Mode timings (hz)

Discuss game and other programming topics not specifically covered in another forum

Moderator: Programming Moderators

User avatar
sol_hsa
Posts: 273
Joined: Fri Jun 02, 2017 10:10 am
Location: Finland
Contact:

Mode timings (hz)

Postby sol_hsa » Mon May 25, 2020 2:19 pm

I've been pondering on working further on that music player of mine, and one little goal would be to produce better timings. So if a song is 50hz, I'd like to be able to play it at 50hz regardless of the video mode the next is in.

The idea is to use the raster interrupt and adjust that on every interrupt so I'm interrupting at quite approximately 50hz.

For this I need to know the range of the raster interrupt, which is pretty easy to find (just watch the raster position registers until they don't increase). Figuring out what our actual refresh rate is, is somewhat trickier.

In vga4 mode, for example, my monitor reports 54.6Hz for 50hz mode and 64.3hz for the 60hz mode.

How do I figure out the refresh rates?

The video timing register info doesn't really say what the refresh rate is, the copper documentation has some handwavy "vga0 is closer to 50/60hz and vga6 is closer to 60/70hz". I haven't found anything more specific.

User avatar
varmfskii
Posts: 287
Joined: Fri Jun 23, 2017 1:13 pm
Location: Stone Mountain, GA USA

Re: Mode timings (hz)

Postby varmfskii » Mon May 25, 2020 2:55 pm

There is a bit table in the wiki (somewhere) that contains a lot of timing information to include the number of Ts per blanking interval and line. I'll find the link for the exact page.
Backer #2741 - TS2068, Byte, ZX Evolution

User avatar
varmfskii
Posts: 287
Joined: Fri Jun 23, 2017 1:13 pm
Location: Stone Mountain, GA USA

Re: Mode timings (hz)

Postby varmfskii » Mon May 25, 2020 2:58 pm

Backer #2741 - TS2068, Byte, ZX Evolution

User avatar
sol_hsa
Posts: 273
Joined: Fri Jun 02, 2017 10:10 am
Location: Finland
Contact:

Re: Mode timings (hz)

Postby sol_hsa » Mon May 25, 2020 3:35 pm

Yes, that's the one that says:
The effect of this speed up means that mode 0 will execute in one second of
time whereas mode 6 will execute in a shorter time period. Mode 0 is as close
to 50/60 Hz as possible where mode 6 is closer to 60/70 Hz. That would mean
that one second of machine time for mode 6 will execute in 0.83 seconds of
human time when running 50 frames per second at 60Hz.

User avatar
sol_hsa
Posts: 273
Joined: Fri Jun 02, 2017 10:10 am
Location: Finland
Contact:

Re: Mode timings (hz)

Postby sol_hsa » Tue May 26, 2020 10:02 am

Well, here's some experimental data, based on what my monitor reports.

Code: Select all

        50hz    60hz
vga0    49.3    58.1
vga1    50.3    59.3
vga2    51.9    61.1
vga3    52.8    62.2
vga4    54.6    64.3
vga5    56.4    66.4
vga6    58.1    68.5
hdmi    50      60
What's funny about the above values is that when the next first boots up I get complaint about bad frequency that's exactly 50.0.
Whenever I disable scan doubler I just get "no signal", so I don't know if that affects the frequency.

edit: tested with hdmi (different monitor), that reports 50 and 60hz.


Who is online

Users browsing this forum: No registered users and 3 guests