Add mapper 613.
This commit is contained in:
70
src/boards/613.c
Normal file
70
src/boards/613.c
Normal file
@@ -0,0 +1,70 @@
|
||||
/* FCE Ultra - NES/Famicom Emulator
|
||||
*
|
||||
* Copyright notice for this file:
|
||||
* Copyright (C) 2026 NewRisingSun
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#include "mapinc.h"
|
||||
#include "asic_mmc1.h"
|
||||
#include "asic_mmc3.h"
|
||||
|
||||
static uint8 reg;
|
||||
|
||||
static void sync (void) {
|
||||
if (reg &0x01) {
|
||||
MMC3_syncPRG(0x0F, reg <<4);
|
||||
MMC3_syncCHR(0x7F, reg <<7);
|
||||
MMC3_syncMirror();
|
||||
} else {
|
||||
MMC1_syncPRG(0x07, reg <<3);
|
||||
MMC1_syncCHR(0x1F, reg <<5);
|
||||
MMC1_syncMirror();
|
||||
}
|
||||
}
|
||||
|
||||
static void applyMode (uint8 clear) {
|
||||
PPU_hook = NULL;
|
||||
MapIRQHook = NULL;
|
||||
GameHBIRQHook = NULL;
|
||||
if (reg &0x01)
|
||||
MMC3_activate(clear, sync, MMC3_TYPE_AX5202P, NULL, NULL, NULL, NULL);
|
||||
else
|
||||
MMC1_activate(clear, sync, MMC1_TYPE_MMC1B, NULL, NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
static void reset (void) {
|
||||
reg++;
|
||||
applyMode(1);
|
||||
}
|
||||
|
||||
static void power (void) {
|
||||
reg = 0;
|
||||
applyMode(1);
|
||||
}
|
||||
|
||||
static void restore (int version) {
|
||||
applyMode(0);
|
||||
}
|
||||
|
||||
void Mapper613_Init (CartInfo *info) {
|
||||
MMC1_addExState();
|
||||
MMC3_addExState();
|
||||
info->Reset = reset;
|
||||
info->Power = power;
|
||||
GameStateRestore = restore;
|
||||
AddExState(®, 1, 0, "EXPR");
|
||||
}
|
||||
@@ -1029,6 +1029,7 @@ INES_BOARD_BEGIN()
|
||||
INES_BOARD( "63-100", 609, Mapper609_Init )
|
||||
INES_BOARD( "J-2042", 610, Mapper610_Init )
|
||||
INES_BOARD( "T-124/43-117/831049", 611, Mapper611_Init )
|
||||
INES_BOARD( "S5668 3366", 613, Mapper613_Init )
|
||||
INES_BOARD( "K-3044", 616, Mapper616_Init )
|
||||
INES_BOARD_END()
|
||||
|
||||
|
||||
@@ -498,6 +498,7 @@ void Mapper608_Init(CartInfo *);
|
||||
void Mapper609_Init(CartInfo *);
|
||||
void Mapper610_Init(CartInfo *);
|
||||
void Mapper611_Init(CartInfo *);
|
||||
void Mapper613_Init(CartInfo *);
|
||||
void Mapper616_Init(CartInfo *);
|
||||
void FFE_Init(CartInfo *);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user