Skip to content

Commit

Permalink
Remove things that caused more issues than they fixed
Browse files Browse the repository at this point in the history
Co-Authored-By: RoccoLox Programs <[email protected]>
  • Loading branch information
TIny-Hacker and RoccoLoxPrograms committed Dec 27, 2022
1 parent 8559959 commit 16020e9
Showing 1 changed file with 26 additions and 52 deletions.
78 changes: 26 additions & 52 deletions src/asm/runProgram.asm
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ returnIsAsm := backupPrgmName + 9
returnEditLocked := returnIsAsm + 1
returnCEaShell := returnEditLocked + 1
lockStatus := ti.pixelShadow2 + 3
quitOrOff := lockStatus + 1

sysHookFlg := 52
appInpPrmptInit := 0
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -532,21 +526,13 @@ 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:
call ti.ReloadAppEntryVecs
call ti.PutAway
ld b,0
ret
.reloadHooks:
call ti.DeleteTempPrograms
call ti.CleanAll
call _reinstallGetCSCHook
call _reinstallHomescreenHook
jr .aipi

_showError:
xor a, a
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 16020e9

Please sign in to comment.