From 8e9df5624d56a91eaa71a1ceac4932b7c5c5ee48 Mon Sep 17 00:00:00 2001 From: Javier Date: Sun, 29 Nov 2026 18:01:42 +0100 Subject: w16mouse: wmake vbmouse2.drv now builds the windows2.x version --- .gitignore | 1 + dosstub.asm | 11 +++++++++++ makefile | 7 +++++-- mousew2.lnk | 19 +++++++++++++++++++ 4 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 dosstub.asm create mode 100644 mousew2.lnk diff --git a/.gitignore b/.gitignore index 72ab409..27970b4 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ vbados.zip vbmouse.exe vbmouse.drv vbsf.exe +dosstub.exe *.o *.obj *.map diff --git a/dosstub.asm b/dosstub.asm new file mode 100644 index 0000000..fd5c164 --- /dev/null +++ b/dosstub.asm @@ -0,0 +1,11 @@ +.8086 +.model small +.code +PUBLIC main +main: +; This just builds a stub MZ exec that is exactly 1K long, see mousew2.lnk for details +mov ax,0x4c01 +int 0x21 ; just end with error code +db 400h-40h-5h dup(0) ; 1K - sizeof full MZ header - size of above code +.stack +END main diff --git a/makefile b/makefile index 4181021..99c3a44 100644 --- a/makefile +++ b/makefile @@ -72,8 +72,11 @@ mousew16.obj: mousew16.c .AUTODEPEND # Windows 2.x version # TODO 2.x setup.exe expects an exactly 400byte long stub (option stub=...) -vbmouse2.drv: mousew16.lnk $(mousew16_objs) - *wlink @$[@ name $@ file { $(mousew16_objs) } option version=2.0 option alignment=16 +vbmouse2.drv: mousew16.lnk mousew2.lnk dosstub.exe $(mousew16_objs) + *wlink @mousew16.lnk @mousew2.lnk name $@ file { $(mousew16_objs) } + +dosstub.exe: dosstub.asm .AUTODEPEND + *wcl -fo=$^@ $[@ -\"option fullheader\" # DOS shared folders vbsf.exe: vbsf.lnk $(sfdos_objs) kittenc.exe diff --git a/mousew2.lnk b/mousew2.lnk new file mode 100644 index 0000000..c0bc8b6 --- /dev/null +++ b/mousew2.lnk @@ -0,0 +1,19 @@ +# Additional link options for vbmouse2.drv, the version for Windows 2.x + +option map=mousew2.map +option description 'VBMouse int33 absolute mouse driver for 2.x' + +# Sadly the 3.x/95 NE loader requires an min Windows version >=3.0, +# while the 1.x/2.x loader requires a min Windows version <=2.0 +# so even though the code is the same, no idea how to provide +# a single exec that satisfies both OSes. + +# Set min windows version required to 1.0 +option version=1.0 + +# The 1.x/2.x loader in SETUP.EXE is also way more picky than the regular one +# Fortunately, we have the source for SETUP.EXE, so we know what it needs: +# Paragraph alignment, and for the NE header to start at exactly 0x400, +# which means we need a custom stub exe that is exactly 1K long. +option alignment=16 +option stub=dosstub.exe -- cgit v1.2.3