update 225 from fceumm to get 255 support too.
This commit is contained in:
parent
db6d5bed8c
commit
ebf0c2c737
|
@ -2,6 +2,8 @@
|
|||
*
|
||||
* Copyright notice for this file:
|
||||
* Copyright (C) 2011 CaH4e3
|
||||
* Copyright (C) 2019 Libretro Team
|
||||
* Copyright (C) 2020
|
||||
*
|
||||
* 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
|
||||
|
@ -16,15 +18,23 @@
|
|||
* 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
|
||||
*
|
||||
* PCB-018 board, discrete multigame cart 110-in-1
|
||||
*
|
||||
* Mapper 225
|
||||
* Mapper 255
|
||||
*
|
||||
*/
|
||||
|
||||
/* 2020-2-20 - merge mapper 255, re-implement extra RAM */
|
||||
|
||||
#include "mapinc.h"
|
||||
|
||||
static uint8 prot[4], prg, mode, chr, mirr;
|
||||
static uint8 extraRAM[4], prg, mode, chr, mirr;
|
||||
|
||||
static SFORMAT StateRegs[] =
|
||||
{
|
||||
{ prot, 4, "PROT" },
|
||||
{ extraRAM, 4, "PROT" },
|
||||
{ &prg, 1, "PRG" },
|
||||
{ &chr, 1, "CHR" },
|
||||
{ &mode, 1, "MODE" },
|
||||
|
@ -36,14 +46,15 @@ static void Sync(void) {
|
|||
if (mode) {
|
||||
setprg16(0x8000, prg);
|
||||
setprg16(0xC000, prg);
|
||||
} else
|
||||
}
|
||||
else
|
||||
setprg32(0x8000, prg >> 1);
|
||||
setchr8(chr);
|
||||
setmirror(mirr ^ 1);
|
||||
}
|
||||
|
||||
static DECLFW(M225Write) {
|
||||
uint32 bank = (A >> 14) & 1;
|
||||
uint8 bank = (A >> 14) & 1;
|
||||
mirr = (A >> 13) & 1;
|
||||
mode = (A >> 12) & 1;
|
||||
chr = (A & 0x3f) | (bank << 6);
|
||||
|
@ -52,35 +63,28 @@ static DECLFW(M225Write) {
|
|||
}
|
||||
|
||||
static DECLFW(M225LoWrite) {
|
||||
if (A & 0x800) {
|
||||
prot[A & 0x03] = V;
|
||||
}
|
||||
/* e.g. 115-in-1 [p1][!] CRC32 0xb39d30b4 */
|
||||
if (A & 0x800) extraRAM[A & 3] = V & 0x0F;
|
||||
}
|
||||
|
||||
static DECLFR(M225LoRead) {
|
||||
if (A & 0x800) {
|
||||
return prot[A & 3] & 0x0F;
|
||||
}
|
||||
if (A & 0x800) return extraRAM[A & 3];
|
||||
return X.DB;
|
||||
}
|
||||
|
||||
static void M225Power(void) {
|
||||
prg = 0;
|
||||
chr = 0;
|
||||
mode = 0;
|
||||
mirr = 0;
|
||||
Sync();
|
||||
SetReadHandler(0x5000, 0x5FFF, M225LoRead);
|
||||
SetWriteHandler(0x5000, 0x5FFF, M225LoWrite);
|
||||
SetReadHandler(0x5000, 0x5fff, M225LoRead);
|
||||
SetWriteHandler(0x5000, 0x5fff, M225LoWrite);
|
||||
SetReadHandler(0x8000, 0xFFFF, CartBR);
|
||||
SetWriteHandler(0x8000, 0xFFFF, M225Write);
|
||||
}
|
||||
|
||||
static void M225Reset(void) {
|
||||
prg = 0;
|
||||
chr = 0;
|
||||
mode = 0;
|
||||
mirr = 0;
|
||||
Sync();
|
||||
}
|
||||
|
||||
|
@ -94,3 +98,7 @@ void Mapper225_Init(CartInfo *info) {
|
|||
GameStateRestore = StateRestore;
|
||||
AddExState(&StateRegs, ~0, 0, 0);
|
||||
}
|
||||
|
||||
void Mapper255_Init(CartInfo *info) {
|
||||
Mapper225_Init(info);
|
||||
}
|
|
@ -770,7 +770,7 @@ BMAPPINGLocal bmap[] = {
|
|||
{"SAN GUO ZHI PIRATE", 252, Mapper252_Init},
|
||||
{"DRAGON BALL PIRATE", 253, Mapper253_Init},
|
||||
{"", 254, Mapper254_Init},
|
||||
// {"", 255, Mapper255_Init}, // No good dumps for this mapper
|
||||
{"", 255, Mapper255_Init}, // dupe of 225
|
||||
|
||||
//-------- Mappers 256-511 is the Supplementary Multilingual Plane ----------
|
||||
//-------- Mappers 512-767 is the Supplementary Ideographic Plane -----------
|
||||
|
|
|
@ -274,6 +274,7 @@ void Mapper250_Init(CartInfo *);
|
|||
void Mapper252_Init(CartInfo *);
|
||||
void Mapper253_Init(CartInfo *);
|
||||
void Mapper254_Init(CartInfo *);
|
||||
void Mapper255_Init(CartInfo *);
|
||||
void Mapper354_Init(CartInfo *);
|
||||
void Mapper406_Init(CartInfo *);
|
||||
|
||||
|
|
Loading…
Reference in New Issue