Add mapper 465
This commit is contained in:
89
src/boards/465.c
Normal file
89
src/boards/465.c
Normal file
@@ -0,0 +1,89 @@
|
||||
/* FCEUmm - NES/Famicom Emulator
|
||||
*
|
||||
* Copyright notice for this file:
|
||||
* Copyright (C) 2022
|
||||
*
|
||||
* 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"
|
||||
|
||||
static uint16 latchAddr;
|
||||
static uint8 latchData;
|
||||
|
||||
static SFORMAT StateRegs[] =
|
||||
{
|
||||
{ &latchAddr, 2, "ADDR" },
|
||||
{ &latchData, 1, "DATA" },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
static void Mapper465_Sync(void)
|
||||
{
|
||||
int prg =latchAddr >>2 &0x1F | latchAddr >>5 &0x20;
|
||||
if (latchAddr &0x200)
|
||||
{
|
||||
setprg16(0x8000, prg &~7 | latchData &7);
|
||||
setprg16(0xC000, prg | 7);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (latchAddr &0x001)
|
||||
{
|
||||
setprg32(0x8000, prg >>1);
|
||||
}
|
||||
else
|
||||
{
|
||||
setprg16(0x8000, prg);
|
||||
setprg16(0xC000, prg);
|
||||
}
|
||||
}
|
||||
setchr8(0);
|
||||
setmirror(latchAddr &0x002? MI_H: MI_V);
|
||||
}
|
||||
|
||||
static DECLFW(Mapper465_WriteLatch)
|
||||
{
|
||||
if (latchAddr &0x200)
|
||||
{
|
||||
latchData =V;
|
||||
}
|
||||
else
|
||||
{
|
||||
latchAddr =A &0xFFFF;
|
||||
}
|
||||
Mapper465_Sync();
|
||||
}
|
||||
|
||||
static void Mapper465_Reset(void)
|
||||
{
|
||||
latchAddr =latchData =0;
|
||||
Mapper465_Sync();
|
||||
}
|
||||
|
||||
static void Mapper465_Power(void)
|
||||
{
|
||||
latchAddr =latchData =0;
|
||||
Mapper465_Sync();
|
||||
SetWriteHandler(0x8000, 0xFFFF, Mapper465_WriteLatch);
|
||||
SetReadHandler(0x6000, 0xFFFF, CartBR);
|
||||
}
|
||||
|
||||
void Mapper465_Init(CartInfo *info)
|
||||
{
|
||||
info->Power = Mapper465_Power;
|
||||
info->Reset = Mapper465_Reset;
|
||||
AddExState(StateRegs, ~0, 0, 0);
|
||||
}
|
||||
@@ -792,4 +792,4 @@ static void M464Sync(void) {
|
||||
|
||||
void Mapper464_Init(CartInfo *info) {
|
||||
Latch_Init(info, M464Sync, NULL, 0x0000, 0x8000, 0xFFFF, 1);
|
||||
}
|
||||
}
|
||||
@@ -823,6 +823,7 @@ INES_BOARD_BEGIN()
|
||||
INES_BOARD( "8-in-1", 459, Mapper459_Init )
|
||||
INES_BOARD( "YH810X1", 463, Mapper463_Init )
|
||||
INES_BOARD( "NTDEC 9012", 464, Mapper464_Init )
|
||||
INES_BOARD( "ET-120", 465, Mapper465_Init )
|
||||
INES_BOARD( "Keybyte Computer", 466, Mapper466_Init )
|
||||
INES_BOARD( "47-2", 467, Mapper467_Init )
|
||||
INES_BOARD( "SA-9602B", 513, SA9602B_Init )
|
||||
|
||||
@@ -331,6 +331,7 @@ void Mapper456_Init(CartInfo *);
|
||||
void Mapper459_Init(CartInfo *);
|
||||
void Mapper463_Init(CartInfo *);
|
||||
void Mapper464_Init(CartInfo *);
|
||||
void Mapper465_Init(CartInfo *);
|
||||
void Mapper466_Init(CartInfo *);
|
||||
void Mapper467_Init(CartInfo *);
|
||||
void Mapper516_Init(CartInfo *);
|
||||
|
||||
Reference in New Issue
Block a user