First post, by aVd
Here is what I have about so called "S3 BIOS bright bug". The information is gathered form different sources (including one related thread in this forum and not using a.i. slop/web-searches):
For the older S3 video cards based on Trio64V2/DX (86C775), Trio64V2/GX (86C785), ViRGE/DX (86C375), ViRGE/GX (86C385) chips the "pedestal bit" in 0x03C5 register is this one: x x B x x x x x (the sixth bit, if we count from the least significant bit starting from one).
So, to cure the "bright bug" in the safest way, we have to use bitwise operation "AND 0xDF" (oxDF = 1 1 0 1 1 1 1 1) applied to the register 0x03C5. This way we don't change any other previously set bit values in the register:
MOV DX,3C4MOV AL,8OUT DX,ALINC DXMOV AL,6OUT DX,ALDEC DXMOV AL,1AOUT DX,ALINC DXIN AL,DXAND AL,DF ; dis. BBOUT DX,AL
The safest reverse bitwise operation enabling "bright bug" for the same older S3 card is with "OR 0x20" (0x20 = 0 0 1 0 0 0 0 0) applied to the same register 0x03C5. This way we don't change any other previously set bit values in the register:
MOV DX,3C4MOV AL,8OUT DX,ALINC DXMOV AL,6OUT DX,ALDEC DXMOV AL,1AOUT DX,ALINC DXIN AL,DXOR AL,20 ; en. BBOUT DX,AL
Important note: The above doesn't apply to the very first ViRGE/325 (86C325) chip! Possibly due to different register's settings.
For the newer S3 cards based on ViRGE/GX2 (86C357), Trio3D (86C365) and possibly even Savage3D, Savage4 chips the "pedestal bit" in 0x03C5 register is this one: x x x x B x x x (the fourth bit, if we count from the least significant bit starting from one).
In this case, to cure the "bright bug" in the safest way, we have to use bitwise operation "AND 0xF7" (oxF7 = 1 1 1 1 0 1 1 1). We don't change any other previously set bit values in this register:
MOV DX,3C4MOV AL,8OUT DX,ALINC DXMOV AL,6OUT DX,ALDEC DXMOV AL,27OUT DX,ALINC DXIN AL,DXAND AL,F7 ; dis. BBOUT DX,AL
The safest reverse bitwise operation enabling "bright bug" for the same newer S3 cards is with "OR 0x08" (0x08 = 0 0 0 0 1 0 0 0):
MOV DX,3C4MOV AL,8OUT DX,ALINC DXMOV AL,6OUT DX,ALDEC DXMOV AL,27OUT DX,ALINC DXIN AL,DXOR AL,8 ; en. BBOUT DX,AL
The pre-build DOS com-executables along with the source code for MASM and NASM will be attached in the next post.
SvarDOS fan :: artificial "intelligence" bots - not a fan at all :: say NO to systemd :: is freeware a lie, when human freedom is a fundamental lie? :: f00ck €u!