Page 1 of 2

15hz CRT support through CGA/EGA card simulation?

Posted: Tue Oct 27, 2020 1:23 pm
by Matsu
I don't know if this has been discussed before. But at least I tried and failed finding anything about it.

Would it in theory be possible to output proper 15khz resolutions by simulating an EGA card?
It would be awesome to display those old CGA/EGA games in their original non scandoubled resolutions on a CRT.

I was contemplating buying an isa EGA card for my old trusty 486, and figured this could actually be an excellent addition to the ao486 core.

Re: 15hz CRT support through CGA/EGA card simulation?

Posted: Tue Oct 27, 2020 3:06 pm
by deepthaw
All development on Ao486 seems to target the scaler for output. I'd love native EGA/VGA/CRT but I can understand why they aren't there when 99% of the users are probably on modern displays via HDMI.

Re: 15hz CRT support through CGA/EGA card simulation?

Posted: Tue Oct 27, 2020 3:26 pm
by retrorepair
I don't know about 99% of users, at least for this core.

A poll would be handy to gauge this.

Re: 15hz CRT support through CGA/EGA card simulation?

Posted: Tue Oct 27, 2020 10:34 pm
by macro
Only 640x200 and 320x200 would be 15Khz

640×350 is 21.9Khz

Re: 15hz CRT support through CGA/EGA card simulation?

Posted: Wed Oct 28, 2020 11:43 am
by Matsu
I don't think it's a matter of how many users will use it. But more about if it can it be done, and how easy it is to implement.
A poll however would definitely be nice. I expect there's quite a lot of CRT Mister users because of the accuracy and authentic retro feel.

If you'd want to be as era accurate as possible , I suppose EGA 15khz support would maybe fit better with a seperate 286 based core.
But there's not many EGA games that have trouble running on a 486. I still think this could be a neat addition.
Just setup a seperate hdd image specifically for 15khz 16 color bliss :)

Most EGA games used 200 line resolutions. It's mainly some puzzle/strategy games that have 350 line resolutions.
I tried to find a complete list but here's a what I gobbled together with information from reddit and vogons.

EGA games with 350 line Hi-Res resolutions:
Blockout
CD-Man
Color Lines
Crime Wave
EGATrek
Eric the Unready
Frederick Pohl's Gateway - also supports 640x200
Homeworld - also supports 640x200
King's Quest 6 - also supports 640x200
Lemmings - rare case where the gameplay is in 320x200, but the title screen in 640x350.
Microsoft Flight Simulator 3 & 4
Monkey Island 2 - also supports 640x200
Netwars
Sierra's 3-D Helicopter Simulator
SimAnt
SimCity
Snarf
Spellcasting 101 - also supports 640x200
Timequest - also supports 640x200
Welltris
Wonderland

Re: 15hz CRT support through CGA/EGA card simulation?

Posted: Wed Oct 28, 2020 2:47 pm
by akeley
Matsu wrote: Wed Oct 28, 2020 11:43 am But more about if it can it be done, and how easy it is to implement.
This has been raised before but so far it's still unclear. You can check these:
https://github.com/MiSTer-devel/ao486_MiSTer/issues/6
viewtopic.php?f=13&t=970

At the moment, native VGA (CGA/EGA would be nice too) is my Most Wanted MiSTer feature.

Re: 15hz CRT support through CGA/EGA card simulation?

Posted: Mon Nov 09, 2020 5:48 am
by Televicious
Wouldn't you need a completely different IO board for the 9 pin TTL video? I think HDMI is TTL, but way different and there's nothing to adapt vga back to 9 pin let alone hdmi.

Re: 15hz CRT support through CGA/EGA card simulation?

Posted: Tue Nov 10, 2020 12:48 am
by thorr
I am running ao486 VGA at 480i right now on my 15Khz CRT TV using an Extron VSC 500. They are very cheap on ebay. It works with and without the MiSTer scaler. If you don't use the MiSTer scaler, you need to adjust the centering and sizing every time the video mode changes, so I just use the scaler. Is it the same as a VGA monitor? No because it is a bit fuzzy and is interlaced, but it is better/more retro than an HDMI monitor.

Re: 15hz CRT support through CGA/EGA card simulation?

Posted: Tue Nov 10, 2020 2:40 pm
by Matsu
Televicious wrote: Mon Nov 09, 2020 5:48 am Wouldn't you need a completely different IO board for the 9 pin TTL video? I think HDMI is TTL, but way different and there's nothing to adapt vga back to 9 pin let alone hdmi.
I always thought TTL was similar to RGB, but now learned there's actually a whole other thing called RGBI (RGB + Intensity). Very interesting!
From what I understand it's digital instead of analog and it uses an extra pin for intensity when using CGA, and 3 extra intensity pins for each color when using EGA.

So it seems you're right it that would probably need a different IO board.
Now that would be the epitome of niche, even within this community.

Might try my luck with just getting the EGA card for my 486. But It probably won't work or result in glitches due to ISA bus speed incompatibility.
It also has a build in VGA card, so that might be a hindrance as well... need to do some extra research first.

Was really hoping this would be a relatively simple thing to implement, maybe it's still doable with some trickery?
thorr wrote: Tue Nov 10, 2020 12:48 am Is it the same as a VGA monitor? No because it is a bit fuzzy and is interlaced, but it is better/more retro than an HDMI monitor.
Interlaced and fuzzy are the opposite of what I'm looking for here sorry :P
For now I use a mini SLG with my 486 computer, and I'm actually almost satisfied with this solution. But I just wished those scanlines could be dialed to pitch black, not just slightly darker. It looks pretty convincing from a distance, but up close it still bothers me lol. Take a look to see what I mean. https://i.imgur.com/IOzW7z0.jpg

Re: 15hz CRT support through CGA/EGA card simulation?

Posted: Tue Nov 10, 2020 8:04 pm
by thorr
I think I misunderstood what you were trying to do, but now I think I get it. I think you want 240p with black scanlines for 320x200 and 640x200 resolution games probably with black on the top and bottom for the extra 40 pixels. I don't know if EGA/CGA cards would be compatible with CRT timings. I think regular 15KHz displays are expecting 240p or 480i, and I don't know if they would work with 200p signals unless those are actually 240p signals with built in black bars at the top and bottom. This is all speculation on my part. The reason I am using the Extron is to achieve 640x480 and higher resolutions as well as lower resolutions on my TV. Having 480i is very nice since the MiSTer doesn't support it natively and it gives me twice the resolution vs 240p. When I am not using 480i, I switch out the cable and run at 240p directly for most of the cores.

Re: 15hz CRT support through CGA/EGA card simulation?

Posted: Tue Nov 10, 2020 10:36 pm
by Matsu
Old tv's are generally capable of displaying 320×200.
Slightly above or below 240 lines was common, as analog tubes had no fixed resolution.
Old consoles and computers used many different resolutions. And black lines should only exist when a resolution is higher than the used amount of lines.
A PAL SNES game for example will often have black bars due to not being optimized for the higher PAL resolution.

Some other examples of low line resolutions:
Atari 2600 160×192 (probably 160x200 lines with 8 black unused lines)
NES 256×224 (NTSC), 256×240 (PAL)
Master System 256×192, 256×224, 256x240 (some PAL games)
Sega Genesis 320×224, 256×224, 320x240 (some PAL games)
SNES 256×224 (NTSC), 256×240 (PAL)
Amiga 320×200, 640×200 (NTSC), 320×256, 640×256 (PAL)

BTW, you could run that 480i signal into an extron emotia* to de-interlace it and end up with a true 240p signal.
I used one for my original xbox to de-interlace mame games, it worked fine but it caused a loud whine that didn't happen with regular 240p input.

*Extron Emotia, the Emotia Plus, the Super Emotia and the Super Emotia GX all can deinterlace. Newer models can't.

Re: 15hz CRT support through CGA/EGA card simulation?

Posted: Tue Nov 10, 2020 11:45 pm
by Pepeart
Hi thorr, wich extron model are you using? thank you

Re: 15hz CRT support through CGA/EGA card simulation?

Posted: Wed Nov 11, 2020 12:24 am
by thorr
Pepeart wrote: Tue Nov 10, 2020 11:45 pm Hi thorr, wich extron model are you using? thank you
Extron VSC 500. It cost me about $15. I also just bought one of these and it will be here tomorrow. https://www.amazon.com/gp/product/B00V2ULFAQ/ I am hoping it will always keep the image centered even when not using the MiSTer scaler. I can always return if it is not better than the Extron.

Re: 15hz CRT support through CGA/EGA card simulation?

Posted: Thu Nov 12, 2020 7:17 am
by thorr
I got my new HDMI to Svideo adapter linked in the previous post and I definitely like it better than the Extron VSC 500. The image looks much better. The text looks pretty good and sharp and it doesn't flicker much at all. The colors look great. Games look excellent. It is about as good I could ever expect for running ao486 on my CRT TV. It is not quite as good looking as 240p with consoles but it is pretty close, but also it is better with twice the resolution vertically. I need to use the MiSTer scaler with it and I currently have it set to 1024x768 with a vscale border of 30 to get rid of some overscan and I have the scaler set to fill the screen. When it changes video modes, it takes it a moment to lock onto the new signal, but it is always centered in the same way as before.

Re: 15hz CRT support through CGA/EGA card simulation?

Posted: Thu Nov 12, 2020 8:44 am
by akeley
thorr wrote: Thu Nov 12, 2020 7:17 am The colors look great. Games look excellent. It is about as good I could ever expect for running ao486 on my CRT TV.
Is the scaling 1:1? Could you post some pictures with text?

Re: 15hz CRT support through CGA/EGA card simulation?

Posted: Fri Nov 13, 2020 4:59 am
by thorr
akeley wrote: Thu Nov 12, 2020 8:44 am Is the scaling 1:1? Could you post some pictures with text?
The scaling is not currently 1:1 because I am upscaling in the MiSTer to 1024x768, but this has more than enough pixels to show everything so it won't matter. This is getting downscaled to 480i. The MiSTer scaler has its own issues with displaying perfect pixels in ao486 even if the resolution is set the same as the original and hopefully they can fix this. I tried other resolutions, but it doesn't make much difference, so I am leaving it at 1024x768 so it will work with lots of resolutions within ao486. If I go too high, it doesn't work anymore.

Here are some pictures to give you an idea. Keep in mind it looks better in person because I am taking pictures of a TV with a moving electron gun at an instant in time. The colors have much more pop in person. The text is sharper and more solid. The moire patterns are not there and the scan lines are filled in. In the last picture, the black and purple pixels on the carpet are consistent across the carpet and look good and not striped like in the photo.
https://imgur.com/a/erfY7Si

Re: 15hz CRT support through CGA/EGA card simulation?

Posted: Fri Nov 13, 2020 9:44 am
by akeley
Thanks for the pics. It's an interesting solution, but for me that issue with VGA scaling is still a major obstacle. I remain hopeful it can be fixed one day.

HDMI to SVideo/composite converter...hmmm. I've spent some time researching it back in the day, though that was more about 240p. The one you are using looks fairly decent. Do you know if it adds any lag? Don't need one atm but I live in the NTSC land sometimes and maybe I could use something like that for my PC.

As an aside: many games, such as the Monkey Island or Colonel's from your pics, are imo better on Amiga where you can display in 240p (especially if the game can be run in NTSC mode with no problems),

Re: 15hz CRT support through CGA/EGA card simulation?

Posted: Fri Nov 13, 2020 8:17 pm
by thorr
Thanks for the tips and information.

I have achieved amazing 240p results using direct video from HDMI with a different converter. The picture is pure perfection with zero lag. I wrote about it in this thread: viewtopic.php?f=33&t=1471 I have an inline power switch for this because sometimes I need to power cycle it to get it to sync when going in between cores, etc. This is not a major issue as it stays solid unless I am doing things to cause the issue.

The HDMI to SVideo (480i) converter does not seem to have any lag, but I don't have a way to measure it. It certainly is fast enough that I can't tell if it introduces lag or not.

I run both of the above through an unpowered HDMI switch that does not change the signal at all so I can switch back and forth. One goes to the component inputs (240p) and the other goes to SVideo (480i). I push the button on the HDMI switch and change the input on the TV and change the Mister.INI to an alternate and reset the MiSTer.

I haven't tried the Amiga core yet, but that sounds like a great suggestion for some cases. The problem is I have a great MIDI setup in DOS and it appears that the Amiga games don't take advantage of having MIDI devices like a Roland MT-32 or Sound Canvas. I could be wrong. I did a quick Youtube search for Monkey Island 2 on Amiga, and in this particular case, I definitely prefer the DOS version. The image quality I am getting is pretty good with my SVideo converter. I will definitely check out the Amiga version at 240p for comparison of the video. It is nice to have options and play the best version of the game depending on which system it works best on. I got the C64 core going last night at 240p and it was glorious with my direct video setup. I have yet to find the * key though lol.

The Extron VSC 500 works with the native AO486 timing without the scaler at least some of the time so theoretically that is pixel perfect. The only problem is every time the video mode changes, you need to adjust the knobs to center and size it similar to a VGA CRT monitor. This is fine for one game at a time that doesn't change, but I was testing it with Second Reality and I had to adjust it throughout the demo.

Re: 15hz CRT support through CGA/EGA card simulation?

Posted: Wed Nov 18, 2020 3:01 am
by Televicious
If you want 15khz resolutions for VGA/EGA/CGA games there's a few threads with working custom scaler settings to set in the config .ini. They work alright for games, but not DOS prompts or any OS's so you'd want to have a switchable config file and a HDD image specifically for those games with some sort of graphical menu preconfigured. I tested them out with ao486 DOS games and SCUMMVM on a Commodore 1084 and it's pretty cool. I would love any device that output RGBi TTL video though. I have two monitors that take TTL input and not many devices that output that. Native VGA doesn't even quite work 100% on MiSTer without the scaler though yet so unless we get a PCjr or Tandy 1000 core I wouldn't count on seeing any direct CGA/EGA support.

Re: 15hz CRT support through CGA/EGA card simulation?

Posted: Thu Dec 10, 2020 6:11 pm
by FoxbatStargazer
I've been playing around with recent stable builds using VGA output to a late-ish PC CRT (max res 1600x1200 @ 60hz). From my experience it seems like this core always uses the scaler for video output even with vga_scaler=0. Your video mode choice matters as does the aspect ratio in the settings, these are things that are usually ignored for VGA output on most cores. I'd be curious if anyone had a lead to bypass the scaler but as of now it doesn't seem to apply to ao486. If so this is something that really ought to be mentioned in the core readme so people know they have to adjust the scaler to get anything useful from the analog side.

Anyway with that in mind I find you can get a pretty good experience with 320x200 games on a PC CRT using either 640x400 or 1280x800 resolutions. In the core menus set vsync to variable and aspect ratio to full screen. Your mister.ini should have vsync_adjust=2. This will give you 1:1 mapping of 320x200 squished by your CRT to the correct aspect ratio, with the original refresh rate and sub-1 frame lag. DOS text will be slightly garbled but you can improve it with a sharp interpolation filter and higher resolution as long as you keep to a multiple of 200.

Re: 15hz CRT support through CGA/EGA card simulation?

Posted: Fri Dec 18, 2020 6:05 pm
by Televicious
Since some recent update it seems that no matter what I set the scaler to for this core it displays 640x480 or something close to that. Anyone else having this happen? Also, in scaled VGA on a 15khz crt mode it boots up and displays fine, then immediately switches to a higher sync. It's like there is some video setting overriding the video modes that used to work.

Re: 15hz CRT support through CGA/EGA card simulation?

Posted: Fri Dec 18, 2020 8:24 pm
by thorr
This could be the setting for Variable vs 60Hz. Variable seems to ignore the scaler. 60Hz works. At least in my case.

Re: 15hz CRT support through CGA/EGA card simulation?

Posted: Sat Feb 27, 2021 2:23 pm
by FoxbatStargazer
For the record since I think I just figured this out...

By default the core seems to force vga_scaler=1 (even if you set it to 0), and use your video modes for VGA output. However, if you use direct_video=1, it will override and give you an "analog" output.

Edit: I've recently discovered that the combination of direct video, vga scaler, and forced scandoubler gives you 640x480 60hz in all cores. The display is garbled in most cores but it works fine in AO486. So whatever is being said below could be very wrong, but I will quote it for posterity.
What is this "analog" output? It seems to be 640x240, regardless of what internal resolution the core is rendering. You can use scandoubler to get to 640x480 on a PC VGA monitor, but you're probably better off controlling things with vga_scaler to get the full vertical resolution from DOS text. Basically it looks like direct_video is just a default to get things running on 15khz displays. The menu options for 60hz vs. variable also may be useful for 15khz displays, as they might have trouble supporting the common 70hz refresh for dos.

Re: 15hz CRT support through CGA/EGA card simulation?

Posted: Thu Mar 25, 2021 10:06 am
by miaou
Apologies for the maybe stupid question.

I would like to use AO486 on a 15khz screen (such as the atari sc1435 or the amiga 1084s) to display games such as monkey island in their original resolution (320x200 in this case).

The most common way I currently use to achieve this is scummvm on retroarch with crt switchres enabled.

Based on what I read above and some research I am bit confused.

Could anyone advise if:

1) AO486 uses the vga output ?

2) If so is it possible to display 320x200 from the VGA output with AO486 ?

Thank you in advance :)

Re: 15hz CRT support through CGA/EGA card simulation?

Posted: Fri Mar 26, 2021 3:31 am
by FoxbatStargazer
As mentioned confusingly in this thread AO486 does not pass through real video timings to your CRT monitor. Its like vga_scaler=1 is forced on and you must pick a video mode, and everything is rescaled to that. You can set direct_video=1 (it does work for analog I/O VGA port combined with vga_scaler) but that is just going to force a resolution a bit larger than 640x240.

Now 200 px tall may be a problem for your display unless it can accept 70hz signals. If it can then just use a video mode for x200@70hz with vsync_adjust=0, or else in the core menu turn on variable refresh rate for use with vsync_adjust=1 or 2. In this case I would recommend something like 1440x200 (with wide aspect ratio in core options) since that evenly divides into 720 for DOS text and 320 for DOS games. The CRT will take care of squishing this super wide resolution back to 4:3.

If you are stuck with 60hz then don't to that, you will need a 240 (or 244) based resolution. vscale_mode=1 will ensure only 200 pixels are drawn without any messy scaling, but this might appear squashed with black bars above/below. You can either use your video controls to stretch vertically, or you can try going to original aspect ratio with something like 390x244, that should show a 320x200 box with black borders, but your DOS text will be rather low res and super garbled. That's why its usually better to use something extra wide (even 640) and let the CRT squish if you can.

Re: 15hz CRT support through CGA/EGA card simulation?

Posted: Wed Apr 07, 2021 1:11 pm
by Matsu
I found these settings on a reddit post from a month ago, it works almost perfect on my PVM monitors. Though you have to enable underscan to display the whole picture.

1ejZkwH.jpeg
1ejZkwH.jpeg (408.56 KiB) Viewed 8906 times

Add the following lines to the end of your MiSTer.ini

[ao486]
video_mode=640,6,56,66,224,14,8,18,12000
vga_scaler=1

Update: It's actually better to use vscale_mode=1

[ao486]
video_mode=640,6,56,66,224,14,8,18,12000
vscale_mode=1

Re: 15hz CRT support through CGA/EGA card simulation?

Posted: Fri Apr 09, 2021 4:36 pm
by akeley
Matsu wrote: Wed Apr 07, 2021 1:11 pm [ao486]
video_mode=640,6,56,66,224,14,8,18,12000
vga_scaler=1
I tried this on my 15khz Trinitron via Direct Video, but there was no change from my usual vertically-squished display.

Are there perhaps any other settings I should try changing? (I only have composite sync & direct video set to 1 in the ini, rest is default)

Re: 15hz CRT support through CGA/EGA card simulation?

Posted: Fri Apr 09, 2021 6:36 pm
by FoxbatStargazer
Direct video ignores video modes and uses its own default. You should set it to 0 when trying to output your own video mode.

Re: 15hz CRT support through CGA/EGA card simulation?

Posted: Fri Apr 09, 2021 6:45 pm
by darksakul
I prefer HDMI out, there are less guess work for me.
Especially there so many different games with different output standards

Re: 15hz CRT support through CGA/EGA card simulation?

Posted: Fri Apr 09, 2021 6:58 pm
by akeley
FoxbatStargazer wrote: Fri Apr 09, 2021 6:36 pm Direct video ignores video modes and uses its own default. You should set it to 0 when trying to output your own video mode.
I added "direct video=0" to Matsu's setting but the image started rolling heavily.