DeskTop disasm: volume enumeration

This commit is contained in:
Joshua Bell 2018-11-23 23:03:11 -08:00
parent a90ef2226c
commit 418cd09cd6
2 changed files with 27 additions and 23 deletions

View File

@ -3127,11 +3127,11 @@ L594A: ldy L599E
sta devlst_copy,y sta devlst_copy,y
lda DEVLST,y lda DEVLST,y
jsr create_volume_icon jsr create_volume_icon
cmp #$57 cmp #ERR_DUPLICATE_VOLUME
bne L5967 bne :+
lda #$F9 ; "... 2 volumes with the same name..." lda #$F9 ; "... 2 volumes with the same name..."
sta pending_alert sta pending_alert
L5967: inc L599E : inc L599E
lda L599E lda L599E
cmp DEVCNT cmp DEVCNT
beq L594A beq L594A
@ -14208,8 +14208,10 @@ trash_name: PASCAL_STRING " Trash "
;;; ============================================================ ;;; ============================================================
;; create volume icons??? ;;; This removes particular devices from the device list.
.proc init_volumes ;;; TODO: Figure out what/why ???
.proc filter_volumes
ptr := $06 ptr := $06
lda DEVCNT lda DEVCNT
@ -14469,12 +14471,12 @@ dx: .word 0
;; Does the directory exist? ;; Does the directory exist?
MLI_RELAY_CALL GET_FILE_INFO, get_file_info_params MLI_RELAY_CALL GET_FILE_INFO, get_file_info_params
beq :+ beq :+
jmp L0D0A jmp populate_volume_icons
: lda get_file_info_type : lda get_file_info_type
cmp #FT_DIRECTORY cmp #FT_DIRECTORY
beq open_dir beq open_dir
jmp L0D0A jmp populate_volume_icons
open_dir: open_dir:
MLI_RELAY_CALL OPEN, open_params MLI_RELAY_CALL OPEN, open_params
@ -14600,7 +14602,7 @@ next_entry:
close_dir: close_dir:
MLI_RELAY_CALL CLOSE, close_params MLI_RELAY_CALL CLOSE, close_params
jmp L0D0A jmp populate_volume_icons
DEFINE_OPEN_PARAMS open_params, str_desk_acc, $1000 DEFINE_OPEN_PARAMS open_params, str_desk_acc, $1000
open_ref_num := open_params::ref_num open_ref_num := open_params::ref_num
@ -14630,15 +14632,17 @@ ptr_calc_hi: .byte 0
;;; ============================================================ ;;; ============================================================
.proc L0D0A ;;; TODO: Dedupe with cmd_check_drives
.proc populate_volume_icons
ldy #0 ldy #0
sty desktop_main::pending_alert sty desktop_main::pending_alert
sty L0E33 sty volume_num
L0D12: lda L0E33 L0D12: lda volume_num
asl a asl a
tay tay
copy16 slot_drive_string_table,y, $08 copy16 slot_drive_string_table,y, $08
ldy L0E33 ldy volume_num
lda DEVLST,y lda DEVLST,y
pha pha
txa txa
@ -14660,19 +14664,18 @@ L0D12: lda L0E33
lda L0E34 lda L0E34
cmp #$28 cmp #$28
bne L0D64 bne L0D64
ldy L0E33 ldy volume_num
lda DEVLST,y lda DEVLST,y
and #$0F and #$0F
beq L0D6D beq ok
ldx L0E33 ldx volume_num
jsr remove_device jsr remove_device
jmp L0E25 jmp next
L0D64: cmp #ERR_DUPLICATE_VOLUME
L0D64: cmp #$57 bne ok
bne L0D6D
lda #$F9 ; "... 2 volumes with the same name..." lda #$F9 ; "... 2 volumes with the same name..."
sta desktop_main::pending_alert sta desktop_main::pending_alert
L0D6D: pla ok: pla
pha pha
and #$0F and #$0F
sta L0E32 sta L0E32
@ -14770,15 +14773,15 @@ L0E1C: ldy #$11
pla pla
L0E1F: sta ($08),y L0E1F: sta ($08),y
L0E21: pla L0E21: pla
inc L0E33 inc volume_num
L0E25: lda L0E33 next: lda volume_num
cmp DEVCNT cmp DEVCNT
beq L0E2F beq L0E2F
bcs populate_startup_menu bcs populate_startup_menu
L0E2F: jmp L0D12 L0E2F: jmp L0D12
L0E32: .byte 0 L0E32: .byte 0
L0E33: .byte 0 volume_num: .byte 0
L0E34: .byte 0 L0E34: .byte 0
.endproc .endproc

View File

@ -124,6 +124,7 @@ ERR_OVERRUN_ERROR := $48
ERR_VOLUME_DIR_FULL := $49 ERR_VOLUME_DIR_FULL := $49
ERR_END_OF_FILE := $4C ERR_END_OF_FILE := $4C
ERR_ACCESS_ERROR := $4E ERR_ACCESS_ERROR := $4E
ERR_DUPLICATE_VOLUME := $57
;;; ============================================================ ;;; ============================================================
;;; Directory Structures ;;; Directory Structures