From ee9f96c5404c20248d8e82a6f5497f6683099f5e Mon Sep 17 00:00:00 2001 From: Oggom Date: Wed, 23 Aug 2017 20:18:38 +0200 Subject: [PATCH] Backport r183 - UNIF RT-01 - new dump "Dlya Proverki TV Pristavok" --- src/boards/rt-01.c | 53 ++++++++++++++++++++++++++++++++++++++++++++++ src/unif.c | 1 + src/unif.h | 1 + 3 files changed, 55 insertions(+) create mode 100644 src/boards/rt-01.c diff --git a/src/boards/rt-01.c b/src/boards/rt-01.c new file mode 100644 index 0000000..c724b74 --- /dev/null +++ b/src/boards/rt-01.c @@ -0,0 +1,53 @@ +/* FCE Ultra - NES/Famicom Emulator + * + * Copyright notice for this file: + * Copyright (C) 2016 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 + * + * Test Ver. 1.01 Dlya Proverki TV Pristavok (RT-01, by SS aka Snake) + * A simple board with 16K PRG ROM + 2K CHR ROM with no mapper, hardwired mirroring + * PRG EPROM has copy protected areas with "weak bits", which is tested at some + * points of the program. Trying to simalate "weak bits" behaviour + * + */ + +#include "mapinc.h" + +static DECLFR(UNLRT01Read) { +// u16 i, prot_areas[2][2] = { +// { 0x8E80, 0x8EFF }, +// { 0xFE80, 0xFEFF }, +// }; + if(((A >= 0xCE80) && (A < 0xCF00)) || + ((A >= 0xFE80) && (A < 0xFF00))) { + return 0xF2 | (rand() & 0x0D); + } else + return CartBR(A); +} + +static void UNLRT01Power(void) { + setprg16(0x8000, 0); + setprg16(0xC000, 0); + setchr2(0x0000,0); + setchr2(0x0800,0); + setchr2(0x1000,0); + setchr2(0x1800,0); + SetReadHandler(0x8000, 0xFFFF, UNLRT01Read); +} + +void UNLRT01_Init(CartInfo *info) { + info->Power = UNLRT01Power; +} diff --git a/src/unif.c b/src/unif.c index 0ce37b7..a1a96c1 100644 --- a/src/unif.c +++ b/src/unif.c @@ -460,6 +460,7 @@ static BMAPPING bmap[] = { { "EH8813A", UNLEH8813A_Init, 0 }, { "HP898F", BMCHP898F_Init, 0 }, { "F-15", BMCF15_Init, 0 }, + { "RT-01", UNLRT01_Init, 0 }, { "81-01-31-C", BMC810131C_Init, 0 }, { "8-IN-1", BMC8IN1_Init, 0 }, diff --git a/src/unif.h b/src/unif.h index 5d3073c..29a8804 100644 --- a/src/unif.h +++ b/src/unif.h @@ -154,6 +154,7 @@ void UNLBMW8544_Init(CartInfo *info); void UNLEH8813A_Init(CartInfo *info); void BMCHP898F_Init(CartInfo *info); void BMCF15_Init(CartInfo *info); +void UNLRT01_Init(CartInfo *info); void BMC810131C_Init(CartInfo *info); void BMC8IN1_Init(CartInfo *info);