summaryrefslogtreecommitdiffstats
path: root/src/glut/dos/PC_HW
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2002-02-23 17:11:27 +0000
committerBrian Paul <[email protected]>2002-02-23 17:11:27 +0000
commite0193a9425807cc61779c3b8680c5b551685ba65 (patch)
treeb3dacd48e37032f60b2b450a68d406d9deee2e1e /src/glut/dos/PC_HW
parentc7a3356746b8751fa0f04c8c0b674e26d73fdb76 (diff)
DOS updates from Daniel Borca
Diffstat (limited to 'src/glut/dos/PC_HW')
-rw-r--r--src/glut/dos/PC_HW/pc_irq.S6
-rw-r--r--src/glut/dos/PC_HW/pc_mouse.c10
2 files changed, 12 insertions, 4 deletions
diff --git a/src/glut/dos/PC_HW/pc_irq.S b/src/glut/dos/PC_HW/pc_irq.S
index 2a6302f71a2..8f19f8eb9f4 100644
--- a/src/glut/dos/PC_HW/pc_irq.S
+++ b/src/glut/dos/PC_HW/pc_irq.S
@@ -1,5 +1,5 @@
/*
- * PC/HW routine collection v0.1 for DOS/DJGPP
+ * PC/HW routine collection v0.2 for DOS/DJGPP
*
* Copyright (C) 2002 - Borca Daniel
* Email : [email protected]
@@ -129,7 +129,7 @@ __irq_wrapper_##x: ; \
pushl %es ; \
pushl %fs ; \
pushl %gs ; \
- movw %ss, %bx ; \
+ movl %ss, %ebx ; \
movl %esp, %esi ; \
movl %cs:___djgpp_ds_alias, %ss ; \
movl %cs:__irq_stack_##x, %esp ; \
@@ -141,7 +141,7 @@ __irq_wrapper_##x: ; \
pushl %fs ; \
popl %gs ; \
call *__irq_hook_##x ; \
- movw %bx, %ss ; \
+ movl %ebx, %ss ; \
movl %esi, %esp ; \
testl %eax, %eax ; \
popl %gs ; \
diff --git a/src/glut/dos/PC_HW/pc_mouse.c b/src/glut/dos/PC_HW/pc_mouse.c
index cc3396cb213..2a692eceb66 100644
--- a/src/glut/dos/PC_HW/pc_mouse.c
+++ b/src/glut/dos/PC_HW/pc_mouse.c
@@ -1,5 +1,5 @@
/*
- * PC/HW routine collection v0.1 for DOS/DJGPP
+ * PC/HW routine collection v0.2 for DOS/DJGPP
*
* Copyright (C) 2002 - Borca Daniel
* Email : [email protected]
@@ -15,6 +15,12 @@
#define MOUSE_STACK_SIZE 16384
+#define CLEAR_MICKEYS() \
+ do { \
+ __asm__ __volatile__ ("movw $0xb, %%ax; int $0x33":::"%eax", "%ecx", "%edx"); \
+ ox = oy = 0; \
+ } while (0)
+
extern void mouse_wrapper (void);
extern void mouse_wrapper_end (void);
@@ -161,6 +167,8 @@ int pc_install_mouse (void)
mouse_regs.x.es = mouse_callback>>16;
__dpmi_int(0x33, &mouse_regs);
+ CLEAR_MICKEYS();
+
emulat3 = buttons<3;
pc_atexit(pc_remove_mouse);
return buttons;