Skip to content

Commit

Permalink
cleanup things and add installer icon
Browse files Browse the repository at this point in the history
  • Loading branch information
mateoconlechuga committed Sep 24, 2023
1 parent 0ceab82 commit 9b47151
Show file tree
Hide file tree
Showing 9 changed files with 64 additions and 40 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ RELEASE_ZIP := cesium.zip

all: english french dutch

icon:
convimg --icon icon.png --icon-output icon.asm --icon-format asm

english:
fasmg $(FLAGS_ENGLISH) $(SRC) $(BIN_ENGLISH)

Expand Down
3 changes: 2 additions & 1 deletion include/macros.inc
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,8 @@ edit_mode := edit_status + 1
return_info := edit_mode ; yes this is right
backup_prgm_name := edit_mode + 1
backup_home_hook_location := backup_prgm_name + 11
settings_data := backup_home_hook_location + 3
backup_app_change_hook_location := backup_home_hook_location + 3
settings_data := backup_app_change_hook_location + 3
setting_color_primary := settings_data
setting_color_secondary := setting_color_primary + 1
setting_color_tertiary := setting_color_secondary + 1
Expand Down
17 changes: 17 additions & 0 deletions src/data.asm
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,23 @@ data_lcd_init:
ld (ti.mpLcdCtrl),a ; operate in 8bpp
ret

cesium_cleanup:
ld a,$25
ld ($D02687),a
xor a,a
ld (ti.menuCurrent),a
ld (ti.appErr1),a
ld (ti.kbdGetKy),a
ld hl,ti.textShadow
ld de,ti.cmdShadow
ld bc,$104
ldir
ld hl,ti.pixelShadow
ld bc,8400 * 3
call ti.MemClear
call ti.ForceFullScreen
jp ti.ClrWindow

data_cesium_appvar:
db ti.AppVarObj
data_string_cesium_name:
Expand Down
3 changes: 3 additions & 0 deletions src/edit.asm
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ edit_basic_program:
ld (edit_status),a
call cesium.Arc_Unarc
.not_archived:
ld hl,(ti.appChangeHookPtr)
ld (backup_app_change_hook_location),hl
ld hl,hook_app_change
call ti.SetAppChangeHook
call util_setup_shortcuts
Expand All @@ -129,6 +131,7 @@ edit_basic_program:
call ti.CursorOff
call ti.RunIndicOff
call lcd_normal
call ti.DrawStatusBar
ld hl,string_temp ; contains OP1
push hl
ld de,ti.progToEdit
Expand Down
29 changes: 9 additions & 20 deletions src/execute.asm
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,9 @@ execute_usb_program:
execute_app:
bit setting_ram_backup,(iy + settings_flag)
call nz,flash_clear_backup
call lcd_normal
call ti.ClrAppChangeHook
call execute_prepare
call ti.EnableAPD
call ti.ClrHomescreenHook
call util_setup_shortcuts
res ti.useTokensInString,(iy + ti.clockFlags)
res ti.onInterrupt,(iy + ti.onFlags)
Expand Down Expand Up @@ -391,7 +392,6 @@ execute_quit:
ld (return_info),a
call ti.ReloadAppEntryVecs
call ti.ClrHomescreenHook
call ti.ClrAppChangeHook
call ti.ForceFullScreen
call hook_restore_parser
ld de,(ti.asm_prgm_size)
Expand Down Expand Up @@ -425,26 +425,15 @@ execute_hook:
ld (ti.cxCurApp),a
ret

execute_setup_vectors:
execute_prepare:
call lcd_normal
xor a,a
ld (ti.appErr1),a
ld (ti.kbdGetKy),a
ld hl,execute_hook
call ti.SetHomescreenHook
call ti.DrawStatusBar
jp cesium_cleanup

execute_setup_vectors:
call execute_prepare
ld hl,execute_vectors
call ti.AppInit
call ti.ForceFullScreen
call ti.ClrScrn
call ti.HomeUp
ld hl,ti.pixelShadow
ld bc,8400 * 3
call ti.MemClear
call ti.ClrTxtShd
ld hl,ti.textShadow
ld de,ti.cmdShadow
ld bc,$104
ldir
ld hl,execute_error
jp ti.PushErrorHandler

Expand Down
17 changes: 2 additions & 15 deletions src/exit.asm
Original file line number Diff line number Diff line change
Expand Up @@ -41,21 +41,11 @@ relocate exit_cleanup, ti.mpLcdCrsrImage + 500
call nz,flash_clear_backup
call lcd_normal
call hook_restore_parser
call ti.ClrAppChangeHook
call util_setup_shortcuts
call ti.ClrScrn
call ti.HomeUp
res ti.useTokensInString,(iy + ti.clockFlags)
res ti.onInterrupt,(iy + ti.onFlags)
set ti.graphDraw,(iy + ti.graphFlags)
ld hl,ti.pixelShadow
ld bc,8400 * 3
call ti.MemClear
call ti.ClrTxtShd
ld hl,ti.textShadow
ld de,ti.cmdShadow
ld bc,$104
ldir
call cesium_cleanup
bit 3,(iy + $25)
jr z,.no_defrag
ld a,ti.cxErase
Expand All @@ -66,8 +56,5 @@ relocate exit_cleanup, ti.mpLcdCrsrImage + 500
call ti.EnableAPD ; restore apd
im 1
ei
xor a,a
ld (ti.menuCurrent),a
ld a,ti.kClear
jp ti.JForceCmd ; exit the application for good
jp ti.JForceCmdNoChar ; exit the application for good
end relocate
8 changes: 7 additions & 1 deletion src/hooks.asm
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,16 @@ hook_app_change:
cp a,ti.cxTableSet
ret z
call .close_editor
ld a,return_prgm
ld a,return_edit
ld (return_info),a
jp cesium_start
.close_editor:
push af, bc, hl
ld hl,(backup_app_change_hook_location)
ld (ti.appChangeHookPtr),hl
or a,a
sbc hl,de
call z,ti.ClrAppChangeHook
call ti.CursorOff
call ti.CloseEditEqu
call ti.PopOP1
Expand All @@ -83,6 +88,7 @@ hook_app_change:
or a,a
call nz,cesium.Arc_Unarc
.noarc:
call cesium_cleanup
pop hl, bc, af
ret

Expand Down
22 changes: 20 additions & 2 deletions src/installer.asm
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,26 @@
; POSSIBILITY OF SUCH DAMAGE.

jp installer_start

db byte_description, 'Cesium Installer Version ', cesium_version, 0
; icon
db $01
db $10, $10
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $20, $20, $20, $20, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $20, $20, $20, $20, $20, $44, $6D, $6D, $44, $20, $20, $FF, $FF, $FF
db $FF, $20, $23, $44, $6D, $23, $23, $20, $23, $23, $6D, $44, $44, $20, $FF, $FF
db $FF, $20, $6D, $23, $23, $44, $6D, $44, $44, $23, $23, $6D, $44, $44, $20, $FF
db $20, $23, $23, $44, $44, $6D, $6D, $6D, $44, $44, $23, $23, $23, $20, $20, $FF
db $20, $20, $44, $44, $44, $6D, $CE, $6D, $6D, $23, $44, $44, $44, $6D, $20, $FF
db $20, $23, $44, $6D, $44, $6D, $6D, $8E, $6D, $44, $44, $6D, $6D, $23, $44, $20
db $20, $23, $CE, $6D, $6D, $44, $6D, $8E, $6D, $6D, $8E, $6D, $23, $6D, $6D, $20
db $20, $44, $6D, $8E, $6D, $44, $6D, $CE, $8E, $CE, $6D, $44, $6D, $CE, $6D, $20
db $20, $23, $44, $CE, $6D, $6D, $8E, $CE, $6D, $6D, $44, $6D, $8E, $6D, $44, $20
db $FF, $20, $23, $44, $CE, $6D, $8E, $F7, $6D, $44, $6D, $CE, $6D, $8E, $20, $FF
db $FF, $20, $A5, $23, $44, $F7, $8E, $F7, $6D, $44, $F7, $8E, $8E, $A5, $20, $FF
db $FF, $FF, $20, $A5, $CE, $F7, $CE, $F7, $CE, $CE, $F7, $CE, $A5, $20, $FF, $FF
db $FF, $FF, $FF, $20, $A5, $CE, $F7, $CE, $F7, $CE, $A5, $A5, $20, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $20, $A5, $A5, $A5, $A5, $A5, $20, $20, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $20, $20, $20, $20, $20, $FF, $FF, $FF, $FF, $FF, $FF
db 'Cesium Installer Version ', cesium_version, 0

installer_start:
call .clear_screen
Expand Down
2 changes: 1 addition & 1 deletion src/lcd.asm
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ lcd_normal:
call ti.MemSet
ld a,$2d
ld (ti.mpLcdCtrl),a
jp ti.DrawStatusBar
ret

lcd_clear:
ld hl,ti.vRam
Expand Down

0 comments on commit 9b47151

Please sign in to comment.