{"action":"created","comment":{"url":"https://api.github.com/repos/pret/pokeemerald/pulls/comments/242762797","pull_request_review_id":186352408,"id":242762797,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0Mjc2Mjc5Nw==","diff_hunk":"@@ -0,0 +1,7231 @@\n+#include \"global.h\"\n+#include \"alloc.h\"\n+#include \"battle.h\"\n+#include \"battle_anim.h\"\n+#include \"battle_controllers.h\"\n+#include \"battle_gfx_sfx_util.h\"\n+#include \"battle_interface.h\"\n+#include \"battle_pike.h\"\n+#include \"battle_pyramid.h\"\n+#include \"battle_pyramid_bag.h\"\n+#include \"bg.h\"\n+#include \"contest.h\"\n+#include \"data2.h\"\n+#include \"decompress.h\"\n+#include \"easy_chat.h\"\n+#include \"event_data.h\"\n+#include \"evolution_scene.h\"\n+#include \"field_control_avatar.h\"\n+#include \"field_effect.h\"\n+#include \"field_player_avatar.h\"\n+#include \"field_screen_effect.h\"\n+#include \"field_specials.h\"\n+#include \"field_weather.h\"\n+#include \"fieldmap.h\"\n+#include \"fldeff_softboiled.h\"\n+#include \"frontier_util.h\"\n+#include \"gpu_regs.h\"\n+#include \"graphics.h\"\n+#include \"international_string_util.h\"\n+#include \"item.h\"\n+#include \"item_menu.h\"\n+#include \"item_use.h\"\n+#include \"link.h\"\n+#include \"link_rfu.h\"\n+#include \"mail.h\"\n+#include \"main.h\"\n+#include \"menu.h\"\n+#include \"menu_helpers.h\"\n+#include \"metatile_behavior.h\"\n+#include \"overworld.h\"\n+#include \"palette.h\"\n+#include \"party_menu.h\"\n+#include \"pokemon.h\"\n+#include \"pokemon_icon.h\"\n+#include \"pokemon_storage_system.h\"\n+#include \"pokemon_summary_screen.h\"\n+#include \"pokenav.h\"\n+#include \"region_map.h\"\n+#include \"reshow_battle_screen.h\"\n+#include \"rom_8011DC0.h\"\n+#include \"scanline_effect.h\"\n+#include \"script.h\"\n+#include \"sound.h\"\n+#include \"sprite.h\"\n+#include \"start_menu.h\"\n+#include \"string_util.h\"\n+#include \"strings.h\"\n+#include \"task.h\"\n+#include \"text.h\"\n+#include \"text_window.h\"\n+#include \"trade.h\"\n+#include \"window.h\"\n+#include \"constants/battle.h\"\n+#include \"constants/battle_frontier.h\"\n+#include \"constants/field_effects.h\"\n+#include \"constants/flags.h\"\n+#include \"constants/items.h\"\n+#include \"constants/maps.h\"\n+#include \"constants/moves.h\"\n+#include \"constants/rgb.h\"\n+#include \"constants/songs.h\"\n+#include \"constants/species.h\"\n+#include \"constants/vars.h\"\n+\n+enum {\n+    CAN_LEARN_MOVE,\n+    CANNOT_LEARN_MOVE,\n+    ALREADY_KNOWS_MOVE,\n+    CANNOT_LEARN_MOVE_IS_EGG\n+};\n+\n+struct Unk_Rodata1 {\n+    void (*unk0)(u8, u8, u8, u8, u8, u8);\n+    u8 unk4[24];\n+    u8 unk1C;\n+    u8 unk1D;\n+    u8 unk1E;\n+    u8 unk1F;\n+};\n+\n+struct Struct203CEC4 {\n+    TaskFunc unk0;\n+    MainCallback exitCallback;\n+    u32 unk8_0:1;\n+    u32 unk8_1:3;\n+    u32 unk8_2:7;\n+    u32 unk9_0:7;\n+    u32 unkA_0:14;\n+    u8 unkC[3];\n+    u8 unkF[8];\n+    u8 unk17;\n+    u16 palBuffer[0xB0];\n+    u8 filler[0xA0];\n+    s16 data[16];\n+};\n+\n+struct Struct203CEDC {\n+    struct Unk_Rodata1 *unk0;\n+    u8 *unk4;\n+    u8 windowId;\n+    u8 unk9;\n+    u8 unkA;\n+    u8 unkB;\n+    u8 unkC;\n+};\n+\n+struct Struct8615C08 {\n+    const u8 *textPtr;\n+    TaskFunc func;\n+};\n+\n+struct Struct8615D9C {\n+    bool8 (*fieldMoveFunc)(void);\n+    u8 msgID;\n+};\n+\n+EWRAM_DATA struct Struct203CEC4 *gUnknown_0203CEC4 = NULL;\n+EWRAM_DATA struct Struct203CEC8 gUnknown_0203CEC8 = {0};\n+EWRAM_DATA struct Struct203CEDC *gUnknown_0203CEDC = NULL;\n+EWRAM_DATA u8 *gUnknown_0203CEE0 = NULL;\n+EWRAM_DATA u8 *gUnknown_0203CEE4 = NULL;\n+EWRAM_DATA u8 gUnknown_0203CEE8 = 0;\n+EWRAM_DATA u8 gUnknown_0203CEE9 = 0;\n+EWRAM_DATA MainCallback gPostMenuFieldCallback = NULL;\n+EWRAM_DATA u16 *gUnknown_0203CEF0 = 0;\n+EWRAM_DATA u16 *gUnknown_0203CEF4 = 0;\n+EWRAM_DATA u8 gSelectedOrderFromParty[4] = {0};\n+EWRAM_DATA u16 gUnknown_0203CEFC = 0;\n+EWRAM_DATA u16 gUnknown_0203CEFE = 0; // unused\n+EWRAM_DATA u8 gUnknown_0203CF00[3] = {0};\n+\n+// BELOW TO BE CONVERTED TO C\n+\n+extern u32 gUnknown_08615048[]; // tutor compatibility table\n+extern struct BgTemplate gUnknown_086156B8[];\n+extern struct Unk_Rodata1 gUnknown_086156C4[2];\n+// extern struct Unk_Rodata1 gUnknown_086156E4;\n+extern u8 gUnknown_08615704[][6][8];\n+extern u8 gUnknown_086157C4[];\n+extern u8 gUnknown_086157E0[];\n+extern const u8 gUnknown_086157FC[][3];\n+extern struct WindowTemplate gUnknown_08615810[];\n+extern struct WindowTemplate gUnknown_08615850[];\n+extern struct WindowTemplate gUnknown_086158D0[];\n+extern struct WindowTemplate gUnknown_08615890[];\n+extern struct WindowTemplate gUnknown_08615908;\n+extern struct WindowTemplate gUnknown_08615910;\n+extern struct WindowTemplate gUnknown_08615918;\n+extern struct WindowTemplate gUnknown_08615920;\n+extern struct WindowTemplate gUnknown_08615928;\n+extern struct WindowTemplate gUnknown_08615930;\n+extern struct WindowTemplate gUnknown_08615938;\n+extern struct WindowTemplate gUnknown_08615940;\n+extern struct WindowTemplate gUnknown_08615948;\n+extern struct WindowTemplate gUnknown_08615950;\n+extern struct WindowTemplate gUnknown_08615958;\n+extern struct WindowTemplate gUnknown_08615960;\n+extern struct WindowTemplate gUnknown_08615968;\n+extern struct WindowTemplate gUnknown_08615970;\n+extern u8 gUnknown_08615988[];\n+extern u8 gUnknown_086159CE[];\n+extern u8 gUnknown_08615A14[];\n+extern u8 gUnknown_08615A4A[];\n+extern u8 gUnknown_08615A80[];\n+extern u8 gUnknown_08615AB6[];\n+extern u8 gUnknown_08615AB8[];\n+extern u8 gUnknown_08615ABA[];\n+extern u8 gUnknown_08615ABD[];\n+extern u8 gUnknown_08615AC0[];\n+extern u8 gUnknown_08615AC3[];\n+extern u8 gUnknown_08615AC5[];\n+extern u8 gUnknown_08615AC7[];\n+extern u8 gUnknown_08615AC9[];\n+extern u8 gUnknown_08615ACB[];\n+extern u8 gUnknown_08615ACD[];\n+extern u8 gUnknown_08615AD0[];\n+extern u8 gUnknown_08615AD3[];\n+extern u8 gUnknown_08615AD6[];\n+extern u8 gUnknown_08615AD9[];\n+extern u8 gUnknown_08615ADC[];\n+extern u8 gUnknown_08615ADF[];\n+extern u8 gUnknown_08615AE2[];\n+extern u8 gUnknown_08615AE5[];\n+extern u8 gUnknown_08615AE8[];\n+extern u8 gUnknown_08615AEB[];\n+extern u8 gUnknown_08615AEE[];\n+extern u8 gUnknown_08615AF1[];\n+extern const u8 *gUnknown_08615AF4[];\n+extern const u8 *gUnknown_08615B60[];\n+extern struct Struct8615C08 gUnknown_08615C08[];\n+extern u8 *gUnknown_08615D38[];\n+extern u8 gUnknown_08615D70[];\n+extern const u16 gUnknown_08615D7E[];\n+extern const struct Struct8615D9C gUnknown_08615D9C[];\n+extern const u8 *gUnknown_08615E0C[];\n+extern const struct SpriteSheet gUnknown_08615EB0;\n+extern const struct SpritePalette gUnknown_08615EB8;\n+extern struct SpriteTemplate gSpriteTemplate_8615EC0;\n+extern const struct CompressedSpriteSheet gUnknown_08615EF8;\n+extern const struct CompressedSpritePalette gUnknown_08615F00;\n+extern struct SpriteTemplate gSpriteTemplate_8615F08;\n+extern const struct CompressedSpriteSheet gUnknown_08615F70;\n+extern struct SpriteTemplate gSpriteTemplate_8615F78;\n+extern const struct CompressedSpriteSheet gUnknown_08615FF8;\n+extern const struct CompressedSpritePalette gUnknown_08616000;\n+extern struct SpriteTemplate gSpriteTemplate_8616008;\n+extern u8 gUnknown_08616020[];\n+extern u16 gUnknown_08616040[];\n+\n+// ABOVE TO BE CONVERTED TO C\n+\n+extern void (*gUnknown_03006328)(u8, TaskFunc);\n+\n+void reset_brm(void);\n+void PartyMenuInitCallback(void);\n+bool8 PartyMenuSetup(void);\n+void sub_81B209C(void);\n+void PartyMenuExit(void);\n+bool8 AllocPartyMenuBg(void);\n+bool8 AllocPartyMiscGfx(void);\n+void sub_81B239C(u8);\n+void PartyMenuInitHelperStructs(u8);\n+void LoadHeldItemIcons(void);\n+void LoadPartyMenuPokeballGfx(void);\n+void LoadPartyMenuAilmentGfx(void);\n+bool8 party_menu_add_per_mon_objects(void);\n+bool8 RenderPartyMenuBoxes(void);\n+void sub_81B0F28(void);\n+void sub_81B2428(u8);\n+void display_pokemon_menu_message(u32);\n+void PartyMenuExitTask(u8);\n+void FreePartyPointers(void);\n+void PartyPaletteBufferCopy(u8);\n+void sub_81B0CEC(u8);\n+void UpdateSelectedPartyBox(struct Struct203CEDC *, u8);\n+void sub_81B2720(u8);\n+void DisplayPartyPokemonSelectForRelearner(u8);\n+void DisplayPartyPokemonSelectForContest(u8);\n+void DisplayPartyPokemonSelectForBattle(u8);\n+void sub_81B0B98(u8);\n+void DisplayPartyPokemonSelectHeldItemRelated(u8);\n+bool8 sub_81B0BFC(u8);\n+void DisplayPartyPokemonData(u8);\n+void sub_81B0FCC(u8, u8);\n+void DisplayPartyPokemonNickname(struct Pokemon *, struct Struct203CEDC *, u8);\n+void DisplayPartyPokemonLevelCheck(struct Pokemon *, struct Struct203CEDC *, u8);\n+void DisplayPartyPokemonGenderNidoranCheck(struct Pokemon *, struct Struct203CEDC *, u8);\n+void DisplayPartyPokemonHPCheck(struct Pokemon *, struct Struct203CEDC *, u8);\n+void DisplayPartyPokemonMaxHPCheck(struct Pokemon *, struct Struct203CEDC *, u8);\n+void DisplayPartyPokemonHPBarCheck(struct Pokemon *, struct Struct203CEDC *);\n+void DisplayPartyPokemonOtherText(u8, struct Struct203CEDC *, u8);\n+u8 sub_81B8830(void);\n+bool8 GetBattleEntryEligibility(struct Pokemon *);\n+bool8 sub_81B218C(u8);\n+void DisplayPartyPokemonSelectToTeachMove(u8, u16, u8);\n+u8 CanPartyPokemonLearnTMTutor(struct Pokemon *, u16, u8);\n+void DisplayPartyPokemonBarDetail(u8, const u8*, u8, u8*);\n+void DisplayPartyPokemonLevel(u8, struct Struct203CEDC *);\n+void DisplayPartyPokemonGender(u8, u16, u8*, struct Struct203CEDC *);\n+void DisplayPartyPokemonHP(u16, struct Struct203CEDC *);\n+void DisplayPartyPokemonMaxHP(u16, struct Struct203CEDC *);\n+void DisplayPartyPokemonHPBar(u16, u16, struct Struct203CEDC *);\n+void party_menu_link_mon_icon_anim(u16, u32, struct Struct203CEDC *, u8, u32);\n+void party_menu_link_mon_held_item_object(u16, u16, struct Struct203CEDC *);\n+void party_menu_link_mon_pokeball_object(u16, struct Struct203CEDC *);\n+void party_menu_link_mon_status_condition_object(u16, u8, struct Struct203CEDC *);\n+void party_menu_held_item_object(struct Pokemon *, struct Struct203CEDC *);\n+void party_menu_pokeball_object(struct Pokemon *, struct Struct203CEDC *);\n+void party_menu_icon_anim(struct Pokemon *, struct Struct203CEDC *, u32);\n+void party_menu_status_condition_object(struct Pokemon *, struct Struct203CEDC *);\n+u8 sub_81B5F74(u8, u8);\n+void sub_81B120C(void);\n+u8 sub_81B5F34(u8, u8);\n+void AnimateSelectedPartyIcon(u8, u8);\n+void sub_81B5F98(u8, u8);\n+u8 GetPartyBoxPalBitfield(u8, u8);\n+bool8 PartyBoxPal_ParnterOrDisqualifiedInArena(u8);\n+u8 sub_81B8F38(u8);\n+void c3_0811FAB4(u8);\n+void sub_81B9080(void);\n+void sub_81B4F88(void);\n+void sub_81B15D0(u8, s8*);\n+void sub_81B140C(u8, s8*);\n+u16 PartyMenuButtonHandler(s8*);\n+s8* sub_81B13EC(void);\n+bool8 sub_81B15A4(u8*);\n+void sub_81B302C(u8*);\n+void sub_81B9140(void);\n+void sub_81B6794(u8);\n+void sub_81B7E4C(u8);\n+void sub_81B8474(u8);\n+void sub_81B7FAC(u8);\n+void sub_81B3938(u8);\n+void sub_81B21AC(u8, u8);\n+void sub_81B36FC(u8);\n+void sub_81B407C(u8);\n+void sub_81B2210(u8);\n+bool8 sub_81B1660(u8);\n+const u8* sub_81B88BC(void);\n+u8 sub_81B1B5C(const u8*, u8);\n+void sub_81B16D4(u8);\n+void sub_81B334C(void);\n+void sub_81B1708(u8);\n+bool8 sub_81B1BD4(void);\n+void sub_81B1C1C(u8);\n+void sub_81B8558(void);\n+void UpdateCurrentPartySelection(s8*, s8);\n+void SetNewPartySelectTarget1(s8*, s8);\n+void SetNewPartySelectTarget2(s8*, s8);\n+s8 sub_81B1B00(s8, s8);\n+void sub_81B3300(const u8*);\n+void sub_81B1B8C(u8);\n+void DisplayPartyPokemonHPCheck(struct Pokemon*, struct Struct203CEDC*, u8);\n+void DisplayPartyPokemonHPBarCheck(struct Pokemon*, struct Struct203CEDC*);\n+bool16 sub_81B2134(struct Pokemon*);\n+bool16 sub_81B2164(struct Pokemon*);\n+void sub_81B2248(u8);\n+void sub_81B227C(u8);\n+bool8 sub_81B2370(u16, u8);\n+u16 sub_81B2360(u8);\n+bool8 sub_81B314C(void);\n+void sub_81B3414(struct Pokemon*, u8);\n+u8 sub_81B8A2C(struct Pokemon*);\n+u8 sub_81B856C(s8);\n+void sub_81B469C(u8);\n+void sub_81B3730(u8);\n+void sub_81B3828(void);\n+void pokemon_change_order(void);\n+void sub_81B3894(void);\n+void sub_81B3CC0(u8);\n+void sub_81B3D48(u8);\n+void swap_pokemon_and_oams(void);\n+void sub_81B3E60(u8);\n+void sub_81B41C4(void);\n+void c2_8123744(void);\n+void sub_81B452C(void);\n+void sub_81B4350(u8);\n+void sub_81B42D0(u8);\n+void sub_81B43A8(u8);\n+void sub_81B43DC(u8);\n+void sub_81B44FC(u8);\n+void sub_81B4578(void);\n+void sub_81B4624(u8);\n+void sub_81B5C94(struct Pokemon*, struct Struct203CEDC*);\n+void sub_81B48A8(u8);\n+void sub_81B48DC(u8);\n+void sub_81B4988(u8);\n+void sub_81B4A98(void);\n+void sub_81B4AE0(void);\n+void sub_81B4B6C(u8);\n+void sub_81B4BA0(u8);\n+void sub_81B4C60(u8);\n+void sub_81B4C94(u8);\n+bool8 sub_81B8A7C(void);\n+void sub_81B53FC(u8);\n+void sub_81B5430(u8);\n+void task_brm_cancel_1_on_keypad_a_or_b(u8);\n+void sub_81B5674(u8);\n+void sub_81B57DC(void);\n+void sub_81B5864(void);\n+void sub_81B56A4(u8);\n+void sub_81B56D8(u8);\n+void task_launch_hm_phase_2(u8);\n+u16 brm_get_selected_species(void);\n+void sub_81B5B38(u8, struct Pokemon*);\n+void UpdatePartyMonIconFrame(struct Sprite*);\n+void UpdatePartyMonIconFrameAndBounce(struct Sprite*);\n+void sub_81B5CB0(u16, struct Struct203CEDC*);\n+void sub_81B5DF0(u8, u8);\n+void sub_81B5E74(struct Sprite*);\n+void party_menu_get_status_condition_and_update_object(struct Pokemon*, struct Struct203CEDC*);\n+void party_menu_update_status_condition_object(u8, struct Struct203CEDC*);\n+u8 sub_81B8984(void);\n+void sub_81B6280(u8);\n+void c2_815ABFC(void);\n+u8 GetItemEffectType(u16);\n+void sub_81B672C(u8);\n+u16 sub_81B691C(struct Pokemon*, u8);\n+void option_menu_get_string(u8, u8*);\n+void sub_81B6BB4(u8);\n+void ether_effect_related_2(u8);\n+void ether_effect_related(u8);\n+void sub_81B6EB4(u8);\n+void sub_81B6FF4(u8);\n+void sub_81B6F60(u8);\n+void sub_81B6F98(u8);\n+void sub_81B77AC(u8);\n+void sub_81B7028(u8);\n+void sub_81B7088(u8);\n+void sub_81B7230(u8);\n+void sub_81B70B8(void);\n+void sub_81B70F0(void);\n+void sub_81B711C(u8);\n+void sub_81B7154(u8);\n+void sub_81B71D4(u8);\n+void sub_81B7294(u8);\n+void sub_81B72C8(u8);\n+void sub_81B73E4(u8);\n+void sub_81B79A0(struct Pokemon*, s16*);\n+void sub_81B754C(u8, struct Pokemon*);\n+void sub_81B75D4(u8);\n+void sub_81B767C(u8);\n+void sub_81B7634(u8);\n+void sub_81B76C8(u8);\n+void sub_81B7704(u8);\n+void sub_81B7810(u8);\n+void sub_81B787C(u8);\n+void sub_81B7910(u8, u16);\n+void sub_81B7A28(u8);\n+void task_sacred_ash_party_loop(u8);\n+void sub_81B7C10(u8);\n+void sub_81B8044(u8);\n+void sub_81B83B8(u8);\n+void sub_81B82A0(u8);\n+void sub_81B83F0(u16);\n+void sub_81B814C(void);\n+void sub_81B8088(u8);\n+void sub_81B8104(u8);\n+void sub_81B81A8(void);\n+bool8 sub_81B841C(u16);\n+void sub_81B8230(u8);\n+void sub_81B82D4(u8);\n+void sub_81B879C(u8);\n+void sub_81B8558(void);\n+bool8 GetBattleEntryEligibility(struct Pokemon*);\n+bool8 sub_81B8770(u8);\n+u8 sub_81B8888(void);\n+u8 sub_81B885C(void);\n+void sub_81B87E8(u8);\n+u8 pokemon_order_func(u8);\n+void sub_81B8FB0(u8, u8);\n+void sub_81B8C88(u8*, bool8);\n+void sub_81B8D88(u8*, u8, u8);\n+void sub_81B917C(u8);\n+void sub_81B91B4(u8);\n+void sub_81B9294(u8);\n+void sub_81B9240(u8);\n+void sub_81B9390(void);\n+void task_hm_without_phase_2(u8);\n+void sub_81B9424(u8);\n+void sub_81B9470(void);\n+void sub_81B94D0(u8);\n+void sub_81B953C(u8);\n+void sub_81B9588(void);\n+void sub_81B9640(u8);\n+void sub_81B97DC(struct Pokemon*, u8, u8);\n+\n+void InitPartyMenu(u8 a, u8 b, u8 c, u8 d, u8 e, TaskFunc task, MainCallback callback)\n+{\n+    u16 i;\n+    \n+    reset_brm();\n+    gUnknown_0203CEC4 = Alloc(sizeof(struct Struct203CEC4));\n+    if (gUnknown_0203CEC4 == NULL)\n+    {\n+        SetMainCallback2(callback);\n+    }\n+    else\n+    {\n+        gUnknown_0203CEC8.unk8_0 = a;\n+        gUnknown_0203CEC8.exitCallback = callback;\n+        gUnknown_0203CEC8.unkB = c;\n+        gUnknown_0203CEC4->unkA_0 = e;\n+        gUnknown_0203CEC4->unk0 = task;\n+        gUnknown_0203CEC4->exitCallback = NULL;\n+        gUnknown_0203CEC4->unk8_1 = 0;\n+        gUnknown_0203CEC4->unk8_2 = 0xFF;\n+        gUnknown_0203CEC4->unk9_0 = 0xFF;\n+        \n+        if (a == 4)\n+            gUnknown_0203CEC4->unk8_0 = TRUE;\n+        else\n+            gUnknown_0203CEC4->unk8_0 = FALSE;\n+        \n+        if (b != 0xFF)\n+            gUnknown_0203CEC8.mode = b;\n+        \n+        for (i = 0; i <= 15; i++)\n+            gUnknown_0203CEC4->data[i] = 0;\n+        for (i = 0; i < 3; i++)\n+            gUnknown_0203CEC4->unkC[i] |= 0xFF;\n+        \n+        if (d == 0)\n+            gUnknown_0203CEC8.unk9 = 0;\n+        else if (gUnknown_0203CEC8.unk9 > 5 || GetMonData(&gPlayerParty[gUnknown_0203CEC8.unk9], MON_DATA_SPECIES) == SPECIES_NONE)\n+            gUnknown_0203CEC8.unk9 = 0; // wut why is this else if?\n+        \n+        gTextFlags.autoScroll = 0;\n+        CalculatePlayerPartyCount();\n+        SetMainCallback2(PartyMenuInitCallback);\n+    }\n+}\n+\n+void PartyMenuCallback(void)\n+{\n+    RunTasks();\n+    AnimateSprites();\n+    BuildOamBuffer();\n+    do_scheduled_bg_tilemap_copies_to_vram();\n+    UpdatePaletteFade();\n+}\n+\n+void PartyMenuVBlankCallback(void)\n+{\n+    LoadOam();\n+    ProcessSpriteCopyRequests();\n+    TransferPlttBuffer();\n+}\n+\n+void PartyMenuInitCallback(void)\n+{\n+    while (TRUE)\n+    {\n+        if (sub_81221EC() == TRUE || PartyMenuSetup() == TRUE || sub_81221AC() == TRUE)\n+            break;\n+    }\n+}\n+\n+bool8 PartyMenuSetup(void)\n+{\n+    switch (gMain.state)\n+    {\n+        case 0:\n+            SetVBlankHBlankCallbacksToNull();\n+            ResetVramOamAndBgCntRegs();\n+            clear_scheduled_bg_copies_to_vram();\n+            gMain.state++;\n+            break;\n+        case 1:\n+            ScanlineEffect_Stop();\n+            gMain.state++;\n+            break;\n+        case 2:\n+            ResetPaletteFade();\n+            gPaletteFade.bufferTransferDisabled = TRUE;\n+            gMain.state++;\n+            break;\n+        case 3:\n+            ResetSpriteData();\n+            gMain.state++;\n+            break;\n+        case 4:\n+            FreeAllSpritePalettes();\n+            gMain.state++;\n+            break;\n+        case 5:\n+            if (!sub_81221AC())\n+                ResetTasks();\n+            gMain.state++;\n+            break;\n+        case 6:\n+            sub_81B209C();\n+            gMain.state++;\n+            break;\n+        case 7:\n+            if (!AllocPartyMenuBg())\n+            {\n+                PartyMenuExit();\n+                return TRUE;\n+            }\n+            else\n+            {\n+                gUnknown_0203CEC4->data[0] = 0;\n+                gMain.state++;\n+            }\n+            break;\n+        case 8:\n+            if (AllocPartyMiscGfx())\n+                gMain.state++;\n+            break;\n+        case 9:\n+            sub_81B239C(gUnknown_0203CEC8.mode);\n+            gMain.state++;\n+            break;\n+        case 10:\n+            PartyMenuInitHelperStructs(gUnknown_0203CEC8.mode);\n+            gUnknown_0203CEC4->data[0] = 0;\n+            gMain.state++;\n+            break;\n+        case 11:\n+            LoadHeldItemIcons();\n+            gMain.state++;\n+            break;\n+        case 12:\n+            LoadPartyMenuPokeballGfx();\n+            gMain.state++;\n+            break;\n+        case 13:\n+            LoadPartyMenuAilmentGfx();\n+            gMain.state++;\n+            break;\n+        case 14:\n+            LoadMonIconPalettes();\n+            gMain.state++;\n+            break;\n+        case 15:\n+            if (party_menu_add_per_mon_objects())\n+            {\n+                gUnknown_0203CEC4->data[0] = 0;\n+                gMain.state++;\n+            }\n+            break;\n+        case 16:\n+            if (RenderPartyMenuBoxes())\n+            {\n+                gUnknown_0203CEC4->data[0] = 0;\n+                gMain.state++;\n+            }\n+            break;\n+        case 17:\n+            sub_81B0F28();\n+            gMain.state++;\n+            break;\n+        case 18:\n+            sub_81B2428(gUnknown_0203CEC4->unk8_0);\n+            gMain.state++;\n+            break;\n+        case 19:\n+            gMain.state++;\n+            break;\n+        case 20:\n+            CreateTask(gUnknown_0203CEC4->unk0, 0);\n+            display_pokemon_menu_message(gUnknown_0203CEC4->unkA_0);\n+            gMain.state++;\n+            break;\n+        case 21:\n+            BlendPalettes(0xFFFFFFFF, 16, 0);\n+            gPaletteFade.bufferTransferDisabled = FALSE;\n+            gMain.state++;\n+            break;\n+        case 22:\n+            BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_BLACK);\n+            gMain.state++;\n+            break;\n+        default:\n+            SetVBlankCallback(PartyMenuVBlankCallback);\n+            SetMainCallback2(PartyMenuCallback);\n+            return TRUE;\n+    }\n+    return FALSE;\n+}\n+\n+void PartyMenuExit(void)\n+{\n+    BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK);\n+    CreateTask(PartyMenuExitTask, 0);\n+    SetVBlankCallback(PartyMenuVBlankCallback);\n+    SetMainCallback2(PartyMenuCallback);\n+}\n+\n+void PartyMenuExitTask(u8 taskId)\n+{\n+    if (!gPaletteFade.active)\n+    {\n+        SetMainCallback2(gUnknown_0203CEC8.exitCallback);\n+        FreePartyPointers();\n+        DestroyTask(taskId);\n+    }\n+}\n+\n+void reset_brm(void)\n+{\n+    gUnknown_0203CEC4 = NULL;\n+    gUnknown_0203CEE4 = NULL;\n+    gUnknown_0203CEDC = NULL;\n+    gUnknown_0203CEE0 = NULL;\n+}\n+\n+bool8 AllocPartyMenuBg(void)\n+{\n+    gUnknown_0203CEE4 = Alloc(0x800);\n+    if (gUnknown_0203CEE4 == NULL)\n+        return FALSE;\n+    memset(gUnknown_0203CEE4, 0, 0x800);\n+    ResetBgsAndClearDma3BusyFlags(0);\n+    InitBgsFromTemplates(0, gUnknown_086156B8, 3);\n+    SetBgTilemapBuffer(1, gUnknown_0203CEE4);\n+    ResetAllBgsCoordinates();\n+    schedule_bg_copy_tilemap_to_vram(1);\n+    SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_OBJ_ON | DISPCNT_OBJ_1D_MAP);\n+    SetGpuReg(REG_OFFSET_BLDCNT, 0);\n+    ShowBg(0);\n+    ShowBg(1);\n+    ShowBg(2);\n+    return TRUE;\n+}\n+\n+bool8 AllocPartyMiscGfx(void)\n+{\n+    int sizeout;\n+    \n+    switch (gUnknown_0203CEC4->data[0])\n+    {\n+        case 0:\n+            gUnknown_0203CEE0 = malloc_and_decompress(gPartyMenuMisc_Gfx, &sizeout);\n+            LoadBgTiles(1, gUnknown_0203CEE0, sizeout, 0);\n+            gUnknown_0203CEC4->data[0]++;\n+            break;\n+        case 1:\n+            if (!IsDma3ManagerBusyWithBgCopy())\n+            {\n+                LZDecompressWram(gPartyMenuMisc_Tilemap, gUnknown_0203CEE4);\n+                gUnknown_0203CEC4->data[0]++;\n+            }\n+            break;\n+        case 2:\n+            LoadCompressedPalette(gPartyMenuMisc_Pal, 0, 0x160);\n+            CpuCopy16(gPlttBufferUnfaded, gUnknown_0203CEC4->palBuffer, 0x160);\n+            gUnknown_0203CEC4->data[0]++;\n+            break;\n+        case 3:\n+            PartyPaletteBufferCopy(4);\n+            gUnknown_0203CEC4->data[0]++;\n+            break;\n+        case 4:\n+            PartyPaletteBufferCopy(5);\n+            gUnknown_0203CEC4->data[0]++;\n+            break;\n+        case 5:\n+            PartyPaletteBufferCopy(6);\n+            gUnknown_0203CEC4->data[0]++;\n+            break;\n+        case 6:\n+            PartyPaletteBufferCopy(7);\n+            gUnknown_0203CEC4->data[0]++;\n+            break;\n+        case 7:\n+            PartyPaletteBufferCopy(8);\n+            gUnknown_0203CEC4->data[0]++;\n+            break;\n+        default:\n+            return TRUE;\n+    }\n+    return FALSE;\n+}\n+\n+void PartyPaletteBufferCopy(u8 offset)\n+{\n+    offset *= 16;\n+    CpuCopy16(&gPlttBufferUnfaded[0x30], &gPlttBufferUnfaded[offset], 32);\n+    CpuCopy16(&gPlttBufferUnfaded[0x30], &gPlttBufferFaded[offset], 32);\n+}\n+\n+void FreePartyPointers(void)\n+{\n+    if (gUnknown_0203CEC4)\n+        Free(gUnknown_0203CEC4);\n+    if (gUnknown_0203CEE4)\n+        Free(gUnknown_0203CEE4);\n+    if (gUnknown_0203CEE0)\n+        Free(gUnknown_0203CEE0);\n+    if (gUnknown_0203CEDC)\n+        Free(gUnknown_0203CEDC);\n+    FreeAllWindowBuffers();\n+}\n+\n+void PartyMenuInitHelperStructs(u8 a)\n+{\n+    u8 i;\n+    \n+    gUnknown_0203CEDC = Alloc(sizeof(struct Struct203CEDC[PARTY_SIZE]));\n+    \n+    for (i = 0; i < PARTY_SIZE; i++)\n+    {\n+        gUnknown_0203CEDC[i].unk0 = &gUnknown_086156C4[1];\n+        gUnknown_0203CEDC[i].unk4 = gUnknown_08615704[a][i];\n+        gUnknown_0203CEDC[i].windowId = i;\n+        gUnknown_0203CEDC[i].unk9 |= 0xFF;\n+        gUnknown_0203CEDC[i].unkA |= 0xFF;\n+        gUnknown_0203CEDC[i].unkB |= 0xFF;\n+        gUnknown_0203CEDC[i].unkC |= 0xFF;\n+    }\n+    gUnknown_0203CEDC[0].unk0 = &gUnknown_086156C4[0];\n+    if (a == 3)\n+        gUnknown_0203CEDC[3].unk0 = &gUnknown_086156C4[0];\n+    else if (a)\n+        gUnknown_0203CEDC[1].unk0 = &gUnknown_086156C4[0];\n+}\n+\n+void RenderPartyMenuBox(u8 slot)\n+{\n+    if (gUnknown_0203CEC8.unk8_0 == 5 && slot > 2)\n+    {\n+        sub_81B0CEC(slot);\n+        if (gUnknown_02022FF8[slot - 3].species == SPECIES_NONE)\n+            UpdateSelectedPartyBox(&gUnknown_0203CEDC[slot], 0x40);\n+        else\n+            UpdateSelectedPartyBox(&gUnknown_0203CEDC[slot], 8);\n+        CopyWindowToVram(gUnknown_0203CEDC[slot].windowId, 2);\n+        PutWindowTilemap(gUnknown_0203CEDC[slot].windowId);\n+        schedule_bg_copy_tilemap_to_vram(2);\n+    }\n+    else\n+    {\n+        if (GetMonData(&gPlayerParty[slot], MON_DATA_SPECIES) == SPECIES_NONE)\n+        {\n+            sub_81B2720(gUnknown_0203CEDC[slot].windowId);\n+            UpdateSelectedPartyBox(&gUnknown_0203CEDC[slot], 0x40);\n+            CopyWindowToVram(gUnknown_0203CEDC[slot].windowId, 2);\n+        }\n+        else\n+        {\n+            if (gUnknown_0203CEC8.unk8_0 == 7)\n+                DisplayPartyPokemonSelectForRelearner(slot);\n+            else if (gUnknown_0203CEC8.unk8_0 == 2)\n+                DisplayPartyPokemonSelectForContest(slot);\n+            else if (gUnknown_0203CEC8.unk8_0 == 4)\n+                DisplayPartyPokemonSelectForBattle(slot);\n+            else if (gUnknown_0203CEC8.unk8_0 == 11)\n+                sub_81B0B98(slot);\n+            else if (gUnknown_0203CEC8.unk8_0 == 12)\n+                DisplayPartyPokemonSelectHeldItemRelated(slot);\n+            else if (!sub_81B0BFC(slot))\n+                DisplayPartyPokemonData(slot);\n+            \n+            if (gUnknown_0203CEC8.unk8_0 == 5)\n+                sub_81B0FCC(slot, 0);\n+            else if (gUnknown_0203CEC8.unk9 == slot)\n+                sub_81B0FCC(slot, 1);\n+            else\n+                sub_81B0FCC(slot, 0);\n+        }\n+        PutWindowTilemap(gUnknown_0203CEDC[slot].windowId);\n+        schedule_bg_copy_tilemap_to_vram(0);\n+    }\n+}\n+\n+void DisplayPartyPokemonData(u8 slot)\n+{\n+    if (GetMonData(&gPlayerParty[slot], MON_DATA_IS_EGG))\n+    {\n+        gUnknown_0203CEDC[slot].unk0->unk0(gUnknown_0203CEDC[slot].windowId, 0, 0, 0, 0, 1);\n+        DisplayPartyPokemonNickname(&gPlayerParty[slot], &gUnknown_0203CEDC[slot], 0);\n+    }\n+    else\n+    {\n+        gUnknown_0203CEDC[slot].unk0->unk0(gUnknown_0203CEDC[slot].windowId, 0, 0, 0, 0, 0);\n+        DisplayPartyPokemonNickname(&gPlayerParty[slot], &gUnknown_0203CEDC[slot], 0);\n+        DisplayPartyPokemonLevelCheck(&gPlayerParty[slot], &gUnknown_0203CEDC[slot], 0);\n+        DisplayPartyPokemonGenderNidoranCheck(&gPlayerParty[slot], &gUnknown_0203CEDC[slot], 0);\n+        DisplayPartyPokemonHPCheck(&gPlayerParty[slot], &gUnknown_0203CEDC[slot], 0);\n+        DisplayPartyPokemonMaxHPCheck(&gPlayerParty[slot], &gUnknown_0203CEDC[slot], 0);\n+        DisplayPartyPokemonHPBarCheck(&gPlayerParty[slot], &gUnknown_0203CEDC[slot]);\n+    }\n+}\n+\n+void DisplayPartyPokemonSelectData(u8 slot, u8 stringID)\n+{\n+    struct Pokemon *mon = &gPlayerParty[slot];\n+    \n+    gUnknown_0203CEDC[slot].unk0->unk0(gUnknown_0203CEDC[slot].windowId, 0, 0, 0, 0, 1);\n+    DisplayPartyPokemonNickname(mon, &gUnknown_0203CEDC[slot], 0);\n+    if (!GetMonData(mon, MON_DATA_IS_EGG))\n+    {\n+        DisplayPartyPokemonLevelCheck(mon, &gUnknown_0203CEDC[slot], 0);\n+        DisplayPartyPokemonGenderNidoranCheck(mon, &gUnknown_0203CEDC[slot], 0);\n+    }\n+    DisplayPartyPokemonOtherText(stringID, &gUnknown_0203CEDC[slot], 0);\n+}\n+\n+void DisplayPartyPokemonSelectForBattle(u8 slot)\n+{\n+    u8 i;\n+    struct Pokemon *mon = &gPlayerParty[slot];\n+    u8 *ptr = gSelectedOrderFromParty;\n+    \n+    if (!GetBattleEntryEligibility(mon))\n+    {\n+        DisplayPartyPokemonSelectData(slot, 7);\n+        return;\n+    }\n+    else\n+    {\n+        i = 0;\n+        while (i < sub_81B8830())\n+        {\n+            if (ptr[i] != 0 && (ptr[i] - 1) == slot)\n+            {\n+                DisplayPartyPokemonSelectData(slot, i + 2);\n+                return;\n+            }\n+            i++;\n+        }\n+        DisplayPartyPokemonSelectData(slot, 1);\n+    }\n+}\n+\n+void DisplayPartyPokemonSelectForContest(u8 slot)\n+{\n+    switch (sub_80DAE0C(&gPlayerParty[slot]))\n+    {\n+        case 0:\n+        case 3:\n+        case 4:\n+            DisplayPartyPokemonSelectData(slot, 7);\n+            break;\n+        case 1:\n+        case 2:\n+            DisplayPartyPokemonSelectData(slot, 6);\n+            break;\n+    }\n+}\n+\n+void DisplayPartyPokemonSelectForRelearner(u8 slot)\n+{\n+    if (GetNumberOfRelearnableMoves(&gPlayerParty[slot]) == 0)\n+        DisplayPartyPokemonSelectData(slot, 9);\n+    else\n+        DisplayPartyPokemonSelectData(slot, 8);\n+}\n+\n+void sub_81B0B98(u8 slot)\n+{\n+    if (sub_81B218C(slot) == TRUE)\n+        DisplayPartyPokemonSelectData(slot, 6);\n+    else\n+        DisplayPartyPokemonSelectData(slot, 7);\n+}\n+\n+void DisplayPartyPokemonSelectHeldItemRelated(u8 slot)\n+{\n+    if (GetMonData(&gPlayerParty[slot], MON_DATA_HELD_ITEM))\n+        DisplayPartyPokemonSelectData(slot, 11);\n+    else\n+        DisplayPartyPokemonSelectData(slot, 12);\n+}\n+\n+bool8 sub_81B0BFC(u8 slot)\n+{\n+    struct Pokemon *currentPokemon = &gPlayerParty[slot];\n+    u16 item = gSpecialVar_ItemId;\n+    \n+    if (gUnknown_0203CEC8.unkB == 12)\n+    {\n+        gSpecialVar_Result = FALSE;\n+        DisplayPartyPokemonSelectToTeachMove(slot, 0, gSpecialVar_0x8005);\n+    }\n+    else\n+    {\n+        if (gUnknown_0203CEC8.unkB != 3)\n+            return FALSE;\n+        \n+        switch (CheckIfItemIsTMHMOrEvolutionStone(item))\n+        {\n+            default:\n+                return FALSE;\n+            case 1:\n+                DisplayPartyPokemonSelectToTeachMove(slot, item, 0);\n+                break;\n+            case 2:\n+                if (!GetMonData(currentPokemon, MON_DATA_IS_EGG) && GetEvolutionTargetSpecies(currentPokemon, 3, item) != SPECIES_NONE)\n+                    return FALSE;\n+                DisplayPartyPokemonSelectData(slot, 0);\n+                break;\n+        }\n+    }\n+    return TRUE;\n+}\n+\n+void DisplayPartyPokemonSelectToTeachMove(u8 slot, u16 item, u8 tutor)\n+{\n+    switch (CanPartyPokemonLearnTMTutor(&gPlayerParty[slot], item, tutor))\n+    {\n+        case CANNOT_LEARN_MOVE:\n+        case CANNOT_LEARN_MOVE_IS_EGG:\n+            DisplayPartyPokemonSelectData(slot, 9);\n+            break;\n+        case ALREADY_KNOWS_MOVE:\n+            DisplayPartyPokemonSelectData(slot, 10);\n+            break;\n+        default:\n+            DisplayPartyPokemonSelectData(slot, 8);\n+            break;\n+    }\n+}\n+\n+void sub_81B0CEC(u8 slot)\n+{\n+    struct Struct203CEDC *structPtr = &gUnknown_0203CEDC[slot];\n+    u8 actualSlot = slot - 3;\n+    \n+    if (gUnknown_02022FF8[actualSlot].species == SPECIES_NONE)\n+    {\n+        sub_81B2720(structPtr->windowId);\n+    }\n+    else\n+    {\n+        structPtr->unk0->unk0(structPtr->windowId, 0, 0, 0, 0, 0);\n+        StringCopy(gStringVar1, gUnknown_02022FF8[actualSlot].nickname);\n+        StringGetEnd10(gStringVar1);\n+        sub_81DB52C(gStringVar1);\n+        DisplayPartyPokemonBarDetail(structPtr->windowId, gStringVar1, 0, structPtr->unk0->unk4);\n+        DisplayPartyPokemonLevel(gUnknown_02022FF8[actualSlot].level, structPtr);\n+        DisplayPartyPokemonGender(gUnknown_02022FF8[actualSlot].gender, gUnknown_02022FF8[actualSlot].species, gUnknown_02022FF8[actualSlot].nickname, structPtr);\n+        DisplayPartyPokemonHP(gUnknown_02022FF8[actualSlot].hp, structPtr);\n+        DisplayPartyPokemonMaxHP(gUnknown_02022FF8[actualSlot].maxhp, structPtr);\n+        DisplayPartyPokemonHPBar(gUnknown_02022FF8[actualSlot].hp, gUnknown_02022FF8[actualSlot].maxhp, structPtr);\n+    }\n+}\n+\n+bool8 RenderPartyMenuBoxes(void)\n+{\n+    RenderPartyMenuBox(gUnknown_0203CEC4->data[0]);\n+    if (++gUnknown_0203CEC4->data[0] == 6)\n+        return TRUE;\n+    return FALSE;\n+}\n+\n+u8* GetPartyMiscGraphicsTile(u16 tileId)\n+{\n+    return &gUnknown_0203CEE0[tileId << 5];\n+}\n+\n+void party_menu_add_per_mon_objects_internal(u8 slot)\n+{\n+    u8 actualSlot;\n+    \n+    if (gUnknown_0203CEC8.unk8_0 == 5 && slot > 2)\n+    {\n+        u8 status;\n+        actualSlot = slot - 3;\n+        \n+        if (gUnknown_02022FF8[actualSlot].species != SPECIES_NONE)\n+        {\n+            party_menu_link_mon_icon_anim(gUnknown_02022FF8[actualSlot].species, gUnknown_02022FF8[actualSlot].personality, &gUnknown_0203CEDC[slot], 0, 0);\n+            party_menu_link_mon_held_item_object(gUnknown_02022FF8[actualSlot].species, gUnknown_02022FF8[actualSlot].heldItem, &gUnknown_0203CEDC[slot]);\n+            party_menu_link_mon_pokeball_object(gUnknown_02022FF8[actualSlot].species, &gUnknown_0203CEDC[slot]);\n+            if (gUnknown_02022FF8[actualSlot].hp == 0)\n+                status = AILMENT_FNT;\n+            else\n+                status = pokemon_ailments_get_primary(gUnknown_02022FF8[actualSlot].status);\n+            party_menu_link_mon_status_condition_object(gUnknown_02022FF8[actualSlot].species, status, &gUnknown_0203CEDC[slot]);\n+        }\n+    }\n+    else if (GetMonData(&gPlayerParty[slot], MON_DATA_SPECIES) != SPECIES_NONE)\n+    {\n+        party_menu_icon_anim(&gPlayerParty[slot], &gUnknown_0203CEDC[slot], slot);\n+        party_menu_held_item_object(&gPlayerParty[slot], &gUnknown_0203CEDC[slot]);\n+        party_menu_pokeball_object(&gPlayerParty[slot], &gUnknown_0203CEDC[slot]);\n+        party_menu_status_condition_object(&gPlayerParty[slot], &gUnknown_0203CEDC[slot]);\n+    }\n+}\n+\n+bool8 party_menu_add_per_mon_objects(void)\n+{\n+    party_menu_add_per_mon_objects_internal(gUnknown_0203CEC4->data[0]);\n+    if (++gUnknown_0203CEC4->data[0] == 6)\n+        return TRUE;\n+    return FALSE;\n+}\n+\n+void sub_81B0F28(void)\n+{\n+    if (gUnknown_0203CEC8.unk8_0 == 5)\n+    {\n+        FillBgTilemapBufferRect(1, 14, 23, 17, 7, 2, 1);\n+    }\n+    else\n+    {\n+        if (gUnknown_0203CEC4->unk8_0 != FALSE)\n+        {\n+            gUnknown_0203CEC4->unk8_2 = sub_81B5F74(0xBF, 0x88);\n+            sub_81B120C();\n+            gUnknown_0203CEC4->unk9_0 = sub_81B5F74(0xBF, 0x98);\n+        }\n+        else\n+        {\n+            gUnknown_0203CEC4->unk9_0 = sub_81B5F34(0xC6, 0x94);\n+        }\n+        sub_81B0FCC(gUnknown_0203CEC8.unk9, 1);\n+    }\n+}\n+\n+void sub_81B0FCC(u8 slot, u8 b)\n+{\n+    u8 spriteId;\n+    \n+    switch (slot)\n+    {\n+        default:\n+            if (GetMonData(&gPlayerParty[slot], MON_DATA_SPECIES) != SPECIES_NONE)\n+            {\n+                UpdateSelectedPartyBox(&gUnknown_0203CEDC[slot], GetPartyBoxPalBitfield(slot, b));\n+                AnimateSelectedPartyIcon(gUnknown_0203CEDC[slot].unk9, b);\n+                sub_81B5F98(gUnknown_0203CEDC[slot].unkB, b);\n+            }\n+            return;\n+        case 6:\n+            if (b == 0)\n+                sub_8199C30(1, 23, 16, 7, 2, 1);\n+            else\n+                sub_8199C30(1, 23, 16, 7, 2, 2);\n+            spriteId = gUnknown_0203CEC4->unk8_2;\n+            break;\n+        case 7:\n+            if (!gUnknown_0203CEC4->unk8_0)\n+            {\n+                if (b == 0)\n+                    sub_8199C30(1, 23, 17, 7, 2, 1);\n+                else\n+                    sub_8199C30(1, 23, 17, 7, 2, 2);\n+            }\n+            else if (b == 0)\n+            {\n+                sub_8199C30(1, 23, 18, 7, 2, 1);\n+            }\n+            else\n+            {\n+                sub_8199C30(1, 23, 18, 7, 2, 2);\n+            }\n+            spriteId = gUnknown_0203CEC4->unk9_0;\n+            break;\n+    }\n+    sub_81B5F98(spriteId, b);\n+    schedule_bg_copy_tilemap_to_vram(1);\n+}\n+\n+u8 GetPartyBoxPalBitfield(u8 slot, u8 b)\n+{\n+    u8 returnVar = 0;\n+    if (b == 1)\n+        returnVar = 1;\n+    if (GetMonData(&gPlayerParty[slot], MON_DATA_HP) == 0)\n+        returnVar |= 2;\n+    if (PartyBoxPal_ParnterOrDisqualifiedInArena(slot) == TRUE)\n+        returnVar |= 8;\n+    if (gUnknown_0203CEC8.unkB == 9)\n+        returnVar |= 16;\n+    if (gUnknown_0203CEC8.unkB == 8)\n+    {\n+        if (slot == gUnknown_0203CEC8.unk9 || slot == gUnknown_0203CEC8.unkA)\n+            returnVar |= 4;\n+    }\n+    if (gUnknown_0203CEC8.unkB == 10 && slot == gUnknown_0203CEC8.unk9 )\n+        returnVar |= 32;\n+    \n+    return returnVar;\n+}\n+\n+bool8 PartyBoxPal_ParnterOrDisqualifiedInArena(u8 slot)\n+{\n+    if (gUnknown_0203CEC8.mode == 2 && (slot == 1 || slot == 4 || slot == 5))\n+        return TRUE;\n+    \n+    if (slot < 3 && (gBattleTypeFlags & BATTLE_TYPE_ARENA) && gMain.inBattle && (gBattleStruct->arenaLostPlayerMons >> sub_81B8F38(slot) & 1))\n+        return TRUE;\n+    \n+    return FALSE;\n+}\n+\n+void sub_81B120C(void)\n+{\n+    CopyToBgTilemapBufferRect_ChangePalette(1, gUnknown_086157C4, 23, 16, 7, 2, 17);\n+    CopyToBgTilemapBufferRect_ChangePalette(1, gUnknown_086157E0, 23, 18, 7, 2, 17);\n+    schedule_bg_copy_tilemap_to_vram(1);\n+}\n+\n+bool8 IsMultiBattle(void)\n+{\n+    if ((gBattleTypeFlags & (BATTLE_TYPE_DOUBLE | BATTLE_TYPE_TRAINER | BATTLE_TYPE_MULTI)) == (BATTLE_TYPE_DOUBLE | BATTLE_TYPE_TRAINER | BATTLE_TYPE_MULTI) && gMain.inBattle)\n+        return TRUE;\n+    return FALSE;\n+}\n+\n+void sub_81B1288(struct Pokemon *partySlot, struct Pokemon *pokemon)\n+{\n+    struct Pokemon *temp = Alloc(sizeof(struct Pokemon));\n+    \n+    *temp = *partySlot;\n+    *partySlot = *pokemon;\n+    *pokemon = *temp;\n+    \n+    Free(temp);\n+}\n+\n+void sub_81B12C0(u8 taskId)\n+{\n+    BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK);\n+    gTasks[taskId].func = c3_0811FAB4;\n+}\n+\n+void c3_0811FAB4(u8 taskId)\n+{\n+    if (!gPaletteFade.active)\n+    {\n+        if (gUnknown_0203CEC8.unk8_0 == 1)\n+            sub_81B9080();\n+        \n+        if  (gUnknown_0203CEC4->exitCallback != NULL)\n+            SetMainCallback2(gUnknown_0203CEC4->exitCallback);\n+        else\n+            SetMainCallback2(gUnknown_0203CEC8.exitCallback);\n+        \n+        ResetSpriteData();\n+        FreePartyPointers();\n+        DestroyTask(taskId);\n+    }\n+}\n+\n+u8 GetCursorSelectionMonId(void)\n+{\n+    return gUnknown_0203CEC8.unk9;\n+}\n+\n+u8 sub_81B1360(void)\n+{\n+    return gUnknown_0203CEC8.unk8_0;\n+}\n+\n+void sub_81B1370(u8 taskId)\n+{\n+    if (!gPaletteFade.active && sub_81221EC() != TRUE)\n+    {\n+        s8 *ptr = sub_81B13EC();\n+        \n+        switch (PartyMenuButtonHandler(ptr))\n+        {\n+            case 1:\n+                sub_81B140C(taskId, ptr);\n+                break;\n+            case 2:\n+                sub_81B15D0(taskId, ptr);\n+                break;\n+            case 8:\n+                if (gUnknown_0203CEC4->unk8_0)\n+                {\n+                    PlaySE(SE_SELECT);\n+                    sub_81B4F88();\n+                }\n+        }\n+    }\n+}\n+\n+s8* sub_81B13EC(void)\n+{\n+    if (gUnknown_0203CEC8.unkB == 8 || gUnknown_0203CEC8.unkB == 10)\n+        return &gUnknown_0203CEC8.unkA;\n+    return &gUnknown_0203CEC8.unk9;\n+}\n+\n+void sub_81B140C(u8 taskId, s8 *ptr)\n+{\n+    if (*ptr == 6)\n+    {\n+        gUnknown_0203CEC8.unk4(taskId);\n+    }\n+    else\n+    {\n+        switch (gUnknown_0203CEC8.unkB - 3)\n+        {\n+            case 7:\n+                if (sub_81B15A4((u8*)ptr))\n+                {\n+                    sub_81B302C(&gUnknown_0203CEC4->unkC[1]);\n+                    sub_81615A8(taskId);\n+                }\n+                break;\n+            case 0:\n+                if (sub_81B15A4((u8*)ptr))\n+                {\n+                    if (gUnknown_0203CEC8.unk8_0 == 1)\n+                        gUnknown_0203CEC4->exitCallback = sub_81B9140;\n+                    \n+                    sub_81B302C(&gUnknown_0203CEC4->unkC[1]);\n+                    gUnknown_03006328(taskId, sub_81B6794);\n+                }\n+                break;\n+            case 9:\n+                if (sub_81B15A4((u8*)ptr))\n+                {\n+                    PlaySE(SE_SELECT);\n+                    sub_81B302C(&gUnknown_0203CEC4->unkC[1]);\n+                    sub_81B7E4C(taskId);\n+                }\n+                break;\n+            case 4:\n+                if (sub_81B15A4((u8*)ptr))\n+                {\n+                    PlaySE(SE_SELECT);\n+                    sub_81B302C(&gUnknown_0203CEC4->unkC[1]);\n+                    sub_81B8474(taskId);\n+                }\n+                break;\n+            case 2:\n+            case 3:\n+                if (sub_81B15A4((u8*)ptr))\n+                {\n+                    PlaySE(SE_SELECT);\n+                    sub_81B302C(&gUnknown_0203CEC4->unkC[1]);\n+                    sub_81B7FAC(taskId);\n+                }\n+                break;\n+            case 5:\n+                PlaySE(SE_SELECT);\n+                sub_81B3938(taskId);\n+                break;\n+            case 8:\n+                PlaySE(SE_SELECT);\n+                sub_81B12C0(taskId);\n+                break;\n+            case 10:\n+                if (sub_81B15A4((u8*)ptr))\n+                {\n+                    sub_81B21AC(taskId, (u8)*ptr);\n+                }\n+                break;\n+            default:\n+            case 1:\n+            case 6:\n+                PlaySE(SE_SELECT);\n+                sub_81B36FC(taskId);\n+                break;\n+        }\n+    }\n+}\n+\n+bool8 sub_81B15A4(u8 *slotPtr)\n+{\n+    if (GetMonData(&gPlayerParty[*slotPtr], MON_DATA_IS_EGG) == TRUE)\n+    {\n+        PlaySE(SE_HAZURE);\n+        return FALSE;\n+    }\n+    return TRUE;\n+}\n+\n+void sub_81B15D0(u8 taskId, s8 *ptr)\n+{\n+    switch (gUnknown_0203CEC8.unkB)\n+    {\n+        case 1:\n+            PlaySE(SE_HAZURE);\n+            break;\n+        case 8:\n+        case 10:\n+            PlaySE(SE_SELECT);\n+            sub_81B407C(taskId);\n+            break;\n+        case 13:\n+            PlaySE(SE_SELECT);\n+            sub_81B2210(taskId);\n+            break;\n+        default:\n+            PlaySE(SE_SELECT);\n+            if (sub_81B1660(taskId) != TRUE)\n+            {\n+                if (!sub_81221AC())\n+                    gSpecialVar_0x8004 = 7;\n+                gUnknown_0203CEE8 = 0;\n+                *ptr = 7;\n+                sub_81B12C0(taskId);\n+            }\n+            break;\n+    }\n+}    \n+\n+bool8 sub_81B1660(u8 taskId)\n+{\n+    const u8* stringPtr = NULL;\n+    \n+    if (gUnknown_0203CEC8.unk8_0 == 2)\n+        stringPtr = gText_CancelParticipation;\n+    else if (gUnknown_0203CEC8.unk8_0 == 4)\n+        stringPtr = sub_81B88BC();\n+    \n+    if (stringPtr == NULL)\n+        return FALSE;\n+    \n+    sub_81B302C(&gUnknown_0203CEC4->unkC[1]);\n+    StringExpandPlaceholders(gStringVar4, stringPtr);\n+    sub_81B1B5C(gStringVar4, 1);\n+    gTasks[taskId].func = sub_81B16D4;\n+    return TRUE;\n+}\n+\n+void sub_81B16D4(u8 taskId)\n+{\n+    if (sub_81B1BD4() != TRUE)\n+    {\n+        sub_81B334C();\n+        gTasks[taskId].func = sub_81B1708;\n+    }\n+}\n+\n+void sub_81B1708(u8 taskId)\n+{\n+    switch (Menu_ProcessInputNoWrapClearOnChoose())\n+    {\n+        case 0:\n+            gUnknown_0203CEE8 = 0;\n+            gUnknown_0203CEC8.unk9 = 7;\n+            sub_81B8558();\n+            sub_81B12C0(taskId);\n+            break;\n+        case MENU_B_PRESSED:\n+            PlaySE(SE_SELECT);\n+        case 1:\n+            sub_81B1C1C(taskId);\n+            break;\n+    }\n+}\n+\n+u16 PartyMenuButtonHandler(s8 *ptr)\n+{\n+    s8 movementDir;\n+    \n+    switch (gMain.newAndRepeatedKeys)\n+    {\n+        case DPAD_UP:\n+            movementDir = -1;\n+            break;\n+        case DPAD_DOWN:\n+            movementDir = 1;\n+            break;\n+        case DPAD_LEFT:\n+            movementDir = -2;\n+            break;\n+        case DPAD_RIGHT:\n+            movementDir = 2;\n+            break;\n+        default:\n+            switch (sub_812210C())\n+            {\n+                case 1:\n+                    movementDir = -1;\n+                    break;\n+                case 2:\n+                    movementDir = 1;\n+                    break;\n+                default:\n+                    movementDir = 0;\n+                    break;\n+            }\n+    }\n+    \n+    if (gMain.newKeys & START_BUTTON)\n+        return 8;\n+    \n+    if (movementDir)\n+    {\n+        UpdateCurrentPartySelection(ptr, movementDir);\n+        return 0;\n+    }\n+    \n+    if ((gMain.newKeys & A_BUTTON) && *ptr == 7)\n+        return 2;\n+    \n+    return gMain.newKeys & (A_BUTTON | B_BUTTON);\n+}\n+\n+#ifdef NONMATCHING\n+void UpdateCurrentPartySelection(s8 *ptr, s8 movementDir)\n+{\n+    s8 slot = *ptr;\n+    \n+    if (gUnknown_0203CEC8.mode == 0)\n+        SetNewPartySelectTarget1(ptr, movementDir);\n+    else\n+        SetNewPartySelectTarget2(ptr, movementDir);\n+    \n+    if (*ptr != slot)\n+    {\n+        PlaySE(SE_SELECT);\n+        sub_81B0FCC(slot, 0);\n+        sub_81B0FCC(*ptr, 1);\n+    }\n+}\n+#else\n+NAKED\n+void UpdateCurrentPartySelection(s8 *ptr, s8 b)\n+{\n+    asm_unified(\"push {r4,r5,lr}\\n\\\n+\tadds r5, r0, 0\\n\\\n+\tlsls r1, 24\\n\\\n+\tlsrs r1, 24\\n\\\n+\tldrb r4, [r5]\\n\\\n+\tldr r0, =gUnknown_0203CEC8\\n\\\n+\tldrb r0, [r0, 0x8]\\n\\\n+\tlsls r0, 26\\n\\\n+\tlsrs r0, 30\\n\\\n+\tcmp r0, 0\\n\\\n+\tbne _081B1820\\n\\\n+\tlsls r1, 24\\n\\\n+\tasrs r1, 24\\n\\\n+\tadds r0, r5, 0\\n\\\n+\tbl SetNewPartySelectTarget1\\n\\\n+\tb _081B182A\\n\\\n+\t.pool\\n\\\n+_081B1820:\\n\\\n+\tlsls r1, 24\\n\\\n+\tasrs r1, 24\\n\\\n+\tadds r0, r5, 0\\n\\\n+\tbl SetNewPartySelectTarget2\\n\\\n+_081B182A:\\n\\\n+\tmovs r1, 0\\n\\\n+\tldrsb r1, [r5, r1]\\n\\\n+\tlsls r4, 24\\n\\\n+\tasrs r0, r4, 24\\n\\\n+\tcmp r1, r0\\n\\\n+\tbeq _081B184C\\n\\\n+\tmovs r0, 0x5\\n\\\n+\tbl PlaySE\\n\\\n+\tlsrs r0, r4, 24\\n\\\n+\tmovs r1, 0\\n\\\n+\tbl sub_81B0FCC\\n\\\n+\tldrb r0, [r5]\\n\\\n+\tmovs r1, 0x1\\n\\\n+\tbl sub_81B0FCC\\n\\\n+_081B184C:\\n\\\n+\tpop {r4,r5}\\n\\\n+\tpop {r0}\\n\\\n+\tbx r0\\n\");\n+}\n+#endif\n+\n+#ifdef NONMATCHING\n+void SetNewPartySelectTarget1(s8 *ptr, s8 b)\n+{\n+    u8 r0r2;\n+    \n+    switch (b)\n+    {\n+        case -1:\n+            r0r2 = *ptr;\n+            if (*ptr == 0)\n+            {\n+                *ptr = 7;\n+            }\n+            else if (*ptr == 6)\n+            {\n+                *ptr = gPlayerPartyCount - 1;\n+            }\n+            else if (*ptr == 7)\n+            {\n+                if (gUnknown_0203CEC4->unk8_0)\n+                    *ptr = 6;\n+                else\n+                    *ptr = gPlayerPartyCount - 1;\n+            }\n+            else\n+            {\n+                *ptr = r0r2 - 1;\n+            }\n+            break;\n+        case 1:\n+            r0r2 = *ptr;\n+            if (*ptr != 7)\n+            {\n+                if ((u32)*ptr == gPlayerPartyCount - 1)\n+                {\n+                    if (gUnknown_0203CEC4->unk8_0)\n+                        *ptr = 6;\n+                    else\n+                        *ptr = 7;\n+                }\n+                else\n+                {\n+                    *ptr = r0r2 + 1;\n+                }\n+            }\n+            else\n+            {\n+                *ptr = 0;\n+            }\n+            break;\n+        case 2:\n+            if (gPlayerPartyCount != 1 && *ptr == 0)\n+            {\n+                if (gUnknown_0203CEC4->unk8_1 == 0)\n+                    *ptr = 1;\n+                else\n+                    *ptr = gUnknown_0203CEC4->unk8_1;\n+            }\n+            break;\n+        case -2:\n+            if (*ptr != 0 && *ptr != 6 && *ptr != 7)\n+            {\n+                gUnknown_0203CEC4->unk8_1 = *ptr;\n+                *ptr = 0;\n+            }\n+            break;\n+    }\n+}\n+#else\n+NAKED\n+void SetNewPartySelectTarget1(s8 *ptr, s8 b)\n+{\n+    asm_unified(\"push {r4,lr}\\n\\\n+\tadds r4, r0, 0\\n\\\n+\tlsls r1, 24\\n\\\n+\tasrs r1, 24\\n\\\n+\tmovs r0, 0x1\\n\\\n+\tnegs r0, r0\\n\\\n+\tcmp r1, r0\\n\\\n+\tbeq _081B187A\\n\\\n+\tcmp r1, r0\\n\\\n+\tbgt _081B1870\\n\\\n+\tsubs r0, 0x1\\n\\\n+\tcmp r1, r0\\n\\\n+\tbeq _081B1924\\n\\\n+\tb _081B1952\\n\\\n+_081B1870:\\n\\\n+\tcmp r1, 0x1\\n\\\n+\tbeq _081B18C0\\n\\\n+\tcmp r1, 0x2\\n\\\n+\tbeq _081B18F8\\n\\\n+\tb _081B1952\\n\\\n+_081B187A:\\n\\\n+\tldrb r0, [r4]\\n\\\n+\tmovs r1, 0\\n\\\n+\tldrsb r1, [r4, r1]\\n\\\n+\tcmp r1, 0\\n\\\n+\tbne _081B1888\\n\\\n+\tmovs r0, 0x7\\n\\\n+\tb _081B1950\\n\\\n+_081B1888:\\n\\\n+\tcmp r1, 0x6\\n\\\n+\tbne _081B1898\\n\\\n+\tldr r0, =gPlayerPartyCount\\n\\\n+\tldrb r0, [r0]\\n\\\n+\tsubs r0, 0x1\\n\\\n+\tb _081B1950\\n\\\n+\t.pool\\n\\\n+_081B1898:\\n\\\n+\tcmp r1, 0x7\\n\\\n+\tbne _081B18BC\\n\\\n+\tldr r0, =gUnknown_0203CEC4\\n\\\n+\tldr r0, [r0]\\n\\\n+\tldrb r0, [r0, 0x8]\\n\\\n+\tlsls r0, 31\\n\\\n+\tcmp r0, 0\\n\\\n+\tbeq _081B18B0\\n\\\n+\tmovs r0, 0x6\\n\\\n+\tb _081B1950\\n\\\n+\t.pool\\n\\\n+_081B18B0:\\n\\\n+\tldr r0, =gPlayerPartyCount\\n\\\n+\tldrb r0, [r0]\\n\\\n+\tsubs r0, 0x1\\n\\\n+\tb _081B1950\\n\\\n+\t.pool\\n\\\n+_081B18BC:\\n\\\n+\tsubs r0, 0x1\\n\\\n+\tb _081B1950\\n\\\n+_081B18C0:\\n\\\n+\tldrb r2, [r4]\\n\\\n+\tmovs r0, 0\\n\\\n+\tldrsb r0, [r4, r0]\\n\\\n+\tcmp r0, 0x7\\n\\\n+\tbeq _081B194E\\n\\\n+\tmovs r1, 0\\n\\\n+\tldrsb r1, [r4, r1]\\n\\\n+\tldr r0, =gPlayerPartyCount\\n\\\n+\tldrb r0, [r0]\\n\\\n+\tsubs r0, 0x1\\n\\\n+\tcmp r1, r0\\n\\\n+\tbne _081B18F4\\n\\\n+\tldr r0, =gUnknown_0203CEC4\\n\\\n+\tldr r0, [r0]\\n\\\n+\tldrb r0, [r0, 0x8]\\n\\\n+\tlsls r0, 31\\n\\\n+\tcmp r0, 0\\n\\\n+\tbeq _081B18F0\\n\\\n+\tmovs r0, 0x6\\n\\\n+\tb _081B1950\\n\\\n+\t.pool\\n\\\n+_081B18F0:\\n\\\n+\tmovs r0, 0x7\\n\\\n+\tb _081B1950\\n\\\n+_081B18F4:\\n\\\n+\tadds r0, r2, 0x1\\n\\\n+\tb _081B1950\\n\\\n+_081B18F8:\\n\\\n+\tldr r0, =gPlayerPartyCount\\n\\\n+\tldrb r0, [r0]\\n\\\n+\tcmp r0, 0x1\\n\\\n+\tbeq _081B1952\\n\\\n+\tmovs r0, 0\\n\\\n+\tldrsb r0, [r4, r0]\\n\\\n+\tcmp r0, 0\\n\\\n+\tbne _081B1952\\n\\\n+\tldr r0, =gUnknown_0203CEC4\\n\\\n+\tldr r0, [r0]\\n\\\n+\tldrb r0, [r0, 0x8]\\n\\\n+\tlsls r0, 28\\n\\\n+\tlsrs r0, 29\\n\\\n+\tcmp r0, 0\\n\\\n+\tbne _081B1950\\n\\\n+\tmovs r0, 0x1\\n\\\n+\tb _081B1950\\n\\\n+\t.pool\\n\\\n+_081B1924:\\n\\\n+\tmovs r0, 0\\n\\\n+\tldrsb r0, [r4, r0]\\n\\\n+\tcmp r0, 0\\n\\\n+\tbeq _081B1952\\n\\\n+\tcmp r0, 0x6\\n\\\n+\tbeq _081B1952\\n\\\n+\tcmp r0, 0x7\\n\\\n+\tbeq _081B1952\\n\\\n+\tldr r0, =gUnknown_0203CEC4\\n\\\n+\tldr r3, [r0]\\n\\\n+\tmovs r1, 0\\n\\\n+\tldrsb r1, [r4, r1]\\n\\\n+\tmovs r0, 0x7\\n\\\n+\tands r1, r0\\n\\\n+\tlsls r1, 1\\n\\\n+\tldrb r2, [r3, 0x8]\\n\\\n+\tmovs r0, 0xF\\n\\\n+\tnegs r0, r0\\n\\\n+\tands r0, r2\\n\\\n+\torrs r0, r1\\n\\\n+\tstrb r0, [r3, 0x8]\\n\\\n+_081B194E:\\n\\\n+\tmovs r0, 0\\n\\\n+_081B1950:\\n\\\n+\tstrb r0, [r4]\\n\\\n+_081B1952:\\n\\\n+\tpop {r4}\\n\\\n+\tpop {r0}\\n\\\n+\tbx r0\\n\\\n+    .pool\\n\");\n+}\n+#endif\n+\n+#ifdef NONMATCHING\n+void SetNewPartySelectTarget2(s8 *ptr, s8 b)\n+{\n+    u8 unk;\n+    s8 unk2 = b;\n+    u8 unk3;\n+    \n+    switch (b)\n+    {\n+        case -1:\n+            unk = *ptr;\n+            if (*ptr == 0)\n+            {\n+                *ptr = 7;\n+            }\n+            else if (*ptr == 6)\n+            {\n+                *ptr = gPlayerPartyCount - 1;\n+            }\n+            else if (*ptr == 7)\n+            {\n+                if (gUnknown_0203CEC4->unk8_0)\n+                {\n+                    *ptr = 6;\n+                }\n+                else\n+                {\n+                    *ptr = unk - 1;\n+                    unk2 = sub_81B1B00(*ptr, unk2);\n+                    if (unk2 != -1)\n+                        *ptr = unk2;\n+                }\n+            }\n+            else\n+            {\n+                unk2 = sub_81B1B00(*ptr, unk2);\n+                if (unk2 != -1)\n+                    *ptr = unk2;\n+            }\n+            break;\n+        case 1:\n+            if (*ptr == 6)\n+            {\n+                *ptr = 7;\n+            }\n+            else if (*ptr == 7)\n+            {\n+                *ptr = 0;\n+            }\n+            else\n+            {\n+                unk2 = sub_81B1B00(*ptr, 1);\n+                if (unk2 == -1)\n+                {\n+                    if (gUnknown_0203CEC4->unk8_0)\n+                        *ptr = 6;\n+                    else\n+                        *ptr = 7;\n+                }\n+                else\n+                {\n+                    *ptr = unk2;\n+                }\n+            }\n+            break;\n+        case 2:\n+            if (*ptr == 0)\n+            {\n+                if (gUnknown_0203CEC4->unk8_1 == 3)\n+                {\n+                    if (GetMonData(&gPlayerParty[3], MON_DATA_SPECIES) != SPECIES_NONE)\n+                        *ptr = 3;\n+                }\n+                else if (GetMonData(&gPlayerParty[2], MON_DATA_SPECIES) != SPECIES_NONE)\n+                {\n+                    *ptr = 2;\n+                }\n+            }\n+            else if (*ptr == 1)\n+            {\n+                if (gUnknown_0203CEC4->unk8_1 == 5)\n+                {\n+                    if (GetMonData(&gPlayerParty[5], MON_DATA_SPECIES) != SPECIES_NONE)\n+                        *ptr = 5;\n+                }\n+                else if (GetMonData(&gPlayerParty[4], MON_DATA_SPECIES) != SPECIES_NONE)\n+                {\n+                    *ptr = 4;\n+                }\n+            }\n+            break;\n+        case -2:\n+            unk3 = *ptr - 2;\n+            if (unk3 <= 1)\n+            {\n+                gUnknown_0203CEC4->unk8_1 = *ptr;\n+                *ptr = 0;\n+            }\n+            else \n+            {\n+                unk3 = *ptr - 4;\n+                if (unk3 <= 1)\n+                {\n+                    gUnknown_0203CEC4->unk8_1 = *ptr;\n+                    *ptr = 1;\n+                }\n+            }\n+            break;\n+    }\n+}\n+#else\n+NAKED\n+void SetNewPartySelectTarget2(s8 *ptr, s8 b)\n+{\n+    asm_unified(\"push {r4-r6,lr}\\n\\\n+\tadds r4, r0, 0\\n\\\n+\tlsls r1, 24\\n\\\n+\tlsrs r2, r1, 24\\n\\\n+\tasrs r5, r1, 24\\n\\\n+\tmovs r6, 0x1\\n\\\n+\tnegs r6, r6\\n\\\n+\tcmp r5, r6\\n\\\n+\tbeq _081B1988\\n\\\n+\tcmp r5, r6\\n\\\n+\tbgt _081B197E\\n\\\n+\tmovs r0, 0x2\\n\\\n+\tnegs r0, r0\\n\\\n+\tcmp r5, r0\\n\\\n+\tbne _081B197C\\n\\\n+\tb _081B1A9C\\n\\\n+_081B197C:\\n\\\n+\tb _081B1AF4\\n\\\n+_081B197E:\\n\\\n+\tcmp r5, 0x1\\n\\\n+\tbeq _081B19E4\\n\\\n+\tcmp r5, 0x2\\n\\\n+\tbeq _081B1A24\\n\\\n+\tb _081B1AF4\\n\\\n+_081B1988:\\n\\\n+\tldrb r1, [r4]\\n\\\n+\tmovs r0, 0\\n\\\n+\tldrsb r0, [r4, r0]\\n\\\n+\tcmp r0, 0\\n\\\n+\tbne _081B1996\\n\\\n+\tmovs r0, 0x7\\n\\\n+\tb _081B1AF2\\n\\\n+_081B1996:\\n\\\n+\tcmp r0, 0x6\\n\\\n+\tbne _081B19A8\\n\\\n+\tldr r0, =gPlayerPartyCount\\n\\\n+\tldrb r0, [r0]\\n\\\n+\tsubs r0, 0x1\\n\\\n+\tb _081B1AF2\\n\\\n+\t.pool\\n\\\n+_081B19A8:\\n\\\n+\tcmp r0, 0x7\\n\\\n+\tbne _081B19C4\\n\\\n+\tldr r0, =gUnknown_0203CEC4\\n\\\n+\tldr r0, [r0]\\n\\\n+\tldrb r0, [r0, 0x8]\\n\\\n+\tlsls r0, 31\\n\\\n+\tcmp r0, 0\\n\\\n+\tbeq _081B19C0\\n\\\n+\tmovs r0, 0x6\\n\\\n+\tb _081B1AF2\\n\\\n+\t.pool\\n\\\n+_081B19C0:\\n\\\n+\tsubs r0, r1, 0x1\\n\\\n+\tstrb r0, [r4]\\n\\\n+_081B19C4:\\n\\\n+\tmovs r0, 0\\n\\\n+\tldrsb r0, [r4, r0]\\n\\\n+\tlsls r1, r2, 24\\n\\\n+\tasrs r1, 24\\n\\\n+\tbl sub_81B1B00\\n\\\n+\tlsls r0, 24\\n\\\n+\tlsrs r2, r0, 24\\n\\\n+\tasrs r0, 24\\n\\\n+\tmovs r1, 0x1\\n\\\n+\tnegs r1, r1\\n\\\n+\tcmp r0, r1\\n\\\n+\tbne _081B19E0\\n\\\n+\tb _081B1AF4\\n\\\n+_081B19E0:\\n\\\n+\tstrb r2, [r4]\\n\\\n+\tb _081B1AF4\\n\\\n+_081B19E4:\\n\\\n+\tmovs r0, 0\\n\\\n+\tldrsb r0, [r4, r0]\\n\\\n+\tcmp r0, 0x6\\n\\\n+\tbne _081B19F0\\n\\\n+\tmovs r0, 0x7\\n\\\n+\tb _081B1AF2\\n\\\n+_081B19F0:\\n\\\n+\tcmp r0, 0x7\\n\\\n+\tbne _081B19F8\\n\\\n+\tmovs r0, 0\\n\\\n+\tb _081B1AF2\\n\\\n+_081B19F8:\\n\\\n+\tmovs r0, 0\\n\\\n+\tldrsb r0, [r4, r0]\\n\\\n+\tmovs r1, 0x1\\n\\\n+\tbl sub_81B1B00\\n\\\n+\tlsls r0, 24\\n\\\n+\tlsrs r2, r0, 24\\n\\\n+\tasrs r0, 24\\n\\\n+\tcmp r0, r6\\n\\\n+\tbne _081B19E0\\n\\\n+\tldr r0, =gUnknown_0203CEC4\\n\\\n+\tldr r0, [r0]\\n\\\n+\tldrb r0, [r0, 0x8]\\n\\\n+\tlsls r0, 31\\n\\\n+\tcmp r0, 0\\n\\\n+\tbeq _081B1A20\\n\\\n+\tmovs r0, 0x6\\n\\\n+\tb _081B1AF2\\n\\\n+\t.pool\\n\\\n+_081B1A20:\\n\\\n+\tmovs r0, 0x7\\n\\\n+\tb _081B1AF2\\n\\\n+_081B1A24:\\n\\\n+\tmovs r0, 0\\n\\\n+\tldrsb r0, [r4, r0]\\n\\\n+\tcmp r0, 0\\n\\\n+\tbne _081B1A5C\\n\\\n+\tldr r0, =gUnknown_0203CEC4\\n\\\n+\tldr r0, [r0]\\n\\\n+\tldrb r0, [r0, 0x8]\\n\\\n+\tlsls r0, 28\\n\\\n+\tlsrs r6, r0, 29\\n\\\n+\tcmp r6, 0x3\\n\\\n+\tbne _081B1A54\\n\\\n+\tldr r0, =gPlayerParty + 300\\n\\\n+\tmovs r1, 0xB\\n\\\n+\tbl GetMonData\\n\\\n+\tcmp r0, 0\\n\\\n+\tbeq _081B1AF4\\n\\\n+\tstrb r6, [r4]\\n\\\n+\tb _081B1AF4\\n\\\n+\t.pool\\n\\\n+_081B1A54:\\n\\\n+\tldr r0, =gPlayerParty + 200\\n\\\n+\tb _081B1A70\\n\\\n+\t.pool\\n\\\n+_081B1A5C:\\n\\\n+\tcmp r0, 0x1\\n\\\n+\tbne _081B1AF4\\n\\\n+\tldr r0, =gUnknown_0203CEC4\\n\\\n+\tldr r0, [r0]\\n\\\n+\tldrb r0, [r0, 0x8]\\n\\\n+\tlsls r0, 28\\n\\\n+\tlsrs r5, r0, 29\\n\\\n+\tcmp r5, 0x5\\n\\\n+\tbne _081B1A88\\n\\\n+\tldr r0, =gPlayerParty + 500\\n\\\n+_081B1A70:\\n\\\n+\tmovs r1, 0xB\\n\\\n+\tbl GetMonData\\n\\\n+\tcmp r0, 0\\n\\\n+\tbeq _081B1AF4\\n\\\n+\tstrb r5, [r4]\\n\\\n+\tb _081B1AF4\\n\\\n+\t.pool\\n\\\n+_081B1A88:\\n\\\n+\tldr r0, =gPlayerParty + 400\\n\\\n+\tmovs r1, 0xB\\n\\\n+\tbl GetMonData\\n\\\n+\tcmp r0, 0\\n\\\n+\tbeq _081B1AF4\\n\\\n+\tmovs r0, 0x4\\n\\\n+\tb _081B1AF2\\n\\\n+\t.pool\\n\\\n+_081B1A9C:\\n\\\n+\tldrb r1, [r4]\\n\\\n+\tsubs r0, r1, 0x2\\n\\\n+\tlsls r0, 24\\n\\\n+\tlsrs r0, 24\\n\\\n+\tcmp r0, 0x1\\n\\\n+\tbhi _081B1ACC\\n\\\n+\tldr r0, =gUnknown_0203CEC4\\n\\\n+\tldr r3, [r0]\\n\\\n+\tmovs r1, 0\\n\\\n+\tldrsb r1, [r4, r1]\\n\\\n+\tmovs r0, 0x7\\n\\\n+\tands r1, r0\\n\\\n+\tlsls r1, 1\\n\\\n+\tldrb r2, [r3, 0x8]\\n\\\n+\tmovs r0, 0xF\\n\\\n+\tnegs r0, r0\\n\\\n+\tands r0, r2\\n\\\n+\torrs r0, r1\\n\\\n+\tstrb r0, [r3, 0x8]\\n\\\n+\tmovs r0, 0\\n\\\n+\tb _081B1AF2\\n\\\n+\t.pool\\n\\\n+_081B1ACC:\\n\\\n+\tsubs r0, r1, 0x4\\n\\\n+\tlsls r0, 24\\n\\\n+\tlsrs r0, 24\\n\\\n+\tcmp r0, 0x1\\n\\\n+\tbhi _081B1AF4\\n\\\n+\tldr r0, =gUnknown_0203CEC4\\n\\\n+\tldr r3, [r0]\\n\\\n+\tmovs r1, 0\\n\\\n+\tldrsb r1, [r4, r1]\\n\\\n+\tmovs r0, 0x7\\n\\\n+\tands r1, r0\\n\\\n+\tlsls r1, 1\\n\\\n+\tldrb r2, [r3, 0x8]\\n\\\n+\tmovs r0, 0xF\\n\\\n+\tnegs r0, r0\\n\\\n+\tands r0, r2\\n\\\n+\torrs r0, r1\\n\\\n+\tstrb r0, [r3, 0x8]\\n\\\n+\tmovs r0, 0x1\\n\\\n+_081B1AF2:\\n\\\n+\tstrb r0, [r4]\\n\\\n+_081B1AF4:\\n\\\n+\tpop {r4-r6}\\n\\\n+\tpop {r0}\\n\\\n+\tbx r0\\n\\\n+\t.pool\\n\");\n+}\n+#endif\n+\n+s8 sub_81B1B00(s8 a, s8 b)\n+{\n+    while (TRUE)\n+    {\n+        a += b;\n+        if ((u8)a >= 6)\n+            return -1;\n+        if (GetMonData(&gPlayerParty[a], MON_DATA_SPECIES) != SPECIES_NONE)\n+            return a;\n+    }\n+}\n+\n+u8* GetMonNickname(struct Pokemon *mon, u8 *dest)\n+{\n+    GetMonData(mon, MON_DATA_NICKNAME, dest);\n+    return StringGetEnd10(dest);\n+}\n+\n+u8 sub_81B1B5C(const u8* str, u8 b)\n+{\n+    u8 taskId;\n+    \n+    sub_81B3300(str);\n+    taskId = CreateTask(sub_81B1B8C, 1);\n+    gTasks[taskId].data[0] = b;\n+    return taskId;\n+}\n+\n+void sub_81B1B8C(u8 taskId)\n+{\n+    if (RunTextPrintersRetIsActive(6) != TRUE)\n+    {\n+        if (gTasks[taskId].data[0] == 0)\n+        {\n+            sub_8198070(6, 0);\n+            ClearWindowTilemap(6);\n+        }\n+        DestroyTask(taskId);\n+    }\n+}\n+\n+bool8 sub_81B1BD4(void)\n+{\n+    return FuncIsActiveTask(sub_81B1B8C);\n+}\n+\n+void sub_81B1BE8(u8 taskId)\n+{\n+    if (sub_81221EC() != TRUE)\n+    {\n+        display_pokemon_menu_message(0);\n+        gTasks[taskId].func = sub_81B1370;\n+    }\n+}\n+\n+void sub_81B1C1C(u8 taskId)\n+{\n+    if (sub_81B1BD4() != TRUE)\n+    {\n+        sub_8198070(6, 0);\n+        ClearWindowTilemap(6);\n+        if (sub_81221AC() == TRUE)\n+        {\n+            gTasks[taskId].func = sub_81B1BE8;\n+        }\n+        else\n+        {\n+            display_pokemon_menu_message(0);\n+            gTasks[taskId].func = sub_81B1370;\n+        }\n+    }\n+}\n+\n+void sub_81B1C84(struct Pokemon *mon, u16 item, u8 c, u8 unused)\n+{\n+    GetMonNickname(mon, gStringVar1);\n+    CopyItemName(item, gStringVar2);\n+    StringExpandPlaceholders(gStringVar4, gText_PkmnWasGivenItem);\n+    sub_81B1B5C(gStringVar4, c);\n+    schedule_bg_copy_tilemap_to_vram(2);\n+}\n+\n+void sub_81B1CD0(struct Pokemon *mon, u16 item, u8 c)\n+{\n+    GetMonNickname(mon, gStringVar1);\n+    CopyItemName(item, gStringVar2);\n+    StringExpandPlaceholders(gStringVar4, gText_RecievedItemFromPkmn);\n+    sub_81B1B5C(gStringVar4, c);\n+    schedule_bg_copy_tilemap_to_vram(2);\n+}\n+\n+void sub_81B1D1C(struct Pokemon *mon, u16 item, u8 c)\n+{\n+    GetMonNickname(mon, gStringVar1);\n+    CopyItemName(item, gStringVar2);\n+    StringExpandPlaceholders(gStringVar4, gText_SwitchPkmnItem);\n+    sub_81B1B5C(gStringVar4, c);\n+    schedule_bg_copy_tilemap_to_vram(2);\n+}\n+\n+void sub_81B1D68(u16 item, u16 item2, u8 c)\n+{\n+    CopyItemName(item, gStringVar1);\n+    CopyItemName(item2, gStringVar2);\n+    StringExpandPlaceholders(gStringVar4, gText_SwitchedPkmnItem);\n+    sub_81B1B5C(gStringVar4, c);\n+    schedule_bg_copy_tilemap_to_vram(2);\n+}\n+\n+void sub_81B1DB8(struct Pokemon *mon, u16 item)\n+{\n+    u8 itemBytes[2];\n+    \n+    if (ItemIsMail(item) == TRUE)\n+    {\n+        if (GiveMailToMon(mon, item) == 0xFF)\n+            return;\n+    }\n+    itemBytes[0] = item;\n+    itemBytes[1] = item >> 8;\n+    SetMonData(mon, MON_DATA_HELD_ITEM, itemBytes);\n+}\n+\n+u8 sub_81B1E00(struct Pokemon* mon)\n+{\n+    u16 item = GetMonData(mon, MON_DATA_HELD_ITEM);\n+    \n+    if (item == ITEM_NONE)\n+        return 0;\n+    if (AddBagItem(item, 1) == FALSE)\n+        return 1;\n+    \n+    item = ITEM_NONE;\n+    SetMonData(mon, MON_DATA_HELD_ITEM, &item);\n+    return 2;\n+}\n+\n+void pokemon_item_not_removed(u16 itemUnused)\n+{\n+    StringExpandPlaceholders(gStringVar4, gText_BagFullCouldNotRemoveItem);\n+}\n+\n+void sub_81B1E60(u8 taskId)\n+{\n+    s16 *data = gTasks[taskId].data;\n+    \n+    data[0] += data[2];\n+    data[3]--;\n+    SetMonData(&gPlayerParty[data[4]], MON_DATA_HP, &data[0]);\n+    DisplayPartyPokemonHPCheck(&gPlayerParty[data[4]], &gUnknown_0203CEDC[data[4]], 1);\n+    DisplayPartyPokemonHPBarCheck(&gPlayerParty[data[4]], &gUnknown_0203CEDC[data[4]]);\n+    if (data[3] == 0 || data[0] == 0 || data[0] == data[1])\n+    {\n+        if (data[0] > data[5])\n+            ConvertIntToDecimalStringN(gStringVar2, data[0] - data[5], 0, 3);\n+        SwitchTaskToFollowupFunc(taskId);\n+    }\n+}\n+\n+void sub_81B1F18(u8 taskId, u8 slot, s8 c, s16 HPDifference, TaskFunc func)\n+{\n+    struct Pokemon *mon = &gPlayerParty[slot];\n+    s16 *data = gTasks[taskId].data;\n+    \n+    data[0] = GetMonData(mon, MON_DATA_HP);\n+    data[1] = GetMonData(mon, MON_DATA_MAX_HP);\n+    data[2] = c;\n+    data[3] = HPDifference;\n+    data[4] = slot;\n+    data[5] = data[0];\n+    SetTaskFuncWithFollowupFunc(taskId, sub_81B1E60, func);\n+}\n+\n+void sub_81B1FA8(u8 taskId, u8 b, u32 hp)\n+{\n+    s16 *data = gTasks[taskId].data;\n+    \n+    switch (b) // only case 0 is used\n+    {\n+        case 0:\n+            data[0] = hp;\n+            data[5] = hp;\n+            break;\n+        case 1:\n+            data[1] = hp;\n+            break;\n+        case 2:\n+            data[2] = hp;\n+            break;\n+        case 3:\n+            data[3] = hp;\n+            break;\n+        case 4:\n+            data[4] = hp;\n+            break;\n+        case 5:\n+            SetTaskFuncWithFollowupFunc(taskId, sub_81B1E60, (TaskFunc)hp); // >casting hp as a taskfunc\n+            break;\n+    }\n+}\n+\n+u8 pokemon_ailments_get_primary(u32 status)\n+{\n+    if (status & STATUS1_PSN_ANY)\n+        return AILMENT_PSN;\n+    if (status & STATUS1_PARALYSIS)\n+        return AILMENT_PRZ;\n+    if (status & STATUS1_SLEEP)\n+        return AILMENT_SLP;\n+    if (status & STATUS1_FREEZE)\n+        return AILMENT_FRZ;\n+    if (status & STATUS1_BURN)\n+        return AILMENT_BRN;\n+    return AILMENT_NONE;\n+}\n+\n+u8 sub_81B205C(struct Pokemon *mon)\n+{\n+    u8 ailment;\n+    \n+    if (GetMonData(mon, MON_DATA_HP) == 0)\n+        return AILMENT_FNT;\n+    ailment = pokemon_ailments_get_primary(GetMonData(mon, MON_DATA_STATUS));\n+    if (ailment != AILMENT_NONE)\n+        return ailment;\n+    if (CheckPartyPokerus(mon, 0))\n+        return AILMENT_PKRS;\n+    return AILMENT_NONE;\n+}\n+\n+void sub_81B209C(void)\n+{\n+    u16 *ptr;\n+    \n+    if (gUnknown_0203CEC8.unk8_0 == 11)\n+    {\n+        u8 i;\n+        \n+        ptr = &gUnknown_0203CEC8.unkE;\n+        gUnknown_0203CEC8.unkE = 0;\n+        if (gSpecialVar_0x8005 == 0)\n+        {\n+            for (i = 0; i < gPlayerPartyCount; i++)\n+                *ptr += sub_81B2134(&gPlayerParty[i]) << i;\n+        }\n+        else\n+        {\n+            for (i = 0; i < gPlayerPartyCount; i++)\n+                *ptr += sub_81B2164(&gPlayerParty[i]) << i;\n+        }\n+    }\n+}\n+\n+bool16 sub_81B2134(struct Pokemon *mon)\n+{\n+    if (GetMonData(mon, MON_DATA_IS_EGG) != TRUE && sub_802C908(GetMonData(mon, MON_DATA_SPECIES)) != FALSE)\n+        return TRUE;\n+    return FALSE;\n+}\n+\n+// Dodrio Berry Picking select?\n+\n+bool16 sub_81B2164(struct Pokemon *mon)\n+{\n+    if (GetMonData(mon, MON_DATA_IS_EGG) != TRUE && GetMonData(mon, MON_DATA_SPECIES) == SPECIES_DODRIO)\n+        return TRUE;\n+    return FALSE;\n+}\n+\n+bool8 sub_81B218C(u8 slot)\n+{\n+    if (!((gUnknown_0203CEC8.unkE >> slot) & 1))\n+        return FALSE;\n+    return TRUE;\n+}\n+\n+void sub_81B21AC(u8 taskId, u8 slot)\n+{\n+    if (sub_81B218C(slot) == TRUE)\n+    {\n+        PlaySE(SE_SELECT);\n+        gSpecialVar_0x8004 = slot;\n+        sub_81B12C0(taskId);\n+    }\n+    else\n+    {\n+        PlaySE(SE_HAZURE);\n+        sub_81B1B5C(gText_PkmnCantParticipate, 0);\n+        schedule_bg_copy_tilemap_to_vram(2);\n+        gTasks[taskId].func = sub_81B1C1C;\n+    }\n+}\n+\n+void sub_81B2210(u8 taskId)\n+{\n+    sub_81B1B5C(gText_CancelParticipation, 1);\n+    schedule_bg_copy_tilemap_to_vram(2);\n+    gTasks[taskId].func = sub_81B2248;\n+}\n+\n+void sub_81B2248(u8 taskId)\n+{\n+    if (sub_81B1BD4() != TRUE)\n+    {\n+        sub_81B334C();\n+        gTasks[taskId].func = sub_81B227C;\n+    }\n+}\n+\n+void sub_81B227C(u8 taskId)\n+{\n+    switch (Menu_ProcessInputNoWrapClearOnChoose())\n+    {\n+        case 0:\n+            gSpecialVar_0x8004 = 7;\n+            sub_81B12C0(taskId);\n+            break;\n+        case MENU_B_PRESSED:\n+            PlaySE(SE_SELECT);\n+        case 1:\n+            gTasks[taskId].func = sub_81B1C1C;\n+            break;\n+    }\n+}\n+\n+u8 CanPartyPokemonLearnTMTutor(struct Pokemon *mon, u16 item, u8 tutor)\n+{\n+    u16 move;\n+    \n+    if (GetMonData(mon, MON_DATA_IS_EGG) != FALSE)\n+        return CANNOT_LEARN_MOVE_IS_EGG;\n+    if (item >= ITEM_TM01_FOCUS_PUNCH)\n+    {\n+        if (CanMonLearnTMHM(mon, item - 33) != FALSE)\n+            move = ItemIdToBattleMoveId(item);\n+        else\n+            return CANNOT_LEARN_MOVE;\n+        do {} while (0); // :morphon:\n+    }\n+    else if (sub_81B2370(GetMonData(mon, MON_DATA_SPECIES), tutor) == FALSE)\n+    {\n+        return CANNOT_LEARN_MOVE;\n+    }\n+    else\n+    {\n+        move = sub_81B2360(tutor);\n+    }\n+    \n+    if (pokemon_has_move(mon, move) == TRUE)\n+        return ALREADY_KNOWS_MOVE;\n+    return CAN_LEARN_MOVE;\n+}\n+\n+u16 sub_81B2360(u8 tutor)\n+{\n+    return gUnknown_0861500C[tutor];\n+}\n+\n+bool8 sub_81B2370(u16 species, u8 tutor)\n+{\n+    if (gUnknown_08615048[species] & (1 << tutor))\n+        return TRUE;\n+    return FALSE;\n+}\n+\n+void sub_81B239C(u8 a)\n+{\n+    u8 i;\n+    \n+    switch (a)\n+    {\n+        case 0:\n+            InitWindows(gUnknown_08615810);\n+            break;\n+        case 1:\n+            InitWindows(gUnknown_08615850);\n+            break;\n+        case 2:\n+            InitWindows(gUnknown_08615890);\n+            break;\n+        default:\n+            In","path":"src/party_menu.c","position":5799,"original_position":5799,"commit_id":"42c5ceef3a019234405e5013d40b5dbd33dbd2e6","original_commit_id":"42c5ceef3a019234405e5013d40b5dbd33dbd2e6","user":{"login":"huderlem","id":2229288,"node_id":"MDQ6VXNlcjIyMjkyODg=","avatar_url":"https://avatars3.githubusercontent.com/u/2229288?v=4","gravatar_id":"","url":"https://api.github.com/users/huderlem","html_url":"https://github.com/huderlem","followers_url":"https://api.github.com/users/huderlem/followers","following_url":"https://api.github.com/users/huderlem/following{/other_user}","gists_url":"https://api.github.com/users/huderlem/gists{/gist_id}","starred_url":"https://api.github.com/users/huderlem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/huderlem/subscriptions","organizations_url":"https://api.github.com/users/huderlem/orgs","repos_url":"https://api.github.com/users/huderlem/repos","events_url":"https://api.github.com/users/huderlem/events{/privacy}","received_events_url":"https://api.github.com/users/huderlem/received_events","type":"User","site_admin":false},"body":"Line 5799: you forgot to delete this whole commented out function","created_at":"2018-12-19T01:11:23Z","updated_at":"2018-12-19T01:11:24Z","html_url":"https://github.com/pret/pokeemerald/pull/454#discussion_r242762797","pull_request_url":"https://api.github.com/repos/pret/pokeemerald/pulls/454","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/pret/pokeemerald/pulls/comments/242762797"},"html":{"href":"https://github.com/pret/pokeemerald/pull/454#discussion_r242762797"},"pull_request":{"href":"https://api.github.com/repos/pret/pokeemerald/pulls/454"}}},"pull_request":{"url":"https://api.github.com/repos/pret/pokeemerald/pulls/454","id":239441850,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM5NDQxODUw","html_url":"https://github.com/pret/pokeemerald/pull/454","diff_url":"https://github.com/pret/pokeemerald/pull/454.diff","patch_url":"https://github.com/pret/pokeemerald/pull/454.patch","issue_url":"https://api.github.com/repos/pret/pokeemerald/issues/454","number":454,"state":"open","locked":false,"title":"Decompile party menu","user":{"login":"golemgalvanize","id":29003214,"node_id":"MDQ6VXNlcjI5MDAzMjE0","avatar_url":"https://avatars1.githubusercontent.com/u/29003214?v=4","gravatar_id":"","url":"https://api.github.com/users/golemgalvanize","html_url":"https://github.com/golemgalvanize","followers_url":"https://api.github.com/users/golemgalvanize/followers","following_url":"https://api.github.com/users/golemgalvanize/following{/other_user}","gists_url":"https://api.github.com/users/golemgalvanize/gists{/gist_id}","starred_url":"https://api.github.com/users/golemgalvanize/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/golemgalvanize/subscriptions","organizations_url":"https://api.github.com/users/golemgalvanize/orgs","repos_url":"https://api.github.com/users/golemgalvanize/repos","events_url":"https://api.github.com/users/golemgalvanize/events{/privacy}","received_events_url":"https://api.github.com/users/golemgalvanize/received_events","type":"User","site_admin":false},"body":"It isn't quite documented nor is the massive amount of data ported over yet, but decompilation was done to the best I could.\r\n\r\nAlso due to being a large file and thus github comments acting oddly, I'd prefer if any edit comments leave the line in question to make fixing this PR more convenient for me and maintainers alike","created_at":"2018-12-18T10:45:58Z","updated_at":"2018-12-19T01:11:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c232afe3e5360f1e9109a6adde5111461ebfd069","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/pret/pokeemerald/pulls/454/commits","review_comments_url":"https://api.github.com/repos/pret/pokeemerald/pulls/454/comments","review_comment_url":"https://api.github.com/repos/pret/pokeemerald/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pret/pokeemerald/issues/454/comments","statuses_url":"https://api.github.com/repos/pret/pokeemerald/statuses/42c5ceef3a019234405e5013d40b5dbd33dbd2e6","head":{"label":"golemgalvanize:decompile_party_menu","ref":"decompile_party_menu","sha":"42c5ceef3a019234405e5013d40b5dbd33dbd2e6","user":{"login":"golemgalvanize","id":29003214,"node_id":"MDQ6VXNlcjI5MDAzMjE0","avatar_url":"https://avatars1.githubusercontent.com/u/29003214?v=4","gravatar_id":"","url":"https://api.github.com/users/golemgalvanize","html_url":"https://github.com/golemgalvanize","followers_url":"https://api.github.com/users/golemgalvanize/followers","following_url":"https://api.github.com/users/golemgalvanize/following{/other_user}","gists_url":"https://api.github.com/users/golemgalvanize/gists{/gist_id}","starred_url":"https://api.github.com/users/golemgalvanize/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/golemgalvanize/subscriptions","organizations_url":"https://api.github.com/users/golemgalvanize/orgs","repos_url":"https://api.github.com/users/golemgalvanize/repos","events_url":"https://api.github.com/users/golemgalvanize/events{/privacy}","received_events_url":"https://api.github.com/users/golemgalvanize/received_events","type":"User","site_admin":false},"repo":{"id":103856564,"node_id":"MDEwOlJlcG9zaXRvcnkxMDM4NTY1NjQ=","name":"pokeemerald","full_name":"golemgalvanize/pokeemerald","private":false,"owner":{"login":"golemgalvanize","id":29003214,"node_id":"MDQ6VXNlcjI5MDAzMjE0","avatar_url":"https://avatars1.githubusercontent.com/u/29003214?v=4","gravatar_id":"","url":"https://api.github.com/users/golemgalvanize","html_url":"https://github.com/golemgalvanize","followers_url":"https://api.github.com/users/golemgalvanize/followers","following_url":"https://api.github.com/users/golemgalvanize/following{/other_user}","gists_url":"https://api.github.com/users/golemgalvanize/gists{/gist_id}","starred_url":"https://api.github.com/users/golemgalvanize/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/golemgalvanize/subscriptions","organizations_url":"https://api.github.com/users/golemgalvanize/orgs","repos_url":"https://api.github.com/users/golemgalvanize/repos","events_url":"https://api.github.com/users/golemgalvanize/events{/privacy}","received_events_url":"https://api.github.com/users/golemgalvanize/received_events","type":"User","site_admin":false},"html_url":"https://github.com/golemgalvanize/pokeemerald","description":"disassembly of Pokémon Emerald","fork":true,"url":"https://api.github.com/repos/golemgalvanize/pokeemerald","forks_url":"https://api.github.com/repos/golemgalvanize/pokeemerald/forks","keys_url":"https://api.github.com/repos/golemgalvanize/pokeemerald/keys{/key_id}","collaborators_url":"https://api.github.com/repos/golemgalvanize/pokeemerald/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/golemgalvanize/pokeemerald/teams","hooks_url":"https://api.github.com/repos/golemgalvanize/pokeemerald/hooks","issue_events_url":"https://api.github.com/repos/golemgalvanize/pokeemerald/issues/events{/number}","events_url":"https://api.github.com/repos/golemgalvanize/pokeemerald/events","assignees_url":"https://api.github.com/repos/golemgalvanize/pokeemerald/assignees{/user}","branches_url":"https://api.github.com/repos/golemgalvanize/pokeemerald/branches{/branch}","tags_url":"https://api.github.com/repos/golemgalvanize/pokeemerald/tags","blobs_url":"https://api.github.com/repos/golemgalvanize/pokeemerald/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/golemgalvanize/pokeemerald/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/golemgalvanize/pokeemerald/git/refs{/sha}","trees_url":"https://api.github.com/repos/golemgalvanize/pokeemerald/git/trees{/sha}","statuses_url":"https://api.github.com/repos/golemgalvanize/pokeemerald/statuses/{sha}","languages_url":"https://api.github.com/repos/golemgalvanize/pokeemerald/languages","stargazers_url":"https://api.github.com/repos/golemgalvanize/pokeemerald/stargazers","contributors_url":"https://api.github.com/repos/golemgalvanize/pokeemerald/contributors","subscribers_url":"https://api.github.com/repos/golemgalvanize/pokeemerald/subscribers","subscription_url":"https://api.github.com/repos/golemgalvanize/pokeemerald/subscription","commits_url":"https://api.github.com/repos/golemgalvanize/pokeemerald/commits{/sha}","git_commits_url":"https://api.github.com/repos/golemgalvanize/pokeemerald/git/commits{/sha}","comments_url":"https://api.github.com/repos/golemgalvanize/pokeemerald/comments{/number}","issue_comment_url":"https://api.github.com/repos/golemgalvanize/pokeemerald/issues/comments{/number}","contents_url":"https://api.github.com/repos/golemgalvanize/pokeemerald/contents/{+path}","compare_url":"https://api.github.com/repos/golemgalvanize/pokeemerald/compare/{base}...{head}","merges_url":"https://api.github.com/repos/golemgalvanize/pokeemerald/merges","archive_url":"https://api.github.com/repos/golemgalvanize/pokeemerald/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/golemgalvanize/pokeemerald/downloads","issues_url":"https://api.github.com/repos/golemgalvanize/pokeemerald/issues{/number}","pulls_url":"https://api.github.com/repos/golemgalvanize/pokeemerald/pulls{/number}","milestones_url":"https://api.github.com/repos/golemgalvanize/pokeemerald/milestones{/number}","notifications_url":"https://api.github.com/repos/golemgalvanize/pokeemerald/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/golemgalvanize/pokeemerald/labels{/name}","releases_url":"https://api.github.com/repos/golemgalvanize/pokeemerald/releases{/id}","deployments_url":"https://api.github.com/repos/golemgalvanize/pokeemerald/deployments","created_at":"2017-09-17T19:40:04Z","updated_at":"2018-12-19T00:06:32Z","pushed_at":"2018-12-19T00:03:55Z","git_url":"git://github.com/golemgalvanize/pokeemerald.git","ssh_url":"git@github.com:golemgalvanize/pokeemerald.git","clone_url":"https://github.com/golemgalvanize/pokeemerald.git","svn_url":"https://github.com/golemgalvanize/pokeemerald","homepage":"","size":76247,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"pret:master","ref":"master","sha":"c74468fd11b551e1babf18a4d320e114fe495bd8","user":{"login":"pret","id":10761592,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwNzYxNTky","avatar_url":"https://avatars1.githubusercontent.com/u/10761592?v=4","gravatar_id":"","url":"https://api.github.com/users/pret","html_url":"https://github.com/pret","followers_url":"https://api.github.com/users/pret/followers","following_url":"https://api.github.com/users/pret/following{/other_user}","gists_url":"https://api.github.com/users/pret/gists{/gist_id}","starred_url":"https://api.github.com/users/pret/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pret/subscriptions","organizations_url":"https://api.github.com/users/pret/orgs","repos_url":"https://api.github.com/users/pret/repos","events_url":"https://api.github.com/users/pret/events{/privacy}","received_events_url":"https://api.github.com/users/pret/received_events","type":"Organization","site_admin":false},"repo":{"id":43677244,"node_id":"MDEwOlJlcG9zaXRvcnk0MzY3NzI0NA==","name":"pokeemerald","full_name":"pret/pokeemerald","private":false,"owner":{"login":"pret","id":10761592,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwNzYxNTky","avatar_url":"https://avatars1.githubusercontent.com/u/10761592?v=4","gravatar_id":"","url":"https://api.github.com/users/pret","html_url":"https://github.com/pret","followers_url":"https://api.github.com/users/pret/followers","following_url":"https://api.github.com/users/pret/following{/other_user}","gists_url":"https://api.github.com/users/pret/gists{/gist_id}","starred_url":"https://api.github.com/users/pret/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pret/subscriptions","organizations_url":"https://api.github.com/users/pret/orgs","repos_url":"https://api.github.com/users/pret/repos","events_url":"https://api.github.com/users/pret/events{/privacy}","received_events_url":"https://api.github.com/users/pret/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/pret/pokeemerald","description":"disassembly of Pokémon Emerald","fork":false,"url":"https://api.github.com/repos/pret/pokeemerald","forks_url":"https://api.github.com/repos/pret/pokeemerald/forks","keys_url":"https://api.github.com/repos/pret/pokeemerald/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pret/pokeemerald/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pret/pokeemerald/teams","hooks_url":"https://api.github.com/repos/pret/pokeemerald/hooks","issue_events_url":"https://api.github.com/repos/pret/pokeemerald/issues/events{/number}","events_url":"https://api.github.com/repos/pret/pokeemerald/events","assignees_url":"https://api.github.com/repos/pret/pokeemerald/assignees{/user}","branches_url":"https://api.github.com/repos/pret/pokeemerald/branches{/branch}","tags_url":"https://api.github.com/repos/pret/pokeemerald/tags","blobs_url":"https://api.github.com/repos/pret/pokeemerald/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pret/pokeemerald/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pret/pokeemerald/git/refs{/sha}","trees_url":"https://api.github.com/repos/pret/pokeemerald/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pret/pokeemerald/statuses/{sha}","languages_url":"https://api.github.com/repos/pret/pokeemerald/languages","stargazers_url":"https://api.github.com/repos/pret/pokeemerald/stargazers","contributors_url":"https://api.github.com/repos/pret/pokeemerald/contributors","subscribers_url":"https://api.github.com/repos/pret/pokeemerald/subscribers","subscription_url":"https://api.github.com/repos/pret/pokeemerald/subscription","commits_url":"https://api.github.com/repos/pret/pokeemerald/commits{/sha}","git_commits_url":"https://api.github.com/repos/pret/pokeemerald/git/commits{/sha}","comments_url":"https://api.github.com/repos/pret/pokeemerald/comments{/number}","issue_comment_url":"https://api.github.com/repos/pret/pokeemerald/issues/comments{/number}","contents_url":"https://api.github.com/repos/pret/pokeemerald/contents/{+path}","compare_url":"https://api.github.com/repos/pret/pokeemerald/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pret/pokeemerald/merges","archive_url":"https://api.github.com/repos/pret/pokeemerald/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pret/pokeemerald/downloads","issues_url":"https://api.github.com/repos/pret/pokeemerald/issues{/number}","pulls_url":"https://api.github.com/repos/pret/pokeemerald/pulls{/number}","milestones_url":"https://api.github.com/repos/pret/pokeemerald/milestones{/number}","notifications_url":"https://api.github.com/repos/pret/pokeemerald/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pret/pokeemerald/labels{/name}","releases_url":"https://api.github.com/repos/pret/pokeemerald/releases{/id}","deployments_url":"https://api.github.com/repos/pret/pokeemerald/deployments","created_at":"2015-10-05T10:09:22Z","updated_at":"2018-12-18T20:27:05Z","pushed_at":"2018-12-19T01:04:55Z","git_url":"git://github.com/pret/pokeemerald.git","ssh_url":"git@github.com:pret/pokeemerald.git","clone_url":"https://github.com/pret/pokeemerald.git","svn_url":"https://github.com/pret/pokeemerald","homepage":"","size":76148,"stargazers_count":258,"watchers_count":258,"language":"C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":101,"mirror_url":null,"archived":false,"open_issues_count":9,"license":null,"forks":101,"open_issues":9,"watchers":258,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pret/pokeemerald/pulls/454"},"html":{"href":"https://github.com/pret/pokeemerald/pull/454"},"issue":{"href":"https://api.github.com/repos/pret/pokeemerald/issues/454"},"comments":{"href":"https://api.github.com/repos/pret/pokeemerald/issues/454/comments"},"review_comments":{"href":"https://api.github.com/repos/pret/pokeemerald/pulls/454/comments"},"review_comment":{"href":"https://api.github.com/repos/pret/pokeemerald/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pret/pokeemerald/pulls/454/commits"},"statuses":{"href":"https://api.github.com/repos/pret/pokeemerald/statuses/42c5ceef3a019234405e5013d40b5dbd33dbd2e6"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"huderlem"}}