Rename the icon management logic in Aux 'Icon ToolKit'

This commit is contained in:
Joshua Bell 2019-07-28 16:54:06 -07:00
parent 24d318c274
commit daf6e87aec
19 changed files with 271 additions and 230 deletions

51
APIs.md
View File

@ -3,8 +3,8 @@
There are three distinct API classes that need to be used: There are three distinct API classes that need to be used:
* MouseGraphics ToolKit - graphics primitives, windowing and events * MouseGraphics ToolKit - graphics primitives, windowing and events
* Icon TookKit - internal API, MLI-style interface providing icon services
* DeskTop Jump Table - simple JSR calls starting at $4003 MAIN, no arguments * DeskTop Jump Table - simple JSR calls starting at $4003 MAIN, no arguments
* DeskTop API - another MLI-style interface starting at $8E00 AUX
In addition, some DeskTop data structures can be accessed directly. In addition, some DeskTop data structures can be accessed directly.
@ -68,9 +68,9 @@ Eject command
Redraws all DeskTop windows. Required after a drag or resize. Redraws all DeskTop windows. Required after a drag or resize.
Follow with `DT_REDRAW_ICONS` call. Follow with `DT_REDRAW_ICONS` call.
#### `JUMP_TABLE_DESKTOP_RELAY` ($4018) #### `JUMP_TABLE_ITK_RELAY` ($4018)
DESKTOP relay call (main>aux) Icon ToolKit relay call (main>aux)
#### `JUMP_TABLE_LOAD_OVL` ($401B) #### `JUMP_TABLE_LOAD_OVL` ($401B)
@ -135,76 +135,80 @@ Used when exiting DeskTop; exit DHR mode, restores DHR mode to color, restores d
<!-- ============================================================ --> <!-- ============================================================ -->
## DeskTop API ## Icon ToolKit
This is part of DeskTop (unlike MGTK), but is written to be (mostly) isolated from the rest of the application logic, depending only on MGTK.
* An internal table of icon number &rarr; IconEntry is maintained.
* An internal list of highlighted (selected) icons is maintained.
* Window-centric calls assume a GrafPort for the window is already the current GrafPort.
Call from AUX (RAMRDON/RAMWRTON). Call style: Call from AUX (RAMRDON/RAMWRTON). Call style:
``` ```
jsr $8E00 jsr IconTK::MLI
.byte command .byte command
.addr params .addr params
``` ```
Return value in A, 0=success. Return value in A, 0=success.
> NOTE: Only some of the calls have been identified.
Commands: Commands:
### `DT_ADD_ICON` ($01) ### `IconTK::ADD_ICON` ($01)
Parameters: { addr icondata } Parameters: { addr icondata }
Inserts an icon record into the table. Inserts an icon record into the table.
### `DT_HIGHLIGHT_ICON` ($02) ### `IconTK::HIGHLIGHT_ICON` ($02)
Parameters: { byte icon } Parameters: { byte icon }
Highlights (selects) an icon by number. Highlights (selects) an icon by number.
### `DT_REDRAW_ICON` ($03) ### `IconTK::REDRAW_ICON` ($03)
Parameters: { byte icon } Parameters: { byte icon }
Redraws an icon by number. Redraws an icon by number.
### `DT_REMOVE_ICON` ($04) ### `IconTK::REMOVE_ICON` ($04)
Parameters: { byte icon } Parameters: { byte icon }
Removes an icon by number. Removes an icon by number.
### `DT_HIGHLIGHT_ALL` ($05) ### `IconTK::HIGHLIGHT_ALL` ($05)
Parameters: { byte window_id } Parameters: { byte window_id }
Highlights (selects) all icons in specified window (0 = desktop). Highlights (selects) all icons in specified window (0 = desktop).
### `DT_REMOVE_ALL` ($06) ### `IconTK::REMOVE_ALL` ($06)
Parameters: { byte window_id } Parameters: { byte window_id }
Removes all icons from specified window (0 = desktop). Removes all icons from specified window (0 = desktop).
### `DT_CLOSE_WINDOW` ($07) ### `IconTK::CLOSE_WINDOW` ($07)
Parameters: { byte window_id } Parameters: { byte window_id }
Closes the specified window. Remove all icons associated with the specified window. No redrawing is done.
### `DT_GET_HIGHLIGHTED` ($08) ### `IconTK::GET_HIGHLIGHTED` ($08)
Parameters: { .res 20 } Parameters: { .res 20 }
Copies the numbers of the first 20 selected icons to the given buffer. Copies the numbers of the first 20 selected icons to the given buffer.
### `DT_FIND_ICON` ($09) ### `IconTK::FIND_ICON` ($09)
Parameters: { word mousex, word mousey, (out) byte result } Parameters: { word mousex, word mousey, (out) byte result }
Find the icon number at the given coordinates. Find the icon number at the given coordinates.
### `DT_DRAG_HIGHLIGHTED` ($0A) ### `IconTK::DRAG_HIGHLIGHTED` ($0A)
Parameters: { byte param } Parameters: { byte param }
@ -214,27 +218,26 @@ drop was on the desktop, high bit clear if the drop target was an icon
(and the low bits are the icon number), high bit set if the drop (and the low bits are the icon number), high bit set if the drop
target was a window (and the low bits are the window number). target was a window (and the low bits are the window number).
### `DT_UNHIGHLIGHT_ICON` ($0B) ### `IconTK::UNHIGHLIGHT_ICON` ($0B)
Parameters: { addr iconentry } Parameters: { addr iconentry }
Unhighlights the specified icon. Note that the address of the icon Unhighlights the specified icon. Note that the address of the IconEntry is passed, not the number.
entry is passed, not the number.
### `DT_REDRAW_ICONS` ($0C) ### `IconTK::REDRAW_ICONS` ($0C)
Parameters: none (pass $0000 as address) Parameters: none (pass $0000 as address)
Redraws the icons on the desktop (mounted volumes, trash). This call Redraws the icons on the desktop (mounted volumes, trash). This call
is required after destroying, moving, or resizing a desk accessory window. is required after destroying, moving, or resizing a desk accessory window.
### `DT_ICON_IN_RECT` ($0D) ### `IconTK::ICON_IN_RECT` ($0D)
Parameters: { byte icon, rect bounds } Parameters: { byte icon, rect bounds }
Tests to see if the given icon (by number) overlaps the passed rect. Tests to see if the given icon (by number) overlaps the passed rect.
### `DT_ERASE_ICON` ($0E) ### `IconTK::ERASE_ICON` ($0E)
Parameters: { byte icon } Parameters: { byte icon }

View File

@ -6,27 +6,28 @@ DAs are documented here.
### Desk Accessory Lifecycle ### Desk Accessory Lifecycle
* DAs are loaded/invoked at $800 MAIN * DAs are loaded/invoked at $800 Main
* Up to $1C00 MAIN is available * Up to $1C00 Main is available
* But AUX $1B00 and on must be preserved. * But Aux $1B00 and on must be preserved.
* Save stack pointer * Save stack pointer
* Copy DA code from MAIN to AUX (e.g. using `AUXMOVE`) at same address. * Copy DA code from Main to Aux (e.g. using `AUXMOVE`) at same address.
* Transfer control to the AUX copy * Needed if any MGTK resources will be used (bitmaps, etc)
* This allows direct access to MGTK/DeskTop MLI * Transfer control to the Aux copy (`RAMRDON`/`RAMWRTON`)
* Retaining a copy in MAIN allows easy access to ProDOS MLI * This allows direct access to MGTK/IconTK MLI
* Turn on ALTZP and LCBANK1 * Retaining a copy in Main allows easy access to ProDOS MLI
* Turn on ALTZP and LCBANK1 (should already be the case)
* Create window (`OpenWindow`) * Create window (`OpenWindow`)
* Draw everything * Draw everything
* Flush event queue (`FlushEvents`) * Flush event queue (`FlushEvents`)
* Run an event Loop (`GetEvent`, and subsequent processing, per MGTK) * Run an event Loop (`GetEvent`, and subsequent processing, per MGTK)
* Normal event processing per MGTK * Normal event processing per MGTK
* In addition, following a window drag/resize, DeskTop calls must be made: * In addition, following a window drag/resize, DeskTop calls must be made:
* `JUMP_TABLE_REDRAW_ALL` * `JUMP_TABLE_REDRAW_ALL` - redraw all windows
* `DESKTOP_REDRAW_ICONS` * `IconTK::REDRAW_ICONS` - redraw desktop (volume) icons
* ... * ...
* Destroy window (`CloseWindow`) * Destroy window (`CloseWindow`)
* Tell DeskTop to redraw desktop icons (`DESKTOP_REDRAW_ICONS`) * Tell DeskTop to redraw desktop icons (`IconTK::REDRAW_ICONS`)
* Switch control back to MAIN (`RAMRDOFF`/`RAMWRTOFF`) * Switch control back to Main (`RAMRDOFF`/`RAMWRTOFF`)
* Ensure ALTZP and LCBANK1 are still on * Ensure ALTZP and LCBANK1 are still on
* Restore stack pointer * Restore stack pointer
* `rts` * `rts`

View File

@ -80,7 +80,7 @@ save_stack: .byte 0
sta RAMWRTON sta RAMWRTON
;; Redraw DeskTop's icons. ;; Redraw DeskTop's icons.
DESKTOP_CALL DT_REDRAW_ICONS ITK_CALL IconTK::REDRAW_ICONS
;; Redraw window after event_kind_drag ;; Redraw window after event_kind_drag
jsr draw_content jsr draw_content
@ -765,7 +765,7 @@ ignore_click:
beq ignore_click beq ignore_click
exit: MGTK_CALL MGTK::CloseWindow, closewindow_params exit: MGTK_CALL MGTK::CloseWindow, closewindow_params
DESKTOP_CALL DT_REDRAW_ICONS ITK_CALL IconTK::REDRAW_ICONS
jmp exit_da jmp exit_da
: cmp #MGTK::Area::dragbar ; Title bar? : cmp #MGTK::Area::dragbar ; Title bar?

View File

@ -631,7 +631,7 @@ dialog_result: .byte 0
.proc destroy .proc destroy
MGTK_CALL MGTK::CloseWindow, closewindow_params MGTK_CALL MGTK::CloseWindow, closewindow_params
DESKTOP_CALL DT_REDRAW_ICONS ITK_CALL IconTK::REDRAW_ICONS
;; Copy the relay routine to the zero page ;; Copy the relay routine to the zero page
dest := $20 dest := $20

View File

@ -211,7 +211,7 @@ grow_box_bitmap:
.proc exit .proc exit
MGTK_CALL MGTK::CloseWindow, winfo MGTK_CALL MGTK::CloseWindow, winfo
DESKTOP_CALL DT_REDRAW_ICONS ITK_CALL IconTK::REDRAW_ICONS
rts rts
.endproc .endproc
@ -311,7 +311,7 @@ common: lda dragwindow_params::moved
jsr draw_window jsr draw_window
;; Draw DeskTop icons ;; Draw DeskTop icons
DESKTOP_CALL DT_REDRAW_ICONS ITK_CALL IconTK::REDRAW_ICONS
: jmp input_loop : jmp input_loop

View File

@ -592,7 +592,7 @@ continue:
.proc exit .proc exit
MGTK_CALL MGTK::CloseWindow, winfo MGTK_CALL MGTK::CloseWindow, winfo
DESKTOP_CALL DT_REDRAW_ICONS ITK_CALL IconTK::REDRAW_ICONS
rts ; exits input loop rts ; exits input loop
.endproc .endproc
@ -693,7 +693,7 @@ return_flag:
jsr draw_window jsr draw_window
;; Draw DeskTop icons ;; Draw DeskTop icons
DESKTOP_CALL DT_REDRAW_ICONS ITK_CALL IconTK::REDRAW_ICONS
: jmp input_loop : jmp input_loop

View File

@ -84,7 +84,7 @@ stash_stack: .byte 0
bit window_pos_flag bit window_pos_flag
bmi skip bmi skip
DESKTOP_CALL DT_REDRAW_ICONS ITK_CALL IconTK::REDRAW_ICONS
skip: lda #0 skip: lda #0
sta window_pos_flag sta window_pos_flag
@ -732,7 +732,7 @@ bail: rts
beq bail beq bail
destroy: destroy:
MGTK_CALL MGTK::CloseWindow, closewindow_params MGTK_CALL MGTK::CloseWindow, closewindow_params
DESKTOP_CALL DT_REDRAW_ICONS ITK_CALL IconTK::REDRAW_ICONS
target = $20 ; copy following to ZP and run it target = $20 ; copy following to ZP and run it
COPY_BYTES sizeof_routine+1, routine, target COPY_BYTES sizeof_routine+1, routine, target

View File

@ -169,7 +169,7 @@ exit:
;; Force desktop redraw ;; Force desktop redraw
MGTK_CALL MGTK::CloseWindow, winfo MGTK_CALL MGTK::CloseWindow, winfo
DESKTOP_CALL DT_REDRAW_ICONS ITK_CALL IconTK::REDRAW_ICONS
MGTK_CALL MGTK::ShowCursor MGTK_CALL MGTK::ShowCursor
rts ; exits input loop rts ; exits input loop

View File

@ -779,7 +779,7 @@ done: rts
.proc exit .proc exit
MGTK_CALL MGTK::CloseWindow, winfo MGTK_CALL MGTK::CloseWindow, winfo
DESKTOP_CALL DT_REDRAW_ICONS ITK_CALL IconTK::REDRAW_ICONS
rts ; exits input loop rts ; exits input loop
.endproc .endproc
@ -842,7 +842,7 @@ done: rts
jsr draw_window jsr draw_window
;; Draw DeskTop icons ;; Draw DeskTop icons
DESKTOP_CALL DT_REDRAW_ICONS ITK_CALL IconTK::REDRAW_ICONS
: jmp input_loop : jmp input_loop

View File

@ -13,7 +13,7 @@ VERSION_MINOR = 2
.define RELEASE_DATE "July 12, 2019" .define RELEASE_DATE "July 12, 2019"
DA_FILE_TYPE = $F1 DA_FILE_TYPE = $F1
DA_AUX_TYPE = $640 ; High bit set = don't show in Apple menu DA_Aux_TYPE = $640 ; High bit set = don't show in Apple menu
APP_FILE_TYPE = $01 ; FT_SYS w/ ".SYSTEM" (FT_BAD mapped to FT_TYPELESS) APP_FILE_TYPE = $01 ; FT_SYS w/ ".SYSTEM" (FT_BAD mapped to FT_TYPELESS)
@ -22,13 +22,23 @@ max_desk_acc_count = 12
INVOKER := $290 ; Invoke other programs INVOKER := $290 ; Invoke other programs
INVOKER_FILENAME := $280 ; File to invoke (PREFIX must be set) INVOKER_FILENAME := $280 ; File to invoke (PREFIX must be set)
DA_LOAD_ADDRESS := $800 ; Loaded into MAIN ;;; Desk Accessories are loaded in Main ($800-$1BFF) using
;;; an I/O buffer (Main $1C00-1FFF). DAs often copy themselves
;;; into Aux but can only use $800-$1AFF due to icon tables.
DA_LOAD_ADDRESS := $800 ; Loaded into Main
DA_IO_BUFFER := $1C00 ; ...through $1FFF DA_IO_BUFFER := $1C00 ; ...through $1FFF
DA_MAX_SIZE = DA_IO_BUFFER - DA_LOAD_ADDRESS DA_MAX_SIZE = DA_IO_BUFFER - DA_LOAD_ADDRESS
;; Can't load DA past I/O Buffer at MAIN $1C00,
;; but icon tables start at AUX $1B00 so can't clone there.
;;; Memory in AUX - $80 bytes for desktop and 8 windows. First byte is a ;;; Scratch area (in Aux) used during modal operations:
;;; * Given to MGTK to save background when menus are shown
;;; * Used by DeskTop to save background when alert dialog shown
;;; * Used by DeskTop to store icon outline polygons during drag
SAVE_AREA_BUFFER := $800 ; through $1AFF
SAVE_AREA_SIZE = $1300
;;; Memory in Aux - $80 bytes for desktop and 8 windows. First byte is a
;;; count, up to 127 icon entries. $1F80-$1FFF is a map of used/free icon ;;; count, up to 127 icon entries. $1F80-$1FFF is a map of used/free icon
;;; numbers. ;;; numbers.
WINDOW_ICON_TABLES := $1B00 WINDOW_ICON_TABLES := $1B00
@ -51,7 +61,7 @@ JUMP_TABLE_SELECT_WINDOW:= $400C ; Select and refresh given window
JUMP_TABLE_AUXLOAD := $400F ; Auxload JUMP_TABLE_AUXLOAD := $400F ; Auxload
JUMP_TABLE_EJECT := $4012 ; Eject command JUMP_TABLE_EJECT := $4012 ; Eject command
JUMP_TABLE_REDRAW_ALL := $4015 ; Redraw all windows (e.g. after a drag) * JUMP_TABLE_REDRAW_ALL := $4015 ; Redraw all windows (e.g. after a drag) *
JUMP_TABLE_DESKTOP_RELAY:= $4018 ; DESKTOP relay call (main>aux) JUMP_TABLE_ITK_RELAY := $4018 ; Icon ToolKit relay call (main>aux)
JUMP_TABLE_LOAD_OVL := $401B ; Load overlay routine JUMP_TABLE_LOAD_OVL := $401B ; Load overlay routine
JUMP_TABLE_CLEAR_SEL := $401E ; Clear DeskTop selection * JUMP_TABLE_CLEAR_SEL := $401E ; Clear DeskTop selection *
JUMP_TABLE_MLI := $4021 ; ProDOS MLI call (Y=call, X,A=params addr) * JUMP_TABLE_MLI := $4021 ; ProDOS MLI call (Y=call, X,A=params addr) *
@ -80,45 +90,47 @@ ERR_INSERT_DST_DISK = $FD
ERR_BASIC_SYS_NOT_FOUND = $FE ERR_BASIC_SYS_NOT_FOUND = $FE
;;; ============================================================ ;;; ============================================================
;;; API Calls (from aux memory) ;;; Icon ToolKit Calls (from aux memory)
.scope IconTK
;;; * = Used by Desk Accessories ;;; * = Used by Desk Accessories
DESKTOP := $8E00 MLI := $8E00
;; MLI-style call (jsr DEKSTOP ; .byte call ; .addr params) ;; MLI-style call (jsr IconTK::MLI ; .byte call ; .addr params)
;; Call from AUX (RAMRDON/RAMWRTON) ;; Call from Aux (RAMRDON/RAMWRTON)
;; Implementation bounces to $93BC, uses jump table at $939E ADD_ICON = $01 ; { .addr icondata }
HIGHLIGHT_ICON = $02 ; { .byte icon }
DT_ADD_ICON = $01 ; { .addr icondata } REDRAW_ICON = $03 ; { .byte icon }
DT_HIGHLIGHT_ICON = $02 ; { .byte icon } REMOVE_ICON = $04 ; { .byte icon }
DT_REDRAW_ICON = $03 ; { .byte icon } HIGHLIGHT_ALL = $05 ; { .byte window_id }
DT_REMOVE_ICON = $04 ; { .byte icon } REMOVE_ALL = $06 ; { .byte window_id }
DT_HIGHLIGHT_ALL = $05 ; { .byte window_id } CLOSE_WINDOW = $07 ; { .byte window_id }
DT_REMOVE_ALL = $06 ; { .byte window_id } GET_HIGHLIGHTED = $08 ; { .res 20 }
DT_CLOSE_WINDOW = $07 ; { .byte window_id } FIND_ICON = $09 ; { .word mousex, .word mousey, .byte result }
DT_GET_HIGHLIGHTED = $08 ; { .res 20 } DRAG_HIGHLIGHTED = $0A ; { .byte param }
DT_FIND_ICON = $09 ; { .word mousex, .word mousey, .byte result }
DT_DRAG_HIGHLIGHTED = $0A ; { .byte param }
; Input: specific icon being dragged ; Input: specific icon being dragged
; Output: 0 = on desktop (no-op) ; Output: 0 = on desktop (no-op)
; hi bit clear: low bits are target icon ; hi bit clear: low bits are target icon
; hi bit set: low bits are target window ; hi bit set: low bits are target window
DT_UNHIGHLIGHT_ICON = $0B ; { .addr iconentry } UNHIGHLIGHT_ICON = $0B ; { .addr iconentry }
DT_REDRAW_ICONS = $0C ; Repaints desktop icons * REDRAW_ICONS = $0C ; Repaints desktop icons *
DT_ICON_IN_RECT = $0D ; { .byte icon, rect bounds } ICON_IN_RECT = $0D ; { .byte icon, rect bounds }
DT_ERASE_ICON = $0E ; { .byte icon } ERASE_ICON = $0E ; { .byte icon }
;;; `icon` is the icon number, i.e. first field in icon entry ;;; `icon` is the icon number, i.e. first field in icon entry
;;; `icon_index` is the index in the icon table ;;; `icon_index` is the index in the icon table
;;; Call a DESKTOP entry point: .endscope ; IconTK
;;; DESKTOP_CALL n - params is $0000
;;; DESKTOP_CALL n, params_addr
;;; DESKTOP_CALL m, params_addr, label - params_addr is labeled for modifying
.macro DESKTOP_CALL op, addr, label ;;; Call a IconTK entry point:
jsr DESKTOP ;;; ITK_CALL n - params is $0000
;;; ITK_CALL n, params_addr
;;; ITK_CALL m, params_addr, label - params_addr is labeled for modifying
.macro ITK_CALL op, addr, label
jsr IconTK::MLI
.byte op .byte op
.if .paramcount > 2 .if .paramcount > 2
@ -137,7 +149,7 @@ label := *
;;; Relays from Main to Aux (params must be in ZP or LC) ;;; Relays from Main to Aux (params must be in ZP or LC)
MGTK_RELAY := $D000 MGTK_RELAY := $D000
DESKTOP_RELAY := $D040 ITK_RELAY := $D040
.macro MGTK_RELAY_CALL call, addr .macro MGTK_RELAY_CALL call, addr
.if .paramcount > 1 .if .paramcount > 1
@ -147,11 +159,11 @@ DESKTOP_RELAY := $D040
.endif .endif
.endmacro .endmacro
.macro DESKTOP_RELAY_CALL call, addr .macro ITK_RELAY_CALL call, addr
.if .paramcount > 1 .if .paramcount > 1
yax_call DESKTOP_RELAY, (call), (addr) yax_call ITK_RELAY, (call), (addr)
.else .else
yax_call DESKTOP_RELAY, (call), 0 yax_call ITK_RELAY, (call), 0
.endif .endif
.endmacro .endmacro

View File

@ -220,13 +220,14 @@ basic_mask:
PAD_TO $8E00 PAD_TO $8E00
;;; ============================================================ ;;; ============================================================
;;; Entry point for "DESKTOP" ;;; Entry point for "Icon TookKit"
;;; ============================================================ ;;; ============================================================
.assert * = DESKTOP, error, "DESKTOP entry point must be at $8E00" .assert * = IconTK::MLI, error, "IconTK entry point must be at $8E00"
jmp DESKTOP_DIRECT .proc icon_toolkit
jmp ITK_DIRECT
;;; ============================================================ ;;; ============================================================
@ -325,8 +326,8 @@ highlight_list: ; selected icons
;;; Re-use the "save area" ($800-$1AFF) since menus won't show during ;;; Re-use the "save area" ($800-$1AFF) since menus won't show during
;;; this operation. ;;; this operation.
drag_outline_buffer := save_area_buffer drag_outline_buffer := SAVE_AREA_BUFFER
max_draggable_items = save_area_size / (.sizeof(MGTK::Point) * 8 + 2) max_draggable_items = SAVE_AREA_SIZE / (.sizeof(MGTK::Point) * 8 + 2)
;;; ============================================================ ;;; ============================================================
@ -356,7 +357,7 @@ textbg: .byte MGTK::textbg_black
fontptr: .addr DEFAULT_FONT fontptr: .addr DEFAULT_FONT
.endproc .endproc
;;; Grafport used to draw icon outlines during ;;; Grafport used to draw icon outlines during drag
.proc drag_outline_grafport .proc drag_outline_grafport
viewloc: DEFINE_POINT 0, 0, viewloc viewloc: DEFINE_POINT 0, 0, viewloc
mapbits: .addr 0 mapbits: .addr 0
@ -393,7 +394,7 @@ fontptr: .addr 0
.endproc .endproc
;;; ============================================================ ;;; ============================================================
;;; DESKTOP command jump table ;;; IconTK command jump table
desktop_jump_table: desktop_jump_table:
.addr 0 .addr 0
@ -412,15 +413,15 @@ desktop_jump_table:
.addr ICON_IN_RECT_IMPL .addr ICON_IN_RECT_IMPL
.addr ERASE_ICON_IMPL .addr ERASE_ICON_IMPL
.macro DESKTOP_DIRECT_CALL op, addr, label .macro ITK_DIRECT_CALL op, addr, label
jsr DESKTOP_DIRECT jsr ITK_DIRECT
.byte op .byte op
.addr addr .addr addr
.endmacro .endmacro
;;; DESKTOP entry point (after jump) ;;; IconTK entry point (after jump)
.proc DESKTOP_DIRECT .proc ITK_DIRECT
;; Stash return value from stack, adjust by 3 ;; Stash return value from stack, adjust by 3
;; (command byte, params addr) ;; (command byte, params addr)
@ -588,10 +589,10 @@ L949D: ldx highlight_count
ldy #IconEntry::id ldy #IconEntry::id
lda (ptr),y ; icon num lda (ptr),y ; icon num
sta icon sta icon
DESKTOP_DIRECT_CALL DT_REDRAW_ICON, icon ITK_DIRECT_CALL IconTK::REDRAW_ICON, icon
return #0 ; Highlighted return #0 ; Highlighted
;; DT_REDRAW_ICON params ;; IconTK::REDRAW_ICON params
icon: .byte 0 icon: .byte 0
.endproc .endproc
@ -766,7 +767,7 @@ ptr_window_id: .addr 0
ptr := $08 ptr := $08
;; DT_HIGHLIGHT_ICON params ;; IconTK::HIGHLIGHT_ICON params
icon: .byte 0 icon: .byte 0
buffer: .res 127, 0 buffer: .res 127, 0
@ -775,7 +776,7 @@ start: lda HIGHLIGHT_ICON_IMPL ; ???
beq start2 beq start2
lda highlight_list lda highlight_list
sta icon sta icon
DESKTOP_DIRECT_CALL DT_UNHIGHLIGHT_ICON, icon ITK_DIRECT_CALL IconTK::UNHIGHLIGHT_ICON, icon
jmp start jmp start
start2: start2:
@ -823,7 +824,7 @@ loop2: lda buffer,x
rts rts
: sta icon : sta icon
DESKTOP_DIRECT_CALL DT_HIGHLIGHT_ICON, icon ITK_DIRECT_CALL IconTK::HIGHLIGHT_ICON, icon
pla pla
tax tax
inx inx
@ -846,7 +847,7 @@ ptr_window_id: .addr 0
icon_ptr := $08 icon_ptr := $08
;; DT_REMOVE_ICON params ;; IconTK::REMOVE_ICON params
icon: .byte 0 icon: .byte 0
count: .byte 0 count: .byte 0
@ -870,7 +871,7 @@ loop: ldx count
ldy #0 ldy #0
cmp (params::ptr_window_id),y cmp (params::ptr_window_id),y
bne loop bne loop
DESKTOP_DIRECT_CALL DT_REMOVE_ICON, icon ITK_DIRECT_CALL IconTK::REMOVE_ICON, icon
jmp loop jmp loop
done: return #0 done: return #0
@ -879,35 +880,43 @@ done: return #0
;;; ============================================================ ;;; ============================================================
;;; CLOSE_WINDOW IMPL ;;; CLOSE_WINDOW IMPL
;;; param is window id
.proc CLOSE_WINDOW_IMPL .proc CLOSE_WINDOW_IMPL
jmp L96D7 PARAM_BLOCK params, $06
window_id: .addr 0
END_PARAM_BLOCK
L96D5: .byte 0 ptr := $08
L96D6: .byte 0
L96D7: lda num_icons jmp start
sta L96D6
L96DD: ldx L96D6 icon: .byte 0
count: .byte 0
start: lda num_icons
sta count
loop: ldx count
bne L96E5 bne L96E5
return #0 return #0
L96E5: dec L96D6 L96E5: dec count
dex dex
lda icon_table,x lda icon_table,x
sta L96D5 sta icon
asl a asl a
tax tax
copy16 icon_ptrs,x, $08 copy16 icon_ptrs,x, ptr
ldy #IconEntry::win_type ldy #IconEntry::win_type
lda ($08),y lda (ptr),y
and #icon_entry_winid_mask and #icon_entry_winid_mask ; check window
ldy #0 ldy #0
cmp ($06),y cmp (params::window_id),y ; match?
bne L96DD bne loop ; nope
;; Move to end of icon list ;; Move to end of icon list
ldy #IconEntry::id ldy #IconEntry::id
lda ($08),y ; icon num lda (ptr),y ; icon num
ldx num_icons ; icon index ldx num_icons ; icon index
jsr change_icon_index jsr change_icon_index
@ -917,12 +926,12 @@ L96E5: dec L96D6
sta icon_table,x sta icon_table,x
ldy #IconEntry::state ldy #IconEntry::state
lda #0 lda #0
sta ($08),y sta (ptr),y
lda has_highlight lda has_highlight
beq L9758 beq L9758
ldx #0 ldx #0
ldy #0 ldy #0
L972B: lda ($08),y L972B: lda (ptr),y
cmp highlight_list,x cmp highlight_list,x
beq L973B beq L973B
inx inx
@ -930,7 +939,7 @@ L972B: lda ($08),y
bne L972B bne L972B
jmp L9758 jmp L9758
L973B: lda ($08),y ; icon num L973B: lda (ptr),y ; icon num
ldx highlight_count ; new position ldx highlight_count ; new position
jsr change_highlight_index jsr change_highlight_index
dec highlight_count dec highlight_count
@ -941,7 +950,7 @@ L973B: lda ($08),y ; icon num
L9750: lda #0 L9750: lda #0
ldx highlight_count ldx highlight_count
sta highlight_list,x sta highlight_list,x
L9758: jmp L96DD L9758: jmp loop
.endproc .endproc
;;; ============================================================ ;;; ============================================================
@ -1028,7 +1037,7 @@ L97F6: .byte 0
;;; ============================================================ ;;; ============================================================
;;; DESKTOP DRAG_HIGHLIGHTED IMPL ;;; IconTK DRAG_HIGHLIGHTED IMPL
.proc DRAG_HIGHLIGHTED .proc DRAG_HIGHLIGHTED
ldy #IconEntry::id ldy #IconEntry::id
@ -1063,7 +1072,7 @@ icon_id:
deltax: .word 0 deltax: .word 0
deltay: .word 0 deltay: .word 0
;; DT_HIGHLIGHT_ICON params ;; IconTK::HIGHLIGHT_ICON params
highlight_icon_id: .byte $00 highlight_icon_id: .byte $00
L9831: .byte $00 L9831: .byte $00
@ -1160,7 +1169,7 @@ L98F2: lda highlight_count,x
ldx #$80 ldx #$80
stx L9833 stx L9833
L9909: sta L9834 L9909: sta L9834
DESKTOP_DIRECT_CALL DT_ICON_IN_RECT, L9834 ITK_DIRECT_CALL IconTK::ICON_IN_RECT, L9834
beq L9954 beq L9954
jsr calc_icon_poly jsr calc_icon_poly
lda L9C74 lda L9C74
@ -1298,13 +1307,13 @@ L9A31: COPY_BYTES 4, findwindow_params2, L9C92
beq L9A84 beq L9A84
lda L9831 lda L9831
sta findwindow_params2::window_id sta findwindow_params2::window_id
DESKTOP_DIRECT_CALL DT_FIND_ICON, findwindow_params2 ITK_DIRECT_CALL IconTK::FIND_ICON, findwindow_params2
lda findwindow_params2::which_area lda findwindow_params2::which_area
cmp highlight_icon_id cmp highlight_icon_id
beq L9A84 beq L9A84
jsr xdraw_outline jsr xdraw_outline
MGTK_CALL MGTK::SetPort, icon_grafport MGTK_CALL MGTK::SetPort, icon_grafport
DESKTOP_DIRECT_CALL DT_UNHIGHLIGHT_ICON, highlight_icon_id ITK_DIRECT_CALL IconTK::UNHIGHLIGHT_ICON, highlight_icon_id
jsr xdraw_outline jsr xdraw_outline
lda #0 lda #0
sta highlight_icon_id sta highlight_icon_id
@ -1386,7 +1395,7 @@ L9BA5: jsr xdraw_outline
lda highlight_icon_id lda highlight_icon_id
beq :+ beq :+
MGTK_CALL MGTK::SetPort, icon_grafport MGTK_CALL MGTK::SetPort, icon_grafport
DESKTOP_DIRECT_CALL DT_UNHIGHLIGHT_ICON, highlight_icon_id ITK_DIRECT_CALL IconTK::UNHIGHLIGHT_ICON, highlight_icon_id
jmp L9C63 jmp L9C63
: MGTK_CALL MGTK::FindWindow, findwindow_params2 : MGTK_CALL MGTK::FindWindow, findwindow_params2
@ -1583,7 +1592,7 @@ L9E1A: jsr push_pointers
lda findwindow_params2::which_area lda findwindow_params2::which_area
bne L9E2B bne L9E2B
sta findwindow_params2::window_id sta findwindow_params2::window_id
L9E2B: DESKTOP_DIRECT_CALL DT_FIND_ICON, findwindow_params2 L9E2B: ITK_DIRECT_CALL IconTK::FIND_ICON, findwindow_params2
lda findwindow_params2::which_area ; Icon ID lda findwindow_params2::which_area ; Icon ID
bne L9E39 bne L9E39
jmp L9E97 jmp L9E97
@ -1611,7 +1620,7 @@ L9E3D: cmp highlight_list,x
: sta highlight_icon_id : sta highlight_icon_id
jsr xdraw_outline jsr xdraw_outline
MGTK_CALL MGTK::SetPort, icon_grafport MGTK_CALL MGTK::SetPort, icon_grafport
DESKTOP_DIRECT_CALL DT_HIGHLIGHT_ICON, highlight_icon_id ITK_DIRECT_CALL IconTK::HIGHLIGHT_ICON, highlight_icon_id
jsr xdraw_outline jsr xdraw_outline
L9E97: jsr pop_pointers L9E97: jsr pop_pointers
rts rts
@ -1667,10 +1676,10 @@ start: lda has_highlight
: ldy #IconEntry::id : ldy #IconEntry::id
lda (params::ptr_iconent),y lda (params::ptr_iconent),y
sta icon sta icon
DESKTOP_DIRECT_CALL DT_REDRAW_ICON, icon ITK_DIRECT_CALL IconTK::REDRAW_ICON, icon
return #0 return #0
;; DT_REDRAW_ICON params ;; IconTK::REDRAW_ICON params
icon: .byte 0 icon: .byte 0
.endproc .endproc
@ -2071,40 +2080,44 @@ text_width: .byte 0
;;; REDRAW_ICONS IMPL ;;; REDRAW_ICONS IMPL
.proc REDRAW_ICONS_IMPL .proc REDRAW_ICONS_IMPL
jmp LA2AE ptr := $06
;; DT_REDRAW_ICON params jmp start
LA2A9: .byte 0
LA2AA: jsr pop_pointers ;; IconTK::REDRAW_ICON params
icon: .byte 0
done: jsr pop_pointers
rts rts
LA2AE: jsr push_pointers start: jsr push_pointers
MGTK_CALL MGTK::InitPort, icon_grafport MGTK_CALL MGTK::InitPort, icon_grafport
MGTK_CALL MGTK::SetPort, icon_grafport MGTK_CALL MGTK::SetPort, icon_grafport
ldx num_icons ldx num_icons
dex dex
LA2B5: bmi LA2AA loop: bmi done
txa txa
pha pha
lda icon_table,x lda icon_table,x
asl a asl a
tax tax
copy16 icon_ptrs,x, $06 copy16 icon_ptrs,x, ptr
ldy #IconEntry::win_type ldy #IconEntry::win_type
lda ($06),y lda (ptr),y
and #icon_entry_winid_mask and #icon_entry_winid_mask ; desktop icon
bne LA2DD bne next ; no, skip it
ldy #0
lda ($06),y ldy #IconEntry::id
sta LA2A9 lda (ptr),y
DESKTOP_DIRECT_CALL DT_REDRAW_ICON, LA2A9 sta icon
LA2DD: pla ITK_DIRECT_CALL IconTK::REDRAW_ICON, icon
next: pla
tax tax
dex dex
jmp LA2B5 jmp loop
.endproc .endproc
;;; ============================================================ ;;; ============================================================
@ -2260,7 +2273,7 @@ erase_icon:
LA3AC: .byte 0 LA3AC: .byte 0
LA3AD: .byte 0 LA3AD: .byte 0
;; DT_REDRAW_ICON params ;; IconTK::REDRAW_ICON params
LA3AE: .byte 0 LA3AE: .byte 0
LA3AF: .word 0 LA3AF: .word 0
@ -2296,7 +2309,7 @@ window_id: .byte 0
jsr offset_icon_poly jsr offset_icon_poly
jsr shift_port_down ; Further offset by window's items/used/free bar jsr shift_port_down ; Further offset by window's items/used/free bar
jsr erase_window_icon jsr erase_window_icon
jmp LA446 jmp redraw_icons_after_erase
;; Volume (i.e. icon on desktop) ;; Volume (i.e. icon on desktop)
volume: volume:
@ -2307,7 +2320,7 @@ volume:
lda more_drawing_needed_flag lda more_drawing_needed_flag
bne :- bne :-
MGTK_CALL MGTK::SetPortBits, grafport ; default maprect MGTK_CALL MGTK::SetPortBits, grafport ; default maprect
jmp LA446 jmp redraw_icons_after_erase
.endproc .endproc
;;; ============================================================ ;;; ============================================================
@ -2330,8 +2343,9 @@ volume:
.endproc .endproc
;;; ============================================================ ;;; ============================================================
;;; After erasing an icon, redraw any overlapping icons
.proc LA446 .proc redraw_icons_after_erase
ptr := $8 ptr := $8
jsr push_pointers jsr push_pointers
@ -2381,10 +2395,10 @@ LA49D: ldy #IconEntry::id ; icon num
bit LA3B7 ; windowed? bit LA3B7 ; windowed?
bpl LA4AC ; nope, desktop bpl LA4AC ; nope, desktop
jsr offset_icon_do ; yes, adjust rect jsr offset_icon_do ; yes, adjust rect
LA4AC: DESKTOP_DIRECT_CALL DT_ICON_IN_RECT, LA3AE LA4AC: ITK_DIRECT_CALL IconTK::ICON_IN_RECT, LA3AE
beq :+ beq :+
DESKTOP_DIRECT_CALL DT_REDRAW_ICON, LA3AE ITK_DIRECT_CALL IconTK::REDRAW_ICON, LA3AE
: bit LA3B7 : bit LA3B7
bpl next bpl next
@ -2958,6 +2972,8 @@ vert: cmp16 win_t, cr_t
rts rts
.endproc .endproc
.endproc ; icon_toolkit
;;; ============================================================ ;;; ============================================================
floppy140_pixels: floppy140_pixels:
@ -3970,7 +3986,7 @@ LBDE1: sub16 event_xcoord, portmap::viewloc::xcoord, event_xcoord
ptr := $06 ptr := $06
.proc save .proc save
copy16 #save_area_buffer, addr copy16 #SAVE_AREA_BUFFER, addr
lda LBFC9 lda LBFC9
jsr LBF10 jsr LBF10
lda LBFCB lda LBFCB
@ -4006,7 +4022,7 @@ LBE5C: .byte 0
.endproc .endproc
.proc restore .proc restore
copy16 #save_area_buffer, addr copy16 #SAVE_AREA_BUFFER, addr
ldx LBFCD ldx LBFCD
ldy LBFCE ldy LBFCE
lda #$FF lda #$FF
@ -4048,7 +4064,7 @@ LBEAE: lda LBF0B
sta PAGE2ON ; aux $2000-$3FFF sta PAGE2ON ; aux $2000-$3FFF
addr := *+1 addr := *+1
: lda save_area_buffer ; self-modified : lda SAVE_AREA_BUFFER ; self-modified
pha pha
lda LBF0B lda LBF0B

View File

@ -53,15 +53,15 @@
.endproc .endproc
;;; ============================================================ ;;; ============================================================
;;; DESKTOP call from main>aux, call in Y params at (X,A) ;;; IconTK call from main>aux, call in Y params at (X,A)
.proc DTRelayImpl .proc ITKRelayImpl
.assert * = DESKTOP_RELAY, error, "Entry point mismatch" .assert * = ITK_RELAY, error, "Entry point mismatch"
sty addr-1 sty addr-1
stax addr stax addr
sta RAMRDON sta RAMRDON
sta RAMWRTON sta RAMWRTON
DESKTOP_CALL 0, 0, addr ITK_CALL 0, 0, addr
tay tay
sta RAMRDOFF sta RAMRDOFF
sta RAMWRTOFF sta RAMWRTOFF

View File

@ -42,7 +42,7 @@ JT_SELECT_WINDOW: jmp select_and_refresh_window
JT_AUXLOAD: jmp AuxLoad JT_AUXLOAD: jmp AuxLoad
JT_EJECT: jmp cmd_eject JT_EJECT: jmp cmd_eject
JT_REDRAW_ALL: jmp redraw_windows ; * JT_REDRAW_ALL: jmp redraw_windows ; *
JT_DESKTOP_RELAY: jmp DESKTOP_RELAY JT_ITK_RELAY: jmp ITK_RELAY
JT_LOAD_OVL: jmp load_dynamic_routine JT_LOAD_OVL: jmp load_dynamic_routine
JT_CLEAR_SELECTION: jmp clear_selection ; * JT_CLEAR_SELECTION: jmp clear_selection ; *
JT_MLI_RELAY: jmp MLI_RELAY ; * JT_MLI_RELAY: jmp MLI_RELAY ; *
@ -75,8 +75,8 @@ iloop: cpx cached_window_icon_count
pha pha
lda cached_window_icon_list,x lda cached_window_icon_list,x
jsr icon_entry_lookup jsr icon_entry_lookup
ldy #DT_ADD_ICON ldy #IconTK::ADD_ICON
jsr DESKTOP_RELAY ; icon entry addr in A,X jsr ITK_RELAY ; icon entry addr in A,X
pla pla
tax tax
inx inx
@ -187,7 +187,7 @@ L412B: jsr LoadDesktopIconTable
jsr redraw_selected_icons jsr redraw_selected_icons
L4143: bit L40F1 L4143: bit L40F1
bpl L4151 bpl L4151
DESKTOP_RELAY_CALL DT_REDRAW_ICONS ITK_RELAY_CALL IconTK::REDRAW_ICONS
L4151: rts L4151: rts
.endproc .endproc
@ -261,9 +261,9 @@ L41FE: lda L4241
beq L4227 beq L4227
tax tax
copy cached_window_icon_list,x, icon_param copy cached_window_icon_list,x, icon_param
DESKTOP_RELAY_CALL DT_ICON_IN_RECT, icon_param ITK_RELAY_CALL IconTK::ICON_IN_RECT, icon_param
beq :+ beq :+
DESKTOP_RELAY_CALL DT_REDRAW_ICON, icon_param ITK_RELAY_CALL IconTK::REDRAW_ICON, icon_param
: inc L4241 : inc L4241
jmp L41FE jmp L41FE
@ -310,9 +310,9 @@ window: lda num
tax tax
copy selected_icon_list,x, icon_param copy selected_icon_list,x, icon_param
jsr icon_screen_to_window jsr icon_screen_to_window
DESKTOP_RELAY_CALL DT_ICON_IN_RECT, icon_param ITK_RELAY_CALL IconTK::ICON_IN_RECT, icon_param
beq :+ beq :+
DESKTOP_RELAY_CALL DT_REDRAW_ICON, icon_param ITK_RELAY_CALL IconTK::REDRAW_ICON, icon_param
: lda icon_param : lda icon_param
jsr icon_window_to_screen jsr icon_window_to_screen
inc num inc num
@ -327,7 +327,7 @@ desktop:
beq done beq done
tax tax
copy selected_icon_list,x, icon_param copy selected_icon_list,x, icon_param
DESKTOP_RELAY_CALL DT_REDRAW_ICON, icon_param ITK_RELAY_CALL IconTK::REDRAW_ICON, icon_param
inc num inc num
jmp desktop jmp desktop
@ -527,7 +527,7 @@ call_proc:
jsr detect_double_click jsr detect_double_click
sta double_click_flag sta double_click_flag
copy #0, findwindow_window_id copy #0, findwindow_window_id
DESKTOP_RELAY_CALL DT_FIND_ICON, event_coords ITK_RELAY_CALL IconTK::FIND_ICON, event_coords
lda findicon_which_icon lda findicon_which_icon
beq :+ beq :+
jmp handle_volume_icon_click jmp handle_volume_icon_click
@ -608,7 +608,7 @@ start: jsr clear_selection
and #icon_entry_winid_mask and #icon_entry_winid_mask
sta winid sta winid
jsr zero_grafport5_coords jsr zero_grafport5_coords
DESKTOP_RELAY_CALL DT_HIGHLIGHT_ICON, icon_param ITK_RELAY_CALL IconTK::HIGHLIGHT_ICON, icon_param
jsr reset_grafport3 jsr reset_grafport3
copy winid, selected_window_index copy winid, selected_window_index
copy #1, selected_icon_count copy #1, selected_icon_count
@ -657,7 +657,7 @@ continue:
.proc redraw_windows_and_desktop .proc redraw_windows_and_desktop
jsr redraw_windows jsr redraw_windows
DESKTOP_RELAY_CALL DT_REDRAW_ICONS ITK_RELAY_CALL IconTK::REDRAW_ICONS
rts rts
.endproc .endproc
@ -931,7 +931,7 @@ begin:
: lda #ERR_FILE_NOT_OPENABLE : lda #ERR_FILE_NOT_OPENABLE
jsr show_alert_and_fail jsr show_alert_and_fail
launch: DESKTOP_RELAY_CALL DT_REMOVE_ALL, 0 ; volume icons launch: ITK_RELAY_CALL IconTK::REMOVE_ALL, 0 ; volume icons
MGTK_RELAY_CALL MGTK::CloseAll MGTK_RELAY_CALL MGTK::CloseAll
MGTK_RELAY_CALL MGTK::SetMenu, blank_menu MGTK_RELAY_CALL MGTK::SetMenu, blank_menu
ldx buf_win_path ldx buf_win_path
@ -2266,8 +2266,8 @@ L518D: lda L51EF
tax tax
lda cached_window_icon_list,x lda cached_window_icon_list,x
jsr icon_entry_lookup jsr icon_entry_lookup
ldy #DT_ADD_ICON ldy #IconTK::ADD_ICON
jsr DESKTOP_RELAY ; icon entry addr in A,X jsr ITK_RELAY ; icon entry addr in A,X
inc L51EF inc L51EF
jmp L518D jmp L518D
@ -2285,7 +2285,7 @@ L51C0: ldx L51EF
sta icon_param sta icon_param
jsr icon_screen_to_window jsr icon_screen_to_window
jsr offset_grafport2_and_set jsr offset_grafport2_and_set
DESKTOP_RELAY_CALL DT_HIGHLIGHT_ICON, icon_param ITK_RELAY_CALL IconTK::HIGHLIGHT_ICON, icon_param
lda icon_param lda icon_param
jsr icon_window_to_screen jsr icon_window_to_screen
dec L51EF dec L51EF
@ -2451,7 +2451,7 @@ L5265: .byte 0
;;; ============================================================ ;;; ============================================================
.proc close_active_window .proc close_active_window
DESKTOP_RELAY_CALL DT_CLOSE_WINDOW, active_window_id ITK_RELAY_CALL IconTK::CLOSE_WINDOW, active_window_id
jsr LoadActiveWindowIconTable jsr LoadActiveWindowIconTable
lda icon_count lda icon_count
sec sec
@ -2713,7 +2713,7 @@ L5485: cpx cached_window_icon_count
lda cached_window_icon_list,x lda cached_window_icon_list,x
sta icon_param sta icon_param
jsr icon_screen_to_window jsr icon_screen_to_window
DESKTOP_RELAY_CALL DT_ICON_IN_RECT, icon_param ITK_RELAY_CALL IconTK::ICON_IN_RECT, icon_param
pha pha
lda icon_param lda icon_param
jsr icon_window_to_screen jsr icon_window_to_screen
@ -2875,7 +2875,7 @@ L55F0: ldx L544A
jsr L56F9 jsr L56F9
lda icon_param lda icon_param
jsr icon_screen_to_window jsr icon_screen_to_window
L5614: DESKTOP_RELAY_CALL DT_HIGHLIGHT_ICON, icon_param L5614: ITK_RELAY_CALL IconTK::HIGHLIGHT_ICON, icon_param
lda getwinport_params2::window_id lda getwinport_params2::window_id
beq L562B beq L562B
lda icon_param lda icon_param
@ -2894,7 +2894,7 @@ L562C: lda icon_param
jsr L56F9 jsr L56F9
lda icon_param lda icon_param
jsr icon_screen_to_window jsr icon_screen_to_window
L564A: DESKTOP_RELAY_CALL DT_UNHIGHLIGHT_ICON, icon_param L564A: ITK_RELAY_CALL IconTK::UNHIGHLIGHT_ICON, icon_param
lda getwinport_params2::window_id lda getwinport_params2::window_id
beq L5661 beq L5661
lda icon_param lda icon_param
@ -2942,7 +2942,7 @@ L56B4: ldx L56F8
beq L56CF beq L56CF
lda icon_param2 lda icon_param2
jsr icon_screen_to_window jsr icon_screen_to_window
L56CF: DESKTOP_RELAY_CALL DT_HIGHLIGHT_ICON, icon_param2 L56CF: ITK_RELAY_CALL IconTK::HIGHLIGHT_ICON, icon_param2
lda LE22C lda LE22C
beq L56E3 beq L56E3
lda icon_param2 lda icon_param2
@ -3231,7 +3231,7 @@ L5916: lda cached_window_icon_list,x
lda cached_window_icon_list,x lda cached_window_icon_list,x
sta icon_param sta icon_param
copy #0, cached_window_icon_list,x copy #0, cached_window_icon_list,x
DESKTOP_RELAY_CALL DT_REMOVE_ICON, icon_param ITK_RELAY_CALL IconTK::REMOVE_ICON, icon_param
lda icon_param lda icon_param
jsr FreeIcon jsr FreeIcon
dec cached_window_icon_count dec cached_window_icon_count
@ -3275,8 +3275,8 @@ L5986: txa
cmp trash_icon_num cmp trash_icon_num
beq L5998 beq L5998
jsr icon_entry_lookup jsr icon_entry_lookup
ldy #DT_ADD_ICON ldy #IconTK::ADD_ICON
jsr DESKTOP_RELAY ; icon entry addr in A,X jsr ITK_RELAY ; icon entry addr in A,X
L5998: pla L5998: pla
tax tax
inx inx
@ -3432,7 +3432,7 @@ not_in_map:
lda icon_param lda icon_param
jsr FreeIcon jsr FreeIcon
jsr reset_grafport3 jsr reset_grafport3
DESKTOP_RELAY_CALL DT_REMOVE_ICON, icon_param ITK_RELAY_CALL IconTK::REMOVE_ICON, icon_param
: lda cached_window_icon_count : lda cached_window_icon_count
sta previous_icon_count sta previous_icon_count
@ -3470,8 +3470,8 @@ add_icon:
dex dex
lda cached_window_icon_list,x lda cached_window_icon_list,x
jsr icon_entry_lookup jsr icon_entry_lookup
ldy #DT_ADD_ICON ldy #IconTK::ADD_ICON
jsr DESKTOP_RELAY ; icon entry addr in A,X jsr ITK_RELAY ; icon entry addr in A,X
: jsr StoreWindowIconTable : jsr StoreWindowIconTable
jmp redraw_windows_and_desktop jmp redraw_windows_and_desktop
@ -3718,7 +3718,7 @@ ctl: .byte 0
jmp clear_selection jmp clear_selection
: copy active_window_id, findicon_window_id : copy active_window_id, findicon_window_id
DESKTOP_RELAY_CALL DT_FIND_ICON, findicon_params ITK_RELAY_CALL IconTK::FIND_ICON, findicon_params
lda findicon_which_icon lda findicon_which_icon
bne handle_file_icon_click bne handle_file_icon_click
jsr L5F13 jsr L5F13
@ -3768,7 +3768,7 @@ replace:
copy icon_num, icon_param copy icon_num, icon_param
jsr icon_screen_to_window jsr icon_screen_to_window
jsr offset_grafport2_and_set jsr offset_grafport2_and_set
DESKTOP_RELAY_CALL DT_HIGHLIGHT_ICON, icon_param ITK_RELAY_CALL IconTK::HIGHLIGHT_ICON, icon_param
copy active_window_id, getwinport_params2::window_id copy active_window_id, getwinport_params2::window_id
jsr get_set_port2 jsr get_set_port2
@ -3784,7 +3784,7 @@ replace:
start_icon_drag: start_icon_drag:
copy icon_num, drag_drop_param copy icon_num, drag_drop_param
DESKTOP_RELAY_CALL DT_DRAG_HIGHLIGHTED, drag_drop_param ITK_RELAY_CALL IconTK::DRAG_HIGHLIGHTED, drag_drop_param
tax tax
lda drag_drop_param lda drag_drop_param
beq desktop beq desktop
@ -3850,7 +3850,7 @@ desktop:
pha pha
lda selected_icon_list,x lda selected_icon_list,x
sta redraw_icon_param sta redraw_icon_param
DESKTOP_RELAY_CALL DT_REDRAW_ICON, redraw_icon_param ITK_RELAY_CALL IconTK::REDRAW_ICON, redraw_icon_param
pla pla
tax tax
dex dex
@ -4071,9 +4071,9 @@ L5F88: txa
lda cached_window_icon_list,x lda cached_window_icon_list,x
sta icon_param sta icon_param
jsr icon_screen_to_window jsr icon_screen_to_window
DESKTOP_RELAY_CALL DT_ICON_IN_RECT, icon_param ITK_RELAY_CALL IconTK::ICON_IN_RECT, icon_param
beq L5FB9 beq L5FB9
DESKTOP_RELAY_CALL DT_HIGHLIGHT_ICON, icon_param ITK_RELAY_CALL IconTK::HIGHLIGHT_ICON, icon_param
ldx selected_icon_count ldx selected_icon_count
inc selected_icon_count inc selected_icon_count
copy icon_param, selected_icon_list,x copy icon_param, selected_icon_list,x
@ -4256,7 +4256,7 @@ handle_close_click:
sbc cached_window_icon_count sbc cached_window_icon_count
sta icon_count sta icon_count
DESKTOP_RELAY_CALL DT_CLOSE_WINDOW, active_window_id ITK_RELAY_CALL IconTK::CLOSE_WINDOW, active_window_id
jsr free_cached_window_icons jsr free_cached_window_icons
@ -4294,7 +4294,7 @@ cont: sta cached_window_icon_count
and #icon_entry_winid_mask and #icon_entry_winid_mask
sta selected_window_index sta selected_window_index
jsr zero_grafport5_coords jsr zero_grafport5_coords
DESKTOP_RELAY_CALL DT_HIGHLIGHT_ICON, icon_param ITK_RELAY_CALL IconTK::HIGHLIGHT_ICON, icon_param
jsr reset_grafport3 jsr reset_grafport3
copy #1, selected_icon_count copy #1, selected_icon_count
copy icon_param, selected_icon_list copy icon_param, selected_icon_list
@ -4822,7 +4822,7 @@ L67F6: bit BUTN0
;; Add clicked icon to selection ;; Add clicked icon to selection
lda selected_window_index lda selected_window_index
bne replace_selection bne replace_selection
DESKTOP_RELAY_CALL DT_HIGHLIGHT_ICON, findicon_which_icon ITK_RELAY_CALL IconTK::HIGHLIGHT_ICON, findicon_which_icon
ldx selected_icon_count ldx selected_icon_count
lda findicon_which_icon lda findicon_which_icon
sta selected_icon_list,x sta selected_icon_list,x
@ -4835,7 +4835,7 @@ replace_selection:
;; Set selection to clicked icon ;; Set selection to clicked icon
set_selection: set_selection:
DESKTOP_RELAY_CALL DT_HIGHLIGHT_ICON, findicon_which_icon ITK_RELAY_CALL IconTK::HIGHLIGHT_ICON, findicon_which_icon
copy #1, selected_icon_count copy #1, selected_icon_count
copy findicon_which_icon, selected_icon_list copy findicon_which_icon, selected_icon_list
copy #0, selected_window_index copy #0, selected_window_index
@ -4846,7 +4846,7 @@ L6834: bit double_click_flag
;; Drag of volume icon ;; Drag of volume icon
copy findicon_which_icon, drag_drop_param copy findicon_which_icon, drag_drop_param
DESKTOP_RELAY_CALL DT_DRAG_HIGHLIGHTED, drag_drop_param ITK_RELAY_CALL IconTK::DRAG_HIGHLIGHTED, drag_drop_param
tax tax
lda drag_drop_param lda drag_drop_param
beq L6878 beq L6878
@ -4889,7 +4889,7 @@ L688F: ldx selected_icon_count
L6893: txa L6893: txa
pha pha
copy selected_icon_list,x, icon_param3 copy selected_icon_list,x, icon_param3
DESKTOP_RELAY_CALL DT_REDRAW_ICON, icon_param3 ITK_RELAY_CALL IconTK::REDRAW_ICON, icon_param3
pla pla
tax tax
dex dex
@ -4918,7 +4918,7 @@ L68B8: lda event_coords,x
beq L68CF beq L68CF
rts rts
L68CF: MGTK_RELAY_CALL MGTK::SetPattern, desktop_aux::checkerboard_pattern L68CF: MGTK_RELAY_CALL MGTK::SetPattern, checkerboard_pattern
jsr set_penmode_xor jsr set_penmode_xor
MGTK_RELAY_CALL MGTK::FrameRect, tmp_rect MGTK_RELAY_CALL MGTK::FrameRect, tmp_rect
L68E4: jsr peek_event L68E4: jsr peek_event
@ -4936,9 +4936,9 @@ L68F9: cpx cached_window_icon_count
: txa : txa
pha pha
copy cached_window_icon_list,x, icon_param copy cached_window_icon_list,x, icon_param
DESKTOP_RELAY_CALL DT_ICON_IN_RECT, icon_param ITK_RELAY_CALL IconTK::ICON_IN_RECT, icon_param
beq L692C beq L692C
DESKTOP_RELAY_CALL DT_HIGHLIGHT_ICON, icon_param ITK_RELAY_CALL IconTK::HIGHLIGHT_ICON, icon_param
ldx selected_icon_count ldx selected_icon_count
inc selected_icon_count inc selected_icon_count
copy icon_param, selected_icon_list,x copy icon_param, selected_icon_list,x
@ -5199,8 +5199,8 @@ update_view:
tax tax
lda cached_window_icon_list,x lda cached_window_icon_list,x
jsr icon_entry_lookup ; A,X points at IconEntry jsr icon_entry_lookup ; A,X points at IconEntry
ldy #DT_ADD_ICON ldy #IconTK::ADD_ICON
jsr DESKTOP_RELAY ; icon entry addr in A,X jsr ITK_RELAY ; icon entry addr in A,X
inc num inc num
jmp :- jmp :-
@ -5235,7 +5235,7 @@ done: copy cached_window_id, active_window_id
jsr offset_grafport2_and_set jsr offset_grafport2_and_set
lda icon_params2 lda icon_params2
jsr icon_screen_to_window jsr icon_screen_to_window
: DESKTOP_RELAY_CALL DT_REDRAW_ICON, icon_params2 : ITK_RELAY_CALL IconTK::REDRAW_ICON, icon_params2
lda getwinport_params2::window_id lda getwinport_params2::window_id
beq done ; skip if on desktop beq done ; skip if on desktop
@ -5375,9 +5375,9 @@ L6D09: txa
pha pha
lda cached_window_icon_list,x lda cached_window_icon_list,x
sta icon_param sta icon_param
DESKTOP_RELAY_CALL DT_ICON_IN_RECT, icon_param ITK_RELAY_CALL IconTK::ICON_IN_RECT, icon_param
beq L6D25 beq L6D25
DESKTOP_RELAY_CALL DT_REDRAW_ICON, icon_param ITK_RELAY_CALL IconTK::REDRAW_ICON, icon_param
L6D25: pla L6D25: pla
tax tax
inx inx
@ -5409,7 +5409,7 @@ L6D56: lda L6DB0
lda selected_icon_list,x lda selected_icon_list,x
sta icon_param sta icon_param
jsr icon_screen_to_window jsr icon_screen_to_window
DESKTOP_RELAY_CALL DT_UNHIGHLIGHT_ICON, icon_param ITK_RELAY_CALL IconTK::UNHIGHLIGHT_ICON, icon_param
lda icon_param lda icon_param
jsr icon_window_to_screen jsr icon_window_to_screen
inc L6DB0 inc L6DB0
@ -5421,7 +5421,7 @@ L6D7D: lda L6DB0
tax tax
lda selected_icon_list,x lda selected_icon_list,x
sta icon_param sta icon_param
DESKTOP_RELAY_CALL DT_UNHIGHLIGHT_ICON, icon_param ITK_RELAY_CALL IconTK::UNHIGHLIGHT_ICON, icon_param
inc L6DB0 inc L6DB0
jmp L6D7D jmp L6D7D
@ -9332,7 +9332,7 @@ L8D56: .word 0
lda #0 lda #0
sta step sta step
jsr reset_grafport3 jsr reset_grafport3
MGTK_RELAY_CALL MGTK::SetPattern, desktop_aux::checkerboard_pattern MGTK_RELAY_CALL MGTK::SetPattern, checkerboard_pattern
jsr set_penmode_xor jsr set_penmode_xor
loop: lda step loop: lda step
@ -9397,7 +9397,7 @@ step: .byte 0
lda #11 lda #11
sta step sta step
jsr reset_grafport3 jsr reset_grafport3
MGTK_RELAY_CALL MGTK::SetPattern, desktop_aux::checkerboard_pattern MGTK_RELAY_CALL MGTK::SetPattern, checkerboard_pattern
jsr set_penmode_xor jsr set_penmode_xor
loop: lda step loop: lda step
@ -10210,7 +10210,7 @@ done: stx buf
.proc redraw_desktop_and_windows .proc redraw_desktop_and_windows
jsr JT_REDRAW_ALL jsr JT_REDRAW_ALL
yax_call JT_DESKTOP_RELAY, DT_REDRAW_ICONS, 0 yax_call JT_ITK_RELAY, IconTK::REDRAW_ICONS, 0
rts rts
.endproc .endproc
@ -10816,7 +10816,7 @@ L969E: lda #$40
ldx L9706 ldx L9706
lda selected_icon_list,x lda selected_icon_list,x
sta icon_param2 sta icon_param2
yax_call JT_DESKTOP_RELAY, DT_ERASE_ICON, icon_param2 yax_call JT_ITK_RELAY, IconTK::ERASE_ICON, icon_param2
copy16 L9707, $08 copy16 L9707, $08
ldx L9706 ldx L9706
lda selected_icon_list,x lda selected_icon_list,x

View File

@ -146,9 +146,6 @@ fontptr: .addr DEFAULT_FONT
;;; ============================================================ ;;; ============================================================
save_area_buffer := $800
save_area_size = $1300
;; Copies of ROM bytes used for machine identification ;; Copies of ROM bytes used for machine identification
.proc startdesktop_params .proc startdesktop_params
machine: .byte $06 ; ROM FBB3 ($06 = IIe or later) machine: .byte $06 ; ROM FBB3 ($06 = IIe or later)
@ -157,8 +154,8 @@ op_sys: .byte 0 ; 0=ProDOS
slot_num: .byte 0 ; Mouse slot, 0 = search slot_num: .byte 0 ; Mouse slot, 0 = search
use_interrupts: .byte 0 ; 0=passive use_interrupts: .byte 0 ; 0=passive
sysfontptr: .addr DEFAULT_FONT sysfontptr: .addr DEFAULT_FONT
savearea: .addr save_area_buffer savearea: .addr SAVE_AREA_BUFFER
savesize: .word save_area_size savesize: .word SAVE_AREA_SIZE
.endproc .endproc
zp_use_flag0: zp_use_flag0:
@ -1008,21 +1005,21 @@ window_filerecord_table:
.byte $00,$1E,$00,$32,$00,$1E,$00,$40 .byte $00,$1E,$00,$32,$00,$1E,$00,$40
.byte $00 .byte $00
;; DT_HIGHLIGHT_ICON params ;; IconTK::HIGHLIGHT_ICON params
icon_param2: icon_param2:
.byte 0 .byte 0
LE22C: .byte 0 LE22C: .byte 0
;; DT_HIGHLIGHT_ICON params ;; IconTK::HIGHLIGHT_ICON params
icon_param3: icon_param3:
.byte 0 .byte 0
redraw_icon_param: redraw_icon_param:
.byte 0 .byte 0
;; DT_HIGHLIGHT_ICON params ;; IconTK::HIGHLIGHT_ICON params
;; DT_UNHIGHLIGHT_ICON params ;; IconTK::UNHIGHLIGHT_ICON params
icon_param: .byte 0 icon_param: .byte 0
;; Used for all sorts of temporary work ;; Used for all sorts of temporary work
@ -1208,7 +1205,7 @@ blank_dd_label:
dummy_dd_item: dummy_dd_item:
PASCAL_STRING "Rien" ; ??? PASCAL_STRING "Rien" ; ???
;; DT_UNHIGHLIGHT_ICON params ;; IconTK::UNHIGHLIGHT_ICON params
icon_params2: icon_params2:
.byte 0 .byte 0
@ -1471,6 +1468,18 @@ fto_table:
.byte 0 ; sentinel at end of table .byte 0 ; sentinel at end of table
;;; --------------------------------------------------
checkerboard_pattern:
.byte %01010101
.byte %10101010
.byte %01010101
.byte %10101010
.byte %01010101
.byte %10101010
.byte %01010101
.byte %10101010
;;; -------------------------------------------------- ;;; --------------------------------------------------
PAD_TO $ED00 PAD_TO $ED00

View File

@ -43,7 +43,7 @@ str_desktop2:
start: lda #$80 start: lda #$80
sta ptr sta ptr
DESKTOP_RELAY_CALL DT_REMOVE_ALL, 0 ; volume icons ITK_RELAY_CALL IconTK::REMOVE_ALL, 0 ; volume icons
MGTK_RELAY_CALL MGTK::CloseAll MGTK_RELAY_CALL MGTK::CloseAll
MGTK_RELAY_CALL MGTK::SetZP1, ptr MGTK_RELAY_CALL MGTK::SetZP1, ptr

View File

@ -1024,7 +1024,7 @@ _DA specific: Use the following steps instead:_
* If not `moved` - done * If not `moved` - done
* Call `JUMP_TABLE_REDRAW_ALL` so DeskTop can redraw its windows * Call `JUMP_TABLE_REDRAW_ALL` so DeskTop can redraw its windows
* [Redraw](#redraw-window) window content * [Redraw](#redraw-window) window content
* Call `DESKTOP_REDRAW_ICONS` so DeskTop can redraw the desktop (volume) icons * Call `IconTK::REDRAW_ICONS` so DeskTop can redraw the desktop (volume) icons
#### Handle Window Close #### Handle Window Close
@ -1062,7 +1062,7 @@ _DA specific:_
In addition to the above steps: In addition to the above steps:
* Call `JUMP_TABLE_REDRAW_ALL` _before_ redrawing the DA window. * Call `JUMP_TABLE_REDRAW_ALL` _before_ redrawing the DA window.
* Call `DESKTOP_REDRAW_ICONS` _after_ redrawing the DA window. * Call `IconTK::REDRAW_ICONS` _after_ redrawing the DA window.
#### Handle Update Events #### Handle Update Events

View File

@ -300,7 +300,7 @@ char_label: .byte 0
.proc exit .proc exit
MGTK_CALL MGTK::CloseWindow, winfo MGTK_CALL MGTK::CloseWindow, winfo
DESKTOP_CALL DT_REDRAW_ICONS ITK_CALL IconTK::REDRAW_ICONS
rts ; exits input loop rts ; exits input loop
.endproc .endproc
@ -365,7 +365,7 @@ char_label: .byte 0
jsr draw_window jsr draw_window
;; Draw DeskTop icons ;; Draw DeskTop icons
DESKTOP_CALL DT_REDRAW_ICONS ITK_CALL IconTK::REDRAW_ICONS
: jmp input_loop : jmp input_loop

View File

@ -394,7 +394,7 @@ exit:
;; Force desktop redraw ;; Force desktop redraw
MGTK_CALL MGTK::CloseWindow, winfo MGTK_CALL MGTK::CloseWindow, winfo
DESKTOP_CALL DT_REDRAW_ICONS ITK_CALL IconTK::REDRAW_ICONS
MGTK_CALL MGTK::ShowCursor MGTK_CALL MGTK::ShowCursor
rts ; exits input loop rts ; exits input loop

View File

@ -557,7 +557,7 @@ no_mod:
.proc do_close .proc do_close
jsr close_file jsr close_file
MGTK_CALL MGTK::CloseWindow, winfo MGTK_CALL MGTK::CloseWindow, winfo
DESKTOP_CALL DT_REDRAW_ICONS ITK_CALL IconTK::REDRAW_ICONS
rts ; exits input loop rts ; exits input loop
.endproc .endproc
@ -839,7 +839,7 @@ end: rts
.endproc .endproc
.proc finish_resize ; only called from dead code .proc finish_resize ; only called from dead code
DESKTOP_CALL DT_REDRAW_ICONS ITK_CALL IconTK::REDRAW_ICONS
MGTK_CALL MGTK::SetPort, winfo::port MGTK_CALL MGTK::SetPort, winfo::port
lda winfo::hscroll lda winfo::hscroll
ror a ; check if low bit (track enabled) is set ror a ; check if low bit (track enabled) is set