C_OBJS = mouse_load.o
-S_OBJS = mouse-kernel.o
+S_OBJS = mouse-kernel.o \
+ mouse_info.o \
+ mouse_ioctl.o \
+ mouse_pos.o
+
#--------------------------------------------------------------------------
.import return0
.importzp ptr1
+ .condes mouse_irq, 2 ; Export as IRQ handler
.include "mouse-kernel.inc"
mouse_buttons: jmp return0
mouse_pos: jmp return0
mouse_info: jmp return0
+mouse_ioctl: jmp return0
+mouse_irq: .byte $60, $00, $00 ; RTS plus two dummy bytes
; Driver header signature
.rodata
jmp mouse_install ; Call driver install routine
+ ldy mouse_irq+2 ; Check high byte of IRQ vector
+ beq @L2 ; Jump if vector invalid
+ ldy #$4C ; Jump opcode
+ sty mouse_irq ; Activate IRQ routine
+@L2: rts
+
; Driver signature invalid
inv_drv:
_mouse_uninstall:
jsr mouse_uninstall ; Call driver routine
+ lda #$60 ; RTS opcode
+ sta mouse_irq ; Disable IRQ entry point
+
mouse_clear_ptr: ; External entry point
lda #0
sta _mouse_drv
--- /dev/null
+;
+; Ullrich von Bassewitz, 2003-12-30
+;
+; void __fastcall__ mouse_info (struct mouse_info* info);
+; /* Return the state of the mouse buttons and the position of the mouse */
+;
+
+ .import ptr1: zp
+
+ .include "mouse-kernel.inc"
+
+.proc _mouse_info
+
+ sta ptr1
+ stx ptr1+1 ; Store info into ptr1
+ jmp mouse_info ; Call the driver
+
+.endproc
+
+
+
+
+
--- /dev/null
+;
+; Ullrich von Bassewitz, 2003-12-30
+;
+; unsigned char __fastcall__ mouse_ioctl (unsigned char code, void* data);
+; /* Call the driver specific ioctl function. NON PORTABLE! Returns an error
+; * code.
+; */
+;
+
+ .import popa
+ .import ptr1: zp
+
+ .include "mouse-kernel.inc"
+
+.proc _mouse_ioctl
+
+ sta ptr1
+ stx ptr1+1 ; Store data into ptr1
+ jsr popa ; Get code from stack
+ jmp mouse_ioctl ; Call the driver
+
+.endproc
+
+
+
+
+
--- /dev/null
+;
+; Ullrich von Bassewitz, 2003-12-30
+;
+; void __fastcall__ mouse_pos (struct mouse_pos* pos);
+; /* Return the current mouse position */
+;
+
+ .import ptr1: zp
+
+ .include "mouse-kernel.inc"
+
+.proc _mouse_pos
+
+ sta ptr1
+ stx ptr1+1 ; Store pos into ptr1
+ jmp mouse_pos ; Call the driver
+
+.endproc
+
+
+
+
+