Start documenting region map

This commit is contained in:
GriffinR
2020-03-30 22:54:14 -04:00
parent 200c82e01a
commit 250f955ae6
31 changed files with 1920 additions and 1888 deletions

Before

Width:  |  Height:  |  Size: 181 B

After

Width:  |  Height:  |  Size: 181 B

Before

Width:  |  Height:  |  Size: 175 B

After

Width:  |  Height:  |  Size: 175 B

Before

Width:  |  Height:  |  Size: 205 B

After

Width:  |  Height:  |  Size: 205 B

Before

Width:  |  Height:  |  Size: 495 B

After

Width:  |  Height:  |  Size: 495 B

Before

Width:  |  Height:  |  Size: 217 B

After

Width:  |  Height:  |  Size: 217 B

Before

Width:  |  Height:  |  Size: 216 B

After

Width:  |  Height:  |  Size: 216 B

Before

Width:  |  Height:  |  Size: 258 B

After

Width:  |  Height:  |  Size: 258 B

Before

Width:  |  Height:  |  Size: 257 B

After

Width:  |  Height:  |  Size: 257 B

Before

Width:  |  Height:  |  Size: 294 B

After

Width:  |  Height:  |  Size: 294 B

Before

Width:  |  Height:  |  Size: 345 B

After

Width:  |  Height:  |  Size: 345 B

Before

Width:  |  Height:  |  Size: 244 B

After

Width:  |  Height:  |  Size: 244 B

Before

Width:  |  Height:  |  Size: 233 B

After

Width:  |  Height:  |  Size: 233 B

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

+5 -5
View File
@@ -3,14 +3,14 @@
#define MAP_TYPE_NONE 0 #define MAP_TYPE_NONE 0
#define MAP_TYPE_TOWN 1 #define MAP_TYPE_TOWN 1
#define MAP_TYPE_CITY 2 // Unused. RSE use this map type to distinguish Town and City. FRLG make no distinction #define MAP_TYPE_CITY 2 // Not used by any map. RSE use this map type to distinguish Town and City. FRLG make no distinction
#define MAP_TYPE_ROUTE 3 #define MAP_TYPE_ROUTE 3
#define MAP_TYPE_UNDERGROUND 4 #define MAP_TYPE_UNDERGROUND 4
#define MAP_TYPE_UNDERWATER 5 // Unused #define MAP_TYPE_UNDERWATER 5 // Not used by any map.
#define MAP_TYPE_OCEAN_ROUTE 6 // Unused #define MAP_TYPE_OCEAN_ROUTE 6 // Not used by any map.
#define MAP_TYPE_UNKNOWN 7 // Unused #define MAP_TYPE_UNKNOWN 7 // Not used by any map.
#define MAP_TYPE_INDOOR 8 #define MAP_TYPE_INDOOR 8
#define MAP_TYPE_SECRET_BASE 9 // Unused #define MAP_TYPE_SECRET_BASE 9 // Not used by any map.
#define MAP_BATTLE_SCENE_NORMAL 0 #define MAP_BATTLE_SCENE_NORMAL 0
#define MAP_BATTLE_SCENE_GYM 1 #define MAP_BATTLE_SCENE_GYM 1
+3 -2
View File
@@ -103,8 +103,8 @@
#define MAPSEC_CINNABAR_ISLAND 0x60 #define MAPSEC_CINNABAR_ISLAND 0x60
#define MAPSEC_INDIGO_PLATEAU 0x61 #define MAPSEC_INDIGO_PLATEAU 0x61
#define MAPSEC_SAFFRON_CITY 0x62 #define MAPSEC_SAFFRON_CITY 0x62
#define MAPSEC_ROUTE_4_FLYDUP 0x63 #define MAPSEC_ROUTE_4_POKECENTER 0x63
#define MAPSEC_ROUTE_10_FLYDUP 0x64 #define MAPSEC_ROUTE_10_POKECENTER 0x64
#define MAPSEC_ROUTE_1 0x65 #define MAPSEC_ROUTE_1 0x65
#define MAPSEC_ROUTE_2 0x66 #define MAPSEC_ROUTE_2 0x66
#define MAPSEC_ROUTE_3 0x67 #define MAPSEC_ROUTE_3 0x67
@@ -205,6 +205,7 @@
#define MAPSEC_EMBER_SPA 0xC3 #define MAPSEC_EMBER_SPA 0xC3
#define MAPSEC_SPECIAL_AREA 0xC4 #define MAPSEC_SPECIAL_AREA 0xC4
#define MAPSEC_NONE 0xC5 #define MAPSEC_NONE 0xC5
#define MAPSEC_COUNT 0xC6
#define METLOC_SPECIAL_EGG 0xFD #define METLOC_SPECIAL_EGG 0xFD
#define METLOC_IN_GAME_TRADE 0xFE #define METLOC_IN_GAME_TRADE 0xFE
+34 -18
View File
@@ -7,35 +7,51 @@
// Exported type declarations // Exported type declarations
enum enum {
{ MAP_INPUT_NONE,
INPUT_EVENT_NONE, MAP_INPUT_MOVE_START,
INPUT_EVENT_MOVE_START, MAP_INPUT_MOVE_CONT,
INPUT_EVENT_MOVE_CONT, MAP_INPUT_MOVE_END,
INPUT_EVENT_MOVE_END, MAP_INPUT_A_BUTTON,
INPUT_EVENT_A_BUTTON, MAP_INPUT_SWITCH,
INPUT_EVENT_B_BUTTON, MAP_INPUT_CANCEL
}; };
enum { enum {
MAPSECTYPE_NONE, MAPSECTYPE_NONE,
MAPSECTYPE_PLAIN, MAPSECTYPE_ROUTE,
MAPSECTYPE_CITY_CANFLY, MAPSECTYPE_VISITED,
MAPSECTYPE_CITY_CANTFLY, MAPSECTYPE_NOT_VISITED,
MAPSECTYPE_UNKNOWN, // Checked but never used
}; };
enum { enum {
MAPPERM_0, LAYER_MAP,
MAPPERM_1, LAYER_DUNGEON,
MAPPERM_2, LAYER_COUNT
MAPPERM_3 };
enum {
MAPPERM_HAS_SWITCH_BUTTON,
MAPPERM_HAS_MAP_PREVIEW,
MAPPERM_HAS_OPEN_ANIM,
MAPPERM_HAS_FLY_DESTINATIONS,
MAPPERM_COUNT
}; };
enum { enum {
REGIONMAP_KANTO, REGIONMAP_KANTO,
REGIONMAP_SEVII123, REGIONMAP_SEVII123,
REGIONMAP_SEVII45, REGIONMAP_SEVII45,
REGIONMAP_SEVII67 REGIONMAP_SEVII67,
REGIONMAP_COUNT
};
enum {
REGIONMAP_TYPE_NORMAL,
REGIONMAP_TYPE_WALL,
REGIONMAP_TYPE_FLY,
REGIONMAP_TYPE_COUNT
}; };
// Exported RAM declarations // Exported RAM declarations
@@ -43,7 +59,7 @@ enum {
// Exported ROM declarations // Exported ROM declarations
u8 *GetMapName(u8 *dest, u16 mapsec, u16 fill); u8 *GetMapName(u8 *dest, u16 mapsec, u16 fill);
u8 *GetMapNameGeneric(u8 *dest, u16 mapsec); u8 *GetMapNameGeneric(u8 *dest, u16 mapsec);
void sub_80BFF50(u8 a0, void (*a1)(void)); void InitRegionMapWithExitCB(u8 a0, void (*a1)(void));
void MCB2_FlyMap(void); void CB2_OpenFlyMap(void);
#endif // GUARD_REGION_MAP_H #endif // GUARD_REGION_MAP_H
+1 -1
View File
@@ -188,7 +188,7 @@ u8 GetLeadMonFriendship(void)
void ShowTownMap(void) void ShowTownMap(void)
{ {
sub_8112364(); sub_8112364();
sub_80BFF50(1, CB2_ReturnToFieldContinueScriptPlayMapMusic); InitRegionMapWithExitCB(REGIONMAP_TYPE_WALL, CB2_ReturnToFieldContinueScriptPlayMapMusic);
} }
bool8 PlayerHasGrassPokemonInParty(void) bool8 PlayerHasGrassPokemonInParty(void)
+2 -2
View File
@@ -668,7 +668,7 @@ void FieldUseFunc_TownMap(u8 taskId)
static void sub_80A1CAC(void) static void sub_80A1CAC(void)
{ {
sub_80BFF50(0, CB2_BagMenuFromStartMenu); InitRegionMapWithExitCB(REGIONMAP_TYPE_NORMAL, CB2_BagMenuFromStartMenu);
} }
static void sub_80A1CC0(u8 taskId) static void sub_80A1CC0(u8 taskId)
@@ -677,7 +677,7 @@ static void sub_80A1CC0(u8 taskId)
{ {
CleanupOverworldWindowsAndTilemaps(); CleanupOverworldWindowsAndTilemaps();
sub_80A1184(); sub_80A1184();
sub_80BFF50(0, CB2_ReturnToField); InitRegionMapWithExitCB(REGIONMAP_TYPE_NORMAL, CB2_ReturnToField);
DestroyTask(taskId); DestroyTask(taskId);
} }
} }
+1 -1
View File
@@ -3970,7 +3970,7 @@ static void CursorCB_FieldMove(u8 taskId)
sPartyMenuInternal->data[0] = fieldMove; sPartyMenuInternal->data[0] = fieldMove;
break; break;
case FIELD_MOVE_FLY: case FIELD_MOVE_FLY:
gPartyMenu.exitCallback = MCB2_FlyMap; gPartyMenu.exitCallback = CB2_OpenFlyMap;
Task_ClosePartyMenu(taskId); Task_ClosePartyMenu(taskId);
break; break;
default: default:
+1710 -1695
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -40,8 +40,8 @@ static const u16 sDexAreas_Kanto[][2] = {
{ MAPSEC_CINNABAR_ISLAND, 9 }, { MAPSEC_CINNABAR_ISLAND, 9 },
{ MAPSEC_INDIGO_PLATEAU, 10 }, { MAPSEC_INDIGO_PLATEAU, 10 },
{ MAPSEC_SAFFRON_CITY, 11 }, { MAPSEC_SAFFRON_CITY, 11 },
{ MAPSEC_ROUTE_4_FLYDUP, 15 }, { MAPSEC_ROUTE_4_POKECENTER, 15 },
{ MAPSEC_ROUTE_10_FLYDUP, 21 }, { MAPSEC_ROUTE_10_POKECENTER, 21 },
{ MAPSEC_ROUTE_1, 12 }, { MAPSEC_ROUTE_1, 12 },
{ MAPSEC_ROUTE_2, 13 }, { MAPSEC_ROUTE_2, 13 },
{ MAPSEC_ROUTE_3, 14 }, { MAPSEC_ROUTE_3, 14 },