re4_tweaks
re4_tweaks copied to clipboard
[Hang] Non-60/30 framelimit causes game hang
As mentioned at https://github.com/nipkownix/re4_tweaks/pull/257#issuecomment-1183911869
Tried testing out UseDynamicFrametime with 51FPS nvidia framecap, seems to cause the freeze at start of first level issue that we had way back with one of the 90/120FPS fixes, don't think we ever found the actual cause for that though unfortunately, maybe will try looking into it more soon.
Tried having a quick look into it, seems it might be something to do with the TaskSleep
func, R120Event
runs fine up until the first call to that, but then never resumes afterward...
The TaskSleep stuff is kinda strange, seems its meant to act like the Sleep function on windows to sleep for X milliseconds, on PS2/GC it just stored the first (u32) param inside the TASK structs SleepCtr
field, but UHD converts to float now, and does some weird if (param <= 1) store 0.0000099999997
check inside it too...
If you nop that check out (6C5478 -> nop) to get rid of that 0.000009.. load then that seems to fix the hang, unfortunately also makes things run at really weird timings though (menus extremely fast, while 3D rendering goes really slow...)
Seems the FixedFrame
funcs get used on the SleepCtr
, FixedFrame mixes the param to them with deltaTime to adjust param for the game speed - TaskSchedulerMain
(~6C5B06) seems to use FixedFrame::operator--
to decrement the SleepCtr
, and then uses FixedFrame::operator>
to check it against 0, I'm guessing something there might be causing the issue, not sure yet though, could be something similar to https://github.com/nipkownix/re4_tweaks/pull/25#issuecomment-986015359 where the varying deltaTime value causes it to over/undershoot the greater-than check...