mirror of
https://github.com/mi57730/a2d.git
synced 2025-02-19 09:31:41 +00:00
disasm: vol icon clipping
This commit is contained in:
parent
63a7bf730d
commit
8b738798f4
@ -203,10 +203,10 @@ fontptr: .addr DEFAULT_FONT
|
||||
|
||||
.proc getwinport_params
|
||||
window_id: .byte 0
|
||||
a_grafport: .addr grafport4
|
||||
a_grafport: .addr icon_grafport
|
||||
.endproc
|
||||
|
||||
.proc grafport4
|
||||
.proc icon_grafport
|
||||
viewloc: DEFINE_POINT 0, 0, viewloc
|
||||
mapbits: .addr 0
|
||||
mapwidth: .word 0
|
||||
@ -1572,7 +1572,7 @@ L9F8F: return #1
|
||||
icon_flags: ; bit 7 = highlighted, bit 6 = volume icon
|
||||
.byte 0
|
||||
|
||||
L9F93: .byte 0
|
||||
more_drawing_needed_flag: .byte 0
|
||||
L9F94: .byte 0
|
||||
.byte 0
|
||||
.byte 0
|
||||
@ -1662,7 +1662,7 @@ highlighted: copy #$80, icon_flags ; is highlighted
|
||||
jsr set_port_for_erasing_vol_icon
|
||||
: jsr calc_window_intersections
|
||||
jsr paint_icon
|
||||
lda L9F93
|
||||
lda more_drawing_needed_flag
|
||||
bne :-
|
||||
MGTK_CALL MGTK::SetPortBits, grafport
|
||||
rts
|
||||
@ -2129,7 +2129,7 @@ window_id: .byte 0
|
||||
sta getwinport_params::window_id
|
||||
MGTK_CALL MGTK::GetWinPort, getwinport_params
|
||||
jsr LA4CC
|
||||
jsr LA938
|
||||
jsr shift_port_down
|
||||
jsr erase_icon
|
||||
jmp LA446
|
||||
|
||||
@ -2139,7 +2139,7 @@ volume:
|
||||
jsr set_port_for_erasing_vol_icon
|
||||
: jsr calc_window_intersections
|
||||
jsr erase_desktop_icon
|
||||
lda L9F93
|
||||
lda more_drawing_needed_flag
|
||||
bne :-
|
||||
MGTK_CALL MGTK::SetPortBits, grafport
|
||||
jmp LA446
|
||||
@ -2176,7 +2176,7 @@ LA446: jsr push_pointers
|
||||
bit LA3B7 ; no, almost done
|
||||
bpl :+
|
||||
MGTK_CALL MGTK::InitPort, grafport
|
||||
MGTK_CALL MGTK::SetPort, grafport4
|
||||
MGTK_CALL MGTK::SetPort, icon_grafport
|
||||
: jsr pop_pointers
|
||||
rts
|
||||
|
||||
@ -2242,13 +2242,13 @@ LA4DC: pha
|
||||
lda #0
|
||||
sta LA4CB
|
||||
LA4E2: ldy #0
|
||||
LA4E4: lda grafport4,y
|
||||
LA4E4: lda icon_grafport,y
|
||||
sta LA567,y
|
||||
iny
|
||||
cpy #4
|
||||
bne LA4E4
|
||||
ldy #8
|
||||
LA4F1: lda grafport4,y
|
||||
LA4F1: lda icon_grafport,y
|
||||
sta LA567-4,y
|
||||
iny
|
||||
cpy #12
|
||||
@ -2325,7 +2325,7 @@ LA627: .word 0
|
||||
LA629: .word 0
|
||||
LA62B: DEFINE_POINT 0,0
|
||||
|
||||
.proc setportbits_params2
|
||||
.proc portbits
|
||||
viewloc: DEFINE_POINT 0, 0, viewloc
|
||||
mapbits: .addr MGTK::screen_mapbits
|
||||
mapwidth: .word MGTK::screen_mapwidth
|
||||
@ -2337,26 +2337,26 @@ cliprect: DEFINE_RECT 0, 0, 0, 0, cliprect
|
||||
|
||||
lda poly::v0::ycoord
|
||||
sta LA629
|
||||
sta setportbits_params2::cliprect::y1
|
||||
sta setportbits_params2::viewloc::ycoord
|
||||
sta portbits::cliprect::y1
|
||||
sta portbits::viewloc::ycoord
|
||||
lda poly::v0::ycoord+1
|
||||
sta LA629+1
|
||||
sta setportbits_params2::cliprect::y1+1
|
||||
sta setportbits_params2::viewloc::ycoord+1
|
||||
sta portbits::cliprect::y1+1
|
||||
sta portbits::viewloc::ycoord+1
|
||||
|
||||
lda poly::v5::xcoord
|
||||
sta LA627
|
||||
sta setportbits_params2::cliprect::x1
|
||||
sta setportbits_params2::viewloc::xcoord
|
||||
sta portbits::cliprect::x1
|
||||
sta portbits::viewloc::xcoord
|
||||
lda poly::v5::xcoord+1
|
||||
sta LA627+1
|
||||
sta setportbits_params2::cliprect::x1+1
|
||||
sta setportbits_params2::viewloc::xcoord+1
|
||||
sta portbits::cliprect::x1+1
|
||||
sta portbits::viewloc::xcoord+1
|
||||
|
||||
ldx #3
|
||||
: lda poly::v4,x
|
||||
sta LA62B,x
|
||||
sta setportbits_params2::cliprect::x2,x
|
||||
sta portbits::cliprect::x2,x
|
||||
dex
|
||||
bpl :-
|
||||
|
||||
@ -2364,18 +2364,19 @@ cliprect: DEFINE_RECT 0, 0, 0, 0, cliprect
|
||||
bmi done
|
||||
lda #<(screen_width - 2)
|
||||
sta LA62B
|
||||
sta setportbits_params2::cliprect::x2
|
||||
sta portbits::cliprect::x2
|
||||
lda #>(screen_width - 2)
|
||||
sta LA62B+1
|
||||
sta setportbits_params2::cliprect::x2+1
|
||||
sta portbits::cliprect::x2+1
|
||||
|
||||
done: MGTK_CALL MGTK::SetPortBits, setportbits_params2
|
||||
done: MGTK_CALL MGTK::SetPortBits, portbits
|
||||
rts
|
||||
.endproc
|
||||
|
||||
;;; ============================================================
|
||||
|
||||
.proc calc_window_intersections
|
||||
|
||||
lda #$00 ; immediately overwritten???
|
||||
jmp LA6C7
|
||||
|
||||
@ -2387,102 +2388,108 @@ window_id: .byte 0
|
||||
.endproc
|
||||
|
||||
LA6AE: .word 0
|
||||
LA6B0: .byte $00
|
||||
pt_num: .byte $00
|
||||
LA6B1: .byte $00
|
||||
LA6B2: .byte $00
|
||||
|
||||
x1a: .word 0
|
||||
y1a: .word 0
|
||||
x2a: .word 0
|
||||
y1b: .word 0
|
||||
x2b: .word 0
|
||||
y2a: .word 0
|
||||
x1b: .word 0
|
||||
y2b: .word 0
|
||||
pt1: DEFINE_POINT 0,0,pt1
|
||||
pt2: DEFINE_POINT 0,0,pt2
|
||||
pt3: DEFINE_POINT 0,0,pt3
|
||||
pt4: DEFINE_POINT 0,0,pt4
|
||||
|
||||
LA6C3: .word 0
|
||||
LA6C5: .word 0
|
||||
|
||||
LA6C7: lda L9F93
|
||||
LA6C7: lda more_drawing_needed_flag
|
||||
beq LA6FA
|
||||
|
||||
lda setportbits_params2::cliprect::x2
|
||||
lda portbits::cliprect::x2
|
||||
clc
|
||||
adc #1
|
||||
sta setportbits_params2::cliprect::x1
|
||||
sta setportbits_params2::viewloc::xcoord
|
||||
lda setportbits_params2::cliprect::x2+1
|
||||
sta portbits::cliprect::x1
|
||||
sta portbits::viewloc::xcoord
|
||||
lda portbits::cliprect::x2+1
|
||||
adc #0
|
||||
sta setportbits_params2::cliprect::x1+1
|
||||
sta setportbits_params2::viewloc::xcoord+1
|
||||
sta portbits::cliprect::x1+1
|
||||
sta portbits::viewloc::xcoord+1
|
||||
|
||||
COPY_BYTES 6, LA629, setportbits_params2::cliprect::y1
|
||||
COPY_BYTES 6, LA629, portbits::cliprect::y1
|
||||
|
||||
copy16 setportbits_params2::cliprect::y1, setportbits_params2::viewloc::ycoord
|
||||
copy16 portbits::cliprect::y1, portbits::viewloc::ycoord
|
||||
|
||||
LA6FA: lda setportbits_params2::cliprect::x1
|
||||
sta x1a
|
||||
sta x1b
|
||||
lda setportbits_params2::cliprect::x1+1
|
||||
sta x1a+1
|
||||
sta x1b+1
|
||||
lda setportbits_params2::cliprect::y1
|
||||
sta y1a
|
||||
sta y1b
|
||||
lda setportbits_params2::cliprect::y1+1
|
||||
sta y1a+1
|
||||
sta y1b+1
|
||||
lda setportbits_params2::cliprect::x2
|
||||
sta x2a
|
||||
sta x2b
|
||||
lda setportbits_params2::cliprect::x2+1
|
||||
sta x2a+1
|
||||
sta x2b+1
|
||||
lda setportbits_params2::cliprect::y2
|
||||
sta y2a
|
||||
sta y2b
|
||||
lda setportbits_params2::cliprect::y2+1
|
||||
sta y2a+1
|
||||
sta y2b+1
|
||||
LA6FA: lda portbits::cliprect::x1
|
||||
sta pt1::xcoord
|
||||
sta pt4::xcoord
|
||||
lda portbits::cliprect::x1+1
|
||||
sta pt1::xcoord+1
|
||||
sta pt4::xcoord+1
|
||||
lda portbits::cliprect::y1
|
||||
sta pt1::ycoord
|
||||
sta pt2::ycoord
|
||||
lda portbits::cliprect::y1+1
|
||||
sta pt1::ycoord+1
|
||||
sta pt2::ycoord+1
|
||||
lda portbits::cliprect::x2
|
||||
sta pt2::xcoord
|
||||
sta pt3::xcoord
|
||||
lda portbits::cliprect::x2+1
|
||||
sta pt2::xcoord+1
|
||||
sta pt3::xcoord+1
|
||||
lda portbits::cliprect::y2
|
||||
sta pt3::ycoord
|
||||
sta pt4::ycoord
|
||||
lda portbits::cliprect::y2+1
|
||||
sta pt3::ycoord+1
|
||||
sta pt4::ycoord+1
|
||||
|
||||
lda #0
|
||||
sta LA6B0
|
||||
LA747: lda LA6B0
|
||||
sta pt_num
|
||||
|
||||
next_pt:
|
||||
lda pt_num
|
||||
cmp #4
|
||||
bne LA775
|
||||
|
||||
;; --------------------------------------------------
|
||||
;; Finish up
|
||||
|
||||
lda #0
|
||||
sta LA6B0
|
||||
LA753: MGTK_CALL MGTK::SetPortBits, setportbits_params2
|
||||
lda setportbits_params2::cliprect::x2+1
|
||||
sta pt_num
|
||||
|
||||
LA753: MGTK_CALL MGTK::SetPortBits, portbits
|
||||
;; if (cliprect::x2 < LA62B) more drawing is needed
|
||||
lda portbits::cliprect::x2+1
|
||||
cmp LA62B+1
|
||||
bne LA76F
|
||||
lda setportbits_params2::cliprect::x2
|
||||
bne :+
|
||||
lda portbits::cliprect::x2
|
||||
cmp LA62B
|
||||
bcc LA76F
|
||||
lda #$00
|
||||
sta L9F93
|
||||
bcc :+
|
||||
copy #0, more_drawing_needed_flag
|
||||
rts
|
||||
|
||||
LA76F: lda #1
|
||||
sta L9F93
|
||||
: copy #1, more_drawing_needed_flag
|
||||
rts
|
||||
|
||||
LA775: lda LA6B0
|
||||
asl a
|
||||
;; --------------------------------------------------
|
||||
|
||||
LA775: lda pt_num
|
||||
asl a ; *4 (.sizeof(Point))
|
||||
asl a
|
||||
tax
|
||||
ldy #$00
|
||||
LA77D: lda x1a,x
|
||||
|
||||
;; Look up window at Nth point
|
||||
ldy #0
|
||||
: lda pt1::xcoord,x
|
||||
sta findwindow_params,y
|
||||
iny
|
||||
inx
|
||||
cpy #4
|
||||
bne LA77D
|
||||
inc LA6B0
|
||||
bne :-
|
||||
|
||||
inc pt_num
|
||||
MGTK_CALL MGTK::FindWindow, findwindow_params
|
||||
lda findwindow_params::which_area
|
||||
beq LA747
|
||||
beq next_pt
|
||||
lda findwindow_params::window_id
|
||||
sta getwinport_params
|
||||
MGTK_CALL MGTK::GetWinPort, getwinport_params
|
||||
@ -2506,102 +2513,117 @@ LA7C8: ldy #4
|
||||
lsr a
|
||||
ora LA6B1
|
||||
sta LA6B1
|
||||
sub16 grafport4::viewloc::xcoord, #2, grafport4::viewloc::xcoord
|
||||
sub16 grafport4::cliprect::x1, #2, grafport4::cliprect::x1
|
||||
sub16 icon_grafport::viewloc::xcoord, #2, icon_grafport::viewloc::xcoord
|
||||
sub16 icon_grafport::cliprect::x1, #2, icon_grafport::cliprect::x1
|
||||
|
||||
bit LA6B2
|
||||
bmi LA820
|
||||
|
||||
lda grafport4::viewloc::ycoord
|
||||
;; viewloc::ycoord -= 14
|
||||
lda icon_grafport::viewloc::ycoord
|
||||
sec
|
||||
sbc #14
|
||||
sta grafport4::viewloc::ycoord
|
||||
sta icon_grafport::viewloc::ycoord
|
||||
bcs :+
|
||||
dec grafport4::viewloc::ycoord+1
|
||||
dec icon_grafport::viewloc::ycoord+1
|
||||
:
|
||||
|
||||
lda grafport4::cliprect::y1
|
||||
;; cliprect::y1 -= 14
|
||||
lda icon_grafport::cliprect::y1
|
||||
sec
|
||||
sbc #14
|
||||
sta grafport4::cliprect::y1
|
||||
sta icon_grafport::cliprect::y1
|
||||
bcs :+
|
||||
dec grafport4::cliprect::y1+1
|
||||
dec icon_grafport::cliprect::y1+1
|
||||
:
|
||||
|
||||
LA820: bit LA6B1
|
||||
bpl LA833
|
||||
lda grafport4::cliprect::y2
|
||||
bpl :+
|
||||
|
||||
;; cliprect::y2 += 12
|
||||
lda icon_grafport::cliprect::y2
|
||||
clc
|
||||
adc #12
|
||||
sta grafport4::cliprect::y2
|
||||
bcc LA833
|
||||
inc grafport4::cliprect::y2+1
|
||||
LA833: bit LA6B1
|
||||
bvc LA846
|
||||
lda grafport4::cliprect::x2
|
||||
sta icon_grafport::cliprect::y2
|
||||
bcc :+
|
||||
inc icon_grafport::cliprect::y2+1
|
||||
|
||||
: bit LA6B1
|
||||
bvc :+
|
||||
|
||||
;; cliprect::x2 += 20
|
||||
lda icon_grafport::cliprect::x2
|
||||
clc
|
||||
adc #20
|
||||
sta grafport4::cliprect::x2
|
||||
bcc LA846
|
||||
inc grafport4::cliprect::x2+1
|
||||
LA846: jsr pop_pointers
|
||||
sub16 grafport4::cliprect::x2, grafport4::cliprect::x1, LA6C3
|
||||
sub16 grafport4::cliprect::y2, grafport4::cliprect::y1, LA6C5
|
||||
sta icon_grafport::cliprect::x2
|
||||
bcc :+
|
||||
inc icon_grafport::cliprect::x2+1
|
||||
|
||||
: jsr pop_pointers
|
||||
sub16 icon_grafport::cliprect::x2, icon_grafport::cliprect::x1, LA6C3
|
||||
sub16 icon_grafport::cliprect::y2, icon_grafport::cliprect::y1, LA6C5
|
||||
|
||||
;; LA6C3 += viewloc::xcoord
|
||||
lda LA6C3
|
||||
clc
|
||||
adc grafport4::viewloc::xcoord
|
||||
adc icon_grafport::viewloc::xcoord
|
||||
sta LA6C3
|
||||
lda grafport4::viewloc::xcoord+1
|
||||
lda icon_grafport::viewloc::xcoord+1
|
||||
adc LA6C3+1
|
||||
sta LA6C3+1
|
||||
add16 LA6C5, grafport4::viewloc::ycoord, LA6C5
|
||||
cmp16 setportbits_params2::cliprect::x2, LA6C3
|
||||
bmi LA8B7
|
||||
add16 LA6C3, #1, setportbits_params2::cliprect::x2
|
||||
|
||||
;; LA6C5 += viewloc::ycoord
|
||||
add16 LA6C5, icon_grafport::viewloc::ycoord, LA6C5
|
||||
|
||||
;; if (cliprect::x2 < LA6C3) LA6C3 = cliprect::x2 + 1
|
||||
cmp16 portbits::cliprect::x2, LA6C3
|
||||
bmi :+
|
||||
add16 LA6C3, #1, portbits::cliprect::x2
|
||||
jmp LA8D4
|
||||
|
||||
LA8B7: cmp16 grafport4::viewloc::xcoord, setportbits_params2::cliprect::x1
|
||||
;; if (viewloc::xcoord < cliprect::x1) viewloc::xcoord = cliprect::x2
|
||||
: cmp16 icon_grafport::viewloc::xcoord, portbits::cliprect::x1
|
||||
bmi LA8D4
|
||||
copy16 grafport4::viewloc::xcoord, setportbits_params2::cliprect::x2
|
||||
copy16 icon_grafport::viewloc::xcoord, portbits::cliprect::x2
|
||||
jmp LA6FA
|
||||
|
||||
LA8D4: cmp16 grafport4::viewloc::ycoord, setportbits_params2::cliprect::y1
|
||||
bmi LA8F6
|
||||
copy16 grafport4::viewloc::ycoord, setportbits_params2::cliprect::y2
|
||||
lda #1
|
||||
sta L9F93
|
||||
|
||||
;; if (viewloc::ycoord < cliprect::y1) viewloc::ycoord = cliprect::y2
|
||||
LA8D4: cmp16 icon_grafport::viewloc::ycoord, portbits::cliprect::y1
|
||||
bmi :+
|
||||
copy16 icon_grafport::viewloc::ycoord, portbits::cliprect::y2
|
||||
copy #1, more_drawing_needed_flag
|
||||
jmp LA6FA
|
||||
|
||||
LA8F6: cmp16 LA6C5, setportbits_params2::cliprect::y2
|
||||
: cmp16 LA6C5, portbits::cliprect::y2
|
||||
bpl LA923
|
||||
lda LA6C5
|
||||
clc
|
||||
adc #2
|
||||
sta setportbits_params2::cliprect::y1
|
||||
sta setportbits_params2::viewloc::ycoord
|
||||
sta portbits::cliprect::y1
|
||||
sta portbits::viewloc::ycoord
|
||||
lda LA6C5+1
|
||||
adc #0
|
||||
sta setportbits_params2::cliprect::y1+1
|
||||
sta setportbits_params2::viewloc::ycoord+1
|
||||
lda #1
|
||||
sta L9F93
|
||||
sta portbits::cliprect::y1+1
|
||||
sta portbits::viewloc::ycoord+1
|
||||
copy #1, more_drawing_needed_flag
|
||||
jmp LA6FA
|
||||
|
||||
LA923: lda setportbits_params2::cliprect::x2
|
||||
sta setportbits_params2::cliprect::x1
|
||||
sta setportbits_params2::viewloc::xcoord
|
||||
lda setportbits_params2::cliprect::x2+1
|
||||
sta setportbits_params2::cliprect::x1+1
|
||||
sta setportbits_params2::viewloc::xcoord+1
|
||||
LA923: lda portbits::cliprect::x2
|
||||
sta portbits::cliprect::x1
|
||||
sta portbits::viewloc::xcoord
|
||||
lda portbits::cliprect::x2+1
|
||||
sta portbits::cliprect::x1+1
|
||||
sta portbits::viewloc::xcoord+1
|
||||
jmp LA753
|
||||
.endproc
|
||||
|
||||
;;; ============================================================
|
||||
|
||||
.proc LA938
|
||||
add16 grafport4::viewloc::ycoord, #15, grafport4::viewloc::ycoord
|
||||
add16 grafport4::cliprect::y1, #15, grafport4::cliprect::y1
|
||||
MGTK_CALL MGTK::SetPort, grafport4
|
||||
.proc shift_port_down
|
||||
add16 icon_grafport::viewloc::ycoord, #15, icon_grafport::viewloc::ycoord
|
||||
add16 icon_grafport::cliprect::y1, #15, icon_grafport::cliprect::y1
|
||||
MGTK_CALL MGTK::SetPort, icon_grafport
|
||||
rts
|
||||
.endproc
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user