diff options
author | PikalaxALT <pikalaxalt@gmail.com> | 2019-01-07 08:54:56 -0500 |
---|---|---|
committer | PikalaxALT <pikalaxalt@gmail.com> | 2019-01-07 08:54:56 -0500 |
commit | bc79312d48781a35597705bf6663ac2a39598873 (patch) | |
tree | 386ec4bbf12ad8f11deedab94bc38a1680a91df0 /src/fieldmap.c | |
parent | 08ffdce1b642dfc00080f99578049b8c3ddfd7e9 (diff) |
Start decomping fieldmap
Diffstat (limited to 'src/fieldmap.c')
-rw-r--r-- | src/fieldmap.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/src/fieldmap.c b/src/fieldmap.c new file mode 100644 index 000000000..f9b3ad897 --- /dev/null +++ b/src/fieldmap.c @@ -0,0 +1,42 @@ +#include "global.h" +#include "overworld.h" +#include "script.h" +#include "fieldmap.h" + +void sub_8058A00(struct MapHeader *mapHeader); +void map_copy_with_padding(u16 *map, u16 width, u16 height); +void mapheader_copy_mapdata_of_adjacent_maps(struct MapHeader *mapHeader); +void sub_80591C4(void); + +struct BackupMapData VMap; +EWRAM_DATA u16 gBackupMapData[VIRTUAL_MAP_SIZE]; + +const struct MapHeader * mapconnection_get_mapheader(struct MapConnection * connection) +{ + return get_mapheader_by_bank_and_number(connection->mapGroup, connection->mapNum); +} + +void not_trainer_hill_battle_pyramid(void) +{ + sub_8058A00(&gMapHeader); + mapheader_run_script_with_tag_x1(); +} + +void sub_80589E8(void) +{ + sub_8058A00(&gMapHeader); + sub_80591C4(); + mapheader_run_script_with_tag_x1(); +} + +void sub_8058A00(struct MapHeader * mapHeader) +{ + const struct MapData * mapData = mapHeader->mapData; + CpuFastFill(0x03FF03FF, gBackupMapData, sizeof(gBackupMapData)); + VMap.map = gBackupMapData; + VMap.Xsize = mapData->width + 15; + VMap.Ysize = mapData->height + 14; + AGB_ASSERT_EX(VMap.Xsize * VMap.Ysize <= VIRTUAL_MAP_SIZE, "C:/WORK/POKeFRLG/src/pm_lgfr_ose/source/fieldmap.c", 158); + map_copy_with_padding(mapData->map, mapData->width, mapData->height); + mapheader_copy_mapdata_of_adjacent_maps(mapHeader); +} |