Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some feedback on the latest features #519

Open
PoloniumRain opened this issue Jul 25, 2024 · 107 comments
Open

Some feedback on the latest features #519

PoloniumRain opened this issue Jul 25, 2024 · 107 comments

Comments

@PoloniumRain
Copy link

Just had a look at the latest changes you've made, and obviously a lot of these new features might not be finished yet and could change before the next release, but...

  1. The new 3dfx Voodoo Hardware OpenGL option is huuuuge and massively improves performance :) I assume it works similar to DOSBox-X with glide passthrough enabled? There's also a Hardware OpenGL High Resolution option which seems to double the games native resolution. But i think it would be better if there was a separate resolution option for this, with 2x, 3x, 4x increases and so on. This would also make it clear to the user exactly what the setting does, and this is how other emulators deal with this feature (the DuckStation core is a good example). I can now run any 3dfx supported game and hit the games maximum frame rate with "High Resolution" 2x res enabled, so the performance headroom is there for much higher resolutions.

  2. Hardware OpenGL fixes significant visual issues like Texture rendering issues in most 3dfx games #316. I need to do more testing but it's looking great so far.

  3. The 3dfx Voodoo Gamma Correction option is really useful but by default it has incorrect gamma. There's roughly 30-ish DOS games that support 3dfx Voodoo and i've tried most of them. Every one of them now has incorrect gamma by default, so they look either too bright (most common) or too dark. Previously the gamma was correct in every game. So how about an "Auto" gamma setting that works exactly as things did before? Or have the current None gamma setting function this way. If there's some reason this can no longer be done with Hardware OpenGL, then i can create a list with the correct Gamma settings for every game and DBP could apply them on launch.

  4. Software Multi Threaded (default) and Software Multi Threaded, low quality run worse than before. Frame rates are cut in half and i get significant sound stuttering/popping. It's similar to when i tried 1 CPU thread in my testing. But Software Single Threaded runs the same as when i tested with 7 threads... Are these options incorrectly labelled?

  5. This only affects Hardware OpenGL - In Screamer 2, Screamer Rally and Carmageddon 2 the menu screens have the same issue as above, but not as severe and only with the menu screens. Seems like a possible threading issue but it's strange how (so far) it only affects the menus and never gameplay.

  6. Running a 3dfx accelerated game and switching from any of the Software Multi Threaded or Software Single Threaded options to Hardware OpenGL will show a black screen after restarting the game. To fix this the game needs to be closed and run again.

Anyway, just ignore any of the above problems if it's simply down to the feature being unfinished. Excellent work btw!

@michael-leroy
Copy link

Interesting. I wonder if this would fix the graphical issues I see in Diablo 2 in glide mode on iPadOS. Since that platform is so restricted I am guessing I won’t be able to test this for a long while. It would be cool if a dosbox-pure beta (from main/master branch) core was added to Retroarch for such purposes.

Things are sounding promising though!

@schellingb
Copy link
Owner

@PoloniumRain Thank you so much for the detailed feedback. It isn't enabled by default just yet because it is new. But were it not for feedback like this, it likely would have been released as it is now :-)

  1. The reason why we can't have arbitrary multipliers is because this DOSBox core has a fixed maximum resolution of 1280x1024 which is reported to the frontend (RetroArch) at start and we can't go past that. It will need some more under the hood changes to make this more flexible but I can look into it if you're interested. It would be neat to see even higher resolutions :-)
  2. I don't know why the texture level-of-detail issues exist in the software renderer, it's code inherited from the original authors of the 3dfx emulation. I've noticed it not reappearing with OpenGL and I'm glad but ideally software rendering would also be fixed but I don't know how...
  3. Before games were not gamma corrected at all so they really didn't look like original. In DOS games, the default value of SST_GAMMA is at 1.7. This can be changed in the command line with SET SST_GAMMA 1.0 to disable gamma correction. If you were to do that, and set the core option to "None" it should look like it looked before. The default 1.7 seemed way to bright so I ended up defaulting to -0.2.
  4. Oh, you're totally right, the flag check for single threaded and multi threaded was flipped in code by mistake. I fixed it now.
  5. The same issue meaning performance issue or texture issues? Rendering 2D in Voodoo with OpenGL is actually very tedious because every drawn pixel is a command that has to be translated to GL. I think full screen 2D screens can be slower on OpenGL than in software rendering due to that. We're already batching all pixel draws into a single OpenGL draw but it still needs a lot of processing to get there.
  6. RetroArch should show a little notification popup saying "To enable OpenGL hardware rendering, close and re-open.". This is needed because at startup we tell the frontend if we want hardware accelerated rendering or not. If 3dfx is set to the default (software rendering), we don't request hardware rendering and thus we are limited to 2D functions. For now this is to not break any existing compatibility (it runs on devices that don't have OpenGL). In theory we could always request the 3D context but I'm conflicted a bit. If only a small percentage of users use 3dfx, it seems an unnecessary overhead...

@michael-leroy I really wanted to try Diablo 2 but I couldn't get it to run in DOSBox Pure. The only way I got Diablo 2 running was with software rendering in windowed mode. Can you tell me how I could get it running in glide mode? Any special version or patches? Hopefully new release soon!

@michael-leroy
Copy link

@schellingb It took me forever to get D2 working. The key is to use version 1.05b with a no-cd patch. You can get the needed files from this project:

https://github.com/ChaosMarc/D2VersionChanger

I didn't use the .bat file I just installed the game (full install) and copied the classic/1.05b files and then the no-cd game.exe. Software mode does run fine it seems. I didn't have to use window mode. Trying to use later versions makes it explode with an illegal operation usually due to fog.dll.

In glide mode the sprites are missing with white blocks around them, but the game does actually start and run. I can post screen shots/video later if need be. I tried several voodoo driver versions with no luck. At one point messing with some settings in the registry I was able to get the background rendering properly in glide mode, but almost all the sprites were missing.

Here is a video I do have of it running in software mode:
https://youtu.be/2s7sPFEUKrQ

This is with an M4 ipad pro.

While on this subject do you know what is going on with mouse grab/lock in iPAD os with dosbox-pure? Having the system cursor and the windows 98/game cursor at the same time is less than ideal. Makes it really hard to play games like D2 and say Quake with a mouse. Seems like a upstream Retroarch problem. A bug has been open for about a year with no progress..

@michael-leroy
Copy link

Here is the video of D2 starting and running in glide mode:

https://youtu.be/QShKAzrYmWE?si=j_Q3tRD3MMmu3I2r

Let me know if you want me to file a separate issue/ticket on this. I don’t want to crowd/distract from OP’s report.

@schellingb
Copy link
Owner

Interesting... I wonder why it's so broken. I wonder if this would run correct in something like PCem.

@PoloniumRain
Copy link
Author

but I can look into it if you're interested. It would be neat to see even higher resolutions :-)

Yeah definitely!!

  1. Before games were not gamma corrected at all so they really didn't look like original. In DOS games, the default value of SST_GAMMA is at 1.7. This can be changed in the command line with SET SST_GAMMA 1.0 to disable gamma correction. If you were to do that, and set the core option to "None" it should look like it looked before. The default 1.7 seemed way to bright so I ended up defaulting to -0.2.

This is what i'm seeing...

Gamma_Comparison

You can see that with DBP 0.9.9 the 3dfx version has gamma that closely resembles software rendering, which has correct gamma. But now it's way too bright and i have to lower gamma to -7 to get it to match DBP 0.9.9. Every 3dfx game is like this to some extent but Blood is one of the more obvious examples. I remember many games were like this on real hardware, where some were too bright/dark and i'd have to adjust my monitor or Windows settings to fix it, which was always a pain, but the great thing about previous DBP versions is that i never had to bother with this. Every game always had correct gamma.

So now with DOS 3dfx games i can at least fix the gamma by adjusting the DBP gamma setting for each game and then save my core options settings with RA. But the biggest problem here is with something like Windows 98 where the DBP gamma setting obviously cannot be configured for individual games running inside Windows.

But somehow DBP 0.9.9 and older versions have correct gamma for each Windows 98 game that i've tried so far (only around 8)... Which is weird! Because i've no idea how it could get the gamma correct for 3dfx Windows games when some of these games will need separate gamma adjustments on real hardware. But now the gamma is too bright or dark with the default -2. For example Motorhead and Pod are too bright, but Carmageddon 2 almost looks correct, which is how i'd expect real hardware to work. Anyway all i know is that the previous gamma implementation worked extremely well for me, so can you add that back as an "Auto" setting or something? Btw i'm on Windows 11 with an RTX 3080 and haven't changed any RA or driver display settings that could be affecting my gamma.

  1. The same issue meaning performance issue or texture issues? Rendering 2D in Voodoo with OpenGL is actually very tedious because every drawn pixel is a command that has to be translated to GL. I think full screen 2D screens can be slower on OpenGL than in software rendering due to that. We're already batching all pixel draws into a single OpenGL draw but it still needs a lot of processing to get there.

Sorry for not being clear, i meant it's a performance issue. One strange thing is that GTA is 2D but runs totally fine with Hardware OpenGL, and i've just noticed with Screamer 2 on the very first screen that appears where you select your team, it has frame rate issues and sound stuttering due to it running too slow, but this screen only shows four 3D models of the team logo's. It's a very simple scene with low complexity. This same screen runs perfect with DBP 3dfx Software rendering but Hardware OpenGL has better frame rates during gameplay, which has far higher scene complexity. Makes no sense.

Oh and Screamer Rally runs way too fast during gameplay with Hardware OpenGL, but this likely isn't a problem with DBP. Screamer Really has always had issues with the game speed being tied to the frame rate. So now that Hardware OpenGL produces far higher frame rates it seems to have sped up the gameplay. It's best to use DBP 3dfx Software rendering for this game. I'm only mentioning this because i'm sure someone will eventually make a post saying how Screamer Rally isn't working properly...

  1. RetroArch should show a little notification popup saying "To enable OpenGL hardware rendering, close and re-open.".

In theory we could always request the 3D context but I'm conflicted a bit. If only a small percentage of users use 3dfx, it seems an unnecessary overhead...

Ah i didn't notice that notification even though it's really obvious! lol. Ignore this one then :)

@schellingb
Copy link
Owner

schellingb commented Jul 25, 2024

Anyway all i know is that the previous gamma implementation worked extremely well for me, so can you add that back as an "Auto" setting or something?

The problem is, previously we had NO gamma implementation. It showed the raw color data as rendered. completely unadjusted. This means things like fade-in/fade-out (for example used by the spinning 3dfx logo on game startup) doesn't work. Games like Quake 3 Arena use a special gamma curve to make fire and stuff pop out which resulted in very flat, dull colors before.

I was close to having 2 options "Gamma Correction in DOS" and "Gamma Correction in Windows 9x" but it seems that wouldn't be enough.

We can have a "disabled" option for gamma correction, but I'm not sure this is really what we want... The issues above are quite severe in my opinion.

Without gamma correction:
image

With gamma correction:
image


strange thing is that GTA is 2D but runs totally fine with Hardware OpenGL, and i've just noticed with Screamer 2 on the very first screen that appears where you select your team, it has frame rate issues and sound stuttering due to it running too slow, but this screen only shows four 3D models of the team logo's

GTA still draws the world with (rather large) polygons. The problem in screamer isn't the 4 team logos, it's the background (307200 pixels) and text (17737 pixel) which is a full screen drawing where each pixel is processed and converted for OpenGL rendering one-by-one. The Voodoo API isn't set up that the game can prepare a bitmap, it has to send a draw command for each pixel. For us this means drawing 2D on the entire screen (at 640x480) is similar to the game drawing 307200 polygons. There might be means of catching large pixel drawings somewhere in the process and treating it special, but it won't be easy...

Just to be clear, some games draw images like that, some don't. For example Tomb Raider has a full screen image on the title, but it choses to draw it with 12 or so large polygons, which of course is much faster.

@schellingb
Copy link
Owner

I added a bit of optimization to pixel drawing. It isn't magnitudes faster but hopefully noticeable.
@PoloniumRain If you have some more time for testing, can you give the latest commit a shot?

@PoloniumRain
Copy link
Author

PoloniumRain commented Jul 25, 2024

This means things like fade-in/fade-out (for example used by the spinning 3dfx logo on game startup) doesn't work.

For me i get the opposite result... The 3dfx logo works properly in 0.9.9, but it doesn't fade in with Hardware OpenGL, it's very dark then instantly gets lighter...

3dfx.logo.mp4

But with 3dfx Software it still works correctly. It might be a different logo to the one you're talking about though, because there's two different spinning 3dfx logo's. But either way that logo in Motorhead doesn't show the fade-in effect with Hardware OpenGL. The other spinning 3dfx logo looks the same in 0.9.9 or with the latest changes.

Games like Quake 3 Arena use a special gamma curve to make fire and stuff pop out which resulted in very flat, dull colors before.

I also don't have the same issue as in the images you posted. What version of Quake 3 is that because the font is different and the text is green? I have an original Quake 3 that has been updated with the official patch 1.32. It looks like this...

Q3 Comparison

But to get Q3 to even run i had to use a driver file named OpenGL.dll and place it in the game directory. So maybe i'm getting different lighting results because of that, because i can't replicate that flat/dull look in the image you posted no matter what graphics setting i change in the game. This is my current settings...

Q3 Settings

it's the background (307200 pixels) and text (17737 pixel) which is a full screen drawing

Ohh that explains it! Pretty obvious now that i look at it again...

I added a bit of optimization to pixel drawing. It isn't magnitudes faster but hopefully noticeable.
@PoloniumRain If you have some more time for testing, can you give the latest commit a shot?

That was quick! I'll test it tonight...

@michael-leroy
Copy link

I recall in the ancient days of yore some 3dfx games were too dark and I had to boost gamma. I think it being wildly inconsistent is fairly accurate to the real hardware?

RE: D2, can you guys reproduce the graphical glitches I see in the latest version with OpenGL enabled? When I get around to it I will try it on a Windows PC instead of iPadOS. What I wonder is if D2 never actually ran correctly on a voodoo 1. That is one thing that is a bummer about emulating a V1, the drivers are much older and are fairly ancient by the time Diablo 2 came out. It would be really nice to instead have Voodoo Banshee emulation. Not as demanding to emulate as a full voodoo 2, but has newer drivers.

@PoloniumRain
Copy link
Author

PoloniumRain commented Jul 25, 2024

Ok i tested the latest commit but sadly it doesn't seem to make any difference. The frame rates are identical on the menu screens.

@michael-leroy Just gave D2 a go and can't get it to work with 3dfx either, including with the new Hardware OpenGL. Like you say i think the Voodoo is just too old. From what i can find it definitely supports Voodoo 2 and 3, but probably not Voodoo 1. This is how it's looking for me with completely missing sprites....

D2

Your best bet is to use PCem, which supports up to Voodoo 3 (but is only available for Windows and Linux). It has far better Windows support as well because DOSBox was never really intended to run Windows. There's a good chance D2 will work, but PCem focuses heavily on accuracy, so it requires way faster CPU's than DOSBox. To emulate even the minimum required CPU for Diablo 2 (Pentium 233MHz) you'll need a CPU at least equivalent to an AMD Ryzen 3600X.

@PoloniumRain
Copy link
Author

Found a fix for the menu performance issue! It happens when Emulated Performance is set to either AUTO or MAX.

For Screamer 2, Screamer Rally and any other games with this problem, if i set the Emulated Performance to 300MHz it will now run the menus perfectly (solid 60fps). If i go up to around 600MHz and beyond i will get frame rate drops and sound stuttering again, exactly the same as with AUTO. So it seems to be caused by the CPU cycles being too high on AUTO when using Hardware OpenGL. How many threads does Hardware OpenGL use?

@schellingb
Copy link
Owner

OpenGL doesn't use any threads. Well, your graphics card driver might but that is out of our control. What OpenGL does though, unlike software rendering, it makes the main thread (of RetroArch) much busier than ever before. So maybe that causes the emulation thread to have to wait for the main thread which usually never happens. The AUTO/MAX CPU cycle scaling might just not work well with it.

@michael-leroy
Copy link

michael-leroy commented Jul 26, 2024

Ok i tested the latest commit but sadly it doesn't seem to make any difference. The frame rates are identical on the menu screens.

@michael-leroy Just gave D2 a go and can't get it to work with 3dfx either, including with the new Hardware OpenGL. Like you say i think the Voodoo is just too old. From what i can find it definitely supports Voodoo 2 and 3, but probably not Voodoo 1. This is how it's looking for me with completely missing sprites....

D2

Your best bet is to use PCem, which supports up to Voodoo 3 (but is only available for Windows and Linux). It has far better Windows support as well because DOSBox was never really intended to run Windows. There's a good chance D2 will work, but PCem focuses heavily on accuracy, so it requires way faster CPU's than DOSBox. To emulate even the minimum required CPU for Diablo 2 (Pentium 233MHz) you'll need a CPU at least equivalent to an AMD Ryzen 3600X.

Your image matches what I got at one point trying different voodoo drivers and registry settings on iPadOS. I do suspect that the game never worked right on a real Voodoo 1 either (EDIT: The game runs fine with a voodoo 1 under PCem). I completely understand this may be out of the scope of the project, but running D2 in glide mode on the iPad would be so rad. Especially if hw openGL actually works on iOS/iPadOS. (One day..)

I know I can just use a PC. Heck I can just play the remastered version of D2, but AFAIK the only way to play D2 on the iPad is via Dosbox-Pure. The novelty is what makes it cool. It’s actually really awesome that the game runs in Direct2d even without JIT!

UTM SE is wayyyyy too slow to even attempt without JIT, even with a M4 CPU. I might try using PCem (on windows) if it has a Voodoo 1 to see if it’s broken in a similar way.

I am not totally familiar with all the dosbox forks, but is emulating a Voodoo Banshee out of the question? This card had much newer 3dfx drivers that are less likely to have bugs in various win 95/98 games. It’s essentially a crippled V2 so perhaps easier to emulate?

@schellingb
Copy link
Owner

schellingb commented Jul 26, 2024

I think emulating a Voodoo Banshee in DOSBox would be quite involved. A lot of its normal VGA rendering very much is built on top of its VGA code which can emulate an S3 card among a few others. Unlike Voodoo 1 and 2 which were separate, 3D only cards, implementing something like a Banshee in DOSBox is probably not an easy endeavor.
It feels like Voodoo 2 is the limit for what we have. Voodoo 2 code is mostly in there but disabled in some places because I got crashes in Windows. Perhaps this could be fixed.

Edit: I tried to enable Voodoo 2 support and the code that is there seems just unfinished. Bugs I can maybe work around, but if the emulation in the DOSBox Voodoo emulation is unfinished, there isn't much I can do.

@PoloniumRain
Copy link
Author

I did some testing with Quake II and uncapped the frame rate limit, then used the games built-in "timedemo 1" benchmark. This is the most demanding DOS game but performs particularly well with Hardware OpenGL + AUTO (no menu performance issues) and is a good example of just how much performance can be gained even when the res is doubled:

3dfx Software @ 640x480 Hardware OpenGL High Resolution @ 1280x960
28 FPS 98 FPS

There's also no difference AT ALL between 640x480 and 1280x960 when using Hardware OpenGL and Hardware OpenGL High Resolution, not even a 1 FPS change. The bottleneck is 100% CPU. This is on an RTX 3080, but i think if there was higher resolution scaling options then even 6x scaling (slightly over 4K) would run fine on any remotely decent GPU, maybe even some integrated graphics.

@schellingb
Copy link
Owner

Great numbers! Happy to see :-)

Keep in mind though that something like a timedemo or fastforward in the frontend is cheating a bit because it will end up not actually fully rendering all these frames. The emulation will prepare drawing of these frames by queueing up all the draw commands executed on the 3dfx card, but only when the frontend is asking for a new frame will the latest batch of draw commands actually be executed and (3D) rendered to be shown on screen.
The software emulation does not have that freedom and will always make sure all 3D rendered images will be finished in the video cards memory at some point. This is actually important for some games that want to read back the rendered image and can lead to issues when using OpenGL where the resulting image is always delayed (an example is Extreme Assault which queries the depth buffer to figure out where to show target markers).

Scaling the output should have a small impact on a powerful desktop GPU. On an Android phone it does have quite an impact because a mobile GPU is very often fill rate limited. Same results on a Raspberry Pi.

@michael-leroy
Copy link

I think emulating a Voodoo Banshee in DOSBox would be quite involved. A lot of its normal VGA rendering very much is built on top of its VGA code which can emulate an S3 card among a few others. Unlike Voodoo 1 and 2 which were separate, 3D only cards, implementing something like a Banshee in DOSBox is probably not an easy endeavor. It feels like Voodoo 2 is the limit for what we have. Voodoo 2 code is mostly in there but disabled in some places because I got crashes in Windows. Perhaps this could be fixed.

Edit: I tried to enable Voodoo 2 support and the code that is there seems just unfinished. Bugs I can maybe work around, but if the emulation in the DOSBox Voodoo emulation is unfinished, there isn't much I can do.

Luckily it seems that D2 runs fine on a Voodoo 1. I setup PCem with a 2d card and a Voodoo 1. Using the 3.01.00 drivers, Diablo 2 1.05b runs great in glide mode. So the problem lies in the voodoo emulation on dosbox-pure.

@PoloniumRain Its really cool to see Quake 2 performance improve so much!

@PoloniumRain
Copy link
Author

PoloniumRain commented Jul 26, 2024

Keep in mind though that something like a timedemo or fastforward in the frontend is cheating a bit because it will end up not actually fully rendering all these frames.

Ah right, but i've found with Q2 that the timedemo is surprisingly representative of gameplay performance. If i start a new game, in the very first room i get almost identical frame rates to the timedemo on the same map. I've now ran through roughly 30% of the game and it's been great, typically around 80 - 130 FPS, sometimes going over 200 FPS! Although of course the Voodoo can't even display that many frames per-second.

With Hardware OpenGL i wonder if there would be some way around the Voodoo refresh rate limitation, so that DBP outputs as many frames as the game is rendering? Like any non-DOSBox game would typically work. Obviously it wouldn't be accurate to real hardware but that could also fix the issue with Variable Refresh Rate not working correctly.

@leilei-
Copy link

leilei- commented Jul 27, 2024

Somehow I knew the emulation of the clut tables would lead to the gamma shock like it's a new bug. There's a potential "always has been" astronaut meme here.

On real 3dfx hardware, everything was so gamma boosted, this gaslit competitors as being 'too dark' back in the day! The gamma's there likely from the arcade roots, where large CRTs for cabinets then really needed the correction (i.e. Konami's 1987-1993 games). Coincidentally it was also handy for users of S3 video cards which had a forced brightness boost that required monitor adjustment, so the 3dfx gamma boost was well compensated for that.
Should also be noted Windows 95+ didn't have color ramps standardized for video drivers in these years.

Later Voodoo hardware (Voodoo2, Banshee/V3) would tone down the default gamma to 1.3.

It's very dark then instantly gets lighter...

that's how it is on the real thing too. The STB-era splash never had an instant appearance.

But to get Q3 to even run i had to use a driver file named OpenGL.dll and place it in the game directory. So maybe i'm getting different lighting results because of that, because i can't replicate that flat/dull look in the image you posted no matter what graphics setting i change in the game. This is my current settings...

The proper procedure is installing the latest drivers (The May 1999 "Quake3 certified" drivers, also available in GLSetup), and having Quake3 use r_gldriver 3dfxvgl. It should see the proper 3dfx gamma extension and send proper color ramps to the card to bring in the intended lighting range. This also overrides the 3dfx gamma setting, so it should look consistent with contemporary 3d hardware.
The version in the screenshots is the 1.09 Q3DEMOTEST which shouldn't have any renderer differences from the final game and it's mostly cosmetic, 1-2 weeks behind gold date.

@schellingb
Copy link
Owner

Thanks for the insight @leilei- !
I'm fine with adding a "Disable Gamma Correction" selection to the "3dfx Voodoo Gamma Correction" core option, it would be a small change and would bring back to what it was before. But the default will probably stay like it is, maybe we go one lower? Not that it would help much...

@PoloniumRain
Copy link
Author

So... I've just tested the new resolution scaling options on a RTX 3080...

QUAKE II

Resolution scale Frame rate
1x (640×480) 98
2x (1280×960) 98
3x (1920×1440) 99
4x (2560×1920) 99
5x (3200×2400) 100
6x (3840×2880) 100
7x (4480×3360) 101
8x (5120×3840) 99

LOL no performance loss even at 5120×3840 .... I've double checked multiple maps and it's the same frame rates with any scaling setting. It's definitely working properly, at least up to 6x (4K) because that's the highest resolution displays which i have to test with, so 8x looks the same as 6x to me. Although the DBP Performance Statistics shows the resolution as 640x480 (it definitely isn't).

Maybe add up to 12x for 8K support? I know that's a little absurd but i doubt the frame rate would change much... I'm sure that even crappy Intel integrated graphics would be fine with 4x or higher, as long as the CPU is fast enough being as that's the real bottleneck here. With this much GPU performance headroom you could implement SSAA (supersampling). DuckStation core has this feature and it will provide the most perfectly anti-aliased image possible, better than any modern AA techniques.

Btw it's great seeing these old games at such high resolutions :) Quake II is looking like the recent remaster.

Oh and Screamer Rally crashes back to the DOS command prompt screen with Hardware OpenGL, typically within 1 minute of racing. So far it's been stable with 3dfx Software rendering, and i know it's stable with 0.9.9 because i completed the Championship mode on that version.

@leilei- Thanks, i'll give Q3 a go with those drivers/files.

@michael-leroy
Copy link

Will oGL hardware acceleration work in iPadOS? These performance numbers are pretty rad on PC.

@schellingb
Copy link
Owner

Found a fix for the menu performance issue! It happens when Emulated Performance is set to either AUTO or MAX.

For Screamer 2, Screamer Rally and any other games with this problem, if i set the Emulated Performance to 300MHz it will now run the menus perfectly (solid 60fps). If i go up to around 600MHz and beyond i will get frame rate drops and sound stuttering again, exactly the same as with AUTO. So it seems to be caused by the CPU cycles being too high on AUTO when using Hardware OpenGL.

Have you noticed any improvement with this since the last commit? It is an attempt that I'm not quite sure is correct but it does seem to help. But it also reduces the emulated CPU's speed a bit while using OpenGL Voodoo rendering (to avoid the stuttering).

@PoloniumRain
Copy link
Author

PoloniumRain commented Jul 28, 2024

Have you noticed any improvement with this since the last commit? It is an attempt that I'm not quite sure is correct but it does seem to help. But it also reduces the emulated CPU's speed a bit while using OpenGL Voodoo rendering (to avoid the stuttering).

Yeah the last commit definitely helps :) For example the menus in Screamer 2 no longer have any problems until i go up to 5x scaling, where as previously they would have issues with no scaling at all. Other games have similar results to this. But it does have a negative effect with Quake II, where i've lost about 15 FPS. There's some areas in certain maps where it will now dip under 60fps. The frame rate drop isn't visibly noticeable with any other games because they're all far less demanding, so if i uncap their frame rates they're still in the hundreds of FPS. So overall i think it works well.

Maybe DBP could detect Quake II at launch (q2.exe) and not apply the latest commit fix to just this game? It was the one game where it had zero issues with AUTO anyway. I've tried manually adjusting the cycles but nothing works quite as well as AUTO did before this commit.

@PoloniumRain
Copy link
Author

PoloniumRain commented Jul 28, 2024

Problems i've encountered with Hardware OpenGL so far:

  • Decent 2 - Runs too fast and some HUD elements do not show (including the FPS counter which can be enabled by typing frametime).
  • Screamer Rally - As mentioned previously, it runs too fast likely due to the insanely high frame rate with Hardware OpenGL, and then the game crashes back to the DOS command prompt.
  • Incoming on Windows 98 - Runs too fast. Can be somewhat fixed by setting Emulated Performance to around 12000 cycles.
  • POD on Windows 98 - Runs too fast. Can be completely fixed by setting Emulated Performance to Pentium 100MHz.
  • Windows 98 - Edit: I've narrowed down this issue. Windows shows a black screen instead of the desktop when the scaling is set too high. The scaling seems to break when it exceeds a resolution that's roughly around 2560x1920. So if the desktop is set to 1024x768 then 3x scaling will show a black screen because the resolution has now gone over 2560x1920. The same thing happens for any Windows games that i've tried so far.

Since my last post i've now tried many more 3dfx supported games on both DOS and Windows. So far with the latest commit i can't find a single game that has menu performance issues with 1x - 4x scaling. Some encounter emulation slowdown with 5x on the menu screens (audio stuttering), while others are fine at 8x. It's made a big improvement! Again the ONE exception being Quake II which ran better previously.

@schellingb
Copy link
Owner

  1. Now restart the game, or close and run it again, and the console will appear.

You do mean restart with the "Restart" button in the Quick Menu in RetroArch, not restarting by quitting the game into DOS and starting it again, right? It does work for me with QDOS, not sure what is different. It works fine for you in games other than Redneck Rampage or QDOS?

I'd like to test Android, and i have some great devices for this. But i don't know how to compile DBP for Android on Windows

Here's a little guide how to compile and run the core on Android, only one thing needs to be downloaded and nothing needs to be installed system wide:

  1. Download https://dl.google.com/android/repository/android-ndk-r25c-windows.zip (445 MB)
  2. Extract it, for example to F:\android-ndk-r25c (important to not have any spaces in the full path!)
  3. Open up the file jni\Application.mk in a text editor that supports Unix line endings (pretty much anything but Notepad)
  4. Change the line APP_ABI := armeabi-v7a arm64-v8a to APP_ABI := arm64-v8a to only build for ARM64 processors
  5. Or, change it to APP_ABI := armeabi-v7a to only build for 32 bit ARM processors (or leave it to build both but wait longer)
  6. Open a Command Prompt and go to the directory of the source with cd {path to dosbox pure source} (like the NDK, it's important to not have any spaces in the path!)
  7. Go into the JNI directory with cd jni
  8. Build the core with F:\android-ndk-r25c\ndk-build.cmd -j8
  9. If it succeeds, it will say [arm64-v8a] Install : libretro.so => libs/arm64-v8a/libretro.so
  10. In Windows Explorer, go to {DBP source}\libs\arm64-v8a
  11. Rename libretro.so to dosbox_pure_libretro_android.so.20290101T0000000001.0000000001.0.lcbk
  12. Copy that file onto an Android phone, for me it works best copying it to {SDCARD}/RetroArch/downloads
  13. On the phone, open RetroArch
  14. Select "Load Core"
  15. Select "Install or Restore a Core"
  16. Find and select "dosbox_pure_libretro_android.so.20290101T0000000000.0000000001.0.lcbk"
  17. If it says "Core restoration complete" things worked

If you compile another version, name the file "dosbox_pure_libretro_android.so.20290101T0000000000.0000000002.0.lcbk" because somehow RetroArch remembers the old file name and doesn't want to install it? I'm not sure, this works for me. I have a batch file which builds the core, appends the actual date and time and copies it to the phone. But I still use 2029 so hopefully RetroArch thinks it's new. If RetroArch thinks it isn't new it will say "Core restoration failed" and you will need to try a different filename.

@PoloniumRain
Copy link
Author

You do mean restart with the "Restart" button in the Quick Menu in RetroArch, not restarting by quitting the game into DOS and starting it again, right?

Yeah, restarting from the Quick Menu. Here's exactly what i'm doing:

SkipConsole.mp4

That's using RA 1.19.1 (happens with a clean RA install as well) and the exact same thing happens with Redneck Rampage. Other games are working fine, but i've only tried roughly 15 so far.

Thanks for the guide! I'll give it a go :)

@PoloniumRain
Copy link
Author

Think i've found the problem. The above issue only happens when a game is not run from a .ZIP file. I had both games unzipped and was running them from a folder, like D:\Emulators\ROMs\DOS\QDOS

So when QDOS and Redneck Rampage are run from .ZIP files, and i then set Skip showing the text console, DBP will always skip the console. I can reproduce this with Hexen and DOOM as well, so this issue might happen with all games if they're not zipped.

schellingb added a commit that referenced this issue Sep 26, 2024
@schellingb
Copy link
Owner

Gotcha, when running an EXE file as content, it will always run it and it ignores any previous auto start/auto skip setting. But I changed it now that it will respect the auto start. This means you can start something like D:\Emulators\ROMs\DOS\QDOS\QDOS.EXE from RetroArch but then still set auto start to launch something different than QDOS.EXE. Which I think is fine, it's an explicit choice.

@PoloniumRain
Copy link
Author

Yeah this way makes more sense. I just tested the change and it's working well. Problem solved!

@PoloniumRain
Copy link
Author

PoloniumRain commented Oct 1, 2024

Alright i've finally tested Android (had some trouble, more on that later). This one's going to be long....

Device 1:
Samsung Galaxy S23 Ultra (full specs)
SoC: Snapdragon 8 Gen 2 (8 CPU cores)
GPU: Adreno 740
RAM: 12GB
OS: Android 14

Device 2:
Samsung Galaxy S9+ (full specs)
SoC: Snapdragon 845 (8 CPU cores)
GPU: Adreno 630
RAM: 6GB
OS: Android 10

Test setup:
RetroArch 1.19.1, 64-bit, default settings, new install.
DOSBox Pure: 64-bit build from 27/09.
Default core settings are used unless otherwise stated.
All tests use 3dfx Voodoo acceleration.

Abbreviation meanings in the charts below:
S8G2 = Snapdragon 8 Gen 2 SoC in the Samsung Galaxy S23 Ultra.
S845 = Snapdragon 845 SoC in the Samsung Galaxy S9+.
Software MT = Software Multi Threaded (default)
Software ST = Software Single Threaded
OpenGL = Hardware OpenGL

I'm using the SoC (System on a Chip) name instead of the phone name. This makes more sense because there's many other devices which use the same SoC's and should perform similar to these Samsung phones. The S8G2 in the S23 Ultra will have a clock speed advantage over other S8G2's, but it's minor.

Q2DOS (QUAKE II) (640x480). Frames per-second:

Timedemo S8G2 Software ST S8G2 Software MT S8G2 OpenGL S845 Software MT S845 OpenGL
Demo1 17 18 50 5 17
Demo2 17 18 49 5 17
Map S8G2 Software ST S8G2 Software MT S8G2 OpenGL S845 Software MT S845 OpenGL
Outer Base 19 19 54 4 18
Supply Station 18 18 66 4 20
Main Gate 21 22 77 4 21
Detention Center 33 33 160 5 42
Security Complex 18 18 47 3 15
Torture Chambers 26 26 129 5 34
Guard House 14 14 35 2 11
Grid Control 20 20 85 4 23
Borehole 16 16 52 3 16
Drilling Area 15 15 34 3 11
Big Gun 17 17 56 4 17
Outer Courts 27 27 112 4 32

Q2DOS: OpenGL resolution scaling:

SoC Scaling achieved before severe FPS dip Note
S8G2 4x 6% drop to frame rate. Remains very playable
S845 1x (none) Technically "playable" but very poor experience

Just from the Q2DOS results there's already a few interesting things here...

  • Q2DOS is the most demanding DOS game but the S8G2 is more than capable of running it at very playable frame rates, even with 4x res scaling. So it should easily run any other DOS game... (spoiler: it does).

  • The S845 was a high-end SoC, but it's now over 6 years old, yet the Q2DOS performance, while not exactly playable, is still good enough to show that it will run almost all of the most demanding DOS games at playable frame rates. The CPU and GPU in this SoC are still also slightly faster than the latest Raspberry Pi 5 and many similar ARM based single board computers.

  • Software Single Threaded and Software Multi-Threaded perform near identical on the S8G2 with Q2DOS on Android :/ Each test was run several times to make sure, then i quickly tested the S845 and it's the same. Multi-threading is definitely working on Android though, because some games below show large frame rate gains with MT. On Windows with a Threadripper 3960X the Q2DOS frame rate will double with MT.

  • What's insane is that the Cortex-X3 "performance core" in the S8G2 actually matches my 3960X in the timedemo demo1 and demo2 benchmarks with single threaded performance, and it's very similar on most maps. Both get 17 FPS for each demo. Obviously the Threadripper will destroy it in overall multi-threaded performance, but still, a ~10W mobile SoC matching a 350+ Watt overclocked and custom water cooled 3960X... Wtf..

  • @michael-leroy I tried the Normal core and it gets 22 FPS on the S8G2 with OpenGL, versus 54 with Dynamic recompilation, in same location shown in your images. The Normal core with Software Multi Threaded gets 19 FPS. So only 3 FPS is gained when using OpenGL. So being as you're having to use Normal core, and getting 15 FPS here with the same settings, it's likely that you're not seeing any performance increase with OpenGL because the Normal core is just too slow for a game as demanding as Q2DOS. I'd expect any other 3dfx DOS game to show a performance increase... If DynRec worked then i'd also expect the OpenGL frame rate to triple on the M4.

For the following benchmarks "Software" = Software Multi Threaded (default) for 3dfx Voodoo acceleration.

QDOS (QUAKE) (640x480). Frames per-second:

Timedemo S8G2 Software S8G2 OpenGL S845 Software S845 OpenGL
Demo1 21 79 8 29
Demo2 20 89 7 33
Demo3 20 71 7 27
Map S8G2 Software S8G2 OpenGL S8G2 OpenGL 800x600 S845 Software S845 OpenGL
The Slipgate Complex 34 111 111 8 39
Castle of the Damned 17 64 63 6 23
Gloom Keep 13 50 48 4 16
The Installation 34 252 243 15 74
The Underearth 17 66 64 9 23
The Tomb of Terror 15 68 65 7 24
The Wind Tunnels 25 139 134 12 44
Chambers of Torment 16 51 49 6 19
The Sewage System 29 145 143 13 45
The Tower of Despair 25 133 129 13 42
Hell's Atrium 21 87 85 11 30
The Nameless City 29 124 120 13 40

QDOS: OpenGL resolution scaling:

SoC Scaling achieved before severe FPS dip Note
S8G2 4x 7% drop to frame rate. Still mostly above 60 FPS
S845 2x 8% drop to frame rate. Obvious FPS issues but playable



Screamer 2 (640x480). Frames per-second:

Track S8G2 Software ST S8G2 Software MT S8G2 OpenGL S845 Software MT S845 OpenGL
England 23 36 60 9 60
Egypt 26 39 60 10 60
California 21 31 60 8 60

Screamer Rally (640x480). Frames per-second:

Track S8G2 Software ST S8G2 Software MT S8G2 OpenGL S845 Software MT S845 OpenGL
China 21 32 60 9 60
Canada 19 31 60 8 60
Italy 24 38 60 10 60

Screamer 2 and Screamer Rally: OpenGL resolution scaling:

SoC Scaling achieved before severe FPS dip Note
S8G2 6x Averages 50 FPS. 5x is locked to 60 FPS
S845 2x Averages 42 FPS but can dip to 26 FPS. Playable

The Screamer 2/Rally track results (not the scaling results) are from when the car is sitting at the starting line. When actually racing the FPS drops from 60 to roughly 45 on the S845. The scaling results are an average of racing AI opponents. The S8G2 is always 60 FPS until 6x scaling is used.



Tomb Raider (640x480). Frames per-second:

Level S8G2 Software ST S8G2 Software MT S8G2 OpenGL S845 Software MT S845 OpenGL
1: Caves 30 (max FPS cap) 30 30 26 30
4: Tomb of Qualopec 30 30 30 23 30
5: St. Francis' Folly 28 30 30 15 30

Tomb Raider: OpenGL resolution scaling:

SoC Scaling achieved before severe FPS dip Note
S8G2 5x Some minor dips. 4x is locked to 30 FPS
S845 2x Locked to 30 FPS at least 95% of the time



Fatal Racing / Whiplash (640x480). Frames per-second:

Track S8G2 Software S8G2 OpenGL S845 Software S845 OpenGL
Auto Ariel 38 60 17 60
Pulse 38 60 18 60
Zizin 38 60 19 60

Fatal Racing / Whiplash: OpenGL resolution scaling:

SoC Scaling achieved before severe FPS dip Note
S8G2 8x Rare dips to 50 FPS. 6x is locked to 60
S845 3x Averages 51 FPS. 2x is almost locked to 60



Descent II (640x480). Frames per-second:

Level S8G2 Software ST S8G2 Software MT S8G2 OpenGL S845 Software MT S845 OpenGL
1: Ahayweh Gate 49 83 403 25 122
7: Coralbank Quarry 43 73 369 24 109
12: Magnacore Station 42 72 364 24 120
13: Sleetstone Tunnels 47 82 465 23 149
18: Drec'nilbie K'luh 46 74 230 24 74
22: Kwod A'rior 52 89 496 29 159

Descent II: OpenGL resolution scaling:

SoC Scaling achieved before severe FPS dip Note
S8G2 6x Almost a 50% drop but still averages 200 FPS
S845 3x 4% drop to frame rate. 2x is identical to 1x



Battle Arena Toshinden (640x480). Frames per-second:

Stage S8G2 Software ST S8G2 Software MT S8G2 OpenGL S845 Software ST S845 Software MT S845 OpenGL
Sofia 36 29 170 16 14 35

Battle Arena Toshinden: OpenGL resolution scaling:

SoC Scaling achieved before severe FPS dip Note
S8G2 3x Large FPS drop after 3x. But still averages 85 FPS at 6x
S845 3x Drops to 30. But game speed becomes too fast over 30, so it's perfect

Software Single Threaded performed better than Software Multi Threaded with Toshinden. The above results for the single character stage were practically the same for all stages.



Grand Theft Auto (512x384). Frames per-second:

Map S8G2 Software ST S8G2 Software MT S8G2 OpenGL S845 Software ST S845 Software MT S845 OpenGL
Liberty City 25 (FPS cap) 25 25 20 17 25

Grand Theft Auto: OpenGL resolution scaling:

SoC Scaling achieved before severe FPS dip Note
S8G2 6x Minor FPS drop at 8x but has sound crackling
S845 3x Locked to 25 FPS

GTA is another game where Software Single Threaded performs better than Software Multi Threaded.



Bonus round...

Windows scaling with an Nvidia RTX 3080 and AMD Radeon RX 7900 XTX:
All games run at the maximum 8x scaling with zero affect on frame rates (no surprise there).

It's been many years since i last used RA on a phone. Here's some problems with it and other random stuff:

  • The keys on the DBP on-screen keyboard are wayyy too small on a phone screen. It's very awkward to use. I ended up using the S23 Ultra's stylus pen to press the keys, which worked well, but barely any other phones have a stylus. It's probably best to have two keyboard modes: Full Size and 75% Layout. The current full size keyboard is perfect for TV's/monitors/laptop screens, and the compact 75% layout will save enough screen space to make the remaining keys much larger. It also keeps the Function and Arrow keys, so it's preferable to something like a 60% layout. An example of how it could look compared to the current keyboard:
    On-screen_keyboard

  • You'll probably already know this, but the DBP Performance Statistics wont always display an accurate frame rate. It sometimes happens in QDOS but not always. Luckily QDOS (and Q2DOS) have an in-game FPS counter in Options > Extended Options > Show framerate.

  • Hardware OpenGL worked well overall on Android 10 and 14. Apart from one thing...

  • In some games on Android (but not Windows), any level of scaling with OpenGL will produce a checkerboard effect on bitmap textures (on the word "ZEUS" below), along with a trailing effect on animated bitmaps, like these spinning logos in Screamer 2 which appear immediately after starting the game:
    Screamer_2

  • As shown in the image above, the Performance Statistics font is too large, so the Cycles details are cut off. Reducing RA's Scale Factor will make it fit on the screen, but then RA's menus become too small. Can the font be made smaller?

  • The S23 Ultra has a 120Hz screen with variable refresh rate, but VRR doesn't work with RetroArch/DBP. I'm guessing this is a RA problem on Android. It works on Windows with G-Sync. Although VRR/G-Sync is barely useful with any DOSBox variant because DOSBox always outputs a locked refresh rates from 60 - 70Hz, so G-Sync on Windows is locked to that as well, instead of a games actual frame rate. It's my biggest problem with DOSBox. I don't expect there's much DBP can do here.

  • The S845/S9+ had some thermal throttling, but it was only with some games (mostly QDOS and Q2DOS) and only by several percent. All the S9+ numbers here are from when it wasn't throttling. The S8G2/S23 Ultra barely got warm with any of these games, and it never showed any thermal throttling, at least with 1x scaling. Maybe if i used something like 8x scaling for longer then it would stress the GPU enough for it to throttle.

  • Using scaling beyond 3x on a phone screen is totally pointless! (obviously). When using the common 3dfx 640x480 game resolution, 3x scaling will produce a very sharp looking 1920x1440 image. I only tried higher scaling values because it's interesting to see how far mobile hardware can be pushed (and some phones like the S23 Ultra can output 4K to an external display).

  • It's possible to get some free performance: The (excellent) Quake II soundtrack needs to be placed in the folder Q2DOS\baseq2\music as either .OGG or .WAV format (the soundtrack can be found online and the tracks need to be numbered from track02 - track11), but use .WAV because it practically has no overhead, so you'll see an FPS increase if you're already using .OGG. Even my Threadripper 3960X still gained 5% FPS. This will apply to any game, including modern DOOM/Quake source ports or anything else (but to a much lesser extent). Some games also support .MP3 music, which has very little overhead, but .WAV will still match or outperform it.

So the reason Android testing took so effing long is because i ran into a VERY annoying issue. For example with Q2DOS, when i wasn't even moving the frame rate could jump up and down from ~80 FPS down to ~20 FPS on the S8G2. This is in an empty room with nothing happening. Most of the time it wasn't that severe though. Some times it might just be going up/down by 10 FPS or less. After a while the constantly jumping frame rate would occasionally settle down, but remain low, sometimes losing well over 50% of the FPS. This happened with AUTO, MAX and any manual cycles setting. The S845 also did this, but with less frame rate variation because the FPS is already lower on that older SoC. Sometimes the performance was good and the frame rate was totally stable, so that's when i got the testing/benchmarking done.

I know what you're thinking... But it's not thermal throttling. Each phone only got slightly warm, and it's just a WAY too severe drop in FPS. It can instantly happen after starting a game after the phone has been idle for ages. I also tried Limit CPU Usage > 85%, which didn't help. But to rule out thermals i put the S23 Ultra in my freezer (this isn't the first time lol) after the FPS had dropped from 80 to 22. The phone was ice cold but the frame rate was still 22.

The way to temporarily fix this issue is to either: Restart the game from the Quick Menu, close/re-open the game, close/re-open RA, open/close the Quick Menu, or just reloading the games map/track/area could fix it, like typing MAP E1M1 into the QDOS game console, or reloading a save. But often these methods wont fix it on the first try. It may take up to 10 attempts, and eventually the problem will return. I only did the tests here when i was completely sure the problem had gone.

It mostly happens with QDOS and Q2DOS. Maybe it's just these games. Also, the faster the hardware, the more noticeable this issue becomes. So if you test this on something that only gets like 10 FPS, then it will be far harder to notice the problem with such a low FPS to begin with. I couldn't find the cause after changing loads of core settings on both phones. It doesn't happen on Windows. I also tried extracting the games from the .ZIP files and directly running from the .EXE's, but that had no effect.

But ignoring this bizarre problem, DBP works well overall on a phone/Android. Apart from the keyboard! :)

@schellingb
Copy link
Owner

@PoloniumRain Ok, you have done some amazing posts around here but this one has to take the cake! Amazing work, thank you so much for the dedication! It took me a while but I finally have time to properly respond.

I have only done a minimum amount of testing on my Android phone, which by 2024 is a low-end device and I've had similar experience to what you had on your lower end device. The rendering is very fill rate limited so scaling up beyond 1x is really hurting performance. Glad to see that higher end devices are quite a bit better in that aspect. With the OpenGL implementation my biggest hope was for the many lower spec devices RetroArch runs on (phones, handhelds, raspberry pi, ...) and at first it wasn't the holy grail I was hoping for but some of these numbers do look very good. It won't suddenly make complex Win98 3D games run amazing everywhere but quite a few titles will be much more playable which is super cool :-)

Let's get to the feedback:

The keys on the DBP on-screen keyboard are wayyy too small on a phone screen.

One thing you maybe didn't try is the alternative mouse modes. Touchscreen based phones really should switch the Input -> Mouse Input Mode option to "Touchpad mode". Both for games and the On-Screen-Keyboard. It will make the mouse cursor control like a few remote desktop applications I looked at - swipe moves the cursor, tapping clicks, tap-and-hold-and-drag does click and drag (for example to select units in an RTS), two and three finger tap does right and middle click. I think it works quite well and I'm now thinking the core option should default to that on mobile platforms (Android, iOS, maybe Vita/3DS/Switch).

All your suggestion for a split layout or better scaling are great, if only it wasn't so much busywork to implement it :-) I'll try to keep them in mind.

You'll probably already know this, but the DBP Performance Statistics wont always display an accurate frame rate. It sometimes happens in QDOS but not always. Luckily QDOS (and Q2DOS) have an in-game FPS counter in Options > Extended Options > Show framerate.

Yeah it really isn't a frame rate but actually it counts how many of the frames had new 3dfx render commands executed. I now committed 3e4fcbb as an improvement to the detection and it seems accurate. Hooray :-)

In some games on Android (but not Windows), any level of scaling with OpenGL will produce a checkerboard effect on bitmap textures (on the word "ZEUS" below).

What you're seeing is that the phone version of OpenGL (OpenGLES) doesn't support drawing points larger than 1 pixel, which is what we rely on for drawing 2D images with upscaling enabled. But turns out there are 2 ways to do that, one called glPointSize and the other gl_PointSize 😂 Well, in 1cdb5c1 I now switched to the latter and it seems to work, on both desktop and mobile. Hooray again :-)

As shown in the image above, the Performance Statistics font is too large, so the Cycles details are cut off. Reducing RA's Scale Factor will make it fit on the screen, but then RA's menus become too small. Can the font be made smaller?

This is all RetroArch doing, but you're in luck, under Settings -> On-Screen Display -> On-Screen Notifications there is "Graphics Widget Scale Override" which will also scale those performance statistics. It will also scale other popups so not a perfect solution but for my testing I just keep that low while still having the menu be readable.

The S23 Ultra has a 120Hz screen with variable refresh rate, but VRR doesn't work with RetroArch/DBP.

Yeah that would be on RetroArch to add support for VRR on Android. There are very few cores that have refresh rates above 60 FPS, so I'm not sure if that's a high priority.

Although VRR/G-Sync is barely useful with any DOSBox variant because DOSBox always outputs a locked refresh rates from 60 - 70Hz, so G-Sync on Windows is locked to that as well, instead of a games actual frame rate. It's my biggest problem with DOSBox. I don't expect there's much DBP can do here.

Yeah, not much an emulator can do, it emulates a monitor with a software selected refresh rate, but then how often the software draws to that is up to the software. Because the core needs to tell the frontend in advance what the refresh rate is (and submit audio at that rate) it can't be modified to just stall submitting the next frame to the frontend until an actual new image is available. I almost feel like that is something a non-libretro based DOSBox variant might be able to do, but not sure how well it would work out in practice.

but use .WAV because it practically has no overhead, so you'll see an FPS increase if you're already using .OGG. Even my Threadripper 3960X still gained 5% FPS.

That is interesting, maybe it would be worth switching out the OGG decoder library we use, maybe others are faster.

So the reason Android testing took so effing long is because i ran into a VERY annoying issue

I don't really know why this would be the case... Mobile CPU schedulers are just a mystery box, sometimes they do the most arbitrary things in the name of battery life :-) I wonder if RetroArch could introduce something like gamemode on Linux but for Android, where it somehow forces or tricks the OS into being nicer for the performance needs of games. Though I have no idea if that's a possibility at all, I try to stay away from mobile development as far as I can :-)

Again thanks for the in-depth testing, got some good data out of that, and now some small but good fixes, too!

@PoloniumRain
Copy link
Author

PoloniumRain commented Oct 11, 2024

With the OpenGL implementation my biggest hope was for the many lower spec devices RetroArch runs on (phones, handhelds, raspberry pi, ...) and at first it wasn't the holy grail I was hoping for

Well, at least this is now possible with OpenGL😎

Thumbnail

Just a short vid, but you can get an idea of how good the performance is. It looks like CPU performance needs to be decent enough to begin with for OpenGL to really start pulling ahead. Which is similar to how many 3D accelerated games performed back in the 90's, where they still relied far more heavily on the CPU compared to modern games. Quite a few 3dfx Win9x games are also playable on my 6 year old Galaxy S9+ but probably not anything shown in that vid where i'm using the Galaxy S23 Ultra.

Over the last few days i've found some problems specific to Android:

  • Win98 games that work on Windows but don't work on Android:

    Unreal - Crashes on launch. Shows a laughably long Win98 error message!
    Unreal Tournament - Same as above.
    Deus Ex - Same again (also uses Unreal Engine).
    Clive Barker's Undying - Same again (looks like all Unreal Engine games don't work).
    Carmageddon 2 - Crashes on launch.
    Dethkarz - Crashes after loading a track.
    Forsaken - Crashes on launch.
    Need for Speed: Porsche Unleashed - Crashes on launch.
    Star Wars Episode I: Racer - Randomly locks up Win98.
    Grand Theft Auto - CD music does not play with the same .ZIP file and core settings (not sure if i'm missing something here).
    EDIT: Fixed GTA! I re-zipped the game and copied it to my phone again. For some reason the music now works... :/

  • Occasionally when Unreal, UT and Forsaken crash, they can also crash RA (closes), which happens roughly 1 in 4 times.
    Here's the log for Forsaken, and this RA notification sometimes briefly appears:

    JMP illegal descriptor type 0X

  • RA will crash (closes) when mounting a folder as the D drive if that folder contains two or more subfolders. For example, i've made this RA playlist file. which contains this path:

    "path": "/storage/emulated/0/ROMs/test",

    So when running this playlist, it will mount the test folder as the D drive in Win98. The folder is located on my phones internal storage (haven't tried an SD card). But if the mounted test folder contains two subfolders, so the directory structure looks like this:

    test > test > test

    Then it will immediately crash RA after running Win98 from the DBP Start Menu. It still happens if all the folders are empty. Folder names can also affect crashes. So the "test" name will always crash RA but other names can stop it from happening (cant remember which ones though). Other folder structures can cause crashes as well, it seem pretty random.

  • With large .ZIP files, when selecting Run in RA for the first time, it can take over 3 minutes with games like GTA (1.2GB) to start on the Samsung Galaxy S9+. GTA also takes 30+ seconds on the S23 Ultra. While this is happening it looks like RA has locked up. Of course on subsequent runs the game will start instantly. But i doubt anything can be done about the first run? Maybe something like if a game takes 10+ seconds to load, DBP could go to the command prompt screen and display a loading message (kinda doubt it's possible).

Problems that affect both Android and Windows:

  • The game Re-Volt on Win98 shows a blank white loading screen before races.

  • Sometimes when changing the disc with RA, Windows 9x doesn't recognise that a new disc has been inserted, so if i open up My Computer it will still show the previous disc icon in the drive. When this happens, if i double click on the disc drive, then it usually wont work and says that it can't read the disc (or a similar error). I need to refresh the My Computer window before the new disc appears in the drive, and then it will work. Not sure if this happens on real hardware though, it's like i vaguely remember it happening...

  • Sorry to bring up gamma again lol, but it's such a pain on Win9x being as it's not useful to save the core settings, being as the 3dfx Voodoo Gamma Correction will obviously be applied to all Windows games, so this setting constantly needs be adjusted for almost every game. RA shaders can also be used to adjust gamma, but the same problem now applies here. With DOS and 3dfx games the cores gamma setting can be saved for each game or course, but this is still an extra step that wasn't needed before. Another issue has appeared with games that i'm not familiar with, where it becomes hard to tell what the correct gamma setting is.

    Until this problem popped up i had totally forgotten how this used to be a thing on real hardware! (back then i'd have to constantly adjust my monitor for each game). But one of the best things about DBP is that it does away with annoying stuff like this, so while this feature is hardware accurate, it feels like a step backwards overall now that it's enabled by default. I'm still glad it's there though, but i'd really like an option to at least disable it, where doing so would make DBP work exactly how it used to (completely ignored 3dfx gamma because it lacked support). Things like the 3dfx logo previously not having a fade in/out effect are insignificant compared to constantly needing to adjust gamma because an entire game looks too bright/washed out or whatever else.

    Or would it be possible to have a separate option that converts all 3dfx gamma to the standardised sRGB gamma of 2.2? Which is what Android, iOS, Mac, Windows and most Linux distros use. So each game should then look the same as when DBP didn't support gamma (it wont be too bright/dark), but things like the 3dfx logo fade and any game specific gamma tricks (Quake III) would still work.

Touchscreen based phones really should switch the Input -> Mouse Input Mode option to "Touchpad mode"

Typing is still slow but it helps a little...

I now committed 3e4fcbb as an improvement to the detection and it seems accurate.

Nice! I just tested it out with GTA, i'm pretty sure that it's now giving accurate readings, so i've added GTA benchmarks to my post above!

There are very few cores that have refresh rates above 60 FPS, so I'm not sure if that's a high priority.

In case you didn't know, 70 FPS already works, at least on Windows :) For example, with DOS games like DOOM that output at 70Hz, my 120Hz TV with VRR will drop down to match this refresh of 70. So being as DOOM runs at 35 FPS, exactly half of 70, it then produces a perfectly smooth looking frame rate with no stuttering. But on a 60Hz display DOOM has obvious stutter. My TV can show the current refresh rate/VRR info, so i can see that it switches to 70Hz when i make the RA window fullscreen.

But turns out there are 2 ways to do that, one called glPointSize and the other gl_PointSize 😂 Well, in 1cdb5c1 I now switched to the latter and it seems to work, on both desktop and mobile.

LOL that underscore has fixed all the affected games :)

thanks for the in-depth testing, got some good data out of that, and now some small but good fixes, too!

Hope this post also helps!

schellingb added a commit that referenced this issue Oct 15, 2024
…nux file systems (#519)

This fixes a crash during boot of an installed operating system on Android which expects these entries to exist.
schellingb added a commit that referenced this issue Oct 17, 2024
…k cache the first time by showing a loading message (#519)

Caching can take a minute or longer on a low end device, now the frontend stays responsive throughout the process.
schellingb added a commit that referenced this issue Oct 17, 2024
…erating system for a split second that there is no media inserted (#519)

Otherwise Windows 9x might not realize that the CD-ROM has been changed.
@schellingb
Copy link
Owner

Win98 games that work on Windows but don't work on Android

This sadly is a general problem with DOSBox. After all it was never meant to emulate Win9x, it's hardware accelerated CPU emulation (the dynamic core) takes some shortcuts to get more performance, which means a multi-threaded OS like Win9x can somewhat easily get confused by the minute differences when running on an ARM CPU as opposed to an Intel CPU. For now it is what it is.

Occasionally when Unreal, UT and Forsaken crash, they can also crash RA

I wish this was reliably reproducible. I get the huge error message on Unreal engine games but no crash. I'd like to not crash the core but if it crashes randomly it's hard to fix... The big Unreal error seems to be about some CPU calculation being off which matches my assumption above. You can change the emulation to not use dynamic recompiling (either by setting CPU Core to normal or by enabling Force Normal Core in OS) and then Unreal seems to be happy and launches. Though at a severe performance cost. Once in the game it actually can be switched back to dynamic but it might just crash on the next level load.

RA will crash (closes) when mounting a folder as the D drive if that folder contains two or more subfolders

Commit f6294f3 fixed this. Thanks for reporting!

With large .ZIP files, when selecting Run in RA for the first time, it can take over 3 minutes with games like GTA (1.2GB) to start

Commit b6310d3 added a fancy message that pops up after a second or so while it is building the seek cache of the ZIP. I always thought there's no way around the freezing but it turned out to be not that complicated to show something on screen and keep the frontend responsive. Though hopefully it doesn't cause any issues because now it shows frame updates when it really shouldn't.

The game Re-Volt on Win98 shows a blank white loading screen before races.

I tried the Acclaim demo from https://re-volt.io/downloads/demos and it shows the loading screen fine. But it might be related to other 2D rendering issues like the Descent 2 menu that still has some artifacts with OpenGL rendering...

Sometimes when changing the disc with RA, Windows 9x doesn't recognise that a new disc has been inserted

Not 100% confident but I think commit f160e1b will improve that.

Sorry to bring up gamma again

Commit c7bbbf3 now adds a 'Disable Gamma Correction' to the '3dfx Voodoo Gamma Correction' core option that should make things look like how they were in 0.9.9. Maybe another option with a different but still fixed 2.2 gamma curve?


@PoloniumRain I was wondering, we're slowly creeping towards a release of all of this stuff, I might ask for a mention of the new version on the RetroArch blog once it is out and I was wondering if you'd be OK if I'd have them show off your YouTube videos? I was thinking of the two latest ones, Half-Life on the phone and Forsaken in 4K, they make it look very impressive :-)

@PoloniumRain
Copy link
Author

@schellingb

Commit f6294f3 fixed this. Thanks for reporting!

I think this actually fixed two issues lol... Because i forgot to mention it before, but on the Start Menu where you choose a HDD size when installing an OS, it would crash RA immediately after the .IMG file had been created. But now this no longer happens. Previously i got around this issue by just copying a Win98 .IMG from my PC to my phone.

Commit c7bbbf3 now adds a 'Disable Gamma Correction'

So happy to see this!

Maybe another option with a different but still fixed 2.2 gamma curve?

Yeah, it would be the ideal setting if it works...

Not 100% confident but I think commit f160e1b will improve that.

This works 100% of the time on Windows 10/11... But oddly enough it never works on Android... To make Win9x recognise a disc change on Android i need to open the Quick Menu, eject the disc, then close the Quick Menu, wait for around 3+ seconds on the Win9x desktop, then re-open the Quick Menu and insert a disc. Or i can do: My Computer > right click > Refresh which also makes Win9x recognise a disc change.

But it might be related to other 2D rendering issues like the Descent 2 menu that still has some artifacts with OpenGL rendering...

Yeah i think it is. Same thing with the black 3DMark 99 loading screen that i mentioned before. But speaking of 3DMark, i tried it again on Android, and the black loading screen doesn't always appear (it does on Windows). Instead, Android will display the very last frame from the previous 3DMark test. But the 3DMark loading/progress bar appears on top of it.

So with the Decesnt 2 menu on Windows, if you press the F key to switch RA between windowed and fullscreen mode, it will turn the entire screen black. This might happen because the screen turns black for a split second when resizing the RA window like this, so it's just displaying the last frame again. But if you then press the Up/Down arrow keys, the Descent 2 menu will appear again because pressing these keys will highlight another menu item. Any kind of visual change like this will fix the problem. That's probably why animated bitmaps never seem to be affected, like the progress bar in 3DMark. But the Decent 2 menu is entirely static, and so are most loading screens. It's only completely static bitmaps that are affected.

Commit b6310d3 added a fancy message that pops up after a second

Hmm there seems to be two freezing issues... There's the one you've just fixed, where for example, with the game Ripper if i run RIPPER.EXE the game will immediately ask if i want to load my last save file, and if i choose yes then it used to freeze for a few seconds (even on my Threadripper). Now it shows the "Caching ZIP Structure" message (i like the little animation). But then there's also this problem...

RA_freeze

The image above is what happens after i've selected 'Load Archive' for the eXoDOS versions of GTA and Harvester. On the first attempt, both games will cause the above RA menu screen to freeze for 3+ minutes on the Galaxy S9+, and after roughly 30 seconds Android will ask if i want to close the app because it's unresponsive. If i choose 'Wait' then eventually these games will start. Although this happens with such a small amount of games that it isn't a huge problem or anything (but it might happen with more games on very old/slow hardware).

The size of a .ZIP file appears to partially be the cause of this, but not the main reason, because far larger games like Ripper, which is 4.15GB, will get past that frozen screen in under 5 seconds. GTA is 1.2GB and Harvester is 1.3GB, but most larger games from 1.5 - 4GB in size will only freeze for just 1 - 8 seconds. Anyway i'd be surprised if there's anything you can do here! It's more of an RA problem.

I was wondering if you'd be OK if I'd have them show off your YouTube videos?

Yeah course :) I was actually planning on making a longer compilation video that shows way more games running with OpenGL. I'll probably get round to it some time next week...

@schellingb
Copy link
Owner

On the first attempt, both games will cause the above RA menu screen to freeze for 3+ minutes on the Galaxy S9+, and after roughly 30 seconds Android will ask if i want to close the app because it's unresponsive.

And it does not happen if the file extension is changed from .ZIP to .DOSZ. So yes, this seems to be a RetroArch issue... It somehow does something with the ZIP even though "Load Archive" should just pass the path to the ZIP to the core and leave it at that. But instead it seems to do some big operation on it... Does it extract it? Or calculate a checksum of the content? Or just waste time reading the file for nothing? I wonder...

@PoloniumRain
Copy link
Author

PoloniumRain commented Oct 25, 2024

I don't mean to spam another long post with benchmark tables... But lol.... I was messing around with voodoo.cpp and found a small performance improvement to Software Multi Threaded CPU rendering.

I'm not even remotely familiar with C++, i've no idea what i'm doing, but this line looked interesting. So i changed this:

if (tworker.totalpix <= 200)

To this...

if (tworker.totalpix <= 400)

And it showed a slight FPS improvement. So then i made multiple builds for both Windows and Android, where i changed it from 150 to 600 in increments of 50. After tons of testing i narrowed it down and found that 350 performs the best on Windows with my Threadripper 3960X and also on Android with both my Samsung Galaxy S23 Ultra and Galaxy S9+. It's just a small improvement though, but very decent for such a quick and simple change. So now it's time for even more benchmark tables...

Abbreviation meanings in the tables below:
TR = AMD Threadripper 3960X.
S8G2 = Snapdragon 8 Gen 2 SoC in the Samsung Galaxy S23 Ultra.
200 = if (tworker.totalpix <= 200)
350 = if (tworker.totalpix <= 350)



Q2DOS (QUAKE II) (DOS 640x480). Frames per-second:

Timedemo TR: 200 TR: 350 S8G2: 200 S8G2: 350
Demo1 32.2 33.9 18.6 20.1
Demo2 32.1 33.3 18.4 20.0



MDK2 (Win98 512x384). Frames per-second:

Timedemo TR: 200 TR: 350 S8G2: 200 S8G2: 350
Demo 31.3 32.8 18.2 19.3



Expendable (Win98 640x480). Frames per-second:

Timedemo TR: 200 TR: 350 S8G2: 200 S8G2: 350
Demo 25.5 26.4 18.3 19.4

Because the difference to the frame rate is small i've ran the above tests 10 times for each demo, just to be completely sure, because there's always some small variation for each run. So these results are the average FPS for each of those 10 runs.

Overall 350 showed a 3.5 - 5% increase to the frame rates on Windows for the above games, and Android showed a larger 6 - 8% increase.

Android testing is such a pain that i didn't bother testing it as thoroughly for each game below, so all of the following games will just have the results for Windows/Threadripper, but basically these games on Android/S8G2 performed similar to the results above, where the FPS increase was typically slightly better than on Windows with the Threadripper.



QDOS (QUAKE) (DOS 640x480). Frames per-second:

Timedemo 200 350
Demo1 36.3 37.5
Demo2 35.4 36.9
Demo3 32.9 34.3



Hexen II: Hammer of Thyrion (DOS 640x480). Frames per-second:

Timedemo 200 350
Demo1 33.8 35.2
Demo2 36.3 37.8
Demo3 42.8 44.6



Screamer 2 (DOS 640x480). Frames per-second:

Track 200 350
England 50 51
Egypt 50 51
California 48 48



Descent II (DOS 640x480). Frames per-second:

Level 200 350
1: Ahayweh Gate 134 147
2: Turnabout Bore 167 180
5: Seaspring Gorge 152 164
7: Coralbank Quarry 116 131
9: Firewalker Mine 177 198



Expendable (Win98 640x480). Frames per-second:

Timedemo 200 350
Demo1 25.5 26.4



QUAKE III (Win98 512x384). Frames per-second:

Timedemo 200 350
Four.dm_68 20.8 22.0



Unreal Gold (Win98 640x480). Frames per-second:

Map 200 350
Vortex Rikers: Avg FPS 31.2 31.7
Vortex Rikers: Max FPS 84.1 84.5
Vortex Rikers: Min FPS 29.2 29.8



Unreal Tournament (Win98 800x600). Frames per-second:

Timedemo 200 350
Cityintro: Avg FPS 28.6 29.5
Cityintro: Max FPS 75.4 77.3
Cityintro: Min FPS 16.4 16.4



Forsaken (Win98 640x480). Frames per-second:

Demo 200 350
Nuke 88.9 92.4
Ship 88.7 92.2



Dethkarz (Win98 640x480). Frames per-second:

Track 200 350
Metro City 51.0 52.3
The Pole 53.8 55.6
Grand Keys 58.3 60.4
Red Planet 53.7 55.7



3DMark 99 Max (Win98 640x480). Frames per-second:

Benchmark name TR 200 TR 350
Race 32.4 33.0
First Person 20.2 20.9
Overall 3DMark score TR 200 TR 350
2482 2550



I didn't find any games where this change performed worse, or any other issues.

And it does not happen if the file extension is changed from .ZIP to .DOSZ

Ah yeah you're right, that's weird. When using .DOSZ all games will now get past that screen almost instantly, with a 1 second freeze at most, no matter how large the game is. If it's extracting the .ZIP then i can't find where it's being extracted to... But it looks like i'll be changing all my games to .DOSZ then.

And @schellingb this is unrelated but do you know why DBP has some different looking text characters to DOSBox Staging on the command line screen, like below? Which one is accurate? Some characters like the 0 and M look squished on DBP, but then the Y, W and T all have different character designs. I'm just asking because i'm making a DOS font so i'm looking for a very accurate example to base it on. I know these characters were stored in ROM, so maybe there's some variation between ROMs, in which case i'll just have to find a nice looking character set which was also common.
Comparison

BTW i haven't had time to do that vid i mentioned!

@schellingb
Copy link
Owner

Overall 350 showed a 3.5 - 5% increase to the frame rates on Windows for the above games, and Android showed a larger 6 - 8% increase.

Oh, that's a lovely improvement there. The number there is basically the threshold required for how many pixels a triangle must fill on the screen for it to use the threaded rendering. So 200 pixels would be something like a triangle covering a 20 by 20 pixel area. 350 is like a 26 by 27 pixel large triangle. Generally the more modern of a game is being emulated, the smaller the polygons become and thus it will more often forego the threaded rendering. I haven't really done any testing on what other factors affect this but your tests seem quite conclusive.

If it's extracting the .ZIP then i can't find where it's being extracted to... But it looks like i'll be changing all my games to .DOSZ then.

Yeah, I should look into this, it seems a bug in RetroArch and it's quite peculiar this isn't happening on Windows.

this is unrelated but do you know why DBP has some different looking text characters to DOSBox Staging on the command line screen, like below?

No idea... DOSBox Pure should look like original DOSBox. But I tried two more things, VMWare with MS-DOS 6.22 and PCjs.

image

You could maybe also try real MS-DOS in PCem to see how it looks there by emulating various types of PCs and video cards.

PoloniumRain added a commit to PoloniumRain/dosbox-pure that referenced this issue Oct 26, 2024
Improves 3dfx Voodoo frame rates by 3 - 8% (sometimes slightly less or more) depending on the game. This applies to the core options 'Software Multi Threaded (default)' and 'Software Multi Threaded, low quality'.

Many game test results can be viewed [here.](schellingb#519 (comment))
@PoloniumRain
Copy link
Author

Alright i've just created a pull request and it's the first time i've created one, so let me know if i've messed something up...

The number there is basically the threshold required for how many pixels a triangle must fill on the screen for it to use the threaded rendering

Yeah i roughly guessed that from the code comment "Don't wake up threads for just a few pixels". If that wasn't there then i'd be lost and never would have stumbled upon this performance improvement. It's all just a total fluke. Don't expect me to do anything else like this lol... I'm only used to simple web development languages.

PCem

Totally forgot that i already have PCem. Thanks for those other suggestions!

@PoloniumRain
Copy link
Author

I was thinking, could MSAA options for OpenGL be added? I'd imagine that this is now a possibility... So for example, within Core Options > Video there could be Multisample Anti-Aliasing with 2x, 4x and 8x options. Another possibility could be super sampling/SSAA, which would provide the ultimate image quality for 3D games. Many emulators support these features and the DuckStation core has a great implementation of both, but i've never seen either of these in any DOSBox variant, PCem or 86Box.

Speaking of 86Box, i was recently trying it out and it has this extremely useful feature:

Mount_folder

It lets you mount a folder as the disc drive. This is SO much easier for getting drivers/games/software on to Win9x.

Meanwhile with DBP, there's a few awkward ways to transfer files:

  • My preferred way is to create an RA playlist file and point the path to a folder, instead of a game, which will mount that folder as the D drive in Win9x. But hardly anyone is going to know about this method, and from what i've seen the average RA user doesn't know how to manually create/edit a playlist.

  • Software like UltraISO or PowerISO can be used to create an ISO, or add files to an existing ISO or IMG. But most people also wont know about this, and it requires extra software.

  • Creating a ZIP containing your files is probably the easiest way. It can be loaded like any other zipped game, and if you then run the OS it will have all the files inside the ZIP on the D drive. But this is still not as fast or simple as 86Box.

Being as RA doesn't allow for folders to be selected in Quick Menu > Disc Control, maybe a similar feature to 86Box could be added in the Core Options? But instead of also adding an "Eject" option for the disc (folder), it could instead work where you'd only need to select a different folder, which would then automatically "eject" and change the current disc (folder) in Win9x.

Or if there's a reason why this can't be done, then having a Core Option to select a folder as a drive would be just as good. It doesn't have to be the D drive either. There could be an option that allows a folder to be mounted as any drive letter. The downside to this is that it couldn't be ejected/changed while the OS is running. But the positives are that it would obviously allow for writes, instead of just reads like with the disc, and it would get around the D drives 8GB size limit.

Having both options would be ideal, but either would be hugely helpful, especially to new users. I think that since OpenGL was added, DBP is now easily one of the best ways to play Win9x games, at least for games that only support the Voodoo 1 and don't require MMX (and unlike PCem/86Box, DBP doesn't have severe input latency, plus the overall frame rates are now better than DOSBox X). So having helpful Win9x features like these would be really nice.

@schellingb
Copy link
Owner

I was thinking, could MSAA options for OpenGL be added? I'd imagine that this is now a possibility

Yeah, that seems like a good next step. SSAA is basically what we already do with the upscaling, but the core would then bilinearly scale it down before passing it to the frontend. MSAA needs some work with how the framebuffers are set up. Put it's probably something for a next version of the core :-)

Speaking of 86Box, i was recently trying it out and it has this extremely useful feature:
It lets you mount a folder as the disc drive. This is SO much easier for getting drivers/games/software on to Win9x.

This seems like a neat feature. Certainly not trivial, to real-time emulate a CD-ROM filesystem. For DOSBox Pure I did the emulation of a FAT file system for emulating the D: drive with any DOSBox drive (mounted directory or ZIP, etc.). CD-ROM emulation could be implemented but even more than that I would like a FAT file system emulation that writes modifications done on the D: drive into a regular DOSBox Pure save zip instead of the opaque hard disk delta files we have now.

Or if there's a reason why this can't be done, then having a Core Option to select a folder as a drive would be just as good.

A core option can't be something like a directory selection, it is always a selection from one list of items.

But... very recently I have contributed this change to RetroArch:

This now allows directories to be loaded as the content for DOSBox Pure directly via the Load Content. It also allows that for discs, but for now this only works in DOS, not in Win9x (again, due to there not being something like a CD-ROM filesystem emulator).

But the positives are that it would obviously allow for writes, instead of just reads like with the disc, and it would get around the D drives 8GB size limit.

There is no way to simply make a transparent folder mounting like you describe. Win9x running inside DOSBox means that all drivers of Win9x run. This includes hard disk and file systems drivers. This means the emulator itself really can just present the OS a block of bytes that makes up an emulated hard drive. So on that level there is no concept of files.

One way to achieve this would be if the emulator were somehow able to emulate a full Windows server that offers a network drive to be mapped via Windows file sharing. This is feasible, but will include a lot of work and research. Of course the open source project samba is out there but nowadays that is huge because it supports all kinds of versions of Windows, all kinds of protocols, all kinds of security standards and encryptions. We would basically need none of that. Even if that was figured out, then implementing a fake network server that responds to network packets sent by the emulated OS will still be quite a task.

Another option would be to develop a custom Win9x file system driver that somehow does the passthrough, but.... that seems even more complicated and also would mean anyone who would want to use this would need to install this custom driver in their Win9x installation.

@Torinde
Copy link
Contributor

Torinde commented Oct 31, 2024

There is also VBSF - DOS shared folders support for Virtualbox. Maybe you can implement the Vbox interface in Pure...

@schellingb
Copy link
Owner

DOSBox emulates DOS, it has no problem providing real drives to the emulated application based on anything (mounted directory, zip, filesystem). VirtualBox just like VMWare has something called "Guest Additions" for many operating systems which is what I described above with "custom Win9x file system driver that somehow does the passthrough". The Virtual Box Windows Guest Additions only support Windows NT/2000/XP and up, so none for Windows 9x which is what we'd need.

@PoloniumRain
Copy link
Author

Yeah, that seems like a good next step. SSAA is basically what we already do with the upscaling, but the core would then bilinearly scale it down before passing it to the frontend. MSAA needs some work with how the framebuffers are set up. Put it's probably something for a next version of the core :-)

I'd love to see SSAA on Win9x games :) Although even higher scaling options would be needed for SSAA, maybe up to 16x. I know that sounds stupidly high but the Voodoo's lowest resolution is 512x384 (although most games only go down to 640x480), so being as the current maximum 8x scaling would produce 4096x3072, that wouldn't be high enough for SSAA to show any meaningful difference on a 4K display. For comparison the Flycast and DuckStation cores have up to 20x and 32x scaling, although these are overkill unless you have an 8K display! But it would be amusing to test these kind of ludicrous resolutions with DBP...

This now allows directories to be loaded as the content for DOSBox Pure directly via the Load Content.

Excellent!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants