Skip to content

Commit

Permalink
Fix memory leak and minor changes
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 21, 2022
1 parent 98ff8fb commit a977542
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 18 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ src/gfx/*.h
.DS_Store
convimg.out
nul.d
src/gfx/convimg.yaml.lst
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# 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)
[//]: <> (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!🤫)
# 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)

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!

Expand Down
Binary file removed icon.png
Binary file not shown.
3 changes: 1 addition & 2 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
NAME = CEaShell
APP_NAME = CEaShell
APP_VERSION = 5.0.0.0000
CEASHELL_VERSION = 0.82
ICON = icon.png
CEASHELL_VERSION = 0.82.5
DESCRIPTION = (C) 2022 RoccoLox + TIny_Hacker
COMPRESSED = NO
ARCHIVED = YES
Expand Down
24 changes: 13 additions & 11 deletions src/asm/runProgram.asm
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,6 @@ _asmProgram.run:
call ti.DisableAPD
set ti.appAutoScroll, (iy + ti.appFlags)
call execute_setup_vectors
;call _clearUsedMem
;call ti.DrawStatusBar
call ti.userMem
jp _return

Expand Down Expand Up @@ -312,7 +310,6 @@ _basicProgram:
set ti.progExecuting, (iy + ti.newDispF)
set ti.cmdExec, (iy + ti.cmdFlags)
set ti.allowProgTokens, (iy + ti.newDispF)
call _clearUsedMem
call execute_setup_vectors
call ti.EnableAPD
ei
Expand Down Expand Up @@ -365,6 +362,7 @@ _return:
call _showError

.quit:
call ti.ReloadAppEntryVecs
call ti.DeleteTempPrograms
call ti.CleanAll
ld de, (ti.asm_prgm_size)
Expand All @@ -373,9 +371,14 @@ _return:
ld (ti.asm_prgm_size), hl
ld hl, ti.userMem
call ti.DelMem
ld a, (returnCEaShell)
bit ti.monAbandon, (iy + ti.monFlags)
jr nz, .quitNoApp
ld a, (returnCEaShell)
cp a, 1
jp z, _reloadApp

.quitNoApp:
res ti.onInterrupt, (iy + ti.onFlags)
call ti.ClrTxtShd
ld a, ti.cxCmd
call ti.NewContext0
Expand Down Expand Up @@ -496,7 +499,7 @@ execute_setup_vectors:
execute_vectors:
dl .ret
dl ti.SaveShadow
dl .putway
dl .putaway
dl .restore
dl .ret
dl .ret
Expand All @@ -506,7 +509,7 @@ execute_vectors:
jp ti.RStrShadow
.ret:
ret
.putway:
.putaway:
xor a,a
ld (ti.currLastEntry),a
bit appInpPrmptInit,(iy + ti.apiFlg2)
Expand Down Expand Up @@ -687,11 +690,11 @@ _reloadApp:
jp (hl)

execute_hook:
add a,e
db $83
cp a,3
ret nz
call _reinstallGetCSCHook
ld iy, ti.flags
call _reinstallGetCSCHook
call ti.ClrHomescreenHook
ld hl, appVarName ; restore other homescreen hook if need be
call ti.Mov9ToOP1
Expand All @@ -712,13 +715,12 @@ execute_hook:
add hl, de
ld a, 1
cp a, (hl)
jr nz, .continue
call _installHomescreenHook
call z, _installHomescreenHook

.continue:
bit appInpPrmptDone,(iy + ti.apiFlg2)
res appInpPrmptDone,(iy + ti.apiFlg2)
jp z, _reloadApp
jp z, _return.quit
call ti.ReloadAppEntryVecs
ld hl,execute_vectors
call ti.AppInit
Expand Down
8 changes: 5 additions & 3 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
* By RoccoLox Programs and TIny_Hacker
* Copyright 2022
* License: GPL-3.0
* Last Build: December 19, 2022
* Version: 0.82
* Last Build: December 20, 2022
* Version: 0.82.5
*
* --------------------------------------
**/
Expand All @@ -15,10 +15,10 @@
#include "shapes.h"
#include "menu.h"
#include "utility.h"
#include "gfx/gfx.h"
#include "asm/misc.h"
#include "asm/sortVat.h"
#include "asm/fileOps.h"
#include "gfx/gfx.h"
#include "asm/hooks.h"
#include "asm/lowercase.h"
#include "asm/runProgram.h"
Expand Down Expand Up @@ -588,6 +588,7 @@ int main(void) {

gfx_End();
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
kb_DisableOnLatch();
editBasicProg(name, OS_TYPE_PRGM);
} else if (directory == APPVARS_FOLDER) {
if (!util_CheckNameExists(name, directory)) {
Expand All @@ -599,6 +600,7 @@ int main(void) {

gfx_End();
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
kb_DisableOnLatch();
editCelticAppvar(name);
}
} else if (!copyMenu) { // Copy
Expand Down
2 changes: 2 additions & 0 deletions src/utility.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ void util_PrintFreeRamRom(void) {

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

Expand Down Expand Up @@ -419,6 +420,7 @@ uint8_t util_GetSingleKeyPress(void) {

void util_RunApp(const unsigned int fileSelected, const bool displayCEaShell) {
while (kb_AnyKey());
kb_DisableOnLatch();

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

0 comments on commit a977542

Please sign in to comment.