Add mapper 277

This commit is contained in:
libretroadmin
2024-06-09 18:16:27 +02:00
parent 25b83453af
commit 06287bc8e8
3 changed files with 66 additions and 0 deletions

64
src/boards/277.c Normal file
View File

@@ -0,0 +1,64 @@
/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
* Copyright (C) 2006 CaH4e3
* Copyright (C) 2023
*
* 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 "latch.h"
static void Sync(void) {
if (!(latch.data & 1) && (latch.data & 8)) {
setprg16(0x8000, latch.data & ~1);
setprg16(0xC000, latch.data | 1);
} else {
if (latch.data & 8) {
setprg16(0x8000, latch.data);
setprg16(0xC000, latch.data);
} else {
setprg16(0x8000, latch.data);
setprg16(0xC000, latch.data | 7);
}
}
setchr8(0);
setmirror(((latch.data >> 4) & 1) ^ 1);
}
static DECLFW(M277Write) {
if (!(latch.data & 0x20)) {
LatchWrite(A, V);
}
}
static void M277Power(void) {
LatchPower();
latch.data = 8;
Sync();
SetWriteHandler(0x8000, 0xFFFF, M277Write);
}
static void M277Reset() {
latch.data = 0x08;
Sync();
}
void Mapper277_Init(CartInfo *info) {
Latch_Init(info, Sync, NULL, 0, 0);
info->Power = M277Power;
info->Reset = M277Reset;
}

View File

@@ -696,6 +696,7 @@ INES_BOARD_BEGIN()
INES_BOARD( "MGC-026", 271, Mapper271_Init )
INES_BOARD( "Akumajō Special: Boku Dracula-kun", 272, Mapper272_Init )
INES_BOARD( "80013-B", 274, BMC80013B_Init )
INES_BOARD( "", 277, Mapper277_Init )
INES_BOARD( "YY860417C", 281, Mapper281_Init )
INES_BOARD( "860224C", 282, Mapper282_Init )
INES_BOARD( "GS-2004/GS-2013", 283, Mapper283_Init )

View File

@@ -249,6 +249,7 @@ void Mapper255_Init(CartInfo *);
void GN45_Init(CartInfo *info); /* m361, m366 */
void Mapper272_Init(CartInfo *);
void Mapper277_Init(CartInfo *);
void Mapper281_Init(CartInfo *);
void Mapper282_Init(CartInfo *);
void Mapper283_Init(CartInfo *);