Skip to content

Commit c8d73e1

Browse files
committed
VESA driver / installer fixes / new release
1 parent e5b139a commit c8d73e1

13 files changed

Lines changed: 440 additions & 166 deletions

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ ifdef DEBUG
1010
CFLAGS=-std=c99 -Wall -Wextra -g -O0 -march=pentium2 -fdata-sections -ffunction-sections
1111
else
1212
LIBS=-lgdi32 -luser32 -ladvapi32 -lkernel32 -lshell32 -lversion -Wl,-subsystem,windows
13-
CFLAGS=-std=c99 -Wall -Wextra -Os -march=pentium2 -fdata-sections -ffunction-sections
13+
CFLAGS=-std=c99 -Wall -Wextra -Os -march=i486 -fdata-sections -ffunction-sections
1414
endif
1515

1616
SOFTGPU_PATCH=2025

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@ This is ready-to-use compilation of my 6 projects:
1111
- ICD enabled fork of qemu-3dfx: https://github.com/JHRobotics/qemu-3dfx
1212

1313
## Requirements
14-
1) Virtual machine with one of these VGA adapter support:
15-
- A) Bochs VBE (Bochs, VirtualBox, Qemu)
16-
- B) VMware SVGA-II (VMware, VirtualBox, Qemu)
17-
2) Windows 95/98/Me as VM guest system
14+
1) Machine with one of these VGA adapter support:
15+
- A) Virtual machine supporting Bochs VBE (Bochs, VirtualBox, Qemu)
16+
- B) Virtual machine supporting VMware SVGA-II (VMware, VirtualBox, Qemu)
17+
- C) Real or virtual machine with video adapter supporting VESA VBE 2.0 at minimum
18+
2) Windows 95/98/Me as VM guest system (or main system at bare metal):
1819
- A) Windows 98/Me - required is last version of DirectX 9 (included in package)
1920
- B) Windows 95
2021
- Last version of DirectX 8 (included in package)
@@ -37,7 +38,8 @@ This is ready-to-use compilation of my 6 projects:
3738
| VMware Workstation | 16, 17 | - |||||| speaker, SBPCI128 |
3839
| QEMU | 7.x, 8.0 | std |||||| speaker, adlib, GUS, SB16, WSS, AC97, SBPCI128 |
3940
| QEMU | 7.x, 8.0 | vmware |||||| speaker, adlib, GUS, SB16, WSS, AC97, SBPCI128 |
40-
| QEMU | 7.x, 8.0 | std + qemu-3dfx |||||| speaker, adlib, GUS, SB16, WSS, AC97, SBPCI128 |
41+
| QEMU | 7.x, 8.0 | std + qemu-3dfx |||||| speaker, adlib, GUS, SB16, WSS, AC97, SBPCI128 |
42+
| _Real Hardware_ | - | VESA 2.0/3.0 |||||| _depends on configuration_ |
4143

4244
SoftGPU can use 4 render drivers:
4345
- *softpipe*: software Mesa3D reference renderer

actions.c

Lines changed: 97 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,7 @@ BOOL setLineSvga(char *buf, size_t bufs, size_t fpos)
776776
strcpy(buf, "CopyFiles=VMSvga.Copy");
777777
if(isSettingSet(CHBX_WINE))
778778
{
779-
strcat(buf, ",Dx.Copy,DX.CopyBackup");
779+
strcat(buf, ",Dx.Copy");
780780
}
781781

782782
if(isSettingSet(CHBX_GLIDE))
@@ -795,7 +795,7 @@ BOOL setLineVbox(char *buf, size_t bufs, size_t fpos)
795795
strcpy(buf, "CopyFiles=VBox.Copy");
796796
if(isSettingSet(CHBX_WINE))
797797
{
798-
strcat(buf, ",Dx.Copy,DX.CopyBackup");
798+
strcat(buf, ",Dx.Copy");
799799
}
800800

801801
if(isSettingSet(CHBX_GLIDE))
@@ -814,7 +814,26 @@ BOOL setLineQemu(char *buf, size_t bufs, size_t fpos)
814814
strcpy(buf, "CopyFiles=Qemu.Copy");
815815
if(isSettingSet(CHBX_WINE))
816816
{
817-
strcat(buf, ",Dx.Copy,DX.CopyBackup");
817+
strcat(buf, ",Dx.Copy");
818+
}
819+
820+
if(isSettingSet(CHBX_GLIDE))
821+
{
822+
strcat(buf, ",Voodoo.Copy");
823+
}
824+
825+
return TRUE;
826+
}
827+
828+
BOOL setLineVesa(char *buf, size_t bufs, size_t fpos)
829+
{
830+
(void)bufs;
831+
(void)fpos;
832+
833+
strcpy(buf, "CopyFiles=VESA.Copy");
834+
if(isSettingSet(CHBX_WINE))
835+
{
836+
strcat(buf, ",Dx.Copy");
818837
}
819838

820839
if(isSettingSet(CHBX_GLIDE))
@@ -897,6 +916,43 @@ BOOL setLineQemuReg(char *buf, size_t bufs, size_t fpos)
897916
return TRUE;
898917
}
899918

919+
BOOL setLineVesaReg(char *buf, size_t bufs, size_t fpos)
920+
{
921+
(void)bufs;
922+
(void)fpos;
923+
924+
strcpy(buf, "AddReg=VESA.AddReg,VM.AddReg,DX.addReg");
925+
926+
if(isSettingSet(CHBX_QXGA))
927+
strcat(buf, ",VM.QXGA");
928+
929+
if(isSettingSet(CHBX_1440))
930+
strcat(buf, ",VM.WQHD");
931+
932+
if(isSettingSet(CHBX_4K))
933+
strcat(buf, ",VM.UHD");
934+
935+
if(isSettingSet(CHBX_5K))
936+
strcat(buf, ",VM.R5K");
937+
938+
strcat(buf, ",VM.regextra");
939+
940+
return TRUE;
941+
}
942+
943+
BOOL setDeletes(char *buf, size_t bufs, size_t fpos)
944+
{
945+
(void)bufs;
946+
(void)fpos;
947+
948+
if(isSettingSet(CHBX_FIXES))
949+
{
950+
strcat(buf, ",VM.DelRegEx");
951+
}
952+
953+
return TRUE;
954+
}
955+
900956
BOOL setLineMeFix(char *buf, size_t bufs, size_t fpos)
901957
{
902958
(void)bufs;
@@ -1042,10 +1098,10 @@ BOOL setLineSwitcher(char *buf, size_t bufs, size_t fpos)
10421098
(void)bufs;
10431099
(void)fpos;
10441100

1045-
BOOL all_on_hal = isSettingSet(RAD_DD_HAL) && isSettingSet(RAD_D8_HAL) && isSettingSet(RAD_D9_HAL);
1101+
//BOOL all_on_hal = isSettingSet(RAD_DD_HAL) && isSettingSet(RAD_D8_HAL) && isSettingSet(RAD_D9_HAL);
10461102

1047-
if(!all_on_hal)
1048-
{
1103+
//if(!all_on_hal)
1104+
//{
10491105
int line_start = sizeof(";switcher:")-1;
10501106
int line_len = strlen(buf);
10511107
int i;
@@ -1054,7 +1110,7 @@ BOOL setLineSwitcher(char *buf, size_t bufs, size_t fpos)
10541110
{
10551111
buf[i] = buf[i + line_start];
10561112
}
1057-
}
1113+
//}
10581114

10591115
return TRUE;
10601116
}
@@ -1077,28 +1133,21 @@ BOOL setMesaAlternate(char *buf, size_t bufs, size_t fpos)
10771133
return TRUE;
10781134
}
10791135

1080-
static size_t del_section_pos = 0;
1081-
1082-
BOOL saveDelPos(char *buf, size_t bufs, size_t fpos)
1083-
{
1084-
(void)bufs;
1085-
(void)buf;
1086-
del_section_pos = fpos;
1087-
1088-
return TRUE;
1089-
}
1090-
10911136
linerRule_t infFixRules[] = {
1092-
{"CopyFiles=VBox.Copy,Dx.Copy,DX.CopyBackup,Voodoo.Copy", TRUE, TRUE, setLineVbox},
1093-
{"CopyFiles=VMSvga.Copy,Dx.Copy,DX.CopyBackup,Voodoo.Copy", TRUE, TRUE, setLineSvga},
1094-
{"CopyFiles=Qemu.Copy,Dx.Copy,DX.CopyBackup,Voodoo.Copy", TRUE, TRUE, setLineQemu},
1137+
{"CopyFiles=VBox.Copy,Dx.Copy,Voodoo.Copy", TRUE, TRUE, setLineVbox},
1138+
{"CopyFiles=VMSvga.Copy,Dx.Copy,Voodoo.Copy", TRUE, TRUE, setLineSvga},
1139+
{"CopyFiles=Qemu.Copy,Dx.Copy,Voodoo.Copy", TRUE, TRUE, setLineQemu},
1140+
{"CopyFiles=VESA.Copy,Dx.Copy,Voodoo.Copy", TRUE, TRUE, setLineVesa},
10951141
{"AddReg=VBox.AddReg,VM.AddReg,DX.addReg,VM.regextra", TRUE, TRUE, setLineVboxReg},
10961142
{"AddReg=VMSvga.AddReg,VM.AddReg,DX.addReg,VM.regextra", TRUE, TRUE, setLineSvgaReg},
10971143
{"AddReg=Qemu.AddReg,VM.AddReg,DX.addReg,VM.regextra", TRUE, TRUE, setLineQemuReg},
1144+
{"AddReg=VESA.AddReg,VM.AddReg,DX.addReg,VM.regextra", TRUE, TRUE, setLineVesaReg},
1145+
{"DelReg=VM.DelReg", TRUE, TRUE, setDeletes},
10981146
{"HKLM,Software\\vmdisp9x\\svga,RGB565bug,,0", TRUE, TRUE, setBug565},
10991147
{"HKLM,Software\\vmdisp9x\\svga,PreferFIFO,,1", TRUE, TRUE, setBugPreferFifo},
11001148
{"HKLM,Software\\vmdisp9x\\apps\\global\\mesa,SVGA_CLEAR_DX_FLAGS,,0", TRUE, TRUE, setBugDxFlags},
11011149
{"HKLM,Software\\vmdisp9x\\svga,VRAMLimit,,128", FALSE, TRUE, setLimitVRAM},
1150+
{"HKLM,Software\\vmdisp9x\\vesa,VRAMLimit,,128", FALSE, TRUE, setLimitVRAM},
11021151
//{";mefix:", FALSE, TRUE, setLineMeFix},
11031152
//{";syscopy:", FALSE, TRUE, setLineSyscopy},
11041153
{";switcher:", FALSE, TRUE, setLineSwitcher},
@@ -1107,7 +1156,6 @@ linerRule_t infFixRules[] = {
11071156
{"vmwsgl32.dll=1", TRUE, TRUE, setMesaAlternate},
11081157
{"mesa98.dll=1", TRUE, TRUE, setMesaAlternate},
11091158
{"mesa99.dll=1", TRUE, TRUE, setMesaAlternate},
1110-
{"HKR,CURRENT", TRUE, TRUE, saveDelPos},
11111159
{NULL, FALSE, FALSE, NULL}
11121160
};
11131161

@@ -1196,48 +1244,57 @@ BOOL set_inf_regs(HWND hwnd)
11961244
registryWriteInfDWORD("HKLM\\Software\\vmdisp9x\\svga\\NoMultisample", settingReadDW(CHBX_NO_MULTISAMPLE), dstfile);
11971245
registryWriteInfDWORD("HKLM\\Software\\vmdisp9x\\svga\\AsyncMOBs", settingReadDW(INP_ASYNCMOBS), dstfile);
11981246

1199-
registryWriteInfDWORD("HKLM\\Software\\vmdisp9x\\apps\\global\\mesa\\SVGA_GMR_CACHE_ENABLED", settingReadDW(CHBX_GMR_CACHE), dstfile);
1247+
registryWriteInfDWORD("HKLM\\Software\\vmdisp9x\\apps\\global\\mesa\\SVGA_GMR_CACHE_ENABLED", settingReadDW(CHBX_GMR_CACHE), dstfile);
12001248

12011249
#if 0
12021250
if(settingReadDW(IMP_SVGA_MEM_MAX) != 400)
12031251
{
1204-
registryWriteInfDWORD("HKLM\\Software\\vmdisp9x\\apps\\global\\mesa\\SVGA_MEM_MAX", settingReadDW(IMP_SVGA_MEM_MAX), dstfile);
1252+
registryWriteInfDWORD("HKLM\\Software\\vmdisp9x\\apps\\global\\mesa\\SVGA_MEM_MAX", settingReadDW(IMP_SVGA_MEM_MAX), dstfile);
12051253
}
12061254
#endif
12071255

12081256
registryWriteInfDWORD("HKLM\\Software\\vmdisp9x\\apps\\global\\mesa\\MESA_SW_GAMMA_ENABLED", settingReadDW(CHBX_SW_GAMMA), dstfile);
12091257
registryWriteInfDWORD("HKLM\\Software\\vmdisp9x\\apps\\global\\mesa\\SVGA_DMA_TO_FB", settingReadDW(CHBX_DMA_TO_FB), dstfile);
12101258

1211-
registryWriteInfDWORD("HKLM\\Software\\vmdisp9x\\svga\\HWCursor", settingReadDW(CHBX_HWCURSOR), dstfile);
1259+
registryWriteInfDWORD("HKLM\\Software\\vmdisp9x\\svga\\HWCursor", settingReadDW(CHBX_HWCURSOR), dstfile);
1260+
1261+
if(isSettingSet(RAD_LOWDETAIL_1))
1262+
{
1263+
registryWriteInf("HKLM\\Software\\vmdisp9x\\apps\\global\\hal\\lowdetail", "1", WINREG_STR, dstfile);
1264+
registryWriteInf("HKLM\\Software\\vmdisp9x\\apps\\global\\mesa\\MESA_NO_DITHER", "1", WINREG_STR, dstfile);
1265+
}
1266+
else if(isSettingSet(RAD_LOWDETAIL_2))
1267+
{
1268+
registryWriteInf("HKLM\\Software\\vmdisp9x\\apps\\global\\hal\\lowdetail", "2", WINREG_STR, dstfile);
1269+
registryWriteInf("HKLM\\Software\\vmdisp9x\\apps\\global\\mesa\\MESA_NO_DITHER", "1", WINREG_STR, dstfile);
1270+
}
1271+
else if(isSettingSet(RAD_LOWDETAIL_3))
1272+
{
1273+
registryWriteInf("HKLM\\Software\\vmdisp9x\\apps\\global\\hal\\lowdetail", "3", WINREG_STR, dstfile);
1274+
registryWriteInf("HKLM\\Software\\vmdisp9x\\apps\\global\\mesa\\MESA_NO_DITHER", "1", WINREG_STR, dstfile);
1275+
}
1276+
else
1277+
{
1278+
registryWriteInf("HKLM\\Software\\vmdisp9x\\apps\\global\\hal\\lowdetail", "0", WINREG_STR, dstfile);
1279+
registryWriteInf("HKLM\\Software\\vmdisp9x\\apps\\global\\mesa\\MESA_NO_DITHER", "0", WINREG_STR, dstfile);
1280+
}
12121281

12131282
return TRUE;
12141283
}
12151284

12161285
void apply_delete(const char *target)
12171286
{
1218-
char *data;
1219-
size_t data_size;
1287+
addLine(target, "\r\n[VM.DelRegEx]\r\n");
12201288

1221-
if(del_section_pos == 0)
1222-
return;
1223-
1224-
if(!truncateFile(target, del_section_pos, &data, &data_size))
1225-
return;
1226-
12271289
const char *line = NULL;
12281290
int index = 0;
12291291
for(; (line = iniLine("[delete]", index)) != NULL; index++)
12301292
{
12311293
if(line[0] == 'H' && line[1] == 'K')
12321294
{
12331295
registryDeleteKeyInf(line, target);
1234-
//addLine(target, line);
12351296
}
12361297
}
1237-
1238-
extendFile(target, data, data_size);
1239-
freeTruncateData(data);
1240-
12411298
}
12421299

12431300
BOOL apply_reg_fixes(HWND hwnd)
@@ -1252,8 +1309,6 @@ BOOL apply_reg_fixes(HWND hwnd)
12521309
strcat(dstfile, "\\");
12531310
strcat(dstfile, iniValue("[softgpu]", "drvfile"));
12541311

1255-
apply_delete(dstfile);
1256-
12571312
//if(version_compare(&sysver, &WINVERME) < 0)
12581313
if(1) /* delete in all cases */
12591314
{
@@ -1296,6 +1351,8 @@ BOOL apply_reg_fixes(HWND hwnd)
12961351
}
12971352
}
12981353

1354+
apply_delete(dstfile);
1355+
12991356
return TRUE;
13001357
}
13011358

changelog.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
0.8.2025.52
2+
! VESA display driver
3+
! VBOX: page fault in VBox VGA driver
4+
- small stability improvements
5+
- fixed corrupted driver inf in some cases
6+
17
0.8.2025.51
28
- VMware: VRAM test (VMware bug)
39
- QEMU: vmware adapter compatibility fixes

config.md

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,14 @@ HKEY_LOCAL_MACHINE\Software\vmdisp9x
4444
- d3d9
4545
+ driver = universal display settings
4646
+ svga = display settings related to VMware SVGA-II gpu
47+
+ vesa = display settings related to VESA driver
4748
```
4849

4950
NOTE: you can enter numeric values as DWORD or as string, it'll be converted automatically.
5051

5152
## Universal display settings
5253

53-
| Name | Default value | Desctiption |
54+
| Name | Default value | Description |
5455
| ----------------- | ----------- | ----------- |
5556
| FORCE_SOFTWARE | 0 | 1 to use software OpenGL even if there is HW accelerated |
5657
| FORCE_QEMU3DFX | 0 | 1 when you has working QEMU-3Dfx wrapper |
@@ -62,7 +63,7 @@ NOTE: you can enter numeric values as DWORD or as string, it'll be converted aut
6263

6364
## SVGA driver
6465

65-
| Name | Default value | Desctiption |
66+
| Name | Default value | Description |
6667
| ----------------- | ----------- | ----------- |
6768
| HWCursor | 0 | 1 enable HW cursor, 0 draw cursor by software |
6869
| VRAMLimit | 128 | limits maximum of VRAM (for Win9x maximum around 256) |
@@ -75,6 +76,18 @@ NOTE: you can enter numeric values as DWORD or as string, it'll be converted aut
7576
| AsyncMOBs | 1 | number of MOBs to be created simulately |
7677
| NoScreenAccel | 0 | when enable, all frame buffer operation will be done strictly by CPU |
7778

79+
## VESA driver
80+
81+
| Name | Default value | Description |
82+
| ---- | ------------- | ----------- |
83+
| VRAMLimit | 128 | Maximum video RAM (in MB) exposed to system, allow to use adapters when have more then 256 MB VRAM, VRAM is usually utilized only by frame buffers, 32 MB is usually enough for FullHD resolution (1920 x 1080).
84+
| MTRR | 1 | Allow to use Intel MTRR registry to accelerate CPU to VRAM operations |
85+
| DosWindowSetMode | 0 | Allow to DOS application to call set mode when DOS application is in window mode |
86+
87+
88+
### DosWindowSetMode
89+
90+
[More description in VMDisp9x readme](https://github.com/JHRobotics/vmdisp9x?tab=readme-ov-file#dos-in-window)
7891

7992
## HAL
8093

@@ -90,13 +103,30 @@ NOTE: you can enter numeric values as DWORD or as string, it'll be converted aut
90103
| touchdepth | yes | 0 | when 1, depth buffer is read and write from and to surface, slow, only need when application needs manipulate with depth buffer |
91104
| filter_bug | yes | auto | SVGA driver has bug when filtering isn't applied correctly |
92105
| s3tc_bug | yes | 1 | software conversion of S3 style compressed textures |
106+
| lowdetail | yes | 0 | reduce detail, from 0 (no detail reduction) to 3 (lowest detail) |
107+
108+
### lowdetail
109+
110+
This setting allow turn off some graphical feature to faster rendering. Note: this setting affect only software 3D, respective detail reduction will be visible on HW and SW renderer but only on SW renderer affect performance.
111+
112+
| Level | Description |
113+
| ----- | ----------- |
114+
| 0 | All graphical features on |
115+
| 1 | Disabled dithering and edge antialiasing |
116+
| 2 | level 1 + texture filtering is forced to nearest neighbour including mipmaps |
117+
| 3 | level 2 + shading is forced to flat |
118+
119+
I recommend to use Level 1 every time when SW rendering is ON. On Level 2 games usually looks like old games when switched to software renderer. Level 3 has visible artefact when lighting is used. When you need more FPS from SW renderer, please reduce resolution, you can also try to turn off HW T&L (set `hwtl` to `0`), SW T&L done in DX runtime is paradoxically faster that than HW T&L performed by SW renderer.
93120

94121

95122
## MESA
96123

97-
"MESA_EXTENSION_MAX_YEAR"="2000"
98-
"LP_NATIVE_VECTOR_WIDTH"="256"
124+
These keys have same names and behaviour like [Mesa Environment Variables](https://docs.mesa3d.org/envvars.html), so there are few important values
99125

126+
| Name | Default | Description |
127+
| ---- | ------- | ----------- |
128+
| LP_NATIVE_VECTOR_WIDTH | 128 | CPU register size for LLVM pipe renderer, 128 = SSE, or 256 = AVX, when you have AVX support in CPU and enabled support in system, you can set this variable to 256 for faster software rendering |
129+
| MESA_EXTENSION_MAX_YEAR | - | The string with OpenGL extensions too long to cause buffer overflow in old games (Q2 and Q3 engines games). When enter year, the newer extension is not listed (but still works). Usually good values are '2004' or '2006'. Because HAL and WINE internally using Mesa, please do not set this setting globally.|
100130

101131

102132
## OpenGlide

0 commit comments

Comments
 (0)