-
Notifications
You must be signed in to change notification settings - Fork 1
/
pseudo iceage_ny.txt
240 lines (240 loc) · 6.38 KB
/
pseudo iceage_ny.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
CONST PCR 64
CONST PCD 65
CONST joystick 66
CONST still 0 -- 000
CONST up 7 -- 111
CONST right 5 -- 101
CONST down 6 -- 110
CONST left 4 -- 100
CONST wait_time1 240
CONST wait_time2 240
CONST wait_time3 240
CONST player_start_position 232
CONST var_dir 0 -- 0000 0000
CONST var_temp 1 -- 0000 0010
CONST var_tile 2 -- 0000 0011
CONST var_count1 3
CONST var_count2 4
const var_count3 5
L1:
CMP joystick IMED still --z set high if no joystick signal
ADD joystick IMED 0 var_dir
NOP --allow vardir to settle for comparison
BRF L1 Z --keep waiting for joystick values
CMP var_dir IMED up
NOP --allow flag to settle before branch
BRF L2.1 Z
CMP var_dir IMED right
NOP --allow flag to settle before branch
BRF L3.1 Z
CMP var_dir IMED down
NOP --allow flag to settle before branch
BRF L4.1 Z
NOP
BRA L5.1
L6:
MOVE wait_time1 var_count1
L6.3:
MOVE wait_time2 var_count2
L6.2:
MOVE wait_time3 var_count3
NOP
NOP
L6.1:
SUB var_count3 imed 1 var_count3
NOP
BRF L6.1 N
NOP
SUB var_count2 imed 1 var_count2
NOP
BRF L6.2 N
NOP
SUB var_count1 imed 1 var_count1
NOP
BRF L6.3 N
NOP --direction selection
CMP var_dir IMED up
NOP --allow flag to settle before branch
BRF L2.2 Z
CMP var_dir IMED right
NOP --allow flag to settle before branch
BRF L3.2 Z
CMP var_dir IMED down
NOP --allow flag to settle before branch
BRF L4.2 Z
NOP --dodge unconditional branch
BRA L5.2
L2:
COL PCR var_tile --up
NOP --allow var_tile to settle for comp
NOP --allow var_tile to settle for comp
CMP var_tile IMED 2 --ground
NOP --allow flag to settle before branch
BRF L1 Z
L2.1:
COL PCR var_tile
NOP
NOP
CMP var_tile IMED 3 --reached goal
NOP --allow flag to settle before branch
BRF L9 Z
CMP PCR IMED $10
NOP --allow flag to settle before branch
BRF L1 N --hit ceiling
NOP --dodge sub
SUB PCR IMED 16 var_temp
NOP --allow var_temp to settle before tile_access
NOP --allow var_temp to settle before tile access
COL var_temp var_tile
NOP --allow var_tile to settle before comp
NOP --allow var_tile to settle before comp
CMP var_tile IMED 1 --hit rock
NOP --allow flag to settle before branch
BRF L1 Z
NOP --dodge sub
SUB PCR IMED 16 PCR
MOVE $E0 PCD
BRA L6
NOP --dodge sub
L2.2:
SUB pcd IMED 16 pcd --L2.2
NOP --allow flag to settle before branch
BRF L2 Z
NOP --dodge unconditional branch
BRA L6
L3:
COL PCR var_tile --L3
NOP --allow var_tile to settle before comp
NOP --allow var_tile to settle before comp
CMP var_tile IMED 2 --ground
NOP --allow flag to settle before branch
BRF L1 Z
L3.1:
COL PCR var_tile
NOP
NOP
CMP var_tile IMED 3 --reached goal
NOP --allow flag to settle before branch
BRF L9 Z
SHIFT PCR var_temp
NOP --allow var_temp to settle before comp
NOP --allow var_temp to settle before comp
CMP var_temp IMED $F0
NOP --allow flag to settle before branch
BRF L1 Z --hit right wall
NOP --dodge add
ADD PCR IMED 1 var_temp
NOP --allow var_temp to settle before tile_access
NOP --allow var_temp to settle before tile_access
COL var_temp var_tile
NOP --allow var_tile to settle before comp
NOP --allow var_tile to settle before comp
CMP var_tile IMED 1 --hit rock
NOP --allow flag to settle before branch
BRF L1 Z
NOP --dodge assignment
MOVE 1 PCD
BRA L6
L3.2:
CMP pcd IMED 16 --L3.2
NOP --allow flag to settle before branch
BRF L3 Z
CMP pcd IMED 15
NOP --allow flag to settle before branch
BRF L3.3 Z
NOP --dodge add
ADD pcd IMED 1 pcd
BRA L6
NOP --dodge assignment
L3.3:
MOVE 0 pcd
ADD PCR IMED 1 PCR
BRA L6
L4:
COL PCR var_tile
NOP --allow var_tile to settle before comp
NOP --allow var_tile to settle before comp
CMP var_tile IMED 2 --ground
NOP --allow flag to settle before branch
BRF L1 Z
L4.1:
COL PCR var_tile
NOP
NOP
CMP var_tile IMED 3 --reached goal
NOP
BRF L9 Z
MOVE $EF var_temp
NOP --allow var_temp to settle before comp
NOP --allow var_temp to settle before comp
CMP var_temp DIR PCR
NOP --allow flag to settle before branch
BRF L1 N --hit floor
ADD PCR IMED 16 var_temp
NOP --allow var_temp to settle before tile_access
NOP --allow var_temp to settle before tile_access
COL var_temp var_tile
NOP --allow var_tile to settle before comp
NOP --allow var_tile to settle before comp
CMP var_tile IMED 1 --hit rock
NOP --allow flag to settle before branch
BRF L1 Z
NOP --dodge assignment
MOVE $10 PCD
BRA L6
NOP --dodge add
L4.2:
ADD pcd IMED 16 pcd --L4.2
NOP --allow flag to settle before branch
BRF L4.3 N
NOP --dodge unconditional branch
BRA L6
NOP --dodge add
L4.3:
ADD PCR IMED 16 PCR --L4.3
BRA L4
L5:
COL PCR var_tile --L5
NOP --allow var_tile to settle before comp
NOP --allow var_tile to settle before comp
CMP var_tile IMED 2 --ground
NOP --allow flag to settle before branch
BRF L1 Z --reached goal
L5.1:
COL PCR var_tile
NOP
NOP
CMP var_tile IMED 3 --reached goal
NOP --allow flag to settle before branch
BRF L1 Z
SHIFT PCR var_temp
NOP --allow var_temp to settle before comp
NOP --allow var_temp to settle before comp
CMP var_temp IMED 0
NOP --allow flag to settle before branch
BRF L1 Z --hit left wall
SUB PCR IMED 1 var_temp
NOP --allow var_temp to settle before tile_access
NOP --allow var_temp to settle before tile_access
COL var_temp var_tile
NOP --allow var_tile to settle before comp
NOP --allow var_tile to settle before comp
CMP var_tile IMED 1 --hit rock
NOP --allow flag to settle before branch
BRF L1 Z
NOP --dodge sub
SUB PCR IMED 1 PCR
MOVE $0F PCD
BRA L6
L5.2:
CMP PCD IMED 0 --L5.2
NOP --allow flag to settle before branch
BRF L5 Z
NOP --dodge sub
SUB PCD IMED 1 PCD
BRA L6
NOP --dodge assignment
L9:
MOVE player_start_position PCR
BRA L1 --restart game
NOP