X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=fceu.git;a=blobdiff_plain;f=mappers%2F41.c;h=dfb69089d630261359e4d5ea5d38630eeceeed37;hp=ce634085f8f52837e655fd295004a657b11ff34b;hb=d97315ac0bca825d2d50a44453bc5652946e2c67;hpb=890e37ba2b8ea1c7593dc05926d7431e3bd00bfb diff --git a/mappers/41.c b/mappers/41.c index ce63408..dfb6908 100644 --- a/mappers/41.c +++ b/mappers/41.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 @@ -28,24 +28,29 @@ DECLFW(Mapper41_write) { if(A<0x8000) { - ROM_BANK32(A&7); - X6502_Rebase(); - MIRROR_SET((A>>5)&1); - calreg=A; - calchr&=0x3; - calchr|=(A>>1)&0xC; - VROM_BANK8(calchr); + ROM_BANK32(A&7); + MIRROR_SET((A>>5)&1); + calreg=A; + calchr&=0x3; + calchr|=(A>>1)&0xC; + VROM_BANK8(calchr); } else if(calreg&0x4) { - calchr&=0xC; - calchr|=A&3; - VROM_BANK8(calchr); + calchr&=0xC; + calchr|=A&3; + VROM_BANK8(calchr); } } +static void M41Reset(void) +{ + calreg=calchr=0; +} + void Mapper41_init(void) { + MapperReset=M41Reset; ROM_BANK32(0); SetWriteHandler(0x8000,0xffff,Mapper41_write); SetWriteHandler(0x6000,0x67ff,Mapper41_write);