Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: Question on games with interlaced video modes  (Read 6218 times)

0 Members and 1 Guest are viewing this topic.

emuola

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 131
  • Last login:June 15, 2017, 02:19:54 am
Question on games with interlaced video modes
« on: March 15, 2013, 10:50:22 am »
Just wondering this Interlaced stuff... Popeye and Up'n down are being displayed interlaced, the "nag" screen being virtually unreadable. The game looks much better than the nag screen, but the image is still a bit flickery/not as sharp as it could be. I know that Popeye uses a "double" interlaced mode 512 x 448 (256 x 224) and he blurry nag screen reports exactly that, but could not find info on Up'n Down. What resolution should it be in? Tried to disable the interlaced option in mame.ini, but then the games look even worse :( I presume this is just my m3129 being "not a good choice for a interlaced game" kinda thing? Or am I just a "spoiled with all this digital progressive sh*t" kinda guy?  ;) ;)

Running latest GroovyArcade, ATi X300 and M3129 tri-mode.
« Last Edit: March 15, 2013, 10:57:40 am by emuola »

eboshidori

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 13
  • Last login:May 20, 2013, 06:56:18 pm
  • Le CRT vaincra ! ^.^
Re: Question on games with interlaced video modes
« Reply #1 on: March 15, 2013, 11:14:41 pm »
The resolution of Popeye is 512x448 (horizontal screen). The sprites are done with 1:1 pixels (they are detailed), the rest is "doubled" (larger pixels). Back then, 15 KHz monitors only in arcades, so the 448 lines must be displayed in interlaced mode. MAME doesn't provide much details for the video parameters, so you have the generic "60.000000 Hz" refresh rate. In this case, the modeline is simple :

Code: [Select]
Modeline "512x448"   10.08   512 535 583 640   448 470 476 525  -hsync -vsync Interlace
525 lines, 60 Hz, 15.75 KHz.

If you have a tri-sync monitor, you can avoid interlaced display. Just double the pixel clock :

Code: [Select]
Modeline "512x448"   20.16   512 535 583 640   448 470 476 525  +hsync +vsync
525 lines, 60 Hz, 31.5 KHz.


On the other hand, Up 'n Down isn't in interlaced mode. The resolution is 512x224, so 224 lines in progressive mode. MAME lists 224x512 because the game is designed to be played with rotated monitor (vertical screen). You need to go in interlaced mode only if you want to play the game without rotating your monitor, and if it is a 15 KHz one.

What does MAME says about the timings ? Go to system1.c :

Code: [Select]
216  #define MASTER_CLOCK    XTAL_20MHz

2177      MCFG_SCREEN_RAW_PARAMS(MASTER_CLOCK/2, 640, 0, 512, 260, 0, 224)

So the pixel clock is 10 MHz,  640 pixels per line, and 512 for the active display. Then you have 260 total lines, 224 for the display.

The game shows you 256x224 pixels, but internally (for scrolling, collision detections etc.) the game use 512 instead of 256.

The timings at 15 KHz :

Code: [Select]
Modeline "512x224"   10.00   512 535 583 640   224 234 237 260  -hsync -vsync
And you get the perfect 60,096154 Hz for the refresh rate as indicated by MAME. Or, more accurately :
   
60,096153846153846153846153846154 Hz. :laugh:

Simply put : 16640 ms per frame. That's the true number that really counts.


If you don't want to rotate your monitor ( because it's heavy and you are lazy :D ), display the game in a 512 lines frame, but without going in interlaced mode, because you have a tri-sync monitor.

You should try this :

Code: [Select]
Modeline "224x512"   15.75   224 313 361 480   512 516 519 546  +hsync +vsync
Here you have the resolution of the game with the exact same frame duration as in regular 15 KHz mode:

(480x546) / 15.75 = 16640 ms.

Horizontal frequency is 32.8125 KHz, your monitor should support it.

The complete frame is 546 lines, because if you display the 512 lines of the game within 525 lines (standard for VGA), it may be too short for the sync period. And we must extend the height of the original frame (260 lines) by a little coeficient that works well with the horizontal frequency, so at the end we keep the ratio that gave us the frame duration, and we work with an easy dotclock. Here I choose 1.05 :
520 * 1.05 = 546.

Same for the horizontal freq : the original rate of the game is 15625 Hz, so we first double it (31250) and then multiply it by 1.05.
The width of the frame is 480 pixels, so you can have a picture with a near 3/4 ratio, with black border (normally, it should be centered, but you'll need a few adjustements).


So, avoid interlaced display every time it's possible. ;)
« Last Edit: March 15, 2013, 11:30:16 pm by eboshidori »

emuola

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 131
  • Last login:June 15, 2017, 02:19:54 am
Re: Question on games with interlaced video modes
« Reply #2 on: March 16, 2013, 03:30:34 am »
The resolution of Popeye is 512x448 (horizontal screen). The sprites are done with 1:1 pixels (they are detailed), the rest is "doubled" (larger pixels). Back then, 15 KHz monitors only in arcades, so the 448 lines must be displayed in interlaced mode. MAME doesn't provide much details for the video parameters, so you have the generic "60.000000 Hz" refresh rate. In this case, the modeline is simple :

Code: [Select]
Modeline "512x448"   10.08   512 535 583 640   448 470 476 525  -hsync -vsync Interlace
525 lines, 60 Hz, 15.75 KHz.

If you have a tri-sync monitor, you can avoid interlaced display. Just double the pixel clock :

Code: [Select]
Modeline "512x448"   20.16   512 535 583 640   448 470 476 525  +hsync +vsync
525 lines, 60 Hz, 31.5 KHz.


On the other hand, Up 'n Down isn't in interlaced mode. The resolution is 512x224, so 224 lines in progressive mode. MAME lists 224x512 because the game is designed to be played with rotated monitor (vertical screen). You need to go in interlaced mode only if you want to play the game without rotating your monitor, and if it is a 15 KHz one.

What does MAME says about the timings ? Go to system1.c :

Code: [Select]
216  #define MASTER_CLOCK    XTAL_20MHz

2177      MCFG_SCREEN_RAW_PARAMS(MASTER_CLOCK/2, 640, 0, 512, 260, 0, 224)

So the pixel clock is 10 MHz,  640 pixels per line, and 512 for the active display. Then you have 260 total lines, 224 for the display.

The game shows you 256x224 pixels, but internally (for scrolling, collision detections etc.) the game use 512 instead of 256.

The timings at 15 KHz :

Code: [Select]
Modeline "512x224"   10.00   512 535 583 640   224 234 237 260  -hsync -vsync
And you get the perfect 60,096154 Hz for the refresh rate as indicated by MAME. Or, more accurately :
   
60,096153846153846153846153846154 Hz. :laugh:

Simply put : 16640 ms per frame. That's the true number that really counts.


If you don't want to rotate your monitor ( because it's heavy and you are lazy :D ), display the game in a 512 lines frame, but without going in interlaced mode, because you have a tri-sync monitor.

You should try this :

Code: [Select]
Modeline "224x512"   15.75   224 313 361 480   512 516 519 546  +hsync +vsync
Here you have the resolution of the game with the exact same frame duration as in regular 15 KHz mode:

(480x546) / 15.75 = 16640 ms.

Horizontal frequency is 32.8125 KHz, your monitor should support it.

The complete frame is 546 lines, because if you display the 512 lines of the game within 525 lines (standard for VGA), it may be too short for the sync period. And we must extend the height of the original frame (260 lines) by a little coeficient that works well with the horizontal frequency, so at the end we keep the ratio that gave us the frame duration, and we work with an easy dotclock. Here I choose 1.05 :
520 * 1.05 = 546.

Same for the horizontal freq : the original rate of the game is 15625 Hz, so we first double it (31250) and then multiply it by 1.05.
The width of the frame is 480 pixels, so you can have a picture with a near 3/4 ratio, with black border (normally, it should be centered, but you'll need a few adjustements).


So, avoid interlaced display every time it's possible. ;)

Ok, thank you for a very detailed explanation eboshidori :) I wonder what this means for switchres in practice? I know it calculates the modelines based on the monitor specs in mame.ini, so if I want to have a "custom modeline" for Popeye, how is it possible to do that?


Calamity

  • Moderator
  • Trade Count: (0)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 7463
  • Last login:July 19, 2025, 04:03:33 am
  • Quote me with care
Re: Question on games with interlaced video modes
« Reply #3 on: March 19, 2013, 11:29:05 am »
Hi emuola,

Welcome eboshidori,

As pointed by eboshidori, the Popeye game used an interlaced resolution natively, so that's how it's intended to be.

On the other hand, Up'n down when it's rotated, its height will be 512 lines. But your crt_range2 monitor settings won't probably allow 512p@60.10Hz, the refresh is probably lowered so Hfreq keeps below 32.00 kHz. That's why the resolution is calculated using crt_range0 instead, where it can do 60.10 Hz, although interlaced.

crt_range0                15250-16500, 40-80, 4.087, 4.688, 2.519, 0.190, 0.191, 1.018, 1, 1, 224, 288, 448, 576
crt_range1                23900-24420, 40-80, 2.510, 3.000, 4.940, 0.451, 0.164, 1.048, 1, 1, 320, 384, 0, 0
crt_range2                31000-32000, 40-80, 0.536, 3.813, 2.106, 0.318, 0.064, 1.048, 1, 1, 480, 512, 0, 0

(these are your settings as posted by you)

So, if you want Up'n down to be 512p (crt_range2), try increasing the value of the -sync_refresh_tolerance option. This way the algorithm will 'tolerate' the bad vfreq and still produce a progressive resolution.

If you really want Popeye to be calculated as progressive, try doing this:

crt_range2                31000-32000, 40-80, 0.536, 3.813, 2.106, 0.318, 0.064, 1.048, 1, 1, 448, 512, 0, 0
« Last Edit: March 19, 2013, 11:30:58 am by Calamity »
Important note: posts reporting GM issues without a log will be IGNORED.
Steps to create a log:
 - From command line, run: groovymame.exe -v romname >romname.txt
 - Attach resulting romname.txt file to your post, instead of pasting it.

CRT Emudriver, VMMaker & Arcade OSD downloads, documentation and discussion:  Eiusdemmodi