From 655e86f37b3f5cca027fe5c2fc72339092313330 Mon Sep 17 00:00:00 2001 From: Joshua Bell Date: Tue, 3 Apr 2018 21:26:13 -0700 Subject: [PATCH] MGTK: minor S2W/W2S cleanup --- MGTK.md | 3 +-- desktop/mgtk.s | 25 ++++++++++++++++--------- inc/prodos.inc | 2 ++ 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/MGTK.md b/MGTK.md index dc4e976..bed783e 100644 --- a/MGTK.md +++ b/MGTK.md @@ -808,7 +808,7 @@ Parameters: .byte window_id .word dragx mouse coords .word dragy -.byte moved high bit set if moved, clear if not +.byte moved (out) high bit set if moved, clear if not ``` @@ -883,7 +883,6 @@ Parameters: ``` - #### UpdateThumb ($4B) diff --git a/desktop/mgtk.s b/desktop/mgtk.s index 45b36b9..04c96f1 100644 --- a/desktop/mgtk.s +++ b/desktop/mgtk.s @@ -5640,7 +5640,7 @@ set_x: stax current_penloc_x kind: .byte 0 mouse_pos: mouse_x: .word 0 -mouse_y: .word 0 +mouse_y: .word 0 END_PARAM_BLOCK MGTK_CALL MGTK::GetEvent, event @@ -7870,7 +7870,7 @@ loop: add16 $83,x, $B7,x, $83,x dex dex bpl loop - bmi L790F + bmi copy_map_results .endproc ;;; ============================================================ @@ -7878,20 +7878,27 @@ loop: add16 $83,x, $B7,x, $83,x ;;; 5 bytes of params, copied to $82 -ScreenToWindowImpl: +.proc ScreenToWindowImpl jsr window_by_id_or_exit ldx #$02 -L78FE: sub16 $83,x, $B7,x, $83,x +loop: sub16 $83,x, $B7,x, $83,x dex dex - bpl L78FE -L790F: ldy #$05 -L7911: lda $7E,y + bpl loop + ;; fall through +.endproc + +.proc copy_map_results + ldy #5 +loop: lda $7E,y sta (params_addr),y iny - cpy #$09 - bne L7911 + cpy #9 ; results are 2 words (x, y) at params_addr+5 + bne loop rts +.endproc + +;;; ============================================================ ;; Used to draw scrollbar arrows L791C: stax $82 diff --git a/inc/prodos.inc b/inc/prodos.inc index 1cb1dc6..517d5d1 100644 --- a/inc/prodos.inc +++ b/inc/prodos.inc @@ -17,6 +17,8 @@ TIMELO := $BF92 ; Time lo TIMEHI := $BF93 ; Time hi LEVEL := $BF94 ; File level MACHID := $BF98 ; Machine ID +IVERSION := $BFFD ; Interpreter Version +KVERSION := $BFFF ; ProDOS Kernel Version ;;; Patch Locations SELECTOR := $D100