[BSNESv115+] Fix Lag Frames For SGB (#2886)
* better lag detection for sgb. todo: might want to toggle this? * correct logic and don't fail build this time
This commit is contained in:
parent
7518ce962b
commit
036e349337
Binary file not shown.
|
@ -146,7 +146,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.BSNES
|
||||||
public delegate void snes_video_frame_t(ushort* data, int width, int height, int pitch);
|
public delegate void snes_video_frame_t(ushort* data, int width, int height, int pitch);
|
||||||
public delegate void snes_input_poll_t();
|
public delegate void snes_input_poll_t();
|
||||||
public delegate short snes_input_state_t(int port, int index, int id);
|
public delegate short snes_input_state_t(int port, int index, int id);
|
||||||
public delegate void snes_no_lag_t();
|
public delegate void snes_no_lag_t(bool sgb_poll);
|
||||||
public delegate void snes_audio_sample_t(short left, short right);
|
public delegate void snes_audio_sample_t(short left, short right);
|
||||||
public delegate string snes_path_request_t(int slot, string hint, bool required);
|
public delegate string snes_path_request_t(int slot, string hint, bool required);
|
||||||
public delegate void snes_trace_t(string disassembly, string register_info);
|
public delegate void snes_trace_t(string disassembly, string register_info);
|
||||||
|
|
|
@ -295,10 +295,13 @@ namespace BizHawk.Emulation.Cores.Nintendo.BSNES
|
||||||
return _controllers.CoreInputState(port, index, id);
|
return _controllers.CoreInputState(port, index, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void snes_no_lag()
|
private void snes_no_lag(bool sgbPoll)
|
||||||
{
|
{
|
||||||
// gets called whenever there was input polled, aka no lag
|
// gets called whenever there was input polled, aka no lag
|
||||||
IsLagFrame = false;
|
if (!IsSGB || sgbPoll)
|
||||||
|
{
|
||||||
|
IsLagFrame = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private readonly int[] palette = new int[32768];
|
private readonly int[] palette = new int[32768];
|
||||||
|
|
|
@ -24,6 +24,7 @@ namespace SameBoy {
|
||||||
static auto joyp_write(GB_gameboy_t*, uint8_t value) -> void {
|
static auto joyp_write(GB_gameboy_t*, uint8_t value) -> void {
|
||||||
bool p14 = value & 0x10;
|
bool p14 = value & 0x10;
|
||||||
bool p15 = value & 0x20;
|
bool p15 = value & 0x20;
|
||||||
|
if (!p14 || !p15) platform->notify("NOTIFY NO_LAG_SGB");
|
||||||
icd.joypWrite(p14, p15);
|
icd.joypWrite(p14, p15);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
typedef void (*snes_input_poll_t)(void);
|
typedef void (*snes_input_poll_t)(void);
|
||||||
typedef int16_t (*snes_input_state_t)(int port, int index, int id);
|
typedef int16_t (*snes_input_state_t)(int port, int index, int id);
|
||||||
typedef void (*snes_no_lag_t)(void);
|
typedef void (*snes_no_lag_t)(bool sgb_poll);
|
||||||
typedef void (*snes_video_frame_t)(const uint16_t* data, int width, int height, int pitch);
|
typedef void (*snes_video_frame_t)(const uint16_t* data, int width, int height, int pitch);
|
||||||
typedef void (*snes_audio_sample_t)(int16_t left, int16_t right);
|
typedef void (*snes_audio_sample_t)(int16_t left, int16_t right);
|
||||||
typedef char* (*snes_path_request_t)(int slot, const char* hint, int required);
|
typedef char* (*snes_path_request_t)(int slot, const char* hint, int required);
|
||||||
|
|
|
@ -444,8 +444,10 @@ auto Program::audioFrame(const double* samples, uint channels) -> void
|
||||||
|
|
||||||
auto Program::notify(string message) -> void
|
auto Program::notify(string message) -> void
|
||||||
{
|
{
|
||||||
if (message == "NOTIFY NO_LAG");
|
if (message == "NOTIFY NO_LAG")
|
||||||
snesCallbacks.snes_no_lag();
|
snesCallbacks.snes_no_lag(false);
|
||||||
|
else if (message == "NOTIFY NO_LAG_SGB")
|
||||||
|
snesCallbacks.snes_no_lag(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto Program::cpuTrace(vector<string> parts) -> void
|
auto Program::cpuTrace(vector<string> parts) -> void
|
||||||
|
|
Loading…
Reference in New Issue