Housekeeping
This commit is contained in:
parent
878f606081
commit
6de8f677d0
|
@ -7,14 +7,7 @@
|
|||
|80 @Controller &vector $2 &button $1 &key $1
|
||||
|90 @Mouse &vector $2 &x $2 &y $2 &state $1 &wheel $1
|
||||
|
||||
|0000
|
||||
|
||||
@world &frame $1 &count $2
|
||||
@anchor &x $2 &y $2 &x2 $2 &y2 $2
|
||||
@pointer &x $2 &y $2
|
||||
|
||||
|0100 ( -> )
|
||||
|
||||
( theme )
|
||||
#970f .System/r DEO2
|
||||
#7d0f .System/g DEO2
|
||||
|
@ -26,26 +19,21 @@
|
|||
;on-mouse .Mouse/vector DEO2
|
||||
draw-border
|
||||
draw-blocks
|
||||
|
||||
BRK
|
||||
|
||||
(
|
||||
@|vectors )
|
||||
|
||||
@on-mouse ( -> )
|
||||
|
||||
[ LIT2 00 -Mouse/state ] DEI NEQ #41 ADD ;cursor-icn update-cursor
|
||||
.Mouse/state DEI ?&on-touch
|
||||
|
||||
BRK
|
||||
|
||||
&on-touch ( -> )
|
||||
|
||||
.Mouse/x DEI2 #0008 SUB2 NIP #18 DIV
|
||||
.Mouse/y DEI2 #0008 SUB2 NIP #18 DIV
|
||||
;try-move ;try-move/cc .Mouse/state DEI #01 GTH JMP SWP2 POP2 JSR2
|
||||
;try-move ;try-move/cc .Mouse/state DEI #01 GTH [ JMP SWP2 POP2 ] JSR2
|
||||
#00 .Mouse/state DEO
|
||||
|
||||
BRK
|
||||
|
||||
(
|
||||
|
@ -60,7 +48,6 @@ BRK
|
|||
&l
|
||||
#00 OVR #0006 MUL2 ;game ADD2 [ LIT2 &t $2 ] is-at ?&found
|
||||
INC GTHk ?&l
|
||||
&end
|
||||
POP2
|
||||
#ffff
|
||||
JMP2r
|
||||
|
@ -72,17 +59,13 @@ JMP2r
|
|||
JMP2r
|
||||
|
||||
@is-at ( block* x y -- f )
|
||||
|
||||
OVR2 LDA2 STH2
|
||||
SWP2 INC2 INC2 LDA2 SUB2
|
||||
STHr LTH
|
||||
SWP STHr LTH AND
|
||||
|
||||
JMP2r
|
||||
|
||||
@try-move ( x y -- )
|
||||
|
||||
#01 phex/b #2018 DEO
|
||||
pick
|
||||
DUP2 #ffff EQU2 ?&blank
|
||||
DUP2 #0000 EQU2 ?&blank
|
||||
|
@ -91,10 +74,8 @@ JMP2r
|
|||
( left ) #ff00 OVR2 OVR2 can-move ?&move POP2
|
||||
( right ) #0001 OVR2 OVR2 can-move ?&move POP2
|
||||
POP2
|
||||
|
||||
JMP2r
|
||||
&cc ( x y -- )
|
||||
#00 phex/b #2018 DEO
|
||||
pick
|
||||
DUP2 #ffff EQU2 ?&blank
|
||||
DUP2 #0000 EQU2 ?&blank
|
||||
|
@ -110,20 +91,12 @@ JMP2r
|
|||
SWP
|
||||
LDAkr STHr ADD STH2kr STA INC2r
|
||||
LDAkr STHr ADD STH2r STA
|
||||
draw-blocks
|
||||
JMP2r
|
||||
!draw-blocks
|
||||
&blank ( block* -- )
|
||||
POP2
|
||||
JMP2r
|
||||
|
||||
@is-free ( x y -- f )
|
||||
|
||||
POP2 #00
|
||||
|
||||
JMP2r
|
||||
|
||||
@can-move ( block* x y -- f )
|
||||
|
||||
OVR2 ,&self STR2
|
||||
OVR2 STH2 INC2r INC2r LDA2r
|
||||
STHr ADD ,&offy STR
|
||||
|
@ -131,7 +104,6 @@ JMP2r
|
|||
LDA2
|
||||
,&height STR
|
||||
,&width STR
|
||||
|
||||
[ LIT2 &height $1 00 ]
|
||||
&v
|
||||
STHk
|
||||
|
@ -150,56 +122,35 @@ JMP2r
|
|||
INC GTHk ?&v
|
||||
POP2
|
||||
#01
|
||||
|
||||
JMP2r
|
||||
|
||||
@game ( size, pos ) [
|
||||
&a 0202 0000 =draw-a
|
||||
&b 0201 0200 =draw-b
|
||||
&v 0201 0201 =draw-v
|
||||
&w 0101 0002 =draw-w
|
||||
&x 0101 0102 =draw-x
|
||||
&d 0102 0003 =draw-d
|
||||
&y 0102 0103 =draw-y
|
||||
&z 0201 0203 =draw-z
|
||||
&c 0201 0204 =draw-c ]
|
||||
|
||||
(
|
||||
@|drawing )
|
||||
|
||||
|
||||
@draw-blocks ( -- )
|
||||
|
||||
#0900
|
||||
&l
|
||||
#00 OVR draw-block
|
||||
INC GTHk ?&l
|
||||
POP2
|
||||
|
||||
JMP2r
|
||||
|
||||
@clear-block ( id* -- )
|
||||
|
||||
#00 ;draw-times/color STA
|
||||
INC2 INC2 LDA2k to-screen
|
||||
INC2 INC2 LDA2 JSR2
|
||||
#81 ;draw-times/color STA
|
||||
|
||||
JMP2r
|
||||
|
||||
@draw-block ( id* -- )
|
||||
|
||||
#0006 MUL2 ;game ADD2
|
||||
INC2 INC2 LDA2k to-screen
|
||||
INC2 INC2 LDA2 JSR2
|
||||
|
||||
JMP2r
|
||||
INC2 INC2 LDA2
|
||||
JMP2
|
||||
|
||||
@to-screen ( x y -- )
|
||||
|
||||
#00 SWP #0018 MUL2 #0008 ADD2 .Screen/y DEO2
|
||||
#00 SWP #0018 MUL2 #0008 ADD2 .Screen/x DEO2
|
||||
|
||||
JMP2r
|
||||
|
||||
@draw-a ( -- ) ;blocks-chr/a .Screen/addr DEO2 #56 .Screen/auto DEO #06 !draw-times
|
||||
|
@ -213,20 +164,17 @@ JMP2r
|
|||
@draw-21 ( addr* -- ) .Screen/addr DEO2 #56 .Screen/auto DEO #03 !draw-times
|
||||
@draw-y ( -- ) ;blocks-chr/y !draw-12
|
||||
@draw-d ( -- ) ;blocks-chr/d
|
||||
@draw-12 ( addr* -- ) .Screen/addr DEO2 #26 .Screen/auto DEO #06 !draw-times
|
||||
@draw-12 ( addr* -- ) .Screen/addr DEO2 #26 .Screen/auto DEO #06 ( >> )
|
||||
|
||||
@draw-times ( times -- )
|
||||
|
||||
#00 SWP SUB
|
||||
&l
|
||||
[ LIT &color 81 ] .Screen/sprite DEO
|
||||
INC DUP ?&l
|
||||
POP
|
||||
|
||||
JMP2r
|
||||
|
||||
@draw-border ( -- )
|
||||
|
||||
( top corners )
|
||||
#00 .Screen/auto DEO
|
||||
#0000 .Screen/y DEO2
|
||||
|
@ -262,7 +210,6 @@ JMP2r
|
|||
#0068 .Screen/x DEO2
|
||||
;frame-chr/mr .Screen/addr DEO2
|
||||
#81 .Screen/sprite DEO
|
||||
|
||||
JMP2r
|
||||
|
||||
@update-cursor ( color addr* -- )
|
||||
|
@ -278,9 +225,18 @@ JMP2r
|
|||
JMP2r
|
||||
|
||||
(
|
||||
@|stdlib )
|
||||
@|state )
|
||||
|
||||
@phex ( short* -- ) SWP phex/b &b DUP #04 SFT phex/c &c #0f AND DUP #09 GTH #27 MUL ADD #30 ADD #18 DEO JMP2r
|
||||
@game ( size, pos ) [
|
||||
&a 0202 0000 =draw-a
|
||||
&b 0201 0200 =draw-b
|
||||
&v 0201 0201 =draw-v
|
||||
&w 0101 0002 =draw-w
|
||||
&x 0101 0102 =draw-x
|
||||
&d 0102 0003 =draw-d
|
||||
&y 0102 0103 =draw-y
|
||||
&z 0201 0203 =draw-z
|
||||
&c 0201 0204 =draw-c ]
|
||||
|
||||
(
|
||||
@|assets )
|
||||
|
|
Loading…
Reference in New Issue