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/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/commands/basic11.asm b/src/commands/basic11.asm index a9127a1..5b2c7d6 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 @@ -179,7 +179,22 @@ basic11_do_not_display := userzp+17 pla sta STORE_CURRENT_DEVICE ; For atmos ROM : it pass the current device () - lda #ATMOS_ID_BANK + + ; 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 sta VIA2::PRA jmp $F88F ; NMI vector of ATMOS rom @@ -611,7 +626,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 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/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 diff --git a/src/commands/twilbank.asm b/src/commands/twilbank.asm index 31b4cfa..76b0715 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,13 @@ jmp _twilbank .endproc +.proc twillaunchbank + + lda #MENULAUNCHBANK_ROM + jmp _twilbank +.endproc + + .proc twilfirmware lda #$00 jmp _twilbank @@ -33,13 +41,12 @@ 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 - malloc 100,str_oom ; [,fail_value] - sta ptr1 - sty ptr1+1 + malloc 100,ptr1,str_oom ; [,fail_value] + lda save_mode cmp #NETWORK_ROM @@ -84,9 +91,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 @@ -149,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: @@ -161,13 +178,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 @@ -228,9 +243,6 @@ str_path_network: ora #%00100000 sta TWILIGHTE_REGISTER - - - ldx #$00 ldy #$00 @loop: @@ -247,6 +259,11 @@ str_path_network: mfree (buffer) lda save_mode beq @firmware + + + +@default: + jsr $c006 ; Twil form buffer lda #$00 beq @out diff --git a/src/shell.asm b/src/shell.asm index 3b3076c..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 v2021.4" + .asciiz "Shell v2021.4.1" str_compile_time: .byt __DATE__ .byt " " diff --git a/src/shortcut.asm b/src/shortcut.asm index e49b22e..33d9633 100644 --- a/src/shortcut.asm +++ b/src/shortcut.asm @@ -2,16 +2,19 @@ .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 cmp #'T'+$40 beq @start_shortcut cmp #'G'+$40 + beq @start_shortcut + bne @exit @start_shortcut: and #%01111111 ; Remove ctrl/fonct @@ -89,7 +92,7 @@ shortcut_low: .byte $00 ; I .byte $00 ; J .byte $00 ; K - .byte twillauncher ; L + .byte >twillaunchbank ; L .byte $00 ; M .byte >network_start ; N .byte $00 ; O @@ -142,3 +145,4 @@ shortcut_action_type: .byte SHORTCUT_VECTOR ; T .endproc +