From 542db672b6916993d1c00343f38d6cc9f9b5e3f9 Mon Sep 17 00:00:00 2001 From: adelikat Date: Wed, 19 Oct 2016 18:54:55 -0500 Subject: [PATCH] NesHawk - implement mapper 198 --- Assets/gamedb/gamedb.txt | 5 ++ .../BizHawk.Emulation.Cores.csproj | 1 + .../NES/Boards/MMC3_family/Mapper198.cs | 54 +++++++++++++++++++ 3 files changed, 60 insertions(+) create mode 100644 BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper198.cs diff --git a/Assets/gamedb/gamedb.txt b/Assets/gamedb/gamedb.txt index b2990000b9..a5b43bbb78 100644 --- a/Assets/gamedb/gamedb.txt +++ b/Assets/gamedb/gamedb.txt @@ -174,6 +174,11 @@ sha1:D565A9C2B117447C310E4F59E4AFC30DF299EA4F G Street Fighter IV (Unl) NES boa sha1:B9F444FF60F60C177EEEC8671BEC3731B0F6FE49 G Tang Mu Li Xian Ji (Ch) NES board=MAPPER223;WRAM=16 sha1:EBD2B4A4067FD4A8F0D0ABD34C8FF1AF520D1EED G Super Blaster VII Turbo 28 (Unl) NES board=MAPPER083;prg=512;chr=256;wram=0; sha1:40409FEC8249EFDB772E6FFB2DCD41860C6CCA23 G Pegasus 4-in-1 (Unl) NES board=MAPPER232 +sha1:7EF667D9BF107B6512565177B9C62081077558F5 T Tenchi wo Kurau II - Shokatsu Koumei Den (J) [T+Chi] NES board=MAPPER198 +sha1:92CC033C1255F119B3A566EDCA10140C014FA479 T Tenchi wo Kurau II - Shokatsu Koumei Den (J) [T+Chi][a1] NES board=MAPPER198 +sha1:EEF617A022B8E45E0BDE088FED654C89AD4FAABF T Tenchi wo Kurau II - Shokatsu Koumei Den (J) [T+Chi][a2] NES board=MAPPER198 +sha1:3D49A357362160B16F03CC4BE7D8EAFB7108708D T Tenchi wo Kurau II - Shokatsu Koumei Den (J) [T+Chi(Trad)] NES board=MAPPER198 +sha1:7FB334A7375E17EA157415193DEE4FACC4EC2B34 T Tenchi wo Kurau II - Shokatsu Koumei Den (J) [T+Chi(Simp)] NES board=MAPPER198 ;;;;;;;;;;;;;;;;;;;----------------------------------------------------------------------- diff --git a/BizHawk.Emulation.Cores/BizHawk.Emulation.Cores.csproj b/BizHawk.Emulation.Cores/BizHawk.Emulation.Cores.csproj index 726a51b140..bdd367a11f 100644 --- a/BizHawk.Emulation.Cores/BizHawk.Emulation.Cores.csproj +++ b/BizHawk.Emulation.Cores/BizHawk.Emulation.Cores.csproj @@ -691,6 +691,7 @@ + diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper198.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper198.cs new file mode 100644 index 0000000000..c89c0a5c00 --- /dev/null +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper198.cs @@ -0,0 +1,54 @@ +using BizHawk.Common; + +namespace BizHawk.Emulation.Cores.Nintendo.NES +{ + public class Mapper198 : MMC3Board_Base + { + + public override bool Configure(NES.EDetectionOrigin origin) + { + switch (Cart.board_type) + { + case "MAPPER198": + break; + default: + return false; + } + + BaseSetup(); + prg_mask = 1024 / 8 - 1; + return true; + } + + protected override int Get_PRGBank_8K(int addr) + { + var val = base.Get_PRGBank_8K(addr); + if (val >= 0x50) + { + return val & 0x4F; + } + + return val; + } + + public override byte ReadEXP(int addr) + { + if (addr >= 0x1000) + { + return WRAM[addr - 0x1000]; + } + + return base.ReadEXP(addr); + } + + public override void WriteEXP(int addr, byte value) + { + if (addr >= 0x1000) + { + WRAM[addr - 0x1000] = value; + } + + base.WriteEXP(addr, value); + } + } +}