Common Overlay disasm

This commit is contained in:
Joshua Bell 2018-11-23 09:50:47 -08:00
parent 5f7584d8d5
commit 038eb4b7eb
5 changed files with 137 additions and 127 deletions

View File

@ -709,7 +709,7 @@ picker_entry_pos:
str_folder: str_folder:
PASCAL_STRING {GLYPH_FOLDERL,GLYPH_FOLDERR} PASCAL_STRING {GLYPH_FOLDERL,GLYPH_FOLDERR}
.byte $00,$00 LD920: .byte $00,$00
pos_D922: pos_D922:
DEFINE_POINT 343,40 DEFINE_POINT 343,40
@ -756,8 +756,8 @@ rect_D97E:
rect_D986: rect_D986:
DEFINE_RECT 346,92,480,99 DEFINE_RECT 346,92,480,99
rect_D98E: rect_scratch:
DEFINE_RECT 0,0,0,0 DEFINE_RECT 0,0,0,0, rect_scratch
.byte $00,$00,$00,$00,$00,$00,$00,$00 .byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00 .byte $00,$00,$00,$00,$00,$00,$00,$00

View File

@ -861,6 +861,7 @@ params: .addr 0
;;; ============================================================ ;;; ============================================================
just_rts:
L59B8: rts L59B8: rts
;;; ============================================================ ;;; ============================================================
@ -2121,7 +2122,7 @@ L658B: cmp #$09
sbc #$08 sbc #$08
rts rts
lda winfo_entrydlg L6593: lda winfo_entrydlg
jsr set_port_for_window jsr set_port_for_window
jsr L6E45 jsr L6E45
stax $06 stax $06
@ -2143,7 +2144,7 @@ L65D6: copy16 #$D8EF, $06
jsr L56E3 jsr L56E3
rts rts
lda winfo_entrydlg L65F0: lda winfo_entrydlg
jsr set_port_for_window jsr set_port_for_window
jsr L6E72 jsr L6E72
stax $06 stax $06
@ -2166,7 +2167,7 @@ L6634: copy16 #$D8EF, $06
jsr L56E3 jsr L56E3
rts rts
lda winfo_entrydlg L664E: lda winfo_entrydlg
jsr set_port_for_window jsr set_port_for_window
MGTK_RELAY_CALL MGTK::PaintRect, common_input1_rect MGTK_RELAY_CALL MGTK::PaintRect, common_input1_rect
MGTK_RELAY_CALL MGTK::SetPenMode, penXOR MGTK_RELAY_CALL MGTK::SetPenMode, penXOR
@ -2194,7 +2195,7 @@ L66C9: addr_call draw_string, path_buf2
addr_call draw_string, str_2_spaces addr_call draw_string, str_2_spaces
rts rts
lda winfo_entrydlg L66D8: lda winfo_entrydlg
sta screentowindow_window_id sta screentowindow_window_id
MGTK_RELAY_CALL MGTK::ScreenToWindow, screentowindow_params MGTK_RELAY_CALL MGTK::ScreenToWindow, screentowindow_params
lda winfo_entrydlg lda winfo_entrydlg
@ -2322,7 +2323,7 @@ L6846: jsr jt_03
rts rts
L684D: .word 0 L684D: .word 0
lda winfo_entrydlg L684F: lda winfo_entrydlg
sta screentowindow_window_id sta screentowindow_window_id
MGTK_RELAY_CALL MGTK::ScreenToWindow, screentowindow_params MGTK_RELAY_CALL MGTK::ScreenToWindow, screentowindow_params
lda winfo_entrydlg lda winfo_entrydlg
@ -2450,7 +2451,7 @@ L69BD: jsr jt_03
rts rts
L69C4: .word 0 L69C4: .word 0
sta L6A17 L69C6: sta L6A17
lda path_buf0 lda path_buf0
clc clc
adc path_buf2 adc path_buf2
@ -2476,7 +2477,7 @@ L69D5: lda L6A17
rts rts
L6A17: .byte 0 L6A17: .byte 0
lda path_buf0 L6A18: lda path_buf0
bne L6A1E bne L6A1E
rts rts
@ -2492,7 +2493,7 @@ L6A1E: dec path_buf0
jsr L6EA3 jsr L6EA3
rts rts
lda path_buf0 L6A53: lda path_buf0
bne L6A59 bne L6A59
rts rts
@ -2520,7 +2521,7 @@ L6A6B: ldx path_buf0
jsr L6EA3 jsr L6EA3
rts rts
lda path_buf2 L6AAC: lda path_buf2
cmp #$02 cmp #$02
bcs L6AB4 bcs L6AB4
rts rts
@ -2600,7 +2601,7 @@ L6B51: inx
jsr L6EA3 jsr L6EA3
rts rts
sta L6BC3 L6B72: sta L6BC3
lda path_buf1 lda path_buf1
clc clc
adc path_buf2 adc path_buf2
@ -2626,7 +2627,7 @@ L6B81: lda L6BC3
rts rts
L6BC3: .byte 0 L6BC3: .byte 0
lda path_buf1 L6BC4: lda path_buf1
bne L6BCA bne L6BCA
rts rts
@ -2642,7 +2643,7 @@ L6BCA: dec path_buf1
jsr L6E9F jsr L6E9F
rts rts
lda path_buf1 L6BFF: lda path_buf1
bne L6C05 bne L6C05
rts rts
@ -2670,7 +2671,7 @@ L6C17: ldx path_buf1
jsr L6E9F jsr L6E9F
rts rts
lda path_buf2 L6C58: lda path_buf2
cmp #$02 cmp #$02
bcs L6C60 bcs L6C60
rts rts
@ -2828,17 +2829,17 @@ L6DB0: ldx path_buf1
bne L6DB0 bne L6DB0
L6DC1: rts L6DC1: rts
jsr L6D9E L6DC2: jsr L6D9E
jsr jt_03 jsr jt_03
rts rts
jsr L6DB0 L6DC9: jsr L6DB0
jsr jt_03 jsr jt_03
rts rts
lda #$00 L6DD0: lda #$00
beq L6DD6 beq L6DD6
lda #$80 L6DD4: lda #$80
L6DD6: sta L6E1C L6DD6: sta L6E1C
copy16 #$1800, $06 copy16 #$1800, $06
ldx $D920 ldx $D920
@ -2872,7 +2873,7 @@ L6E17: jsr jt_03
L6E1B: .byte 0 L6E1B: .byte 0
L6E1C: .byte 0 L6E1C: .byte 0
ldx path_buf L6E1D: ldx path_buf
L6E20: lda path_buf,x L6E20: lda path_buf,x
sta path_buf0,x sta path_buf0,x
dex dex
@ -2880,11 +2881,11 @@ L6E20: lda path_buf,x
addr_call adjust_filename_case, path_buf0 addr_call adjust_filename_case, path_buf0
rts rts
ldx path_buf L6E31: ldx path_buf
L6E34: lda path_buf,x : lda path_buf,x
sta path_buf1,x sta path_buf1,x
dex dex
bpl L6E34 bpl :-
addr_call adjust_filename_case, path_buf1 addr_call adjust_filename_case, path_buf1
rts rts

View File

@ -104,7 +104,7 @@ L70F1: lda #1
bpl :- bpl :-
lda #$80 lda #$80
sta $50A8 sta common_overlay::L50A8
sta $51AE sta $51AE
lda $D920 lda $D920
sta $D921 sta $D921
@ -116,8 +116,8 @@ L70F1: lda #1
jsr common_overlay::L61B1 jsr common_overlay::L61B1
jsr common_overlay::L606D jsr common_overlay::L606D
ldx $5028 ldx common_overlay::path_buf
L7137: lda $5028,x L7137: lda common_overlay::path_buf,x
sta path_buf1,x sta path_buf1,x
dex dex
bpl L7137 bpl L7137
@ -167,7 +167,7 @@ L7198: addr_call common_overlay::L647C, path_buf1
MGTK_RELAY_CALL MGTK::CloseWindow, winfo_entrydlg_file_picker MGTK_RELAY_CALL MGTK::CloseWindow, winfo_entrydlg_file_picker
MGTK_RELAY_CALL MGTK::CloseWindow, winfo_entrydlg MGTK_RELAY_CALL MGTK::CloseWindow, winfo_entrydlg
lda #0 lda #0
sta $50A8 sta common_overlay::L50A8
lda #0 lda #0
sta $D8EC sta $D8EC
jsr common_overlay::set_cursor_pointer jsr common_overlay::set_cursor_pointer
@ -211,7 +211,7 @@ L7209: lda jump_table_entries+1,x
lda #$06 lda #$06
sta path_buf2+1 sta path_buf2+1
lda #$00 lda #$00
sta $50A8 sta common_overlay::L50A8
lda #$FF lda #$FF
sta $D920 sta $D920
lda #$00 lda #$00
@ -223,7 +223,7 @@ L7209: lda jump_table_entries+1,x
ldx path_buf0 ldx path_buf0
: lda path_buf0,x : lda path_buf0,x
sta $5028,x sta common_overlay::path_buf,x
dex dex
bpl :- bpl :-
@ -240,7 +240,7 @@ L7209: lda jump_table_entries+1,x
jsr common_overlay::jt_03 jsr common_overlay::jt_03
jmp L7295 jmp L7295
L726D: lda $5028 L726D: lda common_overlay::path_buf
bne L7281 bne L7281
L7272: jsr common_overlay::device_on_line L7272: jsr common_overlay::device_on_line
lda #$00 lda #$00

View File

@ -16,7 +16,7 @@ L7000: stx L73A9
addr_call common_overlay::adjust_filename_case, path_buf0 addr_call common_overlay::adjust_filename_case, path_buf0
ldy path_buf0 ldy path_buf0
L7021: lda path_buf0,y L7021: lda path_buf0,y
sta $5028,y sta common_overlay::path_buf,y
dey dey
bpl L7021 bpl L7021
jsr common_overlay::L5F49 jsr common_overlay::L5F49
@ -42,8 +42,8 @@ L7046: iny
L7056: jsr common_overlay::L5F5B L7056: jsr common_overlay::L5F5B
lda #$00 lda #$00
bcs L706A bcs L706A
addr_call common_overlay::L6516, $709D addr_call common_overlay::L6516, L709D
sta $D920 sta LD920
jsr common_overlay::L6586 jsr common_overlay::L6586
L706A: jsr common_overlay::L6163 L706A: jsr common_overlay::L6163
jsr common_overlay::L61B1 jsr common_overlay::L61B1
@ -56,7 +56,7 @@ L707B: copy16 #$2001, path_buf2
jsr common_overlay::L6693 jsr common_overlay::L6693
copy16 #$2001, path_buf2 copy16 #$2001, path_buf2
lda #$FF lda #$FF
sta $D8EC sta LD8EC
jmp common_overlay::L5106 jmp common_overlay::L5106
;;; ============================================================ ;;; ============================================================
@ -76,9 +76,9 @@ L70B0: lda jump_table_entries+1,x
dex dex
bpl L70B0 bpl L70B0
lda #$00 lda #$00
sta $51AE sta common_overlay::L51AE
lda #$80 lda #$80
sta $5104 sta common_overlay::L5104
copy16 #$0601, path_buf2 copy16 #$0601, path_buf2
lda winfo_entrydlg lda winfo_entrydlg
jsr common_overlay::set_port_for_window jsr common_overlay::set_port_for_window
@ -87,15 +87,9 @@ L70B0: lda jump_table_entries+1,x
lda L73AA lda L73AA
jsr L747B jsr L747B
lda #$80 lda #$80
sta $5103 sta common_overlay::L5103
lda #$AB copy16 #L73AB, common_overlay::L531B+1
sta $531C copy16 #L74F4, common_overlay::L59B9::key_meta_digit+1
lda #$73
sta $531D
lda #$F4
sta $5B24
lda #$74
sta $5B25
rts rts
L7101: lda winfo_entrydlg L7101: lda winfo_entrydlg
@ -141,57 +135,57 @@ L711D: addr_call common_overlay::L5E6F, enter_the_full_pathname_label2
.byte $00 .byte $00
jump_table_entries: .byte $29 jump_table_entries: .byte $29
jump_table_entry $725D jump_table_entry L725D
jump_table_entry $732F jump_table_entry L732F
jump_table_entry $6593 jump_table_entry common_overlay::L6593
jump_table_entry $664E jump_table_entry common_overlay::L664E
jump_table_entry $6DC2 jump_table_entry common_overlay::L6DC2
jump_table_entry $6DD0 jump_table_entry common_overlay::L6DD0
jump_table_entry $6E1D jump_table_entry common_overlay::L6E1D
jump_table_entry $69C6 jump_table_entry common_overlay::L69C6
jump_table_entry $6A18 jump_table_entry common_overlay::L6A18
jump_table_entry $6A53 jump_table_entry common_overlay::L6A53
jump_table_entry $6AAC jump_table_entry common_overlay::L6AAC
jump_table_entry $6B01 jump_table_entry common_overlay::L6B01
jump_table_entry $6B44 jump_table_entry common_overlay::L6B44
jump_table_entry $66D8 jump_table_entry common_overlay::L66D8
jump_table2_entries: .byte $29 jump_table2_entries: .byte $29
jump_table_entry $72CD jump_table_entry L72CD
jump_table_entry $736C jump_table_entry L736C
jump_table_entry $65F0 jump_table_entry common_overlay::L65F0
jump_table_entry $6693 jump_table_entry common_overlay::L6693
jump_table_entry $6DC9 jump_table_entry common_overlay::L6DC9
jump_table_entry $6DD4 jump_table_entry common_overlay::L6DD4
jump_table_entry $6E31 jump_table_entry common_overlay::L6E31
jump_table_entry $6B72 jump_table_entry common_overlay::L6B72
jump_table_entry $6BC4 jump_table_entry common_overlay::L6BC4
jump_table_entry $6BFF jump_table_entry common_overlay::L6BFF
jump_table_entry $6C58 jump_table_entry common_overlay::L6C58
jump_table_entry $6CAD jump_table_entry common_overlay::L6CAD
jump_table_entry $6CF0 jump_table_entry common_overlay::L6CF0
jump_table_entry $684F jump_table_entry common_overlay::L684F
;;; ============================================================ ;;; ============================================================
copy16 #$2001, path_buf2 L725D: copy16 #$2001, path_buf2
jsr common_overlay::jt_03 jsr common_overlay::jt_03
ldx jump_table2_entries ldx jump_table2_entries
L726D: lda jump_table2_entries+1,x L726D: lda jump_table2_entries+1,x
sta $6D1E,x sta common_overlay::jump_table,x
dex dex
lda jump_table2_entries+1,x lda jump_table2_entries+1,x
sta $6D1E,x sta common_overlay::jump_table,x
dex dex
dex dex
bpl L726D bpl L726D
lda #$80 lda #$80
sta $51AE sta common_overlay::L51AE
sta $5105 sta common_overlay::L5105
lda $D8F0 lda LD8F0
sta $D8F1 sta LD8F1
lda #$00 lda #$00
sta $D8F0 sta LD8F0
lda path_buf1 lda path_buf1
bne L72BF bne L72BF
lda #$00 lda #$00
@ -217,7 +211,7 @@ L72BF: copy16 #$0601, path_buf2
jsr common_overlay::jt_03 jsr common_overlay::jt_03
rts rts
addr_call common_overlay::L647C, path_buf0 L72CD: addr_call common_overlay::L647C, path_buf0
bne L72E2 bne L72E2
lda path_buf1 lda path_buf1
beq L72E7 beq L72E7
@ -237,51 +231,51 @@ L72EE: MGTK_RELAY_CALL MGTK::InitPort, grafport3
MGTK_RELAY_CALL MGTK::SetPort, grafport3 MGTK_RELAY_CALL MGTK::SetPort, grafport3
MGTK_RELAY_CALL MGTK::CloseWindow, winfo_entrydlg_file_picker MGTK_RELAY_CALL MGTK::CloseWindow, winfo_entrydlg_file_picker
MGTK_RELAY_CALL MGTK::CloseWindow, winfo_entrydlg MGTK_RELAY_CALL MGTK::CloseWindow, winfo_entrydlg
sta $D8EC sta LD8EC
jsr common_overlay::set_cursor_pointer jsr common_overlay::set_cursor_pointer
copy16 #$59B8, $5B24 copy16 #common_overlay::just_rts, common_overlay::L59B9::key_meta_digit+1
ldx $50AA ldx common_overlay::stash_stack
txs txs
ldx L73A9 ldx L73A9
ldy L73AA ldy L73AA
return #$00 return #$00
MGTK_RELAY_CALL MGTK::InitPort, grafport3 L732F: MGTK_RELAY_CALL MGTK::InitPort, grafport3
MGTK_RELAY_CALL MGTK::SetPort, grafport3 MGTK_RELAY_CALL MGTK::SetPort, grafport3
MGTK_RELAY_CALL MGTK::CloseWindow, winfo_entrydlg_file_picker MGTK_RELAY_CALL MGTK::CloseWindow, winfo_entrydlg_file_picker
MGTK_RELAY_CALL MGTK::CloseWindow, winfo_entrydlg MGTK_RELAY_CALL MGTK::CloseWindow, winfo_entrydlg
lda #$00 lda #$00
sta $D8EC sta LD8EC
jsr common_overlay::set_cursor_pointer jsr common_overlay::set_cursor_pointer
copy16 #$59B8, $5B24 copy16 #common_overlay::just_rts, common_overlay::L59B9::key_meta_digit+1
ldx $50AA ldx common_overlay::stash_stack
txs txs
return #$FF return #$FF
copy16 #$2001, path_buf2 L736C: copy16 #$2001, path_buf2
jsr common_overlay::jt_03 jsr common_overlay::jt_03
ldx jump_table_entries ldx jump_table_entries
L737C: lda jump_table_entries+1,x L737C: lda jump_table_entries+1,x
sta $6D1E,x sta common_overlay::jump_table,x
dex dex
lda jump_table_entries+1,x lda jump_table_entries+1,x
sta $6D1E,x sta common_overlay::jump_table,x
dex dex
dex dex
bpl L737C bpl L737C
copy16 #$0601, path_buf2 copy16 #$0601, path_buf2
jsr common_overlay::jt_03 jsr common_overlay::jt_03
lda #$00 lda #$00
sta $5105 sta common_overlay::L5105
sta $51AE sta common_overlay::L51AE
lda $D8F1 lda LD8F1
sta $D8F0 sta LD8F0
rts rts
L73A9: .byte 0 L73A9: .byte 0
L73AA: .byte 0 L73AA: .byte 0
MGTK_RELAY_CALL MGTK::InRect, rect_D966 L73AB: MGTK_RELAY_CALL MGTK::InRect, rect_D966
cmp #MGTK::inrect_inside cmp #MGTK::inrect_inside
bne :+ bne :+
jmp L73FE jmp L73FE
@ -350,58 +344,73 @@ L7464: return #$FF
L7467: cmp #1 L7467: cmp #1
bne L7473 bne L7473
addr_call L749B, $D93E addr_call draw_inset_rect, rect_D93E
rts rts
L7473: addr_call L749B, $D946 L7473: addr_call draw_inset_rect, rect_D946
rts rts
L747B: cmp #1 L747B: cmp #1
bne L7487 bne L7487
addr_call L749B, $D94E addr_call draw_inset_rect, rect_D94E
rts rts
L7487: cmp #2 L7487: cmp #2
bne L7493 bne L7493
addr_call L749B, $D956 addr_call draw_inset_rect, rect_D956
rts rts
L7493: addr_call L749B, $D95E L7493: addr_call draw_inset_rect, rect_D95E
rts rts
L749B: stax $06 ;;; ============================================================
ldy #7 ;;; Draw rect inset by 2px. Pointer to Rect in A,X.
L74A1: lda ($06),y
sta rect_D98E,y .proc draw_inset_rect
ptr := $06
;; Copy to scratch rect
stax ptr
ldy #.sizeof(MGTK::Rect)-1
: lda (ptr),y
sta rect_scratch,y
dey dey
bpl L74A1 bpl :-
lda rect_D98E
lda rect_scratch::x1
clc clc
adc #2 adc #2
sta rect_D98E sta rect_scratch::x1
bcc L74B7 bcc :+
inc $D98F inc rect_scratch::x1+1
L74B7: lda $D990
: lda rect_scratch::y1
clc clc
adc #2 adc #2
sta $D990 sta rect_scratch::y1
bcc L74C5 bcc :+
inc $D991 inc rect_scratch::y1+1
L74C5: lda $D992
: lda rect_scratch::x2
sec sec
sbc #2 sbc #2
sta $D992 sta rect_scratch::x2
bcs L74D3 bcs :+
dec $D993 dec rect_scratch::x2+1
L74D3: lda $D994
: lda rect_scratch::y2
sec sec
sbc #2 sbc #2
sta $D994 sta rect_scratch::y2
bcs L74E1 bcs :+
dec $D995 dec rect_scratch::y2+1
L74E1: MGTK_RELAY_CALL MGTK::SetPenMode, penXOR
MGTK_RELAY_CALL MGTK::PaintRect, rect_D98E : MGTK_RELAY_CALL MGTK::SetPenMode, penXOR
MGTK_RELAY_CALL MGTK::PaintRect, rect_scratch
rts rts
.endproc
;;; ============================================================
L74F4: lda winfo_entrydlg L74F4: lda winfo_entrydlg
jsr common_overlay::set_port_for_window jsr common_overlay::set_port_for_window

View File

@ -35,7 +35,7 @@ while (<STDIN>) {
$scoped{$def} = 1 if $depth >= 2; $scoped{$def} = 1 if $depth >= 2;
} }
foreach my $term (split /[ (),+\-*\/]/, $_) { foreach my $term (split /[ (),+\-*\/<>#:]/, $_) {
$term =~ s/\s+//g; $term =~ s/\s+//g;
next unless $term; next unless $term;
if ($term =~ m/^L[0-9A-F]{4}$/) { if ($term =~ m/^L[0-9A-F]{4}$/) {