documenting select_pokemon.c, trade.c, wfc_int.c

This commit is contained in:
Land0fChocolate
2026-07-25 21:56:55 +01:00
parent 47fddafe82
commit c634fdea2e
15 changed files with 1284 additions and 1223 deletions

View File

@@ -67,23 +67,23 @@ typedef struct GTSPokemonRequirements {
s8 gender;
s8 level;
s8 level2;
s8 unk_05;
s8 unset_05;
} GTSPokemonRequirements;
typedef struct GTSPokemonListing {
GTSPokemonListingMon pokemon;
GTSPokemonCriteria criteria;
GTSPokemonRequirements requirements;
u8 unk_F6;
u8 trainerGender;
u8 unused[17];
s32 unk_108;
s32 listingId;
u16 trainerNames[8];
u16 unk_11C;
u16 trainerId;
u8 trainerCountry;
u8 trainerRegion;
u8 unk_120;
u8 trainerAppearance;
s8 exchangedFromRemote; // whether or not the pokemon was exchanged in the remote server (ie: this is the listing that someone traded for your deposited pokemon)
u8 unk_122;
u8 gameVersion;
u8 trainerLanguage;
} GTSPokemonListing;
@@ -116,9 +116,9 @@ typedef struct {
typedef struct GTSApplicationState {
GTSPlayerData *playerData;
BgConfig *bgConfig;
WiFiList *unk_08;
int unk_0C;
int unk_10;
WiFiList *unused_08;
int unused_0C;
int unused_10;
int screenId;
int nextScreen;
int returnAfterNetworkScreen;
@@ -129,12 +129,12 @@ typedef struct GTSApplicationState {
int nextScreenInstruction;
u16 hasPlayerDescended;
u16 isPokemonListed;
u16 unk_38;
u16 unused_38;
u16 networkTimer;
int commsErrorMessage;
int unk_40; // dwcError
int unk_44; // dwcErrorCode
int unk_48; // dwcErrorType
int dwcErr;
int dwcErrCode;
int dwcErrType;
void *dwcHeapPointer;
NNSFndHeapHandle dwcHeapHandle;
DWCInetControl dwcInetControlObject;
@@ -144,12 +144,12 @@ typedef struct GTSApplicationState {
EvolutionData *evolutionData;
BOOL appManActive;
u16 listMenuCursorIndex;
u16 unk_10A;
u16 unused_10A;
u16 mainMenuSelectedOption;
u16 selectedInfoTab;
u16 selectedBoxId;
u16 partySlotIndex;
BoxPokemon *unk_114;
BoxPokemon *selectedBoxMon;
int searchResultCount;
int selectedSearchResult;
TrainerInfo *receivingPokemonTrainer;
@@ -157,19 +157,19 @@ typedef struct GTSApplicationState {
GTSPokemonListing receivedListing;
GTSPokemonListing searchResults[7];
GTSPokemonListing selectedListing;
GTSPokemonCriteria unk_B70;
GTSPokemonRequirements unk_B74;
GTSPokemonCriteria offeredPokemonCriteria;
GTSPokemonRequirements depositRequirements;
GTSPokemonRequirements searchRequirements;
GTSPokemonRequirements submittedRequirements;
int submittedCountryIndex;
StringTemplate *stringTemplate;
MessageLoader *gtsMessageLoader;
MessageLoader *speciesMessageLoader;
MessageLoader *unk0674MessageLoader;
MessageLoader *unk0695MessageLoader;
MessageLoader *connProgressMessageLoader;
MessageLoader *disconnStatusMessageLoader;
MessageLoader *countryMessageLoader;
String *selectPokemonBoxName;
String *unk_BA8;
String *cancelButtonLabel;
String *genericMessageBuffer;
String *title;
String *trainerLocationStrings[10];
@@ -183,25 +183,25 @@ typedef struct GTSApplicationState {
SpriteResourcesHeader avatarSpriteResourceHeader;
SpriteResourcesHeader unused_DFC;
Sprite *cursorSprite;
Sprite *unk_E24;
Sprite *unk_E28[30];
Sprite *unk_EA0[30];
Sprite *unused_E24;
Sprite *boxSlotIconSprites[30];
Sprite *boxSlotItemSprites[30];
Sprite *selectPokemonPartySprites[MAX_PARTY_SIZE];
Sprite *listingCursorSprite;
Sprite *avatarSprites[8];
Sprite *unk_F54[2];
Sprite *boxArrowSprites[2];
Window bottomInstructionWindow;
Window unk_F6C;
Window unused_F6C;
Window titleWindow;
Window unk_F8C;
Window networkErrWindow;
Window menuButtonWindows[3];
Window infoWindows[13];
Window confirmationWindow;
Window locationCriteriaWindows[2];
StringList *unk_10CC;
StringList *menuStringList;
Menu *yesNoMenu;
Menu *unk_10D4;
ListMenu *unk_10D8;
Menu *popupMenu;
ListMenu *activeListMenu;
void *waitDial;
int frameDelay;
GTSSpeciesMenuState *speciesMenuState;
@@ -210,10 +210,10 @@ typedef struct GTSApplicationState {
SysTask *playerAvatarAnimationTask;
u16 hasAvatarFinishedMoving;
u16 searchResultsVisible;
void *unk_10F4;
NNSG2dCharacterData *unk_10F8;
void *unk_10FC;
NNSG2dPaletteData *unk_1100;
void *avatarCharDataHeapPtr;
NNSG2dCharacterData *avatarCharData;
void *avatarPaletteHeapPtr;
NNSG2dPaletteData *avatarPaletteData;
Pokemon *tradeTempPokemon;
GTSBoxPokemonCriteria *boxCriteria;
u16 deferredBoxPokemonCount;

View File

@@ -7,11 +7,37 @@
#include "pc_boxes.h"
#include "pokemon.h"
int GTSApplication_SelectPokemon_Init(GTSApplicationState *param0, int param1);
int GTSApplication_SelectPokemon_Main(GTSApplicationState *param0, int param1);
int GTSApplication_SelectPokemon_Exit(GTSApplicationState *param0, int param1);
int GTSApplication_SelectMon_Init(GTSApplicationState *param0, int param1);
int GTSApplication_SelectMon_Main(GTSApplicationState *param0, int param1);
int GTSApplication_SelectMon_Exit(GTSApplicationState *param0, int param1);
BOOL GTSApplication_IsBoxIDParty(int boxID);
BoxPokemon *GTSApplication_GetSelectedBoxMon(Party *party, PCBoxes *pcBoxes, int boxID, int pos);
BOOL Pokemon_IsHoldingMail(Pokemon *mon);
enum GTSPokemonSelectScreenStates {
GTS_SELECTMON_WAIT_FADE_IN,
GTS_SELECTMON_HANDLE_INPUT,
GTS_SELECTMON_FADE_AND_EXIT,
GTS_SELECTMON_WAIT_FOR_TEXT,
GTS_SELECTMON_WAIT_FOR_TEXT_AND_ERASE_BOX,
GTS_SELECTMON_CREATE_EXIT_CONFIRM_MENU,
GTS_SELECTMON_HANDLE_EXIT_CONFIRM,
GTS_SELECTMON_CREATE_POKEMON_MENU,
GTS_SELECTMON_HANDLE_POKEMON_MENU_INPUT,
GTS_SELECTMON_CREATE_TRADE_MENU,
GTS_SELECTMON_HANDLE_TRADE_MENU_INPUT,
GTS_SELECTMON_SHOW_BALL_CAPSULE_TRADE_PROMPT,
GTS_SELECTMON_CREATE_TRADE_CONFIRM_MENU,
GTS_SELECTMON_HANDLE_TRADE_CONFIRM,
GTS_SELECTMON_SHOW_BALL_CAPSULE_DEPOSIT_PROMPT,
GTS_SELECTMON_CREATE_BALL_CAPSULE_TRADE_CONFIRM_MENU,
GTS_SELECTMON_HANDLE_BALL_CAPSULE_TRADE_CONFIRM
};
enum GTSSlotStatus {
GTS_SLOTSTATUS_NO_SPECIES,
GTS_SLOTSTATUS_VALID_MON,
GTS_SLOTSTATUS_EGG
};
#endif // POKEPLATINUM_GTS_SCREENS_SELECT_POKEMON_H

View File

@@ -3,8 +3,13 @@
#include "overlay094/gts_application_state.h"
int GTSApplication_Trade_Init(GTSApplicationState *param0, int param1);
int GTSApplication_Trade_Main(GTSApplicationState *param0, int param1);
int GTSApplication_Trade_Exit(GTSApplicationState *param0, int param1);
int GTSApplication_Trade_Init(GTSApplicationState *appState, int unused);
int GTSApplication_Trade_Main(GTSApplicationState *appState, int unused);
int GTSApplication_Trade_Exit(GTSApplicationState *appState, int unused);
enum GTSTradeScreenStates {
GTS_TRADE_WAIT_ANIMATION,
GTS_TRADE_WAIT_EVOLUTION
};
#endif // POKEPLATINUM_GTS_SCREENS_TRADE_H

View File

@@ -7,12 +7,64 @@
#include "message.h"
#include "string_gf.h"
int GTSApplication_InitWFC_Init(GTSApplicationState *appState, int param1);
int GTSApplication_WFCInit_Main(GTSApplicationState *appState, int param1);
int GTSApplication_WFCInit_Exit(GTSApplicationState *appState, int param1);
int GTSApplication_WFC_Init(GTSApplicationState *appState, int unused);
int GTSApplication_WFCInit_Main(GTSApplicationState *appState, int unused);
int GTSApplication_WFCInit_Exit(GTSApplicationState *appState, int unused);
void GTSApplication_DisplayStatusMessage(GTSApplicationState *appState, MessageLoader *messageLoader, int messageId, int textSpeed, u16 unused);
void ov94_022458CC(Window *window, String *string, int x, int y, int width, TextColor textColor);
void ov94_02245900(Window *window, String *string, int x, int y, int centered, TextColor textColor);
void ov94_02245934(GTSApplicationState *appState);
void Window_DrawAlignedMessageText(Window *window, String *string, int x, int y, int width, TextColor textColor);
void Window_DrawAlignedSystemText(Window *window, String *string, int x, int y, int centered, TextColor textColor);
void GTSApplication_InitNetworkIcon(GTSApplicationState *appState);
enum GTSWFCInitScreenStates {
GTSWFCINIT_ASK_TO_SETUP_CONNECTION,
GTSWFCINIT_PROCESS_SETUP_CONFIRMATION,
GTSWFCINIT_CONNECT,
GTSWFCINIT_CHECK_CONNECTION,
GTSWFCINIT_AUTHENTICATE,
GTSWFCINIT_CHECK_AUTHENTICATION,
GTSWFCINIT_GET_DWC_KEY,
GTSWFCINIT_CONNECT_TO_REMOTE_SERVER,
GTSWFCINIT_WAIT_FOR_SERVER_RESPONSE,
GTSWFCINIT_SET_PROFILE_REQUEST,
GTSWFCINIT_SET_PROFILE_RESPONSE,
GTSWFCINIT_EXIT_SCREEN,
GTSWFCINIT_WAIT_FOR_TEXT,
GTSWFCINIT_WAIT_FOR_TEXT_THEN_YES_NO_MENU,
GTSWFCINIT_HANDLE_RETRY_MENU_INPUT,
GTSWFCINIT_ASK_TO_DISCONNECT,
GTSWFCINIT_RESTART_OR_EXIT,
GTSWFCINIT_SHOW_DISCONNECTING_MESSAGE,
GTSWFCINIT_CLEANUP_NETWORKING,
GTSWFCINIT_SHOW_DISCONNECTED_MESSAGE,
GTSWFCINIT_WAIT_FOR_TEXT_DELAYED,
GTSWFCINIT_FATAL_ERROR,
GTSWFCINIT_FATAL_ERROR_DISCONNECT_MESSAGE,
GTSWFCINIT_SHOW_NETWORK_ERROR,
GTSWFCINIT_RESTART_CONNECTION
};
enum GTSCommsError {
GTSCOMMS_RESULT_GTS_MAINTENANCE = 1,
GTSCOMMS_RESULT_CROWDED1 = 2,
GTSCOMMS_RESULT_CROWDED2 = -1,
GTSCOMMS_RESULT_DISCONNECTED1 = -2,
GTSCOMMS_RESULT_DISCONNECTED2 = -14,
GTSCOMMS_RESULT_UNABLE_TO_CONNECT1 = -12,
GTSCOMMS_RESULT_UNABLE_TO_CONNECT2 = -15,
GTSCOMMS_RESULT_UNABLE_TO_CONNECT3 = -3,
GTSCOMMS_RESULT_UNABLE_TO_CONNECT4 = -5,
GTSCOMMS_RESULT_WII_AUTH_ERROR = -5003,
GTSCOMMS_RESULT_COMMUNICATION_ERROR1 = -5000,
GTSCOMMS_RESULT_COMMUNICATION_ERROR2 = -5001,
GTSCOMMS_RESULT_DATA_CORRUPTION = -5004,
GTSCOMMS_RESULT_SERVER_MAINTENANCE = -5005,
};
enum WFCDisconnectMessage {
WFCDISCONNECTMSG_DISCONNECTING_FROM_WIFI,
WFCDISCONNECTMSG_WAIT_THEN_DISCONNECT,
WFCDISCONNECTMSG_YOU_HAVE_DISCONNECTED,
WFCDISCONNECTMSG_WAIT_FOR_DISCONNECTED_TEXT
};
#endif // POKEPLATINUM_GTS_SCREENS_WFC_INIT_H

View File

@@ -71,12 +71,12 @@ static NNSFndHeapHandle sGTSHeapHandle;
// gtsApplicationScreens { init, main, exit }
static int (*gtsApplicationScreens[][3])(GTSApplicationState *, int) = {
{ GTSApplication_InitWFC_Init, GTSApplication_WFCInit_Main, GTSApplication_WFCInit_Exit },
{ GTSApplication_WFC_Init, GTSApplication_WFCInit_Main, GTSApplication_WFCInit_Exit },
{ GTSApplication_MainMenu_Init, GTSApplication_MainMenu_Main, GTSApplication_MainMenu_Exit },
{ GTSApplication_Listing_Init, GTSApplication_Listing_Main, GTSApplication_Listing_Exit },
{ GTSApplication_SearchListing_Init, GTSApplication_SearchListing_Main, GTSApplication_SearchListing_Exit },
{ GTSApplication_Search_Init, GTSApplication_Search_Main, GTSApplication_Search_Exit },
{ GTSApplication_SelectPokemon_Init, GTSApplication_SelectPokemon_Main, GTSApplication_SelectPokemon_Exit },
{ GTSApplication_SelectMon_Init, GTSApplication_SelectMon_Main, GTSApplication_SelectMon_Exit },
{ GTSApplication_Deposit_Init, GTSApplication_Deposit_Main, GTSApplication_Deposit_Exit },
{ GTSApplication_NetworkHandler_Init, GTSApplication_NetworkHandler_Main, GTSApplication_NetworkHandler_Exit },
{ GTSApplication_PokemonSummary_Init, GTSApplication_PokemonSummary_Main, GTSApplication_PokemonSummary_Exit },
@@ -115,8 +115,8 @@ BOOL GTSApplication_Init(ApplicationManager *appMan, int *loopState)
appState->stringTemplate = StringTemplate_New(11, 64, HEAP_ID_62);
appState->gtsMessageLoader = MessageLoader_Init(MSG_LOADER_PRELOAD_ENTIRE_BANK, NARC_INDEX_MSGDATA__PL_MSG, TEXT_BANK_GTS, HEAP_ID_62);
appState->unk0674MessageLoader = MessageLoader_Init(MSG_LOADER_PRELOAD_ENTIRE_BANK, NARC_INDEX_MSGDATA__PL_MSG, TEXT_BANK_UNK_0674, HEAP_ID_62);
appState->unk0695MessageLoader = MessageLoader_Init(MSG_LOADER_PRELOAD_ENTIRE_BANK, NARC_INDEX_MSGDATA__PL_MSG, TEXT_BANK_UNK_0695, HEAP_ID_62);
appState->connProgressMessageLoader = MessageLoader_Init(MSG_LOADER_PRELOAD_ENTIRE_BANK, NARC_INDEX_MSGDATA__PL_MSG, TEXT_BANK_UNK_0674, HEAP_ID_62);
appState->disconnStatusMessageLoader = MessageLoader_Init(MSG_LOADER_PRELOAD_ENTIRE_BANK, NARC_INDEX_MSGDATA__PL_MSG, TEXT_BANK_UNK_0695, HEAP_ID_62);
appState->speciesMessageLoader = MessageLoader_Init(MSG_LOADER_PRELOAD_ENTIRE_BANK, NARC_INDEX_MSGDATA__PL_MSG, TEXT_BANK_SPECIES_NAME, HEAP_ID_62);
appState->countryMessageLoader = MessageLoader_Init(MSG_LOADER_PRELOAD_ENTIRE_BANK, NARC_INDEX_MSGDATA__PL_MSG, TEXT_BANK_COUNTRY_NAMES, HEAP_ID_62);
@@ -209,8 +209,8 @@ BOOL GTSApplication_Exit(ApplicationManager *appMan, int *unused)
GTSApplication_CleanupGraphics(appState);
MessageLoader_Free(appState->speciesMessageLoader);
MessageLoader_Free(appState->unk0695MessageLoader);
MessageLoader_Free(appState->unk0674MessageLoader);
MessageLoader_Free(appState->disconnStatusMessageLoader);
MessageLoader_Free(appState->connProgressMessageLoader);
MessageLoader_Free(appState->gtsMessageLoader);
MessageLoader_Free(appState->countryMessageLoader);
StringTemplate_Free(appState->stringTemplate);
@@ -312,7 +312,7 @@ static void GTSApplication_InitGraphics(GTSApplicationState *appState)
appState->spriteList = SpriteList_InitRendering(72 + 6, &appState->g2dRenderer, HEAP_ID_62);
SetSubScreenViewRect(&appState->g2dRenderer, 0, (256 * FX32_ONE));
SetSubScreenViewRect(&appState->g2dRenderer, 0, 256 * FX32_ONE );
for (int i = 0; i < 4; i++) {
appState->spriteResourceCollection[i] = SpriteResourceCollection_New(3, i, HEAP_ID_62);
@@ -398,7 +398,7 @@ Menu *GTSApplication_CreateYesNoMenu(BgConfig *bgConfig, int tilemapTop, int bas
template.tilemapTop = tilemapTop;
template.baseTile = baseTile;
return Menu_MakeYesNoChoice(bgConfig, &template, (1 + (18 + 12)), 11, HEAP_ID_62);
return Menu_MakeYesNoChoice(bgConfig, &template, 1 + (18 + 12), 11, HEAP_ID_62);
}
void GTSApplication_SetCurrentAndNextScreenInstruction(GTSApplicationState *appState, int currentInstruction, int nextInstruction)

View File

@@ -233,10 +233,10 @@ void GTSAvatar_ShowSearchResults(GTSApplicationState *appState, int resultCount,
for (int i = 0; i < GTS_MAX_SEARCH_RESULTS; i++) {
if (i < resultCount) {
int v1 = appState->searchResults[i].unk_120;
int v2 = appState->searchResults[i].unk_F6;
int v1 = appState->searchResults[i].trainerAppearance;
int v2 = appState->searchResults[i].trainerGender;
GTSAvatar_LoadTrainerSprite(appState->unk_10F8, appState->unk_1100, i, v1, v2);
GTSAvatar_LoadTrainerSprite(appState->avatarCharData, appState->avatarPaletteData, i, v1, v2);
if (showIdle) {
Sprite_SetAnim(appState->avatarSprites[i + 1], 14 + i * 4);
@@ -269,10 +269,10 @@ void GTSAvatar_HighlightSearchResults(GTSApplicationState *appState)
static void GTSAvatar_LoadGraphics(GTSApplicationState *appState)
{
appState->unk_10FC = Graphics_GetPlttData(NARC_INDEX_GRAPHIC__RECORD, 7, &(appState->unk_1100), HEAP_ID_62);
appState->unk_10F4 = Graphics_GetCharData(NARC_INDEX_GRAPHIC__RECORD, 9, 1, &(appState->unk_10F8), HEAP_ID_62);
appState->avatarPaletteHeapPtr = Graphics_GetPlttData(NARC_INDEX_GRAPHIC__RECORD, 7, &(appState->avatarPaletteData), HEAP_ID_62);
appState->avatarCharDataHeapPtr = Graphics_GetCharData(NARC_INDEX_GRAPHIC__RECORD, 9, 1, &(appState->avatarCharData), HEAP_ID_62);
DC_FlushRange(appState->unk_10F8, (256 * 256 / 2));
DC_FlushRange(appState->avatarCharData, 256 * 256 / 2);
}
static const u16 sSearchResultVRAMAddresses[] = {
@@ -301,7 +301,7 @@ static void GTSAvatar_LoadTrainerSprite(NNSG2dCharacterData *charData, NNSG2dPal
void GTSAvatar_FreeGraphics(GTSApplicationState *appState)
{
if (appState->hasAvatarFinishedMoving) {
Heap_Free(appState->unk_10FC);
Heap_Free(appState->unk_10F4);
Heap_Free(appState->avatarPaletteHeapPtr);
Heap_Free(appState->avatarCharDataHeapPtr);
}
}

View File

@@ -284,9 +284,9 @@ int GTSApplication_Deposit_Init(GTSApplicationState *appState, int unused)
StartScreenFade(FADE_MAIN_ONLY, FADE_TYPE_BRIGHTNESS_IN, FADE_TYPE_BRIGHTNESS_IN, COLOR_BLACK, 6, 1, HEAP_ID_62);
ov94_02245934(appState);
GTSApplication_InitNetworkIcon(appState);
GTSDeposit_DrawWantedCriteria(appState->gtsMessageLoader, appState->speciesMessageLoader, appState->stringTemplate, &appState->infoWindows[0], 0, 3, -1);
GTSDeposit_DrawOfferedPokemon(appState->gtsMessageLoader, appState->stringTemplate, &appState->infoWindows[3], appState->unk_114, &appState->unk_B70);
GTSDeposit_DrawOfferedPokemon(appState->gtsMessageLoader, appState->stringTemplate, &appState->infoWindows[3], appState->selectedBoxMon, &appState->offeredPokemonCriteria);
appState->currentScreenInstruction = 0;
@@ -444,7 +444,7 @@ static void GTSDeposit_InitWindows(GTSApplicationState *appState)
Window_Add(appState->bgConfig, &appState->titleWindow, 0, 1, 1, 28, 2, 13, (1 + (18 + 12)) + 9);
Window_FillTilemap(&appState->titleWindow, 0x0);
ov94_022458CC(&appState->titleWindow, appState->title, 0, 1, 0, TEXT_COLOR(15, 14, 0));
Window_DrawAlignedMessageText(&appState->titleWindow, appState->title, 0, 1, 0, TEXT_COLOR(15, 14, 0));
Window_Add(appState->bgConfig, &appState->bottomInstructionWindow, 0, 2, 21, 27, 2, 13, ((1 + (18 + 12)) + 9) + 28 * 2);
Window_FillTilemap(&appState->bottomInstructionWindow, 0x0);
@@ -519,7 +519,7 @@ static int GTSDeposit_SetupCharpadWindows(GTSApplicationState *appState)
static int GTSDeposit_ShowCharpadMenu(GTSApplicationState *appState)
{
appState->unk_10D8 = GTS_CreateCharpadMenu(appState, &appState->unk_10CC, &appState->menuButtonWindows[0], appState->gtsMessageLoader);
appState->activeListMenu = GTS_CreateCharpadMenu(appState, &appState->menuStringList, &appState->menuButtonWindows[0], appState->gtsMessageLoader);
appState->listMenuCursorIndex = 0xffff;
appState->currentScreenInstruction = 4;
@@ -528,7 +528,7 @@ static int GTSDeposit_ShowCharpadMenu(GTSApplicationState *appState)
static int GTSDeposit_HandleCharpadInput(GTSApplicationState *appState)
{
switch (GTS_ProcessListMenuInput(appState->unk_10D8, &appState->listMenuCursorIndex)) {
switch (GTS_ProcessListMenuInput(appState->activeListMenu, &appState->listMenuCursorIndex)) {
case 1:
case 2:
case 3:
@@ -538,14 +538,14 @@ static int GTSDeposit_HandleCharpadInput(GTSApplicationState *appState)
case 7:
case 8:
case 9:
ListMenu_Free(appState->unk_10D8, &appState->speciesMenuState->charpadScrollPos, &appState->speciesMenuState->charpadCursorPos);
StringList_Free(appState->unk_10CC);
ListMenu_Free(appState->activeListMenu, &appState->speciesMenuState->charpadScrollPos, &appState->speciesMenuState->charpadCursorPos);
StringList_Free(appState->menuStringList);
appState->currentScreenInstruction = 5;
Sound_PlayEffect(SEQ_SE_CONFIRM);
break;
case MENU_CANCEL:
ListMenu_Free(appState->unk_10D8, &appState->speciesMenuState->charpadScrollPos, &appState->speciesMenuState->charpadCursorPos);
StringList_Free(appState->unk_10CC);
ListMenu_Free(appState->activeListMenu, &appState->speciesMenuState->charpadScrollPos, &appState->speciesMenuState->charpadCursorPos);
StringList_Free(appState->menuStringList);
Window_EraseStandardFrame(&appState->menuButtonWindows[0], 0);
Window_EraseMessageBox(&appState->bottomInstructionWindow, 0);
Window_Remove(&appState->menuButtonWindows[0]);
@@ -561,7 +561,7 @@ static int GTSDeposit_HandleCharpadInput(GTSApplicationState *appState)
static int GTSDeposit_ShowSpeciesMenu(GTSApplicationState *appState)
{
appState->unk_10D8 = GTS_CreateSpeciesMenu(appState, &appState->unk_10CC, &appState->menuButtonWindows[1], appState->gtsMessageLoader, appState->speciesMessageLoader, appState->speciesMenuState, appState->playerData->pokedex);
appState->activeListMenu = GTS_CreateSpeciesMenu(appState, &appState->menuStringList, &appState->menuButtonWindows[1], appState->gtsMessageLoader, appState->speciesMessageLoader, appState->speciesMenuState, appState->playerData->pokedex);
appState->listMenuCursorIndex = 0xffff;
appState->currentScreenInstruction = 6;
@@ -588,12 +588,12 @@ int GTSDeposit_TryAutoSetGender(GTSPokemonRequirements *requirements, int gender
static int GTSDeposit_HandleSpeciesInput(GTSApplicationState *appState)
{
u32 input;
switch (input = GTS_ProcessListMenuInput(appState->unk_10D8, &appState->listMenuCursorIndex)) {
switch (input = GTS_ProcessListMenuInput(appState->activeListMenu, &appState->listMenuCursorIndex)) {
case MENU_NOTHING_CHOSEN:
break;
case MENU_CANCEL:
ListMenu_Free(appState->unk_10D8, &appState->speciesMenuState->speciesListScrollPos, &appState->speciesMenuState->speciesListCursorPos);
StringList_Free(appState->unk_10CC);
ListMenu_Free(appState->activeListMenu, &appState->speciesMenuState->speciesListScrollPos, &appState->speciesMenuState->speciesListCursorPos);
StringList_Free(appState->menuStringList);
Window_EraseStandardFrame(&appState->menuButtonWindows[1], 0);
Window_Remove(&appState->menuButtonWindows[0]);
Window_Remove(&appState->menuButtonWindows[1]);
@@ -604,25 +604,25 @@ static int GTSDeposit_HandleSpeciesInput(GTSApplicationState *appState)
default:
int gender;
ListMenu_Free(appState->unk_10D8, &appState->speciesMenuState->speciesListScrollPos, &appState->speciesMenuState->speciesListCursorPos);
StringList_Free(appState->unk_10CC);
ListMenu_Free(appState->activeListMenu, &appState->speciesMenuState->speciesListScrollPos, &appState->speciesMenuState->speciesListCursorPos);
StringList_Free(appState->menuStringList);
Window_EraseStandardFrame(&appState->menuButtonWindows[0], 0);
Window_EraseStandardFrame(&appState->menuButtonWindows[1], 0);
Window_Remove(&appState->menuButtonWindows[0]);
Window_Remove(&appState->menuButtonWindows[1]);
appState->unk_B74.species = input;
appState->depositRequirements.species = input;
Sound_PlayEffect(SEQ_SE_CONFIRM);
appState->speciesMenuState->selectedSpeciesGenderRatio = SpeciesData_GetSpeciesValue(input, SPECIES_DATA_GENDER_RATIO);
if (GTSDeposit_TryAutoSetGender(&appState->unk_B74, appState->speciesMenuState->selectedSpeciesGenderRatio)) {
if (GTSDeposit_TryAutoSetGender(&appState->depositRequirements, appState->speciesMenuState->selectedSpeciesGenderRatio)) {
appState->currentScreenInstruction = 10;
gender = appState->unk_B74.gender;
gender = appState->depositRequirements.gender;
} else {
appState->currentScreenInstruction = 7;
gender = GENDER_NONE + 1;
}
GTSDeposit_DrawWantedCriteria(appState->gtsMessageLoader, appState->speciesMessageLoader, appState->stringTemplate, &appState->infoWindows[0], appState->unk_B74.species, gender, -1);
GTSDeposit_DrawWantedCriteria(appState->gtsMessageLoader, appState->speciesMessageLoader, appState->stringTemplate, &appState->infoWindows[0], appState->depositRequirements.species, gender, -1);
GTS_SaveTabScrollState(&appState->charpadScrollState, appState->speciesMenuState->charpadScrollPos + appState->speciesMenuState->charpadCursorPos, appState->speciesMenuState->speciesListScrollPos, appState->speciesMenuState->speciesListCursorPos);
break;
}
@@ -643,7 +643,7 @@ static int GTSDeposit_ShowGenderPrompt(GTSApplicationState *appState)
static int GTSDeposit_ShowGenderMenu(GTSApplicationState *appState)
{
appState->unk_10D8 = GTS_CreateGenderMenu(&appState->unk_10CC, &appState->menuButtonWindows[0], appState->gtsMessageLoader);
appState->activeListMenu = GTS_CreateGenderMenu(&appState->menuStringList, &appState->menuButtonWindows[0], appState->gtsMessageLoader);
appState->listMenuCursorIndex = 0xffff;
appState->currentScreenInstruction = 9;
@@ -654,10 +654,10 @@ static int GTSDeposit_HandleGenderInput(GTSApplicationState *appState)
{
u32 input;
switch (input = GTS_ProcessListMenuInput(appState->unk_10D8, &appState->listMenuCursorIndex)) {
switch (input = GTS_ProcessListMenuInput(appState->activeListMenu, &appState->listMenuCursorIndex)) {
case MENU_CANCEL:
ListMenu_Free(appState->unk_10D8, NULL, NULL);
StringList_Free(appState->unk_10CC);
ListMenu_Free(appState->activeListMenu, NULL, NULL);
StringList_Free(appState->menuStringList);
Window_EraseStandardFrame(&appState->menuButtonWindows[0], 0);
Window_EraseMessageBox(&appState->bottomInstructionWindow, 0);
Window_Remove(&appState->menuButtonWindows[0]);
@@ -668,14 +668,14 @@ static int GTSDeposit_HandleGenderInput(GTSApplicationState *appState)
case GENDER_MALE:
case GENDER_FEMALE:
case GENDER_NONE:
ListMenu_Free(appState->unk_10D8, NULL, NULL);
StringList_Free(appState->unk_10CC);
ListMenu_Free(appState->activeListMenu, NULL, NULL);
StringList_Free(appState->menuStringList);
Window_EraseStandardFrame(&appState->menuButtonWindows[0], 0);
Window_Remove(&appState->menuButtonWindows[0]);
Sound_PlayEffect(SEQ_SE_CONFIRM);
appState->unk_B74.gender = input + 1;
appState->depositRequirements.gender = input + 1;
appState->currentScreenInstruction = 10;
GTSDeposit_DrawWantedCriteria(appState->gtsMessageLoader, appState->speciesMessageLoader, appState->stringTemplate, &appState->infoWindows[0], appState->unk_B74.species, appState->unk_B74.gender, -1);
GTSDeposit_DrawWantedCriteria(appState->gtsMessageLoader, appState->speciesMessageLoader, appState->stringTemplate, &appState->infoWindows[0], appState->depositRequirements.species, appState->depositRequirements.gender, -1);
break;
}
@@ -695,7 +695,7 @@ static int GTSDeposit_ShowLevelPrompt(GTSApplicationState *appState)
static int GTSDeposit_ShowLevelMenu(GTSApplicationState *appState)
{
appState->unk_10D8 = GTS_CreateLevelMenu(&appState->unk_10CC, &appState->menuButtonWindows[0], appState->gtsMessageLoader, 0);
appState->activeListMenu = GTS_CreateLevelMenu(&appState->menuStringList, &appState->menuButtonWindows[0], appState->gtsMessageLoader, 0);
appState->listMenuCursorIndex = 0xffff;
appState->currentScreenInstruction = 12;
@@ -706,19 +706,19 @@ static int GTSDeposit_HandleLevelInput(GTSApplicationState *appState)
{
u32 input;
switch (input = GTS_ProcessListMenuInput(appState->unk_10D8, &appState->listMenuCursorIndex)) {
switch (input = GTS_ProcessListMenuInput(appState->activeListMenu, &appState->listMenuCursorIndex)) {
case MENU_NOTHING_CHOSEN:
break;
case MENU_CANCEL:
case NELEMS(gtsLevelPreferenceMessages) - 1:
ListMenu_Free(appState->unk_10D8, NULL, NULL);
StringList_Free(appState->unk_10CC);
ListMenu_Free(appState->activeListMenu, NULL, NULL);
StringList_Free(appState->menuStringList);
Window_EraseStandardFrame(&appState->menuButtonWindows[0], 0);
Window_EraseMessageBox(&appState->bottomInstructionWindow, 0);
Window_Remove(&appState->menuButtonWindows[0]);
Sound_PlayEffect(SEQ_SE_CONFIRM);
if (GTSDeposit_TryAutoSetGender(&appState->unk_B74, appState->speciesMenuState->selectedSpeciesGenderRatio)) {
if (GTSDeposit_TryAutoSetGender(&appState->depositRequirements, appState->speciesMenuState->selectedSpeciesGenderRatio)) {
appState->currentScreenInstruction = 0;
} else {
appState->currentScreenInstruction = 7;
@@ -726,13 +726,13 @@ static int GTSDeposit_HandleLevelInput(GTSApplicationState *appState)
break;
default:
Sound_PlayEffect(SEQ_SE_CONFIRM);
ListMenu_Free(appState->unk_10D8, NULL, NULL);
StringList_Free(appState->unk_10CC);
ListMenu_Free(appState->activeListMenu, NULL, NULL);
StringList_Free(appState->menuStringList);
Window_EraseStandardFrame(&appState->menuButtonWindows[0], 0);
Window_Remove(&appState->menuButtonWindows[0]);
GTS_SetLevelRequirement(&appState->unk_B74, input, 0);
GTS_SetLevelRequirement(&appState->depositRequirements, input, 0);
appState->currentScreenInstruction = 13;
GTSDeposit_DrawWantedCriteria(appState->gtsMessageLoader, appState->speciesMessageLoader, appState->stringTemplate, &appState->infoWindows[0], appState->unk_B74.species, appState->unk_B74.gender, GTS_FindLevelMessageIndex(appState->unk_B74.level, appState->unk_B74.level2, 0));
GTSDeposit_DrawWantedCriteria(appState->gtsMessageLoader, appState->speciesMessageLoader, appState->stringTemplate, &appState->infoWindows[0], appState->depositRequirements.species, appState->depositRequirements.gender, GTS_FindLevelMessageIndex(appState->depositRequirements.level, appState->depositRequirements.level2, 0));
break;
}
@@ -806,7 +806,7 @@ void GTSDeposit_DrawSpeciesText(Window *window, MessageLoader *speciesMessageLoa
{
if (messageId != 0) {
String *string = MessageLoader_GetNewString(speciesMessageLoader, messageId);
ov94_02245900(window, string, 0, y, centered, textColor);
Window_DrawAlignedSystemText(window, string, 0, y, centered, textColor);
String_Free(string);
}
}
@@ -817,11 +817,11 @@ void GTSDeposit_DrawCountryText(Window *window, MessageLoader *countryMessageLoa
if (messageId != 0) {
string = MessageLoader_GetNewString(countryMessageLoader, messageId);
ov94_02245900(window, string, 0, y, centered, textColor);
Window_DrawAlignedSystemText(window, string, 0, y, centered, textColor);
String_Free(string);
} else {
string = MessageLoader_GetNewString(gtsMessageLoader, GTS_Text_Any);
ov94_02245900(window, string, 0, y, centered, textColor);
Window_DrawAlignedSystemText(window, string, 0, y, centered, textColor);
String_Free(string);
}
}
@@ -853,9 +853,9 @@ void GTSDeposit_DrawGenderText(Window *window, MessageLoader *gtsMessageLoader,
String *string = MessageLoader_GetNewString(gtsMessageLoader, gGTSGenderPreferenceMessages[gender]);
if (x > 3) {
ov94_02245900(window, string, x, y, 0, GTSDeposit_GetGenderTextColor(gender, fallback));
Window_DrawAlignedSystemText(window, string, x, y, 0, GTSDeposit_GetGenderTextColor(gender, fallback));
} else {
ov94_02245900(window, string, 0, y, x, GTSDeposit_GetGenderTextColor(gender, fallback));
Window_DrawAlignedSystemText(window, string, 0, y, x, GTSDeposit_GetGenderTextColor(gender, fallback));
}
String_Free(string);
@@ -872,7 +872,7 @@ void GTSDeposit_DrawLevelText(Window *window, MessageLoader *gtsMessageLoader, i
}
String *string = MessageLoader_GetNewString(gtsMessageLoader, messages[messageIndex].messageId);
ov94_02245900(window, string, x, y, centered, textColor);
Window_DrawAlignedSystemText(window, string, x, y, centered, textColor);
String_Free(string);
}
}
@@ -885,7 +885,7 @@ void GTSDeposit_DrawLevelTextAtOrigin(Window *window, MessageLoader *gtsMessageL
void GTSDeposit_DrawWantedCriteria(MessageLoader *gtsMessageLoader, MessageLoader *speciesMessageLoader, StringTemplate *unused, Window windows[], int species, int gender, int levelRange)
{
String *string = MessageLoader_GetNewString(gtsMessageLoader, GTS_Text_Setup_Wanted);
ov94_02245900(&windows[0], string, 0, 0, 0, TEXT_COLOR(15, 2, 0));
Window_DrawAlignedSystemText(&windows[0], string, 0, 0, 0, TEXT_COLOR(15, 2, 0));
for (int i = 1; i < 3; i++) {
Window_FillTilemap(&windows[i], 0x0);
@@ -904,7 +904,7 @@ void GTSDeposit_DrawWantedCriteria(MessageLoader *gtsMessageLoader, MessageLoade
void GTS_DrawWantedCriteria(MessageLoader *gtsMessageLoader, MessageLoader *speciesMessageLoader, StringTemplate *unused, Window windows[], int species, int gender, int levelRange)
{
String *string = MessageLoader_GetNewString(gtsMessageLoader, GTS_Text_Setup_Wanted);
ov94_02245900(&windows[0], string, 0, 0, 0, TEXT_COLOR(15, 2, 0));
Window_DrawAlignedSystemText(&windows[0], string, 0, 0, 0, TEXT_COLOR(15, 2, 0));
for (int i = 1; i < 3; i++) {
Window_FillTilemap(&windows[i], 0x0);
@@ -943,12 +943,12 @@ static void GTSDeposit_DrawOfferedPokemon(MessageLoader *gtsMessageLoader, Strin
Window_FillTilemap(&windows[i], 0x0);
}
ov94_02245900(&windows[0], offerString, 0, 0, 0, TEXT_COLOR(15, 2, 0));
ov94_02245900(&windows[1], nicknameString, 0, 0, 0, TEXT_COLOR(15, 2, 0));
ov94_02245900(&windows[2], levelString, 0, 0, 2, TEXT_COLOR(15, 2, 0));
Window_DrawAlignedSystemText(&windows[0], offerString, 0, 0, 0, TEXT_COLOR(15, 2, 0));
Window_DrawAlignedSystemText(&windows[1], nicknameString, 0, 0, 0, TEXT_COLOR(15, 2, 0));
Window_DrawAlignedSystemText(&windows[2], levelString, 0, 0, 2, TEXT_COLOR(15, 2, 0));
if (gender != GENDER_NONE + 1) {
ov94_02245900(&windows[1], genderString, 70, 0, 0, sGenderTextColors[gender - 1]);
Window_DrawAlignedSystemText(&windows[1], genderString, 70, 0, 0, sGenderTextColors[gender - 1]);
}
criteria->species = BoxPokemon_GetValue(boxMon, MON_DATA_SPECIES, NULL);
@@ -994,22 +994,22 @@ u8 *GTS_LoadNationalDexLookup(enum HeapID heapID)
void GTS_FillListing(GTSPokemonListing *listing, GTSApplicationState *appState)
{
if (GTSApplication_IsBoxIDParty(appState->selectedBoxId)) {
Pokemon_SetShayminForm((Pokemon *)(appState->unk_114), SHAYMIN_FORM_LAND);
Pokemon_SetShayminForm((Pokemon *)(appState->selectedBoxMon), SHAYMIN_FORM_LAND);
MI_CpuCopyFast(appState->unk_114, listing->pokemon.bytes, Pokemon_StructSize());
MI_CpuCopyFast(appState->selectedBoxMon, listing->pokemon.bytes, Pokemon_StructSize());
} else {
BoxPokemon_SetShayminForm(appState->unk_114, SHAYMIN_FORM_LAND);
Pokemon_FromBoxPokemon(appState->unk_114, (Pokemon *)listing->pokemon.bytes);
BoxPokemon_SetShayminForm(appState->selectedBoxMon, SHAYMIN_FORM_LAND);
Pokemon_FromBoxPokemon(appState->selectedBoxMon, (Pokemon *)listing->pokemon.bytes);
}
CharCode_CopyNumChars(listing->trainerNames, TrainerInfo_Name(appState->playerData->trainerInfo), 8);
listing->unk_11C = TrainerInfo_ID_LowHalf(appState->playerData->trainerInfo);
listing->trainerId = TrainerInfo_ID_LowHalf(appState->playerData->trainerInfo);
listing->trainerCountry = WiFiHistory_GetCountry(appState->playerData->wiFiHistory);
listing->trainerRegion = WiFiHistory_GetRegion(appState->playerData->wiFiHistory);
listing->unk_120 = TrainerInfo_Appearance(appState->playerData->trainerInfo);
listing->unk_F6 = TrainerInfo_Gender(appState->playerData->trainerInfo);
listing->unk_122 = GAME_VERSION;
listing->trainerAppearance = TrainerInfo_Appearance(appState->playerData->trainerInfo);
listing->trainerGender = TrainerInfo_Gender(appState->playerData->trainerInfo);
listing->gameVersion = GAME_VERSION;
listing->trainerLanguage = GAME_LANGUAGE;
}
@@ -1017,8 +1017,8 @@ static void GTSDeposit_FillDepositListing(GTSPokemonListing *listing, GTSApplica
{
GTS_FillListing(listing, appState);
listing->criteria = appState->unk_B70;
listing->requirements = appState->unk_B74;
listing->criteria = appState->offeredPokemonCriteria;
listing->requirements = appState->depositRequirements;
}
static const ListMenuTemplate sCharpadListMenuTemplate = {

View File

@@ -378,17 +378,17 @@ static int GTSListing_ShowActionMenu(GTSApplicationState *appState)
template.suppressCursor = FALSE;
template.loopAround = FALSE;
appState->unk_10CC = StringList_New(2, HEAP_ID_62);
appState->menuStringList = StringList_New(2, HEAP_ID_62);
StringList_AddFromMessageBank(appState->unk_10CC, appState->gtsMessageLoader, GTS_Text_MenuOption_TakeBack, 1);
StringList_AddFromMessageBank(appState->unk_10CC, appState->gtsMessageLoader, GTS_Text_MenuOption_LeaveAsIs, 2);
StringList_AddFromMessageBank(appState->menuStringList, appState->gtsMessageLoader, GTS_Text_MenuOption_TakeBack, 1);
StringList_AddFromMessageBank(appState->menuStringList, appState->gtsMessageLoader, GTS_Text_MenuOption_LeaveAsIs, 2);
template.choices = appState->unk_10CC;
template.choices = appState->menuStringList;
template.window = &appState->menuButtonWindows[0];
Window_DrawStandardFrame(&appState->menuButtonWindows[0], 0, 1 + (18 + 12), 11);
appState->unk_10D4 = Menu_NewAndCopyToVRAM(&template, 9, 0, 0, 62, PAD_BUTTON_B);
appState->popupMenu = Menu_NewAndCopyToVRAM(&template, 9, 0, 0, 62, PAD_BUTTON_B);
appState->currentScreenInstruction = 8;
return 3;
@@ -396,10 +396,10 @@ static int GTSListing_ShowActionMenu(GTSApplicationState *appState)
static int GTSListing_HandleActionMenu(GTSApplicationState *appState)
{
switch (Menu_ProcessInput(appState->unk_10D4)) {
switch (Menu_ProcessInput(appState->popupMenu)) {
case 1: // take back
Menu_Free(appState->unk_10D4, NULL);
StringList_Free(appState->unk_10CC);
Menu_Free(appState->popupMenu, NULL);
StringList_Free(appState->menuStringList);
Window_EraseStandardFrame(&appState->menuButtonWindows[0], 0);
Pokemon *mon = (Pokemon *)appState->receivedListing.pokemon.bytes;
@@ -418,8 +418,8 @@ static int GTSListing_HandleActionMenu(GTSApplicationState *appState)
break;
case 2: // leave as is
case MENU_CANCEL:
Menu_Free(appState->unk_10D4, NULL);
StringList_Free(appState->unk_10CC);
Menu_Free(appState->popupMenu, NULL);
StringList_Free(appState->menuStringList);
Window_EraseStandardFrame(&appState->menuButtonWindows[0], 0);
appState->currentScreenInstruction = 2;
@@ -503,16 +503,16 @@ void GTS_DrawOfferedPokemonInfo(MessageLoader *msgLoader, MessageLoader *species
Window_FillTilemap(&windows[i], 0x0);
}
ov94_02245900(&windows[0], nickname, 0, 0, 0, TEXT_COLOR(15, 2, 0));
Window_DrawAlignedSystemText(&windows[0], nickname, 0, 0, 0, TEXT_COLOR(15, 2, 0));
if (gender != GENDER_NONE + 1) {
ov94_02245900(&windows[0], genderStr, 70, 0, 0, sGenderTextColors[gender]);
Window_DrawAlignedSystemText(&windows[0], genderStr, 70, 0, 0, sGenderTextColors[gender]);
}
ov94_02245900(&windows[1], speciesNameStr, 0, 0, 0, TEXT_COLOR(15, 2, 0));
ov94_02245900(&windows[2], levelStr, 0, 0, 0, TEXT_COLOR(15, 2, 0));
ov94_02245900(&windows[3], itemLabelStr, 0, 0, 0, TEXT_COLOR(15, 2, 0));
ov94_02245900(&windows[4], itemName, 0, 0, 0, TEXT_COLOR(15, 2, 0));
Window_DrawAlignedSystemText(&windows[1], speciesNameStr, 0, 0, 0, TEXT_COLOR(15, 2, 0));
Window_DrawAlignedSystemText(&windows[2], levelStr, 0, 0, 0, TEXT_COLOR(15, 2, 0));
Window_DrawAlignedSystemText(&windows[3], itemLabelStr, 0, 0, 0, TEXT_COLOR(15, 2, 0));
Window_DrawAlignedSystemText(&windows[4], itemName, 0, 0, 0, TEXT_COLOR(15, 2, 0));
String_Free(itemLabelStr);
String_Free(itemName);
@@ -535,10 +535,10 @@ void GTS_DrawTrainerInfo(MessageLoader *msgLoader, Window trainerNameWindows[],
otNameLabelStr = MessageLoader_GetNewString(msgLoader, pl_msg_00000671_00172);
Pokemon_GetValue(mon, MON_DATA_OT_NAME_STRING, otNameStr);
ov94_02245900(&trainerNameWindows[0], trainerNameLabelStr, 0, 0, 0, TEXT_COLOR(15, 2, 0));
ov94_02245900(&trainerNameWindows[1], trainerNameStr, 0, 0, 0, TEXT_COLOR(15, 2, 0));
ov94_02245900(&otNameWindows[0], otNameLabelStr, 0, 0, 0, TEXT_COLOR(15, 2, 0));
ov94_02245900(&otNameWindows[1], otNameStr, 0, 0, 0, TEXT_COLOR(15, 2, 0));
Window_DrawAlignedSystemText(&trainerNameWindows[0], trainerNameLabelStr, 0, 0, 0, TEXT_COLOR(15, 2, 0));
Window_DrawAlignedSystemText(&trainerNameWindows[1], trainerNameStr, 0, 0, 0, TEXT_COLOR(15, 2, 0));
Window_DrawAlignedSystemText(&otNameWindows[0], otNameLabelStr, 0, 0, 0, TEXT_COLOR(15, 2, 0));
Window_DrawAlignedSystemText(&otNameWindows[1], otNameStr, 0, 0, 0, TEXT_COLOR(15, 2, 0));
String_Free(trainerNameLabelStr);
String_Free(trainerNameStr);

View File

@@ -82,7 +82,7 @@ int GTSApplication_MainMenu_Init(GTSApplicationState *appState, int unused1)
GTSMainMenu_InitGraphics(appState);
GTSMainMenu_InitMenu(appState);
GTSMainMenu_InitCursor(appState);
ov94_02245934(appState);
GTSApplication_InitNetworkIcon(appState);
GTSMainMenu_RenderMenuButtons(appState);
Sound_SetSceneAndPlayBGM(SOUND_SCENE_23, SEQ_BLD_BLD_GTC, 1);

View File

@@ -167,7 +167,7 @@ int GTSApplication_NetworkHandler_Init(GTSApplicationState *appState, int unused
GTSNetworkHandler_InitWindows(appState);
StartScreenFade(FADE_MAIN_ONLY, FADE_TYPE_BRIGHTNESS_IN, FADE_TYPE_BRIGHTNESS_IN, COLOR_BLACK, 6, 1, HEAP_ID_62);
ov94_02245934(appState);
GTSApplication_InitNetworkIcon(appState);
appState->currentScreenInstruction = GTS_NETHANDLER_PARSE_SCREEN_ARGUMENT;
@@ -611,7 +611,7 @@ static int GTSNetworkHandler_ExchangeRequest(GTSApplicationState *appState)
{
Pokemon_ClearBallCapsuleData((Pokemon *)appState->receivedListing.pokemon.bytes);
GTSNetworking_Exchange(appState->searchResults[appState->selectedSearchResult].unk_108, &appState->receivedListing, &appState->selectedListing);
GTSNetworking_Exchange(appState->searchResults[appState->selectedSearchResult].listingId, &appState->receivedListing, &appState->selectedListing);
GTSNetworkHandler_SetSaveInstructions(appState, GTS_NETHANDLER_EXCHANGE_FINISH_REQUEST, GTS_NETHANDLER_GO_TO_TRADE_DEPOSIT);
appState->currentScreenInstruction = GTS_NETHANDLER_EXCHANGE_RESPONSE;
@@ -1362,7 +1362,7 @@ static void GTSNetworkHandler_LogTradeInJournal(JournalEntry *journalEntry, GTSP
Pokemon *mon = (Pokemon *)listing->pokemon.bytes;
Pokemon_GetValue(mon, MON_DATA_NICKNAME, nickname);
journalEntryOnlineEvent = JournalEntry_CreateEventGotPokemonGTS(listing->trainerNames, listing->unk_F6, nickname, Pokemon_GetGender(mon), 62);
journalEntryOnlineEvent = JournalEntry_CreateEventGotPokemonGTS(listing->trainerNames, listing->trainerGender, nickname, Pokemon_GetGender(mon), 62);
JournalEntry_SaveData(journalEntry, journalEntryOnlineEvent, JOURNAL_ONLINE_EVENT);
}

View File

@@ -316,7 +316,7 @@ static void GTSSearch_InitWindows(GTSApplicationState *appState)
Window_Add(appState->bgConfig, &appState->titleWindow, 0, 1, 1, 28, 2, 13, (1 + (18 + 12)) + 9);
Window_FillTilemap(&appState->titleWindow, 0x0);
ov94_022458CC(&appState->titleWindow, appState->title, 0, 1, 0, TEXT_COLOR(15, 13, 0));
Window_DrawAlignedMessageText(&appState->titleWindow, appState->title, 0, 1, 0, TEXT_COLOR(15, 13, 0));
Window_Add(appState->bgConfig, &appState->bottomInstructionWindow, 0, 2, 21, 27, 2, 13, ((1 + (18 + 12)) + 9) + 28 * 2);
Window_FillTilemap(&appState->bottomInstructionWindow, 0x0);
@@ -514,7 +514,7 @@ static int GTSSearch_SendSearchRequest(GTSApplicationState *appState)
request.gender = appState->searchRequirements.gender;
request.level = appState->searchRequirements.level;
request.level2 = appState->searchRequirements.level2;
request.unk_05 = appState->searchRequirements.unk_05;
request.unk_05 = appState->searchRequirements.unset_05;
request.count = maxResults;
request.countryIndex = appState->selectedCountryIndex;
@@ -722,7 +722,7 @@ static int GTSSearch_ShowSpeciesSearchPrompt(GTSApplicationState *appState)
static int GTSSearch_CreateCharpad(GTSApplicationState *appState)
{
appState->unk_10D8 = GTS_CreateCharpadMenu(appState, &appState->unk_10CC, &appState->menuButtonWindows[0], appState->gtsMessageLoader);
appState->activeListMenu = GTS_CreateCharpadMenu(appState, &appState->menuStringList, &appState->menuButtonWindows[0], appState->gtsMessageLoader);
appState->listMenuCursorIndex = 0xffff;
appState->currentScreenInstruction = GTS_SEARCH_HANDLE_CHARPAD_INPUT;
@@ -731,7 +731,7 @@ static int GTSSearch_CreateCharpad(GTSApplicationState *appState)
static int GTSSearch_HandleCharpadInput(GTSApplicationState *appState)
{
switch (GTS_ProcessListMenuInput(appState->unk_10D8, &appState->listMenuCursorIndex)) {
switch (GTS_ProcessListMenuInput(appState->activeListMenu, &appState->listMenuCursorIndex)) {
case 1:
case 2:
case 3:
@@ -741,14 +741,14 @@ static int GTSSearch_HandleCharpadInput(GTSApplicationState *appState)
case 7:
case 8:
case 9:
ListMenu_Free(appState->unk_10D8, &appState->speciesMenuState->charpadScrollPos, &appState->speciesMenuState->charpadCursorPos);
StringList_Free(appState->unk_10CC);
ListMenu_Free(appState->activeListMenu, &appState->speciesMenuState->charpadScrollPos, &appState->speciesMenuState->charpadCursorPos);
StringList_Free(appState->menuStringList);
Sound_PlayEffect(SEQ_SE_CONFIRM);
appState->currentScreenInstruction = GTS_SEARCH_CREATE_SPECIES_MENU;
break;
case MENU_CANCEL:
ListMenu_Free(appState->unk_10D8, &appState->speciesMenuState->charpadScrollPos, &appState->speciesMenuState->charpadCursorPos);
StringList_Free(appState->unk_10CC);
ListMenu_Free(appState->activeListMenu, &appState->speciesMenuState->charpadScrollPos, &appState->speciesMenuState->charpadCursorPos);
StringList_Free(appState->menuStringList);
Window_EraseStandardFrame(&appState->menuButtonWindows[0], 0);
Window_EraseMessageBox(&appState->bottomInstructionWindow, 0);
Window_Remove(&appState->menuButtonWindows[0]);
@@ -763,7 +763,7 @@ static int GTSSearch_HandleCharpadInput(GTSApplicationState *appState)
static int GTSSearch_CreateSpeciesMenu(GTSApplicationState *appState)
{
appState->unk_10D8 = GTS_CreateSpeciesMenu(appState, &appState->unk_10CC, &appState->menuButtonWindows[1], appState->gtsMessageLoader, appState->speciesMessageLoader, appState->speciesMenuState, appState->playerData->pokedex);
appState->activeListMenu = GTS_CreateSpeciesMenu(appState, &appState->menuStringList, &appState->menuButtonWindows[1], appState->gtsMessageLoader, appState->speciesMessageLoader, appState->speciesMenuState, appState->playerData->pokedex);
appState->listMenuCursorIndex = 0xffff;
appState->currentScreenInstruction = GTS_SEARCH_HANDLE_SPECIES_MENU_INPUT;
@@ -774,20 +774,20 @@ static int GTSSearch_HandleSpeciesMenuInput(GTSApplicationState *appState)
{
u32 result;
switch (result = GTS_ProcessListMenuInput(appState->unk_10D8, &appState->listMenuCursorIndex)) {
switch (result = GTS_ProcessListMenuInput(appState->activeListMenu, &appState->listMenuCursorIndex)) {
case MENU_NOTHING_CHOSEN:
break;
case MENU_CANCEL:
ListMenu_Free(appState->unk_10D8, &appState->speciesMenuState->speciesListScrollPos, &appState->speciesMenuState->speciesListCursorPos);
StringList_Free(appState->unk_10CC);
ListMenu_Free(appState->activeListMenu, &appState->speciesMenuState->speciesListScrollPos, &appState->speciesMenuState->speciesListCursorPos);
StringList_Free(appState->menuStringList);
Window_EraseStandardFrame(&appState->menuButtonWindows[1], 0);
Sound_PlayEffect(SEQ_SE_CONFIRM);
appState->currentScreenInstruction = GTS_SEARCH_CREATE_CHARPAD;
GTS_SaveTabScrollState(&appState->charpadScrollState, appState->speciesMenuState->charpadScrollPos + appState->speciesMenuState->charpadCursorPos, appState->speciesMenuState->speciesListScrollPos, appState->speciesMenuState->speciesListCursorPos);
break;
default:
ListMenu_Free(appState->unk_10D8, &appState->speciesMenuState->speciesListScrollPos, &appState->speciesMenuState->speciesListCursorPos);
StringList_Free(appState->unk_10CC);
ListMenu_Free(appState->activeListMenu, &appState->speciesMenuState->speciesListScrollPos, &appState->speciesMenuState->speciesListCursorPos);
StringList_Free(appState->menuStringList);
Window_EraseStandardFrame(&appState->menuButtonWindows[0], 0);
Window_EraseStandardFrame(&appState->menuButtonWindows[1], 0);
Window_Remove(&appState->menuButtonWindows[0]);
@@ -826,7 +826,7 @@ static int GTSSearch_ShowGenderSearchPrompt(GTSApplicationState *appState)
static int GTSSearch_CreateGenderMenu(GTSApplicationState *appState)
{
appState->unk_10D8 = GTS_CreateGenderMenu(&appState->unk_10CC, &appState->menuButtonWindows[0], appState->gtsMessageLoader);
appState->activeListMenu = GTS_CreateGenderMenu(&appState->menuStringList, &appState->menuButtonWindows[0], appState->gtsMessageLoader);
appState->listMenuCursorIndex = 0xffff;
appState->currentScreenInstruction = GTS_SEARCH_HANDLE_GENDER_MENU_INPUT;
@@ -837,10 +837,10 @@ static int GTSSearch_HandleGenderMenuInput(GTSApplicationState *appState)
{
u32 result;
switch (result = GTS_ProcessListMenuInput(appState->unk_10D8, &appState->listMenuCursorIndex)) {
switch (result = GTS_ProcessListMenuInput(appState->activeListMenu, &appState->listMenuCursorIndex)) {
case MENU_CANCEL:
ListMenu_Free(appState->unk_10D8, NULL, NULL);
StringList_Free(appState->unk_10CC);
ListMenu_Free(appState->activeListMenu, NULL, NULL);
StringList_Free(appState->menuStringList);
Window_EraseStandardFrame(&appState->menuButtonWindows[0], 0);
Window_EraseMessageBox(&appState->bottomInstructionWindow, 0);
Window_Remove(&appState->menuButtonWindows[0]);
@@ -850,8 +850,8 @@ static int GTSSearch_HandleGenderMenuInput(GTSApplicationState *appState)
case 0:
case 1:
case 2:
ListMenu_Free(appState->unk_10D8, NULL, NULL);
StringList_Free(appState->unk_10CC);
ListMenu_Free(appState->activeListMenu, NULL, NULL);
StringList_Free(appState->menuStringList);
Window_EraseStandardFrame(&appState->menuButtonWindows[0], 0);
Window_Remove(&appState->menuButtonWindows[0]);
Sound_PlayEffect(SEQ_SE_CONFIRM);
@@ -880,7 +880,7 @@ static int GTSSearch_ShowLevelSearchPrompt(GTSApplicationState *appState)
static int GTSSearch_CreateLevelMenu(GTSApplicationState *appState)
{
appState->unk_10D8 = GTS_CreateLevelMenu(&appState->unk_10CC, &appState->menuButtonWindows[0], appState->gtsMessageLoader, 1);
appState->activeListMenu = GTS_CreateLevelMenu(&appState->menuStringList, &appState->menuButtonWindows[0], appState->gtsMessageLoader, 1);
appState->listMenuCursorIndex = 0xffff;
appState->currentScreenInstruction = GTS_SEARCH_HANDLE_LEVEL_MENU_INPUT;
@@ -891,13 +891,13 @@ static int GTSSearch_HandleLevelMenuInput(GTSApplicationState *appState)
{
u32 result;
switch (result = GTS_ProcessListMenuInput(appState->unk_10D8, &appState->listMenuCursorIndex)) {
switch (result = GTS_ProcessListMenuInput(appState->activeListMenu, &appState->listMenuCursorIndex)) {
case MENU_NOTHING_CHOSEN:
break;
case MENU_CANCEL:
case 11:
ListMenu_Free(appState->unk_10D8, NULL, NULL);
StringList_Free(appState->unk_10CC);
ListMenu_Free(appState->activeListMenu, NULL, NULL);
StringList_Free(appState->menuStringList);
Window_EraseStandardFrame(&appState->menuButtonWindows[0], 0);
Window_EraseMessageBox(&appState->bottomInstructionWindow, 0);
Window_Remove(&appState->menuButtonWindows[0]);
@@ -905,8 +905,8 @@ static int GTSSearch_HandleLevelMenuInput(GTSApplicationState *appState)
appState->currentScreenInstruction = GTS_SEARCH_SHOW_PROMPT;
break;
default:
ListMenu_Free(appState->unk_10D8, NULL, NULL);
StringList_Free(appState->unk_10CC);
ListMenu_Free(appState->activeListMenu, NULL, NULL);
StringList_Free(appState->menuStringList);
Window_EraseStandardFrame(&appState->menuButtonWindows[0], 0);
Window_Remove(&appState->menuButtonWindows[0]);
Sound_PlayEffect(SEQ_SE_CONFIRM);
@@ -935,7 +935,7 @@ static int GTSSearch_ShowCountrySearchPrompt(GTSApplicationState *appState)
static int GTSSearch_CreateCountryMenu(GTSApplicationState *appState)
{
appState->unk_10D8 = GTS_CreateCountryMenu(&appState->unk_10CC, &appState->menuButtonWindows[0], appState->countryMessageLoader, appState->gtsMessageLoader);
appState->activeListMenu = GTS_CreateCountryMenu(&appState->menuStringList, &appState->menuButtonWindows[0], appState->countryMessageLoader, appState->gtsMessageLoader);
appState->listMenuCursorIndex = 0xffff;
appState->currentScreenInstruction = GTS_SEARCH_HANDLE_COUNTRY_MENU_INPUT;
@@ -944,21 +944,21 @@ static int GTSSearch_CreateCountryMenu(GTSApplicationState *appState)
static int GTSSearch_HandleCountryMenuInput(GTSApplicationState *appState)
{
u32 result = GTS_ProcessListMenuInput(appState->unk_10D8, &appState->listMenuCursorIndex);
u32 result = GTS_ProcessListMenuInput(appState->activeListMenu, &appState->listMenuCursorIndex);
if (result == MENU_NOTHING_CHOSEN) {
(void)0;
} else if ((result == MENU_CANCEL) || (result == (gGTSAvailableCountryCount + 1))) {
ListMenu_Free(appState->unk_10D8, NULL, NULL);
StringList_Free(appState->unk_10CC);
ListMenu_Free(appState->activeListMenu, NULL, NULL);
StringList_Free(appState->menuStringList);
Window_EraseStandardFrame(&appState->menuButtonWindows[0], 0);
Window_EraseMessageBox(&appState->bottomInstructionWindow, 0);
Window_Remove(&appState->menuButtonWindows[0]);
Sound_PlayEffect(SEQ_SE_CONFIRM);
appState->currentScreenInstruction = GTS_SEARCH_SHOW_PROMPT;
} else {
ListMenu_Free(appState->unk_10D8, NULL, NULL);
StringList_Free(appState->unk_10CC);
ListMenu_Free(appState->activeListMenu, NULL, NULL);
StringList_Free(appState->menuStringList);
Window_EraseStandardFrame(&appState->menuButtonWindows[0], 0);
Window_Remove(&appState->menuButtonWindows[0]);
Sound_PlayEffect(SEQ_SE_CONFIRM);
@@ -1049,32 +1049,32 @@ static void GTSSearch_DrawCriteriaLabels(Window *criteriaWindows, Window *locati
String *str1, *str2, *str3;
str1 = MessageLoader_GetNewString(gtsMessageLoader, GTS_Text_Criteria_Pokemon);
ov94_02245900(&criteriaWindows[0], str1, 0, 0, 0, TEXT_COLOR(15, 2, 0));
Window_DrawAlignedSystemText(&criteriaWindows[0], str1, 0, 0, 0, TEXT_COLOR(15, 2, 0));
String_Free(str1);
str3 = MessageLoader_GetNewString(gtsMessageLoader, GTS_Text_Criteria_Gender);
ov94_02245900(&criteriaWindows[2], str3, 0, 0, 0, TEXT_COLOR(15, 2, 0));
Window_DrawAlignedSystemText(&criteriaWindows[2], str3, 0, 0, 0, TEXT_COLOR(15, 2, 0));
String_Free(str3);
str2 = MessageLoader_GetNewString(gtsMessageLoader, GTS_Text_Criteria_Level);
ov94_02245900(&criteriaWindows[4], str2, 0, 0, 0, TEXT_COLOR(15, 2, 0));
Window_DrawAlignedSystemText(&criteriaWindows[4], str2, 0, 0, 0, TEXT_COLOR(15, 2, 0));
String_Free(str2);
str2 = MessageLoader_GetNewString(gtsMessageLoader, GTS_Text_Criteria_Location);
ov94_02245900(&locationWindows[0], str2, 0, 0, 0, TEXT_COLOR(15, 2, 0));
Window_DrawAlignedSystemText(&locationWindows[0], str2, 0, 0, 0, TEXT_COLOR(15, 2, 0));
String_Free(str2);
str1 = MessageLoader_GetNewString(gtsMessageLoader, GTS_Text_Criteria_Search);
int x1 = Font_CalcCenterAlignment(FONT_SYSTEM, str1, 0, criteriaWindows[6].width * 8);
ov94_02245900(&criteriaWindows[6], str1, x1, 0, 0, TEXT_COLOR(1, 2, 0));
Window_DrawAlignedSystemText(&criteriaWindows[6], str1, x1, 0, 0, TEXT_COLOR(1, 2, 0));
String_Free(str1);
str1 = MessageLoader_GetNewString(gtsMessageLoader, GTS_Text_Criteria_Back);
int x2 = Font_CalcCenterAlignment(FONT_SYSTEM, str1, 0, criteriaWindows[7].width * 8);
ov94_02245900(&criteriaWindows[7], str1, x2, 0, 0, TEXT_COLOR(1, 2, 0));
Window_DrawAlignedSystemText(&criteriaWindows[7], str1, x2, 0, 0, TEXT_COLOR(1, 2, 0));
String_Free(str1);
}

View File

@@ -234,9 +234,9 @@ static const int sWindowLayouts[][4] = {
static void GTSSearchListing_InitWindows(GTSApplicationState *appState)
{
Window_Add(appState->bgConfig, &appState->bottomInstructionWindow, 0, 2, 21, 27, 2, 13, (1 + (18 + 12) + 9));
Window_Add(appState->bgConfig, &appState->bottomInstructionWindow, 0, 2, 21, 27, 2, 13, 1 + (18 + 12) + 9);
Window_FillTilemap(&appState->bottomInstructionWindow, 0x0);
Window_Add(appState->bgConfig, &appState->menuButtonWindows[0], 0, 21, 15, (5 * 2), 4, 13, ((1 + (18 + 12)) + 9) + 27 * 2);
Window_Add(appState->bgConfig, &appState->menuButtonWindows[0], 0, 21, 15, 5 * 2, 4, 13, ((1 + (18 + 12)) + 9) + 27 * 2);
int baseTile = ((((1 + (18 + 12)) + 9) + 27 * 2) + (5 * 2) * 4);
@@ -409,8 +409,8 @@ static void GTSSearchListing_DrawTabHeaders(MessageLoader *messageLoader, Window
String *wantedHeader = MessageLoader_GetNewString(messageLoader, Gts_Text_WantedPokemon);
String *locationHeader = MessageLoader_GetNewString(messageLoader, Gts_Text_OTLocation);
ov94_02245900(&windows[0], wantedHeader, 0, 2, 0, TEXT_COLOR(15, 2, 0));
ov94_02245900(&windows[1], locationHeader, 0, 2, 1, TEXT_COLOR(15, 2, 0));
Window_DrawAlignedSystemText(&windows[0], wantedHeader, 0, 2, 0, TEXT_COLOR(15, 2, 0));
Window_DrawAlignedSystemText(&windows[1], locationHeader, 0, 2, 1, TEXT_COLOR(15, 2, 0));
String_Free(wantedHeader);
String_Free(locationHeader);
@@ -434,10 +434,10 @@ static void GTSSearchListing_DrawTrainerLocationText(Window *window, String *cou
Window_FillTilemap(window, 0x0);
if (countryString != NULL) {
ov94_02245900(window, countryString, 0, 3, 0, TEXT_COLOR(15, 2, 0));
Window_DrawAlignedSystemText(window, countryString, 0, 3, 0, TEXT_COLOR(15, 2, 0));
}
if (cityString != NULL) {
ov94_02245900(window, cityString, 8, 19, 0, TEXT_COLOR(15, 2, 0));
Window_DrawAlignedSystemText(window, cityString, 8, 19, 0, TEXT_COLOR(15, 2, 0));
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -31,7 +31,7 @@ static const ApplicationManagerTemplate sTradeSequenceConfig = {
FS_OVERLAY_ID(overlay95)
};
int GTSApplication_Trade_Init(GTSApplicationState *appState, int unused1)
int GTSApplication_Trade_Init(GTSApplicationState *appState, int unused)
{
appState->tradeTempPokemon = Pokemon_New(HEAP_ID_62);
@@ -52,7 +52,7 @@ int GTSApplication_Trade_Init(GTSApplicationState *appState, int unused1)
appState->tradeAnimationConfig.background = TRADE_BACKGROUND_WIFI;
appState->tradeAnimationConfig.tradeType = TRADE_TYPE_RECEIVE_ONLY;
break;
case SCREEN_ARGUMENT_10:
case SCREEN_ARGUMENT_10: // probably dead code, doesn't seem to be reached
appState->tradeAnimationConfig.receivingPokemon = Pokemon_GetBoxPokemon((Pokemon *)appState->receivedListing.pokemon.bytes);
GlobalTrade_CopyFromStoredPokemon(appState->playerData->globalTrade, appState->tradeTempPokemon);
appState->tradeAnimationConfig.sendingPokemon = Pokemon_GetBoxPokemon(appState->tradeTempPokemon);
@@ -79,12 +79,12 @@ int GTSApplication_Trade_Init(GTSApplicationState *appState, int unused1)
return GTS_LOOP_STATE_WAIT_FADE;
}
int GTSApplication_Trade_Main(GTSApplicationState *appState, int unused1)
int GTSApplication_Trade_Main(GTSApplicationState *appState, int unused)
{
int loopState = GTS_LOOP_STATE_MAIN;
switch (appState->currentScreenInstruction) {
case 0:
case GTS_TRADE_WAIT_ANIMATION:
if (ApplicationManager_Exec(appState->appMan)) {
ApplicationManager_Free(appState->appMan);
@@ -134,7 +134,7 @@ int GTSApplication_Trade_Main(GTSApplicationState *appState, int unused1)
}
}
break;
case 1:
case GTS_TRADE_WAIT_EVOLUTION:
if (Evolution_IsDone(appState->evolutionData)) {
Evolution_Free(appState->evolutionData);
GTSApplication_Trade_StoreTradedPokemon(appState);
@@ -148,7 +148,7 @@ int GTSApplication_Trade_Main(GTSApplicationState *appState, int unused1)
return loopState;
}
int GTSApplication_Trade_Exit(GTSApplicationState *appState, int unused1)
int GTSApplication_Trade_Exit(GTSApplicationState *appState, int unused)
{
Heap_Free(appState->tradeTempPokemon);
Heap_Free(appState->receivingPokemonTrainer);
@@ -163,7 +163,7 @@ static TrainerInfo *GTSPokemonListing_GetTrainerInfo(GTSPokemonListing *listing)
TrainerInfo_Init(trainerInfo);
TrainerInfo_SetName(trainerInfo, listing->trainerNames);
TrainerInfo_SetGameCode(trainerInfo, listing->unk_122);
TrainerInfo_SetGameCode(trainerInfo, listing->gameVersion);
TrainerInfo_SetLanguage(trainerInfo, listing->trainerLanguage);
return trainerInfo;

File diff suppressed because it is too large Load Diff