Skip to content

Commit a977542

Browse files
Fix memory leak and minor changes
Co-Authored-By: RoccoLox Programs <roccoloxprograms2018@gmail.com>
1 parent 98ff8fb commit a977542

File tree

7 files changed

+23
-18
lines changed

7 files changed

+23
-18
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ src/gfx/*.h
77
.DS_Store
88
convimg.out
99
nul.d
10+
src/gfx/convimg.yaml.lst

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
# CEaShell [![Discord Chat Link](https://img.shields.io/discord/1012426214226530424?logo=discord)](https://discord.gg/RDTtu258fW) [![Current Beta](https://img.shields.io/badge/beta-v0.75.1-blue)](https://cdn.discordapp.com/attachments/1014235873161781328/1035331209955397642/CEaShell.zip)
2-
[//]: <> (Yes I know the beta is only on discord maybe we'll put it on GitHub eventually. Congrats if you can see this, it's supposed to be a secret!🤫)
1+
# CEaShell [![Discord Chat Link](https://img.shields.io/discord/1012426214226530424?logo=discord)](https://discord.gg/RDTtu258fW) [![Current Beta](https://img.shields.io/badge/beta-v0.82.5-blue)](https://github.com/roccoloxprograms/shell/releases/latest)
32

43
CEaShell (pronounced like "Seashell") is a new shell for the TI-84 Plus CE. It aims to provide a modern, sleek, and easy to use UI, which is understandable by any user regardless of previous experience or calculator-related knowledge. To get help, suggest a feature, or report a bug, join the discord!
54

icon.png

-255 Bytes
Binary file not shown.

makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010
NAME = CEaShell
1111
APP_NAME = CEaShell
1212
APP_VERSION = 5.0.0.0000
13-
CEASHELL_VERSION = 0.82
14-
ICON = icon.png
13+
CEASHELL_VERSION = 0.82.5
1514
DESCRIPTION = (C) 2022 RoccoLox + TIny_Hacker
1615
COMPRESSED = NO
1716
ARCHIVED = YES

src/asm/runProgram.asm

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,6 @@ _asmProgram.run:
146146
call ti.DisableAPD
147147
set ti.appAutoScroll, (iy + ti.appFlags)
148148
call execute_setup_vectors
149-
;call _clearUsedMem
150-
;call ti.DrawStatusBar
151149
call ti.userMem
152150
jp _return
153151

@@ -312,7 +310,6 @@ _basicProgram:
312310
set ti.progExecuting, (iy + ti.newDispF)
313311
set ti.cmdExec, (iy + ti.cmdFlags)
314312
set ti.allowProgTokens, (iy + ti.newDispF)
315-
call _clearUsedMem
316313
call execute_setup_vectors
317314
call ti.EnableAPD
318315
ei
@@ -365,6 +362,7 @@ _return:
365362
call _showError
366363

367364
.quit:
365+
call ti.ReloadAppEntryVecs
368366
call ti.DeleteTempPrograms
369367
call ti.CleanAll
370368
ld de, (ti.asm_prgm_size)
@@ -373,9 +371,14 @@ _return:
373371
ld (ti.asm_prgm_size), hl
374372
ld hl, ti.userMem
375373
call ti.DelMem
376-
ld a, (returnCEaShell)
374+
bit ti.monAbandon, (iy + ti.monFlags)
375+
jr nz, .quitNoApp
376+
ld a, (returnCEaShell)
377377
cp a, 1
378378
jp z, _reloadApp
379+
380+
.quitNoApp:
381+
res ti.onInterrupt, (iy + ti.onFlags)
379382
call ti.ClrTxtShd
380383
ld a, ti.cxCmd
381384
call ti.NewContext0
@@ -496,7 +499,7 @@ execute_setup_vectors:
496499
execute_vectors:
497500
dl .ret
498501
dl ti.SaveShadow
499-
dl .putway
502+
dl .putaway
500503
dl .restore
501504
dl .ret
502505
dl .ret
@@ -506,7 +509,7 @@ execute_vectors:
506509
jp ti.RStrShadow
507510
.ret:
508511
ret
509-
.putway:
512+
.putaway:
510513
xor a,a
511514
ld (ti.currLastEntry),a
512515
bit appInpPrmptInit,(iy + ti.apiFlg2)
@@ -687,11 +690,11 @@ _reloadApp:
687690
jp (hl)
688691

689692
execute_hook:
690-
add a,e
693+
db $83
691694
cp a,3
692695
ret nz
693-
call _reinstallGetCSCHook
694696
ld iy, ti.flags
697+
call _reinstallGetCSCHook
695698
call ti.ClrHomescreenHook
696699
ld hl, appVarName ; restore other homescreen hook if need be
697700
call ti.Mov9ToOP1
@@ -712,13 +715,12 @@ execute_hook:
712715
add hl, de
713716
ld a, 1
714717
cp a, (hl)
715-
jr nz, .continue
716-
call _installHomescreenHook
718+
call z, _installHomescreenHook
717719

718720
.continue:
719721
bit appInpPrmptDone,(iy + ti.apiFlg2)
720722
res appInpPrmptDone,(iy + ti.apiFlg2)
721-
jp z, _reloadApp
723+
jp z, _return.quit
722724
call ti.ReloadAppEntryVecs
723725
ld hl,execute_vectors
724726
call ti.AppInit

src/main.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
* By RoccoLox Programs and TIny_Hacker
66
* Copyright 2022
77
* License: GPL-3.0
8-
* Last Build: December 19, 2022
9-
* Version: 0.82
8+
* Last Build: December 20, 2022
9+
* Version: 0.82.5
1010
*
1111
* --------------------------------------
1212
**/
@@ -15,10 +15,10 @@
1515
#include "shapes.h"
1616
#include "menu.h"
1717
#include "utility.h"
18+
#include "gfx/gfx.h"
1819
#include "asm/misc.h"
1920
#include "asm/sortVat.h"
2021
#include "asm/fileOps.h"
21-
#include "gfx/gfx.h"
2222
#include "asm/hooks.h"
2323
#include "asm/lowercase.h"
2424
#include "asm/runProgram.h"
@@ -588,6 +588,7 @@ int main(void) {
588588

589589
gfx_End();
590590
util_WritePrefs(colors, transitionSpeed, is24Hour, displayCEaShell, getCSCHook, editArchivedProg, editLockedProg, showHiddenProg, showFileCount, hideBusyIndicator, lowercase, apdTimer, fileSelected, fileStartLoc, directory, showApps, showAppvars, &programPtrs, &appvarPtrs, fileNumbers, true); // Stores our data to the appvar before exiting
591+
kb_DisableOnLatch();
591592
editBasicProg(name, OS_TYPE_PRGM);
592593
} else if (directory == APPVARS_FOLDER) {
593594
if (!util_CheckNameExists(name, directory)) {
@@ -599,6 +600,7 @@ int main(void) {
599600

600601
gfx_End();
601602
util_WritePrefs(colors, transitionSpeed, is24Hour, displayCEaShell, getCSCHook, editArchivedProg, editLockedProg, showHiddenProg, showFileCount, hideBusyIndicator, lowercase, apdTimer, fileSelected, fileStartLoc, directory, showApps, showAppvars, &programPtrs, &appvarPtrs, fileNumbers, true); // Stores our data to the appvar before exiting
603+
kb_DisableOnLatch();
602604
editCelticAppvar(name);
603605
}
604606
} else if (!copyMenu) { // Copy

src/utility.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ void util_PrintFreeRamRom(void) {
215215

216216
void util_RunPrgm(unsigned int fileSelected, unsigned int fileStartLoc, void **programPtrs, const bool editLockedProg, const bool showApps, const bool showAppvars) {
217217
gfx_End();
218+
kb_DisableOnLatch();
218219
uint8_t fileType; // Different from C, ICE, ASM, etc. This is stuff like OS_TYPE_APPVAR and OS_TYPE_PRGM
219220
unsigned int filesSearched = showApps + showAppvars; // Account for folders
220221

@@ -419,6 +420,7 @@ uint8_t util_GetSingleKeyPress(void) {
419420

420421
void util_RunApp(const unsigned int fileSelected, const bool displayCEaShell) {
421422
while (kb_AnyKey());
423+
kb_DisableOnLatch();
422424

423425
unsigned int filesSearched = 1; // account for folders
424426
char appName[9] = "\0";

0 commit comments

Comments
 (0)