Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
Github action : ![shell](https://github.com/orix-software/shell/workflows/main/badge.svg)

# Build code
./configure
make

Maintainers :

* Jede
Expand Down
11 changes: 6 additions & 5 deletions buildr64.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -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
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
2 changes: 1 addition & 1 deletion src/build.inc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
.define __DATE__ "2021-09-07 22:07"
.define __DATE__ "2021-10-05 00:33"
23 changes: 20 additions & 3 deletions src/commands/basic11.asm
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
7 changes: 1 addition & 6 deletions src/commands/ls.asm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
67 changes: 38 additions & 29 deletions src/commands/man.asm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
ldx #$01 ; get arg
lda man_xmainargs_ptr
ldy man_xmainargs_ptr+1
BRK_KERNEL XGETARGV

sta RESB
lda #>ORIX_ARGV
sta RESB+1
sty RESB+1

lda MAN_SAVE_MALLOC_PTR
sta RES
Expand All @@ -59,52 +64,56 @@ 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
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

Expand Down
43 changes: 30 additions & 13 deletions src/commands/twilbank.asm
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.define NETWORK_ROM $02
.define NETWORK_ROM $02
.define MENULAUNCHBANK_ROM $03

.proc network_start
; Test version
Expand All @@ -19,6 +20,13 @@
jmp _twilbank
.endproc

.proc twillaunchbank

lda #MENULAUNCHBANK_ROM
jmp _twilbank
.endproc


.proc twilfirmware
lda #$00
jmp _twilbank
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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
Expand Down Expand Up @@ -228,9 +243,6 @@ str_path_network:
ora #%00100000
sta TWILIGHTE_REGISTER




ldx #$00
ldy #$00
@loop:
Expand All @@ -247,6 +259,11 @@ str_path_network:
mfree (buffer)
lda save_mode
beq @firmware



@default:

jsr $c006 ; Twil form buffer
lda #$00
beq @out
Expand Down
2 changes: 1 addition & 1 deletion src/shell.asm
Original file line number Diff line number Diff line change
Expand Up @@ -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 " "
Expand Down
10 changes: 7 additions & 3 deletions src/shortcut.asm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -110,7 +113,7 @@ shortcut_high:
.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
Expand Down Expand Up @@ -142,3 +145,4 @@ shortcut_action_type:
.byte SHORTCUT_VECTOR ; T

.endproc