disasm: window icon/filerecord mapping

This commit is contained in:
Joshua Bell 2019-04-12 10:03:07 -06:00
parent 7cf6f9406c
commit 4c875790b0
3 changed files with 65 additions and 37 deletions

View File

@ -268,3 +268,19 @@ GLYPH_SAPPLE = $1E
;;; Check $1D ;;; Check $1D
;;; Control $01 ;;; Control $01
;;; Inactive $7F ;;; Inactive $7F
;;; ============================================================
;;; Internals - miscellaneous structures
.struct FileRecord
name .res 16
file_type .byte ; 16 $10
blocks .word ; 17 $11
creation_date .word ; 19 $13
creation_time .word ; 21 $15
modification_date .word ; 23 $17
modification_time .word ; 25 $19
access .byte ; 27 $1B
header_pointer .word ; 28 $1C
aux_type .word ; 30 $1E
.endstruct

View File

@ -5171,9 +5171,9 @@ found_win:
jsr reset_grafport3 jsr reset_grafport3
skip: lda icon_params2 skip: lda icon_params2
ldx LE1F1 ldx window_icon_to_filerecord_list
dex dex
: cmp LE1F1+1,x : cmp window_icon_to_filerecord_list+1,x
beq :+ beq :+
dex dex
bpl :- bpl :-
@ -5343,20 +5343,20 @@ L6C25: jsr push_pointers
dex dex
lda window_to_dir_icon_table,x lda window_to_dir_icon_table,x
ldx #$00 ldx #$00
L6C53: cmp LE1F1+1,x L6C53: cmp window_icon_to_filerecord_list+1,x
beq L6C5F beq L6C5F
inx inx
cpx LE1F1 cpx window_icon_to_filerecord_list
bne L6C53 bne L6C53
rts rts
L6C5F: txa L6C5F: txa
asl a asl a
tax tax
lda LE202,x lda window_filerecord_table,x
sta LE71D sta LE71D
sta $06 sta $06
lda LE202+1,x lda window_filerecord_table+1,x
sta LE71D+1 sta LE71D+1
sta $06+1 sta $06+1
lda LCBANK2 lda LCBANK2
@ -5941,14 +5941,14 @@ L7161: jsr warning_dialog_proc_num
record_ptr := $06 record_ptr := $06
L7169: copy16 L485F, record_ptr L7169: copy16 L485F, record_ptr
lda LE1F1 lda window_icon_to_filerecord_list
asl a asl a
tax tax
copy16 record_ptr, LE202,x copy16 record_ptr, window_filerecord_table,x
ldx LE1F1 ldx window_icon_to_filerecord_list
lda L72A7 lda L72A7
sta LE1F1+1,x sta window_icon_to_filerecord_list+1,x
inc LE1F1 inc window_icon_to_filerecord_list
lda L70C1 lda L70C1
;; Store entry count ;; Store entry count
@ -6159,7 +6159,7 @@ get_vol_free_used:
.proc L7345 .proc L7345
sta L7445 sta L7445
ldx #0 ldx #0
L734A: lda LE1F1+1,x L734A: lda window_icon_to_filerecord_list+1,x
cmp L7445 cmp L7445
beq :+ beq :+
inx inx
@ -6170,28 +6170,28 @@ L734A: lda LE1F1+1,x
: stx L7446 : stx L7446
dex dex
: inx : inx
lda LE1F1+2,x lda window_icon_to_filerecord_list+2,x
sta LE1F1+1,x sta window_icon_to_filerecord_list+1,x
cpx LE1F1 cpx window_icon_to_filerecord_list
bne :- bne :-
dec LE1F1 dec window_icon_to_filerecord_list
lda L7446 lda L7446
cmp LE1F1 cmp window_icon_to_filerecord_list
bne :+ bne :+
ldx L7446 ldx L7446
asl a asl a
tax tax
copy16 LE202,x, L485F copy16 window_filerecord_table,x, L485F
rts rts
: lda L7446 : lda L7446
asl a asl a
tax tax
copy16 LE202,x, $06 copy16 window_filerecord_table,x, $06
inx inx
inx inx
copy16 LE202,x, $08 copy16 window_filerecord_table,x, $08
ldy #$00 ldy #$00
jsr push_pointers jsr push_pointers
L73A5: lda LCBANK2 L73A5: lda LCBANK2
@ -6209,30 +6209,30 @@ L73A5: lda LCBANK2
cmp L485F cmp L485F
bne L73A5 bne L73A5
jsr pop_pointers jsr pop_pointers
lda LE1F1 lda window_icon_to_filerecord_list
asl a asl a
tax tax
sub16 L485F, LE202,x, L7447 sub16 L485F, window_filerecord_table,x, L7447
inc L7446 inc L7446
L73ED: lda L7446 L73ED: lda L7446
cmp LE1F1 cmp window_icon_to_filerecord_list
bne :+ bne :+
jmp L7429 jmp L7429
: lda L7446 : lda L7446
asl a asl a
tax tax
sub16 LE202+2,x, LE202,x, L7449 sub16 window_filerecord_table+2,x, window_filerecord_table,x, L7449
add16 LE200,x, L7449, LE202,x add16 window_filerecord_table-2,x, L7449, window_filerecord_table,x
inc L7446 inc L7446
jmp L73ED jmp L73ED
L7429: lda LE1F1 L7429: lda window_icon_to_filerecord_list
sec sec
sbc #$01 sbc #$01
asl a asl a
tax tax
add16 LE202,x, L7447, L485F add16 window_filerecord_table,x, L7447, L485F
rts rts
L7445: .byte 0 L7445: .byte 0
@ -6584,9 +6584,9 @@ L7647: sta flag
bpl :- bpl :-
lda icon_params2 lda icon_params2
ldx LE1F1 ldx window_icon_to_filerecord_list
dex dex
: cmp LE1F1+1,x : cmp window_icon_to_filerecord_list+1,x
beq :+ beq :+
dex dex
bpl :- bpl :-
@ -6595,7 +6595,7 @@ L7647: sta flag
: txa : txa
asl a asl a
tax tax
copy16 LE202,x, $06 copy16 window_filerecord_table,x, $06
lda LCBANK2 lda LCBANK2
lda LCBANK2 lda LCBANK2
ldy #0 ldy #0
@ -7379,10 +7379,10 @@ start: ldx cached_window_id
lda window_to_dir_icon_table,x lda window_to_dir_icon_table,x
ldx #0 ldx #0
: cmp LE1F1+1,x : cmp window_icon_to_filerecord_list+1,x
beq found beq found
inx inx
cpx LE1F1 cpx window_icon_to_filerecord_list
bne :- bne :-
rts rts
@ -7390,10 +7390,10 @@ found: txa
asl a asl a
tax tax
lda LE202,x ; Ptr points at start of record lda window_filerecord_table,x ; Ptr points at start of record
sta ptr sta ptr
sta list_start_ptr sta list_start_ptr
lda LE202+1,x lda window_filerecord_table+1,x
sta ptr+1 sta ptr+1
sta list_start_ptr+1 sta list_start_ptr+1

View File

@ -998,10 +998,22 @@ device_to_icon_map:
;;; Path buffer for open_directory logic ;;; Path buffer for open_directory logic
open_dir_path_buf: open_dir_path_buf:
.res 65, 0 .res 65, 0
LE1F1: .res 15, 0 ; length-prefixed string
LE200: .word 0
LE202: .res 24, 0 ; addr table
;;; Icon to window file record mapping list. First byte is number of
;;; entries, then each entry is an icon number. Position in the list
;;; is the same as position in the subsequent file record list.
window_icon_to_filerecord_list:
.res 9, 0 ; 8 entries + length
.res 6 ; Unused ???
LE200: .word 0 ; Unused ???
;;; Mapping from position in above table to FileRecord entry
window_filerecord_table:
.res 8*2
.res 8, 0 ; Unused ???
.byte $00,$00,$00,$00,$7F,$64,$00,$1C .byte $00,$00,$00,$00,$7F,$64,$00,$1C
.byte $00,$1E,$00,$32,$00,$1E,$00,$40 .byte $00,$1E,$00,$32,$00,$1E,$00,$40
.byte $00 .byte $00