From 1dd50d5202d8c42ce776d7f85d89591594c2ecdd Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sun, 15 Jun 2025 16:29:31 +0200 Subject: [PATCH] ground script data, poke documentation --- data/data_8115F5C_2.s | 578 --------------------------------- data/data_8115F5C_2_.s | 436 +++++++++++++++++++++++++ include/debug.h | 6 +- include/pokemon.h | 22 +- include/structs/str_pokemon.h | 12 +- ld_script.ld | 2 + src/code_801AFA4.c | 2 +- src/code_801D014.c | 2 +- src/code_806FDF4.c | 10 +- src/code_8094F88.c | 4 +- src/code_8097670.c | 2 +- src/debug_menu3.c | 4 +- src/dungeon_8067A80.c | 14 +- src/dungeon_generation_fixed.c | 2 +- src/dungeon_info.c | 8 +- src/dungeon_main.c | 2 +- src/dungeon_menu_recruitment.c | 2 +- src/dungeon_misc.c | 38 +-- src/friend_area.c | 10 +- src/friend_area_action_menu.c | 4 +- src/friend_list.c | 12 +- src/friend_list_menu.c | 2 +- src/ground_lives.c | 12 +- src/ground_main.c | 33 +- src/ground_script.c | 211 ++++++------ src/items.c | 4 +- src/luminous_cave.c | 2 +- src/main_loops.c | 4 +- src/party_list_menu.c | 6 +- src/pokemon.c | 105 +++--- src/pokemon_3.c | 24 +- src/pokemon_evolution.c | 2 +- src/run_dungeon.c | 4 +- src/wigglytuff_shop2.c | 2 +- 34 files changed, 723 insertions(+), 860 deletions(-) create mode 100644 data/data_8115F5C_2_.s diff --git a/data/data_8115F5C_2.s b/data/data_8115F5C_2.s index 5a2ba8100..ee868cec3 100644 --- a/data/data_8115F5C_2.s +++ b/data/data_8115F5C_2.s @@ -65,582 +65,4 @@ gUnknown_811642C: @ 811642C gZeroPos_8116478: @ 8116478 .byte 0x00, 0x00, 0x00, 0x00 .byte 0x00, 0x00, 0x00, 0x00 -.string "pksdir0\0" -.align 2,0 -.global gGroundScriptTriggerCallbacks -gGroundScriptTriggerCallbacks: @ 8116488 -.byte 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - -.global gUnknown_81164DC -gUnknown_81164DC: @ 81164DC -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 - -.global gUnknown_81164E4 -gUnknown_81164E4: @ 81164E4 -.byte 0xf6, 0x00, 0xc5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.4byte GroundScriptFile_Text -.byte 0xef, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - -.global GroundScriptFile_Text -GroundScriptFile_Text: -.string "../ground/ground_script.c\0" -.align 2,0 - -.global GroundScript_ExecutePP_Text -GroundScript_ExecutePP_Text: -.string "GroundScript_ExecutePP\0" -.align 2,0 - -.global gUnknown_8116538 -gUnknown_8116538: @ 8116538 -.4byte GroundScriptFile_Text -.4byte 0x000002b0 -.4byte GroundScript_ExecutePP_Text - -.global gUnknown_8116544 -gUnknown_8116544: @ 8116544 -.string "execute script type error B\0" -.align 2,0 - -.global gUnknown_8116560 -gUnknown_8116560: @ 8116560 -.4byte GroundScriptFile_Text -.4byte 0x000002b1 -.4byte GroundScript_ExecutePP_Text - -.global gUnknown_811656C -gUnknown_811656C: @ 811656C -.string "execute script type error C\0" -.align 2,0 - -.global gUnknown_8116588 -gUnknown_8116588: @ 8116588 -.4byte GroundScriptFile_Text -.4byte 0x000002c4 -.4byte GroundScript_ExecutePP_Text - -.global gUnknown_8116594 -gUnknown_8116594: @ 8116594 -.string "execute script type error %d\0" -.align 2,0 - -.global GroundScript_Cancel_Text -GroundScript_Cancel_Text: -.string "GroundScript_Cancel\0" -.align 2,0 - -.global gUnknown_81165C8 -gUnknown_81165C8: @ 81165C8 -.4byte GroundScriptFile_Text -.4byte 0x00000335 -.4byte GroundScript_Cancel_Text - -.global gUnknown_81165D4 -gUnknown_81165D4: @ 81165D4 -.string " ground select %3d[%s] %3d\0" -.align 2,0 - -.global gUnknown_81165F4 -gUnknown_81165F4: @ 81165F4 -.string " dungeon select %3d\0" -.align 2,0 - -.global gUnknown_811660C -gUnknown_811660C: @ 811660C -.string " dungeon enter check %3d\0" -.align 2,0 - -.global gUnknown_8116628 -gUnknown_8116628: @ 8116628 -.string " map select %3d %3d[%s]\0" -.align 2,0 - -.global gUnknown_8116644 -gUnknown_8116644: @ 8116644 -.string " ground select %3d %3d[%s]\0" -.align 2,0 - -.global gUnknown_8116664 -gUnknown_8116664: @ 8116664 -.string " dungeon select %3d %3d[%s]\0" -.align 2,0 - -.global gUnknown_8116684 -gUnknown_8116684: @ 8116684 -.string " dungeon rescue select %3d\0" -.align 2,0 - -.global AnalyzeProcess_Text -AnalyzeProcess_Text: @ Text -.string "_AnalyzeProcess\0" -.align 2,0 - -.global gUnknown_81166B4 -gUnknown_81166B4: @ 81166B4 -.4byte GroundScriptFile_Text -.4byte 0x0000107e -.4byte AnalyzeProcess_Text - -.global gUnknown_81166C0 -gUnknown_81166C0: @ 81166C0 -.string "switch type error %d\0" -.align 2,0 - -.global gUnknown_81166D8 -gUnknown_81166D8: @ 81166D8 -.byte 0x00, 0x00, 0x00, 0x00 - -.global GroundScript_ExecuteTrigger_Text -GroundScript_ExecuteTrigger_Text: -.string "GroundScript_ExecuteTrigger\0" -.align 2,0 - -.global gUnknown_81166F8 -gUnknown_81166F8: @ 81166F8 -.4byte GroundScriptFile_Text -.4byte 0x000011c9 -.4byte GroundScript_ExecuteTrigger_Text - -.global gUnknown_8116704 -gUnknown_8116704: @ 8116704 -.4byte GroundScriptFile_Text -.4byte 0x000011ce -.4byte GroundScript_ExecuteTrigger_Text - -.global gUnknown_8116710 -gUnknown_8116710: @ 8116710 -@ replacing .incbin "baserom.gba", 0x00116710, 0x28 -.byte 0x98, 0x9d, 0x03, 0x02, 0x51, 0x00, 0x00, 0x00, 0x46, 0x00, 0x00, 0x00, 0x53, 0x00, 0x9a, 0x00, 0xbc, 0x00, 0x00, 0x00, 0x26, 0x00, 0x06, 0x00, 0x01, 0x00, 0x14, 0x00, 0x12, 0x00, 0x14, 0x00 -.byte 0x12, 0x00, 0x00, 0x00, 0xd0, 0x11, 0x00, 0x00 - -.global gUnknown_8116738 -gUnknown_8116738: @ 8116738 -@ replacing .incbin "baserom.gba", 0x00116738, 0x28 -.byte 0x98, 0x9d, 0x03, 0x02, 0x83, 0x01, 0x00, 0x00, 0x43, 0x00, 0x00, 0x00, 0x04, 0x01, 0xe0, 0x00, 0xac, 0x00, 0xbe, 0x00, 0x50, 0x00, 0x14, 0x00, 0x01, 0x00, 0x21, 0x00, 0x20, 0x00, 0x1f, 0x00 -.byte 0x20, 0x00, 0x00, 0x00, 0xf8, 0xa7, 0x00, 0x00 - -.global gUnknown_8116760 -gUnknown_8116760: @ 8116760 -@ replacing .incbin "baserom.gba", 0x00116760, 0x28 -.byte 0x98, 0x9d, 0x03, 0x02, 0x04, 0x01, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x8a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x05, 0x00, 0x01, 0x00, 0x10, 0x00, 0x14, 0x00, 0x14, 0x00 -.byte 0x10, 0x00, 0x00, 0x00, 0x40, 0x06, 0x00, 0x00 - -.global gUnknown_8116788 -gUnknown_8116788: @ 8116788 -.byte 0x06, 0x63, 0x00, 0x00 - -.global gUnknown_811678C -gUnknown_811678C: @ 811678C -.byte 0x0a, 0x63, 0x00, 0x00 - -.global gUnknown_8116790 -gUnknown_8116790: @ 8116790 -.byte 0x0c, 0x63, 0x00, 0x00 - -.global gUnknown_8116794 -gUnknown_8116794: @ 8116794 -@ replacing .incbin "baserom.gba", 0x00116794, 0x28 -.byte 0x98, 0x9d, 0x03, 0x02, 0x99, 0x01, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x6c, 0x00, 0x2b, 0x00, 0xb9, 0x00, 0x86, 0x00, 0x7d, 0x00, 0x1e, 0x00, 0x01, 0x00, 0x3c, 0x00, 0x3b, 0x00, 0x2a, 0x00 -.byte 0x2c, 0x00, 0x00, 0x00, 0xf8, 0x2b, 0x04, 0x00 - -.global gUnknown_81167BC -gUnknown_81167BC: @ 81167BC -@ replacing .incbin "baserom.gba", 0x001167bc, 0x28 -.byte 0x98, 0x9d, 0x03, 0x02, 0x98, 0x01, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x6c, 0x00, 0xe1, 0x00, 0xb9, 0x00, 0x86, 0x00, 0x78, 0x00, 0x1c, 0x00, 0x01, 0x00, 0x3a, 0x00, 0x39, 0x00, 0x28, 0x00 -.byte 0x2b, 0x00, 0x00, 0x00, 0x98, 0xbe, 0x03, 0x00 - -.global gUnknown_81167E4 -gUnknown_81167E4: @ 81167E4 -.byte 0x00, 0x00 -.byte 0x36, 0x00 - -.global gUnknown_81167E8 -gUnknown_81167E8: @ 81167E8 -.byte 0x48, 0x00, 0x00, 0x00 - -.global gUnknown_81167EC -gUnknown_81167EC: @ 81167EC -.string "{CENTER_ALIGN}The rescue rank went up from\n" -.string "{CENTER_ALIGN}{MOVE_ITEM_0} to {MOVE_ITEM_1}!\0" -.align 2,0 - -.global gUnknown_811681C -gUnknown_811681C: @ 811681C -@ replacing .incbin "baserom.gba", 0x11681C, 0x28 -.byte 0x98, 0x9d, 0x03, 0x02, 0x33, 0x01, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0xea, 0x00, 0x38, 0x00 -.byte 0xbb, 0x00, 0xd9, 0x00, 0x35, 0x00, 0x05, 0x00, 0x01, 0x00, 0x12, 0x00, 0x12, 0x00, 0x0b, 0x00 -.byte 0x0a, 0x00, 0x00, 0x00, 0xf0, 0x0a, 0x00, 0x00 - -.global gUnknown_8116844 -gUnknown_8116844: @ 8116844 -.byte 0x00, 0x00, 0x52, 0x00 - -.global gUnknown_8116848 -gUnknown_8116848: @ 8116848 -.string "GroundScript unlock %3d\0" -.align 2,0 - -.global SearchScriptLabelText -SearchScriptLabelText: -.string "_SearchScriptLabel\0" -.align 2,0 -.4byte GroundScriptFile_Text -.byte 0xbe, 0x16, 0x00, 0x00 -.4byte SearchScriptLabelText -.string "Script label search error %d\0" -.align 2,0 -.string "pksdir0\0" -.align 2,0 - -.global gUnknown_81168A8 -gUnknown_81168A8: @ 81168A8 -@ replacing .incbin "baserom.gba", 0x1168A8, 0x67C -.byte 0xb2, 0x00, 0xb2, 0x00, 0xb2, 0x00, 0xff, 0xff, 0xff, 0xff, 0x67, 0x01, 0x00, 0x00, 0x00, 0x00 -.byte 0x01, 0x01, 0x00, 0x00, 0x09, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x7f, 0x00, 0x81, 0x00, 0x68, 0x01 -.byte 0x01, 0x00, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x09, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x88, 0x00 -.byte 0x8a, 0x00, 0x69, 0x01, 0x02, 0x00, 0x02, 0x00, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x0c, 0x00 -.byte 0x0c, 0x00, 0xff, 0xff, 0xff, 0xff, 0x69, 0x01, 0x02, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00 -.byte 0x09, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x94, 0x00, 0x96, 0x00, 0x6a, 0x01, 0x03, 0x00, 0x03, 0x00 -.byte 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x0c, 0x00, 0x0c, 0x00, 0xff, 0xff, 0xff, 0xff, 0x6a, 0x01 -.byte 0x03, 0x00, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x09, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x9b, 0x00 -.byte 0x9d, 0x00, 0x6b, 0x01, 0x04, 0x00, 0x04, 0x00, 0x01, 0x01, 0x00, 0x00, 0x09, 0x00, 0xbd, 0x00 -.byte 0x0c, 0x00, 0xa2, 0x00, 0xa4, 0x00, 0x6c, 0x01, 0x05, 0x00, 0x05, 0x00, 0x01, 0x01, 0x00, 0x00 -.byte 0xff, 0xff, 0x0c, 0x00, 0xbd, 0x00, 0xff, 0xff, 0xff, 0xff, 0x6c, 0x01, 0x06, 0x00, 0x05, 0x00 -.byte 0x01, 0x01, 0x00, 0x00, 0x09, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0xaa, 0x00, 0xac, 0x00, 0x6d, 0x01 -.byte 0x07, 0x00, 0x06, 0x00, 0x01, 0x01, 0x00, 0x00, 0xc1, 0x00, 0xc2, 0x00, 0xc1, 0x00, 0xff, 0xff -.byte 0xff, 0xff, 0x6e, 0x01, 0x08, 0x00, 0x07, 0x00, 0x01, 0x01, 0x00, 0x00, 0xc3, 0x00, 0xc4, 0x00 -.byte 0xc3, 0x00, 0xff, 0xff, 0xff, 0xff, 0x6f, 0x01, 0x09, 0x00, 0x08, 0x00, 0x01, 0x01, 0x00, 0x00 -.byte 0xff, 0xff, 0xff, 0xff, 0xc4, 0x00, 0xff, 0xff, 0xff, 0xff, 0x6f, 0x01, 0x0a, 0x00, 0x08, 0x00 -.byte 0x01, 0x01, 0x00, 0x00, 0xc6, 0x00, 0xc7, 0x00, 0xc6, 0x00, 0xff, 0xff, 0xff, 0xff, 0x70, 0x01 -.byte 0x0b, 0x00, 0x09, 0x00, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xc7, 0x00, 0xff, 0xff -.byte 0xff, 0xff, 0x70, 0x01, 0x0c, 0x00, 0x09, 0x00, 0x01, 0x01, 0x00, 0x00, 0xc9, 0x00, 0xca, 0x00 -.byte 0xc9, 0x00, 0xff, 0xff, 0xff, 0xff, 0x71, 0x01, 0x0d, 0x00, 0x0a, 0x00, 0x01, 0x01, 0x00, 0x00 -.byte 0xff, 0xff, 0xff, 0xff, 0xca, 0x00, 0xff, 0xff, 0xff, 0xff, 0x71, 0x01, 0x0e, 0x00, 0x0a, 0x00 -.byte 0x01, 0x01, 0x00, 0x00, 0x09, 0x00, 0xcd, 0x00, 0x0c, 0x00, 0xde, 0x00, 0xe0, 0x00, 0x72, 0x01 -.byte 0x0f, 0x00, 0x0b, 0x00, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xcd, 0x00, 0xff, 0xff -.byte 0xff, 0xff, 0x72, 0x01, 0x10, 0x00, 0x0b, 0x00, 0x01, 0x01, 0x00, 0x00, 0x09, 0x00, 0xd0, 0x00 -.byte 0x0c, 0x00, 0xe6, 0x00, 0xe8, 0x00, 0x73, 0x01, 0x11, 0x00, 0x0c, 0x00, 0x01, 0x01, 0x00, 0x00 -.byte 0xff, 0xff, 0xff, 0xff, 0xd0, 0x00, 0xff, 0xff, 0xff, 0xff, 0x73, 0x01, 0x12, 0x00, 0x0c, 0x00 -.byte 0x01, 0x01, 0x00, 0x00, 0x09, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0xff, 0xff, 0xff, 0xff, 0x74, 0x01 -.byte 0x00, 0x00, 0x0d, 0x00, 0x01, 0x00, 0x00, 0x00, 0x09, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0xff, 0xff -.byte 0xff, 0xff, 0x75, 0x01, 0x2a, 0x00, 0x0e, 0x00, 0x01, 0x01, 0x00, 0x00, 0x09, 0x00, 0x0c, 0x00 -.byte 0x0c, 0x00, 0xff, 0xff, 0xff, 0xff, 0x76, 0x01, 0x35, 0x00, 0x0f, 0x00, 0x01, 0x01, 0x00, 0x00 -.byte 0x09, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0xff, 0xff, 0xff, 0xff, 0x77, 0x01, 0x13, 0x00, 0x10, 0x00 -.byte 0x01, 0x01, 0x00, 0x00, 0x09, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0xff, 0xff, 0xff, 0xff, 0x78, 0x01 -.byte 0x14, 0x00, 0x11, 0x00, 0x01, 0x01, 0x00, 0x00, 0x09, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0xff, 0xff -.byte 0xff, 0xff, 0x79, 0x01, 0x15, 0x00, 0x12, 0x00, 0x01, 0x01, 0x00, 0x00, 0x09, 0x00, 0x0c, 0x00 -.byte 0x0c, 0x00, 0xff, 0xff, 0xff, 0xff, 0x7a, 0x01, 0x07, 0x00, 0x13, 0x00, 0x01, 0x01, 0x00, 0x00 -.byte 0x09, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0xff, 0xff, 0xff, 0xff, 0x7b, 0x01, 0x22, 0x00, 0x14, 0x00 -.byte 0x01, 0x01, 0x00, 0x00, 0x09, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0xff, 0xff, 0xff, 0xff, 0x7c, 0x01 -.byte 0x25, 0x00, 0x15, 0x00, 0x01, 0x01, 0x00, 0x00, 0x09, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0xff, 0xff -.byte 0xff, 0xff, 0x7d, 0x01, 0x23, 0x00, 0x16, 0x00, 0x01, 0x01, 0x00, 0x00, 0x09, 0x00, 0x0c, 0x00 -.byte 0x0c, 0x00, 0xff, 0xff, 0xff, 0xff, 0x7e, 0x01, 0x3c, 0x00, 0x17, 0x00, 0x01, 0x01, 0x00, 0x00 -.byte 0x09, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x01, 0x17, 0x00, 0x18, 0x00 -.byte 0x01, 0x01, 0x00, 0x00, 0x09, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0xff, 0xff, 0xff, 0xff, 0x80, 0x01 -.byte 0x1d, 0x00, 0x19, 0x00, 0x01, 0x01, 0x00, 0x00, 0x09, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0xff, 0xff -.byte 0xff, 0xff, 0x81, 0x01, 0x1c, 0x00, 0x1a, 0x00, 0x01, 0x01, 0x00, 0x00, 0x09, 0x00, 0x0c, 0x00 -.byte 0x0c, 0x00, 0xff, 0xff, 0xff, 0xff, 0x82, 0x01, 0x1b, 0x00, 0x1b, 0x00, 0x01, 0x01, 0x00, 0x00 -.byte 0x09, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0xff, 0xff, 0xff, 0xff, 0x83, 0x01, 0x1a, 0x00, 0x1c, 0x00 -.byte 0x01, 0x01, 0x00, 0x00, 0xc9, 0x00, 0xca, 0x00, 0xc9, 0x00, 0x5a, 0x01, 0x5a, 0x01, 0x84, 0x01 -.byte 0x0d, 0x00, 0x1d, 0x00, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xca, 0x00, 0xff, 0xff -.byte 0xff, 0xff, 0x84, 0x01, 0x16, 0x00, 0x1d, 0x00, 0x01, 0x01, 0x00, 0x00, 0x09, 0x00, 0x0c, 0x00 -.byte 0x0c, 0x00, 0x5e, 0x01, 0x5e, 0x01, 0x85, 0x01, 0x28, 0x00, 0x1e, 0x00, 0x01, 0x01, 0x00, 0x00 -.byte 0x09, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0xff, 0xff, 0xff, 0xff, 0x8c, 0x01, 0x1f, 0x00, 0xff, 0xff -.byte 0x01, 0x01, 0x00, 0x00, 0x09, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0xff, 0xff, 0xff, 0xff, 0x8c, 0x01 -.byte 0x20, 0x00, 0xff, 0xff, 0x01, 0x01, 0x00, 0x00, 0x09, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0xff, 0xff -.byte 0xff, 0xff, 0x8c, 0x01, 0x21, 0x00, 0xff, 0xff, 0x01, 0x01, 0x00, 0x00, 0x09, 0x00, 0x0c, 0x00 -.byte 0x0c, 0x00, 0xff, 0xff, 0xff, 0xff, 0x8c, 0x01, 0x24, 0x00, 0xff, 0xff, 0x01, 0x01, 0x00, 0x00 -.byte 0x09, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0xff, 0xff, 0xff, 0xff, 0x8c, 0x01, 0x26, 0x00, 0xff, 0xff -.byte 0x01, 0x01, 0x00, 0x00, 0x09, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0xff, 0xff, 0xff, 0xff, 0x8c, 0x01 -.byte 0x29, 0x00, 0xff, 0xff, 0x01, 0x01, 0x00, 0x00, 0x09, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0xff, 0xff -.byte 0xff, 0xff, 0x8c, 0x01, 0x38, 0x00, 0xff, 0xff, 0x01, 0x01, 0x00, 0x00, 0x09, 0x00, 0x0c, 0x00 -.byte 0x0c, 0x00, 0xff, 0xff, 0xff, 0xff, 0x8c, 0x01, 0x39, 0x00, 0xff, 0xff, 0x01, 0x01, 0x00, 0x00 -.byte 0x09, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0xff, 0xff, 0xff, 0xff, 0x8c, 0x01, 0x3a, 0x00, 0xff, 0xff -.byte 0x01, 0x01, 0x00, 0x00, 0x09, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0xff, 0xff, 0xff, 0xff, 0x8c, 0x01 -.byte 0x3b, 0x00, 0xff, 0xff, 0x01, 0x01, 0x00, 0x00, 0x09, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0xff, 0xff -.byte 0xff, 0xff, 0x86, 0x01, 0x3e, 0x00, 0xff, 0xff, 0x01, 0x01, 0x00, 0x00, 0x09, 0x00, 0x0c, 0x00 -.byte 0x0c, 0x00, 0xff, 0xff, 0xff, 0xff, 0x87, 0x01, 0x2b, 0x00, 0xff, 0xff, 0x01, 0x01, 0x00, 0x00 -.byte 0x09, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0xff, 0xff, 0xff, 0xff, 0x88, 0x01, 0x2c, 0x00, 0xff, 0xff -.byte 0x01, 0x01, 0x00, 0x00, 0x09, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0xff, 0xff, 0xff, 0xff, 0x89, 0x01 -.byte 0x2d, 0x00, 0xff, 0xff, 0x01, 0x01, 0x00, 0x00, 0x09, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0xff, 0xff -.byte 0xff, 0xff, 0x8a, 0x01, 0x2e, 0x00, 0xff, 0xff, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff -.byte 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x8d, 0x01, 0x4b, 0x00, 0xff, 0xff, 0x01, 0x01, 0x00, 0x00 -.byte 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x8d, 0x01, 0x4c, 0x00, 0xff, 0xff -.byte 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x8d, 0x01 -.byte 0x4d, 0x00, 0xff, 0xff, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff -.byte 0xff, 0xff, 0x8d, 0x01, 0x4e, 0x00, 0xff, 0xff, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff -.byte 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x8d, 0x01, 0x4f, 0x00, 0xff, 0xff, 0x01, 0x01, 0x00, 0x00 -.byte 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x8d, 0x01, 0x50, 0x00, 0xff, 0xff -.byte 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x8d, 0x01 -.byte 0x51, 0x00, 0xff, 0xff, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff -.byte 0xff, 0xff, 0x8d, 0x01, 0x52, 0x00, 0xff, 0xff, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff -.byte 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x8d, 0x01, 0x53, 0x00, 0xff, 0xff, 0x01, 0x01, 0x00, 0x00 -.byte 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x8d, 0x01, 0x54, 0x00, 0xff, 0xff -.byte 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x8d, 0x01 -.byte 0x55, 0x00, 0xff, 0xff, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff -.byte 0xff, 0xff, 0x8d, 0x01, 0x56, 0x00, 0xff, 0xff, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff -.byte 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x8d, 0x01, 0x57, 0x00, 0xff, 0xff, 0x01, 0x01, 0x00, 0x00 -.byte 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x8d, 0x01, 0x58, 0x00, 0xff, 0xff -.byte 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x8d, 0x01 -.byte 0x59, 0x00, 0xff, 0xff, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff -.byte 0xff, 0xff, 0x8d, 0x01, 0x5a, 0x00, 0xff, 0xff, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff -.byte 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x8d, 0x01, 0x5b, 0x00, 0xff, 0xff, 0x01, 0x01, 0x00, 0x00 -.byte 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x8d, 0x01, 0x5c, 0x00, 0xff, 0xff -.byte 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x8d, 0x01 -.byte 0x5d, 0x00, 0xff, 0xff, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff -.byte 0xff, 0xff, 0x8d, 0x01, 0x5e, 0x00, 0xff, 0xff, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff -.byte 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x8d, 0x01, 0x5f, 0x00, 0xff, 0xff, 0x01, 0x01, 0x00, 0x00 -.byte 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x8d, 0x01, 0x60, 0x00, 0xff, 0xff -.byte 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x8d, 0x01 -.byte 0x61, 0x00, 0xff, 0xff, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff -.byte 0xff, 0xff, 0x8e, 0x01, 0x2f, 0x00, 0xff, 0xff, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff -.byte 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x8f, 0x01, 0x30, 0x00, 0xff, 0xff, 0x01, 0x01, 0x00, 0x00 -.byte 0xff, 0xff, 0x05, 0x00, 0x05, 0x00, 0xff, 0xff, 0xff, 0xff, 0x8b, 0x01, 0x3f, 0x00, 0xff, 0xff -.byte 0x01, 0x00, 0x00, 0x00, 0xff, 0xff, 0x0c, 0x00, 0x0c, 0x00, 0xff, 0xff, 0xff, 0xff, 0x8c, 0x01 -.byte 0x3f, 0x00, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff -.byte 0xff, 0xff, 0x8d, 0x01, 0x3f, 0x00, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00 - -.global gUnknown_8116F24 -gUnknown_8116F24: @ 8116F24 -@ replacing .incbin "baserom.gba", 0x116F24, 0x76 -.byte 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x03, 0x00, 0x04, 0x00, 0x05, 0x00 -.byte 0x06, 0x00, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x08, 0x00, 0x09, 0x00, 0x0a, 0x00, 0x0b, 0x00 -.byte 0x0c, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0d, 0x00, 0x0e, 0x00, 0xff, 0xff -.byte 0x0f, 0x00, 0xff, 0xff, 0x10, 0x00, 0x11, 0x00, 0xff, 0xff, 0x12, 0x00, 0xff, 0xff, 0x13, 0x00 -.byte 0x14, 0x00, 0x15, 0x00, 0x16, 0x00, 0x17, 0x00, 0xff, 0xff, 0x18, 0x00, 0xff, 0xff, 0x19, 0x00 -.byte 0x1a, 0x00, 0xff, 0xff, 0x1b, 0x00, 0xff, 0xff, 0x1c, 0x00, 0xff, 0xff, 0x1d, 0x00, 0x1e, 0x00 -.byte 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - -.global gUnknown_8116F9A -gUnknown_8116F9A: @ 8116F9A -@ replacing .incbin "baserom.gba", 0x116F9A, 0x66 -.byte 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x04, 0x00, 0x06, 0x00, 0x07, 0x00, 0x09, 0x00, 0x0a, 0x00 -.byte 0x0b, 0x00, 0x0d, 0x00, 0x0f, 0x00, 0x11, 0x00, 0x13, 0x00, 0x15, 0x00, 0x16, 0x00, 0x17, 0x00 -.byte 0x18, 0x00, 0x19, 0x00, 0x1a, 0x00, 0x1b, 0x00, 0x1c, 0x00, 0x1d, 0x00, 0x1e, 0x00, 0x1f, 0x00 -.byte 0x20, 0x00, 0x21, 0x00, 0x22, 0x00, 0x23, 0x00, 0x24, 0x00, 0x25, 0x00, 0x27, 0x00, 0x28, 0x00 -.byte 0x29, 0x00, 0x2a, 0x00, 0x2b, 0x00, 0x2c, 0x00, 0x2d, 0x00, 0x2e, 0x00, 0x2f, 0x00, 0x30, 0x00 -.byte 0x31, 0x00, 0x32, 0x00, 0x33, 0x00, 0x34, 0x00, 0x35, 0x00, 0x36, 0x00, 0x00, 0x00, 0x70, 0x6b -.byte 0x73, 0x64, 0x69, 0x72, 0x30, 0x00 - -.global gUnknown_8117000 -gUnknown_8117000: @ 8117000 -@ Dungeon Names.. Segments too (i.e Sky Tower and Sky Tower Mid) -.4byte gUnknown_81172A8 -.4byte gUnknown_81172A8 -.4byte gUnknown_8117298 -.4byte gUnknown_8117288 -.4byte gUnknown_8117270 -.4byte gUnknown_8117270 -.4byte gUnknown_8117260 -.4byte gUnknown_8117260 -.4byte gUnknown_8117250 -.4byte gUnknown_8117240 -.4byte gUnknown_8117230 -.4byte gUnknown_8117230 -.4byte gUnknown_8117228 -.4byte gUnknown_811721C -.4byte gUnknown_8117208 -.4byte gUnknown_81171FC -.4byte gUnknown_81171EC -.4byte gUnknown_81171DC -.4byte gUnknown_81171D0 -.4byte gUnknown_81171C0 -.4byte gUnknown_81171B0 -.4byte gUnknown_8117198 -.4byte gUnknown_811718C -.4byte gUnknown_811717C -.4byte gUnknown_8117170 -.4byte gUnknown_8117160 -.4byte gUnknown_8117150 -.4byte gUnknown_8117140 -.4byte gUnknown_8117134 -.4byte gUnknown_8117124 -.4byte gUnknown_8117114 -.4byte gUnknown_8117100 -.4byte gUnknown_81170F4 -.4byte gUnknown_81170E4 -.4byte gUnknown_81170D4 -.4byte gUnknown_81170C4 -.4byte gUnknown_81170B8 -.4byte gUnknown_81170AC -.4byte gUnknown_811709C - -.global gUnknown_811709C -gUnknown_811709C: @ 811709C -.string "{COLOR RED_W}invalidity{RESET}\0" -.align 2,0 - -.global gUnknown_81170AC -gUnknown_81170AC: @ 81170AC -.string "{COLOR YELLOW_C}scene{RESET}\0" -.align 2,0 - -.global gUnknown_81170B8 -gUnknown_81170B8: @ 81170B8 -.string "New Game\0" -.align 2,0 - -.global gUnknown_81170C4 -gUnknown_81170C4: @ 81170C4 -.string "{COLOR YELLOW_C}direction{RESET}\0" -.align 2,0 - -.global gUnknown_81170D4 -gUnknown_81170D4: @ 81170D4 -.string "Western Cave\0" -.align 2,0 - -.global gUnknown_81170E4 -gUnknown_81170E4: @ 81170E4 -.string "Sky Tower Mid\0" -.align 2,0 - -.global gUnknown_81170F4 -gUnknown_81170F4: @ 81170F4 -.string "Sky Tower\0" -.align 2,0 - -.global gUnknown_8117100 -gUnknown_8117100: @ 8117100 -.string "Magma Cavern Mid\0" -.align 2,0 - -.global gUnknown_8117114 -gUnknown_8117114: @ 8117114 -.string "Magma Cavern\0" -.align 2,0 - -.global gUnknown_8117124 -gUnknown_8117124: @ 8117124 -.string "Mt. Freeze Mid\0" -.align 2,0 - -.global gUnknown_8117134 -gUnknown_8117134: @ 8117134 -.string "Mt. Freeze\0" -.align 2,0 - -.global gUnknown_8117140 -gUnknown_8117140: @ 8117140 -.string "Frosty Clearing\0" -.align 2,0 - -.global gUnknown_8117150 -gUnknown_8117150: @ 8117150 -.string "Frosty Forest\0" -.align 2,0 - -.global gUnknown_8117160 -gUnknown_8117160: @ 8117160 -.string "Mt. Blaze Mid\0" -.align 2,0 - -.global gUnknown_8117170 -gUnknown_8117170: @ 8117170 -.string "Mt. Blaze\0" -.align 2,0 - -.global gUnknown_811717C -gUnknown_811717C: @ 811717C -.string "Lapis Cave Exit\0" -.align 2,0 - -.global gUnknown_811718C -gUnknown_811718C: @ 811718C -.string "Lapis Cave\0" -.align 2,0 - -.global gUnknown_8117198 -gUnknown_8117198: @ 8117198 -.string "Hill of the Ancients\0" -.align 2,0 - -.global gUnknown_81171B0 -gUnknown_81171B0: @ 81171B0 -.string "Great Canyon\0" -.align 2,0 - -.global gUnknown_81171C0 -gUnknown_81171C0: @ 81171C0 -.string "Mt. Thunder Mid\0" -.align 2,0 - -.global gUnknown_81171D0 -gUnknown_81171D0: @ 81171D0 -.string "Mt. Thunder\0" -.align 2,0 - -.global gUnknown_81171DC -gUnknown_81171DC: @ 81171DC -.string "Silent Chasm\0" -.align 2,0 - -.global gUnknown_81171EC -gUnknown_81171EC: @ 81171EC -.string "Sinister Woods\0" -.align 2,0 - -.global gUnknown_81171FC -gUnknown_81171FC: @ 81171FC -.string "Mt. Steel\0" -.align 2,0 - -.global gUnknown_8117208 -gUnknown_8117208: @ 8117208 -.string "Thunderwave Cave\0" -.align 2,0 - -.global gUnknown_811721C -gUnknown_811721C: @ 811721C -.string "Tiny Woods\0" -.align 2,0 - -.global gUnknown_8117228 -gUnknown_8117228: @ 8117228 -.string "Dungeon\0" -.align 2,0 - -.global gUnknown_8117230 -gUnknown_8117230: @ 8117230 -.string "$t Team Base\0" -.align 2,0 - -.global gUnknown_8117240 -gUnknown_8117240: @ 8117240 -.string "Friend Areas\0" -.align 2,0 - -.global gUnknown_8117250 -gUnknown_8117250: @ 8117250 -.string "Luminous Cave\0" -.align 2,0 - -.global gUnknown_8117260 -gUnknown_8117260: @ 8117260 -.string "Makuhita Dojo\0" -.align 2,0 - -.global gUnknown_8117270 -gUnknown_8117270: @ 8117270 -.string "Pelipper Post Office\0" -.align 2,0 - -.global gUnknown_8117288 -gUnknown_8117288: @ 8117288 -.string "Whiscash Pond\0" -.align 2,0 - -.global gUnknown_8117298 -gUnknown_8117298: @ 8117298 -.string "Pokémon Square\0" -.align 2,0 - -.global gUnknown_81172A8 -gUnknown_81172A8: @ 81172A8 -.string "Square\0" -.align 2,0 diff --git a/data/data_8115F5C_2_.s b/data/data_8115F5C_2_.s new file mode 100644 index 000000000..0125c1399 --- /dev/null +++ b/data/data_8115F5C_2_.s @@ -0,0 +1,436 @@ +.section .rodata + + +.align 2,0 + + + + + +.global gUnknown_8116738 +gUnknown_8116738: @ 8116738 +@ replacing .incbin "baserom.gba", 0x00116738, 0x28 +.byte 0x98, 0x9d, 0x03, 0x02, 0x83, 0x01, 0x00, 0x00, 0x43, 0x00, 0x00, 0x00, 0x04, 0x01, 0xe0, 0x00, 0xac, 0x00, 0xbe, 0x00, 0x50, 0x00, 0x14, 0x00, 0x01, 0x00, 0x21, 0x00, 0x20, 0x00, 0x1f, 0x00 +.byte 0x20, 0x00, 0x00, 0x00, 0xf8, 0xa7, 0x00, 0x00 + +.global gUnknown_8116760 +gUnknown_8116760: @ 8116760 +@ replacing .incbin "baserom.gba", 0x00116760, 0x28 +.byte 0x98, 0x9d, 0x03, 0x02, 0x04, 0x01, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x8a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x05, 0x00, 0x01, 0x00, 0x10, 0x00, 0x14, 0x00, 0x14, 0x00 +.byte 0x10, 0x00, 0x00, 0x00, 0x40, 0x06, 0x00, 0x00 + +.global gUnknown_8116788 +gUnknown_8116788: @ 8116788 +.byte 0x06, 0x63, 0x00, 0x00 + +.global gUnknown_811678C +gUnknown_811678C: @ 811678C +.byte 0x0a, 0x63, 0x00, 0x00 + +.global gUnknown_8116790 +gUnknown_8116790: @ 8116790 +.byte 0x0c, 0x63, 0x00, 0x00 + +.global gUnknown_8116794 +gUnknown_8116794: @ 8116794 +@ replacing .incbin "baserom.gba", 0x00116794, 0x28 +.byte 0x98, 0x9d, 0x03, 0x02, 0x99, 0x01, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x6c, 0x00, 0x2b, 0x00, 0xb9, 0x00, 0x86, 0x00, 0x7d, 0x00, 0x1e, 0x00, 0x01, 0x00, 0x3c, 0x00, 0x3b, 0x00, 0x2a, 0x00 +.byte 0x2c, 0x00, 0x00, 0x00, 0xf8, 0x2b, 0x04, 0x00 + +.global gUnknown_81167BC +gUnknown_81167BC: @ 81167BC +@ replacing .incbin "baserom.gba", 0x001167bc, 0x28 +.byte 0x98, 0x9d, 0x03, 0x02, 0x98, 0x01, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x6c, 0x00, 0xe1, 0x00, 0xb9, 0x00, 0x86, 0x00, 0x78, 0x00, 0x1c, 0x00, 0x01, 0x00, 0x3a, 0x00, 0x39, 0x00, 0x28, 0x00 +.byte 0x2b, 0x00, 0x00, 0x00, 0x98, 0xbe, 0x03, 0x00 + +.global gUnknown_81167E4 +gUnknown_81167E4: @ 81167E4 +.byte 0x00, 0x00 +.byte 0x36, 0x00 + +.global gUnknown_81167E8 +gUnknown_81167E8: @ 81167E8 +.byte 0x48, 0x00, 0x00, 0x00 + +.global gUnknown_81167EC +gUnknown_81167EC: @ 81167EC +.string "{CENTER_ALIGN}The rescue rank went up from\n" +.string "{CENTER_ALIGN}{MOVE_ITEM_0} to {MOVE_ITEM_1}!\0" +.align 2,0 + +.global gUnknown_811681C +gUnknown_811681C: @ 811681C +@ replacing .incbin "baserom.gba", 0x11681C, 0x28 +.byte 0x98, 0x9d, 0x03, 0x02, 0x33, 0x01, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0xea, 0x00, 0x38, 0x00 +.byte 0xbb, 0x00, 0xd9, 0x00, 0x35, 0x00, 0x05, 0x00, 0x01, 0x00, 0x12, 0x00, 0x12, 0x00, 0x0b, 0x00 +.byte 0x0a, 0x00, 0x00, 0x00, 0xf0, 0x0a, 0x00, 0x00 + +.global gUnknown_8116844 +gUnknown_8116844: @ 8116844 +.byte 0x00, 0x00, 0x52, 0x00 + +.global gUnknown_8116848 +gUnknown_8116848: @ 8116848 +.string "GroundScript unlock %3d\0" +.align 2,0 + +.global SearchScriptLabelText +SearchScriptLabelText: +.string "_SearchScriptLabel\0" +.align 2,0 +.4byte GroundScriptFile_Text +.byte 0xbe, 0x16, 0x00, 0x00 +.4byte SearchScriptLabelText +.string "Script label search error %d\0" +.align 2,0 +.string "pksdir0\0" +.align 2,0 + +.global gUnknown_81168A8 +gUnknown_81168A8: @ 81168A8 +@ replacing .incbin "baserom.gba", 0x1168A8, 0x67C +.byte 0xb2, 0x00, 0xb2, 0x00, 0xb2, 0x00, 0xff, 0xff, 0xff, 0xff, 0x67, 0x01, 0x00, 0x00, 0x00, 0x00 +.byte 0x01, 0x01, 0x00, 0x00, 0x09, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x7f, 0x00, 0x81, 0x00, 0x68, 0x01 +.byte 0x01, 0x00, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x09, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x88, 0x00 +.byte 0x8a, 0x00, 0x69, 0x01, 0x02, 0x00, 0x02, 0x00, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x0c, 0x00 +.byte 0x0c, 0x00, 0xff, 0xff, 0xff, 0xff, 0x69, 0x01, 0x02, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00 +.byte 0x09, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x94, 0x00, 0x96, 0x00, 0x6a, 0x01, 0x03, 0x00, 0x03, 0x00 +.byte 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x0c, 0x00, 0x0c, 0x00, 0xff, 0xff, 0xff, 0xff, 0x6a, 0x01 +.byte 0x03, 0x00, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x09, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x9b, 0x00 +.byte 0x9d, 0x00, 0x6b, 0x01, 0x04, 0x00, 0x04, 0x00, 0x01, 0x01, 0x00, 0x00, 0x09, 0x00, 0xbd, 0x00 +.byte 0x0c, 0x00, 0xa2, 0x00, 0xa4, 0x00, 0x6c, 0x01, 0x05, 0x00, 0x05, 0x00, 0x01, 0x01, 0x00, 0x00 +.byte 0xff, 0xff, 0x0c, 0x00, 0xbd, 0x00, 0xff, 0xff, 0xff, 0xff, 0x6c, 0x01, 0x06, 0x00, 0x05, 0x00 +.byte 0x01, 0x01, 0x00, 0x00, 0x09, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0xaa, 0x00, 0xac, 0x00, 0x6d, 0x01 +.byte 0x07, 0x00, 0x06, 0x00, 0x01, 0x01, 0x00, 0x00, 0xc1, 0x00, 0xc2, 0x00, 0xc1, 0x00, 0xff, 0xff +.byte 0xff, 0xff, 0x6e, 0x01, 0x08, 0x00, 0x07, 0x00, 0x01, 0x01, 0x00, 0x00, 0xc3, 0x00, 0xc4, 0x00 +.byte 0xc3, 0x00, 0xff, 0xff, 0xff, 0xff, 0x6f, 0x01, 0x09, 0x00, 0x08, 0x00, 0x01, 0x01, 0x00, 0x00 +.byte 0xff, 0xff, 0xff, 0xff, 0xc4, 0x00, 0xff, 0xff, 0xff, 0xff, 0x6f, 0x01, 0x0a, 0x00, 0x08, 0x00 +.byte 0x01, 0x01, 0x00, 0x00, 0xc6, 0x00, 0xc7, 0x00, 0xc6, 0x00, 0xff, 0xff, 0xff, 0xff, 0x70, 0x01 +.byte 0x0b, 0x00, 0x09, 0x00, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xc7, 0x00, 0xff, 0xff +.byte 0xff, 0xff, 0x70, 0x01, 0x0c, 0x00, 0x09, 0x00, 0x01, 0x01, 0x00, 0x00, 0xc9, 0x00, 0xca, 0x00 +.byte 0xc9, 0x00, 0xff, 0xff, 0xff, 0xff, 0x71, 0x01, 0x0d, 0x00, 0x0a, 0x00, 0x01, 0x01, 0x00, 0x00 +.byte 0xff, 0xff, 0xff, 0xff, 0xca, 0x00, 0xff, 0xff, 0xff, 0xff, 0x71, 0x01, 0x0e, 0x00, 0x0a, 0x00 +.byte 0x01, 0x01, 0x00, 0x00, 0x09, 0x00, 0xcd, 0x00, 0x0c, 0x00, 0xde, 0x00, 0xe0, 0x00, 0x72, 0x01 +.byte 0x0f, 0x00, 0x0b, 0x00, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xcd, 0x00, 0xff, 0xff +.byte 0xff, 0xff, 0x72, 0x01, 0x10, 0x00, 0x0b, 0x00, 0x01, 0x01, 0x00, 0x00, 0x09, 0x00, 0xd0, 0x00 +.byte 0x0c, 0x00, 0xe6, 0x00, 0xe8, 0x00, 0x73, 0x01, 0x11, 0x00, 0x0c, 0x00, 0x01, 0x01, 0x00, 0x00 +.byte 0xff, 0xff, 0xff, 0xff, 0xd0, 0x00, 0xff, 0xff, 0xff, 0xff, 0x73, 0x01, 0x12, 0x00, 0x0c, 0x00 +.byte 0x01, 0x01, 0x00, 0x00, 0x09, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0xff, 0xff, 0xff, 0xff, 0x74, 0x01 +.byte 0x00, 0x00, 0x0d, 0x00, 0x01, 0x00, 0x00, 0x00, 0x09, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0xff, 0xff +.byte 0xff, 0xff, 0x75, 0x01, 0x2a, 0x00, 0x0e, 0x00, 0x01, 0x01, 0x00, 0x00, 0x09, 0x00, 0x0c, 0x00 +.byte 0x0c, 0x00, 0xff, 0xff, 0xff, 0xff, 0x76, 0x01, 0x35, 0x00, 0x0f, 0x00, 0x01, 0x01, 0x00, 0x00 +.byte 0x09, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0xff, 0xff, 0xff, 0xff, 0x77, 0x01, 0x13, 0x00, 0x10, 0x00 +.byte 0x01, 0x01, 0x00, 0x00, 0x09, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0xff, 0xff, 0xff, 0xff, 0x78, 0x01 +.byte 0x14, 0x00, 0x11, 0x00, 0x01, 0x01, 0x00, 0x00, 0x09, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0xff, 0xff +.byte 0xff, 0xff, 0x79, 0x01, 0x15, 0x00, 0x12, 0x00, 0x01, 0x01, 0x00, 0x00, 0x09, 0x00, 0x0c, 0x00 +.byte 0x0c, 0x00, 0xff, 0xff, 0xff, 0xff, 0x7a, 0x01, 0x07, 0x00, 0x13, 0x00, 0x01, 0x01, 0x00, 0x00 +.byte 0x09, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0xff, 0xff, 0xff, 0xff, 0x7b, 0x01, 0x22, 0x00, 0x14, 0x00 +.byte 0x01, 0x01, 0x00, 0x00, 0x09, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0xff, 0xff, 0xff, 0xff, 0x7c, 0x01 +.byte 0x25, 0x00, 0x15, 0x00, 0x01, 0x01, 0x00, 0x00, 0x09, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0xff, 0xff +.byte 0xff, 0xff, 0x7d, 0x01, 0x23, 0x00, 0x16, 0x00, 0x01, 0x01, 0x00, 0x00, 0x09, 0x00, 0x0c, 0x00 +.byte 0x0c, 0x00, 0xff, 0xff, 0xff, 0xff, 0x7e, 0x01, 0x3c, 0x00, 0x17, 0x00, 0x01, 0x01, 0x00, 0x00 +.byte 0x09, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x01, 0x17, 0x00, 0x18, 0x00 +.byte 0x01, 0x01, 0x00, 0x00, 0x09, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0xff, 0xff, 0xff, 0xff, 0x80, 0x01 +.byte 0x1d, 0x00, 0x19, 0x00, 0x01, 0x01, 0x00, 0x00, 0x09, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0xff, 0xff +.byte 0xff, 0xff, 0x81, 0x01, 0x1c, 0x00, 0x1a, 0x00, 0x01, 0x01, 0x00, 0x00, 0x09, 0x00, 0x0c, 0x00 +.byte 0x0c, 0x00, 0xff, 0xff, 0xff, 0xff, 0x82, 0x01, 0x1b, 0x00, 0x1b, 0x00, 0x01, 0x01, 0x00, 0x00 +.byte 0x09, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0xff, 0xff, 0xff, 0xff, 0x83, 0x01, 0x1a, 0x00, 0x1c, 0x00 +.byte 0x01, 0x01, 0x00, 0x00, 0xc9, 0x00, 0xca, 0x00, 0xc9, 0x00, 0x5a, 0x01, 0x5a, 0x01, 0x84, 0x01 +.byte 0x0d, 0x00, 0x1d, 0x00, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xca, 0x00, 0xff, 0xff +.byte 0xff, 0xff, 0x84, 0x01, 0x16, 0x00, 0x1d, 0x00, 0x01, 0x01, 0x00, 0x00, 0x09, 0x00, 0x0c, 0x00 +.byte 0x0c, 0x00, 0x5e, 0x01, 0x5e, 0x01, 0x85, 0x01, 0x28, 0x00, 0x1e, 0x00, 0x01, 0x01, 0x00, 0x00 +.byte 0x09, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0xff, 0xff, 0xff, 0xff, 0x8c, 0x01, 0x1f, 0x00, 0xff, 0xff +.byte 0x01, 0x01, 0x00, 0x00, 0x09, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0xff, 0xff, 0xff, 0xff, 0x8c, 0x01 +.byte 0x20, 0x00, 0xff, 0xff, 0x01, 0x01, 0x00, 0x00, 0x09, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0xff, 0xff +.byte 0xff, 0xff, 0x8c, 0x01, 0x21, 0x00, 0xff, 0xff, 0x01, 0x01, 0x00, 0x00, 0x09, 0x00, 0x0c, 0x00 +.byte 0x0c, 0x00, 0xff, 0xff, 0xff, 0xff, 0x8c, 0x01, 0x24, 0x00, 0xff, 0xff, 0x01, 0x01, 0x00, 0x00 +.byte 0x09, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0xff, 0xff, 0xff, 0xff, 0x8c, 0x01, 0x26, 0x00, 0xff, 0xff +.byte 0x01, 0x01, 0x00, 0x00, 0x09, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0xff, 0xff, 0xff, 0xff, 0x8c, 0x01 +.byte 0x29, 0x00, 0xff, 0xff, 0x01, 0x01, 0x00, 0x00, 0x09, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0xff, 0xff +.byte 0xff, 0xff, 0x8c, 0x01, 0x38, 0x00, 0xff, 0xff, 0x01, 0x01, 0x00, 0x00, 0x09, 0x00, 0x0c, 0x00 +.byte 0x0c, 0x00, 0xff, 0xff, 0xff, 0xff, 0x8c, 0x01, 0x39, 0x00, 0xff, 0xff, 0x01, 0x01, 0x00, 0x00 +.byte 0x09, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0xff, 0xff, 0xff, 0xff, 0x8c, 0x01, 0x3a, 0x00, 0xff, 0xff +.byte 0x01, 0x01, 0x00, 0x00, 0x09, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0xff, 0xff, 0xff, 0xff, 0x8c, 0x01 +.byte 0x3b, 0x00, 0xff, 0xff, 0x01, 0x01, 0x00, 0x00, 0x09, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0xff, 0xff +.byte 0xff, 0xff, 0x86, 0x01, 0x3e, 0x00, 0xff, 0xff, 0x01, 0x01, 0x00, 0x00, 0x09, 0x00, 0x0c, 0x00 +.byte 0x0c, 0x00, 0xff, 0xff, 0xff, 0xff, 0x87, 0x01, 0x2b, 0x00, 0xff, 0xff, 0x01, 0x01, 0x00, 0x00 +.byte 0x09, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0xff, 0xff, 0xff, 0xff, 0x88, 0x01, 0x2c, 0x00, 0xff, 0xff +.byte 0x01, 0x01, 0x00, 0x00, 0x09, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0xff, 0xff, 0xff, 0xff, 0x89, 0x01 +.byte 0x2d, 0x00, 0xff, 0xff, 0x01, 0x01, 0x00, 0x00, 0x09, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0xff, 0xff +.byte 0xff, 0xff, 0x8a, 0x01, 0x2e, 0x00, 0xff, 0xff, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff +.byte 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x8d, 0x01, 0x4b, 0x00, 0xff, 0xff, 0x01, 0x01, 0x00, 0x00 +.byte 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x8d, 0x01, 0x4c, 0x00, 0xff, 0xff +.byte 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x8d, 0x01 +.byte 0x4d, 0x00, 0xff, 0xff, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff +.byte 0xff, 0xff, 0x8d, 0x01, 0x4e, 0x00, 0xff, 0xff, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff +.byte 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x8d, 0x01, 0x4f, 0x00, 0xff, 0xff, 0x01, 0x01, 0x00, 0x00 +.byte 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x8d, 0x01, 0x50, 0x00, 0xff, 0xff +.byte 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x8d, 0x01 +.byte 0x51, 0x00, 0xff, 0xff, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff +.byte 0xff, 0xff, 0x8d, 0x01, 0x52, 0x00, 0xff, 0xff, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff +.byte 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x8d, 0x01, 0x53, 0x00, 0xff, 0xff, 0x01, 0x01, 0x00, 0x00 +.byte 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x8d, 0x01, 0x54, 0x00, 0xff, 0xff +.byte 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x8d, 0x01 +.byte 0x55, 0x00, 0xff, 0xff, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff +.byte 0xff, 0xff, 0x8d, 0x01, 0x56, 0x00, 0xff, 0xff, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff +.byte 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x8d, 0x01, 0x57, 0x00, 0xff, 0xff, 0x01, 0x01, 0x00, 0x00 +.byte 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x8d, 0x01, 0x58, 0x00, 0xff, 0xff +.byte 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x8d, 0x01 +.byte 0x59, 0x00, 0xff, 0xff, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff +.byte 0xff, 0xff, 0x8d, 0x01, 0x5a, 0x00, 0xff, 0xff, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff +.byte 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x8d, 0x01, 0x5b, 0x00, 0xff, 0xff, 0x01, 0x01, 0x00, 0x00 +.byte 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x8d, 0x01, 0x5c, 0x00, 0xff, 0xff +.byte 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x8d, 0x01 +.byte 0x5d, 0x00, 0xff, 0xff, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff +.byte 0xff, 0xff, 0x8d, 0x01, 0x5e, 0x00, 0xff, 0xff, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff +.byte 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x8d, 0x01, 0x5f, 0x00, 0xff, 0xff, 0x01, 0x01, 0x00, 0x00 +.byte 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x8d, 0x01, 0x60, 0x00, 0xff, 0xff +.byte 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x8d, 0x01 +.byte 0x61, 0x00, 0xff, 0xff, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff +.byte 0xff, 0xff, 0x8e, 0x01, 0x2f, 0x00, 0xff, 0xff, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff +.byte 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x8f, 0x01, 0x30, 0x00, 0xff, 0xff, 0x01, 0x01, 0x00, 0x00 +.byte 0xff, 0xff, 0x05, 0x00, 0x05, 0x00, 0xff, 0xff, 0xff, 0xff, 0x8b, 0x01, 0x3f, 0x00, 0xff, 0xff +.byte 0x01, 0x00, 0x00, 0x00, 0xff, 0xff, 0x0c, 0x00, 0x0c, 0x00, 0xff, 0xff, 0xff, 0xff, 0x8c, 0x01 +.byte 0x3f, 0x00, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff +.byte 0xff, 0xff, 0x8d, 0x01, 0x3f, 0x00, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00 + +.global gUnknown_8116F24 +gUnknown_8116F24: @ 8116F24 +@ replacing .incbin "baserom.gba", 0x116F24, 0x76 +.byte 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x03, 0x00, 0x04, 0x00, 0x05, 0x00 +.byte 0x06, 0x00, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x08, 0x00, 0x09, 0x00, 0x0a, 0x00, 0x0b, 0x00 +.byte 0x0c, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0d, 0x00, 0x0e, 0x00, 0xff, 0xff +.byte 0x0f, 0x00, 0xff, 0xff, 0x10, 0x00, 0x11, 0x00, 0xff, 0xff, 0x12, 0x00, 0xff, 0xff, 0x13, 0x00 +.byte 0x14, 0x00, 0x15, 0x00, 0x16, 0x00, 0x17, 0x00, 0xff, 0xff, 0x18, 0x00, 0xff, 0xff, 0x19, 0x00 +.byte 0x1a, 0x00, 0xff, 0xff, 0x1b, 0x00, 0xff, 0xff, 0x1c, 0x00, 0xff, 0xff, 0x1d, 0x00, 0x1e, 0x00 +.byte 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + +.global gUnknown_8116F9A +gUnknown_8116F9A: @ 8116F9A +@ replacing .incbin "baserom.gba", 0x116F9A, 0x66 +.byte 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x04, 0x00, 0x06, 0x00, 0x07, 0x00, 0x09, 0x00, 0x0a, 0x00 +.byte 0x0b, 0x00, 0x0d, 0x00, 0x0f, 0x00, 0x11, 0x00, 0x13, 0x00, 0x15, 0x00, 0x16, 0x00, 0x17, 0x00 +.byte 0x18, 0x00, 0x19, 0x00, 0x1a, 0x00, 0x1b, 0x00, 0x1c, 0x00, 0x1d, 0x00, 0x1e, 0x00, 0x1f, 0x00 +.byte 0x20, 0x00, 0x21, 0x00, 0x22, 0x00, 0x23, 0x00, 0x24, 0x00, 0x25, 0x00, 0x27, 0x00, 0x28, 0x00 +.byte 0x29, 0x00, 0x2a, 0x00, 0x2b, 0x00, 0x2c, 0x00, 0x2d, 0x00, 0x2e, 0x00, 0x2f, 0x00, 0x30, 0x00 +.byte 0x31, 0x00, 0x32, 0x00, 0x33, 0x00, 0x34, 0x00, 0x35, 0x00, 0x36, 0x00, 0x00, 0x00, 0x70, 0x6b +.byte 0x73, 0x64, 0x69, 0x72, 0x30, 0x00 + +.global gUnknown_8117000 +gUnknown_8117000: @ 8117000 +@ Dungeon Names.. Segments too (i.e Sky Tower and Sky Tower Mid) +.4byte gUnknown_81172A8 +.4byte gUnknown_81172A8 +.4byte gUnknown_8117298 +.4byte gUnknown_8117288 +.4byte gUnknown_8117270 +.4byte gUnknown_8117270 +.4byte gUnknown_8117260 +.4byte gUnknown_8117260 +.4byte gUnknown_8117250 +.4byte gUnknown_8117240 +.4byte gUnknown_8117230 +.4byte gUnknown_8117230 +.4byte gUnknown_8117228 +.4byte gUnknown_811721C +.4byte gUnknown_8117208 +.4byte gUnknown_81171FC +.4byte gUnknown_81171EC +.4byte gUnknown_81171DC +.4byte gUnknown_81171D0 +.4byte gUnknown_81171C0 +.4byte gUnknown_81171B0 +.4byte gUnknown_8117198 +.4byte gUnknown_811718C +.4byte gUnknown_811717C +.4byte gUnknown_8117170 +.4byte gUnknown_8117160 +.4byte gUnknown_8117150 +.4byte gUnknown_8117140 +.4byte gUnknown_8117134 +.4byte gUnknown_8117124 +.4byte gUnknown_8117114 +.4byte gUnknown_8117100 +.4byte gUnknown_81170F4 +.4byte gUnknown_81170E4 +.4byte gUnknown_81170D4 +.4byte gUnknown_81170C4 +.4byte gUnknown_81170B8 +.4byte gUnknown_81170AC +.4byte gUnknown_811709C + +.global gUnknown_811709C +gUnknown_811709C: @ 811709C +.string "{COLOR RED_W}invalidity{RESET}\0" +.align 2,0 + +.global gUnknown_81170AC +gUnknown_81170AC: @ 81170AC +.string "{COLOR YELLOW_C}scene{RESET}\0" +.align 2,0 + +.global gUnknown_81170B8 +gUnknown_81170B8: @ 81170B8 +.string "New Game\0" +.align 2,0 + +.global gUnknown_81170C4 +gUnknown_81170C4: @ 81170C4 +.string "{COLOR YELLOW_C}direction{RESET}\0" +.align 2,0 + +.global gUnknown_81170D4 +gUnknown_81170D4: @ 81170D4 +.string "Western Cave\0" +.align 2,0 + +.global gUnknown_81170E4 +gUnknown_81170E4: @ 81170E4 +.string "Sky Tower Mid\0" +.align 2,0 + +.global gUnknown_81170F4 +gUnknown_81170F4: @ 81170F4 +.string "Sky Tower\0" +.align 2,0 + +.global gUnknown_8117100 +gUnknown_8117100: @ 8117100 +.string "Magma Cavern Mid\0" +.align 2,0 + +.global gUnknown_8117114 +gUnknown_8117114: @ 8117114 +.string "Magma Cavern\0" +.align 2,0 + +.global gUnknown_8117124 +gUnknown_8117124: @ 8117124 +.string "Mt. Freeze Mid\0" +.align 2,0 + +.global gUnknown_8117134 +gUnknown_8117134: @ 8117134 +.string "Mt. Freeze\0" +.align 2,0 + +.global gUnknown_8117140 +gUnknown_8117140: @ 8117140 +.string "Frosty Clearing\0" +.align 2,0 + +.global gUnknown_8117150 +gUnknown_8117150: @ 8117150 +.string "Frosty Forest\0" +.align 2,0 + +.global gUnknown_8117160 +gUnknown_8117160: @ 8117160 +.string "Mt. Blaze Mid\0" +.align 2,0 + +.global gUnknown_8117170 +gUnknown_8117170: @ 8117170 +.string "Mt. Blaze\0" +.align 2,0 + +.global gUnknown_811717C +gUnknown_811717C: @ 811717C +.string "Lapis Cave Exit\0" +.align 2,0 + +.global gUnknown_811718C +gUnknown_811718C: @ 811718C +.string "Lapis Cave\0" +.align 2,0 + +.global gUnknown_8117198 +gUnknown_8117198: @ 8117198 +.string "Hill of the Ancients\0" +.align 2,0 + +.global gUnknown_81171B0 +gUnknown_81171B0: @ 81171B0 +.string "Great Canyon\0" +.align 2,0 + +.global gUnknown_81171C0 +gUnknown_81171C0: @ 81171C0 +.string "Mt. Thunder Mid\0" +.align 2,0 + +.global gUnknown_81171D0 +gUnknown_81171D0: @ 81171D0 +.string "Mt. Thunder\0" +.align 2,0 + +.global gUnknown_81171DC +gUnknown_81171DC: @ 81171DC +.string "Silent Chasm\0" +.align 2,0 + +.global gUnknown_81171EC +gUnknown_81171EC: @ 81171EC +.string "Sinister Woods\0" +.align 2,0 + +.global gUnknown_81171FC +gUnknown_81171FC: @ 81171FC +.string "Mt. Steel\0" +.align 2,0 + +.global gUnknown_8117208 +gUnknown_8117208: @ 8117208 +.string "Thunderwave Cave\0" +.align 2,0 + +.global gUnknown_811721C +gUnknown_811721C: @ 811721C +.string "Tiny Woods\0" +.align 2,0 + +.global gUnknown_8117228 +gUnknown_8117228: @ 8117228 +.string "Dungeon\0" +.align 2,0 + +.global gUnknown_8117230 +gUnknown_8117230: @ 8117230 +.string "$t Team Base\0" +.align 2,0 + +.global gUnknown_8117240 +gUnknown_8117240: @ 8117240 +.string "Friend Areas\0" +.align 2,0 + +.global gUnknown_8117250 +gUnknown_8117250: @ 8117250 +.string "Luminous Cave\0" +.align 2,0 + +.global gUnknown_8117260 +gUnknown_8117260: @ 8117260 +.string "Makuhita Dojo\0" +.align 2,0 + +.global gUnknown_8117270 +gUnknown_8117270: @ 8117270 +.string "Pelipper Post Office\0" +.align 2,0 + +.global gUnknown_8117288 +gUnknown_8117288: @ 8117288 +.string "Whiscash Pond\0" +.align 2,0 + +.global gUnknown_8117298 +gUnknown_8117298: @ 8117298 +.string "Pokémon Square\0" +.align 2,0 + +.global gUnknown_81172A8 +gUnknown_81172A8: @ 81172A8 +.string "Square\0" +.align 2,0 diff --git a/include/debug.h b/include/debug.h index b43e1a61d..7c3172484 100644 --- a/include/debug.h +++ b/include/debug.h @@ -13,8 +13,10 @@ typedef struct DebugLocation #define DEBUG_LOC_PTR(file, line, func)((&((DebugLocation){file, line, func}))) -#define FATAL_ERROR_ARGS(file, line, str, ...) FatalError(DEBUG_LOC_PTR(file, line, __func__), str, __VA_ARGS__ ) -#define FATAL_ERROR(str, ...) FATAL_ERROR_ARGS(__FILE__, __LINE__, str, __VA_ARGS__) +#define FATAL_ERROR_ARGS(file, line, ...) FatalError(DEBUG_LOC_PTR(file, line, __func__), __VA_ARGS__ ) +// Custom function name instead of actual function's name. +#define FATAL_ERROR_ARGS2(file, line, func, ...) FatalError(DEBUG_LOC_PTR(file, line, func), __VA_ARGS__ ) +#define FATAL_ERROR(...) FATAL_ERROR_ARGS(__FILE__, __LINE__, __VA_ARGS__) void FatalError(const DebugLocation *debug, const char *text, ...) NORETURN; void Log(u8 num, const u8 *text, ...); diff --git a/include/pokemon.h b/include/pokemon.h index 15eefb369..40c9728c3 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -11,9 +11,11 @@ enum PokemonUnk0Flags { - FLAG_NONE = 0, - FLAG_UNK_1 = 1 << 0, - FLAG_ON_TEAM = 1 << 1, // Mon is not on "standby" + POKEMON_FLAG_NONE = 0, + POKEMON_FLAG_EXISTS = 1 << 0, + POKEMON_FLAG_ON_TEAM = 1 << 1, // Mon is not on "standby" + POKEMON_FLAG_x4000 = 1 << 14, + POKEMON_FLAG_x8000 = 1 << 15, }; // size: 0x1A4 @@ -106,33 +108,33 @@ void PrintPokeNameToBuffer(u8 *buffer, PokemonStruct1 *pokemon); void GetPokemonLevelData(LevelData* a1, s32 _id, s32 level); const u8* DecompressMoveID(const u8* a1, u16* moveID); bool8 sub_808DA44(s32, u32); -void sub_808D144(PokemonStruct1 *pokemon, struct unkStruct_808D144 *r1); +void ConvertStoryMonToPokemon(PokemonStruct1 *dst, struct StoryMonData *src); void sub_808CE74(s16 _species, bool32 _isLeader, u8* name); PokemonStruct1 *sub_808D278(s32 species); -static inline bool8 PokemonFlag1(PokemonStruct1 *mon) +static inline bool8 PokemonExists(PokemonStruct1 *mon) { - return (mon->unk0 & FLAG_UNK_1) != 0; + return (mon->flags & POKEMON_FLAG_EXISTS) != 0; } static inline bool8 PokemonFlag1Struct2(PokemonStruct2 *mon) { - return (mon->unk0 & FLAG_UNK_1) != 0; + return (mon->flags & POKEMON_FLAG_EXISTS) != 0; } static inline bool8 PokemonFlag2(PokemonStruct1 *mon) { - return (mon->unk0 & FLAG_ON_TEAM) != 0; + return (mon->flags & POKEMON_FLAG_ON_TEAM) != 0; } static inline bool8 PokemonFlag2Struct2(PokemonStruct2 *mon) { - return (mon->unk0 & FLAG_ON_TEAM) != 0; + return (mon->flags & POKEMON_FLAG_ON_TEAM) != 0; } static inline void SetPokemonFlag2(PokemonStruct1 *mon) { - mon->unk0 |= FLAG_ON_TEAM; + mon->flags |= POKEMON_FLAG_ON_TEAM; } static inline bool8 IsMonTeamLeader(PokemonStruct1 *pokemon) diff --git a/include/structs/str_pokemon.h b/include/structs/str_pokemon.h index 625048138..4e150ca8a 100644 --- a/include/structs/str_pokemon.h +++ b/include/structs/str_pokemon.h @@ -23,7 +23,7 @@ typedef struct unkPokeSubStruct_C // size: R=0x58 | B=0x40 typedef struct PokemonStruct1 { - /* R=0x0 | B=0x0 */ u16 unk0; // Probably a union: Sometimes ldrh and sometimes ldrb. Recruited?? Only 2 bits are serialized + /* R=0x0 | B=0x0 */ u16 flags; /* R=0x2 | B=0x2 */ bool8 isTeamLeader; /* R=0x3 | B=0x3 */ u8 level; /* R=0x4 | B=0x4 */ DungeonLocation dungeonLocation; @@ -50,7 +50,7 @@ typedef struct EvolveStage // size: R=0x64 | B=0x54 typedef struct PokemonStruct2 { - /* R=0x0 | B=0x0 */ u16 unk0; // corresponds to unk0 in PokemonStruct. Only 2 bits are serialized + /* R=0x0 | B=0x0 */ u16 flags; // corresponds to flags in PokemonStruct. /* R=0x2 | B=0x2 */ bool8 isTeamLeader; /* R=0x3 | B=0x3 */ u8 level; /* R=0x4 | B=0x4 */ DungeonLocation dungeonLocation; @@ -147,13 +147,7 @@ typedef struct LevelData u16 fillA; } LevelData; -// Definitely wrong but need to figure out better structure later -struct FaceData -{ - u8 *unk0[5]; -}; - -struct unkStruct_808D144 +struct StoryMonData { /* 0x0 */ u8 *name; /* 0x4 */ s16 speciesNum; diff --git a/ld_script.ld b/ld_script.ld index ecea8131c..92c044f84 100755 --- a/ld_script.ld +++ b/ld_script.ld @@ -719,6 +719,8 @@ SECTIONS { src/palette_util.o(.rodata); src/code_809A560.o(.rodata); data/data_8115F5C_2.o(.rodata); + src/ground_script.o(.rodata); + data/data_8115F5C_2_.o(.rodata); src/ground_bg.o(.rodata); data/data_8115F5C_2_1.o(.rodata); src/ground_sprite.o(.rodata); diff --git a/src/code_801AFA4.c b/src/code_801AFA4.c index 6deae7926..1daa33ba0 100644 --- a/src/code_801AFA4.c +++ b/src/code_801AFA4.c @@ -221,7 +221,7 @@ UNUSED static bool8 sub_801B374(u8 id) moveID = GetItemMoveID(id); for (i = 0; i < NUM_MONSTERS; i++, pokeStruct++) { - if ((pokeStruct->unk0 >> 1) & 1) + if (PokemonFlag2(pokeStruct)) if (CanMonLearnMove(moveID, pokeStruct->speciesNum)) return FALSE; } diff --git a/src/code_801D014.c b/src/code_801D014.c index 86e848783..89c1dc6e7 100644 --- a/src/code_801D014.c +++ b/src/code_801D014.c @@ -157,7 +157,7 @@ u32 sub_801D178(void) return 0; pokeStruct = sub_808D3F8(); - if (!(pokeStruct->unk0 >> 1 & 1)) + if (!(pokeStruct->flags >> 1 & 1)) _ret4: return 4; diff --git a/src/code_806FDF4.c b/src/code_806FDF4.c index a4301e022..eeeca0db9 100644 --- a/src/code_806FDF4.c +++ b/src/code_806FDF4.c @@ -276,7 +276,7 @@ bool8 sub_806FA5C(Entity *entity1, Entity *entity2, struct unkStruct_8069D4C *pa } sub_8068FE0(entity2,500,entity1); pokeStruct2 = &gRecruitedPokemonRef->pokemon2[pokeIndex]; - pokeStruct2->unk0 = 3; + pokeStruct2->flags = 3; pokeStruct2->isTeamLeader = FALSE; pokeStruct2->level = param_3->level; pokeStruct2->IQ = 1; @@ -308,7 +308,7 @@ bool8 sub_806FA5C(Entity *entity1, Entity *entity2, struct unkStruct_8069D4C *pa if (sub_806B8CC(param_3->id,param_3->pos.x,param_3->pos.y,pokeStruct2,&local_2c,0,1) == 0) { LogMessageByIdWithPopupCheckUser(entity1,gUnknown_80FA058); - pokeStruct2->unk0 = 0; + pokeStruct2->flags = 0; } else { sub_8083D88(); @@ -399,7 +399,7 @@ bool8 sub_806FDF4(Entity *entity1,Entity *entity2,Entity **entityPtr) for(index = 0; index < MAX_TEAM_MEMBERS; index++) { - if (((u8)(index[gRecruitedPokemonRef->pokemon2].unk0) & 1) == 0) break; + if (((u8)(index[gRecruitedPokemonRef->pokemon2].flags) & 1) == 0) break; } if (index == MAX_TEAM_MEMBERS) { @@ -408,7 +408,7 @@ bool8 sub_806FDF4(Entity *entity1,Entity *entity2,Entity **entityPtr) else { friendArea = GetFriendArea(local_74.id); pokeStruct2 = &gRecruitedPokemonRef->pokemon2[index]; - pokeStruct2->unk0 = 3; + pokeStruct2->flags = 3; pokeStruct2->isTeamLeader = FALSE; pokeStruct2->level = local_74.level; pokeStruct2->IQ = 1; @@ -443,7 +443,7 @@ bool8 sub_806FDF4(Entity *entity1,Entity *entity2,Entity **entityPtr) IncrementAdventureNumJoined(); sub_8068FE0(entity2,500,entity1); if (sub_806B8CC(local_74.id,local_74.pos.x,local_74.pos.y,pokeStruct2,&local_2c,0,0) == 0) { - pokeStruct2->unk0 = 0; + pokeStruct2->flags = 0; } else { if (DisplayDungeonYesNoMessage(0,gUnknown_80FA090,1) == 1) { diff --git a/src/code_8094F88.c b/src/code_8094F88.c index 84382e23c..f97824340 100644 --- a/src/code_8094F88.c +++ b/src/code_8094F88.c @@ -341,7 +341,7 @@ u32 sub_80954CC(u8 *buffer, u32 size) mon = &gUnknown_203B484->unk4; memset(mon, 0, sizeof(PokemonStruct1)); - ReadBits(&backup, &mon->unk0, 2); + ReadBits(&backup, &mon->flags, 2); ReadBits(&backup, &mon->isTeamLeader, 1); ReadBits(&backup, &mon->level, 7); ReadDungeonLocationBits(&backup, &mon->dungeonLocation); @@ -386,7 +386,7 @@ u32 sub_8095624(u8 *buffer, u32 b) mon = &gUnknown_203B484->unk4; - WriteBits(&backup, &mon->unk0, 2); + WriteBits(&backup, &mon->flags, 2); WriteBits(&backup, &mon->isTeamLeader, 1); WriteBits(&backup, &mon->level, 7); WriteDungeonLocationBits(&backup, &mon->dungeonLocation); diff --git a/src/code_8097670.c b/src/code_8097670.c index a988088c0..960bf0c3d 100644 --- a/src/code_8097670.c +++ b/src/code_8097670.c @@ -229,7 +229,7 @@ void UpdateAdventureAchievements(void) SetAdventureAchievement(AA_ALL_FRIEND_AREAS); for (i = 0; i < NUM_MONSTERS; i++) { - if (PokemonFlag1(&gRecruitedPokemonRef->pokemon[i])) { + if (PokemonExists(&gRecruitedPokemonRef->pokemon[i])) { s32 species = gRecruitedPokemonRef->pokemon[i].speciesNum; gUnknown_203B494->unk1C[species / 32] |= 1 << species % 32; diff --git a/src/debug_menu3.c b/src/debug_menu3.c index 7c1fb14c5..5bf54736d 100644 --- a/src/debug_menu3.c +++ b/src/debug_menu3.c @@ -225,8 +225,8 @@ static bool8 sub_803ABC8(void) mon = &gRecruitedPokemonRef->pokemon[i]; - if ((mask & mon->unk0) != 0 - && ((mon->unk0 >> 1) & mask) != 0 + if ((mask & mon->flags) != 0 + && ((mon->flags >> 1) & mask) != 0 && sUnknown_203B3F4->friendArea == GetFriendArea(mon->speciesNum)) return FALSE; diff --git a/src/dungeon_8067A80.c b/src/dungeon_8067A80.c index 609e02600..915da7921 100644 --- a/src/dungeon_8067A80.c +++ b/src/dungeon_8067A80.c @@ -101,7 +101,7 @@ void sub_8067A80(u8 a0, s32 a1, s32 a2, PokemonStruct1 **a3) gUnknown_202F30C = 0; r10 = 0; for (i = 0; i < a2; i++) { - a3[i]->unk0 &= ~(0x8000); + a3[i]->flags &= ~(POKEMON_FLAG_x8000); } while (1) { @@ -266,7 +266,7 @@ void sub_8067A80(u8 a0, s32 a1, s32 a2, PokemonStruct1 **a3) AddActionToDungeonSubMenu(0x29, 0); AddActionToDungeonSubMenu(0x2A, 0); AddActionToDungeonSubMenu(0x40, 0); - if (a3[arrId]->unk0 & 0x8000) { + if (a3[arrId]->flags & POKEMON_FLAG_x8000) { SetActionUnusableInDungeonSubMenu(0x29); } else { @@ -314,11 +314,11 @@ void sub_8067A80(u8 a0, s32 a1, s32 a2, PokemonStruct1 **a3) DungeonRunFrameActions(0x37); if (r7 != 0) { if (gDungeonMenu.menuIndex == 0) { - a3[arrId]->unk0 |= 0x8000; + a3[arrId]->flags |= POKEMON_FLAG_x8000; sub_8068310(a2, a3); } else if (gDungeonMenu.menuIndex == 1) { - a3[arrId]->unk0 &= ~(0x8000); + a3[arrId]->flags &= ~(POKEMON_FLAG_x8000); sub_8068310(a2, a3); } else { @@ -352,14 +352,14 @@ void sub_8067F00(u8 a0, PokemonStruct1 **a1, s32 a2_, s32 a3, s32 a4) PrintColoredPokeNameToBuffer(gFormatBuffer_Monsters[0], a1[a2], 0); sub_808D930(gFormatBuffer_Monsters[1], a1[a2]->speciesNum); gFormatArgs[0] = a2 + 1; - if (a1[a2]->unk0 & 0x8000) { + if (a1[a2]->flags & POKEMON_FLAG_x8000) { InlineStrcpy(gFormatBuffer_Items[0], _("{STAR_BULLET}")); } else { InlineStrcpy(gFormatBuffer_Items[0], _("{ICON_BLANK}")); } - if (a1[a2]->unk0 & 0x4000) { + if (a1[a2]->flags & POKEMON_FLAG_x4000) { PrintFormattedStringOnWindow(7, y, _("{MOVE_ITEM_0}{color CYAN}$v02:{POKEMON_0}{reset}"), 0, '\0'); } else { @@ -522,7 +522,7 @@ void sub_8068310(s32 n, PokemonStruct1 **monPtrs) s32 counter = 0; for (i = 0; i < n; i++) { - if ((monPtrs[i]->unk0 & 0x8000) != 0) { + if ((monPtrs[i]->flags & POKEMON_FLAG_x8000) != 0) { counter++; } } diff --git a/src/dungeon_generation_fixed.c b/src/dungeon_generation_fixed.c index d98f66bfb..f89c68f16 100644 --- a/src/dungeon_generation_fixed.c +++ b/src/dungeon_generation_fixed.c @@ -1083,7 +1083,7 @@ static bool8 sub_805210C(u8 itemId) } for (i = 0; i < NUM_MONSTERS; i++) { - if (PokemonFlag1(&gRecruitedPokemonRef->pokemon[i])) { + if (PokemonExists(&gRecruitedPokemonRef->pokemon[i])) { if (MonHasItem(&gRecruitedPokemonRef->pokemon[i]) && gRecruitedPokemonRef->pokemon[i].heldItem.id == itemId) return TRUE; } diff --git a/src/dungeon_info.c b/src/dungeon_info.c index 7c5c20428..a56d930a1 100644 --- a/src/dungeon_info.c +++ b/src/dungeon_info.c @@ -2567,7 +2567,7 @@ u32 sub_809034C(u8 dungeonIndex, s32 speciesId_, u8 *buffer, bool32 requireHm_, for (i = 0; i < NUM_MONSTERS; i++) { struct PokemonStruct1 *mon = &gRecruitedPokemonRef->pokemon[i]; - if (PokemonFlag1(mon) && PokemonFlag2(mon)) { + if (PokemonExists(mon) && PokemonFlag2(mon)) { if (mon->heldItem.id != 0) { sp_0xf0++; } @@ -2612,7 +2612,7 @@ u32 sub_809034C(u8 dungeonIndex, s32 speciesId_, u8 *buffer, bool32 requireHm_, for (i = 0; i < NUM_MONSTERS; i++) { struct PokemonStruct1 *mon = &gRecruitedPokemonRef->pokemon[i]; - if (PokemonFlag1(mon) && PokemonFlag2(mon)){ + if (PokemonExists(mon) && PokemonFlag2(mon)){ bodySize += GetBodySize(mon->speciesNum); } } @@ -2656,7 +2656,7 @@ u32 sub_809034C(u8 dungeonIndex, s32 speciesId_, u8 *buffer, bool32 requireHm_, for (otherSpeciesId = 0; otherSpeciesId < NUM_MONSTERS; otherSpeciesId++) { struct PokemonStruct1 *mon = &gRecruitedPokemonRef->pokemon[otherSpeciesId]; - if (PokemonFlag1(mon) && PokemonFlag2(mon) + if (PokemonExists(mon) && PokemonFlag2(mon) && (GetPokemonType(mon->speciesNum,0) == TYPE_WATER || GetPokemonType(mon->speciesNum,1) == TYPE_WATER)) { break; @@ -2726,7 +2726,7 @@ static bool8 TeamMonWithMove(u16 moveID) for (speciesId = 0; speciesId < NUM_MONSTERS; speciesId++) { PokemonStruct1 *pokeStruct = &gRecruitedPokemonRef->pokemon[speciesId]; - if (PokemonFlag1(pokeStruct) && PokemonFlag2(pokeStruct)) { + if (PokemonExists(pokeStruct) && PokemonFlag2(pokeStruct)) { for (moveIndex = 0; moveIndex < MAX_MON_MOVES; moveIndex++) { Move *move = &pokeStruct->moves[moveIndex]; if (MoveFlagExists(move) && move->id == moveID) { diff --git a/src/dungeon_main.c b/src/dungeon_main.c index d7543378a..30935e048 100644 --- a/src/dungeon_main.c +++ b/src/dungeon_main.c @@ -1114,7 +1114,7 @@ void sub_805F02C(void) PokemonStruct2 *mon = &gRecruitedPokemonRef->pokemon2[i]; PokemonStruct1 *r5 = NULL; - if ((u8)mon->unk0 & 1) { + if ((u8)mon->flags & 1) { if (!sub_806A538(mon->unkA)) { r5 = &gRecruitedPokemonRef->pokemon[mon->unkA]; } diff --git a/src/dungeon_menu_recruitment.c b/src/dungeon_menu_recruitment.c index 9df05780c..a7e846ba1 100644 --- a/src/dungeon_menu_recruitment.c +++ b/src/dungeon_menu_recruitment.c @@ -343,7 +343,7 @@ static void SetRecruitableMons(struct MonRecruitList *tabsData) } else { for (k = 0; k < NUM_MONSTERS; k++) { - if (PokemonFlag1(&gRecruitedPokemonRef->pokemon[k]) && gRecruitedPokemonRef->pokemon[k].speciesNum == speciesId) + if (PokemonExists(&gRecruitedPokemonRef->pokemon[k]) && gRecruitedPokemonRef->pokemon[k].speciesNum == speciesId) break; } if (k != NUM_MONSTERS) { diff --git a/src/dungeon_misc.c b/src/dungeon_misc.c index e3e582f28..caa1163d5 100644 --- a/src/dungeon_misc.c +++ b/src/dungeon_misc.c @@ -143,7 +143,7 @@ void LoadDungeonPokemonSprites(void) for(index = 0; index < MAX_TEAM_MEMBERS; index++) { PokemonStruct1 *ptr = &gRecruitedPokemonRef->team[index]; - if(PokemonFlag1(ptr)) + if(PokemonExists(ptr)) LoadPokemonSprite(ptr->speciesNum, TRUE); } } @@ -234,7 +234,7 @@ void sub_806890C(void) for (speciesId = 0; speciesId < NUM_MONSTERS; speciesId++) { PokemonStruct1 stack; PokemonStruct1 *pokeStruct = &gRecruitedPokemonRef->pokemon[speciesId]; - if (PokemonFlag1(pokeStruct) && PokemonFlag2(pokeStruct)) { + if (PokemonExists(pokeStruct) && PokemonFlag2(pokeStruct)) { xxx_pokemonstruct_index_to_pokemon2_808DE30(&gRecruitedPokemonRef->pokemon2[index],speciesId); if (IsLevelResetTo1(gDungeon->unk644.dungeonLocation.id)) { struct DungeonLocation dungeonLoc = {.id = DUNGEON_TINY_WOODS, .floor = 1}; @@ -259,7 +259,7 @@ void sub_806890C(void) } } for (; index < 4; index++) { - gRecruitedPokemonRef->pokemon2[index].unk0 = 0; + gRecruitedPokemonRef->pokemon2[index].flags = 0; } } @@ -268,7 +268,7 @@ void sub_8068A84(PokemonStruct1 *pokemon) s32 i, totalBodySize; totalBodySize = 0; - for (i = 0; i < 4; i++) { + for (i = 0; i < MAX_TEAM_MEMBERS; i++) { PokemonStruct2 *ptr = &gRecruitedPokemonRef->pokemon2[i]; if (PokemonFlag1Struct2(ptr)) { totalBodySize += GetBodySize(ptr->speciesNum); @@ -289,15 +289,15 @@ void sub_8068A84(PokemonStruct1 *pokemon) } } else { - for (i = 0; i < 4; i++) { + for (i = 0; i < MAX_TEAM_MEMBERS; i++) { PokemonStruct2 *monPtr = &gRecruitedPokemonRef->pokemon2[i]; if (!PokemonFlag1Struct2(monPtr)) { xxx_pokemonstruct_to_pokemon2_808DE50(monPtr,pokemon,0x55aa); - monPtr->unk0 |= 1; + monPtr->flags |= POKEMON_FLAG_EXISTS; if (monPtr->IQ < 0x1a) { monPtr->IQ = 0x1a; } - monPtr->unk0 |= 2; + monPtr->flags |= 2; monPtr->unkC = i; ZeroOutItem(&monPtr->itemSlot); PrintColoredPokeNameToBuffer(gFormatBuffer_Monsters[0],pokemon,6); @@ -397,7 +397,7 @@ void sub_8068BDC(bool8 a0) if (PokemonFlag1Struct2(monPtr) && sub_806A5A4(monPtr->unkA) && GetFriendArea(monPtr->speciesNum) == friendAreaId && a0) { monPointers[j] = &mon1Structs[id]; xxx_pokemon2_to_pokemonstruct_808DF44(monPointers[j], monPtr); - monPointers[j]->unk0 |= 0x4000; + monPointers[j]->flags |= POKEMON_FLAG_x4000; monPointers[j]->unkC[0].level = 0; monPointers[j]->unkC[1].level = 0; j++; @@ -407,7 +407,7 @@ void sub_8068BDC(bool8 a0) if (j <= areaCapacity.maxPokemon) { s32 k; for (k = 0; k < j; k++) { - if (monPointers[k]->unk0 & 0x4000) { + if (monPointers[k]->flags & POKEMON_FLAG_x4000) { sub_808D1DC(monPointers[k]); } } @@ -419,7 +419,7 @@ void sub_8068BDC(bool8 a0) sub_8067A80(friendAreaId, j - areaCapacity.maxPokemon, j, monPointers); for (id = 0; id < j; id++) { PokemonStruct1 *monPtr = monPointers[id]; - if (PokemonFlag1(monPtr) && (monPtr->unk0 & 0x8000)) { + if (PokemonExists(monPtr) && (monPtr->flags & POKEMON_FLAG_x8000)) { if (IsUnkDungeon(monPtr->dungeonLocation.id)) { break; } @@ -433,14 +433,14 @@ void sub_8068BDC(bool8 a0) } for (id = 0; id < j; id++) { - if (PokemonFlag1(monPointers[id]) && (monPointers[id]->unk0 & 0x8000)) { - monPointers[id]->unk0 = 0; + if (PokemonExists(monPointers[id]) && (monPointers[id]->flags & POKEMON_FLAG_x8000)) { + monPointers[id]->flags = 0; } } for (id = 0; id < j; id++) { - if (PokemonFlag1(monPointers[id]) && (monPointers[id]->unk0 & 0x4000)) { + if (PokemonExists(monPointers[id]) && (monPointers[id]->flags & POKEMON_FLAG_x4000)) { sub_808D1DC(monPointers[id]); - monPointers[id]->unk0 = 0; + monPointers[id]->flags = 0; } } } @@ -455,10 +455,10 @@ void sub_8068F28(void) PokemonStruct2 *monStruct2Ptr = &gRecruitedPokemonRef->pokemon2[i]; if (PokemonFlag1Struct2(monStruct2Ptr)) { if (sub_806A564(monStruct2Ptr->unkA)) { - monStruct2Ptr->unk0 = 0; + monStruct2Ptr->flags = 0; } else if (sub_806A538(monStruct2Ptr->unkA)) { - monStruct2Ptr->unk0 = 0; + monStruct2Ptr->flags = 0; } } } @@ -483,7 +483,7 @@ void sub_8068F80(void) static inline void ClearOnTeamFlag(PokemonStruct1 *mon) { - mon->unk0 &= ~(FLAG_ON_TEAM); + mon->flags &= ~(POKEMON_FLAG_ON_TEAM); } static inline void ClearMonItemId(PokemonStruct1 *mon) @@ -597,7 +597,7 @@ void sub_8068FE0(Entity *entity, s32 param_2, Entity *param_3) ClearMonItemId(&gRecruitedPokemonRef->pokemon[partnerStruct->unkA]); } } - partnerStruct->unk0 = 0; + partnerStruct->flags = 0; } } } @@ -657,7 +657,7 @@ void sub_8068FE0(Entity *entity, s32 param_2, Entity *param_3) ClearOnTeamFlag(&gRecruitedPokemonRef->pokemon[mon2Ptr->unkA]); } } - mon2Ptr->unk0 = 0; + mon2Ptr->flags = 0; } DeletePokemonDungeonSprite(entInfo->dungeonSpriteId); diff --git a/src/friend_area.c b/src/friend_area.c index 2a1e35265..6fac04659 100644 --- a/src/friend_area.c +++ b/src/friend_area.c @@ -53,7 +53,7 @@ void sub_8092404(u8 r0, u16 *r1, bool8 allowLeader, bool8 allowPartner) count = 0; for (i = 0; i < NUM_MONSTERS; i++) { - if (PokemonFlag1(&gRecruitedPokemonRef->pokemon[i]) + if (PokemonExists(&gRecruitedPokemonRef->pokemon[i]) && (!IsMonTeamLeader(&gRecruitedPokemonRef->pokemon[i]) || allowLeader) && (!IsMonPartner(&gRecruitedPokemonRef->pokemon[i]) || allowPartner) && sub_80923D4(i) == r0 @@ -78,11 +78,11 @@ void sub_809249C(u8 friendArea, bool8 clear) for (i = 0; i < NUM_MONSTERS; i++) { PokemonStruct1 *pokemon = &gRecruitedPokemonRef->pokemon[i]; - if (PokemonFlag1(pokemon) && sub_80923D4(i) == friendArea) { + if (PokemonExists(pokemon) && sub_80923D4(i) == friendArea) { if (IsMonPartner(pokemon) || IsMonTeamLeader(pokemon)) clear = FALSE; else - pokemon->unk0 = 0; + pokemon->flags = 0; } } @@ -171,7 +171,7 @@ void GetFriendAreaCapacity2(u8 friendArea, FriendAreaCapacity *dst, bool8 checkL for (i = 0; i < dst->maxPokemon; i++, iVar4++) { pokeStruct = &gRecruitedPokemonRef->pokemon[iVar4]; - if (PokemonFlag1(pokeStruct) && + if (PokemonExists(pokeStruct) && (!checkLeader || !IsMonTeamLeader(pokeStruct)) && (!checkPartner || pokeStruct->dungeonLocation.id != DUNGEON_JOIN_LOCATION_PARTNER)) { dst->currNoPokemon++; @@ -206,7 +206,7 @@ void GetFriendAreaCapacity(u8 areaId, FriendAreaCapacity *dst, bool8 checkPartne for (i = 0; i < max; i++, r5++) { mon = &gRecruitedPokemonRef->pokemon[r5]; - if (PokemonFlag1(mon)) { + if (PokemonExists(mon)) { if (mon->isTeamLeader || (!checkPartner && mon->dungeonLocation.id == DUNGEON_JOIN_LOCATION_PARTNER)) dst->maxPokemon--; else diff --git a/src/friend_area_action_menu.c b/src/friend_area_action_menu.c index 06dff887b..d6e88357d 100644 --- a/src/friend_area_action_menu.c +++ b/src/friend_area_action_menu.c @@ -245,7 +245,7 @@ void CreateFriendActionMenu(void) pokeStruct = &gRecruitedPokemonRef->pokemon[sUnknown_203B2BC->targetPoke]; MemoryFill16(sUnknown_203B2BC->unk16C,0,sizeof(sUnknown_203B2BC->unk16C)); - if((pokeStruct->unk0 >> 1) % 2) + if((pokeStruct->flags >> 1) % 2) { sUnknown_203B2BC->menuItems[loopMax].text = sStandBy; sUnknown_203B2BC->menuItems[loopMax].menuAction = FRIEND_AREA_ACTION_MENU_ACTION_STANDBY; @@ -431,7 +431,7 @@ void sub_80278B4(void) SetFriendAreaActionMenuState(FRIEND_AREA_ACTION_MENU_MAIN_2); break; case FRIEND_AREA_ACTION_MENU_ACTION_STANDBY: - sUnknown_203B2BC->pokeStruct->unk0 &= ~(FLAG_ON_TEAM); + sUnknown_203B2BC->pokeStruct->flags &= ~(POKEMON_FLAG_ON_TEAM); nullsub_104(); sub_808ED00(); SetFriendAreaActionMenuState(FRIEND_AREA_ACTION_MENU_MAIN_2); diff --git a/src/friend_list.c b/src/friend_list.c index ab0badff4..2b288be25 100644 --- a/src/friend_list.c +++ b/src/friend_list.c @@ -181,7 +181,7 @@ static s32 sub_8023BD8(void) for (i = 0; i < sFriendList->unk8; i++) { s32 id = sFriendList->unk1A[i]; - if (!PokemonFlag1(&gRecruitedPokemonRef->pokemon[id])) { + if (!PokemonExists(&gRecruitedPokemonRef->pokemon[id])) { sFriendList->unk8--; for (j = i; j < sFriendList->unk8; j++) { sFriendList->unk1A[j] = sFriendList->unk1A[j + 1]; @@ -308,7 +308,7 @@ static s32 sub_8023F8C(void) if (!sFriendList->unk15) { for (i = 0; i < NUM_MONSTERS; i++) { pokeStruct = &gRecruitedPokemonRef->pokemon[i]; - if (pokeStruct->isTeamLeader && PokemonFlag1(pokeStruct)) { + if (pokeStruct->isTeamLeader && PokemonExists(pokeStruct)) { sFriendList->unk1A[sFriendList->unk8++] = i; break; } @@ -318,7 +318,7 @@ static s32 sub_8023F8C(void) if (!sFriendList->unk16) { for (i = 0; i < NUM_MONSTERS; i++) { pokeStruct = &gRecruitedPokemonRef->pokemon[i]; - if (IsMonPartner(pokeStruct) && !pokeStruct->isTeamLeader && PokemonFlag2(pokeStruct) && PokemonFlag1(pokeStruct)) { + if (IsMonPartner(pokeStruct) && !pokeStruct->isTeamLeader && PokemonFlag2(pokeStruct) && PokemonExists(pokeStruct)) { sFriendList->unk1A[sFriendList->unk8++] = i; break; } @@ -329,7 +329,7 @@ static s32 sub_8023F8C(void) if (!sFriendList->unk17) { for (i = 0; i < NUM_MONSTERS; i++) { pokeStruct = &gRecruitedPokemonRef->pokemon[i]; - if (PokemonFlag2(pokeStruct) && PokemonFlag1(pokeStruct) && !pokeStruct->isTeamLeader && !IsMonPartner(pokeStruct)) { + if (PokemonFlag2(pokeStruct) && PokemonExists(pokeStruct) && !pokeStruct->isTeamLeader && !IsMonPartner(pokeStruct)) { sFriendList->unk1A[sFriendList->unk8++] = i; if (sFriendList->unk8 >= 4) { break; @@ -342,7 +342,7 @@ static s32 sub_8023F8C(void) if (!sFriendList->unk14) { for (i = 0; i < NUM_MONSTERS; i++) { pokeStruct = &gRecruitedPokemonRef->pokemon[i]; - if (PokemonFlag1(pokeStruct) && !PokemonFlag2(&gRecruitedPokemonRef->pokemon[i])) { + if (PokemonExists(pokeStruct) && !PokemonFlag2(&gRecruitedPokemonRef->pokemon[i])) { sFriendList->unk1A[sFriendList->unk8++] = i; } } @@ -358,7 +358,7 @@ bool8 sub_8024108(s32 param_1) for (i = 0; i < NUM_MONSTERS; i++) { PokemonStruct1 *pokeStruct = &gRecruitedPokemonRef->pokemon[i]; - if (PokemonFlag1(pokeStruct)) { + if (PokemonExists(pokeStruct)) { if (param_1 == 2) { if (!PokemonFlag2(pokeStruct)) continue; } diff --git a/src/friend_list_menu.c b/src/friend_list_menu.c index 33c656fb7..5c2eca137 100644 --- a/src/friend_list_menu.c +++ b/src/friend_list_menu.c @@ -426,7 +426,7 @@ void sub_8025A84(void) SetFriendListMenuState(FRIEND_LIST_MENU_STATE_TAKE); break; case FRIEND_LIST_MENU_STANDBY: - gUnknown_203B2B4->pokeStruct->unk0 &= ~(FLAG_ON_TEAM); + gUnknown_203B2B4->pokeStruct->flags &= ~(POKEMON_FLAG_ON_TEAM); nullsub_104(); sub_808ED00(); FriendList_Free(); diff --git a/src/ground_lives.c b/src/ground_lives.c index 1d0e6561d..c045b952a 100644 --- a/src/ground_lives.c +++ b/src/ground_lives.c @@ -541,12 +541,12 @@ s32 sub_80A7B94(s16 *a0) if (id < fAreaCapacity.maxPokemon) { PokemonStruct1 *monStrPtr = &gRecruitedPokemonRef->pokemon[fAreaCapacity.unk8 + id]; if (sub_80023E4(9)) { - if (PokemonFlag1(monStrPtr) && !monStrPtr->isTeamLeader) { + if (PokemonExists(monStrPtr) && !monStrPtr->isTeamLeader) { return -1; } } else { - if (PokemonFlag1(monStrPtr) && !monStrPtr->isTeamLeader && !IsMonPartner(monStrPtr)) { + if (PokemonExists(monStrPtr) && !monStrPtr->isTeamLeader && !IsMonPartner(monStrPtr)) { return -1; } } @@ -619,13 +619,13 @@ s32 sub_80A7DDC(s16 *a0, s16 *speciesDst) if (id < fAreaCapacity.maxPokemon) { PokemonStruct1 *monStrPtr = &gRecruitedPokemonRef->pokemon[fAreaCapacity.unk8 + id]; if (sub_80023E4(9)) { - if (PokemonFlag1(monStrPtr) && !monStrPtr->isTeamLeader) { + if (PokemonExists(monStrPtr) && !monStrPtr->isTeamLeader) { *speciesDst = monStrPtr->speciesNum; return -1; } } else { - if (PokemonFlag1(monStrPtr) && !monStrPtr->isTeamLeader && !IsMonPartner(monStrPtr)) { + if (PokemonExists(monStrPtr) && !monStrPtr->isTeamLeader && !IsMonPartner(monStrPtr)) { *speciesDst = monStrPtr->speciesNum; return -1; } @@ -1346,12 +1346,12 @@ PokemonStruct1 *sub_80A8D54(s32 a0) monPtr = &gRecruitedPokemonRef->pokemon[fAreaCapacity.unk8 + id]; if (sub_80023E4(9)) { - if (PokemonFlag1(monPtr) && !monPtr->isTeamLeader) { + if (PokemonExists(monPtr) && !monPtr->isTeamLeader) { return monPtr; } } else { - if (PokemonFlag1(monPtr) && !monPtr->isTeamLeader && !IsMonPartner(monPtr)) { + if (PokemonExists(monPtr) && !monPtr->isTeamLeader && !IsMonPartner(monPtr)) { return monPtr; } } diff --git a/src/ground_main.c b/src/ground_main.c index bf98fc8c1..bd00c6ed3 100644 --- a/src/ground_main.c +++ b/src/ground_main.c @@ -775,30 +775,29 @@ u8 sub_80990EC(struct DungeonSetupInfo *param_1, s16 param_2) param_1->sub0.unk0.floor = 1; param_1->sub0.unkC = 0; - switch(sub_80A2750(param_2)) - { + switch (sub_80A2750(param_2)) { case 1: if (sub_80990EC_sub(param_1, param_2)) { param_1->sub0.unkC = 1; sub_80A8EC0(auStack_98, 0x5b); BoundedCopyStringtoBuffer(nameBuffer, auStack_98, POKEMON_NAME_LENGTH); { - struct unkStruct_808D144 stack = - { - .name = nameBuffer, - .speciesNum = MONSTER_GENGAR, - .itemID = ITEM_NOTHING, - .dungeonLocation= {DUNGEON_RESCUE_TEAM_BASE, 0}, // DUNGEON_RESCUE_TEAM_BASE - .moveID = {MOVE_SCRATCH, MOVE_LEER, MOVE_TAUNT, MOVE_QUICK_ATTACK}, - .pokeHP = 80, - .level = 15, - .IQ = 1, - .offenseAtk = {25, 25}, - .offenseDef = {15, 15}, - .currExp = 25000, - }; + struct StoryMonData gengarData = + { + .name = nameBuffer, + .speciesNum = MONSTER_GENGAR, + .itemID = ITEM_NOTHING, + .dungeonLocation= {DUNGEON_RESCUE_TEAM_BASE, 0}, + .moveID = {MOVE_SCRATCH, MOVE_LEER, MOVE_TAUNT, MOVE_QUICK_ATTACK}, + .pokeHP = 80, + .level = 15, + .IQ = 1, + .offenseAtk = {25, 25}, + .offenseDef = {15, 15}, + .currExp = 25000, + }; - sub_808D144(¶m_1->mon, &stack); + ConvertStoryMonToPokemon(¶m_1->mon, &gengarData); } } break; diff --git a/src/ground_script.c b/src/ground_script.c index c48a1d0cc..3a306def3 100644 --- a/src/ground_script.c +++ b/src/ground_script.c @@ -1,4 +1,5 @@ #include "global.h" +#include "globaldata.h" #include "ground_script.h" #include "constants/dungeon.h" #include "constants/friend_area.h" @@ -130,7 +131,7 @@ s32 ExecuteScriptCommand(Action *action); bool8 sub_8099B94(void); PixelPos SetVecFromDirectionSpeed(s8, s32); bool8 sub_8098DCC(u32 speed); -extern const PixelPos gUnknown_81164DC; + extern char *gUnknown_203B4B0; void sub_8099220(void *param_1, s32 param_2); s16 sub_8002694(u8 param_1); // value -> GroundEnter lookup @@ -141,31 +142,6 @@ bool8 sub_809D234(void); s32 sub_80A14E8(Action *, u8, u32, s32); u8 sub_80990EC(struct DungeonSetupInfo *param_1, s32 param_2); -extern char gUnknown_81165D4[]; -extern char gUnknown_81165F4[]; -extern char gUnknown_811660C[]; -extern char gUnknown_8116628[]; -extern char gUnknown_8116644[]; -extern char gUnknown_8116664[]; -extern char gUnknown_8116684[]; -extern char gUnknown_81166C0[]; -extern char gUnknown_81166D8[]; - -extern const CallbackData gGroundScriptTriggerCallbacks; -extern DebugLocation gUnknown_81166B4; -extern DebugLocation gUnknown_81166F8; -extern DebugLocation gUnknown_8116704; -extern ScriptCommand gUnknown_81164E4; - -extern const DebugLocation gUnknown_8116588; -extern const DebugLocation gUnknown_8116538; -extern const DebugLocation gUnknown_8116560; -extern u8 gUnknown_8116594[]; -extern u8 gUnknown_8116544[]; -extern u8 gUnknown_811656C[]; - -extern DebugLocation gUnknown_81165C8; - extern u8 GroundObjectsCancellAll(void); extern u8 GroundEffectsCancelAll(void); extern u8 GroundLivesCancelAll(void); @@ -196,18 +172,6 @@ u8 sub_80A8D20(); bool8 sub_80A87E0(); s16 sub_80A8BFC(s16); void sub_80A8F50(const u8 *buffer, s32, s32 size); - -extern struct unkStruct_808D144 gUnknown_8116710; -extern struct unkStruct_808D144 gUnknown_8116760; -extern struct unkStruct_808D144 gUnknown_8116794; -extern struct unkStruct_808D144 gUnknown_81167BC; -extern struct unkStruct_808D144 gUnknown_8116738; -extern struct unkStruct_808D144 gUnknown_811681C; -extern DungeonLocation gUnknown_81167E8; -extern DungeonLocation gUnknown_8116788; -extern DungeonLocation gUnknown_811678C; -extern DungeonLocation gUnknown_8116790; - PokemonStruct1 *sub_808D2E8(s32 species, u8 *name, u32 _itemID, DungeonLocation *location, u16 *moveID); bool8 HasRecruitedMon(s32 species); extern Item gUnknown_8116844; @@ -244,6 +208,42 @@ EWRAM_DATA u32 gUnknown_2039DA4 = 0; EWRAM_DATA u16 gUnknown_2039DA8 = 0; EWRAM_INIT static int sNumChoices = 0; +static const CallbackData sNullCallbackData = { + .maybeId = 4, + .getIndex = NULL, + .getSize = NULL, + .getHitboxCenter = NULL, + .getPosHeightAndUnk = NULL, + .getDirection = NULL, + .getFlags = NULL, + .setHitboxPos = NULL, + .setPositionBounds = NULL, + .moveReal = NULL, + .setPosHeight = NULL, + .setDirection = NULL, + .setEventIndex = NULL, + .livesOnlyNullsub = NULL, + .func38 = NULL, + .setFlags = NULL, + .clearFlags = NULL, + .func44_livesOnlySpriteRelated = NULL, + .moveRelative = NULL, + .func4C_spriteRelatedCheck = NULL, + .func50_spriteRelated = NULL, +}; + +static const PixelPos sPixelPosZero = {0, 0}; + +// TODO GET RID OF IT +const u8 GroundScriptFile_Text[]; + +static const ScriptCommand gUnknown_81164E4[] = { + {0xF6, 0, 0xC5, 0, 0, GroundScriptFile_Text}, + {0xEF, 0, 0, 0, 0, NULL}, +}; + +ALIGNED(4) const u8 GroundScriptFile_Text[] = "../ground/ground_script.c"; + // -1 didn't match void sub_809D520(ActionUnkIds *a0) { @@ -327,12 +327,12 @@ void InitAction2(Action *action) InitAction(action); } -UNUSED s16 sub_809D654(Action *action) +UNUSED static s16 sub_809D654(Action *action) { return action->scriptData.savedState; } -UNUSED s16 sub_809D65C(Action *action) +UNUSED static s16 sub_809D65C(Action *action) { if(action->scriptData.savedState != 0) return action->scriptData.state; @@ -438,26 +438,26 @@ bool8 GroundScript_ExecutePP(Action *action, ActionUnkIds *param_2, ScriptInfoSm break; case 5: if (action->scriptData.state != 2) { - // "execute script type error B" at ../ground/ground_script.c:688 - FatalError(&gUnknown_8116538, gUnknown_8116544); + FATAL_ERROR_ARGS(GroundScriptFile_Text, 688, "execute script type error B"); } if (action->scriptData2.state != -1) { - // "execute script type error C" at ../ground/ground_script.c:689 - FatalError(&gUnknown_8116560, gUnknown_811656C); + FATAL_ERROR_ARGS(GroundScriptFile_Text, 689, "execute script type error C"); } action->scriptData2 = action->scriptData; break; case 0: - if (action->scriptData.state != 1) goto _0809D84A; - action->scriptData2 = action->scriptData; + if (action->scriptData.state != 1) { + InitScriptData(&action->scriptData2); + } + else { + action->scriptData2 = action->scriptData; + } break; case 1: - _0809D84A: InitScriptData(&action->scriptData2); break; default: - // "execute script type error %d" at ../ground/ground_script.c:708 - FatalError(&gUnknown_8116588, gUnknown_8116594, param_3->state); + FATAL_ERROR_ARGS(GroundScriptFile_Text, 708, "execute script type error %d", param_3->state); } InitScriptData(&action->scriptData); if (param_2 != NULL) { @@ -510,7 +510,7 @@ u8 GroundScriptCheckLockCondition(Action *param_1, s16 param_2) bool8 GroundScript_Cancel(Action *r0) { // NOTE: Will always return TRUE - return ActionResetScriptDataForDeletion(r0, &gUnknown_81165C8); + return ActionResetScriptDataForDeletion(r0, DEBUG_LOC_PTR(GroundScriptFile_Text, 821, "GroundScript_Cancel")); } u8 GroundCancelAllEntities(void) @@ -856,7 +856,7 @@ s16 HandleAction(Action *action, DebugLocation *debug) if (res >= 0) { flag = TRUE; sub_80A8FD8(res, &pos1); - pos2 = gUnknown_81164DC; + pos2 = sPixelPosZero; } break; } @@ -873,7 +873,7 @@ s16 HandleAction(Action *action, DebugLocation *debug) action->callbacks->getSize(action->parentObject, &pos4); tmp2 = SizedDeltaDirection8(&pos3, &pos4, &pos1, &pos2); if (tmp2 == -1) { - tmp2 = SizedDeltaDirection4(&pos3, &gUnknown_81164DC, &pos1, &gUnknown_81164DC); + tmp2 = SizedDeltaDirection4(&pos3, &sPixelPosZero, &pos1, &sPixelPosZero); } } if (tmp2 == -1 || tmp2 == dir) { @@ -1406,8 +1406,7 @@ s32 ExecuteScriptCommand(Action *action) u32 argCopy = arg; u32 byte = (u8)curCmd.argByte; if (ScriptLoggingEnabled(TRUE)) { - // " ground select %3d[%s] %3d" - Log(1, gUnknown_81165D4, arg, gGroundConversion_811BAF4[arg].text, byte); + Log(1, " ground select %3d[%s] %3d", arg, gGroundConversion_811BAF4[arg].text, byte); } GroundMainGroundRequest(argCopy, byte, curCmd.argShort); break; @@ -1416,8 +1415,7 @@ s32 ExecuteScriptCommand(Action *action) s32 arg = (s16)curCmd.arg1; if (arg == -1) arg = (s16)GetScriptVarValue(NULL, DUNGEON_ENTER); if (ScriptLoggingEnabled(TRUE)) { - // " dungeon select %3d" - Log(1, gUnknown_81165F4, arg); + Log(1, " dungeon select %3d", arg); } if (arg != -1) { GroundMainRescueRequest(arg, curCmd.argShort); @@ -1480,7 +1478,7 @@ s32 ExecuteScriptCommand(Action *action) SetScriptVarValue(NULL, DUNGEON_ENTER, tmp); } if (ScriptLoggingEnabled(TRUE)) { - Log(1, gUnknown_811660C, tmp); + Log(1, " dungeon enter check %3d", tmp); } if (tmp != -1) { action->scriptData.branchDiscriminant = 1; @@ -1496,16 +1494,14 @@ s32 ExecuteScriptCommand(Action *action) gUnknown_2039A32 = GetAdjustedGroundMap((s16)curCmd.arg1); gUnknown_2039A34 = gUnknown_2039A32; if (ScriptLoggingEnabled(TRUE)) { - // " map select %3d %3d[%s]" - Log(1,gUnknown_8116628,gCurrentMap,gUnknown_2039A32, + Log(1," map select %3d %3d[%s]",gCurrentMap,gUnknown_2039A32, gGroundConversion_811BAF4[gCurrentMap].text); } } else { gUnknown_2039A32 = gCurrentMap = curCmd.arg1; gUnknown_2039A34 = curCmd.arg1; if (ScriptLoggingEnabled(TRUE)) { - // " ground select %3d %3d[%s]" - Log(1,gUnknown_8116644,gCurrentMap,gUnknown_2039A32, + Log(1," ground select %3d %3d[%s]",gCurrentMap,gUnknown_2039A32, gGroundConversion_811BAF4[gCurrentMap].text); } } @@ -1530,8 +1526,7 @@ s32 ExecuteScriptCommand(Action *action) tmp = GetDungeonInfo_80A2608((s16)curCmd.arg1); gUnknown_2039A34 = gUnknown_2039A32 = gCurrentMap = (s16)curCmd.arg2; if (ScriptLoggingEnabled(TRUE)) { - // " dungeon select %3d %3d[%s]" - Log(1, gUnknown_8116664, gCurrentMap,gUnknown_2039A32, + Log(1, " dungeon select %3d %3d[%s]", gCurrentMap,gUnknown_2039A32, gGroundConversion_811BAF4[gCurrentMap].text); } GroundSprite_Reset(gUnknown_2039A32); @@ -1723,8 +1718,7 @@ s32 ExecuteScriptCommand(Action *action) if (!((u16)(a - 0x37) < 0x11) && (s16)sub_80A2750(a) == 1) { if (thing == -1) { if (ScriptLoggingEnabled(TRUE)) { - // " dungeon rescue select %3d" - Log(1, gUnknown_8116684, a); + Log(1, " dungeon rescue select %3d", a); } GroundMainRescueRequest(a, -1); } else { @@ -1779,7 +1773,7 @@ s32 ExecuteScriptCommand(Action *action) sub_80A8FD8(ret, &pos3); sub_80A8F9C(ret, &pos4); if ((tmp = SizedDeltaDirection8(&pos3, &pos4, &pos1, &pos2)) != -1 || - (tmp = SizedDeltaDirection4(&pos1, &gUnknown_81164DC, &pos3, &gUnknown_81164DC)) != -1) { + (tmp = SizedDeltaDirection4(&pos1, &sPixelPosZero, &pos3, &sPixelPosZero)) != -1) { sub_80A9090(ret, tmp); } } @@ -2423,7 +2417,7 @@ s32 ExecuteScriptCommand(Action *action) if (val >= 0) { flag = TRUE; sub_80A8FD8(val, &pos1); - pos2 = gUnknown_81164DC; + pos2 = sPixelPosZero; } break; } @@ -2445,7 +2439,7 @@ s32 ExecuteScriptCommand(Action *action) tmp = -1; if (dir == tmp) { - dir = SizedDeltaDirection4(&pos3, &gUnknown_81164DC, &pos1, &gUnknown_81164DC); + dir = SizedDeltaDirection4(&pos3, &sPixelPosZero, &pos1, &sPixelPosZero); } if (dir == tmp) { action->callbacks->getDirection(action->parentObject, &dir); @@ -2843,7 +2837,7 @@ s32 ExecuteScriptCommand(Action *action) sub_80A8F9C(tmp, &pos4); val = SizedDeltaDirection8(&pos1, &pos2, &pos3, &pos4); if (val == -1) { - val = SizedDeltaDirection4(&pos1, &gUnknown_81164DC, &pos3, &gUnknown_81164DC); + val = SizedDeltaDirection4(&pos1, &sPixelPosZero, &pos3, &sPixelPosZero); } } else { val = -1; @@ -2857,9 +2851,9 @@ s32 ExecuteScriptCommand(Action *action) action->callbacks->getHitboxCenter(action->parentObject, &pos1); action->callbacks->getSize(action->parentObject, &pos2); sub_80A8FD8(tmp, &pos3); - val = SizedDeltaDirection8(&pos1, &pos2, &pos3, &gUnknown_81164DC); + val = SizedDeltaDirection8(&pos1, &pos2, &pos3, &sPixelPosZero); if (val == -1) { - val = SizedDeltaDirection4(&pos1, &gUnknown_81164DC, &pos3, &gUnknown_81164DC); + val = SizedDeltaDirection4(&pos1, &sPixelPosZero, &pos3, &sPixelPosZero); } } else { val = -1; @@ -2872,8 +2866,7 @@ s32 ExecuteScriptCommand(Action *action) } default: { // The locdata says this is part of an inlined function... :/ - // "switch type error %d" - FatalError(&gUnknown_81166B4, gUnknown_81166C0, curCmd.op); + FATAL_ERROR_ARGS2(GroundScriptFile_Text, 4222, "_AnalyzeProcess", "switch type error %d", curCmd.op); } } scriptData->script.ptr = ResolveJump(action, val); @@ -2909,7 +2902,7 @@ s32 ExecuteScriptCommand(Action *action) } } } - if (!out) out = gUnknown_81166D8; // "" + if (!out) out = ""; for (; scriptData->script.ptr->op == 0xd9; scriptData->script.ptr++) { gChoices[sNumChoices].text = scriptData->script.ptr->argPtr; gChoices[sNumChoices].menuAction = sNumChoices + 1; @@ -3046,12 +3039,12 @@ s32 ExecuteScriptCommand(Action *action) } } -UNUSED u32 sub_80A1440(s32 r0, s32 r1, s32 r2) +UNUSED static u32 sub_80A1440(s32 r0, s32 r1, s32 r2) { return sub_80A14E8(NULL, r0, r1, r2); } -UNUSED bool8 GroundScript_ExecuteTrigger(s16 r0) +UNUSED static bool8 GroundScript_ExecuteTrigger(s16 r0) { s32 ret; ScriptInfoSmall scriptInfo; @@ -3062,14 +3055,14 @@ UNUSED bool8 GroundScript_ExecuteTrigger(s16 r0) if(ptr->type != 0xB) return FALSE; - InitActionWithParams(&action, &gGroundScriptTriggerCallbacks, NULL, 0, 0); + InitActionWithParams(&action, &sNullCallbackData, NULL, 0, 0); GetFunctionScript(NULL, &scriptInfo, r0); - GroundScript_ExecutePP(&action, NULL, &scriptInfo, &gUnknown_81166F8); + GroundScript_ExecutePP(&action, NULL, &scriptInfo, DEBUG_LOC_PTR(GroundScriptFile_Text, 4553, "GroundScript_ExecuteTrigger")); action.scriptData.savedScript = action.scriptData.script; - action.scriptData.savedScript.ptr = &gUnknown_81164E4; - action.scriptData.savedScript.ptr2 = &gUnknown_81164E4; - ret = HandleAction(&action, &gUnknown_8116704); + action.scriptData.savedScript.ptr = gUnknown_81164E4; + action.scriptData.savedScript.ptr2 = gUnknown_81164E4; + ret = HandleAction(&action, DEBUG_LOC_PTR(GroundScriptFile_Text, 4558, "GroundScript_ExecuteTrigger")); InitAction2(&action); if(ret == 0) return TRUE; @@ -3077,6 +3070,16 @@ UNUSED bool8 GroundScript_ExecuteTrigger(s16 r0) return FALSE; } +extern struct StoryMonData gUnknown_8116760; +extern struct StoryMonData gUnknown_8116794; +extern struct StoryMonData gUnknown_81167BC; +extern struct StoryMonData gUnknown_8116738; +extern struct StoryMonData gUnknown_811681C; +extern DungeonLocation gUnknown_81167E8; +extern DungeonLocation gUnknown_8116788; +extern DungeonLocation gUnknown_811678C; +extern DungeonLocation gUnknown_8116790; + s32 sub_80A14E8(Action *action, u8 idx, u32 r2, s32 r3) { switch(idx) @@ -3253,16 +3256,26 @@ s32 sub_80A14E8(Action *action, u8 idx, u32 r2, s32 r3) sub_80A8F50(gUnknown_2039D98, 0x3C, POKEMON_NAME_LENGTH); return 0; case 0x19: + UnlockFriendArea(GetFriendArea(MONSTER_MAGNEMITE)); { - struct unkStruct_808D144 sp_4; + struct StoryMonData sp_4 = { + .name = gUnknown_2039D98, + .speciesNum = MONSTER_MAGNEMITE, + .itemID = ITEM_NOTHING, + .dungeonLocation = {.id = DUNGEON_POKEMON_SQUARE_2, .floor = 0}, + .moveID = {MOVE_METAL_SOUND, MOVE_TACKLE, MOVE_THUNDERSHOCK, MOVE_NOTHING}, + .pokeHP = 38, + .level = 6, + .IQ = 1, + .offenseAtk = {20, 18}, + .offenseDef = {20, 18}, + .currExp = 4560, + }; PokemonStruct1 sp_2c; PokemonStruct1 *ptr; s32 index; - - UnlockFriendArea(GetFriendArea(MONSTER_MAGNEMITE)); - sp_4 = gUnknown_8116710; - sub_808D144(&sp_2c, &sp_4); + ConvertStoryMonToPokemon(&sp_2c, &sp_4); ptr = sub_808D1DC(&sp_2c); if (ptr == NULL) return 1; for(index = 0; index < POKEMON_NAME_LENGTH; index++) @@ -3274,31 +3287,29 @@ s32 sub_80A14E8(Action *action, u8 idx, u32 r2, s32 r3) return 0; } break; - case 0x1A: sub_80A8F50(gUnknown_2039D98, 0x53, POKEMON_NAME_LENGTH); return 0; - case 0x1B: { PokemonStruct1 *pokemon; - struct unkStruct_808D144 sp_84; + struct StoryMonData sp_84; PokemonStruct1 sp_ac; UnlockFriendArea(GetFriendArea(MONSTER_ABSOL)); sp_84 = gUnknown_8116738; - sub_808D144(&sp_ac, &sp_84); + ConvertStoryMonToPokemon(&sp_ac, &sp_84); pokemon = sub_808D1DC(&sp_ac); if(pokemon == NULL) return 1; IncrementAdventureNumJoined(); - pokemon->unk0 |= FLAG_ON_TEAM; + pokemon->flags |= POKEMON_FLAG_ON_TEAM; return 0; } case 0x1C: { PokemonStruct1 *pokemon = sub_808D434(MONSTER_ABSOL, 0); if(pokemon == NULL) return 1; - pokemon->unk0 |= FLAG_ON_TEAM; + pokemon->flags |= POKEMON_FLAG_ON_TEAM; return 0; } case 0x1D: @@ -3316,11 +3327,11 @@ s32 sub_80A14E8(Action *action, u8 idx, u32 r2, s32 r3) { PokemonStruct1 *pokemon; s32 index; - struct unkStruct_808D144 sp_108; + struct StoryMonData sp_108; PokemonStruct1 sp_130; sp_108 = gUnknown_8116760; - sub_808D144(&sp_130, &sp_108); + ConvertStoryMonToPokemon(&sp_130, &sp_108); pokemon = sub_808D1DC(&sp_130); if(!pokemon) return 1; for(index = 0; index < POKEMON_NAME_LENGTH; index++) @@ -3389,13 +3400,13 @@ s32 sub_80A14E8(Action *action, u8 idx, u32 r2, s32 r3) { PokemonStruct1 *pokemon; s32 index; - struct unkStruct_808D144 sp_188; + struct StoryMonData sp_188; PokemonStruct1 sp_1b0; if(!GetFriendAreaStatus(GetFriendArea(MONSTER_LATIOS))) UnlockFriendArea(GetFriendArea(MONSTER_LATIOS)); sp_188 = gUnknown_8116794; - sub_808D144(&sp_1b0, &sp_188); + ConvertStoryMonToPokemon(&sp_1b0, &sp_188); pokemon = sub_808D1DC(&sp_1b0); if(pokemon == NULL) return 1; for(index = 0; index < POKEMON_NAME_LENGTH; index++) @@ -3414,11 +3425,11 @@ s32 sub_80A14E8(Action *action, u8 idx, u32 r2, s32 r3) { PokemonStruct1 *pokemon; s32 index; - struct unkStruct_808D144 sp_208; + struct StoryMonData sp_208; PokemonStruct1 sp_230; sp_208 = gUnknown_81167BC; - sub_808D144(&sp_230, &sp_208); + ConvertStoryMonToPokemon(&sp_230, &sp_208); pokemon = sub_808D1DC(&sp_230); if(pokemon == NULL) return 1; for(index = 0; index < POKEMON_NAME_LENGTH; index++) @@ -3609,10 +3620,10 @@ s32 sub_80A14E8(Action *action, u8 idx, u32 r2, s32 r3) case 0x32: { - struct unkStruct_808D144 sp_288; + struct StoryMonData sp_288; PokemonStruct1 sp_2b0; sp_288 = gUnknown_811681C; - sub_808D144(&sp_2b0, &sp_288); + ConvertStoryMonToPokemon(&sp_2b0, &sp_288); if(sub_808D1DC(&sp_2b0) == 0) { return 1; } diff --git a/src/items.c b/src/items.c index 7aba93901..46ae3ea03 100644 --- a/src/items.c +++ b/src/items.c @@ -596,7 +596,7 @@ s32 GetItemPossessionCount(u8 id) for (i = 0; i < NUM_MONSTERS; i++) { PokemonStruct1 *mon = &gRecruitedPokemonRef->pokemon[i]; - if (PokemonFlag1(mon) + if (PokemonExists(mon) && PokemonFlag2(mon) && (mon->heldItem.id != ITEM_NOTHING) && (mon->heldItem.id == id)) @@ -1400,7 +1400,7 @@ void ClearAllItems_8091FB4(void) } FillInventoryGaps(); for (i = 0; i < NUM_MONSTERS; i++) { - if (PokemonFlag1(&gRecruitedPokemonRef->pokemon[i])) { + if (PokemonExists(&gRecruitedPokemonRef->pokemon[i])) { PokemonStruct1 *pokemon = &gRecruitedPokemonRef->pokemon[i]; if (pokemon->heldItem.id) { if (pokemon->heldItem.id == ITEM_POKE) { diff --git a/src/luminous_cave.c b/src/luminous_cave.c index 2d2302578..47d86cb48 100644 --- a/src/luminous_cave.c +++ b/src/luminous_cave.c @@ -747,7 +747,7 @@ static bool8 LuminousCave_HasOnly1Member(void) memberCount = 0; for(index = 0; index < NUM_MONSTERS; index++, preload++) { - if((preload->unk0 >> 1) & 1) + if((preload->flags >> 1) & 1) memberCount++; } diff --git a/src/main_loops.c b/src/main_loops.c index a649c6f57..726c60602 100644 --- a/src/main_loops.c +++ b/src/main_loops.c @@ -1074,7 +1074,7 @@ static void RemoveMoneyAndRandomItems(void) for (i = 0; i < NUM_MONSTERS; i++) { PokemonStruct1 *mon = &gRecruitedPokemonRef->pokemon[i]; - if (PokemonFlag1(mon) && PokemonFlag2(mon)) + if (PokemonExists(mon) && PokemonFlag2(mon)) mon->heldItem.id = ITEM_NOTHING; } @@ -1094,7 +1094,7 @@ static void RemoveAllMoneyAndItems(void) for (i = 0; i < NUM_MONSTERS; i++) { PokemonStruct1 *mon = &gRecruitedPokemonRef->pokemon[i]; - if (PokemonFlag1(mon) && PokemonFlag2(mon)) + if (PokemonExists(mon) && PokemonFlag2(mon)) mon->heldItem.id = ITEM_NOTHING; } diff --git a/src/party_list_menu.c b/src/party_list_menu.c index 3c9ca560b..8f343af97 100644 --- a/src/party_list_menu.c +++ b/src/party_list_menu.c @@ -315,7 +315,7 @@ void PartyListMenu_CreateMenu1(void) { PeekPokemonItem(sUnknown_203B2B8->pokeSpecies, &sUnknown_203B2B8->item2); - if(temp = pokeStruct->unk0 >> 1, one = 1, temp & one) + if(temp = pokeStruct->flags >> 1, one = 1, temp & one) { sUnknown_203B2B8->unk16C[loopMax].text = sPartyMenuStandBy; sUnknown_203B2B8->unk16C[loopMax].menuAction = PARTY_LIST_MENU_STANDBY; @@ -367,7 +367,7 @@ void PartyListMenu_CreateMenu1(void) { } loopMax += 1; - if((temp = pokeStruct->unk0 >> 1, one = 1, temp & one) == 0) + if((temp = pokeStruct->flags >> 1, one = 1, temp & one) == 0) { sUnknown_203B2B8->unk16C[loopMax].text = sPartyMenuSayFarewell; sUnknown_203B2B8->unk16C[loopMax].menuAction = PARTY_LIST_MENU_SAY_FAREWELL; @@ -476,7 +476,7 @@ void PartyListMenu_HandleMenu1(void) SetPartyListMenuState(PARTY_LIST_STATE_JOIN_TEAM); break; case PARTY_LIST_MENU_STANDBY: - sUnknown_203B2B8->pokeStruct->unk0 &= ~(FLAG_ON_TEAM); + sUnknown_203B2B8->pokeStruct->flags &= ~(POKEMON_FLAG_ON_TEAM); nullsub_104(); sub_808ED00(); SetPartyListMenuState(PARTY_LIST_STATE_STANDBY); diff --git a/src/pokemon.c b/src/pokemon.c index bb5fb6571..28e73698b 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -63,14 +63,14 @@ void InitializeRecruitedPokemon(void) s32 index; for (index = 0; index < NUM_MONSTERS; index++) - gRecruitedPokemonRef->pokemon[index].unk0 = 0; + gRecruitedPokemonRef->pokemon[index].flags = 0; for (index = 0; index < 4; index++) - gRecruitedPokemonRef->pokemon2[index].unk0 = 0; + gRecruitedPokemonRef->pokemon2[index].flags = 0; for (index = 0; index < MAX_TEAM_MEMBERS; index++) { gRecruitedPokemonRef->team[index].speciesNum = 0; - gRecruitedPokemonRef->team[index].unk0 = 0; + gRecruitedPokemonRef->team[index].flags = 0; } } @@ -83,7 +83,7 @@ void sub_808CE74(s16 _species, bool32 _isLeader, u8* name) s32 species = _species; bool8 isLeader = _isLeader; - pokemon.unk0 = 3; + pokemon.flags = POKEMON_FLAG_EXISTS | POKEMON_FLAG_ON_TEAM; if (isLeader) { pokemon.isTeamLeader = TRUE; pokemon.dungeonLocation.id = DUNGEON_JOIN_LOCATION_LEADER; @@ -122,7 +122,7 @@ void sub_808CE74(s16 _species, bool32 _isLeader, u8* name) } friendArea = gMonsterParameters[species].friendArea; for (i = 0; i < NUM_MONSTERS; i++) { - if (!PokemonFlag1(&gRecruitedPokemonRef->pokemon[i])) { + if (!PokemonExists(&gRecruitedPokemonRef->pokemon[i])) { u8 speciesFriendArea = sub_80923D4(i); if (speciesFriendArea == friendArea) { gRecruitedPokemonRef->pokemon[i] = pokemon; @@ -142,7 +142,7 @@ void sub_808CFD0(PokemonStruct1 *pokemon, s16 _species, u8* name, u32 _itemID, D s32 species = _species; u8 itemID = _itemID; - pokemon->unk0 = 1; + pokemon->flags = POKEMON_FLAG_EXISTS; pokemon->isTeamLeader = 0; pokemon->level = 1; pokemon->pokeHP = GetBaseHP(species); @@ -206,47 +206,42 @@ void sub_808D0D8(PokemonStruct1 *pokemon) sub_808E490(pokemon->moves, pokemon->speciesNum); } -void sub_808D144(PokemonStruct1 *pokemon, struct unkStruct_808D144 *r1) +void ConvertStoryMonToPokemon(PokemonStruct1 *dst, struct StoryMonData *src) { s32 i; - pokemon->unk0 = 1; - pokemon->isTeamLeader = FALSE; - pokemon->level = r1->level; - pokemon->pokeHP = r1->pokeHP; - pokemon->offense.att[0] = r1->offenseAtk[0]; - pokemon->offense.att[1] = r1->offenseAtk[1]; - pokemon->offense.def[0] = r1->offenseDef[0]; - pokemon->offense.def[1] = r1->offenseDef[1]; - pokemon->speciesNum = r1->speciesNum; - xxx_init_helditem_8090B08(&pokemon->heldItem, r1->itemID); - pokemon->currExp = r1->currExp; - pokemon->tacticIndex = TACTIC_LETS_GO_TOGETHER; - pokemon->IQ = r1->IQ; - pokemon->dungeonLocation = r1->dungeonLocation; - pokemon->unkC[0].level = 0; - pokemon->unkC[1].level = 0; - SetDefaultIQSkills(&pokemon->IQSkills, FALSE); + dst->flags = POKEMON_FLAG_EXISTS; + dst->isTeamLeader = FALSE; + dst->level = src->level; + dst->pokeHP = src->pokeHP; + dst->offense.att[0] = src->offenseAtk[0]; + dst->offense.att[1] = src->offenseAtk[1]; + dst->offense.def[0] = src->offenseDef[0]; + dst->offense.def[1] = src->offenseDef[1]; + dst->speciesNum = src->speciesNum; + xxx_init_helditem_8090B08(&dst->heldItem, src->itemID); + dst->currExp = src->currExp; + dst->tacticIndex = TACTIC_LETS_GO_TOGETHER; + dst->IQ = src->IQ; + dst->dungeonLocation = src->dungeonLocation; + dst->unkC[0].level = 0; + dst->unkC[1].level = 0; + SetDefaultIQSkills(&dst->IQSkills, FALSE); - for(i = 0; i < MAX_MON_MOVES; i++) - { - if(r1->moveID[i] != 0) - { - InitZeroedPPPokemonMove(&pokemon->moves[i], r1->moveID[i]); + for (i = 0; i < MAX_MON_MOVES; i++) { + if (src->moveID[i] != 0) { + InitZeroedPPPokemonMove(&dst->moves[i], src->moveID[i]); } - else - { - pokemon->moves[i].moveFlags = 0; + else { + dst->moves[i].moveFlags = 0; } } - for(i = 0; i < POKEMON_NAME_LENGTH; i++) - { - pokemon->name[i] = r1->name[i]; + for (i = 0; i < POKEMON_NAME_LENGTH; i++) { + dst->name[i] = src->name[i]; } } - PokemonStruct1 *sub_808D1DC(PokemonStruct1 *pokemon) { u32 friendArea; @@ -257,11 +252,11 @@ PokemonStruct1 *sub_808D1DC(PokemonStruct1 *pokemon) if(!gFriendAreas[friendArea]) return NULL; for (i = 0; i < NUM_MONSTERS; i++) { - if (!PokemonFlag1(&gRecruitedPokemonRef->pokemon[i])) { + if (!PokemonExists(&gRecruitedPokemonRef->pokemon[i])) { u8 speciesFriendArea = sub_80923D4(i); if (speciesFriendArea == friendArea) { gRecruitedPokemonRef->pokemon[i] = *pokemon; - gRecruitedPokemonRef->pokemon[i].unk0 &= 0xbfff; + gRecruitedPokemonRef->pokemon[i].flags &= 0xbfff; sub_80980B4(pokemon->speciesNum); return &gRecruitedPokemonRef->pokemon[i]; } @@ -281,7 +276,7 @@ PokemonStruct1 *sub_808D278(s32 species) if(!gFriendAreas[friendArea]) return NULL; for (i = 0; i < NUM_MONSTERS; i++) { - if (!PokemonFlag1(&gRecruitedPokemonRef->pokemon[i])) { + if (!PokemonExists(&gRecruitedPokemonRef->pokemon[i])) { u8 speciesFriendArea = sub_80923D4(i); if (speciesFriendArea == friendArea) { return &gRecruitedPokemonRef->pokemon[i]; @@ -302,7 +297,7 @@ PokemonStruct1 *sub_808D2E8(s32 species, u8 *name, u32 _itemID, DungeonLocation void sub_808D31C(PokemonStruct1 *param_1) { if ((!IsMonTeamLeader(param_1)) && !IsMonPartner(param_1)) - param_1->unk0 = 0; + param_1->flags = 0; } PokemonStruct1 * GetPlayerPokemonStruct(void) @@ -311,7 +306,7 @@ PokemonStruct1 * GetPlayerPokemonStruct(void) for(index = 0; index < NUM_MONSTERS; index++) { - if(((PokemonFlag1(&gRecruitedPokemonRef->pokemon[index])))){ + if(((PokemonExists(&gRecruitedPokemonRef->pokemon[index])))){ if(IsMonTeamLeader(&gRecruitedPokemonRef->pokemon[index])) { return &gRecruitedPokemonRef->pokemon[index]; } @@ -326,7 +321,7 @@ PokemonStruct1 * sub_808D378(void) for(index = 0; index < NUM_MONSTERS; index++) { - if(((PokemonFlag1(&gRecruitedPokemonRef->pokemon[index])))){ + if(((PokemonExists(&gRecruitedPokemonRef->pokemon[index])))){ if(IsMonPartner(&gRecruitedPokemonRef->pokemon[index])) { return &gRecruitedPokemonRef->pokemon[index]; } @@ -339,7 +334,7 @@ PokemonStruct1 * sub_808D3BC(void) { s32 index; for (index = 0; index < NUM_MONSTERS; index++) { - if (PokemonFlag1(&gRecruitedPokemonRef->pokemon[index]) + if (PokemonExists(&gRecruitedPokemonRef->pokemon[index]) && (gRecruitedPokemonRef->pokemon[index].dungeonLocation.id == DUNGEON_JOIN_LOCATION_LEADER)) { return &gRecruitedPokemonRef->pokemon[index]; @@ -352,7 +347,7 @@ PokemonStruct1 * sub_808D3F8(void) { s32 index; for (index = 0; index < NUM_MONSTERS; index++) { - if (PokemonFlag1(&gRecruitedPokemonRef->pokemon[index]) + if (PokemonExists(&gRecruitedPokemonRef->pokemon[index]) && (gRecruitedPokemonRef->pokemon[index].dungeonLocation.id == DUNGEON_JOIN_LOCATION_PARTNER)) { return &gRecruitedPokemonRef->pokemon[index]; @@ -372,7 +367,7 @@ PokemonStruct1 * sub_808D434(s16 species, s32 param_2) counter = 0; for(index = 0; index < NUM_MONSTERS; index++, pokeStruct++) { - if(((PokemonFlag1(pokeStruct)) && (pokeStruct->speciesNum == species_s32))) { + if(((PokemonExists(pokeStruct)) && (pokeStruct->speciesNum == species_s32))) { if (counter == param_2) return pokeStruct; counter++; @@ -391,7 +386,7 @@ s32 GetFriendSum_808D480(void) count = 0; for(index = 0; index < NUM_MONSTERS; index++, pokeStruct++) { - if(PokemonFlag1(pokeStruct)){ + if(PokemonExists(pokeStruct)){ count++; } } @@ -410,7 +405,7 @@ bool8 sub_808D4B0(void) { if(PokemonFlag2(pokeStruct) && !IsMonTeamLeader(pokeStruct) && !IsMonPartner(pokeStruct)){ flag = TRUE; - pokeStruct->unk0 &= 0xFFFD; + pokeStruct->flags &= 0xFFFD; } } return flag; @@ -428,7 +423,7 @@ bool8 sub_808D500(void) { if(PokemonFlag2(pokeStruct) && !IsMonTeamLeader(pokeStruct)){ flag = TRUE; - pokeStruct->unk0 &= 0xFFFD; + pokeStruct->flags &= 0xFFFD; } } return flag; @@ -463,7 +458,7 @@ s32 sub_808D580(s32 *team) for(index = 0; index < NUM_MONSTERS; index++, mon++) { - if (((IsMonTeamLeader(mon)) && (PokemonFlag1(mon))) && (team != NULL)) { + if (((IsMonTeamLeader(mon)) && (PokemonExists(mon))) && (team != NULL)) { team[counter] = index; counter++; break; @@ -472,7 +467,7 @@ s32 sub_808D580(s32 *team) for(mon = gRecruitedPokemonRef->pokemon, index = 0; index < NUM_MONSTERS; index++, mon++) { - if (((IsMonPartner(mon) && !IsMonTeamLeader(mon) && PokemonFlag2(mon)) && (PokemonFlag1(mon))) && + if (((IsMonPartner(mon) && !IsMonTeamLeader(mon) && PokemonFlag2(mon)) && (PokemonExists(mon))) && ((((team != NULL))))) { team[counter] = index; @@ -484,7 +479,7 @@ s32 sub_808D580(s32 *team) for(mon = gRecruitedPokemonRef->pokemon, index = 0; index < NUM_MONSTERS; index++, mon++) { - if ((((PokemonFlag2(mon)) && (PokemonFlag1(mon))) && + if ((((PokemonFlag2(mon)) && (PokemonExists(mon))) && (!IsMonTeamLeader(mon))) && (((!IsMonPartner(mon) && (team != NULL))))) { team[counter] = index; @@ -542,7 +537,7 @@ bool8 sub_808D6E8() s32 size_count = 0; for (i = 0; i < NUM_MONSTERS; i++) { PokemonStruct1* pokemon = &gRecruitedPokemonRef->pokemon[i]; - if (PokemonFlag1(pokemon) && PokemonFlag2(pokemon)) { + if (PokemonExists(pokemon) && PokemonFlag2(pokemon)) { size_count += GetBodySize(pokemon->speciesNum); count++; } @@ -563,7 +558,7 @@ bool8 sub_808D6E8() for (i = 0; i < 413; i++) { pokemon = &gRecruitedPokemonRef->pokemon[i]; - if (PokemonFlag1(pokemon) && PokemonFlag2(pokemon)) { + if (PokemonExists(pokemon) && PokemonFlag2(pokemon)) { size_count += GetBodySize(pokemon->speciesNum); count++; } @@ -937,7 +932,7 @@ void xxx_pokemonstruct_to_pokemon2_808DE50(PokemonStruct2 * a1, PokemonStruct1 * BulkItem* held; Item* slot; - a1->unk0 = pokemon->unk0; + a1->flags = pokemon->flags; a1->level = pokemon->level; a1->IQ = pokemon->IQ; a1->IQSkills = pokemon->IQSkills; @@ -988,7 +983,7 @@ void xxx_pokemon2_to_pokemonstruct_808DF44(PokemonStruct1* pokemon, PokemonStruc { s32 i; - pokemon->unk0 = a2->unk0; + pokemon->flags = a2->flags; pokemon->level = a2->level; pokemon->IQ = a2->IQ; pokemon->IQSkills = a2->IQSkills; diff --git a/src/pokemon_3.c b/src/pokemon_3.c index 2a09cb2a1..321c86d57 100644 --- a/src/pokemon_3.c +++ b/src/pokemon_3.c @@ -67,7 +67,7 @@ bool8 HasRecruitedMon(s16 species) PokemonStruct1 *pokemon = gRecruitedPokemonRef->pokemon; for (i = 0; i < NUM_MONSTERS; i++) { - if (((u8)pokemon->unk0 & 1)) { + if (((u8)pokemon->flags & 1)) { if (pokemon->speciesNum == species_s32) return TRUE; } @@ -517,7 +517,7 @@ void sub_808ED00(void) } for (; i < MAX_TEAM_MEMBERS; i++) { - gRecruitedPokemonRef->team[i].unk0 = FLAG_NONE; + gRecruitedPokemonRef->team[i].flags = POKEMON_FLAG_NONE; } } } @@ -545,8 +545,8 @@ s32 SaveRecruitedPokemon(u8 *a1, s32 a2) for (i = 0; i < NUM_MONSTERS; i++) { PokemonStruct1 *pokemon = &gRecruitedPokemonRef->pokemon[i]; - if (PokemonFlag1(pokemon)) { - if (pokemon->unk0 & FLAG_ON_TEAM) + if (PokemonExists(pokemon)) { + if (pokemon->flags & POKEMON_FLAG_ON_TEAM) sixMons[count++] = i; if (IsMonTeamLeader(pokemon)) @@ -561,7 +561,7 @@ s32 SaveRecruitedPokemon(u8 *a1, s32 a2) // Team members for (i = 0; i < MAX_TEAM_MEMBERS; i++) { u8 data_u8; - if (PokemonFlag1(&gRecruitedPokemonRef->team[i])) + if (PokemonExists(&gRecruitedPokemonRef->team[i])) data_u8 = 0xFF; else data_u8 = 0; @@ -600,16 +600,16 @@ s32 RestoreRecruitedPokemon(u8 *a1, s32 a2) ReadBits(&backup, &data_u8, 1); ReadPoke1Bits(&backup, &gRecruitedPokemonRef->team[i]); if (data_u8 & 1) - gRecruitedPokemonRef->team[i].unk0 = FLAG_ON_TEAM | FLAG_UNK_1; + gRecruitedPokemonRef->team[i].flags = POKEMON_FLAG_ON_TEAM | POKEMON_FLAG_EXISTS; else - gRecruitedPokemonRef->team[i].unk0 = FLAG_NONE; + gRecruitedPokemonRef->team[i].flags = POKEMON_FLAG_NONE; } // ??? for (i = 0; i < 6; i++) { ReadBits(&backup, &data_s16, 16); if ((u16)data_s16 < NUM_MONSTERS) - gRecruitedPokemonRef->pokemon[data_s16].unk0 |= FLAG_ON_TEAM; + gRecruitedPokemonRef->pokemon[data_s16].flags |= POKEMON_FLAG_ON_TEAM; } // Team leader @@ -648,12 +648,12 @@ void ReadPoke1Bits(DataSerializer* a1, PokemonStruct1* pokemon) { memset(pokemon, 0, sizeof(PokemonStruct1)); - pokemon->unk0 = FLAG_NONE; + pokemon->flags = POKEMON_FLAG_NONE; pokemon->isTeamLeader = FALSE; ReadBits(a1, &pokemon->level, 7); if (pokemon->level) - pokemon->unk0 |= FLAG_UNK_1; + pokemon->flags |= POKEMON_FLAG_EXISTS; ReadBits(a1, &pokemon->speciesNum, 9); ReadDungeonLocationBits(a1, &pokemon->dungeonLocation); @@ -687,7 +687,7 @@ s32 SavePoke2s(u8* buffer, s32 size) for (i = 0; i < 4; i++) { PokemonStruct2* pokemon2 = &gRecruitedPokemonRef->pokemon2[i]; - WriteBits(&backup, &pokemon2->unk0, 2); + WriteBits(&backup, &pokemon2->flags, 2); WriteBits(&backup, pokemon2->isTeamLeader ? &data_u8_neg1 : &data_u8_zero, 1); WriteBits(&backup, &pokemon2->level, 7); @@ -732,7 +732,7 @@ s32 RestorePoke2s(u8* a1, s32 size) memset(pokemon2, 0, sizeof(PokemonStruct2)); - ReadBits(&backup, &pokemon2->unk0, 2); + ReadBits(&backup, &pokemon2->flags, 2); ReadBits(&backup, &unk2, 1); if (unk2 & 1) { diff --git a/src/pokemon_evolution.c b/src/pokemon_evolution.c index 475ec62be..f8823d646 100644 --- a/src/pokemon_evolution.c +++ b/src/pokemon_evolution.c @@ -222,7 +222,7 @@ PokemonStruct1 *sub_808F798(PokemonStruct1 *pokemon, s16 _species) r6 = pokeStruct.speciesNum; GetPokemonLevelData(&levelData,species,pokeStruct.level); pokeStruct.currExp = levelData.expRequired; - pokemon->unk0 = 0; + pokemon->flags = 0; pokeStruct.speciesNum = species; if (pokeStruct.unkC[0].level == 0) { pokeStruct.unkC[0].level = pokeStruct.level; diff --git a/src/run_dungeon.c b/src/run_dungeon.c index d53b12988..ab44cc245 100644 --- a/src/run_dungeon.c +++ b/src/run_dungeon.c @@ -858,7 +858,7 @@ static void sub_8043FD0(void) s32 i, monId, movesCount; for (monId = 0; monId < NUM_MONSTERS; monId++) { PokemonStruct1 *monStruct = &gRecruitedPokemonRef->pokemon[monId]; - if (PokemonFlag1(monStruct) && PokemonFlag2(monStruct)) { + if (PokemonExists(monStruct) && PokemonFlag2(monStruct)) { u16 learnedMoves[16]; LevelData levelData; // I have to make the variables volatile to get matching code. I'm sure there's a solution for this, but keeping it like that for now. @@ -925,7 +925,7 @@ void EnforceMaxItemsAndMoney(void) } for (i = 0; i < NUM_MONSTERS; i++) { PokemonStruct1 *mon = (&gRecruitedPokemonRef->pokemon[i]); - if (PokemonFlag1(mon) && PokemonFlag2(mon)) { + if (PokemonExists(mon) && PokemonFlag2(mon)) { mon->heldItem.id = 0; } } diff --git a/src/wigglytuff_shop2.c b/src/wigglytuff_shop2.c index d031215eb..cc3562403 100644 --- a/src/wigglytuff_shop2.c +++ b/src/wigglytuff_shop2.c @@ -166,7 +166,7 @@ static void sub_8021A60(void) for (index = 0; index < NUM_MONSTERS; index++) { pokeStruct = &gRecruitedPokemonRef->pokemon[index]; - if (!((u8)pokeStruct->unk0 & 1)) + if (!((u8)pokeStruct->flags & 1)) continue; areaIndex = CheckSpeciesinWigglytuffFriendArea(pokeStruct->speciesNum);