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: 3 additions & 1 deletion src/arch/kim-1/cpmfs/imu.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Image Manipulation Utility
==========================

Usage: imu [/L]
Usage: imu [{/L | /S}]
imu /M <drive> <image> [/O]
imu /U <drive>
imu /N <image> [/P]
Expand All @@ -15,6 +15,8 @@ Options

/L - Lists the available disk images on the SD card.

/S - Saves the current mounts to the SD card config file.

/M <drive> <image> [/O]
- Mounts <image> into <drive>. Option /O makes it read-only.

Expand Down
1 change: 1 addition & 0 deletions src/arch/kim-1/k-1013.inc
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ EXT_CMD_CPY = 0b00011000
EXT_CMD_MOV = 0b00011100
EXT_CMD_MNT = 0b00100000
EXT_CMD_UMNT = 0b00100100
EXT_CMD_SAV = 0b00101000

ST4_UNSUPPORTED = 0b10000000
ST4_ABNORMAL_TERM = 0b01000000
Expand Down
35 changes: 26 additions & 9 deletions src/arch/kim-1/utils/imu-k1013.S
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ zproc unmount_drive

; Dig further for errors

lda disk_status ; Check for success
and #ST4_ABNORMAL_TERM
zif ne
lda disk_status+1
Expand All @@ -314,13 +315,29 @@ zproc unmount_drive
jmp inf_done
zendproc

; Update config to flash. Not yet supported
; Update the SD config file with the latest mounted drives
; situation. Issues warning if the file could not be
; updated.
;
zproc save_config
lda #<unknown_msg
ldy #>unknown_msg
jsr err_withchar
jmp err_usage

ldy #EXT_CMD_SAV
jsr fdc_exec_extended ; Exec SD mounts config save
zif cs
lda #<fdc_msg
ldx #>fdc_msg
jmp err_withmsg ; Controller error
zendif

lda disk_status ; Check for success
and #ST4_ABNORMAL_TERM
zif ne
lda #<config_msg
ldx #>config_msg
jmp err_withmsg
zendif

jmp inf_done
zendproc

; Create an empty image on the SD card.
Expand Down Expand Up @@ -376,7 +393,7 @@ zproc create_image

; Set buffer for sending mount info

lda #BUFFER_DMA
lda #DMA_AREA
sta ADMA

; Prepare the command data
Expand Down Expand Up @@ -425,7 +442,7 @@ zproc create_image
zendif
; If we are here, there was an unexpected error
lda #<generic_msg
ldy #>generic_msg
ldx #>generic_msg
jmp err_withmsg
zendif

Expand Down Expand Up @@ -493,7 +510,7 @@ zproc delete_file
zendif
; If we are here, there was an unexpected error
lda #<generic_msg
ldy #>generic_msg
ldx #>generic_msg
jmp err_withmsg
zendif

Expand Down Expand Up @@ -741,7 +758,7 @@ disk_status: .fill 8 ; Result phase readouts from NEC-765

.global usage_msg

usage_msg: .ascii "Usage: imu [/L]\r\n"
usage_msg: .ascii "Usage: imu [{/L | /S}]\r\n"
.ascii " imu /M <drive> [/O]\r\n"
.ascii " imu /U <drive>\r\n"
.ascii " imu /N <image> [/P]\r\n"
Expand Down
3 changes: 0 additions & 3 deletions src/arch/kim-1/utils/imu-sdshield.S
Original file line number Diff line number Diff line change
Expand Up @@ -609,8 +609,5 @@ imagerr_msg: .ascii "Image name must be in 8.3 format.\r\n"
disabled_msg: .ascii "Disabled by hardware. Please flip option switch 2.\r\n"
.byte 0

config_msg: .ascii "Can't update the SD config file.\r\n"
.byte 0

working_msg: .ascii "On it. May take a while...\r\n"
.byte 0
4 changes: 4 additions & 0 deletions src/arch/kim-1/utils/imu.S
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,7 @@ zendproc

.global unknown_msg, invalid_msg, mounterr_msg, mountederr_msg
.global unmnterr_msg, notmntederr_msg, generic_msg, exists_msg
.global config_msg

error_msg: .ascii "Error: "
.byte 0
Expand Down Expand Up @@ -531,6 +532,9 @@ imgmounted_msg: .ascii "Error: Image file '"
imgmounted_msg2:.ascii "' already mounted.\r\n"
.byte 0

config_msg: .ascii "Can't update the SD config file.\r\n"
.byte 0

warning_msg: .ascii "Warning: About to delete file '"
.byte 0
warning_msg2: .ascii "'.\r\n"
Expand Down
Loading