diff -r ba7bd14b7d7b -r 9ef17625274f source/page7C/initial.asm --- a/source/page7C/initial.asm Thu May 15 05:38:01 2014 -0400 +++ b/source/page7C/initial.asm Tue May 20 02:59:10 2014 -0400 @@ -2014,14 +2014,14 @@ call Page7C_2DCF ld a, (unk_867C) cp 1 - jp z, Page7C_3A0B + jp z, InitLinkIOContext cp 2 jr nz, p7Cloc_4BEF ld hl, Page7C_2C79 call pushErrorHandleR call p7Csub_418C call popErrorHandleR - jp Page7C_3A0B + jp InitLinkIOContext ; --------------------------------------------------------------------------- p7Cloc_4BEF: @@ -4222,7 +4222,7 @@ DeselectAllVars: - ; p7Csub_4B62:Page7C_3A0Bp ... + ; p7Csub_4B62:InitLinkIOContextp ... call p7Csub_5A39 xor a @@ -4338,7 +4338,7 @@ ; --------------------------------------------------------------------------- ; START OF FUNCTION CHUNK FOR p7Csub_4B62 -Page7C_3A0B: +InitLinkIOContext: call DeselectAllVars p7Cloc_5AD0: @@ -4547,7 +4547,7 @@ jp nz, resetRam p7Cloc_5C36: - jp Page7C_3A0B + jp InitLinkIOContext ; --------------------------------------------------------------------------- p7Cloc_5C39: @@ -4608,7 +4608,7 @@ ; --------------------------------------------------------------------------- p7Cloc_5C84: - jp Page7C_3A0B + jp InitLinkIOContext ; --------------------------------------------------------------------------- p7Cloc_5C87: @@ -5150,18 +5150,16 @@ p7Csub_6023: - ; ReceiveVar+690p ... ld a, 1 ld (sndRecState), a ret -; End of function p7Csub_6023 linkContext: .dw Page7C_2CF1 .dw linkcxPPutAway .dw linkcxPPutAway .dw linkcxPPUtAway - .dw Page7C_3A0B + .dw InitLinkIOContext .dw linkcxSizeWind .db 12h @@ -7563,7 +7561,8 @@ ; --------------------------------------------------------------------------- -Page7C_3E31: +.module IsAHLAtValidAppHeader +IsAHLAtValidAppHeader: push hl push de push bc @@ -7579,56 +7578,39 @@ ld l, a or a sbc hl, de - jr nz, p7Cloc_6D4A - -p7Cloc_6D45: - pop af + jr nz, {+} +-: pop af ld b, a xor a - jr p7Cloc_6D5A -; --------------------------------------------------------------------------- - -p7Cloc_6D4A: - pop af + jr _ret ++: pop af push af ld h, 0 ld l, 0Fh or a sbc hl, de - jr z, p7Cloc_6D45 + jr z, {-} pop af ld b, a ld a, 1 or a - -p7Cloc_6D5A: - ld a, b +_ret: ld a, b pop bc pop de pop hl ret - -; =============== S U B R O U T I N E ======================================= - +.endmodule p7Csub_6D5F: - ; Page7C_2C91+1Bp call NZIf83Plus jr nz, p7Cloc_6D69 and 7Fh ; '' cp 6Ah ; 'j' ret -; --------------------------------------------------------------------------- - p7Cloc_6D69: and 1Fh cp 16h ret -; End of function p7Csub_6D5F - - -; =============== S U B R O U T I N E ======================================= - p7Csub_6D6E: ld a, 16h @@ -7777,21 +7759,17 @@ ; --------------------------------------------------------------------------- -Page7C_3EAF: +ResetIOPorts: ld a, 0 out (0), a - ld a, 97h ; '�' + ld a, 97h out (9), a - ld a, 0B4h ; '�' + ld a, 0B4h out (0Ah), a out (0Bh), a out (0Ch), a - -; =============== S U B R O U T I N E ======================================= - - p7Csub_6E1A: - ld a, 80h ; '�' + ld a, 80h out (8), a xor a out (8), a @@ -7799,11 +7777,6 @@ set silentLinkActive, (iy+silentLinkFlags) xor a ret -; End of function p7Csub_6E1A - - -; =============== S U B R O U T I N E ======================================= - p7Csub_6E29: ld hl, 8685h @@ -8198,9 +8171,9 @@ p7Csub_6FEA: - call page0_1664 + call command_buf_to_OP1 call p7Csub_7022 - call page0_165F + call last_entry_to_OP1 call p7Csub_7022 ld hl, symTable ld b, 0 @@ -8720,7 +8693,7 @@ p7Csub_72B2: ; p7Csub_725D+16p - call Page0Call_2B53 + call j_GetFirstInvalidAppPageToB call p7Csub_7ED9 p7Cloc_72B8: @@ -8803,7 +8776,7 @@ call p7Csub_7E85 p7Cloc_732B: - call Page0Call_2B53 + call j_GetFirstInvalidAppPageToB ld a, b inc a call p7Csub_7E97 @@ -9152,7 +9125,7 @@ ld a, (unk_8435) add a, 3 push af - call Page0Call_2B53 + call j_GetFirstInvalidAppPageToB pop af sub b jr c, p7Cloc_74E8 @@ -9819,7 +9792,7 @@ p7Csub_7782: - call Page0Call_2B53 + call j_GetFirstInvalidAppPageToB ld a, b rst 28h ; --------------------------------------------------------------------------- @@ -9836,7 +9809,7 @@ p7Csub_778D: - call Page0Call_2B53 + call j_GetFirstInvalidAppPageToB ld a, b ld (unk_8435), a call p7Csub_74C1 @@ -9923,7 +9896,7 @@ res 7, (iy+24h) ld b, 0FBh ; '�' call p7Csub_7E85 - call Page0Call_2B53 + call j_GetFirstInvalidAppPageToB ld a, b inc a call p7Csub_7E97 @@ -10945,7 +10918,7 @@ p7Csub_7C20: - call Page0Call_2B53 + call j_GetFirstInvalidAppPageToB ld a, b rst 28h ; ---------------------------------------------------------------------------