diff --git a/Assets/dll/tic80.wbx.gz b/Assets/dll/tic80.wbx.gz index 3381882042..3ebb987ae4 100644 Binary files a/Assets/dll/tic80.wbx.gz and b/Assets/dll/tic80.wbx.gz differ diff --git a/src/BizHawk.Emulation.Cores/Computers/TIC80/LibTIC80.cs b/src/BizHawk.Emulation.Cores/Computers/TIC80/LibTIC80.cs index 0072ef0e4a..a68eb9e8c5 100644 --- a/src/BizHawk.Emulation.Cores/Computers/TIC80/LibTIC80.cs +++ b/src/BizHawk.Emulation.Cores/Computers/TIC80/LibTIC80.cs @@ -117,6 +117,7 @@ namespace BizHawk.Emulation.Cores.Computers.TIC80 { public long Time; public bool Crop; + public bool Reset; } [StructLayout(LayoutKind.Sequential)] diff --git a/src/BizHawk.Emulation.Cores/Computers/TIC80/TIC80.cs b/src/BizHawk.Emulation.Cores/Computers/TIC80/TIC80.cs index ec4a596eac..e119fb72d4 100644 --- a/src/BizHawk.Emulation.Cores/Computers/TIC80/TIC80.cs +++ b/src/BizHawk.Emulation.Cores/Computers/TIC80/TIC80.cs @@ -111,6 +111,8 @@ namespace BizHawk.Emulation.Cores.Computers.TIC80 ret.CategoryLabels[name] = "Keyboard"; } + ret.BoolButtons.Add("Reset"); + return ret.MakeImmutable(); } @@ -199,7 +201,8 @@ namespace BizHawk.Emulation.Cores.Computers.TIC80 return new LibTIC80.FrameInfo { Time = GetRtcTime(!DeterministicEmulation), - Crop = _settings.Crop + Crop = _settings.Crop, + Reset = controller.IsPressed("Reset"), }; } } diff --git a/waterbox/tic80/BizInterface.c b/waterbox/tic80/BizInterface.c index 5dec394305..32e212f77c 100644 --- a/waterbox/tic80/BizInterface.c +++ b/waterbox/tic80/BizInterface.c @@ -66,6 +66,7 @@ typedef struct FrameInfo b; u64 time; bool crop; + bool reset; } MyFrameInfo; bool lagged; @@ -73,9 +74,13 @@ void (*inputcb)() = 0; ECL_EXPORT void FrameAdvance(MyFrameInfo* f) { + if (f->reset) + { + tic_api_reset((tic_mem*)tic); + } + lagged = true; biz_time = f->time; - biz_clock_rm = (biz_clock_rm + 1) % 60; tic80_tick(tic, biz_inputs); tic80_sound(tic); @@ -111,6 +116,8 @@ ECL_EXPORT void FrameAdvance(MyFrameInfo* f) f->b.Height = height; f->b.Lagged = lagged; + + biz_clock_rm = (biz_clock_rm + 1) % 60; } ECL_EXPORT void SetInputCallback(void (*callback)())