mirror of
https://github.com/pret/pokeplatinum.git
synced 2026-10-02 14:31:06 -05:00
Document main menu utils
This commit is contained in:
@@ -32,10 +32,12 @@ enum DSScreen {
|
||||
#define HW_BG_B_PLTT_COLOR(palette, colorIdx) ((GXRgb *)(HW_DB_BG_PLTT + PLTT_OFFSET(palette) + colorIdx * sizeof(GXRgb)))
|
||||
#define HW_OBJ_B_PLTT_COLOR(palette, colorIdx) ((GXRgb *)(HW_DB_OBJ_PLTT + PLTT_OFFSET(palette) + colorIdx * sizeof(GXRgb)))
|
||||
|
||||
#define MON_SPRITE_FRAME_WIDTH_TILES 10
|
||||
#define MON_SPRITE_FRAME_HEIGHT_TILES 10
|
||||
#define MON_SPRITE_FRAME_WIDTH (MON_SPRITE_FRAME_WIDTH_TILES * TILE_WIDTH_PIXELS)
|
||||
#define MON_SPRITE_FRAME_HEIGHT (MON_SPRITE_FRAME_HEIGHT_TILES * TILE_HEIGHT_PIXELS)
|
||||
#define MON_SPRITE_FRAME_WIDTH_TILES 10
|
||||
#define MON_SPRITE_FRAME_HEIGHT_TILES 10
|
||||
#define MON_SPRITE_FRAME_WIDTH (MON_SPRITE_FRAME_WIDTH_TILES * TILE_WIDTH_PIXELS)
|
||||
#define MON_SPRITE_FRAME_HEIGHT (MON_SPRITE_FRAME_HEIGHT_TILES * TILE_HEIGHT_PIXELS)
|
||||
#define MON_SPRITE_FRAME_MAX_SIZE_TILES (MON_SPRITE_FRAME_WIDTH_TILES * MON_SPRITE_FRAME_HEIGHT_TILES)
|
||||
#define MON_SPRITE_FRAME_MAX_SIZE_BYTES (TILE_SIZE_4BPP * MON_SPRITE_FRAME_MAX_SIZE_TILES)
|
||||
|
||||
#define SHADOW_SPRITE_FRAME_WIDTH_TILES 8
|
||||
#define SHADOW_SPRITE_FRAME_HEIGHT_TILES 2
|
||||
@@ -49,6 +51,7 @@ enum DSScreen {
|
||||
|
||||
#define COLOR_BLACK GX_RGB(0, 0, 0)
|
||||
#define COLOR_DARK_GRAY GX_RGB(4, 4, 4)
|
||||
#define COLOR_WHITE GX_RGB(31, 31, 31)
|
||||
#define COLOR_TRANSPARENT GX_RGB(31, 31, 16)
|
||||
|
||||
#endif // POKEPLATINUM_CONSTANTS_GRAPHICS_H
|
||||
|
||||
@@ -99,7 +99,7 @@ enum MysteryGiftType {
|
||||
MYST_GIFT_POKETCH_APP,
|
||||
MYST_GIFT_SECRET_KEY,
|
||||
MYST_GIFT_UNKNOWN,
|
||||
MYST_GIFT_TYPE_MAX = 14,
|
||||
MYST_GIFT_TYPE_MAX,
|
||||
};
|
||||
|
||||
typedef struct MysteryGift {
|
||||
|
||||
@@ -2,49 +2,97 @@
|
||||
#define POKEPLATINUM_OV97_02237694_H
|
||||
|
||||
#include "overlay097/mystery_gift_app.h"
|
||||
#include "overlay097/struct_ov97_02237808.h"
|
||||
#include "overlay097/struct_ov97_02237AEC.h"
|
||||
|
||||
#include "bg_window.h"
|
||||
#include "list_menu.h"
|
||||
#include "mystery_gift.h"
|
||||
#include "overlay_manager.h"
|
||||
#include "palette.h"
|
||||
#include "savedata.h"
|
||||
#include "screen_fade.h"
|
||||
#include "sprite.h"
|
||||
#include "sprite_resource.h"
|
||||
#include "sprite_util.h"
|
||||
|
||||
void ov97_02237694(int heapID);
|
||||
void *ov97_022376C4(ApplicationManager *appMan, int heapID, int param2, int param3);
|
||||
void ov97_022376FC(BgConfig *bgConfig, int bgLayer, u8 param2, u32 param3, u32 param4);
|
||||
void ov97_02237784(int param0);
|
||||
void ov97_02237790(int param0, int param1, int *param2, int param3);
|
||||
void ov97_022377F0(int *param0);
|
||||
void ov97_02237808(UnkStruct_ov97_02237808 *param0, Window *param1, int param2, int param3, int param4, int param5);
|
||||
void ov97_02237858(UnkStruct_ov97_02237808 *param0, int param1, int param2, int param3);
|
||||
void ov97_02237860(UnkStruct_ov97_02237808 *param0, int param1, int param2);
|
||||
void ov97_02237868(UnkStruct_ov97_02237808 *param0, int param1, int param2);
|
||||
int ov97_0223795C(BgConfig *param0, UnkStruct_ov97_02237808 *param1, int param2, int param3, int param4);
|
||||
int ov97_02237A18(UnkStruct_ov97_02237808 *param0);
|
||||
void ov97_02237A20(void);
|
||||
BOOL ov97_02237A60(void);
|
||||
void ov97_02237A74(void);
|
||||
UnkStruct_ov97_02237AEC *ov97_02237AEC(void);
|
||||
void ov97_02237B0C(int param0, int param1, int param2, int param3, int param4, int param5);
|
||||
void ov97_02237C80(fx32 param0, fx32 param1);
|
||||
void ov97_02237CA0(void);
|
||||
void ov97_02237CAC(int param0);
|
||||
Sprite *ov97_02237D14(int param0, Sprite *param1, int param2, int param3, int param4);
|
||||
void ov97_02237DA0(void);
|
||||
u32 ov97_02237E4C(int param0);
|
||||
void ov97_02238194(BgConfig *param0, WonderCard *param1);
|
||||
void ov97_0223829C(MysteryGiftEventData *param0, WonderCard *param1, int heapID);
|
||||
void ov97_02238324(MysteryGiftEventData *param0, WonderCard *param1, int heapID);
|
||||
void ov97_022383C4(ListMenu *param0, u32 param1, u8 param2);
|
||||
void ov97_02238400(BOOL param0);
|
||||
void ov97_02238440(void);
|
||||
void ov97_0223846C(SaveData *saveData);
|
||||
int ov97_0223847C(void);
|
||||
void ov97_022384F4(void);
|
||||
void ov97_0223850C(void);
|
||||
int ov97_02238528(void);
|
||||
enum MainMenuUtilSavingState {
|
||||
MAIN_MENU_UTIL_INIT_SAVING,
|
||||
MAIN_MENU_UTIL_SAVING,
|
||||
MAIN_MENU_UTIL_SAVE_SUCCESS,
|
||||
MAIN_MENU_UTIL_SAVE_FAILURE,
|
||||
MAIN_MENU_UTIL_SAVING_IDLE,
|
||||
};
|
||||
|
||||
typedef struct MainMenuSpriteManager {
|
||||
SpriteList *spriteList;
|
||||
G2dRenderer renderer;
|
||||
SpriteResourceCollection *resourceCollections[SPRITE_RESOURCE_MAX];
|
||||
SpriteResource *resources[DS_SCREEN_MAX][SPRITE_RESOURCE_MAX];
|
||||
SpriteResourcesHeader resourceHeaders[DS_SCREEN_MAX];
|
||||
int unused_220;
|
||||
int unused_224;
|
||||
int unused_228;
|
||||
int unused_22C;
|
||||
int unused_230;
|
||||
int unused_234;
|
||||
} MainMenuSpriteManager;
|
||||
|
||||
typedef struct MainMenuWindow {
|
||||
BOOL scrollable;
|
||||
BOOL drawFrame;
|
||||
BOOL clearBeforePrinting;
|
||||
BOOL textRightAligned;
|
||||
Window *window;
|
||||
StringTemplate *strTemplate;
|
||||
int width;
|
||||
int height;
|
||||
int textXOffset;
|
||||
int textYOffset;
|
||||
int baseTile;
|
||||
enum BgLayer bgLayer;
|
||||
enum Palette textPltt;
|
||||
int textBank;
|
||||
int frameBaseTile;
|
||||
enum Palette framePltt;
|
||||
enum Font font;
|
||||
TextColor textColor;
|
||||
u8 backgroundColorIdx;
|
||||
int textEntryID;
|
||||
int renderDelay;
|
||||
} MainMenuWindow;
|
||||
|
||||
void MainMenuUtil_Init(enum HeapId heapID);
|
||||
void *MainMenuUtil_InitAppAndFadeToBlack(ApplicationManager *appMan, enum HeapId heapID, int appDataSize, enum HeapSize heapSize);
|
||||
void MainMenuUtil_InitBG(BgConfig *bgConfig, enum BgLayer bgLayer, u8 screenSize, u32 screenBase, u32 charBase);
|
||||
void MainMenuUtil_SetFadeToWhite(BOOL enable);
|
||||
void MainMenuUtil_StartScreenFadeToState(enum FadeType fadeType, int destState, int *state, int waitState);
|
||||
void MainMenuUtil_CheckScreenFadeDone(int *state);
|
||||
void MainMenuUtil_InitWindow(MainMenuWindow *mainMenuWindow, Window *window, enum Palette textPalette, enum TextBank textBank, int baseTile, enum Palette framePalette);
|
||||
void MainMenuWindow_SetDimensionsAndBasetile(MainMenuWindow *window, int width, int height, int baseTile);
|
||||
void MainMenuWindow_SetScrollableAndFont(MainMenuWindow *window, BOOL scrollable, enum Font font);
|
||||
void MainMenuWindow_SetTextOffsets(MainMenuWindow *window, int xOffset, int yOffset);
|
||||
int MainMenuUtil_ShowWindowAtPos(BgConfig *param0, MainMenuWindow *window, int xPos, int yPos, int textEntryID);
|
||||
int MainMenuWindow_GetSize(MainMenuWindow *window);
|
||||
void MainMenuUtil_InitCharPlttTransferBuffers(void);
|
||||
BOOL MainMenuUtil_CheckSpriteLoaderInit(void);
|
||||
void MainMenuUtil_InitSpriteLoader(void);
|
||||
MainMenuSpriteManager *MainMenuUtil_GetSpriteManager(void);
|
||||
void MainMenuUtil_LoadSprite(enum NarcID narcID, int tilesID, int plttID, int cellID, int animID, enum DSScreen screen);
|
||||
void MainMenuUtil_SetSubScreenViewRect(fx32 x, fx32 y);
|
||||
void MainMenuUtil_UpdateSpritesSkipGift(void);
|
||||
void MainMenuUtil_UpdateSprites(int skipDrawGift);
|
||||
Sprite *MainMenuUtil_InitSprite(enum DSScreen screen, Sprite *sprite, int x, int y, int animationIdx);
|
||||
void MainMenuUtil_FreeSprites(void);
|
||||
u32 MainMenuUtil_CalcMysteryGiftVersionBit(enum Version version);
|
||||
void MainMenuUtil_LoadGiftSprite(BgConfig *bgConfig, WonderCard *wonderCard);
|
||||
void MainMenuUtil_EncryptWonderCard(MysteryGiftEventData *eventData, WonderCard *wonderCard, enum HeapId heapID);
|
||||
void MainMenuUtil_DecryptReceivedWonderCard(MysteryGiftEventData *param0, WonderCard *param1, enum HeapId heapID);
|
||||
void MainMenuUtil_ListMenuCursorCB(ListMenu *param0, u32 param1, u8 param2);
|
||||
void MainMenuUtil_ToggleTerminateOnGBACartRemoved(BOOL enable);
|
||||
void MainMenuUtil_UnsetGBACartIRQFunc(void);
|
||||
void MainMenuUtil_InitSaving(SaveData *saveData);
|
||||
enum SaveResult MainMenuUtil_SaveState(void);
|
||||
void MainMenuUtil_ContinueSaving(void);
|
||||
void MainMenuUtil_CancelSave(void);
|
||||
int MainMenuUtil_GetSavingStatus(void);
|
||||
|
||||
#endif // POKEPLATINUM_OV97_02237694_H
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
#ifndef POKEPLATINUM_STRUCT_OV97_02237808_H
|
||||
#define POKEPLATINUM_STRUCT_OV97_02237808_H
|
||||
|
||||
#include "bg_window.h"
|
||||
#include "string_template.h"
|
||||
#include "text.h"
|
||||
|
||||
typedef struct {
|
||||
int unk_00;
|
||||
int unk_04;
|
||||
int unk_08;
|
||||
int unk_0C;
|
||||
Window *unk_10;
|
||||
StringTemplate *unk_14;
|
||||
int unk_18;
|
||||
int unk_1C;
|
||||
int unk_20;
|
||||
int unk_24;
|
||||
int unk_28;
|
||||
int unk_2C;
|
||||
int unk_30;
|
||||
int unk_34;
|
||||
int unk_38;
|
||||
int unk_3C;
|
||||
int unk_40;
|
||||
TextColor unk_44;
|
||||
u8 unk_48;
|
||||
int unk_4C;
|
||||
int unk_50;
|
||||
} UnkStruct_ov97_02237808;
|
||||
|
||||
#endif // POKEPLATINUM_STRUCT_OV97_02237808_H
|
||||
@@ -1,22 +0,0 @@
|
||||
#ifndef POKEPLATINUM_STRUCT_OV97_02237AEC_H
|
||||
#define POKEPLATINUM_STRUCT_OV97_02237AEC_H
|
||||
|
||||
#include "sprite.h"
|
||||
#include "sprite_resource.h"
|
||||
#include "sprite_util.h"
|
||||
|
||||
typedef struct {
|
||||
SpriteList *unk_00;
|
||||
G2dRenderer unk_04;
|
||||
SpriteResourceCollection *unk_190[6];
|
||||
SpriteResource *unk_1A8[2][6];
|
||||
SpriteResourcesHeader unk_1D8[2];
|
||||
int unk_220;
|
||||
int unk_224;
|
||||
int unk_228;
|
||||
int unk_22C;
|
||||
int unk_230;
|
||||
int unk_234;
|
||||
} UnkStruct_ov97_02237AEC;
|
||||
|
||||
#endif // POKEPLATINUM_STRUCT_OV97_02237AEC_H
|
||||
@@ -1845,7 +1845,7 @@ static int GBAMigrator_Init(ApplicationManager *appMan, int *state)
|
||||
OS_InitTick();
|
||||
}
|
||||
|
||||
ov97_02238440();
|
||||
MainMenuUtil_UnsetGBACartIRQFunc();
|
||||
Unk_ov97_0223F434 = migrator->unk_E8FC;
|
||||
|
||||
return 1;
|
||||
@@ -2196,7 +2196,7 @@ static int GBAMigrator_Exit(ApplicationManager *appMan, int *state)
|
||||
ApplicationManager_FreeData(appMan);
|
||||
Heap_Destroy(HEAP_ID_MIGRATE_FROM_GBA);
|
||||
|
||||
ov97_02238400(FALSE);
|
||||
MainMenuUtil_ToggleTerminateOnGBACartRemoved(FALSE);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
#include "overlay097/distribution_cartridge.h"
|
||||
#include "overlay097/ov97_02235D18.h"
|
||||
#include "overlay097/ov97_02237694.h"
|
||||
#include "overlay097/struct_ov97_02237808.h"
|
||||
#include "savedata/save_table.h"
|
||||
|
||||
#include "bg_window.h"
|
||||
@@ -234,7 +233,7 @@ typedef struct MainMenuAppData {
|
||||
* Must not set appData->optionApps[option] nor render the option and return
|
||||
* FALSE if it's not available.
|
||||
*/
|
||||
typedef BOOL (*MainMenuOptionRenderFuncPtr)(MainMenuAppData *appData, enum MainMenuOption optionIdx, UnkStruct_ov97_02237808 *, int yPos);
|
||||
typedef BOOL (*MainMenuOptionRenderFuncPtr)(MainMenuAppData *appData, enum MainMenuOption optionIdx, MainMenuWindow *, int yPos);
|
||||
|
||||
typedef struct {
|
||||
enum MainMenuNextApp appToLoad;
|
||||
@@ -243,13 +242,13 @@ typedef struct {
|
||||
MainMenuOptionRenderFuncPtr renderFunc; // If NULL, the option is always always available and simply shows the string indicated by textEntryID in the main menu text bank.
|
||||
} MainMenuOptionTemplate;
|
||||
|
||||
static BOOL RenderContinueOption(MainMenuAppData *appData, enum MainMenuOption option, UnkStruct_ov97_02237808 *param2, int yPos);
|
||||
static BOOL RenderMysteryGiftOption(MainMenuAppData *appData, enum MainMenuOption option, UnkStruct_ov97_02237808 *param2, int yPos);
|
||||
static BOOL RenderRangerLinkOption(MainMenuAppData *appData, enum MainMenuOption option, UnkStruct_ov97_02237808 *param2, int yPos);
|
||||
static BOOL RenderGBAMigrationOption(MainMenuAppData *appData, enum MainMenuOption option, UnkStruct_ov97_02237808 *param2, int yPos);
|
||||
static BOOL RenderWiiConnectionOption(MainMenuAppData *appData, enum MainMenuOption option, UnkStruct_ov97_02237808 *param2, int yPos);
|
||||
static BOOL RenderWFCSettingsOption(MainMenuAppData *appData, enum MainMenuOption option, UnkStruct_ov97_02237808 *param2, int yPos);
|
||||
static BOOL RenderWiiMsgSettingsOption(MainMenuAppData *appData, enum MainMenuOption option, UnkStruct_ov97_02237808 *param2, int yPos);
|
||||
static BOOL RenderContinueOption(MainMenuAppData *appData, enum MainMenuOption option, MainMenuWindow *param2, int yPos);
|
||||
static BOOL RenderMysteryGiftOption(MainMenuAppData *appData, enum MainMenuOption option, MainMenuWindow *param2, int yPos);
|
||||
static BOOL RenderRangerLinkOption(MainMenuAppData *appData, enum MainMenuOption option, MainMenuWindow *param2, int yPos);
|
||||
static BOOL RenderGBAMigrationOption(MainMenuAppData *appData, enum MainMenuOption option, MainMenuWindow *param2, int yPos);
|
||||
static BOOL RenderWiiConnectionOption(MainMenuAppData *appData, enum MainMenuOption option, MainMenuWindow *param2, int yPos);
|
||||
static BOOL RenderWFCSettingsOption(MainMenuAppData *appData, enum MainMenuOption option, MainMenuWindow *param2, int yPos);
|
||||
static BOOL RenderWiiMsgSettingsOption(MainMenuAppData *appData, enum MainMenuOption option, MainMenuWindow *param2, int yPos);
|
||||
|
||||
MysteryGift *SaveData_GetMysteryGift(SaveData *saveData);
|
||||
int TrainerInfo_Size(void);
|
||||
@@ -341,10 +340,10 @@ static BOOL ShowWFCUserInfoErasedMsg(MainMenuAppData *appData)
|
||||
appData->wfcUserInfoErasedMsgPending[i] = FALSE;
|
||||
WFCUserInfoErasedAlertTemplate *alertTemplate = &sWFCUserInfoErasedMsgWindowTemplate[i];
|
||||
|
||||
UnkStruct_ov97_02237808 v2;
|
||||
ov97_02237808(&v2, &appData->wfcUserInfoErasedWindow, PLTT_0, alertTemplate->bankID, 1, PLTT_2);
|
||||
ov97_02237858(&v2, alertTemplate->width, alertTemplate->height, ALERT_WINDOW_CONTENT_BASE_TILE);
|
||||
ov97_0223795C(appData->bgConfig, &v2, alertTemplate->x, alertTemplate->y, alertTemplate->entryID);
|
||||
MainMenuWindow v2;
|
||||
MainMenuUtil_InitWindow(&v2, &appData->wfcUserInfoErasedWindow, PLTT_0, alertTemplate->bankID, 1, PLTT_2);
|
||||
MainMenuWindow_SetDimensionsAndBasetile(&v2, alertTemplate->width, alertTemplate->height, ALERT_WINDOW_CONTENT_BASE_TILE);
|
||||
MainMenuUtil_ShowWindowAtPos(appData->bgConfig, &v2, alertTemplate->x, alertTemplate->y, alertTemplate->entryID);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
@@ -403,7 +402,7 @@ static void DetectGBAGame(MainMenuAppData *appData)
|
||||
|
||||
appData->agbGameType = GBACart_GetAGBGameType() + 1;
|
||||
|
||||
ov97_02238440();
|
||||
MainMenuUtil_UnsetGBACartIRQFunc();
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -492,8 +491,8 @@ static BOOL ShowAlerts(MainMenuAppData *appData)
|
||||
appData->alertsState = MAIN_MANU_ALERTS_STATE_SHOW_NEXT_ALERT;
|
||||
break;
|
||||
case MAIN_MANU_ALERTS_STATE_SHOW_NEXT_ALERT: {
|
||||
UnkStruct_ov97_02237808 v0;
|
||||
ov97_02237808(&v0, &appData->alertWindow, PLTT_0, TEXT_BANK_MAIN_MENU_ALERTS, 1, PLTT_2);
|
||||
MainMenuWindow v0;
|
||||
MainMenuUtil_InitWindow(&v0, &appData->alertWindow, PLTT_0, TEXT_BANK_MAIN_MENU_ALERTS, 1, PLTT_2);
|
||||
|
||||
int pendingAlerts = appData->pendingAlerts & ~appData->shownAlerts;
|
||||
|
||||
@@ -517,12 +516,12 @@ static BOOL ShowAlerts(MainMenuAppData *appData)
|
||||
}
|
||||
|
||||
appData->shownAlerts |= pendingAlerts;
|
||||
ov97_02237858(&v0, alertTemplate->width, alertTemplate->height, ALERT_WINDOW_CONTENT_BASE_TILE);
|
||||
MainMenuWindow_SetDimensionsAndBasetile(&v0, alertTemplate->width, alertTemplate->height, ALERT_WINDOW_CONTENT_BASE_TILE);
|
||||
|
||||
v0.unk_2C = 1;
|
||||
ov97_0223795C(appData->bgConfig, &v0, alertTemplate->x, alertTemplate->y, alertTemplate->textEntryID);
|
||||
v0.bgLayer = 1;
|
||||
MainMenuUtil_ShowWindowAtPos(appData->bgConfig, &v0, alertTemplate->x, alertTemplate->y, alertTemplate->textEntryID);
|
||||
|
||||
Bg_ChangeTilemapRectPalette(appData->bgConfig, BG_LAYER_MAIN_1, Window_GetXPos(v0.unk_10), Window_GetYPos(v0.unk_10), Window_GetWidth(v0.unk_10), Window_GetHeight(v0.unk_10), PLTT_0);
|
||||
Bg_ChangeTilemapRectPalette(appData->bgConfig, BG_LAYER_MAIN_1, Window_GetXPos(v0.window), Window_GetYPos(v0.window), Window_GetWidth(v0.window), Window_GetHeight(v0.window), PLTT_0);
|
||||
GXLayers_EngineAToggleLayers(GX_PLANEMASK_BG0, FALSE);
|
||||
GXLayers_EngineAToggleLayers(GX_PLANEMASK_BG2, FALSE);
|
||||
GXLayers_EngineAToggleLayers(GX_PLANEMASK_BG1, TRUE);
|
||||
@@ -604,15 +603,15 @@ static void InitMainMenuGraphics(MainMenuAppData *appData)
|
||||
GXLayers_SetBanks(&vramBanks);
|
||||
SetAllGraphicsModes(&graphicsModes);
|
||||
|
||||
ov97_022376FC(appData->bgConfig, 0, 2, 0xF000, 0x0);
|
||||
MainMenuUtil_InitBG(appData->bgConfig, 0, 2, 0xF000, 0x0);
|
||||
G2_SetBG0Priority(2);
|
||||
Bg_ClearTilesRange(BG_LAYER_MAIN_0, 32, 0, HEAP_ID_MAIN_MENU);
|
||||
|
||||
ov97_022376FC(appData->bgConfig, 1, 1, 0xD800, 0x8000);
|
||||
MainMenuUtil_InitBG(appData->bgConfig, 1, 1, 0xD800, 0x8000);
|
||||
G2_SetBG1Priority(1);
|
||||
Bg_ClearTilesRange(BG_LAYER_MAIN_1, 32, 0, HEAP_ID_MAIN_MENU);
|
||||
|
||||
ov97_022376FC(appData->bgConfig, 2, 2, 0xE000, 0x0);
|
||||
MainMenuUtil_InitBG(appData->bgConfig, 2, 2, 0xE000, 0x0);
|
||||
G2_SetBG2Priority(0);
|
||||
Bg_ClearTilesRange(BG_LAYER_MAIN_2, 32, 0, HEAP_ID_MAIN_MENU);
|
||||
|
||||
@@ -631,14 +630,14 @@ static void InitMainMenuGraphics(MainMenuAppData *appData)
|
||||
|
||||
static void LoadScrollArrowsSprites(MainMenuAppData *appData)
|
||||
{
|
||||
ov97_02237A20();
|
||||
ov97_02237A74();
|
||||
ov97_02237B0C(NARC_INDEX_GRAPHIC__MYSTERY, 43, 40, 42, 41, 0);
|
||||
MainMenuUtil_InitCharPlttTransferBuffers();
|
||||
MainMenuUtil_InitSpriteLoader();
|
||||
MainMenuUtil_LoadSprite(NARC_INDEX_GRAPHIC__MYSTERY, 43, 40, 42, 41, 0);
|
||||
|
||||
appData->scrollUpArrowSprite = ov97_02237D14(0, appData->scrollUpArrowSprite, HW_LCD_WIDTH / 2, SCROLL_ARROWS_OFFSET, 0);
|
||||
appData->scrollUpArrowSprite = MainMenuUtil_InitSprite(0, appData->scrollUpArrowSprite, HW_LCD_WIDTH / 2, SCROLL_ARROWS_OFFSET, 0);
|
||||
Sprite_SetDrawFlag(appData->scrollUpArrowSprite, FALSE);
|
||||
|
||||
appData->scrollDownArrowSprite = ov97_02237D14(0, appData->scrollDownArrowSprite, HW_LCD_WIDTH / 2, HW_LCD_HEIGHT - SCROLL_ARROWS_OFFSET, 1);
|
||||
appData->scrollDownArrowSprite = MainMenuUtil_InitSprite(0, appData->scrollDownArrowSprite, HW_LCD_WIDTH / 2, HW_LCD_HEIGHT - SCROLL_ARROWS_OFFSET, 1);
|
||||
Sprite_SetDrawFlag(appData->scrollDownArrowSprite, FALSE);
|
||||
}
|
||||
|
||||
@@ -719,7 +718,7 @@ static void SetTemplateNumberCustomFormatting(StringTemplate *strTemplate, int n
|
||||
StringTemplate_SetNumber(strTemplate, 0, number, maxDigits, paddingMode, CHARSET_MODE_EN);
|
||||
}
|
||||
|
||||
static BOOL RenderContinueOption(MainMenuAppData *appData, enum MainMenuOption option, UnkStruct_ov97_02237808 *param2, int yPos)
|
||||
static BOOL RenderContinueOption(MainMenuAppData *appData, enum MainMenuOption option, MainMenuWindow *param2, int yPos)
|
||||
{
|
||||
StringTemplate *strTemplate; // Forward-declaration required to match.
|
||||
|
||||
@@ -733,7 +732,7 @@ static BOOL RenderContinueOption(MainMenuAppData *appData, enum MainMenuOption o
|
||||
textColor = TEXT_COLOR(7, 8, 15);
|
||||
}
|
||||
|
||||
ov97_0223795C(appData->bgConfig, param2, 3, yPos, sOptions[option].textEntryID);
|
||||
MainMenuUtil_ShowWindowAtPos(appData->bgConfig, param2, 3, yPos, sOptions[option].textEntryID);
|
||||
|
||||
// Index 0 has the "Continue" string, which is printed separately
|
||||
for (int i = 1; i < NELEMS(sContinueOptionStringsIDs); i++) {
|
||||
@@ -742,26 +741,26 @@ static BOOL RenderContinueOption(MainMenuAppData *appData, enum MainMenuOption o
|
||||
}
|
||||
|
||||
Strbuf *strBuf = MessageUtil_ExpandedStrbuf(strTemplate, msgLoader, sContinueOptionStringsIDs[i], HEAP_ID_MAIN_MENU);
|
||||
Text_AddPrinterWithParamsAndColor(param2->unk_10, FONT_SYSTEM, strBuf, CONTINUE_WINDOW_MARGIN, TEXT_LINES(i), TEXT_SPEED_NO_TRANSFER, textColor, NULL);
|
||||
Text_AddPrinterWithParamsAndColor(param2->window, FONT_SYSTEM, strBuf, CONTINUE_WINDOW_MARGIN, TEXT_LINES(i), TEXT_SPEED_NO_TRANSFER, textColor, NULL);
|
||||
Strbuf_Free(strBuf);
|
||||
}
|
||||
|
||||
StringTemplate_SetPlayerName(strTemplate, 0, appData->trainerInfo);
|
||||
PrintRightAlignedWithMargin(param2->unk_10, msgLoader, strTemplate, textColor, MainMenuOptions_Text_PlayerName, TEXT_LINES(1));
|
||||
PrintRightAlignedWithMargin(param2->window, msgLoader, strTemplate, textColor, MainMenuOptions_Text_PlayerName, TEXT_LINES(1));
|
||||
|
||||
SetTemplateNumberCustomFormatting(strTemplate, PlayTime_GetHours(appData->playTime));
|
||||
StringTemplate_SetNumber(strTemplate, 1, PlayTime_GetMinutes(appData->playTime), 2, PADDING_MODE_ZEROES, CHARSET_MODE_EN);
|
||||
PrintRightAlignedWithMargin(param2->unk_10, msgLoader, strTemplate, textColor, MainMenuOptions_Text_PlayTime, TEXT_LINES(2));
|
||||
PrintRightAlignedWithMargin(param2->window, msgLoader, strTemplate, textColor, MainMenuOptions_Text_PlayTime, TEXT_LINES(2));
|
||||
|
||||
StringTemplate_SetNumber(strTemplate, 0, appData->badgeCount, 1, PADDING_MODE_NONE, CHARSET_MODE_EN);
|
||||
PrintRightAlignedWithMargin(param2->unk_10, msgLoader, strTemplate, textColor, MainMenuOptions_Text_BadgeCount, TEXT_LINES(3));
|
||||
PrintRightAlignedWithMargin(param2->window, msgLoader, strTemplate, textColor, MainMenuOptions_Text_BadgeCount, TEXT_LINES(3));
|
||||
|
||||
if (appData->pokedexObtained) {
|
||||
SetTemplateNumberCustomFormatting(strTemplate, Pokedex_CountSeen(appData->pokedex));
|
||||
PrintRightAlignedWithMargin(param2->unk_10, msgLoader, strTemplate, textColor, MainMenuOptions_Text_SeenSpeciesCount, TEXT_LINES(4));
|
||||
PrintRightAlignedWithMargin(param2->window, msgLoader, strTemplate, textColor, MainMenuOptions_Text_SeenSpeciesCount, TEXT_LINES(4));
|
||||
}
|
||||
|
||||
Window_DrawStandardFrame(param2->unk_10, FALSE, param2->unk_38, param2->unk_3C);
|
||||
Window_DrawStandardFrame(param2->window, FALSE, param2->frameBaseTile, param2->framePltt);
|
||||
|
||||
appData->optionApps[option] = sOptions[option].appToLoad;
|
||||
|
||||
@@ -771,7 +770,7 @@ static BOOL RenderContinueOption(MainMenuAppData *appData, enum MainMenuOption o
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static BOOL RenderGBAMigrationOption(MainMenuAppData *appData, enum MainMenuOption option, UnkStruct_ov97_02237808 *param2, int yPos)
|
||||
static BOOL RenderGBAMigrationOption(MainMenuAppData *appData, enum MainMenuOption option, MainMenuWindow *param2, int yPos)
|
||||
{
|
||||
if (appData->agbGameType == 0) {
|
||||
return FALSE;
|
||||
@@ -796,7 +795,7 @@ static BOOL RenderGBAMigrationOption(MainMenuAppData *appData, enum MainMenuOpti
|
||||
break;
|
||||
}
|
||||
|
||||
ov97_0223795C(appData->bgConfig, param2, 3, yPos, optionTextID);
|
||||
MainMenuUtil_ShowWindowAtPos(appData->bgConfig, param2, 3, yPos, optionTextID);
|
||||
ClearWirelessIcon(appData, OPTION_WINDOW_WIDTH, yPos);
|
||||
|
||||
appData->optionApps[option] = sOptions[option].appToLoad;
|
||||
@@ -804,7 +803,7 @@ static BOOL RenderGBAMigrationOption(MainMenuAppData *appData, enum MainMenuOpti
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static BOOL RenderMysteryGiftOption(MainMenuAppData *appData, enum MainMenuOption option, UnkStruct_ov97_02237808 *param2, int yPos)
|
||||
static BOOL RenderMysteryGiftOption(MainMenuAppData *appData, enum MainMenuOption option, MainMenuWindow *param2, int yPos)
|
||||
{
|
||||
if (appData->mysteryGiftUnlocked == FALSE) {
|
||||
if (MysteryGift_GetMysteryGiftUnlockedFlag(appData->mysteryGift) == TRUE) {
|
||||
@@ -819,7 +818,7 @@ static BOOL RenderMysteryGiftOption(MainMenuAppData *appData, enum MainMenuOptio
|
||||
|
||||
if (DistributionCartridge_ReadLength()) {
|
||||
appData->mysteryGiftUnlocked = TRUE;
|
||||
ov97_02238400(TRUE);
|
||||
MainMenuUtil_ToggleTerminateOnGBACartRemoved(TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -830,7 +829,7 @@ static BOOL RenderMysteryGiftOption(MainMenuAppData *appData, enum MainMenuOptio
|
||||
}
|
||||
|
||||
if (appData->mysteryGiftUnlocked == TRUE) {
|
||||
ov97_0223795C(appData->bgConfig, param2, 3, yPos, sOptions[option].textEntryID);
|
||||
MainMenuUtil_ShowWindowAtPos(appData->bgConfig, param2, 3, yPos, sOptions[option].textEntryID);
|
||||
ClearWirelessIcon(appData, OPTION_WINDOW_WIDTH, yPos);
|
||||
|
||||
appData->optionApps[option] = sOptions[option].appToLoad;
|
||||
@@ -843,10 +842,10 @@ static BOOL RenderMysteryGiftOption(MainMenuAppData *appData, enum MainMenuOptio
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static BOOL RenderRangerLinkOption(MainMenuAppData *appData, enum MainMenuOption option, UnkStruct_ov97_02237808 *param2, int yPos)
|
||||
static BOOL RenderRangerLinkOption(MainMenuAppData *appData, enum MainMenuOption option, MainMenuWindow *param2, int yPos)
|
||||
{
|
||||
if ((appData->rangerLinkAvailable == TRUE) && (appData->pokedexObtained == TRUE)) {
|
||||
ov97_0223795C(appData->bgConfig, param2, 3, yPos, sOptions[option].textEntryID);
|
||||
MainMenuUtil_ShowWindowAtPos(appData->bgConfig, param2, 3, yPos, sOptions[option].textEntryID);
|
||||
DrawWirelessIcon(appData, OPTION_WINDOW_WIDTH, yPos, WIRELESS_ICON_LOCAL);
|
||||
|
||||
appData->optionWirelessIconTypes[option] = WIRELESS_ICON_LOCAL;
|
||||
@@ -859,10 +858,10 @@ static BOOL RenderRangerLinkOption(MainMenuAppData *appData, enum MainMenuOption
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static BOOL RenderWiiConnectionOption(MainMenuAppData *appData, enum MainMenuOption option, UnkStruct_ov97_02237808 *param2, int yPos)
|
||||
static BOOL RenderWiiConnectionOption(MainMenuAppData *appData, enum MainMenuOption option, MainMenuWindow *param2, int yPos)
|
||||
{
|
||||
if (appData->wiiConnectionAvailable == TRUE) {
|
||||
ov97_0223795C(appData->bgConfig, param2, 3, yPos, sOptions[option].textEntryID);
|
||||
MainMenuUtil_ShowWindowAtPos(appData->bgConfig, param2, 3, yPos, sOptions[option].textEntryID);
|
||||
appData->optionWirelessIconTypes[option] = WIRELESS_ICON_LOCAL;
|
||||
|
||||
DrawWirelessIcon(appData, OPTION_WINDOW_WIDTH, yPos, WIRELESS_ICON_LOCAL);
|
||||
@@ -873,9 +872,9 @@ static BOOL RenderWiiConnectionOption(MainMenuAppData *appData, enum MainMenuOpt
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static BOOL RenderWFCSettingsOption(MainMenuAppData *appData, enum MainMenuOption option, UnkStruct_ov97_02237808 *param2, int yPos)
|
||||
static BOOL RenderWFCSettingsOption(MainMenuAppData *appData, enum MainMenuOption option, MainMenuWindow *param2, int yPos)
|
||||
{
|
||||
ov97_0223795C(appData->bgConfig, param2, 3, yPos, sOptions[option].textEntryID);
|
||||
MainMenuUtil_ShowWindowAtPos(appData->bgConfig, param2, 3, yPos, sOptions[option].textEntryID);
|
||||
appData->optionWirelessIconTypes[option] = WIRELESS_ICON_WIFI;
|
||||
|
||||
DrawWirelessIcon(appData, OPTION_WINDOW_WIDTH, yPos, WIRELESS_ICON_WIFI);
|
||||
@@ -884,9 +883,9 @@ static BOOL RenderWFCSettingsOption(MainMenuAppData *appData, enum MainMenuOptio
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static BOOL RenderWiiMsgSettingsOption(MainMenuAppData *appData, enum MainMenuOption option, UnkStruct_ov97_02237808 *param2, int yPos)
|
||||
static BOOL RenderWiiMsgSettingsOption(MainMenuAppData *appData, enum MainMenuOption option, MainMenuWindow *param2, int yPos)
|
||||
{
|
||||
ov97_0223795C(appData->bgConfig, param2, 3, yPos, sOptions[option].textEntryID);
|
||||
MainMenuUtil_ShowWindowAtPos(appData->bgConfig, param2, 3, yPos, sOptions[option].textEntryID);
|
||||
appData->optionWirelessIconTypes[option] = WIRELESS_ICON_NONE;
|
||||
|
||||
ClearWirelessIcon(appData, OPTION_WINDOW_WIDTH, yPos);
|
||||
@@ -907,15 +906,15 @@ static BOOL RenderOptions(MainMenuAppData *appData)
|
||||
for (i = 0; i < (sizeof(sOptions) / sizeof(MainMenuOptionTemplate)); i++) {
|
||||
MainMenuOptionTemplate *option = &sOptions[i];
|
||||
|
||||
UnkStruct_ov97_02237808 v1;
|
||||
ov97_02237808(&v1, &appData->optionWindows[i], PLTT_1, TEXT_BANK_MAIN_MENU_OPTIONS, 1, PLTT_2);
|
||||
ov97_02237858(&v1, OPTION_WINDOW_WIDTH, option->height, appData->nextOptionBasetile);
|
||||
MainMenuWindow v1;
|
||||
MainMenuUtil_InitWindow(&v1, &appData->optionWindows[i], PLTT_1, TEXT_BANK_MAIN_MENU_OPTIONS, 1, PLTT_2);
|
||||
MainMenuWindow_SetDimensionsAndBasetile(&v1, OPTION_WINDOW_WIDTH, option->height, appData->nextOptionBasetile);
|
||||
|
||||
if (option->renderFunc) {
|
||||
if (appData->optionApps[i]) {
|
||||
Window_SetXPos(v1.unk_10, 3);
|
||||
Window_SetYPos(v1.unk_10, nextOptionY);
|
||||
Window_DrawStandardFrame(v1.unk_10, FALSE, v1.unk_38, v1.unk_3C);
|
||||
Window_SetXPos(v1.window, 3);
|
||||
Window_SetYPos(v1.window, nextOptionY);
|
||||
Window_DrawStandardFrame(v1.window, FALSE, v1.frameBaseTile, v1.framePltt);
|
||||
|
||||
if (appData->optionWirelessIconTypes[i]) {
|
||||
DrawWirelessIcon(appData, OPTION_WINDOW_WIDTH, nextOptionY, appData->optionWirelessIconTypes[i]);
|
||||
@@ -930,7 +929,7 @@ static BOOL RenderOptions(MainMenuAppData *appData)
|
||||
renderedCustomRenderedOption = TRUE;
|
||||
}
|
||||
} else {
|
||||
ov97_0223795C(appData->bgConfig, &v1, 3, nextOptionY, option->textEntryID);
|
||||
MainMenuUtil_ShowWindowAtPos(appData->bgConfig, &v1, 3, nextOptionY, option->textEntryID);
|
||||
appData->optionApps[i] = option->appToLoad;
|
||||
nextOptionY += option->height + 2; // Add 2 to account for the window border
|
||||
}
|
||||
@@ -1043,7 +1042,7 @@ static void FreeApplicationResources(ApplicationManager *appMan)
|
||||
if (appData->scrollUpArrowSprite || appData->scrollDownArrowSprite) {
|
||||
Sprite_Delete(appData->scrollUpArrowSprite);
|
||||
Sprite_Delete(appData->scrollDownArrowSprite);
|
||||
ov97_02237DA0();
|
||||
MainMenuUtil_FreeSprites();
|
||||
}
|
||||
|
||||
for (int i = 0; i < NELEMS(sOptions); i++) {
|
||||
@@ -1138,7 +1137,7 @@ static int MainMenu_Init(ApplicationManager *appMan, int *unused)
|
||||
appData->badgeCount = TrainerInfo_BadgeCount(appData->trainerInfo);
|
||||
appData->alertsState = MAIN_MANU_ALERTS_STATE_WAIT;
|
||||
|
||||
ov97_02237694(HEAP_ID_MAIN_MENU);
|
||||
MainMenuUtil_Init(HEAP_ID_MAIN_MENU);
|
||||
|
||||
if (!SaveData_DataExists(appData->saveData)) {
|
||||
appData->isNewGame = TRUE;
|
||||
@@ -1174,13 +1173,13 @@ static int MainMenu_Main(ApplicationManager *appMan, int *state)
|
||||
if (CheckWFCUserInfoErased(appData) == FALSE) {
|
||||
*state = MAIN_MENU_STATE_CHECK_NEW_GAME_AND_GBA;
|
||||
} else {
|
||||
ov97_02237790(FADE_TYPE_UNK_1, MAIN_MENU_STATE_WARM_WFC_USER_INFO_ERASED, state, MAIN_MENU_STATE_WAIT_SCREEN_TRANSITION);
|
||||
MainMenuUtil_StartScreenFadeToState(FADE_TYPE_UNK_1, MAIN_MENU_STATE_WARM_WFC_USER_INFO_ERASED, state, MAIN_MENU_STATE_WAIT_SCREEN_TRANSITION);
|
||||
*HW_BG_A_PLTT_COLOR(PLTT_0, 0) = BACKGROUND_COLOR;
|
||||
}
|
||||
break;
|
||||
case MAIN_MENU_STATE_WARM_WFC_USER_INFO_ERASED:
|
||||
if (ShowWFCUserInfoErasedMsg(appData) == FALSE) {
|
||||
ov97_02237790(FADE_TYPE_UNK_0, MAIN_MENU_STATE_CHECK_NEW_GAME_AND_GBA, state, MAIN_MENU_STATE_WAIT_SCREEN_TRANSITION);
|
||||
MainMenuUtil_StartScreenFadeToState(FADE_TYPE_UNK_0, MAIN_MENU_STATE_CHECK_NEW_GAME_AND_GBA, state, MAIN_MENU_STATE_WAIT_SCREEN_TRANSITION);
|
||||
}
|
||||
break;
|
||||
case MAIN_MENU_STATE_CHECK_NEW_GAME_AND_GBA:
|
||||
@@ -1188,7 +1187,7 @@ static int MainMenu_Main(ApplicationManager *appMan, int *state)
|
||||
|
||||
if (appData->isNewGame == TRUE) {
|
||||
appData->nextApplication = NEXT_APP_GAME_INTRO;
|
||||
ov97_02237790(FADE_TYPE_UNK_0, MAIN_MENU_STATE_EXIT, state, MAIN_MENU_STATE_WAIT_SCREEN_TRANSITION);
|
||||
MainMenuUtil_StartScreenFadeToState(FADE_TYPE_UNK_0, MAIN_MENU_STATE_EXIT, state, MAIN_MENU_STATE_WAIT_SCREEN_TRANSITION);
|
||||
} else {
|
||||
DetectGBAGame(appData);
|
||||
*state = MAIN_MENU_STATE_LOAD_GRAPHICS;
|
||||
@@ -1202,7 +1201,7 @@ static int MainMenu_Main(ApplicationManager *appMan, int *state)
|
||||
|
||||
RenderOptions(appData);
|
||||
RenderOptionsFrames(appData, appData->focusedOption);
|
||||
ov97_02237790(FADE_TYPE_UNK_1, MAIN_MENU_STATE_SELECT_OPTION, state, MAIN_MENU_STATE_WAIT_SCREEN_TRANSITION);
|
||||
MainMenuUtil_StartScreenFadeToState(FADE_TYPE_UNK_1, MAIN_MENU_STATE_SELECT_OPTION, state, MAIN_MENU_STATE_WAIT_SCREEN_TRANSITION);
|
||||
|
||||
*HW_BG_A_PLTT_COLOR(PLTT_0, 0) = BACKGROUND_COLOR;
|
||||
appData->wirelessCheckState = MAIN_MENU_WIRELESS_CHECK_START;
|
||||
@@ -1225,7 +1224,7 @@ static int MainMenu_Main(ApplicationManager *appMan, int *state)
|
||||
} else {
|
||||
Sound_PlayEffect(SEQ_SE_CONFIRM);
|
||||
appData->nextApplication = NEXT_APP_TITLE_SCREEN;
|
||||
ov97_02237784(TRUE);
|
||||
MainMenuUtil_SetFadeToWhite(TRUE);
|
||||
}
|
||||
|
||||
if (appData->nextApplication == NEXT_APP_GAME_INTRO) {
|
||||
@@ -1234,10 +1233,10 @@ static int MainMenu_Main(ApplicationManager *appMan, int *state)
|
||||
*state = MAIN_MENU_STATE_CONFIRM_NEW_GAME;
|
||||
} else {
|
||||
if ((appData->nextApplication == NEXT_APP_WII_CONNECTION) || (appData->nextApplication == NEXT_APP_WFC_SETTINGS)) {
|
||||
ov97_02237784(TRUE);
|
||||
MainMenuUtil_SetFadeToWhite(TRUE);
|
||||
}
|
||||
|
||||
ov97_02237790(FADE_TYPE_UNK_0, MAIN_MENU_STATE_EXIT, state, MAIN_MENU_STATE_WAIT_SCREEN_TRANSITION);
|
||||
MainMenuUtil_StartScreenFadeToState(FADE_TYPE_UNK_0, MAIN_MENU_STATE_EXIT, state, MAIN_MENU_STATE_WAIT_SCREEN_TRANSITION);
|
||||
}
|
||||
|
||||
if (appData->wirelessCheckState == MAIN_MENU_WIRELESS_CHECK_CHECK_RESULT) {
|
||||
@@ -1274,7 +1273,7 @@ static int MainMenu_Main(ApplicationManager *appMan, int *state)
|
||||
if (appData->alertDismissKeys & PAD_BUTTON_B) {
|
||||
*state = MAIN_MENU_STATE_SELECT_OPTION;
|
||||
} else {
|
||||
ov97_02237790(FADE_TYPE_UNK_0, MAIN_MENU_STATE_EXIT, state, MAIN_MENU_STATE_WAIT_SCREEN_TRANSITION);
|
||||
MainMenuUtil_StartScreenFadeToState(FADE_TYPE_UNK_0, MAIN_MENU_STATE_EXIT, state, MAIN_MENU_STATE_WAIT_SCREEN_TRANSITION);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -1283,7 +1282,7 @@ static int MainMenu_Main(ApplicationManager *appMan, int *state)
|
||||
return TRUE;
|
||||
break;
|
||||
case MAIN_MENU_STATE_WAIT_SCREEN_TRANSITION:
|
||||
ov97_022377F0(state);
|
||||
MainMenuUtil_CheckScreenFadeDone(state);
|
||||
break;
|
||||
case MAIN_MENU_STATE_UNUSED_9:
|
||||
return TRUE;
|
||||
@@ -1292,7 +1291,7 @@ static int MainMenu_Main(ApplicationManager *appMan, int *state)
|
||||
|
||||
DetectWirelessConnections(appData);
|
||||
DoScrollStep(appData);
|
||||
ov97_02237CA0();
|
||||
MainMenuUtil_UpdateSpritesSkipGift();
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
@@ -1347,7 +1346,7 @@ static BOOL MainMenu_Exit(ApplicationManager *appMan, int *unused)
|
||||
ApplicationManager_FreeData(appMan);
|
||||
Heap_Destroy(HEAP_ID_MAIN_MENU);
|
||||
|
||||
ov97_02238400(FALSE);
|
||||
MainMenuUtil_ToggleTerminateOnGBACartRemoved(FALSE);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -16,8 +16,6 @@
|
||||
#include "overlay097/ov97_02237694.h"
|
||||
#include "overlay097/ov97_02238534.h"
|
||||
#include "overlay097/ov97_02238D74.h"
|
||||
#include "overlay097/struct_ov97_02237808.h"
|
||||
#include "overlay097/struct_ov97_02237AEC.h"
|
||||
#include "overlay097/wonder_cards_app.h"
|
||||
#include "savedata/save_table.h"
|
||||
|
||||
@@ -216,7 +214,7 @@ typedef struct MysteryGiftAnimationManager {
|
||||
int animationStage;
|
||||
int unused_04;
|
||||
s8 blendBrightness;
|
||||
UnkStruct_ov97_02237AEC *unk_0C;
|
||||
MainMenuSpriteManager *unk_0C;
|
||||
SpriteResourcesHeader spriteResourcesHeaders[DS_SCREEN_MAX];
|
||||
SpriteResource *spriteResources[DS_SCREEN_MAX][SPRITE_RESOURCE_MAX];
|
||||
MysteryGiftParticle topScreenSmallParticles[NUM_MYSTERY_GIFT_PARTICLES];
|
||||
@@ -299,7 +297,7 @@ StateChangeMenuOptionTemplate sConfirmReceiveGiftOptions_WirelessDistribution[]
|
||||
|
||||
static ListMenuTemplate sMysteryGiftAppListMenuTemplate = {
|
||||
.choices = NULL,
|
||||
.cursorCallback = ov97_022383C4,
|
||||
.cursorCallback = MainMenuUtil_ListMenuCursorCB,
|
||||
.printCallback = NULL,
|
||||
.window = NULL,
|
||||
.count = 0,
|
||||
@@ -346,7 +344,7 @@ static void FreeApplicationResources(ApplicationManager *appMan)
|
||||
{
|
||||
MysteryGiftAppData *appData = ApplicationManager_Data(appMan);
|
||||
|
||||
ov97_02237DA0();
|
||||
MainMenuUtil_FreeSprites();
|
||||
|
||||
if (appData->listMenuOptions) {
|
||||
StringList_Free(appData->listMenuOptions);
|
||||
@@ -380,15 +378,15 @@ static void FreeApplicationResources(ApplicationManager *appMan)
|
||||
|
||||
static void LoadDownloadArrowSpriteResources(MysteryGiftAppData *appData)
|
||||
{
|
||||
ov97_02237A20();
|
||||
ov97_02237A74();
|
||||
ov97_02237B0C(NARC_INDEX_GRAPHIC__MYSTERY, 10, 7, 9, 8, 0);
|
||||
MainMenuUtil_InitCharPlttTransferBuffers();
|
||||
MainMenuUtil_InitSpriteLoader();
|
||||
MainMenuUtil_LoadSprite(NARC_INDEX_GRAPHIC__MYSTERY, 10, 7, 9, 8, 0);
|
||||
}
|
||||
|
||||
static void SetDownloadArrowAnim(MysteryGiftAppData *appData, int animID)
|
||||
{
|
||||
if (animID != HIDE_DOWNLOADING_ARROW) {
|
||||
appData->dowloadArrowSprite = ov97_02237D14(0, appData->dowloadArrowSprite, HW_LCD_WIDTH / 2, 100, animID);
|
||||
appData->dowloadArrowSprite = MainMenuUtil_InitSprite(0, appData->dowloadArrowSprite, HW_LCD_WIDTH / 2, 100, animID);
|
||||
} else {
|
||||
Sprite_SetDrawFlag(appData->dowloadArrowSprite, FALSE);
|
||||
}
|
||||
@@ -478,7 +476,7 @@ static WonderCard *GetReceivedWonderCard(ApplicationManager *appMan)
|
||||
switch (appData->receptionMethod) {
|
||||
case RECEIVE_FROM_FRIEND:
|
||||
memcpy(wonderCard, ov97_0222D2B8(0, NULL, 0), sizeof(WonderCard));
|
||||
ov97_02238324(&appData->eventData, &appData->eventData.wonderCard, HEAP_ID_MYSTERY_GIFT_APP);
|
||||
MainMenuUtil_DecryptReceivedWonderCard(&appData->eventData, &appData->eventData.wonderCard, HEAP_ID_MYSTERY_GIFT_APP);
|
||||
break;
|
||||
case RECEIVE_FROM_LOCAL_WIRELESS:
|
||||
eventData = (MysteryGiftEventData *)appData->wirelessDistributionBuffer;
|
||||
@@ -521,7 +519,7 @@ static void MainCallbackSaveGame(MysteryGiftAppData *appData)
|
||||
appData->mainCallback = NULL;
|
||||
}
|
||||
|
||||
int saveStatus = ov97_0223847C();
|
||||
int saveStatus = MainMenuUtil_SaveState();
|
||||
|
||||
if (saveStatus == SAVE_RESULT_OK || saveStatus == SAVE_RESULT_CORRUPT) {
|
||||
if (ShouldPlayAnimation(&appData->eventData.wonderCard) != TRUE) {
|
||||
@@ -566,7 +564,7 @@ static void SaveReceivedGift(ApplicationManager *appMan)
|
||||
saved = MysteryGift_TrySaveWondercard(mysteryGift, wonderCard);
|
||||
}
|
||||
|
||||
ov97_0223846C(saveData);
|
||||
MainMenuUtil_InitSaving(saveData);
|
||||
|
||||
appData->cancelSave = FALSE;
|
||||
appData->mainCallback = MainCallbackSaveGame;
|
||||
@@ -800,7 +798,7 @@ static enum MysteryGiftAppState ExitToWonderCardsApp(ApplicationManager *appMan)
|
||||
ov97_02230224(appData);
|
||||
}
|
||||
|
||||
ov97_02237790(0, MG_APP_STATE_EXIT_TO_WONDER_CARDS_APP, (int *)appData->statePtr, MG_APP_STATE_WAIT_SCREEN_TRANSITION);
|
||||
MainMenuUtil_StartScreenFadeToState(0, MG_APP_STATE_EXIT_TO_WONDER_CARDS_APP, (int *)appData->statePtr, MG_APP_STATE_WAIT_SCREEN_TRANSITION);
|
||||
return MG_APP_KEEP_PREVIOUS_STATE;
|
||||
}
|
||||
|
||||
@@ -812,8 +810,8 @@ static enum MysteryGiftAppState ExitToTitleScreen(ApplicationManager *appMan)
|
||||
appData->unk_630 = 1;
|
||||
}
|
||||
|
||||
ov97_02237784(1);
|
||||
ov97_02237790(0, MG_APP_STATE_EXIT_TO_TITLE_SCREEN, (int *)appData->statePtr, MG_APP_STATE_WAIT_SCREEN_TRANSITION);
|
||||
MainMenuUtil_SetFadeToWhite(1);
|
||||
MainMenuUtil_StartScreenFadeToState(0, MG_APP_STATE_EXIT_TO_TITLE_SCREEN, (int *)appData->statePtr, MG_APP_STATE_WAIT_SCREEN_TRANSITION);
|
||||
|
||||
return MG_APP_KEEP_PREVIOUS_STATE;
|
||||
}
|
||||
@@ -1078,14 +1076,14 @@ void MysteryGiftApp_ShowWiFiCommError(MysteryGiftAppData *appData)
|
||||
StringTemplate *strTemplate = StringTemplate_Default(HEAP_ID_MYSTERY_GIFT_APP);
|
||||
StringTemplate_SetNumber(strTemplate, 0, appData->wifiCommErrorCode, 5, PADDING_MODE_ZEROES, CHARSET_MODE_EN);
|
||||
|
||||
UnkStruct_ov97_02237808 v1;
|
||||
ov97_02237808(&v1, &appData->wifiCommErrorWindow, PLTT_1, TEXT_BANK_UNK_0695, BASE_TILE_STANDARD_WINDOW_FRAME, PLTT_3);
|
||||
ov97_02237858(&v1, 24, 16, 100);
|
||||
ov97_02237860(&v1, FALSE, FONT_MESSAGE);
|
||||
MainMenuWindow v1;
|
||||
MainMenuUtil_InitWindow(&v1, &appData->wifiCommErrorWindow, PLTT_1, TEXT_BANK_UNK_0695, BASE_TILE_STANDARD_WINDOW_FRAME, PLTT_3);
|
||||
MainMenuWindow_SetDimensionsAndBasetile(&v1, 24, 16, 100);
|
||||
MainMenuWindow_SetScrollableAndFont(&v1, FALSE, FONT_MESSAGE);
|
||||
|
||||
v1.unk_14 = strTemplate;
|
||||
v1.strTemplate = strTemplate;
|
||||
|
||||
ov97_0223795C(appData->bgConfig, &v1, 4, 4, textEntryID);
|
||||
MainMenuUtil_ShowWindowAtPos(appData->bgConfig, &v1, 4, 4, textEntryID);
|
||||
StringTemplate_Free(strTemplate);
|
||||
}
|
||||
|
||||
@@ -1186,7 +1184,7 @@ static int MysteryGiftApp_Init(ApplicationManager *appMan, int *unused)
|
||||
if (DistributionCartridge_ReadLength()) {
|
||||
appData->receptionMethod = RECEIVE_FROM_GBA_CARTRIDGE;
|
||||
SetGBACartridgeVersion(gGameVersion);
|
||||
ov97_02238400(TRUE);
|
||||
MainMenuUtil_ToggleTerminateOnGBACartRemoved(TRUE);
|
||||
}
|
||||
|
||||
appData->unk_62C = 29;
|
||||
@@ -1215,18 +1213,18 @@ static void LoadParticleSpriteResources(MysteryGiftAnimationManager *animMan)
|
||||
vramType = NNS_G2D_VRAM_TYPE_2DMAIN;
|
||||
resourceID = 20000 + vramType;
|
||||
|
||||
animMan->spriteResources[DS_SCREEN_MAIN][SPRITE_RESOURCE_CHAR] = SpriteResourceCollection_AddTiles(animMan->unk_0C->unk_190[SPRITE_RESOURCE_CHAR], narcID, tilesID, compressed, resourceID, vramType, heapID);
|
||||
animMan->spriteResources[DS_SCREEN_MAIN][SPRITE_RESOURCE_PLTT] = SpriteResourceCollection_AddPalette(animMan->unk_0C->unk_190[SPRITE_RESOURCE_PLTT], narcID, paletteID, FALSE, resourceID, vramType, PLTT_1, heapID);
|
||||
animMan->spriteResources[DS_SCREEN_MAIN][SPRITE_RESOURCE_CELL] = SpriteResourceCollection_Add(animMan->unk_0C->unk_190[SPRITE_RESOURCE_CELL], narcID, cellsID, compressed, resourceID, SPRITE_RESOURCE_CELL, heapID);
|
||||
animMan->spriteResources[DS_SCREEN_MAIN][SPRITE_RESOURCE_ANIM] = SpriteResourceCollection_Add(animMan->unk_0C->unk_190[SPRITE_RESOURCE_ANIM], narcID, animationID, compressed, resourceID, SPRITE_RESOURCE_ANIM, heapID);
|
||||
animMan->spriteResources[DS_SCREEN_MAIN][SPRITE_RESOURCE_CHAR] = SpriteResourceCollection_AddTiles(animMan->unk_0C->resourceCollections[SPRITE_RESOURCE_CHAR], narcID, tilesID, compressed, resourceID, vramType, heapID);
|
||||
animMan->spriteResources[DS_SCREEN_MAIN][SPRITE_RESOURCE_PLTT] = SpriteResourceCollection_AddPalette(animMan->unk_0C->resourceCollections[SPRITE_RESOURCE_PLTT], narcID, paletteID, FALSE, resourceID, vramType, PLTT_1, heapID);
|
||||
animMan->spriteResources[DS_SCREEN_MAIN][SPRITE_RESOURCE_CELL] = SpriteResourceCollection_Add(animMan->unk_0C->resourceCollections[SPRITE_RESOURCE_CELL], narcID, cellsID, compressed, resourceID, SPRITE_RESOURCE_CELL, heapID);
|
||||
animMan->spriteResources[DS_SCREEN_MAIN][SPRITE_RESOURCE_ANIM] = SpriteResourceCollection_Add(animMan->unk_0C->resourceCollections[SPRITE_RESOURCE_ANIM], narcID, animationID, compressed, resourceID, SPRITE_RESOURCE_ANIM, heapID);
|
||||
|
||||
vramType = NNS_G2D_VRAM_TYPE_2DSUB;
|
||||
resourceID = 20000 + vramType;
|
||||
|
||||
animMan->spriteResources[DS_SCREEN_SUB][SPRITE_RESOURCE_CHAR] = SpriteResourceCollection_AddTiles(animMan->unk_0C->unk_190[SPRITE_RESOURCE_CHAR], narcID, tilesID, compressed, resourceID, vramType, heapID);
|
||||
animMan->spriteResources[DS_SCREEN_SUB][SPRITE_RESOURCE_PLTT] = SpriteResourceCollection_AddPalette(animMan->unk_0C->unk_190[SPRITE_RESOURCE_PLTT], narcID, paletteID, FALSE, resourceID, vramType, PLTT_1, heapID);
|
||||
animMan->spriteResources[DS_SCREEN_SUB][SPRITE_RESOURCE_CELL] = SpriteResourceCollection_Add(animMan->unk_0C->unk_190[SPRITE_RESOURCE_CELL], narcID, cellsID, compressed, resourceID, SPRITE_RESOURCE_CELL, heapID);
|
||||
animMan->spriteResources[DS_SCREEN_SUB][SPRITE_RESOURCE_ANIM] = SpriteResourceCollection_Add(animMan->unk_0C->unk_190[SPRITE_RESOURCE_ANIM], narcID, animationID, compressed, resourceID, SPRITE_RESOURCE_ANIM, heapID);
|
||||
animMan->spriteResources[DS_SCREEN_SUB][SPRITE_RESOURCE_CHAR] = SpriteResourceCollection_AddTiles(animMan->unk_0C->resourceCollections[SPRITE_RESOURCE_CHAR], narcID, tilesID, compressed, resourceID, vramType, heapID);
|
||||
animMan->spriteResources[DS_SCREEN_SUB][SPRITE_RESOURCE_PLTT] = SpriteResourceCollection_AddPalette(animMan->unk_0C->resourceCollections[SPRITE_RESOURCE_PLTT], narcID, paletteID, FALSE, resourceID, vramType, PLTT_1, heapID);
|
||||
animMan->spriteResources[DS_SCREEN_SUB][SPRITE_RESOURCE_CELL] = SpriteResourceCollection_Add(animMan->unk_0C->resourceCollections[SPRITE_RESOURCE_CELL], narcID, cellsID, compressed, resourceID, SPRITE_RESOURCE_CELL, heapID);
|
||||
animMan->spriteResources[DS_SCREEN_SUB][SPRITE_RESOURCE_ANIM] = SpriteResourceCollection_Add(animMan->unk_0C->resourceCollections[SPRITE_RESOURCE_ANIM], narcID, animationID, compressed, resourceID, SPRITE_RESOURCE_ANIM, heapID);
|
||||
|
||||
SpriteTransfer_RequestChar(animMan->spriteResources[DS_SCREEN_MAIN][SPRITE_RESOURCE_CHAR]);
|
||||
SpriteTransfer_RequestChar(animMan->spriteResources[DS_SCREEN_SUB][SPRITE_RESOURCE_CHAR]);
|
||||
@@ -1237,13 +1235,13 @@ static void LoadParticleSpriteResources(MysteryGiftAnimationManager *animMan)
|
||||
vramType = NNS_G2D_VRAM_TYPE_2DMAIN;
|
||||
resourceID = 20000 + vramType;
|
||||
|
||||
SpriteResourcesHeader_Init(&animMan->spriteResourcesHeaders[DS_SCREEN_MAIN], resourceID, resourceID, resourceID, resourceID, 0xffffffff, 0xffffffff, FALSE, 0, animMan->unk_0C->unk_190[SPRITE_RESOURCE_CHAR], animMan->unk_0C->unk_190[SPRITE_RESOURCE_PLTT], animMan->unk_0C->unk_190[SPRITE_RESOURCE_CELL], animMan->unk_0C->unk_190[SPRITE_RESOURCE_ANIM], NULL, NULL);
|
||||
SpriteResourcesHeader_Init(&animMan->spriteResourcesHeaders[DS_SCREEN_MAIN], resourceID, resourceID, resourceID, resourceID, 0xffffffff, 0xffffffff, FALSE, 0, animMan->unk_0C->resourceCollections[SPRITE_RESOURCE_CHAR], animMan->unk_0C->resourceCollections[SPRITE_RESOURCE_PLTT], animMan->unk_0C->resourceCollections[SPRITE_RESOURCE_CELL], animMan->unk_0C->resourceCollections[SPRITE_RESOURCE_ANIM], NULL, NULL);
|
||||
|
||||
vramType = NNS_G2D_VRAM_TYPE_2DSUB;
|
||||
resourceID = 20000 + vramType;
|
||||
|
||||
// Despite baseIndex always being 0, replacing `baseIndex + DS_SCREEN_SUB` with `DS_SCREEN_SUB` doesn't match here.
|
||||
SpriteResourcesHeader_Init(&animMan->spriteResourcesHeaders[baseIndex + DS_SCREEN_SUB], resourceID, resourceID, resourceID, resourceID, 0xffffffff, 0xffffffff, FALSE, 0, animMan->unk_0C->unk_190[SPRITE_RESOURCE_CHAR], animMan->unk_0C->unk_190[SPRITE_RESOURCE_PLTT], animMan->unk_0C->unk_190[SPRITE_RESOURCE_CELL], animMan->unk_0C->unk_190[SPRITE_RESOURCE_ANIM], NULL, NULL);
|
||||
SpriteResourcesHeader_Init(&animMan->spriteResourcesHeaders[baseIndex + DS_SCREEN_SUB], resourceID, resourceID, resourceID, resourceID, 0xffffffff, 0xffffffff, FALSE, 0, animMan->unk_0C->resourceCollections[SPRITE_RESOURCE_CHAR], animMan->unk_0C->resourceCollections[SPRITE_RESOURCE_PLTT], animMan->unk_0C->resourceCollections[SPRITE_RESOURCE_CELL], animMan->unk_0C->resourceCollections[SPRITE_RESOURCE_ANIM], NULL, NULL);
|
||||
}
|
||||
|
||||
static Sprite *InitParticleSprite(MysteryGiftAnimationManager *animMan, int vramType)
|
||||
@@ -1256,7 +1254,7 @@ static Sprite *InitParticleSprite(MysteryGiftAnimationManager *animMan, int vram
|
||||
// 0 is the top screen, 1 is the bottom screen. Using enum variants doesn't match.
|
||||
enum DSScreen screen = (vramType == NNS_G2D_VRAM_TYPE_2DMAIN) ? 0 : 1;
|
||||
|
||||
template.list = animMan->unk_0C->unk_00;
|
||||
template.list = animMan->unk_0C->spriteList;
|
||||
template.resourceData = &animMan->spriteResourcesHeaders[screen];
|
||||
template.position.z = 0;
|
||||
template.affineScale.x = FX32_ONE;
|
||||
@@ -2004,7 +2002,7 @@ static BOOL MysteryGiftApp_Main(ApplicationManager *appMan, enum MysteryGiftAppS
|
||||
|
||||
switch (*state) {
|
||||
case MG_APP_STATE_SETUP:
|
||||
ov97_02237694(HEAP_ID_MYSTERY_GIFT_APP);
|
||||
MainMenuUtil_Init(HEAP_ID_MYSTERY_GIFT_APP);
|
||||
appData->statePtr = state;
|
||||
*state = MG_APP_STATE_INIT_GRAPHICS;
|
||||
break;
|
||||
@@ -2012,10 +2010,10 @@ static BOOL MysteryGiftApp_Main(ApplicationManager *appMan, enum MysteryGiftAppS
|
||||
case MG_APP_STATE_INIT_GRAPHICS:
|
||||
ShowAppMainMenu(appMan, appData);
|
||||
LoadDownloadArrowSpriteResources(appData);
|
||||
ov97_02237790(1, MG_APP_STATE_WAIT_MAIN_MENU_INPUT, (int *)state, MG_APP_STATE_WAIT_SCREEN_TRANSITION);
|
||||
MainMenuUtil_StartScreenFadeToState(1, MG_APP_STATE_WAIT_MAIN_MENU_INPUT, (int *)state, MG_APP_STATE_WAIT_SCREEN_TRANSITION);
|
||||
break;
|
||||
case MG_APP_STATE_WAIT_SCREEN_TRANSITION:
|
||||
ov97_022377F0((int *)state);
|
||||
MainMenuUtil_CheckScreenFadeDone((int *)state);
|
||||
break;
|
||||
case MG_APP_STATE_WAIT_MAIN_MENU_INPUT:
|
||||
ProcessStateTransitionMenuInput(appMan, state, ExitToTitleScreen);
|
||||
@@ -2083,12 +2081,12 @@ static BOOL MysteryGiftApp_Main(ApplicationManager *appMan, enum MysteryGiftAppS
|
||||
memset(animMan, 0, sizeof(MysteryGiftAnimationManager));
|
||||
|
||||
animMan->animationStatusPtr = &appData->animationStatus;
|
||||
animMan->unk_0C = ov97_02237AEC();
|
||||
animMan->unk_0C = MainMenuUtil_GetSpriteManager();
|
||||
|
||||
SysTask_Start((SysTaskFunc)RunMysteryGiftAnimationFrame, animMan, 5);
|
||||
}
|
||||
} else {
|
||||
ov97_02238194(appData->bgConfig, wonderCard);
|
||||
MainMenuUtil_LoadGiftSprite(appData->bgConfig, wonderCard);
|
||||
SaveReceivedGift(appMan);
|
||||
}
|
||||
|
||||
@@ -2101,10 +2099,10 @@ static BOOL MysteryGiftApp_Main(ApplicationManager *appMan, enum MysteryGiftAppS
|
||||
}
|
||||
break;
|
||||
case MG_APP_STATE_WAIT_LOCAL_WIRELESS_GIFT_SAVED: {
|
||||
int saveStatus = ov97_02238528();
|
||||
int saveStatus = MainMenuUtil_GetSavingStatus();
|
||||
|
||||
if (saveStatus == 4) {
|
||||
ov97_022384F4();
|
||||
MainMenuUtil_ContinueSaving();
|
||||
}
|
||||
|
||||
if (saveStatus == SAVE_RESULT_OK) {
|
||||
@@ -2118,7 +2116,7 @@ static BOOL MysteryGiftApp_Main(ApplicationManager *appMan, enum MysteryGiftAppS
|
||||
WonderCard *wonderCard = &appData->eventData.wonderCard;
|
||||
|
||||
if (ShouldPlayAnimation(wonderCard) == TRUE) {
|
||||
ov97_02238194(appData->bgConfig, wonderCard);
|
||||
MainMenuUtil_LoadGiftSprite(appData->bgConfig, wonderCard);
|
||||
appData->animationStatus = MG_ANIMATION_STATUS_PROCEED_IMPLOSION;
|
||||
} else {
|
||||
Sound_PlayEffect(SEQ_SE_DP_UG_020);
|
||||
@@ -2219,7 +2217,7 @@ static BOOL MysteryGiftApp_Main(ApplicationManager *appMan, enum MysteryGiftAppS
|
||||
}
|
||||
break;
|
||||
case MG_APP_STATE_SAVE_GIFT_FROM_FRIEND:
|
||||
ov97_02238194(appData->bgConfig, GetReceivedWonderCard(appMan));
|
||||
MainMenuUtil_LoadGiftSprite(appData->bgConfig, GetReceivedWonderCard(appMan));
|
||||
CommMan_SetErrorHandling(0, 0);
|
||||
SaveReceivedGift(appMan);
|
||||
*state = MG_APP_STATE_CHECK_FRIEND_CONNECTION_STILL_VALID;
|
||||
@@ -2230,7 +2228,7 @@ static BOOL MysteryGiftApp_Main(ApplicationManager *appMan, enum MysteryGiftAppS
|
||||
if (netID != 0 && CommSys_IsPlayerConnected(netID) == FALSE) {
|
||||
ov97_0222D2DC();
|
||||
appData->cancelSave = TRUE;
|
||||
ov97_0223850C();
|
||||
MainMenuUtil_CancelSave();
|
||||
ToggleWaitDial(appData, FALSE);
|
||||
sub_02039794();
|
||||
SetDownloadArrowAnim(appData, HIDE_DOWNLOADING_ARROW);
|
||||
@@ -2238,12 +2236,12 @@ static BOOL MysteryGiftApp_Main(ApplicationManager *appMan, enum MysteryGiftAppS
|
||||
break;
|
||||
}
|
||||
|
||||
if (ov97_02238528() == 4) {
|
||||
if (MainMenuUtil_GetSavingStatus() == 4) {
|
||||
CommTiming_StartSync(0x93);
|
||||
*state = MG_APP_STATE_WAIT_FRIEND_READY_TO_DISCONNECT;
|
||||
appData->delay = 120;
|
||||
} else if (ov97_02238528() == SAVE_RESULT_CORRUPT) {
|
||||
ov97_0223850C();
|
||||
} else if (MainMenuUtil_GetSavingStatus() == SAVE_RESULT_CORRUPT) {
|
||||
MainMenuUtil_CancelSave();
|
||||
appData->eventData.header.hasWonderCard = FALSE;
|
||||
ToggleWaitDial(appData, FALSE);
|
||||
*state = ShowMessageBoxIntoStateTransition(appMan, &appData->messageBox, MysteryGiftMenu_Text_ProblemWithReceivingTheGift, MG_APP_STATE_EXIT_AFTER_RECEIVING_GIFT);
|
||||
@@ -2251,11 +2249,11 @@ static BOOL MysteryGiftApp_Main(ApplicationManager *appMan, enum MysteryGiftAppS
|
||||
} break;
|
||||
case MG_APP_STATE_WAIT_FRIEND_READY_TO_DISCONNECT:
|
||||
if (CommTiming_IsSyncState(0x93) == TRUE) {
|
||||
ov97_022384F4();
|
||||
MainMenuUtil_ContinueSaving();
|
||||
appData->delay = 10;
|
||||
*state = MG_APP_STATE_RECEIVE_FROM_FRIEND_SUCCESS;
|
||||
} else if (--appData->delay == 0) {
|
||||
ov97_0223850C();
|
||||
MainMenuUtil_CancelSave();
|
||||
appData->eventData.header.hasWonderCard = FALSE;
|
||||
ToggleWaitDial(appData, FALSE);
|
||||
*state = ShowMessageBoxIntoStateTransition(appMan, &appData->messageBox, MysteryGiftMenu_Text_ProblemWithReceivingTheGift, MG_APP_STATE_EXIT_AFTER_RECEIVING_GIFT);
|
||||
@@ -2336,7 +2334,7 @@ static BOOL MysteryGiftApp_Main(ApplicationManager *appMan, enum MysteryGiftAppS
|
||||
case MG_APP_STATE_SHOW_RECEIVING_GIFT_MSG: {
|
||||
WonderCard *wonderCard = GetReceivedWonderCard(appMan);
|
||||
|
||||
ov97_02238194(appData->bgConfig, wonderCard);
|
||||
MainMenuUtil_LoadGiftSprite(appData->bgConfig, wonderCard);
|
||||
ShowMessageBox(appMan, &appData->messageBox, MysteryGiftMenu_Text_ReceivingGiftDontTurnOff);
|
||||
SetDownloadArrowAnim(appData, 1);
|
||||
ToggleWaitDial(appData, TRUE);
|
||||
@@ -2350,17 +2348,17 @@ static BOOL MysteryGiftApp_Main(ApplicationManager *appMan, enum MysteryGiftAppS
|
||||
}
|
||||
break;
|
||||
case MG_APP_STATE_WAIT_MYSTERY_GIFT_SAVED:
|
||||
if (ov97_02238528() == 4) {
|
||||
ov97_022384F4();
|
||||
if (MainMenuUtil_GetSavingStatus() == 4) {
|
||||
MainMenuUtil_ContinueSaving();
|
||||
}
|
||||
|
||||
if (ov97_02238528() == SAVE_RESULT_OK) {
|
||||
if (MainMenuUtil_GetSavingStatus() == SAVE_RESULT_OK) {
|
||||
appData->delay = 1;
|
||||
ToggleWaitDial(appData, FALSE);
|
||||
SetDownloadArrowAnim(appData, HIDE_DOWNLOADING_ARROW);
|
||||
Sound_PlayEffect(SEQ_SE_DP_UG_020);
|
||||
*state = ShowMessageBoxIntoStateTransition(appMan, &appData->messageBox, MysteryGiftMenu_Text_GiftReceivedPickUpInPokeMart, MG_APP_STATE_WAIT_BEFORE_EXIT_AFTER_RECEIVING_GIFT);
|
||||
} else if (ov97_02238528() == SAVE_RESULT_CORRUPT) {
|
||||
} else if (MainMenuUtil_GetSavingStatus() == SAVE_RESULT_CORRUPT) {
|
||||
SetDownloadArrowAnim(appData, HIDE_DOWNLOADING_ARROW);
|
||||
appData->eventData.header.hasWonderCard = FALSE;
|
||||
*state = ShowMessageBoxIntoStateTransition(appMan, &appData->messageBox, MysteryGiftMenu_Text_ProblemWithReceivingTheGift, MG_APP_STATE_EXIT_AFTER_RECEIVING_GIFT);
|
||||
@@ -2409,10 +2407,10 @@ static BOOL MysteryGiftApp_Main(ApplicationManager *appMan, enum MysteryGiftAppS
|
||||
Sound_PlayEffect(SEQ_SE_CONFIRM);
|
||||
|
||||
if (appData->eventData.header.hasWonderCard == TRUE) {
|
||||
ov97_02237790(0, MG_APP_STATE_SHOW_RECEIVED_WONDERCARD, (int *)appData->statePtr, MG_APP_STATE_WAIT_SCREEN_TRANSITION);
|
||||
MainMenuUtil_StartScreenFadeToState(0, MG_APP_STATE_SHOW_RECEIVED_WONDERCARD, (int *)appData->statePtr, MG_APP_STATE_WAIT_SCREEN_TRANSITION);
|
||||
} else {
|
||||
ov97_02237784(1);
|
||||
ov97_02237790(0, MG_APP_STATE_RESET_SYSTEM, (int *)appData->statePtr, MG_APP_STATE_WAIT_SCREEN_TRANSITION);
|
||||
MainMenuUtil_SetFadeToWhite(1);
|
||||
MainMenuUtil_StartScreenFadeToState(0, MG_APP_STATE_RESET_SYSTEM, (int *)appData->statePtr, MG_APP_STATE_WAIT_SCREEN_TRANSITION);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -2421,7 +2419,7 @@ static BOOL MysteryGiftApp_Main(ApplicationManager *appMan, enum MysteryGiftAppS
|
||||
GXLayers_EngineBToggleLayers(GX_PLANEMASK_BG0, FALSE);
|
||||
GXLayers_EngineBToggleLayers(GX_PLANEMASK_BG1, TRUE);
|
||||
WonderCardsApp_ShowWondercard(appData->bgConfig, &appData->eventData.wonderCard, HEAP_ID_MYSTERY_GIFT_APP);
|
||||
ov97_02237790(1, MG_APP_STATE_EXIT_AFTER_RECEIVING_GIFT, (int *)appData->statePtr, MG_APP_STATE_WAIT_SCREEN_TRANSITION);
|
||||
MainMenuUtil_StartScreenFadeToState(1, MG_APP_STATE_EXIT_AFTER_RECEIVING_GIFT, (int *)appData->statePtr, MG_APP_STATE_WAIT_SCREEN_TRANSITION);
|
||||
appData->eventData.header.hasWonderCard = FALSE; // Makes the game exit the application
|
||||
break;
|
||||
case MG_APP_STATE_RESET_SYSTEM:
|
||||
@@ -2433,7 +2431,7 @@ static BOOL MysteryGiftApp_Main(ApplicationManager *appMan, enum MysteryGiftAppS
|
||||
appData->mainCallback(appData);
|
||||
}
|
||||
|
||||
ov97_02237CAC(appData->animationStatus);
|
||||
MainMenuUtil_UpdateSprites(appData->animationStatus);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -2470,7 +2468,7 @@ static int MysteryGiftApp_Exit(ApplicationManager *appMan, int *unused)
|
||||
SetGBACartridgeVersion(VERSION_NONE);
|
||||
}
|
||||
|
||||
ov97_02238400(FALSE);
|
||||
MainMenuUtil_ToggleTerminateOnGBACartRemoved(FALSE);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
#include "overlay097/ov97_02237694.h"
|
||||
#include "overlay097/struct_ov97_02232E38.h"
|
||||
#include "overlay097/struct_ov97_022335A8.h"
|
||||
#include "overlay097/struct_ov97_02237808.h"
|
||||
#include "savedata/save_table.h"
|
||||
|
||||
#include "bg_window.h"
|
||||
@@ -352,9 +351,9 @@ typedef struct {
|
||||
Window unk_18;
|
||||
Window unk_28;
|
||||
Window unk_38;
|
||||
UnkStruct_ov97_02237808 unk_48;
|
||||
UnkStruct_ov97_02237808 unk_9C;
|
||||
UnkStruct_ov97_02237808 unk_F0;
|
||||
MainMenuWindow unk_48;
|
||||
MainMenuWindow unk_9C;
|
||||
MainMenuWindow unk_F0;
|
||||
int unk_144;
|
||||
int unk_148;
|
||||
int unk_14C;
|
||||
@@ -529,10 +528,10 @@ static void ov97_0222C254(UnkStruct_ov97_0222C388 *param0)
|
||||
GXLayers_SetBanks(&v1);
|
||||
|
||||
SetAllGraphicsModes(&v2);
|
||||
ov97_022376FC(param0->unk_04, 0, 1, 0xF000, 0x0);
|
||||
ov97_022376FC(param0->unk_04, 1, 1, 0xF800, 0x4000);
|
||||
ov97_022376FC(param0->unk_04, 4, 1, 0x7800, 0x0);
|
||||
ov97_022376FC(param0->unk_04, 5, 1, 0x7000, 0x4000);
|
||||
MainMenuUtil_InitBG(param0->unk_04, 0, 1, 0xF000, 0x0);
|
||||
MainMenuUtil_InitBG(param0->unk_04, 1, 1, 0xF800, 0x4000);
|
||||
MainMenuUtil_InitBG(param0->unk_04, 4, 1, 0x7800, 0x0);
|
||||
MainMenuUtil_InitBG(param0->unk_04, 5, 1, 0x7000, 0x4000);
|
||||
|
||||
Text_ResetAllPrinters();
|
||||
Font_LoadTextPalette(0, 0 * 32, param0->heapID);
|
||||
@@ -561,12 +560,12 @@ static void ov97_0222C388(UnkStruct_ov97_0222C388 *param0)
|
||||
|
||||
static BOOL ov97_0222C404(UnkStruct_ov97_0222C388 *param0)
|
||||
{
|
||||
UnkStruct_ov97_02237808 v0;
|
||||
MainMenuWindow v0;
|
||||
|
||||
if (Window_IsInUse(¶m0->unk_18) == 0) {
|
||||
ov97_02237808(&v0, ¶m0->unk_18, 0, 14, 1, 1);
|
||||
ov97_02237858(&v0, 22, 16, param0->unk_144);
|
||||
ov97_0223795C(param0->unk_04, &v0, 5, 4, 2);
|
||||
MainMenuUtil_InitWindow(&v0, ¶m0->unk_18, 0, 14, 1, 1);
|
||||
MainMenuWindow_SetDimensionsAndBasetile(&v0, 22, 16, param0->unk_144);
|
||||
MainMenuUtil_ShowWindowAtPos(param0->unk_04, &v0, 5, 4, 2);
|
||||
return 1;
|
||||
} else {
|
||||
if (gSystem.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) {
|
||||
@@ -583,25 +582,25 @@ static void ov97_0222C578(UnkStruct_ov97_0222C388 *param0);
|
||||
|
||||
static void ov97_0222C47C(UnkStruct_ov97_0222C388 *param0)
|
||||
{
|
||||
ov97_02237808(¶m0->unk_48, ¶m0->unk_28, 0, 421, (1 + 9), 2);
|
||||
ov97_02237858(¶m0->unk_48, 27, 4, param0->unk_144);
|
||||
ov97_02237860(¶m0->unk_48, 1, 1);
|
||||
ov97_0223795C(param0->unk_04, ¶m0->unk_48, 2, 19, 70);
|
||||
MainMenuUtil_InitWindow(¶m0->unk_48, ¶m0->unk_28, 0, 421, (1 + 9), 2);
|
||||
MainMenuWindow_SetDimensionsAndBasetile(¶m0->unk_48, 27, 4, param0->unk_144);
|
||||
MainMenuWindow_SetScrollableAndFont(¶m0->unk_48, 1, 1);
|
||||
MainMenuUtil_ShowWindowAtPos(param0->unk_04, ¶m0->unk_48, 2, 19, 70);
|
||||
|
||||
param0->unk_144 += ov97_02237A18(¶m0->unk_48);
|
||||
param0->unk_144 += MainMenuWindow_GetSize(¶m0->unk_48);
|
||||
|
||||
ov97_02237808(¶m0->unk_9C, ¶m0->unk_18, 0, 421, 1, 1);
|
||||
ov97_02237858(¶m0->unk_9C, 30, 4, param0->unk_144);
|
||||
ov97_02237860(¶m0->unk_9C, 0, 1);
|
||||
ov97_0223795C(param0->unk_04, ¶m0->unk_9C, 1, 1, 11);
|
||||
MainMenuUtil_InitWindow(¶m0->unk_9C, ¶m0->unk_18, 0, 421, 1, 1);
|
||||
MainMenuWindow_SetDimensionsAndBasetile(¶m0->unk_9C, 30, 4, param0->unk_144);
|
||||
MainMenuWindow_SetScrollableAndFont(¶m0->unk_9C, 0, 1);
|
||||
MainMenuUtil_ShowWindowAtPos(param0->unk_04, ¶m0->unk_9C, 1, 1, 11);
|
||||
|
||||
param0->unk_144 += ov97_02237A18(¶m0->unk_9C);
|
||||
param0->unk_144 += MainMenuWindow_GetSize(¶m0->unk_9C);
|
||||
|
||||
ov97_02237A20();
|
||||
ov97_02237A74();
|
||||
ov97_02237B0C(116, 10, 7, 9, 8, 0);
|
||||
MainMenuUtil_InitCharPlttTransferBuffers();
|
||||
MainMenuUtil_InitSpriteLoader();
|
||||
MainMenuUtil_LoadSprite(116, 10, 7, 9, 8, 0);
|
||||
|
||||
param0->unk_3170 = ov97_02237D14(0, param0->unk_3170, HW_LCD_WIDTH / 2, 76, 1);
|
||||
param0->unk_3170 = MainMenuUtil_InitSprite(0, param0->unk_3170, HW_LCD_WIDTH / 2, 76, 1);
|
||||
|
||||
ov97_0222C578(param0);
|
||||
}
|
||||
@@ -613,19 +612,19 @@ static void ov97_0222C578(UnkStruct_ov97_0222C388 *param0)
|
||||
UnkStruct_ov97_022335A8 v5;
|
||||
StringTemplate *v6 = StringTemplate_Default(param0->heapID);
|
||||
|
||||
ov97_02237808(¶m0->unk_F0, ¶m0->unk_38, 0, 421, 1, 1);
|
||||
ov97_02237858(¶m0->unk_F0, 26, 4, param0->unk_144);
|
||||
ov97_02237860(¶m0->unk_F0, 0, 1);
|
||||
MainMenuUtil_InitWindow(¶m0->unk_F0, ¶m0->unk_38, 0, 421, 1, 1);
|
||||
MainMenuWindow_SetDimensionsAndBasetile(¶m0->unk_F0, 26, 4, param0->unk_144);
|
||||
MainMenuWindow_SetScrollableAndFont(¶m0->unk_F0, 0, 1);
|
||||
|
||||
param0->unk_F0.unk_14 = v6;
|
||||
param0->unk_F0.strTemplate = v6;
|
||||
|
||||
StringTemplate_SetPlayerName(v6, 0, param0->unk_10);
|
||||
StringTemplate_SetNumber(v6, 1, TrainerInfo_ID_LowHalf(param0->unk_10), 5, 2, 1);
|
||||
|
||||
ov97_0223795C(param0->unk_04, ¶m0->unk_F0, 3, 13, 66);
|
||||
param0->unk_F0.unk_08 = 0;
|
||||
ov97_02237868(¶m0->unk_F0, 0, Font_GetAttribute(FONT_SYSTEM, FONTATTR_MAX_LETTER_HEIGHT));
|
||||
ov97_0223795C(param0->unk_04, ¶m0->unk_F0, -1, -1, 68);
|
||||
MainMenuUtil_ShowWindowAtPos(param0->unk_04, ¶m0->unk_F0, 3, 13, 66);
|
||||
param0->unk_F0.clearBeforePrinting = 0;
|
||||
MainMenuWindow_SetTextOffsets(¶m0->unk_F0, 0, Font_GetAttribute(FONT_SYSTEM, FONTATTR_MAX_LETTER_HEIGHT));
|
||||
MainMenuUtil_ShowWindowAtPos(param0->unk_04, ¶m0->unk_F0, -1, -1, 68);
|
||||
|
||||
OS_GetMacAddress(v4);
|
||||
|
||||
@@ -635,9 +634,9 @@ static void ov97_0222C578(UnkStruct_ov97_0222C388 *param0)
|
||||
StringTemplate_SetNumber(v6, 0, v0, 4, 2, 1);
|
||||
StringTemplate_SetNumber(v6, 1, v1, 4, 2, 1);
|
||||
|
||||
param0->unk_F0.unk_0C = 1;
|
||||
param0->unk_F0.textRightAligned = 1;
|
||||
|
||||
ov97_0223795C(param0->unk_04, ¶m0->unk_F0, -1, -1, 69);
|
||||
MainMenuUtil_ShowWindowAtPos(param0->unk_04, ¶m0->unk_F0, -1, -1, 69);
|
||||
StringTemplate_Free(v6);
|
||||
}
|
||||
|
||||
@@ -646,7 +645,7 @@ static void ov97_0222C688(ApplicationManager *appMan)
|
||||
int v0;
|
||||
UnkStruct_ov97_0222C388 *v1 = ApplicationManager_Data(appMan);
|
||||
|
||||
ov97_02237DA0();
|
||||
MainMenuUtil_FreeSprites();
|
||||
|
||||
if (Window_IsInUse(&v1->unk_18) == 1) {
|
||||
Window_ClearAndCopyToVRAM(&v1->unk_18);
|
||||
@@ -666,7 +665,7 @@ static void ov97_0222C688(ApplicationManager *appMan)
|
||||
|
||||
static int ov97_0222C6F8(ApplicationManager *appMan, int *param1)
|
||||
{
|
||||
UnkStruct_ov97_0222C388 *v0 = ov97_022376C4(appMan, HEAP_ID_85, sizeof(UnkStruct_ov97_0222C388), 0x20000);
|
||||
UnkStruct_ov97_0222C388 *v0 = MainMenuUtil_InitAppAndFadeToBlack(appMan, HEAP_ID_85, sizeof(UnkStruct_ov97_0222C388), 0x20000);
|
||||
|
||||
v0->heapID = HEAP_ID_85;
|
||||
v0->unk_04 = BgConfig_New(v0->heapID);
|
||||
@@ -675,7 +674,7 @@ static int ov97_0222C6F8(ApplicationManager *appMan, int *param1)
|
||||
v0->unk_0C = SaveData_GetPokedex(v0->saveData);
|
||||
v0->options = SaveData_GetOptions(v0->saveData);
|
||||
|
||||
ov97_02237694(v0->heapID);
|
||||
MainMenuUtil_Init(v0->heapID);
|
||||
|
||||
v0->unk_3174 = SaveData_GetMysteryGift(v0->saveData);
|
||||
v0->unk_14C = UnkEnum_ov97_0222C78C_09;
|
||||
@@ -699,44 +698,44 @@ static int ov97_0222C78C(ApplicationManager *appMan, int *param1)
|
||||
ov97_0222C254(v0);
|
||||
|
||||
if (Pokedex_IsObtained(v0->unk_0C) == FALSE) {
|
||||
ov97_02237790(1, UnkEnum_ov97_0222C78C_01, param1, UnkEnum_ov97_0222C78C_13);
|
||||
MainMenuUtil_StartScreenFadeToState(1, UnkEnum_ov97_0222C78C_01, param1, UnkEnum_ov97_0222C78C_13);
|
||||
} else {
|
||||
*param1 = UnkEnum_ov97_0222C78C_02;
|
||||
}
|
||||
break;
|
||||
case UnkEnum_ov97_0222C78C_01:
|
||||
if (ov97_0222C404(v0) == 0) {
|
||||
ov97_02237784(1);
|
||||
ov97_02237790(0, UnkEnum_ov97_0222C78C_12, param1, UnkEnum_ov97_0222C78C_13);
|
||||
MainMenuUtil_SetFadeToWhite(1);
|
||||
MainMenuUtil_StartScreenFadeToState(0, UnkEnum_ov97_0222C78C_12, param1, UnkEnum_ov97_0222C78C_13);
|
||||
}
|
||||
break;
|
||||
case UnkEnum_ov97_0222C78C_02:
|
||||
ov97_0222C47C(v0);
|
||||
|
||||
if (MysteryGift_CheckFreePgtSlotExists(v0->unk_3174) == 0) {
|
||||
v0->unk_48.unk_50 = 1;
|
||||
v0->unk_317C = ov97_0223795C(v0->unk_04, &v0->unk_48, 2, 19, 21);
|
||||
ov97_02237790(1, UnkEnum_ov97_0222C78C_03, param1, UnkEnum_ov97_0222C78C_13);
|
||||
v0->unk_48.renderDelay = 1;
|
||||
v0->unk_317C = MainMenuUtil_ShowWindowAtPos(v0->unk_04, &v0->unk_48, 2, 19, 21);
|
||||
MainMenuUtil_StartScreenFadeToState(1, UnkEnum_ov97_0222C78C_03, param1, UnkEnum_ov97_0222C78C_13);
|
||||
} else {
|
||||
v0->unk_14C = UnkEnum_ov97_0222C78C_07;
|
||||
ov97_02237790(1, UnkEnum_ov97_0222C78C_04, param1, UnkEnum_ov97_0222C78C_13);
|
||||
MainMenuUtil_StartScreenFadeToState(1, UnkEnum_ov97_0222C78C_04, param1, UnkEnum_ov97_0222C78C_13);
|
||||
}
|
||||
break;
|
||||
case UnkEnum_ov97_0222C78C_03:
|
||||
if ((Text_IsPrinterActive(v0->unk_317C) == 0) && gSystem.pressedKeys & PAD_BUTTON_A) {
|
||||
ov97_02237784(1);
|
||||
ov97_02237790(0, UnkEnum_ov97_0222C78C_12, param1, UnkEnum_ov97_0222C78C_13);
|
||||
MainMenuUtil_SetFadeToWhite(1);
|
||||
MainMenuUtil_StartScreenFadeToState(0, UnkEnum_ov97_0222C78C_12, param1, UnkEnum_ov97_0222C78C_13);
|
||||
}
|
||||
break;
|
||||
case UnkEnum_ov97_0222C78C_04:
|
||||
v0->unk_150 = ov97_0222CB10(v0);
|
||||
|
||||
if (v0->unk_150 == 5) {
|
||||
ov97_02237784(1);
|
||||
ov97_02237790(0, UnkEnum_ov97_0222C78C_12, param1, UnkEnum_ov97_0222C78C_13);
|
||||
MainMenuUtil_SetFadeToWhite(1);
|
||||
MainMenuUtil_StartScreenFadeToState(0, UnkEnum_ov97_0222C78C_12, param1, UnkEnum_ov97_0222C78C_13);
|
||||
} else if (v0->unk_150 == 4) {
|
||||
ov97_02237784(1);
|
||||
ov97_02237790(0, UnkEnum_ov97_0222C78C_12, param1, UnkEnum_ov97_0222C78C_13);
|
||||
MainMenuUtil_SetFadeToWhite(1);
|
||||
MainMenuUtil_StartScreenFadeToState(0, UnkEnum_ov97_0222C78C_12, param1, UnkEnum_ov97_0222C78C_13);
|
||||
}
|
||||
break;
|
||||
case UnkEnum_ov97_0222C78C_05:
|
||||
@@ -746,12 +745,12 @@ static int ov97_0222C78C(ApplicationManager *appMan, int *param1)
|
||||
GXLayers_EngineBToggleLayers(GX_PLANEMASK_BG1, 0);
|
||||
|
||||
WonderCardsApp_ShowWondercard(v0->unk_04, &v0->unk_3180, HEAP_ID_85);
|
||||
ov97_02237790(1, UnkEnum_ov97_0222C78C_06, param1, UnkEnum_ov97_0222C78C_13);
|
||||
MainMenuUtil_StartScreenFadeToState(1, UnkEnum_ov97_0222C78C_06, param1, UnkEnum_ov97_0222C78C_13);
|
||||
v0->unk_3180.eventHeader.hasWonderCard = 0;
|
||||
break;
|
||||
case UnkEnum_ov97_0222C78C_06:
|
||||
if (gSystem.pressedKeys) {
|
||||
ov97_02237790(0, UnkEnum_ov97_0222C78C_11, param1, UnkEnum_ov97_0222C78C_13);
|
||||
MainMenuUtil_StartScreenFadeToState(0, UnkEnum_ov97_0222C78C_11, param1, UnkEnum_ov97_0222C78C_13);
|
||||
}
|
||||
break;
|
||||
case UnkEnum_ov97_0222C78C_11:
|
||||
@@ -762,11 +761,11 @@ static int ov97_0222C78C(ApplicationManager *appMan, int *param1)
|
||||
return 1;
|
||||
break;
|
||||
case UnkEnum_ov97_0222C78C_13:
|
||||
ov97_022377F0(param1);
|
||||
MainMenuUtil_CheckScreenFadeDone(param1);
|
||||
break;
|
||||
}
|
||||
|
||||
ov97_02237CA0();
|
||||
MainMenuUtil_UpdateSpritesSkipGift();
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -800,7 +799,7 @@ static void ov97_0222C974(UnkStruct_ov97_0222C388 *param0)
|
||||
Strbuf_ToChars((const Strbuf *)v1, v4->eventHeader.title, 36);
|
||||
Strbuf_Free(v1);
|
||||
|
||||
v4->eventHeader.validGames = (ov97_02237E4C(10) | ov97_02237E4C(11) | ov97_02237E4C(12));
|
||||
v4->eventHeader.validGames = (MainMenuUtil_CalcMysteryGiftVersionBit(10) | MainMenuUtil_CalcMysteryGiftVersionBit(11) | MainMenuUtil_CalcMysteryGiftVersionBit(12));
|
||||
v4->eventHeader.id = 1;
|
||||
v4->eventHeader.unique = 0;
|
||||
v4->eventHeader.unk_4E_1 = 0;
|
||||
@@ -826,7 +825,7 @@ static void ov97_0222C974(UnkStruct_ov97_0222C388 *param0)
|
||||
MysteryGift_TrySavePgt(param0->unk_3174, &v4->pgt, 3);
|
||||
GXLayers_EngineBToggleLayers(GX_PLANEMASK_BG0, 0);
|
||||
|
||||
ov97_02238194(param0->unk_04, v4);
|
||||
MainMenuUtil_LoadGiftSprite(param0->unk_04, v4);
|
||||
}
|
||||
|
||||
static void ov97_0222CAAC(UnkStruct_ov97_0222C388 *param0, int param1)
|
||||
@@ -921,7 +920,7 @@ int ov97_0222CB10(UnkStruct_ov97_0222C388 *param0)
|
||||
}
|
||||
break;
|
||||
case UnkEnum_ov97_0222C6F8_29:
|
||||
ov97_0223795C(param0->unk_04, ¶m0->unk_48, 2, 19, 30);
|
||||
MainMenuUtil_ShowWindowAtPos(param0->unk_04, ¶m0->unk_48, 2, 19, 30);
|
||||
Sprite_SetDrawFlag(param0->unk_3170, FALSE);
|
||||
DestroyWaitDial(param0->unk_34D8);
|
||||
param0->unk_34D8 = NULL;
|
||||
@@ -947,7 +946,7 @@ int ov97_0222CB10(UnkStruct_ov97_0222C388 *param0)
|
||||
ov97_0223329C();
|
||||
*v3 = UnkEnum_ov97_0222C6F8_10;
|
||||
param0->unk_160 = 3200;
|
||||
ov97_0223795C(param0->unk_04, ¶m0->unk_48, 2, 19, 34);
|
||||
MainMenuUtil_ShowWindowAtPos(param0->unk_04, ¶m0->unk_48, 2, 19, 34);
|
||||
Sound_PlayEffect(SEQ_SE_CONFIRM);
|
||||
param0->unk_34D8 = NULL;
|
||||
|
||||
@@ -958,7 +957,7 @@ int ov97_0222CB10(UnkStruct_ov97_0222C388 *param0)
|
||||
break;
|
||||
case UnkEnum_ov97_0222C6F8_10:
|
||||
if (ov97_022332F4()) {
|
||||
ov97_0223795C(param0->unk_04, ¶m0->unk_48, 2, 19, 71);
|
||||
MainMenuUtil_ShowWindowAtPos(param0->unk_04, ¶m0->unk_48, 2, 19, 71);
|
||||
Sprite_SetDrawFlag(param0->unk_3170, TRUE);
|
||||
ov97_0222C578(param0);
|
||||
*v3 = UnkEnum_ov97_0222C6F8_11;
|
||||
@@ -975,22 +974,22 @@ int ov97_0222CB10(UnkStruct_ov97_0222C388 *param0)
|
||||
if (ov97_02233320()) {
|
||||
*v3 = UnkEnum_ov97_0222C6F8_13;
|
||||
param0->unk_160 = 60;
|
||||
ov97_0223795C(param0->unk_04, ¶m0->unk_48, 2, 19, 71);
|
||||
MainMenuUtil_ShowWindowAtPos(param0->unk_04, ¶m0->unk_48, 2, 19, 71);
|
||||
}
|
||||
|
||||
ov97_0222CAB4(param0, v3, 1, PAD_BUTTON_B);
|
||||
break;
|
||||
case UnkEnum_ov97_0222C6F8_13:
|
||||
if (--param0->unk_160 == 0) {
|
||||
ov97_0223795C(param0->unk_04, ¶m0->unk_48, 2, 19, 72);
|
||||
MainMenuUtil_ShowWindowAtPos(param0->unk_04, ¶m0->unk_48, 2, 19, 72);
|
||||
param0->unk_34D8 = Window_AddWaitDial(¶m0->unk_28, (1 + 9));
|
||||
ov97_0222C974(param0);
|
||||
ov97_0223846C(param0->saveData);
|
||||
MainMenuUtil_InitSaving(param0->saveData);
|
||||
*v3 = UnkEnum_ov97_0222C6F8_14;
|
||||
}
|
||||
break;
|
||||
case UnkEnum_ov97_0222C6F8_14:
|
||||
if (ov97_0223847C() == 1) {
|
||||
if (MainMenuUtil_SaveState() == 1) {
|
||||
*v3 = UnkEnum_ov97_0222C6F8_15;
|
||||
param0->unk_160 = 6 + (OS_GetTickLo() % 54);
|
||||
}
|
||||
@@ -1007,7 +1006,7 @@ int ov97_0222CB10(UnkStruct_ov97_0222C388 *param0)
|
||||
break;
|
||||
case UnkEnum_ov97_0222C6F8_17:
|
||||
if (ov97_0223334C()) {
|
||||
ov97_022384F4();
|
||||
MainMenuUtil_ContinueSaving();
|
||||
|
||||
*v3 = UnkEnum_ov97_0222C6F8_18;
|
||||
param0->unk_160 = 800;
|
||||
@@ -1027,12 +1026,12 @@ int ov97_0222CB10(UnkStruct_ov97_0222C388 *param0)
|
||||
}
|
||||
break;
|
||||
case UnkEnum_ov97_0222C6F8_18:
|
||||
if (ov97_02238528() == 3) {
|
||||
if (MainMenuUtil_GetSavingStatus() == 3) {
|
||||
ov97_022333BC();
|
||||
*v3 = UnkEnum_ov97_0222C6F8_22;
|
||||
param0->unk_160 = 120;
|
||||
} else if (ov97_02238528() != 2) {
|
||||
ov97_0223847C();
|
||||
} else if (MainMenuUtil_GetSavingStatus() != 2) {
|
||||
MainMenuUtil_SaveState();
|
||||
} else {
|
||||
if (ov97_02233320() || (!ov97_02233388())) {
|
||||
*v3 = UnkEnum_ov97_0222C6F8_19;
|
||||
@@ -1051,7 +1050,7 @@ int ov97_0222CB10(UnkStruct_ov97_0222C388 *param0)
|
||||
if (--param0->unk_160 == 0) {
|
||||
*v3 = UnkEnum_ov97_0222C6F8_20;
|
||||
|
||||
ov97_0223795C(param0->unk_04, ¶m0->unk_48, 2, 19, 73);
|
||||
MainMenuUtil_ShowWindowAtPos(param0->unk_04, ¶m0->unk_48, 2, 19, 73);
|
||||
|
||||
Sprite_SetDrawFlag(param0->unk_3170, FALSE);
|
||||
DestroyWaitDial(param0->unk_34D8);
|
||||
@@ -1077,7 +1076,7 @@ int ov97_0222CB10(UnkStruct_ov97_0222C388 *param0)
|
||||
case UnkEnum_ov97_0222C6F8_22:
|
||||
*v3 = UnkEnum_ov97_0222C6F8_23;
|
||||
case UnkEnum_ov97_0222C6F8_23:
|
||||
ov97_0223795C(param0->unk_04, ¶m0->unk_48, 2, 19, 74);
|
||||
MainMenuUtil_ShowWindowAtPos(param0->unk_04, ¶m0->unk_48, 2, 19, 74);
|
||||
Sprite_SetDrawFlag(param0->unk_3170, FALSE);
|
||||
|
||||
if (param0->unk_34D8) {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -596,7 +596,7 @@ static StateTransitionListMenuEntryTemplate sConfirmStartWirelessOptions[] = {
|
||||
|
||||
static ListMenuTemplate sWonderCardsAppListMenuTemplate = {
|
||||
.choices = NULL,
|
||||
.cursorCallback = ov97_022383C4,
|
||||
.cursorCallback = MainMenuUtil_ListMenuCursorCB,
|
||||
.printCallback = NULL,
|
||||
.window = NULL,
|
||||
.count = 0,
|
||||
@@ -618,9 +618,9 @@ static ListMenuTemplate sWonderCardsAppListMenuTemplate = {
|
||||
static void LoadWcShareScreenButtonsGraphics(WonderCardsAppData *appData)
|
||||
{
|
||||
ResetAllSprites(appData);
|
||||
ov97_02237A20();
|
||||
ov97_02237A74();
|
||||
ov97_02237B0C(NARC_INDEX_GRAPHIC__MYSTERY, 15, 12, 14, 13, 0);
|
||||
MainMenuUtil_InitCharPlttTransferBuffers();
|
||||
MainMenuUtil_InitSpriteLoader();
|
||||
MainMenuUtil_LoadSprite(NARC_INDEX_GRAPHIC__MYSTERY, 15, 12, 14, 13, 0);
|
||||
}
|
||||
|
||||
static void ResetAllSprites(WonderCardsAppData *appData)
|
||||
@@ -648,16 +648,16 @@ static void ResetAllSprites(WonderCardsAppData *appData)
|
||||
}
|
||||
|
||||
appData->selectedWcSprites[0] = appData->selectedWcSprites[1] = appData->selectedWcSprites[2] = NULL;
|
||||
ov97_02237DA0();
|
||||
MainMenuUtil_FreeSprites();
|
||||
}
|
||||
|
||||
static void ShowWcShareButtons(WonderCardsAppData *appData)
|
||||
{
|
||||
appData->shareScreenSelectedBtn = 0;
|
||||
appData->shareScreenBtnSprites[WC_SHARE_BTN_SEND] = ov97_02237D14(0, appData->shareScreenBtnSprites[WC_SHARE_BTN_SEND], 72, WONDERCARD_HEIGHT, 1);
|
||||
appData->shareScreenBtnSprites[WC_SHARE_BTN_SEND] = MainMenuUtil_InitSprite(0, appData->shareScreenBtnSprites[WC_SHARE_BTN_SEND], 72, WONDERCARD_HEIGHT, 1);
|
||||
Sprite_SetExplicitPriority(appData->shareScreenBtnSprites[WC_SHARE_BTN_SEND], 2);
|
||||
|
||||
appData->shareScreenBtnSprites[WC_SHARE_BTN_CANCEL] = ov97_02237D14(0, appData->shareScreenBtnSprites[WC_SHARE_BTN_CANCEL], 184, WONDERCARD_HEIGHT, 0);
|
||||
appData->shareScreenBtnSprites[WC_SHARE_BTN_CANCEL] = MainMenuUtil_InitSprite(0, appData->shareScreenBtnSprites[WC_SHARE_BTN_CANCEL], 184, WONDERCARD_HEIGHT, 0);
|
||||
Sprite_SetExplicitPriority(appData->shareScreenBtnSprites[WC_SHARE_BTN_CANCEL], 2);
|
||||
}
|
||||
|
||||
@@ -1154,13 +1154,13 @@ static void LoadPokemonSpritesForSelectedWc(WonderCardsAppData *appData)
|
||||
int spriteX, i; // forward declarations required to match
|
||||
|
||||
if (appData->selectedWcSprites[0] == NULL && appData->selectedWcSprites[1] == NULL && appData->selectedWcSprites[2] == NULL) {
|
||||
if (ov97_02237A60() == TRUE) {
|
||||
if (MainMenuUtil_CheckSpriteLoaderInit() == TRUE) {
|
||||
ResetAllSprites(appData);
|
||||
}
|
||||
|
||||
ov97_02237A20();
|
||||
ov97_02237A74();
|
||||
ov97_02237B0C(NARC_INDEX_GRAPHIC__MYSTERY, 26, 23, 25, 24, 0);
|
||||
MainMenuUtil_InitCharPlttTransferBuffers();
|
||||
MainMenuUtil_InitSpriteLoader();
|
||||
MainMenuUtil_LoadSprite(NARC_INDEX_GRAPHIC__MYSTERY, 26, 23, 25, 24, 0);
|
||||
|
||||
Graphics_LoadPalette(NARC_INDEX_POKETOOL__ICONGRA__PL_POKE_ICON, PokeIconPalettesFileIndex(), PAL_LOAD_MAIN_OBJ, PLTT_OFFSET(3), 0, appData->heapID);
|
||||
}
|
||||
@@ -1181,7 +1181,7 @@ static void LoadPokemonSpritesForSelectedWc(WonderCardsAppData *appData)
|
||||
|
||||
NNSG2dCharacterData *charData;
|
||||
|
||||
appData->selectedWcSprites[i] = ov97_02237D14(0, appData->selectedWcSprites[i], spriteX, 16, 10 + i);
|
||||
appData->selectedWcSprites[i] = MainMenuUtil_InitSprite(0, appData->selectedWcSprites[i], spriteX, 16, 10 + i);
|
||||
u8 *ncgrBuffer = Graphics_GetCharData(NARC_INDEX_POKETOOL__ICONGRA__PL_POKE_ICON, PokeIconSpriteIndex(species, FALSE, HEAP_ID_SYSTEM), FALSE, &charData, appData->heapID);
|
||||
|
||||
DC_FlushRange(charData->pRawData, (4 * 4 * 0x20));
|
||||
@@ -1208,7 +1208,7 @@ static BOOL WonderCardsApp_Init(ApplicationManager *appMan, int *unused)
|
||||
appData->selectedWondercardSlot = NUM_WONDERCARD_SLOTS - 1;
|
||||
appData->numPlayerConnections = 1;
|
||||
|
||||
ov97_02237694(HEAP_ID_WONDER_CARDS_APP);
|
||||
MainMenuUtil_Init(HEAP_ID_WONDER_CARDS_APP);
|
||||
Heap_Create(HEAP_ID_SYSTEM, HEAP_ID_91, 0x300);
|
||||
|
||||
return TRUE;
|
||||
@@ -1317,7 +1317,7 @@ static BOOL RunFlipAnimFrame(WonderCardsAppData *appData)
|
||||
|
||||
static void WonderCardsAppCallbackSaveGame(WonderCardsAppData *appData)
|
||||
{
|
||||
int stage = ov97_0223847C();
|
||||
int stage = MainMenuUtil_SaveState();
|
||||
|
||||
if (stage == 2 || stage == 3) {
|
||||
Sound_PlayEffect(SEQ_SE_DP_SAVE);
|
||||
@@ -1339,7 +1339,7 @@ static void UpdateShareCount(WonderCardsAppData *appData)
|
||||
}
|
||||
|
||||
SaveData_SetChecksum(SAVE_TABLE_ENTRY_MYSTERY_GIFT);
|
||||
ov97_0223846C(appData->saveData);
|
||||
MainMenuUtil_InitSaving(appData->saveData);
|
||||
|
||||
appData->mainCallback = WonderCardsAppCallbackSaveGame;
|
||||
}
|
||||
@@ -1578,21 +1578,21 @@ static int WonderCardsApp_Main(ApplicationManager *appMan, enum WonderCardsAppSt
|
||||
break;
|
||||
case WC_APP_STATE_DISTRIBUTION_UNDERWAY:
|
||||
if (--appData->shouldSendWc == FALSE) {
|
||||
ov97_0223829C(&appData->mysteryGiftAppData.eventData, &appData->currentWonderCard, appData->heapID);
|
||||
MainMenuUtil_EncryptWonderCard(&appData->mysteryGiftAppData.eventData, &appData->currentWonderCard, appData->heapID);
|
||||
ov97_0222D1F0((const void *)&appData->currentWonderCard, sizeof(WonderCard));
|
||||
UpdateShareCount(appData);
|
||||
*state = WC_APP_STATE_START_COMM_SYNC;
|
||||
}
|
||||
break;
|
||||
case WC_APP_STATE_START_COMM_SYNC:
|
||||
if (ov97_02238528() == 4) {
|
||||
if (MainMenuUtil_GetSavingStatus() == 4) {
|
||||
CommTiming_StartSync(0x93);
|
||||
*state = WC_APP_STATE_WAIT_FOR_COMM_SYNC;
|
||||
}
|
||||
break;
|
||||
case WC_APP_STATE_WAIT_FOR_COMM_SYNC:
|
||||
if (CountConnectedPlayers(appData) == 0 || CommTiming_IsSyncState(0x93) == TRUE) {
|
||||
ov97_022384F4();
|
||||
MainMenuUtil_ContinueSaving();
|
||||
ShowWindowFromTemplateIndex(appData, &appData->messageBox, MSG_BOX_DISTRIBUTION_SUCCESSFUL, 640);
|
||||
DestroyWaitDial(appData->waitDial);
|
||||
StopWirelessCommunication(appData, state, WC_APP_STATE_DISTRIBUTION_SUCCESSFUL);
|
||||
@@ -1624,7 +1624,7 @@ static int WonderCardsApp_Main(ApplicationManager *appMan, enum WonderCardsAppSt
|
||||
SpriteList_Update(appData->spriteList);
|
||||
}
|
||||
|
||||
ov97_02237CA0();
|
||||
MainMenuUtil_UpdateSpritesSkipGift();
|
||||
|
||||
if (appData->mainCallback) {
|
||||
appData->mainCallback(appData);
|
||||
|
||||
Reference in New Issue
Block a user