]> git.sur5r.net Git - cc65/commitdiff
added mousemem constructor
authorcpg <cpg@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Sun, 3 Dec 2000 21:39:12 +0000 (21:39 +0000)
committercpg <cpg@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Sun, 3 Dec 2000 21:39:12 +0000 (21:39 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@535 b7a2c559-68d2-44c3-8de9-860c34a00d81

libsrc/atari/mouse.s

index 1592b411acb563f3d993e4d8e68b82f99341e66f..172e2ad69d8a7d7950b2295b77f9d4f1423c9c07 100644 (file)
@@ -14,8 +14,9 @@
        .export _mouse_init, _mouse_done, _mouse_box
        .export _mouse_show, _mouse_hide, _mouse_move
        .export _mouse_buttons
+       .constructor    mousemem
 
-       .import popa,popax,mouse_pm0
+       .import popa,popax
 
        .include "atari.inc"
 
@@ -35,6 +36,23 @@ pmsize       = 16            ; y size pm shape
 xinit  = defxmin       ; init. x pos.
 yinit  = defymin       ; init. y pos.
 
+;--------------------------------------------------------------------
+; reserve memory for the mouse pointer
+
+mousemem:
+       lda     APPMHI+1
+       and     #%11111000      ; make 2k aligned
+       sec
+       sbc     #%00001000      ; reserve 2k
+       tax
+       adc     #3              ; add 4 (C = 1)
+       sta     mouse_pm0
+       lda     #0
+       sta     APPMHI
+       stx     APPMHI+1
+       rts
+       
+
 ;--------------------------------------------------------------------
 ; Initialize mouse routines
 ; void __fastcall__ mouse_init (unsigned char port, unsigned char sprite, unsigned char type);
@@ -533,3 +551,5 @@ mouse_on:
        .res 1
 port_nr:
        .res 1
+mouse_pm0:
+       .res 1