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