This is an ASCII generic text file of the available text and (.S) - source files from: Mouse Development Tools - Mousetext Toolkit v1.7 (4/3/84) - for use with an Apple //e (80 Col) only. ------------ ALLOCATE.S ------------ ; ALLOCATE ; ; Allocates a $1000 byte area protected from BASIC by making a call ; to BASIC.SYSTEM. (see ProDOS tech note #9) This area must extend ; from $8A00 to $9A00 for toolkit. The high byte of the address ; returned is placed at $310 so that the calling BASIC program can ; check it. ; ; This routine is org'ed at $300 since it is short and very temporary. ; ; See the companion progam RELEASE, which releases all memory set aside ; using this method. ; org $300 ; getbufr equ $BEF5 ; address of BASIC.SYSTEM's buffer allocation routine numpgs equ $10 ; number of pages we want set aside ; lda #numpgs jsr getbufr ; allocate the buffer bcc continue ; if carry clear, call was successful lda #0 ; store an invalid # so caller detects failure continue sta result rts result equ $310 ; result must be beyond above code --------------------------------------------------------------------------- ------------ IDCHECK.S ------------ ; IDCHECK ; org $300 ; pdosid equ $BF98 ; address of BASIC.SYSTEM's buffer allocation routine mustbe equ $A2 ; number of pages we want set aside mask equ $E2 ; lda pdosid and #mask eor #mustbe sta result rts result equ $310 ; result must be beyond above code -------------------------------------------------------------------------- ----------- RELEASE.S ----------- ; RELEASE ; ; Releases any special buffers that BASIC has reserved by making a call to ; to BASIC.SYSTEM. (see ProDOS tech note #9) ; ; This routine is org'ed at $300 since it is short and very temporary. ; ; See the companion progam ALLOCATE, which allocates memory for toolkit. ; org $300 ; freebufr equ $BEF8 ; address of BASIC.SYSTEM's buffer release routine ; jsr freebufr ; release any buffers set aside rts --------------------------------------------------------------------------- --------------- TOOLKITDEMO.S --------------- sbtl .Mouse Toolkit Demo. * * Sample program using the Mouse Toolkit (version 1) * See the pseudo-code example for an overview of the program structure * * User runs this program by running the BASIC program START.DEMO * which allocates space for the toolkit, loads in the toolkit and * the demo program, and then runs the demo. * skp 1 org $1000 skp 1 toolkit equ $8A00 skp 1 jmp progstart ; jump to program start, so this can be BRUN skp 1 ; ; Toolkit command numbers ; startdesktop equ 0 stopdesktop equ 1 setcursor equ 2 showcursor equ 3 hidecursor equ 4 checkevents equ 5 getevent equ 6 flushevents equ 7 setkeyevent equ 8 initmenu equ 9 setmenu equ 10 menuselect equ 11 menukey equ 12 hilitemenu equ 13 disablemenu equ 14 disableitem equ 15 checkitem equ 16 ; ; Monitor entry points ; cout equ $FDED crout equ $FD8E prbyte equ $FDDA ; ; Machine ID equates ; machid equ $FBB3 machsid equ $FBC0 ; ; local variables: ; quitflag db 0 ; high bit set = quit ; ; The program begins here!! ; progstart equ * lda #0 ; initialize quitflag sta quitflag lda machid ; get the machine's id byte sta mid ; store in parameter list lda machsid ; get machine's sub id byte sta msid ; store in parameter list skp 1 jsr toolkit ; initialize the desktop db startdesktop dw startparms beq prog.cont ; continue if no error cmp #$04 ; check if machine is not a //e beq notsupported cmp #$06 ; check to see if no card beq nocard jmp syserror ; some other error occurred skp 1 notsupported equ * ; Machine is not supported (we know ProDOS is) lda #>notsup.str ; print the error string ldx #nocard.str ; print the error string ldx #syse.str ; print the error string ldx #