couple of mapper fixes (#482)

* Fix a couple of mapper issues

- Implement info->Close, to free any unallocated memory (e.g. WRAM)
- Add missing GameStateRestore function
- Add missing state variable

* Simplify header parsing

* Update ines-correct.h

Co-authored-by: negativeExponent <negativeExponent@users.noreply.github.com>
This commit is contained in:
negativeExponent
2022-01-24 02:20:46 +08:00
committed by GitHub
parent eb06d17e79
commit 758a51eacb
9 changed files with 157 additions and 61 deletions

View File

@@ -409,6 +409,13 @@ static void JYASIC_reset (void)
dipSwitch = (dipSwitch +0x40) &0xC0;
}
static void JYASIC_close (void)
{
if (WRAM)
FCEU_gfree(WRAM);
WRAM = NULL;
}
static void JYASIC_restore (int version)
{
sync();
@@ -418,6 +425,7 @@ void JYASIC_init (CartInfo *info)
{
info->Reset = JYASIC_reset;
info->Power = JYASIC_power;
info->Close = JYASIC_close;
PPU_hook = trapPPUAddressChange;
MapIRQHook = cpuCycle;
GameHBIRQHook2 = ppuScanline;