VOGONS


S3 ViRGE BIOS RAM timings

Topic actions

First post, by RichB93

User metadata
Rank Member
Rank
Member

Recently got my hands on an Expert Color branded S3 ViRGE DX PCI card with 4MB of 35ns RAM. Stock clocks were and already impressive 72MHz, but I was hopeful it could be pushed to 83MHz due to the RAM speed. MCLK confirmed that 83MHz was indeed possible, and I hard modded the BIOS to this figure without incident. The BIOS is v1.01.03 (available here).

As always happens on VOGONS, I went down the rabbit hole and found that there was a newer BIOS which adds VBE 2.0 and also fixes the black level problem. The new BIOS however was only running at 50MHz. Using the method to modify my original BIOS to the same 83MHz speed ended up in artifacting, but checking MCLK, the other timings etc were the same... so I can only assume that there's some other secret sauce in the BIOS which we can't change on the fly with MCLK which controls the card timings, and also isn't documented anywhere.

I ended up replacing the entire block from end of the second date (B5) to just before the PCIR section (13) which seems to work, and my card is once again running at 83MHz, but with the fixed black levels and VBE2.0 support.

Anyway, if anyone is interested, attached is the original 2.01.07 BIOS, and my modified 83MHz version.

Does anyone else have any further insights into how this all works?

Attachments

Reply 2 of 20, by RichB93

User metadata
Rank Member
Rank
Member
keropi wrote on 2020-09-06, 15:06:

interesting thanks for sharing!

You're welcome - it's astounding that S3 left so much leeway on these cards. Whilst they are still very clearly not in the same league as a Voodoo, for me they seem to be the most interesting early 3D accelerator despite their reputation. They have (for me) the most interesting exclusive accelerated games; the Verite is a nice card but the 2D acceleration isn't that amazing, and as nice as vQuake is, that's about the only bit of excitement; S3 cards have better DOS support to boot.

I'd love to see what the other settings are responsible for in the BIOS as there's more to these cards than what MCLK exposes.

Reply 3 of 20, by keropi

User metadata
Rank l33t++
Rank
l33t++

yeah I am also a fun of S3 cards mainly because they are such good dos/2d ones
rendition ones would also be ok but indeed their 2d performance is just garbage

🎵 🎧 PCMIDI MPU , OrpheusII , Action Rewind , Megacard and 🎶GoldLib soundcard website

Reply 5 of 20, by RichB93

User metadata
Rank Member
Rank
Member
Putas wrote on 2020-09-06, 16:40:

I have such a DX, in my case the frequency was "only" 70 MHz.
Virge specs say single-cycle EDO RAM, but for a frequency that high, loosed timing is prime suspect indeed.

Yeah, that seems about right to be honest - like I say, the original BIOS timings etc caused heavy corruption. Whilst I'm not very knowledgeable on these things, I assume that this is still preferable, as because the core:ram ratio is 1:1, it allows the core to run at higher speeds. Or does the RAM performance really hurt it more? I'd love to know more specifics behind how the timings are configured in the BIOS, and if it's possible to tighten them up.

Reply 7 of 20, by The Serpent Rider

User metadata
Rank l33t++
Rank
l33t++

Virge specs say single-cycle EDO RAM, but for a frequency that high, loosed timing is prime suspect indeed.

I would suspect that timings on 50 Mhz BIOS are just too tight even for more typically clocked card and not the other way. 35ns EDO was rated to work at 83Mhz by some manufacturers. Ultimately, S3 Virge DX with 35ns is limited by the chip itself.

I must be some kind of standard: the anonymous gangbanger of the 21st century.

Reply 8 of 20, by biessea

User metadata
Rank Member
Rank
Member
RichB93 wrote on 2020-09-06, 14:10:
Recently got my hands on an Expert Color branded S3 ViRGE DX PCI card with 4MB of 35ns RAM. Stock clocks were and already impres […]
Show full quote

Recently got my hands on an Expert Color branded S3 ViRGE DX PCI card with 4MB of 35ns RAM. Stock clocks were and already impressive 72MHz, but I was hopeful it could be pushed to 83MHz due to the RAM speed. MCLK confirmed that 83MHz was indeed possible, and I hard modded the BIOS to this figure without incident. The BIOS is v1.01.03 (available here).

As always happens on VOGONS, I went down the rabbit hole and found that there was a newer BIOS which adds VBE 2.0 and also fixes the black level problem. The new BIOS however was only running at 50MHz. Using the method to modify my original BIOS to the same 83MHz speed ended up in artifacting, but checking MCLK, the other timings etc were the same... so I can only assume that there's some other secret sauce in the BIOS which we can't change on the fly with MCLK which controls the card timings, and also isn't documented anywhere.

I ended up replacing the entire block from end of the second date (B5) to just before the PCIR section (13) which seems to work, and my card is once again running at 83MHz, but with the fixed black levels and VBE2.0 support.

Anyway, if anyone is interested, attached is the original 2.01.07 BIOS, and my modified 83MHz version.

Does anyone else have any further insights into how this all works?

Hi there, great work indeed.

I recently bought a s3 Virge Dx, a Sparkle version with 100mhz Ram (25ns). I know it's the highest clocked ram, but when I open Powerstrip 3.20 O see that the card is clocked to 50mhz Gpu and 50mhz Ram. I think it's a pity to leave these low frequencies, but Powerstrip permits me to raise frqeuencies until 67mhz.
How can I go beyoond this limit and test it so I can flash your 83mhz bios? I really want to "use" that 100mhz Ram.
Which program do you use to flash the bios? Flashrom?
Or I have to do with the USB flasher ch341a?

Computer lover since 1992.
Love retro-computing, retro-gaming, high-end systems and all about computer-tech.
Love beer, too.

Reply 10 of 20, by biessea

User metadata
Rank Member
Rank
Member
Dorunkāku wrote on 2022-10-02, 09:13:

Double click the icons under the frequency sliders in Powerstrip to adjust the range of those sliders.
You can go up to 100% overclock if i recall correctly.

Thanks a lot I'll do.

Anyway I don't have understood to now how to flash the bios then.

Computer lover since 1992.
Love retro-computing, retro-gaming, high-end systems and all about computer-tech.
Love beer, too.

Reply 11 of 20, by mkarcher

User metadata
Rank l33t
Rank
l33t
biessea wrote on 2022-10-01, 17:08:

Which program do you use to flash the bios? Flashrom?
Or I have to do with the USB flasher ch341a?

Neither approach will work. Virge cards (at least Virge (original), Virge/VX and Virge/DX) do not provide in-system flashing. So usually, these cards are not shipped with flashable ROM chips at all. Virge cards use 28-pin parallel ROM chips (they output 8 bits at the same time, and they take all 15 address bits at the same time, too; the model number usually starts with 27 for UV erasable chips, or 28 or 29 for flashable chips). The ch431a is only able to work with serial flash chips (they take addresses bit-by-bit over the same pin, and they output data bit-by-bit over the another pin; the model number of these chips usually starts with 25). So the ch431a is unable to write ROM chips (EPROM or flash) for use in a Virge card.

A well known "low-cost" programming solution for parallel ROM, EPROM and flash chips is the TL866. It's still around 50 to 70 dollars/euros/pounds. A Virge card is compatible with BIOS chips like the standard 27C256 EPROMs, Winbond W27E256/W27C256 EEPROMs and 28C256 EEPROMs. you need a programmer that supports this kind of chip to create a BIOS chip with different contents. On the other hand, if you are using Windows 95/98, most likely you can just run a DOS software tool that changes the memory/core clock (it's the same on the ViRGE) from autoexec.bat, and this will also change the clock used in Windows.

Reply 12 of 20, by biessea

User metadata
Rank Member
Rank
Member
mkarcher wrote on 2022-10-02, 13:02:
biessea wrote on 2022-10-01, 17:08:

Which program do you use to flash the bios? Flashrom?
Or I have to do with the USB flasher ch341a?

Neither approach will work. Virge cards (at least Virge (original), Virge/VX and Virge/DX) do not provide in-system flashing. So usually, these cards are not shipped with flashable ROM chips at all. Virge cards use 28-pin parallel ROM chips (they output 8 bits at the same time, and they take all 15 address bits at the same time, too; the model number usually starts with 27 for UV erasable chips, or 28 or 29 for flashable chips). The ch431a is only able to work with serial flash chips (they take addresses bit-by-bit over the same pin, and they output data bit-by-bit over the another pin; the model number of these chips usually starts with 25). So the ch431a is unable to write ROM chips (EPROM or flash) for use in a Virge card.

A well known "low-cost" programming solution for parallel ROM, EPROM and flash chips is the TL866. It's still around 50 to 70 dollars/euros/pounds. A Virge card is compatible with BIOS chips like the standard 27C256 EPROMs, Winbond W27E256/W27C256 EEPROMs and 28C256 EEPROMs. you need a programmer that supports this kind of chip to create a BIOS chip with different contents. On the other hand, if you are using Windows 95/98, most likely you can just run a DOS software tool that changes the memory/core clock (it's the same on the ViRGE) from autoexec.bat, and this will also change the clock used in Windows.

So my friend, the simplest way is to use the Mclk program to the autoexec.bat so every time I power on the pc it set the speed of core and memory isn't it?

This is a good method to test the frequencies too.

Anyway I wanted to flash my s3 virge dx, I am sad that I cannot.

Computer lover since 1992.
Love retro-computing, retro-gaming, high-end systems and all about computer-tech.
Love beer, too.

Reply 13 of 20, by mkarcher

User metadata
Rank l33t
Rank
l33t
biessea wrote on 2022-10-03, 18:04:
mkarcher wrote on 2022-10-02, 13:02:

if you are using Windows 95/98, most likely you can just run a DOS software tool that changes the memory/core clock (it's the same on the ViRGE) from autoexec.bat, and this will also change the clock used in Windows.

So my friend, the simplest way is to use the Mclk program to the autoexec.bat so every time I power on the pc it set the speed of core and memory isn't it?

Exactly. Find Mclk for example here: http://files.mpoli.fi/hardware/DISPLAY/OTHER/MCLK093B.ZIP

Reply 14 of 20, by pa1983

User metadata
Rank Newbie
Rank
Newbie

I want to thank RichB93 for his bios mod and instructions found here Re: How do I flash VBIOS on an S3 card?

I my self have one of those S3 Virge DX 4Mb 70Mhz cards with 35ns ram that has the stupid Black level bug so everything is gray.
I used the debug metohod to fix it but I now have an eprom burner and I been servicing my 486's so I figure I would reflash the card with a bug free bios.

I did have MCLK running from Autoexec.bat so when I saw it saying OLD clock 50Mhz and new Clock 75Mhz instead of the usual 69.8Mhz Old clock and 75Mhz new clock I knew I had an issue.
On a 486 it did not mater much but still annoying.
I actually cant run mine at 83Mhz or even 80, I ran 80 or 81 for a LONG time until I yesterday figured out that of all the programs that artefacting it was notepad 🤣

So when i found RichB93 83Mhz bios I knew i could not use it BUT thanks to his information I managed to copy the C2 to C5 values and recompute the checksum and flash the eprom with the new bios with my eprom burner.

And the card posts and now it reports 69.8Mhz again and I dont have the gray black level bug so win win!
I used the same 2.01.07 bios and took the settings from my old 1.0 something bios.

And because I might forget how i did it or of someone else is like me, bad at reading then pictures is king so I figured I make a mini guide with pictures and if RichB93 finds any errors he can correct them.

I have not modded bioses before that I can recall so.

So this is my guide based on the instructions from RichB93 and also what I could find online, there where guides but they had dead images so useless .

s3_bios_mod1.jpg
Filename
s3_bios_mod1.jpg
File size
725.45 KiB
Views
1363 views
File license
Public domain

Copy C2 to C5 from your old bios to your new bios to transfer the frequency settings

s3_bios_mod2.jpg
Filename
s3_bios_mod2.jpg
File size
679.21 KiB
Views
1363 views
File license
Public domain

Select the first byte with the cursor, then scroll all the way down to the bottom of the file

s3_bios_mod3.jpg
Filename
s3_bios_mod3.jpg
File size
421.36 KiB
Views
1363 views
File license
Public domain

Hold shift and click the second last byte from the end marking all of the bytes but the last one

s3_bios_mod4.jpg
Filename
s3_bios_mod4.jpg
File size
437.92 KiB
Views
1363 views
File license
Public domain

Click Analyze and then checksums...

Last edited by pa1983 on 2023-07-01, 05:33. Edited 3 times in total.

Website, YouTube, Discord, Gallery

Reply 15 of 20, by pa1983

User metadata
Rank Newbie
Rank
Newbie
s3_bios_mod5.jpg
Filename
s3_bios_mod5.jpg
File size
516.17 KiB
Views
1363 views
File license
Public domain

Select Checksum-8 and also check the box "Selected data" then hit OK

s3_bios_mod6.jpg
Filename
s3_bios_mod6.jpg
File size
498.25 KiB
Views
1363 views
File license
Public domain

You will now have a checksum value, in this example I got "CA", but its not the final checksum value

s3_bios_mod7.jpg
Filename
s3_bios_mod7.jpg
File size
581.77 KiB
Views
1363 views
File license
Public domain

Open up the calculator, select Programmera mode.
Then select HEX mode.
After that enter 100 minus the checksum you got, in my case I got CA so 100-CA equals 36.
Modify the last byte so it has the same value as we just calculated and you are done modding the bios!

Maybe its a bit detailed but I figure anyone can go and get HxD and edit there own S3 bios in like 5 minute now.

Website, YouTube, Discord, Gallery

Reply 16 of 20, by pa1983

User metadata
Rank Newbie
Rank
Newbie

Also here is my bios that I modded, use ate your own risk, I take no responsibility for anything it might cause.

Filename
86c375_5-V2.01.07-70Mhz-mod.zip
File size
18.22 KiB
Downloads
52 downloads
File license
Fair use/fair dealing exception

I tested it on this card.

110_gfx.jpg
Filename
110_gfx.jpg
File size
353.67 KiB
Views
1350 views
File license
Public domain

This bios should be more resonable for cards that dont clock that high but still has fast memory.
This way you can keep your 70Mhz CLK and have the Brightness bug fixed.

Website, YouTube, Discord, Gallery

Reply 17 of 20, by analog_programmer

User metadata
Rank Oldbie
Rank
Oldbie

@pa1983, awesome manual for BIOS modding, man! Yesterday I just compiled my version for DOS .com tool, which heals "too bright" BIOS bug on ViRGE/GX(DX) videocards, but now I'm looking for real BIOS mod solution. Your shared experience will be very useful to me. Thahks!

And now I have an question: How did you managed to find the hex values for the brightness bug in your BIOS image file? I've read the threads here on the subject, but I got the impression that for different cards these values are located at different hex addresses and I didn't find a clear answer how to find and correct them. This more of an interests to me, because my S3 ViRGE/GX card uses SGRAM chips and it hardly makes sense to try to overclock it through the BIOS.

from СМ630 to Ryzen gen. 3
engineer's five pennies: this world goes south since everything's run by financiers and economists
this isn't voice chat, yet some people, overusing online communications, "talk" and "hear voices"

Reply 19 of 20, by pa1983

User metadata
Rank Newbie
Rank
Newbie
analog_programmer wrote on 2023-07-01, 05:36:

@pa1983, awesome manual for BIOS modding, man! Yesterday I just compiled my version for DOS .com tool, which heals "too bright" BIOS bug on ViRGE/GX(DX) videocards, but now I'm looking for real BIOS mod solution. Your shared experience will be very useful to me. Thahks!

And now I have an question: How did you managed to find the hex values for the brightness bug in your BIOS image file? I've read the threads here on the subject, but I got the impression that for different cards these values are located at different hex addresses and I didn't find a clear answer how to find and correct them. This more of an interests to me, because my S3 ViRGE/GX card uses SGRAM chips and it hardly makes sense to try to overclock it through the BIOS.

Well the guide was not mine as I stated, I just redid it with pictures as best i understand it because its just easier for me and probably a lot of people to have som pictures with the words.
So the actual work was done by RichB93 not me.
Here is the guide he write.
Re: How do I flash VBIOS on an S3 card?
I just documented it a bit more but he has the knowledge not me.

I just took the 2.01.07 bios like people recommended that has the brightness fix then I copied the C2 to C5 bytes from my original bios that I extracted with my eprom burner.
So there is really no skill involved from my side, I read instructions on what to copy and also I used a bios file that dont have the bug.
Here is the 2.01.07 bios, its 50Mhz CLK and brightness fix.

Filename
86c375_5.zip
File size
19.12 KiB
Downloads
42 downloads
File license
Fair use/fair dealing exception

Here is my cards original 1.01.03 bios with 70Mhz clock that I took the C2-C5 values out of.

Filename
S3_VirgeDX-DSV3325DX-M70-W27E257@DIP28.BIN.zip
File size
16.92 KiB
Downloads
45 downloads
File license
Fair use/fair dealing exception

Now Idk how to compute any arbitrary CLK value, someone might be able to do a guide on that but if nothing else if people posted the C2-C5 values and what clock there card runs at then its a simple copy paste.

But I did use a software fix using debug and you did have to do some calculations.

You have to use something called S3Brigth.
I will attach the file.

Filename
S3BRIGHT.zip
File size
15.67 KiB
Downloads
39 downloads
File license
Fair use/fair dealing exception

Its from this Vogon thread Re: S3 AGP Cards (and possibly others) Too Bright

The readme file.

This batch removes the pedestal switch that elevates the black level of some S3 cards. […]
Show full quote

This batch removes the pedestal switch that elevates the black level of some S3 cards.

Before running RUN.BAT you have to find the correct value for you S3 card and modify the register (1F) on the fourth line in ON.SCR and OFF.SCR.
But you can try to run it as is if you have S3 or ViRGE/DX and Trio64V2/DX.

For Trio3D famly third line with 1A should be changed to 27 at the second 3c4.
For ViRGE/DX and Trio64V2/DX keep it 1A.

To find the correct "1F" value:
Run debug.exe and type:

o 3c4 08
o 3c5 06
o 3c4 1a
i 3c5

You will get a 8-bit hexadecimal value, subtract 20h from it [i.e. you got 3F, (3F - 20 = 1F)].
* Google search: 0x3F-0x20 to find the value.
Type "q" to quit debug.exe.

Replace the 1F value in OFF.SCR with the calculated resulting value and save.
Replace the 3F value in ON.SCR with the default output from "i 3c5" and save.

For more info see this thread on Vogons:
S3 AGP Cards (and possibly others) Too Bright

This is the line I ended up with in my Autoexec.bat

C:\S3BRIGHT\debug.exe < C:\S3BRIGHT\off.scr > nul

And this is my ON.SCR

o 3c4 08 o 3c5 06 o 3c4 1a o 3c5 3f q :end […]
Show full quote

o 3c4 08
o 3c5 06
o 3c4 1a
o 3c5 3f
q
:end

And this is my OFF.SCR

o 3c4 08 o 3c5 06 o 3c4 1a o 3c5 1f q :end […]
Show full quote

o 3c4 08
o 3c5 06
o 3c4 1a
o 3c5 1f
q
:end

I no longer have need for it tough but thats how I fixed the bug initially but removed the line today after patching the bios.

Its fairly easy if you just do what it tells you step by step and it might help you with your project too.

But Im have no real knowledge in this subject other then the fact that I can read instructions.

I got rid of my VBE extension, S3VBE20 because the new bios had the same performance now so it proved to be redundant to use a VBE extension now with the good VESA 2.0 support the later 2.01.07 bios has.
Duke Nuke 3D hits 120fps on my 486 @ 133Mhz, sure it dips to the low 20's at times to but yea pretty solid performance.

I hope the post answers your questions, its about all I know on the subject.

Website, YouTube, Discord, Gallery