; See InstantGoto for the comments : we do the same thing beginHomescreenHook: .db 83h bit parserHookActive, (iy+hookflags4) jr nz,parserActive ; If another program has removed the parserHook... call _zeroop1 ld a,AppVarObj ; We want the address of the code (in PH AppVar) ld (OP1),a ld a,'P' ld (OP1+1),a ld a,'H' ld (OP1+2),a call _ChkFindSym ld de,endHSHook-beginHomescreenHook + endMenuHook-beginMenuHook + endGetkeyHook-beginGetkeyHook + 2 add hl,de call _setParserHook parserActive: bit editArchivedProgFlag, (iy+asm_Flag3) jr z,noProgramToArchive ArchiveEditedProgram: ; The following code archives an unarchived program which has been edited thanks to PHASM push bc push af call _pushrealo1 res editArchivedProgFlag, (IY+asm_Flag3) call _zeroop1 ld a,AppVarObj ; We want the address of the code (in PH AppVar) ld (OP1),a ld a,'P' ld (OP1+1),a ld a,'H' ld (OP1+2),a call _ChkFindSym jr c,endArchiveEditedProgram call _chkinram jr nz,endArchiveEditedProgram inc de inc de ex de,hl push hl call _Mov9ToOp1 call _ChkFindSym pop ix jr c,endArchiveEditedProgram push ix call _ARC_UNARC pop de ld h,d ld l,e ld (hl),0 inc de ld bc,8 ldir endArchiveEditedProgram: call _poprealo1 pop af pop bc cp $FF jr nz,noProgramToArchive jr notFirstEvent-2 bridgeJR: ; To have only relative jumps jr ArchiveEditedProgram noProgramToArchive: cp 2 jr nz,ErrorMissing call _zeroop1 ld a,AppVarObj ld (OP1),a ld a,'P' ld (OP1+1),a ld a,'H' ld (OP1+2),a call _ChkFindSym jr c,ErrorMissing call _chkinram jr nz,ErrorMissing ld hl,11 add hl,de ld de,$D052C6+4000 ld bc,AppvarSize ldir ld hl,$D052C6+4004 jp (hl) ErrorMissing: cp a ret EndHSHook: