| author | brandonlw |
| Thu, 15 May 2014 01:54:30 -0400 | |
| changeset 37 | 9cdbb6464f89 |
| parent 36 | 2fca899545cf |
| child 38 | a4c5f839b738 |
| permissions | -rw-r--r-- |
| 7 | 1 |
coorMon: |
|
19
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
2 |
res g_style_active, (iy+sGrFlags) |
|
16
27ca02d0d8aa
Give meaningful names to the page 0 calls we know about so far.
brandonlw
parents:
13
diff
changeset
|
3 |
call j_CursorOff |
|
27ca02d0d8aa
Give meaningful names to the page 0 calls we know about so far.
brandonlw
parents:
13
diff
changeset
|
4 |
call j_COORDISP |
| 36 | 5 |
Mon: call j_RunIndicOff |
|
16
27ca02d0d8aa
Give meaningful names to the page 0 calls we know about so far.
brandonlw
parents:
13
diff
changeset
|
6 |
call j_CursorOn |
| 36 | 7 |
res displayCoords, (iy+newDispF) |
8 |
bit sendFinalPacketOnMon, (iy+linkFlags2) |
|
9 |
jr z, Mon_NoPacketSend |
|
| 4 | 10 |
di |
| 36 | 11 |
res sendFinalPacketOnMon, (iy+linkFlags2) |
12 |
ld hl, Mon_ResetIndicOnly |
|
| 4 | 13 |
call pushErrorHandleR |
|
19
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
14 |
set indicOnly, (iy+indicFlags) |
| 8 | 15 |
ld a, (mcxCurApp) |
| 36 | 16 |
cp kError |
17 |
jr nz, {+}
|
|
| 8 | 18 |
ld a, (errNo) |
|
16
27ca02d0d8aa
Give meaningful names to the page 0 calls we know about so far.
brandonlw
parents:
13
diff
changeset
|
19 |
call j_SendSkipExitPacket |
| 36 | 20 |
jr Mon_LinkEnd |
21 |
+: call j_SendAck |
|
22 |
Mon_LinkEnd: |
|
| 4 | 23 |
call popErrorHandleR |
| 36 | 24 |
Mon_ResetIndicOnly: |
|
19
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
25 |
res indicOnly, (iy+indicFlags) |
| 4 | 26 |
ei |
| 36 | 27 |
Mon_NoPacketSend: |
| 8 | 28 |
xor a |
29 |
ld (kbdKey), a |
|
30 |
ld (keyExtend), a |
|
|
16
27ca02d0d8aa
Give meaningful names to the page 0 calls we know about so far.
brandonlw
parents:
13
diff
changeset
|
31 |
call j_getkey |
| 7 | 32 |
monForceKey: |
| 37 | 33 |
res recallingPrgmName, (iy+rclFlag2) |
34 |
res recallingListName, (iy+rclFlag3) |
|
| 8 | 35 |
ld (kbdKey), a |
36 |
bit 0, (iy+2) |
|
37 |
jr z, page0_433 |
|
|
19
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
38 |
res curAble, (iy+curFlags) |
|
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
39 |
bit curOn, (iy+curFlags) |
|
16
27ca02d0d8aa
Give meaningful names to the page 0 calls we know about so far.
brandonlw
parents:
13
diff
changeset
|
40 |
call z, j_BLINKGCUR |
| 8 | 41 |
ld a, (kbdKey) |
42 |
jr page0_436 |
|
| 4 | 43 |
|
| 7 | 44 |
page0_433: |
|
16
27ca02d0d8aa
Give meaningful names to the page 0 calls we know about so far.
brandonlw
parents:
13
diff
changeset
|
45 |
call j_CursorOff |
| 7 | 46 |
page0_436: |
|
16
27ca02d0d8aa
Give meaningful names to the page 0 calls we know about so far.
brandonlw
parents:
13
diff
changeset
|
47 |
call j_RunIndicOn |
| 8 | 48 |
or a |
49 |
jr nz, page0_44D |
|
|
19
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
50 |
bit appWantIntrpt, (iy+appFlags) |
| 8 | 51 |
jr nz, page0_448 |
| 4 | 52 |
|
53 |
page0_442: |
|
|
19
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
54 |
res onInterrupt, (iy+onFlags) |
| 8 | 55 |
jr page0_4B2 |
| 4 | 56 |
|
| 7 | 57 |
page0_448: |
| 8 | 58 |
ld a, 5 |
59 |
jp sendKPress |
|
| 4 | 60 |
|
| 7 | 61 |
page0_44D: |
| 8 | 62 |
cp 0B4h ; 'ԧ |
63 |
jr nz, page0_470 |
|
64 |
ld a, 0CCh ; '̧ |
|
| 27 | 65 |
call IsFunctionMode |
| 8 | 66 |
jr nz, page0_46D |
67 |
ld a, 0ADh ; 'ͧ |
|
| 4 | 68 |
sub_45A: |
| 27 | 69 |
call IsParametricMode |
| 8 | 70 |
jr nz, page0_46D |
71 |
ld a, 0B1h ; 'ѧ |
|
| 4 | 72 |
page0_461: |
| 27 | 73 |
call IsFuncMode |
| 8 | 74 |
jr nz, page0_46D |
75 |
ld a, 0E8h ; '觍 |
|
76 |
ld (keyExtend), a |
|
| 11 | 77 |
ld a, 0FEh |
| 7 | 78 |
page0_46D: |
| 8 | 79 |
ld (kbdKey), a |
| 7 | 80 |
page0_470: |
| 8 | 81 |
res 1, (iy+28h) |
82 |
res 2, (iy+28h) |
|
|
19
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
83 |
bit rawKeyHookActive, (iy+hookflags2) |
| 8 | 84 |
jr z, page0_491 |
|
16
27ca02d0d8aa
Give meaningful names to the page 0 calls we know about so far.
brandonlw
parents:
13
diff
changeset
|
85 |
call j_call_rawkey_hook |
| 8 | 86 |
bit 1, (iy+28h) |
87 |
jr nz, page0_4B2 |
|
88 |
bit 2, (iy+28h) |
|
89 |
jr z, page0_491 |
|
| 4 | 90 |
push af |
| 8 | 91 |
jp page0_53E |
| 4 | 92 |
|
| 7 | 93 |
page0_491: |
| 8 | 94 |
cp 3Fh ; '?' |
95 |
jr z, page0_4A2 |
|
|
16
27ca02d0d8aa
Give meaningful names to the page 0 calls we know about so far.
brandonlw
parents:
13
diff
changeset
|
96 |
call j_PULLDOWNCHK |
| 8 | 97 |
jr c, page0_4B2 |
|
16
27ca02d0d8aa
Give meaningful names to the page 0 calls we know about so far.
brandonlw
parents:
13
diff
changeset
|
98 |
call j_clrTR |
| 8 | 99 |
jr c, page0_4B2 |
| 4 | 100 |
call page0_7DE |
| 7 | 101 |
page0_4A2: |
| 8 | 102 |
jr z, sendKPress |
103 |
cp 28h ; '('
|
|
104 |
jr z, sendKPress |
|
105 |
cp 29h ; ')' |
|
106 |
jr z, sendKPress |
|
107 |
jr page0_4D0 |
|
| 4 | 108 |
|
| 7 | 109 |
page0_4AE: |
| 8 | 110 |
pop hl |
111 |
pop bc |
|
| 4 | 112 |
djnz page0_4BA |
113 |
||
| 7 | 114 |
page0_4B2: |
| 8 | 115 |
jp coorMon |
| 4 | 116 |
|
| 7 | 117 |
page0_4B5: |
| 8 | 118 |
ld b, 8 |
| 37 | 119 |
ld hl, progToEdit-1 |
| 7 | 120 |
page0_4BA: |
| 8 | 121 |
inc hl |
122 |
ld a, (hl) |
|
123 |
or a |
|
124 |
jr z, page0_4B2 |
|
| 4 | 125 |
push bc |
126 |
push hl |
|
| 8 | 127 |
ld d, 0 |
128 |
ld e, a |
|
|
16
27ca02d0d8aa
Give meaningful names to the page 0 calls we know about so far.
brandonlw
parents:
13
diff
changeset
|
129 |
call j_TokToKey |
| 4 | 130 |
call cxMain |
|
19
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
131 |
res onInterrupt, (iy+onFlags) |
| 8 | 132 |
jr page0_4AE |
| 4 | 133 |
|
| 7 | 134 |
page0_4D0: |
| 8 | 135 |
cp 7Fh ; '' |
136 |
jp c, page0_595 |
|
137 |
cp 0FEh ; ' |
|
138 |
jr z, sendKPress |
|
139 |
cp 0FCh ; '𧍊 |
|
140 |
jr z, sendKPress |
|
141 |
cp 0FBh ; ' |
|
142 |
jr nz, page0_4FA |
|
143 |
ld a, (keyExtend) |
|
144 |
or a |
|
145 |
jr z, page0_4F7 |
|
146 |
cp 0Dh |
|
147 |
jr c, page0_4F3 |
|
148 |
cp 8Ch ; '̧ |
|
149 |
jr c, page0_549 |
|
150 |
cp 0A6h ; 'Ƨ |
|
151 |
jr nc, page0_549 |
|
| 4 | 152 |
|
| 7 | 153 |
page0_4F3: |
| 8 | 154 |
ld a, 0FBh ; |
| 11 | 155 |
jr sendKPress |
| 4 | 156 |
|
| 7 | 157 |
page0_4F7: |
| 8 | 158 |
ld a, (kbdKey) |
| 7 | 159 |
page0_4FA: |
| 8 | 160 |
cp 0EFh ; '留 |
161 |
jr nz, page0_502 |
|
162 |
ld a, 0A6h ; 'Ƨ |
|
163 |
jr page0_510 |
|
| 4 | 164 |
|
| 7 | 165 |
page0_502: |
| 8 | 166 |
cp 0F9h ; ' |
167 |
jr c, page0_50A |
|
168 |
sub 14h |
|
169 |
jr page0_510 |
|
| 4 | 170 |
|
| 7 | 171 |
page0_50A: |
| 8 | 172 |
cp 0F3h ; ' |
173 |
jr c, sendKPress |
|
174 |
sub 7Ch ; '|' |
|
| 7 | 175 |
page0_510: |
| 8 | 176 |
ld (keyExtend), a |
177 |
ld a, 0FEh ; ' |
|
| 7 | 178 |
sendKPress: |
| 8 | 179 |
cp 69h ; 'i' |
180 |
jr nz, page0_51D |
|
181 |
ld a, 0FCh ; '𧍊 |
|
182 |
jr page0_510 |
|
| 4 | 183 |
|
| 7 | 184 |
page0_51D: |
| 8 | 185 |
cp 5Bh ; '[' |
186 |
jr nz, page0_525 |
|
187 |
ld a, 0FDh ; ' |
|
188 |
jr page0_510 |
|
| 4 | 189 |
|
| 7 | 190 |
page0_525: |
| 8 | 191 |
cp 28h ; '('
|
| 4 | 192 |
push af |
| 8 | 193 |
jr nz, page0_532 |
| 37 | 194 |
set recallingPrgmName, (iy+rclFlag2) |
| 8 | 195 |
ld a, 0DAh ; 'ڧ |
196 |
jr page0_53E |
|
| 4 | 197 |
|
| 7 | 198 |
page0_532: |
| 8 | 199 |
pop af |
200 |
cp 29h ; ')' |
|
| 4 | 201 |
push af |
| 8 | 202 |
jr nz, page0_53E |
| 37 | 203 |
set recallingListName, (iy+rclFlag3) |
| 8 | 204 |
ld a, 7Fh ; '' |
| 7 | 205 |
page0_53E: |
| 4 | 206 |
call cxMain |
|
19
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
207 |
res onInterrupt, (iy+onFlags) |
| 8 | 208 |
pop af |
209 |
jp z, page0_4B5 |
|
| 7 | 210 |
page0_549: |
|
19
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
211 |
bit enableQueue, (iy+rclFlag) |
| 8 | 212 |
jr z, page0_58E |
213 |
ld de, (rclQueue) |
|
| 4 | 214 |
page0_553: |
| 8 | 215 |
ld hl, (editCursor) |
|
19
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
216 |
bit useRclQueueEnd, (iy+hookflags1) |
| 8 | 217 |
jr z, page0_560 |
218 |
ld hl, (rclQueueEnd) |
|
219 |
ex de, hl |
|
| 7 | 220 |
page0_560: |
| 4 | 221 |
call CpHLDE |
| 8 | 222 |
jr nc, page0_580 |
223 |
ld a, (hl) |
|
| 4 | 224 |
call page0_172F |
| 8 | 225 |
ld d, 0 |
226 |
ld e, a |
|
227 |
jr nz, page0_571 |
|
228 |
ld d, a |
|
229 |
inc hl |
|
230 |
ld e, (hl) |
|
| 7 | 231 |
page0_571: |
|
19
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
232 |
bit useRclQueueEnd, (iy+hookflags1) |
| 8 | 233 |
jr z, page0_57B |
234 |
inc hl |
|
235 |
ld (rclQueue), hl |
|
| 7 | 236 |
page0_57B: |
|
16
27ca02d0d8aa
Give meaningful names to the page 0 calls we know about so far.
brandonlw
parents:
13
diff
changeset
|
237 |
call j_TokToKey |
| 7 | 238 |
page0_57E: |
| 8 | 239 |
jr sendKPress |
| 4 | 240 |
|
| 7 | 241 |
page0_580: |
|
19
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
242 |
res enableQueue, (iy+rclFlag) |
| 8 | 243 |
ld hl, 89F5h |
244 |
ld a, (promptIns) |
|
245 |
res 4, (hl) |
|
246 |
or (hl) |
|
247 |
ld (hl), a |
|
| 7 | 248 |
page0_58E: |
|
19
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
249 |
res useRclQueueEnd, (iy+hookflags1) |
| 8 | 250 |
jp Mon |
| 4 | 251 |
|
| 7 | 252 |
page0_595: |
| 8 | 253 |
cp 27h ; ''' |
254 |
jr c, page0_57E |
|
255 |
cp 5Ah ; 'Z' |
|
256 |
jr c, page0_5C2 |
|
257 |
cp 75h ; 'u' |
|
258 |
jr nc, page0_5BC |
|
259 |
bit 0, (iy+9) |
|
260 |
jr nz, page0_57E |
|
261 |
cp 69h ; 'i' |
|
262 |
jr c, page0_5BC |
|
263 |
cp 6Dh ; 'm' |
|
264 |
jr z, page0_5BC |
|
265 |
cp 69h ; 'i' |
|
266 |
jr z, page0_57E |
|
267 |
ld b, a |
|
268 |
ld a, (mcxCurApp) |
|
269 |
cp 44h ; 'D' |
|
270 |
ld a, b |
|
271 |
jr nz, page0_57E |
|
| 7 | 272 |
page0_5BC: |
| 8 | 273 |
ld b, a |
274 |
ld a, 44h ; 'D' |
|
275 |
jr page0_5D0 |
|
| 11 | 276 |
|
| 4 | 277 |
push af |
| 7 | 278 |
page0_5C2: |
| 8 | 279 |
ld b, a |
280 |
cp 59h ; 'Y' |
|
281 |
jr nz, page0_5D0 |
|
282 |
ld a, (keyExtend) |
|
283 |
add a, b |
|
284 |
cp 5Bh ; '[' |
|
285 |
jr nc, JForceCmdNoChar |
|
286 |
ld b, a |
|
| 7 | 287 |
page0_5D0: |
| 8 | 288 |
ld c, a |
289 |
ld a, (mcxCurApp) |
|
290 |
cp 50h ; 'P' |
|
291 |
jr nz, page0_5E1 |
|
292 |
ld a, b |
|
293 |
cp 40h ; '@' |
|
294 |
jr z, JForceCmdNoChar |
|
295 |
ld a, 50h ; 'P' |
|
296 |
jr page0_5EA |
|
| 4 | 297 |
|
| 7 | 298 |
page0_5E1: |
| 8 | 299 |
cp 52h ; 'R' |
300 |
ld a, c |
|
301 |
jr nz, page0_5EA |
|
302 |
cp 40h ; '@' |
|
303 |
jr nz, page0_58E |
|
| 7 | 304 |
page0_5EA: |
| 4 | 305 |
call newContext0 |
| 8 | 306 |
ld a, b |
307 |
jp page0_525 |
|
| 4 | 308 |
|
| 7 | 309 |
JForceCmdNoChar: |
| 8 | 310 |
xor a |
| 4 | 311 |
JForceCmd: |
| 8 | 312 |
ld b, a |
313 |
ld sp, (onSP) |
|
314 |
res 6, (iy+0Ch) |
|
| 23 | 315 |
call SetFastSpeed |
| 8 | 316 |
ld a, 40h ; '@' |
| 4 | 317 |
call newContext0 |
| 8 | 318 |
ld a, b |
319 |
cp 0DAh ; 'ڧ |
|
320 |
jr nz, page0_60D |
|
321 |
ld a, 28h ; '('
|
|
| 7 | 322 |
page0_60A: |
| 8 | 323 |
jp sendKPress |
| 4 | 324 |
|
| 7 | 325 |
page0_60D: |
| 8 | 326 |
cp 7Fh ; '' |
327 |
jr nz, page0_60A |
|
328 |
ld a, 29h ; ')' |
|
329 |
jr page0_60A |
|
| 4 | 330 |
|
331 |
sysErrHandler: |
|
| 8 | 332 |
ld sp, (onSP) |
333 |
ld a, 52h ; 'R' |
|
| 4 | 334 |
call newContext |
| 8 | 335 |
jp Mon |
| 11 | 336 |
|
| 4 | 337 |
ret |
338 |
||
| 7 | 339 |
newContext: |
| 8 | 340 |
ld c, a |
341 |
sub a |
|
342 |
ld (kbdKey), a |
|
343 |
ld b, a |
|
344 |
in a, (6) |
|
| 4 | 345 |
push af |
| 8 | 346 |
ld a, c |
| 4 | 347 |
call newContext0 |
| 8 | 348 |
pop af |
| 7 | 349 |
sub_630: |
| 8 | 350 |
out (6), a |
| 4 | 351 |
ret |
352 |
||
| 7 | 353 |
newContext0: |
|
19
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
354 |
res appRetKeyOff, (iy+APIFlg) |
| 8 | 355 |
ld hl, 859Ah |
356 |
cp (hl) |
|
357 |
jr nz, page0_64E |
|
358 |
cp 44h ; 'D' |
|
359 |
jr nz, page0_647 |
|
| 4 | 360 |
push bc |
361 |
page0_642: |
|
|
16
27ca02d0d8aa
Give meaningful names to the page 0 calls we know about so far.
brandonlw
parents:
13
diff
changeset
|
362 |
call j_GRPUTAWAY |
| 8 | 363 |
pop bc |
| 4 | 364 |
ret |
365 |
||
| 7 | 366 |
page0_647: |
| 8 | 367 |
cp 40h ; '@' |
368 |
jr z, page0_64E |
|
369 |
ld b, 27h ; ''' |
|
| 4 | 370 |
ret |
371 |
||
| 7 | 372 |
page0_64E: |
| 4 | 373 |
push bc |
374 |
push af |
|
| 8 | 375 |
pop af |
| 4 | 376 |
page0_651: |
| 8 | 377 |
cp 3Fh ; '?' |
378 |
jr nz, page0_65B |
|
379 |
ld a, 40h ; '@' |
|
| 4 | 380 |
push af |
| 8 | 381 |
xor a |
382 |
jr page0_664 |
|
| 4 | 383 |
|
| 7 | 384 |
page0_65B: |
| 4 | 385 |
push af |
386 |
page0_65C: |
|
| 8 | 387 |
sub 40h ; '@' |
388 |
jr nz, page0_664 |
|
389 |
res 6, (iy+0Ch) |
|
| 7 | 390 |
page0_664: |
| 4 | 391 |
call Page0Call_3F51 |
| 8 | 392 |
pop af |
| 4 | 393 |
push hl |
394 |
push af |
|
|
19
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
395 |
res curLock, (iy+curFlags) |
| 4 | 396 |
call cxPutAway2 |
| 8 | 397 |
pop af |
| 4 | 398 |
push af |
| 8 | 399 |
ld b, a |
400 |
ld a, (mcxCurApp) |
|
401 |
cp 47h ; 'G' |
|
402 |
ld a, b |
|
403 |
jr z, page0_68E |
|
404 |
bit 0, (iy+9) |
|
405 |
jr z, page0_68E |
|
406 |
cp 57h ; 'W' |
|
407 |
jr z, page0_69E |
|
408 |
cp 45h ; 'E' |
|
409 |
jr z, page0_69E |
|
410 |
cp 4Bh ; 'K' |
|
411 |
jr z, page0_69E |
|
| 7 | 412 |
page0_68E: |
| 4 | 413 |
call Page0Call_3F57 |
| 8 | 414 |
cp 52h ; 'R' |
415 |
jr z, page0_69E |
|
| 4 | 416 |
call cxPPutAway |
417 |
call page0_7DE |
|
| 23 | 418 |
call z, SetFastSpeed |
| 7 | 419 |
page0_69E: |
| 8 | 420 |
ld a, (mcxCurApp) |
421 |
pop bc |
|
| 4 | 422 |
push af |
423 |
push bc |
|
| 8 | 424 |
cp 52h ; 'R' |
425 |
jr nz, page0_6B4 |
|
|
16
27ca02d0d8aa
Give meaningful names to the page 0 calls we know about so far.
brandonlw
parents:
13
diff
changeset
|
426 |
call j_POPCX |
| 4 | 427 |
call sub_73D |
428 |
call page0_7DE |
|
| 23 | 429 |
call z, SetFastSpeed |
| 7 | 430 |
page0_6B4: |
| 8 | 431 |
ld hl, 858Dh |
432 |
ld de, 859Bh |
|
433 |
ld bc, 0Eh |
|
| 4 | 434 |
ldir |
| 8 | 435 |
ld a, (appFlagsAddr) |
436 |
ld (de), a |
|
437 |
pop af |
|
| 4 | 438 |
push af |
| 8 | 439 |
cp 4Ah ; 'J' |
440 |
jr nz, page0_6CE |
|
| 4 | 441 |
call Page0Call_3F63 |
| 8 | 442 |
jr page0_707 |
| 4 | 443 |
|
| 7 | 444 |
page0_6CE: |
| 8 | 445 |
cp 44h ; 'D' |
| 4 | 446 |
call z, Page0Call_3F63 |
| 8 | 447 |
jr z, page0_6DF |
448 |
set 6, (iy+1Dh) |
|
449 |
set 7, (iy+1Dh) |
|
450 |
jr page0_707 |
|
| 4 | 451 |
|
| 7 | 452 |
page0_6DF: |
| 4 | 453 |
call page0_17DB |
454 |
call CheckSplitFlag |
|
| 8 | 455 |
jr z, page0_707 |
456 |
ld a, (mcxCurApp) |
|
|
16
27ca02d0d8aa
Give meaningful names to the page 0 calls we know about so far.
brandonlw
parents:
13
diff
changeset
|
457 |
call j_CompareContext |
| 8 | 458 |
jr nz, page0_707 |
459 |
ld a, 40h ; '@' |
|
460 |
ld (mcxCurApp), a |
|
461 |
ld hl, Page0Call_3F6F |
|
462 |
ld a, (iy+12h) |
|
| 4 | 463 |
push af |
| 8 | 464 |
ld a, 40h ; '@' |
| 4 | 465 |
call sub_71D |
466 |
call cxPutAway |
|
| 8 | 467 |
pop af |
468 |
ld (iy+12h), a |
|
| 7 | 469 |
page0_707: |
| 8 | 470 |
pop af |
471 |
pop bc |
|
472 |
cp 46h ; 'F' |
|
473 |
jr nz, page0_718 |
|
| 4 | 474 |
push af |
| 8 | 475 |
ld a, b |
476 |
cp 52h ; 'R' |
|
477 |
jr z, page0_717 |
|
|
19
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
478 |
set promptEdit, (iy+promptFlags) |
| 7 | 479 |
page0_717: |
| 8 | 480 |
pop af |
| 7 | 481 |
page0_718: |
| 8 | 482 |
pop hl |
483 |
ld (mcxCurApp), a |
|
484 |
pop af |
|
| 7 | 485 |
sub_71D: |
| 8 | 486 |
bit 2, (iy+36h) |
| 4 | 487 |
call nz, Page0Call_3F75 |
488 |
push af |
|
| 8 | 489 |
set 5, (iy+1) |
| 4 | 490 |
call sub_7A1 |
| 8 | 491 |
res 5, (iy+1) |
492 |
pop bc |
|
| 4 | 493 |
ret |
494 |
||
495 |
page0_732: |
|
| 8 | 496 |
add a, a |
497 |
ld e, a |
|
498 |
ld d, 0 |
|
499 |
add hl, de |
|
500 |
jp ldHLind |
|
| 4 | 501 |
|
| 7 | 502 |
cxPutAway: |
| 4 | 503 |
call cxPutAway2 |
| 7 | 504 |
sub_73D: |
| 4 | 505 |
call cxPPutAway |
506 |
page0_740: |
|
|
19
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
507 |
res promptEdit, (iy+promptFlags) |
| 4 | 508 |
ret |
509 |
||
| 7 | 510 |
cxPutAway2: |
|
19
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
511 |
bit nocxPutAway, (iy+contextFlags) |
| 8 | 512 |
ret nz |
| 4 | 513 |
push hl |
| 8 | 514 |
ld hl, (mcxPPutAway) |
| 4 | 515 |
page0_74E: |
516 |
call sub_77F |
|
517 |
jr page0_762 |
|
518 |
||
| 7 | 519 |
cxPPutAway: |
|
19
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
520 |
bit nocxPutAway, (iy+contextFlags) |
| 8 | 521 |
ret nz |
| 4 | 522 |
push hl |
| 8 | 523 |
ld hl, (mcxPutAway) |
| 4 | 524 |
call sub_77F |
| 10 | 525 |
call zero_basic_prog |
| 4 | 526 |
page0_762: |
| 8 | 527 |
pop hl |
| 4 | 528 |
page0_763: |
| 32 | 529 |
jp CancelAlpha |
| 4 | 530 |
|
531 |
cxRedisp: |
|
| 8 | 532 |
ld hl, (unk_8593) |
533 |
jr sub_77F |
|
| 4 | 534 |
|
535 |
cxSizeWind: |
|
| 8 | 536 |
bit 5, (iy+1) |
| 4 | 537 |
push af |
| 8 | 538 |
ld a, (menuActive) |
539 |
ld b, a |
|
| 4 | 540 |
page0_774: |
| 8 | 541 |
ld hl, (mcxSizeWind) |
| 4 | 542 |
sub_777: |
543 |
call sub_77F |
|
| 8 | 544 |
pop af |
| 4 | 545 |
ret |
546 |
||
547 |
cxErrEP: |
|
| 8 | 548 |
ld hl, (mcxErrorEP) |
| 7 | 549 |
sub_77F: |
| 8 | 550 |
in a, (6) |
| 4 | 551 |
push af |
| 8 | 552 |
ld a, (mcxPage) |
| 4 | 553 |
call sub_630 |
554 |
call sub_7A1 |
|
| 8 | 555 |
pop af |
| 4 | 556 |
call sub_630 |
557 |
ret |
|
558 |
||
| 7 | 559 |
cxMain: |
| 4 | 560 |
push hl |
| 8 | 561 |
ld hl, (mcxMain) |
| 4 | 562 |
push af |
| 8 | 563 |
ld a, (mcxPage) |
| 4 | 564 |
call sub_630 |
| 8 | 565 |
pop af |
| 4 | 566 |
call sub_7A1 |
| 8 | 567 |
pop hl |
| 4 | 568 |
ret |
569 |
||
| 7 | 570 |
sub_7A1: |
| 8 | 571 |
jp (hl) |
| 4 | 572 |
|
573 |
page0_7A2: |
|
| 8 | 574 |
ld a, (unk_85A7) |
| 4 | 575 |
call sub_630 |
| 8 | 576 |
ld hl, (unk_85A1) |
577 |
jr sub_7A1 |
|
| 4 | 578 |
|
579 |
monErrHand: |
|
| 26 | 580 |
ld hl, monErrHand |
| 4 | 581 |
call pushErrorHandleR |
| 8 | 582 |
ld a, 52h ; 'R' |
| 4 | 583 |
call newContext0 |
| 8 | 584 |
jp Mon |
| 11 | 585 |
|
| 4 | 586 |
push hl |
| 8 | 587 |
ld hl, 64h ; 'd' |
588 |
jr page0_7C5 |
|
| 4 | 589 |
page0_7C1: |
590 |
push hl |
|
| 8 | 591 |
ld hl, 32h ; '2' |
| 7 | 592 |
page0_7C5: |
| 4 | 593 |
call EnoughMem |
| 8 | 594 |
jp c, Page0Call_24F9 |
595 |
pop hl |
|
| 4 | 596 |
AppInit: |
| 26 | 597 |
ld de, mcxMain |
598 |
ld bc, 12 |
|
| 4 | 599 |
ldir |
| 8 | 600 |
ld a, (hl) |
601 |
ld (appFlagsAddr), a |
|
602 |
in a, (6) |
|
603 |
ld (mcxPage), a |
|
| 4 | 604 |
ret |
605 |
||
| 7 | 606 |
page0_7DE: |
| 8 | 607 |
ld b, a |
608 |
ld a, (mcxCurApp) |
|
609 |
cp 58h ; 'X' |
|
610 |
ld a, b |
|
| 4 | 611 |
ret |
612 |
||
| 7 | 613 |
handleONKeyPress: |
| 23 | 614 |
;Switch to slow speed |
| 8 | 615 |
in a, (2) |
| 23 | 616 |
and 80h |
617 |
jr z, {+}
|
|
| 8 | 618 |
in a, (20h) |
619 |
ld e, a |
|
620 |
xor a |
|
621 |
out (20h), a |
|
| 23 | 622 |
+: ld b, 0 |
623 |
debounceRestart: |
|
| 8 | 624 |
ld hl, 1016h |
| 23 | 625 |
debounceLoop: |
| 8 | 626 |
in a, (4) |
627 |
and 8 |
|
628 |
cp b |
|
629 |
ld b, a |
|
| 23 | 630 |
jr nz, debounceRestart |
| 8 | 631 |
dec hl |
632 |
ld a, l |
|
633 |
or h |
|
| 23 | 634 |
jr nz, debounceLoop |
| 8 | 635 |
cp b |
| 23 | 636 |
jr z, ONKeyBeingPressed |
637 |
;ON key is being released |
|
| 8 | 638 |
in a, (7) |
639 |
ld b, a |
|
640 |
in a, (2) |
|
| 23 | 641 |
and 80h |
642 |
jr z, {+}
|
|
643 |
;Restore previous speed |
|
| 8 | 644 |
ld a, e |
645 |
out (20h), a |
|
646 |
ld a, b |
|
| 23 | 647 |
cp 81h |
648 |
jr isRAMUnhooked |
|
649 |
+: ld a, b |
|
650 |
and 4Fh |
|
651 |
cp 41h |
|
652 |
isRAMUnhooked: |
|
653 |
jp nz, RAMUnhookedWaitForPowerOn |
|
|
19
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
654 |
bit onRunning, (iy+onFlags) |
| 8 | 655 |
ret nz |
| 23 | 656 |
;ON key being released and we're just off, so just return from the interrupt handler |
| 8 | 657 |
pop hl |
658 |
sub a |
|
| 4 | 659 |
push af |
| 8 | 660 |
ld a, 8 |
661 |
out (3), a |
|
662 |
pop af |
|
663 |
out (3), a |
|
664 |
ld a, 11h |
|
665 |
jp noSecondHardwareTimer |
|
| 23 | 666 |
ONKeyBeingPressed: |
667 |
;Restore previous speed |
|
| 8 | 668 |
in a, (2) |
| 23 | 669 |
and 80h |
670 |
jr z, HandlePowerOnRequest |
|
| 8 | 671 |
ld a, e |
672 |
out (20h), a |
|
| 23 | 673 |
|
674 |
.module HandlePowerOnRequest |
|
675 |
HandlePowerOnRequest: |
|
676 |
ld a, 76h |
|
| 8 | 677 |
out (4), a |
678 |
in a, (2) |
|
| 23 | 679 |
and 80h |
680 |
jr z, {+}
|
|
| 8 | 681 |
in a, (7) |
| 23 | 682 |
cp 81h |
683 |
jr _isRAMUnhooked |
|
684 |
+: in a, (7) |
|
685 |
and 4Fh |
|
686 |
cp 41h |
|
687 |
_isRAMUnhooked: |
|
688 |
jp nz, HookRAMAndPowerOn |
|
|
19
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
689 |
bit shift2nd, (iy+shiftFlags) |
| 23 | 690 |
jp z, HandleONPressed |
691 |
;2nd is being pressed, so we might be turning off |
|
|
19
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
692 |
bit enableKeyEcho, (iy+hookflags1) |
| 23 | 693 |
jr nz, {+}
|
|
19
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
694 |
bit appRetKeyOff, (iy+APIFlg) |
| 8 | 695 |
jr z, PowerOff |
| 23 | 696 |
+: set kOffPressed, (iy+APIFlg) |
697 |
ret |
|
698 |
.endmodule |
|
| 4 | 699 |
|
| 23 | 700 |
.module PowerOff |
| 7 | 701 |
PowerOff: |
| 8 | 702 |
ld a, 8 |
| 4 | 703 |
push af |
| 8 | 704 |
ld a, 8 |
705 |
out (3), a |
|
706 |
pop af |
|
707 |
out (3), a |
|
| 4 | 708 |
call TurnOffLCD |
|
19
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
709 |
bit resetOnPowerOn, (iy+selfTestFlag) |
| 23 | 710 |
jr z, {+}
|
711 |
;If above flag is set and APD is disabled, skip RAM checksum generation (forcing a reset) |
|
|
19
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
712 |
bit apdAble, (iy+apdFlags) |
| 23 | 713 |
jr z, _skipRAMChecksum |
714 |
+: call SetFastSpeed |
|
715 |
call PreviousContext_CloseAnyOpenMenu |
|
|
16
27ca02d0d8aa
Give meaningful names to the page 0 calls we know about so far.
brandonlw
parents:
13
diff
changeset
|
716 |
call j_hideCursor |
|
19
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
717 |
set monAbandon, (iy+monFlags) |
| 23 | 718 |
ld hl, lcdFlag |
719 |
set powerLcdForGC, (hl) |
|
| 4 | 720 |
call forcecmd |
| 23 | 721 |
ld hl, lcdFlag |
722 |
res powerLcdForGC, (hl) |
|
|
19
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
723 |
res monAbandon, (iy+monFlags) |
|
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
724 |
bit alt_Off, (iy+hookflags1) |
| 24 | 725 |
call nz, j_ExecuteOFFSCRPT |
| 28 | 726 |
_DoShutDown: |
727 |
call j_SetupDBusMem |
|
| 8 | 728 |
ld a, 8 |
729 |
out (3), a |
|
| 4 | 730 |
call TurnOffLCD |
| 23 | 731 |
ld hl, flags+onFlags |
732 |
bit clrScrnOnPowerOff, (hl) |
|
733 |
res clrScrnOnPowerOff, (hl) |
|
|
16
27ca02d0d8aa
Give meaningful names to the page 0 calls we know about so far.
brandonlw
parents:
13
diff
changeset
|
734 |
call nz, j_ClrScrn |
| 4 | 735 |
call calculateRAMChecksum |
| 22 | 736 |
ld (RAMChecksum), hl |
| 23 | 737 |
_skipRAMChecksum: |
|
19
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
738 |
res bPLinkOn, (iy+hookflags1) |
|
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
739 |
res enableKeyEcho, (iy+hookflags1) |
| 24 | 740 |
ld a, 36h |
| 8 | 741 |
out (4), a |
742 |
ld a, 11h |
|
743 |
out (3), a |
|
|
19
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
744 |
res shift2nd, (iy+shiftFlags) |
|
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
745 |
res onRunning, (iy+onFlags) |
| 8 | 746 |
ex af, af' |
| 4 | 747 |
exx |
748 |
ei |
|
| 22 | 749 |
-: halt |
750 |
jr {-}
|
|
| 23 | 751 |
.endmodule |
| 4 | 752 |
|
| 23 | 753 |
HandleONPressed: |
| 22 | 754 |
res checkNoBatteriesNextTime, (iy+batteryFlags2) |
| 4 | 755 |
call ApdSetup |
|
19
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
756 |
bit onRunning, (iy+onFlags) |
| 8 | 757 |
jr nz, page0_94D |
| 7 | 758 |
page0_8F1: |
|
19
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
759 |
set onRunning, (iy+onFlags) |
| 22 | 760 |
ld hl, flags+apdFlags |
| 8 | 761 |
bit 4, (hl) |
762 |
res 4, (hl) |
|
763 |
jr nz, page0_92C |
|
|
19
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
764 |
res indicInUse, (iy+indicFlags) |
|
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
765 |
bit resetOnPowerOn, (iy+selfTestFlag) |
| 8 | 766 |
jr z, page0_90D |
767 |
bit 2, (hl) |
|
|
25
fab1bedd3281
Commit some experimental commented-out code for 84+CSE detection and booting
brandonlw
parents:
24
diff
changeset
|
768 |
jp z, resetRam |
| 7 | 769 |
page0_90D: |
| 8 | 770 |
ld sp, (onSP) |
|
16
27ca02d0d8aa
Give meaningful names to the page 0 calls we know about so far.
brandonlw
parents:
13
diff
changeset
|
771 |
call j_resetStacks |
| 8 | 772 |
xor a |
773 |
ld (MenuCurrent), a |
|
| 4 | 774 |
call refreshSystemRAM |
775 |
call sub_ADA |
|
776 |
call Page0Call_3E97 |
|
| 8 | 777 |
bit 6, (iy+0Ch) |
| 4 | 778 |
call nz, Page0Call_3E9D |
779 |
ei |
|
| 8 | 780 |
jp Mon |
| 4 | 781 |
|
| 7 | 782 |
page0_92C: |
|
19
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
783 |
bit alt_On, (iy+hookflags1) |
| 24 | 784 |
call nz, j_ExecuteONSCRPT |
| 8 | 785 |
ld a, 8 |
| 4 | 786 |
push af |
| 8 | 787 |
ld a, 8 |
788 |
out (3), a |
|
789 |
pop af |
|
790 |
out (3), a |
|
|
16
27ca02d0d8aa
Give meaningful names to the page 0 calls we know about so far.
brandonlw
parents:
13
diff
changeset
|
791 |
call j_RstrOScreen |
| 8 | 792 |
pop de |
793 |
pop de |
|
794 |
pop de |
|
795 |
set 3, (hl) |
|
| 4 | 796 |
call sub_ADA |
| 8 | 797 |
ex af, af' |
| 4 | 798 |
exx |
799 |
ei |
|
800 |
reti |
|
801 |
||
| 7 | 802 |
page0_94D: |
|
19
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
803 |
set onInterrupt, (iy+onFlags) |
| 4 | 804 |
ret |
805 |
||
| 23 | 806 |
HookRAMAndPowerOn: |
| 8 | 807 |
ld a, 76h ; 'v' |
808 |
out (4), a |
|
809 |
ld a, 0C0h ; '' |
|
810 |
out (0), a |
|
811 |
in a, (2) |
|
812 |
and 80h ; '' |
|
813 |
ld a, 41h ; 'A' |
|
814 |
jr z, page0_96B |
|
815 |
ld a, 1 |
|
816 |
out (20h), a |
|
817 |
xor a |
|
818 |
out (0Fh), a |
|
819 |
ld a, 81h ; 'g |
|
| 7 | 820 |
page0_96B: |
| 8 | 821 |
out (7), a |
822 |
xor a |
|
| 4 | 823 |
push af |
| 8 | 824 |
ld a, 8 |
825 |
out (3), a |
|
826 |
pop af |
|
827 |
out (3), a |
|
828 |
ld iy, 89F0h |
|
| 4 | 829 |
call NZIf83Plus |
830 |
call z, Page0Call_3EAF |
|
| 22 | 831 |
ld hl, (RAMChecksum) |
| 8 | 832 |
ld de, 0A55Ah |
| 4 | 833 |
call CpHLDE |
| 8 | 834 |
jp z, doFunkyTurnOnFromA55AChecksum |
| 4 | 835 |
call NZIf83Plus |
| 8 | 836 |
jr z, page0_9A0 |
837 |
ld b, 0 |
|
| 11 | 838 |
B_CALL(_getHardwareVersion) |
| 8 | 839 |
bit 0, b |
840 |
ld a, 1Fh |
|
841 |
jr z, page0_9A2 |
|
842 |
ld a, 1Ch |
|
843 |
jr page0_9A2 |
|
| 4 | 844 |
|
| 7 | 845 |
page0_9A0: |
| 8 | 846 |
ld a, 17h |
| 7 | 847 |
page0_9A2: |
| 8 | 848 |
ld (contrast), a |
| 4 | 849 |
call calculateRAMChecksum |
| 22 | 850 |
ld de, (RAMChecksum) |
| 4 | 851 |
call CpHLDE |
|
25
fab1bedd3281
Commit some experimental commented-out code for 84+CSE detection and booting
brandonlw
parents:
24
diff
changeset
|
852 |
jr nz, resetRam |
| 8 | 853 |
dec de |
| 22 | 854 |
ld (RAMChecksum), de |
| 4 | 855 |
call Page0Call_3EB5 |
| 23 | 856 |
call PreviousContext_CloseAnyOpenMenu |
| 8 | 857 |
ld a, 0Bh |
858 |
out (3), a |
|
|
19
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
859 |
res apdWarmStart, (iy+apdFlags) |
| 4 | 860 |
call forcecmd |
| 8 | 861 |
jp page0_8F1 |
| 4 | 862 |
|
| 7 | 863 |
resetRam: |
| 4 | 864 |
di |
| 8 | 865 |
ld hl, 8000h |
866 |
ld de, 8001h |
|
867 |
ld bc, 7FFFh |
|
868 |
ld (hl), 0 |
|
| 4 | 869 |
ldir |
| 8 | 870 |
ld hl, 109h |
871 |
ld (localLanguage), hl |
|
|
25
fab1bedd3281
Commit some experimental commented-out code for 84+CSE detection and booting
brandonlw
parents:
24
diff
changeset
|
872 |
;#ifdef DEVIATE_FROM_ORIGINAL_FILE |
|
fab1bedd3281
Commit some experimental commented-out code for 84+CSE detection and booting
brandonlw
parents:
24
diff
changeset
|
873 |
; call NZIfColorModel |
|
fab1bedd3281
Commit some experimental commented-out code for 84+CSE detection and booting
brandonlw
parents:
24
diff
changeset
|
874 |
; jr z, {+}
|
|
fab1bedd3281
Commit some experimental commented-out code for 84+CSE detection and booting
brandonlw
parents:
24
diff
changeset
|
875 |
; set 0, (iy+asm_Flag3) |
|
fab1bedd3281
Commit some experimental commented-out code for 84+CSE detection and booting
brandonlw
parents:
24
diff
changeset
|
876 |
;+: |
|
fab1bedd3281
Commit some experimental commented-out code for 84+CSE detection and booting
brandonlw
parents:
24
diff
changeset
|
877 |
;#endif |
| 4 | 878 |
page0_9DE: |
| 8 | 879 |
ld a, 0C0h ; '' |
880 |
out (0), a |
|
881 |
ld sp, 0FFF7h |
|
| 4 | 882 |
call Page0Call_3EBB |
| 26 | 883 |
ld hl, monErrHand |
| 4 | 884 |
call pushErrorHandleR |
| 8 | 885 |
ld (onSP), sp |
| 4 | 886 |
call Page0Call_3EC1 |
| 8 | 887 |
jp Page0Call_3EC7 |
| 4 | 888 |
|
889 |
page0_9F8: |
|
890 |
di |
|
| 8 | 891 |
ld a, 0C0h ; '' |
892 |
out (0), a |
|
893 |
ld sp, 0FFF7h |
|
894 |
ld hl, 8000h |
|
895 |
ld de, 8001h |
|
896 |
ld bc, 7FFFh |
|
897 |
ld (hl), 0 |
|
| 4 | 898 |
ldir |
| 8 | 899 |
ld hl, 109h |
900 |
ld (localLanguage), hl |
|
| 4 | 901 |
call Page0Call_3EBB |
| 26 | 902 |
ld hl, monErrHand |
| 4 | 903 |
call pushErrorHandleR |
| 8 | 904 |
ld (onSP), sp |
| 4 | 905 |
call Page0Call_3EC1 |
| 8 | 906 |
jp Page0Call_3ECD |
| 4 | 907 |
|
908 |
page0_A26: |
|
909 |
call GetCSC |
|
| 8 | 910 |
set 2, (iy+9) |
|
16
27ca02d0d8aa
Give meaningful names to the page 0 calls we know about so far.
brandonlw
parents:
13
diff
changeset
|
911 |
call j_getkey |
|
27ca02d0d8aa
Give meaningful names to the page 0 calls we know about so far.
brandonlw
parents:
13
diff
changeset
|
912 |
call j_ClrScrn |
| 8 | 913 |
res 2, (iy+9) |
914 |
jp monForceKey |
|
| 4 | 915 |
|
| 7 | 916 |
calculateRAMChecksum: |
| 4 | 917 |
push ix |
| 8 | 918 |
ld ix, 9D95h |
919 |
ld bc, 60DBh |
|
920 |
ld hl, 11h |
|
921 |
ld d, h |
|
| 7 | 922 |
page0_A47: |
| 8 | 923 |
ld e, (ix+0) |
924 |
inc ix |
|
925 |
add hl, de |
|
926 |
dec bc |
|
927 |
ld a, c |
|
928 |
or b |
|
929 |
jr nz, page0_A47 |
|
930 |
ld e, d |
|
931 |
ex de, hl |
|
932 |
sbc hl, de |
|
933 |
pop ix |
|
| 4 | 934 |
ret |
935 |
||
| 7 | 936 |
forcecmd: |
| 4 | 937 |
call CanAlphIns |
|
19
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
938 |
res textInverse, (iy+textFlags) |
|
16
27ca02d0d8aa
Give meaningful names to the page 0 calls we know about so far.
brandonlw
parents:
13
diff
changeset
|
939 |
call j_Disp |
| 8 | 940 |
res 6, (iy+0Ch) |
941 |
ld a, 40h ; '@' |
|
942 |
jp newContext0 |
|
| 4 | 943 |
|
| 7 | 944 |
bootCalc: |
| 23 | 945 |
call SetSlowSpeed |
| 8 | 946 |
ld a, 77h ; 'w' |
947 |
out (4), a |
|
948 |
ld b, 0 |
|
949 |
ld sp, 0FDFAh |
|
| 7 | 950 |
page0_A78: |
| 4 | 951 |
djnz $ |
| 8 | 952 |
ld ix, 1 |
953 |
add ix, sp |
|
954 |
ld sp, ix |
|
955 |
jr nc, page0_A78 |
|
956 |
ld sp, 0FFC5h |
|
957 |
in a, (2) |
|
958 |
and 80h ; '' |
|
959 |
jr z, page0_A91 |
|
960 |
ld a, 1 |
|
961 |
out (20h), a |
|
| 7 | 962 |
page0_A91: |
| 8 | 963 |
ld a, 77h ; 'w' |
964 |
out (4), a |
|
| 4 | 965 |
im 1 |
| 8 | 966 |
ld a, 0C0h ; '' |
967 |
out (0), a |
|
| 4 | 968 |
|
| 23 | 969 |
RAMUnhookedWaitForPowerOn: |
| 8 | 970 |
ld a, 37h ; '7' |
971 |
out (4), a |
|
972 |
sub a |
|
| 4 | 973 |
push af |
| 8 | 974 |
ld a, 8 |
975 |
out (3), a |
|
976 |
pop af |
|
977 |
out (3), a |
|
978 |
ld a, 11h |
|
979 |
out (3), a |
|
| 4 | 980 |
ei |
981 |
halt |
|
982 |
||
| 7 | 983 |
lcd_busy: |
| 4 | 984 |
push af |
| 7 | 985 |
page0_AAF: |
| 8 | 986 |
in a, (2) |
987 |
and 2 |
|
988 |
jr z, page0_AAF |
|
989 |
pop af |
|
| 4 | 990 |
ret |
991 |
||
992 |
page0_AB7: |
|
| 7 | 993 |
TurnOffLCD: |
| 8 | 994 |
ld a, 2 |
| 4 | 995 |
page0_AB9: |
996 |
push af |
|
| 7 | 997 |
loop: |
| 8 | 998 |
in a, (2) |
999 |
and 2 |
|
1000 |
jr z, loop |
|
1001 |
pop af |
|
1002 |
out (10h), a |
|
| 4 | 1003 |
ret |
1004 |
||
1005 |
page0_AC4: |
|
| 7 | 1006 |
smallDelay: |
| 4 | 1007 |
push af |
| 8 | 1008 |
inc hl |
1009 |
dec hl |
|
1010 |
pop af |
|
| 4 | 1011 |
ret |
1012 |
||
1013 |
page0_AC9: |
|
| 7 | 1014 |
slowDelay: |
| 8 | 1015 |
ld a, 0FFh |
| 4 | 1016 |
|
| 7 | 1017 |
slowDelayA: |
| 4 | 1018 |
push af |
1019 |
call forceSlowSpeed |
|
| 8 | 1020 |
pop af |
| 7 | 1021 |
delayLoop: |
| 4 | 1022 |
call smallDelay |
| 8 | 1023 |
dec a |
1024 |
jr nz, delayLoop |
|
| 4 | 1025 |
call restorePreviousSpeed |
1026 |
ret |
|
1027 |
||
| 7 | 1028 |
sub_ADA: |
| 8 | 1029 |
ld a, 0Bh |
1030 |
out (3), a |
|
|
16
27ca02d0d8aa
Give meaningful names to the page 0 calls we know about so far.
brandonlw
parents:
13
diff
changeset
|
1031 |
call j_LCD_DRIVERON |
| 4 | 1032 |
call Chk_Batt_Low_2 |
| 8 | 1033 |
ret nz |
| 4 | 1034 |
call refreshSystemRAM |
| 8 | 1035 |
in a, (2) |
1036 |
bit 0, a |
|
| 23 | 1037 |
jp z, PowerOff._skipRAMChecksum |
| 4 | 1038 |
|
| 7 | 1039 |
sub_AEF: |
| 4 | 1040 |
call Page0Call_3ED9 |
1041 |
call forcecmd |
|
| 8 | 1042 |
jp Page0Call_3EDF |
| 4 | 1043 |
|
| 7 | 1044 |
Chk_Batt_Low_2: |
| 4 | 1045 |
call refreshSystemRAM |
1046 |
Chk_Batt_Low: |
|
| 8 | 1047 |
ld a, 76h ; 'v' |
1048 |
out (4), a |
|
1049 |
ld a, 0F6h ; ' |
|
1050 |
out (4), a |
|
1051 |
ld b, 5 |
|
| 7 | 1052 |
longerDelay: |
| 4 | 1053 |
call slowDelay |
1054 |
djnz longerDelay |
|
| 8 | 1055 |
set 5, (iy+18h) |
1056 |
in a, (2) |
|
1057 |
bit 0, a |
|
|
19
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
1058 |
jr nz, {+}
|
| 8 | 1059 |
res 5, (iy+18h) |
|
19
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
1060 |
+: ld a, 76h ; 'v' |
| 8 | 1061 |
out (4), a |
1062 |
ld a, 0Ah |
|
| 4 | 1063 |
call slowDelayA |
| 8 | 1064 |
ld a, 76h ; 'v' |
1065 |
out (4), a |
|
1066 |
bit 5, (iy+18h) |
|
| 4 | 1067 |
ret |
| 24 | 1068 |
|
1069 |
.module RefreshSystemRAM |
|
| 7 | 1070 |
refreshSystemRAM: |
| 8 | 1071 |
ld bc, 2710h |
| 24 | 1072 |
ld hl, ramStart |
1073 |
-: ld a, (hl) |
|
| 8 | 1074 |
ld (hl), a |
1075 |
dec bc |
|
1076 |
ld a, b |
|
1077 |
or c |
|
| 24 | 1078 |
jr nz, {-}
|
| 4 | 1079 |
ret |
| 24 | 1080 |
.endmodule |
| 4 | 1081 |
|
| 7 | 1082 |
doFunkyTurnOnFromA55AChecksum: |
| 8 | 1083 |
ld hl, 0 |
| 22 | 1084 |
ld (RAMChecksum), hl |
| 8 | 1085 |
ld sp, (onSP) |
| 24 | 1086 |
ld iy, flags |
| 4 | 1087 |
call Page0Call_3EE5 |
| 23 | 1088 |
call PreviousContext_CloseAnyOpenMenu |
| 4 | 1089 |
call forcecmd |
|
19
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
1090 |
res apdWarmStart, (iy+apdFlags) |
| 8 | 1091 |
bit 6, (iy+0Ch) |
| 4 | 1092 |
call nz, Page0Call_3E9D |
| 8 | 1093 |
ld a, 0Bh |
1094 |
out (3), a |
|
|
16
27ca02d0d8aa
Give meaningful names to the page 0 calls we know about so far.
brandonlw
parents:
13
diff
changeset
|
1095 |
call j_LCD_DRIVERON |
|
19
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
1096 |
set onRunning, (iy+onFlags) |
| 4 | 1097 |
call Chk_Batt_Low_2 |
1098 |
call z, sub_AEF |
|
|
19
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
1099 |
bit alt_On, (iy+hookflags1) |
| 24 | 1100 |
call nz, j_ExecuteONSCRPT |
| 4 | 1101 |
ei |
| 8 | 1102 |
jp Mon |
| 4 | 1103 |
|
| 23 | 1104 |
PreviousContext_CloseAnyOpenMenu: |
1105 |
call IsInMenu |
|
1106 |
jr z, PreviousContext |
|
| 8 | 1107 |
xor a |
1108 |
ld (MenuCurrent), a |
|
|
16
27ca02d0d8aa
Give meaningful names to the page 0 calls we know about so far.
brandonlw
parents:
13
diff
changeset
|
1109 |
call j_rstrpartial |
| 23 | 1110 |
PreviousContext: |
|
16
27ca02d0d8aa
Give meaningful names to the page 0 calls we know about so far.
brandonlw
parents:
13
diff
changeset
|
1111 |
call j_PrevContext |
| 4 | 1112 |
ret |
1113 |
||
| 23 | 1114 |
IsInMenu: |
| 8 | 1115 |
ld b, a |
1116 |
ld a, (MenuCurrent) |
|
1117 |
or a |
|
1118 |
ld a, b |
|
| 4 | 1119 |
ret |
1120 |
||
| 23 | 1121 |
SetSlowSpeed: |
| 4 | 1122 |
call NZIf83Plus |
| 8 | 1123 |
ret nz |
| 23 | 1124 |
jr {+}
|
| 7 | 1125 |
forceSlowSpeed: |
| 4 | 1126 |
call NZIf83Plus |
| 8 | 1127 |
ret nz |
1128 |
in a, (20h) |
|
1129 |
ld (oldSESpeed), a |
|
| 23 | 1130 |
+: push af |
| 8 | 1131 |
xor a |
1132 |
out (20h), a |
|
1133 |
pop af |
|
| 4 | 1134 |
ret |
1135 |
||
| 7 | 1136 |
restorePreviousSpeed: |
| 4 | 1137 |
call NZIf83Plus |
| 8 | 1138 |
ret nz |
1139 |
ld a, (oldSESpeed) |
|
1140 |
and 1 |
|
1141 |
out (20h), a |
|
| 4 | 1142 |
ret |
1143 |
||
1144 |
SetExSpeed: |
|
| 8 | 1145 |
or a |
| 23 | 1146 |
SetSpeed_NZForFast: |
1147 |
jr z, SetSlowSpeed |
|
1148 |
SetFastSpeed: |
|
| 4 | 1149 |
push af |
1150 |
call NZIf83Plus |
|
| 23 | 1151 |
jr nz, {+}
|
| 8 | 1152 |
ld a, 1 |
1153 |
out (20h), a |
|
| 23 | 1154 |
+: pop af |
| 4 | 1155 |
ret |
1156 |
||
1157 |
page0_BBD: |
|
| 8 | 1158 |
pop af |
| 4 | 1159 |
push hl |
| 23 | 1160 |
ld hl, SEspeed |
| 8 | 1161 |
dec (hl) |
1162 |
pop hl |
|
| 4 | 1163 |
call NZIf83Plus |
| 23 | 1164 |
jr nz, {+}
|
| 8 | 1165 |
and 1 |
1166 |
out (20h), a |
|
| 23 | 1167 |
+: pop af |
| 8 | 1168 |
pop af |
1169 |
pop af |
|
| 4 | 1170 |
ret |