From 58f6e624ffd5d1094d160bdc43e87d7017bb800a Mon Sep 17 00:00:00 2001 From: alyosha-tas Date: Thu, 8 Feb 2018 09:26:22 -0500 Subject: [PATCH] SMS add Korea to region selection options --- BizHawk.Client.EmuHawk/MainForm.Designer.cs | 22 ++++++++++++++----- BizHawk.Client.EmuHawk/MainForm.Events.cs | 8 +++++++ .../Consoles/PC Engine/VDC.Render.cs | 3 +++ .../Consoles/Sega/SMS/SMS.ISettable.cs | 4 ++-- .../Consoles/Sega/SMS/SMS.cs | 8 ++++++- 5 files changed, 36 insertions(+), 9 deletions(-) diff --git a/BizHawk.Client.EmuHawk/MainForm.Designer.cs b/BizHawk.Client.EmuHawk/MainForm.Designer.cs index d2c636448a..399cedf8a9 100644 --- a/BizHawk.Client.EmuHawk/MainForm.Designer.cs +++ b/BizHawk.Client.EmuHawk/MainForm.Designer.cs @@ -274,7 +274,8 @@ this.SMSregionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.SMSregionExportToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.SMSregionJapanToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.SMSregionAutoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.SMSregionKoreaToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.SMSregionAutoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.SMSdisplayToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.SMSdisplayNtscToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.SMSdisplayPalToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -2534,7 +2535,8 @@ this.SMSregionToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.SMSregionExportToolStripMenuItem, this.SMSregionJapanToolStripMenuItem, - this.SMSregionAutoToolStripMenuItem}); + this.SMSregionKoreaToolStripMenuItem, + this.SMSregionAutoToolStripMenuItem}); this.SMSregionToolStripMenuItem.Name = "SMSregionToolStripMenuItem"; this.SMSregionToolStripMenuItem.Size = new System.Drawing.Size(277, 22); this.SMSregionToolStripMenuItem.Text = "Region"; @@ -2552,10 +2554,17 @@ this.SMSregionJapanToolStripMenuItem.Size = new System.Drawing.Size(107, 22); this.SMSregionJapanToolStripMenuItem.Text = "Japan"; this.SMSregionJapanToolStripMenuItem.Click += new System.EventHandler(this.SMS_RegionJapan_Click); - // - // SMSregionAutoToolStripMenuItem - // - this.SMSregionAutoToolStripMenuItem.Name = "SMSregionAutoToolStripMenuItem"; + // + // SMSregionKoreaToolStripMenuItem + // + this.SMSregionKoreaToolStripMenuItem.Name = "SMSregionKoreaToolStripMenuItem"; + this.SMSregionKoreaToolStripMenuItem.Size = new System.Drawing.Size(107, 22); + this.SMSregionKoreaToolStripMenuItem.Text = "Korea"; + this.SMSregionKoreaToolStripMenuItem.Click += new System.EventHandler(this.SMS_RegionKorea_Click); + // + // SMSregionAutoToolStripMenuItem + // + this.SMSregionAutoToolStripMenuItem.Name = "SMSregionAutoToolStripMenuItem"; this.SMSregionAutoToolStripMenuItem.Size = new System.Drawing.Size(107, 22); this.SMSregionAutoToolStripMenuItem.Text = "Auto"; this.SMSregionAutoToolStripMenuItem.Click += new System.EventHandler(this.SMS_RegionAuto_Click); @@ -4298,6 +4307,7 @@ private System.Windows.Forms.ToolStripMenuItem SMSregionToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem SMSregionExportToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem SMSregionJapanToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem SMSregionKoreaToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem SMSregionAutoToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem SMSdisplayToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem SMSdisplayNtscToolStripMenuItem; diff --git a/BizHawk.Client.EmuHawk/MainForm.Events.cs b/BizHawk.Client.EmuHawk/MainForm.Events.cs index 3eb36838f1..5e5b535397 100644 --- a/BizHawk.Client.EmuHawk/MainForm.Events.cs +++ b/BizHawk.Client.EmuHawk/MainForm.Events.cs @@ -1757,6 +1757,7 @@ namespace BizHawk.Client.EmuHawk var ss = ((SMS)Emulator).GetSyncSettings(); SMSregionExportToolStripMenuItem.Checked = ss.ConsoleRegion == "Export"; SMSregionJapanToolStripMenuItem.Checked = ss.ConsoleRegion == "Japan"; + SMSregionKoreaToolStripMenuItem.Checked = ss.ConsoleRegion == "Korea"; SMSregionAutoToolStripMenuItem.Checked = ss.ConsoleRegion == "Auto"; SMSdisplayNtscToolStripMenuItem.Checked = ss.DisplayType == "NTSC"; SMSdisplayPalToolStripMenuItem.Checked = ss.DisplayType == "PAL"; @@ -1814,6 +1815,13 @@ namespace BizHawk.Client.EmuHawk PutCoreSyncSettings(ss); } + private void SMS_RegionKorea_Click(object sender, EventArgs e) + { + var ss = ((SMS)Emulator).GetSyncSettings(); + ss.ConsoleRegion = "Korea"; + PutCoreSyncSettings(ss); + } + private void SMS_RegionAuto_Click(object sender, EventArgs e) { var ss = ((SMS)Emulator).GetSyncSettings(); diff --git a/BizHawk.Emulation.Cores/Consoles/PC Engine/VDC.Render.cs b/BizHawk.Emulation.Cores/Consoles/PC Engine/VDC.Render.cs index 3e92622c38..72006fe392 100644 --- a/BizHawk.Emulation.Cores/Consoles/PC Engine/VDC.Render.cs +++ b/BizHawk.Emulation.Cores/Consoles/PC Engine/VDC.Render.cs @@ -36,6 +36,9 @@ namespace BizHawk.Emulation.Cores.PCEngine int ActiveDisplayStartLine = DisplayStartLine; + Console.WriteLine(ActiveDisplayStartLine + Registers[VDW] + 1); + Console.WriteLine(Registers[5]); + while (true) { int VBlankLine = ActiveDisplayStartLine + Registers[VDW] + 1; diff --git a/BizHawk.Emulation.Cores/Consoles/Sega/SMS/SMS.ISettable.cs b/BizHawk.Emulation.Cores/Consoles/Sega/SMS/SMS.ISettable.cs index d2112e2dab..4a45ac0e7a 100644 --- a/BizHawk.Emulation.Cores/Consoles/Sega/SMS/SMS.ISettable.cs +++ b/BizHawk.Emulation.Cores/Consoles/Sega/SMS/SMS.ISettable.cs @@ -63,8 +63,8 @@ namespace BizHawk.Emulation.Cores.Sega.MasterSystem public bool EnableFM = true; public bool AllowOverlock = false; public bool UseBIOS = true; - public string ConsoleRegion = "Export"; - public string DisplayType = "NTSC"; + public string ConsoleRegion = "Auto"; + public string DisplayType = "Auto"; public string ControllerType = "Standard"; public SMSSyncSettings Clone() diff --git a/BizHawk.Emulation.Cores/Consoles/Sega/SMS/SMS.cs b/BizHawk.Emulation.Cores/Consoles/Sega/SMS/SMS.cs index ed20fb5ee0..0f393dff0c 100644 --- a/BizHawk.Emulation.Cores/Consoles/Sega/SMS/SMS.cs +++ b/BizHawk.Emulation.Cores/Consoles/Sega/SMS/SMS.cs @@ -69,6 +69,12 @@ namespace BizHawk.Emulation.Cores.Sega.MasterSystem CoreComm.Notify("Region was forced to Japan for game compatibility."); } + if (game["Korea"] && RegionStr != "Korea") + { + RegionStr = "Korea"; + CoreComm.Notify("Region was forced to Korea for game compatibility."); + } + if ((game.NotInDatabase || game["FM"]) && SyncSettings.EnableFM && !IsGameGear) { HasYM2413 = true; @@ -385,6 +391,6 @@ namespace BizHawk.Emulation.Cores.Sega.MasterSystem } } - private readonly string[] validRegions = { "Export", "Japan", "Auto" , "Korea" }; + private readonly string[] validRegions = { "Export", "Japan", "Korea" , "Auto" }; } }