Browse code

(polycat.tal) Cleanup

neauoire authored on 14/03/2022 03:39:03
Showing 1 changed files
... ...
@@ -1,11 +1,5 @@
1 1
 ( polycat )
2 2
 
3
-%2// { #01 SFT2 }
4
-%!~  { NEQk NIP }
5
-%AUTO-XADDR  { #05 .Screen/auto DEO }
6
-
7
-( devices )
8
-
9 3
 |00 @System     &vector $2 &wst      $1 &rst    $1 &pad    $4 &r      $2 &g       $2 &b       $2 &debug  $1 &halt $1
10 4
 |20 @Screen     &vector $2 &width    $2 &height $2 &auto   $1 &pad    $1 &x       $2 &y       $2 &addr   $2 &pixel  $1 &sprite $1
11 5
 |90 @Mouse      &vector $2 &x        $2 &y      $2 &state  $1 &pad    $3 &scrollx $2 &scrolly $2
... ...
@@ -14,18 +8,18 @@
14 8
 
15 9
 |0000
16 10
 
17
-@cat     
11
+@cat
18 12
 	&x $2 &y $2 &timer $1
19
-@pointer 
13
+@pointer
20 14
 	&x $2 &y $2
21 15
 
22 16
 ( program )
23 17
 
24 18
 |0100 ( -> )
25 19
 	
26
-	( theme ) 
27
-	#0a3f .System/r DEO2 
28
-	#05df .System/g DEO2 
20
+	( theme )
21
+	#0a3f .System/r DEO2
22
+	#05df .System/g DEO2
29 23
 	#0caf .System/b DEO2
30 24
 	( DOS resolution )
31 25
 	#0140 .Screen/width DEO2
... ...
@@ -33,10 +27,10 @@
33 27
 	( vectors )
34 28
 	;on-mouse .Mouse/vector DEO2
35 29
 	( find center )
36
-	.Screen/width DEI2 2// .cat/x STZ2
37
-	.Screen/height DEI2 2// .cat/y STZ2
38
-	( set screen mode )
39
-	AUTO-XADDR
30
+	.Screen/width DEI2 #01 SFT2 .cat/x STZ2
31
+	.Screen/height DEI2 #01 SFT2 .cat/y STZ2
32
+	( set screen mode auto-x )
33
+	#05 .Screen/auto DEO
40 34
 	( init )
41 35
 	#ff ;draw-eye/last STA
42 36
 	#ff ;draw-tail/last STA
... ...
@@ -50,7 +44,7 @@ BRK
50 44
 	.cat/y LDZ2 #0018 ADD2 .Screen/y DEO2
51 45
 	.cat/x LDZ2 #0010 SUB2 .Screen/x DEO2
52 46
 	;ground .Screen/addr DEO2
53
-	#1000 
47
+	#1000
54 48
 	&loop
55 49
 		#01 .Screen/sprite DEO
56 50
 		INC GTHk ,&loop JCN
... ...
@@ -92,7 +86,7 @@ BRK
92 86
 	DUP ,&last LDR NEQ ,&changed JCN
93 87
 		POP JMP2r &changed
94 88
 	( only redraw on change )
95
-	DUP 
89
+	DUP
96 90
 	#00 SWP ;eye ADD2 .Screen/addr DEO2
97 91
 	.cat/y LDZ2 #0008 ADD2 .Screen/y DEO2
98 92
 	.cat/x LDZ2 #0008 SUB2 .Screen/x DEO2
... ...
@@ -107,9 +101,9 @@ JMP2r
107 101
 	DUP ,&last LDR NEQ ,&changed JCN
108 102
 		POP JMP2r &changed
109 103
 	( only redraw on change )
110
-	DUP 
111
-	;frames ROT #00 SWP ADD2 LDA 
112
-	#00 SWP #40 SFT2 ;body/tail ADD2 
104
+	DUP
105
+	;frames ROT #00 SWP ADD2 LDA
106
+	#00 SWP #40 SFT2 ;body/tail ADD2
113 107
 		.Screen/addr DEO2
114 108
 	.cat/x LDZ2 .Screen/x DEO2
115 109
 	.cat/y LDZ2 #0010 ADD2 .Screen/y DEO2
... ...
@@ -122,27 +116,27 @@ JMP2r
122 116
 @draw-cursor ( -- )
123 117
 	
124 118
 	( last cursor )
125
-	;cursor STH2k .Screen/addr DEO2 
126
-	.pointer/x LDZ2 .Screen/x DEO2 
127
-	.pointer/y LDZ2 .Screen/y DEO2 
119
+	;cursor STH2k .Screen/addr DEO2
120
+	.pointer/x LDZ2 .Screen/x DEO2
121
+	.pointer/y LDZ2 .Screen/y DEO2
128 122
 	#40 .Screen/sprite DEO
129 123
 	( new cursor )
130
-	STH2r .Screen/addr DEO2 
124
+	STH2r .Screen/addr DEO2
131 125
 	.Mouse/x DEI2 DUP2 .pointer/x STZ2 .Screen/x DEO2
132
-	.Mouse/y DEI2 DUP2 .pointer/y STZ2 .Screen/y DEO2 
126
+	.Mouse/y DEI2 DUP2 .pointer/y STZ2 .Screen/y DEO2
133 127
 	#41 .Mouse/state DEI #00 NEQ ADD .Screen/sprite DEO
134 128
 
135 129
 JMP2r
136 130
 
137
-@cursor 
138
-	80c0 e0f0 f8e0 1000 
131
+@cursor
132
+	80c0 e0f0 f8e0 1000
139 133
 @frames
140 134
 	00 01 02 03 02 01 00 00
141 135
 	00 00 00 00 00 00 00 00
142
-@ears 
136
+@ears
143 137
 	081c 3e3e 7f7f ffff 081c 3e3e 7f7f fffc
144
-	081c 3c3e 7e7e ffff 081c 3c3e 7e7e ff1f 
145
-@eye 
138
+	081c 3c3e 7e7e ffff 081c 3c3e 7e7e ff1f
139
+@eye
146 140
 	ffff ffff ff7f 3f0f f7ef cfe7 f07c 3f0f
147 141
 	ffff ffff fffe fcf0 87c3 c183 071e fcf0
148 142
 	ffff ffff ff7f 3f0f f0e1 c1e0 f07c 3f0f
... ...
@@ -151,7 +145,7 @@ JMP2r
151 145
 	ffff ffff fffe fcf0 0783 c1c3 871e fcf0
152 146
 	ffff ffff ff7f 3f0f f0e0 c1e1 f07c 3f0f
153 147
 	ffff ffff fffe fcf0 07f3 f9fb f71e fcf0
154
-@body 
148
+@body
155 149
 	0707 0707 0302 0200 0107 0707 0300 0000
156 150
 	&tail
157 151
 	e0f0 f0e0 e080 8000 c0f2 f9f9 fef8 b000
... ...
@@ -159,7 +153,7 @@ JMP2r
159 153
 	e0f0 f0e0 e080 8000 c0f2 faf9 fef8 b000
160 154
 	e0f0 f0e0 e080 8000 c0f1 faf9 fef8 b000
161 155
 	0707 0707 0f08 1000 0307 0707 0f00 0000
162
-	e0e0 e0e0 e080 8000 f2f9 f9fe b884 8400 
163
-@ground 
156
+	e0e0 e0e0 e080 8000 f2f9 f9fe b884 8400
157
+@ground
164 158
 	bf00 5c02 0202 020c ef10 6f90 8080 8074
165
-	ff00 fe01 0100 0116 fd00 3c40 4040 4028 
159
+	ff00 fe01 0100 0116 fd00 3c40 4040 4028