mirror of
https://github.com/antoinevignau/source.git
synced 2025-01-08 13:29:45 +00:00
1 line
8.5 KiB
Plaintext
1 line
8.5 KiB
Plaintext
|
;--------------------------------------------------------------------------
;
; 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 ¶m
&lab ;
IF &nbr(&syslist) GOTO .gotone
macerr 'Break macro: no input parameter specified.'
mexit
.gotone
lda >$00C025
IF (¶m='cap') GOTO .gotcaps
IF (¶m='caps') GOTO .gotcaps
IF (¶m='capslock') GOTO .gotcaps
IF (¶m='opt') GOTO .gotopt
IF (¶m='option') GOTO .gotopt
IF (¶m='closedapple') GOTO .gotopt
IF (¶m='fan') GOTO .gotfan
IF (¶m='apple') GOTO .gotfan
IF (¶m='cmd') GOTO .gotfan
IF (¶m='openapple') GOTO .gotfan
IF (¶m='shift') GOTO .gotshift
IF (¶m='ctl') GOTO .gotctl
IF (¶m='control') GOTO .gotctl
IF (¶m='ctrl') GOTO .gotctl
IF (¶m='cntl') GOTO .gotctl
IF (¶m='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 ¶m
&lab lda ¶m
ora ¶m+2
MEND
;---------------------------------------------------------------------------
;
; SetBorder <colour>
;
; set the border colour
MACRO
&lab SetBorder ¶m
&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 ¶m
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 ¶m
&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 ¶m
bne ~b&SYSINDEX
.exit anop
MEND
;---------------------------------------------------------------------------
;
; Click
;
; click the speaker
MACRO
&lab Click
&lab lda >$00C030
MEND
;---------------------------------------------------------------------------
;
; SetVol
;
;
MACRO
&lab SetVol ¶m
&lab lda >$00C03C
and #$FFF0
ora ¶m
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 ®
&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
® setc &substr(&in[&count],&len(&in[&count])-1,2)
&inp
|