jotego / jtcores

FPGA cores compatible with multiple arcade game machines and KiCAD schematics of arcade games. Working on MiSTer FPGA/Analogue Pocket
https://patreon.com/jotego
GNU General Public License v3.0
216 stars 38 forks source link

Support for 60Hz regression #729

Open jotego opened 1 month ago

jotego commented 1 month ago

Many systems do not output exactly 60Hz video and are troublesome for many screens (#692). Having a general fallback option to adapt the system PLL speed to produce 60Hz would fix this problem at the expense of modified gameplay speed and audio pitch.

The solution should be part of jtframe and applied to all cores automatically

real-amano commented 1 month ago

I guess that would be a manual per-game option then? As I don't think that MISTer can know if there is monitor sync or not and thus "forced 60 hz" cannot be turned on as a fallback (eg. after x secs. without reaching sync).

Probable standard usecase: "I always want un-modified gameplay speed and correct audio pitch. But game XY has a troublesome horizontal signal length for my monitor and my monitor cannot sync at all. Thus I have to turn it on in the game options for that specific game".

MikeS11 commented 1 month ago

A better way to do it for a CRT without the sacrifice of changing the cores clocks is just to adjust the complete display window to fit the video timing better.

I've done this for many cores in the past

image

See: https://github.com/MiSTer-devel/WonderSwan_MiSTer/commit/c8df028ea227bc648a01af9017cfb17b25a3dcad

MikeS11 commented 1 month ago

See this example of how it would work for shouse

image

I built this to play around with https://docs.google.com/spreadsheets/d/1-dsPKfnta681RCE5VyKJGzNwRFjKvYVWYVJchHFKdE4/edit?usp=sharing

I think this is the location for it for the S18 core where H70 should be H83 to relax the timing for the line frequency to meet spec. E.g. 400 pixels vs 381 As per my calculations above. ** Though it wouldnt surprise me if HCNT END was what needed to change, not sure where the active window for the core is set

image

Note: HSYNC will need to shift as well probably between :8A- A6

E.g. Something like this:

.HB_START ( 9'h1ff ), .HB_END ( HB_END ), .HCNT_START( 9'h83 ), // it should be 'h50 .HCNT_END ( 9'h1FF ), .VB_START ( 9'h0DF ), .VB_END ( 9'h105 ), .VCNT_END ( 9'h105 ), // 262 lines .VS_START ( 9'hEF ), .VS_END ( 9'hF3 ), // 4 lines .HS_START ( 9'h08A ), .HS_END ( 9'h0A6 ) // 4.8us measured in PCB

jotego commented 1 month ago

I guess that would be a manual per-game option then? As I don't think that MISTer can know if there is monitor sync or not and thus "forced 60 hz" cannot be turned on as a fallback (eg. after x secs. without reaching sync).

Probable standard usecase: "I always want un-modified gameplay speed and correct audio pitch. But game XY has a troublesome horizontal signal length for my monitor and my monitor cannot sync at all. Thus I have to turn it on in the game options for that specific game".

That's the idea. The default is the original timing, and a 60Hz version can be turned on when needed.

jotego commented 3 hours ago

Documentation about reconfiguring the game PLL here