diff --git a/BizHawk.Client.DBMan/DBMan_MainForm.cs b/BizHawk.Client.DBMan/DBMan_MainForm.cs index 3530e29194..c3dbd793b6 100644 --- a/BizHawk.Client.DBMan/DBMan_MainForm.cs +++ b/BizHawk.Client.DBMan/DBMan_MainForm.cs @@ -315,7 +315,6 @@ namespace BizHawk.Client.DBMan if (regionStr.Length > 0) romName += " ("+regionStr+")"; - string versionStr = ""; if (rom.VersionTags != null) { var versions = rom.VersionTags.Split(';'); diff --git a/BizHawk.Client.EmuHawk/MainForm.cs b/BizHawk.Client.EmuHawk/MainForm.cs index 58b8488035..e47c878053 100644 --- a/BizHawk.Client.EmuHawk/MainForm.cs +++ b/BizHawk.Client.EmuHawk/MainForm.cs @@ -149,7 +149,7 @@ namespace BizHawk.Client.EmuHawk Input.Initialize(); InitControls(); - Global.CoreComm = new CoreComm(ShowMessageCoreComm); + Global.CoreComm = new CoreComm(ShowMessageCoreComm, NotifyCoreComm); CoreFileProvider.SyncCoreCommInputSignals(); Global.Emulator = new NullEmulator(Global.CoreComm); Global.ActiveController = Global.NullControls; @@ -2752,6 +2752,11 @@ namespace BizHawk.Client.EmuHawk MessageBox.Show(this, e.Message, e.AttemptedCoreLoad + " load warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); } + private void NotifyCoreComm(string message) + { + GlobalWin.OSD.AddMessage(message); + } + // Still needs a good bit of refactoring public bool LoadRom(string path, bool deterministicemulation = false, bool hasmovie = false) { @@ -2775,7 +2780,7 @@ namespace BizHawk.Client.EmuHawk // the new settings objects CommitCoreSettingsToConfig(); - var nextComm = new CoreComm(ShowMessageCoreComm); + var nextComm = new CoreComm(ShowMessageCoreComm, NotifyCoreComm); CoreFileProvider.SyncCoreCommInputSignals(nextComm); var result = loader.LoadRom(path, nextComm); @@ -2956,7 +2961,7 @@ namespace BizHawk.Client.EmuHawk CommitCoreSettingsToConfig(); Global.Emulator.Dispose(); - Global.CoreComm = new CoreComm(ShowMessageCoreComm); + Global.CoreComm = new CoreComm(ShowMessageCoreComm, NotifyCoreComm); CoreFileProvider.SyncCoreCommInputSignals(); Global.Emulator = new NullEmulator(Global.CoreComm); Global.ActiveController = Global.NullControls; @@ -2976,7 +2981,7 @@ namespace BizHawk.Client.EmuHawk if (GlobalWin.Tools.AskSave()) { CloseGame(clearSram); - Global.CoreComm = new CoreComm(ShowMessageCoreComm); + Global.CoreComm = new CoreComm(ShowMessageCoreComm, NotifyCoreComm); CoreFileProvider.SyncCoreCommInputSignals(); Global.Emulator = new NullEmulator(Global.CoreComm); Global.Game = GameInfo.GetNullGame(); diff --git a/BizHawk.Client.EmuHawk/tools/BatchRunner.cs b/BizHawk.Client.EmuHawk/tools/BatchRunner.cs index 156320226c..298745f5d9 100644 --- a/BizHawk.Client.EmuHawk/tools/BatchRunner.cs +++ b/BizHawk.Client.EmuHawk/tools/BatchRunner.cs @@ -69,7 +69,7 @@ namespace BizHawk.Client.EmuHawk ldr = new RomLoader(); ldr.OnLoadError += OnLoadError; ldr.ChooseArchive = ChooseArchive; - Comm = new CoreComm(CommMessage); + Comm = new CoreComm(CommMessage, CommMessage); CoreFileProvider.SyncCoreCommInputSignals(Comm); } diff --git a/BizHawk.Emulation.Common/Interfaces/CoreComms.cs b/BizHawk.Emulation.Common/Interfaces/CoreComms.cs index 04b0b929f5..26d3e0f71c 100644 --- a/BizHawk.Emulation.Common/Interfaces/CoreComms.cs +++ b/BizHawk.Emulation.Common/Interfaces/CoreComms.cs @@ -53,9 +53,15 @@ namespace BizHawk.Emulation.Common /// public Action ShowMessage { get; private set; } - public CoreComm(Action ShowMessage) + /// + /// show a message. less annoying (OSD message). Should be used for ignorable helpful messages + /// + public Action Notify { get; private set; } + + public CoreComm(Action ShowMessage, Action NotifyMessage) { this.ShowMessage = ShowMessage; + this.Notify = NotifyMessage; } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/GambatteLink.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/GambatteLink.cs index 93cc5e047e..af052f70ab 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/GambatteLink.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/GambatteLink.cs @@ -46,8 +46,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy GambatteLinkSyncSettings _SyncSettings = (GambatteLinkSyncSettings)SyncSettings ?? GambatteLinkSyncSettings.GetDefaults(); CoreComm = comm; - L = new Gameboy(new CoreComm(comm.ShowMessage), leftinfo, leftrom, _Settings.L, _SyncSettings.L); - R = new Gameboy(new CoreComm(comm.ShowMessage), rightinfo, rightrom, _Settings.R, _SyncSettings.R); + L = new Gameboy(new CoreComm(comm.ShowMessage, comm.Notify), leftinfo, leftrom, _Settings.L, _SyncSettings.L); + R = new Gameboy(new CoreComm(comm.ShowMessage, comm.Notify), rightinfo, rightrom, _Settings.R, _SyncSettings.R); // connect link cable LibGambatte.gambatte_linkstatus(L.GambatteState, 259); diff --git a/BizHawk.Emulation.Cores/Consoles/Sega/SMS/SMS.cs b/BizHawk.Emulation.Cores/Consoles/Sega/SMS/SMS.cs index 2f11ed5964..1e2b1a8ad9 100644 --- a/BizHawk.Emulation.Cores/Consoles/Sega/SMS/SMS.cs +++ b/BizHawk.Emulation.Cores/Consoles/Sega/SMS/SMS.cs @@ -20,7 +20,6 @@ using BizHawk.Emulation.Cores.Components.Z80; + Or a "force region to japan if game is only for japan" thing. Which one is better? + I confess, Mapper system needs some refactoring and love. But right now I want to get all games to work and THEN refactor it. + Savestate system.... maybe use a zeromus-like system. Except maintain the text-savestate compatibility. Might give up some speed for improved maintainability tho. - + Make corecomm OSD notifier system **********************************************************/ @@ -108,7 +107,7 @@ namespace BizHawk.Emulation.Cores.Sega.MasterSystem if (game["PAL"] && DisplayType != DisplayType.PAL) { DisplayType = DisplayType.PAL; - Console.WriteLine("Display was forced to PAL mode for game compatibility."); // TODO change to corecomm.notify when it exists + CoreComm.Notify("Display was forced to PAL mode for game compatibility."); } if (IsGameGear) DisplayType = DisplayType.NTSC; // all game gears run at 60hz/NTSC mode @@ -119,7 +118,7 @@ namespace BizHawk.Emulation.Cores.Sega.MasterSystem if (game["Japan"] && Region != "Japan") { Region = "Japan"; - Console.WriteLine("Region was forced to Japan for game compatibility."); // TODO corecomm.notify + CoreComm.Notify("Region was forced to Japan for game compatibility."); } if (game.NotInDatabase || game["FM"] && SyncSettings.EnableFM && !IsGameGear) @@ -190,9 +189,9 @@ namespace BizHawk.Emulation.Cores.Sega.MasterSystem Port3E = 0xF7; if (BiosRom == null && game["RequireBios"]) - Console.WriteLine("BIOS image not available. This game requires BIOS to function."); // TODO corecomm.notify + CoreComm.Notify("BIOS image not available. This game requires BIOS to function."); if (SyncSettings.UseBIOS && BiosRom == null) - Console.WriteLine("BIOS was selected, but rom image not available. BIOS not enabled."); // TODO corecomm.notify + CoreComm.Notify("BIOS was selected, but rom image not available. BIOS not enabled."); } SetupMemoryDomains(); diff --git a/BizHawk.Emulation.Cores/Consoles/Sega/SMS/VDP.ModeTMS.cs b/BizHawk.Emulation.Cores/Consoles/Sega/SMS/VDP.ModeTMS.cs index 1497fc7410..408c9fb2f3 100644 --- a/BizHawk.Emulation.Cores/Consoles/Sega/SMS/VDP.ModeTMS.cs +++ b/BizHawk.Emulation.Cores/Consoles/Sega/SMS/VDP.ModeTMS.cs @@ -28,6 +28,9 @@ namespace BizHawk.Emulation.Cores.Sega.MasterSystem void RenderBackgroundM0(bool show) { + if (ScanLine >= FrameHeight) + return; + if (DisplayOn == false) { Array.Clear(FrameBuffer, ScanLine * 256, 256); @@ -63,6 +66,9 @@ namespace BizHawk.Emulation.Cores.Sega.MasterSystem void RenderBackgroundM2(bool show) { + if (ScanLine >= FrameHeight) + return; + if (DisplayOn == false) { Array.Clear(FrameBuffer, ScanLine * 256, 256); @@ -100,6 +106,9 @@ namespace BizHawk.Emulation.Cores.Sega.MasterSystem void RenderTmsSprites(bool show) { + if (ScanLine >= FrameHeight || DisplayOn == false) + return; + if (EnableDoubledSprites == false) RenderTmsSpritesStandard(show); else @@ -108,8 +117,6 @@ namespace BizHawk.Emulation.Cores.Sega.MasterSystem void RenderTmsSpritesStandard(bool show) { - if (DisplayOn == false) return; - Array.Clear(ScanlinePriorityBuffer, 0, 256); Array.Clear(SpriteCollisionBuffer, 0, 256); @@ -176,8 +183,6 @@ namespace BizHawk.Emulation.Cores.Sega.MasterSystem void RenderTmsSpritesDouble(bool show) { - if (DisplayOn == false) return; - Array.Clear(ScanlinePriorityBuffer, 0, 256); Array.Clear(SpriteCollisionBuffer, 0, 256); diff --git a/BizHawk.Emulation.Cores/Consoles/Sega/SMS/VDP.cs b/BizHawk.Emulation.Cores/Consoles/Sega/SMS/VDP.cs index fb76cf2a62..69b8d83d37 100644 --- a/BizHawk.Emulation.Cores/Consoles/Sega/SMS/VDP.cs +++ b/BizHawk.Emulation.Cores/Consoles/Sega/SMS/VDP.cs @@ -385,15 +385,11 @@ namespace BizHawk.Emulation.Cores.Sega.MasterSystem } else if (TmsMode == 2) { - if (ScanLine >= FrameHeight) // TODO fix this other way - return; RenderBackgroundM2(Sms.Settings.DispBG); RenderTmsSprites(Sms.Settings.DispOBJ); } else if (TmsMode == 0) { - if (ScanLine >= FrameHeight) // TODO fix this other way - return; RenderBackgroundM0(Sms.Settings.DispBG); RenderTmsSprites(Sms.Settings.DispOBJ); }