From: cpg Date: Sun, 3 Dec 2000 21:39:12 +0000 (+0000) Subject: added mousemem constructor X-Git-Tag: V2.12.0~3005 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=86e8c03001ecc1b8c522befccc03fc233088d03e;p=cc65 added mousemem constructor git-svn-id: svn://svn.cc65.org/cc65/trunk@535 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/libsrc/atari/mouse.s b/libsrc/atari/mouse.s index 1592b411a..172e2ad69 100644 --- a/libsrc/atari/mouse.s +++ b/libsrc/atari/mouse.s @@ -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