Skip to content

Commit

Permalink
fix #67, fix #68
Browse files Browse the repository at this point in the history
  • Loading branch information
mateoconlechuga committed Aug 23, 2018
1 parent ddf2239 commit ddc456a
Show file tree
Hide file tree
Showing 9 changed files with 44 additions and 11 deletions.
4 changes: 3 additions & 1 deletion include/macros.inc
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ scroll_down_available := 1
scroll_up_available := 2
item_renaming := 3
item_is_directory := 4
item_set_editor := 5

prgm_flag := $30
prgm_archived := 0
Expand Down Expand Up @@ -285,7 +286,8 @@ setting_color_quinary := setting_color_quaternary + 1
setting_color_senary := setting_color_quinary + 1
setting_config := setting_color_senary + 1
setting_brightness := setting_config + 1
setting_password := setting_brightness + 1
setting_editor_name := setting_brightness + 1
setting_password := setting_editor_name + 10
current_option_selection := setting_password + password_max_length + 1
current_selection_absolute := current_option_selection + 1
current_selection := current_selection_absolute + 3
Expand Down
2 changes: 1 addition & 1 deletion src/cesium.asm
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
; (c) 2015-2018 Matt "Mateoconlechuga" Waltz

cesium_name := 'Cesium'
cesium_version := '3.0.2'
cesium_version := '3.0.3'
cesium_copyright := '(C) 2015-2018 Matt Waltz'

include 'include/macros.inc'
Expand Down
1 change: 1 addition & 0 deletions src/data.asm
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ data_string_quit2:

; data in this location is allowed to be modified at runtime
app_data

7 changes: 2 additions & 5 deletions src/edit.asm
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ edit_basic_program:
call util_backup_prgm_name
call util_op1_to_temp
call _PushOP1
ld hl,edit_prgm_name
ld hl,setting_editor_name
call _Mov9ToOP1
call _ChkFindSym
push af
Expand Down Expand Up @@ -79,7 +79,7 @@ edit_basic_program:
inc de
ld hl,string_temp
ldir ; copied name to ans
ld hl,edit_prgm_name
ld hl,setting_editor_name
call _Mov9ToOP1
res prgm_is_basic,(iy + prgm_flag) ; not a basic program
jp execute_program.entry ; launch the editor
Expand Down Expand Up @@ -187,6 +187,3 @@ compute_error_offset:
ld (error_offset),hl
ret

edit_prgm_name:
db protProgObj,"KEDIT",0
.length :=$-edit_prgm_name
2 changes: 1 addition & 1 deletion src/execute.asm
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ execute_program:
bit setting_enable_shortcuts,(iy + settings_flag)
call nz,_ClrGetKeyHook
bit prgm_is_basic,(iy + prgm_flag)
jp nz,execute_basic_program ; execute basic program
jr nz,execute_basic_program ; execute basic program
call util_move_prgm_to_usermem ; execute assembly program
call util_install_error_handler
execute_assembly_program:
Expand Down
18 changes: 18 additions & 0 deletions src/features.asm
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
; features offered by cesium

feater_setup_editor:
res item_renaming,(iy + item_flag)
set item_set_editor,(iy + item_flag)
jr feature_item_rename.setup_name
feature_item_new:
ld a,(current_screen)
cp a,screen_programs
jp nz,main_loop
bit cesium_is_nl_disabled,(iy + cesium_flag)
jp nz,main_loop
res item_set_editor,(iy + item_flag)
res item_renaming,(iy + item_flag)
jr feature_item_rename.setup_name
feature_item_rename:
res item_set_editor,(iy + item_flag)
set item_renaming,(iy + item_flag)
ld a,(prgm_type)
cp a,file_dir
Expand Down Expand Up @@ -115,6 +121,9 @@ current_input_mode := $-1
.clear:
ld a,(color_senary)
draw_rectangle_color 199, 173, 313, 215
ld hl,string_editor_name
bit item_set_editor,(iy + item_flag)
jr nz,.rename
bit item_renaming,(iy + item_flag)
ld hl,string_rename
jr nz,.rename
Expand Down Expand Up @@ -151,6 +160,8 @@ current_input_mode := $-1
ld (hl),0
bit item_renaming,(iy + item_flag)
jr nz,.renaming
bit item_set_editor,(iy + item_flag)
jq nz,.setting_editor_name
ld hl,name_buffer
ld (hl),progObj ; already in op1
call _Mov9ToOP1
Expand Down Expand Up @@ -235,6 +246,13 @@ current_input_mode := $-1
ld hl,name_buffer + 1
call search_name
jp main_start
.setting_editor_name:
ld hl,name_buffer
ld (hl),protProgObj
ld de,setting_editor_name
call _Mov9b
call settings_save
jp main_start

feature_item_edit:
call feature_check_valid
Expand Down
2 changes: 2 additions & 0 deletions src/main.asm
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ main_loop:
jp z,feature_item_edit
cp a,skDel
jp z,feature_item_delete
cp a,skTrace
jp z,feater_setup_editor
sub a,skAdd
jp c,main_loop
cp a,skMath - skAdd + 1
Expand Down
15 changes: 12 additions & 3 deletions src/settings.asm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ settings_load:
push af
call z,_Arc_Unarc ; archive it
pop af
jr z,settings_load ; find it again
jq z,settings_load ; find it again
settings_get_data:
ex de,hl
ld de,9
Expand Down Expand Up @@ -43,7 +43,11 @@ settings_create_default:
ld (hl),setting_config_default
ld hl,setting_password
ld (hl),0 ; zero length
ld hl,settings_appvar_size + 5 ; random size increment for safety
ld hl,settings_editor_default_prgm_name
ld de,setting_editor_name
ld bc,settings_editor_default_prgm_name.length
ldir
ld hl,settings_appvar_size + 2 ; increment for safety
push hl
call _EnoughMem
pop hl
Expand All @@ -54,7 +58,7 @@ settings_create_default:
ld hl,settings_data
ld bc,settings_size
ldir
jr settings_load
jq settings_load

settings_save:
ld hl,settings_appvar
Expand Down Expand Up @@ -342,3 +346,8 @@ setting_draw_options:

settings_appvar:
db appvarObj, cesium_name, 0

settings_editor_default_prgm_name:
db protProgObj,"KEDIT",0
.length :=$-settings_editor_default_prgm_name

4 changes: 4 additions & 0 deletions src/strings.asm
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ string_edit_prgm:
string_new_prgm:
db 'New Prgm',0
db $7e,'Y=]'
string_editor_name:
db 'Prgm Editor',0
string_delete_confirmation:
db 'Delete?: ',$7e,'ZOOM]-Yes ',$7e,'GRAPH]-No',0
string_general_settings:
Expand Down Expand Up @@ -157,6 +159,8 @@ string_edit_prgm:
string_new_prgm:
db 'Nouveau',0
db $7e,'Y=]',0
string_editor_name:
db 'Editeur de prgm',0
string_delete_confirmation:
db 'Supprimer ? ',$7e,'ZOOM]-Oui ',$7e,'GRAPH]-Non',0
string_general_settings:
Expand Down

0 comments on commit ddc456a

Please sign in to comment.