diff --git a/src/asm/runProgram.asm b/src/asm/runProgram.asm index 40fef37..4675d11 100644 --- a/src/asm/runProgram.asm +++ b/src/asm/runProgram.asm @@ -53,7 +53,6 @@ returnIsAsm := backupPrgmName + 9 returnEditLocked := returnIsAsm + 1 returnCEaShell := returnEditLocked + 1 lockStatus := ti.pixelShadow2 + 3 -quitOrOff := lockStatus + 1 sysHookFlg := 52 appInpPrmptInit := 0 @@ -81,12 +80,10 @@ _runProgram: ld de, ti.OP1 + 1 ld bc, 8 ldir ; move name to OP1 - -_continueRun: - ld a, $bb - ld (quitOrOff), a ld hl,execute_hook call ti.SetHomescreenHook + +_continueRun: call _isGetCSCHookInstalled cp a, 1 call z, ti.ClrGetKeyHook @@ -357,12 +354,12 @@ _basicProgram: jp ti.ParseInp _return: + call _reinstallGetCSCHook call ti.PopErrorHandler xor a, a .error: push af - call _reinstallGetCSCHook res ti.progExecuting, (iy + ti.newDispF) res ti.cmdExec, (iy + ti.cmdFlags) res ti.allowProgTokens, (iy + ti.newDispF) @@ -392,9 +389,6 @@ _return: jp z, _reloadApp .quitNoApp: - ld a, (quitOrOff) - cp a, $bb - jp nz, ti.JForceCmdNoChar call _removeStopHook res ti.onInterrupt, (iy + ti.onFlags) call ti.ClrTxtShd @@ -532,8 +526,6 @@ execute_vectors: ld (ti.currLastEntry),a bit appInpPrmptInit,(iy + ti.apiFlg2) jr nz,.aipi - bit ti.monAbandon, (iy + ti.monFlags) - jr nz, .reloadHooks call ti.ClrHomescreenHook call ti.ForceFullScreen .aipi: @@ -541,12 +533,6 @@ execute_vectors: call ti.PutAway ld b,0 ret -.reloadHooks: - call ti.DeleteTempPrograms - call ti.CleanAll - call _reinstallGetCSCHook - call _reinstallHomescreenHook - jr .aipi _showError: xor a, a @@ -719,18 +705,35 @@ execute_hook: db $83 cp a,3 ret nz - call ti.ReleaseBuffer ld iy, ti.flags + call ti.ReleaseBuffer call _reinstallGetCSCHook - call _reinstallHomescreenHook + call _removeStopHook + call ti.ClrHomescreenHook + ld hl, appVarName ; restore other homescreen hook if need be + call ti.Mov9ToOP1 + call ti.ChkFindSym + jr c, .continue + call ti.ChkInRam + jr z, .inRam + ld hl, 10 + add hl, de + ld a, c + ld bc, 0 + ld c, a + add hl, bc + ex de, hl + +.inRam: + ld hl, 10 + add hl, de + ld a, 1 + cp a, (hl) + call z, _installHomescreenHook .continue: - bit ti.monAbandon, (iy + ti.monFlags) - jr nz, .turningOff bit appInpPrmptDone,(iy + ti.apiFlg2) res appInpPrmptDone,(iy + ti.apiFlg2) - ld a, 0 - ld (quitOrOff), a jp z, _return.quit call ti.ReloadAppEntryVecs ld hl,execute_vectors @@ -740,11 +743,6 @@ execute_hook: ld (ti.cxCurApp),a ret -.turningOff: - bit appInpPrmptDone,(iy + ti.apiFlg2) - res appInpPrmptDone,(iy + ti.apiFlg2) - jp z, _return.quit - _removeExecuteHookInstalled: ld iy, ti.flags bit ti.homescreenHookActive, (iy + ti.hookflags2) ; check if a menu hook is installed @@ -780,30 +778,6 @@ _reinstallGetCSCHook: call _installGetCSCHookCont ret -_reinstallHomescreenHook: - call ti.ClrHomescreenHook - ld hl, appVarName ; restore other homescreen hook if need be - call ti.Mov9ToOP1 - call ti.ChkFindSym - ret c - call ti.ChkInRam - jr z, .inRam - ld hl, 10 - add hl, de - ld a, c - ld bc, 0 - ld c, a - add hl, bc - ex de, hl - -.inRam: - ld hl, 10 - add hl, de - ld a, 1 - cp a, (hl) - call z, _installHomescreenHook - ret - _lcdNormal: ld hl, ti.vRam ld bc, ((ti.lcdWidth * ti.lcdHeight) * 2) + 0