Add mappers 360, 533

This commit is contained in:
negativeExponent
2020-02-01 09:33:44 +08:00
parent 81058f3558
commit 9150960326
4 changed files with 137 additions and 0 deletions

67
src/boards/360.c Normal file
View File

@@ -0,0 +1,67 @@
/* FCEUmm - NES/Famicom Emulator
*
* Copyright notice for this file:
* Copyright (C) 2020 negativeExponent
*
* 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.
*/
/* NES 2.0 Mapper 360 - Bit Corp's 31-in-1 multicart (3150) */
#include "mapinc.h"
static uint8 dipswitch;
static SFORMAT StateRegs[] =
{
{ &dipswitch, 1, "DPSW" },
{ 0 }
};
static void Sync(void) {
/* dip 0 and 1 is the same game SMB) */
if (dipswitch < 2)
setprg32(0x8000, dipswitch >> 1);
else {
setprg16(0x8000, dipswitch);
setprg16(0xC000, dipswitch);
}
setchr8(dipswitch);
setmirror(((dipswitch & 0x10) >> 4) ^ 1);
}
static void M360Power(void) {
dipswitch = 0;
Sync();
SetReadHandler(0x8000, 0xFFFF, CartBR);
SetWriteHandler(0x8000, 0XFFFF, CartBW);
}
static void M360Reset(void) {
dipswitch = (dipswitch + 1) & 31;
Sync();
FCEU_printf("dipswitch = %d\n", dipswitch);
}
static void StateRestore(int version) {
Sync();
}
void Mapper360_Init(CartInfo *info) {
info->Reset = M360Reset;
info->Power = M360Power;
GameStateRestore = StateRestore;
AddExState(&StateRegs, ~0, 0, 0);
}

66
src/boards/533.c Normal file
View File

@@ -0,0 +1,66 @@
/* FCEUmm - NES/Famicom Emulator
*
* Copyright notice for this file:
* Copyright (C) 2020 negativeExponent
*
* 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.
*/
/* NES 2.0 Mapper 533 is used for the Sachen 3014 board, used for the game
* 動動腦 II: 國中英文(一) (Dòngdòngnǎo II: Guózhōng Yīngwén (I),
* also known as Middle School English II, SA-003).
* It's a CNROM-like board with the added ability to read back
* the latch content for protection purposes.
*/
#include "mapinc.h"
static uint8 latche;
static SFORMAT StateRegs[] = {
{ &latche, 1, "LATC" },
{ 0 }
};
static void Sync(void) {
setprg32(0x8000, 0);
setchr8((latche >> 4) & 1);
}
static DECLFR(M533Read) {
return ((PRGptr[0][A] & 0xF0) | (latche >> 4));
}
static DECLFW(M533Write) {
latche = (V & CartBR(A));
Sync();
}
static void M533Power(void) {
Sync();
SetReadHandler(0x8000, 0xFFFF, CartBROB);
SetReadHandler(0xE000, 0xEFFF, M533Read);
SetWriteHandler(0x8000, 0xFFFF, M533Write);
}
static void StateRestore(int version) {
Sync();
}
void Mapper533_Init(CartInfo* info) {
info->Power = M533Power;
GameStateRestore = StateRestore;
AddExState(&StateRegs, ~0, 0, 0);
}

View File

@@ -671,6 +671,8 @@ static BMAPPINGLocal bmap[] = {
{(uint8_t*)"8-in-1 JY-119", 267, Mapper267_Init },
{(uint8_t*)"MMC3 BMC PIRATE", 294, Bs5652_Init}, /* nesdev redirects this as mapper 134 */
{(uint8_t*)"TXC 01-22110-000", 297, Mapper297_Init},
{(uint8_t*)"Bitcorp 31-in-1", 360, Mapper360_Init},
{(uint8_t*)"Sachen 3014", 533, Mapper533_Init},
/* UNIF to NES 2.0 BOARDS */

View File

@@ -247,10 +247,12 @@ void Mapper267_Init(CartInfo *);
void Mapper288_Init(CartInfo *);
void Mapper297_Init(CartInfo *);
void Mapper357_Init(CartInfo *);
void Mapper360_Init(CartInfo *);
void Mapper372_Init(CartInfo *);
void Mapper374_Init(CartInfo *);
void Mapper381_Init(CartInfo *);
void Mapper390_Init(CartInfo *);
void Mapper533_Init(CartInfo *);
void Mapper538_Init(CartInfo *);
void Mapper541_Init(CartInfo *);