Browse code

Cleanup polycat

neauoire authored on 01/05/2021 16:13:14
Showing 1 changed files
... ...
@@ -31,8 +31,6 @@
31 31
 	.Screen/width DEI2 #0002 / #0008 - .cat/x POK2
32 32
 	.Screen/height DEI2 #0004 / #0003 * #0018 - .cat/y POK2
33 33
 
34
-	( place polycat )
35
-
36 34
 	( vectors )
37 35
 	;on-mouse .Mouse/vector DEO2
38 36
 	;on-frame .Screen/vector DEO2
... ...
@@ -48,19 +46,19 @@ BRK
48 46
 
49 47
 	.Mouse/x DEI2 .cat/x PEK2 > #20 MUL
50 48
 	.Mouse/y DEI2 .cat/y PEK2 > #40 MUL
51
-	ADD #00 SWP ;draw-eye JSR2
49
+		ADD #00 SWP ;draw-eye JSR2
52 50
 
53 51
 BRK
54 52
 
55 53
 @on-frame ( -> )
56 54
 
57 55
 	.cat/timer PEK #01 ADD [ DUP ] .cat/timer POK
58
-	DUP #00 NEQ ,&skip0 JNZ #0000 ;draw-tail JSR2 &skip0
59
-	DUP #10 NEQ ,&skip1 JNZ #0001 ;draw-tail JSR2 &skip1
60
-	DUP #20 NEQ ,&skip2 JNZ #0002 ;draw-tail JSR2 &skip2
61
-	DUP #30 NEQ ,&skip3 JNZ #0003 ;draw-tail JSR2 &skip3
62
-	DUP #40 NEQ ,&skip4 JNZ #0002 ;draw-tail JSR2 &skip4
63
-	DUP #50 NEQ ,&skip5 JNZ #0001 ;draw-tail JSR2 &skip5
56
+		DUP #00 NEQ ,&skip0 JNZ #0000 ;draw-tail JSR2 &skip0
57
+		DUP #10 NEQ ,&skip1 JNZ #0001 ;draw-tail JSR2 &skip1
58
+		DUP #20 NEQ ,&skip2 JNZ #0002 ;draw-tail JSR2 &skip2
59
+		DUP #30 NEQ ,&skip3 JNZ #0003 ;draw-tail JSR2 &skip3
60
+		DUP #40 NEQ ,&skip4 JNZ #0002 ;draw-tail JSR2 &skip4
61
+		DUP #50 NEQ ,&skip5 JNZ #0001 ;draw-tail JSR2 &skip5
64 62
 	POP
65 63
 
66 64
 BRK
... ...
@@ -69,42 +67,39 @@ BRK
69 67
 
70 68
 	( ears )
71 69
 	.cat/y PEK2 .Screen/y DEO2
72
-
73
-	.cat/x PEK2 #0008 - .Screen/x DEO2
70
+	.cat/x PEK2 DUP2 STH2 #0008 - .Screen/x DEO2
74 71
 	;ears .Screen/addr DEO2
75 72
 	#41 .Screen/color DEO
76
-	.cat/x PEK2 .Screen/x DEO2
73
+	STH2r .Screen/x DEO2
77 74
 	;ears #0010 + .Screen/addr DEO2
78 75
 	#41 .Screen/color DEO
79 76
 
80
-	#0000 ;draw-eye JSR2
81
-	#0000 ;draw-tail JSR2
77
+	#0000 ,draw-eye JSR
78
+	#0000 ,draw-tail JSR
82 79
 
83 80
 RTN
84 81
 
85 82
 @draw-eye ( quad* -- )
86 83
 	
87 84
 	.cat/y PEK2 #0008 + .Screen/y DEO2
88
-	.cat/x PEK2 #0008 - .Screen/x DEO2
89
-
85
+	.cat/x PEK2 DUP2 STH2 #0008 - .Screen/x DEO2
90 86
 	DUP2 ;eye + .Screen/addr DEO2
91
-	#41 .Screen/color DEO
92
-	.cat/x PEK2 .Screen/x DEO2
87
+	( draw ) #41 .Screen/color DEO
88
+	STH2r .Screen/x DEO2
93 89
 	;eye #0010 + + .Screen/addr DEO2
94
-	#41 .Screen/color DEO
90
+	( draw ) #41 .Screen/color DEO
95 91
 
96 92
 RTN
97 93
 
98 94
 @draw-tail ( frame* -- )
99 95
 
100 96
 	.cat/y PEK2 #0010 + .Screen/y DEO2
101
-
102
-	.cat/x PEK2 #0008 - .Screen/x DEO2
97
+	.cat/x PEK2 DUP2 STH2 #0008 - .Screen/x DEO2
103 98
 	;body .Screen/addr DEO2
104
-	#41 .Screen/color DEO
105
-	.cat/x PEK2 .Screen/x DEO2
99
+	( draw ) #41 .Screen/color DEO
100
+	STH2r .Screen/x DEO2
106 101
 	#0010 * ;body #0010 + + .Screen/addr DEO2
107
-	#41 .Screen/color DEO
102
+	( draw ) #41 .Screen/color DEO
108 103
 
109 104
 RTN
110 105
 
... ...
@@ -115,13 +110,16 @@ RTN
115 110
 	.pointer/x PEK2 .Screen/x DEO2 
116 111
 	.pointer/y PEK2 .Screen/y DEO2 
117 112
 	#30 .Screen/color DEO
113
+
118 114
 	( record pointer positions )
119 115
 	.Mouse/x DEI2 .pointer/x POK2 
120 116
 	.Mouse/y DEI2 .pointer/y POK2
117
+
121 118
 	( draw new cursor )
122 119
 	;cursor .Screen/addr DEO2 
123 120
 	.pointer/x PEK2 .Screen/x DEO2 
124 121
 	.pointer/y PEK2 .Screen/y DEO2 
122
+
125 123
 	( colorize on state )
126 124
 	#31 [ .Mouse/state DEI #00 NEQ ] ADD .Screen/color DEO
127 125
 
... ...
@@ -135,10 +133,10 @@ RTN
135 133
 
136 134
 	#00 #10
137 135
 	&loop
138
-		#21 .Screen/color DEO
139
-		.Screen/addr DEI2 #0008 + .Screen/addr DEO2
140
-		.Screen/x DEI2 #0008 + .Screen/x DEO2
141
-		SWP #01 ADD SWP
136
+		( draw ) #21 .Screen/color DEO
137
+		( sety ) .Screen/addr DEI2 #0008 + .Screen/addr DEO2
138
+		( setx ) .Screen/x DEI2 #0008 + .Screen/x DEO2
139
+		( incr ) SWP #01 ADD SWP
142 140
 		DUP2 LTH ,&loop JNZ
143 141
 	POP2
144 142
 
... ...
@@ -172,5 +170,5 @@ RTN
172 170
 	e0e0 e0e0 e080 8000 f2f9 f9fe b884 8400 ]
173 171
 
174 172
 @ground [
175
-	bf15 0210 0200 0200 ff55 aa54 a900 2000
176
-	fb55 aa45 2200 0400 ba40 a040 8880 0080 ]
177 173
\ No newline at end of file
174
+	bf00 5c02 0202 020c ef10 6f90 8080 8074
175
+	ff00 fe01 0100 0116 fd00 3c40 4040 4028 ]