aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJaroslav Hensl <jara@hensl.cz>2024-02-04 00:33:27 +0100
committerJaroslav Hensl <jara@hensl.cz>2024-02-04 00:33:27 +0100
commit8c0387f54d4e04fe5af4fc8a62861b942ed2ee7c (patch)
tree660a6522425a5b1f6caa5e2f55b4627a42c29a16
parent981b488286abc6d7c8c10933d41a0a0bb2483921 (diff)
downloadvmdisp9x-8c0387f54d4e04fe5af4fc8a62861b942ed2ee7c.tar.gz
fix of previous commit (no cs needed, fixed return codes)
-rw-r--r--dibcall.c41
-rw-r--r--makefile4
2 files changed, 17 insertions, 28 deletions
diff --git a/dibcall.c b/dibcall.c
index 5cf8641..69d68cc 100644
--- a/dibcall.c
+++ b/dibcall.c
@@ -38,24 +38,6 @@ DWORD mouse_buf_lin = 0;
void __far* mouse_buf = NULL;
BOOL mouse_vxd = FALSE;
-static void cs_enter()
-{
- _asm
- {
- mov ax, 1681h
- int 2Fh
- };
-}
-
-static void cs_leave()
-{
- _asm
- {
- mov ax, 1682h
- int 2Fh
- };
-}
-
/*
* What's this all about? Most of the required exported driver functions can
* be passed straight to the DIB Engine. The DIB Engine in some cases requires
@@ -90,8 +72,12 @@ void WINAPI __loadds MoveCursor(int absX, int absY)
static size_t mouse_cursor_size(CURSORSHAPE __far *lpCursor)
{
- size_t s = sizeof(CURSORSHAPE);
- s += ((lpCursor->cx + 7)/8) * lpCursor->cy; // size of AND mask
+ size_t s = 0;
+ s = ((lpCursor->cx + 7)/8) * lpCursor->cy; // size of AND mask
+
+ if(s == 0)
+ return 0;
+
if(lpCursor->BitsPixel == 1)
{
s += ((lpCursor->cx + 7)/8) * lpCursor->cy; // size of XOR mask 1bpp
@@ -101,6 +87,8 @@ static size_t mouse_cursor_size(CURSORSHAPE __far *lpCursor)
s += ((lpCursor->BitsPixel + 7)/8) * lpCursor->cx * lpCursor->cy; // size of XOR mask (mode bpp)
}
+ s += sizeof(CURSORSHAPE);
+
return s;
}
@@ -108,7 +96,6 @@ WORD WINAPI __loadds SetCursor_driver(CURSORSHAPE __far *lpCursor)
{
if(wEnabled)
{
- cs_enter();
if(mouse_vxd)
{
if(lpCursor != NULL)
@@ -117,20 +104,22 @@ WORD WINAPI __loadds SetCursor_driver(CURSORSHAPE __far *lpCursor)
if(ms > 0)
{
_fmemcpy(mouse_buf, lpCursor, ms);
- mouse_load();
- goto setcursor_exit;
+ if(mouse_load())
+ {
+ return 1;
+ }
+ return 0;
}
}
mouse_hide();
+ return 1;
}
else
{
DIB_SetCursorExt(lpCursor, lpDriverPDevice);
+ return 1;
}
- setcursor_exit:
- cs_leave();
-
}
return 0;
diff --git a/makefile b/makefile
index f5877c2..2b6f3f2 100644
--- a/makefile
+++ b/makefile
@@ -16,12 +16,12 @@ VER_BUILD = 24
FLAGS = -DDRV_VER_BUILD=$(VER_BUILD)
# Define HWBLT if BitBlt can be accelerated.
-FLAGS += -DHWBLT
+#FLAGS += -DHWBLT
# Define VRAM256MB if you want set VRAM limit to 256MB (default is 128MB)
#FLAGS += -DVRAM256MB
# Set DBGPRINT to add debug printf logging.
-DBGPRINT = 1
+#DBGPRINT = 1
!ifdef DBGPRINT
FLAGS += -DDBGPRINT