VGA Mode Changing for 720x400 and 640x400
-
- Top Contributor
- Posts: 1018
- Joined: Thu Dec 10, 2020 5:44 pm
- Has thanked: 315 times
- Been thanked: 238 times
Re: VGA Mode Changing for 720x400 and 640x400
-
- Top Contributor
- Posts: 1441
- Joined: Mon May 25, 2020 7:54 pm
- Has thanked: 496 times
- Been thanked: 467 times
Re: VGA Mode Changing for 720x400 and 640x400
I really hope eventually we will see a permanent 1:1 solution (with approximations my CRT OCD flares up).
CRT SCR$ Project - building a collection of high-quality photos of CRT displays
CRT ART Books - retro-gaming books with authentic CRT photos
Re: VGA Mode Changing for 720x400 and 640x400
-
- Top Contributor
- Posts: 1018
- Joined: Thu Dec 10, 2020 5:44 pm
- Has thanked: 315 times
- Been thanked: 238 times
Re: VGA Mode Changing for 720x400 and 640x400
video_mode = 1600,40,160,200,400,5,2,28,58500
I mostly make lines from here, and if they don't work, just play with the blanking lines a bit, it's all rather arbitrary and will vary based on your display.
Keep in mind this is 400p so you will need refresh rate variable and be running 70hz DOS stuff. 60 hz and you will probably lose sync on a VGA CRT.
Re: VGA Mode Changing for 720x400 and 640x400
Sorry to leave you all hanging, but I finally got around to trying to giving this a more proper treatment.
https://github.com/tsowell/Main_MiSTer/ ... modes-file
https://github.com/tsowell/ao486_MiSTer ... c-polarity
The custom modes are configurable now. You set the custom_video_modes_file option in MiSTer.ini to the path to the file your custom modes are in.
And you define modes in that file like:
Code: Select all
WIDTHxHEIGHT=MODE
You can also specify sync polarity in custom modes now by appending two numbers to the end of the mode (0 for negative, 1 for positive). See my custom modes below for an example. This works anywhere custom mode strings are used, but the sync polarity will only change if the core supports it, and I've only added support to ao486. I think the patch should apply cleanly to any core though.
Here's how I have mine configured for my IBM 8512 monitor.
In MiSTer.ini I have:
Code: Select all
custom_video_modes_file=/media/fat/custom_modes
Code: Select all
720x400=720,15,108,51,400,11,2,32,28322,0,1 ; 720x400@70Hz -hsync +vsync
320x200=640,16,96,48,400,12,2,35,25175,0,1 ; 640x400@70Hz -hsync +vsync
640x400=640,16,96,48,400,12,2,35,25175,0,1 ; 640x400@70Hz -hsync +vsync
Anyway, MiSTer and ao486.rbf binaries are attached. Like last time, you only need the rbf if you want to change sync polarity, but you'll need to use this version of the rbf with this version of MiSTer because I've changed the way sync polarity is set over SPI.
Let me know if this whole setup is sensible or if I'm missing anything. I plan to open a PR for it, but I thought it would be good to run it by you folks first.
- Attachments
-
- custom-video-modes-file.zip
- MiSTer and ao486.rbf binaries
- (2.43 MiB) Downloaded 266 times
-
- Top Contributor
- Posts: 552
- Joined: Sun May 24, 2020 8:07 pm
- Has thanked: 185 times
- Been thanked: 310 times
- Contact:
Re: VGA Mode Changing for 720x400 and 640x400
-
- Top Contributor
- Posts: 1441
- Joined: Mon May 25, 2020 7:54 pm
- Has thanked: 496 times
- Been thanked: 467 times
Re: VGA Mode Changing for 720x400 and 640x400
CRT SCR$ Project - building a collection of high-quality photos of CRT displays
CRT ART Books - retro-gaming books with authentic CRT photos
-
- Top Contributor
- Posts: 1018
- Joined: Thu Dec 10, 2020 5:44 pm
- Has thanked: 315 times
- Been thanked: 238 times
Re: VGA Mode Changing for 720x400 and 640x400
- atrac17
- Core Developer
- Posts: 162
- Joined: Sun May 24, 2020 10:51 pm
- Has thanked: 32 times
- Been thanked: 385 times
Re: VGA Mode Changing for 720x400 and 640x400
Outstanding work.tsowell wrote: ↑Sat Feb 12, 2022 4:54 am Hey,
Sorry to leave you all hanging, but I finally got around to trying to giving this a more proper treatment.
https://github.com/tsowell/Main_MiSTer/ ... modes-file
https://github.com/tsowell/ao486_MiSTer ... c-polarity
The custom modes are configurable now. You set the custom_video_modes_file option in MiSTer.ini to the path to the file your custom modes are in.
And you define modes in that file like:
MODE is the custom video mode (same format as used in MiSTer.ini) to use when the FPGA resolution matches WIDTH and HEIGHT. If you assign different modes to the same target resolution on multiple lines, MiSTer will store both and use whichever one most closely matches the vertical refresh rate of the FPGA's video mode. This might be handy on a display with one 50Hz resolution and one 60Hz resolution - you could use one for PAL and one for NTSC.Code: Select all
WIDTHxHEIGHT=MODE
You can also specify sync polarity in custom modes now by appending two numbers to the end of the mode (0 for negative, 1 for positive). See my custom modes below for an example. This works anywhere custom mode strings are used, but the sync polarity will only change if the core supports it, and I've only added support to ao486. I think the patch should apply cleanly to any core though.
Here's how I have mine configured for my IBM 8512 monitor.
In MiSTer.ini I have:
And /media/fat/custom_modes file has the following contents (semicolons start comments):Code: Select all
custom_video_modes_file=/media/fat/custom_modes
This matches the configuration I hard-coded in the proof-of-concept last year. Note the optional "0,1" parameters at the end of the modes to specify negative hsync and positive vsync polarity. If they are omitted, both polarities default to negative.Code: Select all
720x400=720,15,108,51,400,11,2,32,28322,0,1 ; 720x400@70Hz -hsync +vsync 320x200=640,16,96,48,400,12,2,35,25175,0,1 ; 640x400@70Hz -hsync +vsync 640x400=640,16,96,48,400,12,2,35,25175,0,1 ; 640x400@70Hz -hsync +vsync
Anyway, MiSTer and ao486.rbf binaries are attached. Like last time, you only need the rbf if you want to change sync polarity, but you'll need to use this version of the rbf with this version of MiSTer because I've changed the way sync polarity is set over SPI.
Let me know if this whole setup is sensible or if I'm missing anything. I plan to open a PR for it, but I thought it would be good to run it by you folks first.
-
- Top Contributor
- Posts: 1311
- Joined: Mon Jul 06, 2020 9:37 pm
- Has thanked: 634 times
- Been thanked: 308 times
Re: VGA Mode Changing for 720x400 and 640x400
-
- Top Contributor
- Posts: 1018
- Joined: Thu Dec 10, 2020 5:44 pm
- Has thanked: 315 times
- Been thanked: 238 times
Re: VGA Mode Changing for 720x400 and 640x400
-
- Top Contributor
- Posts: 1311
- Joined: Mon Jul 06, 2020 9:37 pm
- Has thanked: 634 times
- Been thanked: 308 times
Re: VGA Mode Changing for 720x400 and 640x400
Re: VGA Mode Changing for 720x400 and 640x400
Code: Select all
[video=320x200]
video_mode=640,16,96,48,400,12,2,35,25175,0,1
vscale_mode=2
[video=720x400@70.0]
video_mode=720,15,108,51,400,11,2,32,28322,0,1
I'm thinking if there's an exact match between the core's resolution and vertical refresh rate, it will use those settings. If no sub-section specifies a matching rate, it will fall back to one that matches the resolution and has no rate specified. Otherwise it will finally fall back to the [MiSTer] and core-specific settings.
-
- Top Contributor
- Posts: 552
- Joined: Sun May 24, 2020 8:07 pm
- Has thanked: 185 times
- Been thanked: 310 times
- Contact:
Re: VGA Mode Changing for 720x400 and 640x400
Do you use Discord? There's a nice community of like minded people that love talking about the computer cores and specifically AO486. https://discord.com/channels/6479093974 ... 8162279424tsowell wrote: ↑Sun Feb 20, 2022 2:37 am I wondered if it might be useful to change more than just the video mode based on different core video modes, so I'm looking at moving the configuration into sub-sections of MiSTer.ini, so you can do stuff like:
I think it will also make it a little more intuitive than having a whole new special file format just for this.Code: Select all
[video=320x200] video_mode=640,16,96,48,400,12,2,35,25175,0,1 vscale_mode=2 [video=720x400@70.0] video_mode=720,15,108,51,400,11,2,32,28322,0,1
I'm thinking if there's an exact match between the core's resolution and vertical refresh rate, it will use those settings. If no sub-section specifies a matching rate, it will fall back to one that matches the resolution and has no rate specified. Otherwise it will finally fall back to the [MiSTer] and core-specific settings.
Re: VGA Mode Changing for 720x400 and 640x400
https://github.com/tsowell/Main_MiSTer/ ... -overrides
Section names must follow the format "video=WIDTHxHEIGHT[@VREFRESH]". MiSTer will first look for an exactly-matching WIDTHxHEIGHT@VREFRESH section, and if one isn't found, it will fall back to a matching WIDTHxHEIGHT section if present.
Code: Select all
[video=320x200]
video_mode=640,16,96,48,400,12,2,35,25175,0,1
vscale_mode=2
[video=720x400@70.1]
video_mode=720,15,108,51,400,11,2,32,28322,0,1
The other is that in order to match by vertical refresh rate, the rate in the section name must match exactly the vertical refresh rate in video_info or the debug log. If MiSTer reports "640x480 31.47KHz 60.0Hz", the section title needs to be "[video=640x480@60.0]" in order to match. In other words, there's no fuzzy matching of refresh rate like in my previous attempt. (Though now you can at least use the existing video_mode_pal and video_mode_ntsc options in a video override section).
- Attachments
-
- ini-video-override.zip
- MiSTer and ao486.rbf binaries
- (2.43 MiB) Downloaded 281 times
-
- Top Contributor
- Posts: 1441
- Joined: Mon May 25, 2020 7:54 pm
- Has thanked: 496 times
- Been thanked: 467 times
Re: VGA Mode Changing for 720x400 and 640x400
CRT SCR$ Project - building a collection of high-quality photos of CRT displays
CRT ART Books - retro-gaming books with authentic CRT photos
-
- Top Contributor
- Posts: 552
- Joined: Sun May 24, 2020 8:07 pm
- Has thanked: 185 times
- Been thanked: 310 times
- Contact:
Re: VGA Mode Changing for 720x400 and 640x400
Congrats on the merge! This is my favorite feature, hands down.tsowell wrote: ↑Mon Feb 21, 2022 4:33 am Here's a version that supports video-mode-specific sub-sections in MiSTer.ini that can be used to override any configuration option. I'm much happier with this scheme.
https://github.com/tsowell/Main_MiSTer/ ... -overrides
Section names must follow the format "video=WIDTHxHEIGHT[@VREFRESH]". MiSTer will first look for an exactly-matching WIDTHxHEIGHT@VREFRESH section, and if one isn't found, it will fall back to a matching WIDTHxHEIGHT section if present.
There are a couple of caveats. One is that these sections should be the last sections in MiSTer.ini (so that they can "see" the preceding MiSTer/core options that they are not overriding).Code: Select all
[video=320x200] video_mode=640,16,96,48,400,12,2,35,25175,0,1 vscale_mode=2 [video=720x400@70.1] video_mode=720,15,108,51,400,11,2,32,28322,0,1
The other is that in order to match by vertical refresh rate, the rate in the section name must match exactly the vertical refresh rate in video_info or the debug log. If MiSTer reports "640x480 31.47KHz 60.0Hz", the section title needs to be "[video=640x480@60.0]" in order to match. In other words, there's no fuzzy matching of refresh rate like in my previous attempt. (Though now you can at least use the existing video_mode_pal and video_mode_ntsc options in a video override section).
-
- Posts: 38
- Joined: Fri Sep 11, 2020 7:37 pm
- Been thanked: 2 times
Re: VGA Mode Changing for 720x400 and 640x400
Is there a list of common resolutions used in the 486 core with the appropriate video_mode equivalents?
-
- Posts: 61
- Joined: Wed Jun 24, 2020 7:41 pm
- Location: Denver, CO
- Has thanked: 29 times
- Been thanked: 23 times
Re: VGA Mode Changing for 720x400 and 640x400
-
- Posts: 180
- Joined: Sun May 24, 2020 9:13 pm
- Has thanked: 186 times
- Been thanked: 34 times
Re: VGA Mode Changing for 720x400 and 640x400
Of course, if anyone has a better resource...
also, @tsowell thanks so much for this! I've literally just acquired a CRT and was wondering if there was this exact functionality available in MiSTer!
I do have a question though, does the screen mode change regardless or does the code check to see if the mapping is the same as current?
-
- Posts: 180
- Joined: Sun May 24, 2020 9:13 pm
- Has thanked: 186 times
- Been thanked: 34 times
Re: VGA Mode Changing for 720x400 and 640x400
-
- Posts: 61
- Joined: Wed Jun 24, 2020 7:41 pm
- Location: Denver, CO
- Has thanked: 29 times
- Been thanked: 23 times
Re: VGA Mode Changing for 720x400 and 640x400
Oh yea also also a ton of modelines here: https://github.com/glopgar/MISTer_video_modes
Re: VGA Mode Changing for 720x400 and 640x400
-
- Top Contributor
- Posts: 1311
- Joined: Mon Jul 06, 2020 9:37 pm
- Has thanked: 634 times
- Been thanked: 308 times
Re: VGA Mode Changing for 720x400 and 640x400
To be clear, this is actual 320x200 with scan lines, like how it looked on hardware back then. Not upscaled to 640x480. It looks way better in my opinion. It doubles the frequency to 140.2 Hz so the monitor can display it. Also the DOS text mode is actually 70.1Hz. The suggested modeline above is not.
[ao486]
; Set it to "Variable" in the video settings in the menu of the core
video_mode=1600,64,192,304,1200,1,3,46,162000 ; 1600x1200x60Hz I need to update this one to 70.1 Hz too just for good measure
direct_video=0 ; use the scaler
vsync_adjust=2 ; minimal lag
vscale_mode=1 ; integer scaling
video_info=3 ; show resolution information for X seconds
hdmi_limited=2 ; 1 - use limited (16..235) color range over HDMI
; 2 - use limited (16..255) color range over HDMI, for VGA converters.
[video=320x200@70.1]
video_mode=320,24,49,38,200,2,2,20,13535,0,1 ; 320x200@140.2Hz@31.4kHz DOS Games
[video=720x400@70.1]
video_mode=720,15,108,46,400,13,2,34,27983,0,1 ; 720x400@70.1Hz@31.48kHz DOS Text
A special shout out to akeley: Give these a try on your VGA monitor. You may like this better than your CRT TV!
Here are pictures from my VGA monitor using my phone. It looks way better in person. (open in a new tab to see native resolution):
Edit: Ignore my Monkey Island 2 screenshot, because the 320x200@140.2Hz modeline is for EGA and CGA games (at most 16 colors).
- Attachments
-
- sDSYAFA.jpeg (2.64 MiB) Viewed 17098 times
-
- F2zjZNE.jpeg (1.68 MiB) Viewed 17098 times
Re: VGA Mode Changing for 720x400 and 640x400
I use AO486 with a CRT monitor, if this has been merged, is there any documentation about this feature?
Do I only have to add the following under the [ao486] section
Code: Select all
[video=320x200@70.1]
video_mode=640,16,96,48,400,12,2,35,25175,0,1
vscale_mode=2
[video=720x400@70.1]
video_mode=720,15,108,51,400,11,2,32,28322,0,1
-
- Top Contributor
- Posts: 1311
- Joined: Mon Jul 06, 2020 9:37 pm
- Has thanked: 634 times
- Been thanked: 308 times
Re: VGA Mode Changing for 720x400 and 640x400
See my post above yours. I recommend my modelines instead. I also provided all of my other settings. You need to set it to "variable" in the menu.Schyz wrote: ↑Sun Mar 27, 2022 2:20 am Hi,
I use AO486 with a CRT monitor, if this has been merged, is there any documentation about this feature?
Do I only have to add the following under the [ao486] sectionAnd set Wider HV-Integer scaling?Code: Select all
[video=320x200@70.1] video_mode=640,16,96,48,400,12,2,35,25175,0,1 vscale_mode=2 [video=720x400@70.1] video_mode=720,15,108,51,400,11,2,32,28322,0,1
-
- Top Contributor
- Posts: 1018
- Joined: Thu Dec 10, 2020 5:44 pm
- Has thanked: 315 times
- Been thanked: 238 times
Re: VGA Mode Changing for 720x400 and 640x400
-
- Top Contributor
- Posts: 1311
- Joined: Mon Jul 06, 2020 9:37 pm
- Has thanked: 634 times
- Been thanked: 308 times
Re: VGA Mode Changing for 720x400 and 640x400
[video=320x200@70.1]
;video_mode=320,24,49,38,200,2,2,20,13535,0,1 ; 320x200@140.2Hz@31.4kHz DOS CGA/EGA/Adventure games with scanlines
video_mode=640,7,108,30,400,13,2,34,24708,0,1 ; 640x400@70.1Hz@31.48kHz VGA era games including 320x200, 320x400, 640x400 @70.1Hz
[video=320x400@70.1]
;video_mode=320,15,108,46,400,13,2,34,15392,0,1 ; 320x400@70.1Hz@31.48kHz This is not finished (not wide enough), but also not needed
video_mode=640,7,108,30,400,13,2,34,24708,0,1 ; 640x400@70.1Hz@31.48kHz VGA Games including 320x200, 320x400, 640x400 @70.1Hz
[video=640x400@70.1]
video_mode=640,7,108,30,400,13,2,34,24708,0,1 ; 640x400@70.1Hz@31.48kHz VGA Games including 320x200, 320x400, 640x400 @70.1Hz
[video=720x400@70.1]
video_mode=720,15,108,46,400,13,2,34,27983,0,1 ; 720x400@70.1Hz@31.48kHz DOS Text
-
- Top Contributor
- Posts: 1311
- Joined: Mon Jul 06, 2020 9:37 pm
- Has thanked: 634 times
- Been thanked: 308 times
Re: VGA Mode Changing for 720x400 and 640x400
I don't know yet, but I am guessing it is global. It can be easily tested by running another core, showing what resolution it uses, and then define a modeline that it can upscale to, like 1600x1200 in the ini file for it and see if it uses your modeline.FoxbatStargazer wrote: ↑Sun Mar 27, 2022 1:19 pm What I really want to confirm is whether supplying a list of resolutions is framework-wide now, and can be used in other cores? Or is it specific to AO486?