mirror of
https://github.com/mi57730/a2d.git
synced 2024-06-09 05:29:28 +00:00
disasm: Dialog bg save/restore, icon painting
This commit is contained in:
parent
5a445fa078
commit
3e55cbc4f0
|
@ -344,7 +344,7 @@ fail: return #1
|
||||||
|
|
||||||
proceed:
|
proceed:
|
||||||
jsr sub
|
jsr sub
|
||||||
jsr L9F98
|
jsr paint_icon_unhighlighted
|
||||||
lda #1
|
lda #1
|
||||||
tay
|
tay
|
||||||
sta (params::ptr_icon),y
|
sta (params::ptr_icon),y
|
||||||
|
@ -423,7 +423,7 @@ L949D: ldx highlight_count
|
||||||
ldx #1 ; new position
|
ldx #1 ; new position
|
||||||
jsr change_icon_index
|
jsr change_icon_index
|
||||||
|
|
||||||
jsr L9F9F
|
jsr paint_icon_highlighted
|
||||||
return #0 ; Highlighted
|
return #0 ; Highlighted
|
||||||
.endproc
|
.endproc
|
||||||
|
|
||||||
|
@ -470,10 +470,10 @@ found: asl a
|
||||||
bpl :-
|
bpl :-
|
||||||
jmp done
|
jmp done
|
||||||
|
|
||||||
found2: jsr L9F9F
|
found2: jsr paint_icon_highlighted
|
||||||
return #0
|
return #0
|
||||||
|
|
||||||
done: jsr L9F98
|
done: jsr paint_icon_unhighlighted
|
||||||
return #0
|
return #0
|
||||||
.endproc
|
.endproc
|
||||||
|
|
||||||
|
@ -1567,27 +1567,36 @@ L9F8F: return #1
|
||||||
|
|
||||||
;;; ============================================================
|
;;; ============================================================
|
||||||
|
|
||||||
L9F92: .byte 0
|
|
||||||
|
icon_flags: ; bit 7 = highlighted, bit 6 = volume icon
|
||||||
|
.byte 0
|
||||||
|
|
||||||
L9F93: .byte 0
|
L9F93: .byte 0
|
||||||
L9F94: .byte 0
|
L9F94: .byte 0
|
||||||
.byte 0
|
.byte 0
|
||||||
.byte 0
|
.byte 0
|
||||||
.byte 0
|
.byte 0
|
||||||
|
|
||||||
L9F98: lda #0
|
.proc paint_icon
|
||||||
sta L9F92
|
|
||||||
beq L9FA4
|
|
||||||
|
|
||||||
L9F9F: copy #$80, L9F92
|
unhighlighted:
|
||||||
|
lda #0
|
||||||
|
sta icon_flags
|
||||||
|
beq common
|
||||||
|
|
||||||
.proc L9FA4
|
highlighted: copy #$80, icon_flags ; is highlighted
|
||||||
|
|
||||||
|
.proc common
|
||||||
ldy #IconEntry::win_type
|
ldy #IconEntry::win_type
|
||||||
lda ($06),y
|
lda ($06),y
|
||||||
and #icon_entry_winid_mask
|
and #icon_entry_winid_mask
|
||||||
bne :+
|
bne :+
|
||||||
lda L9F92
|
|
||||||
|
;; Mark as "volume icon" on desktop (needs background)
|
||||||
|
lda icon_flags
|
||||||
ora #$40
|
ora #$40
|
||||||
sta L9F92
|
sta icon_flags
|
||||||
|
|
||||||
;; copy icon coords and bits
|
;; copy icon coords and bits
|
||||||
: ldy #IconEntry::iconx
|
: ldy #IconEntry::iconx
|
||||||
: lda ($06),y
|
: lda ($06),y
|
||||||
|
@ -1604,9 +1613,9 @@ L9F9F: copy #$80, L9F92
|
||||||
dey
|
dey
|
||||||
bpl :-
|
bpl :-
|
||||||
|
|
||||||
bit L9F92
|
bit icon_flags ; highlighted?
|
||||||
bpl :+
|
bpl :+
|
||||||
jsr prepare_mask_params
|
jsr prepare_mask_params ; mask needed too
|
||||||
: jsr pop_pointers
|
: jsr pop_pointers
|
||||||
|
|
||||||
ldy #9
|
ldy #9
|
||||||
|
@ -1644,46 +1653,55 @@ L9F9F: copy #$80, L9F92
|
||||||
|
|
||||||
COPY_STRUCT MGTK::Point, moveto_params2, L9F94
|
COPY_STRUCT MGTK::Point, moveto_params2, L9F94
|
||||||
|
|
||||||
bit L9F92
|
bit icon_flags ; volume icon (on desktop) ?
|
||||||
bvc LA097
|
bvc LA097 ; nope
|
||||||
|
|
||||||
|
;; Redraw desktop background
|
||||||
MGTK_CALL MGTK::InitPort, grafport
|
MGTK_CALL MGTK::InitPort, grafport
|
||||||
jsr LA63F
|
jsr set_port_for_erasing_vol_icon
|
||||||
: jsr LA6A3
|
: jsr LA6A3
|
||||||
jsr LA097
|
jsr LA097
|
||||||
lda L9F93
|
lda L9F93
|
||||||
bne :-
|
bne :-
|
||||||
MGTK_CALL MGTK::SetPortBits, grafport
|
MGTK_CALL MGTK::SetPortBits, grafport
|
||||||
rts
|
rts
|
||||||
|
.endproc
|
||||||
|
|
||||||
LA097: MGTK_CALL MGTK::HideCursor, DESKTOP_DIRECT ; These params should be ignored - bogus?
|
.proc LA097
|
||||||
|
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 L9F92
|
bit icon_flags ; highlighted?
|
||||||
bpl LA0C2
|
bpl paint ; no, just draw
|
||||||
bit L9F92
|
bit icon_flags ; on desktop?
|
||||||
bvc LA0B6
|
bvc mask ; no, draw with mask
|
||||||
MGTK_CALL MGTK::SetPenMode, pencopy_2
|
|
||||||
jmp LA0C2
|
|
||||||
|
|
||||||
LA0B6: MGTK_CALL MGTK::PaintBits, mask_paintbits_params
|
;; Highlighted, on desktop: draw icon inverted
|
||||||
|
MGTK_CALL MGTK::SetPenMode, pencopy_2
|
||||||
|
jmp paint
|
||||||
|
|
||||||
|
;; Highlighted, in window: draw mask first, then xor the icon
|
||||||
|
mask: MGTK_CALL MGTK::PaintBits, mask_paintbits_params
|
||||||
MGTK_CALL MGTK::SetPenMode, penXOR_2
|
MGTK_CALL MGTK::SetPenMode, penXOR_2
|
||||||
LA0C2: MGTK_CALL MGTK::PaintBits, icon_paintbits_params
|
|
||||||
|
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 LA0F2
|
beq pos
|
||||||
|
|
||||||
jsr LA14D
|
jsr LA14D
|
||||||
MGTK_CALL MGTK::SetPattern, dark_pattern ; shade for open volume
|
MGTK_CALL MGTK::SetPattern, dark_pattern ; shade for open volume
|
||||||
bit L9F92
|
bit icon_flags ; highlighted?
|
||||||
bmi LA0E6
|
bmi @highlighted
|
||||||
MGTK_CALL MGTK::SetPenMode, penBIC_2
|
MGTK_CALL MGTK::SetPenMode, penBIC_2
|
||||||
beq LA0EC
|
beq @paint
|
||||||
LA0E6: MGTK_CALL MGTK::SetPenMode, penOR_2
|
@highlighted:
|
||||||
LA0EC: MGTK_CALL MGTK::PaintRect, paintrect_params6
|
MGTK_CALL MGTK::SetPenMode, penOR_2
|
||||||
|
@paint: MGTK_CALL MGTK::PaintRect, paintrect_params6
|
||||||
LA0F2: COPY_STRUCT MGTK::Point, L9F94, moveto_params2
|
|
||||||
|
|
||||||
|
pos: COPY_STRUCT MGTK::Point, L9F94, moveto_params2
|
||||||
MGTK_CALL MGTK::MoveTo, moveto_params2
|
MGTK_CALL MGTK::MoveTo, moveto_params2
|
||||||
bit L9F92
|
bit icon_flags ; highlighted?
|
||||||
bmi :+
|
bmi :+
|
||||||
lda #MGTK::textbg_white
|
lda #MGTK::textbg_white
|
||||||
bne setbg
|
bne setbg
|
||||||
|
@ -1696,6 +1714,7 @@ setbg: sta settextbg_params
|
||||||
MGTK_CALL MGTK::DrawText, drawtext_params
|
MGTK_CALL MGTK::DrawText, drawtext_params
|
||||||
MGTK_CALL MGTK::ShowCursor
|
MGTK_CALL MGTK::ShowCursor
|
||||||
rts
|
rts
|
||||||
|
.endproc
|
||||||
|
|
||||||
;;; ============================================================
|
;;; ============================================================
|
||||||
|
|
||||||
|
@ -1735,7 +1754,10 @@ loop: add16 icon_paintbits_params::viewloc::xcoord,x, icon_paintbits_params:
|
||||||
: rts
|
: rts
|
||||||
.endproc
|
.endproc
|
||||||
|
|
||||||
.endproc
|
.endproc ; paint_icon
|
||||||
|
paint_icon_unhighlighted := paint_icon::unhighlighted
|
||||||
|
paint_icon_highlighted := paint_icon::highlighted
|
||||||
|
|
||||||
|
|
||||||
;;; ============================================================
|
;;; ============================================================
|
||||||
|
|
||||||
|
@ -2113,7 +2135,7 @@ window_id: .byte 0
|
||||||
;; Volume (i.e. icon on desktop)
|
;; Volume (i.e. icon on desktop)
|
||||||
volume:
|
volume:
|
||||||
MGTK_CALL MGTK::InitPort, grafport
|
MGTK_CALL MGTK::InitPort, grafport
|
||||||
jsr LA63F
|
jsr set_port_for_erasing_vol_icon
|
||||||
: jsr LA6A3
|
: jsr LA6A3
|
||||||
jsr erase_desktop_icon
|
jsr erase_desktop_icon
|
||||||
lda L9F93
|
lda L9F93
|
||||||
|
@ -2309,7 +2331,7 @@ mapwidth: .word MGTK::screen_mapwidth
|
||||||
cliprect: DEFINE_RECT 0, 0, 0, 0, cliprect
|
cliprect: DEFINE_RECT 0, 0, 0, 0, cliprect
|
||||||
.endproc
|
.endproc
|
||||||
|
|
||||||
.proc LA63F
|
.proc set_port_for_erasing_vol_icon
|
||||||
jsr calc_icon_poly
|
jsr calc_icon_poly
|
||||||
|
|
||||||
lda poly::v0::ycoord
|
lda poly::v0::ycoord
|
||||||
|
@ -2353,7 +2375,7 @@ done: MGTK_CALL MGTK::SetPortBits, setportbits_params2
|
||||||
;;; ============================================================
|
;;; ============================================================
|
||||||
|
|
||||||
.proc LA6A3
|
.proc LA6A3
|
||||||
lda #$00
|
lda #$00 ; immediately overwritten???
|
||||||
jmp LA6C7
|
jmp LA6C7
|
||||||
|
|
||||||
.proc findwindow_params
|
.proc findwindow_params
|
||||||
|
@ -2385,6 +2407,7 @@ LA6C1: .byte $00
|
||||||
LA6C2: .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
|
||||||
|
@ -3243,7 +3266,7 @@ LBA0B: sta grafport3_viewloc_xcoord,x
|
||||||
adc portmap::maprect::y2
|
adc portmap::maprect::y2
|
||||||
sta LBFCB
|
sta LBFCB
|
||||||
MGTK_RELAY2_CALL MGTK::HideCursor
|
MGTK_RELAY2_CALL MGTK::HideCursor
|
||||||
jsr LBE08
|
jsr save_dialog_background
|
||||||
MGTK_RELAY2_CALL MGTK::ShowCursor
|
MGTK_RELAY2_CALL MGTK::ShowCursor
|
||||||
MGTK_RELAY2_CALL MGTK::SetPenMode, pencopy
|
MGTK_RELAY2_CALL MGTK::SetPenMode, pencopy
|
||||||
MGTK_RELAY2_CALL MGTK::PaintRect, alert_rect ; alert background
|
MGTK_RELAY2_CALL MGTK::PaintRect, alert_rect ; alert background
|
||||||
|
@ -3368,7 +3391,7 @@ LBC52: jmp LBB87
|
||||||
|
|
||||||
LBC55: pha
|
LBC55: pha
|
||||||
MGTK_RELAY2_CALL MGTK::HideCursor
|
MGTK_RELAY2_CALL MGTK::HideCursor
|
||||||
jsr LBE5D
|
jsr restore_dialog_background
|
||||||
MGTK_RELAY2_CALL MGTK::ShowCursor
|
MGTK_RELAY2_CALL MGTK::ShowCursor
|
||||||
pla
|
pla
|
||||||
rts
|
rts
|
||||||
|
@ -3482,18 +3505,32 @@ LBDD3: lda LBDE0
|
||||||
|
|
||||||
LBDDB: lda #2
|
LBDDB: lda #2
|
||||||
jmp LBC55
|
jmp LBC55
|
||||||
.endproc
|
|
||||||
show_alert_dialog := show_alert_dialog_impl::start
|
|
||||||
|
|
||||||
;;; ============================================================
|
|
||||||
|
|
||||||
LBDE0: .byte 0
|
LBDE0: .byte 0
|
||||||
|
|
||||||
LBDE1: sub16 event_xcoord, portmap::viewloc::xcoord, event_xcoord
|
LBDE1: sub16 event_xcoord, portmap::viewloc::xcoord, event_xcoord
|
||||||
sub16 event_ycoord, portmap::viewloc::ycoord, event_ycoord
|
sub16 event_ycoord, portmap::viewloc::ycoord, event_ycoord
|
||||||
rts
|
rts
|
||||||
|
|
||||||
.proc LBE08
|
.endproc
|
||||||
copy16 #$0800, addr
|
show_alert_dialog := show_alert_dialog_impl::start
|
||||||
|
|
||||||
|
|
||||||
|
;;; ============================================================
|
||||||
|
;;; Save/Restore Dialog Background
|
||||||
|
;;;
|
||||||
|
;;; This reuses the "save area" ($800-$1AFF) used by MGTK for
|
||||||
|
;;; quickly restoring menu backgrounds.
|
||||||
|
|
||||||
|
.proc dialog_background
|
||||||
|
|
||||||
|
ptr := $06
|
||||||
|
|
||||||
|
savearea := $800
|
||||||
|
|
||||||
|
.proc save
|
||||||
|
copy16 #savearea, addr
|
||||||
lda LBFC9
|
lda LBFC9
|
||||||
jsr LBF10
|
jsr LBF10
|
||||||
lda LBFCB
|
lda LBFCB
|
||||||
|
@ -3509,7 +3546,7 @@ LBE27: lda LBE5C
|
||||||
sta PAGE2OFF ; main $2000-$3FFF
|
sta PAGE2OFF ; main $2000-$3FFF
|
||||||
bcs LBE34
|
bcs LBE34
|
||||||
sta PAGE2ON ; aux $2000-$3FFF
|
sta PAGE2ON ; aux $2000-$3FFF
|
||||||
LBE34: lda ($06),y
|
LBE34: lda (ptr),y
|
||||||
addr := *+1
|
addr := *+1
|
||||||
sta dummy1234
|
sta dummy1234
|
||||||
inc16 addr
|
inc16 addr
|
||||||
|
@ -3528,8 +3565,8 @@ LBE4E: jsr LBF52
|
||||||
LBE5C: .byte 0
|
LBE5C: .byte 0
|
||||||
.endproc
|
.endproc
|
||||||
|
|
||||||
.proc LBE5D
|
.proc restore
|
||||||
copy16 #$800, addr
|
copy16 #savearea, addr
|
||||||
ldx LBFCD
|
ldx LBFCD
|
||||||
ldy LBFCE
|
ldy LBFCE
|
||||||
lda #$FF
|
lda #$FF
|
||||||
|
@ -3571,7 +3608,7 @@ LBEAE: lda LBF0B
|
||||||
sta PAGE2ON ; aux $2000-$3FFF
|
sta PAGE2ON ; aux $2000-$3FFF
|
||||||
|
|
||||||
addr := *+1
|
addr := *+1
|
||||||
: lda $0800 ; self-modified
|
: lda savearea ; self-modified
|
||||||
|
|
||||||
pha
|
pha
|
||||||
lda LBF0B
|
lda LBF0B
|
||||||
|
@ -3579,24 +3616,24 @@ LBEAE: lda LBF0B
|
||||||
beq LBEDD
|
beq LBEDD
|
||||||
cmp LBFCC
|
cmp LBFCC
|
||||||
bne LBEEB
|
bne LBEEB
|
||||||
lda ($06),y
|
lda (ptr),y
|
||||||
and LBF0F
|
and LBF0F
|
||||||
sta ($06),y
|
sta (ptr),y
|
||||||
pla
|
pla
|
||||||
and LBF0E
|
and LBF0E
|
||||||
ora ($06),y
|
ora (ptr),y
|
||||||
pha
|
pha
|
||||||
jmp LBEEB
|
jmp LBEEB
|
||||||
|
|
||||||
LBEDD: lda ($06),y
|
LBEDD: lda (ptr),y
|
||||||
and LBF0D
|
and LBF0D
|
||||||
sta ($06),y
|
sta (ptr),y
|
||||||
pla
|
pla
|
||||||
and LBF0C
|
and LBF0C
|
||||||
ora ($06),y
|
ora (ptr),y
|
||||||
pha
|
pha
|
||||||
LBEEB: pla
|
LBEEB: pla
|
||||||
sta ($06),y
|
sta (ptr),y
|
||||||
inc16 addr
|
inc16 addr
|
||||||
lda LBF0B
|
lda LBF0B
|
||||||
cmp LBFCC
|
cmp LBFCC
|
||||||
|
@ -3616,7 +3653,7 @@ LBF0E: .byte $00
|
||||||
LBF0F: .byte $00
|
LBF0F: .byte $00
|
||||||
.endproc
|
.endproc
|
||||||
|
|
||||||
;;; ============================================================
|
;;; Address calculations for dialog background display buffer.
|
||||||
|
|
||||||
.proc LBF10
|
.proc LBF10
|
||||||
sta LBFCF
|
sta LBFCF
|
||||||
|
@ -3646,13 +3683,13 @@ LBF0F: .byte $00
|
||||||
sta LBF51
|
sta LBF51
|
||||||
pla
|
pla
|
||||||
ror a
|
ror a
|
||||||
sta $06
|
sta ptr
|
||||||
lda LBFB0
|
lda LBFB0
|
||||||
asl a
|
asl a
|
||||||
asl a
|
asl a
|
||||||
ora LBF51
|
ora LBF51
|
||||||
ora #$20
|
ora #$20
|
||||||
sta $07
|
sta ptr+1
|
||||||
clc
|
clc
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
@ -3691,6 +3728,12 @@ LBF89: sec
|
||||||
rts
|
rts
|
||||||
.endproc
|
.endproc
|
||||||
|
|
||||||
|
.endproc ; dialog_background
|
||||||
|
save_dialog_background := dialog_background::save
|
||||||
|
restore_dialog_background := dialog_background::restore
|
||||||
|
|
||||||
|
;;; ============================================================
|
||||||
|
|
||||||
.proc LBF8B
|
.proc LBF8B
|
||||||
ldy #0
|
ldy #0
|
||||||
cpx #2
|
cpx #2
|
||||||
|
|
22
res/go.sh
22
res/go.sh
|
@ -3,22 +3,14 @@
|
||||||
# Run this from the top level directory
|
# Run this from the top level directory
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
source "res/util.sh"
|
||||||
|
|
||||||
cd desktop
|
for i in desktop desk.acc desktop.system ram.system; do
|
||||||
res/go.sh
|
cecho yellow Building: $i
|
||||||
cd ..
|
cd $i
|
||||||
|
res/go.sh
|
||||||
cd desk.acc
|
cd ..
|
||||||
res/go.sh
|
done
|
||||||
cd ..
|
|
||||||
|
|
||||||
cd desktop.system
|
|
||||||
res/go.sh
|
|
||||||
cd ..
|
|
||||||
|
|
||||||
cd ram.system
|
|
||||||
res/go.sh
|
|
||||||
cd ..
|
|
||||||
|
|
||||||
# Mountable directory for Virtual ][
|
# Mountable directory for Virtual ][
|
||||||
if [ -d mount ]; then
|
if [ -d mount ]; then
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
function cecho {
|
function cecho {
|
||||||
case $1 in
|
case $1 in
|
||||||
red) tput setaf 1 ;;
|
red) tput setaf 1 ; shift ;;
|
||||||
green) tput setaf 2 ;;
|
green) tput setaf 2 ; shift ;;
|
||||||
yellow) tput setaf 3 ;;
|
yellow) tput setaf 3 ; shift ;;
|
||||||
esac
|
esac
|
||||||
echo -e "$2"
|
echo -e "$@"
|
||||||
tput sgr0
|
tput sgr0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user