VOGONS

Common searches


VIDEO - Multiple SVGA Chipset patch (commited)

Topic actions

First post, by vasyl

User metadata
Rank Oldbie
Rank
Oldbie

A couple weeks ago I started discussion about multiple SVGA chipset choices in DOSBox. To prove that those were not just empty words on my side I started coding and actually got something working. Right now I have some deadlines looming in my daily job so I may not be able to spend any time on this thing (not that I had that much time before but it was just enough). I don't want this code to be lost and I think some people may be interested, so I've submitted a patch (#1191552).
This is not a complete solution but basic stuff works and does it sufficiently well. You can switch between ET3000, ET4000, S3, and <none> in dosbox.conf, configure RAM size for ET4000. WHATVGA recognizes chipsets correctly, Deluxe Paint IIe works fine, those pesky Legend games have no problems at all. Again, this is not 100% implementation but it is a good start. The entire SVGA support is modularized and new chipsets can be added with no effort (basic support for a new chipset would take 30-45 minutes to implement). If you don't want to use it, just don't modify dosbox.conf and DOSBox will work exactly as it did before. I don't think there is any measurable performance impact with my patch.
Some interesting side notes:
- As I remember, there are two versions of Deluxe Paint IIe -- one with VESA support and the other (older) without. The older one actually does not even have support for ET4000 or more than 512K of videoram. Interestingly enough, the gallery.exe app was never updated, so it is incompatible with "stock" DOSBox. Works in ET3000 mode just fine. Unfortunately, I don't have the older version anymore but I vividly remember patching ET3000 bank switching to work on my ET4000.
- The thing that started all this, Eric the Unready, gave me a surprise. That was really bad example to start with. Floppy and CD versions are quite different but report the same version number. CD version supports VESA and runs in 800x600x16 mode (called SVGA) in slightly patched DOSBox. 640x480x256 mode (called XGA) is completely broken in that version, regardless of chipset. Floppy version does not support VESA at all (neither does it support S3) but both SVGA and XGA modes work fine with my patch. Said that, that XGA mode is useless... and not documented in the manual.

Reply 1 of 343, by ih8registrations

User metadata
Rank Oldbie
Rank
Oldbie

It patches fine under mingw on 98se.

For those scratching your heads about what to write in dosbox.conf, the section and options are:

[vga]
#svgachipset -- s3 trio64, tseng et3000, tseng et4000, none
svgachipset=tseng et4000
videoram=1024

Alas, there's more to do to in order to run dawn patrol.

Reply 2 of 343, by HunterZ

User metadata
Rank l33t++
Rank
l33t++

Would it make sense to combine this with the machine= setting? For example, you would choose machine=et4000 instead of machine=vga to emulate the Tseng ET4000 SVGA chipset.

Just a thought (take it with a grian of salt).

Reply 3 of 343, by eL_PuSHeR

User metadata
Rank l33t++
Rank
l33t++

Agreed. That would make things easier. No need to have a zillion different parameters with a clogged conf file. Besides S3 and TSENG were S/VGA cards, so they cannot be confussed with anything else.

Intel i7 5960X
Gigabye GA-X99-Gaming 5
8 GB DDR4 (2100)
8 GB GeForce GTX 1070 G1 Gaming (Gigabyte)

Reply 4 of 343, by vasyl

User metadata
Rank Oldbie
Rank
Oldbie

Good, at least now I know that I did not mess up the patch itself. It was quite complex patch after all.
I was not sure about dosbox.conf, both approaches kinda make sense. One of my goals was to isolate "other" SVGA implementations from the core as much as possible (if you check you will find that Tseng is mentioned only in vga_svga.cpp), putting chipset info in "machine=" line breaks it to some extent but really not that bad. Let's see what other people say.
I don't know about Dawn Patrol but I may have some time to take a closer look to see what registers that thing accesses (assuming that I can find a copy of that game and that my computer does not die on me -- it is quite unwell lately, ordering new mobo this weekend).

Reply 5 of 343, by ih8registrations

User metadata
Rank Oldbie
Rank
Oldbie

You can find Dawn Patrol at home of the underdogs:
http://www.the-underdogs.org/game.php?gameid=1841

machine=chipset would follow current nomenclature(though I find it awkward as they aren't synonyms; I think of cpu). I'd be less verbose: et4000 instead of tseng et4000.

For separation, I'm inclined to put each chipset in it's own file.

Reply 8 of 343, by vasyl

User metadata
Rank Oldbie
Rank
Oldbie

Precisely. Not sure if that has any practical use but it was very easy to add so I though "why not."
One thought about putting SVGA choice in "machine" tag. That may break frontends. Right now the implementation defaults to S3 if no SVGA config is provided so old frontends will continue working without any issues. If the info is rolled into "machine" then "machine=vga" looks like it should mean "no svga" and the original setup should be "machine=s3". We may consider renaming "machine" to something better (any ideas?) and leave "machine" for compatibility. Video RAM setting can be rolled into the same line easily.
Dawn Patrol does not seem to be rare game by any means so I should have no problems getting a real copy, meanwhile HOTU version should do. Just in case, is that version known good?

Reply 9 of 343, by ih8registrations

User metadata
Rank Oldbie
Rank
Oldbie

It's what I'm using to test, there's also the later h2h version at HOTU. The last incarnation of the series you still have to buy(there's a link to an online vendor at HOTU if interested).

I've added the other ten et4000 video modes. I just copied for mode 8 & A so they're not really 2 color and the two 1280x1024 modes don't display correctly yet. Of course, the 256 color 1280x1024 uses more than 1MB.

I've also been playing around with big rez text modes, 160x120/1280x960, and changing default mode 3(currently 80x96). I think I'll make it a config option.

Reply 10 of 343, by vasyl

User metadata
Rank Oldbie
Rank
Oldbie

Here's what I found. First of all, it looks like it is almost working. It's just that the memory handler is incorrect. This game uses SVGA banked memory in non-linear mode (similar to EGA, very popular technique). Simple hack in vga_memory.cpp, using vgaph.h256 instead of vgaph.hmap confirmed this theory but the result was still not quite correct. So, two pieces of the puzzle left: figure out when to switch to vgaph.h256-like mapper and fix mapper limitation as it does not expect more than 256K of RAM. In the last case it really should be different mapper.

Reply 11 of 343, by vasyl

User metadata
Rank Oldbie
Rank
Oldbie

A couple of technical details: it seems that two spots in vga_memory.cpp need to be fixed.
a) In VGA_SetupHandlers the section for M_LIN8 should look exactly like the one for M_VGA (can be collapsed into one section).
b) VGA_GFX_256U_WriteHandler should also write latched value at 128K and 192K (in addition to 64K).
I am not sure who owns that code, I'd like to get confirmation that I understand the internal logic correctly.
Still missing something -- the game runs and all graphics are there but the screen flickers too much. There are also redraw artefacts in menus.

Reply 13 of 343, by vasyl

User metadata
Rank Oldbie
Rank
Oldbie

Thanks. That's quite typical for games from the same company to share some peculiarities, bugs, etc. In this case I would not be surprised if there are other (i.e., not Rowan/Empire) games that use the same techniques.
On the more technical note -- does anybody know exactly how paged and banked RAM accesses are supposed to interact with each other? Dawn Patrol apparently switches to paged access but I am also seeing a lot of bank switching. My gut feeling is that I have broken logic there somewhere.

Reply 14 of 343, by ih8registrations

User metadata
Rank Oldbie
Rank
Oldbie

Well, based on your details, I'm where you're at; have got et4000 svga working in dawn patrol. The menu articfacts you're referring, the fact that sometimes it doesn't draw the background the first time? As for flickering, it should be a delay or an update not happening as fast as it should.

et4k had vesa so I figure it should be setup like it is for s3. I've added modes to the vesa list since only up to 800x600 were included(us navy allows 1024x748).

Reply 16 of 343, by vasyl

User metadata
Rank Oldbie
Rank
Oldbie

Before we get to Terminal Velocity, let's figure out Dawn Patrol. It is just so close! I had a thought about redraw timing but there are two things that are not consistent with that kind of problem: it is only the upper part of the screen that blinks, while the lower is fine but missing gun turrets; the other one is that if you browse "pages" you can find quite of a few with blinking videos. Also, that first menu missing background... No, this is definitely memory mapping issue. I am seeing a lot of bank switching and coupled with latched memory it is not that clear how is that supposed to work.

Reply 17 of 343, by vasyl

User metadata
Rank Oldbie
Rank
Oldbie

On the second thought, after looking at those artefacts again, you are right and it may be timing. Or: timing and memory issue. It is easy to prove that memory is not 100% there yet. In vga_memory.cpp in VGA_NormalReadHandler add one line at the beginning: start += 64*1024*vga.svga.bank_read; Similarly, in VGA_GFX_256U_WriteHandler that should be start += 64*1024*vga.svga.bank_write; Notice that a few things look different now, starting with the Empire logo? There is something else missing -- there must be another (Rowan) logo appearing immediately after Empire. Where is it? My guess is in the same place where the background of the first menu is. Signing off for today, long day tomorrow.

Reply 18 of 343, by robertmo

User metadata
Rank l33t++
Rank
l33t++

One more game:

Wonderland (by Magnetic Scrolls, 1990)

For 800x600x16colors it has only two options:
1. Super VGA
2. Paradise (works with my Paradise PVGA1A-JK card)

I wonder whether your patches already bring this game back to life in 800x600 😉

Reply 19 of 343, by vasyl

User metadata
Rank Oldbie
Rank
Oldbie

Haven't played that one in ages, did not even remember that it had SVGA mode. It has rather quirky setup, I could not install the original (although I haven't tried running from the original floppies, I prefer not to touch them more than necessary, using images instead), and the HOTU version, while different, was not any better. I'll have to mess with that setup a little more when I have time. However, it ran far enough for me to get pretty good idea if it works with my patch. Most likely, it is. The game claims VESA compatibility but that particular mode is not supported in DOSBox 0.63. I have it enabled in my patch so it is very likely to run (use S3 mode). Said that, it may just be easier to use Magnetic to play this one.
Back to Tseng and Dawn Patrol. Unfortunately, no news, just did not have any time today. Side question though. Does anybody have list of DOS games supporting SVGA? I vaguely remember seeing such a list (it had more info than just that) some ten years ago.