MGTK: minor S2W/W2S cleanup

This commit is contained in:
Joshua Bell 2018-04-03 21:26:13 -07:00
parent 6b176d4ac1
commit 655e86f37b
3 changed files with 19 additions and 11 deletions

View File

@ -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)

View File

@ -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

View File

@ -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