From 1003ed085bf7745176e9c9e6459efee3b73d43bb Mon Sep 17 00:00:00 2001 From: "andres.delikat" Date: Thu, 3 Mar 2011 17:07:12 +0000 Subject: [PATCH] NES - Implement SKROM Board. Zelda II more playable but still bugged, probably something I did wrong. Also added a menu item to enable/disable Rewind. TODO: Zelda II crashes with rewind enabled. --- .../Consoles/Nintendo/NES/Boards/SxROM.cs | 7 +- .../Consoles/Nintendo/NES/NES.cs | 1 + BizHawk.MultiClient/MainForm.Designer.cs | 84 +++++++++++-------- BizHawk.MultiClient/MainForm.cs | 6 ++ BizHawk.MultiClient/output/gamedb.txt | 2 +- 5 files changed, 61 insertions(+), 39 deletions(-) diff --git a/BizHawk.Emulation/Consoles/Nintendo/NES/Boards/SxROM.cs b/BizHawk.Emulation/Consoles/Nintendo/NES/Boards/SxROM.cs index 7a6357ff9e..5e6c45bcd1 100644 --- a/BizHawk.Emulation/Consoles/Nintendo/NES/Boards/SxROM.cs +++ b/BizHawk.Emulation/Consoles/Nintendo/NES/Boards/SxROM.cs @@ -217,6 +217,11 @@ namespace BizHawk.Emulation.Consoles.Nintendo.Boards RomInfo.CRAM_Size = 0; RomInfo.PRAM_Size = 0; break; + case "SKROM": + romInfo.CHR_Size = 128; + RomInfo.PRAM_Size = 8; + RomInfo.CRAM_Size = 0; + break; default: throw new InvalidOperationException(); } @@ -234,7 +239,7 @@ namespace BizHawk.Emulation.Consoles.Nintendo.Boards Debug.Assert(RomInfo.PRAM_Size == 0 || RomInfo.PRAM_Size == 8); if (RomInfo.PRAM_Size != 0) { - pram = new byte[RomInfo.CRAM_Size * 1024]; + pram = new byte[RomInfo.PRAM_Size * 1024]; pram_mask = pram.Length - 1; } else pram = new byte[0]; diff --git a/BizHawk.Emulation/Consoles/Nintendo/NES/NES.cs b/BizHawk.Emulation/Consoles/Nintendo/NES/NES.cs index 988e9ef446..8be0d10f74 100644 --- a/BizHawk.Emulation/Consoles/Nintendo/NES/NES.cs +++ b/BizHawk.Emulation/Consoles/Nintendo/NES/NES.cs @@ -674,6 +674,7 @@ namespace BizHawk.Emulation.Consoles.Nintendo case "GxROM": board = new Boards.GxROM(); break; case "SGROM": board = new Boards.SxROM("SGROM"); break; case "SNROM": board = new Boards.SxROM("SNROM"); break; + case "SKROM": board = new Boards.SxROM("SKROM"); break; case "SL2ROM": board = new Boards.SxROM("SL2ROM"); break; } diff --git a/BizHawk.MultiClient/MainForm.Designer.cs b/BizHawk.MultiClient/MainForm.Designer.cs index d5a4301e46..26206be2af 100644 --- a/BizHawk.MultiClient/MainForm.Designer.cs +++ b/BizHawk.MultiClient/MainForm.Designer.cs @@ -155,13 +155,14 @@ this.debuggerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.hexEditorToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.luaConsoleToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.helpToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); - this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.nESToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.pPUViewerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.nameTableViewerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.gameGenieCodesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.helpToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); + this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.enableRewindToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.menuStrip1.SuspendLayout(); this.SuspendLayout(); // @@ -884,26 +885,26 @@ // controllersToolStripMenuItem // this.controllersToolStripMenuItem.Name = "controllersToolStripMenuItem"; - this.controllersToolStripMenuItem.Size = new System.Drawing.Size(143, 22); + this.controllersToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.controllersToolStripMenuItem.Text = "&Controllers"; this.controllersToolStripMenuItem.Click += new System.EventHandler(this.controllersToolStripMenuItem_Click); // // hotkeysToolStripMenuItem // this.hotkeysToolStripMenuItem.Name = "hotkeysToolStripMenuItem"; - this.hotkeysToolStripMenuItem.Size = new System.Drawing.Size(143, 22); + this.hotkeysToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.hotkeysToolStripMenuItem.Text = "&Hotkeys"; this.hotkeysToolStripMenuItem.Click += new System.EventHandler(this.hotkeysToolStripMenuItem_Click); // // toolStripSeparator9 // this.toolStripSeparator9.Name = "toolStripSeparator9"; - this.toolStripSeparator9.Size = new System.Drawing.Size(140, 6); + this.toolStripSeparator9.Size = new System.Drawing.Size(149, 6); // // soundToolStripMenuItem // this.soundToolStripMenuItem.Name = "soundToolStripMenuItem"; - this.soundToolStripMenuItem.Size = new System.Drawing.Size(143, 22); + this.soundToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.soundToolStripMenuItem.Text = "&Sound"; this.soundToolStripMenuItem.Click += new System.EventHandler(this.soundToolStripMenuItem_Click); // @@ -912,9 +913,10 @@ this.gUIToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.pauseWhenMenuActivatedToolStripMenuItem, this.saveWindowPositionToolStripMenuItem, - this.startPausedToolStripMenuItem}); + this.startPausedToolStripMenuItem, + this.enableRewindToolStripMenuItem}); this.gUIToolStripMenuItem.Name = "gUIToolStripMenuItem"; - this.gUIToolStripMenuItem.Size = new System.Drawing.Size(143, 22); + this.gUIToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.gUIToolStripMenuItem.Text = "GUI"; this.gUIToolStripMenuItem.DropDownOpened += new System.EventHandler(this.gUIToolStripMenuItem_DropDownOpened); // @@ -963,7 +965,7 @@ this.miSpeed150, this.miSpeed200}); this.frameSkipToolStripMenuItem.Name = "frameSkipToolStripMenuItem"; - this.frameSkipToolStripMenuItem.Size = new System.Drawing.Size(143, 22); + this.frameSkipToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.frameSkipToolStripMenuItem.Text = "Speed/Skip"; this.frameSkipToolStripMenuItem.DropDownOpened += new System.EventHandler(this.frameSkipToolStripMenuItem_DropDownOpened); // @@ -1106,19 +1108,19 @@ // toolStripSeparator10 // this.toolStripSeparator10.Name = "toolStripSeparator10"; - this.toolStripSeparator10.Size = new System.Drawing.Size(140, 6); + this.toolStripSeparator10.Size = new System.Drawing.Size(149, 6); // // saveConfigToolStripMenuItem // this.saveConfigToolStripMenuItem.Name = "saveConfigToolStripMenuItem"; - this.saveConfigToolStripMenuItem.Size = new System.Drawing.Size(143, 22); + this.saveConfigToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.saveConfigToolStripMenuItem.Text = "Save Config"; this.saveConfigToolStripMenuItem.Click += new System.EventHandler(this.saveConfigToolStripMenuItem_Click); // // loadConfigToolStripMenuItem // this.loadConfigToolStripMenuItem.Name = "loadConfigToolStripMenuItem"; - this.loadConfigToolStripMenuItem.Size = new System.Drawing.Size(143, 22); + this.loadConfigToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.loadConfigToolStripMenuItem.Text = "Load Config"; // // toolsToolStripMenuItem @@ -1176,30 +1178,6 @@ this.luaConsoleToolStripMenuItem.Text = "Lua Console"; this.luaConsoleToolStripMenuItem.Click += new System.EventHandler(this.luaConsoleToolStripMenuItem_Click); // - // helpToolStripMenuItem - // - this.helpToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.helpToolStripMenuItem1, - this.aboutToolStripMenuItem}); - this.helpToolStripMenuItem.Name = "helpToolStripMenuItem"; - this.helpToolStripMenuItem.Size = new System.Drawing.Size(40, 20); - this.helpToolStripMenuItem.Text = "&Help"; - // - // helpToolStripMenuItem1 - // - this.helpToolStripMenuItem1.Enabled = false; - this.helpToolStripMenuItem1.Name = "helpToolStripMenuItem1"; - this.helpToolStripMenuItem1.Size = new System.Drawing.Size(152, 22); - this.helpToolStripMenuItem1.Text = "&Help"; - this.helpToolStripMenuItem1.Click += new System.EventHandler(this.helpToolStripMenuItem1_Click); - // - // aboutToolStripMenuItem - // - this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem"; - this.aboutToolStripMenuItem.Size = new System.Drawing.Size(152, 22); - this.aboutToolStripMenuItem.Text = "&About"; - this.aboutToolStripMenuItem.Click += new System.EventHandler(this.aboutToolStripMenuItem_Click); - // // nESToolStripMenuItem // this.nESToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { @@ -1231,6 +1209,37 @@ this.gameGenieCodesToolStripMenuItem.Size = new System.Drawing.Size(176, 22); this.gameGenieCodesToolStripMenuItem.Text = "&Game Genie Codes"; // + // helpToolStripMenuItem + // + this.helpToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.helpToolStripMenuItem1, + this.aboutToolStripMenuItem}); + this.helpToolStripMenuItem.Name = "helpToolStripMenuItem"; + this.helpToolStripMenuItem.Size = new System.Drawing.Size(40, 20); + this.helpToolStripMenuItem.Text = "&Help"; + // + // helpToolStripMenuItem1 + // + this.helpToolStripMenuItem1.Enabled = false; + this.helpToolStripMenuItem1.Name = "helpToolStripMenuItem1"; + this.helpToolStripMenuItem1.Size = new System.Drawing.Size(114, 22); + this.helpToolStripMenuItem1.Text = "&Help"; + this.helpToolStripMenuItem1.Click += new System.EventHandler(this.helpToolStripMenuItem1_Click); + // + // aboutToolStripMenuItem + // + this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem"; + this.aboutToolStripMenuItem.Size = new System.Drawing.Size(114, 22); + this.aboutToolStripMenuItem.Text = "&About"; + this.aboutToolStripMenuItem.Click += new System.EventHandler(this.aboutToolStripMenuItem_Click); + // + // enableRewindToolStripMenuItem + // + this.enableRewindToolStripMenuItem.Name = "enableRewindToolStripMenuItem"; + this.enableRewindToolStripMenuItem.Size = new System.Drawing.Size(220, 22); + this.enableRewindToolStripMenuItem.Text = "&Enable Rewind"; + this.enableRewindToolStripMenuItem.Click += new System.EventHandler(this.enableRewindToolStripMenuItem_Click); + // // MainForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -1386,6 +1395,7 @@ private System.Windows.Forms.ToolStripMenuItem pPUViewerToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem nameTableViewerToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem gameGenieCodesToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem enableRewindToolStripMenuItem; } } diff --git a/BizHawk.MultiClient/MainForm.cs b/BizHawk.MultiClient/MainForm.cs index e65a794728..edbfa93767 100644 --- a/BizHawk.MultiClient/MainForm.cs +++ b/BizHawk.MultiClient/MainForm.cs @@ -1054,6 +1054,7 @@ namespace BizHawk.MultiClient pauseWhenMenuActivatedToolStripMenuItem.Checked = Global.Config.PauseWhenMenuActivated; saveWindowPositionToolStripMenuItem.Checked = Global.Config.SaveWindowPosition; startPausedToolStripMenuItem.Checked = Global.Config.StartPaused; + enableRewindToolStripMenuItem.Checked = Global.Config.RewindEnabled; } private void MainForm_Load(object sender, EventArgs e) @@ -1129,5 +1130,10 @@ namespace BizHawk.MultiClient NESPPU n = new NESPPU(); n.Show(); } + + private void enableRewindToolStripMenuItem_Click(object sender, EventArgs e) + { + Global.Config.RewindEnabled ^= true; + } } } \ No newline at end of file diff --git a/BizHawk.MultiClient/output/gamedb.txt b/BizHawk.MultiClient/output/gamedb.txt index 6b36990b4b..d57eaac0e4 100644 --- a/BizHawk.MultiClient/output/gamedb.txt +++ b/BizHawk.MultiClient/output/gamedb.txt @@ -2338,7 +2338,7 @@ D9A1631D5C32D35594B9484862A26CBA Legend of Zelda, The (Rev 0) (U) NES board=SN B2D2D9ED68B3E5E0D29053EA525BD37C Metroid (U) NES board=SNROM;PRG=8 E12F3FD85F96F9A61FE38626A1B5CEFA Spot (J) NES board=SNROM;PRG=8 44F5B716CF5EE0164C151106D0E68DCE Spot (U) NES board=SNROM;PRG=8 -88C0493FB1146834836C0FF4F3E06E45 Zelda II - The Adventure of Link (U) NES board=SL2ROM;PRG=8;CHR=16 +88C0493FB1146834836C0FF4F3E06E45 Zelda II - The Adventure of Link (U) NES board=SKROM;PRG=8;CHR=16 ;UNROM 29E5E1A5F8B400773EF9D959044456B2 3-D Battles of World Running (U) NES board=UNROM;mirror=V;PRG=8