shithub: pokered

Download patch

ref: 0ad1153f165023220c7c2e3bb187ccc5d6ca75bd
parent: 54c1893d579cdf6853c6a64953bae281a6075fe3
author: dannye <corrnondacqb@yahoo.com>
date: Sat Jul 18 11:20:07 EDT 2015

Simplify map connections
let the macros calculate the connection strip length instead of passing it as an arg
don't pass map dimensions since they can be inferred from map ids

todo: figure out why certain south and east connections get an extra 3
added to the connection strip length

--- a/data/mapHeaders/celadoncity.asm
+++ b/data/mapHeaders/celadoncity.asm
@@ -3,6 +3,6 @@
 	db CELADON_CITY_HEIGHT, CELADON_CITY_WIDTH ; dimensions (y, x)
 	dw CeladonCityBlocks, CeladonCityTextPointers, CeladonCityScript ; blocks, texts, scripts
 	db WEST | EAST ; connections
-	WEST_MAP_CONNECTION ROUTE_16, ROUTE_16_WIDTH, 4, 0, ROUTE_16_HEIGHT, Route16Blocks, CELADON_CITY_WIDTH
-	EAST_MAP_CONNECTION ROUTE_7, ROUTE_7_WIDTH, 4, 0, ROUTE_7_HEIGHT, Route7Blocks, CELADON_CITY_WIDTH
+	WEST_MAP_CONNECTION CELADON_CITY, ROUTE_16, 4, 0, Route16Blocks
+	EAST_MAP_CONNECTION CELADON_CITY, ROUTE_7, 4, 0, Route7Blocks, 1
 	dw CeladonCityObject ; objects
--- a/data/mapHeaders/ceruleancity.asm
+++ b/data/mapHeaders/ceruleancity.asm
@@ -3,8 +3,8 @@
 	db CERULEAN_CITY_HEIGHT, CERULEAN_CITY_WIDTH ; dimensions (y, x)
 	dw CeruleanCityBlocks, CeruleanCityTextPointers, CeruleanCityScript ; blocks, texts, scripts
 	db NORTH | SOUTH | WEST | EAST ; connections
-	NORTH_MAP_CONNECTION ROUTE_24, ROUTE_24_WIDTH, ROUTE_24_HEIGHT, 5, 0, ROUTE_24_WIDTH, Route24Blocks
-	SOUTH_MAP_CONNECTION ROUTE_5, ROUTE_5_WIDTH, 5, 0, ROUTE_5_WIDTH, Route5Blocks, CERULEAN_CITY_WIDTH, CERULEAN_CITY_HEIGHT
-	WEST_MAP_CONNECTION ROUTE_4, ROUTE_4_WIDTH, 4, 0, ROUTE_4_HEIGHT, Route4Blocks, CERULEAN_CITY_WIDTH
-	EAST_MAP_CONNECTION ROUTE_9, ROUTE_9_WIDTH, 4, 0, ROUTE_9_HEIGHT, Route9Blocks, CERULEAN_CITY_WIDTH
+	NORTH_MAP_CONNECTION CERULEAN_CITY, ROUTE_24, 5, 0, Route24Blocks
+	SOUTH_MAP_CONNECTION CERULEAN_CITY, ROUTE_5, 5, 0, Route5Blocks, 1
+	WEST_MAP_CONNECTION CERULEAN_CITY, ROUTE_4, 4, 0, Route4Blocks
+	EAST_MAP_CONNECTION CERULEAN_CITY, ROUTE_9, 4, 0, Route9Blocks
 	dw CeruleanCityObject ; objects
--- a/data/mapHeaders/cinnabarisland.asm
+++ b/data/mapHeaders/cinnabarisland.asm
@@ -3,6 +3,6 @@
 	db CINNABAR_ISLAND_HEIGHT, CINNABAR_ISLAND_WIDTH ; dimensions (y, x)
 	dw CinnabarIslandBlocks, CinnabarIslandTextPointers, CinnabarIslandScript ; blocks, texts, scripts
 	db NORTH | EAST ; connections
-	NORTH_MAP_CONNECTION ROUTE_21, ROUTE_21_WIDTH, ROUTE_21_HEIGHT, 0, 0, ROUTE_21_WIDTH, Route21Blocks
-	EAST_MAP_CONNECTION ROUTE_20, ROUTE_20_WIDTH, 0, 0, ROUTE_20_HEIGHT, Route20Blocks, CINNABAR_ISLAND_WIDTH
+	NORTH_MAP_CONNECTION CINNABAR_ISLAND, ROUTE_21, 0, 0, Route21Blocks
+	EAST_MAP_CONNECTION CINNABAR_ISLAND, ROUTE_20, 0, 0, Route20Blocks
 	dw CinnabarIslandObject ; objects
--- a/data/mapHeaders/fuchsiacity.asm
+++ b/data/mapHeaders/fuchsiacity.asm
@@ -3,7 +3,7 @@
 	db FUCHSIA_CITY_HEIGHT, FUCHSIA_CITY_WIDTH ; dimensions (y, x)
 	dw FuchsiaCityBlocks, FuchsiaCityTextPointers, FuchsiaCityScript ; blocks, texts, scripts
 	db SOUTH | WEST | EAST ; connections
-	SOUTH_MAP_CONNECTION ROUTE_19, ROUTE_19_WIDTH, 5, 0, ROUTE_19_WIDTH, Route19Blocks, FUCHSIA_CITY_WIDTH, FUCHSIA_CITY_HEIGHT
-	WEST_MAP_CONNECTION ROUTE_18, ROUTE_18_WIDTH, 4, 0, ROUTE_18_HEIGHT, Route18Blocks, FUCHSIA_CITY_WIDTH
-	EAST_MAP_CONNECTION ROUTE_15, ROUTE_15_WIDTH, 4, 0, ROUTE_15_HEIGHT, Route15Blocks, FUCHSIA_CITY_WIDTH
+	SOUTH_MAP_CONNECTION FUCHSIA_CITY, ROUTE_19, 5, 0, Route19Blocks
+	WEST_MAP_CONNECTION FUCHSIA_CITY, ROUTE_18, 4, 0, Route18Blocks
+	EAST_MAP_CONNECTION FUCHSIA_CITY, ROUTE_15, 4, 0, Route15Blocks
 	dw FuchsiaCityObject ; objects
--- a/data/mapHeaders/indigoplateau.asm
+++ b/data/mapHeaders/indigoplateau.asm
@@ -3,5 +3,5 @@
 	db INDIGO_PLATEAU_HEIGHT, INDIGO_PLATEAU_WIDTH ; dimensions (y, x)
 	dw IndigoPlateauBlocks, IndigoPlateauTextPointers, IndigoPlateauScript ; blocks, texts, scripts
 	db SOUTH ; connections
-	SOUTH_MAP_CONNECTION ROUTE_23, ROUTE_23_WIDTH, 0, 0, ROUTE_23_WIDTH, Route23Blocks, INDIGO_PLATEAU_WIDTH, INDIGO_PLATEAU_HEIGHT
+	SOUTH_MAP_CONNECTION INDIGO_PLATEAU, ROUTE_23, 0, 0, Route23Blocks
 	dw IndigoPlateauObject ; objects
--- a/data/mapHeaders/lavendertown.asm
+++ b/data/mapHeaders/lavendertown.asm
@@ -3,7 +3,7 @@
 	db LAVENDER_TOWN_HEIGHT, LAVENDER_TOWN_WIDTH ; dimensions (y, x)
 	dw LavenderTownBlocks, LavenderTownTextPointers, LavenderTownScript ; blocks, texts, scripts
 	db NORTH | SOUTH | WEST ; connections
-	NORTH_MAP_CONNECTION ROUTE_10, ROUTE_10_WIDTH, ROUTE_10_HEIGHT, 0, 0, ROUTE_10_WIDTH, Route10Blocks
-	SOUTH_MAP_CONNECTION ROUTE_12, ROUTE_12_WIDTH, 0, 0, ROUTE_12_WIDTH, Route12Blocks, LAVENDER_TOWN_WIDTH, LAVENDER_TOWN_HEIGHT
-	WEST_MAP_CONNECTION ROUTE_8, ROUTE_8_WIDTH, 0, 0, ROUTE_8_HEIGHT, Route8Blocks, LAVENDER_TOWN_WIDTH
+	NORTH_MAP_CONNECTION LAVENDER_TOWN, ROUTE_10, 0, 0, Route10Blocks
+	SOUTH_MAP_CONNECTION LAVENDER_TOWN, ROUTE_12, 0, 0, Route12Blocks, 1
+	WEST_MAP_CONNECTION LAVENDER_TOWN, ROUTE_8, 0, 0, Route8Blocks
 	dw LavenderTownObject ; objects
--- a/data/mapHeaders/pallettown.asm
+++ b/data/mapHeaders/pallettown.asm
@@ -3,6 +3,6 @@
 	db PALLET_TOWN_HEIGHT, PALLET_TOWN_WIDTH ; dimensions
 	dw PalletTownBlocks, PalletTownTextPointers, PalletTownScript
 	db NORTH | SOUTH ; connections
-	NORTH_MAP_CONNECTION ROUTE_1, ROUTE_1_WIDTH, ROUTE_1_HEIGHT, 0, 0, ROUTE_1_WIDTH, Route1Blocks
-	SOUTH_MAP_CONNECTION ROUTE_21, ROUTE_21_WIDTH, 0, 0, ROUTE_21_WIDTH, Route21Blocks, PALLET_TOWN_WIDTH, PALLET_TOWN_HEIGHT
+	NORTH_MAP_CONNECTION PALLET_TOWN, ROUTE_1, 0, 0, Route1Blocks
+	SOUTH_MAP_CONNECTION PALLET_TOWN, ROUTE_21, 0, 0, Route21Blocks, 1
 	dw PalletTownObject
--- a/data/mapHeaders/pewtercity.asm
+++ b/data/mapHeaders/pewtercity.asm
@@ -3,8 +3,8 @@
 	db PEWTER_CITY_HEIGHT, PEWTER_CITY_WIDTH ; dimensions (y, x)
 	dw PewterCityBlocks, PewterCityTextPointers, PewterCityScript ; blocks, texts, scripts
 	db SOUTH | EAST ; connections
-	SOUTH_MAP_CONNECTION ROUTE_2, ROUTE_2_WIDTH, 5, 0, ROUTE_2_WIDTH, Route2Blocks, PEWTER_CITY_WIDTH, PEWTER_CITY_HEIGHT
-	EAST_MAP_CONNECTION ROUTE_3, ROUTE_3_WIDTH, 4, 0, ROUTE_3_HEIGHT, Route3Blocks, PEWTER_CITY_WIDTH
+	SOUTH_MAP_CONNECTION PEWTER_CITY, ROUTE_2, 5, 0, Route2Blocks
+	EAST_MAP_CONNECTION PEWTER_CITY, ROUTE_3, 4, 0, Route3Blocks
 	dw PewterCityObject ; objects
 
 	db $0
--- a/data/mapHeaders/route1.asm
+++ b/data/mapHeaders/route1.asm
@@ -3,6 +3,6 @@
 	db ROUTE_1_HEIGHT, ROUTE_1_WIDTH ; dimensions (y, x)
 	dw Route1Blocks, Route1TextPointers, Route1Script ; blocks, texts, scripts
 	db NORTH | SOUTH ; connections
-	NORTH_MAP_CONNECTION VIRIDIAN_CITY, VIRIDIAN_CITY_WIDTH, VIRIDIAN_CITY_HEIGHT, -3, 2, ROUTE_1_WIDTH + 6, ViridianCityBlocks
-	SOUTH_MAP_CONNECTION PALLET_TOWN, PALLET_TOWN_WIDTH, 0, 0, PALLET_TOWN_WIDTH, PalletTownBlocks, ROUTE_1_WIDTH, ROUTE_1_HEIGHT
+	NORTH_MAP_CONNECTION ROUTE_1, VIRIDIAN_CITY, -3, 2, ViridianCityBlocks
+	SOUTH_MAP_CONNECTION ROUTE_1, PALLET_TOWN, 0, 0, PalletTownBlocks, 1
 	dw Route1Object ; objects
--- a/data/mapHeaders/route10.asm
+++ b/data/mapHeaders/route10.asm
@@ -3,6 +3,6 @@
 	db ROUTE_10_HEIGHT, ROUTE_10_WIDTH ; dimensions (y, x)
 	dw Route10Blocks, Route10TextPointers, Route10Script ; blocks, texts, scripts
 	db SOUTH | WEST ; connections
-	SOUTH_MAP_CONNECTION LAVENDER_TOWN, LAVENDER_TOWN_WIDTH, 0, 0, LAVENDER_TOWN_WIDTH, LavenderTownBlocks, ROUTE_10_WIDTH, ROUTE_10_HEIGHT
-	WEST_MAP_CONNECTION ROUTE_9, ROUTE_9_WIDTH, 0, 0, ROUTE_9_HEIGHT, Route9Blocks, ROUTE_10_WIDTH
+	SOUTH_MAP_CONNECTION ROUTE_10, LAVENDER_TOWN, 0, 0, LavenderTownBlocks
+	WEST_MAP_CONNECTION ROUTE_10, ROUTE_9, 0, 0, Route9Blocks
 	dw Route10Object ; objects
--- a/data/mapHeaders/route11.asm
+++ b/data/mapHeaders/route11.asm
@@ -3,6 +3,6 @@
 	db ROUTE_11_HEIGHT, ROUTE_11_WIDTH ; dimensions (y, x)
 	dw Route11Blocks, Route11TextPointers, Route11Script ; blocks, texts, scripts
 	db WEST | EAST ; connections
-	WEST_MAP_CONNECTION VERMILION_CITY, VERMILION_CITY_WIDTH, -3, 1, ROUTE_11_HEIGHT + 6, VermilionCityBlocks, ROUTE_11_WIDTH
-	EAST_MAP_CONNECTION ROUTE_12, ROUTE_12_WIDTH, -3, 24, ROUTE_11_HEIGHT + 6, Route12Blocks, ROUTE_11_WIDTH
+	WEST_MAP_CONNECTION ROUTE_11, VERMILION_CITY, -3, 1, VermilionCityBlocks
+	EAST_MAP_CONNECTION ROUTE_11, ROUTE_12, -3, 24, Route12Blocks, 1
 	dw Route11Object ; objects
--- a/data/mapHeaders/route12.asm
+++ b/data/mapHeaders/route12.asm
@@ -3,7 +3,7 @@
 	db ROUTE_12_HEIGHT, ROUTE_12_WIDTH ; dimensions (y, x)
 	dw Route12Blocks, Route12TextPointers, Route12Script ; blocks, texts, scripts
 	db NORTH | SOUTH | WEST ; connections
-	NORTH_MAP_CONNECTION LAVENDER_TOWN, LAVENDER_TOWN_WIDTH, LAVENDER_TOWN_HEIGHT, 0, 0, LAVENDER_TOWN_WIDTH, LavenderTownBlocks
-	SOUTH_MAP_CONNECTION ROUTE_13, ROUTE_13_WIDTH, -3, 17, ROUTE_12_WIDTH + 3, Route13Blocks, ROUTE_12_WIDTH, ROUTE_12_HEIGHT
-	WEST_MAP_CONNECTION ROUTE_11, ROUTE_11_WIDTH, 27, 0, ROUTE_11_HEIGHT, Route11Blocks, ROUTE_12_WIDTH
+	NORTH_MAP_CONNECTION ROUTE_12, LAVENDER_TOWN, 0, 0, LavenderTownBlocks
+	SOUTH_MAP_CONNECTION ROUTE_12, ROUTE_13, -3, 17, Route13Blocks
+	WEST_MAP_CONNECTION ROUTE_12, ROUTE_11, 27, 0, Route11Blocks
 	dw Route12Object ; objects
--- a/data/mapHeaders/route13.asm
+++ b/data/mapHeaders/route13.asm
@@ -3,6 +3,6 @@
 	db ROUTE_13_HEIGHT, ROUTE_13_WIDTH ; dimensions (y, x)
 	dw Route13Blocks, Route13TextPointers, Route13Script ; blocks, texts, scripts
 	db NORTH | WEST ; connections
-	NORTH_MAP_CONNECTION ROUTE_12, ROUTE_12_WIDTH, ROUTE_12_HEIGHT, 20, 0, ROUTE_12_WIDTH, Route12Blocks
-	WEST_MAP_CONNECTION ROUTE_14, ROUTE_14_WIDTH, 0, 0, ROUTE_13_HEIGHT + 3, Route14Blocks, ROUTE_13_WIDTH
+	NORTH_MAP_CONNECTION ROUTE_13, ROUTE_12, 20, 0, Route12Blocks
+	WEST_MAP_CONNECTION ROUTE_13, ROUTE_14, 0, 0, Route14Blocks
 	dw Route13Object ; objects
--- a/data/mapHeaders/route14.asm
+++ b/data/mapHeaders/route14.asm
@@ -3,6 +3,6 @@
 	db ROUTE_14_HEIGHT, ROUTE_14_WIDTH ; dimensions (y, x)
 	dw Route14Blocks, Route14TextPointers, Route14Script ; blocks, texts, scripts
 	db WEST | EAST ; connections
-	WEST_MAP_CONNECTION ROUTE_15, ROUTE_15_WIDTH, 18, 0, ROUTE_15_HEIGHT, Route15Blocks, ROUTE_14_WIDTH
-	EAST_MAP_CONNECTION ROUTE_13, ROUTE_13_WIDTH, 0, 0, ROUTE_13_HEIGHT, Route13Blocks, ROUTE_14_WIDTH
+	WEST_MAP_CONNECTION ROUTE_14, ROUTE_15, 18, 0, Route15Blocks
+	EAST_MAP_CONNECTION ROUTE_14, ROUTE_13, 0, 0, Route13Blocks
 	dw Route14Object ; objects
--- a/data/mapHeaders/route15.asm
+++ b/data/mapHeaders/route15.asm
@@ -3,6 +3,6 @@
 	db ROUTE_15_HEIGHT, ROUTE_15_WIDTH ; dimensions (y, x)
 	dw Route15Blocks, Route15TextPointers, Route15Script ; blocks, texts, scripts
 	db WEST | EAST ; connections
-	WEST_MAP_CONNECTION FUCHSIA_CITY, FUCHSIA_CITY_WIDTH, -3, 1, ROUTE_15_HEIGHT + 6, FuchsiaCityBlocks, ROUTE_15_WIDTH
-	EAST_MAP_CONNECTION ROUTE_14, ROUTE_14_WIDTH, -3, 15, ROUTE_15_HEIGHT + 3, Route14Blocks, ROUTE_15_WIDTH
+	WEST_MAP_CONNECTION ROUTE_15, FUCHSIA_CITY, -3, 1, FuchsiaCityBlocks
+	EAST_MAP_CONNECTION ROUTE_15, ROUTE_14, -3, 15, Route14Blocks
 	dw Route15Object ; objects
--- a/data/mapHeaders/route16.asm
+++ b/data/mapHeaders/route16.asm
@@ -3,6 +3,6 @@
 	db ROUTE_16_HEIGHT, ROUTE_16_WIDTH ; dimensions (y, x)
 	dw Route16Blocks, Route16TextPointers, Route16Script ; blocks, texts, scripts
 	db SOUTH | EAST ; connections
-	SOUTH_MAP_CONNECTION ROUTE_17, ROUTE_17_WIDTH, 0, 0, ROUTE_17_WIDTH, Route17Blocks, ROUTE_16_WIDTH, ROUTE_16_HEIGHT
-	EAST_MAP_CONNECTION CELADON_CITY, CELADON_CITY_WIDTH, -3, 1, ROUTE_16_HEIGHT + 6, CeladonCityBlocks, ROUTE_16_WIDTH
+	SOUTH_MAP_CONNECTION ROUTE_16, ROUTE_17, 0, 0, Route17Blocks
+	EAST_MAP_CONNECTION ROUTE_16, CELADON_CITY, -3, 1, CeladonCityBlocks, 1
 	dw Route16Object ; objects
--- a/data/mapHeaders/route17.asm
+++ b/data/mapHeaders/route17.asm
@@ -3,6 +3,6 @@
 	db ROUTE_17_HEIGHT, ROUTE_17_WIDTH ; dimensions (y, x)
 	dw Route17Blocks, Route17TextPointers, Route17Script ; blocks, texts, scripts
 	db NORTH | SOUTH ; connections
-	NORTH_MAP_CONNECTION ROUTE_16, ROUTE_16_WIDTH, ROUTE_16_HEIGHT, 0, 0, ROUTE_17_WIDTH + 3, Route16Blocks
-	SOUTH_MAP_CONNECTION ROUTE_18, ROUTE_18_WIDTH, 0, 0, ROUTE_17_WIDTH + 3, Route18Blocks, ROUTE_17_WIDTH, ROUTE_17_HEIGHT
+	NORTH_MAP_CONNECTION ROUTE_17, ROUTE_16, 0, 0, Route16Blocks
+	SOUTH_MAP_CONNECTION ROUTE_17, ROUTE_18, 0, 0, Route18Blocks, 1
 	dw Route17Object ; objects
--- a/data/mapHeaders/route18.asm
+++ b/data/mapHeaders/route18.asm
@@ -3,6 +3,6 @@
 	db ROUTE_18_HEIGHT, ROUTE_18_WIDTH ; dimensions (y, x)
 	dw Route18Blocks, Route18TextPointers, Route18Script ; blocks, texts, scripts
 	db NORTH | EAST ; connections
-	NORTH_MAP_CONNECTION ROUTE_17, ROUTE_17_WIDTH, ROUTE_17_HEIGHT, 0, 0, ROUTE_17_WIDTH, Route17Blocks
-	EAST_MAP_CONNECTION FUCHSIA_CITY, FUCHSIA_CITY_WIDTH, -3, 1, ROUTE_18_HEIGHT + 6, FuchsiaCityBlocks, ROUTE_18_WIDTH
+	NORTH_MAP_CONNECTION ROUTE_18, ROUTE_17, 0, 0, Route17Blocks
+	EAST_MAP_CONNECTION ROUTE_18, FUCHSIA_CITY, -3, 1, FuchsiaCityBlocks, 1
 	dw Route18Object ; objects
--- a/data/mapHeaders/route19.asm
+++ b/data/mapHeaders/route19.asm
@@ -3,6 +3,6 @@
 	db ROUTE_19_HEIGHT, ROUTE_19_WIDTH ; dimensions (y, x)
 	dw Route19Blocks, Route19TextPointers, Route19Script ; blocks, texts, scripts
 	db NORTH | WEST ; connections
-	NORTH_MAP_CONNECTION FUCHSIA_CITY, FUCHSIA_CITY_WIDTH, FUCHSIA_CITY_HEIGHT, -3, 2, ROUTE_19_WIDTH + 6, FuchsiaCityBlocks
-	WEST_MAP_CONNECTION ROUTE_20, ROUTE_20_WIDTH, 18, 0, ROUTE_20_HEIGHT, Route20Blocks, ROUTE_19_WIDTH
+	NORTH_MAP_CONNECTION ROUTE_19, FUCHSIA_CITY, -3, 2, FuchsiaCityBlocks
+	WEST_MAP_CONNECTION ROUTE_19, ROUTE_20, 18, 0, Route20Blocks
 	dw Route19Object ; objects
--- a/data/mapHeaders/route2.asm
+++ b/data/mapHeaders/route2.asm
@@ -3,6 +3,6 @@
 	db ROUTE_2_HEIGHT,ROUTE_2_WIDTH ;Height,Width blocks (1 block = 4x4 tiles)
 	dw Route2Blocks, Route2TextPointers, Route2Script
 	db NORTH | SOUTH ;Connection Byte
-	NORTH_MAP_CONNECTION PEWTER_CITY, PEWTER_CITY_WIDTH, PEWTER_CITY_HEIGHT, -3, 2, ROUTE_2_WIDTH + 6, PewterCityBlocks
-	SOUTH_MAP_CONNECTION VIRIDIAN_CITY, VIRIDIAN_CITY_WIDTH, -3, 2, ROUTE_2_WIDTH + 6, ViridianCityBlocks, ROUTE_2_WIDTH, ROUTE_2_HEIGHT
+	NORTH_MAP_CONNECTION ROUTE_2, PEWTER_CITY, -3, 2, PewterCityBlocks
+	SOUTH_MAP_CONNECTION ROUTE_2, VIRIDIAN_CITY, -3, 2, ViridianCityBlocks, 1
 	dw Route2Object ;Object Data Pointer
--- a/data/mapHeaders/route20.asm
+++ b/data/mapHeaders/route20.asm
@@ -3,6 +3,6 @@
 	db ROUTE_20_HEIGHT, ROUTE_20_WIDTH ; dimensions (y, x)
 	dw Route20Blocks, Route20TextPointers, Route20Script ; blocks, texts, scripts
 	db WEST | EAST ; connections
-	WEST_MAP_CONNECTION CINNABAR_ISLAND, CINNABAR_ISLAND_WIDTH, 0, 0, CINNABAR_ISLAND_HEIGHT, CinnabarIslandBlocks, ROUTE_20_WIDTH
-	EAST_MAP_CONNECTION ROUTE_19, ROUTE_19_WIDTH, -3, 15, ROUTE_20_HEIGHT + 3, Route19Blocks, ROUTE_20_WIDTH
+	WEST_MAP_CONNECTION ROUTE_20, CINNABAR_ISLAND, 0, 0, CinnabarIslandBlocks
+	EAST_MAP_CONNECTION ROUTE_20, ROUTE_19, -3, 15, Route19Blocks
 	dw Route20Object ; objects
--- a/data/mapHeaders/route21.asm
+++ b/data/mapHeaders/route21.asm
@@ -3,6 +3,6 @@
 	db ROUTE_21_HEIGHT, ROUTE_21_WIDTH ; dimensions (y, x)
 	dw Route21Blocks, Route21TextPointers, Route21Script ; blocks, texts, scripts
 	db NORTH | SOUTH ; connections
-	NORTH_MAP_CONNECTION PALLET_TOWN, PALLET_TOWN_WIDTH, PALLET_TOWN_HEIGHT, 0, 0, PALLET_TOWN_WIDTH, PalletTownBlocks
-	SOUTH_MAP_CONNECTION CINNABAR_ISLAND, CINNABAR_ISLAND_WIDTH, 0, 0, CINNABAR_ISLAND_WIDTH, CinnabarIslandBlocks, ROUTE_21_WIDTH, ROUTE_21_HEIGHT
+	NORTH_MAP_CONNECTION ROUTE_21, PALLET_TOWN, 0, 0, PalletTownBlocks
+	SOUTH_MAP_CONNECTION ROUTE_21, CINNABAR_ISLAND, 0, 0, CinnabarIslandBlocks, 1
 	dw Route21Object ; objects
--- a/data/mapHeaders/route22.asm
+++ b/data/mapHeaders/route22.asm
@@ -3,6 +3,6 @@
 	db ROUTE_22_HEIGHT, ROUTE_22_WIDTH ; dimensions (y, x)
 	dw Route22Blocks, Route22TextPointers, Route22Script ; blocks, texts, scripts
 	db NORTH | EAST ; connections
-	NORTH_MAP_CONNECTION ROUTE_23, ROUTE_23_WIDTH, ROUTE_23_HEIGHT, 0, 0, ROUTE_23_WIDTH, Route23Blocks
-	EAST_MAP_CONNECTION VIRIDIAN_CITY, VIRIDIAN_CITY_WIDTH, -3, 1, ROUTE_22_HEIGHT + 6, ViridianCityBlocks, ROUTE_22_WIDTH
+	NORTH_MAP_CONNECTION ROUTE_22, ROUTE_23, 0, 0, Route23Blocks
+	EAST_MAP_CONNECTION ROUTE_22, VIRIDIAN_CITY, -3, 1, ViridianCityBlocks, 1
 	dw Route22Object ; objects
--- a/data/mapHeaders/route23.asm
+++ b/data/mapHeaders/route23.asm
@@ -3,6 +3,6 @@
 	db ROUTE_23_HEIGHT, ROUTE_23_WIDTH ; dimensions (y, x)
 	dw Route23Blocks, Route23TextPointers, Route23Script ; blocks, texts, scripts
 	db NORTH | SOUTH ; connections
-	NORTH_MAP_CONNECTION INDIGO_PLATEAU, INDIGO_PLATEAU_WIDTH, INDIGO_PLATEAU_HEIGHT, 0, 0, INDIGO_PLATEAU_WIDTH, IndigoPlateauBlocks
-	SOUTH_MAP_CONNECTION ROUTE_22, ROUTE_22_WIDTH, 0, 0, ROUTE_23_WIDTH + 3, Route22Blocks, ROUTE_23_WIDTH, ROUTE_23_HEIGHT
+	NORTH_MAP_CONNECTION ROUTE_23, INDIGO_PLATEAU, 0, 0, IndigoPlateauBlocks
+	SOUTH_MAP_CONNECTION ROUTE_23, ROUTE_22, 0, 0, Route22Blocks, 1
 	dw Route23Object ; objects
--- a/data/mapHeaders/route24.asm
+++ b/data/mapHeaders/route24.asm
@@ -3,6 +3,6 @@
 	db ROUTE_24_HEIGHT, ROUTE_24_WIDTH ; dimensions (y, x)
 	dw Route24Blocks, Route24TextPointers, Route24Script ; blocks, texts, scripts
 	db SOUTH | EAST ; connections
-	SOUTH_MAP_CONNECTION CERULEAN_CITY, CERULEAN_CITY_WIDTH, -3, 2, ROUTE_24_WIDTH + 6, CeruleanCityBlocks, ROUTE_24_WIDTH, ROUTE_24_HEIGHT
-	EAST_MAP_CONNECTION ROUTE_25, ROUTE_25_WIDTH, 0, 0, ROUTE_25_HEIGHT, Route25Blocks, ROUTE_24_WIDTH
+	SOUTH_MAP_CONNECTION ROUTE_24, CERULEAN_CITY, -3, 2, CeruleanCityBlocks, 1
+	EAST_MAP_CONNECTION ROUTE_24, ROUTE_25, 0, 0, Route25Blocks
 	dw Route24Object ; objects
--- a/data/mapHeaders/route25.asm
+++ b/data/mapHeaders/route25.asm
@@ -3,5 +3,5 @@
 	db ROUTE_25_HEIGHT, ROUTE_25_WIDTH ; dimensions (y, x)
 	dw Route25Blocks, Route25TextPointers, Route25Script ; blocks, texts, scripts
 	db WEST ; connections
-	WEST_MAP_CONNECTION ROUTE_24, ROUTE_24_WIDTH, 0, 0, ROUTE_25_HEIGHT + 3, Route24Blocks, ROUTE_25_WIDTH
+	WEST_MAP_CONNECTION ROUTE_25, ROUTE_24, 0, 0, Route24Blocks
 	dw Route25Object ; objects
--- a/data/mapHeaders/route3.asm
+++ b/data/mapHeaders/route3.asm
@@ -3,6 +3,6 @@
 	db ROUTE_3_HEIGHT, ROUTE_3_WIDTH ; dimensions (y, x)
 	dw Route3Blocks, Route3TextPointers, Route3Script ; blocks, texts, scripts
 	db NORTH | WEST ; connections
-	NORTH_MAP_CONNECTION ROUTE_4, ROUTE_4_WIDTH, ROUTE_4_HEIGHT, 25, 0, ROUTE_3_WIDTH - 25 + 3, Route4Blocks
-	WEST_MAP_CONNECTION PEWTER_CITY, PEWTER_CITY_WIDTH, -3, 1, ROUTE_3_HEIGHT + 6, PewterCityBlocks, ROUTE_3_WIDTH
+	NORTH_MAP_CONNECTION ROUTE_3, ROUTE_4, 25, 0, Route4Blocks
+	WEST_MAP_CONNECTION ROUTE_3, PEWTER_CITY, -3, 1, PewterCityBlocks
 	dw Route3Object ; objects
--- a/data/mapHeaders/route4.asm
+++ b/data/mapHeaders/route4.asm
@@ -3,6 +3,6 @@
 	db ROUTE_4_HEIGHT, ROUTE_4_WIDTH ; dimensions (y, x)
 	dw Route4Blocks, Route4TextPointers, Route4Script; blocks, texts, scripts
 	db SOUTH | EAST ; connections
-	SOUTH_MAP_CONNECTION ROUTE_3, ROUTE_3_WIDTH, -3, 22, ROUTE_3_WIDTH - 22, Route3Blocks, ROUTE_4_WIDTH, ROUTE_4_HEIGHT
-	EAST_MAP_CONNECTION CERULEAN_CITY, CERULEAN_CITY_WIDTH, -3, 1, ROUTE_4_HEIGHT + 6, CeruleanCityBlocks, ROUTE_4_WIDTH
+	SOUTH_MAP_CONNECTION ROUTE_4, ROUTE_3, -3, 22, Route3Blocks
+	EAST_MAP_CONNECTION ROUTE_4, CERULEAN_CITY, -3, 1, CeruleanCityBlocks, 1
 	dw Route4Object ; objects
--- a/data/mapHeaders/route5.asm
+++ b/data/mapHeaders/route5.asm
@@ -3,6 +3,6 @@
 	db ROUTE_5_HEIGHT, ROUTE_5_WIDTH ; dimensions (y, x)
 	dw Route5Blocks, Route5TextPointers, Route5Script ; blocks, texts, scripts
 	db NORTH | SOUTH ; connections
-	NORTH_MAP_CONNECTION CERULEAN_CITY, CERULEAN_CITY_WIDTH, CERULEAN_CITY_HEIGHT, -3, 2, ROUTE_5_WIDTH + 6, CeruleanCityBlocks
-	SOUTH_MAP_CONNECTION SAFFRON_CITY, SAFFRON_CITY_WIDTH, -3, 2, ROUTE_5_WIDTH + 6, SaffronCityBlocks, ROUTE_5_WIDTH, ROUTE_5_HEIGHT
+	NORTH_MAP_CONNECTION ROUTE_5, CERULEAN_CITY, -3, 2, CeruleanCityBlocks
+	SOUTH_MAP_CONNECTION ROUTE_5, SAFFRON_CITY, -3, 2, SaffronCityBlocks, 1
 	dw Route5Object ; objects
--- a/data/mapHeaders/route6.asm
+++ b/data/mapHeaders/route6.asm
@@ -3,6 +3,6 @@
 	db ROUTE_6_HEIGHT, ROUTE_6_WIDTH ; dimensions (y, x)
 	dw Route6Blocks, Route6TextPointers, Route6Script ; blocks, texts, scripts
 	db NORTH | SOUTH ; connections
-	NORTH_MAP_CONNECTION SAFFRON_CITY, SAFFRON_CITY_WIDTH, SAFFRON_CITY_HEIGHT, -3, 2, ROUTE_6_WIDTH + 6, SaffronCityBlocks
-	SOUTH_MAP_CONNECTION VERMILION_CITY, VERMILION_CITY_WIDTH, -3, 2, ROUTE_6_WIDTH + 6, VermilionCityBlocks, ROUTE_6_WIDTH, ROUTE_6_HEIGHT
+	NORTH_MAP_CONNECTION ROUTE_6, SAFFRON_CITY, -3, 2, SaffronCityBlocks
+	SOUTH_MAP_CONNECTION ROUTE_6, VERMILION_CITY, -3, 2, VermilionCityBlocks, 1
 	dw Route6Object ; objects
--- a/data/mapHeaders/route7.asm
+++ b/data/mapHeaders/route7.asm
@@ -3,6 +3,6 @@
 	db ROUTE_7_HEIGHT, ROUTE_7_WIDTH ; dimensions (y, x)
 	dw Route7Blocks, Route7TextPointers, Route7Script ; blocks, texts, scripts
 	db WEST | EAST ; connections
-	WEST_MAP_CONNECTION CELADON_CITY, CELADON_CITY_WIDTH, -3, 1, ROUTE_7_HEIGHT + 6, CeladonCityBlocks, ROUTE_7_WIDTH
-	EAST_MAP_CONNECTION SAFFRON_CITY, SAFFRON_CITY_WIDTH, -3, 1, ROUTE_7_HEIGHT + 6, SaffronCityBlocks, ROUTE_7_WIDTH
+	WEST_MAP_CONNECTION ROUTE_7, CELADON_CITY, -3, 1, CeladonCityBlocks
+	EAST_MAP_CONNECTION ROUTE_7, SAFFRON_CITY, -3, 1, SaffronCityBlocks, 1
 	dw Route7Object ; objects
--- a/data/mapHeaders/route8.asm
+++ b/data/mapHeaders/route8.asm
@@ -3,6 +3,6 @@
 	db ROUTE_8_HEIGHT, ROUTE_8_WIDTH ; dimensions (y, x)
 	dw Route8Blocks, Route8TextPointers, Route8Script ; blocks, texts, scripts
 	db WEST | EAST ; connections
-	WEST_MAP_CONNECTION SAFFRON_CITY, SAFFRON_CITY_WIDTH, -3, 1, ROUTE_8_HEIGHT + 6, SaffronCityBlocks, ROUTE_8_WIDTH
-	EAST_MAP_CONNECTION LAVENDER_TOWN, LAVENDER_TOWN_WIDTH, 0, 0, LAVENDER_TOWN_HEIGHT, LavenderTownBlocks, ROUTE_8_WIDTH
+	WEST_MAP_CONNECTION ROUTE_8, SAFFRON_CITY, -3, 1, SaffronCityBlocks
+	EAST_MAP_CONNECTION ROUTE_8, LAVENDER_TOWN, 0, 0, LavenderTownBlocks
 	dw Route8Object ; objects
--- a/data/mapHeaders/route9.asm
+++ b/data/mapHeaders/route9.asm
@@ -3,6 +3,6 @@
 	db ROUTE_9_HEIGHT, ROUTE_9_WIDTH ; dimensions (y, x)
 	dw Route9Blocks, Route9TextPointers, Route9Script ; blocks, texts, scripts
 	db WEST | EAST ; connections
-	WEST_MAP_CONNECTION CERULEAN_CITY, CERULEAN_CITY_WIDTH, -3, 1, ROUTE_9_HEIGHT + 6, CeruleanCityBlocks, ROUTE_9_WIDTH
-	EAST_MAP_CONNECTION ROUTE_10, ROUTE_10_WIDTH, 0, 0, ROUTE_9_HEIGHT + 3, Route10Blocks, ROUTE_9_WIDTH
+	WEST_MAP_CONNECTION ROUTE_9, CERULEAN_CITY, -3, 1, CeruleanCityBlocks
+	EAST_MAP_CONNECTION ROUTE_9, ROUTE_10, 0, 0, Route10Blocks, 1
 	dw Route9Object ; objects
--- a/data/mapHeaders/saffroncity.asm
+++ b/data/mapHeaders/saffroncity.asm
@@ -3,8 +3,8 @@
 	db SAFFRON_CITY_HEIGHT, SAFFRON_CITY_WIDTH ; dimensions (y, x)
 	dw SaffronCityBlocks, SaffronCityTextPointers, SaffronCityScript ; blocks, texts, scripts
 	db NORTH | SOUTH | WEST | EAST ; connections
-	NORTH_MAP_CONNECTION ROUTE_5, ROUTE_5_WIDTH, ROUTE_5_HEIGHT, 5, 0, ROUTE_5_WIDTH, Route5Blocks
-	SOUTH_MAP_CONNECTION ROUTE_6, ROUTE_6_WIDTH, 5, 0, ROUTE_6_WIDTH, Route6Blocks, SAFFRON_CITY_WIDTH, SAFFRON_CITY_HEIGHT
-	WEST_MAP_CONNECTION ROUTE_7, ROUTE_7_WIDTH, 4, 0, ROUTE_7_HEIGHT, Route7Blocks, SAFFRON_CITY_WIDTH
-	EAST_MAP_CONNECTION ROUTE_8, ROUTE_8_WIDTH, 4, 0, ROUTE_8_HEIGHT, Route8Blocks, SAFFRON_CITY_WIDTH
+	NORTH_MAP_CONNECTION SAFFRON_CITY, ROUTE_5, 5, 0, Route5Blocks
+	SOUTH_MAP_CONNECTION SAFFRON_CITY, ROUTE_6, 5, 0, Route6Blocks, 1
+	WEST_MAP_CONNECTION SAFFRON_CITY, ROUTE_7, 4, 0, Route7Blocks
+	EAST_MAP_CONNECTION SAFFRON_CITY, ROUTE_8, 4, 0, Route8Blocks
 	dw SaffronCityObject ; objects
--- a/data/mapHeaders/vermilioncity.asm
+++ b/data/mapHeaders/vermilioncity.asm
@@ -3,6 +3,6 @@
 	db VERMILION_CITY_HEIGHT, VERMILION_CITY_WIDTH ; dimensions (y, x)
 	dw VermilionCityBlocks, VermilionCityTextPointers, VermilionCityScript ; blocks, texts, scripts
 	db NORTH | EAST ; connections
-	NORTH_MAP_CONNECTION ROUTE_6, ROUTE_6_WIDTH, ROUTE_6_HEIGHT, 5, 0, ROUTE_6_WIDTH, Route6Blocks
-	EAST_MAP_CONNECTION ROUTE_11, ROUTE_11_WIDTH, 4, 0, ROUTE_11_HEIGHT, Route11Blocks, VERMILION_CITY_WIDTH
+	NORTH_MAP_CONNECTION VERMILION_CITY, ROUTE_6, 5, 0, Route6Blocks
+	EAST_MAP_CONNECTION VERMILION_CITY, ROUTE_11, 4, 0, Route11Blocks
 	dw VermilionCityObject ; objects
--- a/data/mapHeaders/viridiancity.asm
+++ b/data/mapHeaders/viridiancity.asm
@@ -3,7 +3,7 @@
 	db VIRIDIAN_CITY_HEIGHT, VIRIDIAN_CITY_WIDTH ; dimensions (y, x)
 	dw ViridianCityBlocks, ViridianCityTextPointers, ViridianCityScript ; blocks, texts, scripts
 	db NORTH | SOUTH | WEST ; connections
-	NORTH_MAP_CONNECTION ROUTE_2, ROUTE_2_WIDTH, ROUTE_2_HEIGHT, 5, 0, ROUTE_2_WIDTH, Route2Blocks
-	SOUTH_MAP_CONNECTION ROUTE_1, ROUTE_1_WIDTH, 5, 0, ROUTE_1_WIDTH, Route1Blocks, VIRIDIAN_CITY_WIDTH, VIRIDIAN_CITY_HEIGHT
-	WEST_MAP_CONNECTION ROUTE_22, ROUTE_22_WIDTH, 4, 0, ROUTE_22_HEIGHT, Route22Blocks, VIRIDIAN_CITY_WIDTH
+	NORTH_MAP_CONNECTION VIRIDIAN_CITY, ROUTE_2, 5, 0, Route2Blocks
+	SOUTH_MAP_CONNECTION VIRIDIAN_CITY, ROUTE_1, 5, 0, Route1Blocks, 1
+	WEST_MAP_CONNECTION VIRIDIAN_CITY, ROUTE_22, 4, 0, Route22Blocks
 	dw ViridianCityObject ; objects
--- a/macros.asm
+++ b/macros.asm
@@ -505,75 +505,92 @@
 ENDM
 
 
-;\1 (byte) = connected map id
-;\2 (byte) = connected map width
-;\3 (byte) = connected map height
-;\4 (byte) = x movement of connection strip
-;\5 (byte) = connection strip offset
-;\6 (byte) = width of connection strip
-;\7 (word) = connected map blocks pointer
+;\1 (byte) = current map id
+;\2 (byte) = connected map id
+;\3 (byte) = x movement of connection strip
+;\4 (byte) = connection strip offset
+;\5 (word) = connected map blocks pointer
 NORTH_MAP_CONNECTION: MACRO
-	db \1 ; map id
-	dw \7 + (\2 * (\3 - 3)) + \5; "Connection Strip" location
-	dw wOverworldMap + 3 + \4 ; current map position
-	db \6 ; width of connection strip
-	db \2 ; map width
-	db (\3 * 2) - 1 ; y alignment (y coordinate of player when entering map)
-	db (\4 - \5) * -2 ; x alignment (x coordinate of player when entering map)
-	dw wOverworldMap + 1 + (\3 * (\2 + 6)) ; window (position of the upper left block after entering the map)
+	db \2 ; map id
+	dw \5 + (\2_WIDTH * (\2_HEIGHT - 3)) + \4; "Connection Strip" location
+	dw wOverworldMap + 3 + \3 ; current map position
+	IF (\1_WIDTH < \2_WIDTH)
+		db \1_WIDTH - \3 + 3 ; width of connection strip
+	ELSE
+		db \2_WIDTH - \4 ; width of connection strip
+	ENDC
+	db \2_WIDTH ; map width
+	db (\2_HEIGHT * 2) - 1 ; y alignment (y coordinate of player when entering map)
+	db (\3 - \4) * -2 ; x alignment (x coordinate of player when entering map)
+	dw wOverworldMap + 1 + (\2_HEIGHT * (\2_WIDTH + 6)) ; window (position of the upper left block after entering the map)
 ENDM
 
-;\1 (byte)  = connected map id
-;\2 (byte)  = connected map width
-;\3 (byte)  = x movement of connection strip
-;\4 (byte)  = connection strip offset
-;\5 (byte)  = width of connection strip
-;\6 (word)  = connected map blocks pointer
-;\7 (byte)  = current map width
-;\8 (byte) = current map height
+;\1 (byte) = current map id
+;\2 (byte) = connected map id
+;\3 (byte) = x movement of connection strip
+;\4 (byte) = connection strip offset
+;\5 (word) = connected map blocks pointer
+;\6 (flag) = add 3 to width of connection strip (why?)
 SOUTH_MAP_CONNECTION: MACRO
-	db \1 ; map id
-	dw \6 + \4 ; "Conection Strip" location
-	dw wOverworldMap + 3 + (\8 + 3) * (\7 + 6) + \3 ; current map position
-	db \5 ; width of connection strip
-	db \2 ; map width
+	db \2 ; map id
+	dw \5 + \4 ; "Conection Strip" location
+	dw wOverworldMap + 3 + (\1_HEIGHT + 3) * (\1_WIDTH + 6) + \3 ; current map position
+	IF (\1_WIDTH < \2_WIDTH)
+		IF (_NARG > 5)
+			db \1_WIDTH - \3 + 3 ; width of connection strip
+		ELSE
+			db \1_WIDTH - \3 ; width of connection strip
+		ENDC
+	ELSE
+		db \2_WIDTH - \4 ; width of connection strip
+	ENDC
+	db \2_WIDTH ; map width
 	db 0  ; y alignment (y coordinate of player when entering map)
 	db (\3 - \4) * -2 ; x alignment (x coordinate of player when entering map)
-	dw wOverworldMap + 7 + \2 ; window (position of the upper left block after entering the map)
+	dw wOverworldMap + 7 + \2_WIDTH ; window (position of the upper left block after entering the map)
 ENDM
 
-;\1 (byte)  = connected map id
-;\2 (byte)  = connected map width
-;\3 (byte)  = y movement of connection strip
-;\4 (byte)  = connection strip offset
-;\5 (byte)  = height of connection strip
-;\6 (word)  = connected map blocks pointer
-;\7 (byte)  = current map width
-EAST_MAP_CONNECTION: MACRO
-	db \1 ; map id
-	dw \6 + (\2 * \4) ; "Connection Strip" location
-	dw wOverworldMap - 3 + (\7 + 6) * (\3 + 4) ; current map position
-	db \5 ; height of connection strip
-	db \2 ; map width
+;\1 (byte) = current map id
+;\2 (byte) = connected map id
+;\3 (byte) = y movement of connection strip
+;\4 (byte) = connection strip offset
+;\5 (word) = connected map blocks pointer
+WEST_MAP_CONNECTION: MACRO
+	db \2 ; map id
+	dw \5 + (\2_WIDTH * \4) + \2_WIDTH - 3 ; "Connection Strip" location
+	dw wOverworldMap + (\1_WIDTH + 6) * (\3 + 3) ; current map position
+	IF (\1_HEIGHT < \2_HEIGHT)
+		db \1_HEIGHT - \3 + 3 ; height of connection strip
+	ELSE
+		db \2_HEIGHT - \4 ; height of connection strip
+	ENDC
+	db \2_WIDTH ; map width
 	db (\3 - \4) * -2 ; y alignment
-	db 0 ; x alignment
-	dw wOverworldMap + 7 + \2 ; window (position of the upper left block after entering the map)
+	db (\2_WIDTH * 2) - 1 ; x alignment
+	dw wOverworldMap + 6 + (2 * \2_WIDTH) ; window (position of the upper left block after entring the map)
 ENDM
 
-;\1 (byte)  = connected map id
-;\2 (byte)  = connected map width
-;\3 (byte)  = y movement of connection strip
-;\4 (byte)  = connection strip offset
-;\5 (byte)  = height of connection strip
-;\6 (word)  = connected map blocks pointer
-;\7 (byte)  = current map width
-WEST_MAP_CONNECTION: MACRO
-	db \1 ; map id
-	dw \6 + (\2 * \4) + \2 - 3 ; "Connection Strip" location
-	dw wOverworldMap + (\7 + 6) * (\3 + 3) ; current map position
-	db \5 ; height of connection strip
-	db \2 ; map width
+;\1 (byte) = current map id
+;\2 (byte) = connected map id
+;\3 (byte) = y movement of connection strip
+;\4 (byte) = connection strip offset
+;\5 (word) = connected map blocks pointer
+;\6 (flag) = add 3 to height of connection strip (why?)
+EAST_MAP_CONNECTION: MACRO
+	db \2 ; map id
+	dw \5 + (\2_WIDTH * \4) ; "Connection Strip" location
+	dw wOverworldMap - 3 + (\1_WIDTH + 6) * (\3 + 4) ; current map position
+	IF (\1_HEIGHT < \2_HEIGHT)
+		IF (_NARG > 5)
+			db \1_HEIGHT - \3 + 3 ; height of connection strip
+		ELSE
+			db \1_HEIGHT - \3 ; height of connection strip
+		ENDC
+	ELSE
+		db \2_HEIGHT - \4 ; height of connection strip
+	ENDC
+	db \2_WIDTH ; map width
 	db (\3 - \4) * -2 ; y alignment
-	db (\2 * 2) - 1 ; x alignment
-	dw wOverworldMap + 6 + (2 * \2) ; window (position of the upper left block after entring the map)
+	db 0 ; x alignment
+	dw wOverworldMap + 7 + \2_WIDTH ; window (position of the upper left block after entering the map)
 ENDM