The S3 ViRGE Resource Hub

Exploring the "Virtual Reality Graphics Engine"

The History

Released in 1995, the S3 ViRGE was one of the first 2D/3D accelerators for the mass market. While often joked about as a "3D Decelerator," its 2D performance was legendary.

Release Date: 1995
Era CPUs: Pentium, Pentium Pro, Cyrix 6x86
Interface: PCI / VLB
Notable S3D Games:
Terminal Velocity, Descent II, Tomb Raider, MechWarrior 2

The Pedestal Bit

Is your S3 card outputting a "washed out" or overly bright image? This is likely the "Pedestal Bit" bug. I've documented how to patch the BIOS for various S3 chips in the following videos.

BONUS: All patched BIOS files can be downloaded from my website.

Custom Image Splash Screens

Learn how to inject a custom 192x160 image into the VGA ROM. This process involves Ghidra for function injection and GIMP for image formatting.

Compare Splash Screens

Video Thumbnail

Overclocking & BIOS Modding

My ViRGE runs at 70 MHz from the factory! Here is how I use MCLK and BIOS patching to squeeze more performance out of the silicon.

Video Thumbnail

Dynamic Text Splash screen

My ViRGE is overclocked to 77 MHz, but the text splash screen is hard-coded to "M70" The following code snippet reads M, N, and R values from memory location 0xc2 and 0xc3, calculates the actual frequency, and overwrites the hard-coded splash text.

Code:

66 60 2E A0 C3 00 88 C3 80 E3 1F C0 E8 05 24 07
88 C1 B0 01 D2 E0 30 E4 30 FF 83 C3 02 F7 E3 89 
C3 2E A0 C2 00 24 7F 30 E4 83 C0 02 B9 8F 00 F7 
E1 31 D2 F7 F3 D1 E2 39 DA 7C 01 40 BB 0A 00 31 
D2 F7 F3 80 FA 05 7C 01 40 31 D2 F7 F3 04 30 80 
C2 30 2E A2 7C 00 2E 88 16 7D 00 66 61 E8 D4 CB 
C3

This code needs to be injected between two other routines.
It overwrites the hard-coded text and continues with the original call that was hijacked.

S3 ViRGE Snake!

Inspired by Snake-512, this version is adapted to run directly from the VGA BIOS.

Code:

66 60 2E A0 C3 00 88 C3 80 E3 1F C0 E8 05 24 07 88 C1 B0 01 D2 E0 30 E4 30 FF 
83 C3 02 F7 E3 89 C3 2E A0 C2 00 24 7F 30 E4 83 C0 02 B9 8F 00 F7 E1 31 D2 F7 
F3 D1 E2 39 DA 7C 01 40 BB 0A 00 31 D2 F7 F3 80 FA 05 7C 01 40 31 D2 F7 F3 04 
30 80 C2 30 2E A2 7C 00 2E 88 16 7D 00 66 61 E8 D4 CB C3 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 50 53 51 52 56 57 06 1E 31 C0 8E D8 FB E4 21 50 24 FE 
E6 21 B4 0F CD 10 50 B4 02 30 FF BA 00 17 CD 10 BE CF 7E E8 A7 02 90 90 90 90 
90 90 90 3C 01 0F 84 BA 01 90 90 90 90 B8 13 00 CD 10 B8 00 A0 8E C0 B0 68 31 
FF B9 00 FA F3 AA E8 DD 01 B4 02 30 FF BA 0F 0B CD 10 BE FC 7E E8 E9 01 B4 02 
BA 0A 0D CD 10 BE 02 7F E8 DC 01 E8 93 01 84 C0 74 F9 3C 01 0F 84 70 01 3C 31 
75 EF E8 AD 01 B0 0E BF 50 64 E8 88 01 C7 06 04 7E 00 0A C7 06 02 7E 01 00 BF 
20 0A 89 3E 06 7E C7 06 00 7E 06 7E B0 77 E8 6A 01 06 31 C0 8E C0 8B 1E 00 7E 
89 DE 8D 7F 02 8B 0E 02 7E FD F3 A5 FC 07 A1 08 7E 03 06 04 7E A3 06 7E 8B 3E 
08 7E B0 02 E8 40 01 8B 3E 06 7E 26 80 3D 0E 75 4A A1 02 7E 40 A3 02 7E A1 00 
7E 83 C0 02 A3 00 7E A1 6C 04 B9 2D 00 F7 E1 05 39 05 31 D2 BB 19 00 F7 F3 89 
C1 89 D0 BB 00 0A F7 E3 89 C7 89 C8 BB 28 00 F7 F3 89 D0 BB 08 00 F7 E3 01 C7 
26 80 3D 01 75 CD B0 0E E8 EE 00 EB 46 8B 1E 00 7E 8B 7F 02 B0 01 E8 E0 00 8B 
3E 06 7E 26 80 3D 01 74 30 B4 02 30 FF BA 0F 0B CD 10 BE 34 7F E8 FF 00 B4 02 
BA 04 0D CD 10 BE 13 7F E8 F2 00 E8 A9 00 84 C0 74 F9 3C 01 0F 84 86 00 3C 31 
75 EF E9 D0 FE 8B 3E 06 7E B0 77 E8 9D 00 8B 1E 6C 04 83 C3 04 E4 64 A8 01 74 
60 E4 60 24 7F 3C 48 74 04 3C 11 75 10 81 3E 04 7E 00 0A 74 4C C7 06 04 7E 00 
F6 EB 44 3C 50 74 04 3C 1F 75 10 81 3E 04 7E 00 F6 74 34 C7 06 04 7E 00 0A EB 
2C 3C 4B 74 04 3C 1E 75 0F 83 3E 04 7E 08 74 1D C7 06 04 7E F8 FF EB 15 3C 4D 
74 04 3C 20 75 0D 83 3E 04 7E F8 74 06 C7 06 04 7E 08 00 39 1E 6C 04 7C 94 E9 
BD FE 58 30 E4 CD 10 EB 05 58 30 E4 CD 10 58 E6 21 FA 1F 07 5F 5E 5A 59 5B 58 
C3 E4 64 A8 01 74 05 E4 60 24 7F C3 30 C0 C3 57 50 51 52 B9 08 00 89 FA 51 B9 
08 00 F3 AA 59 81 C2 40 01 89 D7 E2 F1 5A 59 58 5F C3 57 50 51 B9 B8 00 BF 08 
0A 51 B0 01 B9 30 01 F3 AA 59 83 C7 10 E2 F2 59 58 5F C3 56 50 53 B4 0E BB 0F 
00 2E 8A 04 84 C0 74 05 CD 10 46 EB F4 5B 58 5E C3 53 33 20 56 69 52 47 45 20 
53 6E 61 6B 65 21 20 50 72 65 73 73 20 4E 20 74 6F 20 70 6C 61 79 2C 20 45 53 
43 20 74 6F 20 73 6B 69 70 00 53 4E 41 4B 45 00 50 72 65 73 73 20 4E 20 74 6F 
20 73 74 61 72 74 00 50 72 65 73 73 20 4E 20 74 6F 20 72 65 73 74 61 72 74 2C 
20 45 53 43 20 66 6F 72 20 50 4F 53 54 00 47 41 4D 45 20 4F 56 45 52 21 00 53 
E8 74 FF 8B 1E 6C 04 83 C3 37 E8 24 FF 84 C0 75 09 A1 6C 04 3B C3 7C F2 B0 01 
5B C3

This code needs to be called from anywhere in the original code.
It continues with the regular execution once Snake terminates.

Video Thumbnail