From ea644c27079c6503aa29dd4a74423106c455d7a4 Mon Sep 17 00:00:00 2001 From: alyosha-tas Date: Thu, 27 Oct 2016 21:27:35 -0400 Subject: [PATCH] more VS system updates Start Supporting 2c05 boards --- .../Consoles/Nintendo/NES/NES.Core.cs | 7 +++--- .../Consoles/Nintendo/NES/PPU.regs.cs | 25 +++++++++++++++---- 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.Core.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.Core.cs index bf96f8f5cf..669ea9bd2f 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.Core.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.Core.cs @@ -40,7 +40,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES //variable set when VS system games are running public bool _isVS = false; //some VS games have a ppu that switches 2000 and 2001, so keep trcak of that - public bool _isVS2c05 = false; + public byte _isVS2c05 = 0; //since prg reg for VS System is set in the controller regs, it is convenient to have it here //instead of in the board public byte VS_chr_reg; @@ -920,7 +920,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES if (cart.DB_GameInfo.Hash == "C145803B5FEE71172A890606A44C6D5DF6D2FA8F" // VS Star Luster || cart.DB_GameInfo.Hash == "E0572DA111D05BF622EC137DF8A658F7B0687DDF" // VS Battle City || cart.DB_GameInfo.Hash == "D232F7BE509E3B745D9E9803DA945C3FABA37A70" // VS Ninja Jajamurru Kun - + || cart.DB_GameInfo.Hash == "CAE9CB4C0452C56BED58AEACCEACE8A3107F843A" // mighty bomb jack ) SetPalette(Palettes.palette_2c03_2c05); @@ -931,8 +931,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES ) SetPalette(Palettes.palette_2c04_001); - if (cart.DB_GameInfo.Hash == "CAE9CB4C0452C56BED58AEACCEACE8A3107F843A" // VS Mighty Bomb Jack (J) - || cart.DB_GameInfo.Hash == "4E38B4C231C44BB1408AC6C6F941A136DD33D0EB" // VS Platoon + if (cart.DB_GameInfo.Hash == "4E38B4C231C44BB1408AC6C6F941A136DD33D0EB" // VS Platoon || cart.DB_GameInfo.Hash == "F8A0F2C5A4B7212CB35F53EA7193B3DD85D6E1CD" // VS Mach Rider || cart.DB_GameInfo.Hash == "F8ED6FAFA057DBEEB0398EECCC9DE91747D479AD" // VS Mach Rider [b1] diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/PPU.regs.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/PPU.regs.cs index f715a70f8e..bce6787160 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/PPU.regs.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/PPU.regs.cs @@ -57,7 +57,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES // this byte is used to simulate open bus reads and writes // it should be modified by every read and write to a ppu register - public byte ppu_open_bus; + public byte ppu_open_bus=0; public bool s_latch_clear; public bool d_latch_clear; public int double_2007_read; // emulates a hardware bug of back to back 2007 reads @@ -382,6 +382,21 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } byte peek_2002() { + //I'm not happy with this, but apparently this is how mighty bobm jack VS works. + //quite strange that is makes the sprite hit flag go high like this + if (nes._isVS2c05==2) + { + if (nes.Frame<4) + { + + return (byte)((Reg2002_vblank_active << 7) | (Reg2002_objhit << 6) | (1 << 5) | (0x1D)); + } + else + { + return (byte)((Reg2002_vblank_active << 7) | (Reg2002_objhit << 6) | (Reg2002_objoverflow << 5) | (0x1D)); + } + + } return (byte)((Reg2002_vblank_active << 7) | (Reg2002_objhit << 6) | (Reg2002_objoverflow << 5) | (ppu_open_bus & 0x1F)); } @@ -613,14 +628,14 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { case 0: { - if (nes._isVS2c05) + if (nes._isVS2c05>0) return read_2001(); else return read_2000(); } case 1: { - if (nes._isVS2c05) + if (nes._isVS2c05>0) return read_2000(); else return read_2001(); @@ -670,13 +685,13 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES switch (addr) { case 0: - if (nes._isVS2c05) + if (nes._isVS2c05>0) write_2001(value); else write_2000(value); break; case 1: - if (nes._isVS2c05) + if (nes._isVS2c05>0) write_2000(value); else write_2001(value);