Skip to content

Commit 351cbc8

Browse files
authored
Merge pull request #93 from orix-software/develop
Develop
2 parents 4f777c8 + a0a6a33 commit 351cbc8

File tree

9 files changed

+108
-61
lines changed

9 files changed

+108
-61
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
Github action : ![shell](https://github.com/orix-software/shell/workflows/main/badge.svg)
22

3+
# Build code
4+
./configure
5+
make
6+
37
Maintainers :
48

59
* Jede

buildr64.sh

100644100755
Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
cp shellus.rom k2021-4.r64
2-
cat ../../kernel/develop/basicus1.rom >> k2021-4.r64
3-
cat ../../kernel/develop/kernelus.rom >> k2021-4.r64
4-
cat ../../empty-rom/empty-rom.rom >> k2021-4.r64
5-
cp k2021-4.r64 /s/devus.r64
1+
make
2+
cp shellus.rom k2022-1.r64
3+
cat ../../kernel/develop/basicus1.rom >> k2022-1.r64
4+
cat ../../kernel/develop/kernelus.rom >> k2022-1.r64
5+
cat ../../empty-rom/empty-rom.rom >> k2022-1.r64
6+
cp k2022-1.r64 /s/devus.r64

src/build.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
.define __DATE__ "2021-09-07 22:07"
1+
.define __DATE__ "2021-10-05 00:33"

src/commands/basic11.asm

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ basic11_do_not_display := userzp+17
3333

3434

3535
.define BASIC11_PATH_DB "/var/cache/basic11/"
36-
.define BASIC11_MAX_MAINDB_LENGTH 12000
36+
.define BASIC11_MAX_MAINDB_LENGTH 20000
3737

3838
.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
3939

@@ -179,7 +179,22 @@ basic11_do_not_display := userzp+17
179179
pla
180180

181181
sta STORE_CURRENT_DEVICE ; For atmos ROM : it pass the current device ()
182-
lda #ATMOS_ID_BANK
182+
183+
; Crap fix
184+
185+
lda #%10110111 ; 0001 0111
186+
sta VIA2::DDRA
187+
188+
lda #%10110110
189+
sta VIA2::PRA
190+
191+
lda #%00010111
192+
sta VIA2::DDRA
193+
194+
195+
lda VIA2::PRA
196+
and #%10100000
197+
ora #ATMOS_ID_BANK
183198
sta VIA2::PRA
184199

185200
jmp $F88F ; NMI vector of ATMOS rom
@@ -611,7 +626,9 @@ basic11_do_not_display := userzp+17
611626
basic11_driver:
612627
sei
613628

614-
lda #$00 ; RAM bank
629+
lda VIA2::PRA
630+
and #%11111000
631+
;lda #$00 ; RAM bank
615632
sta VIA2::PRA
616633

617634
ldx #$00

src/commands/ls.asm

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ ls_arg := userzp+13
1717
; L'utilisation de malloc permet de mettre plusieurs noms de fichier en paramètre
1818
;ls_use_malloc = 1
1919

20-
.struct ls_command_struct
21-
.endstruct
2220

2321
.proc _ls
2422
lda #$03
@@ -76,12 +74,9 @@ ls_arg := userzp+13
7674
rts
7775
@str:
7876
.byte "Unable to open current path",$0D,$0A,$00
79-
80-
77+
8178
; get A&Y
8279
@free:
83-
84-
8580
BRK_KERNEL XMAINARGS
8681
sta ls_mainargs
8782
sty ls_mainargs+1

src/commands/man.asm

Lines changed: 38 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,23 @@
33
; TODO : move MALLOC macro after arg test : it avoid a malloc if there is no parameter on command line
44

55
.proc _man
6-
MAN_SAVE_MALLOC_PTR:=userzp
7-
MAN_SAVE_MALLOC_FP :=userzp+2
6+
MAN_SAVE_MALLOC_PTR :=userzp
7+
MAN_FP :=userzp+2
8+
man_xmainargs_ptr :=userzp+4
9+
10+
BRK_KERNEL XMAINARGS
11+
sta man_xmainargs_ptr
12+
sty man_xmainargs_ptr+1
13+
cpx #$01 ; No args ?
14+
bne start_man
15+
jmp error
16+
start_man:
817
;
918
MALLOC (.strlen("/usr/share/man/")+FNAME_LEN+1+4) ; length of /usr/share/man/ + 8 + .hlp + \0
1019
; FIXME test OOM
1120
TEST_OOM
1221

13-
start_man:
22+
1423
sta MAN_SAVE_MALLOC_PTR
1524
sta RESB
1625
sty MAN_SAVE_MALLOC_PTR+1
@@ -22,17 +31,13 @@ start_man:
2231
sta RES+1
2332
jsr _strcpy ; MAN_SAVE_MALLOC_PTR contains adress of a new string
2433

25-
; get the first parameter
26-
ldx #$01
27-
jsr _orix_get_opt
28-
bcc error ; there is not parameter, jumps and displays str_man_error
29-
STRCPY ORIX_ARGV,BUFNOM
30-
31-
; strcat(ptr,ORIX_ARGV)
32-
lda #<ORIX_ARGV
34+
ldx #$01 ; get arg
35+
lda man_xmainargs_ptr
36+
ldy man_xmainargs_ptr+1
37+
BRK_KERNEL XGETARGV
38+
3339
sta RESB
34-
lda #>ORIX_ARGV
35-
sta RESB+1
40+
sty RESB+1
3641

3742
lda MAN_SAVE_MALLOC_PTR
3843
sta RES
@@ -59,52 +64,56 @@ start_man:
5964
cmp #$FF
6065
bne next
6166

62-
63-
6467
; Not found
6568
; Free memory for path
6669
lda MAN_SAVE_MALLOC_PTR
6770
ldy MAN_SAVE_MALLOC_PTR+1
6871
BRK_KERNEL XFREE
6972

70-
PRINT txt_file_not_found
71-
ldx #$01
72-
jsr _orix_get_opt
73-
PRINT BUFNOM
73+
print txt_file_not_found
74+
75+
ldx #$01 ; get arg
76+
lda man_xmainargs_ptr
77+
ldy man_xmainargs_ptr+1
78+
BRK_KERNEL XGETARGV
79+
BRK_KERNEL XWSTR0
80+
7481
RETURN_LINE
7582

7683
rts
7784
error:
7885
; Free memory for path
7986
lda MAN_SAVE_MALLOC_PTR
8087
ldy MAN_SAVE_MALLOC_PTR+1
81-
BRK_ORIX XFREE
82-
PRINT str_man_error
88+
BRK_KERNEL XFREE
89+
print str_man_error
8390
rts
8491

8592
next:
86-
sta MAN_SAVE_MALLOC_FP
87-
stx MAN_SAVE_MALLOC_FP+1
93+
sta MAN_FP
94+
stx MAN_FP+1
8895
CLS
8996
SWITCH_OFF_CURSOR
9097
; We read 1080 bytes
91-
FREAD SCREEN, 1080, 1, 0
98+
fread SCREEN, 1080, 1, MAN_FP
99+
; FREAD SCREEN, 1080, 1, 0
92100

93101
cget_loop:
94-
BRK_ORIX XRDW0
102+
BRK_KERNEL XRDW0
95103
bmi cget_loop
96104
; A bit crap to flush screen ...
105+
; read again ?
97106
out:
98-
BRK_ORIX XHIRES
99-
BRK_ORIX XTEXT
107+
BRK_KERNEL XHIRES
108+
BRK_KERNEL XTEXT
100109

101110
SWITCH_ON_CURSOR
102111

103112
lda MAN_SAVE_MALLOC_PTR
104113
ldy MAN_SAVE_MALLOC_PTR+1
105-
BRK_ORIX XFREE
114+
BRK_KERNEL XFREE
106115

107-
fclose(MAN_SAVE_MALLOC_FP)
116+
fclose(MAN_FP)
108117

109118
rts
110119

src/commands/twilbank.asm

Lines changed: 30 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
.define NETWORK_ROM $02
1+
.define NETWORK_ROM $02
2+
.define MENULAUNCHBANK_ROM $03
23

34
.proc network_start
45
; Test version
@@ -19,6 +20,13 @@
1920
jmp _twilbank
2021
.endproc
2122

23+
.proc twillaunchbank
24+
25+
lda #MENULAUNCHBANK_ROM
26+
jmp _twilbank
27+
.endproc
28+
29+
2230
.proc twilfirmware
2331
lda #$00
2432
jmp _twilbank
@@ -33,13 +41,12 @@ save_mode := userzp+11 ; FIXME erase shell commands
3341
ptr1 := userzp+6 ; FIXME erase shell commands
3442
current_bank:= userzp+8 ; FIXME erase shell commands
3543
ptr2 := userzp+9 ; FIXME erase shell commands
36-
44+
3745
sta save_mode
3846
;PRINT str_starting
3947

40-
malloc 100,str_oom ; [,fail_value]
41-
sta ptr1
42-
sty ptr1+1
48+
malloc 100,ptr1,str_oom ; [,fail_value]
49+
4350

4451
lda save_mode
4552
cmp #NETWORK_ROM
@@ -84,9 +91,19 @@ save_mode := userzp+11 ; FIXME erase shell commands
8491
bne @read ; not null then start because we did not found a conf
8592
PRINT str_failed
8693
mfree(ptr1)
94+
95+
96+
97+
lda save_mode
98+
cmp #NETWORK_ROM
99+
bne @not_systemd_rom
100+
print str_path_network,NOSAVE
101+
jmp @not_found_str
102+
103+
@not_systemd_rom:
87104
print str_path_rom,NOSAVE
105+
@not_found_str:
88106
print str_not_found
89-
90107
rts
91108
@read:
92109
sta fd_systemd
@@ -149,7 +166,7 @@ save_mode := userzp+11 ; FIXME erase shell commands
149166
lda save_mode
150167
cmp #NETWORK_ROM
151168
bne @systemd_bank
152-
ldx #34 ; bank33
169+
ldx #34 ; bank34 Reserved for network
153170
jmp @loading_rom
154171

155172
@systemd_bank:
@@ -161,13 +178,11 @@ save_mode := userzp+11 ; FIXME erase shell commands
161178

162179
jsr run
163180

164-
; jsr _lsmem
181+
165182
mfree (routine_to_load)
166183

167184
rts
168185

169-
;jsr twil_copy_buffer_to_ram_bank
170-
; XMAINARGS
171186

172187
; if s, then start : load rom into ram
173188
; execute RAM
@@ -228,9 +243,6 @@ str_path_network:
228243
ora #%00100000
229244
sta TWILIGHTE_REGISTER
230245

231-
232-
233-
234246
ldx #$00
235247
ldy #$00
236248
@loop:
@@ -247,6 +259,11 @@ str_path_network:
247259
mfree (buffer)
248260
lda save_mode
249261
beq @firmware
262+
263+
264+
265+
@default:
266+
250267
jsr $c006 ; Twil form buffer
251268
lda #$00
252269
beq @out

src/shell.asm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1518,7 +1518,7 @@ str_max_malloc_reached:
15181518
.asciiz "Max number of malloc reached"
15191519

15201520
signature:
1521-
.asciiz "Shell v2021.4"
1521+
.asciiz "Shell v2021.4.1"
15221522
str_compile_time:
15231523
.byt __DATE__
15241524
.byt " "

src/shortcut.asm

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,19 @@
22
.define SHORTCUT_VECTOR $02
33

44
.proc _manage_shortcut
5-
65
cmp #'B'+$40
76
beq @start_shortcut
87
cmp #'L'+$40
8+
beq @start_shortcut
9+
cmp #'C'+$40
910
beq @start_shortcut
1011
cmp #'N'+$40
1112
beq @start_shortcut
1213
cmp #'T'+$40
1314
beq @start_shortcut
1415
cmp #'G'+$40
16+
beq @start_shortcut
17+
1518
bne @exit
1619
@start_shortcut:
1720
and #%01111111 ; Remove ctrl/fonct
@@ -89,7 +92,7 @@ shortcut_low:
8992
.byte $00 ; I
9093
.byte $00 ; J
9194
.byte $00 ; K
92-
.byte <twillauncher ; L
95+
.byte <twillaunchbank ; L
9396
.byte $00 ; M
9497
.byte <network_start ; N
9598
.byte $00 ; O
@@ -110,7 +113,7 @@ shortcut_high:
110113
.byte $00 ; I
111114
.byte $00 ; J
112115
.byte $00 ; K
113-
.byte >twillauncher ; L
116+
.byte >twillaunchbank ; L
114117
.byte $00 ; M
115118
.byte >network_start ; N
116119
.byte $00 ; O
@@ -142,3 +145,4 @@ shortcut_action_type:
142145
.byte SHORTCUT_VECTOR ; T
143146

144147
.endproc
148+

0 commit comments

Comments
 (0)