X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=fceu.git;a=blobdiff_plain;f=mappers%2F244.c;h=889f13b8c5c2713453e30661436d9ffe91f64bcf;hp=68a7563d6b5e5d0929894d8d19ff2839ae0b0723;hb=43725da7349c85fa13e828fdbf20cc7ac8d298d6;hpb=386f5371eb984fb9c2860c83e740890a75cd45c1 diff --git a/mappers/244.c b/mappers/244.c index 68a7563..889f13b 100644 --- a/mappers/244.c +++ b/mappers/244.c @@ -1,7 +1,7 @@ /* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: - * Copyright (C) 2003 CaH4e3 + * Copyright (C) 2011 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 @@ -15,24 +15,39 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "mapinc.h" -static DECLFW(Mapper244_write_1) -{ - ROM_BANK32((A-0x8065)&0x03); -} +static uint8 prg_perm[4][4] = { + {0, 1, 2, 3,}, + {3, 2, 1, 0,}, + {0, 2, 1, 3,}, + {3, 1, 2, 0,}, +}; + +static uint8 chr_perm[8][8] = { + {0, 1, 2, 3, 4, 5, 6, 7,}, + {0, 2, 1, 3, 4, 6, 5, 7,}, + {0, 1, 4, 5, 2, 3, 6, 7,}, + {0, 4, 1, 5, 2, 6, 3, 7,}, + {0, 4, 2, 6, 1, 5, 3, 7,}, + {0, 2, 4, 6, 1, 3, 5, 7,}, + {7, 6, 5, 4, 3, 2, 1, 0,}, + {7, 6, 5, 4, 3, 2, 1, 0,}, +}; -static DECLFW(Mapper244_write_2) +static DECLFW(Mapper244_write) { - VROM_BANK8((A-0x80A5)&0x07); + if(V&8) + VROM_BANK8(chr_perm[(V>>4)&7][V&7]); + else + ROM_BANK32(prg_perm[(V>>4)&3][V&3]); } void Mapper244_init(void) { ROM_BANK32(0); - SetWriteHandler(0x8065,0x80a4,Mapper244_write_1); - SetWriteHandler(0x80a5,0x80e4,Mapper244_write_2); + SetWriteHandler(0x8000,0xffff,Mapper244_write); }