⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mapper079.c

📁 一款游戏机的模拟器
💻 C
字号:
#include	"..\DLL\d_iNES.h"

static	struct
{
	PWriteFunc Write4;
	u8 Latch;
}	Mapper;

static	void	Sync (void)
{
	MP->SetCHR_ROM8(0,Mapper.Latch & 0x7);
	MP->SetPRG_ROM32(0x8,(Mapper.Latch & 0x8) >> 3);
}

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)
{
	if (Where & 0x100)
	{
		Mapper.Latch = What;
		Sync();
	}
	if (Bank == 4) Mapper.Write4(Bank,Where,What);
}

static	void	__cdecl	UnloadMapper (void)
{
	iNES_UnloadROM();
}

static	void	__cdecl	InitMapper (const PMapperParam _MP, int IsHardReset)
{
	MP = _MP;
	iNES_InitROM();

	Mapper.Write4 = MP->GetWriteHandler(0x4);

	MP->SetWriteHandler(0x4,Write);
	MP->SetWriteHandler(0x5,Write);

	Mapper.Latch = 0;
	Sync();
}

CTMapperInfo	MapperInfo_079 =
{
	"NINA-03/NINA-06",
	79,
	MS_Full,
	32768,
	InitMapper,
	UnloadMapper,
	NULL,
	NULL,
	SaveMI,
	LoadMI,
	NULL,
	NULL
};

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -