Documentation, 3

This commit is contained in:
PikalaxALT 2025-08-23 19:07:52 -04:00
parent 79cf3cbefc
commit 651df977d1
No known key found for this signature in database
GPG Key ID: 7774E96AA69E5B61
17 changed files with 90 additions and 90 deletions

View File

@ -24,9 +24,9 @@ typedef struct PokegearConfigureAppData {
int substate; // 0x08
PokegearAppData *pokegear; // 0x0C
u8 unk_10; // 0x10 unused
u8 selectedBackgroundStyle; // 0x11
u8 selectedSkin; // 0x11
u16 unlockedSkins : 9; // 0x12
u16 backgroundStyle : 7; // 0x12
u16 skin : 7; // 0x12
Sprite *sprites[9]; // 0x14
TouchscreenListMenuSpawner *contextMenuSpawner; // 0x38
LISTMENUITEM *contextMenuItems; // 0x3C
@ -42,14 +42,14 @@ BOOL PokegearConfigure_SwapSkins(PokegearConfigureAppData *configureApp);
void PokegearConfigure_LoadGraphics_Internal(PokegearConfigureAppData *configureApp);
void PokegearConfigure_UnloadGraphics_Internal(PokegearConfigureAppData *configureApp);
void ov101_021EF26C(PokegearConfigureAppData *configureApp, int a1);
void ov101_021EF384(PokegearConfigureAppData *configureApp, int backgroundStyle);
void PokegearConfigure_LoadPalettes(PokegearConfigureAppData *configureApp, BOOL isInit);
void PokegearConfigure_SetNewSkin(PokegearConfigureAppData *configureApp, int skin);
void PokegearConfigure_DrawUnlockedSkinsButtons(PokegearConfigureAppData *configureApp);
void ov101_021EF4B0(void *appData);
void ov101_021EF4DC(PokegearConfigureAppData *configureApp);
void ov101_021EF50C(PokegearConfigureAppData *configureApp, u8 a1);
void ov101_021EF5A4(PokegearConfigureAppData *configureApp, int a1, int a2);
void PokegearConfigure_OnReselectApp(void *appData);
void PokegearConfigure_SetAppCursorActive(PokegearConfigureAppData *configureApp);
void PokegearConfigure_SpawnContextMenu(PokegearConfigureAppData *configureApp, u8 a1);
void PokegearConfigure_ToggleButtonFocusState(PokegearConfigureAppData *configureApp, int skin, int selected);
int PokegearConfigure_HandleKeyInput(PokegearConfigureAppData *configureApp);
int PokegearConfigure_HandleTouchInput(PokegearConfigureAppData *configureApp);

View File

@ -254,7 +254,7 @@ struct PokegearPhoneAppData {
int subsubtaskState; // 0x008
PokegearAppData *pokegear; // 0x00C
u8 menuInputStateBak; // 0x010
u8 backgroundStyle; // 0x011
u8 skin; // 0x011
MsgData *msgData; // 0x014
MessageFormat *msgFormat; // 0x018
String *msgFormatBuf; // 0x01C

View File

@ -139,7 +139,7 @@ struct PokegearAppData {
u8 isSwitchApp : 1; // 0x005
u8 cursorInAppSwitchZone; // 0x006
u8 needClockUpdate; // 0x007
u8 backgroundStyle; // 0x008
u8 skin; // 0x008
u8 fadeCounter; // 0x009
MenuInputState menuInputState; // 0x00C
MenuInputState menuInputStateBak; // 0x010

View File

@ -81,7 +81,7 @@ typedef struct PokegearRadioAppData {
u8 unk_24_0 : 1; // 0x24 unused
u8 isDraggingCursor : 4; // 0x24
u8 selectedButton : 3; // 0x24
u8 backgroundStyle; // 0x25
u8 skin; // 0x25
u8 stationSelection : 4; // 0x26
u8 signalStrength : 2; // 0x26
u8 stationActive : 2; // 0x26

View File

@ -45,7 +45,7 @@ typedef struct SavePokegear {
u8 unk_3;
u32 unlockedSkins : 9;
u32 unk_4_9 : 9;
u32 backgroundStyle : 7;
u32 skin : 7;
u32 registeredCards : 2;
// mapUnlockLevel
// 0: only Johto

View File

@ -108,7 +108,7 @@ BOOL PokegearConfigure_LoadGFX(PokegearConfigureAppData *configureApp) {
PokegearConfigure_InitBGs(configureApp);
PokegearConfigure_LoadGraphics(configureApp);
PokegearConfigure_CreateSpriteManager(configureApp);
ov101_021EF26C(configureApp, 1);
PokegearConfigure_LoadPalettes(configureApp, TRUE);
break;
case 1:
PokegearConfigure_CreateSprites(configureApp);
@ -139,7 +139,7 @@ int PokegearConfigure_ContextMenu(PokegearConfigureAppData *configureApp) {
if (input != LIST_NOTHING_CHOSEN) {
configureApp->pokegear->menuInputState = (MenuInputState)TouchscreenListMenu_WasLastInputTouch(configureApp->contextMenu);
TouchscreenListMenu_Destroy(configureApp->contextMenu);
ov101_021EF5A4(configureApp, 0, 0);
PokegearConfigure_ToggleButtonFocusState(configureApp, 0, FALSE);
PokegearCursorManager_SetCursorSpritesAnimateFlag(configureApp->pokegear->cursorManager, 0xFFFF, TRUE);
if (input == 0) {
return PGCONF_MAIN_STATE_SWAP_SKINS;
@ -153,14 +153,14 @@ int PokegearConfigure_ContextMenu(PokegearConfigureAppData *configureApp) {
static void PokegearConfigure_LoadAndSetSkin(PokegearConfigureAppData *configureApp) {
PokegearConfigure_UnloadGraphics_Internal(configureApp);
configureApp->backgroundStyle = configureApp->selectedBackgroundStyle;
configureApp->pokegear->backgroundStyle = configureApp->backgroundStyle;
PokegearApp_LoadSkinGraphics(configureApp->pokegear, configureApp->backgroundStyle);
ov100_021E6A58(configureApp->pokegear->unk_094, configureApp->backgroundStyle);
configureApp->skin = configureApp->selectedSkin;
configureApp->pokegear->skin = configureApp->skin;
PokegearApp_LoadSkinGraphics(configureApp->pokegear, configureApp->skin);
ov100_021E6A58(configureApp->pokegear->unk_094, configureApp->skin);
PokegearConfigure_LoadGraphics_Internal(configureApp);
ov101_021EF26C(configureApp, 0);
PokegearConfigure_LoadPalettes(configureApp, FALSE);
PokegearConfigure_DrawUnlockedSkinsButtons(configureApp);
ov101_021EF384(configureApp, configureApp->backgroundStyle);
PokegearConfigure_SetNewSkin(configureApp, configureApp->skin);
}
BOOL PokegearConfigure_SwapSkins(PokegearConfigureAppData *configureApp) {

View File

@ -35,9 +35,9 @@ void PokegearConfigure_LoadGraphics_Internal(PokegearConfigureAppData *configure
NARC *narc;
narc = NARC_New(NARC_a_1_4_5, configureApp->heapId);
BgConfig_LoadAssetFromOpenNarc(configureApp->pokegear->bgConfig, configureApp->heapId, narc, NARC_a_1_4_5, 10 + configureApp->backgroundStyle, GF_BG_LYR_MAIN_3, GF_BG_GFX_TYPE_CHAR, 0, 0);
BgConfig_LoadAssetFromOpenNarc(configureApp->pokegear->bgConfig, configureApp->heapId, narc, NARC_a_1_4_5, 16 + configureApp->backgroundStyle, GF_BG_LYR_MAIN_3, GF_BG_GFX_TYPE_SCRN, 0, 0);
configureApp->scrnDataRaw = GfGfxLoader_GetScrnDataFromOpenNarc(narc, 22 + configureApp->backgroundStyle, FALSE, &configureApp->scrnData, configureApp->heapId);
BgConfig_LoadAssetFromOpenNarc(configureApp->pokegear->bgConfig, configureApp->heapId, narc, NARC_a_1_4_5, 10 + configureApp->skin, GF_BG_LYR_MAIN_3, GF_BG_GFX_TYPE_CHAR, 0, 0);
BgConfig_LoadAssetFromOpenNarc(configureApp->pokegear->bgConfig, configureApp->heapId, narc, NARC_a_1_4_5, 16 + configureApp->skin, GF_BG_LYR_MAIN_3, GF_BG_GFX_TYPE_SCRN, 0, 0);
configureApp->scrnDataRaw = GfGfxLoader_GetScrnDataFromOpenNarc(narc, 22 + configureApp->skin, FALSE, &configureApp->scrnData, configureApp->heapId);
NARC_Delete(narc);
ScheduleBgTilemapBufferTransfer(configureApp->pokegear->bgConfig, GF_BG_LYR_MAIN_3);
}
@ -46,18 +46,18 @@ void PokegearConfigure_UnloadGraphics_Internal(PokegearConfigureAppData *configu
Heap_Free(configureApp->scrnDataRaw);
}
void ov101_021EF26C(PokegearConfigureAppData *configureApp, int a1) {
void PokegearConfigure_LoadPalettes(PokegearConfigureAppData *configureApp, BOOL isInit) {
NARC *narc;
narc = NARC_New(NARC_a_1_4_5, configureApp->heapId);
PaletteData_LoadFromOpenNarc(configureApp->pokegear->plttData, narc, 4 + configureApp->backgroundStyle, configureApp->heapId, PLTTBUF_MAIN_BG, 0x1C0, 0, 0);
PaletteData_LoadFromOpenNarc(configureApp->pokegear->plttData, narc, 4 + configureApp->backgroundStyle, configureApp->heapId, PLTTBUF_SUB_BG, 0x180, 0, 0);
if (a1) {
PaletteData_LoadFromOpenNarc(configureApp->pokegear->plttData, narc, 4 + configureApp->skin, configureApp->heapId, PLTTBUF_MAIN_BG, 0x1C0, 0, 0);
PaletteData_LoadFromOpenNarc(configureApp->pokegear->plttData, narc, 4 + configureApp->skin, configureApp->heapId, PLTTBUF_SUB_BG, 0x180, 0, 0);
if (isInit) {
PaletteData_LoadFromOpenNarc(configureApp->pokegear->plttData, narc, 0, configureApp->heapId, PLTTBUF_MAIN_OBJ, 0x160, 0x40, 0);
PaletteData_LoadFromOpenNarc(configureApp->pokegear->plttData, narc, 0, configureApp->heapId, PLTTBUF_SUB_OBJ, 0x160, 0x40, 0);
}
PaletteData_SetAutoTransparent(configureApp->pokegear->plttData, TRUE);
if (a1) {
if (isInit) {
PaletteData_BlendPalette(configureApp->pokegear->plttData, PLTTBUF_MAIN_BG, 0, 0xE0, 16, 0);
PaletteData_BlendPalette(configureApp->pokegear->plttData, PLTTBUF_MAIN_OBJ, 0x40, 0xC0, 16, 0);
} else {
@ -69,10 +69,10 @@ void ov101_021EF26C(PokegearConfigureAppData *configureApp, int a1) {
NARC_Delete(narc);
}
void ov101_021EF384(PokegearConfigureAppData *configureApp, int backgroundStyle) {
configureApp->backgroundStyle = backgroundStyle;
void PokegearConfigure_SetNewSkin(PokegearConfigureAppData *configureApp, int skin) {
configureApp->skin = skin;
BgClearTilemapBufferAndCommit(configureApp->pokegear->bgConfig, GF_BG_LYR_MAIN_2);
CopyToBgTilemapRect(configureApp->pokegear->bgConfig, GF_BG_LYR_MAIN_2, 10 * (backgroundStyle % 3) + 2, 9 * (backgroundStyle / 3) + 2, 9, 7, configureApp->scrnData->rawData, 0, 0, configureApp->scrnData->screenWidth / 8, configureApp->scrnData->screenHeight / 8);
CopyToBgTilemapRect(configureApp->pokegear->bgConfig, GF_BG_LYR_MAIN_2, 10 * (skin % 3) + 2, 9 * (skin / 3) + 2, 9, 7, configureApp->scrnData->rawData, 0, 0, configureApp->scrnData->screenWidth / 8, configureApp->scrnData->screenHeight / 8);
ScheduleBgTilemapBufferTransfer(configureApp->pokegear->bgConfig, GF_BG_LYR_MAIN_2);
}
@ -89,10 +89,10 @@ void PokegearConfigure_DrawUnlockedSkinsButtons(PokegearConfigureAppData *config
mask <<= 1;
}
ScheduleBgTilemapBufferTransfer(configureApp->pokegear->bgConfig, GF_BG_LYR_MAIN_3);
ov101_021EF384(configureApp, configureApp->backgroundStyle);
PokegearConfigure_SetNewSkin(configureApp, configureApp->skin);
}
void ov101_021EF4B0(void *appData) {
void PokegearConfigure_OnReselectApp(void *appData) {
PokegearConfigureAppData *configureApp = appData;
PokegearCursorManager_SetSpecIndexAndCursorPos(configureApp->pokegear->cursorManager, 1, 0xFF);
@ -100,33 +100,33 @@ void ov101_021EF4B0(void *appData) {
PokegearCursorManager_SetCursorSpritesDrawState(configureApp->pokegear->cursorManager, 1, TRUE);
}
void ov101_021EF4DC(PokegearConfigureAppData *configureApp) {
void PokegearConfigure_SetAppCursorActive(PokegearConfigureAppData *configureApp) {
configureApp->pokegear->cursorInAppSwitchZone = FALSE;
PokegearCursorManager_SetSpecIndexAndCursorPos(configureApp->pokegear->cursorManager, 1, 0xFF);
PokegearCursorManager_SetCursorSpritesDrawState(configureApp->pokegear->cursorManager, 0, FALSE);
PokegearCursorManager_SetCursorSpritesDrawState(configureApp->pokegear->cursorManager, 1, TRUE);
}
void ov101_021EF50C(PokegearConfigureAppData *configureApp, u8 backgroundStyle) {
void PokegearConfigure_SpawnContextMenu(PokegearConfigureAppData *configureApp, u8 skin) {
TouchscreenListMenuHeader header;
configureApp->selectedBackgroundStyle = backgroundStyle;
configureApp->selectedSkin = skin;
MI_CpuClear8(&header, sizeof(TouchscreenListMenuHeader));
header.template = sContextMenuTemplate;
header.listMenuItems = configureApp->contextMenuItems;
header.bgConfig = configureApp->pokegear->bgConfig;
header.numWindows = 2;
configureApp->contextMenu = TouchscreenListMenu_CreateWithAlignment(configureApp->contextMenuSpawner, &header, configureApp->pokegear->menuInputState, sContextMenuParam[backgroundStyle].x, sContextMenuParam[backgroundStyle].y, 0, 0, (enum TouchscreenListMenuTextAlignment)sContextMenuParam[backgroundStyle].alignment);
ov101_021EF5A4(configureApp, backgroundStyle, 1);
configureApp->contextMenu = TouchscreenListMenu_CreateWithAlignment(configureApp->contextMenuSpawner, &header, configureApp->pokegear->menuInputState, sContextMenuParam[skin].x, sContextMenuParam[skin].y, 0, 0, (enum TouchscreenListMenuTextAlignment)sContextMenuParam[skin].alignment);
PokegearConfigure_ToggleButtonFocusState(configureApp, skin, TRUE);
PokegearCursorManager_SetCursorSpritesAnimateFlag(configureApp->pokegear->cursorManager, 0xFFFF, FALSE);
}
void ov101_021EF5A4(PokegearConfigureAppData *configureApp, int a1, int a2) {
void PokegearConfigure_ToggleButtonFocusState(PokegearConfigureAppData *configureApp, int skin, BOOL selected) {
int x;
int y;
int width;
if (a2) {
if (selected) {
G2_SetWnd0InsidePlane(31, FALSE);
G2_SetWnd1InsidePlane(31, FALSE);
G2_SetWndOutsidePlane(31, TRUE);
@ -135,7 +135,7 @@ void ov101_021EF5A4(PokegearConfigureAppData *configureApp, int a1, int a2) {
y = configureApp->contextMenu->y * 8;
width = (configureApp->contextMenu->width + 2) * 8;
G2_SetWnd0Position(x, y, x + width, y + 56);
G2_SetWnd1Position(24 + (a1 % 3) * 80, 24 + (a1 / 3) * 72, 72 + (a1 % 3) * 80, 64 + (a1 / 3) * 72);
G2_SetWnd1Position(24 + (skin % 3) * 80, 24 + (skin / 3) * 72, 72 + (skin % 3) * 80, 64 + (skin / 3) * 72);
GX_SetVisibleWnd(GX_WNDMASK_W0 | GX_WNDMASK_W1);
G2_SetBlendBrightness(GX_BLEND_PLANEMASK_BG0 | GX_BLEND_PLANEMASK_BG1 | GX_BLEND_PLANEMASK_BG2 | GX_BLEND_PLANEMASK_BG3 | GX_BLEND_PLANEMASK_OBJ, -8);
} else {

View File

@ -2,9 +2,9 @@
#include "unk_02005D10.h"
BOOL ov101_021EF6D0(PokegearConfigureAppData *configureApp, u8 a1);
static BOOL PokegearConfigure_IsSkinUnlocked(PokegearConfigureAppData *configureApp, u8 skin);
const TouchscreenHitbox ov101_021F83E4[] = {
static const TouchscreenHitbox sTouchscreenHitboxes[] = {
{ .rect = { 24, 64, 24, 72 } },
{ .rect = { 24, 64, 104, 152 } },
{ .rect = { 24, 64, 184, 232 } },
@ -14,14 +14,14 @@ const TouchscreenHitbox ov101_021F83E4[] = {
{ .rect = { TOUCHSCREEN_RECTLIST_END } },
};
BOOL ov101_021EF6D0(PokegearConfigureAppData *configureApp, u8 a1) {
u16 r2 = 1;
r2 <<= a1;
return configureApp->unlockedSkins & r2;
static BOOL PokegearConfigure_IsSkinUnlocked(PokegearConfigureAppData *configureApp, u8 skin) {
u16 mask = 1;
mask <<= skin;
return configureApp->unlockedSkins & mask;
}
int PokegearConfigure_HandleKeyInput(PokegearConfigureAppData *configureApp) {
u8 r5;
u8 input;
if (gSystem.newKeys & PAD_BUTTON_B) {
configureApp->pokegear->cursorInAppSwitchZone = TRUE;
@ -32,13 +32,13 @@ int PokegearConfigure_HandleKeyInput(PokegearConfigureAppData *configureApp) {
return -1;
}
if (gSystem.newKeys & PAD_BUTTON_A) {
r5 = PokegearCursorManager_GetCursorPos(configureApp->pokegear->cursorManager);
if (!ov101_021EF6D0(configureApp, r5)) {
return -1;
input = PokegearCursorManager_GetCursorPos(configureApp->pokegear->cursorManager);
if (!PokegearConfigure_IsSkinUnlocked(configureApp, input)) {
return TOUCH_MENU_NO_INPUT;
}
ov101_021EF50C(configureApp, r5);
PokegearConfigure_SpawnContextMenu(configureApp, input);
PlaySE(SEQ_SE_GS_GEARDECIDE);
return 8;
return GEAR_RETURN_8;
}
if (gSystem.newKeys & PAD_KEY_LEFT) {
PokegearCursorManager_MoveActiveCursor(configureApp->pokegear->cursorManager, 0);
@ -53,29 +53,29 @@ int PokegearConfigure_HandleKeyInput(PokegearConfigureAppData *configureApp) {
PokegearCursorManager_MoveActiveCursor(configureApp->pokegear->cursorManager, 3);
PlaySE(SEQ_SE_GS_GEARCURSOR);
}
return -1;
return TOUCH_MENU_NO_INPUT;
}
int PokegearConfigure_HandleTouchInput(PokegearConfigureAppData *configureApp) {
int input;
input = PokegearApp_HandleTouchInput_SwitchApps(configureApp->pokegear);
if (input != -1) {
if (input != TOUCH_MENU_NO_INPUT) {
return input;
}
input = TouchscreenHitbox_FindRectAtTouchNew(ov101_021F83E4);
if (input != -1) {
if (!ov101_021EF6D0(configureApp, input)) {
return -1;
input = TouchscreenHitbox_FindRectAtTouchNew(sTouchscreenHitboxes);
if (input != TOUCH_MENU_NO_INPUT) {
if (!PokegearConfigure_IsSkinUnlocked(configureApp, input)) {
return TOUCH_MENU_NO_INPUT;
}
if (configureApp->pokegear->cursorInAppSwitchZone == TRUE) {
ov101_021EF4DC(configureApp);
PokegearConfigure_SetAppCursorActive(configureApp);
}
PokegearCursorManager_SetActiveCursorPosition(configureApp->pokegear->cursorManager, input);
ov101_021EF50C(configureApp, input);
PokegearConfigure_SpawnContextMenu(configureApp, input);
PlaySE(SEQ_SE_GS_GEARDECIDE);
configureApp->pokegear->menuInputState = MENU_INPUT_STATE_TOUCH;
return 8;
return GEAR_RETURN_8;
}
return -1;
return TOUCH_MENU_NO_INPUT;
}

View File

@ -84,14 +84,14 @@ BOOL PokegearConfigure_Exit(OverlayManager *man, int *state) {
static void PokegearConfigure_InitInternal(PokegearConfigureAppData *configureApp) {
configureApp->pokegear->childAppdata = configureApp;
configureApp->pokegear->reselectAppCB = ov101_021EF4B0;
configureApp->backgroundStyle = Pokegear_GetBackgroundStyle(configureApp->pokegear->savePokegear);
configureApp->pokegear->reselectAppCB = PokegearConfigure_OnReselectApp;
configureApp->skin = Pokegear_GetBackgroundStyle(configureApp->pokegear->savePokegear);
configureApp->unlockedSkins = Pokegear_GetUnlockedSkins(configureApp->pokegear->savePokegear);
configureApp->unlockedSkins = 0xFF; // nani the fuck?
}
static void PokegearConfigure_ExitInternal(PokegearConfigureAppData *configureApp) {
Pokegear_SetBackgroundStyle(configureApp->pokegear->savePokegear, configureApp->backgroundStyle);
Pokegear_SetBackgroundStyle(configureApp->pokegear->savePokegear, configureApp->skin);
configureApp->pokegear->reselectAppCB = NULL;
configureApp->pokegear->deselectAppCB = NULL;
}

View File

@ -378,7 +378,7 @@ static void PokegearApp_InitPaletteData(PokegearAppData *pokegearApp) {
PaletteData_AllocBuffers(pokegearApp->plttData, PLTTBUF_SUB_BG, 0x200, pokegearApp->heapID);
PaletteData_AllocBuffers(pokegearApp->plttData, PLTTBUF_SUB_OBJ, 0x200, pokegearApp->heapID);
pokegearApp->unk_0C4 = Heap_Alloc(pokegearApp->heapID, GetNarcMemberSizeByIdPair(NARC_application_pokegear_pgear_gra, NARC_pgear_gra_pgear_gra_00000054_NSCR));
PokegearApp_LoadSkinGraphics(pokegearApp, pokegearApp->backgroundStyle);
PokegearApp_LoadSkinGraphics(pokegearApp, pokegearApp->skin);
NARC_Delete(narc); // was never actually used
}
@ -394,7 +394,7 @@ static void PokegearApp_FreePaletteData(PokegearAppData *pokegearApp) {
static void PokegearApp_LoadGraphics(PokegearAppData *pokegearApp) {
PokegearApp_CreateSpriteSystem(pokegearApp);
pokegearApp->unk_094 = ov100_021E69F8(pokegearApp->heapID, 11, 1, pokegearApp->backgroundStyle, 3, 2);
pokegearApp->unk_094 = ov100_021E69F8(pokegearApp->heapID, 11, 1, pokegearApp->skin, 3, 2);
for (int i = 0; i < 4; ++i) {
pokegearApp->uiSprites[i] = ov100_021E6AC0(pokegearApp->unk_094, 0x40, 0x40, 0, 0, 0, i, i + 4, 0);
}

View File

@ -68,7 +68,7 @@ BOOL Pokegear_Init(OverlayManager *man, int *state) {
pokegearApp->profile = Save_PlayerData_GetProfile(pokegearApp->args->saveData);
pokegearApp->registeredCards = Pokegear_GetRegisteredCardsArray(pokegearApp->savePokegear);
pokegearApp->menuInputState = MenuInputStateMgr_GetState(pokegearApp->args->menuInputStatePtr);
pokegearApp->backgroundStyle = Pokegear_GetBackgroundStyle(pokegearApp->savePokegear);
pokegearApp->skin = Pokegear_GetBackgroundStyle(pokegearApp->savePokegear);
switch (pokegearApp->args->isScriptedLaunch) {
case 1: // scripted phone call
pokegearApp->app = GEAR_APP_PHONE;

View File

@ -43,13 +43,13 @@ BOOL PokegearMap_LoadGFX(PokegearMapAppData *mapApp) {
PokegearMap_InitBGs(mapApp);
break;
case 1:
PokegearMap_LoadGraphics(mapApp, mapApp->pokegear->backgroundStyle);
PokegearMap_LoadGraphics(mapApp, mapApp->pokegear->skin);
PokegearMap_InitWindows(mapApp);
PokegearMap_InitMsg(mapApp);
break;
case 2:
PokegearMap_CreateObjectsManager(mapApp);
PokegearMap_LoadPalettes(mapApp, mapApp->pokegear->backgroundStyle);
PokegearMap_LoadPalettes(mapApp, mapApp->pokegear->skin);
PokegearMap_LoadSprites(mapApp);
break;
case 3:

View File

@ -344,10 +344,10 @@ void ov101_021F0260(PokegearPhoneAppData *phoneApp) {
void ov101_021F0284(PokegearPhoneAppData *phoneApp) {
FontID_Alloc(4, phoneApp->heapID);
NARC *narc = NARC_New(NARC_a_1_4_6, phoneApp->heapID);
BgConfig_LoadAssetFromOpenNarc(phoneApp->pokegear->bgConfig, phoneApp->heapID, narc, NARC_a_1_4_6, phoneApp->backgroundStyle + 28, GF_BG_LYR_MAIN_2, GF_BG_GFX_TYPE_CHAR, 0, 0);
BgConfig_LoadAssetFromOpenNarc(phoneApp->pokegear->bgConfig, phoneApp->heapID, narc, NARC_a_1_4_6, phoneApp->backgroundStyle + 16, GF_BG_LYR_SUB_3, GF_BG_GFX_TYPE_CHAR, 0, 0);
BgConfig_LoadAssetFromOpenNarc(phoneApp->pokegear->bgConfig, phoneApp->heapID, narc, NARC_a_1_4_6, phoneApp->backgroundStyle + 22, GF_BG_LYR_SUB_3, GF_BG_GFX_TYPE_SCRN, 0, 0);
phoneApp->pNscrFile = GfGfxLoader_GetScrnDataFromOpenNarc(narc, phoneApp->backgroundStyle + 34, FALSE, &phoneApp->screenData, phoneApp->heapID);
BgConfig_LoadAssetFromOpenNarc(phoneApp->pokegear->bgConfig, phoneApp->heapID, narc, NARC_a_1_4_6, phoneApp->skin + 28, GF_BG_LYR_MAIN_2, GF_BG_GFX_TYPE_CHAR, 0, 0);
BgConfig_LoadAssetFromOpenNarc(phoneApp->pokegear->bgConfig, phoneApp->heapID, narc, NARC_a_1_4_6, phoneApp->skin + 16, GF_BG_LYR_SUB_3, GF_BG_GFX_TYPE_CHAR, 0, 0);
BgConfig_LoadAssetFromOpenNarc(phoneApp->pokegear->bgConfig, phoneApp->heapID, narc, NARC_a_1_4_6, phoneApp->skin + 22, GF_BG_LYR_SUB_3, GF_BG_GFX_TYPE_SCRN, 0, 0);
phoneApp->pNscrFile = GfGfxLoader_GetScrnDataFromOpenNarc(narc, phoneApp->skin + 34, FALSE, &phoneApp->screenData, phoneApp->heapID);
CopyToBgTilemapRect(phoneApp->pokegear->bgConfig, GF_BG_LYR_MAIN_2, 0, 0, 32, 20, phoneApp->screenData->rawData, 0, 0, phoneApp->screenData->screenWidth / 8, phoneApp->screenData->screenHeight / 8);
NARC_Delete(narc);
ScheduleBgTilemapBufferTransfer(phoneApp->pokegear->bgConfig, GF_BG_LYR_MAIN_2);
@ -361,8 +361,8 @@ void ov101_021F0370(PokegearPhoneAppData *phoneApp) {
void ov101_021F0388(PokegearPhoneAppData *phoneApp) {
NARC *narc = NARC_New(NARC_a_1_4_6, phoneApp->heapID);
PaletteData_LoadFromOpenNarc(phoneApp->pokegear->plttData, narc, phoneApp->backgroundStyle + 10, phoneApp->heapID, PLTTBUF_MAIN_BG, 0x1C0, 0, 0);
PaletteData_LoadFromOpenNarc(phoneApp->pokegear->plttData, narc, phoneApp->backgroundStyle + 4, phoneApp->heapID, PLTTBUF_SUB_BG, 0x180, 0, 0);
PaletteData_LoadFromOpenNarc(phoneApp->pokegear->plttData, narc, phoneApp->skin + 10, phoneApp->heapID, PLTTBUF_MAIN_BG, 0x1C0, 0, 0);
PaletteData_LoadFromOpenNarc(phoneApp->pokegear->plttData, narc, phoneApp->skin + 4, phoneApp->heapID, PLTTBUF_SUB_BG, 0x180, 0, 0);
PaletteData_LoadFromOpenNarc(phoneApp->pokegear->plttData, narc, 0, phoneApp->heapID, PLTTBUF_MAIN_OBJ, 0x160, 0x40, 0);
PaletteData_LoadFromOpenNarc(phoneApp->pokegear->plttData, narc, 0, phoneApp->heapID, PLTTBUF_SUB_OBJ, 0x160, 0x40, 0);
PaletteData_SetAutoTransparent(phoneApp->pokegear->plttData, TRUE);

View File

@ -104,7 +104,7 @@ BOOL PokegearPhone_Exit(OverlayManager *man, int *state) {
static void PokegearPhone_LoadContactsAndInitFromArgs(PokegearPhoneAppData *phoneApp) {
phoneApp->pokegear->childAppdata = phoneApp;
phoneApp->pokegear->reselectAppCB = PokegearPhone_OnReselectApp;
phoneApp->backgroundStyle = Pokegear_GetBackgroundStyle(phoneApp->pokegear->savePokegear);
phoneApp->skin = Pokegear_GetBackgroundStyle(phoneApp->pokegear->savePokegear);
phoneApp->saveContacts = SavePokegear_AllocAndCopyPhonebook(phoneApp->pokegear->savePokegear, phoneApp->heapID);
phoneApp->numContacts = SavePokegear_FindEmptyPhonebookSlot(phoneApp->pokegear->savePokegear);
PokegearPhone_ContactList_CreateLinkedList(phoneApp);

View File

@ -301,12 +301,12 @@ void Radio_UnloadBGs(PokegearRadioAppData *radioApp) {
void Radio_LoadGraphics(PokegearRadioAppData *radioApp) {
FontID_Alloc(4, radioApp->heapID);
NARC *narc = NARC_New(NARC_a_1_4_7, radioApp->heapID);
BgConfig_LoadAssetFromOpenNarc(radioApp->pokegear->bgConfig, radioApp->heapID, narc, NARC_a_1_4_7, radioApp->backgroundStyle + 16, GF_BG_LYR_MAIN_2, GF_BG_GFX_TYPE_CHAR, 0, 0);
BgConfig_LoadAssetFromOpenNarc(radioApp->pokegear->bgConfig, radioApp->heapID, narc, NARC_a_1_4_7, radioApp->backgroundStyle + 34, GF_BG_LYR_SUB_3, GF_BG_GFX_TYPE_CHAR, 0, 0);
BgConfig_LoadAssetFromOpenNarc(radioApp->pokegear->bgConfig, radioApp->heapID, narc, NARC_a_1_4_7, radioApp->backgroundStyle + 22, GF_BG_LYR_MAIN_2, GF_BG_GFX_TYPE_SCRN, 0x800, 0);
BgConfig_LoadAssetFromOpenNarc(radioApp->pokegear->bgConfig, radioApp->heapID, narc, NARC_a_1_4_7, radioApp->backgroundStyle + 28, GF_BG_LYR_MAIN_3, GF_BG_GFX_TYPE_SCRN, 0x800, 0);
BgConfig_LoadAssetFromOpenNarc(radioApp->pokegear->bgConfig, radioApp->heapID, narc, NARC_a_1_4_7, radioApp->backgroundStyle + 40, GF_BG_LYR_SUB_3, GF_BG_GFX_TYPE_SCRN, 0x800, 0);
radioApp->pNSCR = GfGfxLoader_GetScrnDataFromOpenNarc(narc, radioApp->backgroundStyle + 22, FALSE, &radioApp->screenData, radioApp->heapID);
BgConfig_LoadAssetFromOpenNarc(radioApp->pokegear->bgConfig, radioApp->heapID, narc, NARC_a_1_4_7, radioApp->skin + 16, GF_BG_LYR_MAIN_2, GF_BG_GFX_TYPE_CHAR, 0, 0);
BgConfig_LoadAssetFromOpenNarc(radioApp->pokegear->bgConfig, radioApp->heapID, narc, NARC_a_1_4_7, radioApp->skin + 34, GF_BG_LYR_SUB_3, GF_BG_GFX_TYPE_CHAR, 0, 0);
BgConfig_LoadAssetFromOpenNarc(radioApp->pokegear->bgConfig, radioApp->heapID, narc, NARC_a_1_4_7, radioApp->skin + 22, GF_BG_LYR_MAIN_2, GF_BG_GFX_TYPE_SCRN, 0x800, 0);
BgConfig_LoadAssetFromOpenNarc(radioApp->pokegear->bgConfig, radioApp->heapID, narc, NARC_a_1_4_7, radioApp->skin + 28, GF_BG_LYR_MAIN_3, GF_BG_GFX_TYPE_SCRN, 0x800, 0);
BgConfig_LoadAssetFromOpenNarc(radioApp->pokegear->bgConfig, radioApp->heapID, narc, NARC_a_1_4_7, radioApp->skin + 40, GF_BG_LYR_SUB_3, GF_BG_GFX_TYPE_SCRN, 0x800, 0);
radioApp->pNSCR = GfGfxLoader_GetScrnDataFromOpenNarc(narc, radioApp->skin + 22, FALSE, &radioApp->screenData, radioApp->heapID);
NARC_Delete(narc);
ScheduleBgTilemapBufferTransfer(radioApp->pokegear->bgConfig, GF_BG_LYR_MAIN_2);
ScheduleBgTilemapBufferTransfer(radioApp->pokegear->bgConfig, GF_BG_LYR_SUB_3);
@ -320,8 +320,8 @@ void Radio_UnloadGraphics(PokegearRadioAppData *radioApp) {
void Radio_LoadPalettes(PokegearRadioAppData *radioApp) {
NARC *narc = NARC_New(NARC_a_1_4_7, radioApp->heapID);
PaletteData_LoadFromOpenNarc(radioApp->pokegear->plttData, narc, radioApp->backgroundStyle + 10, radioApp->heapID, PLTTBUF_MAIN_BG, 0x1C0, 0, 0);
PaletteData_LoadFromOpenNarc(radioApp->pokegear->plttData, narc, radioApp->backgroundStyle + 4, radioApp->heapID, PLTTBUF_SUB_BG, 0x180, 0, 0);
PaletteData_LoadFromOpenNarc(radioApp->pokegear->plttData, narc, radioApp->skin + 10, radioApp->heapID, PLTTBUF_MAIN_BG, 0x1C0, 0, 0);
PaletteData_LoadFromOpenNarc(radioApp->pokegear->plttData, narc, radioApp->skin + 4, radioApp->heapID, PLTTBUF_SUB_BG, 0x180, 0, 0);
PaletteData_LoadFromOpenNarc(radioApp->pokegear->plttData, narc, 0, radioApp->heapID, PLTTBUF_MAIN_OBJ, 0x180, 0x40, 0);
PaletteData_LoadFromOpenNarc(radioApp->pokegear->plttData, narc, 0, radioApp->heapID, PLTTBUF_SUB_OBJ, 0x180, 0x40, 0);
PaletteData_SetAutoTransparent(radioApp->pokegear->plttData, TRUE);

View File

@ -83,7 +83,7 @@ void Radio_Load(PokegearRadioAppData *radioApp) {
radioApp->pokegear->childAppdata = radioApp;
radioApp->pokegear->reselectAppCB = Radio_OnReselectApp;
radioApp->pokegear->deselectAppCB = Radio_UnknownCB;
radioApp->backgroundStyle = Pokegear_GetBackgroundStyle(radioApp->pokegear->savePokegear);
radioApp->skin = Pokegear_GetBackgroundStyle(radioApp->pokegear->savePokegear);
Pokegear_GetRadioCursorCoords(radioApp->pokegear->savePokegear, &radioApp->cursorX, &radioApp->cursorY);
radioApp->selectedButton = 3;
radioApp->stationSelection = Radio_GetAvailableChannels(radioApp);

View File

@ -28,7 +28,7 @@ PhoneCallPersistentState *SaveData_GetPhoneCallPersistentState(SaveData *saveDat
static void SavePokegear_Init_Internal(SavePokegear *pokegear) {
MI_CpuClear8(pokegear, sizeof(SavePokegear));
pokegear->lastUsedApp = 3;
pokegear->backgroundStyle = 0;
pokegear->skin = 0;
pokegear->unk_1 = 0;
pokegear->unk_3 = 128;
pokegear->unk_2 = pokegear->unk_3;
@ -83,11 +83,11 @@ u8 Pokegear_GetMapUnlockLevel(SavePokegear *pokegear) {
}
u32 Pokegear_GetBackgroundStyle(SavePokegear *pokegear) {
return pokegear->backgroundStyle;
return pokegear->skin;
}
void Pokegear_SetBackgroundStyle(SavePokegear *pokegear, u32 newStyle) {
pokegear->backgroundStyle = newStyle;
pokegear->skin = newStyle;
}
u16 Pokegear_GetUnlockedSkins(SavePokegear *pokegear) {