From 6613cd538610c16c6a96e6149f3d54534638626d Mon Sep 17 00:00:00 2001 From: xCrystal Date: Thu, 16 Nov 2023 17:20:13 +0100 Subject: [PATCH] Add anchor points to support manual movement between spaces (#26) --- constants/script_constants.asm | 1 + constants/space_constants.asm | 10 ++- data/tilesets/board_debug_1_metatiles.bin | Bin 4096 -> 4096 bytes engine/board/movement.asm | 18 ++++++ engine/overworld/events.asm | 26 ++++++++ home/map.asm | 74 +++++++++++++++++++--- home/stone_queue.asm | 6 +- macros/scripts/maps.asm | 15 +++++ maps/DebugLevel1_Map1.asm | 2 + maps/DebugLevel2_Map1.asm | 2 + maps/DebugLevel3_Map1.asm | 2 + maps/DebugLevel4_Map1.asm | 2 + maps/DebugLevel5_Map1.asm | 6 +- maps/DebugLevel5_Map1.blk | 2 +- maps/DebugLevel5_Map1.blk.bak | 1 - maps/Level1_Map1.asm | 2 + ram/wram.asm | 13 +++- 17 files changed, 164 insertions(+), 18 deletions(-) delete mode 100755 maps/DebugLevel5_Map1.blk.bak diff --git a/constants/script_constants.asm b/constants/script_constants.asm index bb5f69ed6..227dd8b93 100644 --- a/constants/script_constants.asm +++ b/constants/script_constants.asm @@ -107,6 +107,7 @@ DEF NUM_PLAYER_MOVEMENTS EQU const_value DEF SCENE_SCRIPT_SIZE EQU 4 ; scene_script DEF CALLBACK_SIZE EQU 3 ; callback DEF WARP_EVENT_SIZE EQU 5 ; warp_event +DEF ANCHOR_EVENT_SIZE EQU 3 ; anchor_event DEF COORD_EVENT_SIZE EQU 8 ; coord_event DEF BG_EVENT_SIZE EQU 5 ; bg_event ; An object_event is a map_object without its initial MAPOBJECT_OBJECT_STRUCT_ID or final padding diff --git a/constants/space_constants.asm b/constants/space_constants.asm index fb110e9f2..6849ae7f2 100755 --- a/constants/space_constants.asm +++ b/constants/space_constants.asm @@ -3,6 +3,14 @@ DEF FIRST_SPACE_METATILE EQU $80 DEF FIRST_GREY_SPACE_METATILE EQU $e0 DEF UNIQUE_SPACE_METATILES_MASK EQU %11111 +; reserved next space values that signal movement towards anchor point rather than towards space + const_def -1, -1 + const GO_DOWN ; 255 + const GO_UP ; 254 + const GO_LEFT ; 253 + const GO_RIGHT ; 252 +DEF NEXT_SPACE_IS_ANCHOR_POINT EQU const_value + 1 + ; Branch Space special direction values DEF BRANCH_DIRECTION_INVALID EQU -1 -DEF BRANCH_DIRECTION_UNAVAILABLE EQU -2 \ No newline at end of file +DEF BRANCH_DIRECTION_UNAVAILABLE EQU -2 diff --git a/data/tilesets/board_debug_1_metatiles.bin b/data/tilesets/board_debug_1_metatiles.bin index e625f6a4fd9e5f8c9ab39a0e2b0f3a8d7f2e5211..cb6ea16b9d9cc8ea0243dc6b5ad4f181c88c2422 100755 GIT binary patch delta 89 zcmZorXi(VT#KGt1f8k3T)zbVw~*6yKfUOkXGWqFj