sh: Use the "current" disk id
This commit is contained in:
parent
31b19537c8
commit
ebbc2fa81e
|
@ -6,8 +6,9 @@ shell_dir_command:
|
||||||
mov r0, shell_dir_command_header_string
|
mov r0, shell_dir_command_header_string
|
||||||
call print_str_to_terminal
|
call print_str_to_terminal
|
||||||
|
|
||||||
|
call get_current_disk_id
|
||||||
|
mov r1, r0
|
||||||
mov r0, shell_dir_command_list_buffer
|
mov r0, shell_dir_command_list_buffer
|
||||||
movz.8 r1, [shell_current_disk]
|
|
||||||
call ryfs_get_file_list
|
call ryfs_get_file_list
|
||||||
cmp r0, 0
|
cmp r0, 0
|
||||||
ifz ret
|
ifz ret
|
||||||
|
@ -52,9 +53,10 @@ shell_dir_command_loop:
|
||||||
call print_character_to_terminal
|
call print_character_to_terminal
|
||||||
|
|
||||||
; get and print the file size
|
; get and print the file size
|
||||||
|
call get_current_disk_id
|
||||||
|
mov r1, r0
|
||||||
mov r0, shell_dir_command_list_buffer
|
mov r0, shell_dir_command_list_buffer
|
||||||
add r0, r3
|
add r0, r3
|
||||||
movz.8 r1, [shell_current_disk]
|
|
||||||
mov r2, shell_dir_command_temp_file_struct
|
mov r2, shell_dir_command_temp_file_struct
|
||||||
call open
|
call open
|
||||||
cmp r0, 0
|
cmp r0, 0
|
||||||
|
|
|
@ -10,17 +10,22 @@ shell_disk_command:
|
||||||
; r0: disk ID
|
; r0: disk ID
|
||||||
|
|
||||||
; check if it's in range
|
; check if it's in range
|
||||||
cmp r0, 3
|
cmp r0, 4
|
||||||
ifgt jmp shell_disk_command_out_of_range
|
ifgt jmp shell_disk_command_out_of_range
|
||||||
|
ifz jmp shell_disk_command_is_disk
|
||||||
|
|
||||||
|
call is_romdisk_available
|
||||||
|
ifnz ret
|
||||||
|
jmp shell_disk_command_is_romdisk
|
||||||
|
shell_disk_command_is_disk:
|
||||||
; OR it with the IO port to get the current insert state of a disk
|
; OR it with the IO port to get the current insert state of a disk
|
||||||
or r0, 0x80001000
|
or r0, 0x80001000
|
||||||
in r1, r0
|
in r1, r0
|
||||||
cmp r1, 0
|
cmp r1, 0
|
||||||
ifz ret
|
ifz ret
|
||||||
|
shell_disk_command_is_romdisk:
|
||||||
; set the current disk ID
|
; set the current disk ID
|
||||||
mov.8 [shell_current_disk], r0
|
call set_current_disk_id
|
||||||
|
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
|
@ -31,8 +31,9 @@ shell_type_command:
|
||||||
mov.8 [r1], 0
|
mov.8 [r1], 0
|
||||||
|
|
||||||
; open the file
|
; open the file
|
||||||
|
call get_current_disk_id
|
||||||
|
mov r1, r0
|
||||||
mov r0, shell_type_command_file
|
mov r0, shell_type_command_file
|
||||||
movz.8 r1, [shell_current_disk]
|
|
||||||
mov r2, shell_type_command_file_struct
|
mov r2, shell_type_command_file_struct
|
||||||
call open
|
call open
|
||||||
cmp r0, 0
|
cmp r0, 0
|
||||||
|
|
|
@ -35,8 +35,9 @@ launch_fxf_name_loop:
|
||||||
loop launch_fxf_name_loop
|
loop launch_fxf_name_loop
|
||||||
launch_fxf_name_loop_done:
|
launch_fxf_name_loop_done:
|
||||||
; open the file
|
; open the file
|
||||||
|
call get_current_disk_id
|
||||||
|
mov r1, r0
|
||||||
mov r0, launch_fxf_name
|
mov r0, launch_fxf_name
|
||||||
movz.8 r1, [shell_current_disk]
|
|
||||||
mov r2, launch_fxf_struct
|
mov r2, launch_fxf_struct
|
||||||
call open
|
call open
|
||||||
cmp r0, 0
|
cmp r0, 0
|
||||||
|
|
|
@ -95,7 +95,7 @@ shell_key_down_backspace:
|
||||||
ret
|
ret
|
||||||
|
|
||||||
shell_print_prompt:
|
shell_print_prompt:
|
||||||
movz.8 r0, [shell_current_disk]
|
call get_current_disk_id
|
||||||
add r0, '0'
|
add r0, '0'
|
||||||
call print_character_to_terminal
|
call print_character_to_terminal
|
||||||
mov r0, shell_prompt
|
mov r0, shell_prompt
|
||||||
|
@ -309,8 +309,6 @@ shell_text_buf_top:
|
||||||
shell_text_buf_ptr: data.32 0 ; pointer to the current input character
|
shell_text_buf_ptr: data.32 0 ; pointer to the current input character
|
||||||
shell_args_ptr: data.32 0 ; pointer to the beginning of the command arguments
|
shell_args_ptr: data.32 0 ; pointer to the beginning of the command arguments
|
||||||
|
|
||||||
shell_current_disk: data.8 0
|
|
||||||
|
|
||||||
shell_prompt: data.str "> " data.8 CURSOR data.8 0
|
shell_prompt: data.str "> " data.8 CURSOR data.8 0
|
||||||
|
|
||||||
shell_terminal_stream_struct_ptr: data.32 0
|
shell_terminal_stream_struct_ptr: data.32 0
|
||||||
|
|
Loading…
Reference in New Issue
Block a user