Viewing Issue Advanced Details
ID Category [?] Severity [?] Reproducibility Date Submitted Last Update
04662 Speed Minor Always Feb 7, 2012, 19:50 Aug 25, 2018, 14:30
Tester muf View Status Public Platform MAME (Official Binary)
Assigned To AWJ Resolution Fixed OS
Status [?] Resolved Driver
Version 0.145 Fixed in Version 0.158 Build
Fixed in Git Commit Github Pull Request #
Summary 04662: tgm2, tgm2p: Wrong framerate/refresh rate
Description I have a VGA capture card that syncs down to 15KHz, and capturing from it the following video mode is reported:
HSYNC 16.165KHz
VSYNC 61.700Hz

That is a 2.75% slowdown when playing at MAME's 60.000Hz. Proof is an out of range message from my flat panel monitor showing a squished picture. Note the monitor says 61.6, but since the capture card provides 3-digit decimal precision whereas the monitor only provides single-digit precision, I am siding with the capture card as to the correct video mode.
Steps To Reproduce
Additional Information This might apply to all PS5V2 games, and quite possibly all Psikyo SH-2 games, but I only have TGM2p to test with.
Github Commit
Flags Verified with Original
Regression Version
Affected Sets / Systems tgm2, tgm2p
Attached Files
jpg file icon 04072011055.JPG (127,192 bytes) Feb 7, 2012, 19:50 Uploaded by muf
muf
Relationships
There are no relationship linked to this issue.
Notes
15
User avatar
No.08157
muf
Tester
Feb 8, 2012, 00:06
This doesn't change the way the game timer counts, by the way. The timer actually runs faster-than-realtime, which means 8 minutes on the timer elapse in 7 minutes and 46.7 seconds of real-world time. YouTube gameplay videos from Japanese players confirm this.
User avatar
No.08159
hap
Developer
Feb 8, 2012, 00:54
edited on: Feb 8, 2012, 00:54
Strange that it doesn't match older measurements, from mame source drivers/psikyosh.c:
VSync - 60Hz, HSync - 15.27kHz

Are you certain that youre measurement hw is accurate?
User avatar
No.08160
colour_thief
Tester
Feb 8, 2012, 01:33
MAME is definitely too slow. I just stopwatch-timed it with my PCB and when the game said 8 minutes, only 7 minutes 46.82 seconds elapsed in real life. Accounting for the casualness of my testing method, this is extremely consistent with what muf has reported.

Is there something we can measure on the PCBs to work out the precise timing?
User avatar
No.08161
Haze
Senior Tester
Feb 8, 2012, 10:28
It uses a different resolution to everything else in the driver (probably a register to configure it) so a different framerate is quite likely IMHO.
User avatar
No.08162
muf
Tester
Feb 8, 2012, 11:31
The PCB also has a big red sticker saying something along the lines of "The monitor geometry must be adjusted to match this board", suggesting an oddball video mode.
User avatar
No.09605
muf
Tester
Jun 12, 2013, 13:27
Apparently there is a round-off of the sync rate happening in the capture GUI - the actual value seems to be 61.68Hz.
User avatar
No.11401
muf
Tester
Jan 25, 2015, 15:21
It's now 2015, and I'd like to see this fixed. Can someone tell me in which file the frame rates are defined? I'll submit a patch, then.
User avatar
No.11409
Kale
Developer
Jan 26, 2015, 16:48
So, let me think a little:

Pixel clock should be master_clock / 8 (57272700 / 8 = 7-ish MHz)
HTOTAL = pixel_clock / hsync = around 445/446
VTOTAL = hsync / vsync = 261/262

line 824 of drivers/psikyosh.c should be substituted with MCFG_SCREEN_RAW_PARAMS(MASTER_CLOCK/8,446,0,40*8,262,0,30*8), and checked with internal frame rate report (TAB key -> game information)
User avatar
No.11410
Haze
Senior Tester
Jan 26, 2015, 19:56
that gives 61.266277, which isn't 61.6
User avatar
No.11411
AWJ
Developer
Jan 26, 2015, 20:19
edited on: Jan 26, 2015, 20:19
I get htotal of 443 and vtotal of 262:

57272700 / 8 / 443 = 16160.5 Hz
57272700 / 8 / 443 / 262 = 61.681 Hz

RE the non-tgm games, I'm very suspicious of PCB measurements of exactly 60Hz Vsync (likely overly-aggressive rounding) and of 15.2 or so Hsync (too low, likely caused by improper composite sync separation, see the thread about CPS1 and Twin Cobra some time ago on the list)

tl;dr version if you do a naive measurement of a composite sync signal, you end up measuring the entire VSync pulse as a single scanline, this causes your Hsync measurement to be low by anywhere from 1% to 3% (depending on how long the hardware's VSync pulse is)

Using a htotal of 455 for the other games gives Hsync of 15734.26 Hz which is *exactly* NTSC. FWIW there's an unknown video register for which the value tgm writes differs by 12 from the value all other games write... though this is very weak evidence, little better than a wild guess.
User avatar
No.11415
Kale
Developer
Jan 27, 2015, 10:49
Calcs sounds fair to me.
User avatar
No.11417
colour_thief
Tester
Jan 27, 2015, 12:27
What region of the rom should I change if I want to burn roms that write to the unknown video register like the other games? I could confirm whether it controls the refresh rate.
User avatar
No.11419
Kale
Developer
Jan 27, 2015, 17:05
Just don't do it, playing with refresh rate when you don't know what you're doing is potentially prone to disaster (read: you might burn PCB and/or cabinet components/monitor).
User avatar
No.11422
muf
Tester
Jan 28, 2015, 13:12
Thanks so much for fixing this. For the other titles, I'll keep a lookout to see if I can borrow someone's Dragon Blaze board for a day to get the video signal measurements.

AWJ, do you think you could give 04663 the same treatment? As far as I know all PSX hardware runs at that rate, so it should probably be done in such a way that all PSX-based titles get fixed in one fell swoop.
User avatar
No.11424
AWJ
Developer
Jan 28, 2015, 21:26
PSX hardware has variable resolutions, interlaced and non-interlaced modes, and the arcade variants all run at different clock speeds, so it is in fact vanishingly unlikely that all PSX-based arcade titles run at the exact same refresh rate.