Custom refresh rate like in BMC64?

Discuss development specific to the Pi version of ADFFS
Post Reply
Vanfanel
Posts: 507
Joined: Mon Sep 16, 2013 12:01 am

Custom refresh rate like in BMC64?

Post by Vanfanel » Mon May 20, 2019 8:45 pm

Hi there, Jon!

I dont know if you recall this, but I have reported several times that using the custom video mode for the PiTop will cause games with smooth scroll to show hiccups once in a while.
I also have an HDMI screen with the same native resolution as the PiTop screen, 1360x768. The results when using that mode are the same, with the occasional hiccups in framerate.
I reported it to rrossi, the BCM64 creator (BMC64 is THE baremetal C64 emulator for the Pi, no OS involved), because I had the same problem with BMC64, and he fixed it!!!, look: https://github.com/randyrossi/bmc64/blo ... .md#timing

So now, I have this on config.txt:

Code: Select all

# Custom 1360x768 50Hz
hdmi_cvt=1360 768 50 3 0 0 0
hdmi_group=2
hdmi_mode=87
And this on cmdline.txt (this is specific for BCM64, because it derivates the emulated cycles from real exact vsync rate):

Code: Select all

machine_timing=pal-custom cycles_per_refresh=980670
...And the native 1360x768 50Hz mode works great with BMC64, on the PiTop too! No more hiccups!
This is because 1360x768 50Hz is NOT exactly 50Hz, but 49.89Hz, and BMC64 takes this into account, while ADFFS does not.

So, could you please implement a solution for custom "floating point" framerates when a custom mode is used? That would bring perfect refresh rate to ADFFS, like in BMC64.

JonAbbott
Posts: 2269
Joined: Thu Apr 11, 2013 12:13 pm
Location: Essex
Contact:

Re: Custom refresh rate like in BMC64?

Post by JonAbbott » Wed May 22, 2019 12:16 pm

Vanfanel wrote:
Mon May 20, 2019 8:45 pm
This is because 1360x768 50Hz is NOT exactly 50Hz, but 49.89Hz, and BMC64 takes this into account, while ADFFS does not.
There's a couple of issues that BMC64 won't have to account for, but ADFFS does. Game VSync code cannot be run at VSync as it would potentially lock the machine due to an issue in the OS. To work around this, ADFFS generates a fake 50Hz VSync via RTSupport, out of phase with the actual VSync. When the two fall in-phase due to clock drift etc. you get a dropped frame.

There's absolutely nothing I can do to resolve the issue, as I have no control over the clocks and need to wait for the RISC OS devs to resolve what we believe is an contention issue, that's causing parts of the OS to lock when code runs at VSync.

Vanfanel
Posts: 507
Joined: Mon Sep 16, 2013 12:01 am

Re: Custom refresh rate like in BMC64?

Post by Vanfanel » Mon May 27, 2019 6:35 pm

@Jon: So maybe this feature can be implemented in the future, once things on the RISC OS side are fixed?

Post Reply