]> git.sur5r.net Git - cc65/blobdiff - libsrc/c128/mou/c128-pot.s
Merge remote-tracking branch 'upstream/master' into something_to_pull
[cc65] / libsrc / c128 / mou / c128-pot.s
index 2713e3f4fd7f0179cf79521aba0d11da5d9e8914..2568445f1b5d9ec3f4c05b4ffba3f3a3ad5c9400 100644 (file)
@@ -23,7 +23,11 @@ HEADER:
         .byte   $6d, $6f, $75           ; "mou"
         .byte   MOUSE_API_VERSION       ; Mouse driver API version number
 
-; Jump table.
+; Library reference
+
+        .addr   $0000
+
+; Jump table
 
         .addr   INSTALL
         .addr   UNINSTALL
@@ -42,6 +46,8 @@ HEADER:
 
 CHIDE:  jmp     $0000                   ; Hide the cursor
 CSHOW:  jmp     $0000                   ; Show the cursor
+CPREP:  jmp     $0000                   ; Prepare to move the cursor
+CDRAW:  jmp     $0000                   ; Draw the cursor
 CMOVEX: jmp     $0000                   ; Move the cursor to X coord
 CMOVEY: jmp     $0000                   ; Move the cursor to Y coord
 
@@ -80,10 +86,11 @@ Buttons:        .res    1               ; Button mask
 
 Temp:           .res    1
 
-; Default values for above variables
-
 .rodata
 
+; Default values for above variables
+; (We use ".proc" because we want to define both a label and a scope.)
+
 .proc   DefVars
         .word   SCREEN_HEIGHT/2         ; YPos
         .word   SCREEN_WIDTH/2          ; XPos
@@ -292,7 +299,8 @@ IOCTL:  lda     #<MOUSE_ERR_INV_IOCTL     ; We don't support ioclts for now
 ; (so be careful).
 ;
 
-IRQ:    lda     #$7F
+IRQ:    jsr     CPREP
+        lda     #$7F
         sta     CIA1_PRA
         lda     CIA1_PRB                ; Read port #1
         and     #%00001100
@@ -387,4 +395,7 @@ IRQ:    lda     #$7F
 ; Move the mouse pointer to the new X pos
 
         tya
-        jmp     CMOVEY
+        jsr     CMOVEY
+        jsr     CDRAW
+        clc                             ; Interrupt not "handled"
+        rts