From b2516bbed2e7290cf104059b6752e6ad8bdeca1c Mon Sep 17 00:00:00 2001 From: jede Date: Thu, 15 Feb 2024 22:54:18 +0100 Subject: [PATCH 01/14] basic10 manage -p option --- docs/basic11.md | 50 +++-- src/commands/basic11.asm | 183 ++++++++++++------ .../basic11/basic11_manage_option_cmdline.s | 30 +++ src/dependencies/orix-sdk | 2 +- src/shell.asm | 3 + 5 files changed, 189 insertions(+), 79 deletions(-) create mode 100644 src/commands/basic11/basic11_manage_option_cmdline.s diff --git a/docs/basic11.md b/docs/basic11.md index badf4af..d1d6adb 100644 --- a/docs/basic11.md +++ b/docs/basic11.md @@ -1,8 +1,38 @@ # basic11 -## Usage +## NAME -basic11 [-g] [-l] [-p defaultpath] +basic11 - start atmos rom + +## SYNOPSYS + +basic11 [OPTION]... ["FILE] + + + + +## DESCRIPTION + +This command starts the atmos rom. This rom did not test RAM and cload/csave are done on sdcard. It means that it calls file from sdcard. + +Cload works with .tap file. Multitap files works too. + +Get a tape file, and place it in the root folder of the sdcard. + +-g + Start interface + +-l + list available .tap + +-p path + Set Default path to find .tap file + +-r [id_rom] + Set type of rom to load (value = 0, 1, 2) + +"MYTAPE + Load MYTAPE ## Introduction @@ -150,21 +180,9 @@ not done. Some others games uses special keys (SHIFT, CTRL) for direction or the first button. Theses cases are not handle yet : but it could in the future. -## SYNOPSYS - -+ basic11 -+ basic11 -g -+ basic11 -l -+ basic11 -p path -+ basic11 "MYTAPE - -## DESCRIPTION -This command starts the atmos rom. This rom did not test RAM and cload/csave are done on sdcard. It means that it calls file from sdcard. -Cload works with .tap file. Multitap files works too. - -Get a tape file, and place it in the root folder of the sdcard. +## Example Starts basic11 : @@ -184,6 +202,8 @@ A path can be specified : /#basic11 -p /home/jede ``` + + In basic rom : CLOAD "ZORGONS => it will load zorgons.tap diff --git a/src/commands/basic11.asm b/src/commands/basic11.asm index ee467f3..02f5dd8 100644 --- a/src/commands/basic11.asm +++ b/src/commands/basic11.asm @@ -1,17 +1,35 @@ .export _basic11 -.define BASIC11_OFFSET_ROOT_PATH $FE70 -.define BASIC11_OFFSET_FOR_ID_OF_ROM_TO_LOAD $F2 -.define BASIC11_MAX_LENGTH_DEFAULT_PATH 16 ; MAX : 32 - -.define basic11_color_bar $11 -.define BASIC11_PATH_DB "/var/cache/basic11/" -.define BASIC10_PATH_DB "/var/cache/basic10/" -.define BASIC11_MAX_MAINDB_LENGTH 20000 +;; OPTIONS + + +.define BASIC11_OPTION_DEFAULT_PATH_IS_NOT_SET $00 +.define BASIC11_OPTION_DEFAULT_PATH_IS_SET $01 + +.define BASIC11_OPTION_ROM_ID_IS_NOT_SET $00 +.define BASIC11_OPTION_ROM_ID_IS_SET $01 + +.define BASIC11_START_GUI $01 +.define BASIC11_START_LIST $02 +.define BASIC11_DEFAULT_PATH_SET $03 +.define BASIC11_OPTION_UNKNOWN $FF + +.define BASIC11_NMI_VECTOR $F88F +.define BASIC11_OFFSET_ROOT_PATH $FE70 +.define BASIC11_OFFSET_LENGTH_ROOT_PATH BASIC11_OFFSET_ROOT_PATH-1 + +.define BASIC10_OFFSET_ROOT_PATH $FCED +.define BASIC11_OFFSET_FOR_ID_OF_ROM_TO_LOAD $F2 +.define BASIC11_MAX_LENGTH_DEFAULT_PATH 16 ; MAX : 32 + +.define basic11_color_bar $11 +.define BASIC11_PATH_DB "/var/cache/basic11/" +.define BASIC10_PATH_DB "/var/cache/basic10/" +.define BASIC11_MAX_MAINDB_LENGTH 23000 .define basic11_sizeof_max_length_of_conf_file_bin .strlen(BASIC11_PATH_DB)+1+1+8+1+2+1 ; used for the path but also for the cnf content .define basic11_sizeof_binary_conf_file 9 ; Rom + direction + fire1 + fire2 + fire3 -basic11_tmp := userzp ; One byte (used in gui) +basic11_tmp := userzp ; One byte (used in gui) basic11_ptr1 := userzp+1 ; Two bytes basic11_ptr2 := userzp+3 ; Two bytes @@ -32,7 +50,6 @@ basic11_skip_dec := userzp+8 basic11_fp := userzp+9 basic11_ptr3 := userzp+11 -basic11_mainargs_ptr := userzp+11 ; Avoid 13 because it's device store offset basic11_first_letter_gui := userzp+14 @@ -46,7 +63,10 @@ basic11_argv1_ptr := userzp+21 ; 16 bits basic11_mode := userzp+23 ; 8 bits store if we need to start atmos rom or oric-1 basic11_no_arg_provided := userzp+24 ; 8 bits store if we need to start atmos rom or oric-1 -basic11_default_path_set := userzp+26 ; Used when user type "basic11 -p path" +basic11_option_default_path_set := userzp+26 ; Used when user type "basic11 -p path" +basic11_current_arg_id := userzp+28 ; One byte +basic11_rootpath_ptr := userzp + 29 ; Used to save ptr of the path + .define BASIC10_ROM $01 .define BASIC11_ROM $02 @@ -65,11 +85,18 @@ basic11_default_path_set := userzp+26 ; Used when user type "basic11 -p p .proc _basic_main COPY_CODE_TO_BOOT_ATMOS_ROM_ADRESS := $200 + ; Set Default ROM + lda #$02 + sta BASIC11_OFFSET_FOR_ID_OF_ROM_TO_LOAD + lda #$01 + sta basic11_current_arg_id lda #$00 sta basic11_no_arg_provided - sta basic11_default_path_set + + lda #BASIC11_OPTION_DEFAULT_PATH_IS_NOT_SET + sta basic11_option_default_path_set initmainargs basic11_argv_ptr, basic11_argc, 0 ; Get args cpx #$01 @@ -102,9 +129,9 @@ basic11_default_path_set := userzp+26 ; Used when user type "basic11 -p p sta basic11_no_arg_provided ; Allocating memory to load conf file - lda #basic11_sizeof_max_length_of_conf_file_bin - ldy #$00 - BRK_KERNEL XMALLOC + ; FIXME macro + + malloc #basic11_sizeof_max_length_of_conf_file_bin cmp #$00 bne @no_oom5 cpy #$00 @@ -113,13 +140,10 @@ basic11_default_path_set := userzp+26 ; Used when user type "basic11 -p p crlf - ; FIXME macro - lda #basic11_sizeof_max_length_of_conf_file_bin - ldy #$00 - ldx #$20 ; - stx DEFAFF - ldx #$00 - BRK_KERNEL XDECIM + lda #basic11_sizeof_max_length_of_conf_file_bin + + print_int ,2, 2 ; an arg is skipped because the number is from register rts @no_oom5: @@ -134,7 +158,7 @@ basic11_default_path_set := userzp+26 ; Used when user type "basic11 -p p @L2: lda basic11_mode ; Is it atmos ? cmp #BASIC11_ROM - beq @copy_atmos_db_path ; Yes copy basic path in atmos path offset + beq @copy_atmos_db_path ; Yes copy basic path in atmos path offset lda basic10_conf_str,y ; Copy db path into ptr jmp @continue_copy_path_db @@ -214,7 +238,6 @@ basic11_default_path_set := userzp+26 ; Used when user type "basic11 -p p ; Let's copy BUFEDT jsr copy_bufedt - ldy #$00 lda (basic11_ptr2),y pha @@ -326,16 +349,18 @@ basic11_default_path_set := userzp+26 ; Used when user type "basic11 -p p rts @basic11_option_management: - ldy #$01 - lda (basic11_argv1_ptr),y - cmp #'g' + jsr basic11_manage_option_cmdline + cmp #BASIC11_START_GUI beq @gui - cmp #'p' - beq @root_path + cmp #BASIC11_START_LIST + beq @start_list - cmp #'l' + cmp #BASIC11_DEFAULT_PATH_SET + beq @root_path bne @option_not_known + +@start_list: mfree (basic11_argv_ptr) jsr basic11_read_main_dbfile @@ -347,15 +372,15 @@ basic11_default_path_set := userzp+26 ; Used when user type "basic11 -p p rts @root_path: - getmainarg #2, (basic11_argv_ptr) - sta basic11_argv1_ptr - sty basic11_argv1_ptr+1 + getmainarg basic11_current_arg_id, (basic11_argv_ptr) + sta basic11_rootpath_ptr + sty basic11_rootpath_ptr+1 ; Checking if the path is less than 32 chars (Atmos rom can't contains more than 32 chars) ldy #$00 @check_path: - lda (basic11_argv1_ptr),y + lda (basic11_rootpath_ptr),y beq @end_check iny cpy #BASIC11_MAX_LENGTH_DEFAULT_PATH @@ -366,23 +391,26 @@ basic11_default_path_set := userzp+26 ; Used when user type "basic11 -p p rts @end_check: - lda #$01 - sta basic11_default_path_set - lda #$02 - sta BASIC11_OFFSET_FOR_ID_OF_ROM_TO_LOAD + cpy #$00 + bne @path_not_empty + print str_basic11_missing_arg + crlf + rts + +@path_not_empty: + lda #BASIC11_OPTION_DEFAULT_PATH_IS_SET + sta basic11_option_default_path_set jmp @load_ROM_in_memory_and_start @continue_l_option: ; Search now print basic_str_search - jmp @displays_all @exit_search: print basic_str_last_line @exit: - mfree(basic11_ptr1) ; Open @@ -499,21 +527,17 @@ basic11_default_path_set := userzp+26 ; Used when user type "basic11 -p p ; # Code to load ROM into RAM bank ; ############################################################# @load_ROM_in_memory_and_start: - - malloc 16384,basic11_ptr1 ; Index ptr + malloc #16384, basic11_ptr1 ; Index ptr cmp #$00 bne @no_oom cpy #$00 bne @no_oom print str_enomem - ; FIXME macro - lda #<16384 - ldy #>16384 - ldx #$20 ; - stx DEFAFF - ldx #$00 - BRK_KERNEL XDECIM + lda #<16384 ; 12 + ldy #>16384 ; 0 because the number is 12 (from A) + print_int ,2, 2 ; an arg is skipped because the number is from register + crlf rts @@ -523,7 +547,7 @@ basic11_default_path_set := userzp+26 ; Used when user type "basic11 -p p beq @start_copy_path ; For rom oric-1 we force to rom 2 (why because i don't know :) => it's the only rom available :) lda #$02 - sta $F2 + sta BASIC11_OFFSET_FOR_ID_OF_ROM_TO_LOAD @start_copy_path: ; copy path of the root folder @@ -556,7 +580,7 @@ basic11_default_path_set := userzp+26 ; Used when user type "basic11 -p p iny sta (basic11_ptr1),y - ; Get value + ; Get if kernel default is sdcard or usb device ldx #XVARS_KERNEL_CH376_MOUNT BRK_KERNEL XVARS sta basic11_ptr2 @@ -566,6 +590,7 @@ basic11_default_path_set := userzp+26 ; Used when user type "basic11 -p p lda (basic11_ptr2),y ; cmp #CH376_SET_USB_MODE_CODE_SDCARD beq @sdcard + ; It's usb device, let's load basicusX.rom ldy basic11_tmp0 ; concat 'us' lda #'u' @@ -663,9 +688,6 @@ basic11_default_path_set := userzp+26 ; Used when user type "basic11 -p p BRK_KERNEL XFREAD fclose(basic11_fp) - - - ldy #$00 lda (basic11_ptr2),y sta STORE_CURRENT_DEVICE ; For atmos ROM : it pass the current device () @@ -723,9 +745,11 @@ basic11_default_path_set := userzp+26 ; Used when user type "basic11 -p p code_overlay_switch_sedoric: .byt $08,$48,$78,$a9,$00,$8d,$21,$03,$68,$28,$60 +;******************************************************* +;; This code to + basic11_driver: sei - ldx #$00 @L1000: @@ -750,12 +774,14 @@ basic11_driver: inx cpx #64 bne @loop_copy_rom + ; If the rom id is equal to 0, it means that it's for the hobbit. ; The hobbit rom does not handle path - - lda basic11_default_path_set + lda basic11_option_default_path_set beq @manage_others_cases + +; Clear BUFEDT when we don't need to insert any tape file ldy #$00 lda #$00 @@ -764,10 +790,11 @@ basic11_driver: iny bne @loop_copy_bufedt +; Copy default path into rom path (ram bank) ldy #$00 @copy_rootpath: - lda (basic11_argv1_ptr),y + lda (basic11_rootpath_ptr),y beq @end_start_with_default_path cmp #'a' ; 'a' bcc @do_not_uppercase_copy @@ -776,12 +803,25 @@ basic11_driver: sbc #$1F @do_not_uppercase_copy: + sta basic11_tmp + lda basic11_mode + cmp #BASIC11_ROM + beq @forge_path_for_atmos + lda basic11_tmp + sta BASIC10_OFFSET_ROOT_PATH,y + bne @skip_basic11_forge_path + +@forge_path_for_atmos: + lda basic11_tmp sta BASIC11_OFFSET_ROOT_PATH,y + +@skip_basic11_forge_path: iny bne @copy_rootpath @end_start_with_default_path: - sty $FE6F + ; Store the length of the string + sty BASIC11_OFFSET_LENGTH_ROOT_PATH beq @let_s_start_atmos @manage_others_cases: @@ -825,7 +865,7 @@ basic11_driver: @isatmosforpath: lda basic11_saveA ; Rootpath for Atmos - sta $FE70,x + sta BASIC11_OFFSET_ROOT_PATH,x @continue_path: iny @@ -837,6 +877,7 @@ basic11_driver: cmp #BASIC11_ROM beq @isatmos_fix_EOS_and_length + ; Set path for Oric-1 lda basic11_first_letter sta $FCED,x inx @@ -847,11 +888,11 @@ basic11_driver: @isatmos_fix_EOS_and_length: lda basic11_first_letter - sta $FE70,x ; We store the into default path, the first letter + sta BASIC11_OFFSET_ROOT_PATH,x ; We store the into default path, the first letter inx lda #'/' - sta $FE70,x - stx $FE6F ; Store length of the path + sta BASIC11_OFFSET_ROOT_PATH,x + stx BASIC11_OFFSET_ROOT_PATH-1 ; Store length of the path @let_s_start: @@ -869,6 +910,12 @@ basic11_driver: @jmp_basic10_vector: jmp $F42D +end_basic11_driver: + + +;; this end will be in main memory !!! +;******************************************************* + ; don't move it because it's used in the copy of basic11_driver tapes_path: @@ -877,6 +924,11 @@ tapes_path: tapes_path_basic10: .asciiz "/usr/share/basic10/" +.if end_basic11_driver-basic11_driver > 254 + .out .sprintf("Basic11: Size of copy routine = %d", (end_basic11_driver-basic11_driver)) + .error "Basic11: Size of copy routine us greater than 255. Basic11 will crash" +.endif + copy_bufedt: initmainargs basic11_ptr1, basic11_ptr4, 1 @@ -997,6 +1049,9 @@ str_error_path_too_long: str_basic11_missing_rom: .asciiz "Missing ROM file : " +str_basic11_missing_arg: + .asciiz "Missing arg " + rom_path: .asciiz "/usr/share/atmos/basic" @@ -1044,3 +1099,5 @@ basic_str_last_line: basic_rnd_init: .byte $80,$4F,$C7,$52,$FF,$FF .endproc + +.include "commands/basic11/basic11_manage_option_cmdline.s" diff --git a/src/commands/basic11/basic11_manage_option_cmdline.s b/src/commands/basic11/basic11_manage_option_cmdline.s new file mode 100644 index 0000000..e73880a --- /dev/null +++ b/src/commands/basic11/basic11_manage_option_cmdline.s @@ -0,0 +1,30 @@ +.proc basic11_manage_option_cmdline + + ldy basic11_current_arg_id + lda (basic11_argv1_ptr),y + + cmp #'g' + beq @gui + + cmp #'l' + beq @list + + cmp #'p' + beq @root_path + + lda #BASIC11_OPTION_UNKNOWN + rts + +@root_path: + inc basic11_current_arg_id + lda #BASIC11_DEFAULT_PATH_SET + rts + +@gui: + lda #BASIC11_START_GUI + rts + +@list: + lda #BASIC11_START_LIST + rts +.endproc diff --git a/src/dependencies/orix-sdk b/src/dependencies/orix-sdk index dafac00..a5640e2 160000 --- a/src/dependencies/orix-sdk +++ b/src/dependencies/orix-sdk @@ -1 +1 @@ -Subproject commit dafac0087c07b09a4711e86ebcc843ce5b951985 +Subproject commit a5640e25fa03be5aaf2e81546eefc61fadf24d62 diff --git a/src/shell.asm b/src/shell.asm index d4ae04a..0e59c98 100644 --- a/src/shell.asm +++ b/src/shell.asm @@ -16,12 +16,15 @@ .include "dependencies/kernel/src/include/memory.inc" .include "dependencies/kernel/src/include/files.inc" + ;---------------------------------------------------------------------- ; Orix SDK includes ;---------------------------------------------------------------------- .include "dependencies/orix-sdk/macros/SDK.mac" +.include "dependencies/orix-sdk/macros/SDK_print.mac" .include "dependencies/orix-sdk/include/SDK.inc" + ;---------------------------------------------------------------------- ; Twilighte board includes ;---------------------------------------------------------------------- From bab256ef6a9045cb37d0b5f8e1d563771c570887 Mon Sep 17 00:00:00 2001 From: jede Date: Sat, 17 Feb 2024 23:40:50 +0100 Subject: [PATCH 02/14] -r option basic11 --- src/commands/basic11.asm | 48 +++++++++++++++++-- .../basic11/basic11_manage_option_cmdline.s | 23 ++++++++- 2 files changed, 66 insertions(+), 5 deletions(-) diff --git a/src/commands/basic11.asm b/src/commands/basic11.asm index 02f5dd8..f183fc8 100644 --- a/src/commands/basic11.asm +++ b/src/commands/basic11.asm @@ -1,17 +1,21 @@ .export _basic11 +.export _basic10 ;; OPTIONS - .define BASIC11_OPTION_DEFAULT_PATH_IS_NOT_SET $00 .define BASIC11_OPTION_DEFAULT_PATH_IS_SET $01 .define BASIC11_OPTION_ROM_ID_IS_NOT_SET $00 .define BASIC11_OPTION_ROM_ID_IS_SET $01 +.define BASIC11_MAX_NUMBER_OF_ROM $03 + .define BASIC11_START_GUI $01 .define BASIC11_START_LIST $02 .define BASIC11_DEFAULT_PATH_SET $03 +.define BASIC11_END_OF_ARGS $04 +.define BASIC11_SET_ROM $05 .define BASIC11_OPTION_UNKNOWN $FF .define BASIC11_NMI_VECTOR $F88F @@ -67,7 +71,6 @@ basic11_option_default_path_set := userzp+26 ; Used when user type "basic11 -p p basic11_current_arg_id := userzp+28 ; One byte basic11_rootpath_ptr := userzp + 29 ; Used to save ptr of the path - .define BASIC10_ROM $01 .define BASIC11_ROM $02 @@ -196,7 +199,7 @@ basic11_rootpath_ptr := userzp + 29 ; Used to save ptr of the path tay lda (basic11_argv1_ptr),y ldy basic11_save_pos_arg - cmp #$22 ; " char + cmp #'"' ; " char beq @outstrcat cmp #$00 beq @outstrcat @@ -356,6 +359,12 @@ basic11_rootpath_ptr := userzp + 29 ; Used to save ptr of the path cmp #BASIC11_START_LIST beq @start_list + cmp #BASIC11_SET_ROM + beq @set_rom + + cmp #BASIC11_END_OF_ARGS + beq @start_rom + cmp #BASIC11_DEFAULT_PATH_SET beq @root_path bne @option_not_known @@ -371,12 +380,34 @@ basic11_rootpath_ptr := userzp + 29 ; Used to save ptr of the path print str_can_not rts +@set_rom: + getmainarg basic11_current_arg_id, (basic11_argv_ptr) + sta basic11_ptr2 + sty basic11_ptr2+1 + ;BASIC11_MAX_NUMBER_OF_ROM + ldy #$00 + lda (basic11_ptr2),y + beq @param_empty + sec + sbc #$30 + + cmp #BASIC11_MAX_NUMBER_OF_ROM + bcc @set_rom_id + print str_rom_not_known + crlf + rts + +@set_rom_id: + sta BASIC11_OFFSET_FOR_ID_OF_ROM_TO_LOAD + inc basic11_current_arg_id + jmp @basic11_option_management + @root_path: getmainarg basic11_current_arg_id, (basic11_argv_ptr) sta basic11_rootpath_ptr sty basic11_rootpath_ptr+1 - ; Checking if the path is less than 32 chars (Atmos rom can't contains more than 32 chars) + ldy #$00 @check_path: @@ -393,6 +424,8 @@ basic11_rootpath_ptr := userzp + 29 ; Used to save ptr of the path @end_check: cpy #$00 bne @path_not_empty + +@param_empty: print str_basic11_missing_arg crlf rts @@ -400,6 +433,10 @@ basic11_rootpath_ptr := userzp + 29 ; Used to save ptr of the path @path_not_empty: lda #BASIC11_OPTION_DEFAULT_PATH_IS_SET sta basic11_option_default_path_set + inc basic11_current_arg_id + jmp @basic11_option_management + +@start_rom: jmp @load_ROM_in_memory_and_start @continue_l_option: @@ -1043,6 +1080,9 @@ copy_bufedt: .include "basic11/basic11_gui.asm" +str_rom_not_known: + .asciiz "Rom not known" + str_error_path_too_long: .byte "Path can not longer than ",.string(BASIC11_MAX_LENGTH_DEFAULT_PATH)," chars",0 diff --git a/src/commands/basic11/basic11_manage_option_cmdline.s b/src/commands/basic11/basic11_manage_option_cmdline.s index e73880a..c0ffe16 100644 --- a/src/commands/basic11/basic11_manage_option_cmdline.s +++ b/src/commands/basic11/basic11_manage_option_cmdline.s @@ -1,7 +1,15 @@ .proc basic11_manage_option_cmdline + lda basic11_current_arg_id + cmp basic11_argc + beq @end_of_arg - ldy basic11_current_arg_id + getmainarg basic11_current_arg_id, (basic11_argv_ptr) ; Get first arg + sta basic11_argv1_ptr + sty basic11_argv1_ptr+1 + + ldy #$01 lda (basic11_argv1_ptr),y + beq @unknown_option cmp #'g' beq @gui @@ -12,9 +20,22 @@ cmp #'p' beq @root_path + cmp #'r' + beq @select_rom + +@unknown_option: lda #BASIC11_OPTION_UNKNOWN rts +@end_of_arg: + lda #BASIC11_END_OF_ARGS + rts + +@select_rom: + inc basic11_current_arg_id + lda #BASIC11_SET_ROM + rts + @root_path: inc basic11_current_arg_id lda #BASIC11_DEFAULT_PATH_SET From a161eea1f710335843ac43baf10a08a93133aa16 Mon Sep 17 00:00:00 2001 From: jede Date: Sun, 18 Feb 2024 23:33:52 +0100 Subject: [PATCH 03/14] update version --- VERSION | 2 +- src/shell.asm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 2cf03e5..a2a8260 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2024.1 \ No newline at end of file +2024.2 \ No newline at end of file diff --git a/src/shell.asm b/src/shell.asm index 0e59c98..9e5aab9 100644 --- a/src/shell.asm +++ b/src/shell.asm @@ -1328,7 +1328,7 @@ str_max_malloc_reached: .asciiz "Max number of malloc reached" signature: - .asciiz "Shell v2024.1" + .asciiz "Shell v2024.2" shellext_found: .byte "Shell extentions found",$0A,$0D,$00 From f07150262694e7446665183616aa3a6e5bd663cc Mon Sep 17 00:00:00 2001 From: jede Date: Tue, 7 May 2024 00:34:47 +0200 Subject: [PATCH 04/14] fix bug --- VERSION | 2 +- docs/basic11.md | 13 +++--- src/commands/basic11.asm | 41 +++++++++++++++---- .../basic11/basic11_manage_option_cmdline.s | 14 +++++++ src/shell.asm | 7 +++- 5 files changed, 60 insertions(+), 17 deletions(-) diff --git a/VERSION b/VERSION index a2a8260..80e1c8d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2024.2 \ No newline at end of file +2024.3 \ No newline at end of file diff --git a/docs/basic11.md b/docs/basic11.md index d1d6adb..bd63ddd 100644 --- a/docs/basic11.md +++ b/docs/basic11.md @@ -8,9 +8,6 @@ basic11 - start atmos rom basic11 [OPTION]... ["FILE] - - - ## DESCRIPTION This command starts the atmos rom. This rom did not test RAM and cload/csave are done on sdcard. It means that it calls file from sdcard. @@ -31,6 +28,12 @@ Get a tape file, and place it in the root folder of the sdcard. -r [id_rom] Set type of rom to load (value = 0, 1, 2) +-v + Displays version + +-h + Displays help + "MYTAPE Load MYTAPE @@ -180,8 +183,6 @@ not done. Some others games uses special keys (SHIFT, CTRL) for direction or the first button. Theses cases are not handle yet : but it could in the future. - - ## Example Starts basic11 : @@ -202,8 +203,6 @@ A path can be specified : /#basic11 -p /home/jede ``` - - In basic rom : CLOAD "ZORGONS => it will load zorgons.tap diff --git a/src/commands/basic11.asm b/src/commands/basic11.asm index f183fc8..3b77bf9 100644 --- a/src/commands/basic11.asm +++ b/src/commands/basic11.asm @@ -16,13 +16,15 @@ .define BASIC11_DEFAULT_PATH_SET $03 .define BASIC11_END_OF_ARGS $04 .define BASIC11_SET_ROM $05 +.define BASIC11_DISPLAY_VERSION $06 +.define BASIC11_DISPLAY_HELP $07 .define BASIC11_OPTION_UNKNOWN $FF .define BASIC11_NMI_VECTOR $F88F .define BASIC11_OFFSET_ROOT_PATH $FE70 .define BASIC11_OFFSET_LENGTH_ROOT_PATH BASIC11_OFFSET_ROOT_PATH-1 -.define BASIC10_OFFSET_ROOT_PATH $FCED +.define BASIC10_OFFSET_ROOT_PATH $FCEC .define BASIC11_OFFSET_FOR_ID_OF_ROM_TO_LOAD $F2 .define BASIC11_MAX_LENGTH_DEFAULT_PATH 16 ; MAX : 32 @@ -112,8 +114,8 @@ basic11_rootpath_ptr := userzp + 29 ; Used to save ptr of the path ldy #$00 lda (basic11_argv1_ptr),y - cmp #'-' ; is it Dash ? - bne @is_a_tape_file_in_arg ; No we check if a .tape file is provieded + cmp #'-' ; is it Dash ? + bne @is_a_tape_file_in_arg ; No we check if a .tape file is provieded jmp @basic11_option_management ; Yes, check options @no_arg: @@ -353,6 +355,7 @@ basic11_rootpath_ptr := userzp + 29 ; Used to save ptr of the path @basic11_option_management: jsr basic11_manage_option_cmdline + cmp #BASIC11_START_GUI beq @gui @@ -362,13 +365,31 @@ basic11_rootpath_ptr := userzp + 29 ; Used to save ptr of the path cmp #BASIC11_SET_ROM beq @set_rom - cmp #BASIC11_END_OF_ARGS - beq @start_rom + cmp #BASIC11_DISPLAY_VERSION + beq @display_version + + cmp #BASIC11_DISPLAY_HELP + beq @display_help cmp #BASIC11_DEFAULT_PATH_SET beq @root_path + + cmp #BASIC11_END_OF_ARGS + beq @start_rom bne @option_not_known +@display_version: + print version_str + crlf + rts + +@display_help: + getmainarg #0, (basic11_argv_ptr) ; Get first arg + BRK_KERNEL XWSTR0 + print basic11_usage + crlf + rts + @start_list: mfree (basic11_argv_ptr) @@ -402,6 +423,9 @@ basic11_rootpath_ptr := userzp + 29 ; Used to save ptr of the path inc basic11_current_arg_id jmp @basic11_option_management +@start_rom: + jmp @load_ROM_in_memory_and_start + @root_path: getmainarg basic11_current_arg_id, (basic11_argv_ptr) sta basic11_rootpath_ptr @@ -436,8 +460,7 @@ basic11_rootpath_ptr := userzp + 29 ; Used to save ptr of the path inc basic11_current_arg_id jmp @basic11_option_management -@start_rom: - jmp @load_ROM_in_memory_and_start + @continue_l_option: ; Search now @@ -947,6 +970,7 @@ basic11_driver: @jmp_basic10_vector: jmp $F42D + end_basic11_driver: @@ -1128,6 +1152,9 @@ str_basic10_maindb: .byte BASIC10_PATH_DB .asciiz "basic10.db" +basic11_usage: + .asciiz " [-r rom] [-p path] [-l] [-g] [\"TAPEFILE]" + basic_str_search: .byte "+--------+-----------------------------+" .byte "| key | NAME |" diff --git a/src/commands/basic11/basic11_manage_option_cmdline.s b/src/commands/basic11/basic11_manage_option_cmdline.s index c0ffe16..b97190c 100644 --- a/src/commands/basic11/basic11_manage_option_cmdline.s +++ b/src/commands/basic11/basic11_manage_option_cmdline.s @@ -11,6 +11,12 @@ lda (basic11_argv1_ptr),y beq @unknown_option + cmp #'v' + beq @version + + cmp #'h' + beq @help + cmp #'g' beq @gui @@ -48,4 +54,12 @@ @list: lda #BASIC11_START_LIST rts + +@version: + lda #BASIC11_DISPLAY_VERSION + rts + +@help: + lda #BASIC11_DISPLAY_HELP + rts .endproc diff --git a/src/shell.asm b/src/shell.asm index 9e5aab9..382602a 100644 --- a/src/shell.asm +++ b/src/shell.asm @@ -1307,7 +1307,7 @@ str_not_found: .byte " : No such file or directory",$0D,$0A,0 str_oom: - .byte "Out of memory",$0D,$0A,0 ; FIXME + .byte "Out of memory",$0D,$0A,0 ; FIXME str_too_many_open_files: .byte "Too many open files",$0D,$0A,0 @@ -1328,7 +1328,10 @@ str_max_malloc_reached: .asciiz "Max number of malloc reached" signature: - .asciiz "Shell v2024.2" + .byte "Shell v" + ; Don't put 0 here +version_str: + .asciiz "2024.3" shellext_found: .byte "Shell extentions found",$0A,$0D,$00 From 531707345b7faa7308245289603ecdb97446fa3c Mon Sep 17 00:00:00 2001 From: jede Date: Sun, 12 May 2024 14:58:52 +0200 Subject: [PATCH 05/14] fix/bug_basic10 --- src/commands/basic11.asm | 15 +++++++++++++-- src/shell.asm | 6 ++---- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/commands/basic11.asm b/src/commands/basic11.asm index 3b77bf9..0d01f48 100644 --- a/src/commands/basic11.asm +++ b/src/commands/basic11.asm @@ -24,7 +24,8 @@ .define BASIC11_OFFSET_ROOT_PATH $FE70 .define BASIC11_OFFSET_LENGTH_ROOT_PATH BASIC11_OFFSET_ROOT_PATH-1 -.define BASIC10_OFFSET_ROOT_PATH $FCEC +.define BASIC10_OFFSET_ROOT_PATH $FCED +.define BASIC10_OFFSET_LENGTH_ROOT_PATH BASIC10_OFFSET_ROOT_PATH-1 .define BASIC11_OFFSET_FOR_ID_OF_ROM_TO_LOAD $F2 .define BASIC11_MAX_LENGTH_DEFAULT_PATH 16 ; MAX : 32 @@ -867,9 +868,11 @@ basic11_driver: lda basic11_mode cmp #BASIC11_ROM beq @forge_path_for_atmos + lda basic11_tmp - sta BASIC10_OFFSET_ROOT_PATH,y + sta BASIC10_OFFSET_ROOT_PATH,y ; Put char of the path in BASIC10 path bne @skip_basic11_forge_path + beq @end_start_with_default_path @forge_path_for_atmos: lda basic11_tmp @@ -881,6 +884,14 @@ basic11_driver: @end_start_with_default_path: ; Store the length of the string + lda basic11_mode + cmp #BASIC11_ROM + beq @set_length_to_atmosrom_path + + sty BASIC10_OFFSET_LENGTH_ROOT_PATH + bne @manage_others_cases + +@set_length_to_atmosrom_path: sty BASIC11_OFFSET_LENGTH_ROOT_PATH beq @let_s_start_atmos diff --git a/src/shell.asm b/src/shell.asm index 382602a..3aabfba 100644 --- a/src/shell.asm +++ b/src/shell.asm @@ -220,8 +220,7 @@ RETURN_BANK_READ_BYTE_FROM_OVERLAY_RAM := $78 ; lda bash_struct_command_line_ptr ; ldy bash_struct_command_line_ptr+1 ; BRK_KERNEL XEXEC - ldx #$00 - exec (bash_struct_command_line_ptr) + system (bash_struct_command_line_ptr) jsr external_cmd jmp loop .endproc @@ -276,8 +275,7 @@ RETURN_BANK_READ_BYTE_FROM_OVERLAY_RAM := $78 ; lda bash_struct_ptr ; ldy bash_struct_ptr+1 ; BRK_KERNEL XEXEC - ldx #$00 - exec (bash_struct_ptr) + system (bash_struct_ptr) jsr external_cmd From ede6ee90141506e00749b9abfe9951f731d61e59 Mon Sep 17 00:00:00 2001 From: jede Date: Sun, 12 May 2024 15:06:13 +0200 Subject: [PATCH 06/14] timeout for unit test --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8d74776..1a2d725 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -135,7 +135,7 @@ jobs: cat tests/unit-tests/commands.sub > ${GITHUB_WORKSPACE}/oricutron/sdcard/ETC/AUTOBOOT #cat tests/unit_test/xrm.sub >> ${GITHUB_WORKSPACE}/oricutron/sdcard/ETC/AUTOBOOT cd ${GITHUB_WORKSPACE}/oricutron - timeout --preserve-status 10 ./xvfb.sh || exit 0 + timeout --preserve-status 20 ./xvfb.sh || exit 0 - name: Check unit-test run: | From 8cf9273c71052047dee1d066e6fed307aaee7894 Mon Sep 17 00:00:00 2001 From: jede Date: Sun, 12 May 2024 22:23:45 +0200 Subject: [PATCH 07/14] fix --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1a2d725..24b093f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -72,7 +72,7 @@ jobs: - name: Prepare environment for oricutron if: steps.cache-sdk.outputs.cache-hit != 'true' run: | - sudo apt-get install -y xvfb libgtk-3-0 libgtk-3-dev libsdl1.2debian libsdl1.2-dev + sudo apt-get update && apt-get install -y xvfb libgtk-3-0 libgtk-3-dev libsdl1.2debian libsdl1.2-dev git clone https://github.com/pete-gordon/oricutron.git cd oricutron && make && pwd && cd .. && ls -l && echo ${GITHUB_WORKSPACE} echo Timeout oricutron : $secret.TMOUT_ORICUTRON From ad04bd30ac05ce903d0be7743351c91b55a18f89 Mon Sep 17 00:00:00 2001 From: jede Date: Sun, 12 May 2024 22:26:48 +0200 Subject: [PATCH 08/14] fix --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 24b093f..51827fc 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -72,7 +72,7 @@ jobs: - name: Prepare environment for oricutron if: steps.cache-sdk.outputs.cache-hit != 'true' run: | - sudo apt-get update && apt-get install -y xvfb libgtk-3-0 libgtk-3-dev libsdl1.2debian libsdl1.2-dev + sudo apt-get update && sudo apt-get install -y xvfb libgtk-3-0 libgtk-3-dev libsdl1.2debian libsdl1.2-dev git clone https://github.com/pete-gordon/oricutron.git cd oricutron && make && pwd && cd .. && ls -l && echo ${GITHUB_WORKSPACE} echo Timeout oricutron : $secret.TMOUT_ORICUTRON From 09cdaf3e027a69e67aeb2ca2f2ebb66cb827793c Mon Sep 17 00:00:00 2001 From: jede Date: Sun, 12 May 2024 22:33:11 +0200 Subject: [PATCH 09/14] fix --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 51827fc..b2dc90a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -72,9 +72,9 @@ jobs: - name: Prepare environment for oricutron if: steps.cache-sdk.outputs.cache-hit != 'true' run: | - sudo apt-get update && sudo apt-get install -y xvfb libgtk-3-0 libgtk-3-dev libsdl1.2debian libsdl1.2-dev + sudo apt-get update && sudo apt-get install -y xvfb libgtk-3-0 libgtk-3-dev libsdl1.2debian libsdl1.2-dev && sudo ldconfig git clone https://github.com/pete-gordon/oricutron.git - cd oricutron && make && pwd && cd .. && ls -l && echo ${GITHUB_WORKSPACE} + cd oricutron && make && pwd && cd /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0 . && cd .. && ls -l && echo ${GITHUB_WORKSPACE} echo Timeout oricutron : $secret.TMOUT_ORICUTRON # - name: Compile orix-sdk From 548397d800302845cde72ea735ed01e7c1239131 Mon Sep 17 00:00:00 2001 From: jede Date: Sun, 12 May 2024 22:35:45 +0200 Subject: [PATCH 10/14] test --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b2dc90a..1d484f1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -74,7 +74,7 @@ jobs: run: | sudo apt-get update && sudo apt-get install -y xvfb libgtk-3-0 libgtk-3-dev libsdl1.2debian libsdl1.2-dev && sudo ldconfig git clone https://github.com/pete-gordon/oricutron.git - cd oricutron && make && pwd && cd /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0 . && cd .. && ls -l && echo ${GITHUB_WORKSPACE} + cd oricutron && make && pwd && cd /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0 . && ls -l && cd .. && ls -l && echo ${GITHUB_WORKSPACE} echo Timeout oricutron : $secret.TMOUT_ORICUTRON # - name: Compile orix-sdk From 542562a2b8045f78788808b3becae7f2cdd4b2a8 Mon Sep 17 00:00:00 2001 From: jede Date: Sun, 12 May 2024 22:53:01 +0200 Subject: [PATCH 11/14] fix --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1d484f1..d79ef05 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -74,7 +74,7 @@ jobs: run: | sudo apt-get update && sudo apt-get install -y xvfb libgtk-3-0 libgtk-3-dev libsdl1.2debian libsdl1.2-dev && sudo ldconfig git clone https://github.com/pete-gordon/oricutron.git - cd oricutron && make && pwd && cd /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0 . && ls -l && cd .. && ls -l && echo ${GITHUB_WORKSPACE} + cd oricutron && make && pwd && cp /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0 . && ls -l && cd .. && ls -l && echo ${GITHUB_WORKSPACE} echo Timeout oricutron : $secret.TMOUT_ORICUTRON # - name: Compile orix-sdk From 35e67790093cda2494ab9924f421ae67fc899b5c Mon Sep 17 00:00:00 2001 From: jede Date: Sun, 12 May 2024 23:00:19 +0200 Subject: [PATCH 12/14] fix --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d79ef05..bcd2245 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -134,7 +134,7 @@ jobs: cp build/usr/share/shell/shellsd.rom ${GITHUB_WORKSPACE}/oricutron/roms/shell.rom cat tests/unit-tests/commands.sub > ${GITHUB_WORKSPACE}/oricutron/sdcard/ETC/AUTOBOOT #cat tests/unit_test/xrm.sub >> ${GITHUB_WORKSPACE}/oricutron/sdcard/ETC/AUTOBOOT - cd ${GITHUB_WORKSPACE}/oricutron + cd ${GITHUB_WORKSPACE}/oricutron && ls -l && ldconfig timeout --preserve-status 20 ./xvfb.sh || exit 0 - name: Check unit-test From 6bbad4d1aa7d255ec6b2d2dec38fa96f0493aa6a Mon Sep 17 00:00:00 2001 From: jede Date: Sun, 12 May 2024 23:03:21 +0200 Subject: [PATCH 13/14] fix --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index bcd2245..2bf8eed 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -134,7 +134,7 @@ jobs: cp build/usr/share/shell/shellsd.rom ${GITHUB_WORKSPACE}/oricutron/roms/shell.rom cat tests/unit-tests/commands.sub > ${GITHUB_WORKSPACE}/oricutron/sdcard/ETC/AUTOBOOT #cat tests/unit_test/xrm.sub >> ${GITHUB_WORKSPACE}/oricutron/sdcard/ETC/AUTOBOOT - cd ${GITHUB_WORKSPACE}/oricutron && ls -l && ldconfig + cd ${GITHUB_WORKSPACE}/oricutron && ls -l && sudo ldconfig && ls -l /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0 timeout --preserve-status 20 ./xvfb.sh || exit 0 - name: Check unit-test From 2535c90858a9595a25763501b27899d4a5fdba78 Mon Sep 17 00:00:00 2001 From: jede Date: Sun, 12 May 2024 23:19:19 +0200 Subject: [PATCH 14/14] fix --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2bf8eed..9e09f5a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -134,7 +134,7 @@ jobs: cp build/usr/share/shell/shellsd.rom ${GITHUB_WORKSPACE}/oricutron/roms/shell.rom cat tests/unit-tests/commands.sub > ${GITHUB_WORKSPACE}/oricutron/sdcard/ETC/AUTOBOOT #cat tests/unit_test/xrm.sub >> ${GITHUB_WORKSPACE}/oricutron/sdcard/ETC/AUTOBOOT - cd ${GITHUB_WORKSPACE}/oricutron && ls -l && sudo ldconfig && ls -l /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0 + cd ${GITHUB_WORKSPACE}/oricutron && ls -l && sudo ldconfig && sudo apt-get update && sudo apt-get install -y xvfb libgtk-3-0 libgtk-3-dev libsdl1.2debian libsdl1.2-dev timeout --preserve-status 20 ./xvfb.sh || exit 0 - name: Check unit-test