Clean up subframe inputs: fixes #3111 as well as a bug in SubNEShawk where using zapper prevented reset cycle from appearing
This commit is contained in:
parent
850d8e027c
commit
8e7be7c1f2
|
@ -130,7 +130,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
|
||||||
|
|
||||||
[CoreConstructor(VSystemID.Raw.GB)]
|
[CoreConstructor(VSystemID.Raw.GB)]
|
||||||
[CoreConstructor(VSystemID.Raw.GBC)]
|
[CoreConstructor(VSystemID.Raw.GBC)]
|
||||||
public GBHawk(CoreComm comm, GameInfo game, byte[] rom, /*string gameDbFn,*/ GBSettings settings, GBSyncSettings syncSettings)
|
public GBHawk(CoreComm comm, GameInfo game, byte[] rom, /*string gameDbFn,*/ GBSettings settings, GBSyncSettings syncSettings, bool subframe = false)
|
||||||
{
|
{
|
||||||
var ser = new BasicServiceProvider(this);
|
var ser = new BasicServiceProvider(this);
|
||||||
|
|
||||||
|
@ -199,7 +199,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
|
||||||
|
|
||||||
_controllerDeck = new(mppr is "MBC7"
|
_controllerDeck = new(mppr is "MBC7"
|
||||||
? typeof(StandardTilt).DisplayName()
|
? typeof(StandardTilt).DisplayName()
|
||||||
: GBHawkControllerDeck.DefaultControllerName);
|
: GBHawkControllerDeck.DefaultControllerName, subframe);
|
||||||
|
|
||||||
timer.Core = this;
|
timer.Core = this;
|
||||||
audio.Core = this;
|
audio.Core = this;
|
||||||
|
|
|
@ -10,7 +10,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
|
||||||
{
|
{
|
||||||
public class GBHawkControllerDeck
|
public class GBHawkControllerDeck
|
||||||
{
|
{
|
||||||
public GBHawkControllerDeck(string controller1Name)
|
public GBHawkControllerDeck(string controller1Name, bool subframe)
|
||||||
{
|
{
|
||||||
Port1 = ControllerCtors.TryGetValue(controller1Name, out var ctor1)
|
Port1 = ControllerCtors.TryGetValue(controller1Name, out var ctor1)
|
||||||
? ctor1(1)
|
? ctor1(1)
|
||||||
|
@ -24,6 +24,11 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
|
||||||
|
|
||||||
foreach (var kvp in Port1.Definition.Axes) Definition.Axes.Add(kvp);
|
foreach (var kvp in Port1.Definition.Axes) Definition.Axes.Add(kvp);
|
||||||
|
|
||||||
|
if (subframe)
|
||||||
|
{
|
||||||
|
Definition.AddAxis("Input Cycle", 0.RangeTo(70224), 70224);
|
||||||
|
}
|
||||||
|
|
||||||
Definition.MakeImmutable();
|
Definition.MakeImmutable();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -88,7 +88,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
|
|
||||||
public bool CanProvideAsync => false;
|
public bool CanProvideAsync => false;
|
||||||
|
|
||||||
internal void ResetControllerDefinition()
|
internal void ResetControllerDefinition(bool subframe)
|
||||||
{
|
{
|
||||||
ControllerDefinition = null;
|
ControllerDefinition = null;
|
||||||
|
|
||||||
|
@ -115,7 +115,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add in the reset timing axis for subneshawk
|
// Add in the reset timing axis for subneshawk
|
||||||
if (using_reset_timing && ControllerDefinition.Axes.Count == 0)
|
if (subframe)
|
||||||
{
|
{
|
||||||
ControllerDefinition.AddAxis("Reset Cycle", 0.RangeTo(500000), 0);
|
ControllerDefinition.AddAxis("Reset Cycle", 0.RangeTo(500000), 0);
|
||||||
}
|
}
|
||||||
|
@ -398,8 +398,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
public bool current_strobe;
|
public bool current_strobe;
|
||||||
public bool new_strobe;
|
public bool new_strobe;
|
||||||
public bool alt_lag;
|
public bool alt_lag;
|
||||||
// variable used with subneshawk to trigger reset at specific cycle after reset
|
|
||||||
public bool using_reset_timing = false;
|
|
||||||
// this function will run one step of the ppu
|
// this function will run one step of the ppu
|
||||||
// it will return whether the controller is read or not.
|
// it will return whether the controller is read or not.
|
||||||
public void do_single_step(IController controller, out bool cont_read, out bool frame_done)
|
public void do_single_step(IController controller, out bool cont_read, out bool frame_done)
|
||||||
|
|
|
@ -14,7 +14,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
IBoardInfo, IRomInfo, ISettable<NES.NESSettings, NES.NESSyncSettings>, ICodeDataLogger
|
IBoardInfo, IRomInfo, ISettable<NES.NESSettings, NES.NESSyncSettings>, ICodeDataLogger
|
||||||
{
|
{
|
||||||
[CoreConstructor(VSystemID.Raw.NES)]
|
[CoreConstructor(VSystemID.Raw.NES)]
|
||||||
public NES(CoreComm comm, GameInfo game, byte[] rom, NESSettings settings, NESSyncSettings syncSettings)
|
public NES(CoreComm comm, GameInfo game, byte[] rom, NESSettings settings, NESSyncSettings syncSettings, bool subframe = false)
|
||||||
{
|
{
|
||||||
var ser = new BasicServiceProvider(this);
|
var ser = new BasicServiceProvider(this);
|
||||||
ServiceProvider = ser;
|
ServiceProvider = ser;
|
||||||
|
@ -71,7 +71,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ResetControllerDefinition();
|
ResetControllerDefinition(subframe);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static readonly bool USE_DATABASE = true;
|
private static readonly bool USE_DATABASE = true;
|
||||||
|
|
|
@ -19,7 +19,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.SubGBHawk
|
||||||
var subGBSettings = (GBHawk.GBHawk.GBSettings)settings ?? new GBHawk.GBHawk.GBSettings();
|
var subGBSettings = (GBHawk.GBHawk.GBSettings)settings ?? new GBHawk.GBHawk.GBSettings();
|
||||||
var subGBSyncSettings = (GBHawk.GBHawk.GBSyncSettings)syncSettings ?? new GBHawk.GBHawk.GBSyncSettings();
|
var subGBSyncSettings = (GBHawk.GBHawk.GBSyncSettings)syncSettings ?? new GBHawk.GBHawk.GBSyncSettings();
|
||||||
|
|
||||||
_GBCore = new GBHawk.GBHawk(comm, game, rom, subGBSettings, subGBSyncSettings);
|
_GBCore = new GBHawk.GBHawk(comm, game, rom, subGBSettings, subGBSyncSettings, true);
|
||||||
|
|
||||||
HardReset();
|
HardReset();
|
||||||
current_cycle = 0;
|
current_cycle = 0;
|
||||||
|
@ -41,9 +41,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.SubGBHawk
|
||||||
|
|
||||||
_tracer = new TraceBuffer(_GBCore.cpu.TraceHeader);
|
_tracer = new TraceBuffer(_GBCore.cpu.TraceHeader);
|
||||||
ser.Register(_tracer);
|
ser.Register(_tracer);
|
||||||
|
|
||||||
_GBCore.ControllerDefinition.AddAxis("Input Cycle", 0.RangeTo(70224), 70224)
|
|
||||||
.MakeImmutable();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public GBHawk.GBHawk _GBCore;
|
public GBHawk.GBHawk _GBCore;
|
||||||
|
|
|
@ -14,13 +14,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.SubNESHawk
|
||||||
var subNesSettings = (NES.NES.NESSettings)settings ?? new NES.NES.NESSettings();
|
var subNesSettings = (NES.NES.NESSettings)settings ?? new NES.NES.NESSettings();
|
||||||
var subNesSyncSettings = (NES.NES.NESSyncSettings)syncSettings ?? new NES.NES.NESSyncSettings();
|
var subNesSyncSettings = (NES.NES.NESSyncSettings)syncSettings ?? new NES.NES.NESSyncSettings();
|
||||||
|
|
||||||
_nesCore = new NES.NES(comm, game, rom, subNesSettings, subNesSyncSettings)
|
_nesCore = new NES.NES(comm, game, rom, subNesSettings, subNesSyncSettings, true);
|
||||||
{
|
|
||||||
using_reset_timing = true
|
|
||||||
};
|
|
||||||
|
|
||||||
// Adds Reset timing control to controller definition
|
|
||||||
_nesCore.ResetControllerDefinition();
|
|
||||||
|
|
||||||
HardReset();
|
HardReset();
|
||||||
current_cycle = 0;
|
current_cycle = 0;
|
||||||
|
|
Loading…
Reference in New Issue