diff --git a/README.RUS b/README.RUS index 1228899..f1b8ec8 100644 --- a/README.RUS +++ b/README.RUS @@ -1,8 +1,9 @@ - +.utf8! for english readme, please read README.TXT + < logo placeholder > - S3VBEFIX - TSR fix for S3 VESA 2.0 BIOS v.0.5.2 - blah-blah copyleft (cl) 2o16 by Artem Vasilev - wbc \\ b-state + S3VBEFIX - TSR fix for S3 VESA 2.0 BIOS v.0.6.0 + blah-blah copyleft (cl) 2o16-2o22 by Artem Vasilev - wbcbz7 . _ _____________________________________________________________________ _ . 0x0. disclaimer @@ -25,20 +26,20 @@ в общем, так и появилась сия TSR-ина :) + upd. o2.1o.2o22: набралось достаточно фидбека, решил слегка обновить + 0x2. системныя требования - 100% IBM PC/AT-совместимый персональный компьютер (ну тут ничего особенного) - (с шиной PCI\AGP, ну вы понимаете почему) - - процессор... пока что требуется минимум 386 из-за использования 32-битных - регистров (причем там, где можно было обойтись без них ;) - - память... около 1 кб свободной (сама прога занимает где-то 800-900 байт в + - процессор - 80386 иливыше + - память... около 1 кб свободной (сама прога занимает где-то 900-1200 байт в зависимости от количества VESA-режимов). ОЧЕНЬ рекомендуется грузить в UMB! - система... на MS-DOS 3.3 и выше должно работать (проверял на 6.22 и 7.1) - и самое главное - ВИДЕОКАРТА! конечно же S3 ;), ОЧЕНЬ желательно с версией BIOS 2.0 или выше (проверить очень просто - если БЕЗ всяких VESA-резидентов проги говорят о наличии VBE 2.0, то у вас как раз нужная версия видеобиоса) - да, если у вас Trio64V+, можно дальше не читать и бежать за UniVBE :), ну а - если в наличии ViRGE/DX, Trio3D или даже Savage4 (не проверял) - вперед! + если у вас Trio64V+, можно попробовать режим "фейкового VBE 2.0" (см. ниже), + ну а если в наличии ViRGE/DX, Trio3D или Savage - вперед! PCI или AGP - без разницы, но с VLB-картами ничего обещать не могу. 0x3. фичи @@ -56,7 +57,7 @@ - vid_mode #, # - наш номер (если его нет, то, скорее всего, у вас видеобиоc версии 1.x, и про VESA 2.0 режимы он не знает) - переключаемся в любой Mode-X режим с шириной 360 пикселов (напр. 360x480) - - ...а теперь внимательно смотрим на правый край экрана. впечатляет? :) + - ...а теперь внимательно смотрим на правый край экрана. впечатляет? если наблюдается мусор или черные полосы справа, то баг пойман. - выходим из кваки и опять смотрим на правый край экрана. теперь в текстовом режиме можно наблюдать мусор справа (особенно заметно на панелях NC\VC) @@ -66,29 +67,45 @@ S3VBEFIX просто отключает primary stream fifo fetch во всех VGA-режимах, тем самым все проблемы устраняются. На скорость это не влияет - можете убедиться сами :) - - поддержка VESA 320x[400\480] 8\15\16\32bpp режимов - добавлена для некоторых демок\интр (в основном от replay :), которые так и + + - поддержка VESA 320x[400\480] 8/15/16/24/32bpp режимов + добавлена для некоторых демок/интр (в основном от replay :), которые так и норовят использовать эти режимы, а другие юзать не умеют. - - переопределение объема установленной памяти + фикс кол-ва видеостраниц + по сути, это режимы 320x200/240 со сброшенным битом doublescan. + + - переопределение объема установленной памяти, версии VBE и макс.числа страниц вкратце - если есть кривая софтина, которую колбасит от слишком большого - количества памяти на видяшке, то можно эту прогу обмануть. "новый" размер - задается ключом /M[x] (более подробно - ниже) + количества памяти на видяшке или из-за кривого детекта версии VBE, или же + криво работает double/triple buffering, то можно эту прогу обмануть. + кроме того, можно использоать эту фичу для "фейкового" VBE 2.0, см. ниже + + - настройка линейного кадрового буфера (LFB) + в некоторых случаях требуется отключить LFB или хотя бы пометить VESA-режимы + как не поддерживающие LFB, для чего можно использовать ключ /S1. Ключ /S2, + наоборот, помечает все VESA режимы как поддерживающие LFB, и дополнительно + позволяет вручную включить его в случае, если BIOS не имеет поддержки. + опять же, полезен для фейкового VBE 2.0, см.ниже + /S0 - использовать настрйоки BIOS + + - фикс установки LFB-режимов + сначала устанавливается banked-режим с сохранением флагов, затем в случае + успеха ставится LFB-режим без очистки экрана (OR 0x8000) и проверяется факт + его инициализации в железе. Фиксит зависания с включенным бустером, также + позволяет реализовать "фейковый" VBE 2.0 (см. ниже) + + - собственные процедуры VBE Get/Set Palette (0x4F09) и Display Window (0x4F05) + стандартный код смены банков не дружит с бустером, поэтому S3VBEFIX тащит + за собой собственную реализацию. Ключом /Q можно добавить альтернативную + процедуру чтения/записи палитры, необходимую для "фейкового" VBE 2.0 и прог + и игр типа Quake, которые брезгуют в VBE-режимах долбить палитру в порты :) + - принудительные настройки для set display start как известно, для функции установки начальной позиции кадра (AX=0x4F07) можно задать флаг "ждать обратного хода луча" (BL = 0x80 вместо 0x00). Проблема в том, что некоторые софты используют его некорректно, из-за чего картинку начинает колбасить\глючить\рвать Задается через ключ /S[x]. - - установка разрядности палитры в RAMDAC (Trio3d и выше) - Старые S3-шки (ViRGE/DX и ранее) поддерживают только 6 бит на канал (18 бит - всего) в палитре для ЦАПа в палитровых режимах. Trio3D и новее могут исполь- - зовать режим 8 бит на канал (24 бит всего), в итоге давая большее число - цветов и оттенков из палитры (16,7 млн против 262144). Некоторые игры (типа - Terra Nova) вроде бы поддерживают этот режим, но работают в нем криво (цвета - слишком темные либо вообще закосячены нафиг), посему ключом /D6 можно заста- - вить эти проги использовать 6 бит на канал в палитре. /D0 или /D8 - вернуть - возможность менять разрядность палитры (на ViRGE/DX и старше этот ключ бес- - бесполезен, так как палитру больше 6 бит на канал они не умеют аппаратно) + - бустер (ускоритель) для VESA banked режимов ну и самое вкусное :p Да, это и есть тот самый ускоритель из S3SPDUP, толкьо теперь уже не нужно @@ -102,7 +119,27 @@ Увы, дальше ускорять LFB-режимы некуда - они и так по скорости на уровне Matrox Millennium или Tseng ET6000 и без всяких бустеров, также не имеет смысла включать бустер для VGA-режимов - можно поиметь проблемы с Mode-X. - Включается\отключается ускоритель ключом /B[+\-] + Включается\отключается ускоритель ключом /B[+\-]. + ВНИМАНИЕ: бустер НЕ работает на S3 Savage! + + следующие фичи - только для S3 Trio3D/Savage + - установка разрядности палитры в RAMDAC (Trio3d и выше) + Старые S3-шки (ViRGE/DX и ранее) поддерживают только 6 бит на канал (18 бит + всего) в палитре для ЦАПа в палитровых режимах. Trio3D и новее могут исполь- + зовать режим 8 бит на канал (24 бит всего), в итоге давая большее число + цветов и оттенков из палитры (16,7 млн против 262144). Некоторые игры (типа + Terra Nova) вроде бы поддерживают этот режим, но работают в нем криво (цвета + слишком темные либо вообще закосячены нафиг), посему ключом /D6 можно заста- + вить эти проги использовать 6 бит на канал в палитре. /D0 или /D8 - вернуть + возможность менять разрядность палитры (на ViRGE/DX и старше этот ключ бес- + бесполезен, так как палитру больше 6 бит на канал они не умеют аппаратно) + + - гамма-коррекция в Hi/TrueColor режимах + малополезная фишка (пока нет ни одной программы, которая ее умела бы), но + поскольку она документирована начиная с VBE 2.0, и RAMDAC в Trio3D/Savage + поддерживает гамма-коррекцию, то почему бы и нет? + По умолчанию настраивается линейная гамма (00..FF), собственные кривые (8 + бит на канал) загружаются аналогично палитре в 256-цветных режимах. Вот, пожалуй, и все фичи на текущий момент, если хотите узнать больше, можно почитать TODO.TXT (но он написан в таком стиле, что глаза болеть начинают :)) @@ -111,23 +148,33 @@ Запускается как обычно - [LH] S3VBEFIX.COM <параметр> <параметр>... где <параметр>: - - /B[+\-] - включить\отключить бустер для VESA banked режимов - по умолчанию ускоритель отключен. - - /D[x] - задать режим работы RAMDAC (/D6 - всегда использовать 6 бит на - канал, /D0 или /D8 - разрешить переключение разрядности RAMDAC) - /M[x] - переопределение объема видеопамяти (x - объем памяти в блоках по 64 килобайт, /M16 - 1 МБ, /M0 - по умолчанию) - и да, лишние мегабайты на видяшке не вырастут :), просто софтам - сообщается другой объем установленной памяти. - - /S[x] - настройка работы флага "ждать ретрейса" для set display start + - /P[x] - ограничить макс. число видеостраниц (x - предел, x = 0 - по + умолчанию - 127 страниц) + - /V[x] - задать возвращаемую версию VBE (/V102 - 1.2, /V200 - 2.0) + - /Q - заменить процедуру чтения/записи палитры (0x4F09) (до выгрузки!) + - /X - добавить VESA-режимы 320x400 and 320x480 (до выгрузки!) + - /L - управление LFB: + x = 0 - по умолчанию, x = 1 - выключить + x = 2 - включить несмотря ни на что (для фейкового VBE 2.0) + - /S[x] - настройка работы флага "ждать ретрейса" для set display start: x = 0 - флагом управляет приложение x = 1 - всегда ждать ретрейса, даже если флаг не установлен x = 2 - не ждать ретрейса, даже если флаг установлен + - /B[+\-] - включить\отключить бустер для VESA banked режимов (кроме Savage) + по умолчанию ускоритель отключен. + - /I - дополнительно перехватывать INT 6D, отключает выгрузку! - /U, /R - выгрузить резидент из памяти. НАСТОЯТЕЛЬНО рекомендую выгружать прогу именно этим ключом, (НЕ при помощи RELEASE или VC), иначе при включенном бустере не будет восстановлен адрес LFB в карте, в результате машина может повиснуть при установке LFB-режимов. - + + S3 Trio3D/Savage only: + - /D[x] - задать режим работы RAMDAC (/D6 - всегда использовать 6 бит на + канал, /D0 или /D8 - разрешить переключение разрядности RAMDAC) + - /G[+/-] - включить/отключить гамма-коррекцию в Hi/TrueColor + - LH - грузить S3VBEFIX в верхнюю память (рекомендуется при ее наличии) пример: @@ -135,10 +182,28 @@ кадра игнорировать флаг "ждать ретрейса) S3VBEFIX.COM /M32 - установить объем видеопамяти 2 МБ - Кстати, параметры можно менять прямо во время работы резидента. Также можно - заменить косую черту на дефис, а также "развернуть" ключи: - "S3VBEFIX.COM /BOOSTER=+ /MEMORY=8" и "S3VBEFIX.COM -b+ -m8" равнозначны. - Регистр букв значения также не имеет. + Кстати, некоторые параметры можно менять прямо во время работы резидента. + Также можно заменить косую черту на дефис, а также "развернуть" ключи: + "S3VBEFIX.COM /BOOSTER=+ /MEMORY=8" и "S3VBEFIX.COM -b+ -m8" равнозначны. + Регистр букв значения также не имеет. + Ключи /Q и /X раздувают размер TSR в памяти и действуют до его выгрузки. + + 0x5. фейковый VBE 2.0 + + ВНИМАНИЕ: очень экспериментальная фича, для владельцев VBE 1.2 карт типа + Trio64/V+/оригинальной ViRGE, добавляет _частичную_ поддержку VBE 2.0 с LFB + ТОЛЬКО НА СВОЙ СТРАХ И РИСК, если есть возможность - лучше UniVBE/S3VBE20 + + включается так: S3VBEFIX /V200 /L2 /Q + + ключ /Q нужен для Quake и других программ, которые работают с палитрой через + функцию 0x4F09, поскольку в VBE 1.2 она не определена. + Никаких новых VESA-режимов не добавляется (кроме случая с ключом /X, но если + оригинальный BIOS не предоставляет VESA-режимы 320x200 / 320x240, то тогда и + 320x400 / 320x480 не будет и ключ /X оказывается бесполезен). + Кроме того, VBE 2.0-поля в информации об адаптере (0x4F00) остаются пустыми, + некоторым программам такое может не понравиться. + Разумеется, protected mode интерфейс (0x4F0A) также не реализован. 0x5. встроенный int10 api и некоторая инфа по резидентной части @@ -156,7 +221,7 @@ word ptr ES:[BX-2] - флаг inTSR (0x0001, если уже внутри обработчика) dword ptr ES:[BX+9] - указатель на предыдущий обработчик int10 - - если AX и DX не равны воыхдным значениям, то S3VBEFIX не загружен. + - если AX и DX не равны выходным значениям, то S3VBEFIX не загружен. - если возвращенное значение ES:BX не равно значению после int0x21 AX=0x3510 то S3VBEFIX не является последнем в цепочке int10, выгрузка невозможна - можно временно отключить S3VBEFIX, если установить флаг inTSR в 0x0001, но @@ -181,25 +246,32 @@ этого, неизвестно, будет ли работать резидент корректно - в общем, все на свой страх и риск (хотя, насколько я знаю, S3-шек с 64 и более метрами не так и много, мне они не попадались ни разу) + - VBETEST + и всё-таки он иногда глючит :) по ощущениям умудряется обходить S3VBEFIX исправлено: - VBETEST.EXE и ключ /M[x] VBETEST из SciTech Display Doctor может рухнуть при попытке скроллинга вир- туального экрана во время тестов видеорежимов, если использован ключ /M[x]. >>после добавления фикса функции 0x4F06 проблема ушла. + - Chasm: The Rift и Runtime Error 216 после установки режима + >>фикс процедуры переключения банков, там вообще был рассадник багов. Если что-то еще откажется нормально работать либо же поломается по причине моей проги - пишите. 0x7. планы - в TODO.TXT + в TODO.TXT. а вообще, пока всё заморожено и обновляется очень редко :) + возможно, вырежу часть фич в отдельный универсальный резидент, а специфич- + ные для каждого чипа вещи можно сделать в отдельных TSRах. 0x8. исходные коды и авторский булшит исходники доступны в репе на github: https://github.com/wbcbz7/S3VBEFIX 0x9. координаты - mailto:wbc.bz7(at)gmail.com or telegram (at)wbcbz7 or irc.forestnet.org/#z80 + mailto: wbcbz7.at(at)gmail.com + telegram: (at)wbcbz7 + discord: wbcbz7#3519, можно найти на https://discord.io/demoscene vogons.org - wbc, phantom.sannata.ru and other sites - wbcbz7 - можно еще где-нибудь, но тут ищите меня сами :) ...вот и все :) diff --git a/README.TXT b/README.TXT index 7f6c9ee..494e5b0 100644 --- a/README.TXT +++ b/README.TXT @@ -1,8 +1,8 @@ < logo placeholder > - S3VBEFIX - TSR fix for S3 VESA 2.0 BIOS v.0.5.2 - blah-blah copyleft (cl) 2o16 by Artem Vasilev - wbc \\ b-state + S3VBEFIX - TSR fix for S3 VESA 2.0 BIOS v.0.6.0 + blah-blah copyleft (cl) 2o16-2o22 by Artem Vasilev - wbcbz7 . _ _____________________________________________________________________ _ . 0x0. disclaimer @@ -13,56 +13,113 @@ 0x1. what the &^*% it is? well...since 1997 (afaik) S3 cards are distributed with video BIOS version - 2.0 (starting with S3 Trio64V2/ViRGE-DX and later). It fully supports VESA - BIOS Extensions 2.0 with LOTS of videomodes (from 320x200 to 1600x1200!), + 2.0 (starting with S3 Trio64V2, ViRGE/DX and later). It fully supports VESA + BIOS Extensions 2.0 with LOTS of video modes (from 320x200 to 1600x1200!), linear framebuffer support and mostly bug-free interface (as I know about 90% - of apps\games\demos\intros work without issues), although... + of apps/games/demos/intros work without issues), although... ...yep, some bugs are found and I had written this small TSR :) + Now, as 6 years have passed, I decided to gather the feedback and update + the TSR with bugfixes and small neat features. you know :) + 0x2. system requirements - - 100% IBM PC/AT compatible personal computer (blahblah :) with PCI\AGP bus + - 100% IBM PC/AT compatible personal computer (blahblah) with PCI\AGP bus - 80386 processor or higher - - about 1kb of free conventional\UMB memory (S3VBEFIX will use about 800-900 + - about 1kb of free conventional\UMB memory (S3VBEFIX will use 900-1200 bytes of memory depending on number of available VESA modes) - MS-DOS 3.30 or higher - and the most important - GRAPHICS CARD with S3 chipset with video BIOS - version 2.0 or higher (Trio64V+ users - sorry, use UniVBE instead :) - S3 Trio64V2/DX-GX or ViRGE/DX-GX or later chipset is recommended (should - work on Trio3D and later also) + version 2.0 or higher (or 1.2 to use "fake VBE 2.0" feature, see below) + S3 Trio64V2/DX-GX or ViRGE/DX-GX or later chipset is recommended. 0x3. features what S3VBEFIX can do with your card? - primary stream fifo fetch fix - Normally FIFO fetch is used in VESA modes for performance optimizing, but - video BIOS does not disables it when switching back to VGA modes, resulting - in various visual glitches - still can't imagine it? :) + Normally, FIFO fetch is used in VESA modes to optimize memory performance, + however due to bugs in S3 video BIOS, it stays active when switching back + to VGA modes, resulting in various visual glitches. + test example: - run Quake, DO NOT use -stdvid switch, the open console window - switch to VGA 320x200 mode (vid_mode 0) - type vid_describemodes and find a number for VESA(!) 320x240 mode (if you - can't find it then your video BIOS is not VBE 2.0 compatible) + can't find it, then your video BIOS is not VBE 2.0 compatible) - type vid_mode #, where # - number of VESA 320x240 mode - type vid_mode 2 to set 360x200 Mode-X and.... - if you see vertical stripes on right side of screen then you got a bug :) + if you see vertical stripes on right side of screen then you got a bug - quit Quake and look at right side of text screen, sometimes you can notice odd characters and other garbage On Trio3D FIFO fetch is enabled in all modes so Mode-X 360-wide modes will not work properly in any case. - S3VBEFIX disables FIFO fetch in all VGA modes so this bug will never occur. - - new 320x[400/400] 8\15\16\32bpp modes - basically just a 320x200\240 VESA modes with doublescan disabled. useful - for some demos which request these resolutions and doesn't work in others. - - VESA video memory size overriding + S3VBEFIX disables FIFO fetch in all VGA modes so this bug will not occur. + + - VESA 320x400/320x480 modes (8/15/16/24/32bpp, depending on capabilities) + basically just a 320x200/240 VESA modes with doublescan disabled. useful + for some demos which request these resolutions and don't work in others. + Note that this option stays active until TSR release, and increases memory + footprint by 100-200 bytes, depending on VESA mode list length. + + - VESA BIOS Extensions version and video memory size overriding some apps don't like huge amounts of video memory, in this case you can use /M[x] key to set "new" memory size. Note that it is not recommended to set bigger memory size than available on your card. + Likely, you can "downgrade" VBE version to fix quirky apps, or, rather, + "upgrade" it to mimic VBE 2.0 features :) see "fake VBE 2.0" section. + + - Linear Frame Buffer control + some applications may experience issues while using linear frame buffer + (LFB) modes, while working fine with bank switching. in that case, you may + force S3VBEFIX to remove LFB capability from mode info by using /S1 switch + This is basically equivaent to NOLFB by Ken Silverman, but only marks each + VESA mode as banked-only, and does not prevent to set LFB mode. + + You can do the opposite, and force LFB capability for every mode, even + if BIOS does not support it by default. This can be used to implement + so-called "fake-VBE 2.0", when VBE version is overrided to 2.0 or later, + and mode LFB capability is forced. S3VBEFIX automatically initializes + LFB mode in this case if LFB mode is requested. enabled by /S2 switch. + NOTE: this feature is wildly experimental - see "fake VBE 2.0" section. + /S0 - use BIOS default LFB handling. + + - LFB mode set fix + if LFB mode is reuqested, S3VBEFIX first sets the same mode with bank + switching, preserving other mode flags (like clearing screen), then sets + LFB mode without screen clearing (OR 0x8000). Additionally, S3VBEFIX makes + sure that LFB address is correctly set and LFB is enabled on the chip. + This prevents crashes while booster enabled and permits "fake VBE 2.0". + + - VBE Get/Set Palette (0x4F09) and Display Window (0x4F05) custom procedures + standard S3 bank switching routine is incompatible with booster, so it + needs to be reimplemented. + Get/Set Palette override is used for "fake VBE 2.0" feature to make VBE + runtime implementation more compatible with some games like Quake (it + always updates palette via VBE call, even if adapter is VGA compatible), + enabled by /Q switch (active until release!) + + - VESA maximum video page count limit + some applications (Build Engine titles are known examples) seem to not + function properly with double/triple buffering, or misinterpret video + page count field in VESA mode info as signed byte. By default, S3VBEFIX + limits page count to 127, you may override it via /P[x] switch + - "set display start" settings applications can force waiting for vertical retrace by setting a flag (BL=0x80) before calling set display start (AX=0x4F07) function, but some apps don't uses it properly. in this case you can use /S[x] key for forcing flag status. + + - VESA banked modes booster! + YEAH, it works like S3SPDUP but doesn't require S3VBE20 for proper work! + It just enables linear addressing for 0xA0000 window while bank switching + is still enabled (and this mode is documented in datasheets!!!), therefore + it will dramatically increase memory speed. On my P200MMX and Trio64V2/DX + memory write speed was increased from 22 MB/s to incredible 85 MB/s!!! just + like linear modes it will work REALLY fast! + Use /B[+/-] to enable/disable booster. + NOTE: this feature does not work on S3 Savage cards! + + S3 Trio3D/Savage only features: - force RAMDAC CLUT width to 6 bit per channel (Trio3D and later) (NB: CLUT means palette RAM in RAMDAC, or well known ports 0x3C6-0x3C9 :) Older cards (like ViRGE/DX) are able to use only 6 bits per channel (18 bit @@ -70,18 +127,17 @@ switchable to 8 bit per channel (24 bit total) palette mode, thus giving more color shades (256 vs 64) and total colors in palette (16.7m vs 256k). Some games (like Terra Nova) do have support for wide (8 bit per channel) - RAMDAC' CLUT in 8bpp modes but do not work in this mode properly (too dark + RAMDAC' CLUT in 8bpp modes but cannot work in this mode properly (too dark or corrupted colors). In this case use /D6 key to force 18 bit CLUT mode. Set /D0 or /D8 to normal operation. Note that /D8 will NOT enable 24 bit CLUT mode on ViRGE/DX and older cards since it's not supported by hardware! - - VESA banked modes booster! - YEAH, it works like S3SPDUP but doesn't require S3VBE20 for proper work! - It just enables linear addressing for 0xA0000 window while bank switching - is still enabled (and this mode is documented in datasheets!!!), therefore - it will dramatically increase memory speed. On my P200MMX and Trio64V2/DX - memory write speed was increased from 22 MB/s to incredible 85 MB/s!!! just - like linear modes it will work REALLY fast! - Use /B[+/-] to enable\disable booster. + + - Hi/TrueColor (15/16/24/32bpp) gamma correction + VBE 2.0/3.0 permits color gamma ramp to be user defined if RAMDAC supports + it and VBE implementation exposes gamma capability in mode info block. + If this option is enabled, linear gamma ramp is initialized each mode set, + plus you can prepare custom gamma ramp (8 bit per channel) and upload it + just like regular VGA palette - refer to VBE spec for more info. that's all, read TODO.TXT in GitHub repo (in Russian, sorry :) for other info @@ -89,16 +145,26 @@ usage - [LH] S3VBEFIX.COM ... keys are: - - /B[+/-] - enable\disable banked VESA modes booster (disabled by default) - - /D[x] - force RAMDAC CLUT width (/D8 - normal, /D6 - force 6 bit) - /M[x] - override memory size in 64kb units (/M16 - 1 MB, /M0 - by BIOS) + - /P[x] - limit max. video page count (/P1 - max. 1 page, /P0 - default) + - /V[x] - force reported VBE version (/V102 - 1.2, /V200 - 2.0) + - /Q - replace VBE Get/Set Palette (0x4F09) (until release!) + - /X - add 320x400 and 320x480 VESA modes (until release!) + - /L[x] - linear frame buffer control + (/L0 - normal, /L1 - off, /L2 - force on) - /S[x] - 'set display start' mode - (x = 0 - normal, 1 - force wait for retrace, 2 - force no wait) + - (/S0 - normal, /S1 - force wait for retrace, /S2 - force no wait) + - /B[+/-] - enable/disable banked VESA modes booster (not Savage) + - /I - hook INT 6D in addition to INT 10, disables release function! - /R, /U - release from memory DO NOT release S3VBEFIX by using VC or RELEASE, since valid LFB address will not be restored if booster was enabled, resulting in lockups and crashes while switching to LFB mode. + S3 Trio3D/Savage only: + - /D[x] - force RAMDAC CLUT width (/D8 - normal, /D6 - force 6 bit) + - /G[+/-] - enable Hi/TrueColor gamma correction + - LH - load TSR in upper memory (recommended if UMB is available) examples: @@ -106,13 +172,41 @@ set display start function was invoked S3VBEFIX.COM /M32 - set memory size to 2 MB + NOTE: /Q and /X keys increase TSR memory usage and active until release. Once you have installed TSR you can change current settings on the fly by running it again with new parameters in command line. You can replace slash with dash "-", also keys are case-insensitive and can be expanded, for example: "S3VBEFIX.COM /BOOSTER=+ /MEMORY=8" and "S3VBEFIX.COM -b+ -m8" are same. - 0x5. internal int10 api and TSR tech info + 0x5. fake VBE 2.0 + + NOTE: this is a dirty hack allowing to enable partial VBE 2.0 support on + VBE 1.2 capable S3 video BIOSes (primarily, Trio64/V+/original ViRGE). + it seems to work with most applications (Quake, Duke3D, some apps/demos) + but it might fail in more advanced cases. USE AT OWN RISK! + If possible, use UniVBE or S3VBE20 instead :) + + Since S3VBEFIX now supports VBE version override and LFB control, it is + possible to force LFB version to 2.0 or later, and enable LFB capability. + This alone is usually enough to run most LFB applications, but some 256 + color games (like Quake) use VBE Get/Set Palette (0x4F09) function, which + is not present in VBE 1.2. You can install custom 0x4F09 procedure with + /Q switch, but it has to be done during installation. + + To activate fake VBE 2.0 mode, run S3VBEFIX /V200 /L2 /Q + + NOTE: S3VBEFIX does NOT initialize VBE 2.0-specific controller info fields + like adapter name/revision/vendor string pointers, leaving them at + whatever BIOS has returned (usually zeroes, so these pointers are NULL). + Some applications may not like this. Moreover, SciTech Display Doctor's + VBETEST may hang or crash during mode test. + Besides that, no additional VESA modes are added (except for /X switch but + those 320x400 / 320x480 modes are hacked from existing 320x200 / 320x240 + modes, and if BIOS does not provide them, then /X switch is useless). + VBE 2.0 protected mode services (0x4F0A) are also not inplemented. + + 0x6. internal int10 api and TSR tech info pretty simple and silly, mainly used by installation check. input: AX = 0xCE00 @@ -141,11 +235,8 @@ - ..ah, yes, currently S3VBEFIX overlaps PSP a bit, starting at offset CS:0x40 but you can change it in .asm file before compilation, and thus you should NOT assume than TSR is always starts from this offset. - - mode number patch table can destroy VESA mode table during initialization - if number of 320x??? modes are greater than 10 in total (this will never - occur on S3 built-in VESA 2.0 interface but DOSBox can crack it, yessss! :) - 0x6. bugs? + 0x7. bugs? - /M[x] key quirks Do NOT set fake memsize bigger than available memory size, otherwise you can @@ -154,38 +245,37 @@ By the way, owners of >=64 MB videocards - memory size will be displayed incorrectly, and I can't guarantee that S3VBEFIX will work correctly in these cases (but I hope it will :) - + - VBETEST + uses either undocumented API or manages to bypass S3VBEFIX hooks, resulting + in some features like CLUT width or SDS flags being not working properly. fixed bugs: - VBETEST.EXE and /M[x] key VBETEST from SciTech Display Doctor can crash while attempting to scroll a virtual wide\tall screen if /M[x] key is used. >>fixed after adding function 0x4F06 fix + - Chasm: The Rift Runtime Error 216 while VESA mode set + >>fixed bank procedure if you got some more bugs, contact with me - 0x7. plans? - in TODO.TXT + 0x8. plans? + in TODO.TXT. basically this code base is 6 years old, and i perhaps will + stop fiddling with it due to numerous trics and bugs asscciated with it. + perhaps i'll fork some common features like VBE version/memory/max. page + and make a generic TSR to fix common VESA BIOS bugs, leaving chip-specific + stuff on separate TSR. + idk anyway :) - 0x8. source code? + 0x9. source code? in GitHub repository: https://github.com/wbcbz7/S3VBEFIX - 0x9. how to contact me? - mailto:wbc.bz7(at)gmail.com or telegram (at)wbcbz7 or irc.forestnet.org/#z80 + 0xA. how to contact me? + mailto: wbcbz7.at(at)gmail.com + telegram: (at)wbcbz7 + discord: wbcbz7#3519, also i'm active on https://discord.io/demoscene vogons.org - wbc, phantom.sannata.ru and other sites - wbcbz7 - 0xA. greetings - - #z80 irc channnel users - - demoscene pals - well, pretty big list here :) - diver4d, prof4d, nyuk, kowalski, introspec, n1k-o, nodeus, mmcm, scl^mc, - mmcm, psndcj, wbr, blackcat\eracg, xlat, buddy, quiet, grachev, vbi, tsl, - g0blinish, denpopov, dman_pcb, bitl, f0x, manwe and da russian scene! - sensensthal, hellmood, optimus, orby, branch, mikron, demosplash staff, - fsqrt, factor6, yerzmyey, scali, trixter, reengine, phoenix, rrrola - and ofcoz others because we rulez! - - vogoners - keropi, phil, leileilol, gerwin, vetz, elianda, feipoa and all. - - hello world! :) - that's all! :) - p.s. I HATE WRITING READMES! >_< + p.s MAKE FUN, NOT "SPECIAL OPERATIONS", fuck the useless putin's war! diff --git a/release/FILE_ID.DIZ b/release/FILE_ID.DIZ index d91ba76..a80682c 100644 --- a/release/FILE_ID.DIZ +++ b/release/FILE_ID.DIZ @@ -1 +1 @@ -S3VBEFIX - TSR fix for S3 VESA 2.0 BIOS v.0.5.2 \ No newline at end of file +S3VBEFIX - TSR fix for S3 VESA BIOS v.0.6.0 \ No newline at end of file diff --git a/release/README.RUS b/release/README.RUS index 80da567..4dde4b6 100644 --- a/release/README.RUS +++ b/release/README.RUS @@ -1,8 +1,9 @@ +for english readme, please read README.TXT < logo placeholder > - S3VBEFIX - TSR fix for S3 VESA 2.0 BIOS v.0.5.2 - blah-blah copyleft (cl) 2o16 by Artem Vasilev - wbc \\ b-state + S3VBEFIX - TSR fix for S3 VESA 2.0 BIOS v.0.6.0 + blah-blah copyleft (cl) 2o16-2o22 by Artem Vasilev - wbcbz7 . _ _____________________________________________________________________ _ . 0x0. disclaimer @@ -25,20 +26,20 @@ 饬, ⠪  TSR- :) + upd. o2.1o.2o22: ࠫ 筮 䨤, 訫 ᫥ + 0x2. ⥬ ॡ - 100% IBM PC/AT-ᮢ⨬ ᮭ ( 祣 ᮡ) - ( 設 PCI\AGP, 祬) - - ... ॡ 386 - ᯮ짮 32- - ॣ஢ (祬 ⠬, 뫮 ;) - - ... 1 ᢮ (ᠬ ண - 800-900 + - - 80386 + - ... 1 ᢮ (ᠬ ண - 900-1200 ᨬ ⢠ VESA-०). ४ 㧨 UMB! - ⥬... MS-DOS 3.3 ࠡ (஢ 6.22 7.1) - ᠬ - ! 筮 S3 ;), ⥫쭮 ᨥ BIOS 2.0 (஢ 祭 - ᫨ 直 VESA-१⮢ ண 稨 VBE 2.0, ࠧ 㦭 ) - , ᫨ Trio64V+, UniVBE :), - ᫨ 稨 ViRGE/DX, Trio3D Savage4 ( ஢) - ।! + ᫨ Trio64V+, ஡ ० "䥩 VBE 2.0" (. ), + ᫨ 稨 ViRGE/DX, Trio3D Savage - ।! PCI AGP - ࠧ, VLB-⠬ 祣 . 0x3. @@ -56,7 +57,7 @@ - vid_mode #, # - (᫨ , , ᪮॥ ᥣ, c ᨨ 1.x, VESA 2.0 ० ) - ४砥  Mode-X ० ਭ 360 ᥫ (. 360x480) - - ... ⥯ ⥫쭮 ᬮਬ ࠢ ࠩ ࠭. ? :) + - ... ⥯ ⥫쭮 ᬮਬ ࠢ ࠩ ࠭. ? ᫨  ࠢ, . - 室 ᬮਬ ࠢ ࠩ ࠭. ⥯ ⥪⮢ ०  ࠢ (ᮡ ⭮ NC\VC) @@ -66,29 +67,45 @@ S3VBEFIX ⪫砥 primary stream fifo fetch VGA-०, ⥬ ᠬ ஡ ࠭. ᪮ - 㡥 ᠬ :) - - প VESA 320x[400\480] 8\15\16\32bpp ० - \ ( ᭮ replay :), ⠪ + + - প VESA 320x[400\480] 8/15/16/24/32bpp ० + / ( ᭮ replay :), ⠪ ஢ ᯮ짮 ०, 㣨  㬥. - - ८। ꥬ ⠭ + 䨪 - ࠭ + , ० 320x200/240 襭 ⮬ doublescan. + + - ८। ꥬ ⠭ , ᨨ VBE .᫠ ࠭ - ᫨ ਢ ⨭, ᫨誮 讣 - ⢠ 誥, ண . "" ࠧ - 箬 /M[x] ( ஡ - ) + ⢠ 誥 - ਢ ⥪ ᨨ VBE, + ਢ ࠡ⠥ double/triple buffering, ண . + ஬ ⮣, ᯮ짮 "䥩" VBE 2.0, . + + - ன ஢ (LFB) + ॡ ⪫ LFB VESA-० + ন騥 LFB, 祣 ᯮ짮 /S1. /S2, + , 砥 VESA ० ন騥 LFB, ⥫쭮 + 砥, ᫨ BIOS প. + , 䥩 VBE 2.0, . + /S0 - ᯮ짮 ੮ BIOS + + - 䨪 ⠭ LFB-० + ᭠砫 ⠭ banked-० ࠭ 䫠, ⥬ 砥 + ᯥ ⠢ LFB-० ⪨ ࠭ (OR 0x8000) ஢ 䠪 + 樠樨 . ᠭ 祭 ஬, ⠪ + ॠ "䥩" VBE 2.0 (. ) + + - ᮡ⢥ 楤 VBE Get/Set Palette (0x4F09) Display Window (0x4F05) + ⠭ ᬥ 㦨 ஬, ⮬ S3VBEFIX + ᮡ ᮡ⢥ ॠ. 箬 /Q ୠ⨢ + 楤 ⥭/ , 室 "䥩" VBE 2.0 ண + ⨯ Quake, १ VBE-० :) + - ਭ㤨⥫ ன set display start ⭮, 㭪樨 ⠭ 砫쭮 樨 (AX=0x4F07) 䫠 " ⭮ 室 " (BL = 0x80 0x00). ஡ ⮬, ᯮ ४⭮, - 祣 ⨭ 稭 \\ࢠ १ /S[x]. - - ⠭ ࠧ來 RAMDAC (Trio3d ) - S3-誨 (ViRGE/DX ࠭) ন ⮫쪮 6 (18 - ᥣ) ஢ ०. Trio3D ᯮ- - ० 8 (24 ᥣ), ⮣ 襥 ᫮ - 梥⮢ ⥭ (16,7 ⨢ 262144). (⨯ - Terra Nova) த ন ०, ࠡ ਢ (梥 - ᫨誮 ⥬ 祭 䨣), ᥬ 箬 /D6 - - ண ᯮ짮 6 . /D0 /D8 - - ࠧ來 ( ViRGE/DX - - ᯮ, ⠪ 6 㬥 ⭮) + - (᪮⥫) VESA banked ० ᠬ ᭮ :p , ᠬ ᪮⥫ S3SPDUP, ⮫ ⥯ 㦥 㦭 @@ -102,7 +119,27 @@ , ᪮ LFB-० 㤠 - ⠪ ᪮ ஢ Matrox Millennium Tseng ET6000 直 ஢, ⠪ ᫠ VGA-० - ஡ Mode-X. - 砥\⪫砥 ᪮⥫ 箬 /B[+\-] + 砥\⪫砥 ᪮⥫ 箬 /B[+\-]. + : ࠡ⠥ S3 Savage! + + ᫥騥 - ⮫쪮 S3 Trio3D/Savage + - ⠭ ࠧ來 RAMDAC (Trio3d ) + S3-誨 (ViRGE/DX ࠭) ন ⮫쪮 6 (18 + ᥣ) ஢ ०. Trio3D ᯮ- + ० 8 (24 ᥣ), ⮣ 襥 ᫮ + 梥⮢ ⥭ (16,7 ⨢ 262144). (⨯ + Terra Nova) த ন ०, ࠡ ਢ (梥 + ᫨誮 ⥬ 祭 䨣), ᥬ 箬 /D6 - + ண ᯮ짮 6 . /D0 /D8 - + ࠧ來 ( ViRGE/DX - + ᯮ, ⠪ 6 㬥 ⭮) + + - -४ Hi/TrueColor ० + 誠 ( ணࠬ, 㬥 ), + ᪮ 㬥஢ 稭 VBE 2.0, RAMDAC Trio3D/Savage + ন -४, 祬 ? + 㬮砭 ࠨ (00..FF), ᮡ⢥ ਢ (8 + ) 㦠 筮 256-梥 ०. , , ⥪騩 , ᫨ 㧭 , TODO.TXT ( ᠭ ⠪ ⨫, 稭 :)) @@ -111,23 +148,33 @@ ᪠ 筮 - [LH] S3VBEFIX.COM <ࠬ> <ࠬ>... <ࠬ>: - - /B[+\-] - \⪫ VESA banked ० - 㬮砭 ᪮⥫ ⪫祭. - - /D[x] - ० ࠡ RAMDAC (/D6 - ᥣ ᯮ짮 6 - , /D0 /D8 - ࠧ ४祭 ࠧ來 RAMDAC) - /M[x] - ८। ꥬ (x - ꥬ 64 , /M16 - 1 , /M0 - 㬮砭) - , 譨 誥 :), ⠬ - ᮮ頥 㣮 ꥬ ⠭ . - - /S[x] - ன ࠡ 䫠 " ३" set display start + - /P[x] - ࠭ . ᫮ ࠭ (x - ।, x = 0 - + 㬮砭 - 127 ࠭) + - /V[x] - 頥 VBE (/V102 - 1.2, /V200 - 2.0) + - /Q - 楤 ⥭/ (0x4F09) ( 㧪!) + - /X - VESA-० 320x400 and 320x480 ( 㧪!) + - /L - ࠢ LFB: + x = 0 - 㬮砭, x = 1 - 몫 + x = 2 - ᬮ ( 䥩 VBE 2.0) + - /S[x] - ன ࠡ 䫠 " ३" set display start: x = 0 - 䫠 ࠢ ਫ x = 1 - ᥣ ३, ᫨ 䫠 ⠭ x = 2 - ३, ᫨ 䫠 ⠭ + - /B[+\-] - \⪫ VESA banked ० (஬ Savage) + 㬮砭 ᪮⥫ ⪫祭. + - /I - ⥫쭮 墠뢠 INT 6D, ⪫砥 㧪! - /U, /R - 㧨 १ . ४ 㦠 ண ⨬ 箬, ( RELEASE VC), 祭 㤥 ⠭ LFB , १ 設 ⠭ LFB-०. - + + S3 Trio3D/Savage only: + - /D[x] - ० ࠡ RAMDAC (/D6 - ᥣ ᯮ짮 6 + , /D0 /D8 - ࠧ ४祭 ࠧ來 RAMDAC) + - /G[+/-] - /⪫ -४ Hi/TrueColor + - LH - 㧨 S3VBEFIX (४ 稨) ਬ: @@ -135,10 +182,28 @@ ஢ 䫠 " ३) S3VBEFIX.COM /M32 - ⠭ ꥬ 2 - , ࠬ אַ ६ ࠡ १. - , ⠪ "ࠧ" : - "S3VBEFIX.COM /BOOSTER=+ /MEMORY=8" "S3VBEFIX.COM -b+ -m8" ࠢ. - 㪢 祭 ⠪ . + , ࠬ אַ ६ ࠡ १. + , ⠪ "ࠧ" : + "S3VBEFIX.COM /BOOSTER=+ /MEMORY=8" "S3VBEFIX.COM -b+ -m8" ࠢ. + 㪢 祭 ⠪ . + /Q /X ࠧ㢠 ࠧ TSR 㧪. + + 0x5. 䥩 VBE 2.0 + + : 祭 ᯥਬ⠫쭠 , 楢 VBE 1.2 ⨯ + Trio64/V+/ਣ쭮 ViRGE, __ প VBE 2.0 LFB + , ᫨ - UniVBE/S3VBE20 + + 砥 ⠪: S3VBEFIX /V200 /L2 /Q + + /Q 㦥 Quake 㣨 ணࠬ, ࠡ ன १ + 㭪 0x4F09, ᪮ VBE 1.2 ।. + VESA-० (஬ 箬 /X, ᫨ + ਣ BIOS ।⠢ VESA-० 320x200 / 320x240, ⮣ + 320x400 / 320x480 㤥 /X 뢠 ᯮ). + ஬ ⮣, VBE 2.0- ଠ樨 (0x4F00) 묨, + ணࠬ ⠪ ࠢ. + 㬥, protected mode 䥩 (0x4F0A) ⠪ ॠ. 0x5. ஥ int10 api १⭮ @@ -156,7 +221,7 @@ word ptr ES:[BX-2] - 䫠 inTSR (0x0001, ᫨ 㦥 ࠡ稪) dword ptr ES:[BX+9] - 㪠⥫ ।騩 ࠡ稪 int10 - - ᫨ AX DX ࠢ 夭 祭, S3VBEFIX 㦥. + - ᫨ AX DX ࠢ 室 祭, S3VBEFIX 㦥. - ᫨ 饭 祭 ES:BX ࠢ 祭 ᫥ int0x21 AX=0x3510 S3VBEFIX  ᫥ 楯窥 int10, 㧪 - ६ ⪫ S3VBEFIX, ᫨ ⠭ 䫠 inTSR 0x0001, @@ -181,25 +246,32 @@ ⮣, ⭮, 㤥 ࠡ १ ४⭮ - 饬, ᢮ (, ᪮쪮 , S3-襪 64 ࠬ ⠪ , ࠧ) + - VBETEST + -⠪ :) 饭 室 S3VBEFIX ࠢ: - VBETEST.EXE /M[x] VBETEST SciTech Display Doctor ⪥ ஫ - 㠫쭮 ࠭ ६ ⮢ ०, ᫨ ᯮ짮 /M[x]. >>᫥ 䨪 㭪樨 0x4F06 ஡ 諠. + - Chasm: The Rift Runtime Error 216 ᫥ ⠭ ० + >>䨪 楤 ४祭 , ⠬ ᠤ . ᫨ - ⪠ ଠ쭮 ࠡ 稭 ண - . 0x7. - TODO.TXT + TODO.TXT. , ஦ 祭 । :) + , ० ⤥ 㭨ᠫ १, ᯥ- + 稯 ᤥ ⤥ TSR. 0x8. 室 ᪨ 室 㯭 ९ github: https://github.com/wbcbz7/S3VBEFIX 0x9. न - mailto:wbc.bz7(at)gmail.com or telegram (at)wbcbz7 or irc.forestnet.org/#z80 + mailto: wbcbz7.at(at)gmail.com + telegram: (at)wbcbz7 + discord: wbcbz7#3519, https://discord.io/demoscene vogons.org - wbc, phantom.sannata.ru and other sites - wbcbz7 - -, ᠬ :) ... :) diff --git a/release/README.TXT b/release/README.TXT index 7f6c9ee..494e5b0 100644 --- a/release/README.TXT +++ b/release/README.TXT @@ -1,8 +1,8 @@ < logo placeholder > - S3VBEFIX - TSR fix for S3 VESA 2.0 BIOS v.0.5.2 - blah-blah copyleft (cl) 2o16 by Artem Vasilev - wbc \\ b-state + S3VBEFIX - TSR fix for S3 VESA 2.0 BIOS v.0.6.0 + blah-blah copyleft (cl) 2o16-2o22 by Artem Vasilev - wbcbz7 . _ _____________________________________________________________________ _ . 0x0. disclaimer @@ -13,56 +13,113 @@ 0x1. what the &^*% it is? well...since 1997 (afaik) S3 cards are distributed with video BIOS version - 2.0 (starting with S3 Trio64V2/ViRGE-DX and later). It fully supports VESA - BIOS Extensions 2.0 with LOTS of videomodes (from 320x200 to 1600x1200!), + 2.0 (starting with S3 Trio64V2, ViRGE/DX and later). It fully supports VESA + BIOS Extensions 2.0 with LOTS of video modes (from 320x200 to 1600x1200!), linear framebuffer support and mostly bug-free interface (as I know about 90% - of apps\games\demos\intros work without issues), although... + of apps/games/demos/intros work without issues), although... ...yep, some bugs are found and I had written this small TSR :) + Now, as 6 years have passed, I decided to gather the feedback and update + the TSR with bugfixes and small neat features. you know :) + 0x2. system requirements - - 100% IBM PC/AT compatible personal computer (blahblah :) with PCI\AGP bus + - 100% IBM PC/AT compatible personal computer (blahblah) with PCI\AGP bus - 80386 processor or higher - - about 1kb of free conventional\UMB memory (S3VBEFIX will use about 800-900 + - about 1kb of free conventional\UMB memory (S3VBEFIX will use 900-1200 bytes of memory depending on number of available VESA modes) - MS-DOS 3.30 or higher - and the most important - GRAPHICS CARD with S3 chipset with video BIOS - version 2.0 or higher (Trio64V+ users - sorry, use UniVBE instead :) - S3 Trio64V2/DX-GX or ViRGE/DX-GX or later chipset is recommended (should - work on Trio3D and later also) + version 2.0 or higher (or 1.2 to use "fake VBE 2.0" feature, see below) + S3 Trio64V2/DX-GX or ViRGE/DX-GX or later chipset is recommended. 0x3. features what S3VBEFIX can do with your card? - primary stream fifo fetch fix - Normally FIFO fetch is used in VESA modes for performance optimizing, but - video BIOS does not disables it when switching back to VGA modes, resulting - in various visual glitches - still can't imagine it? :) + Normally, FIFO fetch is used in VESA modes to optimize memory performance, + however due to bugs in S3 video BIOS, it stays active when switching back + to VGA modes, resulting in various visual glitches. + test example: - run Quake, DO NOT use -stdvid switch, the open console window - switch to VGA 320x200 mode (vid_mode 0) - type vid_describemodes and find a number for VESA(!) 320x240 mode (if you - can't find it then your video BIOS is not VBE 2.0 compatible) + can't find it, then your video BIOS is not VBE 2.0 compatible) - type vid_mode #, where # - number of VESA 320x240 mode - type vid_mode 2 to set 360x200 Mode-X and.... - if you see vertical stripes on right side of screen then you got a bug :) + if you see vertical stripes on right side of screen then you got a bug - quit Quake and look at right side of text screen, sometimes you can notice odd characters and other garbage On Trio3D FIFO fetch is enabled in all modes so Mode-X 360-wide modes will not work properly in any case. - S3VBEFIX disables FIFO fetch in all VGA modes so this bug will never occur. - - new 320x[400/400] 8\15\16\32bpp modes - basically just a 320x200\240 VESA modes with doublescan disabled. useful - for some demos which request these resolutions and doesn't work in others. - - VESA video memory size overriding + S3VBEFIX disables FIFO fetch in all VGA modes so this bug will not occur. + + - VESA 320x400/320x480 modes (8/15/16/24/32bpp, depending on capabilities) + basically just a 320x200/240 VESA modes with doublescan disabled. useful + for some demos which request these resolutions and don't work in others. + Note that this option stays active until TSR release, and increases memory + footprint by 100-200 bytes, depending on VESA mode list length. + + - VESA BIOS Extensions version and video memory size overriding some apps don't like huge amounts of video memory, in this case you can use /M[x] key to set "new" memory size. Note that it is not recommended to set bigger memory size than available on your card. + Likely, you can "downgrade" VBE version to fix quirky apps, or, rather, + "upgrade" it to mimic VBE 2.0 features :) see "fake VBE 2.0" section. + + - Linear Frame Buffer control + some applications may experience issues while using linear frame buffer + (LFB) modes, while working fine with bank switching. in that case, you may + force S3VBEFIX to remove LFB capability from mode info by using /S1 switch + This is basically equivaent to NOLFB by Ken Silverman, but only marks each + VESA mode as banked-only, and does not prevent to set LFB mode. + + You can do the opposite, and force LFB capability for every mode, even + if BIOS does not support it by default. This can be used to implement + so-called "fake-VBE 2.0", when VBE version is overrided to 2.0 or later, + and mode LFB capability is forced. S3VBEFIX automatically initializes + LFB mode in this case if LFB mode is requested. enabled by /S2 switch. + NOTE: this feature is wildly experimental - see "fake VBE 2.0" section. + /S0 - use BIOS default LFB handling. + + - LFB mode set fix + if LFB mode is reuqested, S3VBEFIX first sets the same mode with bank + switching, preserving other mode flags (like clearing screen), then sets + LFB mode without screen clearing (OR 0x8000). Additionally, S3VBEFIX makes + sure that LFB address is correctly set and LFB is enabled on the chip. + This prevents crashes while booster enabled and permits "fake VBE 2.0". + + - VBE Get/Set Palette (0x4F09) and Display Window (0x4F05) custom procedures + standard S3 bank switching routine is incompatible with booster, so it + needs to be reimplemented. + Get/Set Palette override is used for "fake VBE 2.0" feature to make VBE + runtime implementation more compatible with some games like Quake (it + always updates palette via VBE call, even if adapter is VGA compatible), + enabled by /Q switch (active until release!) + + - VESA maximum video page count limit + some applications (Build Engine titles are known examples) seem to not + function properly with double/triple buffering, or misinterpret video + page count field in VESA mode info as signed byte. By default, S3VBEFIX + limits page count to 127, you may override it via /P[x] switch + - "set display start" settings applications can force waiting for vertical retrace by setting a flag (BL=0x80) before calling set display start (AX=0x4F07) function, but some apps don't uses it properly. in this case you can use /S[x] key for forcing flag status. + + - VESA banked modes booster! + YEAH, it works like S3SPDUP but doesn't require S3VBE20 for proper work! + It just enables linear addressing for 0xA0000 window while bank switching + is still enabled (and this mode is documented in datasheets!!!), therefore + it will dramatically increase memory speed. On my P200MMX and Trio64V2/DX + memory write speed was increased from 22 MB/s to incredible 85 MB/s!!! just + like linear modes it will work REALLY fast! + Use /B[+/-] to enable/disable booster. + NOTE: this feature does not work on S3 Savage cards! + + S3 Trio3D/Savage only features: - force RAMDAC CLUT width to 6 bit per channel (Trio3D and later) (NB: CLUT means palette RAM in RAMDAC, or well known ports 0x3C6-0x3C9 :) Older cards (like ViRGE/DX) are able to use only 6 bits per channel (18 bit @@ -70,18 +127,17 @@ switchable to 8 bit per channel (24 bit total) palette mode, thus giving more color shades (256 vs 64) and total colors in palette (16.7m vs 256k). Some games (like Terra Nova) do have support for wide (8 bit per channel) - RAMDAC' CLUT in 8bpp modes but do not work in this mode properly (too dark + RAMDAC' CLUT in 8bpp modes but cannot work in this mode properly (too dark or corrupted colors). In this case use /D6 key to force 18 bit CLUT mode. Set /D0 or /D8 to normal operation. Note that /D8 will NOT enable 24 bit CLUT mode on ViRGE/DX and older cards since it's not supported by hardware! - - VESA banked modes booster! - YEAH, it works like S3SPDUP but doesn't require S3VBE20 for proper work! - It just enables linear addressing for 0xA0000 window while bank switching - is still enabled (and this mode is documented in datasheets!!!), therefore - it will dramatically increase memory speed. On my P200MMX and Trio64V2/DX - memory write speed was increased from 22 MB/s to incredible 85 MB/s!!! just - like linear modes it will work REALLY fast! - Use /B[+/-] to enable\disable booster. + + - Hi/TrueColor (15/16/24/32bpp) gamma correction + VBE 2.0/3.0 permits color gamma ramp to be user defined if RAMDAC supports + it and VBE implementation exposes gamma capability in mode info block. + If this option is enabled, linear gamma ramp is initialized each mode set, + plus you can prepare custom gamma ramp (8 bit per channel) and upload it + just like regular VGA palette - refer to VBE spec for more info. that's all, read TODO.TXT in GitHub repo (in Russian, sorry :) for other info @@ -89,16 +145,26 @@ usage - [LH] S3VBEFIX.COM ... keys are: - - /B[+/-] - enable\disable banked VESA modes booster (disabled by default) - - /D[x] - force RAMDAC CLUT width (/D8 - normal, /D6 - force 6 bit) - /M[x] - override memory size in 64kb units (/M16 - 1 MB, /M0 - by BIOS) + - /P[x] - limit max. video page count (/P1 - max. 1 page, /P0 - default) + - /V[x] - force reported VBE version (/V102 - 1.2, /V200 - 2.0) + - /Q - replace VBE Get/Set Palette (0x4F09) (until release!) + - /X - add 320x400 and 320x480 VESA modes (until release!) + - /L[x] - linear frame buffer control + (/L0 - normal, /L1 - off, /L2 - force on) - /S[x] - 'set display start' mode - (x = 0 - normal, 1 - force wait for retrace, 2 - force no wait) + - (/S0 - normal, /S1 - force wait for retrace, /S2 - force no wait) + - /B[+/-] - enable/disable banked VESA modes booster (not Savage) + - /I - hook INT 6D in addition to INT 10, disables release function! - /R, /U - release from memory DO NOT release S3VBEFIX by using VC or RELEASE, since valid LFB address will not be restored if booster was enabled, resulting in lockups and crashes while switching to LFB mode. + S3 Trio3D/Savage only: + - /D[x] - force RAMDAC CLUT width (/D8 - normal, /D6 - force 6 bit) + - /G[+/-] - enable Hi/TrueColor gamma correction + - LH - load TSR in upper memory (recommended if UMB is available) examples: @@ -106,13 +172,41 @@ set display start function was invoked S3VBEFIX.COM /M32 - set memory size to 2 MB + NOTE: /Q and /X keys increase TSR memory usage and active until release. Once you have installed TSR you can change current settings on the fly by running it again with new parameters in command line. You can replace slash with dash "-", also keys are case-insensitive and can be expanded, for example: "S3VBEFIX.COM /BOOSTER=+ /MEMORY=8" and "S3VBEFIX.COM -b+ -m8" are same. - 0x5. internal int10 api and TSR tech info + 0x5. fake VBE 2.0 + + NOTE: this is a dirty hack allowing to enable partial VBE 2.0 support on + VBE 1.2 capable S3 video BIOSes (primarily, Trio64/V+/original ViRGE). + it seems to work with most applications (Quake, Duke3D, some apps/demos) + but it might fail in more advanced cases. USE AT OWN RISK! + If possible, use UniVBE or S3VBE20 instead :) + + Since S3VBEFIX now supports VBE version override and LFB control, it is + possible to force LFB version to 2.0 or later, and enable LFB capability. + This alone is usually enough to run most LFB applications, but some 256 + color games (like Quake) use VBE Get/Set Palette (0x4F09) function, which + is not present in VBE 1.2. You can install custom 0x4F09 procedure with + /Q switch, but it has to be done during installation. + + To activate fake VBE 2.0 mode, run S3VBEFIX /V200 /L2 /Q + + NOTE: S3VBEFIX does NOT initialize VBE 2.0-specific controller info fields + like adapter name/revision/vendor string pointers, leaving them at + whatever BIOS has returned (usually zeroes, so these pointers are NULL). + Some applications may not like this. Moreover, SciTech Display Doctor's + VBETEST may hang or crash during mode test. + Besides that, no additional VESA modes are added (except for /X switch but + those 320x400 / 320x480 modes are hacked from existing 320x200 / 320x240 + modes, and if BIOS does not provide them, then /X switch is useless). + VBE 2.0 protected mode services (0x4F0A) are also not inplemented. + + 0x6. internal int10 api and TSR tech info pretty simple and silly, mainly used by installation check. input: AX = 0xCE00 @@ -141,11 +235,8 @@ - ..ah, yes, currently S3VBEFIX overlaps PSP a bit, starting at offset CS:0x40 but you can change it in .asm file before compilation, and thus you should NOT assume than TSR is always starts from this offset. - - mode number patch table can destroy VESA mode table during initialization - if number of 320x??? modes are greater than 10 in total (this will never - occur on S3 built-in VESA 2.0 interface but DOSBox can crack it, yessss! :) - 0x6. bugs? + 0x7. bugs? - /M[x] key quirks Do NOT set fake memsize bigger than available memory size, otherwise you can @@ -154,38 +245,37 @@ By the way, owners of >=64 MB videocards - memory size will be displayed incorrectly, and I can't guarantee that S3VBEFIX will work correctly in these cases (but I hope it will :) - + - VBETEST + uses either undocumented API or manages to bypass S3VBEFIX hooks, resulting + in some features like CLUT width or SDS flags being not working properly. fixed bugs: - VBETEST.EXE and /M[x] key VBETEST from SciTech Display Doctor can crash while attempting to scroll a virtual wide\tall screen if /M[x] key is used. >>fixed after adding function 0x4F06 fix + - Chasm: The Rift Runtime Error 216 while VESA mode set + >>fixed bank procedure if you got some more bugs, contact with me - 0x7. plans? - in TODO.TXT + 0x8. plans? + in TODO.TXT. basically this code base is 6 years old, and i perhaps will + stop fiddling with it due to numerous trics and bugs asscciated with it. + perhaps i'll fork some common features like VBE version/memory/max. page + and make a generic TSR to fix common VESA BIOS bugs, leaving chip-specific + stuff on separate TSR. + idk anyway :) - 0x8. source code? + 0x9. source code? in GitHub repository: https://github.com/wbcbz7/S3VBEFIX - 0x9. how to contact me? - mailto:wbc.bz7(at)gmail.com or telegram (at)wbcbz7 or irc.forestnet.org/#z80 + 0xA. how to contact me? + mailto: wbcbz7.at(at)gmail.com + telegram: (at)wbcbz7 + discord: wbcbz7#3519, also i'm active on https://discord.io/demoscene vogons.org - wbc, phantom.sannata.ru and other sites - wbcbz7 - 0xA. greetings - - #z80 irc channnel users - - demoscene pals - well, pretty big list here :) - diver4d, prof4d, nyuk, kowalski, introspec, n1k-o, nodeus, mmcm, scl^mc, - mmcm, psndcj, wbr, blackcat\eracg, xlat, buddy, quiet, grachev, vbi, tsl, - g0blinish, denpopov, dman_pcb, bitl, f0x, manwe and da russian scene! - sensensthal, hellmood, optimus, orby, branch, mikron, demosplash staff, - fsqrt, factor6, yerzmyey, scali, trixter, reengine, phoenix, rrrola - and ofcoz others because we rulez! - - vogoners - keropi, phil, leileilol, gerwin, vetz, elianda, feipoa and all. - - hello world! :) - that's all! :) - p.s. I HATE WRITING READMES! >_< + p.s MAKE FUN, NOT "SPECIAL OPERATIONS", fuck the useless putin's war! diff --git a/release/S3VBEFIX.COM b/release/S3VBEFIX.COM index 9bf3d80..1b79269 100644 Binary files a/release/S3VBEFIX.COM and b/release/S3VBEFIX.COM differ diff --git a/release/S3VBEFIX.ZIP b/release/S3VBEFIX.ZIP index 6396d3e..8e9c23a 100644 Binary files a/release/S3VBEFIX.ZIP and b/release/S3VBEFIX.ZIP differ diff --git a/src/S3VBEFIX.ASM b/src/S3VBEFIX.ASM index b77d1dc..c916716 100644 --- a/src/S3VBEFIX.ASM +++ b/src/S3VBEFIX.ASM @@ -190,6 +190,7 @@ int10seg dw ? call patch_mode mov [patchedmode], bx xchg bx, cx + and cx, 0x3FF ; strip mode flags .f2: cmp al, 0x2 ; Function 02h - Set VBE Mode @@ -228,7 +229,7 @@ sds_or = $-1 sds_and = $-1 @f9: - cmp al, 0x9 ; Function 09h - Set/Get Palette ; 0x3C 0x09 + cmp al, 0x9 ; Function 09h - Set/Get Palette f9_jmp: ; 0xEB -> 0x75 - enable pal procedure jmp @invoke jmp palproc @@ -274,6 +275,8 @@ patchedmode dw ? jz patch_modeinfo cmp al, 0x2 ; Function 02h - Set VBE Mode jz patch_modeset + cmp al, 0x3 ; Function 03h - Return Current VBE Mode + jz patch_modeget cmp al, 0x6 ; Function 06h - Set/Get Logical Scan Line Length jz patch_setscanlinelen @@ -598,6 +601,14 @@ gamma_en_skip: call lock_extensions jmp done_iret + ; ---------------------------------- + ; VESA function 0x3 patch +patch_modeget: + mov bx, [ss:bp + 6] + call patch_mode + mov [ss:bp + 6], bx + jmp done_iret + ; ---------------------------------- ; VESA function 0x5 new routine bankproc: @@ -669,7 +680,7 @@ patch_setscanlinelen: jmp done_iret ; ---------------------------------- -; replace current VESA mode number with other (used for mode info block patching) +; replace current VESA mode number with other (used for mode info block patching), preserve mode flags ; input: BX - VESA mode number; DS:SI - address of replacement table ; output: BX - patched mode number; SI destroyed patch_mode: @@ -1741,7 +1752,7 @@ get_hwinfo: in al, dx dec dx cmp al, ah - ;jz .not_inst ; comment for DOSbox hack here! + jz .not_inst ; comment for DOSbox hack here! or [hw_flag], 1 ; check for crtc regs decoding diff --git a/src/s3vbefix.com b/src/s3vbefix.com index 9bf3d80..1b79269 100644 Binary files a/src/s3vbefix.com and b/src/s3vbefix.com differ