mirror of
https://github.com/sylverb/game-and-watch-retro-go.git
synced 2026-01-12 08:29:29 +01:00
Tamalib has been heavily changed to accommodate G&W needs. A "fast forward" option has been added to emulate "always on" mode. The emulator is currently running about 300x speed while fast forwarding. Save & load of emulator state also works. Max age for save states are 48 hours. The emulator will ignore fast forward if state is older and just continue from where it left off. Max volume is 25% as a 100% square wave at even lowest volume setting is way too loud. It also supports start_paused handling. Reload of a tama state will now re-initialize the entire emulator which eases the implementation. This is a deviation from other emulators but my hope is that it makes the code more clear and concise. Bumped all clock counters to 64 bit to avoid wrapping around every 1.5 days. Button handling is: any d-pad = left button, B is middle button and A is right button. In-game icons are taken from tamatool and scaled for G&W use. I have addedd a simple instruction decoding cache using a 4k 'map' to tamalib to increase performance from a 2456 fps base to about 8150 fps (with no gui, and no sound etc.) lcd_clear_active_buffer & lcd_clear_inactive_buffer how returns the cleared buffer
109 lines
3.6 KiB
C
109 lines
3.6 KiB
C
#pragma once
|
|
|
|
#include <stdint.h>
|
|
|
|
extern uint8_t __OFFSAVEFLASH_START__;
|
|
extern uint8_t __OFFSAVEFLASH_END__;
|
|
extern uint8_t __SAVEFLASH_START__;
|
|
extern uint8_t __SAVEFLASH_END__;
|
|
extern uint8_t __CACHEFLASH_START__;
|
|
extern uint8_t __CACHEFLASH_END__;
|
|
extern uint8_t __EXTFLASH_START__;
|
|
extern uint8_t __EXTFLASH_BASE__;
|
|
extern uint32_t __INTFLASH__; // From linker, usually value 0x08000000 for bank 1, or 0x08100000 for bank 2
|
|
|
|
extern uint8_t __NULLPTR_LENGTH__;
|
|
|
|
extern uint8_t _Stack_Redzone_Size;
|
|
extern uint8_t _stack_redzone;
|
|
|
|
extern uint8_t _heap_start;
|
|
extern uint8_t _heap_end;
|
|
|
|
|
|
extern uint32_t _siramdata;
|
|
extern uint32_t __ram_exec_start__;
|
|
extern uint32_t __ram_exec_end__;
|
|
|
|
extern uint32_t _sitcram_hot;
|
|
extern uint32_t __itcram_hot_start__;
|
|
extern uint32_t __itcram_hot_end__;
|
|
extern uint8_t __configflash_start__;
|
|
extern uint8_t __configflash_end__;
|
|
extern uint8_t __cacheflash_start__;
|
|
extern uint8_t __cacheflash_end__;
|
|
extern uint8_t __fbflash_start__;
|
|
extern uint8_t __fbflash_end__;
|
|
|
|
|
|
// If this is not an array the compiler might put in a memory_chk with dest_size 1...
|
|
extern void * __RAM_EMU_START__[];
|
|
extern void * _OVERLAY_NES_LOAD_START[];
|
|
extern uint8_t _OVERLAY_NES_SIZE;
|
|
extern void * _OVERLAY_NES_BSS_START[];
|
|
extern uint8_t _OVERLAY_NES_BSS_SIZE;
|
|
extern void * _OVERLAY_NES_FCEU_LOAD_START[];
|
|
extern uint8_t _OVERLAY_NES_FCEU_SIZE;
|
|
extern void * _OVERLAY_NES_FCEU_BSS_START[];
|
|
extern uint8_t _OVERLAY_NES_FCEU_BSS_SIZE;
|
|
extern void * _OVERLAY_GB_LOAD_START[];
|
|
extern uint8_t _OVERLAY_GB_SIZE;
|
|
extern void * _OVERLAY_GB_BSS_START[];
|
|
extern uint8_t _OVERLAY_GB_BSS_SIZE;
|
|
extern void * _OVERLAY_SMS_LOAD_START[];
|
|
extern uint8_t _OVERLAY_SMS_SIZE;
|
|
extern void * _OVERLAY_SMS_BSS_START[];
|
|
extern uint8_t _OVERLAY_SMS_BSS_SIZE;
|
|
extern void * _OVERLAY_PCE_LOAD_START[];
|
|
extern uint8_t _OVERLAY_PCE_SIZE;
|
|
extern void * _OVERLAY_PCE_BSS_START[];
|
|
extern uint8_t _OVERLAY_PCE_BSS_SIZE;
|
|
extern void * _OVERLAY_GW_LOAD_START[];
|
|
extern uint8_t _OVERLAY_GW_SIZE;
|
|
extern void * _OVERLAY_GW_BSS_START[];
|
|
extern uint8_t _OVERLAY_GW_BSS_SIZE;
|
|
extern void * _OVERLAY_MSX_LOAD_START[];
|
|
extern uint8_t _OVERLAY_MSX_SIZE;
|
|
extern void * _OVERLAY_MSX_BSS_START[];
|
|
extern uint8_t _OVERLAY_MSX_BSS_SIZE;
|
|
extern void * _OVERLAY_WSV_LOAD_START[];
|
|
extern uint8_t _OVERLAY_WSV_SIZE;
|
|
extern void * _OVERLAY_WSV_BSS_START[];
|
|
extern uint8_t _OVERLAY_WSV_BSS_SIZE;
|
|
extern void * _OVERLAY_MD_LOAD_START[];
|
|
extern uint8_t _OVERLAY_MD_SIZE;
|
|
extern void * _OVERLAY_MD_BSS_START[];
|
|
extern uint8_t _OVERLAY_MD_BSS_SIZE;
|
|
extern void * _OVERLAY_A7800_LOAD_START[];
|
|
extern uint8_t _OVERLAY_A7800_SIZE;
|
|
extern void * _OVERLAY_A7800_BSS_START[];
|
|
extern uint8_t _OVERLAY_A7800_BSS_SIZE;
|
|
extern void * _OVERLAY_AMSTRAD_LOAD_START[];
|
|
extern uint8_t _OVERLAY_AMSTRAD_SIZE;
|
|
extern void * _OVERLAY_AMSTRAD_BSS_START[];
|
|
extern uint8_t _OVERLAY_AMSTRAD_BSS_SIZE;
|
|
extern void * _OVERLAY_ZELDA3_LOAD_START[];
|
|
extern uint8_t _OVERLAY_ZELDA3_SIZE;
|
|
extern void * _OVERLAY_ZELDA3_BSS_START[];
|
|
extern uint8_t _OVERLAY_ZELDA3_BSS_SIZE;
|
|
extern void * _OVERLAY_SMW_LOAD_START[];
|
|
extern uint8_t _OVERLAY_SMW_SIZE;
|
|
extern void * _OVERLAY_SMW_BSS_START[];
|
|
extern uint8_t _OVERLAY_SMW_BSS_SIZE;
|
|
extern void * _OVERLAY_TAMA_LOAD_START[];
|
|
extern uint8_t _OVERLAY_TAMA_SIZE;
|
|
extern void * _OVERLAY_TAMA_BSS_START[];
|
|
extern uint8_t _OVERLAY_TAMA_BSS_SIZE;
|
|
|
|
extern uint8_t *_NES_ROM_UNPACK_BUFFER;
|
|
extern uint8_t _NES_ROM_UNPACK_BUFFER_SIZE;
|
|
|
|
extern uint8_t *_NES_FCEU_ROM_UNPACK_BUFFER;
|
|
extern uint8_t _NES_FCEU_ROM_UNPACK_BUFFER_SIZE;
|
|
|
|
extern uint8_t *_GB_ROM_UNPACK_BUFFER;
|
|
extern uint8_t _GB_ROM_UNPACK_BUFFER_SIZE;
|
|
|
|
extern uint8_t *_PCE_ROM_UNPACK_BUFFER;
|
|
extern uint8_t _PCE_ROM_UNPACK_BUFFER_SIZE;
|