M063: Add submapper 1, correct open bus behavior.

This commit is contained in:
NewRisingSun
2023-03-27 17:55:43 +02:00
parent 09b8ef2830
commit ce05415078

View File

@@ -194,33 +194,34 @@ void Mapper61_Init(CartInfo *info) {
* Mapper 63 NTDEC-Multicart * Mapper 63 NTDEC-Multicart
* http://wiki.nesdev.com/w/index.php/INES_Mapper_063 * http://wiki.nesdev.com/w/index.php/INES_Mapper_063
* - Powerful 250-in-1 * - Powerful 250-in-1
* - Hello Kitty 255-in-1 */ * - Hello Kitty 255-in-1
* Submapper 1:
* - NTDEC 82-in-1 */
static uint16 openBus; static uint16 openBus;
static DECLFR(M63Read) { static DECLFR(M63Read) {
if (A < 0xC000) if (openBus)
if (openBus) return X.DB;
return X.DB;
return CartBR(A); return CartBR(A);
} }
static void M63Sync(void) { static void M63Sync(void) {
uint16 mode = latche & 2; uint16 prg =latche >>2 &(submapper ==1? 0x7F: 0xFF);
uint16 prg_bank = (latche & 0x3F8) >> 1; if (latche &2)
uint16 prg16 = (latche & 4) >> 1; setprg32(0x8000, prg >>1);
else {
openBus = ((latche & 0x300) == 0x300); setprg16(0x8000, prg);
setprg8(0x8000, (prg_bank | (mode ? 0 : prg16 | 0))); setprg16(0xC000, prg);
setprg8(0xA000, (prg_bank | (mode ? 1 : prg16 | 1))); }
setprg8(0xC000, (prg_bank | (mode ? 2 : prg16 | 0))); openBus =prg >=ROM_size;
setprg8(0xE000, ((latche & 0x800) ? ((latche & 0x7C) | ((latche & 6) ? 3 : 1)) : SetupCartCHRMapping(0, CHRptr[0], 0x2000, latche &(submapper ==1? 0x200: 0x400)? 0: 1);
(prg_bank | (mode ? 3 : (prg16 | 1)))));
setchr8(0); setchr8(0);
setmirror((latche & 1) ^ 1); setmirror(latche &1? MI_H: MI_V);
} }
void Mapper63_Init(CartInfo *info) { void Mapper63_Init(CartInfo *info) {
submapper = info->submapper;
Latch_Init(info, M63Sync, M63Read, 0x0000, 0x8000, 0xFFFF, 0); Latch_Init(info, M63Sync, M63Read, 0x0000, 0x8000, 0xFFFF, 0);
} }