.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"
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);
.res 1
port_nr:
.res 1
+mouse_pm0:
+ .res 1