Skip to content

Commit 3cc3440

Browse files
committed
Remove most of (old) BSNES' managed source and callsites
1 parent fe85bfa commit 3cc3440

37 files changed

+9
-4726
lines changed

src/BizHawk.Client.Common/Api/Classes/EmulationApi.cs

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
using BizHawk.Emulation.Cores.Nintendo.BSNES;
1212
using BizHawk.Emulation.Cores.Nintendo.NES;
1313
using BizHawk.Emulation.Cores.Consoles.Nintendo.NDS;
14-
using BizHawk.Emulation.Cores.Nintendo.SNES;
1514
using BizHawk.Emulation.Cores.PCEngine;
1615
using BizHawk.Emulation.Cores.Sega.MasterSystem;
1716
using BizHawk.Emulation.Cores.WonderSwan;
@@ -195,7 +194,6 @@ public void SetLagCount(int count)
195194
public object? GetSettings() => Emulator switch
196195
{
197196
GPGX gpgx => gpgx.GetSettings(),
198-
LibsnesCore snes => snes.GetSettings(),
199197
NES nes => nes.GetSettings(),
200198
NDS nds => nds.GetSettings(),
201199
PCEngine pce => pce.GetSettings(),
@@ -208,7 +206,6 @@ public void SetLagCount(int count)
208206
public PutSettingsDirtyBits PutSettings(object settings) => Emulator switch
209207
{
210208
GPGX gpgx => gpgx.PutSettings((GPGX.GPGXSettings) settings),
211-
LibsnesCore snes => snes.PutSettings((LibsnesCore.SnesSettings) settings),
212209
NES nes => nes.PutSettings((NES.NESSettings) settings),
213210
NDS nds => nds.PutSettings((NDS.NDSSettings) settings),
214211
PCEngine pce => pce.PutSettings((PCEngine.PCESettings) settings),
@@ -221,19 +218,6 @@ public void SetLagCount(int count)
221218
public void SetRenderPlanes(params bool[] args)
222219
{
223220
static bool GetSetting(bool[] settings, int index) => index >= settings.Length || settings[index];
224-
void SetLibsnes(LibsnesCore core)
225-
{
226-
var s = core.GetSettings();
227-
s.ShowBG1_0 = s.ShowBG1_1 = GetSetting(args, 0);
228-
s.ShowBG2_0 = s.ShowBG2_1 = GetSetting(args, 1);
229-
s.ShowBG3_0 = s.ShowBG3_1 = GetSetting(args, 2);
230-
s.ShowBG4_0 = s.ShowBG4_1 = GetSetting(args, 3);
231-
s.ShowOBJ_0 = GetSetting(args, 4);
232-
s.ShowOBJ_1 = GetSetting(args, 5);
233-
s.ShowOBJ_2 = GetSetting(args, 6);
234-
s.ShowOBJ_3 = GetSetting(args, 7);
235-
core.PutSettings(s);
236-
}
237221
void SetBsnes(ISettable<BsnesCore.SnesSettings, BsnesCore.SnesSyncSettings> settingsProvider)
238222
{
239223
var s = settingsProvider.GetSettings();
@@ -306,9 +290,6 @@ void SetSmsHawk(SMS sms)
306290
case GPGX gpgx:
307291
SetGPGX(gpgx);
308292
break;
309-
case LibsnesCore snes:
310-
SetLibsnes(snes);
311-
break;
312293
case BsnesCore bsnes:
313294
SetBsnes(bsnes);
314295
break;

src/BizHawk.Client.Common/RomLoader.cs

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
using BizHawk.Emulation.Cores;
1111
using BizHawk.Emulation.Cores.Libretro;
1212
using BizHawk.Emulation.Cores.Nintendo.Sameboy;
13-
using BizHawk.Emulation.Cores.Nintendo.SNES;
1413
using BizHawk.Emulation.Cores.Sony.PSX;
1514
using BizHawk.Emulation.Cores.Arcades.MAME;
1615
using BizHawk.Emulation.DiscSystem;
@@ -696,28 +695,8 @@ private bool LoadXML(string path, CoreComm nextComm, HawkFile file, string force
696695
}
697696
catch (Exception ex)
698697
{
699-
try
700-
{
701-
// need to get rid of this hack at some point
702-
rom = new RomGame(file);
703-
game = rom.GameInfo;
704-
game.System = VSystemID.Raw.SNES;
705-
nextEmulator = new LibsnesCore(
706-
game,
707-
null,
708-
rom.FileData,
709-
Path.GetDirectoryName(path.SubstringBefore('|')),
710-
nextComm,
711-
GetCoreSettings<LibsnesCore, LibsnesCore.SnesSettings>(),
712-
GetCoreSyncSettings<LibsnesCore, LibsnesCore.SnesSyncSettings>()
713-
);
714-
return true;
715-
}
716-
catch
717-
{
718-
DoLoadErrorCallback(ex.ToString(), VSystemID.Raw.GBL, LoadErrorType.Xml);
719-
return false;
720-
}
698+
DoLoadErrorCallback(ex.ToString(), VSystemID.Raw.GBL, LoadErrorType.Xml);
699+
return false;
721700
}
722701
}
723702

src/BizHawk.Client.Common/config/Config.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public class Config
3535
([ VSystemID.Raw.GBL ],
3636
[ CoreNames.GambatteLink, CoreNames.GBHawkLink, CoreNames.GBHawkLink3x, CoreNames.GBHawkLink4x ]),
3737
([ VSystemID.Raw.SGB ],
38-
[ CoreNames.Gambatte, CoreNames.Bsnes115, CoreNames.SubBsnes115, CoreNames.Bsnes ]),
38+
[ CoreNames.Gambatte, CoreNames.Bsnes115, CoreNames.SubBsnes115 ]),
3939
([ VSystemID.Raw.GEN ],
4040
[ CoreNames.Gpgx, CoreNames.PicoDrive ]),
4141
([ VSystemID.Raw.N64 ],
@@ -49,7 +49,7 @@ public class Config
4949
([ VSystemID.Raw.SMS, VSystemID.Raw.GG, VSystemID.Raw.SG ],
5050
[ CoreNames.Gpgx, CoreNames.SMSHawk ]),
5151
([ VSystemID.Raw.SNES ],
52-
[ CoreNames.Snes9X, CoreNames.Bsnes115, CoreNames.SubBsnes115, CoreNames.Faust, CoreNames.Bsnes ]),
52+
[ CoreNames.Snes9X, CoreNames.Bsnes115, CoreNames.SubBsnes115, CoreNames.Faust ]),
5353
([ VSystemID.Raw.TI83 ],
5454
[ CoreNames.Emu83, CoreNames.TI83Hawk ]),
5555
};

src/BizHawk.Client.EmuHawk/MainForm.VSystem.cs

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
using BizHawk.Emulation.Cores.Nintendo.N64;
5151
using BizHawk.Emulation.Cores.Nintendo.NES;
5252
using BizHawk.Emulation.Cores.Nintendo.SNES9X;
53-
using BizHawk.Emulation.Cores.Nintendo.SNES;
5453
using BizHawk.Emulation.Cores.Nintendo.Sameboy;
5554
using BizHawk.Emulation.Cores.Nintendo.SubGBHawk;
5655
using BizHawk.Emulation.Cores.Nintendo.SubNESHawk;
@@ -734,12 +733,6 @@ private void PsxSubMenu_DropDownOpened(object sender, EventArgs e)
734733

735734

736735

737-
private DialogResult OpenOldBSNESGamepadSettingsDialog(ISettingsAdapter settable)
738-
{
739-
using SNESControllerSettings form = new(settable);
740-
return this.ShowDialogWithTempMute(form);
741-
}
742-
743736
private DialogResult OpenBSNESGamepadSettingsDialog(ISettingsAdapter settable)
744737
{
745738
using BSNESControllerSettings form = new(settable);
@@ -749,7 +742,6 @@ private DialogResult OpenBSNESGamepadSettingsDialog(ISettingsAdapter settable)
749742
private void SNESControllerConfigurationMenuItem_Click(object sender, EventArgs e)
750743
=> _ = Emulator switch
751744
{
752-
LibsnesCore => OpenOldBSNESGamepadSettingsDialog(GetSettingsAdapterForLoadedCore<LibsnesCore>()),
753745
BsnesCore => OpenBSNESGamepadSettingsDialog(GetSettingsAdapterForLoadedCore<BsnesCore>()),
754746
SubBsnesCore => OpenBSNESGamepadSettingsDialog(GetSettingsAdapterForLoadedCore<SubBsnesCore>()),
755747
_ => DialogResult.None
@@ -758,16 +750,12 @@ private void SNESControllerConfigurationMenuItem_Click(object sender, EventArgs
758750
private void SnesGfxDebuggerMenuItem_Click(object sender, EventArgs e)
759751
=> Tools.Load<SNESGraphicsDebugger>();
760752

761-
private DialogResult OpenOldBSNESSettingsDialog(ISettingsAdapter settable)
762-
=> SNESOptions.DoSettingsDialog(this, settable);
763-
764753
private DialogResult OpenBSNESSettingsDialog(ISettingsAdapter settable)
765754
=> BSNESOptions.DoSettingsDialog(this, settable);
766755

767756
private void SnesOptionsMenuItem_Click(object sender, EventArgs e)
768757
=> _ = Emulator switch
769758
{
770-
LibsnesCore => OpenOldBSNESSettingsDialog(GetSettingsAdapterForLoadedCore<LibsnesCore>()),
771759
BsnesCore => OpenBSNESSettingsDialog(GetSettingsAdapterForLoadedCore<BsnesCore>()),
772760
SubBsnesCore => OpenBSNESSettingsDialog(GetSettingsAdapterForLoadedCore<SubBsnesCore>()),
773761
_ => DialogResult.None
@@ -805,27 +793,6 @@ private void SNES_ToggleBg(int layer)
805793
settingsProvider.PutSettings(s);
806794
break;
807795
}
808-
case LibsnesCore libsnes:
809-
{
810-
var s = libsnes.GetSettings();
811-
switch (layer)
812-
{
813-
case 1:
814-
result = s.ShowBG1_0 = s.ShowBG1_1 = !s.ShowBG1_1;
815-
break;
816-
case 2:
817-
result = s.ShowBG2_0 = s.ShowBG2_1 = !s.ShowBG2_1;
818-
break;
819-
case 3:
820-
result = s.ShowBG3_0 = s.ShowBG3_1 = !s.ShowBG3_1;
821-
break;
822-
case 4:
823-
result = s.ShowBG4_0 = s.ShowBG4_1 = !s.ShowBG4_1;
824-
break;
825-
}
826-
libsnes.PutSettings(s);
827-
break;
828-
}
829796
case Snes9x snes9X:
830797
{
831798
var s = snes9X.GetSettings();
@@ -1130,13 +1097,6 @@ ToolStripMenuItemEx CreateCoreSubmenu(VSystemCategory cat, string coreName, para
11301097
// Atari2600Hawk
11311098
items.Add(CreateCoreSubmenu(VSystemCategory.Consoles, CoreNames.Atari2600Hawk, CreateGenericCoreConfigItem<Atari2600>(CoreNames.Atari2600Hawk)));
11321099

1133-
// BSNES
1134-
var oldBSNESGamepadSettingsItem = CreateSettingsItem("Controller Configuration...", (_, _) => OpenOldBSNESGamepadSettingsDialog(GetSettingsAdapterFor<LibsnesCore>()));
1135-
var oldBSNESSettingsItem = CreateSettingsItem("Options...", (_, _) => OpenOldBSNESSettingsDialog(GetSettingsAdapterFor<LibsnesCore>()));
1136-
var oldBSNESSubmenu = CreateCoreSubmenu(VSystemCategory.Consoles, CoreNames.Bsnes, oldBSNESGamepadSettingsItem, oldBSNESSettingsItem);
1137-
oldBSNESSubmenu.DropDownOpened += (_, _) => oldBSNESGamepadSettingsItem.Enabled = MovieSession.Movie.NotActive() || Emulator is not LibsnesCore;
1138-
items.Add(oldBSNESSubmenu);
1139-
11401100
// BSNESv115+
11411101
var bsnesGamepadSettingsItem = CreateSettingsItem("Controller Configuration...", (_, _) => OpenBSNESGamepadSettingsDialog(GetSettingsAdapterFor<BsnesCore>()));
11421102
var bsnesSettingsItem = CreateSettingsItem("Options...", (_, _) => OpenBSNESSettingsDialog(GetSettingsAdapterFor<BsnesCore>()));
@@ -1500,10 +1460,6 @@ private void HandlePlatformMenus()
15001460
GBSubMenu.Visible = true;
15011461
SameBoyColorChooserMenuItem.Visible = Emulator is Sameboy { IsCGBMode: false }; // palette config only works in DMG mode
15021462
break;
1503-
case VSystemID.Raw.SNES when Emulator is LibsnesCore oldBSNES: // doesn't use "SGB" sysID, always "SNES"
1504-
SNESSubMenu.Text = oldBSNES.IsSGB ? "&SGB" : "&SNES";
1505-
SNESSubMenu.Visible = true;
1506-
break;
15071463
case var _ when Emulator is BsnesCore or SubBsnesCore:
15081464
SNESSubMenu.Text = $"&{sysID}";
15091465
SNESSubMenu.Visible = true;

src/BizHawk.Client.EmuHawk/MainForm.cs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
using BizHawk.Emulation.Cores.Nintendo.GBA;
3434
using BizHawk.Emulation.Cores.Nintendo.N64;
3535
using BizHawk.Emulation.Cores.Nintendo.NES;
36-
using BizHawk.Emulation.Cores.Nintendo.SNES;
3736

3837
using BizHawk.Emulation.DiscSystem;
3938

@@ -3532,12 +3531,6 @@ public string SaveStatePrefix()
35323531
var name = Game.FilesystemSafeName();
35333532
name += $".{Emulator.Attributes().CoreName}";
35343533

3535-
// Bsnes profiles have incompatible savestates so save the profile name
3536-
if (Emulator is LibsnesCore bsnes)
3537-
{
3538-
name += $".{bsnes.CurrentProfile}";
3539-
}
3540-
35413534
if (MovieSession.Movie.IsActive())
35423535
{
35433536
name += $".{Path.GetFileNameWithoutExtension(MovieSession.Movie.Filename)}";
@@ -3731,7 +3724,7 @@ private bool LoadRomInternal(string path, LoadRomArgs args, out bool failureIsFr
37313724
InputManager.SyncControls(Emulator, MovieSession, Config);
37323725
_multiDiskMode = false;
37333726

3734-
if (oaOpenrom != null && Path.GetExtension(oaOpenrom.Path.Replace("|", "")).ToLowerInvariant() == ".xml" && Emulator is not LibsnesCore)
3727+
if (oaOpenrom != null && Path.GetExtension(oaOpenrom.Path.Replace("|", "")).ToLowerInvariant() == ".xml")
37353728
{
37363729
// this is a multi-disk bundler file
37373730
// determine the xml assets and create RomStatusDetails for all of them

src/BizHawk.Client.EmuHawk/RetroAchievements/RetroAchievements.ConsoleID.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
using BizHawk.Emulation.Cores.Consoles.Nintendo.NDS;
55
using BizHawk.Emulation.Cores.Consoles.Sega.gpgx;
66
using BizHawk.Emulation.Cores.Consoles.Sega.PicoDrive;
7-
using BizHawk.Emulation.Cores.Nintendo.SNES;
87

98
namespace BizHawk.Client.EmuHawk
109
{
@@ -155,7 +154,6 @@ protected ConsoleID SystemIdToConsoleId()
155154
VSystemID.Raw.SGX => ConsoleID.PCEngine, // ???
156155
VSystemID.Raw.SGXCD => ConsoleID.PCEngineCD, // ???
157156
VSystemID.Raw.SMS => ConsoleID.MasterSystem,
158-
VSystemID.Raw.SNES when Emu is LibsnesCore { IsSGB: true } => ConsoleID.GB,
159157
VSystemID.Raw.SNES => ConsoleID.SNES,
160158
VSystemID.Raw.TI83 => ConsoleID.TI83,
161159
VSystemID.Raw.TIC80 => ConsoleID.Tic80,

src/BizHawk.Client.EmuHawk/RetroAchievements/RetroAchievements.Hardcore.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
using BizHawk.Emulation.Cores.Nintendo.GBA;
1414
using BizHawk.Emulation.Cores.Nintendo.NES;
1515
using BizHawk.Emulation.Cores.Nintendo.Sameboy;
16-
using BizHawk.Emulation.Cores.Nintendo.SNES;
1716
using BizHawk.Emulation.Cores.Nintendo.SNES9X;
1817
using BizHawk.Emulation.Cores.Nintendo.SubGBHawk;
1918
using BizHawk.Emulation.Cores.Nintendo.SubNESHawk;
@@ -51,7 +50,6 @@ public abstract partial class RetroAchievements
5150
[typeof(MGBAHawk)] = new[] { "DisplayBG0", "DisplayBG1", "DisplayBG2", "DisplayBG3", "DisplayOBJ" },
5251
[typeof(NES)] = new[] { "DispBackground", "DispSprites" },
5352
[typeof(Sameboy)] = new[] { "EnableBGWIN", "EnableOBJ" },
54-
[typeof(LibsnesCore)] = new[] { "ShowBG1_0", "ShowBG2_0", "ShowBG3_0", "ShowBG4_0", "ShowBG1_1", "ShowBG2_1", "ShowBG3_1", "ShowBG4_1", "ShowOBJ_0", "ShowOBJ_1", "ShowOBJ_2", "ShowOBJ_3" },
5553
[typeof(Snes9x)] = new[] { "ShowBg0", "ShowBg1", "ShowBg2", "ShowBg3", "ShowSprites0", "ShowSprites1", "ShowSprites2", "ShowSprites3", "ShowWindow", "ShowTransparency" },
5654
[typeof(PCEngine)] = new[] { "ShowBG1", "ShowOBJ1", "ShowBG2", "ShowOBJ2", },
5755
[typeof(GPGX)] = new[] { "DrawBGA", "DrawBGB", "DrawBGW", "DrawObj", },

0 commit comments

Comments
 (0)