(polycat.tal) Cleanup

This commit is contained in:
neauoire 2022-03-13 20:39:03 -07:00
parent 9e9313d064
commit 6ffedca0b4
1 changed files with 28 additions and 34 deletions

View File

@ -1,11 +1,5 @@
( polycat ) ( polycat )
%2// { #01 SFT2 }
%!~ { NEQk NIP }
%AUTO-XADDR { #05 .Screen/auto DEO }
( devices )
|00 @System &vector $2 &wst $1 &rst $1 &pad $4 &r $2 &g $2 &b $2 &debug $1 &halt $1 |00 @System &vector $2 &wst $1 &rst $1 &pad $4 &r $2 &g $2 &b $2 &debug $1 &halt $1
|20 @Screen &vector $2 &width $2 &height $2 &auto $1 &pad $1 &x $2 &y $2 &addr $2 &pixel $1 &sprite $1 |20 @Screen &vector $2 &width $2 &height $2 &auto $1 &pad $1 &x $2 &y $2 &addr $2 &pixel $1 &sprite $1
|90 @Mouse &vector $2 &x $2 &y $2 &state $1 &pad $3 &scrollx $2 &scrolly $2 |90 @Mouse &vector $2 &x $2 &y $2 &state $1 &pad $3 &scrollx $2 &scrolly $2
@ -14,18 +8,18 @@
|0000 |0000
@cat @cat
&x $2 &y $2 &timer $1 &x $2 &y $2 &timer $1
@pointer @pointer
&x $2 &y $2 &x $2 &y $2
( program ) ( program )
|0100 ( -> ) |0100 ( -> )
( theme ) ( theme )
#0a3f .System/r DEO2 #0a3f .System/r DEO2
#05df .System/g DEO2 #05df .System/g DEO2
#0caf .System/b DEO2 #0caf .System/b DEO2
( DOS resolution ) ( DOS resolution )
#0140 .Screen/width DEO2 #0140 .Screen/width DEO2
@ -33,10 +27,10 @@
( vectors ) ( vectors )
;on-mouse .Mouse/vector DEO2 ;on-mouse .Mouse/vector DEO2
( find center ) ( find center )
.Screen/width DEI2 2// .cat/x STZ2 .Screen/width DEI2 #01 SFT2 .cat/x STZ2
.Screen/height DEI2 2// .cat/y STZ2 .Screen/height DEI2 #01 SFT2 .cat/y STZ2
( set screen mode ) ( set screen mode auto-x )
AUTO-XADDR #05 .Screen/auto DEO
( init ) ( init )
#ff ;draw-eye/last STA #ff ;draw-eye/last STA
#ff ;draw-tail/last STA #ff ;draw-tail/last STA
@ -50,7 +44,7 @@ BRK
.cat/y LDZ2 #0018 ADD2 .Screen/y DEO2 .cat/y LDZ2 #0018 ADD2 .Screen/y DEO2
.cat/x LDZ2 #0010 SUB2 .Screen/x DEO2 .cat/x LDZ2 #0010 SUB2 .Screen/x DEO2
;ground .Screen/addr DEO2 ;ground .Screen/addr DEO2
#1000 #1000
&loop &loop
#01 .Screen/sprite DEO #01 .Screen/sprite DEO
INC GTHk ,&loop JCN INC GTHk ,&loop JCN
@ -92,7 +86,7 @@ BRK
DUP ,&last LDR NEQ ,&changed JCN DUP ,&last LDR NEQ ,&changed JCN
POP JMP2r &changed POP JMP2r &changed
( only redraw on change ) ( only redraw on change )
DUP DUP
#00 SWP ;eye ADD2 .Screen/addr DEO2 #00 SWP ;eye ADD2 .Screen/addr DEO2
.cat/y LDZ2 #0008 ADD2 .Screen/y DEO2 .cat/y LDZ2 #0008 ADD2 .Screen/y DEO2
.cat/x LDZ2 #0008 SUB2 .Screen/x DEO2 .cat/x LDZ2 #0008 SUB2 .Screen/x DEO2
@ -107,9 +101,9 @@ JMP2r
DUP ,&last LDR NEQ ,&changed JCN DUP ,&last LDR NEQ ,&changed JCN
POP JMP2r &changed POP JMP2r &changed
( only redraw on change ) ( only redraw on change )
DUP DUP
;frames ROT #00 SWP ADD2 LDA ;frames ROT #00 SWP ADD2 LDA
#00 SWP #40 SFT2 ;body/tail ADD2 #00 SWP #40 SFT2 ;body/tail ADD2
.Screen/addr DEO2 .Screen/addr DEO2
.cat/x LDZ2 .Screen/x DEO2 .cat/x LDZ2 .Screen/x DEO2
.cat/y LDZ2 #0010 ADD2 .Screen/y DEO2 .cat/y LDZ2 #0010 ADD2 .Screen/y DEO2
@ -122,27 +116,27 @@ JMP2r
@draw-cursor ( -- ) @draw-cursor ( -- )
( last cursor ) ( last cursor )
;cursor STH2k .Screen/addr DEO2 ;cursor STH2k .Screen/addr DEO2
.pointer/x LDZ2 .Screen/x DEO2 .pointer/x LDZ2 .Screen/x DEO2
.pointer/y LDZ2 .Screen/y DEO2 .pointer/y LDZ2 .Screen/y DEO2
#40 .Screen/sprite DEO #40 .Screen/sprite DEO
( new cursor ) ( new cursor )
STH2r .Screen/addr DEO2 STH2r .Screen/addr DEO2
.Mouse/x DEI2 DUP2 .pointer/x STZ2 .Screen/x DEO2 .Mouse/x DEI2 DUP2 .pointer/x STZ2 .Screen/x DEO2
.Mouse/y DEI2 DUP2 .pointer/y STZ2 .Screen/y DEO2 .Mouse/y DEI2 DUP2 .pointer/y STZ2 .Screen/y DEO2
#41 .Mouse/state DEI #00 NEQ ADD .Screen/sprite DEO #41 .Mouse/state DEI #00 NEQ ADD .Screen/sprite DEO
JMP2r JMP2r
@cursor @cursor
80c0 e0f0 f8e0 1000 80c0 e0f0 f8e0 1000
@frames @frames
00 01 02 03 02 01 00 00 00 01 02 03 02 01 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
@ears @ears
081c 3e3e 7f7f ffff 081c 3e3e 7f7f fffc 081c 3e3e 7f7f ffff 081c 3e3e 7f7f fffc
081c 3c3e 7e7e ffff 081c 3c3e 7e7e ff1f 081c 3c3e 7e7e ffff 081c 3c3e 7e7e ff1f
@eye @eye
ffff ffff ff7f 3f0f f7ef cfe7 f07c 3f0f ffff ffff ff7f 3f0f f7ef cfe7 f07c 3f0f
ffff ffff fffe fcf0 87c3 c183 071e fcf0 ffff ffff fffe fcf0 87c3 c183 071e fcf0
ffff ffff ff7f 3f0f f0e1 c1e0 f07c 3f0f ffff ffff ff7f 3f0f f0e1 c1e0 f07c 3f0f
@ -151,7 +145,7 @@ JMP2r
ffff ffff fffe fcf0 0783 c1c3 871e fcf0 ffff ffff fffe fcf0 0783 c1c3 871e fcf0
ffff ffff ff7f 3f0f f0e0 c1e1 f07c 3f0f ffff ffff ff7f 3f0f f0e0 c1e1 f07c 3f0f
ffff ffff fffe fcf0 07f3 f9fb f71e fcf0 ffff ffff fffe fcf0 07f3 f9fb f71e fcf0
@body @body
0707 0707 0302 0200 0107 0707 0300 0000 0707 0707 0302 0200 0107 0707 0300 0000
&tail &tail
e0f0 f0e0 e080 8000 c0f2 f9f9 fef8 b000 e0f0 f0e0 e080 8000 c0f2 f9f9 fef8 b000
@ -159,7 +153,7 @@ JMP2r
e0f0 f0e0 e080 8000 c0f2 faf9 fef8 b000 e0f0 f0e0 e080 8000 c0f2 faf9 fef8 b000
e0f0 f0e0 e080 8000 c0f1 faf9 fef8 b000 e0f0 f0e0 e080 8000 c0f1 faf9 fef8 b000
0707 0707 0f08 1000 0307 0707 0f00 0000 0707 0707 0f08 1000 0307 0707 0f00 0000
e0e0 e0e0 e080 8000 f2f9 f9fe b884 8400 e0e0 e0e0 e080 8000 f2f9 f9fe b884 8400
@ground @ground
bf00 5c02 0202 020c ef10 6f90 8080 8074 bf00 5c02 0202 020c ef10 6f90 8080 8074
ff00 fe01 0100 0116 fd00 3c40 4040 4028 ff00 fe01 0100 0116 fd00 3c40 4040 4028