X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=fceu.git;a=blobdiff_plain;f=mappers%2Fsimple.c;h=c393d095e35683967de29243232741c6b88ef6de;hp=b2c76d8822d8d7d6cf91aabf75ef9a6e77d64648;hb=e2d0dd92bfad989cce4270fc0ac5a712476c7c50;hpb=971a1d07d2f5b5a6f991ed5712275c04b933734f diff --git a/mappers/simple.c b/mappers/simple.c index b2c76d8..c393d09 100644 --- a/mappers/simple.c +++ b/mappers/simple.c @@ -23,91 +23,6 @@ static uint8 latche; -//static DECLFW(Mapper2_write) -//{ -// latche=V; -// ROM_BANK16(0x8000,V); -//} -// -//void Mapper2_init(void) -//{ -// SetWriteHandler(0x8000,0xFFFF,Mapper2_write); -// AddExState(&latche, 1, 0, "LATC"); -//} - -//static DECLFW(Mapper3_write) -//{ -// VROM_BANK8(V); -// latche=V; -//} - -//void Mapper3_init(void) -//{ -// SetWriteHandler(0x8000,0xFFFF,Mapper3_write); -// AddExState(&latche, 1, 0, "LATC"); -//} - -static DECLFW(Mapper7_write) -{ -// FCEU_printf("%04x,%04x\n",A,V); - ROM_BANK32(V&0xF); - onemir((V>>4)&1); - latche=V; -} - -void Mapper7_init(void) -{ - onemir(0); - ROM_BANK32(0); - SetWriteHandler(0x8000,0xFFFF,Mapper7_write); - AddExState(&latche, 1, 0, "LATC"); -} - -static DECLFW(Mapper11_write) -{ - ROM_BANK32(V&0xF); - VROM_BANK8(V>>4); - latche=V; -} - -void Mapper11_init(void) -{ - ROM_BANK32(0); - SetWriteHandler(0x8000,0xFFFF,Mapper11_write); - AddExState(&latche, 1, 0, "LATC"); -} -void Mapper144_init(void) -{ - ROM_BANK32(0); - SetWriteHandler(0x8001,0xFFFF,Mapper11_write); - AddExState(&latche, 1, 0, "LATC"); - -} -//static DECLFW(Mapper13_write) -//{ -// setchr4r(0x10,0x1000,V&3); -// setprg32(0x8000,(V>>4)&3); -// latche=V; -//} - -//static void Mapper13_StateRestore(int version) -//{ -// setchr4r(0x10,0x0000,0); -// setchr4r(0x10,0x1000,latche&3); -// setprg32(0x8000,(latche>>4)&3); -//} - -//void Mapper13_init(void) -//{ -// SetWriteHandler(0x8000,0xFFFF,Mapper13_write); -// GameStateRestore=Mapper13_StateRestore; -// AddExState(&latche, 1, 0, "LATC"); -// AddExState(MapperExRAM, 16384, 0, "CHRR"); -// SetupCartCHRMapping(0x10, MapperExRAM, 16384, 1); -// latche=0; -// Mapper13_StateRestore(FCEU_VERSION_NUMERIC); -//} - static DECLFW(Mapper34_write) { switch(A) @@ -126,101 +41,6 @@ void Mapper34_init(void) SetWriteHandler(0x7ffd,0xffff,Mapper34_write); } -DECLFW(Mapper66_write) -{ - VROM_BANK8(V&0xF); - ROM_BANK32((V>>4)); - latche=V; -} - -void Mapper66_init(void) -{ - ROM_BANK32(0); - SetWriteHandler(0x6000,0xffff,Mapper66_write); - AddExState(&latche, 1, 0, "LATC"); -} - -DECLFW(Mapper152_write) -{ - ROM_BANK16(0x8000,(V>>4)&0x7); - VROM_BANK8(V&0xF); - onemir((V>>7)&1); /* Saint Seiya...hmm. */ - latche=V; -} - -void Mapper152_init(void) -{ - onemir(0); - SetWriteHandler(0x6000,0xffff,Mapper152_write); - AddExState(&latche, 1, 0, "LATC"); -} - -static DECLFW(Mapper70_write) -{ - ROM_BANK16(0x8000,V>>4); - VROM_BANK8(V&0xF); - latche=V; -} - -void Mapper70_init(void) -{ - SetWriteHandler(0x6000,0xffff,Mapper70_write); - AddExState(&latche, 1, 0, "LATC"); -} -/* Should be two separate emulation functions for this "mapper". Sigh. URGE TO KILL RISING. */ -static DECLFW(Mapper78_write) -{ - //printf("$%04x:$%02x\n",A,V&0x8); - ROM_BANK16(0x8000,V&0x7); - VROM_BANK8(V>>4); - onemir((V>>3)&1); - latche=V; -} - -void Mapper78_init(void) -{ - SetWriteHandler(0x8000,0xffff,Mapper78_write); - AddExState(&latche, 1, 0, "LATC"); -} - -DECLFW(Mapper87_write) -{ - VROM_BANK8(V>>1); - latche=V; -} - -void Mapper87_init(void) -{ - SetWriteHandler(0x6000,0xffff,Mapper87_write); - AddExState(&latche, 1, 0, "LATC"); -} - -DECLFW(Mapper93_write) -{ - ROM_BANK16(0x8000,V>>4); - MIRROR_SET(V&1); - latche=V; -} - -void Mapper93_init(void) -{ - SetWriteHandler(0x8000,0xffff,Mapper93_write); - AddExState(&latche, 1, 0, "LATC"); -} - - -DECLFW(Mapper94_write) -{ - ROM_BANK16(0x8000,V>>2); - latche=V; -} - -void Mapper94_init(void) -{ - SetWriteHandler(0x8000,0xffff,Mapper94_write); - AddExState(&latche, 1, 0, "LATC"); -} - /* I might want to add some code to the mapper 96 PPU hook function to not change CHR banks if the attribute table is being accessed, if I make emulation a little more accurate in the future. @@ -263,56 +83,6 @@ void Mapper96_init(void) GameStateRestore=M96Sync; } -static DECLFW(Mapper140_write) -{ - VROM_BANK8(V&0xF); - ROM_BANK32((V>>4)&0xF); -} - -void Mapper140_init(void) -{ - ROM_BANK32(0); - SetWriteHandler(0x6000,0x7FFF,Mapper140_write); -} - -static void M185Sync(int version) -{ -// on off -//1 0x0F, 0xF0 - Bird Week -//2 0x33, 0x00 - B-Wings -//3 0x11, 0x00 - Mighty Bomb Jack -//4 0x22, 0x20 - Sansuu 1 Nen, Sansuu 2 Nen -//5 0xFF, 0x00 - Sansuu 3 Nen -//6 0x21, 0x13 - Spy vs Spy - -// if((mapbyte1[0]&3)==1) // 6, 3 -// if(mapbyte1[0]&1) // 1, 2, 3, 5 -// if(mapbyte1[0]&2) // 1, 2, 4, 5, - if((mapbyte1[0]&2)||((mapbyte1[0]&3)==1)) // 1, 2, 3, 4, 5 - setchr8(0); - else - setchr8r(0x10,0); -} - -static DECLFW(Mapper185_write) -{ - mapbyte1[0]=V; - M185Sync(0); -} - -void Mapper185_init(void) -{ - int x; - for(x=0;x<8192;x++) - MapperExRAM[x]=0xff; - MapStateRestore=M185Sync; - mapbyte1[0]=0; - M185Sync(0); - SetupCartCHRMapping(0x10,MapperExRAM,8192,0); - SetWriteHandler(0x8000,0xFFFF,Mapper185_write); -} - - static DECLFW(M156Write) { if(A>=0xc000 && A<=0xC003) @@ -328,15 +98,3 @@ void Mapper156_init(void) onemir(0); SetWriteHandler(0xc000,0xc010,M156Write); } - -static DECLFW(m107w) -{ - ROM_BANK32((V>>1)&0x3); - VROM_BANK8(V&0x7); -} - -void Mapper107_init(void) -{ - SetWriteHandler(0x8000,0xffff,m107w); -} -