From 1ae615fb20d8a8f777ccac96df1b149118a4814c Mon Sep 17 00:00:00 2001 From: Joshua Bell Date: Sun, 28 Jan 2018 21:18:00 -0800 Subject: [PATCH] Rename A2D to MGTK --- desk.acc/README.md | 2 +- desk.acc/a2d.md | 54 +- desk.acc/calc_fixed.s | 148 +-- desk.acc/calculator.s | 154 +-- desk.acc/date.s | 142 +-- desk.acc/puzzle.s | 80 +- desk.acc/res/convert_font.pl | 2 +- desk.acc/res/hex2px.pl | 2 +- desk.acc/show_image_file.s | 40 +- desk.acc/show_text_file.s | 120 +- desktop.inc | 4 +- desktop/Makefile | 4 +- desktop/README.md | 8 +- desktop/desktop.s | 1102 +++++++++--------- desktop/loader.s | 2 +- desktop/{a2d.s => mgtk.s} | 219 ++-- desktop/orig/{DESKTOP2_a2d => DESKTOP2_mgtk} | Bin a2d.inc => mgtk.inc | 353 +++--- 18 files changed, 1252 insertions(+), 1184 deletions(-) rename desktop/{a2d.s => mgtk.s} (97%) rename desktop/orig/{DESKTOP2_a2d => DESKTOP2_mgtk} (100%) rename a2d.inc => mgtk.inc (61%) diff --git a/desk.acc/README.md b/desk.acc/README.md index 242b7b3..8bcf126 100644 --- a/desk.acc/README.md +++ b/desk.acc/README.md @@ -13,7 +13,7 @@ New desk accessories: * Loaded at $800 through (at least) $14FF * Copy themselves from Main into Aux memory (same location) -* Can call into ProDOS MLI and A2D entry points ($4000, etc) +* Can call into ProDOS MLI and MGTK/A2D entry points ($4000, etc) ## Files diff --git a/desk.acc/a2d.md b/desk.acc/a2d.md index f3e219e..046d713 100644 --- a/desk.acc/a2d.md +++ b/desk.acc/a2d.md @@ -1,32 +1,32 @@ -# A2D API +# MGTK API There are three distinct API classes that need to be used: -* Main A2D API - entry point $4000 AUX, called MLI-style (JSR followed by command type and address of param block) +* Main MGTK API - entry point $4000 AUX, called MLI-style (JSR followed by command type and address of param block) * DeskTop Jump Table - simple JSR calls starting at $4003 MAIN, no arguments * DeskTop API - another MLI-style interface starting at $8E00 AUX -## Main A2D API +## Main MGTK API ### Concepts -#### Box +#### GrafPort -The _box_ block is reused in several places. It has the following structure: +The _port_ block is reused in several places. It has the following structure: ``` .word left pixels from screen left edge .word top pixels from screen top edge - .addr addr A2D_SCREEN_ADDR ($2000) - .word stride A2D_SCREEN_STRIDE ($80) + .addr addr screen address $2000 + .word stride screen stride $80 .word hoff pixels scrolled left .word voff pixels scrolled up .word width pixels wide .word height pixels tall ``` -Drawing state can be set to a box (A2D_SET_BOX) and then subsequent operations will occur -within the box: they will be clipped to the bounds and the offset will be taken into account. +Drawing state can be set to a port (SetPort) and then subsequent operations will occur +within the port: they will be clipped to the bounds and the offset will be taken into account. For example, if hoffset is 15 and voffset is 5 then a pixel plotted at 40, 40 will appear at 40 - 15 = 25 pixels from the left edge and 40 - 5 = 35 pixels from the top edge. @@ -48,12 +48,12 @@ optional _resize box_ and optional _scroll bars_. * Copy DA code from MAIN to AUX (e.g. using AUXMOVE) * Transfer control to AUX * Turn on ALTZP and LCBANK1 -* Create window (A2D_CREATE_WINDOW) +* Create window (OpenWindow) * Draw everything * Call $2B (no idea what this does!) * Enter [input loop](#input-loop) * ... -* Destroy window (A2D_DESTROY_WINDOW) +* Destroy window (CloseWindow) * Redraw desktop icons (DESKTOP_REDRAW_ICONS) * Switch control back to MAIN (RAMRDOFF/RAMWRTOFF) * Ensure ALTZP and LCBANK1 are on @@ -66,26 +66,26 @@ optional _resize box_ and optional _scroll bars_. #### Input Loop -* Call A2D_GET_INPUT. -* If a key (A2D_INPUT_KEY), then check modifiers (Open/Closed Apple) and key code, ignore or take action. -* If a click, call A2D_QUERY_TARGET. +* Call GetEvent. +* If a key, then check modifiers (Open/Closed Apple) and key code, ignore or take action. +* If a click, call FindWindow. * If target id not the window id, ignore. -* If target element is desktop (A2D_ELEM_DESKTOP) or menu (A2D_ELEM_MENU) then ignore. -* If target element is close box (A2D_ELEM_CLOSE) then initiate [window close](#window-close). -* If target element is title bar (A2D_ELEM_TITLE) then initiate [window drag](#window-drag). -* If target element is resize box (A2D_ELEM_RESIZE) then initiate [window resize](#window-resize). -* Otherwise, it is client area (A2D_ELEM_CLIENT); call A2D_QUERY_CLIENT. -* If client part is a scrollbar (A2D_VSCROLL or A2D_HSCROLL) then initiate a [scroll](#window-scroll). +* If target element is desktop or menu then ignore. +* If target element is close box then initiate [window close](#window-close). +* If target element is title bar then initiate [window drag](#window-drag). +* If target element is resize box then initiate [window resize](#window-resize). +* Otherwise, it is client area; call FindControl. +* If client part is a scrollbar then initiate a [scroll](#window-scroll). * Otherwise, handle a client click using custom logic (e.g. hit testing buttons, etc) #### Window Close -* Call A2D_CLOSE_CLICK, which enters a modal loop to handle the mouse moving out/in the box. +* Call TrackGoAway, which enters a modal loop to handle the mouse moving out/in the box. * Result indicates clicked or canceled; if clicked, exit the DA, otherwise ignore. #### Window Drag -* Call A2D_DRAG_WINDOW. +* Call DragWindow. * Call JUMP_TABLE_REDRAW_ALL. * If _offscreen flag_ was not set, redraw desktop icons (DESKTOP_REDRAW_ICONS). * Set _offscreen flag_ if window's `top` is greater than or equal to the screen bottom (191), clear otherwise. @@ -93,10 +93,10 @@ optional _resize box_ and optional _scroll bars_. #### Window Resize -* Call A2D_DRAG_RESIZE. +* Call GrowWindow. * Call JUMP_TABLE_REDRAW_ALL. * Call DESKTOP_REDRAW_ICONS. -* Call A2D_RESIZE_WINDOW if needed to adjust scroll bar settings. (Details TBD). +* Call UpdateThumb if needed to adjust scroll bar settings. (Details TBD). * Redraw window. #### Window Scroll @@ -155,6 +155,6 @@ Parameters: none (pass $0000 as address) Redraws the icons on the desktop (mounted volumes, trash). This call is required in these cases: -* After destroying a window (A2D_DESTROY_WINDOW) -* After repainting the desktop (JUMP_TABLE_REDRAW_ALL) following a drag (A2D_DRAG_WINDOW) -* After repainting the desktop (JUMP_TABLE_REDRAW_ALL) following a resize (A2D_DRAG_RESIZE/A2D_RESIZE_WINDOW) +* After destroying a window (CloseWindow) +* After repainting the desktop (JUMP_TABLE_REDRAW_ALL) following a drag (DragWindow) +* After repainting the desktop (JUMP_TABLE_REDRAW_ALL) following a resize (GrowWindow) diff --git a/desk.acc/calc_fixed.s b/desk.acc/calc_fixed.s index ab48369..261ac01 100644 --- a/desk.acc/calc_fixed.s +++ b/desk.acc/calc_fixed.s @@ -6,7 +6,7 @@ .include "../inc/applesoft.inc" .include "../inc/prodos.inc" - .include "../a2d.inc" + .include "../mgtk.inc" .include "../desktop.inc" ; redraw icons after window move; font .org $800 @@ -104,8 +104,8 @@ call_init: lda #window_id jsr check_visibility_and_draw_window - A2D_CALL A2D_QUERY_STATE, query_state_params - A2D_CALL A2D_SET_STATE, state_params + MGTK_CALL MGTK::GetWinPort, query_state_params + MGTK_CALL MGTK::SetPort, state_params rts .proc routine @@ -142,8 +142,8 @@ offscreen_flag: ;; Is skipping this responsible for display redraw bug? ;; https://github.com/inexorabletash/a2d/issues/34 - A2D_CALL A2D_QUERY_STATE, query_state_params - A2D_CALL A2D_SET_STATE, state_params + MGTK_CALL MGTK::GetWinPort, query_state_params + MGTK_CALL MGTK::SetPort, state_params lda query_state_params_id cmp #window_id bne :+ @@ -202,11 +202,11 @@ id: .byte 0 query_state_params_id := query_state_params::id .proc preserve_zp_params -flag: .byte A2D_CZP_PRESERVE +flag: .byte MGTK::zp_preserve .endproc .proc overwrite_zp_params -flag: .byte A2D_CZP_OVERWRITE +flag: .byte MGTK::zp_overwrite .endproc ;;; ================================================== @@ -660,9 +660,9 @@ text_buffer2: .res text_buffer_size+2, 0 spaces_string: - A2D_DEFSTRING " " + DEFINE_STRING " " error_string: - A2D_DEFSTRING "Error " + DEFINE_STRING "Error " ;; used when clearing display; params to a $18 call .proc measure_text_params @@ -694,7 +694,7 @@ base: .word 16 farg: .byte $00,$00,$00,$00,$00,$00 -.proc title_bar_decoration ; Params for A2D_DRAW_BITMAP +.proc title_bar_decoration ; Params for MGTK::PaintBits left: .word 115 ; overwritten top: .word $FFF7 ; overwritten bitmap:.addr pixels @@ -740,25 +740,25 @@ font: .addr 0 screen_width := 560 screen_height := 192 - ;; params for A2D_SET_BOX when decorating title bar + ;; params for MGTK::SetPortSite when decorating title bar .proc screen_box .word 0 .word menu_bar_height - .word A2D_SCREEN_ADDR - .word A2D_SCREEN_STRIDE + .word MGTK::screen_mapbits + .word MGTK::screen_mapwidth .word 0, 0 ; hoff/voff .word screen_width - 1 .word screen_height - menu_bar_height - 2 .endproc .proc fill_mode_normal -mode: .byte A2D_SFM_NORMAL +mode: .byte MGTK::pencopy .endproc .byte $01,$02 ; ?? .proc fill_mode_xor -mode: .byte A2D_SFM_XOR +mode: .byte MGTK::notpenXOR .endproc window_width := 130 @@ -768,10 +768,10 @@ mode: .byte A2D_SFM_XOR .proc create_window_params id: .byte window_id -flags: .byte A2D_CWF_ADDCLOSE +flags: .byte MGTK::option_go_away_box title: .addr window_title -hscroll:.byte A2D_CWS_NOSCROLL -vscroll:.byte A2D_CWS_NOSCROLL +hscroll:.byte MGTK::scroll_option_none +vscroll:.byte MGTK::scroll_option_none hs_max: .byte 0 hs_pos: .byte 0 vs_max: .byte 0 @@ -783,15 +783,15 @@ w2: .word window_width h2: .word window_height left: .word default_left top: .word default_top -addr: .addr A2D_SCREEN_ADDR -stride: .word A2D_SCREEN_STRIDE +addr: .addr MGTK::screen_mapbits +stride: .word MGTK::screen_mapwidth hoff: .word 0 voff: .word 0 width: .word window_width height: .word window_height pattern:.res 8, $FF -mskand: .byte A2D_DEFAULT_MSKAND -mskor: .byte A2D_DEFAULT_MSKOR +mskand: .byte MGTK::colormask_and +mskor: .byte MGTK::colormask_or xpos: .word 0 ypos: .word 0 hthick: .byte 1 @@ -812,11 +812,11 @@ window_title: init: sta ALTZPON lda LCBANK1 lda LCBANK1 - A2D_CALL A2D_CONFIGURE_ZP_USE, preserve_zp_params - A2D_CALL A2D_CREATE_WINDOW, create_window_params - A2D_CALL A2D_QUERY_SCREEN, state_params - A2D_CALL A2D_SET_STATE, state_params - A2D_CALL $2B ; reset drawing state? + MGTK_CALL MGTK::SetZP1, preserve_zp_params + MGTK_CALL MGTK::OpenWindow, create_window_params + MGTK_CALL MGTK::InitPort, state_params + MGTK_CALL MGTK::SetPort, state_params + MGTK_CALL $2B ; reset drawing state? jsr reset_buffer2 @@ -880,14 +880,14 @@ loop: lda adjust_txtptr_copied-1,x ;;; Input Loop input_loop: - A2D_CALL A2D_GET_INPUT, input_state_params + MGTK_CALL MGTK::GetEvent, input_state_params lda input_state_params::state - cmp #A2D_INPUT_DOWN + cmp #MGTK::button_down bne :+ jsr on_click jmp input_loop -: cmp #A2D_INPUT_KEY +: cmp #MGTK::key_down bne input_loop jsr on_key_press jmp input_loop @@ -896,9 +896,9 @@ input_loop: ;;; On Click on_click: - A2D_CALL A2D_QUERY_TARGET, target_params + MGTK_CALL MGTK::FindWindow, target_params lda target_params::elem - cmp #A2D_ELEM_CLIENT ; Less than CLIENT is MENU or DESKTOP + cmp #MGTK::area_content ; Less than CLIENT is MENU or DESKTOP bcc ignore_click lda target_params::id cmp #window_id ; This window? @@ -908,21 +908,21 @@ ignore_click: rts : lda target_params::elem - cmp #A2D_ELEM_CLIENT ; Client area? + cmp #MGTK::area_content ; Client area? bne :+ jsr map_click_to_button ; try to translate click into key bcc ignore_click jmp process_key -: cmp #A2D_ELEM_CLOSE ; Close box? +: cmp #MGTK::area_close_box ; Close box? bne :+ - A2D_CALL A2D_CLOSE_CLICK, close_click_params + MGTK_CALL MGTK::TrackGoAway, close_click_params lda close_click_params::state beq ignore_click -exit: A2D_CALL A2D_DESTROY_WINDOW, destroy_window_params +exit: MGTK_CALL MGTK::CloseWindow, destroy_window_params DESKTOP_CALL DESKTOP_REDRAW_ICONS lda ROMIN2 - A2D_CALL A2D_CONFIGURE_ZP_USE, overwrite_zp_params + MGTK_CALL MGTK::SetZP1, overwrite_zp_params .proc do_close ;; Copy following routine to ZP and invoke it @@ -943,11 +943,11 @@ loop: lda routine,x sizeof_routine := * - routine ; Can't use .sizeof before the .proc definition .endproc -: cmp #A2D_ELEM_TITLE ; Title bar? +: cmp #MGTK::area_dragbar ; Title bar? bne ignore_click lda #window_id sta drag_params::id - A2D_CALL A2D_DRAG_WINDOW, drag_params + MGTK_CALL MGTK::DragWindow, drag_params jsr redraw_screen_and_window rts @@ -985,7 +985,7 @@ rts1: rts ; used by next proc .proc map_click_to_button lda #window_id sta map_coords_params::id - A2D_CALL A2D_MAP_COORDS, map_coords_params + MGTK_CALL MGTK::ScreenToWindow, map_coords_params lda map_coords_params::clientx+1 ; ensure high bits of coords are 0 ora map_coords_params::clienty+1 bne rts1 @@ -1483,24 +1483,24 @@ end: jsr display_buffer1 sty invert_addr+1 sty c13_addr+1 sty restore_addr+1 - A2D_CALL A2D_SET_PATTERN, black_pattern - A2D_CALL A2D_SET_FILL_MODE, fill_mode_xor + MGTK_CALL MGTK::SetPattern, black_pattern + MGTK_CALL MGTK::SetPenMode, fill_mode_xor sec ror button_state -invert: A2D_CALL A2D_FILL_RECT, 0, invert_addr ; Inverts box +invert: MGTK_CALL MGTK::PaintRect, 0, invert_addr ; Inverts box check_button: - A2D_CALL A2D_GET_INPUT, input_state_params + MGTK_CALL MGTK::GetEvent, input_state_params lda input_state_params::state - cmp #A2D_INPUT_HELD ; Button down? + cmp #MGTK::drag ; Button down? bne done ; Nope, done immediately lda #window_id sta map_coords_params::id - A2D_CALL A2D_MAP_COORDS, map_coords_params - A2D_CALL A2D_SET_POS, map_coords_params::client - A2D_CALL A2D_TEST_BOX, 0, c13_addr + MGTK_CALL MGTK::ScreenToWindow, map_coords_params + MGTK_CALL MGTK::MoveTo, map_coords_params::client + MGTK_CALL MGTK::InRect, 0, c13_addr bne inside lda button_state ; outside, not down @@ -1519,8 +1519,8 @@ inside: lda button_state ; inside, and down done: lda button_state ; high bit set if button down beq :+ - A2D_CALL A2D_FILL_RECT, 0, restore_addr ; Inverts back to normal -: A2D_CALL A2D_SET_FILL_MODE, fill_mode_normal ; Normal draw mode?? + MGTK_CALL MGTK::PaintRect, 0, restore_addr ; Inverts back to normal +: MGTK_CALL MGTK::SetPenMode, fill_mode_normal ; Normal draw mode?? lda button_state rts .endproc @@ -1561,7 +1561,7 @@ loop: lda #' ' ldx #text_buffer1 jsr pre_display_buffer - A2D_CALL A2D_DRAW_TEXT, draw_text_params1 + MGTK_CALL MGTK::DrawText, draw_text_params1 end: rts .endproc @@ -1571,21 +1571,21 @@ end: rts ldx #text_buffer2 jsr pre_display_buffer - A2D_CALL A2D_DRAW_TEXT, draw_text_params2 + MGTK_CALL MGTK::DrawText, draw_text_params2 end: rts .endproc .proc pre_display_buffer stx measure_text_params::addr ; text buffer address in x,y sty measure_text_params::addr+1 - A2D_CALL A2D_MEASURE_TEXT, measure_text_params + MGTK_CALL MGTK::TextWidth, measure_text_params lda #display_width-15 ; ??? sec sbc measure_text_params::width sta text_pos_params3::left - A2D_CALL A2D_SET_POS, text_pos_params2 ; clear with spaces - A2D_CALL A2D_DRAW_TEXT, spaces_string - A2D_CALL A2D_SET_POS, text_pos_params3 ; set up for display + MGTK_CALL MGTK::MoveTo, text_pos_params2 ; clear with spaces + MGTK_CALL MGTK::DrawText, spaces_string + MGTK_CALL MGTK::MoveTo, text_pos_params3 ; set up for display rts .endproc @@ -1594,14 +1594,14 @@ end: rts .proc draw_background ;; Frame - A2D_CALL A2D_HIDE_CURSOR - A2D_CALL A2D_SET_PATTERN, background_pattern - A2D_CALL A2D_FILL_RECT, background_box_params - A2D_CALL A2D_SET_PATTERN, black_pattern - A2D_CALL A2D_DRAW_RECT, frame_display_params - A2D_CALL A2D_SET_PATTERN, white_pattern - A2D_CALL A2D_FILL_RECT, clear_display_params - A2D_CALL A2D_SET_TEXT_MASK, text_mask_params + MGTK_CALL MGTK::HideCursor + MGTK_CALL MGTK::SetPattern, background_pattern + MGTK_CALL MGTK::PaintRect, background_box_params + MGTK_CALL MGTK::SetPattern, black_pattern + MGTK_CALL MGTK::FrameRect, frame_display_params + MGTK_CALL MGTK::SetPattern, white_pattern + MGTK_CALL MGTK::PaintRect, clear_display_params + MGTK_CALL MGTK::SetTextBG, text_mask_params ;; fall through .endproc @@ -1633,9 +1633,9 @@ loop: ldy #0 lda (ptr),y sta label - A2D_CALL A2D_DRAW_BITMAP, 0, bitmap_addr ; draw shadowed rect - A2D_CALL A2D_SET_POS, 0, text_addr ; button label pos - A2D_CALL A2D_DRAW_TEXT, draw_text_params_label ; button label text + MGTK_CALL MGTK::PaintBits, 0, bitmap_addr ; draw shadowed rect + MGTK_CALL MGTK::MoveTo, 0, text_addr ; button label pos + MGTK_CALL MGTK::DrawText, draw_text_params_label ; button label text lda ptr ; advance to next record clc @@ -1668,13 +1668,13 @@ draw_title_bar: bcs :+ dex : stx title_bar_decoration::top+1 - A2D_CALL A2D_SET_BOX, screen_box ; set clipping rect to whole screen - A2D_CALL A2D_DRAW_BITMAP, title_bar_decoration ; Draws decoration in title bar + MGTK_CALL MGTK::SetPortSite, screen_box ; set clipping rect to whole screen + MGTK_CALL MGTK::PaintBits, title_bar_decoration ; Draws decoration in title bar lda #window_id sta query_state_params::id - A2D_CALL A2D_QUERY_STATE, query_state_params - A2D_CALL A2D_SET_STATE, state_params - A2D_CALL A2D_SHOW_CURSOR + MGTK_CALL MGTK::GetWinPort, query_state_params + MGTK_CALL MGTK::SetPort, state_params + MGTK_CALL MGTK::ShowCursor jsr display_buffer2 rts @@ -1686,8 +1686,8 @@ draw_title_bar: jsr reset_buffers_and_display bit offscreen_flag bmi :+ - A2D_CALL A2D_SET_POS, error_pos - A2D_CALL A2D_DRAW_TEXT, error_string + MGTK_CALL MGTK::MoveTo, error_pos + MGTK_CALL MGTK::DrawText, error_string : jsr reset_buffer1_and_state lda #'=' sta calc_op diff --git a/desk.acc/calculator.s b/desk.acc/calculator.s index bdaaa83..120abcc 100644 --- a/desk.acc/calculator.s +++ b/desk.acc/calculator.s @@ -6,7 +6,7 @@ .include "../inc/applesoft.inc" .include "../inc/prodos.inc" - .include "../a2d.inc" + .include "../mgtk.inc" .include "../desktop.inc" ; redraw icons after window move, font .org $800 @@ -111,8 +111,8 @@ call_init: skip: lda #0 sta offscreen_flag lda ROMIN2 - A2D_CALL A2D_QUERY_STATE, query_state_params - A2D_CALL A2D_SET_STATE, state_params + MGTK_CALL MGTK::GetWinPort, query_state_params + MGTK_CALL MGTK::SetPort, state_params rts .proc routine @@ -147,8 +147,8 @@ offscreen_flag: ;; Is skipping this responsible for display redraw bug? ;; https://github.com/inexorabletash/a2d/issues/34 -: A2D_CALL A2D_QUERY_STATE, query_state_params - A2D_CALL A2D_SET_STATE, state_params +: MGTK_CALL MGTK::GetWinPort, query_state_params + MGTK_CALL MGTK::SetPort, state_params lda query_state_params_id cmp #window_id bne :+ @@ -207,11 +207,11 @@ id: .byte 0 query_state_params_id := query_state_params::id .proc preserve_zp_params -flag: .byte A2D_CZP_PRESERVE +flag: .byte MGTK::zp_preserve .endproc .proc overwrite_zp_params -flag: .byte A2D_CZP_OVERWRITE +flag: .byte MGTK::zp_overwrite .endproc ;;; ================================================== @@ -665,9 +665,9 @@ text_buffer2: .res text_buffer_size+2, 0 spaces_string: - A2D_DEFSTRING " " + DEFINE_STRING " " error_string: - A2D_DEFSTRING "Error " + DEFINE_STRING "Error " ;; used when clearing display; params to a $18 call .proc measure_text_params @@ -699,7 +699,7 @@ base: .word 16 farg: .byte $00,$00,$00,$00,$00,$00 -.proc title_bar_decoration ; Params for A2D_DRAW_BITMAP +.proc title_bar_decoration ; Params for MGTK::PaintBits left: .word 115 ; overwritten top: .word $FFF7 ; overwritten bitmap:.addr pixels @@ -747,12 +747,12 @@ font: .addr 0 screen_width := 560 screen_height := 192 - ;; params for A2D_SET_BOX when decorating title bar + ;; params for MGTK::SetPortSite when decorating title bar .proc screen_box left: .word 0 top: .word menu_bar_height -addr: .word A2D_SCREEN_ADDR -stride: .word A2D_SCREEN_STRIDE +addr: .word MGTK::screen_mapbits +stride: .word MGTK::screen_mapwidth hoff: .word 0 voff: .word 0 width: .word screen_width - 1 @@ -760,13 +760,13 @@ height: .word screen_height - menu_bar_height - 2 .endproc .proc fill_mode_normal -mode: .byte A2D_SFM_NORMAL +mode: .byte MGTK::pencopy .endproc .byte $01,$02 ; ?? .proc fill_mode_xor -mode: .byte A2D_SFM_XOR +mode: .byte MGTK::notpenXOR .endproc window_width := 130 @@ -776,10 +776,10 @@ mode: .byte A2D_SFM_XOR .proc create_window_params id: .byte window_id -flags: .byte A2D_CWF_ADDCLOSE +flags: .byte MGTK::option_go_away_box title: .addr window_title -hscroll:.byte A2D_CWS_NOSCROLL -vscroll:.byte A2D_CWS_NOSCROLL +hscroll:.byte MGTK::scroll_option_none +vscroll:.byte MGTK::scroll_option_none hs_max: .byte 0 hs_pos: .byte 0 vs_max: .byte 0 @@ -791,15 +791,15 @@ w2: .word window_width h2: .word window_height left: .word default_left top: .word default_top -addr: .addr A2D_SCREEN_ADDR -stride: .word A2D_SCREEN_STRIDE +addr: .addr MGTK::screen_mapbits +stride: .word MGTK::screen_mapwidth hoff: .word 0 voff: .word 0 width: .word window_width height: .word window_height pattern:.res 8, $FF -mskand: .byte A2D_DEFAULT_MSKAND -mskor: .byte A2D_DEFAULT_MSKOR +mskand: .byte MGTK::colormask_and +mskor: .byte MGTK::colormask_or xpos: .word 0 ypos: .word 0 hthick: .byte 1 @@ -848,15 +848,15 @@ cursor: .byte px(%0000000),px(%0000000) ; cursor init: sta ALTZPON lda LCBANK1 lda LCBANK1 - A2D_CALL A2D_CONFIGURE_ZP_USE, preserve_zp_params - A2D_CALL A2D_CREATE_WINDOW, create_window_params - A2D_CALL A2D_QUERY_SCREEN, state_params - A2D_CALL A2D_SET_STATE, state_params ; set clipping bounds? - A2D_CALL $2B ; reset drawing state? + MGTK_CALL MGTK::SetZP1, preserve_zp_params + MGTK_CALL MGTK::OpenWindow, create_window_params + MGTK_CALL MGTK::InitPort, state_params + MGTK_CALL MGTK::SetPort, state_params ; set clipping bounds? + MGTK_CALL $2B ; reset drawing state? lda #$01 sta input_state_params::state - A2D_CALL A2D_SET_INPUT, input_state_params - A2D_CALL A2D_GET_INPUT, input_state_params + MGTK_CALL MGTK::PostEvent, input_state_params + MGTK_CALL MGTK::GetEvent, input_state_params lda ROMIN2 jsr reset_buffer2 lda #window_id @@ -916,21 +916,21 @@ loop: lda adjust_txtptr_copied-1,x jsr process_key ;; previous draws mangle the cursor (why???) - A2D_CALL A2D_SET_CURSOR, cursor ; Why not use JUMP_TABLE_CUR_POINTER ? + MGTK_CALL MGTK::SetCursor, cursor ; Why not use JUMP_TABLE_CUR_POINTER ? ;; fall through ;;; ================================================== ;;; Input Loop input_loop: - A2D_CALL A2D_GET_INPUT, input_state_params + MGTK_CALL MGTK::GetEvent, input_state_params lda input_state_params::state - cmp #A2D_INPUT_DOWN + cmp #MGTK::button_down bne :+ jsr on_click jmp input_loop -: cmp #A2D_INPUT_KEY +: cmp #MGTK::key_down bne input_loop jsr on_key_press jmp input_loop @@ -941,10 +941,10 @@ input_loop: on_click: lda LCBANK1 lda LCBANK1 - A2D_CALL A2D_QUERY_TARGET, target_params + MGTK_CALL MGTK::FindWindow, target_params lda ROMIN2 lda target_params::elem - cmp #A2D_ELEM_CLIENT ; Less than CLIENT is MENU or DESKTOP + cmp #MGTK::area_content ; Less than CLIENT is MENU or DESKTOP bcc ignore_click lda target_params::id cmp #window_id ; This window? @@ -954,23 +954,23 @@ ignore_click: rts : lda target_params::elem - cmp #A2D_ELEM_CLIENT ; Client area? + cmp #MGTK::area_content ; Client area? bne :+ jsr map_click_to_button ; try to translate click into key bcc ignore_click jmp process_key -: cmp #A2D_ELEM_CLOSE ; Close box? +: cmp #MGTK::area_close_box ; Close box? bne :+ - A2D_CALL A2D_CLOSE_CLICK, close_click_params + MGTK_CALL MGTK::TrackGoAway, close_click_params lda close_click_params::state beq ignore_click exit: lda LCBANK1 lda LCBANK1 - A2D_CALL A2D_DESTROY_WINDOW, destroy_window_params + MGTK_CALL MGTK::CloseWindow, destroy_window_params DESKTOP_CALL DESKTOP_REDRAW_ICONS lda ROMIN2 - A2D_CALL A2D_CONFIGURE_ZP_USE, overwrite_zp_params + MGTK_CALL MGTK::SetZP1, overwrite_zp_params .proc do_close ;; Copy following routine to ZP and invoke it @@ -991,13 +991,13 @@ loop: lda routine,x sizeof_routine := * - routine ; Can't use .sizeof before the .proc definition .endproc -: cmp #A2D_ELEM_TITLE ; Title bar? +: cmp #MGTK::area_dragbar ; Title bar? bne ignore_click lda #window_id sta drag_params::id lda LCBANK1 lda LCBANK1 - A2D_CALL A2D_DRAG_WINDOW, drag_params + MGTK_CALL MGTK::DragWindow, drag_params lda ROMIN2 jsr redraw_screen_and_window rts @@ -1036,7 +1036,7 @@ rts1: rts ; used by next proc .proc map_click_to_button lda #window_id sta map_coords_params::id - A2D_CALL A2D_MAP_COORDS, map_coords_params + MGTK_CALL MGTK::ScreenToWindow, map_coords_params lda map_coords_params::clientx+1 ; ensure high bits of coords are 0 ora map_coords_params::clienty+1 bne rts1 @@ -1534,24 +1534,24 @@ end: jsr display_buffer1 sty invert_addr+1 sty c13_addr+1 sty restore_addr+1 - A2D_CALL A2D_SET_PATTERN, black_pattern - A2D_CALL A2D_SET_FILL_MODE, fill_mode_xor + MGTK_CALL MGTK::SetPattern, black_pattern + MGTK_CALL MGTK::SetPenMode, fill_mode_xor sec ror button_state -invert: A2D_CALL A2D_FILL_RECT, 0, invert_addr ; Inverts box +invert: MGTK_CALL MGTK::PaintRect, 0, invert_addr ; Inverts box check_button: - A2D_CALL A2D_GET_INPUT, input_state_params + MGTK_CALL MGTK::GetEvent, input_state_params lda input_state_params::state - cmp #A2D_INPUT_HELD ; Button down? + cmp #MGTK::drag ; Button down? bne done ; Nope, done immediately lda #window_id sta map_coords_params::id - A2D_CALL A2D_MAP_COORDS, map_coords_params - A2D_CALL A2D_SET_POS, map_coords_params::client - A2D_CALL A2D_TEST_BOX, 0, c13_addr + MGTK_CALL MGTK::ScreenToWindow, map_coords_params + MGTK_CALL MGTK::MoveTo, map_coords_params::client + MGTK_CALL MGTK::InRect, 0, c13_addr bne inside lda button_state ; outside, not down @@ -1570,8 +1570,8 @@ inside: lda button_state ; inside, and down done: lda button_state ; high bit set if button down beq :+ - A2D_CALL A2D_FILL_RECT, 0, restore_addr ; Inverts back to normal -: A2D_CALL A2D_SET_FILL_MODE, fill_mode_normal ; Normal draw mode?? + MGTK_CALL MGTK::PaintRect, 0, restore_addr ; Inverts back to normal +: MGTK_CALL MGTK::SetPenMode, fill_mode_normal ; Normal draw mode?? lda button_state rts .endproc @@ -1610,7 +1610,7 @@ loop: lda #' ' ldx #text_buffer1 jsr pre_display_buffer - A2D_CALL A2D_DRAW_TEXT, draw_text_params1 + MGTK_CALL MGTK::DrawText, draw_text_params1 rts .endproc @@ -1618,21 +1618,21 @@ loop: lda #' ' ldx #text_buffer2 jsr pre_display_buffer - A2D_CALL A2D_DRAW_TEXT, draw_text_params2 + MGTK_CALL MGTK::DrawText, draw_text_params2 rts .endproc .proc pre_display_buffer stx measure_text_params::addr ; text buffer address in x,y sty measure_text_params::addr+1 - A2D_CALL A2D_MEASURE_TEXT, measure_text_params + MGTK_CALL MGTK::TextWidth, measure_text_params lda #display_width-15 ; ??? sec sbc measure_text_params::width sta text_pos_params3::left - A2D_CALL A2D_SET_POS, text_pos_params2 ; clear with spaces - A2D_CALL A2D_DRAW_TEXT, spaces_string - A2D_CALL A2D_SET_POS, text_pos_params3 ; set up for display + MGTK_CALL MGTK::MoveTo, text_pos_params2 ; clear with spaces + MGTK_CALL MGTK::DrawText, spaces_string + MGTK_CALL MGTK::MoveTo, text_pos_params3 ; set up for display rts .endproc @@ -1641,14 +1641,14 @@ loop: lda #' ' .proc draw_background ;; Frame - A2D_CALL A2D_HIDE_CURSOR - A2D_CALL A2D_SET_PATTERN, background_pattern - A2D_CALL A2D_FILL_RECT, background_box_params - A2D_CALL A2D_SET_PATTERN, black_pattern - A2D_CALL A2D_DRAW_RECT, frame_display_params - A2D_CALL A2D_SET_PATTERN, white_pattern - A2D_CALL A2D_FILL_RECT, clear_display_params - A2D_CALL A2D_SET_TEXT_MASK, text_mask_params + MGTK_CALL MGTK::HideCursor + MGTK_CALL MGTK::SetPattern, background_pattern + MGTK_CALL MGTK::PaintRect, background_box_params + MGTK_CALL MGTK::SetPattern, black_pattern + MGTK_CALL MGTK::FrameRect, frame_display_params + MGTK_CALL MGTK::SetPattern, white_pattern + MGTK_CALL MGTK::PaintRect, clear_display_params + MGTK_CALL MGTK::SetTextBG, text_mask_params ;; fall through .endproc @@ -1680,9 +1680,9 @@ loop: ldy #0 lda (ptr),y sta label - A2D_CALL A2D_DRAW_BITMAP, 0, bitmap_addr ; draw shadowed rect - A2D_CALL A2D_SET_POS, 0, text_addr ; button label pos - A2D_CALL A2D_DRAW_TEXT, draw_text_params_label ; button label text + MGTK_CALL MGTK::PaintBits, 0, bitmap_addr ; draw shadowed rect + MGTK_CALL MGTK::MoveTo, 0, text_addr ; button label pos + MGTK_CALL MGTK::DrawText, draw_text_params_label ; button label text lda ptr ; advance to next record clc @@ -1715,13 +1715,13 @@ draw_title_bar: bcs :+ dex : stx title_bar_decoration::top+1 - A2D_CALL A2D_SET_BOX, screen_box ; set clipping rect to whole screen - A2D_CALL A2D_DRAW_BITMAP, title_bar_decoration ; Draws decoration in title bar + MGTK_CALL MGTK::SetPortSite, screen_box ; set clipping rect to whole screen + MGTK_CALL MGTK::PaintBits, title_bar_decoration ; Draws decoration in title bar lda #window_id sta query_state_params::id - A2D_CALL A2D_QUERY_STATE, query_state_params - A2D_CALL A2D_SET_STATE, state_params - A2D_CALL A2D_SHOW_CURSOR + MGTK_CALL MGTK::GetWinPort, query_state_params + MGTK_CALL MGTK::SetPort, state_params + MGTK_CALL MGTK::ShowCursor jsr display_buffer2 rts @@ -1729,8 +1729,8 @@ draw_title_bar: ;; and returns to the input loop. .proc error_hook jsr reset_buffers_and_display - A2D_CALL A2D_SET_POS, error_pos - A2D_CALL A2D_DRAW_TEXT, error_string + MGTK_CALL MGTK::MoveTo, error_pos + MGTK_CALL MGTK::DrawText, error_string jsr reset_buffer1_and_state lda #'=' sta calc_op diff --git a/desk.acc/date.s b/desk.acc/date.s index 087196e..36ba41e 100644 --- a/desk.acc/date.s +++ b/desk.acc/date.s @@ -5,7 +5,7 @@ .include "../inc/prodos.inc" .include "../inc/auxmem.inc" - .include "../a2d.inc" + .include "../mgtk.inc" .include "../desktop.inc" ; redraw icons after window move; font; glyphs .org $800 @@ -197,22 +197,22 @@ month: .byte 2 ; The date this was written? year: .byte 85 spaces_string: - A2D_DEFSTRING " " + DEFINE_STRING " " day_pos: .word 43, 30 day_string: - A2D_DEFSTRING " " + DEFINE_STRING " " month_pos: .word 87, 30 month_string: - A2D_DEFSTRING " " + DEFINE_STRING " " year_pos: .word 133, 30 year_string: - A2D_DEFSTRING " " + DEFINE_STRING " " .proc get_input_params state: .byte 0 @@ -256,10 +256,10 @@ mode: .byte $02 ; this should be normal, but we do inverts ??? .proc create_window_params id: .byte window_id -flags: .byte A2D_CWF_NOTITLE +flags: .byte MGTK::option_dialog_box title: .addr 0 -hscroll:.byte A2D_CWS_NOSCROLL -vscroll:.byte A2D_CWS_NOSCROLL +hscroll:.byte MGTK::scroll_option_none +vscroll:.byte MGTK::scroll_option_none hsmax: .byte 0 hspos: .byte 0 vsmax: .byte 0 @@ -272,16 +272,16 @@ h2: .word $1F4 .proc box left: .word 180 top: .word 50 -addr: .addr A2D_SCREEN_ADDR -stride: .word A2D_SCREEN_STRIDE +addr: .addr MGTK::screen_mapbits +stride: .word MGTK::screen_mapwidth hoff: .word 0 voff: .word 0 width: .word $C7 height: .word $40 .endproc pattern:.res 8,$00 -mskand: .byte A2D_DEFAULT_MSKAND -mskor: .byte A2D_DEFAULT_MSKOR +mskand: .byte MGTK::colormask_and +mskor: .byte MGTK::colormask_or xpos: .word 0 ypos: .word 0 hthick: .byte 4 @@ -321,25 +321,25 @@ init_window: lsr a sta month - A2D_CALL A2D_CREATE_WINDOW, create_window_params + MGTK_CALL MGTK::OpenWindow, create_window_params lda #0 sta selected_field jsr draw_window - A2D_CALL $2B + MGTK_CALL $2B ;; fall through ;;; ================================================== ;;; Input loop .proc input_loop - A2D_CALL A2D_GET_INPUT, get_input_params + MGTK_CALL MGTK::GetEvent, get_input_params lda get_input_params::state - cmp #A2D_INPUT_DOWN + cmp #MGTK::button_down bne :+ jsr on_click jmp input_loop -: cmp #A2D_INPUT_KEY +: cmp #MGTK::key_down bne input_loop .endproc @@ -364,19 +364,19 @@ init_window: bne input_loop on_key_up: - A2D_CALL A2D_FILL_RECT, up_arrow_rect + MGTK_CALL MGTK::PaintRect, up_arrow_rect lda #up_rect_index sta hit_rect_index jsr do_inc_or_dec - A2D_CALL A2D_FILL_RECT, up_arrow_rect + MGTK_CALL MGTK::PaintRect, up_arrow_rect jmp input_loop on_key_down: - A2D_CALL A2D_FILL_RECT, down_arrow_rect + MGTK_CALL MGTK::PaintRect, down_arrow_rect lda #down_rect_index sta hit_rect_index jsr do_inc_or_dec - A2D_CALL A2D_FILL_RECT, down_arrow_rect + MGTK_CALL MGTK::PaintRect, down_arrow_rect jmp input_loop on_key_left: @@ -403,9 +403,9 @@ update_selection: ;;; ================================================== .proc on_click - A2D_CALL A2D_QUERY_TARGET, get_input_params::xcoord - A2D_CALL A2D_SET_FILL_MODE, fill_mode_params - A2D_CALL A2D_SET_PATTERN, white_pattern + MGTK_CALL MGTK::FindWindow, get_input_params::xcoord + MGTK_CALL MGTK::SetPenMode, fill_mode_params + MGTK_CALL MGTK::SetPattern, white_pattern lda query_target_params::id cmp #window_id bne miss @@ -413,7 +413,7 @@ update_selection: bne hit miss: rts -hit: cmp #A2D_ELEM_CLIENT +hit: cmp #MGTK::area_content bne miss jsr find_hit_target cpx #0 @@ -437,7 +437,7 @@ hit_target_jump_table: ;;; ================================================== .proc on_ok - A2D_CALL A2D_FILL_RECT, ok_button_rect + MGTK_CALL MGTK::PaintRect, ok_button_rect ;; Pack the date bytes and store sta RAMWRTOFF @@ -460,7 +460,7 @@ hit_target_jump_table: .endproc on_cancel: - A2D_CALL A2D_FILL_RECT, cancel_button_rect + MGTK_CALL MGTK::PaintRect, cancel_button_rect lda #0 sta dialog_result jmp destroy @@ -468,7 +468,7 @@ on_cancel: on_up: txa pha - A2D_CALL A2D_FILL_RECT, up_arrow_rect + MGTK_CALL MGTK::PaintRect, up_arrow_rect pla tax jsr on_up_or_down @@ -477,7 +477,7 @@ on_up: on_down: txa pha - A2D_CALL A2D_FILL_RECT, down_arrow_rect + MGTK_CALL MGTK::PaintRect, down_arrow_rect pla tax jsr on_up_or_down @@ -491,9 +491,9 @@ on_field_click: .proc on_up_or_down stx hit_rect_index -loop: A2D_CALL A2D_GET_INPUT, get_input_params ; Repeat while mouse is down +loop: MGTK_CALL MGTK::GetEvent, get_input_params ; Repeat while mouse is down lda get_input_params::state - cmp #A2D_INPUT_UP + cmp #MGTK::button_up beq :+ jsr do_inc_or_dec jmp loop @@ -502,10 +502,10 @@ loop: A2D_CALL A2D_GET_INPUT, get_input_params ; Repeat while mouse is down cmp #up_rect_index beq :+ - A2D_CALL A2D_FILL_RECT, down_arrow_rect + MGTK_CALL MGTK::PaintRect, down_arrow_rect rts -: A2D_CALL A2D_FILL_RECT, up_arrow_rect +: MGTK_CALL MGTK::PaintRect, up_arrow_rect rts .endproc @@ -538,7 +538,7 @@ go: lda selected_field sta gosub+2 gosub: jsr $1000 ; self modified - A2D_CALL A2D_SET_TEXT_MASK, text_mask_params + MGTK_CALL MGTK::SetTextBG, text_mask_params jmp draw_selected_field .endproc @@ -666,7 +666,7 @@ month_name_table: dialog_result: .byte 0 .proc destroy - A2D_CALL A2D_DESTROY_WINDOW, destroy_window_params + MGTK_CALL MGTK::CloseWindow, destroy_window_params DESKTOP_CALL DESKTOP_REDRAW_ICONS ;; Copy the relay routine to the zero page @@ -717,8 +717,8 @@ skip: jmp dest sta map_coords_params::screeny lda get_input_params::ycoord+1 sta map_coords_params::screeny+1 - A2D_CALL A2D_MAP_COORDS, map_coords_params - A2D_CALL A2D_SET_POS, map_coords_params::client + MGTK_CALL MGTK::ScreenToWindow, map_coords_params + MGTK_CALL MGTK::MoveTo, map_coords_params::client ldx #1 lda # font.inc diff --git a/desk.acc/res/hex2px.pl b/desk.acc/res/hex2px.pl index bc40572..c7a6ac0 100755 --- a/desk.acc/res/hex2px.pl +++ b/desk.acc/res/hex2px.pl @@ -1,6 +1,6 @@ #!/usr/bin/env perl -# Convert $xx into px(bbbbbbb) - input to A2D_DRAW_PATTERN +# Convert $xx into px(bbbbbbb) - MGTK pattern/bits use strict; use warnings; diff --git a/desk.acc/show_image_file.s b/desk.acc/show_image_file.s index 04c4a98..547eb07 100644 --- a/desk.acc/show_image_file.s +++ b/desk.acc/show_image_file.s @@ -5,7 +5,7 @@ .include "../inc/prodos.inc" .include "../inc/auxmem.inc" - .include "../a2d.inc" + .include "../mgtk.inc" .include "../desktop.inc" ; get selection, font .org $800 @@ -173,7 +173,7 @@ base: .word 0 .proc input_params ; queried to track mouse-up state: .byte $00 -;;; if state is A2D_INPUT_KEY +;;; if state is MGTK::key_down key := * modifiers := *+1 @@ -195,10 +195,10 @@ ycoord := *+2 .proc window_params id: .byte window_id ; window identifier -flags: .byte A2D_CWF_NOTITLE +flags: .byte MGTK::option_dialog_box title: .addr window_title -hscroll:.byte A2D_CWS_NOSCROLL -vscroll:.byte A2D_CWS_NOSCROLL +hscroll:.byte MGTK::scroll_option_none +vscroll:.byte MGTK::scroll_option_none hsmax: .byte 32 hspos: .byte 0 vsmax: .byte 32 @@ -212,8 +212,8 @@ h2: .word default_height .proc box left: .word default_left top: .word default_top -addr: .addr A2D_SCREEN_ADDR -stride: .word A2D_SCREEN_STRIDE +addr: .addr MGTK::screen_mapbits +stride: .word MGTK::screen_mapwidth hoff: .word 0 voff: .word 0 width: .word default_width @@ -221,8 +221,8 @@ height: .word default_height .endproc pattern:.res 8, 0 -mskand: .byte A2D_DEFAULT_MSKAND -mskor: .byte A2D_DEFAULT_MSKOR +mskand: .byte MGTK::colormask_and +mskor: .byte MGTK::colormask_or xpos: .word 0 ypos: .word 0 hthick: .byte 1 @@ -342,14 +342,14 @@ end: rts sta read_params::ref_num sta close_params::ref_num - A2D_CALL A2D_HIDE_CURSOR + MGTK_CALL MGTK::HideCursor jsr stash_menu - A2D_CALL A2D_CREATE_WINDOW, window_params - A2D_CALL A2D_SET_STATE, window_params::box + MGTK_CALL MGTK::OpenWindow, window_params + MGTK_CALL MGTK::SetPort, window_params::box jsr show_file - A2D_CALL A2D_SHOW_CURSOR + MGTK_CALL MGTK::ShowCursor - A2D_CALL $2B ; ??? + MGTK_CALL $2B ; ??? ;; fall through .endproc @@ -357,11 +357,11 @@ end: rts ;;; Main Input Loop .proc input_loop - A2D_CALL A2D_GET_INPUT, input_params + MGTK_CALL MGTK::GetEvent, input_params lda input_params::state - cmp #A2D_INPUT_DOWN ; was clicked? + cmp #MGTK::button_down ; was clicked? beq exit - cmp #A2D_INPUT_KEY ; any key? + cmp #MGTK::key_down ; any key? beq on_key bne input_loop @@ -374,11 +374,11 @@ on_key: bne input_loop exit: - A2D_CALL A2D_HIDE_CURSOR - A2D_CALL A2D_DESTROY_WINDOW, window_params + MGTK_CALL MGTK::HideCursor + MGTK_CALL MGTK::CloseWindow, window_params DESKTOP_CALL DESKTOP_REDRAW_ICONS jsr unstash_menu - A2D_CALL A2D_SHOW_CURSOR + MGTK_CALL MGTK::ShowCursor rts ; exits input loop .endproc diff --git a/desk.acc/show_text_file.s b/desk.acc/show_text_file.s index 51086b3..95dfe7f 100644 --- a/desk.acc/show_text_file.s +++ b/desk.acc/show_text_file.s @@ -5,7 +5,7 @@ .include "../inc/prodos.inc" .include "../inc/auxmem.inc" - .include "../a2d.inc" + .include "../mgtk.inc" .include "../desktop.inc" ; get/clear selection, font .org $800 @@ -304,10 +304,10 @@ len: .byte 0 ; length .proc window_params id: .byte window_id ; window identifier -flags: .byte A2D_CWF_ADDCLOSE; window flags (2=include close box) +flags: .byte MGTK::option_go_away_box; window flags (2=include close box) title: .addr $1000 ; overwritten to point at filename -hscroll:.byte A2D_CWS_NOSCROLL -vscroll:.byte A2D_CWS_SCROLL_NORMAL +hscroll:.byte MGTK::scroll_option_none +vscroll:.byte MGTK::scroll_option_normal hsmax: .byte 32 hspos: .byte 0 vsmax: .byte 255 @@ -321,17 +321,17 @@ h2: .word default_height .proc box left: .word default_left top: .word default_top -addr: .addr A2D_SCREEN_ADDR -stride: .word A2D_SCREEN_STRIDE -hoff: .word 0 ; Also used for A2D_FILL_RECT +addr: .addr MGTK::screen_mapbits +stride: .word MGTK::screen_mapwidth +hoff: .word 0 ; Also used for MGTK::PaintRect voff: .word 0 width: .word default_width height: .word default_height .endproc pattern:.res 8, $00 -mskand: .byte A2D_DEFAULT_MSKAND -mskor: .byte A2D_DEFAULT_MSKOR +mskand: .byte MGTK::colormask_and +mskor: .byte MGTK::colormask_or xpos: .word 0 ypos: .word 0 hthick: .byte 1 @@ -346,8 +346,8 @@ next: .addr 0 .proc default_box left: .word default_left top: .word default_top -addr: .word A2D_SCREEN_ADDR -stride: .word A2D_SCREEN_STRIDE +addr: .word MGTK::screen_mapbits +stride: .word MGTK::screen_mapwidth hoff: .word 0 voff: .word 0 width: .word default_width @@ -497,12 +497,12 @@ loop: lda font_width_table - 1,x jsr get_file_eof ;; create window - A2D_CALL A2D_CREATE_WINDOW, window_params - A2D_CALL A2D_SET_STATE, window_params::box + MGTK_CALL MGTK::OpenWindow, window_params + MGTK_CALL MGTK::SetPort, window_params::box jsr calc_window_size jsr calc_and_draw_mode jsr draw_content - A2D_CALL $2B ; ??? + MGTK_CALL $2B ; ??? ;; fall through .endproc @@ -510,19 +510,19 @@ loop: lda font_width_table - 1,x ;;; Main Input Loop input_loop: - A2D_CALL A2D_GET_INPUT, input_params + MGTK_CALL MGTK::GetEvent, input_params lda input_params cmp #1 ; was clicked? bne input_loop ; nope, keep waiting - A2D_CALL A2D_QUERY_TARGET, input_params::coords + MGTK_CALL MGTK::FindWindow, input_params::coords lda target_params::win ; in our window? cmp #window_id bne input_loop ;; which part of the window? lda target_params::elem - cmp #A2D_ELEM_CLOSE + cmp #MGTK::area_close_box beq on_close_click ;; title and resize clicks need mouse location @@ -536,9 +536,9 @@ input_loop: stx resize_drag_params::ycoord stx query_client_params::ycoord - cmp #A2D_ELEM_TITLE + cmp #MGTK::area_dragbar beq title - cmp #A2D_ELEM_RESIZE ; not enabled, so this will never match + cmp #MGTK::area_grow_box ; not enabled, so this will never match beq input_loop jsr on_client_click jmp input_loop @@ -550,11 +550,11 @@ title: jsr on_title_bar_click ;;; Close Button .proc on_close_click - A2D_CALL A2D_CLOSE_CLICK, close_btn_params ; wait to see if the click completes + MGTK_CALL MGTK::TrackGoAway, close_btn_params ; wait to see if the click completes lda close_btn_params::state ; did click complete? beq input_loop ; nope jsr close_file - A2D_CALL A2D_DESTROY_WINDOW, window_params + MGTK_CALL MGTK::CloseWindow, window_params DESKTOP_CALL DESKTOP_REDRAW_ICONS rts ; exits input loop .endproc @@ -564,7 +564,7 @@ title: jsr on_title_bar_click ;;; This is dead code (no resize handle!) and may be buggy .proc on_resize_click - A2D_CALL A2D_DRAG_RESIZE, resize_drag_params + MGTK_CALL MGTK::GrowWindow, resize_drag_params jsr redraw_screen jsr calc_window_size @@ -594,10 +594,10 @@ wider: lda window_params::hscroll ldx window_width+1 cpx #>max_width bne enable - and #(<~A2D_CWS_SCROLL_TRACK) ; disable scroll + and #(<~MGTK::scroll_option_active) ; disable scroll jmp :+ -enable: ora #A2D_CWS_SCROLL_TRACK ; enable scroll +enable: ora #MGTK::scroll_option_active ; enable scroll : sta window_params::hscroll sec @@ -609,9 +609,9 @@ enable: ora #A2D_CWS_SCROLL_TRACK ; enable scroll sta $07 jsr div_by_16 sta resize_window_params::L0987 - lda #A2D_HSCROLL + lda #MGTK::ctl_horizontal_scroll_bar sta resize_window_params::part - A2D_CALL A2D_RESIZE_WINDOW, resize_window_params ; change to clamped size ??? + MGTK_CALL MGTK::SetCtlMax, resize_window_params ; change to clamped size ??? jsr calc_and_draw_mode jmp finish_resize .endproc @@ -622,11 +622,11 @@ enable: ora #A2D_CWS_SCROLL_TRACK ; enable scroll ;;; Non-title (client) area clicked .proc on_client_click ;; On one of the scroll bars? - A2D_CALL A2D_QUERY_CLIENT, query_client_params + MGTK_CALL MGTK::FindControl, query_client_params lda query_client_params::part - cmp #A2D_VSCROLL + cmp #MGTK::ctl_vertical_scroll_bar beq on_vscroll_click - cmp #A2D_HSCROLL + cmp #MGTK::ctl_horizontal_scroll_bar bne end jmp on_hscroll_click end: rts @@ -636,19 +636,19 @@ end: rts ;;; Vertical Scroll Bar .proc on_vscroll_click - lda #A2D_VSCROLL + lda #MGTK::ctl_vertical_scroll_bar sta thumb_drag_params::type sta update_scroll_params::type lda query_client_params::scroll - cmp #A2D_SCROLL_PART_THUMB + cmp #MGTK::part_thumb beq on_vscroll_thumb_click - cmp #A2D_SCROLL_PART_BELOW + cmp #MGTK::part_page_down beq on_vscroll_below_click - cmp #A2D_SCROLL_PART_ABOVE + cmp #MGTK::part_page_up beq on_vscroll_above_click - cmp #A2D_SCROLL_PART_UP + cmp #MGTK::part_up_arrow beq on_vscroll_up_click - cmp #A2D_SCROLL_PART_DOWN + cmp #MGTK::part_down_arrow bne end jmp on_vscroll_down_click end: rts @@ -758,19 +758,19 @@ loop: inx ;;; (Unused in STF DA, so most of this is speculation) .proc on_hscroll_click - lda #A2D_HSCROLL + lda #MGTK::ctl_horizontal_scroll_bar sta thumb_drag_params::type sta update_scroll_params::type lda query_client_params::scroll - cmp #A2D_SCROLL_PART_THUMB + cmp #MGTK::part_thumb beq on_hscroll_thumb_click - cmp #A2D_SCROLL_PART_AFTER + cmp #MGTK::part_page_right beq on_hscroll_after_click - cmp #A2D_SCROLL_PART_BEFORE + cmp #MGTK::part_page_left beq on_hscroll_before_click - cmp #A2D_SCROLL_PART_LEFT + cmp #MGTK::part_left_arrow beq on_hscroll_left_click - cmp #A2D_SCROLL_PART_RIGHT + cmp #MGTK::part_right_arrow beq on_hscroll_right_click rts .endproc @@ -860,13 +860,13 @@ store: sta window_params::hspos sta thumb_drag_params::xcoord+1 lda input_params::ycoord sta thumb_drag_params::ycoord - A2D_CALL A2D_DRAG_SCROLL, thumb_drag_params + MGTK_CALL MGTK::TrackThumb, thumb_drag_params rts .endproc ;;; Checks button state; z clear if button was released, set otherwise .proc was_button_released - A2D_CALL A2D_GET_INPUT, input_params + MGTK_CALL MGTK::GetEvent, input_params lda input_params cmp #2 rts @@ -938,20 +938,20 @@ end: rts sta $07 jsr div_by_16 sta update_scroll_params::pos - A2D_CALL A2D_UPDATE_SCROLL, update_scroll_params + MGTK_CALL MGTK::UpdateThumb, update_scroll_params rts .endproc .proc update_vscroll ; update_scroll_params::pos set by caller lda #1 sta update_scroll_params::type - A2D_CALL A2D_UPDATE_SCROLL, update_scroll_params + MGTK_CALL MGTK::UpdateThumb, update_scroll_params rts .endproc .proc finish_resize ; only called from dead code DESKTOP_CALL DESKTOP_REDRAW_ICONS - A2D_CALL A2D_SET_STATE, window_params::box + MGTK_CALL MGTK::SetPort, window_params::box lda window_params::hscroll ror a ; check if low bit (track enabled) is set bcc :+ @@ -964,9 +964,9 @@ end: rts .endproc .proc clear_window - A2D_CALL A2D_SET_PATTERN, white_pattern - A2D_CALL A2D_FILL_RECT, window_params::box::hoff - A2D_CALL A2D_SET_PATTERN, black_pattern + MGTK_CALL MGTK::SetPattern, white_pattern + MGTK_CALL MGTK::PaintRect, window_params::box::hoff + MGTK_CALL MGTK::SetPattern, black_pattern rts .endproc @@ -1005,7 +1005,7 @@ do_line: bne :+ jsr clear_window inc L0948 -: A2D_CALL A2D_SET_POS, line_pos +: MGTK_CALL MGTK::MoveTo, line_pos sec lda #250 sbc line_pos::left @@ -1194,7 +1194,7 @@ times70:.word 70 beq end lda text_string::len beq end - A2D_CALL A2D_DRAW_TEXT, text_string + MGTK_CALL MGTK::DrawText, text_string lda #1 sta L0949 end: rts @@ -1426,15 +1426,15 @@ ignore: clc ; Click ignored rts .endproc -fixed_str: A2D_DEFSTRING "Fixed " -prop_str: A2D_DEFSTRING "Proportional" +fixed_str: DEFINE_STRING "Fixed " +prop_str: DEFINE_STRING "Proportional" label_width := 50 title_bar_height := 12 .proc mode_box ; bounding box for mode label left: .word 0 top: .word 0 -addr: .word A2D_SCREEN_ADDR -stride: .word A2D_SCREEN_STRIDE +addr: .word MGTK::screen_mapbits +stride: .word MGTK::screen_mapwidth hoff: .word 0 voff: .word 0 width: .word 80 @@ -1471,19 +1471,19 @@ base: .word 10 ; vertical text offset (to baseline) .endproc .proc draw_mode - A2D_CALL A2D_SET_BOX, mode_box - A2D_CALL A2D_SET_POS, mode_pos + MGTK_CALL MGTK::SetPortSite, mode_box + MGTK_CALL MGTK::MoveTo, mode_pos lda fixed_mode_flag beq else ; is proportional? - A2D_CALL A2D_DRAW_TEXT, fixed_str + MGTK_CALL MGTK::DrawText, fixed_str jmp endif -else: A2D_CALL A2D_DRAW_TEXT, prop_str +else: MGTK_CALL MGTK::DrawText, prop_str endif: ldx #$0F loop: lda default_box,x sta window_params::box,x dex bpl loop - A2D_CALL A2D_SET_BOX, window_params::box + MGTK_CALL MGTK::SetPortSite, window_params::box rts .endproc diff --git a/desktop.inc b/desktop.inc index b474130..c6d2b13 100644 --- a/desktop.inc +++ b/desktop.inc @@ -11,7 +11,7 @@ DA_MAX_SIZE := $1C00 - DA_LOAD_ADDRESS ;;; * = Used by Desk Accessories JUMP_TABLE_00 := $4000 ; ??? -JUMP_TABLE_A2D_RELAY := $4003 ; A2D relay call (main>aux) +JUMP_TABLE_MGTK_RELAY := $4003 ; MGTK relay call (main>aux) JUMP_TABLE_06 := $4006 ; ??? JUMP_TABLE_09 := $4009 ; ??? JUMP_TABLE_0C := $400C ; ??? @@ -39,7 +39,7 @@ JUMP_TABLE_RESTORE_SEG := $403F ; Restore from dynamic routine ;;; NOTE: Some of these are used by Desk Accessories DESKTOP := $8E00 - ;; MLI-style call (jsr A2D ; .byte call ; .addr params) + ;; MLI-style call (jsr DEKSTOP ; .byte call ; .addr params) ;; Call from AUX (RAMRDON/RAMWRTON) ;; Implementation bounces to $93BC, uses jump table at $939E diff --git a/desktop/Makefile b/desktop/Makefile index 242dba5..951a089 100644 --- a/desktop/Makefile +++ b/desktop/Makefile @@ -3,7 +3,7 @@ CC65 = ~/dev/cc65/bin CAFLAGS = --target apple2enh --list-bytes 0 CCFLAGS = --config asm.cfg -TARGETS = loader.built a2d.built desktop.built invoker.built +TARGETS = loader.built mgtk.built desktop.built invoker.built .PHONY: clean all all: $(TARGETS) @@ -22,6 +22,6 @@ clean: check: diff loader.built orig/DESKTOP2_loader - diff a2d.built orig/DESKTOP2_a2d + diff mgtk.built orig/DESKTOP2_mgtk diff desktop.built orig/DESKTOP2_desktop diff invoker.built orig/DESKTOP2_invoker diff --git a/desktop/README.md b/desktop/README.md index 3276d93..d704028 100644 --- a/desktop/README.md +++ b/desktop/README.md @@ -16,7 +16,7 @@ segments swapped in dynamically. The file is broken down into multiple segments: * segment 0: load - A$2000-$257F, L$0580, mark $000000 (Loader) -* segment 1: aux - A$4000-$BFFF, L$8000, mark $000580 (A2D, DeskTop) +* segment 1: aux - A$4000-$BFFF, L$8000, mark $000580 (MGTK, DeskTop) * segment 2: auxlc - A$D000-$ECFF, L$1D00, mark $008580 (DeskTop) * segment 3: auxlc - A$FB00-$FFFF, L$0500, mark $00A280 (DeskTop) * segment 4: main - A$4000-$BEFF, L$7F00, mark $00A780 (DeskTop) @@ -77,7 +77,7 @@ Loaded at $800-$FFF, this does one-time initialization of the DeskTop. It is later overwritten when any desk accessories are run. -### GUI Library "A2D" +### Mouse Graphics Tool Kit (MGTK) `a2d.s` @@ -140,8 +140,8 @@ $9000 | +------+ | | $8800 | | | Font | | | | | $851F | | +-------------+ - | | | A2D GUI | - | | | Library | + | | | MGTK | + | | | | | | | | | | | | $7800 | +------+ | | diff --git a/desktop/desktop.s b/desktop/desktop.s index 0145cba..7f2f5cf 100644 --- a/desktop/desktop.s +++ b/desktop/desktop.s @@ -4,7 +4,7 @@ .include "../inc/apple2.inc" .include "../inc/auxmem.inc" .include "../inc/prodos.inc" - .include "../a2d.inc" + .include "../mgtk.inc" .include "../desktop.inc" ;;; ================================================== @@ -66,11 +66,11 @@ INVOKER_FILENAME := $280 ; File to invoke (PREFIX must be set) .word top .endmacro -.macro A2D_RELAY_CALL call, addr +.macro MGTK_RELAY_CALL call, addr .if .paramcount > 1 - yax_call A2D_RELAY, (call), (addr) + yax_call MGTK_RELAY, (call), (addr) .else - yax_call A2D_RELAY, (call), 0 + yax_call MGTK_RELAY, (call), 0 .endif .endmacro @@ -79,7 +79,7 @@ INVOKER_FILENAME := $280 ; File to invoke (PREFIX must be set) .endmacro ;;; ================================================== -;;; Segment loaded into AUX $851F-$BFFF (follows A2D) +;;; Segment loaded into AUX $851F-$BFFF (follows MGTK) ;;; ================================================== .proc desktop_aux @@ -171,7 +171,7 @@ L859C: sta $D409,x sta $D40D sta $D40F - A2D_RELAY_CALL A2D_SET_STATE, $D401 + MGTK_RELAY_CALL MGTK::SetPort, $D401 rts addr_call $6B17, $1A39 @@ -215,19 +215,19 @@ L8616: cmp #$57 addr_call $6B17, $1B7C ldx $D5CA txs -L8625: A2D_RELAY_CALL $33, win18_state +L8625: MGTK_RELAY_CALL $33, win18_state rts addr_call $6B17, $1B9C ldx $D5CA txs - A2D_RELAY_CALL $33, win18_state + MGTK_RELAY_CALL $33, win18_state rts addr_call $6B17, $1BBF ldx $D5CA txs - A2D_RELAY_CALL $33, win18_state + MGTK_RELAY_CALL $33, win18_state rts sta L8737 @@ -425,11 +425,11 @@ L8C83: .byte $00,$00,$00,$00,$77,$30,$01 jmp DESKTOP_DIRECT -.macro A2D_RELAY2_CALL call, addr +.macro MGTK_RELAY2_CALL call, addr .if .paramcount > 1 - yax_call A2D_RELAY2, (call), (addr) + yax_call MGTK_RELAY2, (call), (addr) .else - yax_call A2D_RELAY2, (call), 0 + yax_call MGTK_RELAY2, (call), 0 .endif .endmacro @@ -612,16 +612,16 @@ id: .byte 0 .proc query_screen_params left: .word 0 top: .word 0 -addr: .addr A2D_SCREEN_ADDR -stride: .word A2D_SCREEN_STRIDE +addr: .addr MGTK::screen_mapbits +stride: .word MGTK::screen_mapwidth L934D: hoff: .word 0 voff: .word 0 width: .word screen_width-1 height: .word screen_height-1 pattern:.res 8, $FF -mskand: .byte A2D_DEFAULT_MSKAND -mskor: .byte A2D_DEFAULT_MSKOR +mskand: .byte MGTK::colormask_and +mskor: .byte MGTK::colormask_or xpos: .word 0 ypos: .word 0 hthick: .byte 1 @@ -938,7 +938,7 @@ L951D: asl a rts L9532: jsr LA18A - A2D_CALL A2D_SET_FILL_MODE, const0a + MGTK_CALL MGTK::SetPenMode, const0a jsr LA39D ldy #$00 lda ($06),y @@ -1220,7 +1220,7 @@ L978B: lda ($06),y ldy #$05 lda ($06),y sta L97F5 - A2D_CALL A2D_SET_POS, set_pos_params2 + MGTK_CALL MGTK::MoveTo, set_pos_params2 ldx #$00 L97AA: cpx L8E95 bne L97B9 @@ -1245,7 +1245,7 @@ L97B9: txa cmp L97F5 bne L97E0 jsr LA18A - A2D_CALL $17, L8E03 + MGTK_CALL $17, L8E03 bne L97E6 L97E0: pla tax @@ -1311,7 +1311,7 @@ L9835: .byte $00,$00,$00,$00,$00,$00,$00,$00 L983D: lda #$00 sta L9830 sta L9833 -L9845: A2D_CALL $2C, L933E +L9845: MGTK_CALL $2C, L933E lda L933E cmp #$04 beq L9857 @@ -1376,7 +1376,7 @@ L98C8: lda L9017 lda ($06),y and #$0F sta L9832 - A2D_CALL A2D_QUERY_SCREEN, query_screen_params + MGTK_CALL MGTK::InitPort, query_screen_params ldx #$07 L98E3: lda query_screen_params::L934D,x sta L9835,x @@ -1513,10 +1513,10 @@ L99E1: iny sta $08+1 jmp L9972 -L99FC: A2D_CALL A2D_SET_PATTERN, checkerboard_pattern2 - A2D_CALL A2D_SET_FILL_MODE, const2a - A2D_CALL A2D_DRAW_POLYGONS, drag_outline_buffer -L9A0E: A2D_CALL $2C, L933E +L99FC: MGTK_CALL MGTK::SetPattern, checkerboard_pattern2 + MGTK_CALL MGTK::SetPenMode, const2a + MGTK_CALL MGTK::FramePoly, drag_outline_buffer +L9A0E: MGTK_CALL $2C, L933E lda L933E cmp #$04 beq L9A1E @@ -1544,13 +1544,13 @@ L9A33: lda query_target_params2,x lda query_target_params2::element cmp L9830 beq L9A84 - A2D_CALL A2D_SET_PATTERN, checkerboard_pattern2 - A2D_CALL A2D_SET_FILL_MODE, const2a - A2D_CALL A2D_DRAW_POLYGONS, drag_outline_buffer + MGTK_CALL MGTK::SetPattern, checkerboard_pattern2 + MGTK_CALL MGTK::SetPenMode, const2a + MGTK_CALL MGTK::FramePoly, drag_outline_buffer DESKTOP_DIRECT_CALL $B, L9830 - A2D_CALL A2D_SET_PATTERN, checkerboard_pattern2 - A2D_CALL A2D_SET_FILL_MODE, const2a - A2D_CALL A2D_DRAW_POLYGONS, drag_outline_buffer + MGTK_CALL MGTK::SetPattern, checkerboard_pattern2 + MGTK_CALL MGTK::SetPenMode, const2a + MGTK_CALL MGTK::FramePoly, drag_outline_buffer lda #$00 sta L9830 L9A84: lda query_target_params2::queryx @@ -1637,7 +1637,7 @@ L9B48: bit L9C75 bvc L9B52 jmp L9A0E -L9B52: A2D_CALL A2D_DRAW_POLYGONS, drag_outline_buffer +L9B52: MGTK_CALL MGTK::FramePoly, drag_outline_buffer lda #drag_outline_buffer @@ -1674,16 +1674,16 @@ L9B62: lda ($08),y inc $08+1 L9B99: jmp L9B60 -L9B9C: A2D_CALL A2D_DRAW_POLYGONS, drag_outline_buffer +L9B9C: MGTK_CALL MGTK::FramePoly, drag_outline_buffer jmp L9A0E -L9BA5: A2D_CALL A2D_DRAW_POLYGONS, drag_outline_buffer +L9BA5: MGTK_CALL MGTK::FramePoly, drag_outline_buffer lda L9830 beq L9BB9 DESKTOP_DIRECT_CALL $B, L9830 jmp L9C63 -L9BB9: A2D_CALL A2D_QUERY_TARGET, query_target_params2 +L9BB9: MGTK_CALL MGTK::FindWindow, query_target_params2 lda query_target_params2::id cmp L9832 beq L9BE1 @@ -1700,8 +1700,8 @@ L9BD4: ora #$80 L9BDC: lda L9832 beq L9BD1 L9BE1: jsr LA365 - A2D_CALL A2D_QUERY_SCREEN, query_screen_params - A2D_CALL A2D_SET_STATE, query_screen_params + MGTK_CALL MGTK::InitPort, query_screen_params + MGTK_CALL MGTK::SetPort, query_screen_params ldx L9016 L9BF3: dex bmi L9C18 @@ -1715,7 +1715,7 @@ L9BF3: dex lda L8F15+1,x sta $07 jsr LA18A - A2D_CALL A2D_SET_FILL_MODE, const0a + MGTK_CALL MGTK::SetPenMode, const0a jsr LA39D pla tax @@ -1976,7 +1976,7 @@ L9E14: bit L9833 rts L9E1A: jsr LA365 -L9E1D: A2D_CALL A2D_QUERY_TARGET, query_target_params2 +L9E1D: MGTK_CALL MGTK::FindWindow, query_target_params2 lda query_target_params2::element bne L9E2B sta query_target_params2::id @@ -2009,17 +2009,17 @@ L9E3D: cmp L9017,x bne L9E97 lda L9EB3 L9E6A: sta L9830 - A2D_CALL A2D_SET_PATTERN, checkerboard_pattern2 - A2D_CALL A2D_SET_FILL_MODE, const2a - A2D_CALL A2D_DRAW_POLYGONS, drag_outline_buffer + MGTK_CALL MGTK::SetPattern, checkerboard_pattern2 + MGTK_CALL MGTK::SetPenMode, const2a + MGTK_CALL MGTK::FramePoly, drag_outline_buffer DESKTOP_DIRECT_CALL $2, L9830 - A2D_CALL A2D_SET_PATTERN, checkerboard_pattern2 - A2D_CALL A2D_SET_FILL_MODE, const2a - A2D_CALL A2D_DRAW_POLYGONS, drag_outline_buffer -L9E97: A2D_CALL A2D_QUERY_SCREEN, query_screen_params - A2D_CALL A2D_SET_STATE, query_screen_params - A2D_CALL A2D_SET_PATTERN, checkerboard_pattern2 - A2D_CALL A2D_SET_FILL_MODE, const2a + MGTK_CALL MGTK::SetPattern, checkerboard_pattern2 + MGTK_CALL MGTK::SetPenMode, const2a + MGTK_CALL MGTK::FramePoly, drag_outline_buffer +L9E97: MGTK_CALL MGTK::InitPort, query_screen_params + MGTK_CALL MGTK::SetPort, query_screen_params + MGTK_CALL MGTK::SetPattern, checkerboard_pattern2 + MGTK_CALL MGTK::SetPenMode, const2a jsr LA382 rts @@ -2187,7 +2187,7 @@ L9FE4: lda ($06),y bne L9FE4 L9FEE: lda draw_text_params::length sta measure_text_params::length - A2D_CALL A2D_MEASURE_TEXT, measure_text_params + MGTK_CALL MGTK::TextWidth, measure_text_params lda measure_text_params::width cmp draw_bitmap_params2::width bcs LA010 @@ -2241,57 +2241,57 @@ LA06E: lda set_pos_params2,x bpl LA06E bit L9F92 bvc LA097 - A2D_CALL A2D_QUERY_SCREEN, query_screen_params + MGTK_CALL MGTK::InitPort, query_screen_params jsr LA63F LA085: jsr LA6A3 jsr LA097 lda L9F93 bne LA085 - A2D_CALL A2D_SET_BOX, query_screen_params + MGTK_CALL MGTK::SetPortSite, query_screen_params rts -LA097: A2D_CALL A2D_HIDE_CURSOR, DESKTOP_DIRECT ; These params should be ignored - bogus? - A2D_CALL A2D_SET_FILL_MODE, const4a +LA097: MGTK_CALL MGTK::HideCursor, DESKTOP_DIRECT ; These params should be ignored - bogus? + MGTK_CALL MGTK::SetPenMode, const4a bit L9F92 bpl LA0C2 bit L9F92 bvc LA0B6 - A2D_CALL A2D_SET_FILL_MODE, const0a + MGTK_CALL MGTK::SetPenMode, const0a jmp LA0C2 -LA0B6: A2D_CALL A2D_DRAW_BITMAP, draw_bitmap_params - A2D_CALL A2D_SET_FILL_MODE, const2a -LA0C2: A2D_CALL A2D_DRAW_BITMAP, draw_bitmap_params2 +LA0B6: MGTK_CALL MGTK::PaintBits, draw_bitmap_params + MGTK_CALL MGTK::SetPenMode, const2a +LA0C2: MGTK_CALL MGTK::PaintBits, draw_bitmap_params2 ldy #$02 lda ($06),y and #$80 beq LA0F2 jsr LA14D - A2D_CALL A2D_SET_PATTERN, dark_pattern + MGTK_CALL MGTK::SetPattern, dark_pattern bit L9F92 bmi LA0E6 - A2D_CALL A2D_SET_FILL_MODE, const3a + MGTK_CALL MGTK::SetPenMode, const3a beq LA0EC -LA0E6: A2D_CALL A2D_SET_FILL_MODE, const1a -LA0EC: A2D_CALL A2D_FILL_RECT, fill_rect_params6 +LA0E6: MGTK_CALL MGTK::SetPenMode, const1a +LA0EC: MGTK_CALL MGTK::PaintRect, fill_rect_params6 LA0F2: ldx #$03 LA0F4: lda L9F94,x sta set_pos_params2,x dex bpl LA0F4 - A2D_CALL A2D_SET_POS, set_pos_params2 + MGTK_CALL MGTK::MoveTo, set_pos_params2 bit L9F92 bmi LA10C lda #$7F bne LA10E LA10C: lda #$00 LA10E: sta set_text_mask_params - A2D_CALL A2D_SET_TEXT_MASK, set_text_mask_params + MGTK_CALL MGTK::SetTextBG, set_text_mask_params lda text_buffer+1 and #$DF sta text_buffer+1 - A2D_CALL A2D_DRAW_TEXT, draw_text_params - A2D_CALL A2D_SHOW_CURSOR + MGTK_CALL MGTK::DrawText, draw_text_params + MGTK_CALL MGTK::ShowCursor rts LA12C: ldx #$0F @@ -2410,7 +2410,7 @@ LA22A: lda ($06),y bpl LA22A LA233: lda draw_text_params::length sta measure_text_params::length - A2D_CALL A2D_MEASURE_TEXT, measure_text_params + MGTK_CALL MGTK::TextWidth, measure_text_params ldy #$08 lda measure_text_params::width cmp ($08),y @@ -2588,8 +2588,8 @@ LA38C: pla LA39B: .byte 0 LA39C: .byte 0 -LA39D: A2D_CALL A2D_QUERY_SCREEN, query_screen_params - A2D_CALL A2D_SET_STATE, query_screen_params +LA39D: MGTK_CALL MGTK::InitPort, query_screen_params + MGTK_CALL MGTK::SetPort, query_screen_params jmp LA3B9 LA3AC: .byte 0 @@ -2616,28 +2616,28 @@ LA3B9: ldy #$00 beq LA3F4 lda #$80 sta LA3B7 - A2D_CALL A2D_SET_PATTERN, white_pattern - A2D_CALL $41, LA3B8 + MGTK_CALL MGTK::SetPattern, white_pattern + MGTK_CALL $41, LA3B8 lda LA3B8 sta query_state_params - A2D_CALL A2D_QUERY_STATE, query_state_params + MGTK_CALL MGTK::GetWinPort, query_state_params jsr LA4CC jsr LA938 jsr LA41C jmp LA446 -LA3F4: A2D_CALL A2D_QUERY_SCREEN, query_screen_params +LA3F4: MGTK_CALL MGTK::InitPort, query_screen_params jsr LA63F LA3FD: jsr LA6A3 jsr LA411 lda L9F93 bne LA3FD - A2D_CALL A2D_SET_BOX, query_screen_params + MGTK_CALL MGTK::SetPortSite, query_screen_params jmp LA446 LA411: lda #$00 sta LA3B7 - A2D_CALL A2D_SET_PATTERN, checkerboard_pattern2 + MGTK_CALL MGTK::SetPattern, checkerboard_pattern2 LA41C: lda L8E07 sta LA3B1 lda L8E08 @@ -2651,7 +2651,7 @@ LA436: lda L8E15,x sta LA3B3,x dex bpl LA436 - A2D_CALL $15, L8E03 + MGTK_CALL $15, L8E03 rts LA446: jsr LA365 @@ -2661,8 +2661,8 @@ LA44D: cpx #$FF bne LA466 bit LA3B7 bpl LA462 - A2D_CALL A2D_QUERY_SCREEN, query_screen_params - A2D_CALL A2D_SET_STATE, set_state_params + MGTK_CALL MGTK::InitPort, query_screen_params + MGTK_CALL MGTK::SetPort, set_state_params LA462: jsr LA382 rts @@ -2902,8 +2902,8 @@ LA62C: .byte $00,$00,$00 .proc set_box_params2 left: .word 0 top: .word 0 -addr: .addr A2D_SCREEN_ADDR -stride: .word A2D_SCREEN_STRIDE +addr: .addr MGTK::screen_mapbits +stride: .word MGTK::screen_mapwidth hoff: .word 0 voff: .word 0 width: .word 0 @@ -2944,7 +2944,7 @@ LA674: lda L8E15,x lda #$02 sta LA62C sta set_box_params2::width+1 -LA69C: A2D_CALL A2D_SET_BOX, set_box_params2 +LA69C: MGTK_CALL MGTK::SetPortSite, set_box_params2 rts LA6A3: lda #$00 @@ -3033,7 +3033,7 @@ LA747: lda LA6B0 bne LA775 lda #$00 sta LA6B0 -LA753: A2D_CALL A2D_SET_BOX, set_box_params2 +LA753: MGTK_CALL MGTK::SetPortSite, set_box_params2 lda set_box_params2::width+1 cmp LA62C bne LA76F @@ -3060,14 +3060,14 @@ LA77D: lda LA6B3,x cpy #$04 bne LA77D inc LA6B0 - A2D_CALL A2D_QUERY_TARGET, query_target_params + MGTK_CALL MGTK::FindWindow, query_target_params lda query_target_params::element beq LA747 lda query_target_params::id sta query_state_params - A2D_CALL A2D_QUERY_STATE, query_state_params + MGTK_CALL MGTK::GetWinPort, query_state_params jsr LA365 - A2D_CALL A2D_QUERY_WINDOW, query_target_params::id + MGTK_CALL MGTK::GetWinPtr, query_target_params::id lda LA6AE sta $06 lda LA6AF @@ -3241,7 +3241,7 @@ LA938: lda set_state_params::top lda set_state_params::voff+1 adc #0 sta set_state_params::voff+1 - A2D_CALL A2D_SET_STATE, set_state_params + MGTK_CALL MGTK::SetPort, set_state_params rts .byte $00,$00,$00,$00,$00,$00,$00,$00 @@ -3879,9 +3879,9 @@ alert_action_table: start: pha txa pha - A2D_RELAY2_CALL A2D_HIDE_CURSOR - A2D_RELAY2_CALL A2D_SET_CURSOR, pointer_cursor - A2D_RELAY2_CALL A2D_SHOW_CURSOR + MGTK_RELAY2_CALL MGTK::HideCursor + MGTK_RELAY2_CALL MGTK::SetCursor, pointer_cursor + MGTK_RELAY2_CALL MGTK::ShowCursor ;; play bell sta ALTZPOFF @@ -3905,7 +3905,7 @@ LBA0B: sta state2_left,x sta state2_height lda #>$B9 sta state2_height+1 - A2D_RELAY2_CALL A2D_SET_STATE, state2 + MGTK_RELAY2_CALL MGTK::SetPort, state2 lda LB6D3 ldx LB6D3+1 jsr LBF8B @@ -3927,20 +3927,20 @@ LBA0B: sta state2_left,x clc adc LB6E1 sta LBFCB - A2D_RELAY2_CALL A2D_HIDE_CURSOR + MGTK_RELAY2_CALL MGTK::HideCursor jsr LBE08 - A2D_RELAY2_CALL A2D_SHOW_CURSOR - A2D_RELAY2_CALL A2D_SET_FILL_MODE, const0 - A2D_RELAY2_CALL A2D_FILL_RECT, alert_rect ; alert background - A2D_RELAY2_CALL A2D_SET_FILL_MODE, const2 ; ensures corners are inverted - A2D_RELAY2_CALL A2D_DRAW_RECT, alert_rect ; alert outline - A2D_RELAY2_CALL A2D_SET_BOX, LB6D3 - A2D_RELAY2_CALL A2D_DRAW_RECT, alert_inner_frame_rect1 ; inner 2x border - A2D_RELAY2_CALL A2D_DRAW_RECT, alert_inner_frame_rect2 - A2D_RELAY2_CALL A2D_SET_FILL_MODE, const0 ; restores normal mode - A2D_RELAY2_CALL A2D_HIDE_CURSOR - A2D_RELAY2_CALL A2D_DRAW_BITMAP, alert_bitmap_params - A2D_RELAY2_CALL A2D_SHOW_CURSOR + MGTK_RELAY2_CALL MGTK::ShowCursor + MGTK_RELAY2_CALL MGTK::SetPenMode, const0 + MGTK_RELAY2_CALL MGTK::PaintRect, alert_rect ; alert background + MGTK_RELAY2_CALL MGTK::SetPenMode, const2 ; ensures corners are inverted + MGTK_RELAY2_CALL MGTK::FrameRect, alert_rect ; alert outline + MGTK_RELAY2_CALL MGTK::SetPortSite, LB6D3 + MGTK_RELAY2_CALL MGTK::FrameRect, alert_inner_frame_rect1 ; inner 2x border + MGTK_RELAY2_CALL MGTK::FrameRect, alert_inner_frame_rect2 + MGTK_RELAY2_CALL MGTK::SetPenMode, const0 ; restores normal mode + MGTK_RELAY2_CALL MGTK::HideCursor + MGTK_RELAY2_CALL MGTK::PaintBits, alert_bitmap_params + MGTK_RELAY2_CALL MGTK::ShowCursor pla tax pla @@ -3976,33 +3976,33 @@ LBB0B: tya tay lda alert_action_table,y sta alert_action -LBB14: A2D_RELAY2_CALL A2D_SET_FILL_MODE, const2 +LBB14: MGTK_RELAY2_CALL MGTK::SetPenMode, const2 bit alert_action bpl LBB5C - A2D_RELAY2_CALL A2D_DRAW_RECT, cancel_rect - A2D_RELAY2_CALL A2D_SET_POS, cancel_pos + MGTK_RELAY2_CALL MGTK::FrameRect, cancel_rect + MGTK_RELAY2_CALL MGTK::MoveTo, cancel_pos DRAW_PASCAL_STRING cancel_label bit alert_action bvs LBB5C - A2D_RELAY2_CALL A2D_DRAW_RECT, try_again_rect - A2D_RELAY2_CALL A2D_SET_POS, try_again_pos + MGTK_RELAY2_CALL MGTK::FrameRect, try_again_rect + MGTK_RELAY2_CALL MGTK::MoveTo, try_again_pos DRAW_PASCAL_STRING try_again_label jmp LBB75 -LBB5C: A2D_RELAY2_CALL A2D_DRAW_RECT, try_again_rect - A2D_RELAY2_CALL A2D_SET_POS, try_again_pos +LBB5C: MGTK_RELAY2_CALL MGTK::FrameRect, try_again_rect + MGTK_RELAY2_CALL MGTK::MoveTo, try_again_pos DRAW_PASCAL_STRING ok_label -LBB75: A2D_RELAY2_CALL A2D_SET_POS, LB70F +LBB75: MGTK_RELAY2_CALL MGTK::MoveTo, LB70F lda LB714 ldx LB715 jsr draw_pascal_string -LBB87: A2D_RELAY2_CALL A2D_GET_INPUT, input_params +LBB87: MGTK_RELAY2_CALL MGTK::GetEvent, input_params lda input_params_state - cmp #A2D_INPUT_DOWN + cmp #MGTK::button_down bne LBB9A jmp LBC0C -LBB9A: cmp #A2D_INPUT_KEY +LBB9A: cmp #MGTK::key_down bne LBB87 lda input_params_key and #$7F @@ -4010,8 +4010,8 @@ LBB9A: cmp #A2D_INPUT_KEY bpl LBBEE cmp #KEY_ESCAPE bne LBBC3 - A2D_RELAY2_CALL A2D_SET_FILL_MODE, const2 - A2D_RELAY2_CALL A2D_FILL_RECT, cancel_rect + MGTK_RELAY2_CALL MGTK::SetPenMode, const2 + MGTK_RELAY2_CALL MGTK::PaintRect, cancel_rect lda #$01 jmp LBC55 @@ -4019,8 +4019,8 @@ LBBC3: bit alert_action bvs LBBEE cmp #'a' bne LBBE3 -LBBCC: A2D_RELAY2_CALL A2D_SET_FILL_MODE, const2 - A2D_RELAY2_CALL A2D_FILL_RECT, try_again_rect +LBBCC: MGTK_RELAY2_CALL MGTK::SetPenMode, const2 + MGTK_RELAY2_CALL MGTK::PaintRect, try_again_rect lda #$00 jmp LBC55 @@ -4032,30 +4032,30 @@ LBBE3: cmp #'A' LBBEE: cmp #KEY_RETURN bne LBC09 - A2D_RELAY2_CALL A2D_SET_FILL_MODE, const2 - A2D_RELAY2_CALL A2D_FILL_RECT, try_again_rect + MGTK_RELAY2_CALL MGTK::SetPenMode, const2 + MGTK_RELAY2_CALL MGTK::PaintRect, try_again_rect lda #$02 jmp LBC55 LBC09: jmp LBB87 LBC0C: jsr LBDE1 - A2D_RELAY2_CALL A2D_SET_POS, input_params_coords + MGTK_RELAY2_CALL MGTK::MoveTo, input_params_coords bit alert_action bpl LBC42 - A2D_RELAY2_CALL A2D_TEST_BOX, cancel_rect + MGTK_RELAY2_CALL MGTK::InRect, cancel_rect cmp #$80 bne LBC2D jmp LBCE9 LBC2D: bit alert_action bvs LBC42 - A2D_RELAY2_CALL A2D_TEST_BOX, try_again_rect + MGTK_RELAY2_CALL MGTK::InRect, try_again_rect cmp #$80 bne LBC52 jmp LBC6D -LBC42: A2D_RELAY2_CALL A2D_TEST_BOX, try_again_rect +LBC42: MGTK_RELAY2_CALL MGTK::InRect, try_again_rect cmp #$80 bne LBC52 jmp LBD65 @@ -4063,23 +4063,23 @@ LBC42: A2D_RELAY2_CALL A2D_TEST_BOX, try_again_rect LBC52: jmp LBB87 LBC55: pha - A2D_RELAY2_CALL A2D_HIDE_CURSOR + MGTK_RELAY2_CALL MGTK::HideCursor jsr LBE5D - A2D_RELAY2_CALL A2D_SHOW_CURSOR + MGTK_RELAY2_CALL MGTK::ShowCursor pla rts -LBC6D: A2D_RELAY2_CALL A2D_SET_FILL_MODE, const2 - A2D_RELAY2_CALL A2D_FILL_RECT, try_again_rect +LBC6D: MGTK_RELAY2_CALL MGTK::SetPenMode, const2 + MGTK_RELAY2_CALL MGTK::PaintRect, try_again_rect lda #$00 sta LBCE8 -LBC84: A2D_RELAY2_CALL A2D_GET_INPUT, input_params +LBC84: MGTK_RELAY2_CALL MGTK::GetEvent, input_params lda input_params_state - cmp #A2D_INPUT_UP + cmp #MGTK::button_up beq LBCDB jsr LBDE1 - A2D_RELAY2_CALL A2D_SET_POS, input_params_coords - A2D_RELAY2_CALL A2D_TEST_BOX, try_again_rect + MGTK_RELAY2_CALL MGTK::MoveTo, input_params_coords + MGTK_RELAY2_CALL MGTK::InRect, try_again_rect cmp #$80 beq LBCB5 lda LBCE8 @@ -4090,8 +4090,8 @@ LBCB5: lda LBCE8 bne LBCBD jmp LBC84 -LBCBD: A2D_RELAY2_CALL A2D_SET_FILL_MODE, const2 - A2D_RELAY2_CALL A2D_FILL_RECT, try_again_rect +LBCBD: MGTK_RELAY2_CALL MGTK::SetPenMode, const2 + MGTK_RELAY2_CALL MGTK::PaintRect, try_again_rect lda LBCE8 clc adc #$80 @@ -4106,17 +4106,17 @@ LBCE3: lda #$00 jmp LBC55 LBCE8: .byte 0 -LBCE9: A2D_RELAY2_CALL A2D_SET_FILL_MODE, const2 - A2D_RELAY2_CALL A2D_FILL_RECT, cancel_rect +LBCE9: MGTK_RELAY2_CALL MGTK::SetPenMode, const2 + MGTK_RELAY2_CALL MGTK::PaintRect, cancel_rect lda #$00 sta LBD64 -LBD00: A2D_RELAY2_CALL A2D_GET_INPUT, input_params +LBD00: MGTK_RELAY2_CALL MGTK::GetEvent, input_params lda input_params_state - cmp #A2D_INPUT_UP + cmp #MGTK::button_up beq LBD57 jsr LBDE1 - A2D_RELAY2_CALL A2D_SET_POS, input_params_coords - A2D_RELAY2_CALL A2D_TEST_BOX, cancel_rect + MGTK_RELAY2_CALL MGTK::MoveTo, input_params_coords + MGTK_RELAY2_CALL MGTK::InRect, cancel_rect cmp #$80 beq LBD31 lda LBD64 @@ -4127,8 +4127,8 @@ LBD31: lda LBD64 bne LBD39 jmp LBD00 -LBD39: A2D_RELAY2_CALL A2D_SET_FILL_MODE, const2 - A2D_RELAY2_CALL A2D_FILL_RECT, cancel_rect +LBD39: MGTK_RELAY2_CALL MGTK::SetPenMode, const2 + MGTK_RELAY2_CALL MGTK::PaintRect, cancel_rect lda LBD64 clc adc #$80 @@ -4145,15 +4145,15 @@ LBD5F: lda #$01 LBD64: .byte 0 LBD65: lda #$00 sta LBDE0 - A2D_RELAY2_CALL A2D_SET_FILL_MODE, const2 - A2D_RELAY2_CALL A2D_FILL_RECT, try_again_rect -LBD7C: A2D_RELAY2_CALL A2D_GET_INPUT, input_params + MGTK_RELAY2_CALL MGTK::SetPenMode, const2 + MGTK_RELAY2_CALL MGTK::PaintRect, try_again_rect +LBD7C: MGTK_RELAY2_CALL MGTK::GetEvent, input_params lda input_params_state - cmp #A2D_INPUT_UP + cmp #MGTK::button_up beq LBDD3 jsr LBDE1 - A2D_RELAY2_CALL A2D_SET_POS, input_params_coords - A2D_RELAY2_CALL A2D_TEST_BOX, try_again_rect + MGTK_RELAY2_CALL MGTK::MoveTo, input_params_coords + MGTK_RELAY2_CALL MGTK::InRect, try_again_rect cmp #$80 beq LBDAD lda LBDE0 @@ -4164,8 +4164,8 @@ LBDAD: lda LBDE0 bne LBDB5 jmp LBD7C -LBDB5: A2D_RELAY2_CALL A2D_SET_FILL_MODE, const2 - A2D_RELAY2_CALL A2D_FILL_RECT, try_again_rect +LBDB5: MGTK_RELAY2_CALL MGTK::SetPenMode, const2 + MGTK_RELAY2_CALL MGTK::PaintRect, try_again_rect lda LBDE0 clc adc #$80 @@ -4444,16 +4444,16 @@ LBFCF: .byte $00 inc ptr bne call inc ptr+1 -call: A2D_RELAY2_CALL A2D_DRAW_TEXT, ptr +call: MGTK_RELAY2_CALL MGTK::DrawText, ptr end: rts .endproc - ;; A2D call in Y, params addr (X,A) -.proc A2D_RELAY2 + ;; MGTK call in Y, params addr (X,A) +.proc MGTK_RELAY2 sty call sta addr stx addr+1 - jsr A2D + jsr MGTK::MLI call: .byte 0 addr: .addr 0 rts @@ -4474,15 +4474,15 @@ addr: .addr 0 ;;; Various routines callable from MAIN ;;; ================================================== -;;; A2D call from main>aux, call in Y, params at (X,A) -.proc A2D_RELAY +;;; MGTK call from main>aux, call in Y, params at (X,A) +.proc MGTK_RELAY .assert * = $D000, error, "Entry point mismatch" sty addr-1 sta addr stx addr+1 sta RAMRDON sta RAMWRTON - A2D_CALL 0, 0, addr + MGTK_CALL 0, 0, addr sta RAMRDOFF sta RAMWRTOFF rts @@ -4496,8 +4496,8 @@ addr: .addr 0 stx addr+1 sta RAMRDON sta RAMWRTON - A2D_CALL A2D_SET_POS, 0, addr - A2D_RELAY_CALL A2D_DRAW_TEXT, text_buffer2 + MGTK_CALL MGTK::MoveTo, 0, addr + MGTK_RELAY_CALL MGTK::DrawText, text_buffer2 tay sta RAMRDOFF sta RAMWRTOFF @@ -4670,7 +4670,7 @@ flag: .byte 0 sta RAMRDON sta RAMWRTON - A2D_CALL A2D_GET_STATE, src ; grab window state + MGTK_CALL MGTK::GetPort, src ; grab window state lda desktop_active_winid ; which desktop window? asl a @@ -4759,7 +4759,7 @@ ycoord: .word 0 input_params_xcoord := input_params::xcoord input_params_ycoord := input_params::ycoord - ;; When input_params_coords is used for A2D_QUERY_CLIENT/TARGET + ;; When input_params_coords is used for FindControl/FindWindow query_client_params_part: query_target_params_element: @@ -4827,15 +4827,15 @@ font: .addr 0 .proc state1 left: .word 0 top: .word 0 -addr: .addr A2D_SCREEN_ADDR -stride: .word A2D_SCREEN_STRIDE +addr: .addr MGTK::screen_mapbits +stride: .word MGTK::screen_mapwidth hoff: .word 0 voff: .word 0 width: .word 10 height: .word 10 pattern:.res 8, $FF -mskand: .byte A2D_DEFAULT_MSKAND -mskor: .byte A2D_DEFAULT_MSKOR +mskand: .byte MGTK::colormask_and +mskor: .byte MGTK::colormask_or xpos: .word 0 ypos: .word 0 hthick: .byte 1 @@ -5035,10 +5035,10 @@ alert_bitmap2_params: .proc winF id: .byte $0F -flags: .byte A2D_CWF_NOTITLE +flags: .byte MGTK::option_dialog_box title: .addr 0 -hscroll:.byte A2D_CWS_NOSCROLL -vscroll:.byte A2D_CWS_NOSCROLL +hscroll:.byte MGTK::scroll_option_none +vscroll:.byte MGTK::scroll_option_none hsmax: .byte 0 hspos: .byte 0 vsmax: .byte 0 @@ -5050,31 +5050,31 @@ w2: .word $1F4 h2: .word $8C left: .word $4B top: .word $23 -addr: .addr A2D_SCREEN_ADDR -stride: .word A2D_SCREEN_STRIDE +addr: .addr MGTK::screen_mapbits +stride: .word MGTK::screen_mapwidth hoff: .word 0 voff: .word 0 width: .word $190 height: .word $64 pattern:.res 8, $FF -mskand: .byte A2D_DEFAULT_MSKAND -mskor: .byte A2D_DEFAULT_MSKOR +mskand: .byte MGTK::colormask_and +mskor: .byte MGTK::colormask_or xpos: .word 0 ypos: .word 0 hthick: .byte 1 vthick: .byte 1 fill: .byte 0 -tmask: .byte A2D_DEFAULT_TMASK +tmask: .byte MGTK::textbg_white font: .addr DEFAULT_FONT next: .addr 0 .endproc .proc win12 id: .byte $12 -flags: .byte A2D_CWF_NOTITLE +flags: .byte MGTK::option_dialog_box title: .addr 0 -hscroll:.byte A2D_CWS_NOSCROLL -vscroll:.byte A2D_CWS_NOSCROLL +hscroll:.byte MGTK::scroll_option_none +vscroll:.byte MGTK::scroll_option_none hsmax: .byte 0 hspos: .byte 0 vsmax: .byte 0 @@ -5086,31 +5086,31 @@ w2: .word $1F4 h2: .word $8C left: .word $19 top: .word $14 -addr: .addr A2D_SCREEN_ADDR -stride: .word A2D_SCREEN_STRIDE +addr: .addr MGTK::screen_mapbits +stride: .word MGTK::screen_mapwidth hoff: .word 0 voff: .word 0 width: .word $1F4 height: .word $99 pattern:.res 8, $FF -mskand: .byte A2D_DEFAULT_MSKAND -mskor: .byte A2D_DEFAULT_MSKOR +mskand: .byte MGTK::colormask_and +mskor: .byte MGTK::colormask_or xpos: .word 0 ypos: .word 0 hthick: .byte 1 vthick: .byte 1 mode: .byte 0 -tmask: .byte A2D_DEFAULT_TMASK +tmask: .byte MGTK::textbg_white font: .addr DEFAULT_FONT next: .addr 0 .endproc .proc win15 id: .byte $15 -flags: .byte A2D_CWF_NOTITLE +flags: .byte MGTK::option_dialog_box title: .addr 0 -hscroll:.byte A2D_CWS_NOSCROLL -vscroll:.byte A2D_CWS_SCROLL_NORMAL +hscroll:.byte MGTK::scroll_option_none +vscroll:.byte MGTK::scroll_option_normal hsmax: .byte 0 hspos: .byte 0 vsmax: .byte 3 @@ -5122,31 +5122,31 @@ w2: .word $64 h2: .word $46 left: .word $35 top: .word $32 -addr: .addr A2D_SCREEN_ADDR -stride: .word A2D_SCREEN_STRIDE +addr: .addr MGTK::screen_mapbits +stride: .word MGTK::screen_mapwidth hoff: .word 0 voff: .word 0 width: .word $7D height: .word $46 pattern:.res 8, $FF -mskand: .byte A2D_DEFAULT_MSKAND -mskor: .byte A2D_DEFAULT_MSKOR +mskand: .byte MGTK::colormask_and +mskor: .byte MGTK::colormask_or xpos: .word 0 ypos: .word 0 hthick: .byte 1 vthick: .byte 1 mode: .byte 0 -tmask: .byte A2D_DEFAULT_TMASK +tmask: .byte MGTK::textbg_white font: .addr DEFAULT_FONT next: .addr 0 .endproc .proc win18 id: .byte $18 -flags: .byte A2D_CWF_NOTITLE +flags: .byte MGTK::option_dialog_box title: .addr 0 -hscroll:.byte A2D_CWS_NOSCROLL -vscroll:.byte A2D_CWS_NOSCROLL +hscroll:.byte MGTK::scroll_option_none +vscroll:.byte MGTK::scroll_option_none hsmax: .byte 0 hspos: .byte 0 vsmax: .byte 0 @@ -5159,21 +5159,21 @@ h2: .word $8C state: left: .word $50 top: .word $28 -addr: .addr A2D_SCREEN_ADDR -stride: .word A2D_SCREEN_STRIDE +addr: .addr MGTK::screen_mapbits +stride: .word MGTK::screen_mapwidth hoff: .word 0 voff: .word 0 width: .word $190 height: .word $6E pattern:.res 8, $FF -mskand: .byte A2D_DEFAULT_MSKAND -mskor: .byte A2D_DEFAULT_MSKOR +mskand: .byte MGTK::colormask_and +mskor: .byte MGTK::colormask_or xpos: .word 0 ypos: .word 0 hthick: .byte 1 vthick: .byte 1 mode: .byte 0 -tmask: .byte A2D_DEFAULT_TMASK +tmask: .byte MGTK::textbg_white font: .addr DEFAULT_FONT next: .addr 0 .endproc @@ -5181,10 +5181,10 @@ next: .addr 0 .proc win1B id: .byte $1B -flags: .byte A2D_CWF_NOTITLE +flags: .byte MGTK::option_dialog_box title: .addr 0 -hscroll:.byte A2D_CWS_NOSCROLL -vscroll:.byte A2D_CWS_NOSCROLL +hscroll:.byte MGTK::scroll_option_none +vscroll:.byte MGTK::scroll_option_none hsmax: .byte 0 hspos: .byte 0 vsmax: .byte 0 @@ -5196,21 +5196,21 @@ w2: .word $1F4 h2: .word $8C left: .word $69 top: .word $19 -addr: .addr A2D_SCREEN_ADDR -stride: .word A2D_SCREEN_STRIDE +addr: .addr MGTK::screen_mapbits +stride: .word MGTK::screen_mapwidth hoff: .word 0 voff: .word 0 width: .word $15E height: .word $6E pattern:.res 8, $FF -mskand: .byte A2D_DEFAULT_MSKAND -mskor: .byte A2D_DEFAULT_MSKOR +mskand: .byte MGTK::colormask_and +mskor: .byte MGTK::colormask_or xpos: .word 0 ypos: .word 0 hthick: .byte 1 vthick: .byte 1 mode: .byte 0 -tmask: .byte A2D_DEFAULT_TMASK +tmask: .byte MGTK::textbg_white font: .addr DEFAULT_FONT next: .addr 0 .endproc @@ -5226,8 +5226,8 @@ dialog_label_pos: DEFINE_POINT 40,0 LD6C7: DEFINE_POINT 75, 35 - .addr A2D_SCREEN_ADDR - .word A2D_SCREEN_STRIDE + .addr MGTK::screen_mapbits + .word MGTK::screen_mapwidth .word 0, 0 ; hoff, voff .word $166, $64 ; width, height @@ -5470,7 +5470,7 @@ item_num:.byte 0 .byte $00,$00,$00,$00,$00,$00 .byte $00,$04,$00,$00,$00 -LE267: .byte $04,$00,$00 ; params for an A2D $36 call +LE267: .byte $04,$00,$00 ; params for an MGTK $36 call LE26A: .byte $04,$00 LE26C: .byte $00,$00,$00,$00,$04,$00 @@ -5506,20 +5506,20 @@ startup_menu: str_all:PASCAL_STRING "All" -sd0: A2D_DEFSTRING "Slot drive ", sd0s -sd1: A2D_DEFSTRING "Slot drive ", sd1s -sd2: A2D_DEFSTRING "Slot drive ", sd2s -sd3: A2D_DEFSTRING "Slot drive ", sd3s -sd4: A2D_DEFSTRING "Slot drive ", sd4s -sd5: A2D_DEFSTRING "Slot drive ", sd5s -sd6: A2D_DEFSTRING "Slot drive ", sd6s -sd7: A2D_DEFSTRING "Slot drive ", sd7s -sd8: A2D_DEFSTRING "Slot drive ", sd8s -sd9: A2D_DEFSTRING "Slot drive ", sd9s -sd10: A2D_DEFSTRING "Slot drive ", sd10s -sd11: A2D_DEFSTRING "Slot drive ", sd11s -sd12: A2D_DEFSTRING "Slot drive ", sd12s -sd13: A2D_DEFSTRING "Slot drive ", sd13s +sd0: DEFINE_STRING "Slot drive ", sd0s +sd1: DEFINE_STRING "Slot drive ", sd1s +sd2: DEFINE_STRING "Slot drive ", sd2s +sd3: DEFINE_STRING "Slot drive ", sd3s +sd4: DEFINE_STRING "Slot drive ", sd4s +sd5: DEFINE_STRING "Slot drive ", sd5s +sd6: DEFINE_STRING "Slot drive ", sd6s +sd7: DEFINE_STRING "Slot drive ", sd7s +sd8: DEFINE_STRING "Slot drive ", sd8s +sd9: DEFINE_STRING "Slot drive ", sd9s +sd10: DEFINE_STRING "Slot drive ", sd10s +sd11: DEFINE_STRING "Slot drive ", sd11s +sd12: DEFINE_STRING "Slot drive ", sd12s +sd13: DEFINE_STRING "Slot drive ", sd13s s00: PASCAL_STRING "Slot 0 " s01: PASCAL_STRING "Slot 0 " @@ -5634,10 +5634,10 @@ data: .res 55, 0 .macro WIN_PARAMS_DEFN window_id, label, buflabel .proc label id: .byte window_id -flags: .byte A2D_CWF_ADDCLOSE | A2D_CWF_ADDRESIZE +flags: .byte MGTK::option_go_away_box | MGTK::option_grow_box title: .addr buflabel -hscroll:.byte A2D_CWS_SCROLL_NORMAL -vscroll:.byte A2D_CWS_SCROLL_NORMAL +hscroll:.byte MGTK::scroll_option_normal +vscroll:.byte MGTK::scroll_option_normal hsmax: .byte 3 hspos: .byte 0 vsmax: .byte 3 @@ -5649,21 +5649,21 @@ w2: .word 545 h2: .word 175 left: .word 20 top: .word 27 -addr: .addr A2D_SCREEN_ADDR -stride: .word A2D_SCREEN_STRIDE +addr: .addr MGTK::screen_mapbits +stride: .word MGTK::screen_mapwidth hoff: .word 0 voff: .word 0 width: .word 440 height: .word 120 pattern:.res 8, $FF -mskand: .byte A2D_DEFAULT_MSKAND -mskor: .byte A2D_DEFAULT_MSKOR +mskand: .byte MGTK::colormask_and +mskor: .byte MGTK::colormask_or xpos: .word 0 ypos: .word 0 hthick: .byte 1 vthick: .byte 1 mode: .byte 0 -tmask: .byte A2D_DEFAULT_TMASK +tmask: .byte MGTK::textbg_white font: .addr DEFAULT_FONT next: .addr 0 .endproc @@ -6116,7 +6116,7 @@ L0D14 := $0D14 ;; "Exported" by desktop.inc L4000: jmp L4042 ; ??? -JT_A2D_RELAY: jmp A2D_RELAY +JT_MGTK_RELAY: jmp MGTK_RELAY L4006: jmp L8259 ; ??? L4009: jmp L830F ; ??? L400C: jmp L5E78 ; ??? @@ -6184,9 +6184,9 @@ L4088: jsr reset_state2 L40A6: jsr L464E jsr get_input lda input_params_state - cmp #A2D_INPUT_DOWN + cmp #MGTK::button_down beq L40B7 - cmp #A2D_INPUT_DOWN_MOD + cmp #MGTK::apple_key bne L40BD L40B7: jsr handle_click jmp L4088 @@ -6231,10 +6231,10 @@ L4100: jsr L48F0 L410D: jsr L4113 jmp L4100 -L4113: A2D_RELAY_CALL A2D_REDRAW_WINDOW, input_params+1 +L4113: MGTK_RELAY_CALL MGTK::BeginUpdate, input_params+1 bne L4151 jsr L4153 - A2D_RELAY_CALL $3F ; ??? + MGTK_RELAY_CALL $3F ; ??? rts L412B: lda #$00 @@ -6534,7 +6534,7 @@ menu_accelerators: beq L43A1 lda #$01 L43A1: sta $E25D - A2D_RELAY_CALL $32, menu_click_params + MGTK_RELAY_CALL $32, menu_click_params menu_dispatch2: ldx menu_click_params::menu_id @@ -6558,7 +6558,7 @@ L43B3: dex ; x has top level menu id lda dispatch_table+1,x sta L43E5+1 jsr L43E0 - A2D_RELAY_CALL $33, menu_click_params + MGTK_RELAY_CALL $33, menu_click_params rts L43E0: tsx @@ -6577,7 +6577,7 @@ L43E0: tsx .proc handle_click tsx stx $E256 - A2D_RELAY_CALL A2D_QUERY_TARGET, input_params_coords + MGTK_RELAY_CALL MGTK::FindWindow, input_params_coords lda query_target_params_element bne not_desktop @@ -6594,9 +6594,9 @@ L43E0: tsx L4415: jmp L68AA not_desktop: - cmp #A2D_ELEM_MENU ; menu? + cmp #MGTK::area_menubar ; menu? bne not_menu - A2D_RELAY_CALL A2D_MENU_CLICK, menu_click_params + MGTK_RELAY_CALL MGTK::MenuSelect, menu_click_params jmp menu_dispatch2 not_menu: @@ -6612,18 +6612,18 @@ not_menu: .proc handle_active_window_click pla - cmp #A2D_ELEM_CLIENT + cmp #MGTK::area_content bne :+ jsr detect_double_click sta double_click_flag jmp handle_client_click -: cmp #A2D_ELEM_TITLE +: cmp #MGTK::area_dragbar bne :+ jmp handle_title_click -: cmp #A2D_ELEM_RESIZE +: cmp #MGTK::area_grow_box bne :+ jmp handle_resize_click -: cmp #A2D_ELEM_CLOSE +: cmp #MGTK::area_close_box bne :+ jmp handle_close_click : rts @@ -6662,7 +6662,7 @@ L445D: jsr clear_selection sta is_file_selected lda LE22F sta selected_file_index -L44A6: A2D_RELAY_CALL A2D_RAISE_WINDOW, query_target_params_id +L44A6: MGTK_RELAY_CALL MGTK::SelectWindow, query_target_params_id lda $D20E sta desktop_active_winid sta bufnum @@ -6673,7 +6673,7 @@ L44B8: jsr DESKTOP_COPY_TO_BUF jsr DESKTOP_COPY_TO_BUF lda #$00 sta $E269 - A2D_RELAY_CALL $36, LE267 ; ??? + MGTK_RELAY_CALL $36, LE267 ; ??? ldx desktop_active_winid dex lda LE6D1,x @@ -6682,24 +6682,24 @@ L44B8: jsr DESKTOP_COPY_TO_BUF inc $E268 lda #$01 sta $E269 - A2D_RELAY_CALL $36, LE267 ; ??? + MGTK_RELAY_CALL $36, LE267 ; ??? rts .endproc ;;; ================================================== -L44F2: A2D_RELAY_CALL A2D_QUERY_STATE, query_state_params2 - A2D_RELAY_CALL A2D_SET_STATE, query_state_buffer +L44F2: MGTK_RELAY_CALL MGTK::GetWinPort, query_state_params2 + MGTK_RELAY_CALL MGTK::SetPort, query_state_buffer rts -L4505: A2D_RELAY_CALL A2D_QUERY_STATE, query_state_params2 +L4505: MGTK_RELAY_CALL MGTK::GetWinPort, query_state_params2 rts rts reset_state2: - A2D_RELAY_CALL A2D_QUERY_SCREEN, state2 - A2D_RELAY_CALL A2D_SET_STATE, state2 + MGTK_RELAY_CALL MGTK::InitPort, state2 + MGTK_RELAY_CALL MGTK::SetPort, state2 rts ;;; ================================================== @@ -7000,8 +7000,8 @@ L4748: cmp #FT_SYSTEM jsr L4802 L4755: DESKTOP_RELAY_CALL $06 - A2D_RELAY_CALL $3A ; ??? - A2D_RELAY_CALL A2D_SET_MENU, blank_menu + MGTK_RELAY_CALL $3A ; ??? + MGTK_RELAY_CALL MGTK::SetMenu, blank_menu ldx $D355 L4773: lda $D355,x sta $220,x @@ -7116,22 +7116,22 @@ L4862: .byte $00,$00,$00,$00,$00,$00 set_watch_cursor: jsr hide_cursor - A2D_RELAY_CALL A2D_SET_CURSOR, watch_cursor + MGTK_RELAY_CALL MGTK::SetCursor, watch_cursor jsr show_cursor rts set_pointer_cursor: jsr hide_cursor - A2D_RELAY_CALL A2D_SET_CURSOR, pointer_cursor + MGTK_RELAY_CALL MGTK::SetCursor, pointer_cursor jsr show_cursor rts hide_cursor: - A2D_RELAY_CALL A2D_HIDE_CURSOR + MGTK_RELAY_CALL MGTK::HideCursor rts show_cursor: - A2D_RELAY_CALL A2D_SHOW_CURSOR + MGTK_RELAY_CALL MGTK::ShowCursor rts ;;; ================================================== @@ -7159,16 +7159,16 @@ L48C2: lda $E196,x jmp dummy1234 ; self-modified get_input: - A2D_RELAY_CALL A2D_GET_INPUT, input_params + MGTK_RELAY_CALL MGTK::GetEvent, input_params rts -L48F0: A2D_RELAY_CALL $2C, input_params ; ??? +L48F0: MGTK_RELAY_CALL $2C, input_params ; ??? rts -L48FA: A2D_RELAY_CALL A2D_SET_FILL_MODE, const2 +L48FA: MGTK_RELAY_CALL MGTK::SetPenMode, const2 rts -L4904: A2D_RELAY_CALL A2D_SET_FILL_MODE, const0 +L4904: MGTK_RELAY_CALL MGTK::SetPenMode, const0 rts ;;; ================================================== @@ -7584,10 +7584,10 @@ nope: dex ;; Invoke it jsr set_pointer_cursor jsr reset_state2 - A2D_RELAY_CALL A2D_CONFIGURE_ZP_USE, zp_use_flag0 - A2D_RELAY_CALL A2D_CONFIGURE_ZP_USE, zp_use_flag1 + MGTK_RELAY_CALL MGTK::SetZP1, zp_use_flag0 + MGTK_RELAY_CALL MGTK::SetZP1, zp_use_flag1 jsr DA_LOAD_ADDRESS - A2D_RELAY_CALL A2D_CONFIGURE_ZP_USE, zp_use_flag0 + MGTK_RELAY_CALL MGTK::SetZP1, zp_use_flag0 lda #0 sta running_da_flag @@ -7930,7 +7930,7 @@ L4EC3: sta buf3len lda #$00 sta bufnum jsr DESKTOP_COPY_TO_BUF - A2D_RELAY_CALL A2D_DESTROY_WINDOW, desktop_active_winid + MGTK_RELAY_CALL MGTK::CloseWindow, desktop_active_winid ldx desktop_active_winid dex lda LEC26,x @@ -7959,13 +7959,13 @@ L4EC3: sta buf3len dex lda #$00 sta LEC26,x - A2D_RELAY_CALL A2D_QUERY_TOP, desktop_active_winid + MGTK_RELAY_CALL MGTK::FrontWindow, desktop_active_winid lda desktop_active_winid bne L4F3C DESKTOP_RELAY_CALL DESKTOP_REDRAW_ICONS L4F3C: lda #$00 sta $E269 - A2D_RELAY_CALL $36, LE267 ; ??? + MGTK_RELAY_CALL $36, LE267 ; ??? jsr L66A2 jmp reset_state2 .endproc @@ -8202,7 +8202,7 @@ L511E: sta buf3len jsr L4505 jsr L6E8E jsr L4904 - A2D_RELAY_CALL A2D_FILL_RECT, query_state_buffer::hoff + MGTK_RELAY_CALL MGTK::PaintRect, query_state_buffer::hoff lda desktop_active_winid jsr L7D5D sta L51EB @@ -8289,7 +8289,7 @@ L51F0: ldx desktop_active_winid jsr L4505 jsr L6E8E jsr L4904 - A2D_RELAY_CALL A2D_FILL_RECT, query_state_buffer::hoff + MGTK_RELAY_CALL MGTK::PaintRect, query_state_buffer::hoff lda desktop_active_winid jsr L7D5D sta L5263 @@ -8414,12 +8414,12 @@ L52D7: jsr L52DF L52DF: lda #$00 sta $E269 - A2D_RELAY_CALL $36, LE267 ; ??? + MGTK_RELAY_CALL $36, LE267 ; ??? lda $E25B sta $E268 lda #$01 sta $E269 - A2D_RELAY_CALL $36, LE267 ; ??? + MGTK_RELAY_CALL $36, LE267 ; ??? rts L5302: DESKTOP_RELAY_CALL $07, desktop_active_winid @@ -8759,9 +8759,9 @@ L5579: lda #$00 L5581: jsr L55F0 L5584: jsr get_input lda input_params_state - cmp #A2D_INPUT_KEY + cmp #MGTK::key_down beq L5595 - cmp #A2D_INPUT_DOWN + cmp #MGTK::button_down bne L5584 jmp L55D1 @@ -8952,9 +8952,9 @@ L572D: lda #$00 sta L578C L5732: jsr get_input lda input_params_state - cmp #A2D_INPUT_KEY + cmp #MGTK::key_down beq L5743 - cmp #A2D_INPUT_DOWN + cmp #MGTK::button_down bne L5732 jmp L578B @@ -9001,7 +9001,7 @@ L578D: .byte 0 ;;;Initiate keyboard-based resizing .proc cmd_resize - A2D_RELAY_CALL $22 ; ??? + MGTK_RELAY_CALL $22 ; ??? jmp handle_resize_click .endproc @@ -9009,7 +9009,7 @@ L578D: .byte 0 ;;; Initiate keyboard-based window moving .proc cmd_move - A2D_RELAY_CALL $22 ; ??? + MGTK_RELAY_CALL $22 ; ??? jmp handle_title_click .endproc @@ -9020,9 +9020,9 @@ L578D: .byte 0 jsr L5803 loop: jsr get_input lda input_params_state - cmp #A2D_INPUT_DOWN + cmp #MGTK::button_down beq done - cmp #A2D_INPUT_KEY + cmp #MGTK::key_down bne loop lda input_params_key cmp #KEY_RETURN @@ -9468,7 +9468,7 @@ L5B31: lda $EBFD,x sta input_params_coords,x dex bpl L5B31 - A2D_RELAY_CALL A2D_QUERY_CLIENT, input_params_coords + MGTK_RELAY_CALL MGTK::FindControl, input_params_coords lda $D20D bne L5B4B jmp L5CB7 @@ -9584,7 +9584,7 @@ L5C26: jsr DESKTOP_COPY_FROM_BUF L5C31: lda $D20D sta input_params - A2D_RELAY_CALL A2D_DRAG_SCROLL, input_params + MGTK_RELAY_CALL MGTK::TrackThumb, input_params lda $D20E bne L5C46 rts @@ -9597,7 +9597,7 @@ L5C46: jsr L5C54 L5C54: lda $D20D sta input_params+1 - A2D_RELAY_CALL A2D_UPDATE_SCROLL, input_params + MGTK_RELAY_CALL MGTK::UpdateThumb, input_params jsr L6523 jsr L84D1 bit L5B1B @@ -9606,19 +9606,19 @@ L5C54: lda $D20D L5C71: lda desktop_active_winid sta query_state_params2::id jsr L44F2 - A2D_RELAY_CALL A2D_FILL_RECT, query_state_buffer::hoff + MGTK_RELAY_CALL MGTK::PaintRect, query_state_buffer::hoff jsr reset_state2 jmp L6C19 L5C89: sta L5CB6 jsr L48F0 lda input_params_state - cmp #A2D_INPUT_HELD + cmp #MGTK::drag beq L5C99 L5C96: lda #$FF rts -L5C99: A2D_RELAY_CALL A2D_QUERY_CLIENT, input_params_coords +L5C99: MGTK_RELAY_CALL MGTK::FindControl, input_params_coords lda query_client_params_part beq L5C96 cmp #$03 @@ -9836,7 +9836,7 @@ L5E8F: lda desktop_active_winid sta query_state_params2::id jsr L44F2 jsr L4904 - A2D_RELAY_CALL A2D_FILL_RECT, query_state_buffer::hoff + MGTK_RELAY_CALL MGTK::PaintRect, query_state_buffer::hoff ldx desktop_active_winid dex lda LEC26,x @@ -9902,7 +9902,7 @@ L5F20: lda input_params_coords,x bpl L5F20 jsr L48F0 lda input_params_state - cmp #A2D_INPUT_HELD + cmp #MGTK::drag beq L5F3F bit BUTN0 bmi L5F3E @@ -9922,12 +9922,12 @@ L5F50: lda L5F0B,x dex bpl L5F50 jsr L48FA - A2D_RELAY_CALL A2D_DRAW_RECT, rect_E230 + MGTK_RELAY_CALL MGTK::FrameRect, rect_E230 L5F6B: jsr L48F0 lda input_params_state - cmp #A2D_INPUT_HELD + cmp #MGTK::drag beq L5FC5 - A2D_RELAY_CALL A2D_DRAW_RECT, rect_E230 + MGTK_RELAY_CALL MGTK::FrameRect, rect_E230 ldx #$00 L5F80: cpx buf3len bne L5F88 @@ -9989,7 +9989,7 @@ L600E: lda L60CB bcs L601F jmp L5F6B -L601F: A2D_RELAY_CALL A2D_DRAW_RECT, rect_E230 +L601F: MGTK_RELAY_CALL MGTK::FrameRect, rect_E230 ldx #$03 L602A: lda input_params_coords,x sta L60CF,x @@ -10047,7 +10047,7 @@ L60AE: lda input_params_ycoord sta $E237 lda #$00 sta L60D4 -L60BF: A2D_RELAY_CALL A2D_DRAW_RECT, rect_E230 +L60BF: MGTK_RELAY_CALL MGTK::FrameRect, rect_E230 jmp L5F6B L60CB: .byte 0 @@ -10068,10 +10068,10 @@ handle_title_click: L60DE: lda desktop_active_winid sta input_params - A2D_RELAY_CALL A2D_QUERY_TOP, desktop_active_winid + MGTK_RELAY_CALL MGTK::FrontWindow, desktop_active_winid lda desktop_active_winid jsr L8855 - A2D_RELAY_CALL A2D_DRAG_WINDOW, input_params + MGTK_RELAY_CALL MGTK::DragWindow, input_params lda desktop_active_winid jsr window_lookup sta $06 @@ -10157,7 +10157,7 @@ L619A: .byte 0 handle_resize_click: lda desktop_active_winid sta input_params - A2D_RELAY_CALL A2D_DRAG_RESIZE, input_params + MGTK_RELAY_CALL MGTK::GrowWindow, input_params jsr redraw_windows_and_desktop lda desktop_active_winid sta bufnum @@ -10172,7 +10172,7 @@ handle_resize_click: handle_close_click: lda desktop_active_winid - A2D_RELAY_CALL A2D_CLOSE_CLICK, close_click_params + MGTK_RELAY_CALL MGTK::TrackGoAway, close_click_params lda close_click_params::clicked bne L61DC rts @@ -10209,7 +10209,7 @@ L621B: sta buf3,x L6227: sta buf3len jsr DESKTOP_COPY_FROM_BUF - A2D_RELAY_CALL A2D_DESTROY_WINDOW, desktop_active_winid + MGTK_RELAY_CALL MGTK::CloseWindow, desktop_active_winid ldx desktop_active_winid dex lda LEC26,x @@ -10248,13 +10248,13 @@ L6276: ldx desktop_active_winid lda #$00 sta LEC26,x sta LE6D1,x - A2D_RELAY_CALL A2D_QUERY_TOP, desktop_active_winid + MGTK_RELAY_CALL MGTK::FrontWindow, desktop_active_winid lda #$00 sta bufnum jsr DESKTOP_COPY_TO_BUF lda #$00 sta $E269 - A2D_RELAY_CALL $36, LE267 ; ??? + MGTK_RELAY_CALL $36, LE267 ; ??? jsr L66A2 jmp redraw_windows_and_desktop @@ -10553,7 +10553,7 @@ L654C: lda query_state_buffer::hoff,x L6556: bit L5B1B bmi L655E jsr L6E6E -L655E: A2D_RELAY_CALL A2D_FILL_RECT, query_state_buffer::hoff +L655E: MGTK_RELAY_CALL MGTK::PaintRect, query_state_buffer::hoff jsr reset_state2 jmp L6C19 @@ -10610,7 +10610,7 @@ L65EB: jsr L62BC L65EE: sta input_params+1 lda #$02 sta input_params - A2D_RELAY_CALL A2D_UPDATE_SCROLL, input_params + MGTK_RELAY_CALL MGTK::UpdateThumb, input_params rts L6600: .byte 0 @@ -10673,7 +10673,7 @@ L668A: jsr L62BC L668D: sta input_params+1 lda #$01 sta input_params - A2D_RELAY_CALL A2D_UPDATE_SCROLL, input_params + MGTK_RELAY_CALL MGTK::UpdateThumb, input_params rts L669F: .byte 0 @@ -10685,20 +10685,20 @@ L66A2: ldx desktop_active_winid L66AA: lda #$01 sta $E26B - A2D_RELAY_CALL $34, LE26A ; ??? + MGTK_RELAY_CALL $34, LE26A ; ??? lda #$01 sta $E26E lda #$02 sta LE26C lda #$01 sta $E26D - A2D_RELAY_CALL $35, LE26C ; ??? + MGTK_RELAY_CALL $35, LE26C ; ??? lda #$04 sta $E26D - A2D_RELAY_CALL $35, LE26C ; ??? + MGTK_RELAY_CALL $35, LE26C ; ??? lda #$05 sta $E26D - A2D_RELAY_CALL $35, LE26C ; ??? + MGTK_RELAY_CALL $35, LE26C ; ??? lda #$00 sta menu_dispatch_flag rts @@ -10711,7 +10711,7 @@ L66F2: dex stx $E268 lda #$01 sta $E269 - A2D_RELAY_CALL $36, LE267 ; ??? + MGTK_RELAY_CALL $36, LE267 ; ??? rts L670C: lda #$01 @@ -10735,7 +10735,7 @@ L670C: lda #$01 rts L673A: sta $E26D - A2D_RELAY_CALL $35, LE26C ; ??? + MGTK_RELAY_CALL $35, LE26C ; ??? rts L6747: lda #$00 @@ -10759,7 +10759,7 @@ L6747: lda #$00 rts L6775: sta $E26D - A2D_RELAY_CALL $35, LE26C ; ??? + MGTK_RELAY_CALL $35, LE26C ; ??? rts L6782: lda #$00 @@ -10772,7 +10772,7 @@ L678F: lda #$02 sta LE26C lda #$0B sta $E26D - A2D_RELAY_CALL $35, LE26C ; ??? + MGTK_RELAY_CALL $35, LE26C ; ??? rts L67A3: lda #$01 @@ -10794,7 +10794,7 @@ L67B0: lda #$03 rts L67CA: sta $E26D - A2D_RELAY_CALL $35, LE26C ; ??? + MGTK_RELAY_CALL $35, LE26C ; ??? rts L67D7: lda is_file_selected @@ -10900,18 +10900,18 @@ L68B8: lda input_params_coords,x bpl L68B8 jsr L48F0 lda input_params_state - cmp #A2D_INPUT_HELD + cmp #MGTK::drag beq L68CF rts -L68CF: A2D_RELAY_CALL A2D_SET_PATTERN, checkerboard_pattern3 +L68CF: MGTK_RELAY_CALL MGTK::SetPattern, checkerboard_pattern3 jsr L48FA - A2D_RELAY_CALL A2D_DRAW_RECT, rect_E230 + MGTK_RELAY_CALL MGTK::FrameRect, rect_E230 L68E4: jsr L48F0 lda input_params_state - cmp #A2D_INPUT_HELD + cmp #MGTK::drag beq L6932 - A2D_RELAY_CALL A2D_DRAW_RECT, rect_E230 + MGTK_RELAY_CALL MGTK::FrameRect, rect_E230 ldx #$00 L68F9: cpx buf3len bne L6904 @@ -10969,7 +10969,7 @@ L6978: lda L6A35 bcs L6989 jmp L68E4 -L6989: A2D_RELAY_CALL A2D_DRAW_RECT, rect_E230 +L6989: MGTK_RELAY_CALL MGTK::FrameRect, rect_E230 ldx #$03 L6994: lda input_params_coords,x sta L6A39,x @@ -11027,7 +11027,7 @@ L6A18: lda input_params_ycoord sta $E237 lda #$00 sta L6A3E -L6A29: A2D_RELAY_CALL A2D_DRAW_RECT, rect_E230 +L6A29: MGTK_RELAY_CALL MGTK::FrameRect, rect_E230 jmp L68E4 L6A35: .byte 0 @@ -11129,7 +11129,7 @@ L6AF6: cmp $E1F2,x dex bpl L6AF6 jsr L7054 -L6B01: A2D_RELAY_CALL A2D_RAISE_WINDOW, bufnum +L6B01: MGTK_RELAY_CALL MGTK::SelectWindow, bufnum lda bufnum sta desktop_active_winid jsr L6C19 @@ -11205,7 +11205,7 @@ L6BB8: jsr L744B lda bufnum jsr window_lookup ldy #$38 - jsr A2D_RELAY + jsr MGTK_RELAY lda desktop_active_winid sta query_state_params2::id jsr L44F2 @@ -11235,7 +11235,7 @@ L6BF4: lda bufnum jmp reset_state2 L6C0E: .byte 0 -L6C0F: A2D_RELAY_CALL $36, LE267 ; ??? +L6C0F: MGTK_RELAY_CALL $36, LE267 ; ??? rts L6C19: ldx bufnum @@ -11466,7 +11466,7 @@ L6E38: lda #$01 jsr L6E48 jmp L6604 -L6E48: A2D_RELAY_CALL $4C, input_params ; ??? +L6E48: MGTK_RELAY_CALL $4C, input_params ; ??? rts L6E52: lda #$00 @@ -11517,26 +11517,26 @@ L6E90: sta L6EC4 sta query_state_buffer::voff+1 bit L6EC4 bmi L6EC3 - A2D_RELAY_CALL A2D_SET_STATE, query_state_buffer + MGTK_RELAY_CALL MGTK::SetPort, query_state_buffer L6EC3: rts L6EC4: .byte 0 L6EC5: lda #$00 sta $E26B - A2D_RELAY_CALL $34, LE26A ; ??? + MGTK_RELAY_CALL $34, LE26A ; ??? lda #$00 sta $E26E lda #$02 sta LE26C lda #$01 sta $E26D - A2D_RELAY_CALL $35, LE26C ; ??? + MGTK_RELAY_CALL $35, LE26C ; ??? lda #$04 sta $E26D - A2D_RELAY_CALL $35, LE26C ; ??? + MGTK_RELAY_CALL $35, LE26C ; ??? lda #$05 sta $E26D - A2D_RELAY_CALL $35, LE26C ; ??? + MGTK_RELAY_CALL $35, LE26C ; ??? lda #$80 sta menu_dispatch_flag rts @@ -12740,13 +12740,13 @@ L78EF: lda query_state_buffer::hoff adc #$00 sta $EBC1 sta $EBC5 - A2D_RELAY_CALL A2D_SET_POS, LEBBE + MGTK_RELAY_CALL MGTK::MoveTo, LEBBE lda query_state_buffer::width sta LEBC2 lda query_state_buffer::width+1 sta $EBC3 jsr L48FA - A2D_RELAY_CALL A2D_DRAW_LINE_ABS, LEBC2 + MGTK_RELAY_CALL MGTK::LineTo, LEBC2 lda $EBC0 clc adc #$02 @@ -12756,8 +12756,8 @@ L78EF: lda query_state_buffer::hoff adc #$00 sta $EBC1 sta $EBC5 - A2D_RELAY_CALL A2D_SET_POS, LEBBE - A2D_RELAY_CALL A2D_DRAW_LINE_ABS, LEBC2 + MGTK_RELAY_CALL MGTK::MoveTo, LEBBE + MGTK_RELAY_CALL MGTK::LineTo, LEBC2 lda query_state_buffer::voff clc adc #$0A @@ -12772,7 +12772,7 @@ L78EF: lda query_state_buffer::hoff cmp #$02 bcs L798A dec str_items ; remove trailing s -L798A: A2D_RELAY_CALL A2D_SET_POS, items_label_pos +L798A: MGTK_RELAY_CALL MGTK::MoveTo, items_label_pos jsr L7AD7 addr_call draw_text2, str_items lda buf3len @@ -12791,7 +12791,7 @@ L79A7: jsr L79F7 tax tya jsr L7AE0 - A2D_RELAY_CALL A2D_SET_POS, LEBEB + MGTK_RELAY_CALL MGTK::MoveTo, LEBEB jsr L7AD7 addr_call draw_text2, str_k_in_disk ldx desktop_active_winid @@ -12805,7 +12805,7 @@ L79A7: jsr L79F7 tax tya jsr L7AE0 - A2D_RELAY_CALL A2D_SET_POS, LEBEF + MGTK_RELAY_CALL MGTK::MoveTo, LEBEF jsr L7AD7 addr_call draw_text2, str_k_available rts @@ -14040,7 +14040,7 @@ L84DC: lda query_state_buffer::width sbc query_state_buffer::voff+1 sta L85FB lda input_params_state - cmp #A2D_INPUT_DOWN + cmp #MGTK::button_down bne L850C asl a bne L850E @@ -14193,15 +14193,15 @@ loop: dec counter lda input_params_state sta state ; unused ??? - cmp #A2D_INPUT_NONE + cmp #MGTK::no_event beq loop - cmp #A2D_INPUT_HELD + cmp #MGTK::drag beq loop - cmp #A2D_INPUT_UP + cmp #MGTK::button_up bne :+ jsr get_input jmp loop -: cmp #A2D_INPUT_DOWN +: cmp #MGTK::button_down bne exit jsr get_input @@ -14433,7 +14433,7 @@ L877F: .byte 0 inc ptr bne :+ inc ptr+1 -: A2D_RELAY_CALL A2D_DRAW_TEXT, $6 +: MGTK_RELAY_CALL MGTK::DrawText, $6 exit: rts .endproc @@ -14453,7 +14453,7 @@ exit: rts inc ptr bne :+ inc ptr+1 -: A2D_RELAY_CALL A2D_MEASURE_TEXT, $6 +: MGTK_RELAY_CALL MGTK::TextWidth, $6 lda result ldx result+1 rts @@ -14750,7 +14750,7 @@ L899A: sta state1::hoff,x inx cpx #$04 bne L899A - A2D_RELAY_CALL A2D_SET_STATE, state1 + MGTK_RELAY_CALL MGTK::SetPort, state1 rts ;;; ================================================== @@ -15203,7 +15203,7 @@ L8D57: .byte 0 L8D58: lda #$00 sta L8DB2 jsr reset_state2 - A2D_RELAY_CALL A2D_SET_PATTERN, checkerboard_pattern3 + MGTK_RELAY_CALL MGTK::SetPattern, checkerboard_pattern3 jsr L48FA L8D6C: lda L8DB2 cmp #$0C @@ -15251,7 +15251,7 @@ L8DB2: .byte 0 L8DB3: lda #$0B sta L8E0F jsr reset_state2 - A2D_RELAY_CALL A2D_SET_PATTERN, checkerboard_pattern3 + MGTK_RELAY_CALL MGTK::SetPattern, checkerboard_pattern3 jsr L48FA L8DC7: lda L8E0F bmi L8DE4 @@ -15298,7 +15298,7 @@ L8E0F: .byte 0 ;;; ================================================== .proc draw_rect_E230 - A2D_RELAY_CALL A2D_DRAW_RECT, rect_E230 + MGTK_RELAY_CALL MGTK::FrameRect, rect_E230 rts .endproc @@ -15771,8 +15771,8 @@ L91CE: .byte 0 L91D1: stx $E00A rts -L91D5: yax_call JT_A2D_RELAY, A2D_QUERY_SCREEN, state2 - yax_call JT_A2D_RELAY, A2D_SET_STATE, state2 +L91D5: yax_call JT_MGTK_RELAY, MGTK::InitPort, state2 + yax_call JT_MGTK_RELAY, MGTK::SetPort, state2 rts L91E8: jsr JT_REDRAW_ALL @@ -17840,16 +17840,16 @@ LA3A7: yax_call JT_MLI_RELAY, CLOSE, close_params4 lda selected_window_index beq LA3CA sta query_state_params2::id - yax_call JT_A2D_RELAY, A2D_QUERY_STATE, query_state_params2 - yax_call JT_A2D_RELAY, A2D_SET_STATE, query_state_buffer + yax_call JT_MGTK_RELAY, MGTK::GetWinPort, query_state_params2 + yax_call JT_MGTK_RELAY, MGTK::SetPort, query_state_buffer LA3CA: ldx L9188 txs lda #$FF rts -LA3D1: yax_call JT_A2D_RELAY, A2D_GET_INPUT, input_params +LA3D1: yax_call JT_MGTK_RELAY, MGTK::GetEvent, input_params lda input_params_state - cmp #A2D_INPUT_KEY + cmp #MGTK::key_down bne LA3EC lda input_params_key cmp #KEY_ESCAPE @@ -18030,19 +18030,19 @@ prompt_input_loop: lda LD8E8 jsr LB8F5 lda #$14 sta LD8E9 -LA579: A2D_RELAY_CALL A2D_GET_INPUT, input_params +LA579: MGTK_RELAY_CALL MGTK::GetEvent, input_params lda input_params_state - cmp #A2D_INPUT_DOWN + cmp #MGTK::button_down bne LA58C jmp LA5EE -LA58C: cmp #A2D_INPUT_KEY +LA58C: cmp #MGTK::key_down bne LA593 jmp LA6FD LA593: lda LD8E8 beq prompt_input_loop - A2D_RELAY_CALL A2D_QUERY_TARGET, input_params_coords + MGTK_RELAY_CALL MGTK::FindWindow, input_params_coords lda query_target_params_element bne LA5A9 jmp prompt_input_loop @@ -18056,9 +18056,9 @@ LA5B4: lda winF jsr LB7B9 lda winF sta input_params - A2D_RELAY_CALL A2D_MAP_COORDS, input_params - A2D_RELAY_CALL A2D_SET_POS, $D20D -LA5D2: A2D_RELAY_CALL A2D_TEST_BOX, LD6AB + MGTK_RELAY_CALL MGTK::ScreenToWindow, input_params + MGTK_RELAY_CALL MGTK::MoveTo, $D20D +LA5D2: MGTK_RELAY_CALL MGTK::InRect, LD6AB cmp #$80 bne LA5E5 jsr set_cursor_insertion_point_with_flag @@ -18068,7 +18068,7 @@ LA5E5: jsr set_cursor_pointer_with_flag LA5E8: jsr reset_state jmp prompt_input_loop -LA5EE: A2D_RELAY_CALL A2D_QUERY_TARGET, input_params_coords +LA5EE: MGTK_RELAY_CALL MGTK::FindWindow, input_params_coords lda query_target_params_element bne LA5FF lda #$FF @@ -18091,49 +18091,49 @@ LA614: lda winF jsr LB7B9 lda winF sta input_params - A2D_RELAY_CALL A2D_MAP_COORDS, input_params - A2D_RELAY_CALL A2D_SET_POS, $D20D + MGTK_RELAY_CALL MGTK::ScreenToWindow, input_params + MGTK_RELAY_CALL MGTK::MoveTo, $D20D bit LD8E7 bvc LA63A jmp LA65E -LA63A: A2D_RELAY_CALL A2D_TEST_BOX, desktop_aux::ok_button_rect +LA63A: MGTK_RELAY_CALL MGTK::InRect, desktop_aux::ok_button_rect cmp #$80 beq LA64A jmp LA6C1 LA64A: jsr set_fill_black - A2D_RELAY_CALL A2D_FILL_RECT, desktop_aux::ok_button_rect + MGTK_RELAY_CALL MGTK::PaintRect, desktop_aux::ok_button_rect jsr LB7CF bmi LA65D lda #$00 LA65D: rts -LA65E: A2D_RELAY_CALL A2D_TEST_BOX, desktop_aux::yes_button_rect +LA65E: MGTK_RELAY_CALL MGTK::InRect, desktop_aux::yes_button_rect cmp #$80 bne LA67F jsr set_fill_black - A2D_RELAY_CALL A2D_FILL_RECT, desktop_aux::yes_button_rect + MGTK_RELAY_CALL MGTK::PaintRect, desktop_aux::yes_button_rect jsr LB7D9 bmi LA67E lda #$02 LA67E: rts -LA67F: A2D_RELAY_CALL A2D_TEST_BOX, desktop_aux::no_button_rect +LA67F: MGTK_RELAY_CALL MGTK::InRect, desktop_aux::no_button_rect cmp #$80 bne LA6A0 jsr set_fill_black - A2D_RELAY_CALL A2D_FILL_RECT, desktop_aux::no_button_rect + MGTK_RELAY_CALL MGTK::PaintRect, desktop_aux::no_button_rect jsr LB7DE bmi LA69F lda #$03 LA69F: rts -LA6A0: A2D_RELAY_CALL A2D_TEST_BOX, desktop_aux::all_button_rect +LA6A0: MGTK_RELAY_CALL MGTK::InRect, desktop_aux::all_button_rect cmp #$80 bne LA6C1 jsr set_fill_black - A2D_RELAY_CALL A2D_FILL_RECT, desktop_aux::all_button_rect + MGTK_RELAY_CALL MGTK::PaintRect, desktop_aux::all_button_rect jsr LB7E3 bmi LA6C0 lda #$04 @@ -18144,13 +18144,13 @@ LA6C1: bit LD8E7 lda #$FF rts -LA6C9: A2D_RELAY_CALL A2D_TEST_BOX, desktop_aux::cancel_button_rect +LA6C9: MGTK_RELAY_CALL MGTK::InRect, desktop_aux::cancel_button_rect cmp #$80 beq LA6D9 jmp LA6ED LA6D9: jsr set_fill_black - A2D_RELAY_CALL A2D_FILL_RECT, desktop_aux::cancel_button_rect + MGTK_RELAY_CALL MGTK::PaintRect, desktop_aux::cancel_button_rect jsr LB7D4 bmi LA6EC lda #$01 @@ -18289,17 +18289,17 @@ LA7E5: lda #$FF rts LA7E8: jsr set_fill_black - A2D_RELAY_CALL A2D_FILL_RECT, desktop_aux::yes_button_rect + MGTK_RELAY_CALL MGTK::PaintRect, desktop_aux::yes_button_rect lda #$02 rts LA7F7: jsr set_fill_black - A2D_RELAY_CALL A2D_FILL_RECT, desktop_aux::no_button_rect + MGTK_RELAY_CALL MGTK::PaintRect, desktop_aux::no_button_rect lda #$03 rts LA806: jsr set_fill_black - A2D_RELAY_CALL A2D_FILL_RECT, desktop_aux::all_button_rect + MGTK_RELAY_CALL MGTK::PaintRect, desktop_aux::all_button_rect lda #$04 rts @@ -18338,16 +18338,16 @@ LA84E: lda #$FF LA851: lda winF jsr LB7B9 jsr set_fill_black - A2D_RELAY_CALL A2D_FILL_RECT, desktop_aux::ok_button_rect - A2D_RELAY_CALL A2D_FILL_RECT, desktop_aux::ok_button_rect + MGTK_RELAY_CALL MGTK::PaintRect, desktop_aux::ok_button_rect + MGTK_RELAY_CALL MGTK::PaintRect, desktop_aux::ok_button_rect lda #$00 rts LA86F: lda winF jsr LB7B9 jsr set_fill_black - A2D_RELAY_CALL A2D_FILL_RECT, desktop_aux::cancel_button_rect - A2D_RELAY_CALL A2D_FILL_RECT, desktop_aux::cancel_button_rect + MGTK_RELAY_CALL MGTK::PaintRect, desktop_aux::cancel_button_rect + MGTK_RELAY_CALL MGTK::PaintRect, desktop_aux::cancel_button_rect lda #$01 rts @@ -18368,12 +18368,12 @@ LA899: jmp dummy0000 ;;; "About" dialog .proc show_about_dialog - A2D_RELAY_CALL A2D_CREATE_WINDOW, win18::id + MGTK_RELAY_CALL MGTK::OpenWindow, win18::id lda win18::id jsr LB7B9 jsr set_fill_black - A2D_RELAY_CALL A2D_DRAW_RECT, desktop_aux::about_dialog_outer_rect - A2D_RELAY_CALL A2D_DRAW_RECT, desktop_aux::about_dialog_inner_rect + MGTK_RELAY_CALL MGTK::FrameRect, desktop_aux::about_dialog_outer_rect + MGTK_RELAY_CALL MGTK::FrameRect, desktop_aux::about_dialog_inner_rect addr_call draw_centered_string, desktop_aux::str_about1 axy_call draw_dialog_label, $81, desktop_aux::str_about2 axy_call draw_dialog_label, $82, desktop_aux::str_about3 @@ -18392,11 +18392,11 @@ LA899: jmp dummy0000 lda #$00 sta dialog_label_pos+1 -: A2D_RELAY_CALL A2D_GET_INPUT, input_params +: MGTK_RELAY_CALL MGTK::GetEvent, input_params lda input_params_state - cmp #A2D_INPUT_DOWN + cmp #MGTK::button_down beq close - cmp #A2D_INPUT_KEY + cmp #MGTK::key_down bne :- lda input_params_key and #$7F @@ -18406,7 +18406,7 @@ LA899: jmp dummy0000 bne :- jmp close -close: A2D_RELAY_CALL A2D_DESTROY_WINDOW, win18::id +close: MGTK_RELAY_CALL MGTK::CloseWindow, win18::id jsr reset_state jsr set_cursor_pointer_with_flag rts @@ -18459,7 +18459,7 @@ LA9B5: ldy #$01 jsr LBDDF lda winF jsr LB7B9 - A2D_RELAY_CALL A2D_SET_POS, desktop_aux::LB0B6 + MGTK_RELAY_CALL MGTK::MoveTo, desktop_aux::LB0B6 addr_call draw_text1, str_7_spaces addr_call draw_text1, str_files rts @@ -18485,7 +18485,7 @@ LA9E6: ldy #$01 sta $06+1 stx $06 jsr LBE63 - A2D_RELAY_CALL A2D_SET_POS, desktop_aux::LAE7E + MGTK_RELAY_CALL MGTK::MoveTo, desktop_aux::LAE7E addr_call draw_text1, path_buf0 jsr copy_dialog_param_addr_to_ptr ldy #$05 @@ -18496,14 +18496,14 @@ LA9E6: ldy #$01 sta $06+1 stx $06 jsr LBE78 - A2D_RELAY_CALL A2D_SET_POS, desktop_aux::LAE82 + MGTK_RELAY_CALL MGTK::MoveTo, desktop_aux::LAE82 addr_call draw_text1, path_buf1 - yax_call A2D_RELAY, A2D_SET_POS, desktop_aux::LB0BA + yax_call MGTK_RELAY, MGTK::MoveTo, desktop_aux::LB0BA addr_call draw_text1, str_7_spaces rts LAA5A: jsr reset_state - A2D_RELAY_CALL A2D_DESTROY_WINDOW, winF + MGTK_RELAY_CALL MGTK::CloseWindow, winF jsr set_cursor_pointer rts @@ -18516,8 +18516,8 @@ LAA7F: jsr prompt_input_loop bmi LAA7F pha jsr erase_yes_no_all_cancel_buttons - A2D_RELAY_CALL A2D_SET_FILL_MODE, const0 - A2D_RELAY_CALL A2D_FILL_RECT, desktop_aux::prompt_rect + MGTK_RELAY_CALL MGTK::SetPenMode, const0 + MGTK_RELAY_CALL MGTK::PaintRect, desktop_aux::prompt_rect pla rts @@ -18530,8 +18530,8 @@ LAAB1: jsr prompt_input_loop bmi LAAB1 pha jsr erase_ok_cancel_buttons - A2D_RELAY_CALL A2D_SET_FILL_MODE, const0 - A2D_RELAY_CALL A2D_FILL_RECT, desktop_aux::prompt_rect + MGTK_RELAY_CALL MGTK::SetPenMode, const0 + MGTK_RELAY_CALL MGTK::PaintRect, desktop_aux::prompt_rect pla rts @@ -18587,7 +18587,7 @@ do1: ldy #1 jsr LBDDF lda winF jsr LB7B9 - A2D_RELAY_CALL A2D_SET_POS, desktop_aux::LB0B6 + MGTK_RELAY_CALL MGTK::MoveTo, desktop_aux::LB0B6 addr_call draw_text1, str_7_spaces addr_call draw_text1, str_files rts @@ -18612,14 +18612,14 @@ do2: ldy #$01 sta ptr+1 stx ptr jsr LBE63 - A2D_RELAY_CALL A2D_SET_POS, desktop_aux::LAE7E + MGTK_RELAY_CALL MGTK::MoveTo, desktop_aux::LAE7E addr_call draw_text1, path_buf0 - A2D_RELAY_CALL A2D_SET_POS, desktop_aux::LB0BA + MGTK_RELAY_CALL MGTK::MoveTo, desktop_aux::LB0BA addr_call draw_text1, str_7_spaces rts do3: jsr reset_state - A2D_RELAY_CALL A2D_DESTROY_WINDOW, winF + MGTK_RELAY_CALL MGTK::CloseWindow, winF jsr set_cursor_pointer rts @@ -18632,8 +18632,8 @@ do4: jsr bell bmi :- pha jsr erase_ok_button - A2D_RELAY_CALL A2D_SET_FILL_MODE, const0 - A2D_RELAY_CALL A2D_FILL_RECT, desktop_aux::prompt_rect + MGTK_RELAY_CALL MGTK::SetPenMode, const0 + MGTK_RELAY_CALL MGTK::PaintRect, desktop_aux::prompt_rect pla rts .endproc @@ -18708,7 +18708,7 @@ do1: ldy #$01 rts do3: jsr reset_state - A2D_RELAY_CALL A2D_DESTROY_WINDOW, winF + MGTK_RELAY_CALL MGTK::CloseWindow, winF jsr set_cursor_pointer rts @@ -18717,8 +18717,8 @@ do2: lda winF jsr draw_ok_button : jsr prompt_input_loop bmi :- - A2D_RELAY_CALL A2D_SET_FILL_MODE, const0 - A2D_RELAY_CALL A2D_FILL_RECT, desktop_aux::press_ok_to_rect + MGTK_RELAY_CALL MGTK::SetPenMode, const0 + MGTK_RELAY_CALL MGTK::PaintRect, desktop_aux::press_ok_to_rect jsr erase_ok_button lda #$00 rts @@ -18777,10 +18777,10 @@ LAD2A: ldy #$01 jsr LB7B9 lda LAD1F LAD46: bne LAD54 - A2D_RELAY_CALL A2D_SET_POS, desktop_aux::LB16A + MGTK_RELAY_CALL MGTK::MoveTo, desktop_aux::LB16A jmp LAD5D -LAD54: A2D_RELAY_CALL A2D_SET_POS, desktop_aux::LB172 +LAD54: MGTK_RELAY_CALL MGTK::MoveTo, desktop_aux::LB172 LAD5D: addr_call draw_text1, str_7_spaces addr_call draw_text1, str_files rts @@ -18805,9 +18805,9 @@ LAD6C: ldy #$01 sta $06+1 stx $06 jsr LBE63 - A2D_RELAY_CALL A2D_SET_POS, desktop_aux::LAE7E + MGTK_RELAY_CALL MGTK::MoveTo, desktop_aux::LAE7E addr_call draw_text1, path_buf0 - A2D_RELAY_CALL A2D_SET_POS, desktop_aux::LB16E + MGTK_RELAY_CALL MGTK::MoveTo, desktop_aux::LB16E addr_call draw_text1, str_7_spaces rts @@ -18817,8 +18817,8 @@ LADBB: lda winF LADC4: jsr prompt_input_loop bmi LADC4 bne LADF4 - A2D_RELAY_CALL A2D_SET_FILL_MODE, const0 - A2D_RELAY_CALL A2D_FILL_RECT, desktop_aux::press_ok_to_rect + MGTK_RELAY_CALL MGTK::SetPenMode, const0 + MGTK_RELAY_CALL MGTK::PaintRect, desktop_aux::press_ok_to_rect jsr erase_ok_cancel_buttons yax_call draw_dialog_label, $02, desktop_aux::str_file_colon yax_call draw_dialog_label, $04, desktop_aux::str_delete_remaining @@ -18826,7 +18826,7 @@ LADC4: jsr prompt_input_loop LADF4: rts LADF5: jsr reset_state - A2D_RELAY_CALL A2D_DESTROY_WINDOW, winF + MGTK_RELAY_CALL MGTK::CloseWindow, winF jsr set_cursor_pointer rts @@ -18838,8 +18838,8 @@ LAE17: jsr prompt_input_loop bmi LAE17 pha jsr erase_yes_no_all_cancel_buttons - A2D_RELAY_CALL A2D_SET_FILL_MODE, const0 ; white - A2D_RELAY_CALL A2D_FILL_RECT, desktop_aux::prompt_rect ; erase prompt + MGTK_RELAY_CALL MGTK::SetPenMode, const0 ; white + MGTK_RELAY_CALL MGTK::PaintRect, desktop_aux::prompt_rect ; erase prompt pla rts @@ -18867,7 +18867,7 @@ LAE49: lda #$80 jsr LB7B9 addr_call draw_centered_string, desktop_aux::str_new_folder_title jsr set_fill_black - A2D_RELAY_CALL A2D_DRAW_RECT, LD6AB + MGTK_RELAY_CALL MGTK::FrameRect, LD6AB rts LAE70: lda #$80 @@ -18937,7 +18937,7 @@ LAEFF: inx rts LAF16: jsr reset_state - A2D_RELAY_CALL A2D_DESTROY_WINDOW, winF + MGTK_RELAY_CALL MGTK::CloseWindow, winF jsr set_cursor_pointer lda #$01 rts @@ -19025,7 +19025,7 @@ LB006: jsr prompt_input_loop bmi LB006 pha jsr reset_state - A2D_RELAY_CALL A2D_DESTROY_WINDOW, winF + MGTK_RELAY_CALL MGTK::CloseWindow, winF jsr set_cursor_pointer_with_flag pla rts @@ -19085,9 +19085,9 @@ LB068: ldy #$01 jsr LBDDF lda winF jsr LB7B9 - A2D_RELAY_CALL A2D_SET_POS, desktop_aux::LB231 + MGTK_RELAY_CALL MGTK::MoveTo, desktop_aux::LB231 addr_call draw_text1, str_7_spaces - A2D_RELAY_CALL A2D_SET_POS, desktop_aux::LB239 + MGTK_RELAY_CALL MGTK::MoveTo, desktop_aux::LB239 addr_call draw_text1, str_files rts @@ -19111,9 +19111,9 @@ LB0A2: ldy #$01 sta $06+1 stx $06 jsr LBE63 - A2D_RELAY_CALL A2D_SET_POS, desktop_aux::LAE7E + MGTK_RELAY_CALL MGTK::MoveTo, desktop_aux::LAE7E addr_call draw_text1, path_buf0 - A2D_RELAY_CALL A2D_SET_POS, desktop_aux::LB241 + MGTK_RELAY_CALL MGTK::MoveTo, desktop_aux::LB241 addr_call draw_text1, str_7_spaces rts @@ -19123,17 +19123,17 @@ LB0F1: lda winF LB0FA: jsr prompt_input_loop bmi LB0FA bne LB139 - A2D_RELAY_CALL A2D_SET_FILL_MODE, const0 - A2D_RELAY_CALL A2D_FILL_RECT, desktop_aux::press_ok_to_rect - A2D_RELAY_CALL A2D_FILL_RECT, desktop_aux::ok_button_rect - A2D_RELAY_CALL A2D_FILL_RECT, desktop_aux::cancel_button_rect + MGTK_RELAY_CALL MGTK::SetPenMode, const0 + MGTK_RELAY_CALL MGTK::PaintRect, desktop_aux::press_ok_to_rect + MGTK_RELAY_CALL MGTK::PaintRect, desktop_aux::ok_button_rect + MGTK_RELAY_CALL MGTK::PaintRect, desktop_aux::cancel_button_rect yax_call draw_dialog_label, $02, desktop_aux::str_file_colon yax_call draw_dialog_label, $04, desktop_aux::str_lock_remaining lda #$00 LB139: rts LB13A: jsr reset_state - A2D_RELAY_CALL A2D_DESTROY_WINDOW, winF + MGTK_RELAY_CALL MGTK::CloseWindow, winF jsr set_cursor_pointer rts @@ -19177,9 +19177,9 @@ LB186: ldy #$01 jsr LBDDF lda winF jsr LB7B9 - A2D_RELAY_CALL A2D_SET_POS, desktop_aux::LB22D + MGTK_RELAY_CALL MGTK::MoveTo, desktop_aux::LB22D addr_call draw_text1, str_7_spaces - A2D_RELAY_CALL A2D_SET_POS, desktop_aux::LB235 + MGTK_RELAY_CALL MGTK::MoveTo, desktop_aux::LB235 addr_call draw_text1, str_files rts @@ -19203,9 +19203,9 @@ LB1C0: ldy #$01 sta $06+1 stx $06 jsr LBE63 - A2D_RELAY_CALL A2D_SET_POS, desktop_aux::LAE7E + MGTK_RELAY_CALL MGTK::MoveTo, desktop_aux::LAE7E addr_call draw_text1, path_buf0 - A2D_RELAY_CALL A2D_SET_POS, desktop_aux::LB23D + MGTK_RELAY_CALL MGTK::MoveTo, desktop_aux::LB23D addr_call draw_text1, str_7_spaces rts @@ -19215,17 +19215,17 @@ LB20F: lda winF LB218: jsr prompt_input_loop bmi LB218 bne LB257 - A2D_RELAY_CALL A2D_SET_FILL_MODE, const0 - A2D_RELAY_CALL A2D_FILL_RECT, desktop_aux::press_ok_to_rect - A2D_RELAY_CALL A2D_FILL_RECT, desktop_aux::ok_button_rect - A2D_RELAY_CALL A2D_FILL_RECT, desktop_aux::cancel_button_rect + MGTK_RELAY_CALL MGTK::SetPenMode, const0 + MGTK_RELAY_CALL MGTK::PaintRect, desktop_aux::press_ok_to_rect + MGTK_RELAY_CALL MGTK::PaintRect, desktop_aux::ok_button_rect + MGTK_RELAY_CALL MGTK::PaintRect, desktop_aux::cancel_button_rect yax_call draw_dialog_label, $02, desktop_aux::str_file_colon yax_call draw_dialog_label, $04, desktop_aux::str_unlock_remaining lda #$00 LB257: rts LB258: jsr reset_state - A2D_RELAY_CALL A2D_DESTROY_WINDOW, winF + MGTK_RELAY_CALL MGTK::CloseWindow, winF jsr set_cursor_pointer rts @@ -19255,7 +19255,7 @@ LB27D: jsr LBD75 jsr LB7B9 addr_call draw_centered_string, desktop_aux::str_rename_title jsr set_fill_black - A2D_RELAY_CALL A2D_DRAW_RECT, LD6AB + MGTK_RELAY_CALL MGTK::FrameRect, LD6AB yax_call draw_dialog_label, $02, desktop_aux::str_rename_old lda #$55 sta dialog_label_pos @@ -19298,7 +19298,7 @@ LB2FD: jsr prompt_input_loop rts LB313: jsr reset_state - A2D_RELAY_CALL A2D_DESTROY_WINDOW, winF + MGTK_RELAY_CALL MGTK::CloseWindow, winF jsr set_cursor_pointer lda #$01 rts @@ -19311,12 +19311,12 @@ LB313: jsr reset_state ptr := $6 ;; Create window - A2D_RELAY_CALL A2D_HIDE_CURSOR + MGTK_RELAY_CALL MGTK::HideCursor jsr create_window_with_alert_bitmap lda winF jsr LB7B9 addr_call draw_centered_string, desktop_aux::str_warning - A2D_RELAY_CALL A2D_SHOW_CURSOR + MGTK_RELAY_CALL MGTK::ShowCursor jsr copy_dialog_param_addr_to_ptr ;; Dig up message @@ -19368,7 +19368,7 @@ draw_string: pha jsr reset_state - A2D_RELAY_CALL A2D_DESTROY_WINDOW, winF + MGTK_RELAY_CALL MGTK::CloseWindow, winF jsr set_cursor_pointer pla rts @@ -19426,25 +19426,25 @@ cursor_ip_flag: ; high bit set if IP, clear if pointer .byte 0 set_cursor_watch: - A2D_RELAY_CALL A2D_HIDE_CURSOR - A2D_RELAY_CALL A2D_SET_CURSOR, watch_cursor - A2D_RELAY_CALL A2D_SHOW_CURSOR + MGTK_RELAY_CALL MGTK::HideCursor + MGTK_RELAY_CALL MGTK::SetCursor, watch_cursor + MGTK_RELAY_CALL MGTK::ShowCursor rts set_cursor_pointer: - A2D_RELAY_CALL A2D_HIDE_CURSOR - A2D_RELAY_CALL A2D_SET_CURSOR, pointer_cursor - A2D_RELAY_CALL A2D_SHOW_CURSOR + MGTK_RELAY_CALL MGTK::HideCursor + MGTK_RELAY_CALL MGTK::SetCursor, pointer_cursor + MGTK_RELAY_CALL MGTK::ShowCursor rts set_cursor_insertion_point: - A2D_RELAY_CALL A2D_HIDE_CURSOR - A2D_RELAY_CALL A2D_SET_CURSOR, insertion_point_cursor - A2D_RELAY_CALL A2D_SHOW_CURSOR + MGTK_RELAY_CALL MGTK::HideCursor + MGTK_RELAY_CALL MGTK::SetCursor, insertion_point_cursor + MGTK_RELAY_CALL MGTK::ShowCursor rts set_fill_black: - A2D_RELAY_CALL A2D_SET_FILL_MODE, const2 + MGTK_RELAY_CALL MGTK::SetPenMode, const2 rts ldx #$03 @@ -19467,25 +19467,25 @@ LB46C: lda LB501 bne LB476 lda LB500 beq LB4B7 -LB476: A2D_RELAY_CALL $2C, input_params ; ??? +LB476: MGTK_RELAY_CALL $2C, input_params ; ??? jsr LB4BA bmi LB4B7 lda #$FF sta LB508 lda input_params_state sta LB507 - cmp #A2D_INPUT_NONE + cmp #MGTK::no_event beq LB45F - cmp #A2D_INPUT_HELD + cmp #MGTK::drag beq LB45F - cmp #A2D_INPUT_UP + cmp #MGTK::button_up bne LB4A7 - A2D_RELAY_CALL A2D_GET_INPUT, input_params + MGTK_RELAY_CALL MGTK::GetEvent, input_params jmp LB45F LB4A7: cmp #$01 bne LB4B7 - A2D_RELAY_CALL A2D_GET_INPUT, input_params + MGTK_RELAY_CALL MGTK::GetEvent, input_params lda #$00 rts @@ -19540,31 +19540,31 @@ LB509: sta LD8E7 jsr draw_yes_no_all_cancel_buttons jmp LB526 -LB51A: A2D_RELAY_CALL A2D_DRAW_RECT, desktop_aux::ok_button_rect +LB51A: MGTK_RELAY_CALL MGTK::FrameRect, desktop_aux::ok_button_rect jsr draw_ok_label LB526: bit LD8E7 bmi LB537 - A2D_RELAY_CALL A2D_DRAW_RECT, desktop_aux::cancel_button_rect + MGTK_RELAY_CALL MGTK::FrameRect, desktop_aux::cancel_button_rect jsr draw_cancel_label LB537: jmp reset_state -LB53A: A2D_RELAY_CALL A2D_CREATE_WINDOW, winF +LB53A: MGTK_RELAY_CALL MGTK::OpenWindow, winF lda winF jsr LB7B9 jsr set_fill_black - A2D_RELAY_CALL A2D_DRAW_RECT, desktop_aux::confirm_dialog_outer_rect - A2D_RELAY_CALL A2D_DRAW_RECT, desktop_aux::confirm_dialog_inner_rect + MGTK_RELAY_CALL MGTK::FrameRect, desktop_aux::confirm_dialog_outer_rect + MGTK_RELAY_CALL MGTK::FrameRect, desktop_aux::confirm_dialog_inner_rect rts create_window_with_alert_bitmap: - A2D_RELAY_CALL A2D_CREATE_WINDOW, winF + MGTK_RELAY_CALL MGTK::OpenWindow, winF lda winF jsr LB7B9 jsr set_fill_white - A2D_RELAY_CALL A2D_DRAW_BITMAP, alert_bitmap2_params + MGTK_RELAY_CALL MGTK::PaintBits, alert_bitmap2_params jsr set_fill_black - A2D_RELAY_CALL A2D_DRAW_RECT, desktop_aux::confirm_dialog_outer_rect - A2D_RELAY_CALL A2D_DRAW_RECT, desktop_aux::confirm_dialog_inner_rect + MGTK_RELAY_CALL MGTK::FrameRect, desktop_aux::confirm_dialog_outer_rect + MGTK_RELAY_CALL MGTK::FrameRect, desktop_aux::confirm_dialog_inner_rect rts ;;; ================================================== @@ -19587,7 +19587,7 @@ create_window_with_alert_bitmap: sta $08+1 jsr LBD7B sta $0A - A2D_RELAY_CALL A2D_MEASURE_TEXT, $08 + MGTK_RELAY_CALL MGTK::TextWidth, $08 lsr $0C ror $0B lda #$C8 @@ -19611,7 +19611,7 @@ skip: dey lda $D6C2 adc #$00 sta dialog_label_pos+3 - A2D_RELAY_CALL A2D_SET_POS, dialog_label_pos + MGTK_RELAY_CALL MGTK::MoveTo, dialog_label_pos lda $06 ldx $06+1 jsr draw_text1 @@ -19624,36 +19624,36 @@ skip: dey ;;; ================================================== draw_ok_label: - A2D_RELAY_CALL A2D_SET_POS, desktop_aux::ok_label_pos + MGTK_RELAY_CALL MGTK::MoveTo, desktop_aux::ok_label_pos addr_call draw_text1, desktop_aux::str_ok_label rts draw_cancel_label: - A2D_RELAY_CALL A2D_SET_POS, desktop_aux::cancel_label_pos + MGTK_RELAY_CALL MGTK::MoveTo, desktop_aux::cancel_label_pos addr_call draw_text1, desktop_aux::str_cancel_label rts draw_yes_label: - A2D_RELAY_CALL A2D_SET_POS, desktop_aux::yes_label_pos + MGTK_RELAY_CALL MGTK::MoveTo, desktop_aux::yes_label_pos addr_call draw_text1, desktop_aux::str_yes_label rts draw_no_label: - A2D_RELAY_CALL A2D_SET_POS, desktop_aux::no_label_pos + MGTK_RELAY_CALL MGTK::MoveTo, desktop_aux::no_label_pos addr_call draw_text1, desktop_aux::str_no_label rts draw_all_label: - A2D_RELAY_CALL A2D_SET_POS, desktop_aux::all_label_pos + MGTK_RELAY_CALL MGTK::MoveTo, desktop_aux::all_label_pos addr_call draw_text1, desktop_aux::str_all_label rts draw_yes_no_all_cancel_buttons: jsr set_fill_black - A2D_RELAY_CALL A2D_DRAW_RECT, desktop_aux::yes_button_rect - A2D_RELAY_CALL A2D_DRAW_RECT, desktop_aux::no_button_rect - A2D_RELAY_CALL A2D_DRAW_RECT, desktop_aux::all_button_rect - A2D_RELAY_CALL A2D_DRAW_RECT, desktop_aux::cancel_button_rect + MGTK_RELAY_CALL MGTK::FrameRect, desktop_aux::yes_button_rect + MGTK_RELAY_CALL MGTK::FrameRect, desktop_aux::no_button_rect + MGTK_RELAY_CALL MGTK::FrameRect, desktop_aux::all_button_rect + MGTK_RELAY_CALL MGTK::FrameRect, desktop_aux::cancel_button_rect jsr draw_yes_label jsr draw_no_label jsr draw_all_label @@ -19664,16 +19664,16 @@ draw_yes_no_all_cancel_buttons: erase_yes_no_all_cancel_buttons: jsr set_fill_white - A2D_RELAY_CALL A2D_FILL_RECT, desktop_aux::yes_button_rect - A2D_RELAY_CALL A2D_FILL_RECT, desktop_aux::no_button_rect - A2D_RELAY_CALL A2D_FILL_RECT, desktop_aux::all_button_rect - A2D_RELAY_CALL A2D_FILL_RECT, desktop_aux::cancel_button_rect + MGTK_RELAY_CALL MGTK::PaintRect, desktop_aux::yes_button_rect + MGTK_RELAY_CALL MGTK::PaintRect, desktop_aux::no_button_rect + MGTK_RELAY_CALL MGTK::PaintRect, desktop_aux::all_button_rect + MGTK_RELAY_CALL MGTK::PaintRect, desktop_aux::cancel_button_rect rts draw_ok_cancel_buttons: jsr set_fill_black - A2D_RELAY_CALL A2D_DRAW_RECT, desktop_aux::ok_button_rect - A2D_RELAY_CALL A2D_DRAW_RECT, desktop_aux::cancel_button_rect + MGTK_RELAY_CALL MGTK::FrameRect, desktop_aux::ok_button_rect + MGTK_RELAY_CALL MGTK::FrameRect, desktop_aux::cancel_button_rect jsr draw_ok_label jsr draw_cancel_label lda #$00 @@ -19682,13 +19682,13 @@ draw_ok_cancel_buttons: erase_ok_cancel_buttons: jsr set_fill_white - A2D_RELAY_CALL A2D_FILL_RECT, desktop_aux::ok_button_rect - A2D_RELAY_CALL A2D_FILL_RECT, desktop_aux::cancel_button_rect + MGTK_RELAY_CALL MGTK::PaintRect, desktop_aux::ok_button_rect + MGTK_RELAY_CALL MGTK::PaintRect, desktop_aux::cancel_button_rect rts draw_ok_button: jsr set_fill_black - A2D_RELAY_CALL A2D_DRAW_RECT, desktop_aux::ok_button_rect + MGTK_RELAY_CALL MGTK::FrameRect, desktop_aux::ok_button_rect jsr draw_ok_label lda #$80 sta LD8E7 @@ -19696,7 +19696,7 @@ draw_ok_button: erase_ok_button: jsr set_fill_white - A2D_RELAY_CALL A2D_FILL_RECT, desktop_aux::ok_button_rect + MGTK_RELAY_CALL MGTK::PaintRect, desktop_aux::ok_button_rect rts ;;; ================================================== @@ -19710,7 +19710,7 @@ erase_ok_button: inc $06 bne :+ inc $06+1 -: A2D_RELAY_CALL A2D_DRAW_TEXT, $6 +: MGTK_RELAY_CALL MGTK::DrawText, $6 done: rts .endproc @@ -19730,7 +19730,7 @@ done: rts inc str_data ; point past length byte bne :+ inc str_data+1 -: A2D_RELAY_CALL A2D_MEASURE_TEXT, str +: MGTK_RELAY_CALL MGTK::TextWidth, str lsr str_width+1 ; divide by two ror str_width lda #$01 @@ -19744,8 +19744,8 @@ done: rts lda LB76B sbc str_width+1 sta LD6B7+1 - A2D_RELAY_CALL A2D_SET_POS, LD6B7 - A2D_RELAY_CALL A2D_DRAW_TEXT, str + MGTK_RELAY_CALL MGTK::MoveTo, LD6B7 + MGTK_RELAY_CALL MGTK::DrawText, str rts .endproc @@ -19754,7 +19754,7 @@ done: rts LB76B: .byte 0 sta $06 stx $06+1 - A2D_RELAY_CALL A2D_SET_POS, LD6BB + MGTK_RELAY_CALL MGTK::MoveTo, LD6BB lda $06 ldx $06+1 jsr draw_text1 @@ -19796,12 +19796,12 @@ LB7B5: dey jmp LB78D LB7B9: sta query_state_params2::id - A2D_RELAY_CALL A2D_QUERY_STATE, query_state_params2 + MGTK_RELAY_CALL MGTK::GetWinPort, query_state_params2 ldy #$04 lda #$15 LB7CA := *+1 ldx #$D2 - jsr A2D_RELAY + jsr MGTK_RELAY rts LB7CF: lda #$00 jmp LB7E8 @@ -19840,43 +19840,43 @@ LB808: .addr test_ok_button,fill_ok_button .addr test_all_button,fill_all_button test_ok_button: - A2D_RELAY_CALL A2D_TEST_BOX, desktop_aux::ok_button_rect + MGTK_RELAY_CALL MGTK::InRect, desktop_aux::ok_button_rect rts test_cancel_button: - A2D_RELAY_CALL A2D_TEST_BOX, desktop_aux::cancel_button_rect + MGTK_RELAY_CALL MGTK::InRect, desktop_aux::cancel_button_rect rts test_yes_button: - A2D_RELAY_CALL A2D_TEST_BOX, desktop_aux::yes_button_rect + MGTK_RELAY_CALL MGTK::InRect, desktop_aux::yes_button_rect rts test_no_button: - A2D_RELAY_CALL A2D_TEST_BOX, desktop_aux::no_button_rect + MGTK_RELAY_CALL MGTK::InRect, desktop_aux::no_button_rect rts test_all_button: - A2D_RELAY_CALL A2D_TEST_BOX, desktop_aux::all_button_rect + MGTK_RELAY_CALL MGTK::InRect, desktop_aux::all_button_rect rts fill_ok_button: - A2D_RELAY_CALL A2D_FILL_RECT, desktop_aux::ok_button_rect + MGTK_RELAY_CALL MGTK::PaintRect, desktop_aux::ok_button_rect rts fill_cancel_button: - A2D_RELAY_CALL A2D_FILL_RECT, desktop_aux::cancel_button_rect + MGTK_RELAY_CALL MGTK::PaintRect, desktop_aux::cancel_button_rect rts fill_yes_button: - A2D_RELAY_CALL A2D_FILL_RECT, desktop_aux::yes_button_rect + MGTK_RELAY_CALL MGTK::PaintRect, desktop_aux::yes_button_rect rts fill_no_button: - A2D_RELAY_CALL A2D_FILL_RECT, desktop_aux::no_button_rect + MGTK_RELAY_CALL MGTK::PaintRect, desktop_aux::no_button_rect rts fill_all_button: - A2D_RELAY_CALL A2D_FILL_RECT, desktop_aux::all_button_rect + MGTK_RELAY_CALL MGTK::PaintRect, desktop_aux::all_button_rect rts LB880: jmp (LB886) @@ -19890,14 +19890,14 @@ LB889: .byte 0 LB88A: sta LB8F3 lda #$00 sta LB8F2 -LB892: A2D_RELAY_CALL A2D_GET_INPUT, input_params +LB892: MGTK_RELAY_CALL MGTK::GetEvent, input_params lda input_params_state - cmp #A2D_INPUT_UP + cmp #MGTK::button_up beq LB8E3 lda winF sta input_params - A2D_RELAY_CALL A2D_MAP_COORDS, input_params - A2D_RELAY_CALL A2D_SET_POS, $D20D + MGTK_RELAY_CALL MGTK::ScreenToWindow, input_params + MGTK_RELAY_CALL MGTK::MoveTo, $D20D jsr LB880 cmp #$80 beq LB8C9 @@ -19937,15 +19937,15 @@ LB8F5: jsr LBD3B sta $08 lda $D6B5+1 sta $08+1 - A2D_RELAY_CALL A2D_SET_POS, $6 - A2D_RELAY_CALL A2D_SET_BOX, LD6C7 + MGTK_RELAY_CALL MGTK::MoveTo, $6 + MGTK_RELAY_CALL MGTK::SetPortSite, LD6C7 bit LD8EB bpl LB92D - A2D_RELAY_CALL A2D_SET_TEXT_MASK, desktop_aux::LAE6C + MGTK_RELAY_CALL MGTK::SetTextBG, desktop_aux::LAE6C lda #$00 sta LD8EB beq LB93B -LB92D: A2D_RELAY_CALL A2D_SET_TEXT_MASK, desktop_aux::LAE6D +LB92D: MGTK_RELAY_CALL MGTK::SetTextBG, desktop_aux::LAE6D lda #$FF sta LD8EB LB93B: lda #<$D8EF @@ -19954,8 +19954,8 @@ LB93B: lda #<$D8EF sta $06+1 lda LD8EE sta $08 - A2D_RELAY_CALL A2D_DRAW_TEXT, $6 - A2D_RELAY_CALL A2D_SET_TEXT_MASK, desktop_aux::LAE6D + MGTK_RELAY_CALL MGTK::DrawText, $6 + MGTK_RELAY_CALL MGTK::SetTextBG, desktop_aux::LAE6D lda winF jsr LB7B9 rts @@ -19965,11 +19965,11 @@ LB961: lda path_buf1 lda winF jsr LB7B9 jsr set_fill_white - A2D_RELAY_CALL A2D_FILL_RECT, LD6AB - A2D_RELAY_CALL A2D_SET_FILL_MODE, const2 - A2D_RELAY_CALL A2D_DRAW_RECT, LD6AB - A2D_RELAY_CALL A2D_SET_POS, LD6B3 - A2D_RELAY_CALL A2D_SET_BOX, LD6C7 + MGTK_RELAY_CALL MGTK::PaintRect, LD6AB + MGTK_RELAY_CALL MGTK::SetPenMode, const2 + MGTK_RELAY_CALL MGTK::FrameRect, LD6AB + MGTK_RELAY_CALL MGTK::MoveTo, LD6B3 + MGTK_RELAY_CALL MGTK::SetPortSite, LD6C7 addr_call draw_text1, path_buf1 addr_call draw_text1, path_buf2 addr_call draw_text1, str_2_spaces @@ -19977,9 +19977,9 @@ LB961: lda path_buf1 jsr LB7B9 LB9B7: rts -LB9B8: A2D_RELAY_CALL A2D_MAP_COORDS, input_params - A2D_RELAY_CALL A2D_SET_POS, $D20D - A2D_RELAY_CALL A2D_TEST_BOX, LD6AB +LB9B8: MGTK_RELAY_CALL MGTK::ScreenToWindow, input_params + MGTK_RELAY_CALL MGTK::MoveTo, $D20D + MGTK_RELAY_CALL MGTK::InRect, LD6AB cmp #$80 beq LB9D8 rts @@ -20008,7 +20008,7 @@ LB9EE: jsr LBD3B sta $06+1 lda path_buf2 sta $08 -LBA10: A2D_RELAY_CALL A2D_MEASURE_TEXT, $6 +LBA10: MGTK_RELAY_CALL MGTK::TextWidth, $6 lda $09 clc adc LBB09 @@ -20067,7 +20067,7 @@ LBA83: lda #=0, is length of param block -;;; if <0, and with $7E to get length -;;; if $4185,(call*2) is non-zero, param block is copied. +;;; -------------------------------------------------- +;;; Initialization Commands -A2D_NOOP := $00 ; No-op +NoOp := $00 ; No-op ;; (input length 0 bytes) -A2D_CFG_DISPLAY := $02 ; Configure display switches +SetSwitches := $02 ; Configure display switches ;; (input length 1 byte) ;; Turns on 80 col/DHR, and then: ;; bit 0: LoRes if clear, HiRes if set @@ -27,13 +26,16 @@ A2D_CFG_DISPLAY := $02 ; Configure display switches ;; bit 2: Full screen if clear, split screen if set ;; bit 3: Graphics if clear, text if set -A2D_QUERY_SCREEN := $03 ; Get screen state +;;; -------------------------------------------------- +;;; GrafPort Commands + +InitPort := $03 ; Get screen state ;; (input length 0 bytes) ;; (output length 36 bytes) ;; .word left ;; .word top - ;; .addr addr A2D_SCREEN_ADDR - ;; .word stride A2D_SCREEN_STRIDE + ;; .addr addr screen_mapbits + ;; .word stride screen_mapwidth ;; .word hoff ;; .word voff ;; .word width 560-1 @@ -49,12 +51,12 @@ A2D_QUERY_SCREEN := $03 ; Get screen state ;; .byte tmask AND mask for text, default $7F ;; .addr font -A2D_SET_STATE := $04 ; Set full drawing state +SetPort := $04 ; Set full drawing state ;; (input length 36 bytes) ;; .word left pixels from screen edge ;; .word top - ;; .addr addr A2D_SCREEN_ADDR - ;; .word stride A2D_SCREEN_STRIDE + ;; .addr addr screen_mapbits + ;; .word stride screen_mapwidth ;; .word hoff pixels scrolled ;; .word voff ;; .word width pixels @@ -70,92 +72,95 @@ A2D_SET_STATE := $04 ; Set full drawing state ;; .byte tmask AND mask for text, default $7F ;; .addr font -A2D_GET_STATE := $05 ; Get pointer to active drawing state +GetPort := $05 ; Get pointer to active drawing state ;; (input length 0 bytes) ;; (output length 2 bytes) ;; .addr state (out) -A2D_SET_BOX := $06 ; Set just the drawing box, subset of full state +SetPortSite := $06 ; Set just the drawing box, subset of full state ;; (input length 16 bytes) ;; .word left pixels from screen edge ;; .word top - ;; .addr addr A2D_SCREEN_ADDR ($2000) - ;; .word stride A2D_SCREEN_STRIDE ($80) + ;; .addr addr screen_mapbits ($2000) + ;; .word stride screen_mapwidth ($80) ;; .word hoff pixels scrolled ;; .word voff ;; .word width pixels ;; .word height -A2D_SET_FILL_MODE := $07 +SetPenMode := $07 ;; (input length 1 byte) ;; .byte mode (>=4 also sets eor mask to $7f) ;; 0 = white (???) ;; 2 = black (???) -A2D_SET_PATTERN := $08 +SetPattern := $08 ;; (input length 8 bytes) - ;; .res 8 pattern 8x8 pixel pattern for A2D_FILL_RECT calls + ;; .res 8 pattern 8x8 pixel pattern for PaintRect calls -A2D_SET_MSK := $09 +SetColorMasks := $09 ;; (input length 2 bytes) ;; .byte mskand ;; .byte mskor -A2D_SET_THICKNESS := $0A +SetPenSize := $0A ;; (input length 2 bytes) ;; .byte hthick horizontal pen thickness ;; .byte vthick vertical pen thickness -A2D_SET_FONT := $0B +SetFont := $0B ;; (input length 2 bytes) ;; .addr font font definition (see below) -A2D_SET_TEXT_MASK := $0C ; Stored to background before XORing glyph +SetTextBG := $0C ; Stored to background before XORing glyph ;; (input length 1 byte) ;; .byte mask -A2D_OFFSET_POS := $0D ; Adjust start of subsequent DRAW_TEXT, DRAW_LINE +;;; -------------------------------------------------- +;;; Drawing Commands + +Move := $0D ; Adjust start of subsequent DRAW_TEXT, DRAW_LINE ;; (input length 4 bytes) ;; .word xdelta ;; .word ydelta -A2D_SET_POS := $0E ; Start of subsequent DRAW_TEXT, DRAW_LINE +MoveTo := $0E ; Start of subsequent DRAW_TEXT, DRAW_LINE ;; (input length 4 bytes) ;; .word xcoord ;; .word ycoord -A2D_DRAW_LINE := $0F ; Draw line (from SET_POS) +Line := $0F ; Draw line (from SET_POS) ;; (input length 4 bytes) ;; .word xdelta signed, delta in pixels ;; .word ydelta -A2D_DRAW_LINE_ABS := $10 ; Draw line (from SET_POS) +LineTo := $10 ; Draw line (from SET_POS) ;; (input length 4 bytes) ;; .word xcoord end coords in pixels ;; .word ycoord -A2D_FILL_RECT := $11 ; Fill rectangle with selected simple pattern/thickness +PaintRect := $11 ; Fill rectangle with selected simple pattern/thickness ;; (input length 8 bytes) ;; .word left (includes scroll pos) ;; .word top ;; .word right pixels ;; .word bottom -A2D_DRAW_RECT := $12 ; Draw rectangle with selected simple pattern/thickness +FrameRect := $12 ; Draw rectangle with selected simple pattern/thickness ;; (input length 8 bytes) ;; .word left pixels ;; .word top ;; .word right ;; .word bottom -A2D_TEST_BOX := $13 ; Is pos (via SET_POS) in bounds? Returns true/false in A +InRect := $13 ; Is pos (via SET_POS) in bounds? Returns true/false in A ;; (input length 8 bytes) ;; .word left ;; .word top ;; .word right ;; .word bottom -A2D_DRAW_BITMAP := $14 ; Draw pattern +PaintBits := $14 ; Draw pattern ;; (input length 16 bytes) ;; .word left ;; .word top @@ -170,7 +175,7 @@ A2D_DRAW_BITMAP := $14 ; Draw pattern ;; $15 used in DeskTop but not DAs - icon redraw ;; (input length 0 bytes) -A2D_DRAW_POLYGONS := $16 ; Draw multiple closed polygons +FramePoly := $16 ; Draw multiple closed polygons ;; (input length 0 bytes) ;; Address points at struct: ;; .byte points count @@ -182,97 +187,120 @@ A2D_DRAW_POLYGONS := $16 ; Draw multiple closed polygons ;; $17 used in DeskTop but not DAs - maybe selection drag ;; (input length 0 bytes) -A2D_MEASURE_TEXT := $18 ; Measure the width of a string in pixels +;;; -------------------------------------------------- +;;; Text Commands + +TextWidth := $18 ; Measure the width of a string in pixels ;; (input length 3 bytes) ;; .addr data ;; .byte length ;; .word width result in pixels -A2D_DRAW_TEXT := $19 ; Drawn at last SET_POS as left, baseline +DrawText := $19 ; Drawn at last SET_POS as left, baseline ;; (input length 3 bytes) ;; .addr data ;; .byte length -A2D_CONFIGURE_ZP_USE := $1A ; Configure ZP usage by API (speed vs. convenience) +;;; -------------------------------------------------- +;;; Utility Commands + +SetZP1 := $1A ; Configure ZP usage by API (speed vs. convenience) ;; (input length 1 byte) ;; .byte flag (AWS_CZP_*; high bit set = preserve ZP during calls) -A2D_LOW_ZP_STASH := $1B ; Stash or restore lower 128 bytes of ZP; calls are idempotent +SetZP2 := $1B ; Stash or restore lower 128 bytes of ZP; calls are idempotent ;; (input length 1 byte) ;; .byte flag (high bit set = stash ZP, clear = unstash ZP) -A2D_INIT_SCREEN_AND_MOUSE := $1D; Inits state, registers interrupt handler, draws desktop + +;;; ================================================== +;;; Mouse Graphics Tool Kit Calls +;;; ================================================== + +;;; -------------------------------------------------- +;;; Initialization Calls + +StartDeskTop := $1D; Inits state, registers interrupt handler, draws desktop ;; (input length 12 byte) ;; ??? -A2D_DISABLE_MOUSE := $1E ; Deallocates interrupt, hides cursor +StopDeskTop := $1E ; Deallocates interrupt, hides cursor ;; (no parameters; pass $0000 as address) -A2D_HOOK_MOUSE := $20 ; Install mouse hook; A=0 on success, $95 if mouse disabled +SetUserHook := $20 ; Install mouse hook; A=0 on success, $95 if mouse disabled ;; NOTE: Doesn't set the internal flag - buggy ??? ;; (input length 2 bytes) ;; (output length 2 bytes) ;; .addr hook Mouse hook routine to install ;; .addr mouse_state (out) Address of mouse state (.word x, y; .byte status) -A2D_GET_INT_HANDLER := $23 ; Get address of interrupt handler +GetIntHandler := $23 ; Get address of interrupt handler ;; (input length 0) ;; (output length 2 bytes) ;; .addr handler (out) Address of interrupt handler (after cld) -A2D_SET_CURSOR := $24 ; Set cursor definition +;;; -------------------------------------------------- +;;; Cursor Manager Calls + +SetCursor := $24 ; Set cursor definition ;; (input not copied) ;; .res 24 bitmap 2x12 byte bitmap ;; .res 24 mask 2x12 byte mask ;; .byte hotx hotspot coords ;; .byte hoty -A2D_SHOW_CURSOR := $25 ; Return cursor to visibility +ShowCursor := $25 ; Return cursor to visibility ;; (no parameters; pass $0000 as address) -A2D_HIDE_CURSOR := $26 ; Cursor hidden until A2D_SHOW_CURSOR call +HideCursor := $26 ; Cursor hidden until ShowCursor call ;; (no parameters; pass $0000 as address) -A2D_ERASE_CURSOR := $27 ; Cursor hidden until moved or other A2D call +ObscureCursor := $27 ; Cursor hidden until moved ;; (no parameters; pass $0000 as address) -A2D_GET_CURSOR := $28 ; Get cursor definition +GetCursorAddr := $28 ; Get cursor definition ;; (input length 0 bytes) ;; (output length 2 bytes) - ;; .addr definition See A2D_SET_CURSOR + ;; .addr definition See SetCursor -A2D_GET_INPUT := $2A +;;; -------------------------------------------------- +;;; Event Manager Calls + +GetEvent := $2A ;; (input length 0 bytes) ;; (output length 5 bytes) - ;; .byte state (A2D_INPUT_*) - ;; if state is A2D_INPUT_KEY: + ;; .byte state + ;; if state is key_down: ;; .byte key (ASCII code; high bit clear) ;; .byte modifiers (0=none, 1=open-apple, 2=closed-apple, 3=both) ;; if state otherwise: ;; .word xcoord ;; .word ycoord -A2D_UNK_2B := $2B ; Unknown - possibly "reset drawing state" +FlushEvents := $2B ;; (no parameters; pass $0000 as address) ;; $2C used in DeskTop but not DAs - icon drag ;; (input length 0 bytes) -A2D_SET_INPUT := $2D ; Set pending input state (mouse or keyboard) +PostEvent := $2D ; Set pending input state (mouse or keyboard) ;; (input length 5 bytes) - ;; .byte state A2D_INPUT_* - ;; if state is A2D_INPUT_KEY: + ;; .byte state + ;; if state is key_down: ;; .byte key ASCII code; high bit clear ;; .byte modifiers 0=none, 1=open-apple, 2=closed-apple, 3=both ;; if state otherwise: ;; .word xcoord ;; .word ycoord -A2D_SET_KBD_FLAG := $2E ; When set, keyboard is ignored in $29 calls +SetKeyEvent := $2E ; When set, keyboard is ignored in $29 calls ;; (input length 1 byte) ;; .byte flag high bit set = ignore keyboard, otherwise check -A2D_SET_MENU := $30 ; Configure (and draw) menu +;;; -------------------------------------------------- +;;; Menu Manager Calls + +SetMenu := $30 ; Configure (and draw) menu ;; (input not copied) ;; .word count Number of top-level menus ;; @@ -294,19 +322,22 @@ A2D_SET_MENU := $30 ; Configure (and draw) menu ;; or for a separator: ;; .word $40, $13, $0 -A2D_MENU_CLICK := $31 ; Enter modal loop for handling mouse-down on menu bar +MenuSelect := $31 ; Enter modal loop for handling mouse-down on menu bar ;; (input not copied) ;; (output 2 bytes) ;; .byte menu_id Top level menu identifier, or 0 if none ;; .byte item_num Index (1-based) of item in menu, or 0 if none -A2D_CREATE_WINDOW := $38 +;;; -------------------------------------------------- +;;; Window Manager Calls + +OpenWindow := $38 ;; (input not copied) - ;; .byte id 0 = desktop, 1-...n = DeskTop windows, DAs use 51, 52, 100 - ;; .byte flags A2D_CWF_* + ;; .byte id + ;; .byte options option_* ;; .addr title - ;; .byte hscroll A2D_CWS_* - ;; .byte vscroll A2D_CWS_* + ;; .byte hscroll scroll_option_* + ;; .byte vscroll scroll_option_* ;; .byte hsmax ;; .byte hspos ;; .byte vsmax @@ -317,7 +348,7 @@ A2D_CREATE_WINDOW := $38 ;; .word height_a ??? ;; .word width_b (of scroll area?) ;; .word height_b (of scroll area?) - ;; - next section is identical to that for A2D_SET_STATE + ;; - next section is identical to that for SetPort ;; .word left pixels from screen edge ;; .word top ;; .word screen_addr @@ -338,69 +369,69 @@ A2D_CREATE_WINDOW := $38 ;; .addr font ;; .addr next address of next lower window in stack (filled in by call) -A2D_DESTROY_WINDOW := $39 +CloseWindow := $39 ;; (input length 1 byte) ;; .byte id -A2D_QUERY_WINDOW := $3B ; Get pointer to window params by id; A=0 on success +GetWinPtr := $3B ; Get pointer to window params by id; A=0 on success ;; (input length 1 byte) ;; (output length 3 bytes) ;; .byte id of window ;; .addr window (out) window params -A2D_QUERY_STATE := $3C ; get drawing state of window +GetWinPort := $3C ; get drawing state of window ;; (input length 3 bytes) ;; .byte id window - ;; .addr state state definition to populate, like A2D_SET_STATE + ;; .addr state state definition to populate, like SetPort -A2D_UPDATE_STATE := $3D ; Update drawing state by passed window id +SetWinPort := $3D ; Update drawing state by passed window id ;; ** Implementation appears buggy - or maybe just really cryptic ??? ** ;; (input length 2 bytes) ;; .byte id window ;; .byte ??? -A2D_REDRAW_WINDOW := $3E ; Draws window border, background, title bar, scroll bars +BeginUpdate := $3E ; Draws window border, background, title bar, scroll bars ;; (input length 1 byte) ;; .byte id -A2D_QUERY_TARGET := $40 +FindWindow := $40 ;; (input length 4 bytes) ;; .word queryx relative to screen ;; .word queryy - ;; .byte element (out) A2D_ELEM_* + ;; .byte element (out) area_* ;; .byte id (out) of window -A2D_QUERY_TOP := $41 ; Get id of top window +FrontWindow := $41 ; Get id of top window ;; (input length 0 bytes) ;; (output length 1 byte) ;; .byte id (out) window, or 0 if none -A2D_RAISE_WINDOW := $42 ; Make window topmost +SelectWindow := $42 ; Make window topmost ;; (input length 1 byte) ;; .byte id window -A2D_CLOSE_CLICK := $43 +TrackGoAway := $43 ;; (input length 0 bytes) ;; .byte clicked (out) 0 = cancelled, 1 = clicked ;; .byte ?? (out) ;; .byte ?? (out) -A2D_DRAG_WINDOW := $44 +DragWindow := $44 ;; (input length 5 bytes) ;; .byte id window ;; .word xcoord mouse coords ;; .word ycoord ;; .byte moved high bit set if moved, clear if not -A2D_DRAG_RESIZE := $45 +GrowWindow := $45 ;; (input length 5 bytes) ;; .byte id window ;; .word xcoord mouse coords ;; .word ycoord ;; .byte ?? likely: moved? 0 = no change, 1 = moved -A2D_MAP_COORDS := $46 ; Map screen coords to client coords +ScreenToWindow := $46 ; Map screen coords to client coords ;; (input length 5 bytes) ;; .byte window_id ;; .word screenx @@ -408,108 +439,116 @@ A2D_MAP_COORDS := $46 ; Map screen coords to client coords ;; .word clientx ;; .word clienty -A2D_QUERY_CLIENT:= $48 +;;; -------------------------------------------------- +;;; Control Manager Calls + +FindControl := $48 ;; (input length 4 bytes) ;; .word xcoord ;; .word ycoord - ;; .byte part A2D_CLIENT, A2D_HSCROLL or A2D_VSCROLL - ;; .byte scroll A2D_SCROLL_PART_* + ;; .byte part ctl_* + ;; .byte scroll part_* -A2D_RESIZE_WINDOW := $49 ; ??? +SetCtlMax := $49 ; ??? ;; (input length 3 bytes) ;; .byte ??? maybe part (i.e. HSCROLL or VSCROLL) ??? ;; .byte ??? width fraction ?? ;; .byte ??? -A2D_DRAG_SCROLL := $4A +TrackThumb := $4A ;; (input length 5 bytes) - ;; .byte type A2D_HSCROLL or A2D_VSCROLL + ;; .byte type ctl_horizontal_scroll_bar or ctl_vertical_scroll_bar ;; .word mouse xcoord ;; .word mouse ycoord ;; .byte position 0...255 ;; .byte moved 0 = no change, 1 = moved -A2D_UPDATE_SCROLL:= $4B +UpdateThumb := $4B ;; (input length 3 bytes) - ;; .byte type A2D_HSCROLL or A2D_VSCROLL + ;; .byte type ctl_horizontal_scroll_bar or ctl_vertical_scroll_bar ;; .byte pos new position 0...250 ;; .byte ??? -;;; $4E looks like last call +;;; $4E is last call ;;; ================================================== -;;; Constants +;;; Graphics Primitives Constants -;;; Used in A2D_QUERY_STATE / A2D_SET_BOX -A2D_SCREEN_ADDR := $2000 ; Screen address -A2D_SCREEN_STRIDE := $80 ; Stride in bytes +;;; Used in GetWinPort / SetPortSite +screen_mapbits := $2000 ; Screen address +screen_mapwidth := $80 ; Stride in bytes -;;; Used in A2D_GET_INPUT -A2D_INPUT_NONE := 0 ; No mouse or keypress -A2D_INPUT_DOWN := 1 ; Mouse button was depressed -A2D_INPUT_UP := 2 ; Mouse button was released -A2D_INPUT_KEY := 3 ; Key was pressed -A2D_INPUT_HELD := 4 ; Mouse button still down -A2D_INPUT_DOWN_MOD := 5 ; Mouse button was depressed, modifier key down +;;; Used in SetPenMode +pencopy := 0 +notpenXOR := 6 -;;; Used in A2D_GET_MOUSE -A2D_ELEM_DESKTOP:= 0 -A2D_ELEM_MENU := 1 -A2D_ELEM_CLIENT := 2 ; Includes scroll bars -A2D_ELEM_TITLE := 3 -A2D_ELEM_RESIZE := 4 -A2D_ELEM_CLOSE := 5 - -;;; Used in A2D_QUERY_CLIENT, A2D_DRAG_SCROLL, A2D_UPDATE_SCROLL -A2D_CLIENT := 0 -A2D_VSCROLL := 1 -A2D_HSCROLL := 2 - -;;; Used in A2D_QUERY_CLIENT -A2D_SCROLL_PART_UP := 1 -A2D_SCROLL_PART_LEFT := 1 -A2D_SCROLL_PART_DOWN := 2 -A2D_SCROLL_PART_RIGHT := 2 -A2D_SCROLL_PART_ABOVE := 3 -A2D_SCROLL_PART_BEFORE := 3 -A2D_SCROLL_PART_BELOW := 4 -A2D_SCROLL_PART_AFTER := 4 -A2D_SCROLL_PART_THUMB := 5 - -;;; Used in A2D_SET_FILL_MODE -A2D_SFM_NORMAL := 0 -A2D_SFM_XOR := 6 - -;;; Used in A2D_CREATE_WINDOW -A2D_CWF_NOTITLE := 1 << 0 -A2D_CWF_ADDCLOSE := 1 << 1 -A2D_CWF_ADDRESIZE := 1 << 2 - -A2D_CWS_NOSCROLL := 0 -A2D_CWS_SCROLL_ENABLED := 1 << 7 -A2D_CWS_SCROLL_THUMB := 1 << 6 -A2D_CWS_SCROLL_TRACK := 1 << 0 -A2D_CWS_SCROLL_NORMAL := A2D_CWS_SCROLL_ENABLED | A2D_CWS_SCROLL_THUMB | A2D_CWS_SCROLL_TRACK - -;;; Used in A2D_CONFIGURE_ZP_USE -A2D_CZP_PRESERVE := 1<<7 -A2D_CZP_OVERWRITE := 0 +;;; Used in SetZP1 +zp_overwrite := 0 +zp_preserve := 1<<7 ;;; Used in various state blocks -A2D_DEFAULT_MSKAND := $FF -A2D_DEFAULT_MSKOR := $00 -A2D_DEFAULT_TMASK := $7F +colormask_and := $FF +colormask_or := $00 +textbg_white := $7F + +;;; ================================================== +;;; Mouse Graphics Tool Kit Constants + +;;; Used in GetEvent +no_event := 0 ; No mouse or keypress +button_down := 1 ; Mouse button was depressed +button_up := 2 ; Mouse button was released +key_down := 3 ; Key was pressed +drag := 4 ; Mouse button still down +apple_key := 5 ; Mouse button was depressed, modifier key down + +;;; Used in FindWindow +area_desktop := 0 +area_menubar := 1 +area_content := 2 ; Includes scroll bars +area_dragbar := 3 +area_grow_box := 4 +area_close_box := 5 + +;;; Used in FindControl, TrackThumb, UpdateThumb +ctl_not_a_control := 0 +ctl_vertical_scroll_bar := 1 +ctl_horizontal_scroll_bar := 2 + +;;; Used in FindControl +part_up_arrow := 1 +part_left_arrow := 1 +part_down_arrow := 2 +part_right_arrow := 2 +part_page_up := 3 +part_page_left := 3 +part_page_down := 4 +part_page_right := 4 +part_thumb := 5 + +;;; Used in OpenWindow +option_dialog_box := 1 << 0 +option_go_away_box := 1 << 1 +option_grow_box := 1 << 2 + +scroll_option_none := 0 +scroll_option_present := 1 << 7 +scroll_option_thumb := 1 << 6 +scroll_option_active := 1 << 0 +scroll_option_normal := scroll_option_present | scroll_option_thumb | scroll_option_active + +.endscope ; MGTK ;;; ================================================== ;;; Macros -;;; Call an A2D entry point: -;;; A2D_CALL n - params is $0000 -;;; A2D_CALL n, params_addr -;;; A2D_CALL m, params_addr, label - params_addr is labeled for modifying +;;; Call an MGTK entry point: +;;; MGTK_CALL n - params is $0000 +;;; MGTK_CALL n, params_addr +;;; MGTK_CALL m, params_addr, label - params_addr is labeled for modifying -.macro A2D_CALL op, addr, label - jsr A2D +.macro MGTK_CALL op, addr, label + jsr MGTK::MLI .byte op .if .paramcount > 2 @@ -525,10 +564,10 @@ A2D_DEFAULT_TMASK := $7F ;;; ------------------------------------ -.macro A2D_DEFSTRING str, label ; String definition, for use with A2D_TEXT - .local data ; Call as A2D_DEFSTRING "abc" +.macro DEFINE_STRING str, label ; String definition, for use with TextWidth/DrawText + .local data ; Call as DEFINE_STRING "abc" .local end ; Can include control chars by using: - .addr data ; A2D_DEFSTRING {"abc",$0D,"def"} + .addr data ; DEFINE_STRING {"abc",$0D,"def"} .if .paramcount > 1 label: @@ -539,7 +578,7 @@ end: .endmacro -;;; Define pattern for A2D_DRAW_BITMAP - low 7 bits are reversed +;;; Define pattern for PaintBits - low 7 bits are reversed ;;; e.g. .byte px(%1000000) ;;; px() has high bit clear, PX() has high bit set .define px(bits) (((bits&$40)>>6)|((bits&$20)>>4)|((bits&$10)>>2)|(bits&$8)|((bits&$4)<<2)|((bits&$2)<<4)|((bits&$1)<<6))