Skip to content

Commit

Permalink
sh: Allow selecting disk 5
Browse files Browse the repository at this point in the history
  • Loading branch information
ry755 committed May 5, 2024
1 parent 2c2f017 commit 979617e
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions applications/sh/commands/disk.asm
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,29 @@ shell_disk_command:
; r0: disk ID

; check if it's in range
cmp r0, 4
cmp r0, 5
ifgt jmp shell_disk_command_out_of_range
ifnz jmp shell_disk_command_is_disk

call is_romdisk_available
ifnz ret
jmp shell_disk_command_is_romdisk
cmp r0, 4
ifz jmp shell_disk_command_is_romdisk

cmp r0, 5
ifz jmp shell_disk_command_is_ramdisk
shell_disk_command_is_disk:
; OR it with the IO port to get the current insert state of a disk
or r0, 0x80001000
in r1, r0
cmp r1, 0
ifz ret
shell_disk_command_is_romdisk:
; set the current disk ID
call set_current_disk_id

ret
shell_disk_command_is_romdisk:
call is_romdisk_available
ifz call set_current_disk_id
ret
shell_disk_command_is_ramdisk:
call is_ramdisk_formatted
ifz call set_current_disk_id
ret

shell_disk_command_out_of_range:
Expand Down

0 comments on commit 979617e

Please sign in to comment.