GameboyHawk - Skip BIOS menu option

This commit is contained in:
adelikat 2012-05-19 15:17:32 +00:00
parent b08d338761
commit 147caec758
5 changed files with 111 additions and 77 deletions

View File

@ -6,7 +6,7 @@ namespace BizHawk.Emulation.Consoles.Gameboy
{
public partial class Gameboy : IEmulator, IVideoProvider
{
private bool skipBIOS = false;
private int _lagcount = 0;
private bool lagged = true;
private bool islag = false;
@ -265,8 +265,9 @@ namespace BizHawk.Emulation.Consoles.Gameboy
public Z80 Cpu;
public MemoryMapper Mapper;
public Gameboy(GameInfo game, byte[] rom)
public Gameboy(GameInfo game, byte[] rom, bool SkipBIOS)
{
skipBIOS = SkipBIOS;
CoreOutputComm = new CoreOutputComm();
CartType = (ECartType)rom[0x0147];
Mapper = new MemoryMapper(this);
@ -281,7 +282,10 @@ namespace BizHawk.Emulation.Consoles.Gameboy
public void HardReset()
{
Cpu = new CPUs.Z80GB.Z80();
Cpu.ReadMemory = ReadMemoryBios;
if (skipBIOS)
Cpu.ReadMemory = ReadMemory;
else
Cpu.ReadMemory = ReadMemoryBios;
Cpu.WriteMemory = WriteMemory;
Cpu.Reset();

View File

@ -334,6 +334,7 @@ namespace BizHawk.MultiClient
//GB Debugger settings
public bool AutoloadGBDebugger = false;
public bool GBDebuggerSaveWindowPosition = true;
public bool GameBoySkipBIOS = true;
// Cheats Dialog
public bool AutoLoadCheats = false;

View File

@ -217,6 +217,8 @@
this.rightDifficultyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.gBToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.debuggerToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator8 = new System.Windows.Forms.ToolStripSeparator();
this.skipBIOSIntroToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.helpToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.forumsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@ -270,6 +272,7 @@
this.menuStrip1.ClickThrough = true;
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.fileToolStripMenuItem,
this.helpToolStripMenuItem,
this.emulationToolStripMenuItem,
this.viewToolStripMenuItem,
this.configToolStripMenuItem,
@ -279,8 +282,7 @@
this.sMSToolStripMenuItem,
this.tI83ToolStripMenuItem,
this.atariToolStripMenuItem,
this.gBToolStripMenuItem,
this.helpToolStripMenuItem});
this.gBToolStripMenuItem});
this.menuStrip1.LayoutStyle = System.Windows.Forms.ToolStripLayoutStyle.Flow;
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
this.menuStrip1.Name = "menuStrip1";
@ -1851,19 +1853,34 @@
// gBToolStripMenuItem
//
this.gBToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.debuggerToolStripMenuItem1});
this.debuggerToolStripMenuItem1,
this.toolStripSeparator8,
this.skipBIOSIntroToolStripMenuItem});
this.gBToolStripMenuItem.Name = "gBToolStripMenuItem";
this.gBToolStripMenuItem.Size = new System.Drawing.Size(34, 19);
this.gBToolStripMenuItem.Text = "GB";
this.gBToolStripMenuItem.DropDownOpened += new System.EventHandler(this.gBToolStripMenuItem_DropDownOpened);
//
// debuggerToolStripMenuItem1
//
this.debuggerToolStripMenuItem1.Image = global::BizHawk.MultiClient.Properties.Resources.Bug;
this.debuggerToolStripMenuItem1.Name = "debuggerToolStripMenuItem1";
this.debuggerToolStripMenuItem1.Size = new System.Drawing.Size(126, 22);
this.debuggerToolStripMenuItem1.Size = new System.Drawing.Size(152, 22);
this.debuggerToolStripMenuItem1.Text = "Debugger";
this.debuggerToolStripMenuItem1.Click += new System.EventHandler(this.debuggerToolStripMenuItem1_Click);
//
// toolStripSeparator8
//
this.toolStripSeparator8.Name = "toolStripSeparator8";
this.toolStripSeparator8.Size = new System.Drawing.Size(149, 6);
//
// skipBIOSIntroToolStripMenuItem
//
this.skipBIOSIntroToolStripMenuItem.Name = "skipBIOSIntroToolStripMenuItem";
this.skipBIOSIntroToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.skipBIOSIntroToolStripMenuItem.Text = "Skip BIOS Intro";
this.skipBIOSIntroToolStripMenuItem.Click += new System.EventHandler(this.skipBIOSIntroToolStripMenuItem_Click);
//
// helpToolStripMenuItem
//
this.helpToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
@ -1878,7 +1895,7 @@
//
this.helpToolStripMenuItem1.Image = global::BizHawk.MultiClient.Properties.Resources.Help;
this.helpToolStripMenuItem1.Name = "helpToolStripMenuItem1";
this.helpToolStripMenuItem1.Size = new System.Drawing.Size(146, 22);
this.helpToolStripMenuItem1.Size = new System.Drawing.Size(152, 22);
this.helpToolStripMenuItem1.Text = "&Online Help...";
this.helpToolStripMenuItem1.Click += new System.EventHandler(this.helpToolStripMenuItem1_Click);
//
@ -1886,7 +1903,7 @@
//
this.forumsToolStripMenuItem.Image = global::BizHawk.MultiClient.Properties.Resources.TAStudio;
this.forumsToolStripMenuItem.Name = "forumsToolStripMenuItem";
this.forumsToolStripMenuItem.Size = new System.Drawing.Size(146, 22);
this.forumsToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.forumsToolStripMenuItem.Text = "Forums...";
this.forumsToolStripMenuItem.Click += new System.EventHandler(this.forumsToolStripMenuItem_Click);
//
@ -1894,7 +1911,7 @@
//
this.aboutToolStripMenuItem.Image = global::BizHawk.MultiClient.Properties.Resources.CorpHawkSmall;
this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem";
this.aboutToolStripMenuItem.Size = new System.Drawing.Size(146, 22);
this.aboutToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.aboutToolStripMenuItem.Text = "&About";
this.aboutToolStripMenuItem.Click += new System.EventHandler(this.aboutToolStripMenuItem_Click);
//
@ -2087,7 +2104,7 @@
this.cmiCloseRom,
this.cmiShowMenu});
this.contextMenuStrip1.Name = "contextMenuStrip1";
this.contextMenuStrip1.Size = new System.Drawing.Size(192, 396);
this.contextMenuStrip1.Size = new System.Drawing.Size(204, 374);
this.contextMenuStrip1.Closing += new System.Windows.Forms.ToolStripDropDownClosingEventHandler(this.contextMenuStrip1_Closing);
this.contextMenuStrip1.Opening += new System.ComponentModel.CancelEventHandler(this.contextMenuStrip1_Opening);
//
@ -2095,7 +2112,7 @@
//
this.cmiOpenRom.Image = global::BizHawk.MultiClient.Properties.Resources.OpenFile;
this.cmiOpenRom.Name = "cmiOpenRom";
this.cmiOpenRom.Size = new System.Drawing.Size(191, 22);
this.cmiOpenRom.Size = new System.Drawing.Size(203, 22);
this.cmiOpenRom.Text = "Open Rom";
this.cmiOpenRom.Click += new System.EventHandler(this.openRomToolStripMenuItem1_Click);
//
@ -2103,20 +2120,20 @@
//
this.cmiLoadLastRom.Image = global::BizHawk.MultiClient.Properties.Resources.Recent;
this.cmiLoadLastRom.Name = "cmiLoadLastRom";
this.cmiLoadLastRom.Size = new System.Drawing.Size(191, 22);
this.cmiLoadLastRom.Size = new System.Drawing.Size(203, 22);
this.cmiLoadLastRom.Text = "Load Last ROM";
this.cmiLoadLastRom.Click += new System.EventHandler(this.loadLastROMToolStripMenuItem_Click);
//
// toolStripSeparator_afterRomLoading
//
this.toolStripSeparator_afterRomLoading.Name = "toolStripSeparator_afterRomLoading";
this.toolStripSeparator_afterRomLoading.Size = new System.Drawing.Size(188, 6);
this.toolStripSeparator_afterRomLoading.Size = new System.Drawing.Size(200, 6);
//
// cmiRecordMovie
//
this.cmiRecordMovie.Image = global::BizHawk.MultiClient.Properties.Resources.RecordHS;
this.cmiRecordMovie.Name = "cmiRecordMovie";
this.cmiRecordMovie.Size = new System.Drawing.Size(191, 22);
this.cmiRecordMovie.Size = new System.Drawing.Size(203, 22);
this.cmiRecordMovie.Text = "Record Movie";
this.cmiRecordMovie.Click += new System.EventHandler(this.recordMovieToolStripMenuItem1_Click);
//
@ -2124,7 +2141,7 @@
//
this.cmiPlayMovie.Image = global::BizHawk.MultiClient.Properties.Resources.Play;
this.cmiPlayMovie.Name = "cmiPlayMovie";
this.cmiPlayMovie.Size = new System.Drawing.Size(191, 22);
this.cmiPlayMovie.Size = new System.Drawing.Size(203, 22);
this.cmiPlayMovie.Text = "Play Movie";
this.cmiPlayMovie.Click += new System.EventHandler(this.playMovieToolStripMenuItem1_Click);
//
@ -2132,7 +2149,7 @@
//
this.cmiRestartMovie.Image = global::BizHawk.MultiClient.Properties.Resources.restart;
this.cmiRestartMovie.Name = "cmiRestartMovie";
this.cmiRestartMovie.Size = new System.Drawing.Size(191, 22);
this.cmiRestartMovie.Size = new System.Drawing.Size(203, 22);
this.cmiRestartMovie.Text = "Restart Movie";
this.cmiRestartMovie.Click += new System.EventHandler(this.restartMovieToolStripMenuItem_Click);
//
@ -2140,7 +2157,7 @@
//
this.cmiStopMovie.Image = global::BizHawk.MultiClient.Properties.Resources.Stop;
this.cmiStopMovie.Name = "cmiStopMovie";
this.cmiStopMovie.Size = new System.Drawing.Size(191, 22);
this.cmiStopMovie.Size = new System.Drawing.Size(203, 22);
this.cmiStopMovie.Text = "Stop Movie";
this.cmiStopMovie.Click += new System.EventHandler(this.stopMovieToolStripMenuItem1_Click);
//
@ -2148,68 +2165,68 @@
//
this.cmiLoadLastMovie.Image = global::BizHawk.MultiClient.Properties.Resources.Recent;
this.cmiLoadLastMovie.Name = "cmiLoadLastMovie";
this.cmiLoadLastMovie.Size = new System.Drawing.Size(191, 22);
this.cmiLoadLastMovie.Size = new System.Drawing.Size(203, 22);
this.cmiLoadLastMovie.Text = "Load Last Movie";
this.cmiLoadLastMovie.Click += new System.EventHandler(this.loadLastMovieToolStripMenuItem_Click);
//
// cmiMakeMovieBackup
//
this.cmiMakeMovieBackup.Name = "cmiMakeMovieBackup";
this.cmiMakeMovieBackup.Size = new System.Drawing.Size(191, 22);
this.cmiMakeMovieBackup.Size = new System.Drawing.Size(203, 22);
this.cmiMakeMovieBackup.Text = "Make Movie Backup";
this.cmiMakeMovieBackup.Click += new System.EventHandler(this.makeMovieBackupToolStripMenuItem_Click);
//
// cmiViewSubtitles
//
this.cmiViewSubtitles.Name = "cmiViewSubtitles";
this.cmiViewSubtitles.Size = new System.Drawing.Size(191, 22);
this.cmiViewSubtitles.Size = new System.Drawing.Size(203, 22);
this.cmiViewSubtitles.Text = "View Subtitles";
this.cmiViewSubtitles.Click += new System.EventHandler(this.viewSubtitlesToolStripMenuItem_Click);
//
// cmiAddSubtitle
//
this.cmiAddSubtitle.Name = "cmiAddSubtitle";
this.cmiAddSubtitle.Size = new System.Drawing.Size(191, 22);
this.cmiAddSubtitle.Size = new System.Drawing.Size(203, 22);
this.cmiAddSubtitle.Text = "Add Subtitle";
this.cmiAddSubtitle.Click += new System.EventHandler(this.AddSubtitleToolStripMenuItem_Click);
//
// cmiViewComments
//
this.cmiViewComments.Name = "cmiViewComments";
this.cmiViewComments.Size = new System.Drawing.Size(191, 22);
this.cmiViewComments.Size = new System.Drawing.Size(203, 22);
this.cmiViewComments.Text = "View Comments";
this.cmiViewComments.Click += new System.EventHandler(this.viewCommentsToolStripMenuItem_Click);
//
// toolStripSeparator_afterMovie
//
this.toolStripSeparator_afterMovie.Name = "toolStripSeparator_afterMovie";
this.toolStripSeparator_afterMovie.Size = new System.Drawing.Size(188, 6);
this.toolStripSeparator_afterMovie.Size = new System.Drawing.Size(200, 6);
//
// cmiUndoSavestate
//
this.cmiUndoSavestate.Image = global::BizHawk.MultiClient.Properties.Resources.undo;
this.cmiUndoSavestate.Name = "cmiUndoSavestate";
this.cmiUndoSavestate.Size = new System.Drawing.Size(191, 22);
this.cmiUndoSavestate.Size = new System.Drawing.Size(203, 22);
this.cmiUndoSavestate.Text = "Undo Savestate";
this.cmiUndoSavestate.Click += new System.EventHandler(this.undoSavestateToolStripMenuItem_Click);
//
// cmiSeparator20
//
this.cmiSeparator20.Name = "cmiSeparator20";
this.cmiSeparator20.Size = new System.Drawing.Size(188, 6);
this.cmiSeparator20.Size = new System.Drawing.Size(200, 6);
//
// cmiScreenshot
//
this.cmiScreenshot.Image = global::BizHawk.MultiClient.Properties.Resources.camera;
this.cmiScreenshot.Name = "cmiScreenshot";
this.cmiScreenshot.Size = new System.Drawing.Size(191, 22);
this.cmiScreenshot.Size = new System.Drawing.Size(203, 22);
this.cmiScreenshot.Text = "Screenshot";
//
// cmiScreenshotClipboard
//
this.cmiScreenshotClipboard.Image = global::BizHawk.MultiClient.Properties.Resources.camera;
this.cmiScreenshotClipboard.Name = "cmiScreenshotClipboard";
this.cmiScreenshotClipboard.Size = new System.Drawing.Size(191, 22);
this.cmiScreenshotClipboard.Size = new System.Drawing.Size(203, 22);
this.cmiScreenshotClipboard.Text = "Screenshot -> Clipboard";
this.cmiScreenshotClipboard.Click += new System.EventHandler(this.screenshotToClipboardToolStripMenuItem_Click);
//
@ -2217,14 +2234,14 @@
//
this.cmiCloseRom.Image = global::BizHawk.MultiClient.Properties.Resources.Close;
this.cmiCloseRom.Name = "cmiCloseRom";
this.cmiCloseRom.Size = new System.Drawing.Size(191, 22);
this.cmiCloseRom.Size = new System.Drawing.Size(203, 22);
this.cmiCloseRom.Text = "Close ROM";
this.cmiCloseRom.Click += new System.EventHandler(this.closeROMToolStripMenuItem1_Click);
//
// cmiShowMenu
//
this.cmiShowMenu.Name = "cmiShowMenu";
this.cmiShowMenu.Size = new System.Drawing.Size(191, 22);
this.cmiShowMenu.Size = new System.Drawing.Size(203, 22);
this.cmiShowMenu.Text = "Show Menu";
this.cmiShowMenu.Click += new System.EventHandler(this.showMenuToolStripMenuItem_Click);
//
@ -2500,6 +2517,8 @@
private System.Windows.Forms.ToolStripMenuItem bWToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem p0DifficultyToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem rightDifficultyToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator8;
private System.Windows.Forms.ToolStripMenuItem skipBIOSIntroToolStripMenuItem;
}
}

View File

@ -1468,5 +1468,61 @@ namespace BizHawk.MultiClient
{
LoadPCEBGViewer();
}
private void bWToolStripMenuItem_Click(object sender, EventArgs e)
{
if (Global.Emulator is Atari2600)
{
Global.Config.Atari2600_BW ^= true;
((Atari2600)Global.Emulator).SetBw(Global.Config.Atari2600_BW);
if (Global.Config.Atari2600_BW)
Global.OSD.AddMessage("Setting to Black and White Switch to On");
else
Global.OSD.AddMessage("Setting to Black and White Switch to Off");
}
}
private void p0DifficultyToolStripMenuItem_Click(object sender, EventArgs e)
{
if (Global.Emulator is Atari2600)
{
Global.Config.Atari2600_LeftDifficulty ^= true;
((Atari2600)Global.Emulator).SetP0Diff(Global.Config.Atari2600_BW);
if (Global.Config.Atari2600_LeftDifficulty)
Global.OSD.AddMessage("Setting Left Difficulty to B");
else
Global.OSD.AddMessage("Setting Left Difficulty to A");
}
}
private void rightDifficultyToolStripMenuItem_Click(object sender, EventArgs e)
{
if (Global.Emulator is Atari2600)
{
Global.Config.Atari2600_RightDifficulty ^= true;
((Atari2600)Global.Emulator).SetP1Diff(Global.Config.Atari2600_BW);
if (Global.Config.Atari2600_RightDifficulty)
Global.OSD.AddMessage("Setting Right Difficulty to B");
else
Global.OSD.AddMessage("Setting Right Difficulty to A");
}
}
private void atariToolStripMenuItem_DropDownOpened(object sender, EventArgs e)
{
bWToolStripMenuItem.Checked = Global.Config.Atari2600_BW;
p0DifficultyToolStripMenuItem.Checked = Global.Config.Atari2600_LeftDifficulty;
rightDifficultyToolStripMenuItem.Checked = Global.Config.Atari2600_RightDifficulty;
}
private void skipBIOSIntroToolStripMenuItem_Click(object sender, EventArgs e)
{
Global.Config.GameBoySkipBIOS ^= true;
}
private void gBToolStripMenuItem_DropDownOpened(object sender, EventArgs e)
{
skipBIOSIntroToolStripMenuItem.Checked = Global.Config.GameBoySkipBIOS;
}
}
}

View File

@ -1252,7 +1252,7 @@ namespace BizHawk.MultiClient
}
break;
case "GB":
Gameboy gb = new Gameboy(game, rom.FileData);
Gameboy gb = new Gameboy(game, rom.FileData, Global.Config.GameBoySkipBIOS);
nextEmulator = gb;
break;
case "COLV":
@ -3077,51 +3077,5 @@ namespace BizHawk.MultiClient
}
FrameBufferResized();
}
private void bWToolStripMenuItem_Click(object sender, EventArgs e)
{
if (Global.Emulator is Atari2600)
{
Global.Config.Atari2600_BW ^= true;
((Atari2600)Global.Emulator).SetBw(Global.Config.Atari2600_BW);
if (Global.Config.Atari2600_BW)
Global.OSD.AddMessage("Setting to Black and White Switch to On");
else
Global.OSD.AddMessage("Setting to Black and White Switch to Off");
}
}
private void p0DifficultyToolStripMenuItem_Click(object sender, EventArgs e)
{
if (Global.Emulator is Atari2600)
{
Global.Config.Atari2600_LeftDifficulty ^= true;
((Atari2600)Global.Emulator).SetP0Diff(Global.Config.Atari2600_BW);
if(Global.Config.Atari2600_LeftDifficulty)
Global.OSD.AddMessage("Setting Left Difficulty to B");
else
Global.OSD.AddMessage("Setting Left Difficulty to A");
}
}
private void rightDifficultyToolStripMenuItem_Click(object sender, EventArgs e)
{
if (Global.Emulator is Atari2600)
{
Global.Config.Atari2600_RightDifficulty ^= true;
((Atari2600)Global.Emulator).SetP1Diff(Global.Config.Atari2600_BW);
if (Global.Config.Atari2600_RightDifficulty)
Global.OSD.AddMessage("Setting Right Difficulty to B");
else
Global.OSD.AddMessage("Setting Right Difficulty to A");
}
}
private void atariToolStripMenuItem_DropDownOpened(object sender, EventArgs e)
{
bWToolStripMenuItem.Checked = Global.Config.Atari2600_BW;
p0DifficultyToolStripMenuItem.Checked = Global.Config.Atari2600_LeftDifficulty;
rightDifficultyToolStripMenuItem.Checked = Global.Config.Atari2600_RightDifficulty;
}
}
}