From: Lukas Krickl Date: Sat, 5 Jul 2025 02:37:16 +0000 (+0200) Subject: exits: Added exit table ptr to map definition X-Git-Url: https://git.krickl.dev/?a=commitdiff_plain;h=cbe501b3ad07297f814bea3b3fb8581f7bc398cd;p=gbrg%2F.git exits: Added exit table ptr to map definition --- diff --git a/maps/default_map.s b/maps/default_map.s index ba5a585..e086cb6 100644 --- a/maps/default_map.s +++ b/maps/default_map.s @@ -9,6 +9,7 @@ dw bank8000 dw bank8800 dw bank8C00 dw bank9000 +dw default_map_exit_table default_map_bg: @@ -28,6 +29,6 @@ default_map_bg: default_map_tile_flags: .db 0x27, 0x0, 0x4, 0x1, 0x48, 0x0, 0x4, 0x1 -.db 0x8, 0x0, 0x1, 0x2, 0xf, 0x0, 0x1, 0x3 +.db 0x8, 0x0, 0x1, 0x3, 0xf, 0x0, 0x1, 0x3 .db 0x70, 0x0 .db 0x00 ; termiante data diff --git a/src/exittables.s b/src/exittables.s new file mode 100644 index 0000000..d63117e --- /dev/null +++ b/src/exittables.s @@ -0,0 +1,3 @@ +default_map_exit_table: +exit_entry 0, 0, 0, 0, default_map_header +exit_entry 0, 0, 0, 0, default_map_header diff --git a/src/macros.inc b/src/macros.inc index 7a714d2..941dedc 100644 --- a/src/macros.inc +++ b/src/macros.inc @@ -282,7 +282,7 @@ ; $3: goto y ; $4: goto x ; $5: map header pointer -#macro map_exit_table_entry +#macro exit_entry .db $1 .db $2 .db $3 diff --git a/src/main.s b/src/main.s index d48f976..946003e 100644 --- a/src/main.s +++ b/src/main.s @@ -68,6 +68,7 @@ main: #include "text.s" #include "stats.s" #include "actortables.s" +#include "exittables.s" #include "demos.s" ; fill bank diff --git a/src/wram.s b/src/wram.s index 18b71bf..036e9b8 100644 --- a/src/wram.s +++ b/src/wram.s @@ -90,5 +90,7 @@ map_end: ; mape state machine map_st: .adv st_size + ; current exit table ptr +map_exit_table: .adv 2 state_end: diff --git a/tools/tms2map.py b/tools/tms2map.py index 30a075d..57c9eed 100755 --- a/tools/tms2map.py +++ b/tools/tms2map.py @@ -13,6 +13,7 @@ tile_bank0 = "bank8000" tile_bank1 = "bank8800" tile_bank2 = "bank8C00" tile_bank3 = "bank9000" +exit_table = "default_map_exit_table" actor_table_ptr = "map_actor_table_null" map_name = "noname" NAME_LEN = 8 @@ -107,6 +108,7 @@ def print_header(name): print("dw " + tile_bank1) print("dw " + tile_bank2) print("dw " + tile_bank3) + print("dw " + exit_table) print("") def get_flag(tile): @@ -131,6 +133,7 @@ def get_map_props(root): global tile_bank2 global tile_bank3 global map_name + global exit_table for child in root: if child.tag == "properties": @@ -151,6 +154,8 @@ def get_map_props(root): tile_bank3 = value elif name == 'map_name': map_name = value + elif name == 'exit_table': + exit_table = value return