diff options
author | PikalaxALT <pikalaxalt@gmail.com> | 2018-01-22 17:33:02 -0500 |
---|---|---|
committer | PikalaxALT <pikalaxalt@gmail.com> | 2018-01-22 17:47:38 -0500 |
commit | b2ea9aec023be26a83853ca53134ce78b95ac2e6 (patch) | |
tree | 6d3bcdc2068874eb1809b06ce4be76c82e075af7 /src | |
parent | fc504ce61b8698bc4777bbd37a8766b8c35a5814 (diff) |
sub_80C8734
Diffstat (limited to 'src')
-rw-r--r-- | src/battle/contest_link_80C857C.c | 104 |
1 files changed, 104 insertions, 0 deletions
diff --git a/src/battle/contest_link_80C857C.c b/src/battle/contest_link_80C857C.c index 3360ecbb6..b86e7bb9c 100644 --- a/src/battle/contest_link_80C857C.c +++ b/src/battle/contest_link_80C857C.c @@ -8,6 +8,10 @@ static void sub_80C8644(u8 taskId); static void sub_80C8660(u8 taskId); +#if GERMAN +void de_sub_80C9274(bool32 arg0); +void de_sub_80C9294(bool32 arg0); +#endif void sub_80C857C(const void *data, u16 size) { @@ -193,6 +197,106 @@ __attribute__((naked)) u8 sub_80C86A0(const u8 *string) } #endif +void sub_80C8734(u8 taskId) +{ + int i; + u8 *name; + + switch (gTasks[taskId].data[0]) { +#if ENGLISH + default: + gTasks[taskId].data[0] = 0; + SwitchTaskToFollowupFunc(taskId); + break; +#elif GERMAN + case 8: +#endif + case 0: + if (GetMultiplayerId() == 0) { + if (sub_8007ECC()) { +#if GERMAN + if (gTasks[taskId].data[0] == 0) + { + gTasks[taskId].data[0] = 3; + } + else + { +#endif + memcpy(gBlockSendBuffer, gContestMons + gContestPlayerMonIndex, sizeof(struct ContestPokemon)); +#if GERMAN + de_sub_80C9274(FALSE); +#endif + sub_8007E9C(2); +#if GERMAN + gTasks[taskId].data[0] = 1; + } +#else + gTasks[taskId].data[0]++; +#endif + } + } + else + { + memcpy(gBlockSendBuffer, gContestMons + gContestPlayerMonIndex, sizeof(struct ContestPokemon)); +#if GERMAN + de_sub_80C9294(FALSE); +#endif + gTasks[taskId].data[0]++; + } + break; + case 1: + if (sub_80C85D8()) + { + for (i = 0; i < MAX_LINK_PLAYERS; i++) + { + memcpy(gContestMons + i, gBlockRecvBuffer[i], sizeof(struct ContestPokemon)); + name = gContestMons[i].nickname; + if (gLinkPlayers[i].language == LANGUAGE_JAPANESE) + { + ConvertInternationalString(name, sub_80C86A0(name)); + } + else if (name[10] == EXT_CTRL_CODE_BEGIN) + { + ConvertInternationalString(name, LANGUAGE_JAPANESE); + } else + { + name[5] = name[10]; + name[10] = EOS; + } + name = gContestMons[i].trainerName; + if (gLinkPlayers[i].language == LANGUAGE_JAPANESE) + { + name[7] = EOS; + name[6] = name[4]; + name[5] = name[3]; + name[4] = name[2]; + name[3] = name[1]; + name[2] = name[0]; + name[1] = 0x15; + name[0] = EXT_CTRL_CODE_BEGIN; + } + else + { + name[5] = name[7]; + name[7] = EOS; + } + } + gTasks[taskId].data[0]++; + } + break; +#if GERMAN + case 2: + gTasks[taskId].data[0] = 0; + SwitchTaskToFollowupFunc(taskId); + break; + default: + gTasks[taskId].data[0]++; + break; +#endif + } +} + + asm(".section .text_de"); #if GERMAN |