diff options
| author | Remy Oukaour <remy.oukaour@gmail.com> | 2017-12-14 00:36:24 -0500 |
|---|---|---|
| committer | Remy Oukaour <remy.oukaour@gmail.com> | 2017-12-14 00:36:24 -0500 |
| commit | e48a401290e794854880f06fc230a369f37e6b9b (patch) | |
| tree | dcad6cd5d1a7e62a2f2a92522c5619d41dc416cf /maps | |
| parent | 8745915dbd38e9647e0b27d20cb73da0fdde353f (diff) | |
Reorganize macros
Diffstat (limited to 'maps')
| -rw-r--r-- | maps/map_headers.asm | 18 | ||||
| -rw-r--r-- | maps/second_map_headers.asm | 87 |
2 files changed, 104 insertions, 1 deletions
diff --git a/maps/map_headers.asm b/maps/map_headers.asm index 5145fdda1..3b2607e31 100644 --- a/maps/map_headers.asm +++ b/maps/map_headers.asm @@ -1,3 +1,20 @@ +map_header: macro +;\1: map label +;\2: tileset: a TILESET_* constant +;\3: permission: TOWN, ROUTE, INDOOR, CAVE, PERM_5, GATE, or DUNGEON +;\4: location: from constants/landmark_constants.asm +;\5: music: a MUSIC_* constant +;\6: phone service flag: 1 to prevent phone calls +;\7: time of day: a PALETTE_* constant +;\8: fishing group: a FISHGROUP_* constant +\1_MapHeader: + db BANK(\1_SecondMapHeader), \2, \3 + dw \1_SecondMapHeader + db \4, \5 + dn \6, \7 + db \8 +endm + MapGroupPointers:: ; pointers to the first map header of each map group dw MapGroup_Olivine ; 1 @@ -27,7 +44,6 @@ MapGroupPointers:: dw MapGroup_Saffron ; 25 dw MapGroup_Cherrygrove ; 26 - MapGroup_Olivine: map_header OlivinePokecenter1F, TILESET_POKECENTER, INDOOR, OLIVINE_CITY, MUSIC_POKEMON_CENTER, 0, PALETTE_DAY, FISHGROUP_SHORE map_header OlivineGym, TILESET_OLIVINE_GYM, INDOOR, OLIVINE_CITY, MUSIC_GYM, 1, PALETTE_DAY, FISHGROUP_SHORE diff --git a/maps/second_map_headers.asm b/maps/second_map_headers.asm index ab35a7f76..f4162226f 100644 --- a/maps/second_map_headers.asm +++ b/maps/second_map_headers.asm @@ -1,3 +1,90 @@ +map_header_2: macro +;\1: map label +;\2: map id +;\3: border block +;\4: connections: sum of NORTH, SOUTH, WEST, and/or EAST, or 0 for none +\1_SecondMapHeader:: + db \3 + db \2_HEIGHT, \2_WIDTH + db BANK(\1_BlockData) + dw \1_BlockData + db BANK(\1_MapScriptHeader) + dw \1_MapScriptHeader + dw \1_MapEventHeader + db \4 +endm + +connection: macro +if "\1" == "north" +;\2: map id +;\3: map label (eventually will be rolled into map id) +;\4: x +;\5: offset? +;\6: strip length +;\7: this map id + map \2 + dw \3_BlockData + \2_WIDTH * (\2_HEIGHT - 3) + \5 + dw OverworldMap + \4 + 3 + db \6 + db \2_WIDTH + db \2_HEIGHT * 2 - 1 + db (\4 - \5) * -2 + dw OverworldMap + \2_HEIGHT * (\2_WIDTH + 6) + 1 +endc + +if "\1" == "south" +;\2: map id +;\3: map label (eventually will be rolled into map id) +;\4: x +;\5: offset? +;\6: strip length +;\7: this map id + map \2 + dw \3_BlockData + \5 + dw OverworldMap + (\7_HEIGHT + 3) * (\7_WIDTH + 6) + \4 + 3 + db \6 + db \2_WIDTH + db 0 + db (\4 - \5) * -2 + dw OverworldMap + \2_WIDTH + 7 +endc + +if "\1" == "west" +;\2: map id +;\3: map label (eventually will be rolled into map id) +;\4: y +;\5: offset? +;\6: strip length +;\7: this map id + map \2 + dw \3_BlockData + (\2_WIDTH * \5) + \2_WIDTH - 3 + dw OverworldMap + (\7_WIDTH + 6) * (\4 + 3) + db \6 + db \2_WIDTH + db (\4 - \5) * -2 + db \2_WIDTH * 2 - 1 + dw OverworldMap + \2_WIDTH * 2 + 6 +endc + +if "\1" == "east" +;\2: map id +;\3: map label (eventually will be rolled into map id) +;\4: y +;\5: offset? +;\6: strip length +;\7: this map id + map \2 + dw \3_BlockData + (\2_WIDTH * \5) + dw OverworldMap + (\7_WIDTH + 6) * (\4 + 3 + 1) - 3 + db \6 + db \2_WIDTH + db (\4 - \5) * -2 + db 0 + dw OverworldMap + \2_WIDTH + 7 +endc +endm + + map_header_2 NewBarkTown, NEW_BARK_TOWN, $5, WEST | EAST connection west, ROUTE_29, Route29, 0, 0, 9, NEW_BARK_TOWN connection east, ROUTE_27, Route27, 0, 0, 9, NEW_BARK_TOWN |
