X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=fceu.git;a=blobdiff_plain;f=mappers%2F57.c;fp=mappers%2F249.c;h=b64d270629174aeca7d3c8d8400c92b7f1e23755;hp=6225d497553172a6c583455dd5c385c6f55ee677;hb=d97315ac0bca825d2d50a44453bc5652946e2c67;hpb=890e37ba2b8ea1c7593dc05926d7431e3bd00bfb diff --git a/mappers/249.c b/mappers/57.c similarity index 64% rename from mappers/249.c rename to mappers/57.c index 6225d49..b64d270 100644 --- a/mappers/249.c +++ b/mappers/57.c @@ -1,7 +1,7 @@ /* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: - * Copyright (C) 2002 Ben Parnell + * 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 @@ -20,27 +20,30 @@ #include "mapinc.h" -uint8 doh; -static DECLFW(Mapper249_write) + +static DECLFW(Mapper57_write) { - switch(A&0xe001) + A&=0x8800; + if(A==0x8800) { - case 0x8000:doh=V;break; - case 0x8001:switch(doh&7) - { - case 0:VROM_BANK2(0x0000,V>>1);break; - case 1:VROM_BANK2(0x0800,V>>1);break; - case 2:VROM_BANK1(0x1000,V);break; -// case 6:ROM_BANK8(0xa000,V);break; -// case 2:ROM_BANK8(0x8000,V);break; - } + mapbyte1[0]=V; + if(V&0x80) + ROM_BANK32(2|(V>>6)); + else + { + ROM_BANK16(0x8000,(V>>5)&3); + ROM_BANK16(0xc000,(V>>5)&3); + } + MIRROR_SET((V&0x8)>>3); } -// printf("$%04x:$%02x\n",A,V); + else + mapbyte1[1]=V; + VROM_BANK8((mapbyte1[1]&3)|(mapbyte1[0]&7)|((mapbyte1[0]&0x10)>>1)); + //printf("$%04x:$%02x\n",A,V); } -void Mapper249_init(void) +void Mapper57_init(void) { - SetWriteHandler(0x8000,0xffff,Mapper249_write); + SetWriteHandler(0x8000,0xffff,Mapper57_write); } -