diff --git a/src/boards/176.cpp b/src/boards/176.cpp index a0e8e116..37309eb3 100644 --- a/src/boards/176.cpp +++ b/src/boards/176.cpp @@ -24,7 +24,7 @@ extern uint32 ROM_size; static uint8 prg[4], chr, sbw, we_sram; -static uint8 *WRAM=NULL; +static uint8 *WRAM = NULL; static uint32 WRAMSIZE; static SFORMAT StateRegs[]= @@ -135,7 +135,7 @@ static void M176Close(void) { if(WRAM) FCEU_gfree(WRAM); - WRAM=NULL; + WRAM = NULL; } static void StateRestore(int version) diff --git a/src/boards/246.cpp b/src/boards/246.cpp index 726a97ed..2c46acc7 100644 --- a/src/boards/246.cpp +++ b/src/boards/246.cpp @@ -21,7 +21,7 @@ #include "mapinc.h" static uint8 regs[8]; -static uint8 *WRAM=NULL; +static uint8 *WRAM = NULL; static uint32 WRAMSIZE; static SFORMAT StateRegs[] = diff --git a/src/boards/32.cpp b/src/boards/32.cpp index 3d2973c6..0c34402e 100644 --- a/src/boards/32.cpp +++ b/src/boards/32.cpp @@ -22,7 +22,7 @@ static uint8 preg[2], creg[8], mirr; -static uint8 *WRAM=NULL; +static uint8 *WRAM = NULL; static uint32 WRAMSIZE; static SFORMAT StateRegs[] = diff --git a/src/boards/69.cpp b/src/boards/69.cpp index 3f49ceea..389e0458 100644 --- a/src/boards/69.cpp +++ b/src/boards/69.cpp @@ -23,7 +23,7 @@ static uint8 cmdreg, preg[4], creg[8], mirr; static uint8 IRQa; static int32 IRQCount; -static uint8 *WRAM=NULL; +static uint8 *WRAM = NULL; static uint32 WRAMSIZE; static SFORMAT StateRegs[] = diff --git a/src/boards/99.cpp b/src/boards/99.cpp index 0f79d034..caf5cff8 100644 --- a/src/boards/99.cpp +++ b/src/boards/99.cpp @@ -21,7 +21,7 @@ #include "mapinc.h" static uint8 latch; -static uint8 *WRAM=NULL; +static uint8 *WRAM = NULL; static uint32 WRAMSIZE; static writefunc old4016; diff --git a/src/boards/__dummy_mapper.cpp b/src/boards/__dummy_mapper.cpp index c9fa8a96..4a0eadf5 100644 --- a/src/boards/__dummy_mapper.cpp +++ b/src/boards/__dummy_mapper.cpp @@ -24,9 +24,9 @@ static uint8 reg[8]; static uint8 IRQa; static int16 IRQCount, IRQLatch; /* -static uint8 *WRAM=NULL; +static uint8 *WRAM = NULL; static uint32 WRAMSIZE; -static uint8 *CHRRAM=NULL; +static uint8 *CHRRAM = NULL; static uint32 CHRRAMSIZE; */ diff --git a/src/boards/ffe.cpp b/src/boards/ffe.cpp index 0c498ebc..da354114 100644 --- a/src/boards/ffe.cpp +++ b/src/boards/ffe.cpp @@ -26,7 +26,7 @@ static uint8 preg[4], creg[8], latch, ffemode; static uint8 IRQa, mirr; static int32 IRQCount, IRQLatch; -static uint8 *WRAM=NULL; +static uint8 *WRAM = NULL; static uint32 WRAMSIZE; static SFORMAT StateRegs[] = diff --git a/src/boards/mmc2and4.cpp b/src/boards/mmc2and4.cpp index e90fef86..c962df9b 100644 --- a/src/boards/mmc2and4.cpp +++ b/src/boards/mmc2and4.cpp @@ -23,7 +23,7 @@ static uint8 is10; static uint8 creg[4], latch0, latch1, preg, mirr; -static uint8 *WRAM=NULL; +static uint8 *WRAM = NULL; static uint32 WRAMSIZE; static SFORMAT StateRegs[] = diff --git a/src/boards/vrc3.cpp b/src/boards/vrc3.cpp index f07708f1..8369100e 100644 --- a/src/boards/vrc3.cpp +++ b/src/boards/vrc3.cpp @@ -28,7 +28,7 @@ static uint8 IRQx; //autoenable static uint8 IRQm; //mode static uint8 IRQa; static uint16 IRQReload, IRQCount; -static uint8 *WRAM=NULL; +static uint8 *WRAM = NULL; static uint32 WRAMSIZE; static SFORMAT StateRegs[] = diff --git a/src/boards/vrc6.cpp b/src/boards/vrc6.cpp index d5550752..3cad0cc7 100644 --- a/src/boards/vrc6.cpp +++ b/src/boards/vrc6.cpp @@ -26,7 +26,9 @@ static uint8 is26; static uint8 prg[2], chr[8], mirr; static uint8 IRQLatch, IRQa, IRQd; -static uint32 IRQCount, CycleCount; +static int32 IRQCount, CycleCount; +static uint8 *WRAM = NULL; +static uint32 WRAMSIZE; static SFORMAT StateRegs[] = { @@ -42,21 +44,23 @@ static SFORMAT StateRegs[] = }; static void(*sfun[3]) (void); +static uint8 vpsg1[8]; static uint8 vpsg2[4]; -static uint8 vpsg1[4]; static int32 cvbc[3]; static int32 vcount[3]; static int32 dcount[2]; static SFORMAT SStateRegs[] = { - { vpsg1, 4, "PSG1" }, + { vpsg1, 8, "PSG1" }, { vpsg2, 4, "PSG2" }, { 0 } }; static void Sync(void) { uint8 i; + if (is26) + setprg8r(0x10, 0x6000, 0); setprg16(0x8000, prg[0]); setprg8(0xc000, prg[1]); setprg8(0xe000, ~0); @@ -103,14 +107,13 @@ static DECLFW(VRC6Write) { case 0xE001: chr[5] = V; Sync(); break; case 0xE002: chr[6] = V; Sync(); break; case 0xE003: chr[7] = V; Sync(); break; - case 0xF000: IRQLatch = V; break; + case 0xF000: IRQLatch = V; X6502_IRQEnd(FCEU_IQEXT); break; case 0xF001: IRQa = V & 2; IRQd = V & 1; - if (V & 2) { + if (V & 2) IRQCount = IRQLatch; - CycleCount = 0; - } + CycleCount = 0; X6502_IRQEnd(FCEU_IQEXT); break; case 0xF002: @@ -121,26 +124,32 @@ static DECLFW(VRC6Write) { static void VRC6Power(void) { Sync(); - SetReadHandler(0x8000, 0xFFFF, CartBR); + SetReadHandler(0x6000, 0xFFFF, CartBR); + SetWriteHandler(0x6000, 0x7FFF, CartBW); SetWriteHandler(0x8000, 0xFFFF, VRC6Write); } static void VRC6IRQHook(int a) { if (IRQa) { CycleCount += a * 3; - if (CycleCount >= 341) { - while(CycleCount >= 341) { - CycleCount -= 341; - IRQCount++; - if (IRQCount == 0x100) { - X6502_IRQBegin(FCEU_IQEXT); - IRQCount = IRQLatch; - } + while(CycleCount >= 341) { + CycleCount -= 341; + IRQCount++; + if (IRQCount == 0x100) { + IRQCount = IRQLatch; + X6502_IRQBegin(FCEU_IQEXT); } } } } +static void VRC6Close(void) +{ + if (WRAM) + FCEU_gfree(WRAM); + WRAM = NULL; +} + static void StateRestore(int version) { Sync(); } @@ -231,7 +240,7 @@ static void DoSawV(void) { } static INLINE void DoSQVHQ(int x) { - uint32 V; + int32 V; int32 amp = ((vpsg1[x << 2] & 15) << 8) * 6 / 8; if (vpsg1[(x << 2) | 0x2] & 0x80) { @@ -265,7 +274,7 @@ static void DoSQV2HQ(void) { static void DoSawVHQ(void) { static uint8 b3 = 0; static int32 phaseacc = 0; - uint32 V; + int32 V; if (vpsg2[2] & 0x80) { for (V = cvbc[2]; V < SOUNDTS; V++) { @@ -345,9 +354,20 @@ void Mapper24_Init(CartInfo *info) { void Mapper26_Init(CartInfo *info) { is26 = 1; info->Power = VRC6Power; + info->Close = VRC6Close; MapIRQHook = VRC6IRQHook; VRC6_ESI(); GameStateRestore = StateRestore; + + WRAMSIZE = 8192; + WRAM = (uint8*)FCEU_gmalloc(WRAMSIZE); + SetupCartPRGMapping(0x10, WRAM, WRAMSIZE, 1); + AddExState(WRAM, WRAMSIZE, 0, "WRAM"); + if (info->battery) { + info->SaveGame[0] = WRAM; + info->SaveGameLen[0] = WRAMSIZE; + } + AddExState(&StateRegs, ~0, 0, 0); } diff --git a/src/boards/vrc7.cpp b/src/boards/vrc7.cpp index 56e2864a..39154efa 100644 --- a/src/boards/vrc7.cpp +++ b/src/boards/vrc7.cpp @@ -22,8 +22,8 @@ static uint8 vrc7idx, preg[3], creg[8], mirr; static uint8 IRQLatch, IRQa, IRQd; -static uint32 IRQCount, CycleCount; -static uint8 *WRAM=NULL; +static int32 IRQCount, CycleCount; +static uint8 *WRAM = NULL; static uint32 WRAMSIZE; static SFORMAT StateRegs[] = @@ -163,14 +163,12 @@ static void VRC7Close(void) static void VRC7IRQHook(int a) { if (IRQa) { CycleCount += a * 3; - if (CycleCount >= 341) { - while(CycleCount >= 341) { - CycleCount -= 341; - IRQCount++; - if (IRQCount & 0x100) { - IRQCount = IRQLatch; - X6502_IRQBegin(FCEU_IQEXT); - } + while(CycleCount >= 341) { + CycleCount -= 341; + IRQCount++; + if (IRQCount == 0x100) { + IRQCount = IRQLatch; + X6502_IRQBegin(FCEU_IQEXT); } } } diff --git a/src/boards/vrc7p.cpp b/src/boards/vrc7p.cpp index 079a001e..5a886cb0 100644 --- a/src/boards/vrc7p.cpp +++ b/src/boards/vrc7p.cpp @@ -24,7 +24,7 @@ static uint8 prg[3], chr[8], mirr; static uint8 IRQLatch, IRQa, IRQd; -static uint32 IRQCount, CycleCount; +static int32 IRQCount, CycleCount; static SFORMAT StateRegs[] = { @@ -69,10 +69,7 @@ static DECLFW(UNLVRC7Write) { case 0xd000: chr[6] = V; Sync(); break; case 0xd008: chr[7] = V; Sync(); break; case 0xe000: mirr = V; Sync(); break; - case 0xe008: - IRQLatch = V; - X6502_IRQEnd(FCEU_IQEXT); - break; + case 0xe008: IRQLatch = V; X6502_IRQEnd(FCEU_IQEXT); break; case 0xf000: IRQa = V & 2; IRQd = V & 1; @@ -104,8 +101,8 @@ static void UNLVRC7IRQHook(int a) { CycleCount -= 341; IRQCount++; if (IRQCount == 248) { - X6502_IRQBegin(FCEU_IQEXT); IRQCount = IRQLatch; + X6502_IRQBegin(FCEU_IQEXT); } } } diff --git a/src/ines.cpp b/src/ines.cpp index f7c4618e..3a2656f3 100644 --- a/src/ines.cpp +++ b/src/ines.cpp @@ -445,263 +445,263 @@ typedef struct { } BMAPPINGLocal; static BMAPPINGLocal bmap[] = { - {"NROM", 0, NROM_Init}, - {"MMC1", 1, Mapper1_Init}, - {"UNROM", 2, UNROM_Init}, - {"CNROM", 3, CNROM_Init}, - {"MMC3", 4, Mapper4_Init}, - {"MMC5", 5, Mapper5_Init}, - {"FFE", 6, Mapper6_Init}, - {"ANROM", 7, ANROM_Init}, - {"", 8, Mapper8_Init}, // Nogaems, it's worthless - {"MMC2", 9, Mapper9_Init}, - {"MMC4", 10, Mapper10_Init}, - {"Color Dreams", 11, Mapper11_Init}, - {"", 12, Mapper12_Init}, - {"CPROM", 13, CPROM_Init}, -// {"", 14, Mapper14_Init}, - {"100-in-1", 15, Mapper15_Init}, - {"Bandai", 16, Mapper16_Init}, - {"", 17, Mapper17_Init}, - {"JALECO SS880006", 18, Mapper18_Init}, // JF-NNX (EB89018-30007) boards - {"Namcot 106", 19, Mapper19_Init}, -// {"", 20, Mapper20_Init}, - {"Konami VRC2/VRC4 A", 21, Mapper21_Init}, - {"Konami VRC2/VRC4 B", 22, Mapper22_Init}, - {"Konami VRC2/VRC4 C", 23, Mapper23_Init}, - {"Konami VRC6 Rev. A", 24, Mapper24_Init}, - {"Konami VRC2/VRC4 D", 25, Mapper25_Init}, - {"Konami VRC6 Rev. B", 26, Mapper26_Init}, -// {"", 27, Mapper27_Init}, // Deprecated, dupe for VRC2/VRC4 mapper -// {"", 28, Mapper28_Init}, -// {"", 29, Mapper29_Init}, -// {"", 30, Mapper30_Init}, -// {"", 31, Mapper31_Init}, - {"IREM G-101", 32, Mapper32_Init}, - {"TC0190FMC/TC0350FMR", 33, Mapper33_Init}, - {"", 34, Mapper34_Init}, - {"Wario Land 2", 35, UNLSC127_Init}, - {"TXC Policeman", 36, Mapper36_Init}, - {"", 37, Mapper37_Init}, - {"Bit Corp.", 38, Mapper38_Init}, // Crime Busters -// {"", 39, Mapper39_Init}, - {"SMB2j FDS", 40, Mapper40_Init}, - {"CALTRON 6-in-1", 41, Mapper41_Init}, - {"BIO MIRACLE FDS", 42, Mapper42_Init}, - {"", 43, Mapper43_Init}, - {"", 44, Mapper44_Init}, - {"", 45, Mapper45_Init}, - {"RUMBLESTATION 15-in-1",46, Mapper46_Init}, - {"", 47, Mapper47_Init}, - {"TAITO TCxxx", 48, Mapper48_Init}, - {"", 49, Mapper49_Init}, - {"SMB2j FDS REV A", 50, Mapper50_Init}, - {"11-in-1 BALL SERIES", 51, Mapper51_Init}, // 1993 year version - {"", 52, Mapper52_Init}, -// {"", 53, Mapper53_Init}, // iNES version of complex UNIF board, can't emulate properly as iNES -// {"", 54, Mapper54_Init}, -// {"", 55, Mapper55_Init}, -// {"", 56, Mapper56_Init}, - {"", 57, Mapper57_Init}, - {"", 58, BMCGK192_Init}, - {"", 59, Mapper59_Init}, // Check this out - {"", 60, BMCD1038_Init}, - {"20-in-1 KAISER REV A", 61, Mapper61_Init}, - {"700-in-1", 62, Mapper62_Init}, -// {"", 63, Mapper63_Init}, - {"TENGEN RAMBO1", 64, Mapper64_Init}, - {"IREM-H3001", 65, Mapper65_Init}, - {"MHOM", 66, MHROM_Init}, - {"SUNSOFT-FZII", 67, Mapper67_Init}, - {"Sunsoft Mapper #4", 68, Mapper68_Init}, - {"SUNSOFT-5/FME-7", 69, Mapper69_Init}, - {"BA KAMEN DISCRETE", 70, Mapper70_Init}, - {"CAMERICA BF9093", 71, Mapper71_Init}, - {"JALECO JF-17", 72, Mapper72_Init}, - {"KONAMI VRC3", 73, Mapper73_Init}, - {"TW MMC3+VRAM VER. A", 74, Mapper74_Init}, - {"KONAMI VRC1", 75, Mapper75_Init}, - {"NAMCOT 108 VER. A", 76, Mapper76_Init}, - {"IREM LROG017", 77, Mapper77_Init}, - {"Irem 74HC161/32", 78, Mapper78_Init}, - {"AVE/C&E/TXC BOARD", 79, Mapper79_Init}, - {"TAITO X1-005 VER. A", 80, Mapper80_Init}, -// {"", 81, Mapper81_Init}, - {"", 82, Mapper82_Init}, - {"", 83, Mapper83_Init}, -// {"", 84, Mapper84_Init}, - {"KONAMI VRC7", 85, Mapper85_Init}, - {"", 86, Mapper86_Init}, - {"", 87, Mapper87_Init}, - {"", 88, Mapper88_Init}, - {"SUNSOFT-3", 89, Mapper89_Init}, // SUNSOFT-2 mapper - {"", 90, Mapper90_Init}, - {"", 91, Mapper91_Init}, - {"", 92, Mapper92_Init}, - {"SUNSOFT-3R", 93, SUNSOFT_UNROM_Init}, // SUNSOFT-2 mapper with VRAM, different wiring - {"", 94, Mapper94_Init}, - {"NAMCOT 108 VER. B", 95, Mapper95_Init}, - {"", 96, Mapper96_Init}, - {"", 97, Mapper97_Init}, -// {"", 98, Mapper98_Init}, - {"", 99, Mapper99_Init}, -// {"", 100, Mapper100_Init}, - {"", 101, Mapper101_Init}, -// {"", 102, Mapper102_Init}, - {"", 103, Mapper103_Init}, -// {"", 104, Mapper104_Init}, - {"", 105, Mapper105_Init}, - {"", 106, Mapper106_Init}, - {"", 107, Mapper107_Init}, - {"", 108, Mapper108_Init}, -// {"", 109, Mapper109_Init}, -// {"", 110, Mapper110_Init}, -// {"", 111, Mapper111_Init}, - {"", 112, Mapper112_Init}, - {"", 113, Mapper113_Init}, - {"", 114, Mapper114_Init}, - {"", 115, Mapper115_Init}, - {"", 116, UNLSL12_Init}, - {"", 117, Mapper117_Init}, - {"TSKROM", 118, TKSROM_Init}, - {"", 119, Mapper119_Init}, - {"", 120, Mapper120_Init}, - {"", 121, Mapper121_Init}, -// {"", 122, Mapper122_Init}, - {"UNLH2288", 123, UNLH2288_Init}, -// {"", 124, Mapper124_Init}, - {"", 125, LH32_Init}, -// {"", 126, Mapper126_Init}, -// {"", 127, Mapper127_Init}, -// {"", 128, Mapper128_Init}, -// {"", 129, Mapper129_Init}, -// {"", 130, Mapper130_Init}, -// {"", 131, Mapper131_Init}, - {"UNL22211", 132, UNL22211_Init}, - {"SA72008", 133, SA72008_Init}, - {"", 134, Mapper134_Init}, -// {"", 135, Mapper135_Init}, - {"TCU02", 136, TCU02_Init}, - {"S8259D", 137, S8259D_Init}, - {"S8259B", 138, S8259B_Init}, - {"S8259C", 139, S8259C_Init}, - {"", 140, Mapper140_Init}, - {"S8259A", 141, S8259A_Init}, - {"UNLKS7032", 142, UNLKS7032_Init}, - {"TCA01", 143, TCA01_Init}, - {"", 144, Mapper144_Init}, - {"SA72007", 145, SA72007_Init}, - {"SA0161M", 146, SA0161M_Init}, - {"TCU01", 147, TCU01_Init}, - {"SA0037", 148, SA0037_Init}, - {"SA0036", 149, SA0036_Init}, - {"S74LS374N", 150, S74LS374N_Init}, - {"", 151, Mapper151_Init}, - {"", 152, Mapper152_Init}, - {"", 153, Mapper153_Init}, - {"", 154, Mapper154_Init}, - {"", 155, Mapper155_Init}, - {"", 156, Mapper156_Init}, - {"", 157, Mapper157_Init}, -// {"", 158, Mapper158_Init}, -// {"", 159, Mapper159_Init}, - {"SA009", 160, SA009_Init}, -// {"", 161, Mapper161_Init}, - {"", 162, UNLFS304_Init}, - {"", 163, Mapper163_Init}, - {"", 164, Mapper164_Init}, - {"", 165, Mapper165_Init}, - {"SUBOR Rev. A", 166, Mapper166_Init}, - {"SUBOR Rev. B", 167, Mapper167_Init}, - {"", 168, Mapper168_Init}, -// {"", 169, Mapper169_Init}, - {"", 170, Mapper170_Init}, - {"", 171, Mapper171_Init}, - {"", 172, Mapper172_Init}, - {"", 173, Mapper173_Init}, -// {"", 174, Mapper174_Init}, - {"", 175, Mapper175_Init}, - {"BMCFK23C", 176, BMCFK23C_Init}, //zero 26-may-2012 - well, i have some WXN junk games that use 176 for instance ????. i dont know what game uses this BMCFK23C as mapper 176. we'll have to make a note when we find it. - {"", 177, Mapper177_Init}, - {"", 178, Mapper178_Init}, -// {"", 179, Mapper179_Init}, - {"", 180, Mapper180_Init}, - {"", 181, Mapper181_Init}, -// {"", 182, Mapper182_Init}, // Deprecated, dupe - {"", 183, Mapper183_Init}, - {"", 184, Mapper184_Init}, - {"", 185, Mapper185_Init}, - {"", 186, Mapper186_Init}, - {"", 187, Mapper187_Init}, - {"", 188, Mapper188_Init}, - {"", 189, Mapper189_Init}, -// {"", 190, Mapper190_Init}, - {"", 191, Mapper191_Init}, - {"TW MMC3+VRAM VER. B", 192, Mapper192_Init}, - {"NTDEC TC-112", 193, Mapper193_Init}, // War in the Gulf - {"TW MMC3+VRAM VER. C", 194, Mapper194_Init}, - {"TW MMC3+VRAM VER. D", 195, Mapper195_Init}, - {"", 196, Mapper196_Init}, - {"", 197, Mapper197_Init}, - {"TW MMC3+VRAM VER. E", 198, Mapper198_Init}, - {"", 199, Mapper199_Init}, - {"", 200, Mapper200_Init}, - {"", 201, Mapper201_Init}, - {"", 202, Mapper202_Init}, - {"", 203, Mapper203_Init}, - {"", 204, Mapper204_Init}, - {"", 205, Mapper205_Init}, - {"NAMCOT 108 VER. C", 206, Mapper206_Init}, // Deprecated, Used to be "DEIROM" whatever it means, but actually simple version of MMC3 - {"TAITO X1-005 VER. B", 207, Mapper207_Init}, - {"", 208, Mapper208_Init}, - {"", 209, Mapper209_Init}, - {"", 210, Mapper210_Init}, - {"", 211, Mapper211_Init}, - {"", 212, Mapper212_Init}, - {"", 213, Mapper213_Init}, - {"", 214, Mapper214_Init}, - {"", 215, UNL8237_Init}, - {"", 216, Mapper216_Init}, - {"", 217, Mapper217_Init}, // Redefined to a new Discrete BMC mapper -// {"", 218, Mapper218_Init}, - {"UNLA9746", 219, UNLA9746_Init}, - {"Debug Mapper", 220, UNLKS7057_Init}, - {"UNLN625092", 221, UNLN625092_Init}, - {"", 222, Mapper222_Init}, -// {"", 223, Mapper223_Init}, -// {"", 224, Mapper224_Init}, - {"", 225, Mapper225_Init}, - {"BMC 22+20-in-1", 226, Mapper226_Init}, - {"", 227, Mapper227_Init}, - {"", 228, Mapper228_Init}, - {"", 229, Mapper229_Init}, - {"BMC Contra+22-in-1", 230, Mapper230_Init}, - {"", 231, Mapper231_Init}, - {"BMC QUATTRO", 232, Mapper232_Init}, - {"BMC 22+20-in-1 RST", 233, Mapper233_Init}, - {"BMC MAXI", 234, Mapper234_Init}, - {"", 235, Mapper235_Init}, -// {"", 236, Mapper236_Init}, -// {"", 237, Mapper237_Init}, - {"UNL6035052", 238, UNL6035052_Init}, -// {"", 239, Mapper239_Init}, - {"", 240, Mapper240_Init}, - {"", 241, Mapper241_Init}, - {"", 242, Mapper242_Init}, - {"S74LS374NA", 243, S74LS374NA_Init}, - {"DECATHLON", 244, Mapper244_Init}, - {"", 245, Mapper245_Init}, - {"FONG SHEN BANG", 246, Mapper246_Init}, -// {"", 247, Mapper247_Init}, -// {"", 248, Mapper248_Init}, - {"", 249, Mapper249_Init}, - {"", 250, Mapper250_Init}, -// {"", 251, Mapper251_Init}, // No good dumps for this mapper, use UNIF version - {"SAN GUO ZHI PIRATE", 252, Mapper252_Init}, - {"DRAGON BALL PIRATE", 253, Mapper253_Init}, - {"", 254, Mapper254_Init}, -// {"", 255, Mapper255_Init}, // No good dumps for this mapper - {"", 0, NULL} + {"NROM", 0, NROM_Init}, + {"MMC1", 1, Mapper1_Init}, + {"UNROM", 2, UNROM_Init}, + {"CNROM", 3, CNROM_Init}, + {"MMC3", 4, Mapper4_Init}, + {"MMC5", 5, Mapper5_Init}, + {"FFE Rev. A", 6, Mapper6_Init}, + {"ANROM", 7, ANROM_Init}, + {"", 8, Mapper8_Init}, // Nogaems, it's worthless + {"MMC2", 9, Mapper9_Init}, + {"MMC4", 10, Mapper10_Init}, + {"Color Dreams", 11, Mapper11_Init}, + {"REX DBZ 5", 12, Mapper12_Init}, + {"CPROM", 13, CPROM_Init}, +// {"", 14, Mapper14_Init}, + {"100-in-1", 15, Mapper15_Init}, + {"Bandai", 16, Mapper16_Init}, + {"FFE Rev. B", 17, Mapper17_Init}, + {"JALECO SS880006", 18, Mapper18_Init}, // JF-NNX (EB89018-30007) boards + {"Namcot 106", 19, Mapper19_Init}, +// {"", 20, Mapper20_Init}, + {"Konami VRC2/VRC4 A", 21, Mapper21_Init}, + {"Konami VRC2/VRC4 B", 22, Mapper22_Init}, + {"Konami VRC2/VRC4 C", 23, Mapper23_Init}, + {"Konami VRC6 Rev. A", 24, Mapper24_Init}, + {"Konami VRC2/VRC4 D", 25, Mapper25_Init}, + {"Konami VRC6 Rev. B", 26, Mapper26_Init}, +// {"", 27, Mapper27_Init}, // Deprecated, dupe for VRC2/VRC4 mapper +// {"", 28, Mapper28_Init}, +// {"", 29, Mapper29_Init}, +// {"", 30, Mapper30_Init}, +// {"", 31, Mapper31_Init}, + {"IREM G-101", 32, Mapper32_Init}, + {"TC0190FMC/TC0350FMR", 33, Mapper33_Init}, + {"IREM I-IM/BNROM", 34, Mapper34_Init}, + {"Wario Land 2", 35, UNLSC127_Init}, + {"TXC Policeman", 36, Mapper36_Init}, + {"PAL-ZZ SMB/TETRIS/NWC",37, Mapper37_Init}, + {"Bit Corp.", 38, Mapper38_Init}, // Crime Busters +// {"", 39, Mapper39_Init}, + {"SMB2j FDS", 40, Mapper40_Init}, + {"CALTRON 6-in-1", 41, Mapper41_Init}, + {"BIO MIRACLE FDS", 42, Mapper42_Init}, + {"FDS SMB2j LF36", 43, Mapper43_Init}, + {"MMC3 BMC PIRATE A", 44, Mapper44_Init}, + {"MMC3 BMC PIRATE B", 45, Mapper45_Init}, + {"RUMBLESTATION 15-in-1",46, Mapper46_Init}, + {"NES-QJ SSVB/NWC", 47, Mapper47_Init}, + {"TAITO TCxxx", 48, Mapper48_Init}, + {"MMC3 BMC PIRATE C", 49, Mapper49_Init}, + {"SMB2j FDS Rev. A", 50, Mapper50_Init}, + {"11-in-1 BALL SERIES", 51, Mapper51_Init}, // 1993 year version + {"MMC3 BMC PIRATE D", 52, Mapper52_Init}, +// {"", 53, Mapper53_Init}, // iNES version of complex UNIF board, can't emulate properly as iNES +// {"", 54, Mapper54_Init}, +// {"", 55, Mapper55_Init}, +// {"", 56, Mapper56_Init}, + {"SIMBPLE BMC PIRATE A", 57, Mapper57_Init}, + {"SIMBPLE BMC PIRATE B", 58, BMCGK192_Init}, + {"", 59, Mapper59_Init}, // Check this out + {"SIMBPLE BMC PIRATE C", 60, BMCD1038_Init}, + {"20-in-1 KAISER Rev. A",61, Mapper61_Init}, + {"700-in-1", 62, Mapper62_Init}, +// {"", 63, Mapper63_Init}, + {"TENGEN RAMBO1", 64, Mapper64_Init}, + {"IREM-H3001", 65, Mapper65_Init}, + {"MHOM", 66, MHROM_Init}, + {"SUNSOFT-FZII", 67, Mapper67_Init}, + {"Sunsoft Mapper #4", 68, Mapper68_Init}, + {"SUNSOFT-5/FME-7", 69, Mapper69_Init}, + {"BA KAMEN DISCRETE", 70, Mapper70_Init}, + {"CAMERICA BF9093", 71, Mapper71_Init}, + {"JALECO JF-17", 72, Mapper72_Init}, + {"KONAMI VRC3", 73, Mapper73_Init}, + {"TW MMC3+VRAM Rev. A", 74, Mapper74_Init}, + {"KONAMI VRC1", 75, Mapper75_Init}, + {"NAMCOT 108 Rev. A", 76, Mapper76_Init}, + {"IREM LROG017", 77, Mapper77_Init}, + {"Irem 74HC161/32", 78, Mapper78_Init}, + {"AVE/C&E/TXC BOARD", 79, Mapper79_Init}, + {"TAITO X1-005 Rev. A", 80, Mapper80_Init}, +// {"", 81, Mapper81_Init}, + {"TAITO X1-017", 82, Mapper82_Init}, + {"YOKO VRC Rev. B", 83, Mapper83_Init}, +// {"", 84, Mapper84_Init}, + {"KONAMI VRC7", 85, Mapper85_Init}, + {"JALECO JF-13", 86, Mapper86_Init}, + {"74*139/74 DISCRETE", 87, Mapper87_Init}, + {"NAMCO 3433", 88, Mapper88_Init}, + {"SUNSOFT-3", 89, Mapper89_Init}, // SUNSOFT-2 mapper + {"HUMMER/JY BOARD", 90, Mapper90_Init}, + {"EARLY HUMMER/JY BOARD",91, Mapper91_Init}, + {"JALECO JF-19", 92, Mapper92_Init}, + {"SUNSOFT-3R", 93, SUNSOFT_UNROM_Init}, // SUNSOFT-2 mapper with VRAM, different wiring + {"HVC-UN1ROM", 94, Mapper94_Init}, + {"NAMCOT 108 Rev. B", 95, Mapper95_Init}, + {"BANDAI OEKAKIDS", 96, Mapper96_Init}, + {"IREM TAM-S1", 97, Mapper97_Init}, +// {"", 98, Mapper98_Init}, + {"VS Uni/Dual- system", 99, Mapper99_Init}, +// {"", 100, Mapper100_Init}, + {"", 101, Mapper101_Init}, +// {"", 102, Mapper102_Init}, + {"FDS DOKIDOKI FULL", 103, Mapper103_Init}, +// {"", 104, Mapper104_Init}, + {"NES-EVENT NWC1990", 105, Mapper105_Init}, + {"SMB3 PIRATE A", 106, Mapper106_Init}, + {"MAGIC CORP A", 107, Mapper107_Init}, + {"FDS UNROM BOARD", 108, Mapper108_Init}, +// {"", 109, Mapper109_Init}, +// {"", 110, Mapper110_Init}, +// {"", 111, Mapper111_Init}, + {"ASDER/NTDEC BOARD", 112, Mapper112_Init}, + {"HACKER/SACHEN BOARD", 113, Mapper113_Init}, + {"MMC3 SG PROT. A", 114, Mapper114_Init}, + {"MMC3 PIRATE A", 115, Mapper115_Init}, + {"MMC1/MMC3/VRC PIRATE",116, UNLSL12_Init}, + {"FUTURE MEDIA BOARD", 117, Mapper117_Init}, + {"TSKROM", 118, TKSROM_Init}, + {"NES-TQROM", 119, Mapper119_Init}, + {"FDS TOBIDASE", 120, Mapper120_Init}, + {"MMC3 PIRATE PROT. A", 121, Mapper121_Init}, +// {"", 122, Mapper122_Init}, + {"MMC3 PIRATE H2288", 123, UNLH2288_Init}, +// {"", 124, Mapper124_Init}, + {"FDS LH32", 125, LH32_Init}, +// {"", 126, Mapper126_Init}, +// {"", 127, Mapper127_Init}, +// {"", 128, Mapper128_Init}, +// {"", 129, Mapper129_Init}, +// {"", 130, Mapper130_Init}, +// {"", 131, Mapper131_Init}, + {"TXC/MGENIUS 22111", 132, UNL22211_Init}, + {"SA72008", 133, SA72008_Init}, + {"MMC3 BMC PIRATE", 134, Mapper134_Init}, +// {"", 135, Mapper135_Init}, + {"TCU02", 136, TCU02_Init}, + {"S8259D", 137, S8259D_Init}, + {"S8259B", 138, S8259B_Init}, + {"S8259C", 139, S8259C_Init}, + {"JALECO JF-11/14", 140, Mapper140_Init}, + {"S8259A", 141, S8259A_Init}, + {"UNLKS7032", 142, UNLKS7032_Init}, + {"TCA01", 143, TCA01_Init}, + {"AGCI 50282", 144, Mapper144_Init}, + {"SA72007", 145, SA72007_Init}, + {"SA0161M", 146, SA0161M_Init}, + {"TCU01", 147, TCU01_Init}, + {"SA0037", 148, SA0037_Init}, + {"SA0036", 149, SA0036_Init}, + {"S74LS374N", 150, S74LS374N_Init}, + {"", 151, Mapper151_Init}, + {"", 152, Mapper152_Init}, + {"", 153, Mapper153_Init}, + {"", 154, Mapper154_Init}, + {"", 155, Mapper155_Init}, + {"", 156, Mapper156_Init}, + {"", 157, Mapper157_Init}, +// {"", 158, Mapper158_Init}, +// {"", 159, Mapper159_Init}, + {"SA009", 160, SA009_Init}, +// {"", 161, Mapper161_Init}, + {"", 162, UNLFS304_Init}, + {"", 163, Mapper163_Init}, + {"", 164, Mapper164_Init}, + {"", 165, Mapper165_Init}, + {"SUBOR Rev. A", 166, Mapper166_Init}, + {"SUBOR Rev. B", 167, Mapper167_Init}, + {"", 168, Mapper168_Init}, +// {"", 169, Mapper169_Init}, + {"", 170, Mapper170_Init}, + {"", 171, Mapper171_Init}, + {"", 172, Mapper172_Init}, + {"", 173, Mapper173_Init}, +// {"", 174, Mapper174_Init}, + {"", 175, Mapper175_Init}, + {"BMCFK23C", 176, BMCFK23C_Init}, //zero 26-may-2012 - well, i have some WXN junk games that use 176 for instance ????. i dont know what game uses this BMCFK23C as mapper 176. we'll have to make a note when we find it. + {"", 177, Mapper177_Init}, + {"", 178, Mapper178_Init}, +// {"", 179, Mapper179_Init}, + {"", 180, Mapper180_Init}, + {"", 181, Mapper181_Init}, +// {"", 182, Mapper182_Init}, // Deprecated, dupe + {"", 183, Mapper183_Init}, + {"", 184, Mapper184_Init}, + {"", 185, Mapper185_Init}, + {"", 186, Mapper186_Init}, + {"", 187, Mapper187_Init}, + {"", 188, Mapper188_Init}, + {"", 189, Mapper189_Init}, +// {"", 190, Mapper190_Init}, + {"", 191, Mapper191_Init}, + {"TW MMC3+VRAM Rev. B", 192, Mapper192_Init}, + {"NTDEC TC-112", 193, Mapper193_Init}, // War in the Gulf + {"TW MMC3+VRAM Rev. C", 194, Mapper194_Init}, + {"TW MMC3+VRAM Rev. D", 195, Mapper195_Init}, + {"", 196, Mapper196_Init}, + {"", 197, Mapper197_Init}, + {"TW MMC3+VRAM Rev. E", 198, Mapper198_Init}, + {"", 199, Mapper199_Init}, + {"", 200, Mapper200_Init}, + {"", 201, Mapper201_Init}, + {"", 202, Mapper202_Init}, + {"", 203, Mapper203_Init}, + {"", 204, Mapper204_Init}, + {"", 205, Mapper205_Init}, + {"NAMCOT 108 Rev. C", 206, Mapper206_Init}, // Deprecated, Used to be "DEIROM" whatever it means, but actually simple version of MMC3 + {"TAITO X1-005 Rev. B", 207, Mapper207_Init}, + {"", 208, Mapper208_Init}, + {"", 209, Mapper209_Init}, + {"", 210, Mapper210_Init}, + {"", 211, Mapper211_Init}, + {"", 212, Mapper212_Init}, + {"", 213, Mapper213_Init}, + {"", 214, Mapper214_Init}, + {"", 215, UNL8237_Init}, + {"", 216, Mapper216_Init}, + {"", 217, Mapper217_Init}, // Redefined to a new Discrete BMC mapper +// {"", 218, Mapper218_Init}, + {"UNLA9746", 219, UNLA9746_Init}, + {"Debug Mapper", 220, UNLKS7057_Init}, + {"UNLN625092", 221, UNLN625092_Init}, + {"", 222, Mapper222_Init}, +// {"", 223, Mapper223_Init}, +// {"", 224, Mapper224_Init}, + {"", 225, Mapper225_Init}, + {"BMC 22+20-in-1", 226, Mapper226_Init}, + {"", 227, Mapper227_Init}, + {"", 228, Mapper228_Init}, + {"", 229, Mapper229_Init}, + {"BMC Contra+22-in-1", 230, Mapper230_Init}, + {"", 231, Mapper231_Init}, + {"BMC QUATTRO", 232, Mapper232_Init}, + {"BMC 22+20-in-1 RST", 233, Mapper233_Init}, + {"BMC MAXI", 234, Mapper234_Init}, + {"", 235, Mapper235_Init}, +// {"", 236, Mapper236_Init}, +// {"", 237, Mapper237_Init}, + {"UNL6035052", 238, UNL6035052_Init}, +// {"", 239, Mapper239_Init}, + {"", 240, Mapper240_Init}, + {"", 241, Mapper241_Init}, + {"", 242, Mapper242_Init}, + {"S74LS374NA", 243, S74LS374NA_Init}, + {"DECATHLON", 244, Mapper244_Init}, + {"", 245, Mapper245_Init}, + {"FONG SHEN BANG", 246, Mapper246_Init}, +// {"", 247, Mapper247_Init}, +// {"", 248, Mapper248_Init}, + {"", 249, Mapper249_Init}, + {"", 250, Mapper250_Init}, +// {"", 251, Mapper251_Init}, // No good dumps for this mapper, use UNIF version + {"SAN GUO ZHI PIRATE", 252, Mapper252_Init}, + {"DRAGON BALL PIRATE", 253, Mapper253_Init}, + {"", 254, Mapper254_Init}, +// {"", 255, Mapper255_Init}, // No good dumps for this mapper + {"", 0, NULL} }; int iNESLoad(const char *name, FCEUFILE *fp, int OverwriteVidMode) {