From 6e5f5e9a24a0f05621a483d454b142f0054d0361 Mon Sep 17 00:00:00 2001 From: jede Date: Sat, 2 Oct 2021 00:06:56 +0200 Subject: [PATCH 01/10] Fix bug when network rom is not available --- src/commands/ls.asm | 7 +------ src/commands/twilbank.asm | 12 +++++++++++- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/commands/ls.asm b/src/commands/ls.asm index 079d356..e08cc32 100644 --- a/src/commands/ls.asm +++ b/src/commands/ls.asm @@ -17,8 +17,6 @@ ls_arg := userzp+13 ; L'utilisation de malloc permet de mettre plusieurs noms de fichier en paramètre ;ls_use_malloc = 1 -.struct ls_command_struct -.endstruct .proc _ls lda #$03 @@ -76,12 +74,9 @@ ls_arg := userzp+13 rts @str: .byte "Unable to open current path",$0D,$0A,$00 - - + ; get A&Y @free: - - BRK_KERNEL XMAINARGS sta ls_mainargs sty ls_mainargs+1 diff --git a/src/commands/twilbank.asm b/src/commands/twilbank.asm index 31b4cfa..88bde92 100644 --- a/src/commands/twilbank.asm +++ b/src/commands/twilbank.asm @@ -84,9 +84,19 @@ save_mode := userzp+11 ; FIXME erase shell commands bne @read ; not null then start because we did not found a conf PRINT str_failed mfree(ptr1) + + + + lda save_mode + cmp #NETWORK_ROM + bne @not_systemd_rom + print str_path_network,NOSAVE + jmp @not_found_str + +@not_systemd_rom: print str_path_rom,NOSAVE +@not_found_str: print str_not_found - rts @read: sta fd_systemd From 5c91f145db4a9ce0a318ae2a7ab81765e5f06b05 Mon Sep 17 00:00:00 2001 From: jede Date: Tue, 5 Oct 2021 00:24:50 +0200 Subject: [PATCH 02/10] Some fix --- README.md | 4 ++++ src/commands/twilbank.asm | 12 +++--------- src/shell.asm | 2 +- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 27b5c9b..161a8c9 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,9 @@ Github action : ![shell](https://github.com/orix-software/shell/workflows/main/badge.svg) +# Build code +./configure +make + Maintainers : * Jede diff --git a/src/commands/twilbank.asm b/src/commands/twilbank.asm index 88bde92..b074845 100644 --- a/src/commands/twilbank.asm +++ b/src/commands/twilbank.asm @@ -37,9 +37,8 @@ save_mode := userzp+11 ; FIXME erase shell commands sta save_mode ;PRINT str_starting - malloc 100,str_oom ; [,fail_value] - sta ptr1 - sty ptr1+1 + malloc 100,ptr1,str_oom ; [,fail_value] + lda save_mode cmp #NETWORK_ROM @@ -171,13 +170,11 @@ save_mode := userzp+11 ; FIXME erase shell commands jsr run - ; jsr _lsmem + mfree (routine_to_load) rts - ;jsr twil_copy_buffer_to_ram_bank - ; XMAINARGS ; if s, then start : load rom into ram ; execute RAM @@ -238,9 +235,6 @@ str_path_network: ora #%00100000 sta TWILIGHTE_REGISTER - - - ldx #$00 ldy #$00 @loop: diff --git a/src/shell.asm b/src/shell.asm index 3b3076c..99d8346 100644 --- a/src/shell.asm +++ b/src/shell.asm @@ -1518,7 +1518,7 @@ str_max_malloc_reached: .asciiz "Max number of malloc reached" signature: - .asciiz "Shell v2021.4" + .asciiz "Shell v2022.1" str_compile_time: .byt __DATE__ .byt " " From ee3f95c01440dc8c205eab3041b32d4ce6e6586d Mon Sep 17 00:00:00 2001 From: jede Date: Tue, 5 Oct 2021 00:31:12 +0200 Subject: [PATCH 03/10] Add menu launch shortcut --- src/commands/twilbank.asm | 16 +++++++++++++++- src/shortcut.asm | 6 +++--- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/commands/twilbank.asm b/src/commands/twilbank.asm index b074845..36add28 100644 --- a/src/commands/twilbank.asm +++ b/src/commands/twilbank.asm @@ -1,4 +1,5 @@ -.define NETWORK_ROM $02 +.define NETWORK_ROM $02 +.define MENULAUNCHBANK_ROM $03 .proc network_start ; Test version @@ -19,6 +20,12 @@ jmp _twilbank .endproc +.proc twillaunchbank + lda #MENULAUNCHBANK_ROM + jmp _twilbank +.endproc + + .proc twilfirmware lda #$00 jmp _twilbank @@ -251,6 +258,13 @@ str_path_network: mfree (buffer) lda save_mode beq @firmware + cmp #MENULAUNCHBANK_ROM + bne @default + jsr $c009 ; Twil bank + lda #$00 + beq @out + +@default: jsr $c006 ; Twil form buffer lda #$00 beq @out diff --git a/src/shortcut.asm b/src/shortcut.asm index e49b22e..b55286a 100644 --- a/src/shortcut.asm +++ b/src/shortcut.asm @@ -90,7 +90,7 @@ shortcut_low: .byte $00 ; J .byte $00 ; K .byte twillauncher ; L - .byte $00 ; M + .byte >twillaunchbank ; M .byte >network_start ; N .byte $00 ; O .byte $00 ; P @@ -132,7 +132,7 @@ shortcut_action_type: .byte $00 ; J .byte $00 ; K .byte SHORTCUT_VECTOR ; L - .byte $00 ; M + .byte SHORTCUT_VECTOR ; M .byte SHORTCUT_VECTOR ; N .byte $00 ; O .byte $00 ; P From cfd6498495ea0ad6fefca26e1b1e76f85bfb0bb0 Mon Sep 17 00:00:00 2001 From: jede Date: Tue, 5 Oct 2021 00:38:42 +0200 Subject: [PATCH 04/10] Missing shortcut test --- buildr64.sh | 11 ++++++----- src/build.inc | 2 +- src/shortcut.asm | 2 ++ 3 files changed, 9 insertions(+), 6 deletions(-) mode change 100644 => 100755 buildr64.sh diff --git a/buildr64.sh b/buildr64.sh old mode 100644 new mode 100755 index b99ce91..ca80482 --- a/buildr64.sh +++ b/buildr64.sh @@ -1,5 +1,6 @@ -cp shellus.rom k2021-4.r64 -cat ../../kernel/develop/basicus1.rom >> k2021-4.r64 -cat ../../kernel/develop/kernelus.rom >> k2021-4.r64 -cat ../../empty-rom/empty-rom.rom >> k2021-4.r64 -cp k2021-4.r64 /s/devus.r64 \ No newline at end of file +make +cp shellus.rom k2022-1.r64 +cat ../../kernel/develop/basicus1.rom >> k2022-1.r64 +cat ../../kernel/develop/kernelus.rom >> k2022-1.r64 +cat ../../empty-rom/empty-rom.rom >> k2022-1.r64 +cp k2022-1.r64 /s/devus.r64 \ No newline at end of file diff --git a/src/build.inc b/src/build.inc index 07e82b8..2051347 100644 --- a/src/build.inc +++ b/src/build.inc @@ -1 +1 @@ -.define __DATE__ "2021-09-07 22:07" +.define __DATE__ "2021-10-05 00:33" diff --git a/src/shortcut.asm b/src/shortcut.asm index b55286a..32687ac 100644 --- a/src/shortcut.asm +++ b/src/shortcut.asm @@ -12,6 +12,8 @@ cmp #'T'+$40 beq @start_shortcut cmp #'G'+$40 + beq @start_shortcut + cmp #'M'+$40 bne @exit @start_shortcut: and #%01111111 ; Remove ctrl/fonct From 899aef5b5fa89853a28a9cdace1a710c09a8e546 Mon Sep 17 00:00:00 2001 From: jede Date: Sat, 9 Oct 2021 00:15:11 +0200 Subject: [PATCH 05/10] Rollback menu --- src/commands/twilbank.asm | 15 +++++++-------- src/shell.asm | 2 +- src/shortcut.asm | 16 +++++++++------- 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/src/commands/twilbank.asm b/src/commands/twilbank.asm index 36add28..76b0715 100644 --- a/src/commands/twilbank.asm +++ b/src/commands/twilbank.asm @@ -1,4 +1,4 @@ -.define NETWORK_ROM $02 +.define NETWORK_ROM $02 .define MENULAUNCHBANK_ROM $03 .proc network_start @@ -21,6 +21,7 @@ .endproc .proc twillaunchbank + lda #MENULAUNCHBANK_ROM jmp _twilbank .endproc @@ -40,7 +41,7 @@ save_mode := userzp+11 ; FIXME erase shell commands ptr1 := userzp+6 ; FIXME erase shell commands current_bank:= userzp+8 ; FIXME erase shell commands ptr2 := userzp+9 ; FIXME erase shell commands - + sta save_mode ;PRINT str_starting @@ -165,7 +166,7 @@ save_mode := userzp+11 ; FIXME erase shell commands lda save_mode cmp #NETWORK_ROM bne @systemd_bank - ldx #34 ; bank33 + ldx #34 ; bank34 Reserved for network jmp @loading_rom @systemd_bank: @@ -258,13 +259,11 @@ str_path_network: mfree (buffer) lda save_mode beq @firmware - cmp #MENULAUNCHBANK_ROM - bne @default - jsr $c009 ; Twil bank - lda #$00 - beq @out + + @default: + jsr $c006 ; Twil form buffer lda #$00 beq @out diff --git a/src/shell.asm b/src/shell.asm index 99d8346..61345f7 100644 --- a/src/shell.asm +++ b/src/shell.asm @@ -1518,7 +1518,7 @@ str_max_malloc_reached: .asciiz "Max number of malloc reached" signature: - .asciiz "Shell v2022.1" + .asciiz "Shell v2022.X" str_compile_time: .byt __DATE__ .byt " " diff --git a/src/shortcut.asm b/src/shortcut.asm index 32687ac..33d9633 100644 --- a/src/shortcut.asm +++ b/src/shortcut.asm @@ -2,10 +2,11 @@ .define SHORTCUT_VECTOR $02 .proc _manage_shortcut - cmp #'B'+$40 beq @start_shortcut cmp #'L'+$40 + beq @start_shortcut + cmp #'C'+$40 beq @start_shortcut cmp #'N'+$40 beq @start_shortcut @@ -13,7 +14,7 @@ beq @start_shortcut cmp #'G'+$40 beq @start_shortcut - cmp #'M'+$40 + bne @exit @start_shortcut: and #%01111111 ; Remove ctrl/fonct @@ -91,8 +92,8 @@ shortcut_low: .byte $00 ; I .byte $00 ; J .byte $00 ; K - .byte twillauncher ; L - .byte >twillaunchbank ; M + .byte >twillaunchbank ; L + .byte $00 ; M .byte >network_start ; N .byte $00 ; O .byte $00 ; P @@ -134,7 +135,7 @@ shortcut_action_type: .byte $00 ; J .byte $00 ; K .byte SHORTCUT_VECTOR ; L - .byte SHORTCUT_VECTOR ; M + .byte $00 ; M .byte SHORTCUT_VECTOR ; N .byte $00 ; O .byte $00 ; P @@ -144,3 +145,4 @@ shortcut_action_type: .byte SHORTCUT_VECTOR ; T .endproc + From 2e4fc52e0af8885515288a6fa97d4d0d924adca3 Mon Sep 17 00:00:00 2001 From: jede Date: Tue, 12 Oct 2021 13:49:48 +0200 Subject: [PATCH 06/10] man : switch to new xmainargs, and uses more orix-sdk macro --- src/commands/man.asm | 67 +++++++++++++++++++++++++------------------- 1 file changed, 38 insertions(+), 29 deletions(-) diff --git a/src/commands/man.asm b/src/commands/man.asm index 58a182e..0b5e926 100644 --- a/src/commands/man.asm +++ b/src/commands/man.asm @@ -3,14 +3,23 @@ ; TODO : move MALLOC macro after arg test : it avoid a malloc if there is no parameter on command line .proc _man - MAN_SAVE_MALLOC_PTR:=userzp - MAN_SAVE_MALLOC_FP :=userzp+2 + MAN_SAVE_MALLOC_PTR :=userzp + MAN_FP :=userzp+2 + man_xmainargs_ptr :=userzp+4 + + BRK_KERNEL XMAINARGS + sta man_xmainargs_ptr + sty man_xmainargs_ptr+1 + cpx #$01 ; No args ? + bne start_man + jmp error +start_man: ; MALLOC (.strlen("/usr/share/man/")+FNAME_LEN+1+4) ; length of /usr/share/man/ + 8 + .hlp + \0 ; FIXME test OOM TEST_OOM -start_man: + sta MAN_SAVE_MALLOC_PTR sta RESB sty MAN_SAVE_MALLOC_PTR+1 @@ -22,17 +31,13 @@ start_man: sta RES+1 jsr _strcpy ; MAN_SAVE_MALLOC_PTR contains adress of a new string - ; get the first parameter - ldx #$01 - jsr _orix_get_opt - bcc error ; there is not parameter, jumps and displays str_man_error - STRCPY ORIX_ARGV,BUFNOM - - ; strcat(ptr,ORIX_ARGV) - lda #ORIX_ARGV - sta RESB+1 + sty RESB+1 lda MAN_SAVE_MALLOC_PTR sta RES @@ -59,18 +64,20 @@ start_man: cmp #$FF bne next - - ; Not found ; Free memory for path lda MAN_SAVE_MALLOC_PTR ldy MAN_SAVE_MALLOC_PTR+1 BRK_KERNEL XFREE - PRINT txt_file_not_found - ldx #$01 - jsr _orix_get_opt - PRINT BUFNOM + print txt_file_not_found + + ldx #$01 ; get arg + lda man_xmainargs_ptr + ldy man_xmainargs_ptr+1 + BRK_KERNEL XGETARGV + BRK_KERNEL XWSTR0 + RETURN_LINE rts @@ -78,33 +85,35 @@ error: ; Free memory for path lda MAN_SAVE_MALLOC_PTR ldy MAN_SAVE_MALLOC_PTR+1 - BRK_ORIX XFREE - PRINT str_man_error + BRK_KERNEL XFREE + print str_man_error rts next: - sta MAN_SAVE_MALLOC_FP - stx MAN_SAVE_MALLOC_FP+1 + sta MAN_FP + stx MAN_FP+1 CLS SWITCH_OFF_CURSOR ; We read 1080 bytes - FREAD SCREEN, 1080, 1, 0 + fread SCREEN, 1080, 1, MAN_FP + ; FREAD SCREEN, 1080, 1, 0 cget_loop: - BRK_ORIX XRDW0 + BRK_KERNEL XRDW0 bmi cget_loop ; A bit crap to flush screen ... + ; read again ? out: - BRK_ORIX XHIRES - BRK_ORIX XTEXT + BRK_KERNEL XHIRES + BRK_KERNEL XTEXT SWITCH_ON_CURSOR lda MAN_SAVE_MALLOC_PTR ldy MAN_SAVE_MALLOC_PTR+1 - BRK_ORIX XFREE + BRK_KERNEL XFREE - fclose(MAN_SAVE_MALLOC_FP) + fclose(MAN_FP) rts From fbee34ff71308277a40a7bf7e49c1ca764041df8 Mon Sep 17 00:00:00 2001 From: jedeoric Date: Tue, 23 Nov 2021 00:10:05 +0100 Subject: [PATCH 07/10] Read bigger file for basic11 db file --- src/commands/basic11.asm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/basic11.asm b/src/commands/basic11.asm index a9127a1..c1d4ce0 100644 --- a/src/commands/basic11.asm +++ b/src/commands/basic11.asm @@ -33,7 +33,7 @@ basic11_do_not_display := userzp+17 .define BASIC11_PATH_DB "/var/cache/basic11/" -.define BASIC11_MAX_MAINDB_LENGTH 12000 +.define BASIC11_MAX_MAINDB_LENGTH 20000 .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 From 04812c7e7ce6d89ec4934ab4dcf4932435872adc Mon Sep 17 00:00:00 2001 From: jedeoric Date: Tue, 23 Nov 2021 23:53:05 +0100 Subject: [PATCH 08/10] Improve bank switching for basic11 --- src/commands/basic11.asm | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/commands/basic11.asm b/src/commands/basic11.asm index c1d4ce0..9b3f47c 100644 --- a/src/commands/basic11.asm +++ b/src/commands/basic11.asm @@ -179,7 +179,11 @@ basic11_do_not_display := userzp+17 pla sta STORE_CURRENT_DEVICE ; For atmos ROM : it pass the current device () - lda #ATMOS_ID_BANK + + lda VIA2::PRA + and #%10100000 + ora #ATMOS_ID_BANK + ;and #%10100 sta VIA2::PRA jmp $F88F ; NMI vector of ATMOS rom @@ -611,7 +615,9 @@ basic11_do_not_display := userzp+17 basic11_driver: sei - lda #$00 ; RAM bank + lda VIA2::PRA + and #%11111000 + ;lda #$00 ; RAM bank sta VIA2::PRA ldx #$00 From 9d2a04a6217a1bee02fb1a56dea4f0f8b2ae3eb6 Mon Sep 17 00:00:00 2001 From: jedeoric Date: Wed, 24 Nov 2021 22:07:14 +0100 Subject: [PATCH 09/10] Fix bug --- src/commands/basic11.asm | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/commands/basic11.asm b/src/commands/basic11.asm index 9b3f47c..5b2c7d6 100644 --- a/src/commands/basic11.asm +++ b/src/commands/basic11.asm @@ -180,10 +180,21 @@ basic11_do_not_display := userzp+17 sta STORE_CURRENT_DEVICE ; For atmos ROM : it pass the current device () + ; Crap fix + + lda #%10110111 ; 0001 0111 + sta VIA2::DDRA + + lda #%10110110 + sta VIA2::PRA + + lda #%00010111 + sta VIA2::DDRA + + lda VIA2::PRA and #%10100000 ora #ATMOS_ID_BANK - ;and #%10100 sta VIA2::PRA jmp $F88F ; NMI vector of ATMOS rom From 3b7ecdfb94a29e4ceef97e867ed6bdfedc5c5bf1 Mon Sep 17 00:00:00 2001 From: jedeoric Date: Wed, 24 Nov 2021 22:08:15 +0100 Subject: [PATCH 10/10] set version for bugfix --- src/shell.asm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shell.asm b/src/shell.asm index 61345f7..a9903e8 100644 --- a/src/shell.asm +++ b/src/shell.asm @@ -1518,7 +1518,7 @@ str_max_malloc_reached: .asciiz "Max number of malloc reached" signature: - .asciiz "Shell v2022.X" + .asciiz "Shell v2021.4.1" str_compile_time: .byt __DATE__ .byt " "