diff --git a/CHANGELOG.md b/CHANGELOG.md index 7de5fed..d18bdc8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,10 +2,11 @@ All notable changes to CEaShell will be documented in this file. -## [2.0.1] - 2024-09-08 +## [2.0.1] - 2024-09-11 ### Added - Pressing vars in the file info menu opens the editor. +- Show file type in program menu hook for programs without descriptions. ### Changed - Modify behavior for moving the cursor down in the file info menu. diff --git a/src/asm/hooks.asm b/src/asm/hooks.asm index 10001cb..9b5f2a2 100644 --- a/src/asm/hooks.asm +++ b/src/asm/hooks.asm @@ -36,6 +36,7 @@ include 'include/equates.inc' extern _asm_fileSystem_sortVAT extern _asm_labelJumper_showLabels extern _asm_prgmMenuHook_showDescription + extern _asm_prgmMenuHook_showType extern _asm_prgmMenuHook_icons extern _asm_prgmMenuHook_showAppInfo extern _asm_runProgram_main @@ -212,6 +213,9 @@ hooks_iconHook: jp z, _asm_prgmMenuHook_showAppInfo call _asm_prgmMenuHook_icons call _asm_prgmMenuHook_showDescription + ld a, (description) + or a, a + call z, _asm_prgmMenuHook_showType set updateProgInfo, (iy + shellFlags) ret diff --git a/src/asm/prgmMenuHook.asm b/src/asm/prgmMenuHook.asm index 819dd5f..38a2b3b 100644 --- a/src/asm/prgmMenuHook.asm +++ b/src/asm/prgmMenuHook.asm @@ -14,6 +14,7 @@ include 'include/equates.inc' public _asm_prgmMenuHook_showDescription + public _asm_prgmMenuHook_showType public _asm_prgmMenuHook_icons public _asm_prgmMenuHook_showAppInfo @@ -28,8 +29,11 @@ include 'include/equates.inc' extern _asm_utils_getEOF extern _asm_utils_findVar extern _asm_utils_dispTextToolbar + extern _rodata_fileTypes _asm_prgmMenuHook_showDescription: + xor a, a + ld (description), a ld hl, ti.progCurrent call ti.Mov9ToOP1 call prgmMenuHook_eraseRect @@ -191,6 +195,18 @@ _asm_prgmMenuHook_showDescription: ld hl, description jp _asm_utils_dispTextToolbar +_asm_prgmMenuHook_showType: + ld hl, ti.progCurrent + call ti.Mov9ToOP1 + call _asm_utils_findVar + 4 + call _asm_fileOps_getPrgmType.check + ld e, a + ld d, 11 + mlt de + ld hl, _rodata_fileTypes + add hl, de + jp _asm_utils_dispTextToolbar + _asm_prgmMenuHook_icons: ld hl, .finishDrawing push hl diff --git a/src/asm/rodata.asm b/src/asm/rodata.asm index 9189a02..b9c2c4f 100644 --- a/src/asm/rodata.asm +++ b/src/asm/rodata.asm @@ -30,6 +30,12 @@ include 'include/equates.inc' public _rodata_characters public _rodata_sizeOfCharsLUT public _rodata_numberKeysLUT + public _rodata_fileTypes + public _rodata_fileTypeASM + public _rodata_fileTypeBASIC + public _rodata_fileTypeC + public _rodata_fileTypeICE + public _rodata_fileTypeICESrc _rodata_celticAppVarHeader: db ti.tColon, ti.tC, ti.tE, ti.tL, ti.tEnter @@ -117,3 +123,19 @@ _rodata_sizeOfCharsLUT := $ - _rodata_characters _rodata_numberKeysLUT: db ti.sk0, ti.sk1, ti.sk2, ti.sk3, ti.sk4, ti.sk5, ti.sk6, ti.sk7, ti.sk8, ti.sk9 + +_rodata_fileTypes: +_rodata_fileTypeASM: + db "ASM", 8 dup 0 + +_rodata_fileTypeC: + db "C", 10 dup 0 + +_rodata_fileTypeBASIC: + db "TI-BASIC", 0, 0, 0 + +_rodata_fileTypeICE: + db "ICE", 8 dup 0 + +_rodata_fileTypeICESrc: + db "ICE Source", 0 diff --git a/src/defines.h b/src/defines.h index e699bcf..ae9e752 100644 --- a/src/defines.h +++ b/src/defines.h @@ -242,6 +242,15 @@ extern gfx_sprite_t *tempSprite; */ extern char rodata_appName; +/** + * File type strings. + */ +extern char rodata_fileTypeASM; /** ASM file type string. */ +extern char rodata_fileTypeBASIC; /** TI-BASIC file type string. */ +extern char rodata_fileTypeC; /** C file type string. */ +extern char rodata_fileTypeICE; /** ICE file type string. */ +extern char rodata_fileTypeICESrc; /** ICE Source file type string. */ + #ifdef __cplusplus } #endif diff --git a/src/info.c b/src/info.c index bd4db84..a004202 100644 --- a/src/info.c +++ b/src/info.c @@ -64,10 +64,10 @@ static void info_Redraw(struct preferences_t *shellPrefs, struct file_t *fileInf #ifdef FR - static const char *fileTypeStrings[11] = {"ASM", "C", "TI-BASIC", "ICE", "ICE Source", "Annuaire", "AppVar", NULL, "Var Celtic", "Appli", "Inconnu"}; + static const char *fileTypeStrings[11] = {&rodata_fileTypeASM, &rodata_fileTypeC, &rodata_fileTypeBASIC, &rodata_fileTypeICE, &rodata_fileTypeICESrc, "Annuaire", "AppVar", NULL, "Var Celtic", "Appli", "Inconnu"}; gfx_PrintStringXY("Type : ", 64, 74); #else - static const char *fileTypeStrings[11] = {"ASM", "C", "TI-BASIC", "ICE", "ICE Source", "Directory", "AppVar", NULL, "Celtic Var", "App", "Unknown"}; + static const char *fileTypeStrings[11] = {&rodata_fileTypeASM, &rodata_fileTypeC, &rodata_fileTypeBASIC, &rodata_fileTypeICE, &rodata_fileTypeICESrc, "Directory", "AppVar", NULL, "Celtic Var", "App", "Unknown"}; gfx_PrintStringXY("Type: ", 64, 74); #endif diff --git a/src/main.c b/src/main.c index b4332aa..701d5dd 100644 --- a/src/main.c +++ b/src/main.c @@ -5,7 +5,7 @@ * By RoccoLox Programs and TIny_Hacker * Copyright 2022 - 2024 * License: GPL-3.0 - * Last Build: September 8, 2024 + * Last Build: September 11, 2024 * Version: 2.0.1 * * --------------------------------------