JayFoxRox / Lindbergh-Emulator

A Sega Lindbergh environment / HLE for Linux
46 stars 8 forks source link

File loading is too slow #51

Closed JayFoxRox closed 5 years ago

JayFoxRox commented 5 years ago

Original GitLab issue 46

Not sure what goes wrong, but loading files during attract mode seems to take forever.. (at least on the first run)

This is very annoying, marking as critical. Not sure what the reason is yet, but it's crazy how slow it is sometimes.

It actually prevents from playing in Outrun 2 as the next level section is not being loaded in time.

Should take a closer look at cridlg_thrd_proc (Typically runs on thread 4 for my machine). It would shift position on other machines as MESA creates threads..


I should hook cridlg_TryBeginInvoke for debugging like this:

break cridlg_TryBeginInvoke
commands
silent
set $function = *(uint32_t*)($ebp + 12)
set $argument = *(uint32_t*)($ebp + 16)
printf "Requesting CRI DLG invocation with 0x%X: ", $argument
p/a $function
continue
end

Additionally I should somehow print a2 (function) and a3 (argument).

If that doesn't help, lxCi seems to be a wrapper around this.

JayFoxRox commented 5 years ago

This does not happen under the following conditions:

Trying to reproduce it on said system now.


This has to do with GPU / CPU sync.

The game expects that gettimeofday (realtime) and glutSwapBuffers (60 [?] Hz) run at the same speed. If they don't, it seems to not load files for some reason.

My theory is that it sees framedrops and then delays loading of files to avoid further issues. However, if the framerate is kept low, it never gets a chance to do anything and the game logic fails fatally, as necessary data will not be loaded.

Solution should be discussed in #52

JayFoxRox commented 5 years ago

Closing, because GitLab issue was already closed.