Skip to content

Commit 739eb72

Browse files
committed
double buffering (inc. README) + version fix
1 parent 12c37ec commit 739eb72

5 files changed

Lines changed: 48 additions & 5 deletions

File tree

‎README.md‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,23 @@ REGEDIT4
108108

109109
To test that you Video BIOS can handle this, simply run (START -> run) `command.com` and when your screen will broke (you will see full black, or some random chars) this setting is not for you. (You can press Alt+Enter to switch DOS to fullscreen and again Alt+Enter to back to window = this probably can you return to right screen mode).
110110

111+
### Double buffering
112+
113+
Most VESA card support double buffering (e.g. seamless move frame buffer to different location in VRAM). But sometime (or for some applications) this don’t work correctly and [tearing](https://wiki.osdev.org/Double_Buffering#Tearing) is too high - mostly because application control buffer flipping, but due emulation of most drawing and timing function simply doesn't catch right time. For this situation you can force double buffer emulation by this registry key:
114+
115+
```
116+
REGEDIT4
117+
118+
[HKEY_LOCAL_MACHINE\Software\vmdisp9x\vesa]
119+
"HWDoubleBuffer"=dword:00000000
120+
121+
```
122+
123+
(Default value is 2)
124+
125+
Also note, that software double buffering can by very slow (because needs reading from video ram).
126+
127+
111128
### Minimal configuration
112129

113130
Minimal configuration (for Windows 95 build) is Intel 486 with 16 MB ram + PCI S3 (Trio or Virge) with 4 MB VRAM. On this configuration isn't 3D available (for obvious reason). For 3D acceleration you need at last Pentium 3 CPU + 256 MB RAM. But software 3D acceleration is CPU heavy, so doesn't make any sense to run VMDisp9x on these configurations. Minimal usable configuration is around Intel Core 2 CPU with Intel 965 integrated GPU.

‎makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ OBJS += &
1414

1515
INCS = -I$(%WATCOM)\h\win -Iddk -Ivmware
1616

17-
VER_BUILD = 118
17+
VER_BUILD = 119
1818

1919
FLAGS = -DDRV_VER_BUILD=$(VER_BUILD)
2020

‎tools/copyinf.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ int main(int argc, char **argv)
171171
{
172172
if(strstr(linebuf, "DriverVer=") == linebuf)
173173
{
174-
sprintf(linebuf, "DriverVer=%02d/%02d/%04d, %d.%d.0.%d", month, day, year, softgpu+1, year, build);
174+
sprintf(linebuf, "DriverVer=%02d/%02d/%04d,%d.%d.%d.%d", month, day, year, 4, year, softgpu, build);
175175
}
176176
else
177177
{

‎vmdisp9x.inf‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
; 2023-2025, Jaroslav Hensl
99

1010
[version]
11-
DriverVer=01/01/2025, 4.2025.0.0
11+
DriverVer=01/01/2025,4.2025.0.0
1212
Class=DISPLAY
1313
signature="$CHICAGO$"
1414
Provider=%Mfg%

‎vxd_vesa.c‎

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ static int vesa_pal_bits = 6;
125125
static BOOL vesa_valid = FALSE;
126126

127127
static DWORD conf_dos_window = 0;
128-
static DWORD conf_hw_double_buf = 0;
128+
static DWORD conf_hw_double_buf = 2;
129129

130130
#define SCREEN_EMULATED_CENTER 0
131131
#define SCREEN_EMULATED_COPY 1
@@ -609,6 +609,8 @@ DWORD FBHDA_palette_get(unsigned char index)
609609
return 0;
610610
}
611611

612+
#define SWAP_TESTS 1024
613+
612614
BOOL FBHDA_swap(DWORD offset)
613615
{
614616
if((offset + hda->stride) < hda->vram_size && offset >= hda->system_surface)
@@ -639,8 +641,32 @@ BOOL FBHDA_swap(DWORD offset)
639641
(screen_mode == SCREEN_FLIP_VSYNC) ? VESA_DISPLAYSTART_VTRACE : VESA_DISPLAYSTART_SET;
640642
regs.Client_ECX = off_x;
641643
regs.Client_EDX = off_y;
642-
hda->surface = offset;
644+
643645
vesa_bios(&regs);
646+
if(VESA_SUCC(regs))
647+
{
648+
/* wait until is set */
649+
DWORD test_off_x, test_off_y;
650+
DWORD nums_test = 0;
651+
do
652+
{
653+
regs.Client_EAX = VESA_CMD_DISPLAY_START;
654+
regs.Client_EBX = VESA_DISPLAYSTART_GET;
655+
regs.Client_ECX = 0;
656+
regs.Client_EDX = 0;
657+
if(!VESA_SUCC(regs))
658+
{
659+
break;
660+
}
661+
if(++nums_test > SWAP_TESTS)
662+
{
663+
break;
664+
}
665+
test_off_x = regs.Client_ECX & 0xFFFF;
666+
test_off_y = regs.Client_EDX & 0xFFFF;
667+
} while((test_off_x != off_x) || (test_off_y != off_y));
668+
}
669+
hda->surface = offset;
644670

645671
if(fb_lock_cnt == 0)
646672
{

0 commit comments

Comments
 (0)