mapper087.c
来自「一款游戏机的模拟器」· C语言 代码 · 共 64 行
C
64 行
#include "..\DLL\d_iNES.h"
static struct
{
u8 Latch;
} Mapper;
static void Sync (void)
{
MP->SetPRG_ROM32(0x8,0);
MP->SetCHR_ROM8(0,(Mapper.Latch & 0x02) >> 1);
}
static void __cdecl SaveMI (Ar128 MI)
{
u8 x = 0;
MI[x++] = Mapper.Latch;
}
static void __cdecl LoadMI (const Ar128 MI)
{
u8 x = 0;
Mapper.Latch = MI[x++];
Sync();
}
static void __cdecl Write (int Bank, int Where, int What)
{
Mapper.Latch = What;
Sync();
}
static void __cdecl UnloadMapper (void)
{
iNES_UnloadROM();
}
static void __cdecl InitMapper (const PMapperParam _MP, int IsHardReset)
{
MP = _MP;
iNES_InitROM();
MP->SetWriteHandler(0x6,Write);
MP->SetWriteHandler(0x7,Write);
Mapper.Latch = 0;
Sync();
}
CTMapperInfo MapperInfo_087 =
{
"Mapper 87",
87,
MS_Full,
32768,
InitMapper,
UnloadMapper,
NULL,
NULL,
SaveMI,
LoadMI,
NULL,
NULL
};
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?