Merge pull request #565 from GriffinRichards/text-window

Document text window
This commit is contained in:
GriffinR
2022-10-27 13:57:35 -04:00
committed by GitHub
78 changed files with 288 additions and 263 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 160 B

Before

Width:  |  Height:  |  Size: 257 B

After

Width:  |  Height:  |  Size: 257 B

Before

Width:  |  Height:  |  Size: 175 B

After

Width:  |  Height:  |  Size: 175 B

Before

Width:  |  Height:  |  Size: 219 B

After

Width:  |  Height:  |  Size: 219 B

Before

Width:  |  Height:  |  Size: 160 B

After

Width:  |  Height:  |  Size: 160 B

Before

Width:  |  Height:  |  Size: 190 B

After

Width:  |  Height:  |  Size: 190 B

Before

Width:  |  Height:  |  Size: 212 B

After

Width:  |  Height:  |  Size: 212 B

Before

Width:  |  Height:  |  Size: 183 B

After

Width:  |  Height:  |  Size: 183 B

Before

Width:  |  Height:  |  Size: 190 B

After

Width:  |  Height:  |  Size: 190 B

Before

Width:  |  Height:  |  Size: 190 B

After

Width:  |  Height:  |  Size: 190 B

Before

Width:  |  Height:  |  Size: 190 B

After

Width:  |  Height:  |  Size: 190 B

Before

Width:  |  Height:  |  Size: 231 B

After

Width:  |  Height:  |  Size: 231 B

Before

Width:  |  Height:  |  Size: 231 B

After

Width:  |  Height:  |  Size: 231 B

Before

Width:  |  Height:  |  Size: 215 B

After

Width:  |  Height:  |  Size: 215 B

Before

Width:  |  Height:  |  Size: 203 B

After

Width:  |  Height:  |  Size: 203 B

Before

Width:  |  Height:  |  Size: 230 B

After

Width:  |  Height:  |  Size: 230 B

Binary file not shown.
+1 -1
View File
@@ -487,7 +487,7 @@ graphics/seagallop/water.4bpp: %.4bpp: %.png
graphics/link/321start.4bpp: %.4bpp: %.png graphics/link/321start.4bpp: %.4bpp: %.png
$(GFX) $< $@ -mwidth 4 -mheight 4 $(GFX) $< $@ -mwidth 4 -mheight 4
$(TEXTWINDOWGFXDIR)/unk_8470B0C.4bpp: %.4bpp: %.png $(TEXTWINDOWGFXDIR)/signpost.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 19 $(GFX) $< $@ -num_tiles 19
$(SLOTMACHINEGFXDIR)/unk_8466620.4bpp: %.4bpp: %.png $(SLOTMACHINEGFXDIR)/unk_8466620.4bpp: %.4bpp: %.png
+1 -1
View File
@@ -2875,7 +2875,7 @@ extern const u32 gTMCase_TMSpriteGfx[];
extern const u32 gUnknown_8E84F20[]; extern const u32 gUnknown_8E84F20[];
extern const u32 gUnknown_8E85068[]; extern const u32 gUnknown_8E85068[];
extern const u8 gUnknown_8E99118[]; extern const u8 gUnknown_8E99118[];
extern const u16 gTMCaseMainWindowPalette[]; extern const u16 gStandardMenuPalette[];
// egg_hatch // egg_hatch
extern const u32 gBattleTextboxTiles[]; extern const u32 gBattleTextboxTiles[];
+2
View File
@@ -1,6 +1,8 @@
#ifndef GUARD_HELP_MESSAGE_H #ifndef GUARD_HELP_MESSAGE_H
#define GUARD_HELP_MESSAGE_H #define GUARD_HELP_MESSAGE_H
extern const u8 gHelpMessageWindow_Gfx[];
void DestroyHelpMessageWindow(u8 a0); void DestroyHelpMessageWindow(u8 a0);
u8 CreateHelpMessageWindow(void); u8 CreateHelpMessageWindow(void);
void PrintTextOnHelpMessageWindow(const u8 * text, u8 mode); void PrintTextOnHelpMessageWindow(const u8 * text, u8 mode);
+3 -1
View File
@@ -5,6 +5,8 @@
#include "text.h" #include "text.h"
#include "task.h" #include "task.h"
extern const u16 gMenuMessageWindow_Gfx[];
void ClearScheduledBgCopiesToVram(void); void ClearScheduledBgCopiesToVram(void);
void ScheduleBgCopyTilemapToVram(u8 bgId); void ScheduleBgCopyTilemapToVram(u8 bgId);
void DoScheduledBgTilemapCopiesToVram(void); void DoScheduledBgTilemapCopiesToVram(void);
@@ -46,7 +48,7 @@ void RemoveStartMenuWindow(void);
u16 GetStdWindowBaseTileNum(void); u16 GetStdWindowBaseTileNum(void);
void DrawHelpMessageWindowWithText(const u8 * text); void DrawHelpMessageWindowWithText(const u8 * text);
void DestroyHelpMessageWindow_(void); void DestroyHelpMessageWindow_(void);
void LoadSignPostWindowFrameGfx(void); void LoadSignpostWindowFrameGfx(void);
void SetDefaultFontsPointer(void); void SetDefaultFontsPointer(void);
#endif // GUARD_NEW_MENU_HELPERS_H #endif // GUARD_NEW_MENU_HELPERS_H
-1
View File
@@ -30,7 +30,6 @@ struct UnkStruct_203B044
extern u8 gQuestLogState; extern u8 gQuestLogState;
extern u8 gQuestLogPlaybackState; extern u8 gQuestLogPlaybackState;
extern const u8 gUnknown_84566A8[];
extern struct FieldInput gQuestLogFieldInput; extern struct FieldInput gQuestLogFieldInput;
extern struct UnkStruct_203B044 gUnknown_203B044; extern struct UnkStruct_203B044 gUnknown_203B044;
extern u16 *gUnknown_203AE04; extern u16 *gUnknown_203AE04;
+4 -4
View File
@@ -62,12 +62,12 @@ void ClearMsgBoxCancelableState(void);
void SetQuestLogInputIsDpadFlag(void); void SetQuestLogInputIsDpadFlag(void);
void ClearQuestLogInput(void); void ClearQuestLogInput(void);
void ClearQuestLogInputIsDpadFlag(void); void ClearQuestLogInputIsDpadFlag(void);
void MsgSetSignPost(void); void MsgSetSignpost(void);
void MsgSetNotSignPost(void); void MsgSetNotSignpost(void);
bool8 IsMsgSignPost(void); bool8 IsMsgSignpost(void);
bool8 IsQuestLogInputDpad(void); bool8 IsQuestLogInputDpad(void);
u8 GetRegisteredQuestLogInput(void); u8 GetRegisteredQuestLogInput(void);
void ResetFacingNpcOrSignPostVars(void); void ResetFacingNpcOrSignpostVars(void);
bool8 CanWalkAwayToCancelMsgBox(void); bool8 CanWalkAwayToCancelMsgBox(void);
void SetWalkingIntoSignVars(void); void SetWalkingIntoSignVars(void);
bool8 IsMsgBoxWalkawayDisabled(void); bool8 IsMsgBoxWalkawayDisabled(void);
+10 -10
View File
@@ -10,18 +10,18 @@ struct TilesPal
}; };
void rbox_fill_rectangle(u8 windowId); void rbox_fill_rectangle(u8 windowId);
const u16 *stdpal_get(u8 id); const u16 *GetTextWindowPalette(u8 id);
const u16 *GetOverworldTextboxPalettePtr(void); const u16 *GetOverworldTextboxPalettePtr(void);
void TextWindow_LoadResourcesStdFrame0(u8 windowId, u16 tileStart, u8 palette); void LoadMenuMessageWindowGfx(u8 windowId, u16 tileStart, u8 palette);
void TextWindow_SetStdFrame0_WithPal(u8 windowId, u16 tileStart, u8 palette); void LoadStdWindowGfx(u8 windowId, u16 tileStart, u8 palette);
void TextWindow_SetUserSelectedFrame(u8 windowId, u16 tileStart, u8 palette); void LoadUserWindowGfx(u8 windowId, u16 tileStart, u8 palette);
void LoadUserWindowBorderGfx(u8 windowId, u16 tileStart, u8 palette); void LoadUserWindowGfx2(u8 windowId, u16 tileStart, u8 palette);
void DrawWindowBorderWithStdpal3(u8 bgId, u16 tileStart, u8 palette); void LoadStdWindowGfxOnBg(u8 bgId, u16 tileStart, u8 palette);
void DrawTextBorderOuter(u8 windowId, u16 tileStart, u8 palette); void DrawTextBorderOuter(u8 windowId, u16 tileStart, u8 palette);
void DrawTextBorderInner(u8 windowId, u16 tileNum, u8 palNum); void DrawTextBorderInner(u8 windowId, u16 tileNum, u8 palNum);
void TextWindow_LoadTilesStdFrame1(u8 windowId, u16 destOffset); void LoadHelpMessageWindowGfx(u8 windowId, u16 destOffset, u8 palIdx);
void sub_814FE6C(u8 windowId, u16 destOffset, u8 palIdx); void LoadSignpostWindowGfx(u8 windowId, u16 destOffset, u8 palIdx);
void sub_814FEEC(u8 windowId, u16 destOffset, u8 palIdx); void LoadStdWindowTiles(u8 windowId, u16 destOffset);
void sub_814FF6C(u8 windowId, u16 destOffset); void LoadQuestLogWindowTiles(u8 windowId, u16 destOffset);
#endif // GUARD_TEXT_WINDOW_H #endif // GUARD_TEXT_WINDOW_H
+5 -5
View File
@@ -7,13 +7,13 @@ struct TextWindowGraphics
const void *palette; const void *palette;
}; };
extern const u16 gUnknown_8470B0C[]; extern const u16 gSignpostWindow_Gfx[];
extern const u16 gStdFrame0[]; extern const u16 gStdTextWindow_Gfx[];
extern const u16 gStdFrame1[]; extern const u16 gQuestLogWindow_Gfx[];
extern const u16 gUnknown_8471DEC[][16]; extern const u16 gTextWindowPalettes[][16];
extern const struct TextWindowGraphics gUserFrames[]; extern const struct TextWindowGraphics gUserFrames[];
const struct TextWindowGraphics *GetWindowFrameTilesPal(u8 idx); const struct TextWindowGraphics *GetUserWindowGraphics(u8 idx);
#endif //GUARD_TEXT_WINDOW_GRAPHICS_H #endif //GUARD_TEXT_WINDOW_GRAPHICS_H
+3 -3
View File
@@ -202,9 +202,9 @@ void InitBagWindows(void)
else else
InitWindows(sDefaultBagWindowsDeposit); InitWindows(sDefaultBagWindowsDeposit);
DeactivateAllTextPrinters(); DeactivateAllTextPrinters();
TextWindow_SetUserSelectedFrame(0, 0x64, 0xE0); LoadUserWindowGfx(0, 0x64, 0xE0);
TextWindow_LoadResourcesStdFrame0(0, 0x6D, 0xD0); LoadMenuMessageWindowGfx(0, 0x6D, 0xD0);
TextWindow_SetStdFrame0_WithPal(0, 0x81, 0xC0); LoadStdWindowGfx(0, 0x81, 0xC0);
LoadPalette(sBagWindowPalF, 0xF0, 0x20); LoadPalette(sBagWindowPalF, 0xF0, 0x20);
for (i = 0; i < 3; i++) for (i = 0; i < 3; i++)
{ {
+3 -3
View File
@@ -665,8 +665,8 @@ void InitBattleBgsVideo(void)
void LoadBattleMenuWindowGfx(void) void LoadBattleMenuWindowGfx(void)
{ {
TextWindow_SetUserSelectedFrame(2, 0x012, 0x10); LoadUserWindowGfx(2, 0x012, 0x10);
TextWindow_SetUserSelectedFrame(2, 0x022, 0x10); LoadUserWindowGfx(2, 0x022, 0x10);
gPlttBufferUnfaded[0x5C] = RGB( 9, 9, 9); gPlttBufferUnfaded[0x5C] = RGB( 9, 9, 9);
gPlttBufferUnfaded[0x5D] = RGB( 9, 9, 9); gPlttBufferUnfaded[0x5D] = RGB( 9, 9, 9);
gPlttBufferUnfaded[0x5E] = RGB(31, 31, 31); gPlttBufferUnfaded[0x5E] = RGB(31, 31, 31);
@@ -675,7 +675,7 @@ void LoadBattleMenuWindowGfx(void)
if (gBattleTypeFlags & (BATTLE_TYPE_FIRST_BATTLE | BATTLE_TYPE_POKEDUDE)) if (gBattleTypeFlags & (BATTLE_TYPE_FIRST_BATTLE | BATTLE_TYPE_POKEDUDE))
{ {
Menu_LoadStdPalAt(0x70); Menu_LoadStdPalAt(0x70);
TextWindow_LoadResourcesStdFrame0(0, 0x030, 0x70); LoadMenuMessageWindowGfx(0, 0x030, 0x70);
gPlttBufferUnfaded[0x76] = RGB( 0, 0, 0); gPlttBufferUnfaded[0x76] = RGB( 0, 0, 0);
CpuCopy16(&gPlttBufferUnfaded[0x76], &gPlttBufferFaded[0x76], 2); CpuCopy16(&gPlttBufferUnfaded[0x76], &gPlttBufferFaded[0x76], 2);
} }
+1 -1
View File
@@ -109,7 +109,7 @@ static void MainCB2_SetUp(void)
break; break;
case 3: case 3:
LoadFrameGfxOnBg(3); LoadFrameGfxOnBg(3);
LoadPalette(stdpal_get(0), 0xF0, 0x20); LoadPalette(GetTextWindowPalette(0), 0xF0, 0x20);
gMain.state++; gMain.state++;
break; break;
case 4: case 4:
+2 -2
View File
@@ -3046,7 +3046,7 @@ static bool32 OpenResultsWindow(struct BerryCrushGame * game, struct BerryCrushG
FillWindowPixelBuffer(spriteManager->resultsWindowId, PIXEL_FILL(0)); FillWindowPixelBuffer(spriteManager->resultsWindowId, PIXEL_FILL(0));
break; break;
case 2: case 2:
TextWindow_SetStdFrame0_WithPal(spriteManager->resultsWindowId, 0x21D, 0xD0); LoadStdWindowGfx(spriteManager->resultsWindowId, 0x21D, 0xD0);
DrawStdFrameWithCustomTileAndPalette(spriteManager->resultsWindowId, FALSE, 541, 13); DrawStdFrameWithCustomTileAndPalette(spriteManager->resultsWindowId, FALSE, 541, 13);
break; break;
case 3: case 3:
@@ -3105,7 +3105,7 @@ static void Task_ShowBerryCrushRankings(u8 taskId)
tWindowId = AddWindow(&sWindowTemplate_BerryCrushRankings); tWindowId = AddWindow(&sWindowTemplate_BerryCrushRankings);
PutWindowTilemap(tWindowId); PutWindowTilemap(tWindowId);
FillWindowPixelBuffer(tWindowId, PIXEL_FILL(0)); FillWindowPixelBuffer(tWindowId, PIXEL_FILL(0));
TextWindow_SetStdFrame0_WithPal(tWindowId, 0x21D, 0xD0); LoadStdWindowGfx(tWindowId, 0x21D, 0xD0);
DrawStdFrameWithCustomTileAndPalette(tWindowId, 0, 0x21D, 0xD); DrawStdFrameWithCustomTileAndPalette(tWindowId, 0, 0x21D, 0xD);
break; break;
case 1: case 1:
+4 -4
View File
@@ -1411,10 +1411,10 @@ static void BerryPouchInitWindows(void)
u8 i; u8 i;
InitWindows(sWindowTemplates_Main); InitWindows(sWindowTemplates_Main);
DeactivateAllTextPrinters(); DeactivateAllTextPrinters();
TextWindow_SetUserSelectedFrame(0, 0x001, 0xE0); LoadUserWindowGfx(0, 0x001, 0xE0);
TextWindow_LoadResourcesStdFrame0(0, 0x013, 0xD0); LoadMenuMessageWindowGfx(0, 0x013, 0xD0);
TextWindow_SetStdFrame0_WithPal(0, 0x00A, 0xC0); LoadStdWindowGfx(0, 0x00A, 0xC0);
LoadPalette(gTMCaseMainWindowPalette, 0xF0, 0x20); LoadPalette(gStandardMenuPalette, 0xF0, 0x20);
for (i = 0; i < 3; i++) for (i = 0; i < 3; i++)
FillWindowPixelBuffer(i, PIXEL_FILL(0)); FillWindowPixelBuffer(i, PIXEL_FILL(0));
PutWindowTilemap(0); PutWindowTilemap(0);
+1 -1
View File
@@ -119,7 +119,7 @@ void DisplayBerryPowderVendorMenu(void)
sBerryPowderVendorWindowId = AddWindow(&template); sBerryPowderVendorWindowId = AddWindow(&template);
FillWindowPixelBuffer(sBerryPowderVendorWindowId, 0); FillWindowPixelBuffer(sBerryPowderVendorWindowId, 0);
PutWindowTilemap(sBerryPowderVendorWindowId); PutWindowTilemap(sBerryPowderVendorWindowId);
TextWindow_SetStdFrame0_WithPal(sBerryPowderVendorWindowId, 0x21D, 0xD0); LoadStdWindowGfx(sBerryPowderVendorWindowId, 0x21D, 0xD0);
DrawPlayerPowderAmount(sBerryPowderVendorWindowId, 0x21D, 0xD, GetBerryPowder()); DrawPlayerPowderAmount(sBerryPowderVendorWindowId, 0x21D, 0xD, GetBerryPowder());
} }
} }
+3 -3
View File
@@ -162,9 +162,9 @@ void BuyMenuInitWindows(bool32 isSellingTM)
else else
InitWindows(sShopBuyMenuWindowTemplatesTM); InitWindows(sShopBuyMenuWindowTemplatesTM);
DeactivateAllTextPrinters(); DeactivateAllTextPrinters();
TextWindow_SetUserSelectedFrame(0, 0x1, 0xD0); LoadUserWindowGfx(0, 0x1, 0xD0);
TextWindow_LoadResourcesStdFrame0(0, 0x13, 0xE0); LoadMenuMessageWindowGfx(0, 0x13, 0xE0);
TextWindow_SetStdFrame0_WithPal(0, 0xA, 0xF0); LoadStdWindowGfx(0, 0xA, 0xF0);
PutWindowTilemap(0); PutWindowTilemap(0);
PutWindowTilemap(4); PutWindowTilemap(4);
PutWindowTilemap(5); PutWindowTilemap(5);
+2 -2
View File
@@ -101,8 +101,8 @@ static void Task_DrawClearSaveDataScreen(u8 taskId)
SaveClearScreen_GpuInit(); SaveClearScreen_GpuInit();
break; break;
case 3: case 3:
TextWindow_SetStdFrame0_WithPal(0, 0x001, 0xF0); LoadStdWindowGfx(0, 0x001, 0xF0);
TextWindow_SetStdFrame0_WithPal(1, 0x001, 0xF0); LoadStdWindowGfx(1, 0x001, 0xF0);
break; break;
case 4: case 4:
DrawStdFrameWithCustomTileAndPalette(1, TRUE, 0x001, 0xF); DrawStdFrameWithCustomTileAndPalette(1, TRUE, 0x001, 0xF);
+1 -1
View File
@@ -83,7 +83,7 @@ void ShowCoinsWindow(u32 coinAmount, u8 x, u8 y)
sCoinsWindowId = AddWindow(&template); sCoinsWindowId = AddWindow(&template);
FillWindowPixelBuffer(sCoinsWindowId, 0); FillWindowPixelBuffer(sCoinsWindowId, 0);
PutWindowTilemap(sCoinsWindowId); PutWindowTilemap(sCoinsWindowId);
TextWindow_SetStdFrame0_WithPal(sCoinsWindowId, 0x21D, 0xD0); LoadStdWindowGfx(sCoinsWindowId, 0x21D, 0xD0);
DrawStdFrameWithCustomTileAndPalette(sCoinsWindowId, FALSE, 0x21D, 0xD); DrawStdFrameWithCustomTileAndPalette(sCoinsWindowId, FALSE, 0x21D, 0xD);
AddTextPrinterParameterized(sCoinsWindowId, FONT_2, gText_Coins_2, 0, 0, 0xFF, 0); AddTextPrinterParameterized(sCoinsWindowId, FONT_2, gText_Coins_2, 0, 0, 0xFF, 0);
PrintCoinsString(coinAmount); PrintCoinsString(coinAmount);
+1 -1
View File
@@ -1956,7 +1956,7 @@ static void CB2_EggHatch_1(void)
case 9: case 9:
if (!IsTextPrinterActive(sEggHatchData->windowId)) if (!IsTextPrinterActive(sEggHatchData->windowId))
{ {
LoadUserWindowBorderGfx(sEggHatchData->windowId, 0x140, 0xE0); LoadUserWindowGfx2(sEggHatchData->windowId, 0x140, 0xE0);
CreateYesNoMenu(&sYesNoWinTemplate, FONT_3, 0, 2, 0x140, 0xE, 0); CreateYesNoMenu(&sYesNoWinTemplate, FONT_3, 0, 2, 0x140, 0xE, 0);
sEggHatchData->CB2_state++; sEggHatchData->CB2_state++;
} }
+7 -7
View File
@@ -3002,7 +3002,7 @@ static void PrintRecordsText(u8 windowId)
recordNums[1] = gSaveBlock2Ptr->berryPick.bestScore; recordNums[1] = gSaveBlock2Ptr->berryPick.bestScore;
recordNums[2] = gSaveBlock2Ptr->berryPick.berriesPickedInRow; recordNums[2] = gSaveBlock2Ptr->berryPick.berriesPickedInRow;
TextWindow_SetStdFrame0_WithPal(windowId, 0x21D, 0xD0); LoadStdWindowGfx(windowId, 0x21D, 0xD0);
DrawTextBorderOuter(windowId, 0x21D, 0xD); DrawTextBorderOuter(windowId, 0x21D, 0xD);
FillWindowPixelBuffer(windowId, PIXEL_FILL(1)); FillWindowPixelBuffer(windowId, PIXEL_FILL(1));
AddTextPrinterParameterized(windowId, FONT_2, sRecordsTexts[0], 1, 1, TEXT_SKIP_DRAW, NULL); AddTextPrinterParameterized(windowId, FONT_2, sRecordsTexts[0], 1, 1, TEXT_SKIP_DRAW, NULL);
@@ -4160,13 +4160,13 @@ static void ResetBerryAndStatusBarSprites(void)
static void LoadWindowFrameGfx(u8 frameId) static void LoadWindowFrameGfx(u8 frameId)
{ {
LoadBgTiles(BG_INTERFACE, GetWindowFrameTilesPal(frameId)->tiles, 0x120, 1); LoadBgTiles(BG_INTERFACE, GetUserWindowGraphics(frameId)->tiles, 0x120, 1);
LoadPalette(GetWindowFrameTilesPal(frameId)->palette, 0xA0, 0x20); LoadPalette(GetUserWindowGraphics(frameId)->palette, 0xA0, 0x20);
} }
static void LoadUserWindowFrameGfx(void) static void DBP_LoadStdWindowGfx(void)
{ {
TextWindow_SetStdFrame0_WithPal(0, 0xA, 0xB0); LoadStdWindowGfx(0, 0xA, 0xB0);
} }
static void ResetGfxState(void) static void ResetGfxState(void)
@@ -4341,7 +4341,7 @@ static void LoadGfx(void)
break; break;
case 4: case 4:
LoadWindowFrameGfx(gSaveBlock2Ptr->optionsWindowFrameType); LoadWindowFrameGfx(gSaveBlock2Ptr->optionsWindowFrameType);
LoadUserWindowFrameGfx(); DBP_LoadStdWindowGfx();
sGfx->state++; sGfx->state++;
break; break;
default: default:
@@ -4942,7 +4942,7 @@ static bool32 LoadBgGfx(void)
return FALSE; return FALSE;
break; break;
case 5: case 5:
LoadPalette(stdpal_get(3), 0xD0, 0x20); LoadPalette(GetTextWindowPalette(3), 0xD0, 0x20);
break; break;
default: default:
sGfx->loadState = 0; sGfx->loadState = 0;
+1 -1
View File
@@ -1347,7 +1347,7 @@ static void EC_AddTextPrinterParameterized2(u8 windowId, u8 fontId, const u8 *st
static void PrintECInstructionsText(void) static void PrintECInstructionsText(void)
{ {
FillBgTilemapBufferRect(0, 0, 0, 0, 32, 20, 17); FillBgTilemapBufferRect(0, 0, 0, 0, 32, 20, 17);
TextWindow_SetUserSelectedFrame(1, 1, 0xE0); LoadUserWindowGfx(1, 1, 0xE0);
DrawTextBorderOuter(1, 1, 14); DrawTextBorderOuter(1, 1, 14);
PrintECInterfaceTextById(0); PrintECInterfaceTextById(0);
PutWindowTilemap(1); PutWindowTilemap(1);
+1 -1
View File
@@ -1331,7 +1331,7 @@ static void Task_TradeEvolutionScene(u8 taskId)
case T_MVSTATE_PRINT_YES_NO: case T_MVSTATE_PRINT_YES_NO:
if (!IsTextPrinterActive(0) && !IsSEPlaying()) if (!IsTextPrinterActive(0) && !IsSEPlaying())
{ {
LoadUserWindowBorderGfx(0, 0xA8, 0xE0); LoadUserWindowGfx2(0, 0xA8, 0xE0);
CreateYesNoMenu(&gTradeEvolutionSceneYesNoWindowTemplate, FONT_3, 0, 2, 0xA8, 0xE, 0); CreateYesNoMenu(&gTradeEvolutionSceneYesNoWindowTemplate, FONT_3, 0, 2, 0xA8, 0xE, 0);
sEvoCursorPos = 0; sEvoCursorPos = 0;
gTasks[taskId].tLearnMoveState++; gTasks[taskId].tLearnMoveState++;
+1 -1
View File
@@ -667,7 +667,7 @@ static void MainCB2_LoadFameChecker(void)
LoadPalette(gFameCheckerBgPals + 0x10, 0x10, 0x20); LoadPalette(gFameCheckerBgPals + 0x10, 0x10, 0x20);
CopyToBgTilemapBufferRect(2, gFameCheckerBg2Tilemap, 0, 0, 32, 32); CopyToBgTilemapBufferRect(2, gFameCheckerBg2Tilemap, 0, 0, 32, 32);
CopyToBgTilemapBufferRect_ChangePalette(1, sFameCheckerTilemap, 30, 0, 32, 32, 0x11); CopyToBgTilemapBufferRect_ChangePalette(1, sFameCheckerTilemap, 30, 0, 32, 32, 0x11);
LoadPalette(stdpal_get(2), 0xF0, 0x20); LoadPalette(GetTextWindowPalette(2), 0xF0, 0x20);
gMain.state++; gMain.state++;
break; break;
case 4: case 4:
+7 -7
View File
@@ -197,7 +197,7 @@ int ProcessPlayerFieldInput(struct FieldInput *input)
u16 metatileBehavior; u16 metatileBehavior;
u32 metatileAttributes; u32 metatileAttributes;
ResetFacingNpcOrSignPostVars(); ResetFacingNpcOrSignpostVars();
playerDirection = GetPlayerFacingDirection(); playerDirection = GetPlayerFacingDirection();
GetPlayerPosition(&position); GetPlayerPosition(&position);
metatileAttributes = MapGridGetMetatileAttributeAt(position.x, position.y, METATILE_ATTRIBUTES_ALL); metatileAttributes = MapGridGetMetatileAttributeAt(position.x, position.y, METATILE_ATTRIBUTES_ALL);
@@ -507,7 +507,7 @@ static const u8 *GetInteractedBackgroundEventScript(struct MapPosition *position
} }
if (signpostType != SIGNPOST_NA) if (signpostType != SIGNPOST_NA)
MsgSetSignPost(); MsgSetSignpost();
gSpecialVar_Facing = direction; gSpecialVar_Facing = direction;
return bgEvent->bgUnion.script; return bgEvent->bgUnion.script;
} }
@@ -577,22 +577,22 @@ static const u8 *GetInteractedMetatileScript(struct MapPosition *position, u8 me
return CableClub_EventScript_ShowBattleRecords; return CableClub_EventScript_ShowBattleRecords;
if (MetatileBehavior_IsIndigoPlateauSign1(metatileBehavior) == TRUE) if (MetatileBehavior_IsIndigoPlateauSign1(metatileBehavior) == TRUE)
{ {
MsgSetSignPost(); MsgSetSignpost();
return EventScript_Indigo_UltimateGoal; return EventScript_Indigo_UltimateGoal;
} }
if (MetatileBehavior_IsIndigoPlateauSign2(metatileBehavior) == TRUE) if (MetatileBehavior_IsIndigoPlateauSign2(metatileBehavior) == TRUE)
{ {
MsgSetSignPost(); MsgSetSignpost();
return EventScript_Indigo_HighestAuthority; return EventScript_Indigo_HighestAuthority;
} }
if (MetatileBehavior_IsPlayerFacingPokeMartSign(metatileBehavior, direction) == TRUE) if (MetatileBehavior_IsPlayerFacingPokeMartSign(metatileBehavior, direction) == TRUE)
{ {
MsgSetSignPost(); MsgSetSignpost();
return EventScript_PokemartSign; return EventScript_PokemartSign;
} }
if (MetatileBehavior_IsPlayerFacingPokemonCenterSign(metatileBehavior, direction) == TRUE) if (MetatileBehavior_IsPlayerFacingPokemonCenterSign(metatileBehavior, direction) == TRUE)
{ {
MsgSetSignPost(); MsgSetSignpost();
return EventScript_PokecenterSign; return EventScript_PokecenterSign;
} }
return NULL; return NULL;
@@ -809,7 +809,7 @@ static void SetUpWalkIntoSignScript(const u8 *script, u8 playerDirection)
gSpecialVar_Facing = playerDirection; gSpecialVar_Facing = playerDirection;
ScriptContext_SetupScript(script); ScriptContext_SetupScript(script);
SetWalkingIntoSignVars(); SetWalkingIntoSignVars();
MsgSetSignPost(); MsgSetSignpost();
} }
static const u8 *GetSignpostScriptAtMapPosition(struct MapPosition * position) static const u8 *GetSignpostScriptAtMapPosition(struct MapPosition * position)
+3 -3
View File
@@ -28,12 +28,12 @@ static void Task_DrawFieldMessageBox(u8 taskId)
if (gQuestLogState == QL_STATE_PLAYBACK) if (gQuestLogState == QL_STATE_PLAYBACK)
{ {
gTextFlags.autoScroll = TRUE; gTextFlags.autoScroll = TRUE;
TextWindow_LoadTilesStdFrame1(0, 0x200); LoadQuestLogWindowTiles(0, 0x200);
} }
else if (!IsMsgSignPost()) else if (!IsMsgSignpost())
LoadStdWindowFrameGfx(); LoadStdWindowFrameGfx();
else else
LoadSignPostWindowFrameGfx(); LoadSignpostWindowFrameGfx();
task->data[0]++; task->data[0]++;
break; break;
case 1: case 1:
+1 -1
View File
@@ -1096,7 +1096,7 @@ void DrawElevatorCurrentFloorWindow(void)
if (QuestLog_SchedulePlaybackCB(QLPlaybackCB_DestroyScriptMenuMonPicSprites) != TRUE) if (QuestLog_SchedulePlaybackCB(QLPlaybackCB_DestroyScriptMenuMonPicSprites) != TRUE)
{ {
sElevatorCurrentFloorWindowId = AddWindow(&sElevatorCurrentFloorWindowTemplate); sElevatorCurrentFloorWindowId = AddWindow(&sElevatorCurrentFloorWindowTemplate);
TextWindow_SetStdFrame0_WithPal(sElevatorCurrentFloorWindowId, 0x21D, 0xD0); LoadStdWindowGfx(sElevatorCurrentFloorWindowId, 0x21D, 0xD0);
DrawStdFrameWithCustomTileAndPalette(sElevatorCurrentFloorWindowId, FALSE, 0x21D, 0xD); DrawStdFrameWithCustomTileAndPalette(sElevatorCurrentFloorWindowId, FALSE, 0x21D, 0xD);
AddTextPrinterParameterized(sElevatorCurrentFloorWindowId, FONT_2, gText_NowOn, 0, 2, 0xFF, NULL); AddTextPrinterParameterized(sElevatorCurrentFloorWindowId, FONT_2, gText_NowOn, 0, 2, 0xFF, NULL);
floorname = sFloorNamePointers[gSpecialVar_0x8005]; floorname = sFloorNamePointers[gSpecialVar_0x8005];
+1 -1
View File
@@ -620,7 +620,7 @@ static void Task_Hof_SpawnPlayerPic(u8 taskId)
ShowBg(3); ShowBg(3);
gTasks[taskId].data[4] = CreateTrainerPicSprite(PlayerGenderToFrontTrainerPicId_Debug(gSaveBlock2Ptr->playerGender, TRUE), TRUE, 0x78, 0x48, 6, 0xFFFF); gTasks[taskId].data[4] = CreateTrainerPicSprite(PlayerGenderToFrontTrainerPicId_Debug(gSaveBlock2Ptr->playerGender, TRUE), TRUE, 0x78, 0x48, 6, 0xFFFF);
AddWindow(&sWindowTemplate); AddWindow(&sWindowTemplate);
TextWindow_SetStdFrame0_WithPal(1, 0x21D, 0xD0); LoadStdWindowGfx(1, 0x21D, 0xD0);
gTasks[taskId].data[3] = 120; gTasks[taskId].data[3] = 120;
gTasks[taskId].func = Task_Hof_WaitAndPrintPlayerInfo; gTasks[taskId].func = Task_Hof_WaitAndPrintPlayerInfo;
} }
+6 -6
View File
@@ -5,7 +5,7 @@
static EWRAM_DATA u8 sHelpMessageWindowId = 0; static EWRAM_DATA u8 sHelpMessageWindowId = 0;
const u8 gUnknown_84566A8[] = INCBIN_U8("graphics/unknown/unknown_84566a8.bin"); const u8 gHelpMessageWindow_Gfx[] = INCBIN_U8("graphics/help_system/msg_window.4bpp");
static const struct WindowTemplate sHelpMessageWindowTemplate = { static const struct WindowTemplate sHelpMessageWindowTemplate = {
.bg = 0, .bg = 0,
@@ -19,12 +19,12 @@ static const struct WindowTemplate sHelpMessageWindowTemplate = {
void MapNamePopupWindowIdSetDummy(void) void MapNamePopupWindowIdSetDummy(void)
{ {
sHelpMessageWindowId = 0xFF; sHelpMessageWindowId = WINDOW_NONE;
} }
u8 CreateHelpMessageWindow(void) u8 CreateHelpMessageWindow(void)
{ {
if (sHelpMessageWindowId == 0xFF) if (sHelpMessageWindowId == WINDOW_NONE)
{ {
sHelpMessageWindowId = AddWindow(&sHelpMessageWindowTemplate); sHelpMessageWindowId = AddWindow(&sHelpMessageWindowTemplate);
PutWindowTilemap(sHelpMessageWindowId); PutWindowTilemap(sHelpMessageWindowId);
@@ -34,7 +34,7 @@ u8 CreateHelpMessageWindow(void)
void DestroyHelpMessageWindow(u8 a0) void DestroyHelpMessageWindow(u8 a0)
{ {
if (sHelpMessageWindowId != 0xFF) if (sHelpMessageWindowId != WINDOW_NONE)
{ {
FillWindowPixelBuffer(sHelpMessageWindowId, PIXEL_FILL(0)); FillWindowPixelBuffer(sHelpMessageWindowId, PIXEL_FILL(0));
ClearWindowTilemap(sHelpMessageWindowId); ClearWindowTilemap(sHelpMessageWindowId);
@@ -43,13 +43,13 @@ void DestroyHelpMessageWindow(u8 a0)
CopyWindowToVram(sHelpMessageWindowId, a0); CopyWindowToVram(sHelpMessageWindowId, a0);
RemoveWindow(sHelpMessageWindowId); RemoveWindow(sHelpMessageWindowId);
sHelpMessageWindowId = 0xFF; sHelpMessageWindowId = WINDOW_NONE;
} }
} }
void sub_8112F18(u8 windowId) void sub_8112F18(u8 windowId)
{ {
const u8 *ptr = gUnknown_84566A8; const u8 *ptr = gHelpMessageWindow_Gfx;
u8 *buffer; u8 *buffer;
u8 i, j; u8 i, j;
u8 width, height; u8 width, height;
+5 -5
View File
@@ -1069,11 +1069,11 @@ static void ItemPc_InitWindows(void)
InitWindows(sWindowTemplates); InitWindows(sWindowTemplates);
DeactivateAllTextPrinters(); DeactivateAllTextPrinters();
TextWindow_SetUserSelectedFrame(0, 0x3C0, 0xE0); LoadUserWindowGfx(0, 0x3C0, 0xE0);
TextWindow_SetStdFrame0_WithPal(0, 0x3A3, 0xC0); LoadStdWindowGfx(0, 0x3A3, 0xC0);
TextWindow_LoadResourcesStdFrame0(0, 0x3AC, 0xB0); LoadMenuMessageWindowGfx(0, 0x3AC, 0xB0);
LoadPalette(stdpal_get(2), 0xD0, 0x20); LoadPalette(GetTextWindowPalette(2), 0xD0, 0x20);
LoadPalette(gTMCaseMainWindowPalette, 0xF0, 0x20); LoadPalette(gStandardMenuPalette, 0xF0, 0x20);
for (i = 0; i < 3; i++) for (i = 0; i < 3; i++)
{ {
FillWindowPixelBuffer(i, 0x00); FillWindowPixelBuffer(i, 0x00);
+1 -1
View File
@@ -398,7 +398,7 @@ static void MoveRelearnerLoadBgGfx(void)
FillWindowPixelBuffer(7, PIXEL_FILL(1)); FillWindowPixelBuffer(7, PIXEL_FILL(1));
FillBgTilemapBufferRect(0, 0x000, 0, 0, 30, 20, 0xF); FillBgTilemapBufferRect(0, 0x000, 0, 0, 30, 20, 0xF);
SetBgTilemapBuffer(1, sMoveRelearner->bg1TilemapBuffer); SetBgTilemapBuffer(1, sMoveRelearner->bg1TilemapBuffer);
TextWindow_SetUserSelectedFrame(0, 1, 0xE0); LoadUserWindowGfx(0, 1, 0xE0);
ListMenuLoadStdPalAt(0xD0, 1); ListMenuLoadStdPalAt(0xD0, 1);
LoadPalette(gUnknown_8E97DDC, 0x00, 0x20); LoadPalette(gUnknown_8E97DDC, 0x00, 0x20);
DecompressAndLoadBgGfxUsingHeap(1, gUnknown_8E97DFC, 0, 0, 0); DecompressAndLoadBgGfxUsingHeap(1, gUnknown_8E97DFC, 0, 0, 0);
+1 -1
View File
@@ -1487,7 +1487,7 @@ void CB2_LinkError(void)
SetGpuReg(REG_OFFSET_BG1HOFS, 0); SetGpuReg(REG_OFFSET_BG1HOFS, 0);
SetGpuReg(REG_OFFSET_BG1VOFS, 0); SetGpuReg(REG_OFFSET_BG1VOFS, 0);
ClearGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_WIN0_ON | DISPCNT_WIN1_ON | DISPCNT_OBJWIN_ON); ClearGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_WIN0_ON | DISPCNT_WIN1_ON | DISPCNT_OBJWIN_ON);
LoadPalette(gTMCaseMainWindowPalette, 0xf0, 0x20); LoadPalette(gStandardMenuPalette, 0xf0, 0x20);
gSoftResetDisabled = FALSE; gSoftResetDisabled = FALSE;
CreateTask(Task_DestroySelf, 0); CreateTask(Task_DestroySelf, 0);
StopMapMusic(); StopMapMusic();
+1 -1
View File
@@ -91,7 +91,7 @@ u32 DoMysteryGiftListMenu(const struct WindowTemplate *windowTemplate, const str
switch (arg2) switch (arg2)
{ {
case 2: case 2:
TextWindow_SetUserSelectedFrame(sMysteryGiftLinkMenu.windowId, tileNum, palNum); LoadUserWindowGfx(sMysteryGiftLinkMenu.windowId, tileNum, palNum);
case 1: case 1:
DrawTextBorderOuter(sMysteryGiftLinkMenu.windowId, tileNum, palNum / 16); DrawTextBorderOuter(sMysteryGiftLinkMenu.windowId, tileNum, palNum / 16);
break; break;
+1 -1
View File
@@ -560,7 +560,7 @@ static bool8 DoInitMailView(void)
CopyBgTilemapBufferToVram(2); CopyBgTilemapBufferToVram(2);
break; break;
case 12: case 12:
LoadPalette(stdpal_get(0), 0xF0, 0x20); LoadPalette(GetTextWindowPalette(0), 0xF0, 0x20);
gPlttBufferUnfaded[15 * 16 + 10] = sGfxHeaders[sMailViewResources->mailType].textpals[0]; gPlttBufferUnfaded[15 * 16 + 10] = sGfxHeaders[sMailViewResources->mailType].textpals[0];
gPlttBufferFaded[15 * 16 + 10] = sGfxHeaders[sMailViewResources->mailType].textpals[0]; gPlttBufferFaded[15 * 16 + 10] = sGfxHeaders[sMailViewResources->mailType].textpals[0];
gPlttBufferUnfaded[15 * 16 + 11] = sGfxHeaders[sMailViewResources->mailType].textpals[1]; gPlttBufferUnfaded[15 * 16 + 11] = sGfxHeaders[sMailViewResources->mailType].textpals[1];
+3 -3
View File
@@ -677,14 +677,14 @@ static void PrintBadgeCount(void)
static void LoadUserFrameToBg(u8 bgId) static void LoadUserFrameToBg(u8 bgId)
{ {
LoadBgTiles(bgId, GetWindowFrameTilesPal(gSaveBlock2Ptr->optionsWindowFrameType)->tiles, 0x120, 0x1B1); LoadBgTiles(bgId, GetUserWindowGraphics(gSaveBlock2Ptr->optionsWindowFrameType)->tiles, 0x120, 0x1B1);
LoadPalette(GetWindowFrameTilesPal(gSaveBlock2Ptr->optionsWindowFrameType)->palette, 0x20, 0x20); LoadPalette(GetUserWindowGraphics(gSaveBlock2Ptr->optionsWindowFrameType)->palette, 0x20, 0x20);
MainMenu_EraseWindow(&sWindowTemplate[MAIN_MENU_WINDOW_ERROR]); MainMenu_EraseWindow(&sWindowTemplate[MAIN_MENU_WINDOW_ERROR]);
} }
static void SetStdFrame0OnBg(u8 bgId) static void SetStdFrame0OnBg(u8 bgId)
{ {
TextWindow_SetStdFrame0_WithPal(MAIN_MENU_WINDOW_NEWGAME_ONLY, 0x1B1, 0x20); LoadStdWindowGfx(MAIN_MENU_WINDOW_NEWGAME_ONLY, 0x1B1, 0x20);
MainMenu_EraseWindow(&sWindowTemplate[MAIN_MENU_WINDOW_ERROR]); MainMenu_EraseWindow(&sWindowTemplate[MAIN_MENU_WINDOW_ERROR]);
} }
+3 -3
View File
@@ -172,13 +172,13 @@ static u16 MapNamePopupCreateWindow(bool32 palintoFadedBuffer)
windowId = AddWindow(&windowTemplate); windowId = AddWindow(&windowTemplate);
if (palintoFadedBuffer) if (palintoFadedBuffer)
{ {
LoadPalette(stdpal_get(3), 0xd0, 0x20); LoadPalette(GetTextWindowPalette(3), 0xd0, 0x20);
} }
else else
{ {
CpuCopy16(stdpal_get(3), &gPlttBufferUnfaded[0xd0], 0x20); CpuCopy16(GetTextWindowPalette(3), &gPlttBufferUnfaded[0xd0], 0x20);
} }
sub_814FF6C(windowId, r6); LoadStdWindowTiles(windowId, r6);
DrawTextBorderOuter(windowId, r6, 0xD); DrawTextBorderOuter(windowId, r6, 0xD);
PutWindowTilemap(windowId); PutWindowTilemap(windowId);
MapNamePopupPrintMapNameOnWindow(windowId); MapNamePopupPrintMapNameOnWindow(windowId);
+1 -1
View File
@@ -180,7 +180,7 @@ u8 CreateTopBarWindowLoadPalette(u8 bg, u8 width, u8 yPos, u8 palette, u16 baseT
palette = 15 * 16; palette = 15 * 16;
else else
palette *= 16; palette *= 16;
LoadPalette(stdpal_get(2), palette, 0x20); LoadPalette(GetTextWindowPalette(2), palette, 0x20);
return sTopBarWindowId; return sTopBarWindowId;
} }
+1 -1
View File
@@ -290,7 +290,7 @@ void InitMonMarkingsMenu(struct MonMarkingsMenu *ptr)
static void BufferMenuWindowTiles(void) static void BufferMenuWindowTiles(void)
{ {
const struct TextWindowGraphics *frame = GetWindowFrameTilesPal(gSaveBlock2Ptr->optionsWindowFrameType); const struct TextWindowGraphics *frame = GetUserWindowGraphics(gSaveBlock2Ptr->optionsWindowFrameType);
sMenu->frameTiles = frame->tiles; sMenu->frameTiles = frame->tiles;
sMenu->framePalette = frame->palette; sMenu->framePalette = frame->palette;
sMenu->tileLoadState = 0; sMenu->tileLoadState = 0;
+1 -1
View File
@@ -124,7 +124,7 @@ void DrawMoneyBox(int amount, u8 x, u8 y)
sMoneyBoxWindowId = AddWindow(&template); sMoneyBoxWindowId = AddWindow(&template);
FillWindowPixelBuffer(sMoneyBoxWindowId, 0); FillWindowPixelBuffer(sMoneyBoxWindowId, 0);
PutWindowTilemap(sMoneyBoxWindowId); PutWindowTilemap(sMoneyBoxWindowId);
TextWindow_SetStdFrame0_WithPal(sMoneyBoxWindowId, 0x21D, 0xD0); LoadStdWindowGfx(sMoneyBoxWindowId, 0x21D, 0xD0);
PrintMoneyAmountInMoneyBoxWithBorder(sMoneyBoxWindowId, 0x21D, 13, amount); PrintMoneyAmountInMoneyBoxWithBorder(sMoneyBoxWindowId, 0x21D, 13, amount);
} }
+3 -3
View File
@@ -390,8 +390,8 @@ bool32 HandleMysteryGiftOrEReaderSetup(s32 mg_or_ereader)
SetBgTilemapBuffer(1, Alloc(0x800)); SetBgTilemapBuffer(1, Alloc(0x800));
SetBgTilemapBuffer(0, Alloc(0x800)); SetBgTilemapBuffer(0, Alloc(0x800));
LoadUserWindowBorderGfx(0, 10, 0xE0); LoadUserWindowGfx2(0, 10, 0xE0);
DrawWindowBorderWithStdpal3(0, 1, 0xF0); LoadStdWindowGfxOnBg(0, 1, 0xF0);
DecompressAndLoadBgGfxUsingHeap(3, gUnkTextboxBorderGfx, 0x100, 0, 0); DecompressAndLoadBgGfxUsingHeap(3, gUnkTextboxBorderGfx, 0x100, 0, 0);
InitWindows(sMainWindows); InitWindows(sMainWindows);
DeactivateAllTextPrinters(); DeactivateAllTextPrinters();
@@ -403,7 +403,7 @@ bool32 HandleMysteryGiftOrEReaderSetup(s32 mg_or_ereader)
break; break;
case 1: case 1:
LoadPalette(gUnkTextboxBorderPal, 0, 0x20); LoadPalette(gUnkTextboxBorderPal, 0, 0x20);
LoadPalette(stdpal_get(2), 0xd0, 0x20); LoadPalette(GetTextWindowPalette(2), 0xd0, 0x20);
FillBgTilemapBufferRect(0, 0x000, 0, 0, 32, 32, 0x11); FillBgTilemapBufferRect(0, 0x000, 0, 0, 32, 32, 0x11);
FillBgTilemapBufferRect(1, 0x000, 0, 0, 32, 32, 0x11); FillBgTilemapBufferRect(1, 0x000, 0, 0, 32, 32, 0x11);
FillBgTilemapBufferRect(2, 0x000, 0, 0, 32, 32, 0x11); FillBgTilemapBufferRect(2, 0x000, 0, 0, 32, 32, 0x11);
+1 -1
View File
@@ -1874,7 +1874,7 @@ static void LoadPalettes(void)
{ {
LoadPalette(gNamingScreenMenu_Pal, 0, sizeof(gNamingScreenMenu_Pal)); LoadPalette(gNamingScreenMenu_Pal, 0, sizeof(gNamingScreenMenu_Pal));
LoadPalette(gNamingScreenKeyboard_Pal, 0xA0, 0x20); LoadPalette(gNamingScreenKeyboard_Pal, 0xA0, 0x20);
LoadPalette(stdpal_get(2), 0xB0, 0x20); LoadPalette(GetTextWindowPalette(2), 0xB0, 0x20);
} }
static void DecompressToBgTilemapBuffer(u8 bg, const u32 *src) static void DecompressToBgTilemapBuffer(u8 bg, const u32 *src)
+34 -28
View File
@@ -19,21 +19,26 @@ static EWRAM_DATA u16 sTempTileDataBufferCursor = {0};
static EWRAM_DATA void *sTempTileDataBuffers[0x20] = {NULL}; static EWRAM_DATA void *sTempTileDataBuffers[0x20] = {NULL};
static EWRAM_DATA u8 sStartMenuWindowId = {0}; static EWRAM_DATA u8 sStartMenuWindowId = {0};
static const u16 gUnknown_841EF48[] = INCBIN_U16("graphics/unknown/unk_841EF48.4bpp"); static const u16 sUnusedWindow_Gfx[] = INCBIN_U16("graphics/text_window/unused.4bpp");
const u16 gMenuMessageWindow_Gfx[] = INCBIN_U16("graphics/text_window/menu_message.4bpp");
const u16 gUnknown_841F1C8[] = INCBIN_U16("graphics/text_window/unk_841F1C8.4bpp"); const u16 gStandardMenuPalette[] = INCBIN_U16("graphics/interface/std_menu.gbapal");
const u16 gTMCaseMainWindowPalette[] = INCBIN_U16("graphics/tm_case/unk_841F408.gbapal");
static const u8 gUnknown_841F428[] = { 8, 4, 1 }; static const u8 sTextSpeedFrameDelays[] =
{
[OPTIONS_TEXT_SPEED_SLOW] = 8,
[OPTIONS_TEXT_SPEED_MID] = 4,
[OPTIONS_TEXT_SPEED_FAST] = 1
};
static const struct WindowTemplate sStandardTextBox_WindowTemplates[] = static const struct WindowTemplate sStandardTextBox_WindowTemplates[] =
{ {
{ {
.bg = 0, .bg = 0,
.tilemapLeft = 0x2, .tilemapLeft = 2,
.tilemapTop = 0xF, .tilemapTop = 15,
.width = 0x1A, .width = 26,
.height = 0x4, .height = 4,
.paletteNum = DLG_WINDOW_PALETTE_NUM, .paletteNum = DLG_WINDOW_PALETTE_NUM,
.baseBlock = 0x198, .baseBlock = 0x198,
}, },
@@ -43,10 +48,10 @@ static const struct WindowTemplate sStandardTextBox_WindowTemplates[] =
static const struct WindowTemplate sYesNo_WindowTemplate = static const struct WindowTemplate sYesNo_WindowTemplate =
{ {
.bg = 0, .bg = 0,
.tilemapLeft = 0x15, .tilemapLeft = 21,
.tilemapTop = 0x9, .tilemapTop = 9,
.width = 0x6, .width = 6,
.height = 0x4, .height = 4,
.paletteNum = DLG_WINDOW_PALETTE_NUM, .paletteNum = DLG_WINDOW_PALETTE_NUM,
.baseBlock = 0x125, .baseBlock = 0x125,
}; };
@@ -455,14 +460,14 @@ void LoadStdWindowFrameGfx(void)
if (gQuestLogState == QL_STATE_PLAYBACK) if (gQuestLogState == QL_STATE_PLAYBACK)
{ {
gTextFlags.autoScroll = 1; gTextFlags.autoScroll = 1;
TextWindow_LoadTilesStdFrame1(0, DLG_WINDOW_BASE_TILE_NUM); LoadQuestLogWindowTiles(0, DLG_WINDOW_BASE_TILE_NUM);
} }
else else
{ {
Menu_LoadStdPal(); Menu_LoadStdPal();
TextWindow_LoadResourcesStdFrame0(0, DLG_WINDOW_BASE_TILE_NUM, DLG_WINDOW_PALETTE_NUM * 0x10); LoadMenuMessageWindowGfx(0, DLG_WINDOW_BASE_TILE_NUM, DLG_WINDOW_PALETTE_NUM * 0x10);
} }
TextWindow_SetUserSelectedFrame(0, STD_WINDOW_BASE_TILE_NUM, STD_WINDOW_PALETTE_NUM * 0x10); LoadUserWindowGfx(0, STD_WINDOW_BASE_TILE_NUM, STD_WINDOW_PALETTE_NUM * 0x10);
} }
void DrawDialogueFrame(u8 windowId, bool8 copyToVram) void DrawDialogueFrame(u8 windowId, bool8 copyToVram)
@@ -522,7 +527,7 @@ static void WindowFunc_DrawStandardFrame(u8 bg, u8 tilemapLeft, u8 tilemapTop, u
static void WindowFunc_DrawDialogueFrame(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum) static void WindowFunc_DrawDialogueFrame(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum)
{ {
if (!IsMsgSignPost() || gQuestLogState == QL_STATE_PLAYBACK) if (!IsMsgSignpost() || gQuestLogState == QL_STATE_PLAYBACK)
{ {
FillBgTilemapBufferRect(bg, DLG_WINDOW_BASE_TILE_NUM + 0, tilemapLeft - 2, tilemapTop - 1, 1, 1, DLG_WINDOW_PALETTE_NUM); FillBgTilemapBufferRect(bg, DLG_WINDOW_BASE_TILE_NUM + 0, tilemapLeft - 2, tilemapTop - 1, 1, 1, DLG_WINDOW_PALETTE_NUM);
FillBgTilemapBufferRect(bg, DLG_WINDOW_BASE_TILE_NUM + 1, tilemapLeft - 1, tilemapTop - 1, 1, 1, DLG_WINDOW_PALETTE_NUM); FillBgTilemapBufferRect(bg, DLG_WINDOW_BASE_TILE_NUM + 1, tilemapLeft - 1, tilemapTop - 1, 1, 1, DLG_WINDOW_PALETTE_NUM);
@@ -609,35 +614,36 @@ void sub_80F7768(u8 windowId, bool8 copyToVram)
if (gQuestLogState == QL_STATE_PLAYBACK) if (gQuestLogState == QL_STATE_PLAYBACK)
{ {
gTextFlags.autoScroll = 1; gTextFlags.autoScroll = 1;
TextWindow_LoadTilesStdFrame1(0, DLG_WINDOW_BASE_TILE_NUM); LoadQuestLogWindowTiles(0, DLG_WINDOW_BASE_TILE_NUM);
} }
else else
{ {
TextWindow_LoadResourcesStdFrame0(windowId, DLG_WINDOW_BASE_TILE_NUM, DLG_WINDOW_PALETTE_NUM * 0x10); LoadMenuMessageWindowGfx(windowId, DLG_WINDOW_BASE_TILE_NUM, DLG_WINDOW_PALETTE_NUM * 0x10);
} }
DrawDialogFrameWithCustomTileAndPalette(windowId, copyToVram, DLG_WINDOW_BASE_TILE_NUM, DLG_WINDOW_PALETTE_NUM); DrawDialogFrameWithCustomTileAndPalette(windowId, copyToVram, DLG_WINDOW_BASE_TILE_NUM, DLG_WINDOW_PALETTE_NUM);
} }
void Menu_LoadStdPal(void) void Menu_LoadStdPal(void)
{ {
LoadPalette(gTMCaseMainWindowPalette, STD_WINDOW_PALETTE_NUM * 0x10, 0x14); LoadPalette(gStandardMenuPalette, STD_WINDOW_PALETTE_NUM * 0x10, 0x14);
} }
void Menu_LoadStdPalAt(u16 offset) void Menu_LoadStdPalAt(u16 offset)
{ {
LoadPalette(gTMCaseMainWindowPalette, offset, 0x14); LoadPalette(gStandardMenuPalette, offset, 0x14);
} }
static const u16 *GetTmCaseMainWindowPalette(void) // Unused
static const u16 *GetStdMenuPalette(void)
{ {
return gTMCaseMainWindowPalette; return gStandardMenuPalette;
} }
static u16 GetStdPalColor(u8 colorNum) static u16 GetStdPalColor(u8 colorNum)
{ {
if (colorNum > 0xF) if (colorNum > 0xF)
colorNum = 0; colorNum = 0;
return gTMCaseMainWindowPalette[colorNum]; return gStandardMenuPalette[colorNum];
} }
void DisplayItemMessageOnField(u8 taskId, u8 fontId, const u8 *string, TaskFunc callback) void DisplayItemMessageOnField(u8 taskId, u8 fontId, const u8 *string, TaskFunc callback)
@@ -662,7 +668,7 @@ u8 GetTextSpeedSetting(void)
u32 speed; u32 speed;
if (gSaveBlock2Ptr->optionsTextSpeed > OPTIONS_TEXT_SPEED_FAST) if (gSaveBlock2Ptr->optionsTextSpeed > OPTIONS_TEXT_SPEED_FAST)
gSaveBlock2Ptr->optionsTextSpeed = OPTIONS_TEXT_SPEED_MID; gSaveBlock2Ptr->optionsTextSpeed = OPTIONS_TEXT_SPEED_MID;
return gUnknown_841F428[gSaveBlock2Ptr->optionsTextSpeed]; return sTextSpeedFrameDelays[gSaveBlock2Ptr->optionsTextSpeed];
} }
u8 CreateStartMenuWindow(u8 height) u8 CreateStartMenuWindow(u8 height)
@@ -702,7 +708,7 @@ u16 GetStdWindowBaseTileNum(void)
void DrawHelpMessageWindowWithText(const u8 * text) void DrawHelpMessageWindowWithText(const u8 * text)
{ {
sub_814FE6C(CreateHelpMessageWindow(), DLG_WINDOW_BASE_TILE_NUM, 0x10 * DLG_WINDOW_PALETTE_NUM); LoadHelpMessageWindowGfx(CreateHelpMessageWindow(), DLG_WINDOW_BASE_TILE_NUM, 0x10 * DLG_WINDOW_PALETTE_NUM);
PrintTextOnHelpMessageWindow(text, 2); PrintTextOnHelpMessageWindow(text, 2);
} }
@@ -711,11 +717,11 @@ void DestroyHelpMessageWindow_(void)
DestroyHelpMessageWindow(2); DestroyHelpMessageWindow(2);
} }
void LoadSignPostWindowFrameGfx(void) void LoadSignpostWindowFrameGfx(void)
{ {
Menu_LoadStdPal(); Menu_LoadStdPal();
sub_814FEEC(0, DLG_WINDOW_BASE_TILE_NUM, 0x10 * DLG_WINDOW_PALETTE_NUM); LoadSignpostWindowGfx(0, DLG_WINDOW_BASE_TILE_NUM, 0x10 * DLG_WINDOW_PALETTE_NUM);
TextWindow_SetUserSelectedFrame(0, STD_WINDOW_BASE_TILE_NUM, 0x10 * STD_WINDOW_PALETTE_NUM); LoadUserWindowGfx(0, STD_WINDOW_BASE_TILE_NUM, 0x10 * STD_WINDOW_PALETTE_NUM);
} }
void SetDefaultFontsPointer(void) void SetDefaultFontsPointer(void)
+4 -4
View File
@@ -548,7 +548,7 @@ static void Task_OaksSpeech1(u8 taskId)
InitTextBoxGfxAndPrinters(); InitTextBoxGfxAndPrinters();
Menu_LoadStdPalAt(0xD0); Menu_LoadStdPalAt(0xD0);
LoadPalette(sHelpDocsPalette, 0x000, 0x080); LoadPalette(sHelpDocsPalette, 0x000, 0x080);
LoadPalette(stdpal_get(2) + 15, 0x000, 0x002); LoadPalette(GetTextWindowPalette(2) + 15, 0x000, 0x002);
break; break;
case 5: case 5:
sOakSpeechResources->textSpeed = GetTextSpeedSetting(); sOakSpeechResources->textSpeed = GetTextSpeedSetting();
@@ -629,7 +629,7 @@ static void Task_OakSpeech4(u8 taskId)
} }
CopyBgTilemapBufferToVram(1); CopyBgTilemapBufferToVram(1);
} }
BeginNormalPaletteFade(0xFFFFDFFF, -1, 16, 0, stdpal_get(2)[15]); BeginNormalPaletteFade(0xFFFFDFFF, -1, 16, 0, GetTextWindowPalette(2)[15]);
gTasks[taskId].func = Task_OaksSpeech2; gTasks[taskId].func = Task_OaksSpeech2;
} }
@@ -642,7 +642,7 @@ static void Task_OaksSpeech2(u8 taskId)
gTasks[taskId].data[15] = 1; gTasks[taskId].data[15] = 1;
if (sOakSpeechResources->unk_0012 < 2) if (sOakSpeechResources->unk_0012 < 2)
{ {
BeginNormalPaletteFade(0xFFFFDFFF, -1, 0, 16, stdpal_get(2)[15]); BeginNormalPaletteFade(0xFFFFDFFF, -1, 0, 16, GetTextWindowPalette(2)[15]);
} }
} }
else else
@@ -650,7 +650,7 @@ static void Task_OaksSpeech2(u8 taskId)
if (sOakSpeechResources->unk_0012 != 0) if (sOakSpeechResources->unk_0012 != 0)
{ {
gTasks[taskId].data[15] = -1; gTasks[taskId].data[15] = -1;
BeginNormalPaletteFade(0xFFFFDFFF, -1, 0, 16, stdpal_get(2)[15]); BeginNormalPaletteFade(0xFFFFDFFF, -1, 0, 16, GetTextWindowPalette(2)[15]);
} }
else else
return; return;
+6 -6
View File
@@ -337,17 +337,17 @@ static bool8 LoadOptionMenuPalette(void)
switch (sOptionMenuPtr->loadPaletteState) switch (sOptionMenuPtr->loadPaletteState)
{ {
case 0: case 0:
LoadBgTiles(1, GetWindowFrameTilesPal(sOptionMenuPtr->option[MENUITEM_FRAMETYPE])->tiles, 0x120, 0x1AA); LoadBgTiles(1, GetUserWindowGraphics(sOptionMenuPtr->option[MENUITEM_FRAMETYPE])->tiles, 0x120, 0x1AA);
break; break;
case 1: case 1:
LoadPalette(GetWindowFrameTilesPal(sOptionMenuPtr->option[MENUITEM_FRAMETYPE])->palette, 0x20, 0x20); LoadPalette(GetUserWindowGraphics(sOptionMenuPtr->option[MENUITEM_FRAMETYPE])->palette, 0x20, 0x20);
break; break;
case 2: case 2:
LoadPalette(sOptionMenuPalette, 0x10, 0x20); LoadPalette(sOptionMenuPalette, 0x10, 0x20);
LoadPalette(stdpal_get(2), 0xF0, 0x20); LoadPalette(GetTextWindowPalette(2), 0xF0, 0x20);
break; break;
case 3: case 3:
DrawWindowBorderWithStdpal3(1, 0x1B3, 0x30); LoadStdWindowGfxOnBg(1, 0x1B3, 0x30);
break; break;
default: default:
return TRUE; return TRUE;
@@ -381,8 +381,8 @@ static void Task_OptionMenu(u8 taskId)
sOptionMenuPtr->loadState++; sOptionMenuPtr->loadState++;
break; break;
case 2: case 2:
LoadBgTiles(1, GetWindowFrameTilesPal(sOptionMenuPtr->option[MENUITEM_FRAMETYPE])->tiles, 0x120, 0x1AA); LoadBgTiles(1, GetUserWindowGraphics(sOptionMenuPtr->option[MENUITEM_FRAMETYPE])->tiles, 0x120, 0x1AA);
LoadPalette(GetWindowFrameTilesPal(sOptionMenuPtr->option[MENUITEM_FRAMETYPE])->palette, 0x20, 0x20); LoadPalette(GetUserWindowGraphics(sOptionMenuPtr->option[MENUITEM_FRAMETYPE])->palette, 0x20, 0x20);
BufferOptionMenuString(sOptionMenuPtr->cursorPos); BufferOptionMenuString(sOptionMenuPtr->cursorPos);
break; break;
case 3: case 3:
+7 -7
View File
@@ -2006,8 +2006,8 @@ static void Task_FirstBattleEnterParty_WaitFadeNormal(u8 taskId)
{ {
if (!gPaletteFade.active) if (!gPaletteFade.active)
{ {
TextWindow_SetUserSelectedFrame(0, 0x4F, 0xD0); LoadUserWindowGfx(0, 0x4F, 0xD0);
TextWindow_SetStdFrame0_WithPal(0, 0x58, 0xF0); LoadStdWindowGfx(0, 0x58, 0xF0);
if (gPartyMenu.action == PARTY_ACTION_USE_ITEM) if (gPartyMenu.action == PARTY_ACTION_USE_ITEM)
DisplayPartyMenuStdMessage(PARTY_MSG_USE_ON_WHICH_MON); DisplayPartyMenuStdMessage(PARTY_MSG_USE_ON_WHICH_MON);
else else
@@ -2117,10 +2117,10 @@ static void InitPartyMenuWindows(u8 layout)
DeactivateAllTextPrinters(); DeactivateAllTextPrinters();
for (i = 0; i < PARTY_SIZE; ++i) for (i = 0; i < PARTY_SIZE; ++i)
FillWindowPixelBuffer(i, PIXEL_FILL(0)); FillWindowPixelBuffer(i, PIXEL_FILL(0));
TextWindow_SetUserSelectedFrame(0, 0x4F, 0xD0); LoadUserWindowGfx(0, 0x4F, 0xD0);
TextWindow_SetStdFrame0_WithPal(0, 0x58, 0xF0); LoadStdWindowGfx(0, 0x58, 0xF0);
LoadPalette(stdpal_get(2), 0xC0, 0x20); LoadPalette(GetTextWindowPalette(2), 0xC0, 0x20);
LoadPalette(stdpal_get(0), 0xE0, 0x20); LoadPalette(GetTextWindowPalette(0), 0xE0, 0x20);
} }
static void CreateCancelConfirmWindows(bool8 chooseMultiple) static void CreateCancelConfirmWindows(bool8 chooseMultiple)
@@ -2603,7 +2603,7 @@ static bool8 FirstBattleEnterParty_CreateWindowAndMsg1Printer(void)
{ {
u8 windowId = AddWindow(&sWindowTemplate_FirstBattleOakVoiceover); u8 windowId = AddWindow(&sWindowTemplate_FirstBattleOakVoiceover);
TextWindow_LoadResourcesStdFrame0(windowId, 0x4F, 0xE0); LoadMenuMessageWindowGfx(windowId, 0x4F, 0xE0);
DrawDialogFrameWithCustomTileAndPalette(windowId, 1, 0x4F, 0xE); DrawDialogFrameWithCustomTileAndPalette(windowId, 1, 0x4F, 0xE);
PartyMenu_Oak_PrintText(windowId, gText_OakImportantToGetToKnowPokemonThroughly); PartyMenu_Oak_PrintText(windowId, gText_OakImportantToGetToKnowPokemonThroughly);
return windowId; return windowId;
+3 -3
View File
@@ -3053,8 +3053,8 @@ static void LoadPokeJumpGfx(void)
FillBgTilemapBufferRect_Palette0(BG_INTERFACE, 0, 0, 0, 0x20, 0x20); FillBgTilemapBufferRect_Palette0(BG_INTERFACE, 0, 0, 0, 0x20, 0x20);
PrintScoreSuffixes(); PrintScoreSuffixes();
PrintScore(0); PrintScore(0);
DrawWindowBorderWithStdpal3(0, 1, 0xE0); LoadStdWindowGfxOnBg(0, 1, 0xE0);
LoadUserWindowBorderGfx(0, 0x00A, 0xD0); LoadUserWindowGfx2(0, 0x00A, 0xD0);
CopyBgTilemapBufferToVram(BG_INTERFACE); CopyBgTilemapBufferToVram(BG_INTERFACE);
CopyBgTilemapBufferToVram(BG_VENUSAUR); CopyBgTilemapBufferToVram(BG_VENUSAUR);
CopyBgTilemapBufferToVram(BG_BONUSES); CopyBgTilemapBufferToVram(BG_BONUSES);
@@ -4554,7 +4554,7 @@ static void PrintRecordsText(u16 windowId)
recordNums[1] = records->bestJumpScore; recordNums[1] = records->bestJumpScore;
recordNums[2] = records->excellentsInRow; recordNums[2] = records->excellentsInRow;
TextWindow_SetStdFrame0_WithPal(windowId, 0x21D, 0xD0); LoadStdWindowGfx(windowId, 0x21D, 0xD0);
DrawTextBorderOuter(windowId, 0x21D, 0xD); DrawTextBorderOuter(windowId, 0x21D, 0xD);
FillWindowPixelBuffer(windowId, PIXEL_FILL(1)); FillWindowPixelBuffer(windowId, PIXEL_FILL(1));
AddTextPrinterParameterized5(windowId, FONT_2, gText_PkmnJumpRecords, 0, 0, TEXT_SKIP_DRAW, NULL, 1, 0); AddTextPrinterParameterized5(windowId, FONT_2, gText_PkmnJumpRecords, 0, 0, TEXT_SKIP_DRAW, NULL, 1, 0);
+1 -1
View File
@@ -341,7 +341,7 @@ void InitPokemonSpecialAnimScene(struct PokemonSpecialAnimScene * buffer, u16 an
FillBgTilemapBufferRect_Palette0(0, 0x000, 0, 0, 32, 32); FillBgTilemapBufferRect_Palette0(0, 0x000, 0, 0, 32, 32);
LoadBgGfxByAnimType(animType); LoadBgGfxByAnimType(animType);
FillWindowPixelBuffer(0, PIXEL_FILL(0)); FillWindowPixelBuffer(0, PIXEL_FILL(0));
TextWindow_SetUserSelectedFrame(0, 0x000, 0xe0); LoadUserWindowGfx(0, 0x000, 0xe0);
CopyWindowToVram(0, COPYWIN_FULL); CopyWindowToVram(0, COPYWIN_FULL);
ShowBg(0); ShowBg(0);
ShowBg(3); ShowBg(3);
+2 -2
View File
@@ -167,7 +167,7 @@ static bool8 MultiMove_Function_Single(void)
if (!IsDma3ManagerBusyWithBgCopy()) if (!IsDma3ManagerBusyWithBgCopy())
{ {
SetCursorPriorityTo1(); SetCursorPriorityTo1();
LoadPalette(stdpal_get(3), 0xD0, 0x20); LoadPalette(GetTextWindowPalette(3), 0xD0, 0x20);
ShowBg(0); ShowBg(0);
return FALSE; return FALSE;
} }
@@ -273,7 +273,7 @@ static bool8 MultiMove_Function_PlaceMons(void)
case 3: case 3:
if (!IsDma3ManagerBusyWithBgCopy()) if (!IsDma3ManagerBusyWithBgCopy())
{ {
LoadPalette(stdpal_get(3), 0xD0, 0x20); LoadPalette(GetTextWindowPalette(3), 0xD0, 0x20);
SetCursorPriorityTo1(); SetCursorPriorityTo1();
ShowBg(0); ShowBg(0);
return FALSE; return FALSE;
+2 -2
View File
@@ -534,7 +534,7 @@ static void Task_InitPokeStorage(u8 taskId)
PutWindowTilemap(0); PutWindowTilemap(0);
ClearWindowTilemap(1); ClearWindowTilemap(1);
CpuFill32(0, (void *)VRAM, 0x200); CpuFill32(0, (void *)VRAM, 0x200);
TextWindow_SetUserSelectedFrame(1, 0xB, 0xE0); LoadUserWindowGfx(1, 0xB, 0xE0);
break; break;
case 3: case 3:
ResetAllBgCoords(); ResetAllBgCoords();
@@ -2545,7 +2545,7 @@ static bool8 DoShowPartyMenu(void)
static void InitPokeStorageBg0(void) static void InitPokeStorageBg0(void)
{ {
SetGpuReg(REG_OFFSET_BG0CNT, BGCNT_PRIORITY(0) | BGCNT_CHARBASE(0) | BGCNT_SCREENBASE(29)); SetGpuReg(REG_OFFSET_BG0CNT, BGCNT_PRIORITY(0) | BGCNT_CHARBASE(0) | BGCNT_SCREENBASE(29));
TextWindow_SetStdFrame0_WithPal(1, 2, 0xD0); LoadStdWindowGfx(1, 2, 0xD0);
FillBgTilemapBufferRect(0, 0, 0, 0, 32, 20, 17); FillBgTilemapBufferRect(0, 0, 0, 0, 32, 20, 17);
CopyBgTilemapBufferToVram(0); CopyBgTilemapBufferToVram(0);
} }
+3 -3
View File
@@ -459,7 +459,7 @@ void sub_8110FCC(void)
static bool8 FieldCB2_QuestLogStartPlaybackWithWarpExit(void) static bool8 FieldCB2_QuestLogStartPlaybackWithWarpExit(void)
{ {
LoadPalette(stdpal_get(4), 0xF0, 0x20); LoadPalette(GetTextWindowPalette(4), 0xF0, 0x20);
SetQuestLogState(QL_STATE_PLAYBACK); SetQuestLogState(QL_STATE_PLAYBACK);
FieldCB_DefaultWarpExit(); FieldCB_DefaultWarpExit();
sQuestLogCurrentScene = (struct UnkStruct_203AE94){}; sQuestLogCurrentScene = (struct UnkStruct_203AE94){};
@@ -469,7 +469,7 @@ static bool8 FieldCB2_QuestLogStartPlaybackWithWarpExit(void)
static bool8 FieldCB2_QuestLogStartPlaybackStandingInPlace(void) static bool8 FieldCB2_QuestLogStartPlaybackStandingInPlace(void)
{ {
LoadPalette(stdpal_get(4), 0xF0, 0x20); LoadPalette(GetTextWindowPalette(4), 0xF0, 0x20);
SetQuestLogState(QL_STATE_PLAYBACK); SetQuestLogState(QL_STATE_PLAYBACK);
FieldCB_WarpExitFadeFromBlack(); FieldCB_WarpExitFadeFromBlack();
sQuestLogCurrentScene = (struct UnkStruct_203AE94){}; sQuestLogCurrentScene = (struct UnkStruct_203AE94){};
@@ -1076,7 +1076,7 @@ void QuestLog_BackUpPalette(u16 offset, u16 size)
static bool8 FieldCB2_FinalScene(void) static bool8 FieldCB2_FinalScene(void)
{ {
LoadPalette(stdpal_get(4), 0xF0, 0x20); LoadPalette(GetTextWindowPalette(4), 0xF0, 0x20);
DrawPreviouslyOnQuestHeader(0); DrawPreviouslyOnQuestHeader(0);
FieldCB_WarpExitFadeFromBlack(); FieldCB_WarpExitFadeFromBlack();
CreateTask(Task_FinalScene_WaitFade, 0xFF); CreateTask(Task_FinalScene_WaitFade, 0xFF);
+2 -2
View File
@@ -2212,13 +2212,13 @@ bool8 ScrCmd_removecoins(struct ScriptContext * ctx)
bool8 ScrCmd_signmsg(struct ScriptContext * ctx) bool8 ScrCmd_signmsg(struct ScriptContext * ctx)
{ {
MsgSetSignPost(); MsgSetSignpost();
return FALSE; return FALSE;
} }
bool8 ScrCmd_normalmsg(struct ScriptContext * ctx) bool8 ScrCmd_normalmsg(struct ScriptContext * ctx)
{ {
MsgSetNotSignPost(); MsgSetNotSignpost();
return FALSE; return FALSE;
} }
+9 -9
View File
@@ -36,7 +36,7 @@ static u8 sMsgBoxWalkawayDisabled;
static u8 sMsgBoxIsCancelable; static u8 sMsgBoxIsCancelable;
static u8 sQuestLogInput; static u8 sQuestLogInput;
static u8 sQuestLogInputIsDpad; static u8 sQuestLogInputIsDpad;
static u8 sMsgIsSignPost; static u8 sMsgIsSignpost;
extern ScrCmdFunc gScriptCmdTable[]; extern ScrCmdFunc gScriptCmdTable[];
extern ScrCmdFunc gScriptCmdTableEnd[]; extern ScrCmdFunc gScriptCmdTableEnd[];
@@ -276,28 +276,28 @@ bool8 CanWalkAwayToCancelMsgBox(void)
return FALSE; return FALSE;
} }
void MsgSetSignPost(void) void MsgSetSignpost(void)
{ {
sMsgIsSignPost = TRUE; sMsgIsSignpost = TRUE;
} }
void MsgSetNotSignPost(void) void MsgSetNotSignpost(void)
{ {
sMsgIsSignPost = FALSE; sMsgIsSignpost = FALSE;
} }
bool8 IsMsgSignPost(void) bool8 IsMsgSignpost(void)
{ {
if(sMsgIsSignPost == TRUE) if(sMsgIsSignpost == TRUE)
return TRUE; return TRUE;
else else
return FALSE; return FALSE;
} }
void ResetFacingNpcOrSignPostVars(void) void ResetFacingNpcOrSignpostVars(void)
{ {
ResetContextNpcTextColor(); ResetContextNpcTextColor();
MsgSetNotSignPost(); MsgSetNotSignpost();
} }
// The ScriptContext_* functions work with the primary script context, // The ScriptContext_* functions work with the primary script context,
+1 -1
View File
@@ -212,7 +212,7 @@ static void CB2_SetUpSeagallopScene(void)
CopyToBgTilemapBufferRect(3, sWaterTilemap_WB, 0, 0, 32, 32); CopyToBgTilemapBufferRect(3, sWaterTilemap_WB, 0, 0, 32, 32);
} }
LoadPalette(sWaterPal, 0x40, 0x20); LoadPalette(sWaterPal, 0x40, 0x20);
LoadPalette(stdpal_get(2), 0xF0, 0x20); LoadPalette(GetTextWindowPalette(2), 0xF0, 0x20);
gMain.state++; gMain.state++;
break; break;
case 4: case 4:
+3 -3
View File
@@ -1975,8 +1975,8 @@ static bool8 SlotsTask_GraphicsInit(u8 * state, struct SlotMachineSetupTaskData
LoadPalette(sBgPal_50, 0x50, 0x20); LoadPalette(sBgPal_50, 0x50, 0x20);
LoadPalette(sBgPal_70, 0x70, 0x60); LoadPalette(sBgPal_70, 0x70, 0x60);
LoadColor(RGB(30, 30, 31), pal); LoadColor(RGB(30, 30, 31), pal);
LoadUserWindowBorderGfx(0, 0x00A, 0xD0); LoadUserWindowGfx2(0, 0x00A, 0xD0);
DrawWindowBorderWithStdpal3(0, 0x001, 0xF0); LoadStdWindowGfxOnBg(0, 0x001, 0xF0);
SetBgTilemapBuffer(0, ptr->bg0TilemapBuffer); SetBgTilemapBuffer(0, ptr->bg0TilemapBuffer);
FillBgTilemapBufferRect_Palette0(0, 0, 0, 2, 32, 30); FillBgTilemapBufferRect_Palette0(0, 0, 0, 2, 32, 30);
@@ -1984,7 +1984,7 @@ static bool8 SlotsTask_GraphicsInit(u8 * state, struct SlotMachineSetupTaskData
DecompressAndCopyTileDataToVram(1, sBg1Map, 0, 0, 1); DecompressAndCopyTileDataToVram(1, sBg1Map, 0, 0, 1);
CopyBgTilemapBufferToVram(1); CopyBgTilemapBufferToVram(1);
LoadPalette(stdpal_get(2), 0xE0, 0x20); LoadPalette(GetTextWindowPalette(2), 0xE0, 0x20);
FillWindowPixelBuffer(1, 0xFF); FillWindowPixelBuffer(1, 0xFF);
PutWindowTilemap(1); PutWindowTilemap(1);
+2 -2
View File
@@ -870,7 +870,7 @@ bool32 DoSetUpSaveAfterLinkBattle(u8 *state)
ResetBgsAndClearDma3BusyFlags(FALSE); ResetBgsAndClearDma3BusyFlags(FALSE);
InitBgsFromTemplates(0, sBGTemplates_AfterLinkSaveMessage, NELEMS(sBGTemplates_AfterLinkSaveMessage)); InitBgsFromTemplates(0, sBGTemplates_AfterLinkSaveMessage, NELEMS(sBGTemplates_AfterLinkSaveMessage));
InitWindows(sWindowTemplates_AfterLinkSaveMessage); InitWindows(sWindowTemplates_AfterLinkSaveMessage);
TextWindow_SetStdFrame0_WithPal(0, 0x008, 0xF0); LoadStdWindowGfx(0, 0x008, 0xF0);
break; break;
case 3: case 3:
ShowBg(0); ShowBg(0);
@@ -957,7 +957,7 @@ static void PrintSaveStats(void)
u8 y; u8 y;
u8 x; u8 x;
sSaveStatsWindowId = AddWindow(&sSaveStatsWindowTemplate); sSaveStatsWindowId = AddWindow(&sSaveStatsWindowTemplate);
TextWindow_SetStdFrame0_WithPal(sSaveStatsWindowId, 0x21D, 0xD0); LoadStdWindowGfx(sSaveStatsWindowId, 0x21D, 0xD0);
DrawStdFrameWithCustomTileAndPalette(sSaveStatsWindowId, FALSE, 0x21D, 0x0D); DrawStdFrameWithCustomTileAndPalette(sSaveStatsWindowId, FALSE, 0x21D, 0x0D);
SaveStatToString(SAVE_STAT_LOCATION, gStringVar4, 8); SaveStatToString(SAVE_STAT_LOCATION, gStringVar4, 8);
x = (u32)(112 - GetStringWidth(FONT_2, gStringVar4, -1)) / 2; x = (u32)(112 - GetStringWidth(FONT_2, gStringVar4, -1)) / 2;
+1 -1
View File
@@ -42,7 +42,7 @@ static const struct SpriteSheet sUnknown_81EA68C[] =
static const struct SpritePalette sUnknown_81EA6A4[] = static const struct SpritePalette sUnknown_81EA6A4[] =
{ {
{gTMCaseMainWindowPalette, 0x8000}, {gStandardMenuPalette, 0x8000},
{NULL} {NULL}
}; };
+53 -42
View File
@@ -2,95 +2,106 @@
#include "gflib.h" #include "gflib.h"
#include "text_window.h" #include "text_window.h"
#include "text_window_graphics.h" #include "text_window_graphics.h"
#include "quest_log.h" #include "help_message.h"
#include "new_menu_helpers.h"
extern const u16 gUnknown_841F1C8[]; static void LoadUserWindowGfxByFrame(u8 windowId, u8 frameType, u16 destOffset, u8 palIdx);
void LoadWindowGfx(u8 windowId, u8 frameType, u16 destOffset, u8 palIdx); // Unused
// Equivalent to LoadHelpMessageWindowGfx, but takes a bg id directly
void sub_814FD04(u8 bgId, u16 destOffset, u8 palIdx) static void LoadHelpMessageWindowGfxOnBg(u8 bgId, u16 destOffset, u8 palIdx)
{ {
LoadBgTiles(bgId, gUnknown_84566A8, 0x280, destOffset); LoadBgTiles(bgId, gHelpMessageWindow_Gfx, 0x280, destOffset);
LoadPalette(stdpal_get(2), palIdx, 32); LoadPalette(GetTextWindowPalette(2), palIdx, 32);
} }
void sub_814FD38(u8 bgId, u16 destOffset, u8 palIdx) // Unused
// Equivalent to LoadMenuMessageWindowGfx, but takes a bg id directly
static void LoadMenuMessageWindowGfxOnBg(u8 bgId, u16 destOffset, u8 palIdx)
{ {
LoadBgTiles(bgId, gUnknown_841F1C8, 0x280, destOffset); LoadBgTiles(bgId, gMenuMessageWindow_Gfx, 0x280, destOffset);
LoadPalette(stdpal_get(0), palIdx, 32); LoadPalette(GetTextWindowPalette(0), palIdx, 32);
} }
void sub_814FD6C(u8 bgId, u16 destOffset, u8 palIdx) // Unused
// Equivalent to LoadSignpostWindowGfx, but takes a bg id directly
static void LoadSignpostWindowGfxOnBg(u8 bgId, u16 destOffset, u8 palIdx)
{ {
LoadBgTiles(bgId, gUnknown_8470B0C, 0x260, destOffset); LoadBgTiles(bgId, gSignpostWindow_Gfx, 0x260, destOffset);
LoadPalette(stdpal_get(1), palIdx, 32); LoadPalette(GetTextWindowPalette(1), palIdx, 32);
} }
void DrawWindowBorderWithStdpal3(u8 bgId, u16 destOffset, u8 palIdx) // Equivalent to LoadStdWindowGfx, but takes a bg id directly
void LoadStdWindowGfxOnBg(u8 bgId, u16 destOffset, u8 palIdx)
{ {
LoadBgTiles(bgId, gStdFrame0, 0x120, destOffset); LoadBgTiles(bgId, gStdTextWindow_Gfx, 0x120, destOffset);
LoadPalette(stdpal_get(3), palIdx, 32); LoadPalette(GetTextWindowPalette(3), palIdx, 32);
} }
void sub_814FDD4(u8 bgId, u16 destOffset) // Unused
// Equivalent to LoadQuestLogWindowTiles, but takes a bg id directly
static void LoadQuestLogWindowTilesOnBg(u8 bgId, u16 destOffset)
{ {
LoadBgTiles(bgId, gStdFrame1, 0x280, destOffset); LoadBgTiles(bgId, gQuestLogWindow_Gfx, 0x280, destOffset);
} }
void sub_814FDF4(u8 bgId, u8 frameType, u16 destOffset, u8 palIdx) // Unused
// Equivalent to LoadUserWindowGfxByFrame, but takes a bg id directly
static void LoadUserWindowGfxByFrameOnBg(u8 bgId, u8 frameType, u16 destOffset, u8 palIdx)
{ {
LoadBgTiles(bgId, gUserFrames[frameType].tiles, 0x120, destOffset); LoadBgTiles(bgId, gUserFrames[frameType].tiles, 0x120, destOffset);
LoadPalette(gUserFrames[frameType].palette, palIdx, 32); LoadPalette(gUserFrames[frameType].palette, palIdx, 32);
} }
void LoadUserWindowBorderGfx(u8 windowId, u16 destOffset, u8 palIdx) // Identical to LoadUserWindowGfx
void LoadUserWindowGfx2(u8 windowId, u16 destOffset, u8 palIdx)
{ {
LoadWindowGfx(windowId, gSaveBlock2Ptr->optionsWindowFrameType, destOffset, palIdx); LoadUserWindowGfxByFrame(windowId, gSaveBlock2Ptr->optionsWindowFrameType, destOffset, palIdx);
} }
void sub_814FE6C(u8 windowId, u16 destOffset, u8 palIdx) void LoadHelpMessageWindowGfx(u8 windowId, u16 destOffset, u8 palIdx)
{ {
LoadBgTiles(GetWindowAttribute(windowId, WINDOW_BG), gUnknown_84566A8, 0x280, destOffset); LoadBgTiles(GetWindowAttribute(windowId, WINDOW_BG), gHelpMessageWindow_Gfx, 0x280, destOffset);
LoadPalette(stdpal_get(2), palIdx, 32); LoadPalette(GetTextWindowPalette(2), palIdx, 32);
} }
void TextWindow_LoadResourcesStdFrame0(u8 windowId, u16 destOffset, u8 palIdx) void LoadMenuMessageWindowGfx(u8 windowId, u16 destOffset, u8 palIdx)
{ {
LoadBgTiles(GetWindowAttribute(windowId, WINDOW_BG), gUnknown_841F1C8, 0x280, destOffset); LoadBgTiles(GetWindowAttribute(windowId, WINDOW_BG), gMenuMessageWindow_Gfx, 0x280, destOffset);
LoadPalette(stdpal_get(0), palIdx, 32); LoadPalette(GetTextWindowPalette(0), palIdx, 32);
} }
void sub_814FEEC(u8 windowId, u16 destOffset, u8 palIdx) void LoadSignpostWindowGfx(u8 windowId, u16 destOffset, u8 palIdx)
{ {
LoadBgTiles(GetWindowAttribute(windowId, WINDOW_BG), gUnknown_8470B0C, 0x260, destOffset); LoadBgTiles(GetWindowAttribute(windowId, WINDOW_BG), gSignpostWindow_Gfx, 0x260, destOffset);
LoadPalette(stdpal_get(1), palIdx, 32); LoadPalette(GetTextWindowPalette(1), palIdx, 32);
} }
void TextWindow_SetStdFrame0_WithPal(u8 windowId, u16 destOffset, u8 palIdx) void LoadStdWindowGfx(u8 windowId, u16 destOffset, u8 palIdx)
{ {
LoadBgTiles(GetWindowAttribute(windowId, WINDOW_BG), gStdFrame0, 0x120, destOffset); LoadBgTiles(GetWindowAttribute(windowId, WINDOW_BG), gStdTextWindow_Gfx, 0x120, destOffset);
LoadPalette(stdpal_get(3), palIdx, 32); LoadPalette(GetTextWindowPalette(3), palIdx, 32);
} }
void sub_814FF6C(u8 windowId, u16 destOffset) void LoadStdWindowTiles(u8 windowId, u16 destOffset)
{ {
LoadBgTiles(GetWindowAttribute(windowId, WINDOW_BG), gStdFrame0, 0x120, destOffset); LoadBgTiles(GetWindowAttribute(windowId, WINDOW_BG), gStdTextWindow_Gfx, 0x120, destOffset);
} }
void TextWindow_LoadTilesStdFrame1(u8 windowId, u16 destOffset) void LoadQuestLogWindowTiles(u8 windowId, u16 destOffset)
{ {
LoadBgTiles(GetWindowAttribute(windowId, WINDOW_BG), gStdFrame1, 0x280, destOffset); LoadBgTiles(GetWindowAttribute(windowId, WINDOW_BG), gQuestLogWindow_Gfx, 0x280, destOffset);
} }
void LoadWindowGfx(u8 windowId, u8 frameType, u16 destOffset, u8 palIdx) static void LoadUserWindowGfxByFrame(u8 windowId, u8 frameType, u16 destOffset, u8 palIdx)
{ {
LoadBgTiles(GetWindowAttribute(windowId, WINDOW_BG), gUserFrames[frameType].tiles, 0x120, destOffset); LoadBgTiles(GetWindowAttribute(windowId, WINDOW_BG), gUserFrames[frameType].tiles, 0x120, destOffset);
LoadPalette(gUserFrames[frameType].palette, palIdx, 32); LoadPalette(gUserFrames[frameType].palette, palIdx, 32);
} }
void TextWindow_SetUserSelectedFrame(u8 windowId, u16 destOffset, u8 palIdx) void LoadUserWindowGfx(u8 windowId, u16 destOffset, u8 palIdx)
{ {
LoadWindowGfx(windowId, gSaveBlock2Ptr->optionsWindowFrameType, destOffset, palIdx); LoadUserWindowGfxByFrame(windowId, gSaveBlock2Ptr->optionsWindowFrameType, destOffset, palIdx);
} }
void DrawTextBorderOuter(u8 windowId, u16 tileNum, u8 palNum) void DrawTextBorderOuter(u8 windowId, u16 tileNum, u8 palNum)
@@ -140,7 +151,7 @@ void rbox_fill_rectangle(u8 windowId)
FillBgTilemapBufferRect(bgLayer, 0, tilemapLeft - 1, tilemapTop - 1, width + 2, height + 2, 0x11); FillBgTilemapBufferRect(bgLayer, 0, tilemapLeft - 1, tilemapTop - 1, width + 2, height + 2, 0x11);
} }
const u16 *stdpal_get(u8 id) const u16 *GetTextWindowPalette(u8 id)
{ {
switch (id) switch (id)
{ {
@@ -162,5 +173,5 @@ const u16 *stdpal_get(u8 id)
break; break;
} }
return (const u16 *)(gUnknown_8471DEC) + id; return (const u16 *)(gTextWindowPalettes) + id;
} }
+45 -40
View File
@@ -1,36 +1,37 @@
#include "global.h" #include "global.h"
#include "text_window_graphics.h" #include "text_window_graphics.h"
const u16 gUnknown_8470B0C[] = INCBIN_U16("graphics/text_window/unk_8470B0C.4bpp"); const u16 gSignpostWindow_Gfx[] = INCBIN_U16("graphics/text_window/signpost.4bpp");
static const u16 gUnknown_8470D6C[] = INCBIN_U16("graphics/text_window/unk_8470D6C.4bpp"); static const u16 sUserFrame_Type1_Gfx[] = INCBIN_U16("graphics/text_window/type1.4bpp");
static const u16 gUnknown_8470E8C[] = INCBIN_U16("graphics/text_window/unk_8470E8C.4bpp"); static const u16 sUserFrame_Type2_Gfx[] = INCBIN_U16("graphics/text_window/type2.4bpp");
static const u16 gUnk_Empty_Space_8470FAC[16] = {0}; static const u16 sUserFrame_Empty1[16] = {0};
static const u16 gUnknown_8470FCC[] = INCBIN_U16("graphics/text_window/unk_8470FCC.4bpp"); static const u16 sUserFrame_Type3_Gfx[] = INCBIN_U16("graphics/text_window/type3.4bpp");
static const u16 gUnknown_84710EC[] = INCBIN_U16("graphics/text_window/unk_84710EC.4bpp"); static const u16 sUserFrame_Type4_Gfx[] = INCBIN_U16("graphics/text_window/type4.4bpp");
static const u16 gUnknown_847120C[] = INCBIN_U16("graphics/text_window/unk_847120C.4bpp"); static const u16 sUserFrame_Type5_Gfx[] = INCBIN_U16("graphics/text_window/type5.4bpp");
static const u16 gUnknown_847132C[] = INCBIN_U16("graphics/text_window/unk_847132C.4bpp"); static const u16 sUserFrame_Type6_Gfx[] = INCBIN_U16("graphics/text_window/type6.4bpp");
static const u16 gUnknown_847144C[] = INCBIN_U16("graphics/text_window/unk_847144C.4bpp"); static const u16 sUserFrame_Type7_Gfx[] = INCBIN_U16("graphics/text_window/type7.4bpp");
static const u16 gUnknown_847156C[] = INCBIN_U16("graphics/text_window/unk_847156C.4bpp"); static const u16 sUserFrame_Type8_Gfx[] = INCBIN_U16("graphics/text_window/type8.4bpp");
static const u16 gUnk_Empty_Space_847168C[16] = {0}; static const u16 sUserFrame_Empty2[16] = {0};
static const u16 gUnknown_84716AC[] = INCBIN_U16("graphics/text_window/unk_84716AC.4bpp"); static const u16 sUserFrame_Type9_Gfx[] = INCBIN_U16("graphics/text_window/type9.4bpp");
static const u16 gUnknown_84717CC[] = INCBIN_U16("graphics/text_window/unk_84717CC.4bpp"); static const u16 sUserFrame_Type10_Gfx[] = INCBIN_U16("graphics/text_window/type10.4bpp");
static const u16 gUnk_Empty_Space_84718EC[16] = {0}; static const u16 sUserFrame_Empty3[16] = {0};
static const u16 gUnknown_847190C[] = INCBIN_U16("graphics/text_window/unk_8470D6C.gbapal");
static const u16 gUnknown_847192C[] = INCBIN_U16("graphics/text_window/unk_8470E8C.gbapal");
static const u16 gUnknown_847194C[] = INCBIN_U16("graphics/text_window/unk_8470FCC.gbapal");
static const u16 gUnknown_847196C[] = INCBIN_U16("graphics/text_window/unk_84710EC.gbapal");
static const u16 gUnknown_847198C[] = INCBIN_U16("graphics/text_window/unk_847120C.gbapal");
static const u16 gUnknown_84719AC[] = INCBIN_U16("graphics/text_window/unk_847132C.gbapal");
static const u16 gUnknown_84719CC[] = INCBIN_U16("graphics/text_window/unk_847144C.gbapal");
static const u16 gUnknown_84719EC[] = INCBIN_U16("graphics/text_window/unk_847156C.gbapal");
static const u16 gUnknown_8471A0C[] = INCBIN_U16("graphics/text_window/unk_84716AC.gbapal");
static const u16 gUnknown_8471A2C[] = INCBIN_U16("graphics/text_window/unk_84717CC.gbapal");
const u16 gStdFrame0[] = INCBIN_U16("graphics/text_window/unk_8471A4C.4bpp"); static const u16 sUserFrame_Type1_Pal[] = INCBIN_U16("graphics/text_window/type1.gbapal");
const u16 gStdFrame1[] = INCBIN_U16("graphics/text_window/unk_8471B6C.4bpp"); static const u16 sUserFrame_Type2_Pal[] = INCBIN_U16("graphics/text_window/type2.gbapal");
static const u16 sUserFrame_Type3_Pal[] = INCBIN_U16("graphics/text_window/type3.gbapal");
static const u16 sUserFrame_Type4_Pal[] = INCBIN_U16("graphics/text_window/type4.gbapal");
static const u16 sUserFrame_Type5_Pal[] = INCBIN_U16("graphics/text_window/type5.gbapal");
static const u16 sUserFrame_Type6_Pal[] = INCBIN_U16("graphics/text_window/type6.gbapal");
static const u16 sUserFrame_Type7_Pal[] = INCBIN_U16("graphics/text_window/type7.gbapal");
static const u16 sUserFrame_Type8_Pal[] = INCBIN_U16("graphics/text_window/type8.gbapal");
static const u16 sUserFrame_Type9_Pal[] = INCBIN_U16("graphics/text_window/type9.gbapal");
static const u16 sUserFrame_Type10_Pal[] = INCBIN_U16("graphics/text_window/type10.gbapal");
const u16 gUnknown_8471DEC[][16] = { const u16 gStdTextWindow_Gfx[] = INCBIN_U16("graphics/text_window/std.4bpp");
const u16 gQuestLogWindow_Gfx[] = INCBIN_U16("graphics/text_window/quest_log.4bpp");
const u16 gTextWindowPalettes[][16] = {
INCBIN_U16("graphics/text_window/stdpal_0.gbapal"), INCBIN_U16("graphics/text_window/stdpal_0.gbapal"),
INCBIN_U16("graphics/text_window/stdpal_1.gbapal"), INCBIN_U16("graphics/text_window/stdpal_1.gbapal"),
INCBIN_U16("graphics/text_window/stdpal_2.gbapal"), INCBIN_U16("graphics/text_window/stdpal_2.gbapal"),
@@ -39,21 +40,25 @@ const u16 gUnknown_8471DEC[][16] = {
}; };
const struct TextWindowGraphics gUserFrames[] = { const struct TextWindowGraphics gUserFrames[] = {
{gUnknown_8470D6C, gUnknown_847190C}, {sUserFrame_Type1_Gfx, sUserFrame_Type1_Pal},
{gUnknown_8470E8C, gUnknown_847192C}, {sUserFrame_Type2_Gfx, sUserFrame_Type2_Pal},
{gUnknown_8470FCC, gUnknown_847194C}, {sUserFrame_Type3_Gfx, sUserFrame_Type3_Pal},
{gUnknown_84710EC, gUnknown_847196C}, {sUserFrame_Type4_Gfx, sUserFrame_Type4_Pal},
{gUnknown_847120C, gUnknown_847198C}, {sUserFrame_Type5_Gfx, sUserFrame_Type5_Pal},
{gUnknown_847132C, gUnknown_84719AC}, {sUserFrame_Type6_Gfx, sUserFrame_Type6_Pal},
{gUnknown_847144C, gUnknown_84719CC}, {sUserFrame_Type7_Gfx, sUserFrame_Type7_Pal},
{gUnknown_847156C, gUnknown_84719EC}, {sUserFrame_Type8_Gfx, sUserFrame_Type8_Pal},
{gUnknown_84716AC, gUnknown_8471A0C}, {sUserFrame_Type9_Gfx, sUserFrame_Type9_Pal},
{gUnknown_84717CC, gUnknown_8471A2C} {sUserFrame_Type10_Gfx, sUserFrame_Type10_Pal},
}; // NELEMS = 10 };
const struct TextWindowGraphics *GetWindowFrameTilesPal(u8 idx) const struct TextWindowGraphics *GetUserWindowGraphics(u8 idx)
{ {
if (idx >= 20) // if (idx >= NELEMS(gUserFrames)) #ifdef BUGFIX
if (idx >= ARRAY_COUNT(gUserFrames))
#else
if (idx >= 20) // Using the RSE number of elements
#endif
return &gUserFrames[0]; return &gUserFrames[0];
else else
return &gUserFrames[idx]; return &gUserFrames[idx];
+5 -5
View File
@@ -1290,11 +1290,11 @@ static void InitWindowTemplatesAndPals(void)
InitWindows(sWindowTemplates); InitWindows(sWindowTemplates);
DeactivateAllTextPrinters(); DeactivateAllTextPrinters();
TextWindow_SetUserSelectedFrame(0, 0x5B, 0xE0); LoadUserWindowGfx(0, 0x5B, 0xE0);
TextWindow_LoadResourcesStdFrame0(0, 0x64, 0xB0); LoadMenuMessageWindowGfx(0, 0x64, 0xB0);
TextWindow_SetStdFrame0_WithPal(0, 0x78, 0xD0); LoadStdWindowGfx(0, 0x78, 0xD0);
LoadPalette(gTMCaseMainWindowPalette, 0xF0, 0x20); LoadPalette(gStandardMenuPalette, 0xF0, 0x20);
LoadPalette(gTMCaseMainWindowPalette, 0xA0, 0x20); LoadPalette(gStandardMenuPalette, 0xA0, 0x20);
LoadPalette(sPal3Override, 0xF6, 0x04); LoadPalette(sPal3Override, 0xF6, 0x04);
LoadPalette(sPal3Override, 0xD6, 0x04); LoadPalette(sPal3Override, 0xD6, 0x04);
ListMenuLoadStdPalAt(0xc0, 0x01); ListMenuLoadStdPalAt(0xc0, 0x01);
+4 -4
View File
@@ -682,8 +682,8 @@ static void InitTradeMenuResources(void)
ResetPaletteFade(); ResetPaletteFade();
gPaletteFade.bufferTransferDisabled = TRUE; gPaletteFade.bufferTransferDisabled = TRUE;
SetVBlankCallback(VblankCB_Trade); SetVBlankCallback(VblankCB_Trade);
LoadPalette(gTMCaseMainWindowPalette, 0xF0, 0x14); LoadPalette(gStandardMenuPalette, 0xF0, 0x14);
LoadPalette(gTMCaseMainWindowPalette, 0xD0, 0x14); LoadPalette(gStandardMenuPalette, 0xD0, 0x14);
ResetBgsAndClearDma3BusyFlags(FALSE); ResetBgsAndClearDma3BusyFlags(FALSE);
InitBgsFromTemplates(0, sBgTemplates, NELEMS(sBgTemplates)); InitBgsFromTemplates(0, sBgTemplates, NELEMS(sBgTemplates));
SetBgTilemapBuffer(1, sTradeMenuResourcesPtr->tilemapBuffer); SetBgTilemapBuffer(1, sTradeMenuResourcesPtr->tilemapBuffer);
@@ -697,8 +697,8 @@ static void InitTradeMenuResources(void)
FillWindowPixelBuffer(i, PIXEL_FILL(0)); FillWindowPixelBuffer(i, PIXEL_FILL(0));
} }
FillBgTilemapBufferRect(0, 0, 0, 0, 30, 20, 0xF); FillBgTilemapBufferRect(0, 0, 0, 0, 30, 20, 0xF);
TextWindow_SetStdFrame0_WithPal(0, 0x014, 0xC0); LoadStdWindowGfx(0, 0x014, 0xC0);
TextWindow_SetUserSelectedFrame(2, 0x001, 0xE0); LoadUserWindowGfx(2, 0x001, 0xE0);
LoadMonIconPalettes(); LoadMonIconPalettes();
sTradeMenuResourcesPtr->state = 0; sTradeMenuResourcesPtr->state = 0;
sTradeMenuResourcesPtr->tradeMenuCBnum = 0; sTradeMenuResourcesPtr->tradeMenuCBnum = 0;
+1 -1
View File
@@ -121,7 +121,7 @@ void CB2_UnionRoomBattle(void)
FillWindowPixelBuffer(0, PIXEL_FILL(0)); FillWindowPixelBuffer(0, PIXEL_FILL(0));
FillWindowPixelBuffer(0, PIXEL_FILL(1)); FillWindowPixelBuffer(0, PIXEL_FILL(1));
FillBgTilemapBufferRect(0, 0, 0, 0, 30, 20, 0xF); FillBgTilemapBufferRect(0, 0, 0, 0, 30, 20, 0xF);
TextWindow_SetStdFrame0_WithPal(0, 1, 0xD0); LoadStdWindowGfx(0, 1, 0xD0);
Menu_LoadStdPal(); Menu_LoadStdPal();
SetVBlankCallback(VBlankCB_UnionRoomBattle); SetVBlankCallback(VBlankCB_UnionRoomBattle);
gMain.state++; gMain.state++;
+3 -3
View File
@@ -1307,9 +1307,9 @@ static void LoadWin1(void)
static void LoadWin3(void) static void LoadWin3(void)
{ {
FillWindowPixelBuffer(3, PIXEL_FILL(1)); FillWindowPixelBuffer(3, PIXEL_FILL(1));
TextWindow_SetUserSelectedFrame(3, 1, 0xD0); LoadUserWindowGfx(3, 1, 0xD0);
TextWindow_SetStdFrame0_WithPal(3, 0xA, 0x20); LoadStdWindowGfx(3, 0xA, 0x20);
LoadPalette(gTMCaseMainWindowPalette, 0xE0, 0x20); LoadPalette(gStandardMenuPalette, 0xE0, 0x20);
} }
static void InitScanlineEffect(void) static void InitScanlineEffect(void)