[MovieClock.lua] use cycle based time for Gambatte/SubGBHawk (#2708)
* use cycle based time for Gambatte/SubGBHawk * non-functional cleanup
This commit is contained in:
parent
b9123453aa
commit
1fe2a12b67
|
@ -1,12 +1,22 @@
|
|||
while true do
|
||||
if (movie.isloaded()) then
|
||||
fps = movie.getfps();
|
||||
frames = emu.framecount();
|
||||
tseconds = (frames / fps)
|
||||
if movie.getheader()["Core"] == "Gambatte" then
|
||||
clockrate = 2 ^ 21;
|
||||
cycles = emu.totalexecutedcycles();
|
||||
tseconds = (cycles / clockrate);
|
||||
elseif movie.getheader()["Core"] == "SubGBHawk" then
|
||||
clockrate = 2 ^ 22;
|
||||
cycles = emu.totalexecutedcycles();
|
||||
tseconds = (cycles / clockrate);
|
||||
else
|
||||
fps = movie.getfps();
|
||||
frames = emu.framecount();
|
||||
tseconds = (frames / fps);
|
||||
end
|
||||
secondsraw = tseconds % 60;
|
||||
shift = 10 ^ 2;
|
||||
seconds = math.floor((secondsraw * shift) + 0.5) / shift;
|
||||
secondsstr = string.format("%.2f", seconds)
|
||||
secondsstr = string.format("%.2f", seconds);
|
||||
if (seconds < 10) then
|
||||
secondsstr = "0" .. secondsstr;
|
||||
end
|
||||
|
@ -26,4 +36,4 @@ while true do
|
|||
gui.text(0, 0, time, nil, 1);
|
||||
end
|
||||
emu.frameadvance();
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue