From c8727ae01fc051429a59c4b91189ef479d578be7 Mon Sep 17 00:00:00 2001 From: beirich Date: Sun, 10 Jul 2011 04:54:18 +0000 Subject: [PATCH] fix some gamedb stuff, add some genesis games to db, get genesis back to a state where it at least loads roms correctly --- BizHawk.Emulation/CPUs/68000/M68000.cs | 14 ++++- .../Consoles/Sega/Genesis/Genesis.cs | 7 +-- BizHawk.Emulation/Database/Database.cs | 4 +- BizHawk.MultiClient/HawkFile.cs | 2 +- BizHawk.MultiClient/LogConsole.cs | 16 +++--- BizHawk.MultiClient/MainForm.cs | 4 +- BizHawk.MultiClient/PlayMovie.cs | 4 +- BizHawk.MultiClient/RomGame.cs | 2 +- BizHawk.MultiClient/output/gamedb.txt | 52 ++++++++++++++++++- 9 files changed, 83 insertions(+), 22 deletions(-) diff --git a/BizHawk.Emulation/CPUs/68000/M68000.cs b/BizHawk.Emulation/CPUs/68000/M68000.cs index 2445f37383..68a9604284 100644 --- a/BizHawk.Emulation/CPUs/68000/M68000.cs +++ b/BizHawk.Emulation/CPUs/68000/M68000.cs @@ -109,7 +109,7 @@ namespace BizHawk.Emulation.CPUs.M68K public Action[] Opcodes = new Action[0x10000]; public ushort op; - public void Exec() + public void Step() { Console.WriteLine(Disassemble(PC)); @@ -117,6 +117,18 @@ namespace BizHawk.Emulation.CPUs.M68K PC += 2; Opcodes[op](); } + + public void ExecuteCycles(int cycles) + { + PendingCycles += cycles; + while (PendingCycles > 0) + { + Console.WriteLine(Disassemble(PC)); + op = (ushort)ReadWord(PC); + PC += 2; + Opcodes[op](); + } + } } [StructLayout(LayoutKind.Explicit)] diff --git a/BizHawk.Emulation/Consoles/Sega/Genesis/Genesis.cs b/BizHawk.Emulation/Consoles/Sega/Genesis/Genesis.cs index 9ee49c3f9a..e2034b2de1 100644 --- a/BizHawk.Emulation/Consoles/Sega/Genesis/Genesis.cs +++ b/BizHawk.Emulation/Consoles/Sega/Genesis/Genesis.cs @@ -91,7 +91,7 @@ namespace BizHawk.Emulation.Consoles.Sega public void StepMine() { - _MainCPU.Exec(); + _MainCPU.Step(); } public void StepHis() @@ -110,7 +110,7 @@ namespace BizHawk.Emulation.Consoles.Sega if (VDP.ScanLine < 224) VDP.RenderLine(); - MainCPU.Execute(488); + _MainCPU.ExecuteCycles(488); if (Z80Runnable) { //Console.WriteLine("running z80"); @@ -131,11 +131,9 @@ namespace BizHawk.Emulation.Consoles.Sega PSG.EndFrame(SoundCPU.TotalExecutedCycles); } - public CoreInputComm CoreInputComm { get; set; } public CoreOutputComm CoreOutputComm { get; private set; } - public IVideoProvider VideoProvider { get { return VDP; } @@ -197,7 +195,6 @@ namespace BizHawk.Emulation.Consoles.Sega public IList MemoryDomains { get { throw new NotImplementedException(); } } public MemoryDomain MainMemory { get { throw new NotImplementedException(); } } - public void Dispose() {} } } \ No newline at end of file diff --git a/BizHawk.Emulation/Database/Database.cs b/BizHawk.Emulation/Database/Database.cs index c90d472d82..cb4e86ee34 100644 --- a/BizHawk.Emulation/Database/Database.cs +++ b/BizHawk.Emulation/Database/Database.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Globalization; using System.IO; using System.Linq; using System.Threading; @@ -98,7 +97,7 @@ namespace BizHawk Game.System = items[3]; Game.MetaData = items.Length >= 6 ? items[5] : null; db[Game.hash] = Game; - } catch (Exception) + } catch { Console.WriteLine("Error parsing database entry: "+line); } @@ -125,6 +124,7 @@ namespace BizHawk var Game = new GameInfo(); Game.hash = hash; Game.MetaData = "NotInDatabase"; + Console.WriteLine("Game was not in DB. CRC: {0:X8} ", CRC32.Calculate(RomData)); string ext = Path.GetExtension(fileName).ToUpperInvariant(); diff --git a/BizHawk.MultiClient/HawkFile.cs b/BizHawk.MultiClient/HawkFile.cs index a4551fb846..59412df483 100644 --- a/BizHawk.MultiClient/HawkFile.cs +++ b/BizHawk.MultiClient/HawkFile.cs @@ -77,7 +77,7 @@ namespace BizHawk.MultiClient /// /// returns the extension of Name /// - public string Extension { get { return Path.GetExtension(Name); } } + public string Extension { get { return Path.GetExtension(Name).ToUpper(); } } /// /// Indicates whether this file is an archive diff --git a/BizHawk.MultiClient/LogConsole.cs b/BizHawk.MultiClient/LogConsole.cs index fa41c3016d..460d467d6d 100644 --- a/BizHawk.MultiClient/LogConsole.cs +++ b/BizHawk.MultiClient/LogConsole.cs @@ -1,9 +1,6 @@ using System; -using System.ComponentModel; -using System.Diagnostics; using System.IO; using System.Runtime.InteropServices; -using System.Windows.Forms; namespace BizHawk.MultiClient { @@ -14,17 +11,22 @@ namespace BizHawk.MultiClient [DllImport("kernel32.dll", SetLastError = true)] static extern bool FreeConsole(); - - public static bool ConsoleVisible { get; private set; } + + public static bool ConsoleVisible + { + get; + private set; + } public static void ShowConsole() { if (ConsoleVisible) return; AllocConsole(); ConsoleVisible = true; - var sout = new StreamWriter(Console.OpenStandardOutput()); - sout.AutoFlush = true; + var sout = new StreamWriter(Console.OpenStandardOutput()) {AutoFlush = true}; Console.SetOut(sout); + Console.Title = "BizHawk Message Log"; + } public static void HideConsole() diff --git a/BizHawk.MultiClient/MainForm.cs b/BizHawk.MultiClient/MainForm.cs index fd6ca24c77..e637641d24 100644 --- a/BizHawk.MultiClient/MainForm.cs +++ b/BizHawk.MultiClient/MainForm.cs @@ -837,7 +837,7 @@ namespace BizHawk.MultiClient nextEmulator = new PCEngine(NecSystemType.SuperGrafx); break; case "GEN": - nextEmulator = new Genesis(false);//TODO + nextEmulator = new Genesis(true);//TODO break; case "TI83": nextEmulator = new TI83(); @@ -1202,7 +1202,7 @@ namespace BizHawk.MultiClient double frameAdvanceTimestampDelta = (now - FrameAdvanceTimestamp).TotalMilliseconds; bool frameProgressTimeElapsed = Global.Config.FrameProgressDelayMs < frameAdvanceTimestampDelta; - if (Global.ClientControls["Frame Advance"] || PressFrameAdvance) + if (/*Global.ClientControls["Frame Advance"] || PressFrameAdvance*/KeyInput.IsPressed(SlimDX.DirectInput.Key.F)) { //handle the initial trigger of a frame advance if (FrameAdvanceTimestamp == DateTime.MinValue) diff --git a/BizHawk.MultiClient/PlayMovie.cs b/BizHawk.MultiClient/PlayMovie.cs index 9bea71b017..71c0d36550 100644 --- a/BizHawk.MultiClient/PlayMovie.cs +++ b/BizHawk.MultiClient/PlayMovie.cs @@ -114,9 +114,9 @@ namespace BizHawk.MultiClient Movie m = new Movie(path.CanonicalFullPath, MOVIEMODE.INACTIVE); m.PreLoadText(); //m.LoadMovie(); - if (path.Extension.ToUpper() == ".FM2") + if (path.Extension == ".FM2") m.SetHeaderLine(MovieHeader.PLATFORM, "NES"); - else if (path.Extension.ToUpper() == ".MC2") + else if (path.Extension == ".MC2") m.SetHeaderLine(MovieHeader.PLATFORM, "PCE"); MovieList.Add(m); } diff --git a/BizHawk.MultiClient/RomGame.cs b/BizHawk.MultiClient/RomGame.cs index ef26753ab5..f1d04e9870 100644 --- a/BizHawk.MultiClient/RomGame.cs +++ b/BizHawk.MultiClient/RomGame.cs @@ -34,7 +34,7 @@ namespace BizHawk.MultiClient RomData = new byte[length]; stream.Read(RomData, 0, length); - if (file.Extension == "SMD") + if (file.Extension == ".SMD") RomData = DeInterleaveSMD(RomData); var info = Database.GetGameInfo(RomData, file.Name); diff --git a/BizHawk.MultiClient/output/gamedb.txt b/BizHawk.MultiClient/output/gamedb.txt index e78732fdeb..77c6245afe 100644 --- a/BizHawk.MultiClient/output/gamedb.txt +++ b/BizHawk.MultiClient/output/gamedb.txt @@ -1,4 +1,7 @@ ;CRC Status Name System ID Notes MetaData Configurations + +; ************ Sega Master System / Sega Mark III ************ + F0F35C22 20 em 1 (BR) SMS 241F2707 D 20 in 1 menu [beta] SMS SMS newbie A581402E D 64-Color Palette Test Program SMS Charles MacDonald @@ -1256,6 +1259,8 @@ A463DDFA D Zoom Effect #1 1 SMS Charles MacDonald B97E110A D Zoom Effect #1 2 SMS Charles MacDonald 980FDC4B D Zoom Effect #1 3 SMS Charles MacDonald +; ************ Sega Game Gear ************ + F85A8CE8 5 in 1 Fun Pak GG 1D17D2A0 Aa Harimanada (JP) GG 1D01F999 The Addams Family GG @@ -1897,6 +1902,8 @@ F397F041 Zoop [A] GG Product code 88830 (Europe?) 3247FF8B Zoop [B] GG Product code 139048 (US?) 590F9C54 D Zoop'em Up GG +; ************ Sega-Game 1000 ************ + 26ECD094 The Black Onyx SG D8A87095 Bank Panic SG EA0F2691 Bomb Jack SG @@ -1981,6 +1988,8 @@ E2FD5201 Yamato SG BC5D20DF Zippy Race SG 093830D8 Zoom 909 (JP) SG +; ************ NEC TurboGrafx-16 / PC-Engine ************ + FDE08D6D 1943 PCE C8C7D63E Altered Beast PCE 8E71D4F3 Adventure Island PCE @@ -2255,15 +2264,56 @@ C4751503 V Impossamole (bad dump) PCE C4EB68A5 V World Court Tennis (bad dump) PCE D5C782F2 V Bonk's Adventure (bad dump) PCE +; ************ NEC SuperGrafx ************ + 8C4588E2 1941 SGX 4C2126B0 Aldynes SGX 3B13AF61 Battle Ace SGX B486A8ED Dai Makai Mura SGX 1F041166 Madoo Granzort SGX +; ************ TI-83 ************ + D4448D09BBFDE687C04F9E3310E023AB ti83_1.rom TI83 initPC=6ce -;--nes--; +; ************ Genesis / MegaDrive ************ + +F3D65BAA Air Busters GEN +778A0F00 Alex Kidd in the Enchanted Castle GEN +7CD8169E Atomic Robo Kid GEN +73DC0DD8 Decap Attack GEN +5F0BD984 Fatal Labyrinth GEN +5D8BF68B Gaiares GEN +D15F5C3C Galaxy Force II GEN +9F88A32E Gods GEN +E8182B90 Golden Axe GEN +725E0A18 Golden Axe II GEN +CE36E6CC Kid Chameleon GEN +F015C2AD Lemmings GEN +7BA49EDB The Lost Vikings GEN +79EBA28A Marble Madness GEN +6A70791B Michael Jackson's Moonwalker GEN +8F7DE05A Might and Magic GEN +6EF7104A Might and Magic III: Isles of Terra GEN +58A7F7B4 MUSHA Aleste GEN +EE7D9F4A OutRun GEN +0D07D0EF Phantasy Star 2 GEN +733DCDD5 Phantasy Star 3: Generations of Doom GEN +FE236442 Phantasy Star 4: The End of the Millenium GEN +88C8DD94 Quackshot Starring Donald Duck GEN +EC6CD5F0 Road Blasters GEN +F1E22F43 Sagaia GEN +713D377B Shadow Blasters GEN +BB6CF9BB Shove It! The Warehouse Game GEN +F9394E97 Sonic the Hedgehog GEN +BFF227C6 Streets of Rage GEN +CB2201A3 Super Hang-On GEN +EA1BC9AB Sword of Vermillion GEN +0A7148BF Thunder Force II GEN + +520644C0 V Strider (Bad dump) GEN + +; ************ NES / Famicom ************ ;these games seem to be in goodNES but not bootgod's DB. maybe secretly bad dumps or unknown variants. sha1:22E6986903141495BA4589AC65982F3FB4D0E37B Adventures of Lolo (U) NES board=NES-SEROM;PRG=32;CHR=32 sha1:99C18C91F051BFBA6836A7B6B213C77569D83767 After Burner 2 (J) NES board=SUNSOFT-4;PRG=128;CHR=256;WRAM=8