Use proper masks for desktop (volume) icons

This commit is contained in:
Joshua Bell 2019-01-15 23:36:00 -08:00
parent d81e18a228
commit c8cc3bde53
2 changed files with 145 additions and 62 deletions

View File

@ -905,9 +905,6 @@ done: return #0
.proc FIND_ICON_IMPL .proc FIND_ICON_IMPL
jmp start jmp start
.res 9, 0 ; ???
coords := $6 coords := $6
;; Copy coords at $6 to param block ;; Copy coords at $6 to param block
@ -961,9 +958,6 @@ inside: pla
sta L97F6 sta L97F6
rts rts
rts ; ???
.byte 0
L97F5: .byte 0 L97F5: .byte 0
L97F6: .byte 0 L97F6: .byte 0
.endproc .endproc
@ -1002,7 +996,6 @@ win_id: .byte $00 ; written but not read
icon_id: icon_id:
.byte $00 .byte $00
.byte $00 ; unused ???
deltax: .word 0 deltax: .word 0
deltay: .word 0 deltay: .word 0
@ -1586,11 +1579,8 @@ ptr_iconent: .addr 0
END_PARAM_BLOCK END_PARAM_BLOCK
ptr := $06 ; Overwrites param ptr := $06 ; Overwrites param
jmp start jmp start
.byte 0 ; ???
;; DT_REDRAW_ICON params ;; DT_REDRAW_ICON params
icon: .byte 0 icon: .byte 0
@ -1726,13 +1716,10 @@ highlighted: copy #$80, icon_flags ; is highlighted
dey dey
bpl :- bpl :-
bit icon_flags ; highlighted?
bpl :+
;; Icon definition is followed by pointer to mask address. ;; Icon definition is followed by pointer to mask address.
;; NOTE: For volume icons, this is random data, but it is unused.
ldy #.sizeof(MGTK::MapInfo) - .sizeof(MGTK::Point) ldy #.sizeof(MGTK::MapInfo) - .sizeof(MGTK::Point)
copy16in ($08),y, mask_paintbits_params::mapbits copy16in ($08),y, mask_paintbits_params::mapbits
: jsr pop_pointers jsr pop_pointers
ldy #9 ldy #9
: lda ($06),y : lda ($06),y
@ -1775,6 +1762,8 @@ highlighted: copy #$80, icon_flags ; is highlighted
;; 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
;; Why this loopy thing? handle obscured by windows?
: jsr LA6A3 : jsr LA6A3
jsr LA097 jsr LA097
lda L9F93 lda L9F93
@ -1785,21 +1774,33 @@ highlighted: copy #$80, icon_flags ; is highlighted
.proc LA097 .proc LA097
MGTK_CALL MGTK::HideCursor MGTK_CALL MGTK::HideCursor
MGTK_CALL MGTK::SetPenMode, notpencopy_2
bit icon_flags ; highlighted?
bpl paint ; no, just draw
bit icon_flags ; on desktop?
bvc mask ; no, draw with mask
;; Highlighted, on desktop: draw icon inverted bit icon_flags
MGTK_CALL MGTK::SetPenMode, pencopy_2 bvc window
jmp paint
;; Highlighted, in window: draw mask first, then xor the icon ;; On desktop, clear background
mask: MGTK_CALL MGTK::PaintBits, mask_paintbits_params MGTK_CALL MGTK::SetPenMode, penOR_2
bit icon_flags
bpl :+ ; highlighted?
MGTK_CALL MGTK::SetPenMode, penBIC_2
: MGTK_CALL MGTK::PaintBits, mask_paintbits_params
MGTK_CALL MGTK::SetPenMode, penXOR_2 MGTK_CALL MGTK::SetPenMode, penXOR_2
MGTK_CALL MGTK::PaintBits, icon_paintbits_params
jmp continue
paint: MGTK_CALL MGTK::PaintBits, icon_paintbits_params ;; TODO: For windowed, consider similar logic to above
;; always draw mask, always xor normal
window:
MGTK_CALL MGTK::SetPenMode, notpencopy_2
bit icon_flags
bpl :+ ; highlighted? no, just draw
;; draw mask first, then xor the icon
MGTK_CALL MGTK::PaintBits, mask_paintbits_params
MGTK_CALL MGTK::SetPenMode, penXOR_2
: MGTK_CALL MGTK::PaintBits, icon_paintbits_params
continue:
ldy #IconEntry::win_type ldy #IconEntry::win_type
lda ($06),y lda ($06),y
and #icon_entry_open_mask and #icon_entry_open_mask
@ -1854,8 +1855,6 @@ loop: add16 icon_paintbits_params::viewloc::xcoord,x, icon_paintbits_params:
paint_icon_highlighted := paint_icon::highlighted paint_icon_highlighted := paint_icon::highlighted
PAD_TO $A182
;;; ============================================================ ;;; ============================================================
;;; v0 v1 ;;; v0 v1
@ -2233,6 +2232,8 @@ 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
;; Why this loopy thing? Handle obscured by windows??
: jsr LA6A3 : jsr LA6A3
jsr erase_desktop_icon jsr erase_desktop_icon
lda L9F93 lda L9F93
@ -2700,40 +2701,69 @@ LA923: lda setportbits_params2::cliprect::x2
rts rts
.endproc .endproc
PAD_TO $A980
;;; ============================================================ ;;; ============================================================
floppy140_pixels: floppy140_pixels:
.byte px(%1111111),px(%1111111),px(%1111111),px(%1111111) .byte px(%1111111),px(%1111111),px(%1111111),px(%1111110)
.byte px(%1100000),px(%0000011),px(%1000000),px(%0000110)
.byte px(%1100000),px(%0000011),px(%1000000),px(%0000110)
.byte px(%1100000),px(%0000011),px(%1000000),px(%0000110) .byte px(%1100000),px(%0000011),px(%1000000),px(%0000110)
.byte px(%1100000),px(%0000011),px(%1000000),px(%0000111)
.byte px(%1100000),px(%0000011),px(%1000000),px(%0000110) .byte px(%1100000),px(%0000011),px(%1000000),px(%0000110)
.byte px(%1100000),px(%0000011),px(%1000000),px(%0000111)
.byte px(%1100000),px(%0000000),px(%0000000),px(%0000110) .byte px(%1100000),px(%0000000),px(%0000000),px(%0000110)
.byte px(%1100000),px(%0000011),px(%1000000),px(%0000111) .byte px(%1100000),px(%0000011),px(%1000000),px(%0000110)
.byte px(%1100000),px(%0000111),px(%1100000),px(%0000110) .byte px(%1100000),px(%0000111),px(%1100000),px(%0000110)
.byte px(%1100000),px(%0000011),px(%1000000),px(%0000111) .byte px(%1100000),px(%0000011),px(%1000000),px(%0000110)
.byte px(%1100000),px(%0000000),px(%0000000),px(%0000110) .byte px(%1100000),px(%0000000),px(%0000000),px(%0000110)
.byte px(%1100000),px(%0000000),px(%0000000),px(%0000111)
.byte px(%1011000),px(%0000000),px(%0000000),px(%0000110)
.byte px(%1100000),px(%0000000),px(%0000000),px(%0000111)
.byte px(%1100000),px(%0000000),px(%0000000),px(%0000110) .byte px(%1100000),px(%0000000),px(%0000000),px(%0000110)
.byte px(%1111111),px(%1111111),px(%1111111),px(%1111111) .byte px(%0011000),px(%0000000),px(%0000000),px(%0000110)
.byte px(%1100000),px(%0000000),px(%0000000),px(%0000110)
.byte px(%1100000),px(%0000000),px(%0000000),px(%0000110)
.byte px(%1111111),px(%1111111),px(%1111111),px(%1111110)
floppy140_mask:
.byte px(%1111111),px(%1111111),px(%1111111),px(%1111110)
.byte px(%1111111),px(%1111111),px(%1111111),px(%1111110)
.byte px(%1111111),px(%1111111),px(%1111111),px(%1111110)
.byte px(%1111111),px(%1111111),px(%1111111),px(%1111110)
.byte px(%1111111),px(%1111111),px(%1111111),px(%1111110)
.byte px(%1111111),px(%1111111),px(%1111111),px(%1111110)
.byte px(%1111111),px(%1111111),px(%1111111),px(%1111110)
.byte px(%1111111),px(%1111111),px(%1111111),px(%1111110)
.byte px(%1111111),px(%1111111),px(%1111111),px(%1111110)
.byte px(%1111111),px(%1111111),px(%1111111),px(%1111110)
.byte px(%1111111),px(%1111111),px(%1111111),px(%1111110)
.byte px(%0011111),px(%1111111),px(%1111111),px(%1111110)
.byte px(%1111111),px(%1111111),px(%1111111),px(%1111110)
.byte px(%1111111),px(%1111111),px(%1111111),px(%1111110)
.byte px(%1111111),px(%1111111),px(%1111111),px(%1111110)
ramdisk_pixels: ramdisk_pixels:
.byte px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1111101) .byte px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1111100)
.byte px(%1100000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0001110) .byte px(%1100000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0001100)
.byte px(%1100000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0001101) .byte px(%1100000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0001100)
.byte px(%1100000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0001110) .byte px(%1100000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0001100)
.byte px(%1100000),px(%0001111),px(%1000111),px(%1100110),px(%0000110),px(%0001101) .byte px(%1100000),px(%0001111),px(%1000111),px(%1100110),px(%0000110),px(%0001100)
.byte px(%1100000),px(%0001100),px(%1100110),px(%0110111),px(%1011110),px(%0001110) .byte px(%1100000),px(%0001100),px(%1100110),px(%0110111),px(%1011110),px(%0001100)
.byte px(%1100000),px(%0001111),px(%1000111),px(%1110110),px(%1110110),px(%0001101) .byte px(%1100000),px(%0001111),px(%1000111),px(%1110110),px(%1110110),px(%0001100)
.byte px(%1100000),px(%0001100),px(%1100110),px(%0110110),px(%0000110),px(%0001110) .byte px(%1100000),px(%0001100),px(%1100110),px(%0110110),px(%0000110),px(%0001100)
.byte px(%1100000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0001101) .byte px(%1100000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0001100)
.byte px(%1111111),px(%1111111),px(%1111111),px(%1110011),px(%0011001),px(%1001110) .byte px(%1111111),px(%1111111),px(%1111111),px(%1110011),px(%0011001),px(%1001100)
.byte px(%1010101),px(%0101010),px(%1010101),px(%0110011),px(%0011001),px(%1001101) .byte px(%0000000),px(%0000000),px(%0000000),px(%0110011),px(%0011001),px(%1001100)
.byte px(%0101010),px(%1010101),px(%0101010),px(%1111111),px(%1111111),px(%1111110) .byte px(%0000000),px(%0000000),px(%0000000),px(%0111111),px(%1111111),px(%1111100)
ramdisk_mask:
.byte px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1111100)
.byte px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1111100)
.byte px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1111100)
.byte px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1111100)
.byte px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1111100)
.byte px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1111100)
.byte px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1111100)
.byte px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1111100)
.byte px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1111100)
.byte px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1111100)
.byte px(%0000000),px(%0000000),px(%0000000),px(%0111111),px(%1111111),px(%1111100)
.byte px(%0000000),px(%0000000),px(%0000000),px(%0111111),px(%1111111),px(%1111100)
floppy800_pixels: floppy800_pixels:
.byte px(%1111111),px(%1111111),px(%1111110) .byte px(%1111111),px(%1111111),px(%1111110)
@ -2749,21 +2779,47 @@ floppy800_pixels:
.byte px(%1100110),px(%0000000),px(%0110011) .byte px(%1100110),px(%0000000),px(%0110011)
.byte px(%1111111),px(%1111111),px(%1111111) .byte px(%1111111),px(%1111111),px(%1111111)
floppy800_mask:
.byte px(%1111111),px(%1111111),px(%1111110)
.byte px(%1111111),px(%1111111),px(%1111111)
.byte px(%1111111),px(%1111111),px(%1111111)
.byte px(%1111111),px(%1111111),px(%1111111)
.byte px(%1111111),px(%1111111),px(%1111111)
.byte px(%1111111),px(%1111111),px(%1111111)
.byte px(%1111111),px(%1111111),px(%1111111)
.byte px(%1111111),px(%1111111),px(%1111111)
.byte px(%1111111),px(%1111111),px(%1111111)
.byte px(%1111111),px(%1111111),px(%1111111)
.byte px(%1111111),px(%1111111),px(%1111111)
.byte px(%1111111),px(%1111111),px(%1111111)
profile_pixels: profile_pixels:
.byte px(%0111111),px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1110101) .byte px(%0111111),px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1110000)
.byte px(%1100000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0011010) .byte px(%1100000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0011000)
.byte px(%1100000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0011101) .byte px(%1100000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0011000)
.byte px(%1100000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0011010) .byte px(%1100000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0011000)
.byte px(%1100011),px(%1000000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0011101) .byte px(%1100011),px(%1000000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0011000)
.byte px(%1100000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0011101) .byte px(%1100000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0011000)
.byte px(%1100000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0011010) .byte px(%1100000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0011000)
.byte px(%1100000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0011101) .byte px(%1100000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0011000)
.byte px(%0111111),px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1110101) .byte px(%0111111),px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1110000)
.byte px(%1010111),px(%0101010),px(%1010101),px(%0101010),px(%1010101),px(%0101010),px(%1010111),px(%0101010) .byte px(%0000111),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0000111),px(%0000000)
profile_mask:
.byte px(%0111111),px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1110000)
.byte px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1111000)
.byte px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1111000)
.byte px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1111000)
.byte px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1111000)
.byte px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1111000)
.byte px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1111000)
.byte px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1111000)
.byte px(%0111111),px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1110000)
.byte px(%0000111),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0000111),px(%0000000)
trash_pixels: trash_pixels:
.byte px(%1010101),px(%1111111),px(%1010101) .byte px(%0000001),px(%1111111),px(%1000000)
.byte px(%0101011),px(%1000001),px(%1101010) .byte px(%0000011),px(%1000001),px(%1100000)
.byte px(%1111111),px(%1111111),px(%1111111) .byte px(%1111111),px(%1111111),px(%1111111)
.byte px(%1100000),px(%0000000),px(%0000011) .byte px(%1100000),px(%0000000),px(%0000011)
.byte px(%1111111),px(%1111111),px(%1111111) .byte px(%1111111),px(%1111111),px(%1111111)
@ -2781,6 +2837,28 @@ trash_pixels:
.byte px(%1100000),px(%0000000),px(%0000011) .byte px(%1100000),px(%0000000),px(%0000011)
.byte px(%1111111),px(%1111111),px(%1111111) .byte px(%1111111),px(%1111111),px(%1111111)
trash_mask:
.byte px(%0000001),px(%1111111),px(%1000000)
.byte px(%0000011),px(%1111111),px(%1100000)
.byte px(%1111111),px(%1111111),px(%1111111)
.byte px(%1111111),px(%1111111),px(%1111111)
.byte px(%1111111),px(%1111111),px(%1111111)
.byte px(%1111111),px(%1111111),px(%1111111)
.byte px(%1111111),px(%1111111),px(%1111111)
.byte px(%1111111),px(%1111111),px(%1111111)
.byte px(%1111111),px(%1111111),px(%1111111)
.byte px(%1111111),px(%1111111),px(%1111111)
.byte px(%1111111),px(%1111111),px(%1111111)
.byte px(%1111111),px(%1111111),px(%1111111)
.byte px(%1111111),px(%1111111),px(%1111111)
.byte px(%1111111),px(%1111111),px(%1111111)
.byte px(%1111111),px(%1111111),px(%1111111)
.byte px(%1111111),px(%1111111),px(%1111111)
.byte px(%1111111),px(%1111111),px(%1111111)
.byte px(%1111111),px(%1111111),px(%1111111)
;;; ============================================================
label_apple: label_apple:
PASCAL_STRING GLYPH_SAPPLE PASCAL_STRING GLYPH_SAPPLE
label_file: label_file:

View File

@ -820,6 +820,7 @@ floppy140_icon:
.byte 4 ; mapwidth .byte 4 ; mapwidth
.byte 0 ; reserved .byte 0 ; reserved
DEFINE_RECT 0, 0, 26, 14 ; maprect DEFINE_RECT 0, 0, 26, 14 ; maprect
.addr desktop_aux::floppy140_mask
;;; RAM Disk ;;; RAM Disk
ramdisk_icon: ramdisk_icon:
@ -827,6 +828,7 @@ ramdisk_icon:
.byte 6 ; mapwidth .byte 6 ; mapwidth
.byte 0 ; reserved .byte 0 ; reserved
DEFINE_RECT 0, 0, 39, 11 ; maprect DEFINE_RECT 0, 0, 39, 11 ; maprect
.addr desktop_aux::ramdisk_mask
;;; 3.5" Floppy Disk ;;; 3.5" Floppy Disk
floppy800_icon: floppy800_icon:
@ -834,6 +836,7 @@ floppy800_icon:
.byte 3 ; mapwidth .byte 3 ; mapwidth
.byte 0 ; reserved .byte 0 ; reserved
DEFINE_RECT 0, 0, 20, 11 ; maprect DEFINE_RECT 0, 0, 20, 11 ; maprect
.addr desktop_aux::floppy800_mask
;;; Hard Disk ;;; Hard Disk
profile_icon: profile_icon:
@ -841,6 +844,7 @@ profile_icon:
.byte 8 ; mapwidth .byte 8 ; mapwidth
.byte 0 ; reserved .byte 0 ; reserved
DEFINE_RECT 0, 0, 52, 9 ; maprect DEFINE_RECT 0, 0, 52, 9 ; maprect
.addr desktop_aux::profile_mask
;;; Trash Can ;;; Trash Can
trash_icon: trash_icon:
@ -848,6 +852,7 @@ trash_icon:
.byte 3 ; mapwidth .byte 3 ; mapwidth
.byte 0 ; reserved .byte 0 ; reserved
DEFINE_RECT 0, 0, 20, 17 ; maprect DEFINE_RECT 0, 0, 20, 17 ; maprect
.addr desktop_aux::trash_mask
;;; ============================================================ ;;; ============================================================