diff options
author | Jaroslav Hensl <emulator@emulace.cz> | 2023-12-28 02:31:53 +0100 |
---|---|---|
committer | Jaroslav Hensl <emulator@emulace.cz> | 2023-12-28 02:31:53 +0100 |
commit | 4cc02044b5cd8d5a3791f847198b37817fc60b78 (patch) | |
tree | 867347f736eb54f4f9d9ac48d82745d49e559d2d | |
parent | e7212fbc01c4c3263738e5e37899621e295af701 (diff) | |
download | vmdisp9x-4cc02044b5cd8d5a3791f847198b37817fc60b78.tar.gz |
color cursor fix (AND mask is always 1 bpp), ddhal preparation
-rw-r--r-- | control.c | 2 | ||||
-rw-r--r-- | dddrv.c | 2 | ||||
-rw-r--r-- | swcursor.c | 77 | ||||
-rw-r--r-- | vmdisp9x.inf | 8 |
4 files changed, 50 insertions, 39 deletions
@@ -753,11 +753,13 @@ LONG WINAPI __loadds Control(LPVOID lpDevice, UINT function, }
else if(function == MOUSETRAILS)
{
+#ifdef DBGPRINT
if(lpInput)
{
int trails = *((int __far *)lpInput);
dbg_printf("MOUSETRAILS: %d\n", trails);
}
+#endif
//JH: mouse trails are disabled!
//DIB_Control(lpDevice, MOUSETRAILS, lpInput, lpOutput);
rc = 1;
@@ -37,7 +37,7 @@ THE SOFTWARE. #include "vmdahal.h"
const static DD32BITDRIVERDATA_t drv_bridge99 = {
- "bridge99.dll",
+ "vmhal9x.dll",
"DriverInit",
0
};
@@ -191,6 +191,8 @@ BOOL cursor_load(CURSORSHAPE __far *lpCursor, longRECT __far *changes) longRECT r1 = {0, 0, 0, 0};
longRECT r2 = {0, 0, 0, 0};
BOOL is_blitted = FALSE;
+
+ int xi, xj, y;
/* maximum cursor size in 32bit mode is 64x64 px */
if(data_size * 3 + sizeof(SWCURSOR) > CURSOR_MAX_SIZE)
@@ -205,67 +207,74 @@ BOOL cursor_load(CURSORSHAPE __far *lpCursor, longRECT __far *changes) }
cursor_cs_enter();
-
- if(lpCursor->BitsPixel == 1)
- {
- int xi, xj, y;
- for(y = 0; y < lpCursor->cy; y++)
+ for(y = 0; y < lpCursor->cy; y++)
+ {
+ for(xj = 0; xj < lpCursor->cbWidth; xj++)
{
- for(xj = 0; xj < lpCursor->cbWidth; xj++)
- {
- BYTE a = andmask[lpCursor->cbWidth*y + xj];
- BYTE x = xormask[lpCursor->cbWidth*y + xj];
+ BYTE a = andmask[lpCursor->cbWidth*y + xj];
+ BYTE x = xormask[lpCursor->cbWidth*y + xj];
- for(xi = 7; xi >= 0; xi--)
+ for(xi = 7; xi >= 0; xi--)
+ {
+ switch(wBpp)
{
- switch(wBpp)
+ case 8:
{
- case 8:
+ DstAndMask[lpCursor->cx * y + xj*8 + (7-xi)] = EXPAND_BIT(BYTE, ((a >> xi) & 0x1));
+ if(lpCursor->BitsPixel == 1)
{
- DstAndMask[lpCursor->cx * y + xj*8 + (7-xi)] = EXPAND_BIT(BYTE, ((a >> xi) & 0x1));
DstXorMask[lpCursor->cx * y + xj*8 + (7-xi)] = EXPAND_BIT(BYTE, ((x >> xi) & 0x1));
- break;
}
- case 16:
+ break;
+ }
+ case 16:
+ {
+ ((WORD __far*)DstAndMask)[lpCursor->cx * y + xj*8 + (7-xi)] = EXPAND_BIT(WORD, ((a >> xi) & 0x1));
+ if(lpCursor->BitsPixel == 1)
{
- ((WORD __far*)DstAndMask)[lpCursor->cx * y + xj*8 + (7-xi)] = EXPAND_BIT(WORD, ((a >> xi) & 0x1));
((WORD __far*)DstXorMask)[lpCursor->cx * y + xj*8 + (7-xi)] = EXPAND_BIT(WORD, ((x >> xi) & 0x1));
- break;
}
- case 24:
+ break;
+ }
+ case 24:
+ {
+ DWORD am = EXPAND_BIT(DWORD, ((a >> xi) & 0x1));
+ DWORD xm = EXPAND_BIT(DWORD, ((x >> xi) & 0x1));
+ WORD pos = (lpCursor->cx * y + xj*8 + (7-xi))*3;
+
+ DstAndMask[pos] = am & 0xFF;
+ DstAndMask[pos+1] = (am >> 8) & 0xFF;
+ DstAndMask[pos+2] = (am >> 16) & 0xFF;
+
+ if(lpCursor->BitsPixel == 1)
{
- DWORD am = EXPAND_BIT(DWORD, ((a >> xi) & 0x1));
- DWORD xm = EXPAND_BIT(DWORD, ((x >> xi) & 0x1));
- WORD pos = (lpCursor->cx * y + xj*8 + (7-xi))*3;
-
- DstAndMask[pos] = am & 0xFF;
- DstAndMask[pos+1] = (am >> 8) & 0xFF;
- DstAndMask[pos+2] = (am >> 16) & 0xFF;
-
DstXorMask[pos] = xm & 0xFF;
DstXorMask[pos+1] = (xm >> 8) & 0xFF;
DstXorMask[pos+2] = (xm >> 16) & 0xFF;
-
- break;
}
- case 32:
+
+ break;
+ }
+ case 32:
+ {
+ ((DWORD __far*)DstAndMask)[lpCursor->cx * y + xj*8 + (7-xi)] = EXPAND_BIT(DWORD, ((a >> xi) & 0x1));
+ if(lpCursor->BitsPixel == 1)
{
- ((DWORD __far*)DstAndMask)[lpCursor->cx * y + xj*8 + (7-xi)] = EXPAND_BIT(DWORD, ((a >> xi) & 0x1));
((DWORD __far*)DstXorMask)[lpCursor->cx * y + xj*8 + (7-xi)] = EXPAND_BIT(DWORD, ((x >> xi) & 0x1));
- break;
}
+ break;
}
}
}
}
}
- else if(lpCursor->BitsPixel == wBpp)
+
+ if(lpCursor->BitsPixel == wBpp)
{
- _fmemcpy(DstAndMask, andmask, ps * lpCursor->cx * lpCursor->cy);
_fmemcpy(DstXorMask, xormask, ps * lpCursor->cx * lpCursor->cy);
}
- else
+ else if(lpCursor->BitsPixel != 1)
{
cursor_cs_leave();
return FALSE;
diff --git a/vmdisp9x.inf b/vmdisp9x.inf index f457f0c..6391191 100644 --- a/vmdisp9x.inf +++ b/vmdisp9x.inf @@ -43,7 +43,7 @@ qemumini.vxd=1 ;3dfx:3dfxSpl3.dll=1,vgw9x
;wined3d:ddr95.dll=1,dx
;wined3d:ddr98.dll=1,dx
-;bridge:bridge99.dll=1
+;vmhal:vmhal9x.dll=1
[Manufacturer]
%Mfg%=Mfg.VM
@@ -78,20 +78,20 @@ AddReg=VMSvga.AddReg,VM.AddReg,DX.addReg [VBox.Copy]
boxvmini.drv,,,0x00000004
;mesa:mesa3d.dll,,,0x00000004
-;bridge:bridge99.dll,,,0x00000004
+;vmhal:vmhal9x.dll,,,0x00000004
[Qemu.Copy]
qemumini.drv,,,0x00000004
qemumini.vxd,,,0x00000004
;mesa:mesa3d.dll,,,0x00000004
-;bridge:bridge99.dll,,,0x00000004
+;vmhal:vmhal9x.dll,,,0x00000004
[VMSvga.Copy]
vmwsmini.drv,,,0x00000004
vmwsmini.vxd,,,0x00000004
;mesa:vmwsgl32.dll,,,0x00000004
;mesa:mesa3d.dll,,,0x00000004
-;bridge:bridge99.dll,,,0x00000004
+;vmhal:vmhal9x.dll,,,0x00000004
[Voodoo.Copy]
;3dfx:3dfxspl2.dll,,,0x00000010
|