Closed seanshpark closed 2 years ago
About the message Video refresh rate: 0 Hz, inf ms
.
This looked strange.
Anyway found out that from this line in main.cpp
const int should_be_zero = SDL_GetCurrentDisplayMode(0, ¤t)
current.refresh_rate
was 0
I looked in to some SDL codes and some returned 0
and some just returned 60
.
I tried with this change
return current.refresh_rate ? current.refresh_rate : 60;
and seem working OK.
The log after DOS boot.
Video refresh rate: 60 Hz, 16.67 ms
Global: total = 6033.32 ms, mean = 6033.32 ms, std = 0.00 ms, n = 1
Frame: total = 6032.71 ms, mean = 8.17 ms, std = 10.59 ms, n = 738
Screen: total = 3818.37 ms, mean = 5.17 ms, std = 6.86 ms, n = 738
Events: total = 166.90 ms, mean = 0.23 ms, std = 2.62 ms, n = 738
CPU: total = 2045.89 ms, mean = 2.77 ms, std = 6.84 ms, n = 738
Expected clock: 1020484.45 Hz, 11.04 s
Actual clock: 1866740.08 Hz, 6.03 s
Now the clock is roughly about double.
This is after some time
Video refresh rate: 60 Hz, 16.67 ms
Global: total = 833707.78 ms, mean = 833707.78 ms, std = 0.00 ms, n = 1
Frame: total = 833653.53 ms, mean = 16.00 ms, std = 4.73 ms, n = 52102
Screen: total = 713308.81 ms, mean = 13.69 ms, std = 4.38 ms, n = 52102
Events: total = 12132.54 ms, mean = 0.23 ms, std = 0.32 ms, n = 52102
CPU: total = 108049.80 ms, mean = 2.07 ms, std = 0.94 ms, n = 52102
Expected clock: 1020484.45 Hz, 875.52 s
Actual clock: 1071665.83 Hz, 833.71 s
I will have to remove the clock info as it does not take into account changes of speed or resets.
Anyway, why don't you test the speed on Ubuntu 22.04.
It all comes down to texture repaint.
sa2 --gl-swap 0 --fixed-speed
Then, once it finishes the DOS boot, look at the FPS
on the About dialog and check different window sizes, including maximised and full screen.
look at the FPS on the About dialog and check different window sizes, including maximised and full screen.
my default (width=910, height=606) -> 50 ~ 70 maximized (in 1920x1080 res) --> 40 ~ 50 fullscreen (with F6) --> 140 ~ 150
thanks! now it works fine :)
Same on bullseye. Which is as fast as it has ever been.
But a few months ago, the situation was a lot worse.
Hi! I'm a big fan of AppleWin and glad to find this repo to play on Linux :)
I've tried to run this in Ubuntu 22.04 + Raspberry Pi 4 + SDL2. Speed is extremely slow and first thought was it isn't working as expected. I've tried with Qt and seemed working OK.
When I left the emulator running, DOS booted and prompt appeared. So it's about the speed... but why?
This is the log when after several seconds.