Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop old BSNES #4183

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 0 additions & 1 deletion .github/workflows/make.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ jobs:
Assets/dll/faust.wbx.zst
Assets/dll/gpgx.wbx.zst
Assets/dll/hyper.wbx.zst
Assets/dll/libsnes.wbx.zst
Assets/dll/melonDS.wbx.zst
Assets/dll/ngp.wbx.zst
Assets/dll/pcfx.wbx.zst
Expand Down
Binary file removed Assets/dll/libsnes.wbx.zst
Binary file not shown.
19 changes: 0 additions & 19 deletions src/BizHawk.Client.Common/Api/Classes/EmulationApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
using BizHawk.Emulation.Cores.Nintendo.BSNES;
using BizHawk.Emulation.Cores.Nintendo.NES;
using BizHawk.Emulation.Cores.Consoles.Nintendo.NDS;
using BizHawk.Emulation.Cores.Nintendo.SNES;
using BizHawk.Emulation.Cores.PCEngine;
using BizHawk.Emulation.Cores.Sega.MasterSystem;
using BizHawk.Emulation.Cores.WonderSwan;
Expand Down Expand Up @@ -195,7 +194,6 @@ public void SetLagCount(int count)
public object? GetSettings() => Emulator switch
{
GPGX gpgx => gpgx.GetSettings(),
LibsnesCore snes => snes.GetSettings(),
NES nes => nes.GetSettings(),
NDS nds => nds.GetSettings(),
PCEngine pce => pce.GetSettings(),
Expand All @@ -208,7 +206,6 @@ public void SetLagCount(int count)
public PutSettingsDirtyBits PutSettings(object settings) => Emulator switch
{
GPGX gpgx => gpgx.PutSettings((GPGX.GPGXSettings) settings),
LibsnesCore snes => snes.PutSettings((LibsnesCore.SnesSettings) settings),
NES nes => nes.PutSettings((NES.NESSettings) settings),
NDS nds => nds.PutSettings((NDS.NDSSettings) settings),
PCEngine pce => pce.PutSettings((PCEngine.PCESettings) settings),
Expand All @@ -221,19 +218,6 @@ public void SetLagCount(int count)
public void SetRenderPlanes(params bool[] args)
{
static bool GetSetting(bool[] settings, int index) => index >= settings.Length || settings[index];
void SetLibsnes(LibsnesCore core)
{
var s = core.GetSettings();
s.ShowBG1_0 = s.ShowBG1_1 = GetSetting(args, 0);
s.ShowBG2_0 = s.ShowBG2_1 = GetSetting(args, 1);
s.ShowBG3_0 = s.ShowBG3_1 = GetSetting(args, 2);
s.ShowBG4_0 = s.ShowBG4_1 = GetSetting(args, 3);
s.ShowOBJ_0 = GetSetting(args, 4);
s.ShowOBJ_1 = GetSetting(args, 5);
s.ShowOBJ_2 = GetSetting(args, 6);
s.ShowOBJ_3 = GetSetting(args, 7);
core.PutSettings(s);
}
void SetBsnes(ISettable<BsnesCore.SnesSettings, BsnesCore.SnesSyncSettings> settingsProvider)
{
var s = settingsProvider.GetSettings();
Expand Down Expand Up @@ -306,9 +290,6 @@ void SetSmsHawk(SMS sms)
case GPGX gpgx:
SetGPGX(gpgx);
break;
case LibsnesCore snes:
SetLibsnes(snes);
break;
case BsnesCore bsnes:
SetBsnes(bsnes);
break;
Expand Down
25 changes: 2 additions & 23 deletions src/BizHawk.Client.Common/RomLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
using BizHawk.Emulation.Cores;
using BizHawk.Emulation.Cores.Libretro;
using BizHawk.Emulation.Cores.Nintendo.Sameboy;
using BizHawk.Emulation.Cores.Nintendo.SNES;
using BizHawk.Emulation.Cores.Sony.PSX;
using BizHawk.Emulation.Cores.Arcades.MAME;
using BizHawk.Emulation.DiscSystem;
Expand Down Expand Up @@ -696,28 +695,8 @@ private bool LoadXML(string path, CoreComm nextComm, HawkFile file, string force
}
catch (Exception ex)
{
try
{
// need to get rid of this hack at some point
rom = new RomGame(file);
game = rom.GameInfo;
game.System = VSystemID.Raw.SNES;
nextEmulator = new LibsnesCore(
game,
null,
rom.FileData,
Path.GetDirectoryName(path.SubstringBefore('|')),
nextComm,
GetCoreSettings<LibsnesCore, LibsnesCore.SnesSettings>(),
GetCoreSyncSettings<LibsnesCore, LibsnesCore.SnesSyncSettings>()
);
return true;
}
catch
{
DoLoadErrorCallback(ex.ToString(), VSystemID.Raw.GBL, LoadErrorType.Xml);
return false;
}
DoLoadErrorCallback(ex.ToString(), VSystemID.Raw.GBL, LoadErrorType.Xml);
return false;
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/BizHawk.Client.Common/config/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class Config
([ VSystemID.Raw.GBL ],
[ CoreNames.GambatteLink, CoreNames.GBHawkLink, CoreNames.GBHawkLink3x, CoreNames.GBHawkLink4x ]),
([ VSystemID.Raw.SGB ],
[ CoreNames.Gambatte, CoreNames.Bsnes115, CoreNames.SubBsnes115, CoreNames.Bsnes ]),
[ CoreNames.Gambatte, CoreNames.Bsnes115, CoreNames.SubBsnes115 ]),
([ VSystemID.Raw.GEN ],
[ CoreNames.Gpgx, CoreNames.PicoDrive ]),
([ VSystemID.Raw.N64 ],
Expand All @@ -49,7 +49,7 @@ public class Config
([ VSystemID.Raw.SMS, VSystemID.Raw.GG, VSystemID.Raw.SG ],
[ CoreNames.Gpgx, CoreNames.SMSHawk ]),
([ VSystemID.Raw.SNES ],
[ CoreNames.Snes9X, CoreNames.Bsnes115, CoreNames.SubBsnes115, CoreNames.Faust, CoreNames.Bsnes ]),
[ CoreNames.Snes9X, CoreNames.Bsnes115, CoreNames.SubBsnes115, CoreNames.Faust ]),
([ VSystemID.Raw.TI83 ],
[ CoreNames.Emu83, CoreNames.TI83Hawk ]),
};
Expand Down
151 changes: 0 additions & 151 deletions src/BizHawk.Client.Common/lua/LuaHelperLibs/SNESLuaLibrary.cs

This file was deleted.

4 changes: 2 additions & 2 deletions src/BizHawk.Client.EmuHawk/Extensions/CoreExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

using BizHawk.Emulation.Common;
using BizHawk.Emulation.Cores.Consoles.Nintendo.QuickNES;
using BizHawk.Emulation.Cores.Nintendo.SNES;
using BizHawk.Emulation.Cores.Nintendo.BSNES;
using BizHawk.Emulation.Cores.Nintendo.Gameboy;
using BizHawk.Emulation.Cores.Nintendo.SNES9X;
using BizHawk.Emulation.Cores.Consoles.Sega.gpgx;
Expand All @@ -27,7 +27,7 @@ public static Bitmap Icon(this IEmulator core)
return core switch
{
QuickNES => Properties.Resources.QuickNes,
LibsnesCore => Properties.Resources.Bsnes,
BsnesCore => Properties.Resources.Bsnes,
GPGX => Properties.Resources.GenPlus,
Gameboy => Properties.Resources.Gambatte,
Snes9x => Properties.Resources.Snes9X,
Expand Down
46 changes: 1 addition & 45 deletions src/BizHawk.Client.EmuHawk/MainForm.VSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
using BizHawk.Emulation.Cores.Nintendo.N64;
using BizHawk.Emulation.Cores.Nintendo.NES;
using BizHawk.Emulation.Cores.Nintendo.SNES9X;
using BizHawk.Emulation.Cores.Nintendo.SNES;
using BizHawk.Emulation.Cores.Nintendo.Sameboy;
using BizHawk.Emulation.Cores.Nintendo.SubGBHawk;
using BizHawk.Emulation.Cores.Nintendo.SubNESHawk;
Expand Down Expand Up @@ -734,12 +733,6 @@ private void PsxSubMenu_DropDownOpened(object sender, EventArgs e)



private DialogResult OpenOldBSNESGamepadSettingsDialog(ISettingsAdapter settable)
{
using SNESControllerSettings form = new(settable);
return this.ShowDialogWithTempMute(form);
}

private DialogResult OpenBSNESGamepadSettingsDialog(ISettingsAdapter settable)
{
using BSNESControllerSettings form = new(settable);
Expand All @@ -749,7 +742,6 @@ private DialogResult OpenBSNESGamepadSettingsDialog(ISettingsAdapter settable)
private void SNESControllerConfigurationMenuItem_Click(object sender, EventArgs e)
=> _ = Emulator switch
{
LibsnesCore => OpenOldBSNESGamepadSettingsDialog(GetSettingsAdapterForLoadedCore<LibsnesCore>()),
BsnesCore => OpenBSNESGamepadSettingsDialog(GetSettingsAdapterForLoadedCore<BsnesCore>()),
SubBsnesCore => OpenBSNESGamepadSettingsDialog(GetSettingsAdapterForLoadedCore<SubBsnesCore>()),
_ => DialogResult.None
Expand All @@ -758,16 +750,12 @@ private void SNESControllerConfigurationMenuItem_Click(object sender, EventArgs
private void SnesGfxDebuggerMenuItem_Click(object sender, EventArgs e)
=> Tools.Load<SNESGraphicsDebugger>();

private DialogResult OpenOldBSNESSettingsDialog(ISettingsAdapter settable)
=> SNESOptions.DoSettingsDialog(this, settable);

private DialogResult OpenBSNESSettingsDialog(ISettingsAdapter settable)
=> BSNESOptions.DoSettingsDialog(this, settable);

private void SnesOptionsMenuItem_Click(object sender, EventArgs e)
=> _ = Emulator switch
{
LibsnesCore => OpenOldBSNESSettingsDialog(GetSettingsAdapterForLoadedCore<LibsnesCore>()),
BsnesCore => OpenBSNESSettingsDialog(GetSettingsAdapterForLoadedCore<BsnesCore>()),
SubBsnesCore => OpenBSNESSettingsDialog(GetSettingsAdapterForLoadedCore<SubBsnesCore>()),
_ => DialogResult.None
Expand Down Expand Up @@ -805,27 +793,6 @@ private void SNES_ToggleBg(int layer)
settingsProvider.PutSettings(s);
break;
}
case LibsnesCore libsnes:
{
var s = libsnes.GetSettings();
switch (layer)
{
case 1:
result = s.ShowBG1_0 = s.ShowBG1_1 = !s.ShowBG1_1;
break;
case 2:
result = s.ShowBG2_0 = s.ShowBG2_1 = !s.ShowBG2_1;
break;
case 3:
result = s.ShowBG3_0 = s.ShowBG3_1 = !s.ShowBG3_1;
break;
case 4:
result = s.ShowBG4_0 = s.ShowBG4_1 = !s.ShowBG4_1;
break;
}
libsnes.PutSettings(s);
break;
}
case Snes9x snes9X:
{
var s = snes9X.GetSettings();
Expand Down Expand Up @@ -857,7 +824,7 @@ private void SNES_ToggleObj(int layer)
{
if (layer is < 1 or > 4) return; // should this throw?
bool result = false;
if (Emulator is LibsnesCore bsnes)
if (Emulator is BsnesCore bsnes)
{
var s = bsnes.GetSettings();
result = layer switch
Expand Down Expand Up @@ -1130,13 +1097,6 @@ ToolStripMenuItemEx CreateCoreSubmenu(VSystemCategory cat, string coreName, para
// Atari2600Hawk
items.Add(CreateCoreSubmenu(VSystemCategory.Consoles, CoreNames.Atari2600Hawk, CreateGenericCoreConfigItem<Atari2600>(CoreNames.Atari2600Hawk)));

// BSNES
var oldBSNESGamepadSettingsItem = CreateSettingsItem("Controller Configuration...", (_, _) => OpenOldBSNESGamepadSettingsDialog(GetSettingsAdapterFor<LibsnesCore>()));
var oldBSNESSettingsItem = CreateSettingsItem("Options...", (_, _) => OpenOldBSNESSettingsDialog(GetSettingsAdapterFor<LibsnesCore>()));
var oldBSNESSubmenu = CreateCoreSubmenu(VSystemCategory.Consoles, CoreNames.Bsnes, oldBSNESGamepadSettingsItem, oldBSNESSettingsItem);
oldBSNESSubmenu.DropDownOpened += (_, _) => oldBSNESGamepadSettingsItem.Enabled = MovieSession.Movie.NotActive() || Emulator is not LibsnesCore;
items.Add(oldBSNESSubmenu);

// BSNESv115+
var bsnesGamepadSettingsItem = CreateSettingsItem("Controller Configuration...", (_, _) => OpenBSNESGamepadSettingsDialog(GetSettingsAdapterFor<BsnesCore>()));
var bsnesSettingsItem = CreateSettingsItem("Options...", (_, _) => OpenBSNESSettingsDialog(GetSettingsAdapterFor<BsnesCore>()));
Expand Down Expand Up @@ -1500,10 +1460,6 @@ private void HandlePlatformMenus()
GBSubMenu.Visible = true;
SameBoyColorChooserMenuItem.Visible = Emulator is Sameboy { IsCGBMode: false }; // palette config only works in DMG mode
break;
case VSystemID.Raw.SNES when Emulator is LibsnesCore oldBSNES: // doesn't use "SGB" sysID, always "SNES"
SNESSubMenu.Text = oldBSNES.IsSGB ? "&SGB" : "&SNES";
SNESSubMenu.Visible = true;
break;
case var _ when Emulator is BsnesCore or SubBsnesCore:
SNESSubMenu.Text = $"&{sysID}";
SNESSubMenu.Visible = true;
Expand Down
Loading
Loading