From 9c07f7697523703bab2315935f06059814807353 Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Tue, 24 Mar 2020 01:10:39 -0400 Subject: [PATCH] mist: fix some irregularities when entering/leaving worlds sometimes would take two presses to enter area (we weren't tracking IS_SPECIAL if not visible) also weren't masking high bits off direction when turning left/right --- mist/draw_pointer.s | 16 +++++++++++++--- mist/keyboard.s | 2 ++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/mist/draw_pointer.s b/mist/draw_pointer.s index e498685f..d87fc1b8 100644 --- a/mist/draw_pointer.s +++ b/mist/draw_pointer.s @@ -5,9 +5,6 @@ draw_pointer: - lda CURSOR_VISIBLE - bne really_draw_pointer - jmp no_draw_pointer really_draw_pointer: @@ -55,6 +52,13 @@ finger_grab: lda #1 sta IN_SPECIAL + lda CURSOR_VISIBLE ; if not visible skip + bne really_draw_grab + + rts + +really_draw_grab: + lda DIRECTION and #DIRECTION_ONLY_POINT bne special_but_point @@ -69,6 +73,12 @@ special_but_point: finger_not_special: + lda CURSOR_VISIBLE ; if not visible skip + bne really_not_special + + rts +really_not_special: + ; check for left/right lda CURSOR_X diff --git a/mist/keyboard.s b/mist/keyboard.s index 7301fca1..fda934f8 100644 --- a/mist/keyboard.s +++ b/mist/keyboard.s @@ -221,6 +221,7 @@ cant_go_forward: turn_left: lda DIRECTION + and #$f cmp #DIRECTION_N beq go_west cmp #DIRECTION_W @@ -234,6 +235,7 @@ turn_left: ;=========================== turn_right: lda DIRECTION + and #$f cmp #DIRECTION_N beq go_east cmp #DIRECTION_E