More mapper updates (#607)
* M061: Add CHR-ROM variant. * M227: Make DIP switch change only apply to submapper 1 * M242: Only assume DIP/solder pad read when A0-A7 are zero, corrects ET-187 and Xing-2462. Initialize M227's and M242's DIP switch setting on Hard Reset. * M052: Support CHR-RAM-less variant of submapper 14. * M364: Correct the outer bank register's address mask, for LT-953 multicart. * M047: Supprt larger-sized multicarts using a compatible PCB. Reset to menu. * M360: Add submapper 1. * M221: Rewrite, add submapper 1 variant. * M288: Remove bank masks to allow for already-existing larger cartridges. * M411: Add submappers. * M417: Add submapper 1. * M115: Add multicart functionalities. * M201: Simplify and correct the power-on value. CF-043, mentioned in the source code comment, needs no submapper; just a correct header with Horizontal mirroring. * M200: Correct the power-on value. * M432: Add submappers to distinguish three variants. * Add mapper 412. --------- Co-authored-by: NewRisingSun <8vytz1+dhp372pv94ebg@sharklasers.com>
This commit is contained in:
@@ -25,6 +25,7 @@ static uint8 creg[8];
|
||||
static uint8 nt[4];
|
||||
static uint8 IRQa;
|
||||
static uint16 IRQCount;
|
||||
static uint8 submapper;
|
||||
|
||||
static SFORMAT StateRegs[] = {
|
||||
{ preg, 4, "PREG" },
|
||||
@@ -48,11 +49,18 @@ static void Sync(void) {
|
||||
static DECLFW(M417Write) {
|
||||
switch ((A >> 4) & 7) {
|
||||
case 0: preg[A & 3] = V; Sync(); break;
|
||||
case 1: creg[0 | (A & 3)] = V; Sync(); break;
|
||||
case 1: creg[0 | (A & 3)] = V;
|
||||
if (submapper ==1) nt[A & 3] =V >>7;
|
||||
Sync();
|
||||
break;
|
||||
case 2: creg[4 | (A & 3)] = V; Sync(); break;break;
|
||||
case 3: IRQCount = 0; IRQa = 1; break;
|
||||
case 4: IRQa = 0; X6502_IRQEnd(FCEU_IQEXT); break;
|
||||
case 5: nt[A & 3] = V; Sync(); break;
|
||||
case 5: if (submapper ==0) {
|
||||
nt[A & 3] = V;
|
||||
Sync();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,7 +72,7 @@ static void M417Power(void) {
|
||||
|
||||
static void M417IRQHook(int a) {
|
||||
IRQCount += a;
|
||||
if (IRQa && IRQCount > 1024)
|
||||
if (IRQa && IRQCount > (submapper ==1? 4096: 1024))
|
||||
X6502_IRQBegin(FCEU_IQEXT);
|
||||
}
|
||||
|
||||
@@ -73,8 +81,9 @@ static void StateRestore(int version) {
|
||||
}
|
||||
|
||||
void Mapper417_Init(CartInfo *info) {
|
||||
submapper =info->submapper;
|
||||
info->Power = M417Power;
|
||||
MapIRQHook = M417IRQHook;
|
||||
MapIRQHook = M417IRQHook;
|
||||
GameStateRestore = StateRestore;
|
||||
AddExState(&StateRegs, ~0, 0, 0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user