Fixup some names

This commit is contained in:
Marcus Huderle 2018-11-25 15:50:54 -06:00
parent 256bfc3caa
commit fb6120da5b
18 changed files with 69 additions and 80 deletions

View File

@ -1219,7 +1219,7 @@ sub_81B0A9C: @ 81B0A9C
muls r0, r5 muls r0, r5
ldr r1, =gPlayerParty ldr r1, =gPlayerParty
adds r0, r1 adds r0, r1
ldr r6, =gUnknown_0203CEF8 ldr r6, =gSelectedOrderFromParty
bl sub_81B85AC bl sub_81B85AC
lsls r0, 24 lsls r0, 24
cmp r0, 0 cmp r0, 0
@ -9304,7 +9304,7 @@ sub_81B4E8C: @ 81B4E8C
adds r0, r1 adds r0, r1
mov r8, r0 mov r8, r0
_081B4EC6: _081B4EC6:
ldr r0, =gUnknown_0203CEF8 ldr r0, =gSelectedOrderFromParty
adds r4, r5, r0 adds r4, r5, r0
ldrb r0, [r4] ldrb r0, [r4]
cmp r0, 0 cmp r0, 0
@ -9418,7 +9418,7 @@ sub_81B4FA8: @ 81B4FA8
movs r4, 0 movs r4, 0
cmp r4, r5 cmp r4, r5
bcs _081B502A bcs _081B502A
ldr r6, =gUnknown_0203CEF8 ldr r6, =gSelectedOrderFromParty
subs r2, r5, 0x1 subs r2, r5, 0x1
adds r7, r6, 0 adds r7, r6, 0
ldr r3, =gUnknown_0203CEC8 ldr r3, =gUnknown_0203CEC8
@ -9476,7 +9476,7 @@ _081B502A:
cmp r4, r5 cmp r4, r5
bge _081B5078 bge _081B5078
_081B504E: _081B504E:
ldr r0, =gUnknown_0203CEF8 ldr r0, =gSelectedOrderFromParty
adds r1, r4, r0 adds r1, r4, r0
ldrb r0, [r1] ldrb r0, [r1]
cmp r0, 0 cmp r0, 0
@ -15518,7 +15518,7 @@ sub_81B8518: @ 81B8518
thumb_func_start sub_81B8558 thumb_func_start sub_81B8558
sub_81B8558: @ 81B8558 sub_81B8558: @ 81B8558
push {lr} push {lr}
ldr r0, =gUnknown_0203CEF8 ldr r0, =gSelectedOrderFromParty
movs r1, 0 movs r1, 0
movs r2, 0x4 movs r2, 0x4
bl memset bl memset
@ -15655,7 +15655,7 @@ sub_81B865C: @ 81B865C
lsls r0, 24 lsls r0, 24
lsrs r2, r0, 24 lsrs r2, r0, 24
adds r1, r2, 0 adds r1, r2, 0
ldr r3, =gUnknown_0203CEF8 ldr r3, =gSelectedOrderFromParty
adds r0, r2, r3 adds r0, r2, r3
subs r0, 0x1 subs r0, 0x1
ldrb r0, [r0] ldrb r0, [r0]
@ -15700,7 +15700,7 @@ _081B86C0:
movs r5, 0 movs r5, 0
b _081B8750 b _081B8750
_081B86CE: _081B86CE:
ldr r3, =gUnknown_0203CEF8 ldr r3, =gSelectedOrderFromParty
adds r4, r3, r5 adds r4, r3, r5
ldrb r0, [r4] ldrb r0, [r4]
movs r1, 0x64 movs r1, 0x64
@ -15731,7 +15731,7 @@ _081B86CE:
bcs _081B8748 bcs _081B8748
movs r7, 0x64 movs r7, 0x64
_081B870E: _081B870E:
ldr r0, =gUnknown_0203CEF8 ldr r0, =gSelectedOrderFromParty
adds r5, r0, r4 adds r5, r0, r4
ldrb r0, [r5] ldrb r0, [r5]
muls r0, r7 muls r0, r7
@ -15787,7 +15787,7 @@ sub_81B8770: @ 81B8770
lsls r0, 24 lsls r0, 24
lsrs r2, r0, 24 lsrs r2, r0, 24
movs r1, 0 movs r1, 0
ldr r3, =gUnknown_0203CEF8 ldr r3, =gSelectedOrderFromParty
_081B877A: _081B877A:
adds r0, r1, r3 adds r0, r1, r3
ldrb r0, [r0] ldrb r0, [r0]

View File

@ -10149,7 +10149,7 @@ sub_801AAD4: @ 801AAD4
ldr r6, =gPlayerParty ldr r6, =gPlayerParty
ldr r5, =gEnemyParty ldr r5, =gEnemyParty
_0801AAE4: _0801AAE4:
ldr r0, =gUnknown_0203CEF8 ldr r0, =gSelectedOrderFromParty
adds r0, r4, r0 adds r0, r4, r0
ldrb r0, [r0] ldrb r0, [r0]
subs r0, 0x1 subs r0, 0x1
@ -10504,7 +10504,7 @@ _0801AE54:
movs r1, 0 movs r1, 0
movs r2, 0x20 movs r2, 0x20
bl memset bl memset
ldr r0, =gUnknown_0203CEF8 ldr r0, =gSelectedOrderFromParty
ldrb r1, [r0] ldrb r1, [r0]
ldrb r0, [r0, 0x1] ldrb r0, [r0, 0x1]
cmn r1, r0 cmn r1, r0

View File

@ -57,7 +57,7 @@ LilycoveCity_ContestLobby_EventScript_21A2AA:: @ 821A2AA
closemessage closemessage
special sub_80F88DC special sub_80F88DC
setvar VAR_0x4099, 0 setvar VAR_0x4099, 0
specialvar VAR_RESULT, sub_80F8C7C specialvar VAR_RESULT, GiveMonArtistRibbon
compare VAR_RESULT, 1 compare VAR_RESULT, 1
call_if 1, LilycoveCity_ContestLobby_EventScript_21A314 call_if 1, LilycoveCity_ContestLobby_EventScript_21A314
applymovement 4, LilycoveCity_ContestLobby_Movement_21A40F applymovement 4, LilycoveCity_ContestLobby_Movement_21A40F
@ -230,7 +230,7 @@ LilycoveCity_ContestLobby_EventScript_21A47A:: @ 821A47A
closemessage closemessage
special sub_80F88DC special sub_80F88DC
setvar VAR_0x4099, 0 setvar VAR_0x4099, 0
specialvar VAR_RESULT, sub_80F8C7C specialvar VAR_RESULT, GiveMonArtistRibbon
compare VAR_RESULT, 1 compare VAR_RESULT, 1
call_if 1, LilycoveCity_ContestLobby_EventScript_21A4E4 call_if 1, LilycoveCity_ContestLobby_EventScript_21A4E4
applymovement 11, LilycoveCity_ContestLobby_Movement_21A53C applymovement 11, LilycoveCity_ContestLobby_Movement_21A53C
@ -324,7 +324,7 @@ LilycoveCity_ContestLobby_EventScript_21A554:: @ 821A554
goto_eq LilycoveCity_ContestLobby_EventScript_21A5CF goto_eq LilycoveCity_ContestLobby_EventScript_21A5CF
call LilycoveCity_ContestLobby_EventScript_279CC5 call LilycoveCity_ContestLobby_EventScript_279CC5
call LilycoveCity_ContestLobby_EventScript_21A670 call LilycoveCity_ContestLobby_EventScript_21A670
special sub_80F87D8 special SetContestTrainerGfxIds
call LilycoveCity_ContestLobby_EventScript_23BEB6 call LilycoveCity_ContestLobby_EventScript_23BEB6
call LilycoveCity_ContestLobby_EventScript_21A585 call LilycoveCity_ContestLobby_EventScript_21A585
call LilycoveCity_ContestLobby_EventScript_21A5EF call LilycoveCity_ContestLobby_EventScript_21A5EF

View File

@ -260,7 +260,7 @@ MossdeepCity_SpaceCenter_2F_EventScript_22400C:: @ 822400C
goto MossdeepCity_SpaceCenter_2F_EventScript_223FDA goto MossdeepCity_SpaceCenter_2F_EventScript_223FDA
MossdeepCity_SpaceCenter_2F_EventScript_224032:: @ 8224032 MossdeepCity_SpaceCenter_2F_EventScript_224032:: @ 8224032
special ReducePlayerPartyToThree special ReducePlayerPartyToSelectedMons
setvar VAR_0x8004, 2 setvar VAR_0x8004, 2
setvar VAR_0x8005, 4 setvar VAR_0x8005, 4
special CallFrontierUtilFunc special CallFrontierUtilFunc

View File

@ -106,7 +106,7 @@ SootopolisCity_MysteryEventsHouse_1F_EventScript_227A58:: @ 8227A58
compare VAR_RESULT, 0 compare VAR_RESULT, 0
goto_eq SootopolisCity_MysteryEventsHouse_1F_EventScript_227AE2 goto_eq SootopolisCity_MysteryEventsHouse_1F_EventScript_227AE2
special SavePlayerParty special SavePlayerParty
special ReducePlayerPartyToThree special ReducePlayerPartyToSelectedMons
msgbox SootopolisCity_MysteryEventsHouse_1F_Text_227D21, 4 msgbox SootopolisCity_MysteryEventsHouse_1F_Text_227D21, 4
closemessage closemessage
compare VAR_FACING, 2 compare VAR_FACING, 2

View File

@ -18,7 +18,7 @@ LinkContestRoom1_MapScript1_23B79F: @ 823B79F
LinkContestRoom1_EventScript_23B7AF:: @ 823B7AF LinkContestRoom1_EventScript_23B7AF:: @ 823B7AF
call LinkContestRoom1_EventScript_27A133 call LinkContestRoom1_EventScript_27A133
special sub_80F8FA0 special ScriptGetMultiplayerId
compare VAR_RESULT, 0 compare VAR_RESULT, 0
call_if 1, LinkContestRoom1_EventScript_23B7EF call_if 1, LinkContestRoom1_EventScript_23B7EF
compare VAR_RESULT, 1 compare VAR_RESULT, 1
@ -134,7 +134,7 @@ LinkContestRoom1_EventScript_23B8ED:: @ 823B8ED
LinkContestRoom1_EventScript_23B8F8:: @ 823B8F8 LinkContestRoom1_EventScript_23B8F8:: @ 823B8F8
setvar VAR_RESULT, 32 setvar VAR_RESULT, 32
special sub_80F8FE8 special ScriptRandom
addvar VAR_RESULT, 1 addvar VAR_RESULT, 1
switch VAR_RESULT switch VAR_RESULT
case 1, LinkContestRoom1_EventScript_23BA6B case 1, LinkContestRoom1_EventScript_23BA6B

View File

@ -1,7 +0,0 @@
.include "asm/macros.inc"
.include "constants/constants.inc"
.section .rodata
.align 2, 0
gUnknown_0858D8EC:: @ 858D8EC
.byte 3, 4, 5, 14

View File

@ -388,7 +388,7 @@ LinkContestRoom1_EventScript_27A1D2:: @ 827A1D2
releaseall releaseall
addvar VAR_0x8006, 65535 addvar VAR_0x8006, 65535
playse SE_BOWA2 playse SE_BOWA2
special sub_80F8D28 special ShowContestEntryMonPic
call LinkContestRoom1_EventScript_27A217 call LinkContestRoom1_EventScript_27A217
return return
@ -517,7 +517,7 @@ LinkContestRoom1_EventScript_27A34F:: @ 827A34F
LinkContestRoom1_EventScript_27A3E5:: @ 827A3E5 LinkContestRoom1_EventScript_27A3E5:: @ 827A3E5
setvar VAR_RESULT, 8 setvar VAR_RESULT, 8
special sub_80F8FE8 special ScriptRandom
compare VAR_RESULT, 0 compare VAR_RESULT, 0
call_if 1, LinkContestRoom1_EventScript_27A65A call_if 1, LinkContestRoom1_EventScript_27A65A
compare VAR_RESULT, 1 compare VAR_RESULT, 1

View File

@ -94,7 +94,7 @@ gSpecials:: @ 81DBA64
def_special sub_80F8390 def_special sub_80F8390
def_special sub_80F8850 def_special sub_80F8850
def_special sub_80F82B4 def_special sub_80F82B4
def_special sub_80F87D8 def_special SetContestTrainerGfxIds
def_special sub_80F7F30 def_special sub_80F7F30
def_special sub_80F8970 def_special sub_80F8970
def_special sub_80F8AFC def_special sub_80F8AFC
@ -102,7 +102,7 @@ gSpecials:: @ 81DBA64
def_special sub_80F7F7C def_special sub_80F7F7C
def_special sub_80F7FFC def_special sub_80F7FFC
def_special sub_80F8D24 def_special sub_80F8D24
def_special sub_80F8C7C def_special GiveMonArtistRibbon
def_special sub_80B3000 def_special sub_80B3000
def_special SaveGame def_special SaveGame
def_special sub_80FAFF8 def_special sub_80FAFF8
@ -259,7 +259,7 @@ gSpecials:: @ 81DBA64
def_special sub_80F9490 def_special sub_80F9490
def_special ValidateEReaderTrainer def_special ValidateEReaderTrainer
def_special GetBestBattleTowerStreak def_special GetBestBattleTowerStreak
def_special ReducePlayerPartyToThree def_special ReducePlayerPartyToSelectedMons
def_special BedroomPC def_special BedroomPC
def_special PlayerPC def_special PlayerPC
def_special FieldShowRegionMap def_special FieldShowRegionMap
@ -330,13 +330,13 @@ gSpecials:: @ 81DBA64
def_special sub_80AC81C def_special sub_80AC81C
def_special sp13E_warp_to_last_warp def_special sp13E_warp_to_last_warp
def_special sp13F_fall_to_last_warp def_special sp13F_fall_to_last_warp
def_special sub_80F8D28 def_special ShowContestEntryMonPic
def_special sub_80F8EB8 def_special sub_80F8EB8
def_special SetEReaderTrainerGfxId def_special SetEReaderTrainerGfxId
def_special BattleSetup_StartLatiBattle def_special BattleSetup_StartLatiBattle
def_special SetRoute119Weather def_special SetRoute119Weather
def_special SetRoute123Weather def_special SetRoute123Weather
def_special sub_80F8FA0 def_special ScriptGetMultiplayerId
def_special ScriptGetPartyMonSpecies def_special ScriptGetPartyMonSpecies
def_special sub_81B98DC def_special sub_81B98DC
def_special nullsub_54 def_special nullsub_54
@ -350,7 +350,7 @@ gSpecials:: @ 81DBA64
def_special BufferLottoTicketNumber def_special BufferLottoTicketNumber
def_special sub_81653CC def_special sub_81653CC
def_special sub_80F9370 def_special sub_80F9370
def_special sub_80F8FE8 def_special ScriptRandom
def_special sub_81AFDD0 def_special sub_81AFDD0
def_special sub_80EDCE8 def_special sub_80EDCE8
def_special sub_80EE2CC def_special sub_80EE2CC

View File

@ -2,7 +2,7 @@
#define GUARD_SCRIPT_POKEMON_UTIL_80F87D8_H #define GUARD_SCRIPT_POKEMON_UTIL_80F87D8_H
u16 sub_80F903C(void); u16 sub_80F903C(void);
void ReducePlayerPartyToThree(void); void ReducePlayerPartyToSelectedMons(void);
void HealPlayerParty(void); void HealPlayerParty(void);
#endif // GUARD_SCRIPT_POKEMON_UTIL_80F87D8_H #endif // GUARD_SCRIPT_POKEMON_UTIL_80F87D8_H

View File

@ -474,7 +474,7 @@ SECTIONS {
src/secret_base.o(.rodata); src/secret_base.o(.rodata);
src/tv.o(.rodata); src/tv.o(.rodata);
data/contest_link_80F57C4.o(.rodata); data/contest_link_80F57C4.o(.rodata);
data/script_pokemon_util_80F87D8.o(.rodata); src/script_pokemon_util_80F87D8.o(.rodata);
src/pokemon_size_record.o(.rodata) src/pokemon_size_record.o(.rodata)
data/field_effect_misc.o(.rodata); data/field_effect_misc.o(.rodata);
src/field_special_scene.o(.rodata); src/field_special_scene.o(.rodata);

View File

@ -63,9 +63,9 @@ extern u8 GetFrontierBrainMonNature(u8);
extern void sub_81A4C30(void); extern void sub_81A4C30(void);
extern u8 sub_81A3610(void); extern u8 sub_81A3610(void);
extern u16 GetFrontierBrainMonSpecies(u8); extern u16 GetFrontierBrainMonSpecies(u8);
extern void ReducePlayerPartyToThree(void); extern void ReducePlayerPartyToSelectedMons(void);
extern u8 gUnknown_0203CEF8[]; extern u8 gSelectedOrderFromParty[];
extern const u16 gBattleFrontierHeldItems[]; extern const u16 gBattleFrontierHeldItems[];
extern const struct FacilityMon gBattleFrontierMons[]; extern const struct FacilityMon gBattleFrontierMons[];
@ -2465,8 +2465,8 @@ static void sub_818EA84(void)
break; break;
case 8: case 8:
sub_81B8558(); sub_81B8558();
gUnknown_0203CEF8[0] = gSaveBlock2Ptr->frontier.field_CB0; gSelectedOrderFromParty[0] = gSaveBlock2Ptr->frontier.field_CB0;
gUnknown_0203CEF8[1] = gSaveBlock2Ptr->frontier.field_CB0 >> 8; gSelectedOrderFromParty[1] = gSaveBlock2Ptr->frontier.field_CB0 >> 8;
break; break;
case 9: case 9:
gSpecialVar_Result = (gSaveBlock2Ptr->frontier.field_D0A * 2) - 3 + gSaveBlock2Ptr->frontier.field_D0B; gSpecialVar_Result = (gSaveBlock2Ptr->frontier.field_D0A * 2) - 3 + gSaveBlock2Ptr->frontier.field_D0B;
@ -2535,7 +2535,7 @@ static void sub_818ED28(void)
} }
break; break;
case 8: case 8:
gSaveBlock2Ptr->frontier.field_CB0 = T1_READ_16(gUnknown_0203CEF8); gSaveBlock2Ptr->frontier.field_CB0 = T1_READ_16(gSelectedOrderFromParty);
break; break;
} }
} }
@ -6070,7 +6070,7 @@ static void sub_8194D68(void)
for (i = 0; i < 2; i++) for (i = 0; i < 2; i++)
{ {
s32 playerMonId = gSaveBlock2Ptr->frontier.selectedPartyMons[gUnknown_0203CEF8[i] - 1] - 1; s32 playerMonId = gSaveBlock2Ptr->frontier.selectedPartyMons[gSelectedOrderFromParty[i] - 1] - 1;
s32 count; s32 count;
for (moveSlot = 0; moveSlot < 4; moveSlot++) for (moveSlot = 0; moveSlot < 4; moveSlot++)
@ -6096,7 +6096,7 @@ static void sub_8194E44(void)
for (i = 0; i < 2; i++) for (i = 0; i < 2; i++)
{ {
s32 playerMonId = gSaveBlock2Ptr->frontier.selectedPartyMons[gUnknown_0203CEF8[i] - 1] - 1; s32 playerMonId = gSaveBlock2Ptr->frontier.selectedPartyMons[gSelectedOrderFromParty[i] - 1] - 1;
u16 item = GetMonData(&gSaveBlock1Ptr->playerParty[playerMonId], MON_DATA_HELD_ITEM, NULL); u16 item = GetMonData(&gSaveBlock1Ptr->playerParty[playerMonId], MON_DATA_HELD_ITEM, NULL);
SetMonData(&gPlayerParty[i], MON_DATA_HELD_ITEM, &item); SetMonData(&gPlayerParty[i], MON_DATA_HELD_ITEM, &item);
} }
@ -6104,7 +6104,7 @@ static void sub_8194E44(void)
static void sub_8194EB4(void) static void sub_8194EB4(void)
{ {
ReducePlayerPartyToThree(); ReducePlayerPartyToSelectedMons();
} }
static void sub_8194EC0(void) static void sub_8194EC0(void)

View File

@ -29,7 +29,7 @@
#include "constants/maps.h" #include "constants/maps.h"
#include "constants/moves.h" #include "constants/moves.h"
extern u8 gUnknown_0203CEF8[3]; extern u8 gSelectedOrderFromParty[3];
extern void door_upload_tiles(void); extern void door_upload_tiles(void);
extern const struct MapLayout *const gMapLayouts[]; extern const struct MapLayout *const gMapLayouts[];
@ -550,14 +550,14 @@ static void sub_81A9834(void)
SetMonMoveSlot(&gPlayerParty[j], MOVE_SKETCH, k); SetMonMoveSlot(&gPlayerParty[j], MOVE_SKETCH, k);
} }
gSaveBlock1Ptr->playerParty[id] = gPlayerParty[j]; gSaveBlock1Ptr->playerParty[id] = gPlayerParty[j];
gUnknown_0203CEF8[j] = id + 1; gSelectedOrderFromParty[j] = id + 1;
break; break;
} }
} }
} }
for (i = 0; i < 3; i++) for (i = 0; i < 3; i++)
gSaveBlock2Ptr->frontier.selectedPartyMons[i] = gUnknown_0203CEF8[i]; gSaveBlock2Ptr->frontier.selectedPartyMons[i] = gSelectedOrderFromParty[i];
} }
static u8 sub_81A9998(s32 *arg0, u8 arg1, u8 arg2) static u8 sub_81A9998(s32 *arg0, u8 arg1, u8 arg2)

View File

@ -31,7 +31,7 @@
#include "constants/songs.h" #include "constants/songs.h"
extern u8 gUnknown_02032298[2]; extern u8 gUnknown_02032298[2];
extern u8 gUnknown_0203CEF8[]; extern u8 gSelectedOrderFromParty[];
static const struct WindowTemplate gUnknown_08550594 = { static const struct WindowTemplate gUnknown_08550594 = {
.bg = 0, .bg = 0,
@ -358,8 +358,8 @@ static void sub_80B2918(u8 taskId)
sub_800AA04(gFieldLinkPlayerCount); sub_800AA04(gFieldLinkPlayerCount);
card = (struct TrainerCard *)gBlockSendBuffer; card = (struct TrainerCard *)gBlockSendBuffer;
TrainerCard_GenerateCardForPlayer(card); TrainerCard_GenerateCardForPlayer(card);
card->monSpecies[0] = GetMonData(&gPlayerParty[gUnknown_0203CEF8[0] - 1], MON_DATA_SPECIES, NULL); card->monSpecies[0] = GetMonData(&gPlayerParty[gSelectedOrderFromParty[0] - 1], MON_DATA_SPECIES, NULL);
card->monSpecies[1] = GetMonData(&gPlayerParty[gUnknown_0203CEF8[1] - 1], MON_DATA_SPECIES, NULL); card->monSpecies[1] = GetMonData(&gPlayerParty[gSelectedOrderFromParty[1] - 1], MON_DATA_SPECIES, NULL);
gTasks[taskId].func = sub_80B2C30; gTasks[taskId].func = sub_80B2C30;
} }
} }
@ -405,8 +405,8 @@ static void sub_80B2A08(u8 taskId)
sub_800AA04(gFieldLinkPlayerCount); sub_800AA04(gFieldLinkPlayerCount);
card = (struct TrainerCard *)gBlockSendBuffer; card = (struct TrainerCard *)gBlockSendBuffer;
TrainerCard_GenerateCardForPlayer(card); TrainerCard_GenerateCardForPlayer(card);
card->monSpecies[0] = GetMonData(&gPlayerParty[gUnknown_0203CEF8[0] - 1], MON_DATA_SPECIES, NULL); card->monSpecies[0] = GetMonData(&gPlayerParty[gSelectedOrderFromParty[0] - 1], MON_DATA_SPECIES, NULL);
card->monSpecies[1] = GetMonData(&gPlayerParty[gUnknown_0203CEF8[1] - 1], MON_DATA_SPECIES, NULL); card->monSpecies[1] = GetMonData(&gPlayerParty[gSelectedOrderFromParty[1] - 1], MON_DATA_SPECIES, NULL);
gTasks[taskId].func = sub_80B2C30; gTasks[taskId].func = sub_80B2C30;
sub_800A4D8(2); sub_800A4D8(2);
} }
@ -800,7 +800,7 @@ static void sub_80B3260(int a0)
gBattleTypeFlags = BATTLE_TYPE_DOUBLE | BATTLE_TYPE_LINK | BATTLE_TYPE_TRAINER; gBattleTypeFlags = BATTLE_TYPE_DOUBLE | BATTLE_TYPE_LINK | BATTLE_TYPE_TRAINER;
break; break;
case 5: case 5:
ReducePlayerPartyToThree(); ReducePlayerPartyToSelectedMons();
gBattleTypeFlags = BATTLE_TYPE_DOUBLE | BATTLE_TYPE_LINK | BATTLE_TYPE_TRAINER | BATTLE_TYPE_MULTI; gBattleTypeFlags = BATTLE_TYPE_DOUBLE | BATTLE_TYPE_LINK | BATTLE_TYPE_TRAINER | BATTLE_TYPE_MULTI;
break; break;
case 9: case 9:

View File

@ -36,7 +36,7 @@
#include "constants/items.h" #include "constants/items.h"
#include "constants/event_objects.h" #include "constants/event_objects.h"
extern u8 gUnknown_0203CEF8[]; extern u8 gSelectedOrderFromParty[];
struct FrontierBrainMon struct FrontierBrainMon
{ {
@ -779,7 +779,7 @@ static void sub_81A1968(void)
break; break;
case 4: case 4:
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
gSaveBlock2Ptr->frontier.selectedPartyMons[i] = gUnknown_0203CEF8[i]; gSaveBlock2Ptr->frontier.selectedPartyMons[i] = gSelectedOrderFromParty[i];
break; break;
case 6: case 6:
gSaveBlock2Ptr->frontier.field_CA9_b = gSpecialVar_0x8006; gSaveBlock2Ptr->frontier.field_CA9_b = gSpecialVar_0x8006;
@ -796,8 +796,8 @@ static void sub_81A1AD4(void)
sub_81B8558(); sub_81B8558();
for (i = 0; i < gSpecialVar_0x8005; i++) for (i = 0; i < gSpecialVar_0x8005; i++)
gUnknown_0203CEF8[i] = gSaveBlock2Ptr->frontier.selectedPartyMons[i]; gSelectedOrderFromParty[i] = gSaveBlock2Ptr->frontier.selectedPartyMons[i];
ReducePlayerPartyToThree(); ReducePlayerPartyToSelectedMons();
} }
static void DoSoftReset_(void) static void DoSoftReset_(void)

View File

@ -1784,7 +1784,7 @@ void sub_801440C(u8 taskId)
ScriptContext2_Disable(); ScriptContext2_Disable();
} }
extern u8 gUnknown_0203CEF8[]; extern u8 gSelectedOrderFromParty[];
void sub_8014790(u8 taskId) void sub_8014790(u8 taskId)
{ {
@ -1802,8 +1802,8 @@ void sub_8014790(u8 taskId)
gLinkPlayers[0].linkType = 0x2211; gLinkPlayers[0].linkType = 0x2211;
gLinkPlayers[0].id = 0; gLinkPlayers[0].id = 0;
gLinkPlayers[1].id = 2; gLinkPlayers[1].id = 2;
sendBuff[0] = GetMonData(&gPlayerParty[gUnknown_0203CEF8[0] - 1], MON_DATA_SPECIES); sendBuff[0] = GetMonData(&gPlayerParty[gSelectedOrderFromParty[0] - 1], MON_DATA_SPECIES);
sendBuff[1] = GetMonData(&gPlayerParty[gUnknown_0203CEF8[1] - 1], MON_DATA_SPECIES, NULL); sendBuff[1] = GetMonData(&gPlayerParty[gSelectedOrderFromParty[1] - 1], MON_DATA_SPECIES, NULL);
gMain.savedCallback = NULL; gMain.savedCallback = NULL;
data[0] = 4; data[0] = 4;
sub_800E3A8(); sub_800E3A8();

View File

@ -34,18 +34,18 @@ extern const u16 gEventObjectPalette8[];
extern const u16 gEventObjectPalette17[]; extern const u16 gEventObjectPalette17[];
extern const u16 gEventObjectPalette33[]; extern const u16 gEventObjectPalette33[];
extern const u16 gEventObjectPalette34[]; extern const u16 gEventObjectPalette34[];
extern const u8 gUnknown_0858D8EC[];
extern const struct CompressedSpriteSheet gMonFrontPicTable[]; extern const struct CompressedSpriteSheet gMonFrontPicTable[];
extern u8 gUnknown_0203CEF8[]; extern u8 gSelectedOrderFromParty[];
const u8 gUnknown_0858D8EC[] = { 3, 4, 5, 14 };
static void sub_80F8EE8(u8 taskId); static void sub_80F8EE8(u8 taskId);
static void sub_80F9088(u8 taskId); static void sub_80F9088(u8 taskId);
static void sub_80F9460(void); static void sub_80F9460(void);
static void sub_80F94B8(void); static void sub_80F94B8(void);
void SetContestTrainerGfxIds(void)
void sub_80F87D8(void)
{ {
gSaveBlock1Ptr->vars[VAR_OBJ_GFX_ID_0 - VARS_START] = gContestMons[0].trainerGfxId; gSaveBlock1Ptr->vars[VAR_OBJ_GFX_ID_0 - VARS_START] = gContestMons[0].trainerGfxId;
gSaveBlock1Ptr->vars[VAR_OBJ_GFX_ID_1 - VARS_START] = gContestMons[1].trainerGfxId; gSaveBlock1Ptr->vars[VAR_OBJ_GFX_ID_1 - VARS_START] = gContestMons[1].trainerGfxId;
@ -393,7 +393,7 @@ _080F8AB6:\n\
} }
#endif // NONMATCHING #endif // NONMATCHING
void sub_80F8ACC(void) static void ShowContestWinnerCleanup(void)
{ {
SetMainCallback2(CB2_ReturnToFieldContinueScriptPlayMapMusic); SetMainCallback2(CB2_ReturnToFieldContinueScriptPlayMapMusic);
} }
@ -401,7 +401,7 @@ void sub_80F8ACC(void)
void ShowContestWinner(void) void ShowContestWinner(void)
{ {
SetMainCallback2(sub_812FDEC); SetMainCallback2(sub_812FDEC);
gMain.savedCallback = sub_80F8ACC; gMain.savedCallback = ShowContestWinnerCleanup;
} }
void sub_80F8AFC(void) void sub_80F8AFC(void)
@ -463,7 +463,7 @@ void sub_80F8B94(void)
} }
} }
u8 sub_80F8C7C(void) u8 GiveMonArtistRibbon(void)
{ {
u8 hasArtistRibbon; u8 hasArtistRibbon;
@ -489,7 +489,7 @@ u8 sub_80F8D24(void)
return 0; return 0;
} }
void sub_80F8D28(void) void ShowContestEntryMonPic(void)
{ {
const struct CompressedSpritePalette *palette; const struct CompressedSpritePalette *palette;
u32 personality, otId; u32 personality, otId;
@ -510,13 +510,9 @@ void sub_80F8D28(void)
gTasks[taskId].data[0] = 0; gTasks[taskId].data[0] = 0;
gTasks[taskId].data[1] = species; gTasks[taskId].data[1] = species;
if (gSpecialVar_0x8006 == gContestPlayerMonIndex) if (gSpecialVar_0x8006 == gContestPlayerMonIndex)
{
HandleLoadSpecialPokePic_2(&gMonFrontPicTable[species], gMonSpritesGfxPtr->sprites[1], species, personality); HandleLoadSpecialPokePic_2(&gMonFrontPicTable[species], gMonSpritesGfxPtr->sprites[1], species, personality);
}
else else
{
HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonFrontPicTable[species], gMonSpritesGfxPtr->sprites[1], species, personality); HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonFrontPicTable[species], gMonSpritesGfxPtr->sprites[1], species, personality);
}
palette = GetMonSpritePalStructFromOtIdPersonality(species, otId, personality); palette = GetMonSpritePalStructFromOtIdPersonality(species, otId, personality);
LoadCompressedObjectPalette(palette); LoadCompressedObjectPalette(palette);
@ -586,7 +582,7 @@ static void sub_80F8EE8(u8 taskId)
} }
} }
void sub_80F8FA0(void) void ScriptGetMultiplayerId(void)
{ {
if ((gIsLinkContest & 1) && gUnknown_02039F30 == 4 && !(gIsLinkContest & 2)) if ((gIsLinkContest & 1) && gUnknown_02039F30 == 4 && !(gIsLinkContest & 2))
gSpecialVar_Result = GetMultiplayerId(); gSpecialVar_Result = GetMultiplayerId();
@ -594,7 +590,7 @@ void sub_80F8FA0(void)
gSpecialVar_Result = 4; gSpecialVar_Result = 4;
} }
void sub_80F8FE8(void) void ScriptRandom(void)
{ {
u16 random; u16 random;
u16 *scriptPtr; u16 *scriptPtr;
@ -782,7 +778,7 @@ void HasEnoughMonsForDoubleBattle(void)
} }
} }
bool8 CheckPartyMonHasHeldItem(u16 item) static bool8 CheckPartyMonHasHeldItem(u16 item)
{ {
int i; int i;
@ -835,7 +831,7 @@ void sub_80F9438(void)
static void sub_80F9460(void) static void sub_80F9460(void)
{ {
switch (gUnknown_0203CEF8[0]) switch (gSelectedOrderFromParty[0])
{ {
case 0: case 0:
gSpecialVar_Result = 0; gSpecialVar_Result = 0;
@ -856,7 +852,7 @@ void sub_80F9490(void)
static void sub_80F94B8(void) static void sub_80F94B8(void)
{ {
switch (gUnknown_0203CEF8[0]) switch (gSelectedOrderFromParty[0])
{ {
case 0: case 0:
gSpecialVar_Result = 0; gSpecialVar_Result = 0;
@ -869,7 +865,7 @@ static void sub_80F94B8(void)
SetMainCallback2(CB2_ReturnToFieldContinueScriptPlayMapMusic); SetMainCallback2(CB2_ReturnToFieldContinueScriptPlayMapMusic);
} }
void ReducePlayerPartyToThree(void) void ReducePlayerPartyToSelectedMons(void)
{ {
struct Pokemon party[4]; struct Pokemon party[4];
int i; int i;
@ -878,8 +874,8 @@ void ReducePlayerPartyToThree(void)
// copy the selected pokemon according to the order. // copy the selected pokemon according to the order.
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
if (gUnknown_0203CEF8[i]) // as long as the order keeps going (did the player select 1 mon? 2? 3?), do not stop if (gSelectedOrderFromParty[i]) // as long as the order keeps going (did the player select 1 mon? 2? 3?), do not stop
party[i] = gPlayerParty[gUnknown_0203CEF8[i] - 1]; // index is 0 based, not literal party[i] = gPlayerParty[gSelectedOrderFromParty[i] - 1]; // index is 0 based, not literal
CpuFill32(0, gPlayerParty, sizeof gPlayerParty); CpuFill32(0, gPlayerParty, sizeof gPlayerParty);

View File

@ -472,7 +472,7 @@ gUnknown_0203CEF0: @ 203CEF0
gUnknown_0203CEF4: @ 203CEF4 gUnknown_0203CEF4: @ 203CEF4
.space 0x4 .space 0x4
gUnknown_0203CEF8: @ 203CEF8 gSelectedOrderFromParty: @ 203CEF8
.space 0x4 .space 0x4
gUnknown_0203CEFC: @ 203CEFC gUnknown_0203CEFC: @ 203CEFC