Na_th_an:
Welcome in the world of "how to kill that poor screen"
I buried myself in this subject deeply, however i could not make my screen ready to throw off the window, but created some interesting modes what should work.
You may need to get Tweak16B from somewhere to try them easily, but they can be set up without it too (but with some programming):
The basic:
16 color mode 640x400 register set:
Code:
3C2-00: 63 (or 67 for 79Hz)
3D4-00: 5F, 3D4-01: 4F, 3D4-02: 50, 3D4-03: 82, 3D4-04: 55
3D4-05: 81, 3D4-06: BF, 3D4-07: 1F, 3D4-08: 00, 3D4-09: 40
3D4-10: 9C, 3D4-11: 8E, 3D4-12: 8F, 3D4-13: 28, 3D4-14: 1F
3D4-15: 96, 3D4-16: B9, 3D4-17: E3
3C4-01: 01, 3C4-03: 00, 3C4-04: 06
3CE-05: 00, 3CE-06: 05
3C0-10: 01, 3C0-11: 00, 3C0-12: 0F, 3C0-13: 00, 3C0-14: 00
256 color mode 256x256 register set (Mode Q):
Code:
3C2-00: E3 (57Hz, or E7 for 64Hz)
3D4-00: 5F, 3D4-01: 3F, 3D4-02: 40, 3D4-03: 82, 3D4-04: 4A
3D4-05: 9A, 3D4-06: 23, 3D4-07: B2, 3D4-08: 00, 3D4-09: 61
3D4-10: 0A, 3D4-11: AC, 3D4-12: FF, 3D4-13: 20, 3D4-14: 00
3D4-15: 07, 3D4-16: 1A, 3D4-17: E3
3C4-01: 01, 3C4-03: 00, 3C4-04: 06
3CE-05: 40, 3CE-06: 05
3C0-10: 41, 3C0-11: 00, 3C0-12: 0F, 3C0-13: 00, 3C0-14: 00
Now the modes what i could tweak:
Resolution: 536x400 or 544x400 (Pixels are almost square)
Note: The memory page's width can not be set to 536 what is the nearest to have square pixels but 544 can be set.
Variant A,B: (536/544)x400, 75Hz or 84Hz depending on 3C2 (63 or 67)
Set the 640x400 mode, and change these:
Code:
Width=536 (Variant A)
3D4-00: 59, 3D4-01: 42, 3D4-02: 43, 3D4-03: 9C
3D4-04: 48, 3D4-05: 18
3D4-13: 22 (To set the memory page's width to 544)
Width=544 (Variant B; the same but:)
3D4-01: 43, 3D4-02: 44
Safe - A,B: (536/544)x400, 70Hz or 79Hz (Keeping everything but the width)
Set the 640x400 mode, and change these:
Code:
Width=536 (Variant A - Safe)
3D4-01: 42, 3D4-02: 43
3D4-13: 22
Width=544 (Variant B - Safe)
3D4-01: 43, 3D4-02: 44
3D4-13: 22
Variant C,D: (536/544)x400, 78Hz or 88Hz depending on 3C2 (63 or 67)
These modes were set up by keeping the 640x400 mode's limits so they should work if the screen supports these refresh rates:
Select variant A or B (not safe), and change:
Code:
3D4-00: 55, 3D4-03: 98
Mode "Cheetah - Q"
Resolution: 256x256 with 256 colors
Refresh rate: 67Hz or 75Hz (3C2-00: E3 or E7)
Set Mode Q, and change:
Code:
3D4-00: 51, 3D4-03: 94, 3D4-04: 44, 3D4-05: 14
I could set up a 464x350 mode too (with 16 colors) what worked on 92Hz
Note: be careful with (536/544)x400 Variant C and D since some screens (like LCDs) can not set more than 75Hz!
And finally if you want something really high (or something what really makes your screen sick):
An 512x384 mode with 84Hz/95Hz refresh rate! (I can create you versions with lower rates if needed...)
It has exactly square pixels, and no problems at the video memory. Something like ModeQ in 16 colors.
Set the 640x400 mode, and change:
Code:
3D4-00: 51, 3D4-01: 3F, 3D4-02: 40, 3D4-03: 94, 3D4-04: 44
3D4-05: 14, 3D4-06: AF, 3D4-07: 1F, 3D4-08: 00, 3D4-09: 40
3D4-10: 8C, 3D4-11: 8E, 3D4-12: 7F, 3D4-13: 20, 3D4-14: 1F
3D4-15: 86, 3D4-16: A9, 3D4-17: E3
Use, or call these screen modes as you wish... I would like to call "Mode - Cheetah - Q" this version of ModeQ and "Mode - Cheetah - 16" the 512x384 sets, but i will not force anyone to use these names...
The technique:
This is very hard... There are many things what i not know well too for example what is "vertical blanking". I could set these by looking through the available modes learning how they work, and what they can accept. This way all of the modes i set might not be the "perfect" ones (what can force the screen to be on the borderline of it's displaying capabilities), but they are near to it. They use the same differences in the values as the 640x400 mode (as the resolution grows, it might be needed to have more time for retracing and some other invisible processes, and as it shrinks it might be set lower too to gain a bit higher refresh rate).
So all what i did is that i set the values for each screen mode like what i had seen at 640x400: this resulted the highest refresh rate. If it is needed to reduce them it can be done by increasing the time what the screen spends with invisible work (For example by having more "horizontal total" than what is really needed for that mode).
Usually who tweaked VGA modes before simply catched a screen mode with higher resolution than what they would like to have and only reduced the registers storing the number of the displayed lines. This left some idle time behind what might have been used to get higher refresh rates: now i cut this out and got it. Of course who set up Mode - Q first needed to work with the vertical part since there was no higher resolution in double - scanned modes than 240. I can not imagine why he or she not reduced the idle time gained by setting the horizontal part lower than 320 to have at least the usual 60Hz/67Hz refresh rates (Possibly had an LCD display?)...