X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=fceu.git;a=blobdiff_plain;f=boards%2F189.c;fp=mappers%2F57.c;h=23be63a0faa484c2895ce76e27fa3b0d77c8500d;hp=b64d270629174aeca7d3c8d8400c92b7f1e23755;hb=e2d0dd92bfad989cce4270fc0ac5a712476c7c50;hpb=971a1d07d2f5b5a6f991ed5712275c04b933734f diff --git a/mappers/57.c b/boards/189.c similarity index 59% rename from mappers/57.c rename to boards/189.c index b64d270..23be63a 100644 --- a/mappers/57.c +++ b/boards/189.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,31 +19,30 @@ */ #include "mapinc.h" +#include "mmc3.h" +static void M189PW(uint32 A, uint8 V) +{ + setprg32(0x8000,EXPREGS[0]&3); +} +static DECLFW(M189Write) +{ + EXPREGS[0]=V|(V>>4); //actually, there is a two versions of 189 mapper with hi or lo bits bankswitching. + FixMMC3PRG(MMC3_cmd); +} -static DECLFW(Mapper57_write) +static void M189Power(void) { - A&=0x8800; - if(A==0x8800) - { - 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); - } - else - mapbyte1[1]=V; - VROM_BANK8((mapbyte1[1]&3)|(mapbyte1[0]&7)|((mapbyte1[0]&0x10)>>1)); - //printf("$%04x:$%02x\n",A,V); + EXPREGS[0]=EXPREGS[1]=0; + GenMMC3Power(); + SetWriteHandler(0x4120,0x7FFF,M189Write); } -void Mapper57_init(void) +void Mapper189_Init(CartInfo *info) { - SetWriteHandler(0x8000,0xffff,Mapper57_write); + GenMMC3_Init(info, 256, 256, 0, 0); + pwrap=M189PW; + info->Power=M189Power; + AddExState(EXPREGS, 2, 0, "EXPR"); }