disasm: Icon painting

This commit is contained in:
Joshua Bell 2019-01-16 21:04:07 -08:00
parent 3e55cbc4f0
commit 78dc563020

View File

@ -78,7 +78,7 @@ reserved: .byte 0
maprect: DEFINE_RECT 0,0,0,0,maprect maprect: DEFINE_RECT 0,0,0,0,maprect
.endproc .endproc
paintrect_params6: DEFINE_RECT 0,0,0,0, paintrect_params6 rect_opendir: DEFINE_RECT 0,0,0,0, rect_opendir
.proc textwidth_params .proc textwidth_params
textptr: .addr text_buffer textptr: .addr text_buffer
@ -1620,7 +1620,7 @@ highlighted: copy #$80, icon_flags ; is highlighted
ldy #9 ldy #9
: lda ($06),y : lda ($06),y
sta paintrect_params6::y2,y sta rect_opendir::y2,y
iny iny
cpy #$1D cpy #$1D
bne :- bne :-
@ -1654,20 +1654,20 @@ highlighted: copy #$80, icon_flags ; is highlighted
COPY_STRUCT MGTK::Point, moveto_params2, L9F94 COPY_STRUCT MGTK::Point, moveto_params2, L9F94
bit icon_flags ; volume icon (on desktop) ? bit icon_flags ; volume icon (on desktop) ?
bvc LA097 ; nope bvc paint_icon ; nope
;; Redraw desktop background ;; Redraw desktop background
MGTK_CALL MGTK::InitPort, grafport MGTK_CALL MGTK::InitPort, grafport
jsr set_port_for_erasing_vol_icon jsr set_port_for_erasing_vol_icon
: jsr LA6A3 : jsr calc_window_intersections
jsr LA097 jsr paint_icon
lda L9F93 lda L9F93
bne :- bne :-
MGTK_CALL MGTK::SetPortBits, grafport MGTK_CALL MGTK::SetPortBits, grafport
rts rts
.endproc .endproc
.proc LA097 .proc paint_icon
MGTK_CALL MGTK::HideCursor, DESKTOP_DIRECT ; These params should be ignored - bogus? MGTK_CALL MGTK::HideCursor, DESKTOP_DIRECT ; These params should be ignored - bogus?
MGTK_CALL MGTK::SetPenMode, notpencopy_2 MGTK_CALL MGTK::SetPenMode, notpencopy_2
bit icon_flags ; highlighted? bit icon_flags ; highlighted?
@ -1687,9 +1687,9 @@ paint: MGTK_CALL MGTK::PaintBits, icon_paintbits_params
ldy #IconEntry::win_type ldy #IconEntry::win_type
lda ($06),y lda ($06),y
and #icon_entry_open_mask and #icon_entry_open_mask
beq pos beq label
jsr LA14D jsr calc_rect_opendir
MGTK_CALL MGTK::SetPattern, dark_pattern ; shade for open volume MGTK_CALL MGTK::SetPattern, dark_pattern ; shade for open volume
bit icon_flags ; highlighted? bit icon_flags ; highlighted?
bmi @highlighted bmi @highlighted
@ -1697,9 +1697,9 @@ paint: MGTK_CALL MGTK::PaintBits, icon_paintbits_params
beq @paint beq @paint
@highlighted: @highlighted:
MGTK_CALL MGTK::SetPenMode, penOR_2 MGTK_CALL MGTK::SetPenMode, penOR_2
@paint: MGTK_CALL MGTK::PaintRect, paintrect_params6 @paint: MGTK_CALL MGTK::PaintRect, rect_opendir
pos: COPY_STRUCT MGTK::Point, L9F94, moveto_params2 label: COPY_STRUCT MGTK::Point, L9F94, moveto_params2
MGTK_CALL MGTK::MoveTo, moveto_params2 MGTK_CALL MGTK::MoveTo, moveto_params2
bit icon_flags ; highlighted? bit icon_flags ; highlighted?
bmi :+ bmi :+
@ -1736,21 +1736,21 @@ loop: lda mask_paintbits_params::mapwidth
;;; ============================================================ ;;; ============================================================
.proc LA14D .proc calc_rect_opendir
ldx #0 ldx #0
loop: add16 icon_paintbits_params::viewloc::xcoord,x, icon_paintbits_params::maprect::x1,x, paintrect_params6::x1,x loop: add16 icon_paintbits_params::viewloc::xcoord,x, icon_paintbits_params::maprect::x1,x, rect_opendir::x1,x
add16 icon_paintbits_params::viewloc::xcoord,x, icon_paintbits_params::maprect::x2,x, paintrect_params6::x2,x add16 icon_paintbits_params::viewloc::xcoord,x, icon_paintbits_params::maprect::x2,x, rect_opendir::x2,x
inx inx
inx inx
cpx #4 cpx #4
bne loop bne loop
lda paintrect_params6::y2 lda rect_opendir::y2
sec sec
sbc #1 sbc #1
sta paintrect_params6::y2 sta rect_opendir::y2
bcs :+ bcs :+
dec paintrect_params6::y2+1 dec rect_opendir::y2+1
: rts : rts
.endproc .endproc
@ -2136,7 +2136,7 @@ window_id: .byte 0
volume: volume:
MGTK_CALL MGTK::InitPort, grafport MGTK_CALL MGTK::InitPort, grafport
jsr set_port_for_erasing_vol_icon jsr set_port_for_erasing_vol_icon
: jsr LA6A3 : jsr calc_window_intersections
jsr erase_desktop_icon jsr erase_desktop_icon
lda L9F93 lda L9F93
bne :- bne :-
@ -2374,7 +2374,7 @@ done: MGTK_CALL MGTK::SetPortBits, setportbits_params2
;;; ============================================================ ;;; ============================================================
.proc LA6A3 .proc calc_window_intersections
lda #$00 ; immediately overwritten??? lda #$00 ; immediately overwritten???
jmp LA6C7 jmp LA6C7
@ -2389,27 +2389,22 @@ LA6AE: .word 0
LA6B0: .byte $00 LA6B0: .byte $00
LA6B1: .byte $00 LA6B1: .byte $00
LA6B2: .byte $00 LA6B2: .byte $00
LA6B3: .byte $00
LA6B4: .byte $00 x1a: .word 0
LA6B5: .byte $00 y1a: .word 0
LA6B6: .byte $00 x2a: .word 0
LA6B7: .byte $00 y1b: .word 0
LA6B8: .byte $00 x2b: .word 0
LA6B9: .byte $00 y2a: .word 0
LA6BA: .byte $00 x1b: .word 0
LA6BB: .byte $00 y2b: .word 0
LA6BC: .byte $00
LA6BD: .byte $00
LA6BE: .byte $00
LA6BF: .byte $00
LA6C0: .byte $00
LA6C1: .byte $00
LA6C2: .byte $00
LA6C3: .word 0 LA6C3: .word 0
LA6C5: .word 0 LA6C5: .word 0
LA6C7: lda L9F93 LA6C7: lda L9F93
beq LA6FA beq LA6FA
lda setportbits_params2::cliprect::x2 lda setportbits_params2::cliprect::x2
clc clc
adc #1 adc #1
@ -2422,39 +2417,39 @@ LA6C7: lda L9F93
COPY_BYTES 6, LA629, setportbits_params2::cliprect::y1 COPY_BYTES 6, LA629, setportbits_params2::cliprect::y1
lda setportbits_params2::cliprect::y1 copy16 setportbits_params2::cliprect::y1, setportbits_params2::viewloc::ycoord
sta setportbits_params2::viewloc::ycoord
lda setportbits_params2::cliprect::y1+1
sta setportbits_params2::viewloc::ycoord+1
LA6FA: lda setportbits_params2::cliprect::x1 LA6FA: lda setportbits_params2::cliprect::x1
sta LA6B3 sta x1a
sta LA6BF sta x1b
lda setportbits_params2::cliprect::x1+1 lda setportbits_params2::cliprect::x1+1
sta LA6B4 sta x1a+1
sta LA6C0 sta x1b+1
lda setportbits_params2::cliprect::y1 lda setportbits_params2::cliprect::y1
sta LA6B5 sta y1a
sta LA6B9 sta y1b
lda setportbits_params2::cliprect::y1+1 lda setportbits_params2::cliprect::y1+1
sta LA6B6 sta y1a+1
sta LA6BA sta y1b+1
lda setportbits_params2::cliprect::x2 lda setportbits_params2::cliprect::x2
sta LA6B7 sta x2a
sta LA6BB sta x2b
lda setportbits_params2::cliprect::x2+1 lda setportbits_params2::cliprect::x2+1
sta LA6B8 sta x2a+1
sta LA6BC sta x2b+1
lda setportbits_params2::cliprect::y2 lda setportbits_params2::cliprect::y2
sta LA6BD sta y2a
sta LA6C1 sta y2b
lda setportbits_params2::cliprect::y2+1 lda setportbits_params2::cliprect::y2+1
sta LA6BE sta y2a+1
sta LA6C2 sta y2b+1
lda #0 lda #0
sta LA6B0 sta LA6B0
LA747: lda LA6B0 LA747: lda LA6B0
cmp #4 cmp #4
bne LA775 bne LA775
lda #0 lda #0
sta LA6B0 sta LA6B0
LA753: MGTK_CALL MGTK::SetPortBits, setportbits_params2 LA753: MGTK_CALL MGTK::SetPortBits, setportbits_params2
@ -2477,7 +2472,7 @@ LA775: lda LA6B0
asl a asl a
tax tax
ldy #$00 ldy #$00
LA77D: lda LA6B3,x LA77D: lda x1a,x
sta findwindow_params,y sta findwindow_params,y
iny iny
inx inx