Backport r171 - UNIF 158B - new board for "Blood of Jurassic" dump
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
[Project]
|
[Project]
|
||||||
FileName=Fceuwin.dev
|
FileName=Fceuwin.dev
|
||||||
Name=Fceu
|
Name=Fceu
|
||||||
UnitCount=295
|
UnitCount=297
|
||||||
Type=0
|
Type=0
|
||||||
Ver=1
|
Ver=1
|
||||||
ObjFiles=
|
ObjFiles=
|
||||||
@@ -2648,9 +2648,9 @@ OverrideBuildCmd=0
|
|||||||
BuildCmd=
|
BuildCmd=
|
||||||
|
|
||||||
[Unit297]
|
[Unit297]
|
||||||
FileName=src\boards\246.c
|
FileName=src\boards\158B.c
|
||||||
CompileCpp=0
|
CompileCpp=0
|
||||||
Folder=boards
|
Folder=boards/mmc3 based
|
||||||
Compile=1
|
Compile=1
|
||||||
Link=1
|
Link=1
|
||||||
Priority=1000
|
Priority=1000
|
||||||
|
|||||||
71
src/boards/158B.c
Normal file
71
src/boards/158B.c
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
/* FCE Ultra - NES/Famicom Emulator
|
||||||
|
*
|
||||||
|
* Copyright notice for this file:
|
||||||
|
* Copyright (C) 2015 CaH4e3
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
*
|
||||||
|
* "Blood Of Jurassic" protected MMC3 based board (GD-98 Cart ID, 158B PCB ID)
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "mapinc.h"
|
||||||
|
#include "mmc3.h"
|
||||||
|
|
||||||
|
static uint8 lut[8] = { 0x00, 0x00, 0x00, 0x01, 0x02, 0x04, 0x0F, 0x00 };
|
||||||
|
|
||||||
|
static void UNL158BPW(uint32 A, uint8 V) {
|
||||||
|
if (EXPREGS[0] & 0x80) {
|
||||||
|
uint32 bank = EXPREGS[0] & 7;
|
||||||
|
if(EXPREGS[0] & 0x20) { // 32Kb mode
|
||||||
|
setprg32(0x8000, bank >> 1);
|
||||||
|
} else { // 16Kb mode
|
||||||
|
setprg16(0x8000, bank);
|
||||||
|
setprg16(0xC000, bank);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
setprg8(A, V & 0xF);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static DECLFW(UNL158BProtWrite) {
|
||||||
|
EXPREGS[A & 7] = V;
|
||||||
|
switch(A & 7) {
|
||||||
|
case 0:
|
||||||
|
FixMMC3PRG(MMC3_cmd);
|
||||||
|
break;
|
||||||
|
case 7:
|
||||||
|
FCEU_printf("UNK PROT WRITE\n");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
static DECLFR(UNL158BProtRead) {
|
||||||
|
return X.DB | lut[A & 7];
|
||||||
|
}
|
||||||
|
|
||||||
|
static void UNL158BPower(void) {
|
||||||
|
GenMMC3Power();
|
||||||
|
SetWriteHandler(0x5000, 0x5FFF, UNL158BProtWrite);
|
||||||
|
SetReadHandler(0x5000, 0x5FFF, UNL158BProtRead);
|
||||||
|
}
|
||||||
|
|
||||||
|
void UNL158B_Init(CartInfo *info) {
|
||||||
|
GenMMC3_Init(info, 128, 128, 0, 0);
|
||||||
|
pwrap = UNL158BPW;
|
||||||
|
info->Power = UNL158BPower;
|
||||||
|
AddExState(EXPREGS, 6, 0, "EXPR");
|
||||||
|
}
|
||||||
@@ -191,6 +191,10 @@ static int DetectMMC1WRAMSize(uint32 crc32) {
|
|||||||
FCEU_printf(" >8KB external WRAM present. Use UNIF if you hack the ROM image.\n");
|
FCEU_printf(" >8KB external WRAM present. Use UNIF if you hack the ROM image.\n");
|
||||||
return(16);
|
return(16);
|
||||||
break;
|
break;
|
||||||
|
case 0xd1e50064: /* Dezaemon */
|
||||||
|
FCEU_printf(" >8KB external WRAM present. Use UNIF if you hack the ROM image.\n");
|
||||||
|
return(32);
|
||||||
|
break;
|
||||||
default: return(8);
|
default: return(8);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -450,6 +450,7 @@ static BMAPPING bmap[] = {
|
|||||||
{ "VRC7", UNLVRC7_Init, 0 },
|
{ "VRC7", UNLVRC7_Init, 0 },
|
||||||
{ "YOKO", UNLYOKO_Init, 0 },
|
{ "YOKO", UNLYOKO_Init, 0 },
|
||||||
{ "COOLBOY", COOLBOY_Init, BMCFLAG_256KCHRR },
|
{ "COOLBOY", COOLBOY_Init, BMCFLAG_256KCHRR },
|
||||||
|
{ "158B", UNL158B_Init, 0 },
|
||||||
|
|
||||||
#ifdef COPYFAMI
|
#ifdef COPYFAMI
|
||||||
{ "COPYFAMI_MMC3", MapperCopyFamiMMC3_Init, 0 },
|
{ "COPYFAMI_MMC3", MapperCopyFamiMMC3_Init, 0 },
|
||||||
|
|||||||
@@ -146,6 +146,7 @@ void UNLVRC7_Init(CartInfo *info);
|
|||||||
void UNLYOKO_Init(CartInfo *info);
|
void UNLYOKO_Init(CartInfo *info);
|
||||||
void UNROM_Init(CartInfo *info);
|
void UNROM_Init(CartInfo *info);
|
||||||
void COOLBOY_Init(CartInfo *info);
|
void COOLBOY_Init(CartInfo *info);
|
||||||
|
void UNL158B_Init(CartInfo *info);
|
||||||
|
|
||||||
#ifdef COPYFAMI
|
#ifdef COPYFAMI
|
||||||
void MapperCopyFamiMMC3_Init(CartInfo *info);
|
void MapperCopyFamiMMC3_Init(CartInfo *info);
|
||||||
|
|||||||
Reference in New Issue
Block a user