X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=boards%2Fkof97.c;fp=mappers%2F58.c;h=4e477d326ca075646e64919d90bdbc92e63febdc;hb=e2d0dd92bfad989cce4270fc0ac5a712476c7c50;hp=d3cc50577a97ad970ef7c709c16298febf0591b9;hpb=971a1d07d2f5b5a6f991ed5712275c04b933734f;p=fceu.git diff --git a/mappers/58.c b/boards/kof97.c similarity index 56% rename from mappers/58.c rename to boards/kof97.c index d3cc505..4e477d3 100644 --- a/mappers/58.c +++ b/boards/kof97.c @@ -1,7 +1,7 @@ /* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: - * Copyright (C) 2002 Xodnizel + * Copyright (C) 2005 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 @@ -19,25 +19,32 @@ */ #include "mapinc.h" +#include "mmc3.h" -static DECLFW(M58Write) +static DECLFW(UNLKOF97CMDWrite) { - //printf("$%04x:$%02x\n",A,V); - if(A&0x40) - { - ROM_BANK16(0x8000,(A&0x07)); - ROM_BANK16(0xc000,(A&0x07)); - } - else - ROM_BANK32((A&0x06)>>1); + V=(V&0xD8)|((V&0x20)>>4)|((V&4)<<3)|((V&2)>>1)|((V&1)<<2); //76143502 + if(A==0x9000) A=0x8001; + MMC3_CMDWrite(A,V); +} - VROM_BANK8((A&0x38)>>3); - MIRROR_SET2((V&2)>>1); +static DECLFW(UNLKOF97IRQWrite) +{ + V=(V&0xD8)|((V&0x20)>>4)|((V&4)<<3)|((V&2)>>1)|((V&1)<<2); + if(A==0xD000) A=0xC001; + else if(A==0xF000) A=0xE001; + MMC3_IRQWrite(A,V); +} + +static void UNLKOF97Power(void) +{ + GenMMC3Power(); + SetWriteHandler(0x8000,0xA000,UNLKOF97CMDWrite); + SetWriteHandler(0xC000,0xF000,UNLKOF97IRQWrite); } -void Mapper58_init(void) +void UNLKOF97_Init(CartInfo *info) { - ROM_BANK32(0); - VROM_BANK8(0); - SetWriteHandler(0x8000,0xFFFF,M58Write); + GenMMC3_Init(info, 128, 256, 0, 0); + info->Power=UNLKOF97Power; }