diff --git a/data/pokenav.s b/data/pokenav.s index a8d6ee2f1b..10f36b3895 100644 --- a/data/pokenav.s +++ b/data/pokenav.s @@ -4,138 +4,13 @@ .section .rodata // pokenav_unk_5.s -gUnknown_08622868:: @ 8622868 - .incbin "graphics/pokenav/8622868.gbapal" -gUnknown_08622888:: @ 8622888 - .incbin "graphics/pokenav/zoom_tiles.4bpp.lz" -gUnknown_08622A7C:: @ 8622A7C - .incbin "graphics/pokenav/city_maps/lavaridge_0.bin.lz" -gUnknown_08622AC0:: @ 8622AC0 - .incbin "graphics/pokenav/city_maps/fallarbor_0.bin.lz" -gUnknown_08622B08:: @ 8622B08 - .incbin "graphics/pokenav/city_maps/fortree_0.bin.lz" -gUnknown_08622B58:: @ 8622B58 - .incbin "graphics/pokenav/city_maps/slateport_0.bin.lz" -gUnknown_08622BB8:: @ 8622BB8 - .incbin "graphics/pokenav/city_maps/slateport_1.bin.lz" -gUnknown_08622C04:: @ 8622C04 - .incbin "graphics/pokenav/city_maps/rustboro_0.bin.lz" - -gUnknown_08622C58:: @ 8622C58 - .incbin "graphics/pokenav/city_maps/rustboro_1.bin.lz" - -gUnknown_08622CAC:: @ 8622CAC - .incbin "graphics/pokenav/city_maps/pacifidlog_0.bin.lz" - -gUnknown_08622CEC:: @ 8622CEC - .incbin "graphics/pokenav/city_maps/mauville_0.bin.lz" - -gUnknown_08622D44:: @ 8622D44 - .incbin "graphics/pokenav/city_maps/mauville_1.bin.lz" - -gUnknown_08622D98:: @ 8622D98 - .incbin "graphics/pokenav/city_maps/oldale_0.bin.lz" - -gUnknown_08622DC8:: @ 8622DC8 - .incbin "graphics/pokenav/city_maps/lilycove_0.bin.lz" - -gUnknown_08622E14:: @ 8622E14 - .incbin "graphics/pokenav/city_maps/lilycove_1.bin.lz" - -gUnknown_08622E6C:: @ 8622E6C - .incbin "graphics/pokenav/city_maps/littleroot_0.bin.lz" - -gUnknown_08622E9C:: @ 8622E9C - .incbin "graphics/pokenav/city_maps/dewford_0.bin.lz" - -gUnknown_08622ED4:: @ 8622ED4 - .incbin "graphics/pokenav/city_maps/sootopolis_0.bin.lz" - -gUnknown_08622F14:: @ 8622F14 - .incbin "graphics/pokenav/city_maps/ever_grande_0.bin.lz" - -gUnknown_08622F5C:: @ 8622F5C - .incbin "graphics/pokenav/city_maps/ever_grande_1.bin.lz" - -gUnknown_08622FA0:: @ 8622FA0 - .incbin "graphics/pokenav/city_maps/verdanturf_0.bin.lz" - -gUnknown_08622FD8:: @ 8622FD8 - .incbin "graphics/pokenav/city_maps/mossdeep_0.bin.lz" - -gUnknown_08623020:: @ 8623020 - .incbin "graphics/pokenav/city_maps/mossdeep_1.bin.lz" - -gUnknown_0862307C:: @ 862307C - .incbin "graphics/pokenav/city_maps/petalburg_0.bin.lz" - -gUnknown_086230D8:: @ 86230D8 - .4byte 0x11F5 - .4byte 0x206A - .4byte 0x3402 - -gUnknown_086230E4:: @ 86230E4 - .4byte NULL - .4byte sub_81CC848 - .4byte sub_81CC878 - .4byte sub_81CC8D8 - .4byte sub_81CC95C - -gUnknown_086230F8:: @ 86230F8 - obj_tiles gHoennMapZoomIcons_Gfx, 0x800, 6 - -gUnknown_08623100:: @ 8623100 - obj_pal gHoennMapZoomIcons_Pal, 11 - null_obj_pal - -gUnknown_08623110:: @ 8623110 - .byte 1 - .byte 17 - .byte 4 - .byte 12 - .byte 13 - .byte 1 - .2byte 0x4C - -gUnknown_08623118:: @ 8623118 - .4byte 0, gUnknown_08622E6C - .4byte 1, gUnknown_08622D98 - .4byte 2, gUnknown_08622E9C - .4byte 3, gUnknown_08622A7C - .4byte 4, gUnknown_08622AC0 - .4byte 5, gUnknown_08622FA0 - .4byte 6, gUnknown_08622CAC - .4byte 7, gUnknown_0862307C - .4byte 8, gUnknown_08622B58 - .4byte 0x10008, gUnknown_08622BB8 - .4byte 9, gUnknown_08622D44 - .4byte 0x10009, gUnknown_08622CEC - .4byte 0xA, gUnknown_08622C04 - .4byte 0x1000A, gUnknown_08622C58 - .4byte 0xB, gUnknown_08622B08 - .4byte 0xC, gUnknown_08622E14 - .4byte 0x1000C, gUnknown_08622DC8 - .4byte 0xD, gUnknown_08623020 - .4byte 0x1000D, gUnknown_08622FD8 - .4byte 0xE, gUnknown_08622ED4 - .4byte 0xF, gUnknown_08622F14 - .4byte 0x1000F, gUnknown_08622F5C - -gUnknown_086231C8:: @ 86231C8 - .2byte 0x4000 - .2byte 0x4000 - .2byte 0x400 - .2byte 0x0 - -gUnknown_086231D0:: @ 86231D0 - spr_template 6, 11, gUnknown_086231C8, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, sub_81CCEF4 // pokenav_unk_6.s // diff --git a/graphics/pokenav/city_maps/lilycove_0.bin b/graphics/pokenav/city_maps/lilycove_0.bin index e8bf09eaef..99895574d1 100644 Binary files a/graphics/pokenav/city_maps/lilycove_0.bin and b/graphics/pokenav/city_maps/lilycove_0.bin differ diff --git a/graphics/pokenav/city_maps/lilycove_1.bin b/graphics/pokenav/city_maps/lilycove_1.bin index 99895574d1..e8bf09eaef 100644 Binary files a/graphics/pokenav/city_maps/lilycove_1.bin and b/graphics/pokenav/city_maps/lilycove_1.bin differ diff --git a/graphics/pokenav/city_maps/mauville_0.bin b/graphics/pokenav/city_maps/mauville_0.bin index 103d39e54b..a0662010a7 100644 Binary files a/graphics/pokenav/city_maps/mauville_0.bin and b/graphics/pokenav/city_maps/mauville_0.bin differ diff --git a/graphics/pokenav/city_maps/mauville_1.bin b/graphics/pokenav/city_maps/mauville_1.bin index a0662010a7..103d39e54b 100644 Binary files a/graphics/pokenav/city_maps/mauville_1.bin and b/graphics/pokenav/city_maps/mauville_1.bin differ diff --git a/graphics/pokenav/city_maps/mossdeep_0.bin b/graphics/pokenav/city_maps/mossdeep_0.bin index fd03cfe023..6c11d5624f 100644 Binary files a/graphics/pokenav/city_maps/mossdeep_0.bin and b/graphics/pokenav/city_maps/mossdeep_0.bin differ diff --git a/graphics/pokenav/city_maps/mossdeep_1.bin b/graphics/pokenav/city_maps/mossdeep_1.bin index 6c11d5624f..fd03cfe023 100644 Binary files a/graphics/pokenav/city_maps/mossdeep_1.bin and b/graphics/pokenav/city_maps/mossdeep_1.bin differ diff --git a/ld_script.txt b/ld_script.txt index b1884a5c8d..2474b471bb 100644 --- a/ld_script.txt +++ b/ld_script.txt @@ -646,6 +646,7 @@ SECTIONS { src/pokenav_unk_2.o(.rodata); src/pokenav_unk_3.o(.rodata); src/pokenav_unk_4.o(.rodata); + src/pokenav_unk_5.o(.rodata); data/pokenav.o(.rodata); src/pokenav_unk_10.o(.rodata); src/pokenav_match_call_data.o(.rodata); diff --git a/src/data/region_map/city_map_entries.h b/src/data/region_map/city_map_entries.h new file mode 100644 index 0000000000..7b8361a7c9 --- /dev/null +++ b/src/data/region_map/city_map_entries.h @@ -0,0 +1,113 @@ +const struct CityMapEntry gPokenavCityMaps[] = +{ + { + .mapSecId = 0, + .index = 0, + .tilemap = gPokenavCityMap_Littleroot_0, + }, + { + .mapSecId = 1, + .index = 0, + .tilemap = gPokenavCityMap_Oldale_0, + }, + { + .mapSecId = 2, + .index = 0, + .tilemap = gPokenavCityMap_Dewford_0, + }, + { + .mapSecId = 3, + .index = 0, + .tilemap = gPokenavCityMap_Lavarige_0, + }, + { + .mapSecId = 4, + .index = 0, + .tilemap = gPokenavCityMap_Fallarbor_0, + }, + { + .mapSecId = 5, + .index = 0, + .tilemap = gPokenavCityMap_Verdanturf_0, + }, + { + .mapSecId = 6, + .index = 0, + .tilemap = gPokenavCityMap_Pacifidlog_0, + }, + { + .mapSecId = 7, + .index = 0, + .tilemap = gPokenavCityMap_Petalburg_0, + }, + { + .mapSecId = 8, + .index = 0, + .tilemap = gPokenavCityMap_Slateport_0, + }, + { + .mapSecId = 8, + .index = 1, + .tilemap = gPokenavCityMap_Slateport_1, + }, + { + .mapSecId = 9, + .index = 0, + .tilemap = gPokenavCityMap_Mauville_0, + }, + { + .mapSecId = 9, + .index = 1, + .tilemap = gPokenavCityMap_Mauville_1, + }, + { + .mapSecId = 10, + .index = 0, + .tilemap = gPokenavCityMap_Rustboro_0, + }, + { + .mapSecId = 10, + .index = 1, + .tilemap = gPokenavCityMap_Rustboro_1, + }, + { + .mapSecId = 11, + .index = 0, + .tilemap = gPokenavCityMap_Fortree_0, + }, + { + .mapSecId = 12, + .index = 0, + .tilemap = gPokenavCityMap_Lilycove_0, + }, + { + .mapSecId = 12, + .index = 1, + .tilemap = gPokenavCityMap_Lilycove_1, + }, + { + .mapSecId = 13, + .index = 0, + .tilemap = gPokenavCityMap_Mossdeep_0, + }, + { + .mapSecId = 13, + .index = 1, + .tilemap = gPokenavCityMap_Mossdeep_1, + }, + { + .mapSecId = 14, + .index = 0, + .tilemap = gPokenavCityMap_Sootopolis_0, + }, + { + .mapSecId = 15, + .index = 0, + .tilemap = gPokenavCityMap_EverGrande_0, + }, + { + .mapSecId = 15, + .index = 1, + .tilemap = gPokenavCityMap_EverGrande_1, + }, +}; diff --git a/src/data/region_map/city_map_tilemaps.h b/src/data/region_map/city_map_tilemaps.h new file mode 100644 index 0000000000..8a8a931f92 --- /dev/null +++ b/src/data/region_map/city_map_tilemaps.h @@ -0,0 +1,22 @@ +const u32 gPokenavCityMap_Lavarige_0[] = INCBIN_U32("graphics/pokenav/city_maps/lavaridge_0.bin.lz"); +const u32 gPokenavCityMap_Fallarbor_0[] = INCBIN_U32("graphics/pokenav/city_maps/fallarbor_0.bin.lz"); +const u32 gPokenavCityMap_Fortree_0[] = INCBIN_U32("graphics/pokenav/city_maps/fortree_0.bin.lz"); +const u32 gPokenavCityMap_Slateport_0[] = INCBIN_U32("graphics/pokenav/city_maps/slateport_0.bin.lz"); +const u32 gPokenavCityMap_Slateport_1[] = INCBIN_U32("graphics/pokenav/city_maps/slateport_1.bin.lz"); +const u32 gPokenavCityMap_Rustboro_0[] = INCBIN_U32("graphics/pokenav/city_maps/rustboro_0.bin.lz"); +const u32 gPokenavCityMap_Rustboro_1[] = INCBIN_U32("graphics/pokenav/city_maps/rustboro_1.bin.lz"); +const u32 gPokenavCityMap_Pacifidlog_0[] = INCBIN_U32("graphics/pokenav/city_maps/pacifidlog_0.bin.lz"); +const u32 gPokenavCityMap_Mauville_1[] = INCBIN_U32("graphics/pokenav/city_maps/mauville_1.bin.lz"); +const u32 gPokenavCityMap_Mauville_0[] = INCBIN_U32("graphics/pokenav/city_maps/mauville_0.bin.lz"); +const u32 gPokenavCityMap_Oldale_0[] = INCBIN_U32("graphics/pokenav/city_maps/oldale_0.bin.lz"); +const u32 gPokenavCityMap_Lilycove_1[] = INCBIN_U32("graphics/pokenav/city_maps/lilycove_1.bin.lz"); +const u32 gPokenavCityMap_Lilycove_0[] = INCBIN_U32("graphics/pokenav/city_maps/lilycove_0.bin.lz"); +const u32 gPokenavCityMap_Littleroot_0[] = INCBIN_U32("graphics/pokenav/city_maps/littleroot_0.bin.lz"); +const u32 gPokenavCityMap_Dewford_0[] = INCBIN_U32("graphics/pokenav/city_maps/dewford_0.bin.lz"); +const u32 gPokenavCityMap_Sootopolis_0[] = INCBIN_U32("graphics/pokenav/city_maps/sootopolis_0.bin.lz"); +const u32 gPokenavCityMap_EverGrande_0[] = INCBIN_U32("graphics/pokenav/city_maps/ever_grande_0.bin.lz"); +const u32 gPokenavCityMap_EverGrande_1[] = INCBIN_U32("graphics/pokenav/city_maps/ever_grande_1.bin.lz"); +const u32 gPokenavCityMap_Verdanturf_0[] = INCBIN_U32("graphics/pokenav/city_maps/verdanturf_0.bin.lz"); +const u32 gPokenavCityMap_Mossdeep_1[] = INCBIN_U32("graphics/pokenav/city_maps/mossdeep_1.bin.lz"); +const u32 gPokenavCityMap_Mossdeep_0[] = INCBIN_U32("graphics/pokenav/city_maps/mossdeep_0.bin.lz"); +const u32 gPokenavCityMap_Petalburg_0[] = INCBIN_U32("graphics/pokenav/city_maps/petalburg_0.bin.lz"); diff --git a/src/pokenav_unk_4.c b/src/pokenav_unk_4.c index d935c9d284..3a7a4486f1 100755 --- a/src/pokenav_unk_4.c +++ b/src/pokenav_unk_4.c @@ -234,9 +234,9 @@ const struct OamData gUnknown_08622828 = .affineMode = 0, .objMode = 0, .bpp = 0, - .shape = 2,//SPRITE_SHAPE(32x16), + .shape = SPRITE_SHAPE(8x16), .x = 0, - .size = 0,//SPRITE_SIZE(32x16), + .size = SPRITE_SIZE(8x16), .tileNum = 0, .priority = 1, .paletteNum = 0, @@ -259,9 +259,9 @@ const struct OamData gUnknown_08622848 = .affineMode = 0, .objMode = 0, .bpp = 0, - .shape = 0,//SPRITE_SHAPE(32x16), + .shape = SPRITE_SHAPE(64x64), .x = 0, - .size = 3,//SPRITE_SIZE(32x16), + .size = SPRITE_SIZE(64x64), .tileNum = 0, .priority = 1, .paletteNum = 0, diff --git a/src/pokenav_unk_5.c b/src/pokenav_unk_5.c index eccc200d56..6a235df9ee 100755 --- a/src/pokenav_unk_5.c +++ b/src/pokenav_unk_5.c @@ -32,11 +32,11 @@ struct Pokenav5Struct_2 u8 cityZoomPics[22][0xC8]; }; -struct CityZoomPic +struct CityMapEntry { u16 mapSecId; - u16 unk2; - const u32 *data; + u16 index; + const u32 *tilemap; }; static u32 sub_81CC568(struct Pokenav5Struct *); @@ -61,17 +61,110 @@ static void sub_81CCDE8(struct Pokenav5Struct_2 *, int, int); static void sub_81CCFA4(int); static void sub_81CCC9C(u8 taskId); static void sub_81CCF78(void); +void sub_81CCEF4(struct Sprite *sprite); +u32 sub_81CC848(int); +u32 sub_81CC878(int); +u32 sub_81CC8D8(int); +u32 sub_81CC95C(int); -extern const LoopedTask gUnknown_086230E4[]; -extern const struct BgTemplate gUnknown_086230D8[2]; -extern const struct CompressedSpriteSheet gUnknown_086230F8[1]; -extern const struct SpritePalette gUnknown_08623100[]; -extern const struct WindowTemplate gUnknown_08623110; -extern const u32 gUnknown_08622888[]; -extern const u16 gUnknown_08622868[]; extern const u16 gHoennMapZoomIcons_Pal[]; -extern const struct CityZoomPic gUnknown_08623118[22]; extern const struct SpriteTemplate gUnknown_086231D0; +extern const u32 gHoennMapZoomIcons_Gfx[]; + +const u16 gUnknown_08622868[] = INCBIN_U16("graphics/pokenav/8622868.gbapal"); +const u32 gUnknown_08622888[] = INCBIN_U32("graphics/pokenav/zoom_tiles.4bpp.lz"); + +#include "data/region_map/city_map_tilemaps.h" + + +const struct BgTemplate gUnknown_086230D8[3] = +{ + { + .bg = 1, + .charBaseIndex = 1, + .mapBaseIndex = 0x1F, + .screenSize = 0, + .paletteMode = 0, + .priority = 1, + .baseTile = 0 + }, + { + .bg = 2, + .charBaseIndex = 2, + .mapBaseIndex = 0x06, + .screenSize = 0, + .paletteMode = 0, + .priority = 2, + .baseTile = 0 + }, + { + .bg = 2, + .charBaseIndex = 0, + .mapBaseIndex = 0x00, + .screenSize = 2, + .paletteMode = 0, + .priority = 3, + .baseTile = 0 + }, +}; + +const LoopedTask gUnknown_086230E4[] = +{ + NULL, + sub_81CC848, + sub_81CC878, + sub_81CC8D8, + sub_81CC95C +}; + +const struct CompressedSpriteSheet gUnknown_086230F8[1] = +{ + {gHoennMapZoomIcons_Gfx, 0x800, 6} +}; + +const struct SpritePalette gUnknown_08623100[] = +{ + {gHoennMapZoomIcons_Pal, 11}, + {} +}; + +const struct WindowTemplate gUnknown_08623110 = +{ + .bg = 1, + .tilemapLeft 17, + .tilemapTop 4, + .width 12, + .height 13, + .paletteNum 1, + .baseBlock 0x4C +}; + +#include "data/region_map/city_map_entries.h" + +const struct OamData gUnknown_086231C8 = +{ + .y = 0, + .affineMode = 0, + .objMode = 0, + .bpp = 0, + .shape = SPRITE_SHAPE(32x8), + .x = 0, + .size = SPRITE_SIZE(32x8), + .tileNum = 0, + .priority = 1, + .paletteNum = 0, +}; + +const struct SpriteTemplate gUnknown_086231D0 = +{ + .tileTag = 6, + .paletteTag = 11, + .oam = &gUnknown_086231C8, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_81CCEF4, +}; u32 sub_81CC4D4(void) { @@ -215,7 +308,7 @@ static u32 sub_81CC6F4(int taskState) HideBg(2); HideBg(3); SetBgMode(1); - InitBgTemplates(gUnknown_086230D8, ARRAY_COUNT(gUnknown_086230D8)); + InitBgTemplates(gUnknown_086230D8, ARRAY_COUNT(gUnknown_086230D8) - 1); regionMap = GetSubstructPtr(16); sub_8122CF8(regionMap, &gUnknown_086230D8[1], sub_81CC6D0()); sub_81CC9C0(); @@ -521,9 +614,9 @@ static bool32 sub_81CCD24(void) static u32 sub_81CCD34(int taskState) { struct Pokenav5Struct_2 *state = GetSubstructPtr(4); - if (taskState < (int)ARRAY_COUNT(gUnknown_08623118)) + if (taskState < (int)ARRAY_COUNT(gPokenavCityMaps)) { - LZ77UnCompWram(gUnknown_08623118[taskState].data, state->cityZoomPics[taskState]); + LZ77UnCompWram(gPokenavCityMaps[taskState].tilemap, state->cityZoomPics[taskState]); return 1; } @@ -533,10 +626,10 @@ static u32 sub_81CCD34(int taskState) static void sub_81CCD70(struct Pokenav5Struct_2 *state, int mapSecId, int pos) { int i; - for (i = 0; i < (int)ARRAY_COUNT(gUnknown_08623118) && (gUnknown_08623118[i].mapSecId != mapSecId || gUnknown_08623118[i].unk2 != pos); i++) + for (i = 0; i < (int)ARRAY_COUNT(gPokenavCityMaps) && (gPokenavCityMaps[i].mapSecId != mapSecId || gPokenavCityMaps[i].index != pos); i++) ; - if (i == ARRAY_COUNT(gUnknown_08623118)) + if (i == ARRAY_COUNT(gPokenavCityMaps)) return; FillBgTilemapBufferRect_Palette0(1, 0x1041, 17, 6, 12, 11);