93 lines
1.8 KiB
Tal
93 lines
1.8 KiB
Tal
( launcher )
|
|
|
|
%+ { ADD } %- { SUB } %* { MUL } %/ { DIV }
|
|
%< { LTH } %> { GTH } %= { EQU } %! { NEQ }
|
|
%++ { ADD2 } %-- { SUB2 } %** { MUL2 } %// { DIV2 }
|
|
%<< { LTH2 } %>> { GTH2 } %== { EQU2 } %!! { NEQ2 }
|
|
|
|
%AUTO-X { #01 .Screen/auto DEO }
|
|
%AUTO-Y { #02 .Screen/auto DEO }
|
|
%AUTO-YADDR { #06 .Screen/auto DEO }
|
|
|
|
%RTN { JMP2r }
|
|
%2// { #01 SFT2 }
|
|
|
|
( devices )
|
|
|
|
|20 @Screen &vector $2 &width $2 &height $2 &auto $1 &pad $1 &x $2 &y $2 &addr $2 &pixel $1 &sprite $1
|
|
|
|
( variables )
|
|
|
|
|0000
|
|
|
|
( init )
|
|
|
|
|0100 ( -> )
|
|
|
|
;draw-cross JSR2
|
|
|
|
AUTO-YADDR
|
|
#0010 #0000
|
|
&wst
|
|
( working stack )
|
|
#0010 .Screen/y DEO2
|
|
DUP2 #0018 ** #0010 ++ .Screen/x DEO2
|
|
DUP #fe00 LDA ( ptr ) EQU #41 + STH
|
|
DUP2 #fe01 ++ LDA STHr ;draw-hex JSR2
|
|
( return stack )
|
|
#0028 .Screen/y DEO2
|
|
DUP2 #0018 ** #0010 ++ .Screen/x DEO2
|
|
DUP #ff00 LDA ( ptr ) EQU #41 + STH
|
|
DUP2 #ff01 ++ LDA STHr ;draw-hex JSR2
|
|
INC2 GTH2k ,&wst JCN
|
|
POP2 POP2
|
|
|
|
BRK
|
|
|
|
@draw-cross ( -- )
|
|
|
|
( ver )
|
|
AUTO-Y
|
|
#0000 .Screen/y DEO2
|
|
.Screen/width DEI2 2// .Screen/x DEO2
|
|
.Screen/height DEI2 #0000
|
|
&ver
|
|
#43 .Screen/pixel DEO
|
|
.Screen/y DEI2k INC2 ROT DEO2
|
|
INC2 GTH2k ,&ver JCN
|
|
POP2 POP2
|
|
|
|
( hor )
|
|
AUTO-X
|
|
#0000 .Screen/x DEO2
|
|
.Screen/height DEI2 2// .Screen/y DEO2
|
|
.Screen/width DEI2 #0000
|
|
&hor
|
|
#43 .Screen/pixel DEO
|
|
.Screen/x DEI2k INC2 ROT DEO2
|
|
INC2 GTH2k ,&hor JCN
|
|
POP2 POP2
|
|
|
|
RTN
|
|
|
|
@draw-hex ( byte color -- )
|
|
|
|
STH
|
|
DUP #04 SFT ,&parse JSR STHkr ,draw-char JSR
|
|
#0f AND ,&parse JSR STHr ,draw-char JSR
|
|
|
|
RTN
|
|
&parse ( byte -- char ) DUP #09 GTH ,&above JCN #30 ADD JMP2r
|
|
&above #57 ADD JMP2r
|
|
|
|
@draw-char ( char color -- )
|
|
|
|
SWP
|
|
[ #20 - #00 SWP #40 SFT2 ;font ++ ] .Screen/addr DEO2
|
|
.Screen/sprite DEOk DEO
|
|
.Screen/x DEI2k #0008 ++ ROT DEO2
|
|
.Screen/y DEI2k #0010 -- ROT DEO2
|
|
|
|
JMP2r
|
|
|
|
~projects/assets/msx01x02.tal |