antoine-source/appleworksgs/Macros/m16.msl

1 line
8.5 KiB
Plaintext
Raw Normal View History

2023-03-04 02:45:20 +00:00
;-------------------------------------------------------------------------- ; ; m16.MSL ; ; ; ;--------------------------------------------------------------------------- ; ; WaitMouse ; ; Wait for a click MACRO &lab WaitMouse &lab ; ~b&SYSINDEX pha pushword #0 _Button pla beq ~b&SYSINDEX ~c&SYSINDEX pha pushword #0 _Button pla bne ~c&SYSINDEX MEND ;--------------------------------------------------------------------------- ; ; Break ; MACRO &lab Break &param &lab ; IF &nbr(&syslist) GOTO .gotone macerr 'Break macro: no input parameter specified.' mexit .gotone lda >$00C025 IF (&param='cap') GOTO .gotcaps IF (&param='caps') GOTO .gotcaps IF (&param='capslock') GOTO .gotcaps IF (&param='opt') GOTO .gotopt IF (&param='option') GOTO .gotopt IF (&param='closedapple') GOTO .gotopt IF (&param='fan') GOTO .gotfan IF (&param='apple') GOTO .gotfan IF (&param='cmd') GOTO .gotfan IF (&param='openapple') GOTO .gotfan IF (&param='shift') GOTO .gotshift IF (&param='ctl') GOTO .gotctl IF (&param='control') GOTO .gotctl IF (&param='ctrl') GOTO .gotctl IF (&param='cntl') GOTO .gotctl IF (&param='cntrl') GOTO .gotctl macerr 'Break macro: unable to decipher parameter.' .gotcaps and #%00000100 GOTO .didit .gotopt and #%01000000 GOTO .didit .gotfan and #%10000000 GOTO .didit .gotshift and #%00000001 GOTO .didit .gotctl and #%00000010 .didit beq ~b&SYSINDEX brk ~b&SYSINDEX ; MEND ;--------------------------------------------------------------------------- ; ; IsNil ; ; see if a longword is zero MACRO &lab IsNil &param &lab lda &param ora &param+2 MEND ;--------------------------------------------------------------------------- ; ; SetBorder <colour> ; ; set the border colour MACRO &lab SetBorder &param &lab lda >$E0C034 IF &nbr(&syslist) GOTO .setit and #$000F inc a and #$000F pha lda >$E0C034 and #$FFF0 ora 1,s sta >$E0C034 pla GOTO .exit .setit anop and #$FFF0 ora &param sta >$E0C034 .exit anop MEND MACRO &lab GetBorder &arg &lab lda >$e0c034 and #$f sta &arg MEND ;--------------------------------------------------------------------------- ; ; WaitKey <key> ; ; Wait for any key or for a specific key ; MACRO &lab WaitKey &param &lab ; ~b&SYSINDEX lda >$C000 and #$80 beq ~b&SYSINDEX IF &nbr(&syslist) GOTO .specfic sta >$C010 GOTO .exit .specfic anop lda >$C000 sta >$C010 and #$7F cmp &param bne ~b&SYSINDEX .exit anop MEND ;--------------------------------------------------------------------------- ; ; Click ; ; click the speaker MACRO &lab Click &lab lda >$00C030 MEND ;--------------------------------------------------------------------------- ; ; SetVol ; ; MACRO &lab SetVol &param &lab lda >$00C03C and #$FFF0 ora &param sta >$00C03C MEND ;--------------------------------------------------------------------------- ; ; RCall - register Call ; ; MACRO &lab RCall &routine,&in,&out &lab ; lcla &outnum lcla &innum lcla &count lclc &inreg lclc &outreg lclc &inp lclc &outp lclc &reg &innum seta &nbr(&in) &outnum seta &nbr(&out) IF ((&innum = 0) and (&in <20> '')) or ((&outnum = 0) and (&out <20> '')) THEN macerr 'RCall macro: all parameters to this macro must be in parentheses.' mexit ENDIF &count seta 1 IF &innum=0 GOTO .call IF &innum<4 GOTO .inloop macerr 'RCall macro: too many inputs (3 maximum)' mexit .inloop &inreg setc &substr(&in[&count],&len(&in[&count])-2,3) IF (&inreg<65>':ax') and (&inreg<65>':xy') and (&inreg<65>':ay') GOTO .in2 &reg setc &substr(&in[&count],&len(&in[&count])-1,2) &inp