video_mode for 15khz monitor via VGA port?

Discussion about displays and related hardware including MiSTer filters and video settings.
retrodroid
Posts: 138
Joined: Tue Feb 02, 2021 5:55 pm
Has thanked: 96 times
Been thanked: 19 times

video_mode for 15khz monitor via VGA port?

Unread post by retrodroid »

I'm trying to configure my MiSTer to work optimally with my tri-sync arcade monitor (15KHz, 25KHz, 31KHz).

This seems like it should be obvious but when I went to tweak the mister.ini settings to get some sweet authentic 15KHz signal I was a bit dumbfounded. The video_mode settings comments only have high resolutions listed? I got it to work by selecting video_mode=6 for 640x480 60hz (31khz), but that isn't the authentic 15khz goodness that I'm looking for.

Eventually I just commented out the video_mode, video_mode_ntsc, video_mode_pal settings altogether and can now see it setting lower resolutions, but it still seems to be off what the original game resolution was. For example, Berzerk reports the following when it launches:

256x224 15.63KHz 59.6Hz
----------------------------------
640x240 12.59MHz 59.6Hz

So my question is, is it documented somewhere what the correct/ideal video_mode and related settings are for using MiSTer with 15KHz, 25KHz, and 31KHz monitors via the VGA port?

All help is appreciated!
Blitzwing
Posts: 103
Joined: Sat Sep 05, 2020 9:52 pm
Has thanked: 11 times
Been thanked: 24 times

Re: video_mode for 15khz monitor via VGA port?

Unread post by Blitzwing »

If you have vga_scaler=1 then you need to change it to vga_scaler=0

The high resolution modes should not do anything unless that option is set to 1.
retrodroid
Posts: 138
Joined: Tue Feb 02, 2021 5:55 pm
Has thanked: 96 times
Been thanked: 19 times

Re: video_mode for 15khz monitor via VGA port?

Unread post by retrodroid »

Yes, I have vga_scaler=0 set. For reference, here is my entire mister.ini file:

Code: Select all

[MiSTer]
key_menu_as_rgui=0     ; set to 1 to make the MENU key map to RGUI in Minimig (e.g. for Right Amiga)
forced_scandoubler=0   ; set to 1 to run scandoubler on VGA output always (depends on core).
ypbpr=0                ; set to 1 for YPbPr on VGA output.
composite_sync=0       ; set to 1 for composite sync on HSync signal of VGA output.
vga_scaler=0           ; set to 1 to connect VGA to scaler output.
hdmi_audio_96k=0       ; set to 1 for 96khz/16bit HDMI audio (48khz/16bit otherwise)
keyrah_mode=0x18d80002 ; VIDPID of keyrah for special code translation (0x23418037 for Arduino Micro)
vscale_mode=0          ; 0 - scale to fit the screen height.
                       ; 1 - use integer scale only.
                       ; 2 - use 0.5 steps of scale.
                       ; 3 - use 0.25 steps of scale.
vscale_border=0        ; set vertical border for TVs cutting the upper/bottom parts of screen (1-399)
;bootscreen=0          ; uncomment to disable boot screen of some cores like Minimig. 
;mouse_throttle=10     ; 1-100 mouse speed divider. Useful for very sensitive mice
rbf_hide_datecode=0    ; 1 - hides datecodes from rbf file names. Press F2 for quick temporary toggle
menu_pal=0             ; 1 - PAL mode for menu core
hdmi_limited=0         ; 1 - use limited (16..235) color range over HDMI
                       ; 2 - use limited (16..255) color range over HDMI, for VGA converters.
direct_video=1         ; 1 - enable core video timing over HDMI, use only with VGA converters.
fb_size=0              ; 0 - automatic, 1 - full size, 2 - 1/2 of resolution, 4 - 1/4 of resolution.
fb_terminal=0          ; 1 - enabled (default), 0 - disabled
osd_timeout=30         ; 5-3600 timeout (in seconds) for OSD to disappear in Menu core. 30 seconds if not set.
                       ; Background picture will get darker after double timeout
osd_rotate=0           ; Display OSD menu rotated,  0 - no rotation, 1 - rotate right (+90°), 2 - rotate left (-90°)                  

; 1 - enables the recent file loaded/mounted.
; WARNING: This option will enable write to SD card on every load/mount which may wear the SD card after many writes to the same place
;          There is also higher chance to corrupt the File System if MiSTer will be reset or powered off while writing.
recents=0

; lastcore - Autoboot the last loaded core (corename autosaved in CONFIG/lastcore.dat) first found on the SD/USB
; lastexactcore - Autoboot the last loaded exact core (corename_yyyymmdd.rbf autosaved in CONFIG/lastcore.dat) first found on the SD/USB
; corename - Autoboot first corename_*.rbf found on the SD/USB
; corename_yyyymmdd.rbf - Autoboot first corename_yyyymmdd.rbf found on the SD/USB
;bootcore=lastcore    ; uncomment to autoboot a core, as the last loaded core.

; 10-30 timeout before autoboot, comment for autoboot without timeout.
bootcore_timeout=10

; Option to load the custom font. Format is plain bitmap 8x8.
; Supported sizes of font:
;   768 bytes - chars 32-127 (only alpha + numeric)
;  1024 bytes - chars 0-127
;  1136 bytes - chars 0-141
;  up to 2048 - only chars 0-141 will be used.
; if first 32 chars are empty (for sizes 1024 bytes and more) then they are skipped.
font=font/myfont.pf

; USER button emulation by keybaord. Usually it's reset button.
; 0 - lctrl+lalt+ralt (lctrl+lgui+rgui on keyrah)
; 1 - lctrl+lgui+rgui
; 2 - lctrl+lalt+del
; 3 - same as 0 (lctrl+lalt+ralt on keyrah)
reset_combo=0

; set to 1 for DVI mode. Audio won't be transmitted through HDMI in DVI mode.
dvi_mode=0

; 0 - 1280x720@60
; 1 - 1024x768@60
; 2 - 720x480@60
; 3 - 720x576@50
; 4 - 1280x1024@60
; 5 - 800x600@60
; 6 - 640x480@60
; 7 - 1280x720@50
; 8 - 1920x1080@60
; 9 - 1920x1080@50
;10 - 1366x768@60
;11 - 1024x600@60
;12 - 1920x1440@60
;13 - 2048x1536@60
;
; custom mode: hact,hfp,hs,hbp,vact,vfp,vs,vbp,Fpix_in_KHz
;   video_mode=1280,110,40,220,720,5,5,20,74250
;video_mode=6

; set to 1-10 (seconds) to display video info on startup/change
video_info=10

; Set to 1 for automatic HDMI VSync rate adjust to match original VSync.
; Set to 2 for low latency mode (single buffer).
; This option makes video butter smooth like on original emulated system.
; Adjusting is done by changing pixel clock. Not every display supports variable pixel clock.
; For proper adjusting and to reduce possible out of range pixel clock, use 60Hz HDMI video
; modes as a base even for 50Hz systems. 
vsync_adjust=2

; If you monitor doesn't support either very low (NTSC monitors may not support PAL) or 
; very high (PAL monitors may not support NTSC) then you can set refresh_min and/or refresh_max
; parameters, so vsync_adjust won't be applied for refreshes outside specified.
; These parameters are valid only when vsync_adjust is non-zero.
refresh_min=0
refresh_max=0

; These parameters have the same format as video_mode.
; You need to supply both PAL and NTSC modes if you want vsync_adjust to switch between
; predefined modes as a base. This will reduce the range of pixel clock.
;video_mode_ntsc=6
;video_mode_pal=9

; 1-10 (seconds) to display controller's button map upon first time key press
; 0 - disable
controller_info=6

; JammaSD/J-PAC/I-PAC keys to joysticks translation
; You have to provide correct VID and PID of your input device
; Examples: Legacy J-PAC with Mini-USB or USB capable I-PAC with PS/2 connectors VID=0xD209/PID=0x0301
; USB Capable J-PAC with only PS/2 connectors VID=0x04B4/PID=0x0101
; JammaSD: VID=0x04D8/PID=0xF3AD
jamma_vid=0x04D8
jamma_pid=0xF3AD

; Disable merging input devices. Use if only player 1 works.
; Leave no_merge_pid empty to apply this to all devices with the same VID.
;no_merge_vid=0x045E
;no_merge_pid=0x028E

; Speeds in sniper/non-sniper modes of mouse emulation by joystick 
; 0 - (default) - faster move in non-sniper mode, slower move in sniper mode.
; 1 - movement speeds are swapped.
sniper_mode=0

; Uncomment following option if you don't want to see a second line for long file names in listing.
;browse_expand=0

; 0 - disable MiSTer logo in Menu core
logo=1

; Custom shared folder for core supporting this feature (currently minimig and ao486 only)
; Can be relative to core's home dir or absolute path.
; Path must exist before core start to use it, or it will fail.
; Make sure USB device is mounted before use shared folder on USB!
shared_folder=

; Custom aspect ratio
;custom_aspect_ratio_1=16:10
;custom_aspect_ratio_2=1:1

; use specific (VID/PID) mouse X movement as a spinner and paddle. Use VID=0xFFFF/PID=0xFFFF to use all mice as spinners.
; spinner_throttle with base value 100 gives one spinner step per one tick. Higher value makes spinner slower.
; Lower than 100 makes spinner faster. Negative value gives opposite direction.
;spinner_vid=0x1BCF
;spinner_pid=0x0005
;spinner_throttle=-50

; Default filters for video scaler and audio. Paths must be relative to scaler/audio filter filders without leading slash.
;vfilter_default=LCD_Effect/07.txt
;afilter_default=LPF2000_3tap.txt
Blitzwing
Posts: 103
Joined: Sat Sep 05, 2020 9:52 pm
Has thanked: 11 times
Been thanked: 24 times

Re: video_mode for 15khz monitor via VGA port?

Unread post by Blitzwing »

I guess you're using an HDMI to VGA converter rather than and I/O board? direct_video=1

I haven't ever used one so I'm in guessing territory now, but if you're not might be worth changing it to 0 instead, maybe it causes an issue with the I/O board VGA?

Having never used you type of monitor forgive me for asking the obvious, there isn't some sort of setting on the monitor for different horizontal refresh rates or is it automatic? Also does it use standard VGA HV sync or does it require composite? Composite_sync=1?

Like I said before it is odd having vga_scaler=0 and then video_mode still doing something it shouldn't do anything.
retrodroid
Posts: 138
Joined: Tue Feb 02, 2021 5:55 pm
Has thanked: 96 times
Been thanked: 19 times

Re: video_mode for 15khz monitor via VGA port?

Unread post by retrodroid »

No, to confirm, I'm using the VGA out on the analog IO board.

The monitor is a Wells Gardner D9200 arcade monitor. It will auto-sync to 15KHz, 25KHz, and 31KHz frequencies.

Relevant monitor details:
  • The D9200 supports arcade boards that operate between 15.75 - 31.5kHz, but it does not support the entire range 15.75 - 31.5kHz - it is really a fixed frequency monitor that supports hclocks at 15.75kHz, 25kHz, and 31.5kHz with a 1-2kHz error margin at each frequency.
  • The D9200 was designed to support arcade boards that run hclocks between 15.75 - 31.5kHz. Consequently, at an hclock of 15.75kHz and 25kHz it was designed to run a vclock between 50-60Hz (i.e. Standard CGA, EGA frequencies). And at an hclock of 31.5kHz it was designed to run at a vclock between 60-90Hz (i.e. Standard VGA frequencies).
  • Max pclock is 25mHz.
If I turn direct_video=0, when launching the Berzerk core I see:

256x224 15/63KHz 59.6Hz
-----------------------------------
1280x720 74.25MHz 60.0Hz

...so using the direct_video setting does impact the analog VGA output, even though the .ini file comments suggest it's for use with HDMI + VGA adaptor.
User avatar
LamerDeluxe
Top Contributor
Posts: 1239
Joined: Sun May 24, 2020 10:25 pm
Has thanked: 887 times
Been thanked: 284 times

Re: video_mode for 15khz monitor via VGA port?

Unread post by LamerDeluxe »

Try with composite_sync=1, check your sync on green switch on your IO board (should be off). Don't use a scaler option in the core menu.
retrodroid
Posts: 138
Joined: Tue Feb 02, 2021 5:55 pm
Has thanked: 96 times
Been thanked: 19 times

Re: video_mode for 15khz monitor via VGA port?

Unread post by retrodroid »

LamerDeluxe wrote: Tue Feb 16, 2021 11:42 pm Try with composite_sync=1, check your sync on green switch on your IO board (should be off). Don't use a scaler option in the core menu.
Tried this, I get the same result with Berzerk:

256x224 15.63KHz 59.6Hz
----------------------------------
640x240 12.59MHz 59.6Hz

...except now the first 5 rows at the top of the screen are slanted.

If I revert to composite_sync=0, with just direct_video=1, I get the same frequency but no distortion.

Could it be a modeline issue? I'm not setting a video_mode value at all in my mister.ini.
zakk4223
Posts: 289
Joined: Sun May 24, 2020 10:55 pm
Been thanked: 120 times

Re: video_mode for 15khz monitor via VGA port?

Unread post by zakk4223 »

I think the on screen display is confusing you.

MiSTer simultaneously outputs to the hdmi and analog. Unless you have vga_scaler=1, the analog output comes directly from the core (which is what the top line in the video mode OSD shows). The bottom line in the OSD is the scaler output, which is sent to HDMI.

I have an extron that displays the video timing of analog inputs, and I can assure you it is the 'top' video mode coming out of the analog video port. This is the 'raw' analog output from the core, unscaled. For most arcade cores this is going to be 15khz (or close enough, depending on the game)

If for some reason the raw output from the core is incompatible with that game, you can create an ini section for that game and set vga_scaler=1 and video_mode= to an appropriate modeline. Having owned a D9200 in the past it is likely fine for 99.99% of arcade games and won't need this.

Edit: I think you also have to make sure that "Scandoubler FX" is set to None. If you set it to anything the analog port will output 31Khz.
User avatar
LamerDeluxe
Top Contributor
Posts: 1239
Joined: Sun May 24, 2020 10:25 pm
Has thanked: 887 times
Been thanked: 284 times

Re: video_mode for 15khz monitor via VGA port?

Unread post by LamerDeluxe »

zakk4223 wrote: Wed Feb 17, 2021 1:12 amEdit: I think you also have to make sure that "Scandoubler FX" is set to None. If you set it to anything the analog port will output 31Khz.
"Scandoubler FX" is what I meant instead of "scaler option".
retrodroid wrote: Wed Feb 17, 2021 12:33 amIf I revert to composite_sync=0, with just direct_video=1, I get the same frequency but no distortion.
Direct video is meant to directly output the original signals (like 15Khz) through the HDMI output, it shouldn't affect the VGA output on the analog IO board.
Blitzwing
Posts: 103
Joined: Sat Sep 05, 2020 9:52 pm
Has thanked: 11 times
Been thanked: 24 times

Re: video_mode for 15khz monitor via VGA port?

Unread post by Blitzwing »

As zakk said make sure that you don't have "Scandoubler FX" in the running cores OSD menu set to anything but off as it will set the output to 31khz.
retrodroid wrote: Wed Feb 17, 2021 12:33 am Could it be a modeline issue? I'm not setting a video_mode value at all in my mister.ini.
As long as vga_scaler=0 is set then video_mode won't do anything on the analogue output.
retrodroid wrote: Wed Feb 17, 2021 12:33 am 256x224 15.63KHz 59.6Hz
----------------------------------
640x240 12.59MHz 59.6Hz
https://www.google.com/search?q=berzerk ... e&ie=UTF-8

Going off of the top line then the VGA output is correct for Bezerk, so now the question is why is it slanted.
retrodroid
Posts: 138
Joined: Tue Feb 02, 2021 5:55 pm
Has thanked: 96 times
Been thanked: 19 times

Re: video_mode for 15khz monitor via VGA port?

Unread post by retrodroid »

zakk4223 wrote: Wed Feb 17, 2021 1:12 am I think the on screen display is confusing you.

MiSTer simultaneously outputs to the hdmi and analog. Unless you have vga_scaler=1, the analog output comes directly from the core (which is what the top line in the video mode OSD shows). The bottom line in the OSD is the scaler output, which is sent to HDMI.

I have an extron that displays the video timing of analog inputs, and I can assure you it is the 'top' video mode coming out of the analog video port. This is the 'raw' analog output from the core, unscaled. For most arcade cores this is going to be 15khz (or close enough, depending on the game)

If for some reason the raw output from the core is incompatible with that game, you can create an ini section for that game and set vga_scaler=1 and video_mode= to an appropriate modeline. Having owned a D9200 in the past it is likely fine for 99.99% of arcade games and won't need this.

Edit: I think you also have to make sure that "Scandoubler FX" is set to None. If you set it to anything the analog port will output 31Khz.
Thank-you! This is exactly the information I was missing. You are correct, the bottom row was throwing me off I was expecting it to match the top row, forgetting about the dual-output modes (analog + digital).

I came to realize the same thing last night when I checked the frequency using the monitor's setting display and it showed 15Khz. Plus the display itself looked fine / glorious.


To summarize, in order to enable the raw low-freq. output from the VGA port you need to consider these three settings:

mister.ini:
direct_video=1 ;Enable direct video output from the core
vga_scaler=0 ;Disable the scaler on the VGA port

..and also ensure that in the core settings that "Scandoubler FX" is set to None. 8-)

Thanks again everyone.
Gryzor
Posts: 38
Joined: Wed May 27, 2020 2:51 pm
Has thanked: 2 times
Been thanked: 7 times

Re: video_mode for 15khz monitor via VGA port?

Unread post by Gryzor »

Glad you got it running at 15Khz :)
You can also leave direct_video=0 as that line only affects output through the HDMI port of your MiSTer.
retrodroid
Posts: 138
Joined: Tue Feb 02, 2021 5:55 pm
Has thanked: 96 times
Been thanked: 19 times

Re: video_mode for 15khz monitor via VGA port?

Unread post by retrodroid »

Gryzor wrote: Wed Feb 17, 2021 6:47 pm Glad you got it running at 15Khz :)
You can also leave direct_video=0 as that line only affects output through the HDMI port of your MiSTer.
Ah, okay.

So experimenting a bit, I see the following settings are all I need for horizontal games @ 15KHz:
vga_scaler=0
vsync_adjust=2

And for vertical games, I can run the monitor at 640x480@60 by adding the following:
video_mode=6 ;(640x480@60)
vga_scaler=1
vscale_mode=1

Sweet!

Questions:
How much does having the vga_scaler enabled increase lag, if anything?
Is there a way to configure all vertical or horizontal games in one custom ini section, vs having to list each game by name?
Do the refresh_min, refresh_max settings apply to VGA out? Only if vga_scaler is enabled? - Nevermind, it applies when vsync_adjust >0, but only supports limits between 40kHz and 80kHz.
Blitzwing
Posts: 103
Joined: Sat Sep 05, 2020 9:52 pm
Has thanked: 11 times
Been thanked: 24 times

Re: video_mode for 15khz monitor via VGA port?

Unread post by Blitzwing »

retrodroid wrote: Wed Feb 17, 2021 9:52 pm So experimenting a bit, I see the following settings are all I need for horizontal games @ 15KHz:
vga_scaler=0
vsync_adjust=2
vsync_adjust, video_mode, vscale_mode don't do anything unless vga_scaler=1
retrodroid wrote: Wed Feb 17, 2021 9:52 pm And for vertical games, I can run the monitor at 640x480@60 by adding the following:
video_mode=6 ;(640x480@60)
vga_scaler=1
vscale_mode=1
Looks good and then you can just flip/rotate in the arcade cores menu that allow it to get the correct orientation. You can give vsync_adjust=2 a go here to try and get lag as low as possible for your vertical games.
retrodroid wrote: Wed Feb 17, 2021 9:52 pm Questions:
How much does having the vga_scaler enabled increase lag, if anything?
There may be better testing out there but having tested NES and Genesis it is at worst a couple of frames on a fast gaming LCD sat next to a CRT when vsync_adjust=2, so through a CRT it'll be even better I'm sure. https://pasteboard.co/JOYXgfY.jpg
retrodroid
Posts: 138
Joined: Tue Feb 02, 2021 5:55 pm
Has thanked: 96 times
Been thanked: 19 times

Re: video_mode for 15khz monitor via VGA port?

Unread post by retrodroid »

So I've been mucking around trying to see which configuration provides the best PQ for running vertical games on my horizontal monitor.

I had been using video_mode=6 (640x480x60Hz), which was okay, but things seemed a little off.

Running the monitor at 512x448x60 is the best I could come up with.

Code: Select all

video_mode=512,8,80,32,448,37,7,33,19908   ;512x448 31.500KHz
vga_scaler=1
vscale_mode=1
forced_scandoubler=1
One interesting thing I "discovered" is that if I run with no Filters defined the picture shows obvious scaling artifacts, regardless of the vscale_mode setting, but the instant I configured a custom filter the overall PQ improved dramatically, with basically zero visible artifacts. I settled on a nice 10% (lowest) vertical scanline filter.

Overall I'm pretty pleased with the PQ of the vertical games I've tried so far.
FoxbatStargazer
Top Contributor
Posts: 1019
Joined: Thu Dec 10, 2020 5:44 pm
Has thanked: 315 times
Been thanked: 238 times

Re: video_mode for 15khz monitor via VGA port?

Unread post by FoxbatStargazer »

retrodroid wrote: Wed Feb 17, 2021 9:52 pm Questions:
How much does having the vga_scaler enabled increase lag, if anything?
The scaler lag itself is quite low, less than a frame. The trick however is if you use buffering via vsync_mode=0 or 1, this adds typically 1-2 frames of lag, which is significant. You should be able to get away with vsync_mode=2 on CRT but will have to deal with momentary blackouts in many cores when changing resolution and the like.
retrodroid
Posts: 138
Joined: Tue Feb 02, 2021 5:55 pm
Has thanked: 96 times
Been thanked: 19 times

Re: video_mode for 15khz monitor via VGA port?

Unread post by retrodroid »

FoxbatStargazer wrote: Sun Feb 21, 2021 7:22 am
retrodroid wrote: Wed Feb 17, 2021 9:52 pm Questions:
How much does having the vga_scaler enabled increase lag, if anything?
The scaler lag itself is quite low, less than a frame. The trick however is if you use buffering via vsync_mode=0 or 1, this adds typically 1-2 frames of lag, which is significant. You should be able to get away with vsync_mode=2 on CRT but will have to deal with momentary blackouts in many cores when changing resolution and the like.
I'm learning as I go, the video_mode=512,8,80,32,448,37,7,33,19908 mode works well for the nintendo games (DK, DKjr, etc.) and Galaga. I did notice some pretty nasty screen tear in Galaga though, so had to enable vsync_mode=1 which solved it.
Post Reply