mappers to board conversion

This commit is contained in:
CaH4e3 2012-10-25 10:31:30 +00:00
parent a679f48a05
commit eb38da8381
19 changed files with 929 additions and 1416 deletions

View File

@ -22,156 +22,173 @@
static uint16 latche, latcheinit;
static uint16 addrreg0, addrreg1;
static uint8 dipswitch;
static void (*WSync)(void);
static readfunc defread;
static uint8 *WRAM = NULL;
static uint32 WRAMSIZE;
static DECLFW(LatchWrite)
{
// FCEU_printf("%04x:%02x\n",A,V);
static DECLFW(LatchWrite) {
latche = A;
WSync();
}
static void LatchReset(void)
{
static void LatchReset(void) {
latche = latcheinit;
WSync();
}
static void LatchPower(void)
{
static void LatchPower(void) {
latche = latcheinit;
WSync();
if (WRAM) {
SetReadHandler(0x6000, 0x7FFF, CartBR);
SetWriteHandler(0x6000, 0x7FFF, CartBW);
}
SetReadHandler(0x8000, 0xFFFF, defread);
SetWriteHandler(addrreg0, addrreg1, LatchWrite);
}
static void StateRestore(int version)
{
static void LatchClose(void) {
if (WRAM)
FCEU_gfree(WRAM);
WRAM = NULL;
}
static void StateRestore(int version) {
WSync();
}
static void Latch_Init(CartInfo *info, void (*proc)(void), readfunc func, uint16 init, uint16 adr0, uint16 adr1)
{
latcheinit=init;
static void Latch_Init(CartInfo *info, void (*proc)(void), readfunc func, uint16 linit, uint16 adr0, uint16 adr1, uint8 wram) {
latcheinit = linit;
addrreg0 = adr0;
addrreg1 = adr1;
WSync = proc;
if(func)
if (func != NULL)
defread = func;
else
defread = CartBR;
info->Power = LatchPower;
info->Reset = LatchReset;
info->Close = LatchClose;
if (wram) {
WRAMSIZE = 8192;
WRAM = (uint8*)FCEU_gmalloc(WRAMSIZE);
SetupCartPRGMapping(0x10, WRAM, WRAMSIZE, 1);
if (info->battery) {
info->SaveGame[0] = WRAM;
info->SaveGameLen[0] = WRAMSIZE;
}
AddExState(WRAM, WRAMSIZE, 0, "WRAM");
}
GameStateRestore = StateRestore;
AddExState(&latche, 2, 0, "LATC");
}
//------------------ UNLCC21 ---------------------------
static void UNLCC21Sync(void)
{
static void UNLCC21Sync(void) {
setprg32(0x8000, 0);
setchr8(latche & 1);
setmirror(MI_0 + ((latche & 2) >> 1));
}
void UNLCC21_Init(CartInfo *info)
{
Latch_Init(info, UNLCC21Sync, 0, 0, 0x8000, 0xFFFF);
void UNLCC21_Init(CartInfo *info) {
Latch_Init(info, UNLCC21Sync, NULL, 0x0000, 0x8000, 0xFFFF, 0);
}
//------------------ BMCD1038 ---------------------------
static uint8 dipswitch;
static void BMCD1038Sync(void)
{
if(latche&0x80)
{
static void BMCD1038Sync(void) {
if (latche & 0x80) {
setprg16(0x8000, (latche & 0x70) >> 4);
setprg16(0xC000, (latche & 0x70) >> 4);
}
else
}else
setprg32(0x8000, (latche & 0x60) >> 5);
setchr8(latche & 7);
setmirror(((latche & 8) >> 3) ^ 1);
}
static DECLFR(BMCD1038Read)
{
static DECLFR(BMCD1038Read) {
if (latche & 0x100)
return dipswitch;
else
return CartBR(A);
}
static void BMCD1038Reset(void)
{
static void BMCD1038Reset(void) {
dipswitch++;
dipswitch &= 3;
}
void BMCD1038_Init(CartInfo *info)
{
Latch_Init(info, BMCD1038Sync, BMCD1038Read, 0, 0x8000, 0xFFFF);
void BMCD1038_Init(CartInfo *info) {
Latch_Init(info, BMCD1038Sync, BMCD1038Read, 0x0000, 0x8000, 0xFFFF, 0);
info->Reset = BMCD1038Reset;
AddExState(&dipswitch, 1, 0, "DIPSW");
}
//------------------ UNL43272 ---------------------------
// mapper much complex, including 16K bankswitching
static void UNL43272Sync(void)
{
if((latche&0x81) == 0x81)
{
static void UNL43272Sync(void) {
if ((latche & 0x81) == 0x81) {
setprg32(0x8000, (latche & 0x38) >> 3);
}
else
}else
FCEU_printf("unrecognized command %04!\n", latche);
setchr8(0);
setmirror(0);
}
static DECLFR(UNL43272Read)
{
static DECLFR(UNL43272Read) {
if (latche & 0x400)
return CartBR(A & 0xFE);
else
return CartBR(A);
}
static void UNL43272Reset(void)
{
static void UNL43272Reset(void) {
latche = 0;
UNL43272Sync();
}
void UNL43272_Init(CartInfo *info)
{
Latch_Init(info, UNL43272Sync, UNL43272Read, 0x81, 0x8000, 0xFFFF);
void UNL43272_Init(CartInfo *info) {
Latch_Init(info, UNL43272Sync, UNL43272Read, 0x0081, 0x8000, 0xFFFF, 0);
info->Reset = UNL43272Reset;
AddExState(&dipswitch, 1, 0, "DIPSW");
}
//------------------ Map 058 ---------------------------
static void BMCGK192Sync(void)
{
if(latche&0x40)
{
static void BMCGK192Sync(void) {
if (latche & 0x40) {
setprg16(0x8000, latche & 7);
setprg16(0xC000, latche & 7);
}
else
}else
setprg32(0x8000, (latche >> 1) & 3);
setchr8((latche >> 3) & 7);
setmirror(((latche & 0x80) >> 7) ^ 1);
}
void BMCGK192_Init(CartInfo *info)
{
Latch_Init(info, BMCGK192Sync, 0, 0, 0x8000, 0xFFFF);
void BMCGK192_Init(CartInfo *info) {
Latch_Init(info, BMCGK192Sync, NULL, 0x0000, 0x8000, 0xFFFF, 0);
}
//------------------ Map 059 ---------------------------
// One more forbidden mapper
static void M59Sync(void) {
setprg32(0x8000, (latche >> 4) & 7);
setchr8(latche & 0x7);
setmirror((latche >> 3) & 1);
}
static DECLFR(M59Read) {
if (latche & 0x100)
return 0;
else
return CartBR(A);
}
void Mapper59_Init(CartInfo *info) {
Latch_Init(info, M59Sync, M59Read, 0x0000, 0x8000, 0xFFFF, 0);
}
//------------------ Map 092 ---------------------------
@ -180,73 +197,234 @@ void BMCGK192_Init(CartInfo *info)
// Original code provided by LULU
// Additionally, PCB contains DSP extra sound chip, used for voice samples (unemulated)
static void M92Sync(void)
{
static void M92Sync(void) {
uint8 reg = latche & 0xF0;
setprg16(0x8000, 0);
if(latche>=0x9000)
{
switch (reg)
{
if (latche >= 0x9000) {
switch (reg) {
case 0xD0: setprg16(0xc000, latche & 15); break;
case 0xE0: setchr8(latche & 15); break;
}
}
else
{
switch (reg)
{
}else {
switch (reg) {
case 0xB0: setprg16(0xc000, latche & 15); break;
case 0x70: setchr8(latche & 15); break;
}
}
}
void Mapper92_Init(CartInfo *info)
{
Latch_Init(info, M92Sync, 0, 0x80B0, 0x8000, 0xFFFF);
void Mapper92_Init(CartInfo *info) {
Latch_Init(info, M92Sync, NULL, 0x80B0, 0x8000, 0xFFFF, 0);
}
//------------------ Map 200 ---------------------------
static void M200Sync(void)
{
// FCEU_printf("A\n");
static void M200Sync(void) {
setprg16(0x8000, latche & 7);
setprg16(0xC000, latche & 7);
setchr8(latche & 7);
setmirror((latche & 8) >> 3);
}
void Mapper200_Init(CartInfo *info)
{
Latch_Init(info, M200Sync, 0, 0xff, 0x8000, 0xFFFF);
void Mapper200_Init(CartInfo *info) {
Latch_Init(info, M200Sync, NULL, 0xFFFF, 0x8000, 0xFFFF, 0);
}
//------------------ Map 201 ---------------------------
static void M201Sync(void) {
if(latche & 8) {
setprg32(0x8000, latche & 3);
setchr8(latche & 3);
} else {
setprg32(0x8000, 0);
setchr8(0);
}
}
void Mapper201_Init(CartInfo *info) {
Latch_Init(info, M201Sync, NULL, 0xFFFF, 0x8000, 0xFFFF, 0);
}
//------------------ Map 202 ---------------------------
static void M202Sync(void) {
int32 tmp = (latche >> 1) & 0x7;
setmirror((latche & 1)^1);
setprg16(0x8000, tmp);
setprg16(0xc000, tmp + (((tmp & 0x6) == 0x6) ? 1 : 0));
setchr8(tmp);
}
void Mapper202_Init(CartInfo *info) {
Latch_Init(info, M202Sync, NULL, 0x0000, 0x8000, 0xFFFF, 0);
}
//------------------ Map 204 ---------------------------
static void M204Sync(void) {
int32 tmp2 = latche & 0x6;
int32 tmp1 = tmp2 + ((tmp2 == 0x6) ? 0 : (latche & 1));
setprg16(0x8000, tmp1);
setprg16(0xc000, tmp2 + ((tmp2 == 0x6) ? 1 : (latche & 1)));
setchr8(tmp1);
setmirror(((latche >> 4) & 1) ^ 1);
}
void Mapper204_Init(CartInfo *info) {
Latch_Init(info, M204Sync, NULL, 0xFFFF, 0x8000, 0xFFFF, 0);
}
//------------------ Map 212 ---------------------------
static void M212Sync(void) {
if(latche & 0x4000) {
setprg32(0x8000, (latche >> 1) & 3);
} else {
setprg16(0x8000, latche & 7);
setprg16(0xC000, latche & 7);
}
setchr8(latche & 7);
setmirror(((latche >> 3) & 1)^1);
}
void Mapper212_Init(CartInfo *info) {
Latch_Init(info, M212Sync, NULL, 0xFFFF, 0x8000, 0xFFFF, 0);
}
//------------------ Map 213 ---------------------------
static void M213Sync(void) {
setprg32(0x8000, (latche >> 1) & 3);
setchr8((latche >> 3) & 7);
}
void Mapper213_Init(CartInfo *info) {
Latch_Init(info, M213Sync, NULL, 0x0000, 0x8000, 0xFFFF, 0);
}
//------------------ Map 214 ---------------------------
static void M214Sync(void) {
setprg16(0x8000, (latche >> 2) & 3);
setprg16(0xC000, (latche >> 2) & 3);
setchr8(latche & 3);
}
void Mapper214_Init(CartInfo *info) {
Latch_Init(info, M214Sync, NULL, 0x0000, 0x8000, 0xFFFF, 0);
}
//------------------ Map 227 ---------------------------
static void M227Sync(void) {
uint32 S = latche & 1;
uint32 p = ((latche >> 2) & 0x1F) + ((latche & 0x100) >> 3);
uint32 L = (latche >> 9) & 1;
if ((latche >> 7) & 1) {
if (S) {
setprg32(0x8000, p >> 1);
} else {
setprg16(0x8000, p);
setprg16(0xC000, p);
}
} else {
if (S) {
if (L) {
setprg16(0x8000, p & 0x3E);
setprg16(0xC000, p | 7);
} else {
setprg16(0x8000, p & 0x3E);
setprg16(0xC000, p & 0x38);
}
} else {
if (L) {
setprg16(0x8000, p);
setprg16(0xC000, p | 7);
} else {
setprg16(0x8000, p);
setprg16(0xC000, p & 0x38);
}
}
}
setmirror(((latche >> 1) & 1)^1);
setchr8(0);
setprg8r(0x10, 0x6000, 0);
}
void Mapper227_Init(CartInfo *info) {
Latch_Init(info, M227Sync, NULL, 0x0000, 0x8000, 0xFFFF, 1);
}
//------------------ Map 229 ---------------------------
static void M229Sync(void) {
setchr8(latche);
if(!(latche & 0x1e))
setprg32(0x8000, 0);
else {
setprg16(0x8000, latche & 0x1F);
setprg16(0xC000, latche & 0x1F);
}
setmirror(((latche >> 5) & 1)^1);
}
void Mapper229_Init(CartInfo *info) {
Latch_Init(info, M229Sync, NULL, 0x0000, 0x8000, 0xFFFF, 0);
}
//------------------ Map 231 ---------------------------
static void M231Sync(void) {
setchr8(0);
if(latche & 0x20)
setprg32(0x8000, (latche >> 1) & 0x0F);
else {
setprg16(0x8000, latche & 0x1E);
setprg16(0xC000, latche & 0x1E);
}
setmirror(((latche >> 7) & 1)^1);
}
void Mapper231_Init(CartInfo *info) {
Latch_Init(info, M231Sync, NULL, 0x0000, 0x8000, 0xFFFF, 0);
}
//------------------ Map 242 ---------------------------
static void M242Sync(void) {
setchr8(0);
setprg8r(0x10, 0x6000, 0);
setprg32(0x8000, (latche >> 3) & 0xf);
setmirror(((latche >> 1) & 1) ^ 1);
}
void Mapper242_Init(CartInfo *info) {
Latch_Init(info, M242Sync, NULL, 0x0000, 0x8000, 0xFFFF, 1);
}
//------------------ 190in1 ---------------------------
static void BMC190in1Sync(void)
{
static void BMC190in1Sync(void) {
setprg16(0x8000, (latche >> 2) & 0x07);
setprg16(0xC000, (latche >> 2) & 0x07);
setchr8((latche >> 2) & 0x07);
setmirror((latche & 1) ^ 1);
}
void BMC190in1_Init(CartInfo *info)
{
Latch_Init(info, BMC190in1Sync, 0, 0, 0x8000, 0xFFFF);
void BMC190in1_Init(CartInfo *info) {
Latch_Init(info, BMC190in1Sync, NULL, 0x0000, 0x8000, 0xFFFF, 0);
}
//-------------- BMC810544-C-A1 ------------------------
static void BMC810544CA1Sync(void)
{
static void BMC810544CA1Sync(void) {
uint32 bank = latche >> 7;
if (latche & 0x40)
setprg32(0x8000, bank);
else
{
else{
setprg16(0x8000, (bank << 1) | ((latche >> 5) & 1));
setprg16(0xC000, (bank << 1) | ((latche >> 5) & 1));
}
@ -254,33 +432,28 @@ static void BMC810544CA1Sync(void)
setmirror(((latche >> 4) & 1) ^ 1);
}
void BMC810544CA1_Init(CartInfo *info)
{
Latch_Init(info, BMC810544CA1Sync, 0, 0, 0x8000, 0xFFFF);
void BMC810544CA1_Init(CartInfo *info) {
Latch_Init(info, BMC810544CA1Sync, NULL, 0x0000, 0x8000, 0xFFFF, 0);
}
//-------------- BMCNTD-03 ------------------------
static void BMCNTD03Sync(void)
{
static void BMCNTD03Sync(void) {
// 1PPP Pmcc spxx xccc
// 1000 0000 0000 0000 v
// 1001 1100 0000 0100 h
// 1011 1010 1100 0100
uint32 prg = ((latche >> 10) & 0x1e);
uint32 chr = ((latche & 0x0300) >> 5) | (latche & 7);
if(latche&0x80)
{
if (latche & 0x80) {
setprg16(0x8000, prg | ((latche >> 6) & 1));
setprg16(0xC000, prg | ((latche >> 6) & 1));
}
else
}else
setprg32(0x8000, prg >> 1);
setchr8(chr);
setmirror(((latche >> 10) & 1) ^ 1);
}
void BMCNTD03_Init(CartInfo *info)
{
Latch_Init(info, BMCNTD03Sync, 0, 0, 0x8000, 0xFFFF);
void BMCNTD03_Init(CartInfo *info) {
Latch_Init(info, BMCNTD03Sync, NULL, 0x0000, 0x8000, 0xFFFF, 0);
}

View File

@ -27,8 +27,7 @@ static uint8 *WRAM=NULL;
static uint32 WRAMSIZE;
static void (*WSync)(void);
static DECLFW(LatchWrite)
{
static DECLFW(LatchWrite) {
// FCEU_printf("bs %04x %02x\n",A,V);
if (bus_conflict)
latche = V & CartBR(A);
@ -37,36 +36,29 @@ static DECLFW(LatchWrite)
WSync();
}
static void LatchPower(void)
{
static void LatchPower(void) {
latche = latcheinit;
WSync();
if(WRAM)
{
if (WRAM) {
SetReadHandler(0x6000, 0xFFFF, CartBR);
SetWriteHandler(0x6000, 0x7FFF, CartBW);
}
else
{
}else {
SetReadHandler(0x8000, 0xFFFF, CartBR);
}
SetWriteHandler(addrreg0, addrreg1, LatchWrite);
}
static void LatchClose(void)
{
static void LatchClose(void) {
if (WRAM)
FCEU_gfree(WRAM);
WRAM = NULL;
}
static void StateRestore(int version)
{
static void StateRestore(int version) {
WSync();
}
static void Latch_Init(CartInfo *info, void (*proc)(void), uint8 init, uint16 adr0, uint16 adr1, uint8 wram, uint8 busc)
{
static void Latch_Init(CartInfo *info, void (*proc)(void), uint8 init, uint16 adr0, uint16 adr1, uint8 wram, uint8 busc) {
bus_conflict = busc;
latcheinit = init;
addrreg0 = adr0;
@ -75,13 +67,11 @@ static void Latch_Init(CartInfo *info, void (*proc)(void), uint8 init, uint16 ad
info->Power = LatchPower;
info->Close = LatchClose;
GameStateRestore = StateRestore;
if(wram)
{
if (wram) {
WRAMSIZE = 8192;
WRAM = (uint8*)FCEU_gmalloc(WRAMSIZE);
SetupCartPRGMapping(0x10, WRAM, WRAMSIZE, 1);
if(info->battery)
{
if (info->battery) {
info->SaveGame[0] = WRAM;
info->SaveGameLen[0] = WRAMSIZE;
}
@ -94,15 +84,13 @@ static void Latch_Init(CartInfo *info, void (*proc)(void), uint8 init, uint16 ad
//------------------ Map 0 ---------------------------
#ifdef DEBUG_MAPPER
static DECLFW(NROMWrite)
{
static DECLFW(NROMWrite) {
FCEU_printf("bs %04x %02x\n", A, V);
CartBW(A, V);
}
#endif
static void NROMPower(void)
{
static void NROMPower(void) {
setprg8r(0x10, 0x6000, 0); // Famili BASIC (v3.0) need it (uses only 4KB), FP-BASIC uses 8KB
setprg16(0x8000, 0);
setprg16(0xC000, ~0);
@ -117,16 +105,14 @@ static void NROMPower(void)
#endif
}
void NROM_Init(CartInfo *info)
{
void NROM_Init(CartInfo *info) {
info->Power = NROMPower;
info->Close = LatchClose;
WRAMSIZE = 8192;
WRAM = (uint8*)FCEU_gmalloc(WRAMSIZE);
SetupCartPRGMapping(0x10, WRAM, WRAMSIZE, 1);
if(info->battery)
{
if (info->battery) {
info->SaveGame[0] = WRAM;
info->SaveGameLen[0] = WRAMSIZE;
}
@ -135,11 +121,9 @@ void NROM_Init(CartInfo *info)
//------------------ Map 2 ---------------------------
static void UNROMSync(void)
{
static void UNROMSync(void) {
static uint32 mirror_in_use = 0;
if(PRGsize[0] <= 128 * 1024)
{
if (PRGsize[0] <= 128 * 1024) {
setprg16(0x8000, latche & 0x7);
if (latche & 8) mirror_in_use = 1;
if (mirror_in_use)
@ -150,231 +134,198 @@ static void UNROMSync(void)
setchr8(0);
}
void UNROM_Init(CartInfo *info)
{
void UNROM_Init(CartInfo *info) {
Latch_Init(info, UNROMSync, 0, 0x8000, 0xFFFF, 0, 1);
}
//------------------ Map 3 ---------------------------
static void CNROMSync(void)
{
static void CNROMSync(void) {
setchr8(latche);
setprg32(0x8000, 0);
setprg8r(0x10, 0x6000, 0); // Hayauchy IGO uses 2Kb or RAM
}
void CNROM_Init(CartInfo *info)
{
void CNROM_Init(CartInfo *info) {
Latch_Init(info, CNROMSync, 0, 0x8000, 0xFFFF, 1, 1);
}
//------------------ Map 7 ---------------------------
static void ANROMSync()
{
static void ANROMSync() {
setprg32(0x8000, latche & 0xf);
setmirror(MI_0 + ((latche >> 4) & 1));
setchr8(0);
}
void ANROM_Init(CartInfo *info)
{
void ANROM_Init(CartInfo *info) {
Latch_Init(info, ANROMSync, 0, 0x8000, 0xFFFF, 0, 0);
}
//------------------ Map 8 ---------------------------
static void M8Sync()
{
static void M8Sync() {
setprg16(0x8000, latche >> 3);
setprg16(0xc000, 1);
setchr8(latche & 3);
}
void Mapper8_Init(CartInfo *info)
{
void Mapper8_Init(CartInfo *info) {
Latch_Init(info, M8Sync, 0, 0x8000, 0xFFFF, 0, 0);
}
//------------------ Map 11 ---------------------------
static void M11Sync(void)
{
static void M11Sync(void) {
setprg32(0x8000, latche & 0xf);
setchr8(latche >> 4);
}
void Mapper11_Init(CartInfo *info)
{
void Mapper11_Init(CartInfo *info) {
Latch_Init(info, M11Sync, 0, 0x8000, 0xFFFF, 0, 0);
}
void Mapper144_Init(CartInfo *info)
{
void Mapper144_Init(CartInfo *info) {
Latch_Init(info, M11Sync, 0, 0x8001, 0xFFFF, 0, 0);
}
//------------------ Map 13 ---------------------------
static void CPROMSync(void)
{
static void CPROMSync(void) {
setchr4(0x0000, 0);
setchr4(0x1000, latche & 3);
setprg32(0x8000, 0);
}
void CPROM_Init(CartInfo *info)
{
void CPROM_Init(CartInfo *info) {
Latch_Init(info, CPROMSync, 0, 0x8000, 0xFFFF, 0, 0);
}
//------------------ Map 36 ---------------------------
static void M36Sync(void)
{
static void M36Sync(void) {
setprg32(0x8000, latche >> 4);
setchr8((latche) & 0xF);
}
void Mapper36_Init(CartInfo *info)
{
void Mapper36_Init(CartInfo *info) {
Latch_Init(info, M36Sync, 0, 0x8400, 0xfffe, 0, 0);
}
//------------------ Map 38 ---------------------------
static void M38Sync(void)
{
static void M38Sync(void) {
setprg32(0x8000, latche & 3);
setchr8(latche >> 2);
}
void Mapper38_Init(CartInfo *info)
{
void Mapper38_Init(CartInfo *info) {
Latch_Init(info, M38Sync, 0, 0x7000, 0x7FFF, 0, 0);
}
//------------------ Map 66 ---------------------------
static void MHROMSync(void)
{
static void MHROMSync(void) {
setprg32(0x8000, latche >> 4);
setchr8(latche & 0xf);
}
void MHROM_Init(CartInfo *info)
{
void MHROM_Init(CartInfo *info) {
Latch_Init(info, MHROMSync, 0, 0x8000, 0xFFFF, 0, 0);
}
//------------------ Map 70 ---------------------------
static void M70Sync()
{
static void M70Sync() {
setprg16(0x8000, latche >> 4);
setprg16(0xc000, ~0);
setchr8(latche & 0xf);
}
void Mapper70_Init(CartInfo *info)
{
void Mapper70_Init(CartInfo *info) {
Latch_Init(info, M70Sync, 0, 0x8000, 0xFFFF, 0, 0);
}
//------------------ Map 78 ---------------------------
/* Should be two separate emulation functions for this "mapper". Sigh. URGE TO KILL RISING. */
static void M78Sync()
{
static void M78Sync() {
setprg16(0x8000, (latche & 7));
setprg16(0xc000, ~0);
setchr8(latche >> 4);
setmirror(MI_0 + ((latche >> 3) & 1));
}
void Mapper78_Init(CartInfo *info)
{
void Mapper78_Init(CartInfo *info) {
Latch_Init(info, M78Sync, 0, 0x8000, 0xFFFF, 0, 0);
}
//------------------ Map 86 ---------------------------
static void M86Sync(void)
{
static void M86Sync(void) {
setprg32(0x8000, (latche >> 4) & 3);
setchr8((latche & 3) | ((latche >> 4) & 4));
}
void Mapper86_Init(CartInfo *info)
{
void Mapper86_Init(CartInfo *info) {
Latch_Init(info, M86Sync, ~0, 0x6000, 0x6FFF, 0, 0);
}
//------------------ Map 87 ---------------------------
static void M87Sync(void)
{
static void M87Sync(void) {
setprg32(0x8000, 0);
setchr8(((latche >> 1) & 1) | ((latche << 1) & 2));
}
void Mapper87_Init(CartInfo *info)
{
void Mapper87_Init(CartInfo *info) {
Latch_Init(info, M87Sync, ~0, 0x6000, 0xFFFF, 0, 0);
}
//------------------ Map 89 ---------------------------
static void M89Sync(void)
{
static void M89Sync(void) {
setprg16(0x8000, (latche >> 4) & 7);
setprg16(0xc000, ~0);
setchr8((latche & 7) | ((latche >> 4) & 8));
setmirror(MI_0 + ((latche >> 3) & 1));
}
void Mapper89_Init(CartInfo *info)
{
void Mapper89_Init(CartInfo *info) {
Latch_Init(info, M89Sync, 0, 0x8000, 0xFFFF, 0, 0);
}
//------------------ Map 93 ---------------------------
static void SSUNROMSync(void)
{
static void SSUNROMSync(void) {
setprg16(0x8000, latche >> 4);
setprg16(0xc000, ~0);
setchr8(0);
}
void SUNSOFT_UNROM_Init(CartInfo *info)
{
void SUNSOFT_UNROM_Init(CartInfo *info) {
Latch_Init(info, SSUNROMSync, 0, 0x8000, 0xFFFF, 0, 0);
}
//------------------ Map 94 ---------------------------
static void M94Sync(void)
{
static void M94Sync(void) {
setprg16(0x8000, latche >> 2);
setprg16(0xc000, ~0);
setchr8(0);
}
void Mapper94_Init(CartInfo *info)
{
void Mapper94_Init(CartInfo *info) {
Latch_Init(info, M94Sync, 0, 0x8000, 0xFFFF, 0, 0);
}
//------------------ Map 97 ---------------------------
static void M97Sync(void)
{
static void M97Sync(void) {
setchr8(0);
setprg16(0x8000, ~0);
setprg16(0xc000, latche & 15);
switch(latche >> 6)
{
switch (latche >> 6) {
case 0: break;
case 1: setmirror(MI_H); break;
case 2: setmirror(MI_V); break;
@ -383,107 +334,123 @@ static void M97Sync(void)
setchr8(((latche >> 1) & 1) | ((latche << 1) & 2));
}
void Mapper97_Init(CartInfo *info)
{
void Mapper97_Init(CartInfo *info) {
Latch_Init(info, M97Sync, ~0, 0x8000, 0xFFFF, 0, 0);
}
//------------------ Map 101 ---------------------------
static void M101Sync(void)
{
static void M101Sync(void) {
setprg32(0x8000, 0);
setchr8(latche);
}
void Mapper101_Init(CartInfo *info)
{
void Mapper101_Init(CartInfo *info) {
Latch_Init(info, M101Sync, ~0, 0x6000, 0x7FFF, 0, 0);
}
//------------------ Map 107 ---------------------------
static void M107Sync(void)
{
static void M107Sync(void) {
setprg32(0x8000, (latche >> 1) & 3);
setchr8(latche & 7);
}
void Mapper107_Init(CartInfo *info)
{
void Mapper107_Init(CartInfo *info) {
Latch_Init(info, M107Sync, ~0, 0x8000, 0xFFFF, 0, 0);
}
//------------------ Map 113 ---------------------------
static void M113Sync(void)
{
static void M113Sync(void) {
setprg32(0x8000, (latche >> 3) & 7);
setchr8(((latche >> 3) & 8) | (latche & 7));
// setmirror(latche>>7); // only for HES 6in1
}
void Mapper113_Init(CartInfo *info)
{
void Mapper113_Init(CartInfo *info) {
Latch_Init(info, M113Sync, 0, 0x4100, 0x7FFF, 0, 0);
}
//------------------ Map 140 ---------------------------
void Mapper140_Init(CartInfo *info)
{
void Mapper140_Init(CartInfo *info) {
Latch_Init(info, MHROMSync, 0, 0x6000, 0x7FFF, 0, 0);
}
//------------------ Map 152 ---------------------------
static void M152Sync()
{
static void M152Sync() {
setprg16(0x8000, (latche >> 4) & 7);
setprg16(0xc000, ~0);
setchr8(latche & 0xf);
setmirror(MI_0 + ((latche >> 7) & 1)); /* Saint Seiya...hmm. */
}
void Mapper152_Init(CartInfo *info)
{
void Mapper152_Init(CartInfo *info) {
Latch_Init(info, M152Sync, 0, 0x8000, 0xFFFF, 0, 0);
}
//------------------ Map 180 ---------------------------
static void M180Sync(void)
{
static void M180Sync(void) {
setprg16(0x8000, 0);
setprg16(0xc000, latche);
setchr8(0);
}
void Mapper180_Init(CartInfo *info)
{
void Mapper180_Init(CartInfo *info) {
Latch_Init(info, M180Sync, 0, 0x8000, 0xFFFF, 0, 0);
}
//------------------ Map 184 ---------------------------
static void M184Sync(void)
{
static void M184Sync(void) {
setchr4(0x0000, latche);
setchr4(0x1000, latche >> 4);
setprg32(0x8000, 0);
}
void Mapper184_Init(CartInfo *info)
{
void Mapper184_Init(CartInfo *info) {
Latch_Init(info, M184Sync, 0, 0x6000, 0x7FFF, 0, 0);
}
//------------------ Map 203 ---------------------------
static void M203Sync(void) {
setprg16(0x8000, (latche >> 2) & 3);
setprg16(0xC000, (latche >> 2) & 3);
setchr8(latche & 3);
}
void Mapper203_Init(CartInfo *info) {
Latch_Init(info, M203Sync, 0, 0x8000, 0xFFFF, 0, 0);
}
//------------------ Map 240 ---------------------------
void Mapper240_Init(CartInfo *info)
{
Latch_Init(info, MHROMSync, 0, 0x4020, 0x5FFF, 0, 0);
// need SRAM.
static void M240Sync(void) {
setprg8r(0x10, 0x6000, 0);
setprg32(0x8000, latche >> 4);
setchr8(latche & 0xf);
}
void Mapper240_Init(CartInfo *info) {
Latch_Init(info, M240Sync, 0, 0x4020, 0x5FFF, 1, 0);
}
//------------------ Map 241 ---------------------------
// Mapper 7 mostly, but with SRAM or maybe prot circuit
// figure out, which games do need 5xxx area reading
static void M241Sync(void) {
setchr8(0);
setprg8r(0x10, 0x6000, 0);
setprg32(0x8000, latche);
}
void Mapper241_Init(CartInfo *info) {
Latch_Init(info, M241Sync, 0, 0x8000, 0xFFFF, 1, 0);
}
//------------------ A65AS ---------------------------
@ -493,12 +460,10 @@ void Mapper240_Init(CartInfo *info)
// 16 bankswitching mode and normal mirroring... But there is no any
// correlations between modes and they can be used in one mapper code.
static void BMCA65ASSync(void)
{
static void BMCA65ASSync(void) {
if (latche & 0x40)
setprg32(0x8000, (latche >> 1) & 0x0F);
else
{
else{
setprg16(0x8000, ((latche & 0x30) >> 1) | (latche & 7));
setprg16(0xC000, ((latche & 0x30) >> 1) | 7);
}
@ -509,8 +474,7 @@ static void BMCA65ASSync(void)
setmirror(((latche >> 3) & 1) ^ 1);
}
void BMCA65AS_Init(CartInfo *info)
{
void BMCA65AS_Init(CartInfo *info) {
Latch_Init(info, BMCA65ASSync, 0, 0x8000, 0xFFFF, 0, 0);
}

View File

@ -583,7 +583,7 @@ static BMAPPINGLocal bmap[] = {
// {"", 56, Mapper56_Init},
{"", 57, Mapper57_Init},
{"", 58, BMCGK192_Init},
// {"", 59, Mapper59_Init},
{"", 59, Mapper59_Init}, // check this out
{"", 60, BMCD1038_Init},
// {"", 61, Mapper61_Init},
// {"", 62, Mapper62_Init},
@ -725,10 +725,10 @@ static BMAPPINGLocal bmap[] = {
{"", 198, Mapper198_Init},
{"", 199, Mapper199_Init},
{"", 200, Mapper200_Init},
// {"", 201, Mapper201_Init},
// {"", 202, Mapper202_Init},
// {"", 203, Mapper203_Init},
// {"", 204, Mapper204_Init},
{"", 201, Mapper201_Init},
{"", 202, Mapper202_Init},
{"", 203, Mapper203_Init},
{"", 204, Mapper204_Init},
{"", 205, Mapper205_Init},
{"DEIROM", 206, DEIROM_Init},
// {"", 207, Mapper207_Init},
@ -736,9 +736,9 @@ static BMAPPINGLocal bmap[] = {
{"", 209, Mapper209_Init},
{"", 210, Mapper210_Init},
{"", 211, Mapper211_Init},
// {"", 212, Mapper212_Init},
// {"", 213, Mapper213_Init},
// {"", 214, Mapper214_Init},
{"", 212, Mapper212_Init},
{"", 213, Mapper213_Init},
{"", 214, Mapper214_Init},
{"", 215, UNL8237_Init},
{"", 216, Mapper216_Init},
// {"", 217, UNL8237A_Init},
@ -751,11 +751,11 @@ static BMAPPINGLocal bmap[] = {
// {"", 224, Mapper224_Init},
{"", 225, Mapper225_Init},
{"", 226, Mapper226_Init},
// {"", 227, Mapper227_Init},
{"", 227, Mapper227_Init},
// {"", 228, Mapper228_Init},
// {"", 229, Mapper229_Init},
{"", 229, Mapper229_Init},
// {"", 230, Mapper230_Init},
// {"", 231, Mapper231_Init},
{"", 231, Mapper231_Init},
// {"", 232, Mapper232_Init},
{"", 233, BMC42in1r_Init},
// {"", 234, Mapper234_Init},
@ -765,8 +765,8 @@ static BMAPPINGLocal bmap[] = {
{"UNL6035052", 238, UNL6035052_Init},
// {"", 239, Mapper239_Init},
{"", 240, Mapper240_Init},
// {"", 241, Mapper241_Init},
// {"", 242, Mapper242_Init},
{"", 241, Mapper241_Init},
{"", 242, Mapper242_Init},
{"S74LS374NA", 243, S74LS374NA_Init},
// {"", 244, Mapper244_Init},
{"", 245, Mapper245_Init},
@ -1230,7 +1230,7 @@ void (*MapInitTab[256])(void)=
0,
0, //Mapper57_init,
0, //Mapper58_init,
Mapper59_init,
0, //Mapper59_init,
0, //Mapper60_init,
Mapper61_init,
Mapper62_init,
@ -1372,10 +1372,10 @@ void (*MapInitTab[256])(void)=
0,
0,
0, //Mapper200_init,
Mapper201_init,
Mapper202_init,
Mapper203_init,
Mapper204_init,
0, //Mapper201_init,
0, //Mapper202_init,
0, //Mapper203_init,
0, //Mapper204_init,
0,
0,
Mapper207_init,
@ -1383,9 +1383,9 @@ void (*MapInitTab[256])(void)=
0,
0,
0, //Mapper211_init,
Mapper212_init,
Mapper213_init,
Mapper214_init,
0, //Mapper212_init,
0, //Mapper213_init,
0, //Mapper214_init,
0,
0,
0,
@ -1398,11 +1398,11 @@ void (*MapInitTab[256])(void)=
0,
0, //Mapper225_init,
0, //Mapper226_init,
Mapper227_init,
0, //Mapper227_init,
Mapper228_init,
Mapper229_init,
0, //Mapper229_init,
Mapper230_init,
Mapper231_init,
0, //Mapper231_init,
Mapper232_init,
0,
Mapper234_init,
@ -1412,8 +1412,8 @@ void (*MapInitTab[256])(void)=
0,
0,
0, //Mapper240_init,
Mapper241_init,
Mapper242_init,
0, //Mapper241_init,
0, //Mapper242_init,
0,
Mapper244_init,
0,

View File

@ -201,7 +201,7 @@ void Mapper53_init(void);
void Mapper54_init(void);
void Mapper55_init(void);
void Mapper56_init(void);
void Mapper59_init(void);
//void Mapper59_init(void);
void Mapper60_init(void);
void Mapper61_init(void);
void Mapper62_init(void);
@ -316,15 +316,15 @@ void Mapper180_init(void);
//void Mapper198_init(void);
void Mapper199_init(void);
//void Mapper200_init(void);
void Mapper201_init(void);
void Mapper202_init(void);
void Mapper203_init(void);
void Mapper204_init(void);
//void Mapper201_init(void);
//void Mapper202_init(void);
//void Mapper203_init(void);
//void Mapper204_init(void);
void Mapper207_init(void);
//void Mapper211_init(void);
void Mapper212_init(void);
void Mapper213_init(void);
void Mapper214_init(void);
//void Mapper212_init(void);
//void Mapper213_init(void);
//void Mapper214_init(void);
//void Mapper218_init(void);
void Mapper219_init(void);
//void Mapper220_init(void);
@ -334,11 +334,11 @@ void Mapper223_init(void);
void Mapper224_init(void);
//void Mapper225_init(void);
//void Mapper226_init(void);
void Mapper227_init(void);
//void Mapper227_init(void);
void Mapper228_init(void);
void Mapper229_init(void);
//void Mapper229_init(void);
void Mapper230_init(void);
void Mapper231_init(void);
//void Mapper231_init(void);
void Mapper232_init(void);
//void Mapper233_init(void);
void Mapper234_init(void);
@ -348,8 +348,8 @@ void Mapper237_init(void);
void Mapper238_init(void);
void Mapper239_init(void);
void Mapper240_init(void);
void Mapper241_init(void);
void Mapper242_init(void);
//void Mapper241_init(void);
//void Mapper242_init(void);
void Mapper244_init(void);
void Mapper245_init(void);
void Mapper246_init(void);
@ -390,7 +390,7 @@ void Mapper47_Init(CartInfo *);
void Mapper49_Init(CartInfo *);
void Mapper52_Init(CartInfo *);
void Mapper57_Init(CartInfo *);
//void Mapper58_Init(CartInfo *);
void Mapper59_Init(CartInfo *);
void Mapper68_Init(CartInfo *);
void Mapper70_Init(CartInfo *);
void Mapper74_Init(CartInfo *);
@ -465,20 +465,32 @@ void Mapper197_Init(CartInfo *);
void Mapper198_Init(CartInfo *);
void Mapper199_Init(CartInfo *);
void Mapper200_Init(CartInfo *);
void Mapper201_Init(CartInfo *);
void Mapper202_Init(CartInfo *);
void Mapper203_Init(CartInfo *);
void Mapper205_Init(CartInfo *);
void Mapper204_Init(CartInfo *);
void Mapper208_Init(CartInfo *);
void Mapper209_Init(CartInfo *);
void Mapper210_Init(CartInfo *);
void Mapper211_Init(CartInfo *);
void Mapper212_Init(CartInfo *);
void Mapper213_Init(CartInfo *);
void Mapper214_Init(CartInfo *);
void Mapper216_Init(CartInfo *);
void Mapper220_Init(CartInfo *);
void Mapper222_Init(CartInfo *);
void Mapper225_Init(CartInfo *);
void Mapper226_Init(CartInfo *);
void Mapper227_Init(CartInfo *);
void Mapper229_Init(CartInfo *);
void Mapper231_Init(CartInfo *);
void Mapper235_Init(CartInfo *);
void Mapper236_Init(CartInfo *);
void Mapper237_Init(CartInfo *);
void Mapper240_Init(CartInfo *);
void Mapper241_Init(CartInfo *);
void Mapper242_Init(CartInfo *);
void Mapper245_Init(CartInfo *);
void Mapper249_Init(CartInfo *);
void Mapper250_Init(CartInfo *);

View File

@ -1,44 +0,0 @@
/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
* Copyright (C) 2003 CaH4e3
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "mapinc.h"
static DECLFW(Mapper201_write)
{
// FCEU_printf("%04x, %02x\n",A,V);
if(A&0x08)
{
ROM_BANK32(A&0x03);
VROM_BANK8(A&0x03);
}
else
{
ROM_BANK32(0);
VROM_BANK8(0);
}
}
void Mapper201_init(void)
{
ROM_BANK32(~0);
VROM_BANK8(~0);
SetWriteHandler(0x8000,0xffff,Mapper201_write);
}

View File

@ -1,39 +0,0 @@
/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
* Copyright (C) 2003 Xodnizel
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "mapinc.h"
static DECLFW(Mapper202_write)
{
int tmp=(A>>1)&0x7;
MIRROR_SET(A&1);
ROM_BANK16(0x8000,tmp);
ROM_BANK16(0xc000,tmp+(((tmp&0x6)==0x6)?1:0));
VROM_BANK8(tmp);
}
void Mapper202_init(void)
{
ROM_BANK16(0x8000,0);
ROM_BANK16(0xc000,0);
VROM_BANK8(0);
SetWriteHandler(0x8000,0xFFFF,Mapper202_write);
}

View File

@ -1,36 +0,0 @@
/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
* Copyright (C) 2003 Xodnizel
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "mapinc.h"
static DECLFW(Mapper203_write)
{
ROM_BANK16(0x8000,(V>>2)&3);
ROM_BANK16(0xc000,(V>>2)&3);
VROM_BANK8(V&3);
}
void Mapper203_init(void)
{
ROM_BANK16(0x8000,0);
ROM_BANK16(0xc000,0);
VROM_BANK8(0);
SetWriteHandler(0x8000,0xFFFF,Mapper203_write);
}

View File

@ -1,38 +0,0 @@
/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
* Copyright (C) 2003 CaH4e3
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "mapinc.h"
static DECLFW(Mapper204_write)
{
int tmp2=A&0x6;
int tmp1=tmp2+((tmp2==0x6)?0:(A&1));
MIRROR_SET((A>>4)&1);
ROM_BANK16(0x8000,tmp1);
ROM_BANK16(0xc000,tmp2+((tmp2==0x6)?1:(A&1)));
VROM_BANK8(tmp1);
}
void Mapper204_init(void)
{
ROM_BANK32(~0);
VROM_BANK8(~0);
SetWriteHandler(0x8000,0xFFFF,Mapper204_write);
}

View File

@ -1,43 +0,0 @@
/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
* Copyright (C) 2003 CaH4e3
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "mapinc.h"
static DECLFW(Mapper212_write)
{
if((A&0x4000)==0x4000)
{
ROM_BANK32((A&6)>>1);
}
else
{
ROM_BANK16(0x8000,A&7);
ROM_BANK16(0xc000,A&7);
}
VROM_BANK8(A&7);
MIRROR_SET((A>>3)&1);
}
void Mapper212_init(void)
{
ROM_BANK32(~0);
VROM_BANK8(~0);
SetWriteHandler(0x8000,0xFFFF,Mapper212_write);
}

View File

@ -1,34 +0,0 @@
/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
* Copyright (C) 2003 CaH4e3
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "mapinc.h"
static DECLFW(Mapper213_write)
{
ROM_BANK32((A>>1)&3);
VROM_BANK8((A>>3)&7);
}
void Mapper213_init(void)
{
ROM_BANK32(0);
VROM_BANK8(0);
SetWriteHandler(0x8000,0xFFFF,Mapper213_write);
}

View File

@ -1,37 +0,0 @@
/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
* Copyright (C) 2003 CaH4e3
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "mapinc.h"
static DECLFW(Mapper214_write)
{
// FCEU_printf("%02x:%02x\n",A,V);
ROM_BANK16(0x8000,(A>>2)&3);
ROM_BANK16(0xC000,(A>>2)&3);
VROM_BANK8(A&3);
}
void Mapper214_init(void)
{
ROM_BANK16(0x8000,0);
ROM_BANK16(0xC000,0);
VROM_BANK8(0);
SetWriteHandler(0x8000,0xFFFF,Mapper214_write);
}

View File

@ -1,91 +0,0 @@
/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
* Copyright (C) 2002 Xodnizel
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "mapinc.h"
#define rg mapbyte1
static void DoSync(uint32 A)
{
uint32 S = A & 1;
uint32 p = (A >> 2) & 0x1F;
p += (A&0x100) ? 0x20 : 0;
uint32 o = (A>>7)&1;
uint32 L = (A>>9)&1;
if (o && !S )
{
ROM_BANK16(0x8000,p);
ROM_BANK16(0xC000,p);
}
if (o && S )
{
ROM_BANK16(0x8000,p);
ROM_BANK16(0xC000,p+1);
}
if (!o && !S && !L )
{
ROM_BANK16(0x8000,p);
ROM_BANK16(0xC000,p&0x38);
}
if (!o && S && !L )
{
ROM_BANK16(0x8000,p&0x3E);
ROM_BANK16(0xC000,p&0x38);
}
if (!o && !S && L)
{
ROM_BANK16(0x8000,p);
ROM_BANK16(0xC000,p|7);
}
if (!o && S && L )
{
ROM_BANK16(0x8000,p&0x3E);
ROM_BANK16(0xC000,p|7);
}
rg[0]=A;
rg[1]=A>>8;
MIRROR_SET((A>>1)&1);
}
static DECLFW(Mapper227_write)
{
DoSync(A);
}
static void M227Reset(void)
{
DoSync(0);
}
static void M227Restore(int version)
{
DoSync(rg[0]|(rg[1]<<8));
}
void Mapper227_init(void)
{
SetWriteHandler(0x8000,0xffff,Mapper227_write);
MapperReset=M227Reset;
GameStateRestore=M227Restore;
M227Reset();
}

View File

@ -1,48 +0,0 @@
/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
* Copyright (C) 2002 Xodnizel
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "mapinc.h"
DECLFW(Mapper229_write)
{
if(A>=0x8000)
{
MIRROR_SET((A>>5)&1);
if(!(A&0x1e))
{
ROM_BANK32(0);
}
else
{
ROM_BANK16(0x8000,A&0x1f);
ROM_BANK16(0xC000,A&0x1f);
}
VROM_BANK8(A);
}
}
void Mapper229_init(void)
{
SetWriteHandler(0x8000,0xffff,Mapper229_write);
}

View File

@ -1,41 +0,0 @@
/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
* Copyright (C) 2003 Xodnizel
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "mapinc.h"
static DECLFW(Mapper231_write)
{
if(A&0x20)
ROM_BANK32((A>>1)&0xF);
else
{
ROM_BANK16(0x8000,(A&0x1E));
ROM_BANK16(0xc000,(A&0x1E));
}
MIRROR_SET((A>>7)&1);
}
void Mapper231_init(void)
{
ROM_BANK16(0x8000,0);
ROM_BANK16(0xc000,0);
SetWriteHandler(0x8000,0xffff,Mapper231_write);
}

View File

@ -1,47 +0,0 @@
/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
* Copyright (C) 2003 Xodnizel
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "mapinc.h"
static DECLFW(M241wr)
{
// FCEU_printf("Wr: $%04x:$%02x, $%04x\n",A,V,X.PC);
if(A<0x8000)
{
// printf("$%04x:$%02x, $%04x\n",A,V,X.PC);
}
else
ROM_BANK32(V);
}
static DECLFR(M241rd)
{
//DumpMem("out",0x8000,0xffff);
//printf("Rd: $%04x, $%04x\n",A,X.PC);
return(0x50);
}
void Mapper241_init(void)
{
ROM_BANK32(0);
SetWriteHandler(0x5000,0x5fff,M241wr);
SetWriteHandler(0x8000,0xFFFF,M241wr);
SetReadHandler(0x4020,0x5fff,M241rd);
}

View File

@ -1,39 +0,0 @@
/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
* Copyright (C) 2002 Xodnizel
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "mapinc.h"
DECLFW(Mapper242_write)
{
ROM_BANK32((A>>3)&0xF);
switch((A>>1)&1)
{
case 0:MIRROR_SET(0);break;
case 1:MIRROR_SET(1);break;
}
}
void Mapper242_init(void)
{
ROM_BANK32(0);
SetWriteHandler(0x8000,0xffff,Mapper242_write);
}

View File

@ -1,47 +0,0 @@
/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
* Copyright (C) 2002 Xodnizel
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "mapinc.h"
static int ay;
static DECLFW(Mapper59_write)
{
//printf("$%04x:$%02x\n",A,V);
setprg32(0x8000,(A&0x70)>>4);
setchr8(A&0x7);
//if(A&0x100)
// setprg32r(0x10,0x8000,0);
ay=A;
MIRROR_SET2((A&0x8)>>3);
}
static DECLFR(m59rd)
{
if(ay&0x100) return(0);
else
return(CartBR(A));
}
void Mapper59_init(void)
{
setprg32(0x8000,0);
SetReadHandler(0x8000,0xffff,m59rd);
SetWriteHandler(0x8000,0xffff,Mapper59_write);
}

View File

@ -569,24 +569,12 @@
<ClCompile Include="..\src\input\suborkb.cpp" />
<ClCompile Include="..\src\input\toprider.cpp" />
<ClCompile Include="..\src\input\zapper.cpp" />
<ClCompile Include="..\src\mappers\201.cpp" />
<ClCompile Include="..\src\mappers\202.cpp" />
<ClCompile Include="..\src\mappers\203.cpp" />
<ClCompile Include="..\src\mappers\204.cpp" />
<ClCompile Include="..\src\mappers\21.cpp" />
<ClCompile Include="..\src\mappers\212.cpp" />
<ClCompile Include="..\src\mappers\213.cpp" />
<ClCompile Include="..\src\mappers\214.cpp" />
<ClCompile Include="..\src\mappers\22.cpp" />
<ClCompile Include="..\src\mappers\227.cpp" />
<ClCompile Include="..\src\mappers\228.cpp" />
<ClCompile Include="..\src\mappers\229.cpp" />
<ClCompile Include="..\src\mappers\230.cpp" />
<ClCompile Include="..\src\mappers\231.cpp" />
<ClCompile Include="..\src\mappers\232.cpp" />
<ClCompile Include="..\src\mappers\234.cpp" />
<ClCompile Include="..\src\mappers\241.cpp" />
<ClCompile Include="..\src\mappers\242.cpp" />
<ClCompile Include="..\src\mappers\244.cpp" />
<ClCompile Include="..\src\mappers\246.cpp" />
<ClCompile Include="..\src\mappers\24and26.cpp" />
@ -601,7 +589,6 @@
<ClCompile Include="..\src\mappers\46.cpp" />
<ClCompile Include="..\src\mappers\50.cpp" />
<ClCompile Include="..\src\mappers\51.cpp" />
<ClCompile Include="..\src\mappers\59.cpp" />
<ClCompile Include="..\src\mappers\6.cpp" />
<ClCompile Include="..\src\mappers\61.cpp" />
<ClCompile Include="..\src\mappers\62.cpp" />

View File

@ -647,60 +647,24 @@
<ClCompile Include="..\src\lua\src\print.c">
<Filter>drivers\win\lua</Filter>
</ClCompile>
<ClCompile Include="..\src\mappers\201.cpp">
<Filter>mappers</Filter>
</ClCompile>
<ClCompile Include="..\src\mappers\202.cpp">
<Filter>mappers</Filter>
</ClCompile>
<ClCompile Include="..\src\mappers\203.cpp">
<Filter>mappers</Filter>
</ClCompile>
<ClCompile Include="..\src\mappers\204.cpp">
<Filter>mappers</Filter>
</ClCompile>
<ClCompile Include="..\src\mappers\21.cpp">
<Filter>mappers</Filter>
</ClCompile>
<ClCompile Include="..\src\mappers\212.cpp">
<Filter>mappers</Filter>
</ClCompile>
<ClCompile Include="..\src\mappers\213.cpp">
<Filter>mappers</Filter>
</ClCompile>
<ClCompile Include="..\src\mappers\214.cpp">
<Filter>mappers</Filter>
</ClCompile>
<ClCompile Include="..\src\mappers\22.cpp">
<Filter>mappers</Filter>
</ClCompile>
<ClCompile Include="..\src\mappers\227.cpp">
<Filter>mappers</Filter>
</ClCompile>
<ClCompile Include="..\src\mappers\228.cpp">
<Filter>mappers</Filter>
</ClCompile>
<ClCompile Include="..\src\mappers\229.cpp">
<Filter>mappers</Filter>
</ClCompile>
<ClCompile Include="..\src\mappers\230.cpp">
<Filter>mappers</Filter>
</ClCompile>
<ClCompile Include="..\src\mappers\231.cpp">
<Filter>mappers</Filter>
</ClCompile>
<ClCompile Include="..\src\mappers\232.cpp">
<Filter>mappers</Filter>
</ClCompile>
<ClCompile Include="..\src\mappers\234.cpp">
<Filter>mappers</Filter>
</ClCompile>
<ClCompile Include="..\src\mappers\241.cpp">
<Filter>mappers</Filter>
</ClCompile>
<ClCompile Include="..\src\mappers\242.cpp">
<Filter>mappers</Filter>
</ClCompile>
<ClCompile Include="..\src\mappers\244.cpp">
<Filter>mappers</Filter>
</ClCompile>
@ -743,9 +707,6 @@
<ClCompile Include="..\src\mappers\51.cpp">
<Filter>mappers</Filter>
</ClCompile>
<ClCompile Include="..\src\mappers\59.cpp">
<Filter>mappers</Filter>
</ClCompile>
<ClCompile Include="..\src\mappers\6.cpp">
<Filter>mappers</Filter>
</ClCompile>