Merge remote-tracking branch 'origin/disasm'

This commit is contained in:
Joshua Bell 2019-04-12 10:07:08 -06:00
commit f4114b3900
2 changed files with 49 additions and 38 deletions

View File

@ -5094,9 +5094,9 @@ found_win:
jsr update_icon
lda icon_params2
ldx LE1F1
ldx window_icon_to_filerecord_list
dex
: cmp LE1F1+1,x
: cmp window_icon_to_filerecord_list+1,x
beq :+
dex
bpl :-
@ -5290,20 +5290,20 @@ L6C25: jsr push_pointers
lda window_to_dir_icon_table,x
;; BUG: What if dir icon is freed? ($FF)
ldx #0
L6C53: cmp LE1F1+1,x
L6C53: cmp window_icon_to_filerecord_list+1,x
beq L6C5F
inx
cpx LE1F1
cpx window_icon_to_filerecord_list
bne L6C53
rts
L6C5F: txa
asl a
tax
lda LE202,x
lda window_filerecord_table,x
sta LE71D
sta $06
lda LE202+1,x
lda window_filerecord_table+1,x
sta LE71D+1
sta $06+1
lda LCBANK2
@ -5867,14 +5867,14 @@ L7161: jsr warning_dialog_proc_num
record_ptr := $06
L7169: copy16 L485F, record_ptr
lda LE1F1
lda window_icon_to_filerecord_list
asl a
tax
copy16 record_ptr, LE202,x
ldx LE1F1
copy16 record_ptr, window_filerecord_table,x
ldx window_icon_to_filerecord_list
lda L72A7
sta LE1F1+1,x
inc LE1F1
sta window_icon_to_filerecord_list+1,x
inc window_icon_to_filerecord_list
lda L70C1
;; Store entry count
@ -6106,7 +6106,7 @@ get_vol_free_used:
.proc L7345
sta L7445
ldx #0
L734A: lda LE1F1+1,x
L734A: lda window_icon_to_filerecord_list+1,x
cmp L7445
beq :+
inx
@ -6117,28 +6117,28 @@ L734A: lda LE1F1+1,x
: stx L7446
dex
: inx
lda LE1F1+2,x
sta LE1F1+1,x
cpx LE1F1
lda window_icon_to_filerecord_list+2,x
sta window_icon_to_filerecord_list+1,x
cpx window_icon_to_filerecord_list
bne :-
dec LE1F1
dec window_icon_to_filerecord_list
lda L7446
cmp LE1F1
cmp window_icon_to_filerecord_list
bne :+
ldx L7446
asl a
tax
copy16 LE202,x, L485F
copy16 window_filerecord_table,x, L485F
rts
: lda L7446
asl a
tax
copy16 LE202,x, $06
copy16 window_filerecord_table,x, $06
inx
inx
copy16 LE202,x, $08
copy16 window_filerecord_table,x, $08
ldy #$00
jsr push_pointers
L73A5: lda LCBANK2
@ -6156,30 +6156,30 @@ L73A5: lda LCBANK2
cmp L485F
bne L73A5
jsr pop_pointers
lda LE1F1
lda window_icon_to_filerecord_list
asl a
tax
sub16 L485F, LE202,x, L7447
sub16 L485F, window_filerecord_table,x, L7447
inc L7446
L73ED: lda L7446
cmp LE1F1
cmp window_icon_to_filerecord_list
bne :+
jmp L7429
: lda L7446
asl a
tax
sub16 LE202+2,x, LE202,x, L7449
add16 LE200,x, L7449, LE202,x
sub16 window_filerecord_table+2,x, window_filerecord_table,x, L7449
add16 window_filerecord_table-2,x, L7449, window_filerecord_table,x
inc L7446
jmp L73ED
L7429: lda LE1F1
L7429: lda window_icon_to_filerecord_list
sec
sbc #$01
asl a
tax
add16 LE202,x, L7447, L485F
add16 window_filerecord_table,x, L7447, L485F
rts
L7445: .byte 0
@ -6494,9 +6494,9 @@ L7647: sta flag
bpl :-
lda icon_params2
ldx LE1F1
ldx window_icon_to_filerecord_list
dex
: cmp LE1F1+1,x
: cmp window_icon_to_filerecord_list+1,x
beq :+
dex
bpl :-
@ -6505,7 +6505,7 @@ L7647: sta flag
: txa
asl a
tax
copy16 LE202,x, $06
copy16 window_filerecord_table,x, $06
lda LCBANK2
lda LCBANK2
ldy #0
@ -7386,10 +7386,10 @@ start: ldx cached_window_id
;; BUG: What if dir icon is freed? ($FF)
ldx #0
: cmp LE1F1+1,x
: cmp window_icon_to_filerecord_list+1,x
beq found
inx
cpx LE1F1
cpx window_icon_to_filerecord_list
bne :-
rts
@ -7397,10 +7397,10 @@ found: txa
asl a
tax
lda LE202,x ; Ptr points at start of record
lda window_filerecord_table,x ; Ptr points at start of record
sta ptr
sta list_start_ptr
lda LE202+1,x
lda window_filerecord_table+1,x
sta ptr+1
sta list_start_ptr+1

View File

@ -988,11 +988,22 @@ device_to_icon_map:
open_dir_path_buf:
.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
.byte $00,$00,$00,$00,$7F,$64,$00,$1C ; ???
.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,$1E,$00,$32,$00,$1E,$00,$40
.byte $00