From 332a8bcb1d6c9b01e27cc4f5a7a08ae26bf62f79 Mon Sep 17 00:00:00 2001 From: Diegoisawesome Date: Tue, 14 Aug 2018 22:05:48 -0700 Subject: Extract rodata for unk_pokedex_area_screen_helper --- data/battle_pyramid.s | 94 +++++++++++++++++++++++++++++ data/unk_pokedex_area_screen_helper.s | 110 ---------------------------------- include/pokemon_storage_system.h | 2 +- include/pokemon_summary_screen.h | 2 +- ld_script.txt | 2 +- src/pokemon_summary_screen.c | 17 +++--- src/unk_pokedex_area_screen_helper.c | 8 +-- 7 files changed, 109 insertions(+), 126 deletions(-) create mode 100644 data/battle_pyramid.s delete mode 100644 data/unk_pokedex_area_screen_helper.s diff --git a/data/battle_pyramid.s b/data/battle_pyramid.s new file mode 100644 index 000000000..7327fb1f8 --- /dev/null +++ b/data/battle_pyramid.s @@ -0,0 +1,94 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .section .rodata + + .align 2 +gUnknown_0861F2B4:: @ 861F2B4 + .4byte 0x000011f0, 0x000001e1, 0x000021de + + .align 2 +gUnknown_0861F2C0:: @ 861F2C0 + .4byte 0x00000000, sub_81C5460, sub_81C5518, 0x00000000, 0x00080000, 0x07003021 + + .align 2 +gUnknown_0861F2D8:: @ 861F2D8 + .4byte gMenuText_Use, sub_81C61E0 + .4byte gMenuText_Toss, sub_81C62C4 + .4byte gMenuText_Give, sub_81C6648 + .4byte gText_Cancel2, sub_81C6258 + .4byte gMenuText_Use, sub_81C679C + .4byte gText_EmptyString2, NULL + +gUnknown_0861F308:: @ 861F308 + .byte 0x00, 0x02, 0x01, 0x03 + +gUnknown_0861F30C:: @ 861F30C + .byte 0x01, 0x03 + +gUnknown_0861F30E:: @ 861F30E + .byte 0x04, 0x03 + +gUnknown_0861F310:: @ 861F310 + .byte 0x03, 0x00, 0x00, 0x00 + +gUnknown_0861F314:: @ 861F314 + .4byte sub_81C654C + .4byte sub_81C63D0 + +gUnknown_0861F31C:: @ 861F31C + .byte 0x00, 0x02, 0x03, 0x00, 0x03, 0x01, 0x01, 0x02, 0x03, 0x00, 0x00, 0x00 + + .align 2 +gUnknown_0861F328:: @ 861F328 + window_template 0x00, 0x0e, 0x02, 0x0f, 0x10, 0x0f, 0x001e + window_template 0x00, 0x00, 0x0d, 0x0e, 0x06, 0x0f, 0x010e + window_template 0x01, 0x02, 0x0f, 0x1b, 0x04, 0x0f, 0x0162 + window_template 0x01, 0x18, 0x11, 0x05, 0x02, 0x0f, 0x01ce + null_window_template + + .align 2 +gUnknown_0861F350:: @ 861F350 + window_template 0x01, 0x16, 0x11, 0x07, 0x02, 0x0f, 0x01d8 + window_template 0x01, 0x16, 0x0f, 0x07, 0x04, 0x0f, 0x01d8 + window_template 0x01, 0x0f, 0x0f, 0x0e, 0x04, 0x0f, 0x01d8 + window_template 0x01, 0x0f, 0x0d, 0x0e, 0x06, 0x0f, 0x01d8 + + .align 2 +gUnknown_0861F370:: @ 861F370 + window_template 0x01, 0x18, 0x0f, 0x05, 0x04, 0x0f, 0x01d8 + + .align 2 +gOamData_861F378:: @ 861F378 + .2byte 0x0100, 0xc000, 0x0400, 0x0000 + + .align 2 +gSpriteAnim_861F380:: @ 861F380 + .2byte 0x0000, 0x0004, 0xffff, 0x0000 + + .align 2 +gSpriteAnimTable_861F388:: @ 861F388 + .4byte gSpriteAnim_861F380 + + .align 2 +gSpriteAffineAnim_861F38C:: @ 861F38C + .2byte 0x0100, 0x0100, 0x0000, 0x0000, 0x7fff, 0x0000, 0x0000, 0x0000 + + .align 2 +gSpriteAffineAnim_861F39C:: @ 861F39C + .2byte 0x0000, 0x0000, 0x02fe, 0x0000, 0x0000, 0x0000, 0x0402, 0x0000, 0x0000, 0x0000, 0x04fe, 0x0000, 0x0000, 0x0000, 0x0202, 0x0000 + .2byte 0x7fff, 0x0000, 0x0000, 0x0000 + + .align 2 +gSpriteAffineAnimTable_861F3C4:: @ 861F3C4 + .4byte gSpriteAffineAnim_861F38C + .4byte gSpriteAffineAnim_861F39C + + .align 2 +gUnknown_0861F3CC:: @ 861F3CC + obj_tiles gBattleFrontierGfx_PyramidBag, 0x0800, 0x1024 + + .align 2 +gUnknown_0861F3D4:: @ 861F3D4 + spr_template 0x1024, 0x1024, gOamData_861F378, gSpriteAnimTable_861F388, NULL, gSpriteAffineAnimTable_861F3C4, SpriteCallbackDummy + diff --git a/data/unk_pokedex_area_screen_helper.s b/data/unk_pokedex_area_screen_helper.s deleted file mode 100644 index 2f3881446..000000000 --- a/data/unk_pokedex_area_screen_helper.s +++ /dev/null @@ -1,110 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .section .rodata - - .align 2 -gUnknown_0861D1A0:: @ 861D1A0 - .incbin "graphics/interface/region_map.8bpp.lz" - - .align 2 -gUnknown_0861DEF4:: @ 861DEF4 - .incbin "graphics/interface/region_map.bin.lz" - - .align 2 -gUnknown_0861E208:: @ 861E208 - .incbin "graphics/interface/region_map_affine.8bpp.lz" - - .align 2 -gUnknown_0861EF64:: @ 861EF64 - .incbin "graphics/interface/region_map_affine.bin.lz" - - .align 2 -gUnknown_0861F2B4:: @ 861F2B4 - .4byte 0x000011f0, 0x000001e1, 0x000021de - - .align 2 -gUnknown_0861F2C0:: @ 861F2C0 - .4byte 0x00000000, sub_81C5460, sub_81C5518, 0x00000000, 0x00080000, 0x07003021 - - .align 2 -gUnknown_0861F2D8:: @ 861F2D8 - .4byte gMenuText_Use, sub_81C61E0 - .4byte gMenuText_Toss, sub_81C62C4 - .4byte gMenuText_Give, sub_81C6648 - .4byte gText_Cancel2, sub_81C6258 - .4byte gMenuText_Use, sub_81C679C - .4byte gText_EmptyString2, NULL - -gUnknown_0861F308:: @ 861F308 - .byte 0x00, 0x02, 0x01, 0x03 - -gUnknown_0861F30C:: @ 861F30C - .byte 0x01, 0x03 - -gUnknown_0861F30E:: @ 861F30E - .byte 0x04, 0x03 - -gUnknown_0861F310:: @ 861F310 - .byte 0x03, 0x00, 0x00, 0x00 - -gUnknown_0861F314:: @ 861F314 - .4byte sub_81C654C - .4byte sub_81C63D0 - -gUnknown_0861F31C:: @ 861F31C - .byte 0x00, 0x02, 0x03, 0x00, 0x03, 0x01, 0x01, 0x02, 0x03, 0x00, 0x00, 0x00 - - .align 2 -gUnknown_0861F328:: @ 861F328 - window_template 0x00, 0x0e, 0x02, 0x0f, 0x10, 0x0f, 0x001e - window_template 0x00, 0x00, 0x0d, 0x0e, 0x06, 0x0f, 0x010e - window_template 0x01, 0x02, 0x0f, 0x1b, 0x04, 0x0f, 0x0162 - window_template 0x01, 0x18, 0x11, 0x05, 0x02, 0x0f, 0x01ce - null_window_template - - .align 2 -gUnknown_0861F350:: @ 861F350 - window_template 0x01, 0x16, 0x11, 0x07, 0x02, 0x0f, 0x01d8 - window_template 0x01, 0x16, 0x0f, 0x07, 0x04, 0x0f, 0x01d8 - window_template 0x01, 0x0f, 0x0f, 0x0e, 0x04, 0x0f, 0x01d8 - window_template 0x01, 0x0f, 0x0d, 0x0e, 0x06, 0x0f, 0x01d8 - - .align 2 -gUnknown_0861F370:: @ 861F370 - window_template 0x01, 0x18, 0x0f, 0x05, 0x04, 0x0f, 0x01d8 - - .align 2 -gOamData_861F378:: @ 861F378 - .2byte 0x0100, 0xc000, 0x0400, 0x0000 - - .align 2 -gSpriteAnim_861F380:: @ 861F380 - .2byte 0x0000, 0x0004, 0xffff, 0x0000 - - .align 2 -gSpriteAnimTable_861F388:: @ 861F388 - .4byte gSpriteAnim_861F380 - - .align 2 -gSpriteAffineAnim_861F38C:: @ 861F38C - .2byte 0x0100, 0x0100, 0x0000, 0x0000, 0x7fff, 0x0000, 0x0000, 0x0000 - - .align 2 -gSpriteAffineAnim_861F39C:: @ 861F39C - .2byte 0x0000, 0x0000, 0x02fe, 0x0000, 0x0000, 0x0000, 0x0402, 0x0000, 0x0000, 0x0000, 0x04fe, 0x0000, 0x0000, 0x0000, 0x0202, 0x0000 - .2byte 0x7fff, 0x0000, 0x0000, 0x0000 - - .align 2 -gSpriteAffineAnimTable_861F3C4:: @ 861F3C4 - .4byte gSpriteAffineAnim_861F38C - .4byte gSpriteAffineAnim_861F39C - - .align 2 -gUnknown_0861F3CC:: @ 861F3CC - obj_tiles gBattleFrontierGfx_PyramidBag, 0x0800, 0x1024 - - .align 2 -gUnknown_0861F3D4:: @ 861F3D4 - spr_template 0x1024, 0x1024, gOamData_861F378, gSpriteAnimTable_861F388, NULL, gSpriteAffineAnimTable_861F3C4, SpriteCallbackDummy - diff --git a/include/pokemon_storage_system.h b/include/pokemon_storage_system.h index a73958d90..9b5358f06 100644 --- a/include/pokemon_storage_system.h +++ b/include/pokemon_storage_system.h @@ -83,6 +83,6 @@ void CompactPartySlots(void); u32 GetBoxMonDataFromAnyBox(u8 boxId, u8 monPosition, u32 request); bool8 CheckFreePokemonStorageSpace(void); u8 StorageGetCurrentBox(void); -u8 sub_80D214C(struct BoxPokemon* a, u8 b, u8 c, u8 d); +u8 sub_80D214C(struct BoxPokemon *a, u8 b, u8 c, u8 d); #endif // GUARD_POKEMON_STORAGE_SYSTEM_H diff --git a/include/pokemon_summary_screen.h b/include/pokemon_summary_screen.h index 0580e793c..b29548258 100755 --- a/include/pokemon_summary_screen.h +++ b/include/pokemon_summary_screen.h @@ -2,6 +2,6 @@ #define GUARD_POKEMON_SUMMARY_SCREEN_H void sub_81C4F98(u8, void(*)(void)); -void ShowSelectMovePokemonSummaryScreen(struct Pokemon *a, u8 b, u8 c, void *d, u16 e); +void ShowSelectMovePokemonSummaryScreen(struct Pokemon *, u8, u8, MainCallback, u16); #endif // GUARD_POKEMON_SUMMARY_SCREEN_H diff --git a/ld_script.txt b/ld_script.txt index 462af2946..2311301b0 100644 --- a/ld_script.txt +++ b/ld_script.txt @@ -540,7 +540,7 @@ SECTIONS { src/berry_fix_program.o(.rodata); src/pokemon_summary_screen.o(.rodata); src/unk_pokedex_area_screen_helper.o(.rodata); - data/unk_pokedex_area_screen_helper.o(.rodata); + data/battle_pyramid.o(.rodata); data/pokenav.o(.rodata); src/match_call.o(.rodata); data/pokenav.o(.rodata.after.match.call); diff --git a/src/pokemon_summary_screen.c b/src/pokemon_summary_screen.c index b5117d45d..4d194f74a 100644 --- a/src/pokemon_summary_screen.c +++ b/src/pokemon_summary_screen.c @@ -45,13 +45,12 @@ static EWRAM_DATA struct UnkSummaryStruct { - /*0x00*/ union - { + /*0x00*/ union { struct Pokemon *mons; struct BoxPokemon *boxMons; } monList; - /*0x04*/ void (*callback)(void); - /*0x08*/ struct Sprite *markingsSpriteId; + /*0x04*/ MainCallback callback; + /*0x08*/ struct Sprite *markingsSprite; /*0x0C*/ struct Pokemon currentMon; /*0x70*/ struct PokeSummary { @@ -3936,20 +3935,20 @@ void sub_81C4984(struct Pokemon *mon) { struct Sprite *sprite = sub_811FF94(30003, 30003, gUnknown_0861D120); - gUnknown_0203CF1C->markingsSpriteId = sprite; + gUnknown_0203CF1C->markingsSprite = sprite; if (sprite != NULL) { StartSpriteAnim(sprite, GetMonData(mon, MON_DATA_MARKINGS)); - gUnknown_0203CF1C->markingsSpriteId->pos1.x = 60; - gUnknown_0203CF1C->markingsSpriteId->pos1.y = 26; - gUnknown_0203CF1C->markingsSpriteId->oam.priority = 1; + gUnknown_0203CF1C->markingsSprite->pos1.x = 60; + gUnknown_0203CF1C->markingsSprite->pos1.y = 26; + gUnknown_0203CF1C->markingsSprite->oam.priority = 1; } } void sub_81C49E0(struct Pokemon *mon) { - DestroySprite(gUnknown_0203CF1C->markingsSpriteId); + DestroySprite(gUnknown_0203CF1C->markingsSprite); FreeSpriteTilesByTag(30003); sub_81C4984(mon); } diff --git a/src/unk_pokedex_area_screen_helper.c b/src/unk_pokedex_area_screen_helper.c index 3bed79a65..521af6dd9 100644 --- a/src/unk_pokedex_area_screen_helper.c +++ b/src/unk_pokedex_area_screen_helper.c @@ -8,10 +8,10 @@ EWRAM_DATA u8 *gUnknown_0203CF28 = NULL; static const u16 gUnknown_0861D140[] = INCBIN_U16("graphics/interface/region_map.gbapal"); -extern const u8 gUnknown_0861D1A0[]; -extern const u8 gUnknown_0861DEF4[]; -extern const u8 gUnknown_0861E208[]; -extern const u8 gUnknown_0861EF64[]; +static const u8 gUnknown_0861D1A0[] = INCBIN_U8("graphics/interface/region_map.8bpp.lz"); +static const u8 gUnknown_0861DEF4[] = INCBIN_U8("graphics/interface/region_map.bin.lz"); +static const u8 gUnknown_0861E208[] = INCBIN_U8("graphics/interface/region_map_affine.8bpp.lz"); +static const u8 gUnknown_0861EF64[] = INCBIN_U8("graphics/interface/region_map_affine.bin.lz"); struct UnkStruct_1C4D70 { -- cgit v1.2.3