Scroll also stops when getting to the edge.
; defines end of scroll location
#define CURSOR_MIN_X 0
-#define CURSOR_MAX_X 0
+#define CURSOR_MAX_X 0xF8
#define CURSOR_MIN_Y 0
-#define CURSOR_MAX_Y 0
+#define CURSOR_MAX_Y 0xB8
handle_inputs:
input_held BTNDOWN
jr z, @notdown REL
+
+ call try_abort_move_down
+ ret z
cursor_move_direction cursor_move_y, cursor_move_x, 1
input_held BTNRIGHT
jr z, @notright REL
+ call try_abort_move_right
+ ret z
+
cursor_move_direction cursor_move_x, cursor_move_y, 1
; adjust scroll
ld hl, cursor_x
jp try_abort_move_at
+try_abort_move_right:
+ ld b, CURSOR_MAX_X
+ ld hl, cursor_x
+ jp try_abort_move_at
+
try_abort_move_up:
ld b, CURSOR_MIN_Y
ld hl, cursor_y
jp try_abort_move_at
+try_abort_move_down:
+ ld b, CURSOR_MAX_Y
+ ld hl, cursor_y
+ jp try_abort_move_at
; aborts a move direciton
; inputs: