Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
baed48e4
Commit
baed48e4
authored
Mar 25, 1999
by
Ove Kaaven
Committed by
Alexandre Julliard
Mar 25, 1999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented a int 0x33 handler, with a minimal implementation of the
mouse routines, including callbacks.
parent
bb7f0de7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
122 additions
and
0 deletions
+122
-0
int33.c
msdos/int33.c
+122
-0
No files found.
msdos/int33.c
0 → 100644
View file @
baed48e4
/*
* DOS interrupt 33h handler
*/
#include <stdlib.h>
#include "winuser.h"
#include "miscemu.h"
#include "dosexe.h"
#include "debug.h"
typedef
struct
{
DWORD
x
,
y
,
but
;
FARPROC16
callback
;
WORD
callmask
;
}
MOUSESYSTEM
;
/**********************************************************************
* INT_Int33Handler
*
* Handler for int 33h (MS MOUSE).
*/
void
WINAPI
INT_Int33Handler
(
CONTEXT
*
context
)
{
MOUSESYSTEM
*
sys
=
(
MOUSESYSTEM
*
)
DOSVM_GetSystemData
(
0x33
);
switch
(
AX_reg
(
context
))
{
case
0x00
:
TRACE
(
int
,
"Reset mouse driver and request status
\n
"
);
AX_reg
(
context
)
=
0xFFFF
;
/* installed */
BX_reg
(
context
)
=
3
;
/* # of buttons */
sys
=
calloc
(
1
,
sizeof
(
MOUSESYSTEM
));
DOSVM_SetSystemData
(
0x33
,
sys
);
break
;
case
0x03
:
TRACE
(
int
,
"Return mouse position and button status
\n
"
);
BX_reg
(
context
)
=
sys
->
but
;
CX_reg
(
context
)
=
sys
->
x
;
DX_reg
(
context
)
=
sys
->
y
;
break
;
case
0x0C
:
/* Define interrupt subroutine */
TRACE
(
int
,
"Define mouse interrupt subroutine
\n
"
);
sys
->
callmask
=
CX_reg
(
context
);
sys
->
callback
=
(
FARPROC16
)
PTR_SEG_OFF_TO_SEGPTR
(
ES_reg
(
context
),
DX_reg
(
context
));
break
;
default:
INT_BARF
(
context
,
0x33
);
}
}
typedef
struct
{
FARPROC16
proc
;
WORD
mask
,
but
,
x
,
y
,
mx
,
my
;
}
MCALLDATA
;
static
void
MouseRelay
(
LPDOSTASK
lpDosTask
,
PCONTEXT
context
,
void
*
mdata
)
{
MCALLDATA
*
data
=
(
MCALLDATA
*
)
mdata
;
CONTEXT
ctx
=
*
context
;
AX_reg
(
&
ctx
)
=
data
->
mask
;
BX_reg
(
&
ctx
)
=
data
->
but
;
CX_reg
(
&
ctx
)
=
data
->
x
;
DX_reg
(
&
ctx
)
=
data
->
y
;
SI_reg
(
&
ctx
)
=
data
->
mx
;
DI_reg
(
&
ctx
)
=
data
->
my
;
CS_reg
(
&
ctx
)
=
SELECTOROF
(
data
->
proc
);
IP_reg
(
&
ctx
)
=
OFFSETOF
(
data
->
proc
);
free
(
data
);
DPMI_CallRMProc
(
&
ctx
,
NULL
,
0
,
0
);
}
void
WINAPI
INT_Int33Message
(
UINT
message
,
WPARAM
wParam
,
LPARAM
lParam
)
{
MOUSESYSTEM
*
sys
=
(
MOUSESYSTEM
*
)
DOSVM_GetSystemData
(
0x33
);
WORD
mask
=
0
;
if
(
!
sys
)
return
;
sys
->
x
=
LOWORD
(
lParam
);
sys
->
y
=
HIWORD
(
lParam
);
switch
(
message
)
{
case
WM_MOUSEMOVE
:
mask
|=
0x01
;
break
;
case
WM_LBUTTONDOWN
:
case
WM_LBUTTONDBLCLK
:
sys
->
but
|=
0x01
;
mask
|=
0x02
;
break
;
case
WM_LBUTTONUP
:
sys
->
but
&=
~
0x01
;
mask
|=
0x04
;
break
;
case
WM_RBUTTONDOWN
:
case
WM_RBUTTONDBLCLK
:
sys
->
but
|=
0x02
;
mask
|=
0x08
;
break
;
case
WM_RBUTTONUP
:
sys
->
but
&=
~
0x02
;
mask
|=
0x10
;
break
;
case
WM_MBUTTONDOWN
:
case
WM_MBUTTONDBLCLK
:
sys
->
but
|=
0x04
;
mask
|=
0x20
;
break
;
case
WM_MBUTTONUP
:
sys
->
but
&=
~
0x04
;
mask
|=
0x40
;
break
;
}
if
((
mask
&
sys
->
callmask
)
&&
sys
->
callback
)
{
MCALLDATA
*
data
=
calloc
(
1
,
sizeof
(
MCALLDATA
));
data
->
proc
=
sys
->
callback
;
data
->
mask
=
mask
&
sys
->
callmask
;
data
->
but
=
sys
->
but
;
data
->
x
=
sys
->
x
;
data
->
y
=
sys
->
y
;
DOSVM_QueueEvent
(
-
1
,
DOS_PRIORITY_MOUSE
,
MouseRelay
,
data
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment