From 3d4e91aa40b11bf9915c7e29c104acd8c85594c3 Mon Sep 17 00:00:00 2001 From: Jairinho Date: Thu, 24 Feb 2022 16:01:13 -0300 Subject: [PATCH] defined some constants --- chip8/chip8.go | 6 ++++++ libretro/libretro.go | 10 +++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/chip8/chip8.go b/chip8/chip8.go index 37ee8d7..100627e 100644 --- a/chip8/chip8.go +++ b/chip8/chip8.go @@ -17,6 +17,12 @@ const ( VideoBufferAddress = uint16(0x0F00) ) +const ( + Width = 64 + Height = 32 + FPS = 60 +) + type Emulator struct { V [16]uint8 // general registers I uint16 // address register diff --git a/libretro/libretro.go b/libretro/libretro.go index 0a03dee..de1c52f 100644 --- a/libretro/libretro.go +++ b/libretro/libretro.go @@ -36,12 +36,12 @@ func GetEmulatorInfo(info *C.retro_system_info) { //export GetEmulatorAVInfo func GetEmulatorAVInfo(info *C.retro_system_av_info) { - info.geometry.base_width = 64 - info.geometry.base_height = 32 - info.geometry.max_width = 64 - info.geometry.max_height = 32 + info.geometry.base_width = chip8.Width + info.geometry.base_height = chip8.Height + info.geometry.max_width = chip8.Width + info.geometry.max_height = chip8.Height info.geometry.aspect_ratio = 0.0 - info.timing.fps = 60 + info.timing.fps = chip8.FPS info.timing.sample_rate = 44100 }