| author | brandonlw |
| Tue, 20 May 2014 02:59:10 -0400 | |
| changeset 41 | 9ef17625274f |
| parent 40 | ba7bd14b7d7b |
| child 42 | adad2f097dcb |
| 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 |
| 38 | 36 |
bit allowCursor, (iy+plotFlags) |
37 |
jr z, {+}
|
|
|
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) |
| 38 | 42 |
jr {++}
|
43 |
+: call j_CursorOff |
|
44 |
++: call j_RunIndicOn |
|
| 8 | 45 |
or a |
| 38 | 46 |
jr nz, {++}
|
47 |
;ON was pressed; now what? |
|
|
19
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
48 |
bit appWantIntrpt, (iy+appFlags) |
| 38 | 49 |
jr nz, {+}
|
|
19
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
50 |
res onInterrupt, (iy+onFlags) |
| 38 | 51 |
jr jpCoorMon |
52 |
+: ;Return kEnter instead |
|
53 |
ld a, kEnter |
|
| 8 | 54 |
jp sendKPress |
| 38 | 55 |
++: cp kVarx |
56 |
jr nz, monNotVarKey |
|
57 |
ld a, kTheta |
|
| 27 | 58 |
call IsFunctionMode |
| 38 | 59 |
jr nz, {+}
|
60 |
ld a, kCapT |
|
| 27 | 61 |
call IsParametricMode |
| 38 | 62 |
jr nz, {+}
|
63 |
ld a, kCapX |
|
| 27 | 64 |
call IsFuncMode |
| 38 | 65 |
jr nz, {+}
|
66 |
ld a, kRecn |
|
| 8 | 67 |
ld (keyExtend), a |
| 38 | 68 |
ld a, kExtendEcho |
69 |
+: ld (kbdKey), a |
|
70 |
monNotVarKey: |
|
71 |
res appIgnoreKey, (iy+APIFlg) |
|
72 |
res sendKeyStraightTocxMain, (iy+APIFlg) |
|
|
19
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
73 |
bit rawKeyHookActive, (iy+hookflags2) |
| 38 | 74 |
jr z, {+}
|
|
16
27ca02d0d8aa
Give meaningful names to the page 0 calls we know about so far.
brandonlw
parents:
13
diff
changeset
|
75 |
call j_call_rawkey_hook |
| 38 | 76 |
bit appIgnoreKey, (iy+APIFlg) |
77 |
jr nz, jpCoorMon |
|
78 |
bit sendKeyStraightTocxMain, (iy+APIFlg) |
|
79 |
jr z, {+}
|
|
| 4 | 80 |
push af |
| 38 | 81 |
jp Mon_CallcxMain |
82 |
+: cp kOff |
|
83 |
jr z, {+}
|
|
|
16
27ca02d0d8aa
Give meaningful names to the page 0 calls we know about so far.
brandonlw
parents:
13
diff
changeset
|
84 |
call j_PULLDOWNCHK |
| 38 | 85 |
jr c, jpCoorMon |
|
16
27ca02d0d8aa
Give meaningful names to the page 0 calls we know about so far.
brandonlw
parents:
13
diff
changeset
|
86 |
call j_clrTR |
| 38 | 87 |
jr c, jpCoorMon |
88 |
call IsExternalApp |
|
89 |
+: jr z, sendKPress |
|
90 |
cp kDoug |
|
| 8 | 91 |
jr z, sendKPress |
| 38 | 92 |
cp kListflag |
93 |
jr z, sendKPress |
|
94 |
jr Mon_Continue |
|
95 |
-: pop hl |
|
| 8 | 96 |
pop bc |
| 38 | 97 |
djnz {+}
|
98 |
jpCoorMon: |
|
| 8 | 99 |
jp coorMon |
| 38 | 100 |
SendProgToEditTocxMain: |
| 8 | 101 |
ld b, 8 |
| 37 | 102 |
ld hl, progToEdit-1 |
| 38 | 103 |
+: inc hl |
| 8 | 104 |
ld a, (hl) |
105 |
or a |
|
| 38 | 106 |
jr z, jpCoorMon |
| 4 | 107 |
push bc |
108 |
push hl |
|
| 8 | 109 |
ld d, 0 |
110 |
ld e, a |
|
|
16
27ca02d0d8aa
Give meaningful names to the page 0 calls we know about so far.
brandonlw
parents:
13
diff
changeset
|
111 |
call j_TokToKey |
| 4 | 112 |
call cxMain |
|
19
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
113 |
res onInterrupt, (iy+onFlags) |
| 38 | 114 |
jr {-}
|
115 |
Mon_Continue: |
|
116 |
cp EchoStart |
|
117 |
jp c, Mon_HandleNonEchoKey |
|
118 |
cp kExtendEcho |
|
| 8 | 119 |
jr z, sendKPress |
| 38 | 120 |
cp kExtendEcho2 |
| 8 | 121 |
jr z, sendKPress |
| 38 | 122 |
cp kExtendEcho3 |
123 |
jr nz, _isOtherKey |
|
| 8 | 124 |
ld a, (keyExtend) |
125 |
or a |
|
| 38 | 126 |
jr z, {+}
|
| 8 | 127 |
cp 0Dh |
| 38 | 128 |
jr c, _isValid3Key |
129 |
cp 8Ch |
|
130 |
jr c, Mon_HandleOurselves |
|
131 |
cp 0A6h |
|
132 |
jr nc, Mon_HandleOurselves |
|
133 |
_isValid3Key: |
|
134 |
ld a, kExtendEcho3 |
|
| 11 | 135 |
jr sendKPress |
| 38 | 136 |
+: ld a, (kbdKey) |
137 |
_isOtherKey: |
|
138 |
cp 0EFh |
|
139 |
jr nz, {+}
|
|
140 |
ld a, 0A6h |
|
141 |
jr setKeyExtend |
|
142 |
+: cp 0F9h |
|
143 |
jr c, {+}
|
|
| 8 | 144 |
sub 14h |
| 38 | 145 |
jr setKeyExtend |
146 |
+: cp 0F3h |
|
| 8 | 147 |
jr c, sendKPress |
| 38 | 148 |
sub 7Ch |
149 |
setKeyExtend: |
|
| 8 | 150 |
ld (keyExtend), a |
| 38 | 151 |
ld a, kExtendEcho |
| 7 | 152 |
sendKPress: |
| 38 | 153 |
cp echoStart2 |
154 |
jr nz, {+}
|
|
155 |
ld a, kExtendEcho2 |
|
156 |
jr setKeyExtend |
|
157 |
+: cp echoStart1+1 |
|
158 |
jr nz, {+}
|
|
159 |
ld a, 0FDh |
|
160 |
jr setKeyExtend |
|
161 |
sendKPress_NamedVar: |
|
162 |
+: cp kDoug |
|
| 4 | 163 |
push af |
| 38 | 164 |
jr nz, {+}
|
| 37 | 165 |
set recallingPrgmName, (iy+rclFlag2) |
| 38 | 166 |
ld a, kExec |
167 |
jr Mon_CallcxMain |
|
168 |
+: pop af |
|
169 |
cp kListflag |
|
| 4 | 170 |
push af |
| 38 | 171 |
jr nz, Mon_CallcxMain |
| 37 | 172 |
set recallingListName, (iy+rclFlag3) |
| 38 | 173 |
ld a, kListName |
174 |
Mon_CallcxMain: |
|
| 4 | 175 |
call cxMain |
|
19
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
176 |
res onInterrupt, (iy+onFlags) |
| 8 | 177 |
pop af |
| 38 | 178 |
jp z, SendProgToEditTocxMain |
179 |
Mon_HandleOurselves: |
|
|
19
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
180 |
bit enableQueue, (iy+rclFlag) |
| 38 | 181 |
jr z, Mon_Restart |
| 8 | 182 |
ld de, (rclQueue) |
183 |
ld hl, (editCursor) |
|
|
19
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
184 |
bit useRclQueueEnd, (iy+hookflags1) |
| 38 | 185 |
jr z, {+}
|
| 8 | 186 |
ld hl, (rclQueueEnd) |
187 |
ex de, hl |
|
| 38 | 188 |
+: call CpHLDE |
189 |
jr nc, Mon_DisableQueueRestart |
|
| 8 | 190 |
ld a, (hl) |
| 38 | 191 |
call isPtrHLA2ByteTok |
| 8 | 192 |
ld d, 0 |
193 |
ld e, a |
|
| 38 | 194 |
jr nz, {+}
|
| 8 | 195 |
ld d, a |
196 |
inc hl |
|
197 |
ld e, (hl) |
|
| 38 | 198 |
+: bit useRclQueueEnd, (iy+hookflags1) |
199 |
jr z, {+}
|
|
| 8 | 200 |
inc hl |
201 |
ld (rclQueue), hl |
|
| 38 | 202 |
+: call j_TokToKey |
203 |
jpSendKPress: |
|
| 8 | 204 |
jr sendKPress |
| 38 | 205 |
Mon_DisableQueueRestart: |
|
19
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
206 |
res enableQueue, (iy+rclFlag) |
| 38 | 207 |
ld hl, flags+textFlags |
| 8 | 208 |
ld a, (promptIns) |
| 38 | 209 |
res textInsMode, (hl) |
| 8 | 210 |
or (hl) |
211 |
ld (hl), a |
|
| 38 | 212 |
Mon_Restart: |
|
19
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
213 |
res useRclQueueEnd, (iy+hookflags1) |
| 8 | 214 |
jp Mon |
| 38 | 215 |
Mon_HandleNonEchoKey: |
216 |
cp kApp |
|
217 |
jr c, jpSendKPress |
|
218 |
cp echoStart1 |
|
219 |
jr c, Mon_SwitchToStandardContext |
|
220 |
cp kEval |
|
221 |
jr nc, Mon_SwitchToGraphContextThenPressKey |
|
| 39 | 222 |
bit prgmEdit, (iy+prgmFlags) |
| 38 | 223 |
jr nz, jpSendKPress |
224 |
cp echoStart2 |
|
225 |
jr c, Mon_SwitchToGraphContextThenPressKey |
|
226 |
cp kPen |
|
227 |
jr z, Mon_SwitchToGraphContextThenPressKey |
|
228 |
cp echoStart2 |
|
229 |
jr z, jpSendKPress |
|
| 8 | 230 |
ld b, a |
231 |
ld a, (mcxCurApp) |
|
| 38 | 232 |
cp kGraph |
| 8 | 233 |
ld a, b |
| 38 | 234 |
jr nz, jpSendKPress |
235 |
Mon_SwitchToGraphContextThenPressKey: |
|
| 8 | 236 |
ld b, a |
| 38 | 237 |
ld a, kGraph |
238 |
jr {+}
|
|
| 4 | 239 |
push af |
| 38 | 240 |
Mon_SwitchToStandardContext: |
| 8 | 241 |
ld b, a |
| 38 | 242 |
cp kNewApps |
243 |
jr nz, {+}
|
|
| 8 | 244 |
ld a, (keyExtend) |
245 |
add a, b |
|
| 38 | 246 |
cp echoStart1+1 |
| 8 | 247 |
jr nc, JForceCmdNoChar |
248 |
ld b, a |
|
| 38 | 249 |
+: ld c, a |
| 8 | 250 |
ld a, (mcxCurApp) |
| 38 | 251 |
cp kPrgmInput |
252 |
jr nz, {+}
|
|
| 8 | 253 |
ld a, b |
| 38 | 254 |
cp appStart |
| 8 | 255 |
jr z, JForceCmdNoChar |
| 38 | 256 |
ld a, kPrgmInput |
257 |
jr {++}
|
|
258 |
+: cp kError |
|
| 8 | 259 |
ld a, c |
| 38 | 260 |
jr nz, {++}
|
261 |
cp appStart |
|
262 |
jr nz, Mon_Restart |
|
263 |
++: call newContext0 |
|
| 8 | 264 |
ld a, b |
| 38 | 265 |
jp sendKPress_NamedVar |
| 4 | 266 |
|
| 7 | 267 |
JForceCmdNoChar: |
| 8 | 268 |
xor a |
| 4 | 269 |
JForceCmd: |
| 8 | 270 |
ld b, a |
271 |
ld sp, (onSP) |
|
| 38 | 272 |
res cmdExec, (iy+cmdFlags) |
| 23 | 273 |
call SetFastSpeed |
| 38 | 274 |
ld a, appStart |
| 4 | 275 |
call newContext0 |
| 8 | 276 |
ld a, b |
| 38 | 277 |
cp kExec |
278 |
jr nz, {+}
|
|
279 |
ld a, kDoug |
|
280 |
-: jp sendKPress |
|
281 |
+: cp kListName |
|
282 |
jr nz, {-}
|
|
283 |
ld a, kListflag |
|
284 |
jr {-}
|
|
| 4 | 285 |
|
286 |
sysErrHandler: |
|
| 8 | 287 |
ld sp, (onSP) |
| 38 | 288 |
ld a, kError |
| 4 | 289 |
call newContext |
| 8 | 290 |
jp Mon |
| 11 | 291 |
|
| 38 | 292 |
#ifndef DEVIATE_FROM_ORIGINAL_FILE |
293 |
;We don't need this, I don't think. |
|
| 4 | 294 |
ret |
| 38 | 295 |
#endif |
| 4 | 296 |
|
| 7 | 297 |
newContext: |
| 8 | 298 |
ld c, a |
299 |
sub a |
|
300 |
ld (kbdKey), a |
|
301 |
ld b, a |
|
302 |
in a, (6) |
|
| 4 | 303 |
push af |
| 8 | 304 |
ld a, c |
| 4 | 305 |
call newContext0 |
| 8 | 306 |
pop af |
|
41
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
307 |
OutPort6: |
| 8 | 308 |
out (6), a |
| 4 | 309 |
ret |
310 |
||
| 7 | 311 |
newContext0: |
|
19
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
312 |
res appRetKeyOff, (iy+APIFlg) |
| 38 | 313 |
ld hl, mcxCurApp |
| 8 | 314 |
cp (hl) |
| 40 | 315 |
jr nz, newContext_Start |
316 |
cp kGraph |
|
317 |
jr nz, {+}
|
|
318 |
;If you try to start the graph context again, just put it away |
|
| 4 | 319 |
push bc |
|
16
27ca02d0d8aa
Give meaningful names to the page 0 calls we know about so far.
brandonlw
parents:
13
diff
changeset
|
320 |
call j_GRPUTAWAY |
| 8 | 321 |
pop bc |
| 4 | 322 |
ret |
| 40 | 323 |
+: ;We're allowed to re-start the homescreen context again |
324 |
cp appStart |
|
325 |
jr z, newContext_Start |
|
326 |
ld b, kApp |
|
| 4 | 327 |
ret |
| 40 | 328 |
newContext_Start: |
| 4 | 329 |
push bc |
330 |
push af |
|
| 8 | 331 |
pop af |
| 40 | 332 |
cp kInputDone |
|
41
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
333 |
jr nz, {+}
|
| 40 | 334 |
ld a, appStart |
| 4 | 335 |
push af |
| 8 | 336 |
xor a |
|
41
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
337 |
jr newContext_Init |
|
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
338 |
+: push af |
| 40 | 339 |
sub appStart |
|
41
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
340 |
jr nz, newContext_Init |
| 38 | 341 |
res cmdExec, (iy+cmdFlags) |
|
41
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
342 |
newContext_Init: |
|
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
343 |
call j_InitContextA |
| 8 | 344 |
pop af |
| 4 | 345 |
push hl |
346 |
push af |
|
|
19
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
347 |
res curLock, (iy+curFlags) |
|
41
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
348 |
call cxPPutAway2 |
| 8 | 349 |
pop af |
| 4 | 350 |
push af |
| 8 | 351 |
ld b, a |
352 |
ld a, (mcxCurApp) |
|
| 40 | 353 |
cp kPrgmCr |
| 8 | 354 |
ld a, b |
|
41
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
355 |
jr z, _notProgramEditor |
| 39 | 356 |
bit prgmEdit, (iy+prgmFlags) |
|
41
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
357 |
jr z, _notProgramEditor |
| 40 | 358 |
cp kFormat |
|
41
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
359 |
jr z, _skipPutAway |
| 40 | 360 |
cp kMode |
|
41
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
361 |
jr z, _skipPutAway |
| 40 | 362 |
cp kTblSet |
|
41
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
363 |
jr z, _skipPutAway |
|
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
364 |
_notProgramEditor: |
|
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
365 |
;In program editor context, or |
|
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
366 |
;NOT in program editor, or |
|
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
367 |
;NOT in FORMAT, MODE, or TBL SET contexts |
|
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
368 |
call j_RefreshSplitGraphTableFlags |
| 40 | 369 |
cp kError |
|
41
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
370 |
jr z, _skipPutAway |
|
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
371 |
call call_cxPutAway |
| 38 | 372 |
call IsExternalApp |
| 23 | 373 |
call z, SetFastSpeed |
|
41
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
374 |
_skipPutAway: |
| 8 | 375 |
ld a, (mcxCurApp) |
376 |
pop bc |
|
| 4 | 377 |
push af |
378 |
push bc |
|
| 40 | 379 |
cp kError |
|
41
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
380 |
jr nz, {+}
|
|
16
27ca02d0d8aa
Give meaningful names to the page 0 calls we know about so far.
brandonlw
parents:
13
diff
changeset
|
381 |
call j_POPCX |
|
41
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
382 |
call cxPutAway_NoPartial |
| 38 | 383 |
call IsExternalApp |
| 23 | 384 |
call z, SetFastSpeed |
|
41
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
385 |
+: ld hl, mcxMain |
| 40 | 386 |
ld de, mcxPrev |
387 |
ld bc, 14 |
|
| 4 | 388 |
ldir |
| 8 | 389 |
ld a, (appFlagsAddr) |
390 |
ld (de), a |
|
391 |
pop af |
|
| 4 | 392 |
push af |
|
41
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
393 |
cp kTable |
|
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
394 |
jr nz, {+}
|
|
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
395 |
call j_SetVertSplitRedisplayFlags |
|
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
396 |
jr newContext_Finish |
|
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
397 |
+: cp kGraph |
|
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
398 |
call z, j_SetVertSplitRedisplayFlags |
|
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
399 |
jr z, {+}
|
|
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
400 |
set NEED_BUFCPY, (iy+VERTFLAG2) |
|
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
401 |
set NEED_RETABLE, (iy+VERTFLAG2) |
|
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
402 |
jr newContext_Finish |
|
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
403 |
+: call ResetSplitOverride |
| 4 | 404 |
call CheckSplitFlag |
|
41
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
405 |
jr z, newContext_Finish |
| 8 | 406 |
ld a, (mcxCurApp) |
|
16
27ca02d0d8aa
Give meaningful names to the page 0 calls we know about so far.
brandonlw
parents:
13
diff
changeset
|
407 |
call j_CompareContext |
|
41
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
408 |
jr nz, newContext_Finish |
| 40 | 409 |
ld a, appStart |
| 8 | 410 |
ld (mcxCurApp), a |
|
41
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
411 |
ld hl, j_InitHomescreenContext |
|
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
412 |
ld a, (iy+shiftFlags) |
| 4 | 413 |
push af |
| 40 | 414 |
ld a, appstart |
|
41
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
415 |
call CallAppChangeRoutineHL |
| 4 | 416 |
call cxPutAway |
| 8 | 417 |
pop af |
|
41
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
418 |
ld (iy+shiftFlags), a |
|
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
419 |
newContext_Finish: |
| 8 | 420 |
pop af |
421 |
pop bc |
|
|
41
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
422 |
cp kPrgmEd |
|
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
423 |
jr nz, _notPrgmEd |
| 4 | 424 |
push af |
| 8 | 425 |
ld a, b |
| 40 | 426 |
cp kError |
|
41
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
427 |
jr z, {+}
|
|
19
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
428 |
set promptEdit, (iy+promptFlags) |
|
41
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
429 |
+: pop af |
|
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
430 |
_notPrgmEd: |
| 8 | 431 |
pop hl |
432 |
ld (mcxCurApp), a |
|
433 |
pop af |
|
|
41
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
434 |
CallAppChangeRoutineHL: |
| 40 | 435 |
bit appChangeHookActive, (iy+hookflags4) |
436 |
call nz, j_call_appchange_hook |
|
| 4 | 437 |
push af |
|
41
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
438 |
set monAppInit, (iy+monFlags) |
| 40 | 439 |
call jpHL |
|
41
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
440 |
res monAppInit, (iy+monFlags) |
| 8 | 441 |
pop bc |
| 4 | 442 |
ret |
443 |
||
| 40 | 444 |
ldHLind_AWord: |
| 8 | 445 |
add a, a |
446 |
ld e, a |
|
447 |
ld d, 0 |
|
448 |
add hl, de |
|
449 |
jp ldHLind |
|
| 4 | 450 |
|
| 7 | 451 |
cxPutAway: |
|
41
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
452 |
call cxPPutAway2 |
|
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
453 |
cxPutAway_NoPartial: |
|
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
454 |
call call_cxPutAway |
|
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
455 |
ResetPromptEditFlag: |
|
19
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
456 |
res promptEdit, (iy+promptFlags) |
| 4 | 457 |
ret |
458 |
||
|
41
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
459 |
cxPPutAway2: |
|
19
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
460 |
bit nocxPutAway, (iy+contextFlags) |
| 8 | 461 |
ret nz |
| 4 | 462 |
push hl |
| 8 | 463 |
ld hl, (mcxPPutAway) |
|
41
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
464 |
call CallCxRoutineHL |
|
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
465 |
jr {+}
|
|
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
466 |
call_cxPutAway: |
|
19
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
467 |
bit nocxPutAway, (iy+contextFlags) |
| 8 | 468 |
ret nz |
| 4 | 469 |
push hl |
| 8 | 470 |
ld hl, (mcxPutAway) |
|
41
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
471 |
call CallCxRoutineHL |
| 10 | 472 |
call zero_basic_prog |
|
41
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
473 |
+: pop hl |
| 32 | 474 |
jp CancelAlpha |
| 4 | 475 |
|
476 |
cxRedisp: |
|
|
41
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
477 |
ld hl, (mcxRedisp) |
|
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
478 |
jr CallCxRoutineHL |
| 4 | 479 |
|
480 |
cxSizeWind: |
|
|
41
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
481 |
bit monAppInit, (iy+monFlags) |
| 4 | 482 |
push af |
| 8 | 483 |
ld a, (menuActive) |
484 |
ld b, a |
|
485 |
ld hl, (mcxSizeWind) |
|
|
41
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
486 |
call CallCxRoutineHL |
| 8 | 487 |
pop af |
| 4 | 488 |
ret |
489 |
||
490 |
cxErrEP: |
|
| 8 | 491 |
ld hl, (mcxErrorEP) |
|
41
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
492 |
CallCxRoutineHL: |
| 8 | 493 |
in a, (6) |
| 4 | 494 |
push af |
| 8 | 495 |
ld a, (mcxPage) |
|
41
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
496 |
call OutPort6 |
| 40 | 497 |
call jpHL |
| 8 | 498 |
pop af |
|
41
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
499 |
call OutPort6 |
| 4 | 500 |
ret |
501 |
||
|
41
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
502 |
cxMain: push hl |
| 8 | 503 |
ld hl, (mcxMain) |
| 4 | 504 |
push af |
| 8 | 505 |
ld a, (mcxPage) |
|
41
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
506 |
call OutPort6 |
| 8 | 507 |
pop af |
| 40 | 508 |
call jpHL |
| 8 | 509 |
pop hl |
| 4 | 510 |
ret |
511 |
||
|
41
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
512 |
jpHL: jp (hl) |
| 4 | 513 |
|
|
41
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
514 |
call_cxPrevRedisp: |
|
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
515 |
ld a, (cxPrevPage) |
|
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
516 |
call OutPort6 |
|
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
517 |
ld hl, (cxPrevRedisp) |
| 40 | 518 |
jr jpHL |
| 4 | 519 |
|
520 |
monErrHand: |
|
| 26 | 521 |
ld hl, monErrHand |
| 4 | 522 |
call pushErrorHandleR |
|
41
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
523 |
ld a, kError |
| 4 | 524 |
call newContext0 |
| 8 | 525 |
jp Mon |
| 11 | 526 |
|
|
41
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
527 |
#ifndef DEVIATE_FROM_ORIGINAL_FILE |
|
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
528 |
;I don't think this is used *anywhere*. |
| 4 | 529 |
push hl |
|
41
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
530 |
ld hl, 100 |
|
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
531 |
jr AppInitEnoughMemHL |
|
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
532 |
#endif |
|
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
533 |
AppInitEnoughMem50: |
|
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
534 |
push hl |
|
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
535 |
ld hl, 50 |
|
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
536 |
AppInitEnoughMemHL: |
| 4 | 537 |
call EnoughMem |
|
41
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
538 |
jp c, ErrMemory_NoGoTo |
| 8 | 539 |
pop hl |
| 4 | 540 |
AppInit: |
| 26 | 541 |
ld de, mcxMain |
542 |
ld bc, 12 |
|
| 4 | 543 |
ldir |
| 8 | 544 |
ld a, (hl) |
545 |
ld (appFlagsAddr), a |
|
546 |
in a, (6) |
|
547 |
ld (mcxPage), a |
|
| 4 | 548 |
ret |
549 |
||
| 38 | 550 |
IsExternalApp: |
| 8 | 551 |
ld b, a |
552 |
ld a, (mcxCurApp) |
|
| 38 | 553 |
cp kExtApps |
| 8 | 554 |
ld a, b |
| 4 | 555 |
ret |
556 |
||
| 7 | 557 |
handleONKeyPress: |
| 23 | 558 |
;Switch to slow speed |
| 8 | 559 |
in a, (2) |
| 23 | 560 |
and 80h |
561 |
jr z, {+}
|
|
| 8 | 562 |
in a, (20h) |
563 |
ld e, a |
|
564 |
xor a |
|
565 |
out (20h), a |
|
| 23 | 566 |
+: ld b, 0 |
567 |
debounceRestart: |
|
| 8 | 568 |
ld hl, 1016h |
| 23 | 569 |
debounceLoop: |
| 8 | 570 |
in a, (4) |
571 |
and 8 |
|
572 |
cp b |
|
573 |
ld b, a |
|
| 23 | 574 |
jr nz, debounceRestart |
| 8 | 575 |
dec hl |
576 |
ld a, l |
|
577 |
or h |
|
| 23 | 578 |
jr nz, debounceLoop |
| 8 | 579 |
cp b |
| 23 | 580 |
jr z, ONKeyBeingPressed |
581 |
;ON key is being released |
|
| 8 | 582 |
in a, (7) |
583 |
ld b, a |
|
584 |
in a, (2) |
|
| 23 | 585 |
and 80h |
586 |
jr z, {+}
|
|
587 |
;Restore previous speed |
|
| 8 | 588 |
ld a, e |
589 |
out (20h), a |
|
590 |
ld a, b |
|
| 23 | 591 |
cp 81h |
592 |
jr isRAMUnhooked |
|
593 |
+: ld a, b |
|
594 |
and 4Fh |
|
595 |
cp 41h |
|
596 |
isRAMUnhooked: |
|
597 |
jp nz, RAMUnhookedWaitForPowerOn |
|
|
19
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
598 |
bit onRunning, (iy+onFlags) |
| 8 | 599 |
ret nz |
| 23 | 600 |
;ON key being released and we're just off, so just return from the interrupt handler |
| 8 | 601 |
pop hl |
602 |
sub a |
|
| 4 | 603 |
push af |
| 8 | 604 |
ld a, 8 |
605 |
out (3), a |
|
606 |
pop af |
|
607 |
out (3), a |
|
608 |
ld a, 11h |
|
609 |
jp noSecondHardwareTimer |
|
| 23 | 610 |
ONKeyBeingPressed: |
611 |
;Restore previous speed |
|
| 8 | 612 |
in a, (2) |
| 23 | 613 |
and 80h |
614 |
jr z, HandlePowerOnRequest |
|
| 8 | 615 |
ld a, e |
616 |
out (20h), a |
|
| 23 | 617 |
|
618 |
.module HandlePowerOnRequest |
|
619 |
HandlePowerOnRequest: |
|
620 |
ld a, 76h |
|
| 8 | 621 |
out (4), a |
622 |
in a, (2) |
|
| 23 | 623 |
and 80h |
624 |
jr z, {+}
|
|
| 8 | 625 |
in a, (7) |
| 23 | 626 |
cp 81h |
627 |
jr _isRAMUnhooked |
|
628 |
+: in a, (7) |
|
629 |
and 4Fh |
|
630 |
cp 41h |
|
631 |
_isRAMUnhooked: |
|
632 |
jp nz, HookRAMAndPowerOn |
|
|
19
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
633 |
bit shift2nd, (iy+shiftFlags) |
| 23 | 634 |
jp z, HandleONPressed |
635 |
;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
|
636 |
bit enableKeyEcho, (iy+hookflags1) |
| 23 | 637 |
jr nz, {+}
|
|
19
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
638 |
bit appRetKeyOff, (iy+APIFlg) |
| 8 | 639 |
jr z, PowerOff |
| 23 | 640 |
+: set kOffPressed, (iy+APIFlg) |
641 |
ret |
|
642 |
.endmodule |
|
| 4 | 643 |
|
| 23 | 644 |
.module PowerOff |
| 7 | 645 |
PowerOff: |
| 8 | 646 |
ld a, 8 |
| 4 | 647 |
push af |
| 8 | 648 |
ld a, 8 |
649 |
out (3), a |
|
650 |
pop af |
|
651 |
out (3), a |
|
| 4 | 652 |
call TurnOffLCD |
|
19
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
653 |
bit resetOnPowerOn, (iy+selfTestFlag) |
| 23 | 654 |
jr z, {+}
|
655 |
;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
|
656 |
bit apdAble, (iy+apdFlags) |
| 23 | 657 |
jr z, _skipRAMChecksum |
658 |
+: call SetFastSpeed |
|
659 |
call PreviousContext_CloseAnyOpenMenu |
|
|
16
27ca02d0d8aa
Give meaningful names to the page 0 calls we know about so far.
brandonlw
parents:
13
diff
changeset
|
660 |
call j_hideCursor |
|
19
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
661 |
set monAbandon, (iy+monFlags) |
| 23 | 662 |
ld hl, lcdFlag |
663 |
set powerLcdForGC, (hl) |
|
| 4 | 664 |
call forcecmd |
| 23 | 665 |
ld hl, lcdFlag |
666 |
res powerLcdForGC, (hl) |
|
|
19
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
667 |
res monAbandon, (iy+monFlags) |
|
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
668 |
bit alt_Off, (iy+hookflags1) |
| 24 | 669 |
call nz, j_ExecuteOFFSCRPT |
| 28 | 670 |
_DoShutDown: |
671 |
call j_SetupDBusMem |
|
| 8 | 672 |
ld a, 8 |
673 |
out (3), a |
|
| 4 | 674 |
call TurnOffLCD |
| 23 | 675 |
ld hl, flags+onFlags |
|
41
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
676 |
bit onClearScrn, (hl) |
|
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
677 |
res onClearScrn, (hl) |
|
16
27ca02d0d8aa
Give meaningful names to the page 0 calls we know about so far.
brandonlw
parents:
13
diff
changeset
|
678 |
call nz, j_ClrScrn |
| 4 | 679 |
call calculateRAMChecksum |
| 22 | 680 |
ld (RAMChecksum), hl |
| 23 | 681 |
_skipRAMChecksum: |
|
19
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
682 |
res bPLinkOn, (iy+hookflags1) |
|
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
683 |
res enableKeyEcho, (iy+hookflags1) |
| 24 | 684 |
ld a, 36h |
| 8 | 685 |
out (4), a |
686 |
ld a, 11h |
|
687 |
out (3), a |
|
|
19
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
688 |
res shift2nd, (iy+shiftFlags) |
|
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
689 |
res onRunning, (iy+onFlags) |
| 8 | 690 |
ex af, af' |
| 4 | 691 |
exx |
692 |
ei |
|
| 22 | 693 |
-: halt |
694 |
jr {-}
|
|
| 23 | 695 |
.endmodule |
| 4 | 696 |
|
| 23 | 697 |
HandleONPressed: |
| 22 | 698 |
res checkNoBatteriesNextTime, (iy+batteryFlags2) |
| 4 | 699 |
call ApdSetup |
|
19
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
700 |
bit onRunning, (iy+onFlags) |
|
41
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
701 |
jr nz, SetOnInterruptFlag |
|
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
702 |
HandleONPressed_WasOff: |
|
19
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
703 |
set onRunning, (iy+onFlags) |
| 22 | 704 |
ld hl, flags+apdFlags |
|
41
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
705 |
bit APDWarmStart, (hl) |
|
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
706 |
res APDWarmStart, (hl) |
|
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
707 |
jr nz, restoreToPoweredOn |
|
19
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
708 |
res indicInUse, (iy+indicFlags) |
|
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
709 |
bit resetOnPowerOn, (iy+selfTestFlag) |
|
41
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
710 |
jr z, {+}
|
| 8 | 711 |
bit 2, (hl) |
|
25
fab1bedd3281
Commit some experimental commented-out code for 84+CSE detection and booting
brandonlw
parents:
24
diff
changeset
|
712 |
jp z, resetRam |
|
41
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
713 |
+: ld sp, (onSP) |
|
16
27ca02d0d8aa
Give meaningful names to the page 0 calls we know about so far.
brandonlw
parents:
13
diff
changeset
|
714 |
call j_resetStacks |
| 8 | 715 |
xor a |
716 |
ld (MenuCurrent), a |
|
| 4 | 717 |
call refreshSystemRAM |
|
41
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
718 |
call PowerOn |
|
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
719 |
call j_SetExecutionPermissionsAndDeleteOldApps |
| 38 | 720 |
bit cmdExec, (iy+cmdFlags) |
|
41
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
721 |
call nz, j_SetupLastEntryEditResetFlags |
| 4 | 722 |
ei |
| 8 | 723 |
jp Mon |
|
41
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
724 |
restoreToPoweredOn: |
|
19
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
725 |
bit alt_On, (iy+hookflags1) |
| 24 | 726 |
call nz, j_ExecuteONSCRPT |
| 8 | 727 |
ld a, 8 |
| 4 | 728 |
push af |
| 8 | 729 |
ld a, 8 |
730 |
out (3), a |
|
731 |
pop af |
|
732 |
out (3), a |
|
|
16
27ca02d0d8aa
Give meaningful names to the page 0 calls we know about so far.
brandonlw
parents:
13
diff
changeset
|
733 |
call j_RstrOScreen |
| 8 | 734 |
pop de |
735 |
pop de |
|
736 |
pop de |
|
|
41
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
737 |
set APDRunning, (hl) |
|
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
738 |
call PowerOn |
| 8 | 739 |
ex af, af' |
| 4 | 740 |
exx |
741 |
ei |
|
742 |
reti |
|
|
41
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
743 |
SetOnInterruptFlag: |
|
19
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
744 |
set onInterrupt, (iy+onFlags) |
| 4 | 745 |
ret |
746 |
||
| 23 | 747 |
HookRAMAndPowerOn: |
|
41
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
748 |
ld a, 76h |
| 8 | 749 |
out (4), a |
|
41
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
750 |
ld a, 0C0h |
| 8 | 751 |
out (0), a |
752 |
in a, (2) |
|
|
41
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
753 |
and 80h |
|
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
754 |
ld a, 41h |
|
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
755 |
jr z, {+}
|
| 8 | 756 |
ld a, 1 |
757 |
out (20h), a |
|
758 |
xor a |
|
759 |
out (0Fh), a |
|
|
41
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
760 |
ld a, 81h |
|
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
761 |
+: out (7), a |
| 8 | 762 |
xor a |
| 4 | 763 |
push af |
| 8 | 764 |
ld a, 8 |
765 |
out (3), a |
|
766 |
pop af |
|
767 |
out (3), a |
|
|
41
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
768 |
ld iy, flags |
| 4 | 769 |
call NZIf83Plus |
|
41
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
770 |
call z, j_ResetIOPorts |
| 22 | 771 |
ld hl, (RAMChecksum) |
| 8 | 772 |
ld de, 0A55Ah |
| 4 | 773 |
call CpHLDE |
| 8 | 774 |
jp z, doFunkyTurnOnFromA55AChecksum |
| 4 | 775 |
call NZIf83Plus |
|
41
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
776 |
jr z, {+}
|
|
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
777 |
;The loading of B here is to see if the boot code sets it to 1. |
|
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
778 |
;This indicates a change in LCD hardware and requires a different contrast setting. |
| 8 | 779 |
ld b, 0 |
| 11 | 780 |
B_CALL(_getHardwareVersion) |
| 8 | 781 |
bit 0, b |
782 |
ld a, 1Fh |
|
|
41
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
783 |
jr z, {++}
|
| 8 | 784 |
ld a, 1Ch |
|
41
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
785 |
jr {++}
|
|
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
786 |
+: ld a, 17h |
|
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
787 |
++: ld (contrast), a |
| 4 | 788 |
call calculateRAMChecksum |
| 22 | 789 |
ld de, (RAMChecksum) |
| 4 | 790 |
call CpHLDE |
|
25
fab1bedd3281
Commit some experimental commented-out code for 84+CSE detection and booting
brandonlw
parents:
24
diff
changeset
|
791 |
jr nz, resetRam |
| 8 | 792 |
dec de |
| 22 | 793 |
ld (RAMChecksum), de |
|
41
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
794 |
call j_SetExecutionPermissions |
| 23 | 795 |
call PreviousContext_CloseAnyOpenMenu |
| 8 | 796 |
ld a, 0Bh |
797 |
out (3), a |
|
|
19
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
798 |
res apdWarmStart, (iy+apdFlags) |
| 4 | 799 |
call forcecmd |
|
41
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
800 |
jp HandleONPressed_WasOff |
| 4 | 801 |
|
| 7 | 802 |
resetRam: |
| 4 | 803 |
di |
| 8 | 804 |
ld hl, 8000h |
805 |
ld de, 8001h |
|
806 |
ld bc, 7FFFh |
|
807 |
ld (hl), 0 |
|
| 4 | 808 |
ldir |
|
41
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
809 |
ld hl, 0109h |
| 8 | 810 |
ld (localLanguage), hl |
|
25
fab1bedd3281
Commit some experimental commented-out code for 84+CSE detection and booting
brandonlw
parents:
24
diff
changeset
|
811 |
;#ifdef DEVIATE_FROM_ORIGINAL_FILE |
|
fab1bedd3281
Commit some experimental commented-out code for 84+CSE detection and booting
brandonlw
parents:
24
diff
changeset
|
812 |
; call NZIfColorModel |
|
fab1bedd3281
Commit some experimental commented-out code for 84+CSE detection and booting
brandonlw
parents:
24
diff
changeset
|
813 |
; jr z, {+}
|
|
fab1bedd3281
Commit some experimental commented-out code for 84+CSE detection and booting
brandonlw
parents:
24
diff
changeset
|
814 |
; set 0, (iy+asm_Flag3) |
|
fab1bedd3281
Commit some experimental commented-out code for 84+CSE detection and booting
brandonlw
parents:
24
diff
changeset
|
815 |
;+: |
|
fab1bedd3281
Commit some experimental commented-out code for 84+CSE detection and booting
brandonlw
parents:
24
diff
changeset
|
816 |
;#endif |
| 4 | 817 |
page0_9DE: |
|
41
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
818 |
ld a, 0C0h |
| 8 | 819 |
out (0), a |
820 |
ld sp, 0FFF7h |
|
| 4 | 821 |
call Page0Call_3EBB |
| 26 | 822 |
ld hl, monErrHand |
| 4 | 823 |
call pushErrorHandleR |
| 8 | 824 |
ld (onSP), sp |
| 4 | 825 |
call Page0Call_3EC1 |
| 8 | 826 |
jp Page0Call_3EC7 |
| 4 | 827 |
|
828 |
page0_9F8: |
|
829 |
di |
|
| 8 | 830 |
ld a, 0C0h ; '' |
831 |
out (0), a |
|
832 |
ld sp, 0FFF7h |
|
833 |
ld hl, 8000h |
|
834 |
ld de, 8001h |
|
835 |
ld bc, 7FFFh |
|
836 |
ld (hl), 0 |
|
| 4 | 837 |
ldir |
| 8 | 838 |
ld hl, 109h |
839 |
ld (localLanguage), hl |
|
| 4 | 840 |
call Page0Call_3EBB |
| 26 | 841 |
ld hl, monErrHand |
| 4 | 842 |
call pushErrorHandleR |
| 8 | 843 |
ld (onSP), sp |
| 4 | 844 |
call Page0Call_3EC1 |
| 8 | 845 |
jp Page0Call_3ECD |
| 4 | 846 |
|
|
41
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
847 |
GetKey_ClearScrn_MonForceKey: |
| 4 | 848 |
call GetCSC |
|
41
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
849 |
set onClearScrn, (iy+onFlags) |
|
16
27ca02d0d8aa
Give meaningful names to the page 0 calls we know about so far.
brandonlw
parents:
13
diff
changeset
|
850 |
call j_getkey |
|
27ca02d0d8aa
Give meaningful names to the page 0 calls we know about so far.
brandonlw
parents:
13
diff
changeset
|
851 |
call j_ClrScrn |
|
41
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
852 |
res onClearScrn, (iy+onFlags) |
| 8 | 853 |
jp monForceKey |
| 4 | 854 |
|
| 7 | 855 |
calculateRAMChecksum: |
| 4 | 856 |
push ix |
| 8 | 857 |
ld ix, 9D95h |
858 |
ld bc, 60DBh |
|
859 |
ld hl, 11h |
|
860 |
ld d, h |
|
| 7 | 861 |
page0_A47: |
| 8 | 862 |
ld e, (ix+0) |
863 |
inc ix |
|
864 |
add hl, de |
|
865 |
dec bc |
|
866 |
ld a, c |
|
867 |
or b |
|
868 |
jr nz, page0_A47 |
|
869 |
ld e, d |
|
870 |
ex de, hl |
|
871 |
sbc hl, de |
|
872 |
pop ix |
|
| 4 | 873 |
ret |
874 |
||
| 7 | 875 |
forcecmd: |
| 4 | 876 |
call CanAlphIns |
|
19
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
877 |
res textInverse, (iy+textFlags) |
|
16
27ca02d0d8aa
Give meaningful names to the page 0 calls we know about so far.
brandonlw
parents:
13
diff
changeset
|
878 |
call j_Disp |
| 38 | 879 |
res cmdExec, (iy+cmdFlags) |
|
41
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
880 |
ld a, appStart |
| 8 | 881 |
jp newContext0 |
| 4 | 882 |
|
| 7 | 883 |
bootCalc: |
| 23 | 884 |
call SetSlowSpeed |
|
41
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
885 |
ld a, 77h |
| 8 | 886 |
out (4), a |
887 |
ld b, 0 |
|
888 |
ld sp, 0FDFAh |
|
| 7 | 889 |
page0_A78: |
| 4 | 890 |
djnz $ |
| 8 | 891 |
ld ix, 1 |
892 |
add ix, sp |
|
893 |
ld sp, ix |
|
894 |
jr nc, page0_A78 |
|
895 |
ld sp, 0FFC5h |
|
896 |
in a, (2) |
|
897 |
and 80h ; '' |
|
898 |
jr z, page0_A91 |
|
899 |
ld a, 1 |
|
900 |
out (20h), a |
|
| 7 | 901 |
page0_A91: |
| 8 | 902 |
ld a, 77h ; 'w' |
903 |
out (4), a |
|
| 4 | 904 |
im 1 |
| 8 | 905 |
ld a, 0C0h ; '' |
906 |
out (0), a |
|
| 4 | 907 |
|
| 23 | 908 |
RAMUnhookedWaitForPowerOn: |
| 8 | 909 |
ld a, 37h ; '7' |
910 |
out (4), a |
|
911 |
sub a |
|
| 4 | 912 |
push af |
| 8 | 913 |
ld a, 8 |
914 |
out (3), a |
|
915 |
pop af |
|
916 |
out (3), a |
|
917 |
ld a, 11h |
|
918 |
out (3), a |
|
| 4 | 919 |
ei |
920 |
halt |
|
921 |
||
| 7 | 922 |
lcd_busy: |
| 4 | 923 |
push af |
| 7 | 924 |
page0_AAF: |
| 8 | 925 |
in a, (2) |
926 |
and 2 |
|
927 |
jr z, page0_AAF |
|
928 |
pop af |
|
| 4 | 929 |
ret |
930 |
||
931 |
page0_AB7: |
|
| 7 | 932 |
TurnOffLCD: |
| 8 | 933 |
ld a, 2 |
| 4 | 934 |
page0_AB9: |
935 |
push af |
|
| 7 | 936 |
loop: |
| 8 | 937 |
in a, (2) |
938 |
and 2 |
|
939 |
jr z, loop |
|
940 |
pop af |
|
941 |
out (10h), a |
|
| 4 | 942 |
ret |
943 |
||
944 |
page0_AC4: |
|
| 7 | 945 |
smallDelay: |
| 4 | 946 |
push af |
| 8 | 947 |
inc hl |
948 |
dec hl |
|
949 |
pop af |
|
| 4 | 950 |
ret |
951 |
||
952 |
page0_AC9: |
|
| 7 | 953 |
slowDelay: |
| 8 | 954 |
ld a, 0FFh |
| 4 | 955 |
|
| 7 | 956 |
slowDelayA: |
| 4 | 957 |
push af |
958 |
call forceSlowSpeed |
|
| 8 | 959 |
pop af |
| 7 | 960 |
delayLoop: |
| 4 | 961 |
call smallDelay |
| 8 | 962 |
dec a |
963 |
jr nz, delayLoop |
|
| 4 | 964 |
call restorePreviousSpeed |
965 |
ret |
|
966 |
||
|
41
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
967 |
PowerOn: |
| 8 | 968 |
ld a, 0Bh |
969 |
out (3), a |
|
|
16
27ca02d0d8aa
Give meaningful names to the page 0 calls we know about so far.
brandonlw
parents:
13
diff
changeset
|
970 |
call j_LCD_DRIVERON |
| 4 | 971 |
call Chk_Batt_Low_2 |
| 8 | 972 |
ret nz |
| 4 | 973 |
call refreshSystemRAM |
| 8 | 974 |
in a, (2) |
975 |
bit 0, a |
|
| 23 | 976 |
jp z, PowerOff._skipRAMChecksum |
| 7 | 977 |
sub_AEF: |
|
41
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
978 |
call j_ClearScreen_SetupAPDFromPowerOn |
| 4 | 979 |
call forcecmd |
|
41
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
980 |
jp j_DisplayLowBattRecommendChange |
| 4 | 981 |
|
| 7 | 982 |
Chk_Batt_Low_2: |
| 4 | 983 |
call refreshSystemRAM |
984 |
Chk_Batt_Low: |
|
| 8 | 985 |
ld a, 76h ; 'v' |
986 |
out (4), a |
|
987 |
ld a, 0F6h ; ' |
|
988 |
out (4), a |
|
989 |
ld b, 5 |
|
| 7 | 990 |
longerDelay: |
| 4 | 991 |
call slowDelay |
992 |
djnz longerDelay |
|
| 8 | 993 |
set 5, (iy+18h) |
994 |
in a, (2) |
|
995 |
bit 0, a |
|
|
19
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
996 |
jr nz, {+}
|
| 8 | 997 |
res 5, (iy+18h) |
|
19
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
998 |
+: ld a, 76h ; 'v' |
| 8 | 999 |
out (4), a |
1000 |
ld a, 0Ah |
|
| 4 | 1001 |
call slowDelayA |
| 8 | 1002 |
ld a, 76h ; 'v' |
1003 |
out (4), a |
|
1004 |
bit 5, (iy+18h) |
|
| 4 | 1005 |
ret |
| 24 | 1006 |
|
1007 |
.module RefreshSystemRAM |
|
| 7 | 1008 |
refreshSystemRAM: |
| 8 | 1009 |
ld bc, 2710h |
| 24 | 1010 |
ld hl, ramStart |
1011 |
-: ld a, (hl) |
|
| 8 | 1012 |
ld (hl), a |
1013 |
dec bc |
|
1014 |
ld a, b |
|
1015 |
or c |
|
| 24 | 1016 |
jr nz, {-}
|
| 4 | 1017 |
ret |
| 24 | 1018 |
.endmodule |
| 4 | 1019 |
|
| 7 | 1020 |
doFunkyTurnOnFromA55AChecksum: |
| 8 | 1021 |
ld hl, 0 |
| 22 | 1022 |
ld (RAMChecksum), hl |
| 8 | 1023 |
ld sp, (onSP) |
| 24 | 1024 |
ld iy, flags |
| 4 | 1025 |
call Page0Call_3EE5 |
| 23 | 1026 |
call PreviousContext_CloseAnyOpenMenu |
| 4 | 1027 |
call forcecmd |
|
19
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
1028 |
res apdWarmStart, (iy+apdFlags) |
| 38 | 1029 |
bit cmdExec, (iy+cmdFlags) |
|
41
9ef17625274f
Finished _newContext and other page 0 cleanup. Still lots left to go...
brandonlw
parents:
40
diff
changeset
|
1030 |
call nz, j_SetupLastEntryEditResetFlags |
| 8 | 1031 |
ld a, 0Bh |
1032 |
out (3), a |
|
|
16
27ca02d0d8aa
Give meaningful names to the page 0 calls we know about so far.
brandonlw
parents:
13
diff
changeset
|
1033 |
call j_LCD_DRIVERON |
|
19
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
1034 |
set onRunning, (iy+onFlags) |
| 4 | 1035 |
call Chk_Batt_Low_2 |
1036 |
call z, sub_AEF |
|
|
19
271dfee8e3ad
Set all known flags -- I'm amazed this actually worked.
brandonlw
parents:
16
diff
changeset
|
1037 |
bit alt_On, (iy+hookflags1) |
| 24 | 1038 |
call nz, j_ExecuteONSCRPT |
| 4 | 1039 |
ei |
| 8 | 1040 |
jp Mon |
| 4 | 1041 |
|
| 23 | 1042 |
PreviousContext_CloseAnyOpenMenu: |
1043 |
call IsInMenu |
|
1044 |
jr z, PreviousContext |
|
| 8 | 1045 |
xor a |
1046 |
ld (MenuCurrent), a |
|
|
16
27ca02d0d8aa
Give meaningful names to the page 0 calls we know about so far.
brandonlw
parents:
13
diff
changeset
|
1047 |
call j_rstrpartial |
| 23 | 1048 |
PreviousContext: |
|
16
27ca02d0d8aa
Give meaningful names to the page 0 calls we know about so far.
brandonlw
parents:
13
diff
changeset
|
1049 |
call j_PrevContext |
| 4 | 1050 |
ret |
1051 |
||
| 23 | 1052 |
IsInMenu: |
| 8 | 1053 |
ld b, a |
1054 |
ld a, (MenuCurrent) |
|
1055 |
or a |
|
1056 |
ld a, b |
|
| 4 | 1057 |
ret |
1058 |
||
| 23 | 1059 |
SetSlowSpeed: |
| 4 | 1060 |
call NZIf83Plus |
| 8 | 1061 |
ret nz |
| 23 | 1062 |
jr {+}
|
| 7 | 1063 |
forceSlowSpeed: |
| 4 | 1064 |
call NZIf83Plus |
| 8 | 1065 |
ret nz |
1066 |
in a, (20h) |
|
1067 |
ld (oldSESpeed), a |
|
| 23 | 1068 |
+: push af |
| 8 | 1069 |
xor a |
1070 |
out (20h), a |
|
1071 |
pop af |
|
| 4 | 1072 |
ret |
1073 |
||
| 7 | 1074 |
restorePreviousSpeed: |
| 4 | 1075 |
call NZIf83Plus |
| 8 | 1076 |
ret nz |
1077 |
ld a, (oldSESpeed) |
|
1078 |
and 1 |
|
1079 |
out (20h), a |
|
| 4 | 1080 |
ret |
1081 |
||
1082 |
SetExSpeed: |
|
| 8 | 1083 |
or a |
| 23 | 1084 |
SetSpeed_NZForFast: |
1085 |
jr z, SetSlowSpeed |
|
1086 |
SetFastSpeed: |
|
| 4 | 1087 |
push af |
1088 |
call NZIf83Plus |
|
| 23 | 1089 |
jr nz, {+}
|
| 8 | 1090 |
ld a, 1 |
1091 |
out (20h), a |
|
| 23 | 1092 |
+: pop af |
| 4 | 1093 |
ret |
1094 |
||
1095 |
page0_BBD: |
|
| 8 | 1096 |
pop af |
| 4 | 1097 |
push hl |
| 23 | 1098 |
ld hl, SEspeed |
| 8 | 1099 |
dec (hl) |
1100 |
pop hl |
|
| 4 | 1101 |
call NZIf83Plus |
| 23 | 1102 |
jr nz, {+}
|
| 8 | 1103 |
and 1 |
1104 |
out (20h), a |
|
| 23 | 1105 |
+: pop af |
| 8 | 1106 |
pop af |
1107 |
pop af |
|
| 4 | 1108 |
ret |