Skip to content

Commit 16020e9

Browse files
Remove things that caused more issues than they fixed
Co-Authored-By: RoccoLox Programs <roccoloxprograms2018@gmail.com>
1 parent 8559959 commit 16020e9

1 file changed

Lines changed: 26 additions & 52 deletions

File tree

src/asm/runProgram.asm

Lines changed: 26 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ returnIsAsm := backupPrgmName + 9
5353
returnEditLocked := returnIsAsm + 1
5454
returnCEaShell := returnEditLocked + 1
5555
lockStatus := ti.pixelShadow2 + 3
56-
quitOrOff := lockStatus + 1
5756

5857
sysHookFlg := 52
5958
appInpPrmptInit := 0
@@ -81,12 +80,10 @@ _runProgram:
8180
ld de, ti.OP1 + 1
8281
ld bc, 8
8382
ldir ; move name to OP1
84-
85-
_continueRun:
86-
ld a, $bb
87-
ld (quitOrOff), a
8883
ld hl,execute_hook
8984
call ti.SetHomescreenHook
85+
86+
_continueRun:
9087
call _isGetCSCHookInstalled
9188
cp a, 1
9289
call z, ti.ClrGetKeyHook
@@ -357,12 +354,12 @@ _basicProgram:
357354
jp ti.ParseInp
358355

359356
_return:
357+
call _reinstallGetCSCHook
360358
call ti.PopErrorHandler
361359
xor a, a
362360

363361
.error:
364362
push af
365-
call _reinstallGetCSCHook
366363
res ti.progExecuting, (iy + ti.newDispF)
367364
res ti.cmdExec, (iy + ti.cmdFlags)
368365
res ti.allowProgTokens, (iy + ti.newDispF)
@@ -392,9 +389,6 @@ _return:
392389
jp z, _reloadApp
393390

394391
.quitNoApp:
395-
ld a, (quitOrOff)
396-
cp a, $bb
397-
jp nz, ti.JForceCmdNoChar
398392
call _removeStopHook
399393
res ti.onInterrupt, (iy + ti.onFlags)
400394
call ti.ClrTxtShd
@@ -532,21 +526,13 @@ execute_vectors:
532526
ld (ti.currLastEntry),a
533527
bit appInpPrmptInit,(iy + ti.apiFlg2)
534528
jr nz,.aipi
535-
bit ti.monAbandon, (iy + ti.monFlags)
536-
jr nz, .reloadHooks
537529
call ti.ClrHomescreenHook
538530
call ti.ForceFullScreen
539531
.aipi:
540532
call ti.ReloadAppEntryVecs
541533
call ti.PutAway
542534
ld b,0
543535
ret
544-
.reloadHooks:
545-
call ti.DeleteTempPrograms
546-
call ti.CleanAll
547-
call _reinstallGetCSCHook
548-
call _reinstallHomescreenHook
549-
jr .aipi
550536

551537
_showError:
552538
xor a, a
@@ -719,18 +705,35 @@ execute_hook:
719705
db $83
720706
cp a,3
721707
ret nz
722-
call ti.ReleaseBuffer
723708
ld iy, ti.flags
709+
call ti.ReleaseBuffer
724710
call _reinstallGetCSCHook
725-
call _reinstallHomescreenHook
711+
call _removeStopHook
712+
call ti.ClrHomescreenHook
713+
ld hl, appVarName ; restore other homescreen hook if need be
714+
call ti.Mov9ToOP1
715+
call ti.ChkFindSym
716+
jr c, .continue
717+
call ti.ChkInRam
718+
jr z, .inRam
719+
ld hl, 10
720+
add hl, de
721+
ld a, c
722+
ld bc, 0
723+
ld c, a
724+
add hl, bc
725+
ex de, hl
726+
727+
.inRam:
728+
ld hl, 10
729+
add hl, de
730+
ld a, 1
731+
cp a, (hl)
732+
call z, _installHomescreenHook
726733

727734
.continue:
728-
bit ti.monAbandon, (iy + ti.monFlags)
729-
jr nz, .turningOff
730735
bit appInpPrmptDone,(iy + ti.apiFlg2)
731736
res appInpPrmptDone,(iy + ti.apiFlg2)
732-
ld a, 0
733-
ld (quitOrOff), a
734737
jp z, _return.quit
735738
call ti.ReloadAppEntryVecs
736739
ld hl,execute_vectors
@@ -740,11 +743,6 @@ execute_hook:
740743
ld (ti.cxCurApp),a
741744
ret
742745

743-
.turningOff:
744-
bit appInpPrmptDone,(iy + ti.apiFlg2)
745-
res appInpPrmptDone,(iy + ti.apiFlg2)
746-
jp z, _return.quit
747-
748746
_removeExecuteHookInstalled:
749747
ld iy, ti.flags
750748
bit ti.homescreenHookActive, (iy + ti.hookflags2) ; check if a menu hook is installed
@@ -780,30 +778,6 @@ _reinstallGetCSCHook:
780778
call _installGetCSCHookCont
781779
ret
782780

783-
_reinstallHomescreenHook:
784-
call ti.ClrHomescreenHook
785-
ld hl, appVarName ; restore other homescreen hook if need be
786-
call ti.Mov9ToOP1
787-
call ti.ChkFindSym
788-
ret c
789-
call ti.ChkInRam
790-
jr z, .inRam
791-
ld hl, 10
792-
add hl, de
793-
ld a, c
794-
ld bc, 0
795-
ld c, a
796-
add hl, bc
797-
ex de, hl
798-
799-
.inRam:
800-
ld hl, 10
801-
add hl, de
802-
ld a, 1
803-
cp a, (hl)
804-
call z, _installHomescreenHook
805-
ret
806-
807781
_lcdNormal:
808782
ld hl, ti.vRam
809783
ld bc, ((ti.lcdWidth * ti.lcdHeight) * 2) + 0

0 commit comments

Comments
 (0)