wire up reset button for tic80 and make biz_time_rm tick post frame

This commit is contained in:
CasualPokePlayer 2022-06-16 15:56:34 -07:00
parent cb3bd6af72
commit 170ea47464
4 changed files with 13 additions and 2 deletions
Assets/dll
src/BizHawk.Emulation.Cores/Computers/TIC80
waterbox/tic80

Binary file not shown.

View File

@ -117,6 +117,7 @@ namespace BizHawk.Emulation.Cores.Computers.TIC80
{
public long Time;
public bool Crop;
public bool Reset;
}
[StructLayout(LayoutKind.Sequential)]

View File

@ -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"),
};
}
}

View File

@ -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)())