Merge pull request #1542 from GriffinRichards/doc-menu

Document menu
This commit is contained in:
GriffinR
2021-11-08 21:23:21 -05:00
committed by GitHub
114 changed files with 1624 additions and 1665 deletions
+1
View File
@@ -21,6 +21,7 @@ enum {
BG_TYPE_NONE = 0xFFFF BG_TYPE_NONE = 0xFFFF
}; };
// Modes for ChangeBgX / ChangeBgY
enum { enum {
BG_COORD_SET, BG_COORD_SET,
BG_COORD_ADD, BG_COORD_ADD,
+100 -97
View File
@@ -13,6 +13,8 @@
#include "dynamic_placeholder_text_util.h" #include "dynamic_placeholder_text_util.h"
#include "fonts.h" #include "fonts.h"
static u16 RenderText(struct TextPrinter *textPrinter);
static u32 RenderFont(struct TextPrinter *textPrinter);
static u16 FontFunc_Small(struct TextPrinter *); static u16 FontFunc_Small(struct TextPrinter *);
static u16 FontFunc_Normal(struct TextPrinter *); static u16 FontFunc_Normal(struct TextPrinter *);
static u16 FontFunc_Short(struct TextPrinter *); static u16 FontFunc_Short(struct TextPrinter *);
@@ -42,7 +44,7 @@ static u16 gLastTextFgColor;
static u16 gLastTextShadowColor; static u16 gLastTextShadowColor;
const struct FontInfo *gFonts; const struct FontInfo *gFonts;
u8 gDisableTextPrinters; bool8 gDisableTextPrinters;
struct TextGlyph gCurGlyph; struct TextGlyph gCurGlyph;
TextFlags gTextFlags; TextFlags gTextFlags;
@@ -234,7 +236,7 @@ void DeactivateAllTextPrinters(void)
{ {
int printer; int printer;
for (printer = 0; printer < NUM_TEXT_PRINTERS; ++printer) for (printer = 0; printer < NUM_TEXT_PRINTERS; ++printer)
gTextPrinters[printer].active = 0; gTextPrinters[printer].active = FALSE;
} }
u16 AddTextPrinterParameterized(u8 windowId, u8 fontId, const u8 *str, u8 x, u8 y, u8 speed, void (*callback)(struct TextPrinterTemplate *, u16)) u16 AddTextPrinterParameterized(u8 windowId, u8 fontId, const u8 *str, u8 x, u8 y, u8 speed, void (*callback)(struct TextPrinterTemplate *, u16))
@@ -265,16 +267,14 @@ bool16 AddTextPrinter(struct TextPrinterTemplate *printerTemplate, u8 speed, voi
if (!gFonts) if (!gFonts)
return FALSE; return FALSE;
gTempTextPrinter.active = 1; gTempTextPrinter.active = TRUE;
gTempTextPrinter.state = 0; gTempTextPrinter.state = RENDER_STATE_HANDLE_CHAR;
gTempTextPrinter.textSpeed = speed; gTempTextPrinter.textSpeed = speed;
gTempTextPrinter.delayCounter = 0; gTempTextPrinter.delayCounter = 0;
gTempTextPrinter.scrollDistance = 0; gTempTextPrinter.scrollDistance = 0;
for (i = 0; i < 7; i++) for (i = 0; i < (int)ARRAY_COUNT(gTempTextPrinter.subStructFields); i++)
{
gTempTextPrinter.subStructFields[i] = 0; gTempTextPrinter.subStructFields[i] = 0;
}
gTempTextPrinter.printerTemplate = *printerTemplate; gTempTextPrinter.printerTemplate = *printerTemplate;
gTempTextPrinter.callback = callback; gTempTextPrinter.callback = callback;
@@ -282,7 +282,7 @@ bool16 AddTextPrinter(struct TextPrinterTemplate *printerTemplate, u8 speed, voi
gTempTextPrinter.japanese = 0; gTempTextPrinter.japanese = 0;
GenerateFontHalfRowLookupTable(printerTemplate->fgColor, printerTemplate->bgColor, printerTemplate->shadowColor); GenerateFontHalfRowLookupTable(printerTemplate->fgColor, printerTemplate->bgColor, printerTemplate->shadowColor);
if (speed != TEXT_SPEED_FF && speed != 0) if (speed != TEXT_SKIP_DRAW && speed != 0)
{ {
--gTempTextPrinter.textSpeed; --gTempTextPrinter.textSpeed;
gTextPrinters[printerTemplate->windowId] = gTempTextPrinter; gTextPrinters[printerTemplate->windowId] = gTempTextPrinter;
@@ -290,17 +290,20 @@ bool16 AddTextPrinter(struct TextPrinterTemplate *printerTemplate, u8 speed, voi
else else
{ {
gTempTextPrinter.textSpeed = 0; gTempTextPrinter.textSpeed = 0;
// Render all text (up to limit) at once
for (j = 0; j < 0x400; ++j) for (j = 0; j < 0x400; ++j)
{ {
if (RenderFont(&gTempTextPrinter) == 1) if (RenderFont(&gTempTextPrinter) == RENDER_FINISH)
break; break;
} }
if (speed != TEXT_SPEED_FF) // All the text is rendered to the window but don't draw it yet.
CopyWindowToVram(gTempTextPrinter.printerTemplate.windowId, 2); if (speed != TEXT_SKIP_DRAW)
gTextPrinters[printerTemplate->windowId].active = 0; CopyWindowToVram(gTempTextPrinter.printerTemplate.windowId, COPYWIN_GFX);
gTextPrinters[printerTemplate->windowId].active = FALSE;
} }
gDisableTextPrinters = 0; gDisableTextPrinters = FALSE;
return TRUE; return TRUE;
} }
@@ -308,7 +311,7 @@ void RunTextPrinters(void)
{ {
int i; int i;
if (gDisableTextPrinters == 0) if (!gDisableTextPrinters)
{ {
for (i = 0; i < NUM_TEXT_PRINTERS; ++i) for (i = 0; i < NUM_TEXT_PRINTERS; ++i)
{ {
@@ -317,14 +320,14 @@ void RunTextPrinters(void)
u16 temp = RenderFont(&gTextPrinters[i]); u16 temp = RenderFont(&gTextPrinters[i]);
switch (temp) switch (temp)
{ {
case 0: case RENDER_PRINT:
CopyWindowToVram(gTextPrinters[i].printerTemplate.windowId, 2); CopyWindowToVram(gTextPrinters[i].printerTemplate.windowId, COPYWIN_GFX);
case 3: case RENDER_UPDATE:
if (gTextPrinters[i].callback != 0) if (gTextPrinters[i].callback != 0)
gTextPrinters[i].callback(&gTextPrinters[i].printerTemplate, temp); gTextPrinters[i].callback(&gTextPrinters[i].printerTemplate, temp);
break; break;
case 1: case RENDER_FINISH:
gTextPrinters[i].active = 0; gTextPrinters[i].active = FALSE;
break; break;
} }
} }
@@ -337,13 +340,13 @@ bool16 IsTextPrinterActive(u8 id)
return gTextPrinters[id].active; return gTextPrinters[id].active;
} }
u32 RenderFont(struct TextPrinter *textPrinter) static u32 RenderFont(struct TextPrinter *textPrinter)
{ {
u32 ret; u32 ret;
while (TRUE) while (TRUE)
{ {
ret = gFonts[textPrinter->printerTemplate.fontId].fontFunction(textPrinter); ret = gFonts[textPrinter->printerTemplate.fontId].fontFunction(textPrinter);
if (ret != 2) if (ret != RENDER_REPEAT)
return ret; return ret;
} }
} }
@@ -815,7 +818,7 @@ void TextPrinterDrawDownArrow(struct TextPrinter *textPrinter)
textPrinter->printerTemplate.currentY, textPrinter->printerTemplate.currentY,
8, 8,
16); 16);
CopyWindowToVram(textPrinter->printerTemplate.windowId, 2); CopyWindowToVram(textPrinter->printerTemplate.windowId, COPYWIN_GFX);
subStruct->downArrowDelay = 8; subStruct->downArrowDelay = 8;
subStruct->downArrowYPosIdx++; subStruct->downArrowYPosIdx++;
@@ -832,7 +835,7 @@ void TextPrinterClearDownArrow(struct TextPrinter *textPrinter)
textPrinter->printerTemplate.currentY, textPrinter->printerTemplate.currentY,
8, 8,
16); 16);
CopyWindowToVram(textPrinter->printerTemplate.windowId, 2); CopyWindowToVram(textPrinter->printerTemplate.windowId, COPYWIN_GFX);
} }
bool8 TextPrinterWaitAutoMode(struct TextPrinter *textPrinter) bool8 TextPrinterWaitAutoMode(struct TextPrinter *textPrinter)
@@ -922,14 +925,14 @@ void DrawDownArrow(u8 windowId, u16 x, u16 y, u8 bgColor, bool8 drawArrow, u8 *c
y - 2, y - 2,
0x8, 0x8,
0x10); 0x10);
CopyWindowToVram(windowId, 0x2); CopyWindowToVram(windowId, COPYWIN_GFX);
*counter = 8; *counter = 8;
++*yCoordIndex; ++*yCoordIndex;
} }
} }
} }
u16 RenderText(struct TextPrinter *textPrinter) static u16 RenderText(struct TextPrinter *textPrinter)
{ {
struct TextPrinterSubStruct *subStruct = (struct TextPrinterSubStruct *)(&textPrinter->subStructFields); struct TextPrinterSubStruct *subStruct = (struct TextPrinterSubStruct *)(&textPrinter->subStructFields);
u16 currChar; u16 currChar;
@@ -938,7 +941,7 @@ u16 RenderText(struct TextPrinter *textPrinter)
switch (textPrinter->state) switch (textPrinter->state)
{ {
case 0: case RENDER_STATE_HANDLE_CHAR:
if ((JOY_HELD(A_BUTTON | B_BUTTON)) && subStruct->hasPrintBeenSpedUp) if ((JOY_HELD(A_BUTTON | B_BUTTON)) && subStruct->hasPrintBeenSpedUp)
textPrinter->delayCounter = 0; textPrinter->delayCounter = 0;
@@ -950,7 +953,7 @@ u16 RenderText(struct TextPrinter *textPrinter)
subStruct->hasPrintBeenSpedUp = TRUE; subStruct->hasPrintBeenSpedUp = TRUE;
textPrinter->delayCounter = 0; textPrinter->delayCounter = 0;
} }
return 3; return RENDER_UPDATE;
} }
if (!(gBattleTypeFlags & BATTLE_TYPE_RECORDED) && gTextFlags.autoScroll) if (!(gBattleTypeFlags & BATTLE_TYPE_RECORDED) && gTextFlags.autoScroll)
@@ -966,10 +969,10 @@ u16 RenderText(struct TextPrinter *textPrinter)
case CHAR_NEWLINE: case CHAR_NEWLINE:
textPrinter->printerTemplate.currentX = textPrinter->printerTemplate.x; textPrinter->printerTemplate.currentX = textPrinter->printerTemplate.x;
textPrinter->printerTemplate.currentY += (gFonts[textPrinter->printerTemplate.fontId].maxLetterHeight + textPrinter->printerTemplate.lineSpacing); textPrinter->printerTemplate.currentY += (gFonts[textPrinter->printerTemplate.fontId].maxLetterHeight + textPrinter->printerTemplate.lineSpacing);
return 2; return RENDER_REPEAT;
case PLACEHOLDER_BEGIN: case PLACEHOLDER_BEGIN:
textPrinter->printerTemplate.currentChar++; textPrinter->printerTemplate.currentChar++;
return 2; return RENDER_REPEAT;
case EXT_CTRL_CODE_BEGIN: case EXT_CTRL_CODE_BEGIN:
currChar = *textPrinter->printerTemplate.currentChar; currChar = *textPrinter->printerTemplate.currentChar;
textPrinter->printerTemplate.currentChar++; textPrinter->printerTemplate.currentChar++;
@@ -979,17 +982,17 @@ u16 RenderText(struct TextPrinter *textPrinter)
textPrinter->printerTemplate.fgColor = *textPrinter->printerTemplate.currentChar; textPrinter->printerTemplate.fgColor = *textPrinter->printerTemplate.currentChar;
textPrinter->printerTemplate.currentChar++; textPrinter->printerTemplate.currentChar++;
GenerateFontHalfRowLookupTable(textPrinter->printerTemplate.fgColor, textPrinter->printerTemplate.bgColor, textPrinter->printerTemplate.shadowColor); GenerateFontHalfRowLookupTable(textPrinter->printerTemplate.fgColor, textPrinter->printerTemplate.bgColor, textPrinter->printerTemplate.shadowColor);
return 2; return RENDER_REPEAT;
case EXT_CTRL_CODE_HIGHLIGHT: case EXT_CTRL_CODE_HIGHLIGHT:
textPrinter->printerTemplate.bgColor = *textPrinter->printerTemplate.currentChar; textPrinter->printerTemplate.bgColor = *textPrinter->printerTemplate.currentChar;
textPrinter->printerTemplate.currentChar++; textPrinter->printerTemplate.currentChar++;
GenerateFontHalfRowLookupTable(textPrinter->printerTemplate.fgColor, textPrinter->printerTemplate.bgColor, textPrinter->printerTemplate.shadowColor); GenerateFontHalfRowLookupTable(textPrinter->printerTemplate.fgColor, textPrinter->printerTemplate.bgColor, textPrinter->printerTemplate.shadowColor);
return 2; return RENDER_REPEAT;
case EXT_CTRL_CODE_SHADOW: case EXT_CTRL_CODE_SHADOW:
textPrinter->printerTemplate.shadowColor = *textPrinter->printerTemplate.currentChar; textPrinter->printerTemplate.shadowColor = *textPrinter->printerTemplate.currentChar;
textPrinter->printerTemplate.currentChar++; textPrinter->printerTemplate.currentChar++;
GenerateFontHalfRowLookupTable(textPrinter->printerTemplate.fgColor, textPrinter->printerTemplate.bgColor, textPrinter->printerTemplate.shadowColor); GenerateFontHalfRowLookupTable(textPrinter->printerTemplate.fgColor, textPrinter->printerTemplate.bgColor, textPrinter->printerTemplate.shadowColor);
return 2; return RENDER_REPEAT;
case EXT_CTRL_CODE_COLOR_HIGHLIGHT_SHADOW: case EXT_CTRL_CODE_COLOR_HIGHLIGHT_SHADOW:
textPrinter->printerTemplate.fgColor = *textPrinter->printerTemplate.currentChar; textPrinter->printerTemplate.fgColor = *textPrinter->printerTemplate.currentChar;
textPrinter->printerTemplate.currentChar++; textPrinter->printerTemplate.currentChar++;
@@ -998,36 +1001,36 @@ u16 RenderText(struct TextPrinter *textPrinter)
textPrinter->printerTemplate.shadowColor = *textPrinter->printerTemplate.currentChar; textPrinter->printerTemplate.shadowColor = *textPrinter->printerTemplate.currentChar;
textPrinter->printerTemplate.currentChar++; textPrinter->printerTemplate.currentChar++;
GenerateFontHalfRowLookupTable(textPrinter->printerTemplate.fgColor, textPrinter->printerTemplate.bgColor, textPrinter->printerTemplate.shadowColor); GenerateFontHalfRowLookupTable(textPrinter->printerTemplate.fgColor, textPrinter->printerTemplate.bgColor, textPrinter->printerTemplate.shadowColor);
return 2; return RENDER_REPEAT;
case EXT_CTRL_CODE_PALETTE: case EXT_CTRL_CODE_PALETTE:
textPrinter->printerTemplate.currentChar++; textPrinter->printerTemplate.currentChar++;
return 2; return RENDER_REPEAT;
case EXT_CTRL_CODE_FONT: case EXT_CTRL_CODE_FONT:
subStruct->fontId = *textPrinter->printerTemplate.currentChar; subStruct->fontId = *textPrinter->printerTemplate.currentChar;
textPrinter->printerTemplate.currentChar++; textPrinter->printerTemplate.currentChar++;
return 2; return RENDER_REPEAT;
case EXT_CTRL_CODE_RESET_SIZE: case EXT_CTRL_CODE_RESET_SIZE:
return 2; return RENDER_REPEAT;
case EXT_CTRL_CODE_PAUSE: case EXT_CTRL_CODE_PAUSE:
textPrinter->delayCounter = *textPrinter->printerTemplate.currentChar; textPrinter->delayCounter = *textPrinter->printerTemplate.currentChar;
textPrinter->printerTemplate.currentChar++; textPrinter->printerTemplate.currentChar++;
textPrinter->state = 6; textPrinter->state = RENDER_STATE_PAUSE;
return 2; return RENDER_REPEAT;
case EXT_CTRL_CODE_PAUSE_UNTIL_PRESS: case EXT_CTRL_CODE_PAUSE_UNTIL_PRESS:
textPrinter->state = 1; textPrinter->state = RENDER_STATE_WAIT;
if (gTextFlags.autoScroll) if (gTextFlags.autoScroll)
subStruct->autoScrollDelay = 0; subStruct->autoScrollDelay = 0;
return 3; return RENDER_UPDATE;
case EXT_CTRL_CODE_WAIT_SE: case EXT_CTRL_CODE_WAIT_SE:
textPrinter->state = 5; textPrinter->state = RENDER_STATE_WAIT_SE;
return 3; return RENDER_UPDATE;
case EXT_CTRL_CODE_PLAY_BGM: case EXT_CTRL_CODE_PLAY_BGM:
currChar = *textPrinter->printerTemplate.currentChar; currChar = *textPrinter->printerTemplate.currentChar;
textPrinter->printerTemplate.currentChar++; textPrinter->printerTemplate.currentChar++;
currChar |= *textPrinter->printerTemplate.currentChar << 8; currChar |= *textPrinter->printerTemplate.currentChar << 8;
textPrinter->printerTemplate.currentChar++; textPrinter->printerTemplate.currentChar++;
PlayBGM(currChar); PlayBGM(currChar);
return 2; return RENDER_REPEAT;
case EXT_CTRL_CODE_ESCAPE: case EXT_CTRL_CODE_ESCAPE:
currChar = *textPrinter->printerTemplate.currentChar | 0x100; currChar = *textPrinter->printerTemplate.currentChar | 0x100;
textPrinter->printerTemplate.currentChar++; textPrinter->printerTemplate.currentChar++;
@@ -1038,26 +1041,26 @@ u16 RenderText(struct TextPrinter *textPrinter)
currChar |= (*textPrinter->printerTemplate.currentChar << 8); currChar |= (*textPrinter->printerTemplate.currentChar << 8);
textPrinter->printerTemplate.currentChar++; textPrinter->printerTemplate.currentChar++;
PlaySE(currChar); PlaySE(currChar);
return 2; return RENDER_REPEAT;
case EXT_CTRL_CODE_SHIFT_TEXT: case EXT_CTRL_CODE_SHIFT_TEXT:
textPrinter->printerTemplate.currentX = textPrinter->printerTemplate.x + *textPrinter->printerTemplate.currentChar; textPrinter->printerTemplate.currentX = textPrinter->printerTemplate.x + *textPrinter->printerTemplate.currentChar;
textPrinter->printerTemplate.currentChar++; textPrinter->printerTemplate.currentChar++;
return 2; return RENDER_REPEAT;
case EXT_CTRL_CODE_SHIFT_DOWN: case EXT_CTRL_CODE_SHIFT_DOWN:
textPrinter->printerTemplate.currentY = textPrinter->printerTemplate.y + *textPrinter->printerTemplate.currentChar; textPrinter->printerTemplate.currentY = textPrinter->printerTemplate.y + *textPrinter->printerTemplate.currentChar;
textPrinter->printerTemplate.currentChar++; textPrinter->printerTemplate.currentChar++;
return 2; return RENDER_REPEAT;
case EXT_CTRL_CODE_FILL_WINDOW: case EXT_CTRL_CODE_FILL_WINDOW:
FillWindowPixelBuffer(textPrinter->printerTemplate.windowId, PIXEL_FILL(textPrinter->printerTemplate.bgColor)); FillWindowPixelBuffer(textPrinter->printerTemplate.windowId, PIXEL_FILL(textPrinter->printerTemplate.bgColor));
textPrinter->printerTemplate.currentX = textPrinter->printerTemplate.x; textPrinter->printerTemplate.currentX = textPrinter->printerTemplate.x;
textPrinter->printerTemplate.currentY = textPrinter->printerTemplate.y; textPrinter->printerTemplate.currentY = textPrinter->printerTemplate.y;
return 2; return RENDER_REPEAT;
case EXT_CTRL_CODE_PAUSE_MUSIC: case EXT_CTRL_CODE_PAUSE_MUSIC:
m4aMPlayStop(&gMPlayInfo_BGM); m4aMPlayStop(&gMPlayInfo_BGM);
return 2; return RENDER_REPEAT;
case EXT_CTRL_CODE_RESUME_MUSIC: case EXT_CTRL_CODE_RESUME_MUSIC:
m4aMPlayContinue(&gMPlayInfo_BGM); m4aMPlayContinue(&gMPlayInfo_BGM);
return 2; return RENDER_REPEAT;
case EXT_CTRL_CODE_CLEAR: case EXT_CTRL_CODE_CLEAR:
width = *textPrinter->printerTemplate.currentChar; width = *textPrinter->printerTemplate.currentChar;
textPrinter->printerTemplate.currentChar++; textPrinter->printerTemplate.currentChar++;
@@ -1065,13 +1068,13 @@ u16 RenderText(struct TextPrinter *textPrinter)
{ {
ClearTextSpan(textPrinter, width); ClearTextSpan(textPrinter, width);
textPrinter->printerTemplate.currentX += width; textPrinter->printerTemplate.currentX += width;
return 0; return RENDER_PRINT;
} }
return 2; return RENDER_REPEAT;
case EXT_CTRL_CODE_SKIP: case EXT_CTRL_CODE_SKIP:
textPrinter->printerTemplate.currentX = *textPrinter->printerTemplate.currentChar + textPrinter->printerTemplate.x; textPrinter->printerTemplate.currentX = *textPrinter->printerTemplate.currentChar + textPrinter->printerTemplate.x;
textPrinter->printerTemplate.currentChar++; textPrinter->printerTemplate.currentChar++;
return 2; return RENDER_REPEAT;
case EXT_CTRL_CODE_CLEAR_TO: case EXT_CTRL_CODE_CLEAR_TO:
{ {
widthHelper = *textPrinter->printerTemplate.currentChar; widthHelper = *textPrinter->printerTemplate.currentChar;
@@ -1082,29 +1085,29 @@ u16 RenderText(struct TextPrinter *textPrinter)
{ {
ClearTextSpan(textPrinter, width); ClearTextSpan(textPrinter, width);
textPrinter->printerTemplate.currentX += width; textPrinter->printerTemplate.currentX += width;
return 0; return RENDER_PRINT;
} }
} }
return 2; return RENDER_REPEAT;
case EXT_CTRL_CODE_MIN_LETTER_SPACING: case EXT_CTRL_CODE_MIN_LETTER_SPACING:
textPrinter->minLetterSpacing = *textPrinter->printerTemplate.currentChar++; textPrinter->minLetterSpacing = *textPrinter->printerTemplate.currentChar++;
return 2; return RENDER_REPEAT;
case EXT_CTRL_CODE_JPN: case EXT_CTRL_CODE_JPN:
textPrinter->japanese = 1; textPrinter->japanese = TRUE;
return 2; return RENDER_REPEAT;
case EXT_CTRL_CODE_ENG: case EXT_CTRL_CODE_ENG:
textPrinter->japanese = 0; textPrinter->japanese = FALSE;
return 2; return RENDER_REPEAT;
} }
break; break;
case CHAR_PROMPT_CLEAR: case CHAR_PROMPT_CLEAR:
textPrinter->state = 2; textPrinter->state = RENDER_STATE_CLEAR;
TextPrinterInitDownArrowCounters(textPrinter); TextPrinterInitDownArrowCounters(textPrinter);
return 3; return RENDER_UPDATE;
case CHAR_PROMPT_SCROLL: case CHAR_PROMPT_SCROLL:
textPrinter->state = 3; textPrinter->state = RENDER_STATE_SCROLL_START;
TextPrinterInitDownArrowCounters(textPrinter); TextPrinterInitDownArrowCounters(textPrinter);
return 3; return RENDER_UPDATE;
case CHAR_EXTRA_SYMBOL: case CHAR_EXTRA_SYMBOL:
currChar = *textPrinter->printerTemplate.currentChar | 0x100; currChar = *textPrinter->printerTemplate.currentChar | 0x100;
textPrinter->printerTemplate.currentChar++; textPrinter->printerTemplate.currentChar++;
@@ -1113,9 +1116,9 @@ u16 RenderText(struct TextPrinter *textPrinter)
currChar = *textPrinter->printerTemplate.currentChar++; currChar = *textPrinter->printerTemplate.currentChar++;
gCurGlyph.width = DrawKeypadIcon(textPrinter->printerTemplate.windowId, currChar, textPrinter->printerTemplate.currentX, textPrinter->printerTemplate.currentY); gCurGlyph.width = DrawKeypadIcon(textPrinter->printerTemplate.windowId, currChar, textPrinter->printerTemplate.currentX, textPrinter->printerTemplate.currentY);
textPrinter->printerTemplate.currentX += gCurGlyph.width + textPrinter->printerTemplate.letterSpacing; textPrinter->printerTemplate.currentX += gCurGlyph.width + textPrinter->printerTemplate.letterSpacing;
return 0; return RENDER_PRINT;
case EOS: case EOS:
return 1; return RENDER_FINISH;
} }
switch (subStruct->fontId) switch (subStruct->fontId)
@@ -1161,30 +1164,30 @@ u16 RenderText(struct TextPrinter *textPrinter)
else else
textPrinter->printerTemplate.currentX += gCurGlyph.width; textPrinter->printerTemplate.currentX += gCurGlyph.width;
} }
return 0; return RENDER_PRINT;
case 1: case RENDER_STATE_WAIT:
if (TextPrinterWait(textPrinter)) if (TextPrinterWait(textPrinter))
textPrinter->state = 0; textPrinter->state = RENDER_STATE_HANDLE_CHAR;
return 3; return RENDER_UPDATE;
case 2: case RENDER_STATE_CLEAR:
if (TextPrinterWaitWithDownArrow(textPrinter)) if (TextPrinterWaitWithDownArrow(textPrinter))
{ {
FillWindowPixelBuffer(textPrinter->printerTemplate.windowId, PIXEL_FILL(textPrinter->printerTemplate.bgColor)); FillWindowPixelBuffer(textPrinter->printerTemplate.windowId, PIXEL_FILL(textPrinter->printerTemplate.bgColor));
textPrinter->printerTemplate.currentX = textPrinter->printerTemplate.x; textPrinter->printerTemplate.currentX = textPrinter->printerTemplate.x;
textPrinter->printerTemplate.currentY = textPrinter->printerTemplate.y; textPrinter->printerTemplate.currentY = textPrinter->printerTemplate.y;
textPrinter->state = 0; textPrinter->state = RENDER_STATE_HANDLE_CHAR;
} }
return 3; return RENDER_UPDATE;
case 3: case RENDER_STATE_SCROLL_START:
if (TextPrinterWaitWithDownArrow(textPrinter)) if (TextPrinterWaitWithDownArrow(textPrinter))
{ {
TextPrinterClearDownArrow(textPrinter); TextPrinterClearDownArrow(textPrinter);
textPrinter->scrollDistance = gFonts[textPrinter->printerTemplate.fontId].maxLetterHeight + textPrinter->printerTemplate.lineSpacing; textPrinter->scrollDistance = gFonts[textPrinter->printerTemplate.fontId].maxLetterHeight + textPrinter->printerTemplate.lineSpacing;
textPrinter->printerTemplate.currentX = textPrinter->printerTemplate.x; textPrinter->printerTemplate.currentX = textPrinter->printerTemplate.x;
textPrinter->state = 4; textPrinter->state = RENDER_STATE_SCROLL;
} }
return 3; return RENDER_UPDATE;
case 4: case RENDER_STATE_SCROLL:
if (textPrinter->scrollDistance) if (textPrinter->scrollDistance)
{ {
int scrollSpeed = GetPlayerTextSpeed(); int scrollSpeed = GetPlayerTextSpeed();
@@ -1199,26 +1202,26 @@ u16 RenderText(struct TextPrinter *textPrinter)
ScrollWindow(textPrinter->printerTemplate.windowId, 0, speed, PIXEL_FILL(textPrinter->printerTemplate.bgColor)); ScrollWindow(textPrinter->printerTemplate.windowId, 0, speed, PIXEL_FILL(textPrinter->printerTemplate.bgColor));
textPrinter->scrollDistance -= speed; textPrinter->scrollDistance -= speed;
} }
CopyWindowToVram(textPrinter->printerTemplate.windowId, 2); CopyWindowToVram(textPrinter->printerTemplate.windowId, COPYWIN_GFX);
} }
else else
{ {
textPrinter->state = 0; textPrinter->state = RENDER_STATE_HANDLE_CHAR;
} }
return 3; return RENDER_UPDATE;
case 5: case RENDER_STATE_WAIT_SE:
if (!IsSEPlaying()) if (!IsSEPlaying())
textPrinter->state = 0; textPrinter->state = RENDER_STATE_HANDLE_CHAR;
return 3; return RENDER_UPDATE;
case 6: case RENDER_STATE_PAUSE:
if (textPrinter->delayCounter != 0) if (textPrinter->delayCounter != 0)
textPrinter->delayCounter--; textPrinter->delayCounter--;
else else
textPrinter->state = 0; textPrinter->state = RENDER_STATE_HANDLE_CHAR;
return 3; return RENDER_UPDATE;
} }
return 1; return RENDER_FINISH;
} }
// Unused // Unused
@@ -1363,17 +1366,17 @@ s32 GetStringWidth(u8 fontId, const u8 *str, s16 letterSpacing)
case PLACEHOLDER_BEGIN: case PLACEHOLDER_BEGIN:
switch (*++str) switch (*++str)
{ {
case PLACEHOLDER_ID_STRING_VAR_1: case PLACEHOLDER_ID_STRING_VAR_1:
bufferPointer = gStringVar1; bufferPointer = gStringVar1;
break; break;
case PLACEHOLDER_ID_STRING_VAR_2: case PLACEHOLDER_ID_STRING_VAR_2:
bufferPointer = gStringVar2; bufferPointer = gStringVar2;
break; break;
case PLACEHOLDER_ID_STRING_VAR_3: case PLACEHOLDER_ID_STRING_VAR_3:
bufferPointer = gStringVar3; bufferPointer = gStringVar3;
break; break;
default: default:
return 0; return 0;
} }
case CHAR_DYNAMIC: case CHAR_DYNAMIC:
if (bufferPointer == NULL) if (bufferPointer == NULL)
+22 -3
View File
@@ -5,7 +5,9 @@
#define NUM_TEXT_PRINTERS 32 #define NUM_TEXT_PRINTERS 32
#define TEXT_SPEED_FF 0xFF // Given as a text speed when all the text should be
// loaded at once but not copied to vram yet.
#define TEXT_SKIP_DRAW 0xFF
enum { enum {
FONT_SMALL, FONT_SMALL,
@@ -20,6 +22,25 @@ enum {
FONT_BOLD, // JP glyph set only FONT_BOLD, // JP glyph set only
}; };
// Return values for font functions
enum {
RENDER_PRINT,
RENDER_FINISH,
RENDER_REPEAT, // Run render function again, if e.g. a control code is encountered.
RENDER_UPDATE,
};
// Text printer states read by RenderText / FontFunc_Braille
enum {
RENDER_STATE_HANDLE_CHAR,
RENDER_STATE_WAIT,
RENDER_STATE_CLEAR,
RENDER_STATE_SCROLL_START,
RENDER_STATE_SCROLL,
RENDER_STATE_WAIT_SE,
RENDER_STATE_PAUSE,
};
enum { enum {
FONTATTR_MAX_LETTER_WIDTH, FONTATTR_MAX_LETTER_WIDTH,
FONTATTR_MAX_LETTER_HEIGHT, FONTATTR_MAX_LETTER_HEIGHT,
@@ -128,7 +149,6 @@ u16 AddTextPrinterParameterized(u8 windowId, u8 fontId, const u8 *str, u8 x, u8
bool16 AddTextPrinter(struct TextPrinterTemplate *template, u8 speed, void (*callback)(struct TextPrinterTemplate *, u16)); bool16 AddTextPrinter(struct TextPrinterTemplate *template, u8 speed, void (*callback)(struct TextPrinterTemplate *, u16));
void RunTextPrinters(void); void RunTextPrinters(void);
bool16 IsTextPrinterActive(u8 id); bool16 IsTextPrinterActive(u8 id);
u32 RenderFont(struct TextPrinter *textPrinter);
void GenerateFontHalfRowLookupTable(u8 fgColor, u8 bgColor, u8 shadowColor); void GenerateFontHalfRowLookupTable(u8 fgColor, u8 bgColor, u8 shadowColor);
void SaveTextColors(u8 *fgColor, u8 *bgColor, u8 *shadowColor); void SaveTextColors(u8 *fgColor, u8 *bgColor, u8 *shadowColor);
void RestoreTextColors(u8 *fgColor, u8 *bgColor, u8 *shadowColor); void RestoreTextColors(u8 *fgColor, u8 *bgColor, u8 *shadowColor);
@@ -145,7 +165,6 @@ bool8 TextPrinterWaitAutoMode(struct TextPrinter *textPrinter);
bool16 TextPrinterWaitWithDownArrow(struct TextPrinter *textPrinter); bool16 TextPrinterWaitWithDownArrow(struct TextPrinter *textPrinter);
bool16 TextPrinterWait(struct TextPrinter *textPrinter); bool16 TextPrinterWait(struct TextPrinter *textPrinter);
void DrawDownArrow(u8 windowId, u16 x, u16 y, u8 bgColor, bool8 drawArrow, u8 *counter, u8 *yCoordIndex); void DrawDownArrow(u8 windowId, u16 x, u16 y, u8 bgColor, bool8 drawArrow, u8 *counter, u8 *yCoordIndex);
u16 RenderText(struct TextPrinter *textPrinter);
s32 GetStringWidth(u8 fontId, const u8 *str, s16 letterSpacing); s32 GetStringWidth(u8 fontId, const u8 *str, s16 letterSpacing);
u8 RenderTextHandleBold(u8 *pixels, u8 fontId, u8 *str); u8 RenderTextHandleBold(u8 *pixels, u8 fontId, u8 *str);
u8 DrawKeypadIcon(u8 windowId, u8 keypadIconId, u16 x, u16 y); u8 DrawKeypadIcon(u8 windowId, u8 keypadIconId, u16 x, u16 y);
+9 -9
View File
@@ -275,13 +275,13 @@ void CopyWindowToVram(u8 windowId, u8 mode)
switch (mode) switch (mode)
{ {
case 1: case COPYWIN_MAP:
CopyBgTilemapBufferToVram(windowLocal.window.bg); CopyBgTilemapBufferToVram(windowLocal.window.bg);
break; break;
case 2: case COPYWIN_GFX:
LoadBgTiles(windowLocal.window.bg, windowLocal.tileData, windowSize, windowLocal.window.baseBlock); LoadBgTiles(windowLocal.window.bg, windowLocal.tileData, windowSize, windowLocal.window.baseBlock);
break; break;
case 3: case COPYWIN_FULL:
LoadBgTiles(windowLocal.window.bg, windowLocal.tileData, windowSize, windowLocal.window.baseBlock); LoadBgTiles(windowLocal.window.bg, windowLocal.tileData, windowSize, windowLocal.window.baseBlock);
CopyBgTilemapBufferToVram(windowLocal.window.bg); CopyBgTilemapBufferToVram(windowLocal.window.bg);
break; break;
@@ -307,13 +307,13 @@ void CopyWindowRectToVram(u32 windowId, u32 mode, u32 x, u32 y, u32 w, u32 h)
switch (mode) switch (mode)
{ {
case 1: case COPYWIN_MAP:
CopyBgTilemapBufferToVram(windowLocal.window.bg); CopyBgTilemapBufferToVram(windowLocal.window.bg);
break; break;
case 2: case COPYWIN_GFX:
LoadBgTiles(windowLocal.window.bg, windowLocal.tileData + (rectPos * 32), rectSize, windowLocal.window.baseBlock + rectPos); LoadBgTiles(windowLocal.window.bg, windowLocal.tileData + (rectPos * 32), rectSize, windowLocal.window.baseBlock + rectPos);
break; break;
case 3: case COPYWIN_FULL:
LoadBgTiles(windowLocal.window.bg, windowLocal.tileData + (rectPos * 32), rectSize, windowLocal.window.baseBlock + rectPos); LoadBgTiles(windowLocal.window.bg, windowLocal.tileData + (rectPos * 32), rectSize, windowLocal.window.baseBlock + rectPos);
CopyBgTilemapBufferToVram(windowLocal.window.bg); CopyBgTilemapBufferToVram(windowLocal.window.bg);
break; break;
@@ -693,13 +693,13 @@ void CopyWindowToVram8Bit(u8 windowId, u8 mode)
switch (mode) switch (mode)
{ {
case 1: case COPYWIN_MAP:
CopyBgTilemapBufferToVram(sWindowPtr->window.bg); CopyBgTilemapBufferToVram(sWindowPtr->window.bg);
break; break;
case 2: case COPYWIN_GFX:
LoadBgTiles(sWindowPtr->window.bg, sWindowPtr->tileData, sWindowSize, sWindowPtr->window.baseBlock); LoadBgTiles(sWindowPtr->window.bg, sWindowPtr->tileData, sWindowSize, sWindowPtr->window.baseBlock);
break; break;
case 3: case COPYWIN_FULL:
LoadBgTiles(sWindowPtr->window.bg, sWindowPtr->tileData, sWindowSize, sWindowPtr->window.baseBlock); LoadBgTiles(sWindowPtr->window.bg, sWindowPtr->tileData, sWindowSize, sWindowPtr->window.baseBlock);
CopyBgTilemapBufferToVram(sWindowPtr->window.bg); CopyBgTilemapBufferToVram(sWindowPtr->window.bg);
break; break;
+10 -9
View File
@@ -3,8 +3,7 @@
#define PIXEL_FILL(num) ((num) | ((num) << 4)) #define PIXEL_FILL(num) ((num) | ((num) << 4))
enum enum {
{
WINDOW_BG, WINDOW_BG,
WINDOW_TILEMAP_LEFT, WINDOW_TILEMAP_LEFT,
WINDOW_TILEMAP_TOP, WINDOW_TILEMAP_TOP,
@@ -15,6 +14,14 @@ enum
WINDOW_TILE_DATA WINDOW_TILE_DATA
}; };
// Mode for CopyWindowToVram, CopyWindowRectToVram and CopyWindowToVram8Bit
enum {
COPYWIN_NONE,
COPYWIN_MAP,
COPYWIN_GFX,
COPYWIN_FULL,
};
struct WindowTemplate struct WindowTemplate
{ {
u8 bg; u8 bg;
@@ -28,13 +35,7 @@ struct WindowTemplate
#define DUMMY_WIN_TEMPLATE \ #define DUMMY_WIN_TEMPLATE \
{ \ { \
0xFF, \ .bg = 0xFF, \
0, \
0, \
0, \
0, \
0, \
0, \
} }
#define WINDOW_NONE 0xFF #define WINDOW_NONE 0xFF
-19
View File
@@ -1,19 +0,0 @@
JASC-PAL
0100
16
0 0 0
255 255 255
255 180 82
197 123 0
255 139 131
255 49 24
74 74 74
213 213 205
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
-1
View File
@@ -1 +0,0 @@


Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

-19
View File
@@ -1,19 +0,0 @@
JASC-PAL
0100
16
0 0 0
255 255 255
0 0 0
65 65 65
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
+4 -4
View File
@@ -3855,10 +3855,10 @@ extern const u32 gItemIcon_ReturnToFieldArrow[];
extern const u32 gItemIconPalette_ReturnToFieldArrow[]; extern const u32 gItemIconPalette_ReturnToFieldArrow[];
//menu graphics //menu graphics
extern const u16 gFireRedMenuElements1_Pal[16]; extern const u16 gMenuInfoElements1_Pal[16];
extern const u16 gFireRedMenuElements2_Pal[16]; extern const u16 gMenuInfoElements2_Pal[16];
extern const u16 gFireRedMenuElements3_Pal[16]; extern const u16 gMenuInfoElements3_Pal[16];
extern const u8 gFireRedMenuElements_Gfx[]; extern const u8 gMenuInfoElements_Gfx[];
// item menu graphics // item menu graphics
extern const u32 gBagScreen_Gfx[]; extern const u32 gBagScreen_Gfx[];
+17 -18
View File
@@ -59,14 +59,14 @@ u32 GetPlayerTextSpeed(void);
u8 GetPlayerTextSpeedDelay(void); u8 GetPlayerTextSpeedDelay(void);
void Menu_LoadStdPalAt(u16 arg0); void Menu_LoadStdPalAt(u16 arg0);
void AddTextPrinterWithCallbackForMessage(bool8 a1, void (*callback)(struct TextPrinterTemplate *, u16)); void AddTextPrinterWithCallbackForMessage(bool8 a1, void (*callback)(struct TextPrinterTemplate *, u16));
void sub_8199DF0(u32 bg, u8 a1, int a2, int a3); void BgDmaFill(u32 bg, u8 a1, int a2, int a3);
void AddTextPrinterParameterized3(u8 windowId, u8 fontId, u8 left, u8 top, const u8 *color, s8 speed, const u8 *str); void AddTextPrinterParameterized3(u8 windowId, u8 fontId, u8 left, u8 top, const u8 *color, s8 speed, const u8 *str);
void ClearStdWindowAndFrameToTransparent(u8 windowId, bool8 copyToVram); void ClearStdWindowAndFrameToTransparent(u8 windowId, bool8 copyToVram);
void SetWindowTemplateFields(struct WindowTemplate* template, u8 priority, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 palNum, u16 baseBlock); void SetWindowTemplateFields(struct WindowTemplate* template, u8 priority, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 palNum, u16 baseBlock);
void DrawStdFrameWithCustomTileAndPalette(u8 windowId, bool8 copyToVram, u16 tileStart, u8 palette); void DrawStdFrameWithCustomTileAndPalette(u8 windowId, bool8 copyToVram, u16 tileStart, u8 palette);
void ScheduleBgCopyTilemapToVram(u8 bgNum); void ScheduleBgCopyTilemapToVram(u8 bgNum);
void PrintMenuTable(u8 windowId, u8 itemCount, const struct MenuAction *strs); void PrintMenuTable(u8 windowId, u8 itemCount, const struct MenuAction *strs);
u8 InitMenuInUpperLeftCornerPlaySoundWhenAPressed(u8 windowId, u8 numItems, u8 initialCursorPos); u8 InitMenuInUpperLeftCornerNormal(u8 windowId, u8 numItems, u8 initialCursorPos);
u8 Menu_GetCursorPos(void); u8 Menu_GetCursorPos(void);
s8 Menu_ProcessInput(void); s8 Menu_ProcessInput(void);
s8 Menu_ProcessInputNoWrap(void); s8 Menu_ProcessInputNoWrap(void);
@@ -83,24 +83,23 @@ void DoScheduledBgTilemapCopiesToVram(void);
void ClearScheduledBgCopiesToVram(void); void ClearScheduledBgCopiesToVram(void);
void AddTextPrinterParameterized4(u8 windowId, u8 fontId, u8 x, u8 y, u8 letterSpacing, u8 lineSpacing, const u8 *color, s8 speed, const u8 *str); void AddTextPrinterParameterized4(u8 windowId, u8 fontId, u8 x, u8 y, u8 letterSpacing, u8 lineSpacing, const u8 *color, s8 speed, const u8 *str);
void DrawDialogFrameWithCustomTileAndPalette(u8 windowId, bool8 copyToVram, u16 a2, u8 a3); void DrawDialogFrameWithCustomTileAndPalette(u8 windowId, bool8 copyToVram, u16 a2, u8 a3);
void sub_81995E4(u8 windowId, u8 optionsNo, const struct MenuAction *actions, const u8 *actionIds); void PrintMenuActionTextsInUpperLeftCorner(u8 windowId, u8 optionsNo, const struct MenuAction *actions, const u8 *actionIds);
void ClearDialogWindowAndFrameToTransparent(u8 windowId, bool8 copyToVram); void ClearDialogWindowAndFrameToTransparent(u8 windowId, bool8 copyToVram);
u16 sub_8198AA4(u8, u8, u8, u8, u8, u8, u16);
void *malloc_and_decompress(const void *src, u32 *sizeOut); void *malloc_and_decompress(const void *src, u32 *sizeOut);
u16 copy_decompressed_tile_data_to_vram(u8 bgId, const void *src, u16 size, u16 offset, u8 mode); u16 copy_decompressed_tile_data_to_vram(u8 bgId, const void *src, u16 size, u16 offset, u8 mode);
void AddTextPrinterForMessage(bool8 allowSkippingDelayWithButtonPress); void AddTextPrinterForMessage(bool8 allowSkippingDelayWithButtonPress);
void AddItemMenuActionTextPrinters(u8 windowId, u8 fontId, u8 left, u8 top, u8 letterSpacing, u8 lineHeight, u8 itemCount, const struct MenuAction *strs, const u8 *a8); void PrintMenuActionTexts(u8 windowId, u8 fontId, u8 left, u8 top, u8 letterSpacing, u8 lineHeight, u8 itemCount, const struct MenuAction *strs, const u8 *a8);
void PrintMenuActionGrid(u8 windowId, u8 fontId, u8 left, u8 top, u8 a4, u8 itemCount, u8 itemCount2, const struct MenuAction *strs, const u8 *a8); void PrintMenuActionGrid(u8 windowId, u8 fontId, u8 left, u8 top, u8 a4, u8 itemCount, u8 itemCount2, const struct MenuAction *strs, const u8 *a8);
u8 InitMenuActionGrid(u8 windowId, u8 optionWidth, u8 columns, u8 rows, u8 initialCursorPos); u8 InitMenuActionGrid(u8 windowId, u8 optionWidth, u8 columns, u8 rows, u8 initialCursorPos);
u8 ChangeListMenuCursorPosition(s8 deltaX, s8 deltaY); u8 ChangeMenuGridCursorPosition(s8 deltaX, s8 deltaY);
u8 GetStartMenuWindowId(void); u8 GetStartMenuWindowId(void);
void ListMenuLoadStdPalAt(u8, u8); void ListMenuLoadStdPalAt(u8, u8);
u8 Menu_MoveCursor(s8 cursorDelta); u8 Menu_MoveCursor(s8 cursorDelta);
u8 Menu_MoveCursorNoWrapAround(s8 cursorDelta); u8 Menu_MoveCursorNoWrapAround(s8 cursorDelta);
void DrawStdWindowFrame(u8 windowId, bool8 CopyToVram); void DrawStdWindowFrame(u8 windowId, bool8 CopyToVram);
u8 sub_81979C4(u8 a1); u8 AddStartMenuWindow(u8 numActions);
u8 sub_81983AC(u8 windowId, u8 fontId, u8 left, u8 top, u8 cursorHeight, u8 numChoices, u8 initialCursorPos); u8 InitMenuNormal(u8 windowId, u8 fontId, u8 left, u8 top, u8 cursorHeight, u8 numChoices, u8 initialCursorPos);
void sub_819786C(u8 windowId, bool8 copyToVram); void LoadMessageBoxAndFrameGfx(u8 windowId, bool8 copyToVram);
void AddTextPrinterForMessage_2(bool8 allowSkippingDelayWithButtonPress); void AddTextPrinterForMessage_2(bool8 allowSkippingDelayWithButtonPress);
void RemoveStartMenuWindow(void); void RemoveStartMenuWindow(void);
void DisplayYesNoMenuWithDefault(u8 initialCursorPos); void DisplayYesNoMenuWithDefault(u8 initialCursorPos);
@@ -110,21 +109,21 @@ u8 GetMapNamePopUpWindowId(void);
u8 AddMapNamePopUpWindow(void); u8 AddMapNamePopUpWindow(void);
void AddTextPrinterParameterized5(u8 windowId, u8 fontId, const u8 *str, u8 left, u8 top, u8 speed, void (*callback)(struct TextPrinterTemplate *, u16), u8 letterSpacing, u8 lineSpacing); void AddTextPrinterParameterized5(u8 windowId, u8 fontId, const u8 *str, u8 left, u8 top, u8 speed, void (*callback)(struct TextPrinterTemplate *, u16), u8 letterSpacing, u8 lineSpacing);
void SetBgTilemapPalette(u8 bgId, u8 left, u8 top, u8 width, u8 height, u8 palette); void SetBgTilemapPalette(u8 bgId, u8 left, u8 top, u8 width, u8 height, u8 palette);
void sub_8199D3C(void *ptr, int delta, int width, int height, bool32 is8BPP); void AddValToTilemapBuffer(void *ptr, int delta, int width, int height, bool32 is8BPP);
void sub_8198204(const u8 *string, const u8 *string2, u8 a3, u8 a4, bool8 copyToVram); void EraseFieldMessageBox(bool8 copyToVram);
void sub_8197AE8(bool8 copyToVram);
void PrintMenuGridTable(u8 windowId, u8 optionWidth, u8 columns, u8 rows, const struct MenuAction *strs); void PrintMenuGridTable(u8 windowId, u8 optionWidth, u8 columns, u8 rows, const struct MenuAction *strs);
s8 Menu_ProcessInputGridLayout(void); s8 Menu_ProcessGridInput(void);
u8 InitMenuInUpperLeftCorner(u8 windowId, u8 itemCount, u8 initialCursorPos, bool8 APressMuted); u8 InitMenuInUpperLeftCorner(u8 windowId, u8 itemCount, u8 initialCursorPos, bool8 APressMuted);
s8 Menu_ProcessInputNoWrapAround_other(void); s8 Menu_ProcessInputNoWrapAround_other(void);
void CopyToBufferFromBgTilemap(u8 bgId, u16 *dest, u8 left, u8 top, u8 width, u8 height); void CopyToBufferFromBgTilemap(u8 bgId, u16 *dest, u8 left, u8 top, u8 width, u8 height);
u8 sub_81980F0(u8 bg, u8 xPos, u8 yPos, u8 palette, u16 baseTile); u8 HofPCTopBar_AddWindow(u8 bg, u8 xPos, u8 yPos, u8 palette, u16 baseTile);
void sub_8198314(void); void HofPCTopBar_RemoveWindow(void);
void sub_8198180(const u8 *string, u8 a2, bool8 copyToVram); void HofPCTopBar_Print(const u8 *string, u8 left, bool8 copyToVram);
void HofPCTopBar_PrintPair(const u8 *string, const u8 *string2, bool8 noBg, u8 left, bool8 copyToVram);
void ResetBgPositions(void); void ResetBgPositions(void);
void AddTextPrinterWithCustomSpeedForMessage(bool8 allowSkippingDelayWithButtonPress, u8 speed); void AddTextPrinterWithCustomSpeedForMessage(bool8 allowSkippingDelayWithButtonPress, u8 speed);
void sub_8198C78(void); void EraseYesNoWindow(void);
void PrintTextArray(u8 windowId, u8 fontId, u8 left, u8 top, u8 lineHeight, u8 itemCount, const struct MenuAction *strs); void PrintMenuActionTextsAtPos(u8 windowId, u8 fontId, u8 left, u8 top, u8 lineHeight, u8 itemCount, const struct MenuAction *strs);
void Menu_LoadStdPal(void); void Menu_LoadStdPal(void);
#endif // GUARD_MENU_H #endif // GUARD_MENU_H
+3 -3
View File
@@ -643,9 +643,9 @@ static void CreateApprenticeMenu(u8 menu)
SetStandardWindowBorderStyle(windowId, 0); SetStandardWindowBorderStyle(windowId, 0);
for (i = 0; i < count; i++) for (i = 0; i < count; i++)
AddTextPrinterParameterized(windowId, FONT_NORMAL, strings[i], 8, (i * 16) + 1, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(windowId, FONT_NORMAL, strings[i], 8, (i * 16) + 1, TEXT_SKIP_DRAW, NULL);
InitMenuInUpperLeftCornerPlaySoundWhenAPressed(windowId, count, 0); InitMenuInUpperLeftCornerNormal(windowId, count, 0);
CreateChooseAnswerTask(TRUE, count, windowId); CreateChooseAnswerTask(TRUE, count, windowId);
} }
@@ -691,7 +691,7 @@ static u8 CreateAndShowWindow(u8 left, u8 top, u8 width, u8 height)
windowId = AddWindow(&winTemplate); windowId = AddWindow(&winTemplate);
PutWindowTilemap(windowId); PutWindowTilemap(windowId);
CopyWindowToVram(windowId, 3); CopyWindowToVram(windowId, COPYWIN_FULL);
return windowId; return windowId;
} }
+19 -19
View File
@@ -3428,7 +3428,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
for (i = windowId; i < windowId + 9; i++) for (i = windowId; i < windowId + 9; i++)
{ {
CopyWindowToVram(i, 2); CopyWindowToVram(i, COPYWIN_GFX);
FillWindowPixelBuffer(i, PIXEL_FILL(0)); FillWindowPixelBuffer(i, PIXEL_FILL(0));
} }
gTasks[taskId].tState = STATE_REACT_INPUT; gTasks[taskId].tState = STATE_REACT_INPUT;
@@ -4358,7 +4358,7 @@ static void DisplayTrainerInfoOnCard(u8 flags, u8 trainerTourneyId)
textPrinter.currentChar = gStringVar1; textPrinter.currentChar = gStringVar1;
textPrinter.windowId = windowId; textPrinter.windowId = windowId;
PutWindowTilemap(windowId); PutWindowTilemap(windowId);
CopyWindowToVram(windowId, 3); CopyWindowToVram(windowId, COPYWIN_FULL);
AddTextPrinter(&textPrinter, 0, NULL); AddTextPrinter(&textPrinter, 0, NULL);
textPrinter.letterSpacing = 0; textPrinter.letterSpacing = 0;
@@ -4380,12 +4380,12 @@ static void DisplayTrainerInfoOnCard(u8 flags, u8 trainerTourneyId)
textPrinter.currentX = 0; textPrinter.currentX = 0;
PutWindowTilemap(1 + i + windowId); PutWindowTilemap(1 + i + windowId);
CopyWindowToVram(1 + i + windowId, 3); CopyWindowToVram(1 + i + windowId, COPYWIN_FULL);
AddTextPrinter(&textPrinter, 0, NULL); AddTextPrinter(&textPrinter, 0, NULL);
} }
PutWindowTilemap(windowId + 4); PutWindowTilemap(windowId + 4);
CopyWindowToVram(windowId + 4, 3); CopyWindowToVram(windowId + 4, COPYWIN_FULL);
// Print text about trainers potential in the tourney // Print text about trainers potential in the tourney
if (trainerId == TRAINER_FRONTIER_BRAIN) if (trainerId == TRAINER_FRONTIER_BRAIN)
@@ -4861,7 +4861,7 @@ static void DisplayMatchInfoOnCard(u8 flags, u8 matchNo)
textPrinter.windowId = windowId + 8; textPrinter.windowId = windowId + 8;
textPrinter.fontId = FONT_NORMAL; textPrinter.fontId = FONT_NORMAL;
PutWindowTilemap(windowId + 8); PutWindowTilemap(windowId + 8);
CopyWindowToVram(windowId + 8, 3); CopyWindowToVram(windowId + 8, COPYWIN_FULL);
textPrinter.currentX = 0; textPrinter.currentX = 0;
textPrinter.currentY = textPrinter.y = 0; textPrinter.currentY = textPrinter.y = 0;
AddTextPrinter(&textPrinter, 0, NULL); AddTextPrinter(&textPrinter, 0, NULL);
@@ -4881,7 +4881,7 @@ static void DisplayMatchInfoOnCard(u8 flags, u8 matchNo)
textPrinter.currentX = GetStringCenterAlignXOffsetWithLetterSpacing(textPrinter.fontId, textPrinter.currentChar, 0x40, textPrinter.letterSpacing); textPrinter.currentX = GetStringCenterAlignXOffsetWithLetterSpacing(textPrinter.fontId, textPrinter.currentChar, 0x40, textPrinter.letterSpacing);
textPrinter.currentY = textPrinter.y = 2; textPrinter.currentY = textPrinter.y = 2;
PutWindowTilemap(windowId + 6); PutWindowTilemap(windowId + 6);
CopyWindowToVram(windowId + 6, 3); CopyWindowToVram(windowId + 6, COPYWIN_FULL);
AddTextPrinter(&textPrinter, 0, NULL); AddTextPrinter(&textPrinter, 0, NULL);
// Print right trainer's name. // Print right trainer's name.
@@ -4897,7 +4897,7 @@ static void DisplayMatchInfoOnCard(u8 flags, u8 matchNo)
textPrinter.currentX = GetStringCenterAlignXOffsetWithLetterSpacing(textPrinter.fontId, textPrinter.currentChar, 0x40, textPrinter.letterSpacing); textPrinter.currentX = GetStringCenterAlignXOffsetWithLetterSpacing(textPrinter.fontId, textPrinter.currentChar, 0x40, textPrinter.letterSpacing);
textPrinter.currentY = textPrinter.y = 2; textPrinter.currentY = textPrinter.y = 2;
PutWindowTilemap(windowId + 7); PutWindowTilemap(windowId + 7);
CopyWindowToVram(windowId + 7, 3); CopyWindowToVram(windowId + 7, COPYWIN_FULL);
AddTextPrinter(&textPrinter, 0, NULL); AddTextPrinter(&textPrinter, 0, NULL);
// Print match number. // Print match number.
@@ -4907,7 +4907,7 @@ static void DisplayMatchInfoOnCard(u8 flags, u8 matchNo)
textPrinter.currentX = GetStringCenterAlignXOffsetWithLetterSpacing(textPrinter.fontId, textPrinter.currentChar, 0xA0, textPrinter.letterSpacing); textPrinter.currentX = GetStringCenterAlignXOffsetWithLetterSpacing(textPrinter.fontId, textPrinter.currentChar, 0xA0, textPrinter.letterSpacing);
textPrinter.currentY = textPrinter.y = 2; textPrinter.currentY = textPrinter.y = 2;
PutWindowTilemap(windowId + 5); PutWindowTilemap(windowId + 5);
CopyWindowToVram(windowId + 5, 3); CopyWindowToVram(windowId + 5, COPYWIN_FULL);
AddTextPrinter(&textPrinter, 0, NULL); AddTextPrinter(&textPrinter, 0, NULL);
} }
@@ -5281,10 +5281,10 @@ static void Task_ShowTourneyTree(u8 taskId)
gBattle_BG0_Y = 0; gBattle_BG0_Y = 0;
gBattle_BG1_X = 0; gBattle_BG1_X = 0;
gBattle_BG1_Y = 0; gBattle_BG1_Y = 0;
ChangeBgX(2, 0, 0); ChangeBgX(2, 0, BG_COORD_SET);
ChangeBgY(2, 0, 0); ChangeBgY(2, 0, BG_COORD_SET);
ChangeBgX(3, 0, 0); ChangeBgX(3, 0, BG_COORD_SET);
ChangeBgY(3, 0xB00, 0); ChangeBgY(3, 0xB00, BG_COORD_SET);
gTasks[taskId].tState++; gTasks[taskId].tState++;
break; break;
case 1: case 1:
@@ -5442,9 +5442,9 @@ static void Task_ShowTourneyTree(u8 taskId)
PutWindowTilemap(0); PutWindowTilemap(0);
PutWindowTilemap(1); PutWindowTilemap(1);
PutWindowTilemap(2); PutWindowTilemap(2);
CopyWindowToVram(0, 3); CopyWindowToVram(0, COPYWIN_FULL);
CopyWindowToVram(1, 3); CopyWindowToVram(1, COPYWIN_FULL);
CopyWindowToVram(2, 3); CopyWindowToVram(2, COPYWIN_FULL);
SetHBlankCallback(HblankCb_TourneyTree); SetHBlankCallback(HblankCb_TourneyTree);
SetVBlankCallback(VblankCb_TourneyTree); SetVBlankCallback(VblankCb_TourneyTree);
if (r4 == 2) if (r4 == 2)
@@ -5597,8 +5597,8 @@ static void CB2_TourneyTree(void)
static void VblankCb_TourneyInfoCard(void) static void VblankCb_TourneyInfoCard(void)
{ {
ChangeBgX(3, 0x80, 1); ChangeBgX(3, 0x80, BG_COORD_ADD);
ChangeBgY(3, 0x80, 2); ChangeBgY(3, 0x80, BG_COORD_SUB);
SetGpuReg(REG_OFFSET_BG0HOFS, gBattle_BG0_X); SetGpuReg(REG_OFFSET_BG0HOFS, gBattle_BG0_X);
SetGpuReg(REG_OFFSET_BG0VOFS, gBattle_BG0_Y); SetGpuReg(REG_OFFSET_BG0VOFS, gBattle_BG0_Y);
SetGpuReg(REG_OFFSET_BG1HOFS, gBattle_BG1_X); SetGpuReg(REG_OFFSET_BG1HOFS, gBattle_BG1_X);
@@ -5693,8 +5693,8 @@ static void VblankCb_TourneyTree(void)
SetGpuReg(REG_OFFSET_BG0VOFS, gBattle_BG0_Y); SetGpuReg(REG_OFFSET_BG0VOFS, gBattle_BG0_Y);
SetGpuReg(REG_OFFSET_BG1HOFS, gBattle_BG1_X); SetGpuReg(REG_OFFSET_BG1HOFS, gBattle_BG1_X);
SetGpuReg(REG_OFFSET_BG1VOFS, gBattle_BG1_Y); SetGpuReg(REG_OFFSET_BG1VOFS, gBattle_BG1_Y);
ChangeBgY(2, 0x80, 2); ChangeBgY(2, 0x80, BG_COORD_SUB);
ChangeBgY(3, 0x80, 1); ChangeBgY(3, 0x80, BG_COORD_ADD);
LoadOam(); LoadOam();
ProcessSpriteCopyRequests(); ProcessSpriteCopyRequests();
TransferPlttBuffer(); TransferPlttBuffer();
+44 -44
View File
@@ -1147,12 +1147,12 @@ static void CB2_InitSelectScreen(void)
sSelectMonPicBgTilesetBuffer = AllocZeroed(0x440); sSelectMonPicBgTilesetBuffer = AllocZeroed(0x440);
sSelectMenuTilemapBuffer = Alloc(BG_SCREEN_SIZE); sSelectMenuTilemapBuffer = Alloc(BG_SCREEN_SIZE);
sSelectMonPicBgTilemapBuffer = AllocZeroed(BG_SCREEN_SIZE); sSelectMonPicBgTilemapBuffer = AllocZeroed(BG_SCREEN_SIZE);
ChangeBgX(0, 0, 0); ChangeBgX(0, 0, BG_COORD_SET);
ChangeBgY(0, 0, 0); ChangeBgY(0, 0, BG_COORD_SET);
ChangeBgX(1, 0, 0); ChangeBgX(1, 0, BG_COORD_SET);
ChangeBgY(1, 0, 0); ChangeBgY(1, 0, BG_COORD_SET);
ChangeBgX(3, 0, 0); ChangeBgX(3, 0, BG_COORD_SET);
ChangeBgY(3, 0, 0); ChangeBgY(3, 0, BG_COORD_SET);
SetGpuReg(REG_OFFSET_BLDCNT, 0); SetGpuReg(REG_OFFSET_BLDCNT, 0);
SetGpuReg(REG_OFFSET_BLDALPHA, 0); SetGpuReg(REG_OFFSET_BLDALPHA, 0);
SetGpuReg(REG_OFFSET_BLDY, 0); SetGpuReg(REG_OFFSET_BLDY, 0);
@@ -1854,7 +1854,7 @@ static void Select_ErasePopupMenu(u8 windowId)
gSprites[sFactorySelectScreen->menuCursor1SpriteId].invisible = TRUE; gSprites[sFactorySelectScreen->menuCursor1SpriteId].invisible = TRUE;
gSprites[sFactorySelectScreen->menuCursor2SpriteId].invisible = TRUE; gSprites[sFactorySelectScreen->menuCursor2SpriteId].invisible = TRUE;
FillWindowPixelBuffer(windowId, PIXEL_FILL(0)); FillWindowPixelBuffer(windowId, PIXEL_FILL(0));
CopyWindowToVram(windowId, 2); CopyWindowToVram(windowId, COPYWIN_GFX);
ClearWindowTilemap(windowId); ClearWindowTilemap(windowId);
} }
@@ -1862,7 +1862,7 @@ static void Select_PrintRentalPkmnString(void)
{ {
FillWindowPixelBuffer(SELECT_WIN_TITLE, PIXEL_FILL(0)); FillWindowPixelBuffer(SELECT_WIN_TITLE, PIXEL_FILL(0));
AddTextPrinterParameterized(SELECT_WIN_TITLE, FONT_NORMAL, gText_RentalPkmn2, 2, 1, 0, NULL); AddTextPrinterParameterized(SELECT_WIN_TITLE, FONT_NORMAL, gText_RentalPkmn2, 2, 1, 0, NULL);
CopyWindowToVram(SELECT_WIN_TITLE, 3); CopyWindowToVram(SELECT_WIN_TITLE, COPYWIN_FULL);
} }
static void Select_PrintMonSpecies(void) static void Select_PrintMonSpecies(void)
@@ -1876,7 +1876,7 @@ static void Select_PrintMonSpecies(void)
StringCopy(gStringVar4, gSpeciesNames[species]); StringCopy(gStringVar4, gSpeciesNames[species]);
x = GetStringRightAlignXOffset(FONT_NORMAL, gStringVar4, 86); x = GetStringRightAlignXOffset(FONT_NORMAL, gStringVar4, 86);
AddTextPrinterParameterized3(SELECT_WIN_SPECIES, FONT_NORMAL, x, 1, sSpeciesNameTextColors, 0, gStringVar4); AddTextPrinterParameterized3(SELECT_WIN_SPECIES, FONT_NORMAL, x, 1, sSpeciesNameTextColors, 0, gStringVar4);
CopyWindowToVram(SELECT_WIN_SPECIES, 2); CopyWindowToVram(SELECT_WIN_SPECIES, COPYWIN_GFX);
} }
static void Select_PrintSelectMonString(void) static void Select_PrintSelectMonString(void)
@@ -1894,14 +1894,14 @@ static void Select_PrintSelectMonString(void)
str = gText_TheseThreePkmnOkay; str = gText_TheseThreePkmnOkay;
AddTextPrinterParameterized(SELECT_WIN_INFO, FONT_NORMAL, str, 2, 5, 0, NULL); AddTextPrinterParameterized(SELECT_WIN_INFO, FONT_NORMAL, str, 2, 5, 0, NULL);
CopyWindowToVram(SELECT_WIN_INFO, 2); CopyWindowToVram(SELECT_WIN_INFO, COPYWIN_GFX);
} }
static void Select_PrintCantSelectSameMon(void) static void Select_PrintCantSelectSameMon(void)
{ {
FillWindowPixelBuffer(SELECT_WIN_INFO, PIXEL_FILL(0)); FillWindowPixelBuffer(SELECT_WIN_INFO, PIXEL_FILL(0));
AddTextPrinterParameterized(SELECT_WIN_INFO, FONT_NORMAL, gText_CantSelectSamePkmn, 2, 5, 0, NULL); AddTextPrinterParameterized(SELECT_WIN_INFO, FONT_NORMAL, gText_CantSelectSamePkmn, 2, 5, 0, NULL);
CopyWindowToVram(SELECT_WIN_INFO, 2); CopyWindowToVram(SELECT_WIN_INFO, COPYWIN_GFX);
} }
static void Select_PrintMenuOptions(void) static void Select_PrintMenuOptions(void)
@@ -1917,7 +1917,7 @@ static void Select_PrintMenuOptions(void)
AddTextPrinterParameterized3(SELECT_WIN_OPTIONS, FONT_NORMAL, 7, 17, sMenuOptionTextColors, 0, gText_Rent); AddTextPrinterParameterized3(SELECT_WIN_OPTIONS, FONT_NORMAL, 7, 17, sMenuOptionTextColors, 0, gText_Rent);
AddTextPrinterParameterized3(SELECT_WIN_OPTIONS, FONT_NORMAL, 7, 33, sMenuOptionTextColors, 0, gText_Others2); AddTextPrinterParameterized3(SELECT_WIN_OPTIONS, FONT_NORMAL, 7, 33, sMenuOptionTextColors, 0, gText_Others2);
CopyWindowToVram(SELECT_WIN_OPTIONS, 3); CopyWindowToVram(SELECT_WIN_OPTIONS, COPYWIN_FULL);
} }
static void Select_PrintYesNoOptions(void) static void Select_PrintYesNoOptions(void)
@@ -1926,7 +1926,7 @@ static void Select_PrintYesNoOptions(void)
FillWindowPixelBuffer(SELECT_WIN_YES_NO, PIXEL_FILL(0)); FillWindowPixelBuffer(SELECT_WIN_YES_NO, PIXEL_FILL(0));
AddTextPrinterParameterized3(SELECT_WIN_YES_NO, FONT_NORMAL, 7, 1, sMenuOptionTextColors, 0, gText_Yes2); AddTextPrinterParameterized3(SELECT_WIN_YES_NO, FONT_NORMAL, 7, 1, sMenuOptionTextColors, 0, gText_Yes2);
AddTextPrinterParameterized3(SELECT_WIN_YES_NO, FONT_NORMAL, 7, 17, sMenuOptionTextColors, 0, gText_No2); AddTextPrinterParameterized3(SELECT_WIN_YES_NO, FONT_NORMAL, 7, 17, sMenuOptionTextColors, 0, gText_No2);
CopyWindowToVram(SELECT_WIN_YES_NO, 3); CopyWindowToVram(SELECT_WIN_YES_NO, COPYWIN_FULL);
} }
static u8 Select_RunMenuOptionFunc(void) static u8 Select_RunMenuOptionFunc(void)
@@ -1996,7 +1996,7 @@ static void Select_PrintMonCategory(void)
CopyMonCategoryText(SpeciesToNationalPokedexNum(species), text); CopyMonCategoryText(SpeciesToNationalPokedexNum(species), text);
x = GetStringRightAlignXOffset(FONT_NORMAL, text, 0x76); x = GetStringRightAlignXOffset(FONT_NORMAL, text, 0x76);
AddTextPrinterParameterized(SELECT_WIN_MON_CATEGORY, FONT_NORMAL, text, x, 1, 0, NULL); AddTextPrinterParameterized(SELECT_WIN_MON_CATEGORY, FONT_NORMAL, text, x, 1, 0, NULL);
CopyWindowToVram(SELECT_WIN_MON_CATEGORY, 2); CopyWindowToVram(SELECT_WIN_MON_CATEGORY, COPYWIN_GFX);
} }
} }
@@ -3012,7 +3012,7 @@ static void Swap_Task_ScreenInfoTransitionOut(u8 taskId)
if (!gPaletteFade.active) if (!gPaletteFade.active)
{ {
FillWindowPixelBuffer(SWAP_WIN_ACTION_FADE, PIXEL_FILL(0)); FillWindowPixelBuffer(SWAP_WIN_ACTION_FADE, PIXEL_FILL(0));
CopyWindowToVram(SWAP_WIN_ACTION_FADE, 2); CopyWindowToVram(SWAP_WIN_ACTION_FADE, COPYWIN_GFX);
if (sFactorySwapScreen->inEnemyScreen == TRUE) if (sFactorySwapScreen->inEnemyScreen == TRUE)
{ {
// Start "Pkmn for Swap" button slide offscreen // Start "Pkmn for Swap" button slide offscreen
@@ -3150,7 +3150,7 @@ static void Swap_Task_ScreenInfoTransitionIn(u8 taskId)
break; break;
case 6: case 6:
FillWindowPixelBuffer(SWAP_WIN_ACTION_FADE, PIXEL_FILL(0)); FillWindowPixelBuffer(SWAP_WIN_ACTION_FADE, PIXEL_FILL(0));
CopyWindowToVram(SWAP_WIN_ACTION_FADE, 2); CopyWindowToVram(SWAP_WIN_ACTION_FADE, COPYWIN_GFX);
gTasks[taskId].tState++; gTasks[taskId].tState++;
break; break;
case 7: case 7:
@@ -3280,14 +3280,14 @@ static void CB2_InitSwapScreen(void)
sSwapMonPicBgTilesetBuffer = AllocZeroed(0x440); sSwapMonPicBgTilesetBuffer = AllocZeroed(0x440);
sSwapMenuTilemapBuffer = Alloc(BG_SCREEN_SIZE); sSwapMenuTilemapBuffer = Alloc(BG_SCREEN_SIZE);
sSwapMonPicBgTilemapBuffer = AllocZeroed(BG_SCREEN_SIZE); sSwapMonPicBgTilemapBuffer = AllocZeroed(BG_SCREEN_SIZE);
ChangeBgX(0, 0, 0); ChangeBgX(0, 0, BG_COORD_SET);
ChangeBgY(0, 0, 0); ChangeBgY(0, 0, BG_COORD_SET);
ChangeBgX(1, 0, 0); ChangeBgX(1, 0, BG_COORD_SET);
ChangeBgY(1, 0, 0); ChangeBgY(1, 0, BG_COORD_SET);
ChangeBgX(2, 0, 0); ChangeBgX(2, 0, BG_COORD_SET);
ChangeBgY(2, 0, 0); ChangeBgY(2, 0, BG_COORD_SET);
ChangeBgX(3, 0, 0); ChangeBgX(3, 0, BG_COORD_SET);
ChangeBgY(3, 0, 0); ChangeBgY(3, 0, BG_COORD_SET);
SetGpuReg(REG_OFFSET_BLDY, 0); SetGpuReg(REG_OFFSET_BLDY, 0);
SetGpuReg(REG_OFFSET_MOSAIC, 0); SetGpuReg(REG_OFFSET_MOSAIC, 0);
SetGpuReg(REG_OFFSET_WIN0H, 0); SetGpuReg(REG_OFFSET_WIN0H, 0);
@@ -3724,7 +3724,7 @@ static void Swap_ErasePopupMenu(u8 windowId)
gSprites[sFactorySwapScreen->menuCursor1SpriteId].invisible = TRUE; gSprites[sFactorySwapScreen->menuCursor1SpriteId].invisible = TRUE;
gSprites[sFactorySwapScreen->menuCursor2SpriteId].invisible = TRUE; gSprites[sFactorySwapScreen->menuCursor2SpriteId].invisible = TRUE;
FillWindowPixelBuffer(windowId, PIXEL_FILL(0)); FillWindowPixelBuffer(windowId, PIXEL_FILL(0));
CopyWindowToVram(windowId, 2); CopyWindowToVram(windowId, COPYWIN_GFX);
ClearWindowTilemap(windowId); ClearWindowTilemap(windowId);
} }
@@ -3732,14 +3732,14 @@ static void Swap_EraseSpeciesWindow(void)
{ {
PutWindowTilemap(SWAP_WIN_SPECIES); PutWindowTilemap(SWAP_WIN_SPECIES);
FillWindowPixelBuffer(SWAP_WIN_SPECIES, PIXEL_FILL(0)); FillWindowPixelBuffer(SWAP_WIN_SPECIES, PIXEL_FILL(0));
CopyWindowToVram(SWAP_WIN_SPECIES, 2); CopyWindowToVram(SWAP_WIN_SPECIES, COPYWIN_GFX);
} }
static void Swap_EraseSpeciesAtFadeWindow(void) static void Swap_EraseSpeciesAtFadeWindow(void)
{ {
PutWindowTilemap(SWAP_WIN_SPECIES_AT_FADE); PutWindowTilemap(SWAP_WIN_SPECIES_AT_FADE);
FillWindowPixelBuffer(SWAP_WIN_SPECIES_AT_FADE, PIXEL_FILL(0)); FillWindowPixelBuffer(SWAP_WIN_SPECIES_AT_FADE, PIXEL_FILL(0));
CopyWindowToVram(SWAP_WIN_SPECIES_AT_FADE, 2); CopyWindowToVram(SWAP_WIN_SPECIES_AT_FADE, COPYWIN_GFX);
} }
static void Swap_EraseActionFadeWindow(void) static void Swap_EraseActionFadeWindow(void)
@@ -3747,14 +3747,14 @@ static void Swap_EraseActionFadeWindow(void)
Swap_EraseSpeciesWindow(); Swap_EraseSpeciesWindow();
PutWindowTilemap(SWAP_WIN_ACTION_FADE); PutWindowTilemap(SWAP_WIN_ACTION_FADE);
FillWindowPixelBuffer(SWAP_WIN_ACTION_FADE, PIXEL_FILL(0)); FillWindowPixelBuffer(SWAP_WIN_ACTION_FADE, PIXEL_FILL(0));
CopyWindowToVram(SWAP_WIN_ACTION_FADE, 2); CopyWindowToVram(SWAP_WIN_ACTION_FADE, COPYWIN_GFX);
} }
static void Swap_PrintPkmnSwap(void) static void Swap_PrintPkmnSwap(void)
{ {
FillWindowPixelBuffer(SWAP_WIN_TITLE, PIXEL_FILL(1)); FillWindowPixelBuffer(SWAP_WIN_TITLE, PIXEL_FILL(1));
AddTextPrinterParameterized(SWAP_WIN_TITLE, FONT_NORMAL, gText_PkmnSwap, 2, 1, 0, NULL); AddTextPrinterParameterized(SWAP_WIN_TITLE, FONT_NORMAL, gText_PkmnSwap, 2, 1, 0, NULL);
CopyWindowToVram(SWAP_WIN_TITLE, 3); CopyWindowToVram(SWAP_WIN_TITLE, COPYWIN_FULL);
} }
static void Swap_PrintMonSpecies(void) static void Swap_PrintMonSpecies(void)
@@ -3765,7 +3765,7 @@ static void Swap_PrintMonSpecies(void)
FillWindowPixelBuffer(SWAP_WIN_SPECIES, PIXEL_FILL(0)); FillWindowPixelBuffer(SWAP_WIN_SPECIES, PIXEL_FILL(0));
if (sFactorySwapScreen->cursorPos >= FRONTIER_PARTY_SIZE) if (sFactorySwapScreen->cursorPos >= FRONTIER_PARTY_SIZE)
{ {
CopyWindowToVram(SWAP_WIN_SPECIES, 2); CopyWindowToVram(SWAP_WIN_SPECIES, COPYWIN_GFX);
} }
else else
{ {
@@ -3777,7 +3777,7 @@ static void Swap_PrintMonSpecies(void)
StringCopy(gStringVar4, gSpeciesNames[species]); StringCopy(gStringVar4, gSpeciesNames[species]);
x = GetStringRightAlignXOffset(FONT_NORMAL, gStringVar4, 86); x = GetStringRightAlignXOffset(FONT_NORMAL, gStringVar4, 86);
AddTextPrinterParameterized3(SWAP_WIN_SPECIES, FONT_NORMAL, x, 1, sSwapSpeciesNameTextColors, 0, gStringVar4); AddTextPrinterParameterized3(SWAP_WIN_SPECIES, FONT_NORMAL, x, 1, sSwapSpeciesNameTextColors, 0, gStringVar4);
CopyWindowToVram(SWAP_WIN_SPECIES, 3); CopyWindowToVram(SWAP_WIN_SPECIES, COPYWIN_FULL);
} }
} }
@@ -3785,7 +3785,7 @@ static void Swap_PrintOnInfoWindow(const u8 *str)
{ {
FillWindowPixelBuffer(SWAP_WIN_INFO, PIXEL_FILL(0)); FillWindowPixelBuffer(SWAP_WIN_INFO, PIXEL_FILL(0));
AddTextPrinterParameterized(SWAP_WIN_INFO, FONT_NORMAL, str, 2, 5, 0, NULL); AddTextPrinterParameterized(SWAP_WIN_INFO, FONT_NORMAL, str, 2, 5, 0, NULL);
CopyWindowToVram(SWAP_WIN_INFO, 2); CopyWindowToVram(SWAP_WIN_INFO, COPYWIN_GFX);
} }
static void Swap_PrintMenuOptions(void) static void Swap_PrintMenuOptions(void)
@@ -3795,7 +3795,7 @@ static void Swap_PrintMenuOptions(void)
AddTextPrinterParameterized3(SWAP_WIN_OPTIONS, FONT_NORMAL, 15, 1, sSwapMenuOptionsTextColors, 0, gText_Summary2); AddTextPrinterParameterized3(SWAP_WIN_OPTIONS, FONT_NORMAL, 15, 1, sSwapMenuOptionsTextColors, 0, gText_Summary2);
AddTextPrinterParameterized3(SWAP_WIN_OPTIONS, FONT_NORMAL, 15, 17, sSwapMenuOptionsTextColors, 0, gText_Swap); AddTextPrinterParameterized3(SWAP_WIN_OPTIONS, FONT_NORMAL, 15, 17, sSwapMenuOptionsTextColors, 0, gText_Swap);
AddTextPrinterParameterized3(SWAP_WIN_OPTIONS, FONT_NORMAL, 15, 33, sSwapMenuOptionsTextColors, 0, gText_Rechoose); AddTextPrinterParameterized3(SWAP_WIN_OPTIONS, FONT_NORMAL, 15, 33, sSwapMenuOptionsTextColors, 0, gText_Rechoose);
CopyWindowToVram(SWAP_WIN_OPTIONS, 3); CopyWindowToVram(SWAP_WIN_OPTIONS, COPYWIN_FULL);
} }
static void Swap_PrintYesNoOptions(void) static void Swap_PrintYesNoOptions(void)
@@ -3804,7 +3804,7 @@ static void Swap_PrintYesNoOptions(void)
FillWindowPixelBuffer(SWAP_WIN_YES_NO, PIXEL_FILL(0)); FillWindowPixelBuffer(SWAP_WIN_YES_NO, PIXEL_FILL(0));
AddTextPrinterParameterized3(SWAP_WIN_YES_NO, FONT_NORMAL, 7, 1, sSwapMenuOptionsTextColors, 0, gText_Yes3); AddTextPrinterParameterized3(SWAP_WIN_YES_NO, FONT_NORMAL, 7, 1, sSwapMenuOptionsTextColors, 0, gText_Yes3);
AddTextPrinterParameterized3(SWAP_WIN_YES_NO, FONT_NORMAL, 7, 17, sSwapMenuOptionsTextColors, 0, gText_No3); AddTextPrinterParameterized3(SWAP_WIN_YES_NO, FONT_NORMAL, 7, 17, sSwapMenuOptionsTextColors, 0, gText_No3);
CopyWindowToVram(SWAP_WIN_YES_NO, 3); CopyWindowToVram(SWAP_WIN_YES_NO, COPYWIN_FULL);
} }
static void Swap_PrintActionString(const u8 *str, u32 y, u32 windowId) static void Swap_PrintActionString(const u8 *str, u32 y, u32 windowId)
@@ -3824,7 +3824,7 @@ static void Swap_PrintActionStrings(void)
Swap_PrintActionString(gText_Cancel3, 24, SWAP_WIN_ACTION_FADE); Swap_PrintActionString(gText_Cancel3, 24, SWAP_WIN_ACTION_FADE);
break; break;
} }
CopyWindowToVram(SWAP_WIN_ACTION_FADE, 3); CopyWindowToVram(SWAP_WIN_ACTION_FADE, COPYWIN_FULL);
} }
static void Swap_PrintActionStrings2(void) static void Swap_PrintActionStrings2(void)
@@ -3838,7 +3838,7 @@ static void Swap_PrintActionStrings2(void)
Swap_PrintActionString(gText_Cancel3, 32, SWAP_WIN_OPTIONS); Swap_PrintActionString(gText_Cancel3, 32, SWAP_WIN_OPTIONS);
break; break;
} }
CopyWindowToVram(SWAP_WIN_OPTIONS, 3); CopyWindowToVram(SWAP_WIN_OPTIONS, COPYWIN_FULL);
} }
static void Swap_PrintOneActionString(u8 which) static void Swap_PrintOneActionString(u8 which)
@@ -3853,7 +3853,7 @@ static void Swap_PrintOneActionString(u8 which)
Swap_PrintActionString(gText_Cancel3, 32, SWAP_WIN_OPTIONS); Swap_PrintActionString(gText_Cancel3, 32, SWAP_WIN_OPTIONS);
break; break;
} }
CopyWindowToVram(SWAP_WIN_OPTIONS, 3); CopyWindowToVram(SWAP_WIN_OPTIONS, COPYWIN_FULL);
} }
// For printing the species name once its selected. Keep the current fade but don't keep fading in and out // For printing the species name once its selected. Keep the current fade but don't keep fading in and out
@@ -3874,7 +3874,7 @@ static void Swap_PrintMonSpeciesAtFade(void)
FillWindowPixelBuffer(SWAP_WIN_SPECIES_AT_FADE, PIXEL_FILL(0)); FillWindowPixelBuffer(SWAP_WIN_SPECIES_AT_FADE, PIXEL_FILL(0));
if (sFactorySwapScreen->cursorPos >= FRONTIER_PARTY_SIZE) if (sFactorySwapScreen->cursorPos >= FRONTIER_PARTY_SIZE)
{ {
CopyWindowToVram(SWAP_WIN_SPECIES_AT_FADE, 3); CopyWindowToVram(SWAP_WIN_SPECIES_AT_FADE, COPYWIN_FULL);
} }
else else
{ {
@@ -3886,7 +3886,7 @@ static void Swap_PrintMonSpeciesAtFade(void)
StringCopy(gStringVar4, gSpeciesNames[species]); StringCopy(gStringVar4, gSpeciesNames[species]);
x = GetStringRightAlignXOffset(FONT_NORMAL, gStringVar4, 86); x = GetStringRightAlignXOffset(FONT_NORMAL, gStringVar4, 86);
AddTextPrinterParameterized3(SWAP_WIN_SPECIES_AT_FADE, FONT_NORMAL, x, 1, sSwapSpeciesNameTextColors, 0, gStringVar4); AddTextPrinterParameterized3(SWAP_WIN_SPECIES_AT_FADE, FONT_NORMAL, x, 1, sSwapSpeciesNameTextColors, 0, gStringVar4);
CopyWindowToVram(SWAP_WIN_SPECIES_AT_FADE, 3); CopyWindowToVram(SWAP_WIN_SPECIES_AT_FADE, COPYWIN_FULL);
} }
} }
@@ -3901,7 +3901,7 @@ static void Swap_PrintMonSpeciesForTransition(void)
if (sFactorySwapScreen->cursorPos >= FRONTIER_PARTY_SIZE) if (sFactorySwapScreen->cursorPos >= FRONTIER_PARTY_SIZE)
{ {
CopyWindowToVram(SWAP_WIN_SPECIES, 2); CopyWindowToVram(SWAP_WIN_SPECIES, COPYWIN_GFX);
} }
else else
{ {
@@ -3913,7 +3913,7 @@ static void Swap_PrintMonSpeciesForTransition(void)
StringCopy(gStringVar4, gSpeciesNames[species]); StringCopy(gStringVar4, gSpeciesNames[species]);
x = GetStringRightAlignXOffset(FONT_NORMAL, gStringVar4, 86); x = GetStringRightAlignXOffset(FONT_NORMAL, gStringVar4, 86);
AddTextPrinterParameterized3(SWAP_WIN_SPECIES, FONT_NORMAL, x, 1, sSwapSpeciesNameTextColors, 0, gStringVar4); AddTextPrinterParameterized3(SWAP_WIN_SPECIES, FONT_NORMAL, x, 1, sSwapSpeciesNameTextColors, 0, gStringVar4);
CopyWindowToVram(SWAP_WIN_SPECIES, 3); CopyWindowToVram(SWAP_WIN_SPECIES, COPYWIN_FULL);
} }
} }
@@ -3927,7 +3927,7 @@ static void Swap_PrintMonCategory(void)
FillWindowPixelBuffer(SWAP_WIN_MON_CATEGORY, PIXEL_FILL(0)); FillWindowPixelBuffer(SWAP_WIN_MON_CATEGORY, PIXEL_FILL(0));
if (monId >= FRONTIER_PARTY_SIZE) if (monId >= FRONTIER_PARTY_SIZE)
{ {
CopyWindowToVram(SWAP_WIN_MON_CATEGORY, 2); CopyWindowToVram(SWAP_WIN_MON_CATEGORY, COPYWIN_GFX);
} }
else else
{ {
@@ -3939,7 +3939,7 @@ static void Swap_PrintMonCategory(void)
CopyMonCategoryText(SpeciesToNationalPokedexNum(species), text); CopyMonCategoryText(SpeciesToNationalPokedexNum(species), text);
x = GetStringRightAlignXOffset(FONT_NORMAL, text, 0x76); x = GetStringRightAlignXOffset(FONT_NORMAL, text, 0x76);
AddTextPrinterParameterized(SWAP_WIN_MON_CATEGORY, FONT_NORMAL, text, x, 1, 0, NULL); AddTextPrinterParameterized(SWAP_WIN_MON_CATEGORY, FONT_NORMAL, text, x, 1, 0, NULL);
CopyWindowToVram(SWAP_WIN_MON_CATEGORY, 2); CopyWindowToVram(SWAP_WIN_MON_CATEGORY, COPYWIN_GFX);
} }
} }
@@ -4126,7 +4126,7 @@ static void Swap_TaskCantHaveSameMons(u8 taskId)
if (sFactorySwapScreen->monPicAnimating != TRUE) if (sFactorySwapScreen->monPicAnimating != TRUE)
{ {
FillWindowPixelBuffer(SWAP_WIN_ACTION_FADE, PIXEL_FILL(0)); FillWindowPixelBuffer(SWAP_WIN_ACTION_FADE, PIXEL_FILL(0));
CopyWindowToVram(SWAP_WIN_ACTION_FADE, 2); CopyWindowToVram(SWAP_WIN_ACTION_FADE, COPYWIN_GFX);
gTasks[taskId].tState++; gTasks[taskId].tState++;
} }
break; break;
+1 -1
View File
@@ -2525,7 +2525,7 @@ static u8* AddTextPrinterAndCreateWindowOnHealthbox(const u8 *str, u32 x, u32 y,
color[1] = 1; color[1] = 1;
color[2] = 3; color[2] = 3;
AddTextPrinterParameterized4(winId, FONT_SMALL, x, y, 0, 0, color, -1, str); AddTextPrinterParameterized4(winId, FONT_SMALL, x, y, 0, 0, color, TEXT_SKIP_DRAW, str);
*windowId = winId; *windowId = winId;
return (u8*)(GetWindowAttribute(winId, WINDOW_TILE_DATA)); return (u8*)(GetWindowAttribute(winId, WINDOW_TILE_DATA));
+1 -1
View File
@@ -682,7 +682,7 @@ static void CB2_InitBattleInternal(void)
{ {
CreateNPCTrainerParty(&gEnemyParty[0], gTrainerBattleOpponent_A, TRUE); CreateNPCTrainerParty(&gEnemyParty[0], gTrainerBattleOpponent_A, TRUE);
if (gBattleTypeFlags & BATTLE_TYPE_TWO_OPPONENTS) if (gBattleTypeFlags & BATTLE_TYPE_TWO_OPPONENTS)
CreateNPCTrainerParty(&gEnemyParty[3], gTrainerBattleOpponent_B, FALSE); CreateNPCTrainerParty(&gEnemyParty[PARTY_SIZE / 2], gTrainerBattleOpponent_B, FALSE);
SetWildMonHeldItem(); SetWildMonHeldItem();
} }
+1 -1
View File
@@ -3113,7 +3113,7 @@ void BattlePutTextOnWindow(const u8 *text, u8 windowId)
if (copyToVram) if (copyToVram)
{ {
PutWindowTilemap(windowId); PutWindowTilemap(windowId);
CopyWindowToVram(windowId, 3); CopyWindowToVram(windowId, COPYWIN_FULL);
} }
} }
+7 -7
View File
@@ -673,7 +673,7 @@ static void PrintItemQuantity(u8 windowId, u32 itemIndex, u8 y)
2); 2);
StringExpandPlaceholders(gStringVar4, gText_xVar1); StringExpandPlaceholders(gStringVar4, gText_xVar1);
xAlign = GetStringRightAlignXOffset(FONT_NARROW, gStringVar4, 119); xAlign = GetStringRightAlignXOffset(FONT_NARROW, gStringVar4, 119);
PyramidBagPrint_Quantity(windowId, gStringVar4, xAlign, y, 0, 0, TEXT_SPEED_FF, COLORID_DARK_GRAY); PyramidBagPrint_Quantity(windowId, gStringVar4, xAlign, y, 0, 0, TEXT_SKIP_DRAW, COLORID_DARK_GRAY);
} }
static void PrintItemDescription(s32 listMenuId) static void PrintItemDescription(s32 listMenuId)
@@ -978,8 +978,8 @@ static void OpenContextMenu(u8 taskId)
static void PrintMenuActionText_SingleRow(u8 windowId) static void PrintMenuActionText_SingleRow(u8 windowId)
{ {
AddItemMenuActionTextPrinters(windowId, FONT_NARROW, 8, 1, 0, 0x10, gPyramidBagMenu->menuActionsCount, sMenuActions, gPyramidBagMenu->menuActionIds); PrintMenuActionTexts(windowId, FONT_NARROW, 8, 1, 0, 0x10, gPyramidBagMenu->menuActionsCount, sMenuActions, gPyramidBagMenu->menuActionIds);
InitMenuInUpperLeftCornerPlaySoundWhenAPressed(windowId, gPyramidBagMenu->menuActionsCount, 0); InitMenuInUpperLeftCornerNormal(windowId, gPyramidBagMenu->menuActionsCount, 0);
} }
static void PrintMenuActionText_MultiRow(u8 windowId, u8 horizontalCount, u8 verticalCount) static void PrintMenuActionText_MultiRow(u8 windowId, u8 horizontalCount, u8 verticalCount)
@@ -1020,7 +1020,7 @@ static void HandleMenuActionInput_2x2(u8 taskId)
if (id > 0 && IsValidMenuAction(id - 2)) if (id > 0 && IsValidMenuAction(id - 2))
{ {
PlaySE(SE_SELECT); PlaySE(SE_SELECT);
ChangeListMenuCursorPosition(MENU_CURSOR_DELTA_NONE, MENU_CURSOR_DELTA_UP); ChangeMenuGridCursorPosition(MENU_CURSOR_DELTA_NONE, MENU_CURSOR_DELTA_UP);
} }
} }
else if (JOY_NEW(DPAD_DOWN)) else if (JOY_NEW(DPAD_DOWN))
@@ -1028,7 +1028,7 @@ static void HandleMenuActionInput_2x2(u8 taskId)
if (id < gPyramidBagMenu->menuActionsCount - 2 && IsValidMenuAction(id + 2)) if (id < gPyramidBagMenu->menuActionsCount - 2 && IsValidMenuAction(id + 2))
{ {
PlaySE(SE_SELECT); PlaySE(SE_SELECT);
ChangeListMenuCursorPosition(MENU_CURSOR_DELTA_NONE, MENU_CURSOR_DELTA_DOWN); ChangeMenuGridCursorPosition(MENU_CURSOR_DELTA_NONE, MENU_CURSOR_DELTA_DOWN);
} }
} }
else if (JOY_NEW(DPAD_LEFT) || GetLRKeysPressed() == MENU_L_PRESSED) else if (JOY_NEW(DPAD_LEFT) || GetLRKeysPressed() == MENU_L_PRESSED)
@@ -1036,7 +1036,7 @@ static void HandleMenuActionInput_2x2(u8 taskId)
if (id & 1 && IsValidMenuAction(id - 1)) if (id & 1 && IsValidMenuAction(id - 1))
{ {
PlaySE(SE_SELECT); PlaySE(SE_SELECT);
ChangeListMenuCursorPosition(MENU_CURSOR_DELTA_LEFT, MENU_CURSOR_DELTA_NONE); ChangeMenuGridCursorPosition(MENU_CURSOR_DELTA_LEFT, MENU_CURSOR_DELTA_NONE);
} }
} }
else if (JOY_NEW(DPAD_RIGHT) || GetLRKeysPressed() == MENU_R_PRESSED) else if (JOY_NEW(DPAD_RIGHT) || GetLRKeysPressed() == MENU_R_PRESSED)
@@ -1044,7 +1044,7 @@ static void HandleMenuActionInput_2x2(u8 taskId)
if (!(id & 1) && IsValidMenuAction(id + 1)) if (!(id & 1) && IsValidMenuAction(id + 1))
{ {
PlaySE(SE_SELECT); PlaySE(SE_SELECT);
ChangeListMenuCursorPosition(MENU_CURSOR_DELTA_RIGHT, MENU_CURSOR_DELTA_NONE); ChangeMenuGridCursorPosition(MENU_CURSOR_DELTA_RIGHT, MENU_CURSOR_DELTA_NONE);
} }
} }
else if (JOY_NEW(A_BUTTON)) else if (JOY_NEW(A_BUTTON))
+10 -10
View File
@@ -334,7 +334,7 @@ void ShowLinkBattleRecords(void)
} }
PutWindowTilemap(gRecordsWindowId); PutWindowTilemap(gRecordsWindowId);
CopyWindowToVram(gRecordsWindowId, 3); CopyWindowToVram(gRecordsWindowId, COPYWIN_FULL);
} }
void RemoveRecordsWindow(void) void RemoveRecordsWindow(void)
@@ -382,7 +382,7 @@ static void RemoveTrainerHillRecordsWindow(u8 windowId)
{ {
FillWindowPixelBuffer(windowId, PIXEL_FILL(0)); FillWindowPixelBuffer(windowId, PIXEL_FILL(0));
ClearWindowTilemap(windowId); ClearWindowTilemap(windowId);
CopyWindowToVram(windowId, 2); CopyWindowToVram(windowId, COPYWIN_GFX);
RemoveWindow(windowId); RemoveWindow(windowId);
} }
@@ -425,14 +425,14 @@ static void ClearTasksAndGraphicalStructs(void)
static void ResetBgCoordinates(void) static void ResetBgCoordinates(void)
{ {
ChangeBgX(0, 0, 0); ChangeBgX(0, 0, BG_COORD_SET);
ChangeBgY(0, 0, 0); ChangeBgY(0, 0, BG_COORD_SET);
ChangeBgX(1, 0, 0); ChangeBgX(1, 0, BG_COORD_SET);
ChangeBgY(1, 0, 0); ChangeBgY(1, 0, BG_COORD_SET);
ChangeBgX(2, 0, 0); ChangeBgX(2, 0, BG_COORD_SET);
ChangeBgY(2, 0, 0); ChangeBgY(2, 0, BG_COORD_SET);
ChangeBgX(3, 0, 0); ChangeBgX(3, 0, BG_COORD_SET);
ChangeBgY(3, 0, 0); ChangeBgY(3, 0, BG_COORD_SET);
} }
static void SetDispcntReg(void) static void SetDispcntReg(void)
+8 -8
View File
@@ -5921,7 +5921,7 @@ static void Cmd_drawlvlupbox(void)
// Draw page 1 of level up box // Draw page 1 of level up box
DrawLevelUpWindow1(); DrawLevelUpWindow1();
PutWindowTilemap(B_WIN_LEVEL_UP_BOX); PutWindowTilemap(B_WIN_LEVEL_UP_BOX);
CopyWindowToVram(B_WIN_LEVEL_UP_BOX, 3); CopyWindowToVram(B_WIN_LEVEL_UP_BOX, COPYWIN_FULL);
gBattleScripting.drawlvlupboxState++; gBattleScripting.drawlvlupboxState++;
break; break;
case 5: case 5:
@@ -5939,7 +5939,7 @@ static void Cmd_drawlvlupbox(void)
// Draw page 2 of level up box // Draw page 2 of level up box
PlaySE(SE_SELECT); PlaySE(SE_SELECT);
DrawLevelUpWindow2(); DrawLevelUpWindow2();
CopyWindowToVram(B_WIN_LEVEL_UP_BOX, 2); CopyWindowToVram(B_WIN_LEVEL_UP_BOX, COPYWIN_GFX);
gBattleScripting.drawlvlupboxState++; gBattleScripting.drawlvlupboxState++;
} }
break; break;
@@ -5956,10 +5956,10 @@ static void Cmd_drawlvlupbox(void)
if (!SlideOutLevelUpBanner()) if (!SlideOutLevelUpBanner())
{ {
ClearWindowTilemap(B_WIN_LEVEL_UP_BANNER); ClearWindowTilemap(B_WIN_LEVEL_UP_BANNER);
CopyWindowToVram(B_WIN_LEVEL_UP_BANNER, 1); CopyWindowToVram(B_WIN_LEVEL_UP_BANNER, COPYWIN_MAP);
ClearWindowTilemap(B_WIN_LEVEL_UP_BOX); ClearWindowTilemap(B_WIN_LEVEL_UP_BOX);
CopyWindowToVram(B_WIN_LEVEL_UP_BOX, 1); CopyWindowToVram(B_WIN_LEVEL_UP_BOX, COPYWIN_MAP);
SetBgAttribute(2, BG_ATTR_PRIORITY, 2); SetBgAttribute(2, BG_ATTR_PRIORITY, 2);
ShowBg(2); ShowBg(2);
@@ -6004,7 +6004,7 @@ static void InitLevelUpBanner(void)
LoadPalette(sLevelUpBanner_Pal, 0x60, 0x20); LoadPalette(sLevelUpBanner_Pal, 0x60, 0x20);
CopyToWindowPixelBuffer(B_WIN_LEVEL_UP_BANNER, sLevelUpBanner_Gfx, 0, 0); CopyToWindowPixelBuffer(B_WIN_LEVEL_UP_BANNER, sLevelUpBanner_Gfx, 0, 0);
PutWindowTilemap(B_WIN_LEVEL_UP_BANNER); PutWindowTilemap(B_WIN_LEVEL_UP_BANNER);
CopyWindowToVram(B_WIN_LEVEL_UP_BANNER, 3); CopyWindowToVram(B_WIN_LEVEL_UP_BANNER, COPYWIN_FULL);
PutMonIconOnLvlUpBanner(); PutMonIconOnLvlUpBanner();
} }
@@ -6053,7 +6053,7 @@ static void DrawLevelUpBannerText(void)
printerTemplate.bgColor = TEXT_COLOR_TRANSPARENT; printerTemplate.bgColor = TEXT_COLOR_TRANSPARENT;
printerTemplate.shadowColor = TEXT_COLOR_DARK_GRAY; printerTemplate.shadowColor = TEXT_COLOR_DARK_GRAY;
AddTextPrinter(&printerTemplate, TEXT_SPEED_FF, NULL); AddTextPrinter(&printerTemplate, TEXT_SKIP_DRAW, NULL);
txtPtr = gStringVar4; txtPtr = gStringVar4;
*(txtPtr)++ = CHAR_EXTRA_SYMBOL; *(txtPtr)++ = CHAR_EXTRA_SYMBOL;
@@ -6083,9 +6083,9 @@ static void DrawLevelUpBannerText(void)
printerTemplate.y = 10; printerTemplate.y = 10;
printerTemplate.currentY = 10; printerTemplate.currentY = 10;
AddTextPrinter(&printerTemplate, TEXT_SPEED_FF, NULL); AddTextPrinter(&printerTemplate, TEXT_SKIP_DRAW, NULL);
CopyWindowToVram(B_WIN_LEVEL_UP_BANNER, 2); CopyWindowToVram(B_WIN_LEVEL_UP_BANNER, COPYWIN_GFX);
} }
static bool8 SlideOutLevelUpBanner(void) static bool8 SlideOutLevelUpBanner(void)
+3 -3
View File
@@ -378,9 +378,9 @@ static bool8 Circles_Init(struct Task *task)
LoadLogoGfx(); LoadLogoGfx();
SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT1_BG0 | BLDCNT_EFFECT_BLEND | BLDCNT_TGT2_ALL); SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT1_BG0 | BLDCNT_EFFECT_BLEND | BLDCNT_TGT2_ALL);
SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(0, 16)); SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(0, 16));
ChangeBgX(0, 0, 0); ChangeBgX(0, 0, BG_COORD_SET);
ChangeBgY(0, 0, 0); ChangeBgY(0, 0, BG_COORD_SET);
ChangeBgY(0, 0x500, 2); ChangeBgY(0, 0x500, BG_COORD_SUB);
task->tTimer = 0; task->tTimer = 0;
task->tState++; task->tState++;
+24 -24
View File
@@ -1013,10 +1013,10 @@ static void DrawBlenderBg(void)
ShowBg(0); ShowBg(0);
ShowBg(1); ShowBg(1);
SetGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_OBJ_ON | DISPCNT_OBJ_1D_MAP); SetGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_OBJ_ON | DISPCNT_OBJ_1D_MAP);
ChangeBgX(0, 0, 0); ChangeBgX(0, 0, BG_COORD_SET);
ChangeBgY(0, 0, 0); ChangeBgY(0, 0, BG_COORD_SET);
ChangeBgX(1, 0, 0); ChangeBgX(1, 0, BG_COORD_SET);
ChangeBgY(1, 0, 0); ChangeBgY(1, 0, BG_COORD_SET);
} }
static void InitBerryBlenderWindows(void) static void InitBerryBlenderWindows(void)
@@ -1616,7 +1616,7 @@ static void PrintPlayerNames(void)
Blender_AddTextPrinter(i, text, xPos, 1, 0, 1); Blender_AddTextPrinter(i, text, xPos, 1, 0, 1);
PutWindowTilemap(i); PutWindowTilemap(i);
CopyWindowToVram(i, 3); CopyWindowToVram(i, COPYWIN_FULL);
} }
} }
} }
@@ -2684,7 +2684,7 @@ static void CB2_EndBlenderGame(void)
if (sBerryBlender->arrowIdToPlayerId[i] != NO_PLAYER) if (sBerryBlender->arrowIdToPlayerId[i] != NO_PLAYER)
{ {
PutWindowTilemap(i); PutWindowTilemap(i);
CopyWindowToVram(i, 3); CopyWindowToVram(i, COPYWIN_FULL);
} }
} }
break; break;
@@ -2696,7 +2696,7 @@ static void CB2_EndBlenderGame(void)
if (sBerryBlender->arrowIdToPlayerId[i] != NO_PLAYER) if (sBerryBlender->arrowIdToPlayerId[i] != NO_PLAYER)
{ {
PutWindowTilemap(i); PutWindowTilemap(i);
CopyWindowToVram(i, 3); CopyWindowToVram(i, COPYWIN_FULL);
} }
} }
break; break;
@@ -3495,7 +3495,7 @@ static bool8 PrintBlendingResults(void)
u8 *txtPtr; u8 *txtPtr;
xPos = GetStringCenterAlignXOffset(FONT_NORMAL, sText_BlendingResults, 0xA8); xPos = GetStringCenterAlignXOffset(FONT_NORMAL, sText_BlendingResults, 0xA8);
Blender_AddTextPrinter(5, sText_BlendingResults, xPos, 1, TEXT_SPEED_FF, 0); Blender_AddTextPrinter(5, sText_BlendingResults, xPos, 1, TEXT_SKIP_DRAW, 0);
if (sBerryBlender->numPlayers == BLENDER_MAX_PLAYERS) if (sBerryBlender->numPlayers == BLENDER_MAX_PLAYERS)
yPos = 17; yPos = 17;
@@ -3510,15 +3510,15 @@ static bool8 PrintBlendingResults(void)
StringAppend(sBerryBlender->stringVar, sText_Dot); StringAppend(sBerryBlender->stringVar, sText_Dot);
StringAppend(sBerryBlender->stringVar, gText_Space); StringAppend(sBerryBlender->stringVar, gText_Space);
StringAppend(sBerryBlender->stringVar, gLinkPlayers[place].name); StringAppend(sBerryBlender->stringVar, gLinkPlayers[place].name);
Blender_AddTextPrinter(5, sBerryBlender->stringVar, 8, yPos, TEXT_SPEED_FF, 3); Blender_AddTextPrinter(5, sBerryBlender->stringVar, 8, yPos, TEXT_SKIP_DRAW, 3);
StringCopy(sBerryBlender->stringVar, sBerryBlender->blendedBerries[place].name); StringCopy(sBerryBlender->stringVar, sBerryBlender->blendedBerries[place].name);
ConvertInternationalString(sBerryBlender->stringVar, gLinkPlayers[place].language); ConvertInternationalString(sBerryBlender->stringVar, gLinkPlayers[place].language);
StringAppend(sBerryBlender->stringVar, sText_SpaceBerry); StringAppend(sBerryBlender->stringVar, sText_SpaceBerry);
Blender_AddTextPrinter(5, sBerryBlender->stringVar, 0x54, yPos, TEXT_SPEED_FF, 3); Blender_AddTextPrinter(5, sBerryBlender->stringVar, 0x54, yPos, TEXT_SKIP_DRAW, 3);
} }
Blender_AddTextPrinter(5, sText_MaximumSpeed, 0, 0x51, TEXT_SPEED_FF, 3); Blender_AddTextPrinter(5, sText_MaximumSpeed, 0, 0x51, TEXT_SKIP_DRAW, 3);
ConvertIntToDecimalStringN(sBerryBlender->stringVar, sBerryBlender->maxRPM / 100, STR_CONV_MODE_RIGHT_ALIGN, 3); ConvertIntToDecimalStringN(sBerryBlender->stringVar, sBerryBlender->maxRPM / 100, STR_CONV_MODE_RIGHT_ALIGN, 3);
StringAppend(sBerryBlender->stringVar, sText_Dot); StringAppend(sBerryBlender->stringVar, sText_Dot);
@@ -3527,8 +3527,8 @@ static bool8 PrintBlendingResults(void)
StringAppend(sBerryBlender->stringVar, sText_RPM); StringAppend(sBerryBlender->stringVar, sText_RPM);
xPos = GetStringRightAlignXOffset(FONT_NORMAL, sBerryBlender->stringVar, 0xA8); xPos = GetStringRightAlignXOffset(FONT_NORMAL, sBerryBlender->stringVar, 0xA8);
Blender_AddTextPrinter(5, sBerryBlender->stringVar, xPos, 0x51, TEXT_SPEED_FF, 3); Blender_AddTextPrinter(5, sBerryBlender->stringVar, xPos, 0x51, TEXT_SKIP_DRAW, 3);
Blender_AddTextPrinter(5, sText_Time, 0, 0x61, TEXT_SPEED_FF, 3); Blender_AddTextPrinter(5, sText_Time, 0, 0x61, TEXT_SKIP_DRAW, 3);
seconds = (sBerryBlender->gameFrameTime / 60) % 60; seconds = (sBerryBlender->gameFrameTime / 60) % 60;
minutes = (sBerryBlender->gameFrameTime / (60 * 60)); minutes = (sBerryBlender->gameFrameTime / (60 * 60));
@@ -3540,12 +3540,12 @@ static bool8 PrintBlendingResults(void)
StringAppend(sBerryBlender->stringVar, sText_Sec); StringAppend(sBerryBlender->stringVar, sText_Sec);
xPos = GetStringRightAlignXOffset(FONT_NORMAL, sBerryBlender->stringVar, 0xA8); xPos = GetStringRightAlignXOffset(FONT_NORMAL, sBerryBlender->stringVar, 0xA8);
Blender_AddTextPrinter(5, sBerryBlender->stringVar, xPos, 0x61, TEXT_SPEED_FF, 3); Blender_AddTextPrinter(5, sBerryBlender->stringVar, xPos, 0x61, TEXT_SKIP_DRAW, 3);
sBerryBlender->framesToWait = 0; sBerryBlender->framesToWait = 0;
sBerryBlender->mainState++; sBerryBlender->mainState++;
CopyWindowToVram(5, 2); CopyWindowToVram(5, COPYWIN_GFX);
} }
break; break;
case 4: case 4:
@@ -3562,7 +3562,7 @@ static bool8 PrintBlendingResults(void)
if (sBerryBlender->arrowIdToPlayerId[i] != NO_PLAYER) if (sBerryBlender->arrowIdToPlayerId[i] != NO_PLAYER)
{ {
PutWindowTilemap(i); PutWindowTilemap(i);
CopyWindowToVram(i, 3); CopyWindowToVram(i, COPYWIN_FULL);
} }
} }
@@ -3694,7 +3694,7 @@ static bool8 PrintBlendingRanking(void)
case 3: case 3:
DrawStdFrameWithCustomTileAndPalette(5, 0, 1, 0xD); DrawStdFrameWithCustomTileAndPalette(5, 0, 1, 0xD);
xPos = GetStringCenterAlignXOffset(FONT_NORMAL, sText_Ranking, 168); xPos = GetStringCenterAlignXOffset(FONT_NORMAL, sText_Ranking, 168);
Blender_AddTextPrinter(5, sText_Ranking, xPos, 1, TEXT_SPEED_FF, 0); Blender_AddTextPrinter(5, sText_Ranking, xPos, 1, TEXT_SKIP_DRAW, 0);
sBerryBlender->scoreIconIds[SCORE_BEST] = CreateSprite(&sSpriteTemplate_ScoreSymbols, 128, 52, 0); sBerryBlender->scoreIconIds[SCORE_BEST] = CreateSprite(&sSpriteTemplate_ScoreSymbols, 128, 52, 0);
StartSpriteAnim(&gSprites[sBerryBlender->scoreIconIds[SCORE_BEST]], SCOREANIM_BEST_STATIC); StartSpriteAnim(&gSprites[sBerryBlender->scoreIconIds[SCORE_BEST]], SCOREANIM_BEST_STATIC);
@@ -3718,20 +3718,20 @@ static bool8 PrintBlendingRanking(void)
StringAppend(sBerryBlender->stringVar, sText_Dot); StringAppend(sBerryBlender->stringVar, sText_Dot);
StringAppend(sBerryBlender->stringVar, gText_Space); StringAppend(sBerryBlender->stringVar, gText_Space);
StringAppend(sBerryBlender->stringVar, gLinkPlayers[place].name); StringAppend(sBerryBlender->stringVar, gLinkPlayers[place].name);
Blender_AddTextPrinter(5, sBerryBlender->stringVar, 0, yPos, TEXT_SPEED_FF, 3); Blender_AddTextPrinter(5, sBerryBlender->stringVar, 0, yPos, TEXT_SKIP_DRAW, 3);
ConvertIntToDecimalStringN(sBerryBlender->stringVar, sBerryBlender->scores[place][SCORE_BEST], STR_CONV_MODE_RIGHT_ALIGN, 3); ConvertIntToDecimalStringN(sBerryBlender->stringVar, sBerryBlender->scores[place][SCORE_BEST], STR_CONV_MODE_RIGHT_ALIGN, 3);
Blender_AddTextPrinter(5, sBerryBlender->stringVar, 78, yPos, TEXT_SPEED_FF, 3); Blender_AddTextPrinter(5, sBerryBlender->stringVar, 78, yPos, TEXT_SKIP_DRAW, 3);
ConvertIntToDecimalStringN(sBerryBlender->stringVar, sBerryBlender->scores[place][SCORE_GOOD], STR_CONV_MODE_RIGHT_ALIGN, 3); ConvertIntToDecimalStringN(sBerryBlender->stringVar, sBerryBlender->scores[place][SCORE_GOOD], STR_CONV_MODE_RIGHT_ALIGN, 3);
Blender_AddTextPrinter(5, sBerryBlender->stringVar, 78 + 32, yPos, TEXT_SPEED_FF, 3); Blender_AddTextPrinter(5, sBerryBlender->stringVar, 78 + 32, yPos, TEXT_SKIP_DRAW, 3);
ConvertIntToDecimalStringN(sBerryBlender->stringVar, sBerryBlender->scores[place][SCORE_MISS], STR_CONV_MODE_RIGHT_ALIGN, 3); ConvertIntToDecimalStringN(sBerryBlender->stringVar, sBerryBlender->scores[place][SCORE_MISS], STR_CONV_MODE_RIGHT_ALIGN, 3);
Blender_AddTextPrinter(5, sBerryBlender->stringVar, 78 + 64, yPos, TEXT_SPEED_FF, 3); Blender_AddTextPrinter(5, sBerryBlender->stringVar, 78 + 64, yPos, TEXT_SKIP_DRAW, 3);
} }
PutWindowTilemap(5); PutWindowTilemap(5);
CopyWindowToVram(5, 3); CopyWindowToVram(5, COPYWIN_FULL);
sBerryBlender->framesToWait = 0; sBerryBlender->framesToWait = 0;
sBerryBlender->mainState++; sBerryBlender->mainState++;
@@ -3788,7 +3788,7 @@ void ShowBerryBlenderRecordWindow(void)
} }
PutWindowTilemap(gRecordsWindowId); PutWindowTilemap(gRecordsWindowId);
CopyWindowToVram(gRecordsWindowId, 3); CopyWindowToVram(gRecordsWindowId, COPYWIN_FULL);
} }
static void Task_PlayPokeblockFanfare(u8 taskId) static void Task_PlayPokeblockFanfare(u8 taskId)
@@ -3890,7 +3890,7 @@ static bool32 Blender_PrintText(s16 *textState, const u8 *string, s32 textSpeed)
DrawDialogFrameWithCustomTileAndPalette(4, FALSE, 0x14, 0xF); DrawDialogFrameWithCustomTileAndPalette(4, FALSE, 0x14, 0xF);
Blender_AddTextPrinter(4, string, 0, 1, textSpeed, 0); Blender_AddTextPrinter(4, string, 0, 1, textSpeed, 0);
PutWindowTilemap(4); PutWindowTilemap(4);
CopyWindowToVram(4, 3); CopyWindowToVram(4, COPYWIN_FULL);
(*textState)++; (*textState)++;
break; break;
case 1: case 1:
+14 -14
View File
@@ -1202,12 +1202,12 @@ static s32 ShowGameDisplay(void)
SetBgTilemapBuffer(1, game->gfx.bgBuffers[0]); SetBgTilemapBuffer(1, game->gfx.bgBuffers[0]);
SetBgTilemapBuffer(2, game->gfx.bgBuffers[2]); SetBgTilemapBuffer(2, game->gfx.bgBuffers[2]);
SetBgTilemapBuffer(3, game->gfx.bgBuffers[3]); SetBgTilemapBuffer(3, game->gfx.bgBuffers[3]);
ChangeBgX(0, 0, 0); ChangeBgX(0, 0, BG_COORD_SET);
ChangeBgY(0, 0, 0); ChangeBgY(0, 0, BG_COORD_SET);
ChangeBgX(2, 0, 0); ChangeBgX(2, 0, BG_COORD_SET);
ChangeBgY(2, 0, 0); ChangeBgY(2, 0, BG_COORD_SET);
ChangeBgX(3, 0, 0); ChangeBgX(3, 0, BG_COORD_SET);
ChangeBgY(3, 0, 0); ChangeBgY(3, 0, BG_COORD_SET);
SetGpuReg(REG_OFFSET_BLDCNT, 0); SetGpuReg(REG_OFFSET_BLDCNT, 0);
SetGpuReg(REG_OFFSET_BLDALPHA, 0); SetGpuReg(REG_OFFSET_BLDALPHA, 0);
break; break;
@@ -1249,8 +1249,8 @@ static s32 ShowGameDisplay(void)
CreateWirelessStatusIndicatorSprite(0, 0); CreateWirelessStatusIndicatorSprite(0, 0);
CreateGameSprites(game); CreateGameSprites(game);
SetGpuReg(REG_OFFSET_BG1VOFS, -gSpriteCoordOffsetY); SetGpuReg(REG_OFFSET_BG1VOFS, -gSpriteCoordOffsetY);
ChangeBgX(1, 0, 0); ChangeBgX(1, 0, BG_COORD_SET);
ChangeBgY(1, 0, 0); ChangeBgY(1, 0, BG_COORD_SET);
break; break;
case 9: case 9:
gPaletteFade.bufferTransferDisabled = FALSE; gPaletteFade.bufferTransferDisabled = FALSE;
@@ -1778,7 +1778,7 @@ static bool32 OpenResultsWindow(struct BerryCrushGame *game, struct BerryCrushGa
PrintCrushingResults(game); PrintCrushingResults(game);
break; break;
case 5: case 5:
CopyWindowToVram(gfx->resultsWindowId, 3); CopyWindowToVram(gfx->resultsWindowId, COPYWIN_FULL);
gfx->resultsState = 0; gfx->resultsState = 0;
return TRUE; return TRUE;
} }
@@ -1841,7 +1841,7 @@ static void Task_ShowRankings(u8 taskId)
yPos += 16; yPos += 16;
score = 0; score = 0;
} }
CopyWindowToVram(tWindowId, 3); CopyWindowToVram(tWindowId, COPYWIN_FULL);
break; break;
case 2: case 2:
if (JOY_NEW(A_BUTTON | B_BUTTON)) if (JOY_NEW(A_BUTTON | B_BUTTON))
@@ -1938,7 +1938,7 @@ static void DrawPlayerNameWindows(struct BerryCrushGame *game)
game->players[i].name game->players[i].name
); );
} }
CopyWindowToVram(game->gfx.nameWindowIds[i], 3); CopyWindowToVram(game->gfx.nameWindowIds[i], COPYWIN_FULL);
} }
CopyBgTilemapBufferToVram(0); CopyBgTilemapBufferToVram(0);
} }
@@ -2264,7 +2264,7 @@ static u32 Cmd_PrintMessage(struct BerryCrushGame *game, u8 *args)
{ {
AddTextPrinterParameterized2(0, FONT_NORMAL, sMessages[args[0]], game->textSpeed, 0, 2, 1, 3); AddTextPrinterParameterized2(0, FONT_NORMAL, sMessages[args[0]], game->textSpeed, 0, 2, 1, 3);
} }
CopyWindowToVram(0, 3); CopyWindowToVram(0, COPYWIN_FULL);
break; break;
case 1: case 1:
if (!IsTextPrinterActive(0)) if (!IsTextPrinterActive(0))
@@ -3243,7 +3243,7 @@ static u32 Cmd_SaveGame(struct BerryCrushGame *game, u8 *args)
return 0; return 0;
DrawDialogueFrame(0, 0); DrawDialogueFrame(0, 0);
AddTextPrinterParameterized2(0, FONT_NORMAL, gText_SavingDontTurnOffPower, 0, 0, 2, 1, 3); AddTextPrinterParameterized2(0, FONT_NORMAL, gText_SavingDontTurnOffPower, 0, 0, 2, 1, 3);
CopyWindowToVram(0, 3); CopyWindowToVram(0, COPYWIN_FULL);
CreateTask(Task_LinkSave, 0); CreateTask(Task_LinkSave, 0);
break; break;
case 3: case 3:
@@ -3394,7 +3394,7 @@ static u32 Cmd_StopGame(struct BerryCrushGame *game, u8 *args)
AddTextPrinterParameterized2(0, FONT_NORMAL, sMessages[MSG_NO_BERRIES], game->textSpeed, 0, 2, 1, 3); AddTextPrinterParameterized2(0, FONT_NORMAL, sMessages[MSG_NO_BERRIES], game->textSpeed, 0, 2, 1, 3);
else else
AddTextPrinterParameterized2(0, FONT_NORMAL, sMessages[MSG_DROPPED], game->textSpeed, 0, 2, 1, 3); AddTextPrinterParameterized2(0, FONT_NORMAL, sMessages[MSG_DROPPED], game->textSpeed, 0, 2, 1, 3);
CopyWindowToVram(0, 3); CopyWindowToVram(0, COPYWIN_FULL);
break; break;
case 1: case 1:
if (IsTextPrinterActive(0)) if (IsTextPrinterActive(0))
+13 -13
View File
@@ -290,10 +290,10 @@ static void BerryFix_GpuSet(void)
ResetBgsAndClearDma3BusyFlags(0); ResetBgsAndClearDma3BusyFlags(0);
InitBgsFromTemplates(0, sBerryFixBgTemplates, ARRAY_COUNT(sBerryFixBgTemplates)); InitBgsFromTemplates(0, sBerryFixBgTemplates, ARRAY_COUNT(sBerryFixBgTemplates));
ChangeBgX(0, 0, 0); ChangeBgX(0, 0, BG_COORD_SET);
ChangeBgY(0, 0, 0); ChangeBgY(0, 0, BG_COORD_SET);
ChangeBgX(1, 0, 0); ChangeBgX(1, 0, BG_COORD_SET);
ChangeBgY(1, 0, 0); ChangeBgY(1, 0, BG_COORD_SET);
InitWindows(sBerryFixWindowTemplates); InitWindows(sBerryFixWindowTemplates);
DeactivateAllTextPrinters(); DeactivateAllTextPrinters();
@@ -305,23 +305,23 @@ static void BerryFix_GpuSet(void)
width = GetStringWidth(FONT_SMALL, sText_Emerald, 0); width = GetStringWidth(FONT_SMALL, sText_Emerald, 0);
left = (120 - width) / 2; left = (120 - width) / 2;
AddTextPrinterParameterized3(2, FONT_SMALL, left, 3, sGameTitleTextColors, TEXT_SPEED_FF, sText_Emerald); AddTextPrinterParameterized3(2, FONT_SMALL, left, 3, sGameTitleTextColors, TEXT_SKIP_DRAW, sText_Emerald);
width = GetStringWidth(FONT_SMALL, sText_RubySapphire, 0); width = GetStringWidth(FONT_SMALL, sText_RubySapphire, 0);
left = (120 - width) / 2 + 120; left = (120 - width) / 2 + 120;
AddTextPrinterParameterized3(2, FONT_SMALL, left, 3, sGameTitleTextColors, TEXT_SPEED_FF, sText_RubySapphire); AddTextPrinterParameterized3(2, FONT_SMALL, left, 3, sGameTitleTextColors, TEXT_SKIP_DRAW, sText_RubySapphire);
width = GetStringWidth(FONT_SMALL, sText_RubySapphire, 0); width = GetStringWidth(FONT_SMALL, sText_RubySapphire, 0);
left = (112 - width) / 2; left = (112 - width) / 2;
AddTextPrinterParameterized3(3, FONT_SMALL, left, 0, sGameTitleTextColors, TEXT_SPEED_FF, sText_RubySapphire); AddTextPrinterParameterized3(3, FONT_SMALL, left, 0, sGameTitleTextColors, TEXT_SKIP_DRAW, sText_RubySapphire);
width = GetStringWidth(FONT_NORMAL, sText_BerryProgramUpdate, 0); width = GetStringWidth(FONT_NORMAL, sText_BerryProgramUpdate, 0);
left = (208 - width) / 2; left = (208 - width) / 2;
AddTextPrinterParameterized3(0, FONT_NORMAL, left, 2, sBerryProgramTextColors, TEXT_SPEED_FF, sText_BerryProgramUpdate); AddTextPrinterParameterized3(0, FONT_NORMAL, left, 2, sBerryProgramTextColors, TEXT_SKIP_DRAW, sText_BerryProgramUpdate);
CopyWindowToVram(2, 2); CopyWindowToVram(2, COPYWIN_GFX);
CopyWindowToVram(3, 2); CopyWindowToVram(3, COPYWIN_GFX);
CopyWindowToVram(0, 2); CopyWindowToVram(0, COPYWIN_GFX);
} }
static int BerryFix_TrySetScene(int scene) static int BerryFix_TrySetScene(int scene)
@@ -346,9 +346,9 @@ static void BerryFix_SetScene(int scene)
{ {
FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 32, 32); FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 32, 32);
FillWindowPixelBuffer(1, PIXEL_FILL(10)); FillWindowPixelBuffer(1, PIXEL_FILL(10));
AddTextPrinterParameterized3(1, FONT_NORMAL, 0, 0, sBerryProgramTextColors, -1, sBerryProgramTexts[scene]); AddTextPrinterParameterized3(1, FONT_NORMAL, 0, 0, sBerryProgramTextColors, TEXT_SKIP_DRAW, sBerryProgramTexts[scene]);
PutWindowTilemap(1); PutWindowTilemap(1);
CopyWindowToVram(1, 2); CopyWindowToVram(1, COPYWIN_GFX);
switch (scene) switch (scene)
{ {
case SCENE_ENSURE_CONNECT: case SCENE_ENSURE_CONNECT:
+1 -1
View File
@@ -211,7 +211,7 @@ static void PrintBerryPowderAmount(u8 windowId, int amount, u8 x, u8 y, u8 speed
static void DrawPlayerPowderAmount(u8 windowId, u16 baseTileOffset, u8 paletteNum, u32 amount) static void DrawPlayerPowderAmount(u8 windowId, u16 baseTileOffset, u8 paletteNum, u32 amount)
{ {
DrawStdFrameWithCustomTileAndPalette(windowId, FALSE, baseTileOffset, paletteNum); DrawStdFrameWithCustomTileAndPalette(windowId, FALSE, baseTileOffset, paletteNum);
AddTextPrinterParameterized(windowId, FONT_NORMAL, gText_Powder, 0, 1, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(windowId, FONT_NORMAL, gText_Powder, 0, 1, TEXT_SKIP_DRAW, NULL);
PrintBerryPowderAmount(windowId, amount, 26, 17, 0); PrintBerryPowderAmount(windowId, amount, 26, 17, 0);
} }
+2 -2
View File
@@ -409,7 +409,7 @@ static void PrintBerryNumberAndName(void)
static void PrintBerrySize(void) static void PrintBerrySize(void)
{ {
const struct Berry *berry = GetBerryInfo(sBerryTag->berryId); const struct Berry *berry = GetBerryInfo(sBerryTag->berryId);
AddTextPrinterParameterized(WIN_SIZE_FIRM, FONT_NORMAL, gText_SizeSlash, 0, 1, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(WIN_SIZE_FIRM, FONT_NORMAL, gText_SizeSlash, 0, 1, TEXT_SKIP_DRAW, NULL);
if (berry->size != 0) if (berry->size != 0)
{ {
u32 inches, fraction; u32 inches, fraction;
@@ -434,7 +434,7 @@ static void PrintBerrySize(void)
static void PrintBerryFirmness(void) static void PrintBerryFirmness(void)
{ {
const struct Berry *berry = GetBerryInfo(sBerryTag->berryId); const struct Berry *berry = GetBerryInfo(sBerryTag->berryId);
AddTextPrinterParameterized(WIN_SIZE_FIRM, FONT_NORMAL, gText_FirmSlash, 0, 0x11, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(WIN_SIZE_FIRM, FONT_NORMAL, gText_FirmSlash, 0, 0x11, TEXT_SKIP_DRAW, NULL);
if (berry->firmness != 0) if (berry->firmness != 0)
AddTextPrinterParameterized(WIN_SIZE_FIRM, FONT_NORMAL, sBerryFirmnessStrings[berry->firmness - 1], 0x28, 0x11, 0, NULL); AddTextPrinterParameterized(WIN_SIZE_FIRM, FONT_NORMAL, sBerryFirmnessStrings[berry->firmness - 1], 0x28, 0x11, 0, NULL);
else else
+153 -166
View File
@@ -21,187 +21,174 @@ u16 FontFunc_Braille(struct TextPrinter *textPrinter)
switch (textPrinter->state) switch (textPrinter->state)
{ {
case 0: case RENDER_STATE_HANDLE_CHAR:
if (JOY_HELD(A_BUTTON | B_BUTTON) && subStruct->hasPrintBeenSpedUp) if (JOY_HELD(A_BUTTON | B_BUTTON) && subStruct->hasPrintBeenSpedUp)
{
textPrinter->delayCounter = 0;
}
if (textPrinter->delayCounter && textPrinter->textSpeed)
{
textPrinter->delayCounter --;
if (gTextFlags.canABSpeedUpPrint && JOY_NEW(A_BUTTON | B_BUTTON))
{ {
subStruct->hasPrintBeenSpedUp = TRUE;
textPrinter->delayCounter = 0; textPrinter->delayCounter = 0;
} }
if (textPrinter->delayCounter && textPrinter->textSpeed) return RENDER_UPDATE;
{ }
textPrinter->delayCounter --; if (gTextFlags.autoScroll)
if (gTextFlags.canABSpeedUpPrint && JOY_NEW(A_BUTTON | B_BUTTON)) textPrinter->delayCounter = 3;
{ else
subStruct->hasPrintBeenSpedUp = TRUE; textPrinter->delayCounter = textPrinter->textSpeed;
textPrinter->delayCounter = 0;
} char_ = *textPrinter->printerTemplate.currentChar++;
return 3; switch (char_)
} {
if (gTextFlags.autoScroll) case EOS:
{ return RENDER_FINISH;
textPrinter->delayCounter = 3; case CHAR_NEWLINE:
} textPrinter->printerTemplate.currentX = textPrinter->printerTemplate.x;
else textPrinter->printerTemplate.currentY += gFonts[textPrinter->printerTemplate.fontId].maxLetterHeight + textPrinter->printerTemplate.lineSpacing;
{ return RENDER_REPEAT;
textPrinter->delayCounter = textPrinter->textSpeed; case PLACEHOLDER_BEGIN:
} textPrinter->printerTemplate.currentChar++;
return RENDER_REPEAT;
case EXT_CTRL_CODE_BEGIN:
char_ = *textPrinter->printerTemplate.currentChar++; char_ = *textPrinter->printerTemplate.currentChar++;
switch (char_) switch (char_)
{ {
case EOS: case EXT_CTRL_CODE_COLOR:
return 1; textPrinter->printerTemplate.fgColor = *textPrinter->printerTemplate.currentChar++;
case CHAR_NEWLINE: GenerateFontHalfRowLookupTable(textPrinter->printerTemplate.fgColor, textPrinter->printerTemplate.bgColor, textPrinter->printerTemplate.shadowColor);
textPrinter->printerTemplate.currentX = textPrinter->printerTemplate.x; return RENDER_REPEAT;
textPrinter->printerTemplate.currentY += gFonts[textPrinter->printerTemplate.fontId].maxLetterHeight + textPrinter->printerTemplate.lineSpacing; case EXT_CTRL_CODE_HIGHLIGHT:
return 2; textPrinter->printerTemplate.bgColor = *textPrinter->printerTemplate.currentChar++;
case PLACEHOLDER_BEGIN: GenerateFontHalfRowLookupTable(textPrinter->printerTemplate.fgColor, textPrinter->printerTemplate.bgColor, textPrinter->printerTemplate.shadowColor);
textPrinter->printerTemplate.currentChar++; return RENDER_REPEAT;
return 2; case EXT_CTRL_CODE_SHADOW:
case EXT_CTRL_CODE_BEGIN: textPrinter->printerTemplate.shadowColor = *textPrinter->printerTemplate.currentChar++;
char_ = *textPrinter->printerTemplate.currentChar++; GenerateFontHalfRowLookupTable(textPrinter->printerTemplate.fgColor, textPrinter->printerTemplate.bgColor, textPrinter->printerTemplate.shadowColor);
switch (char_) return RENDER_REPEAT;
{ case EXT_CTRL_CODE_COLOR_HIGHLIGHT_SHADOW:
case EXT_CTRL_CODE_COLOR: textPrinter->printerTemplate.fgColor = *textPrinter->printerTemplate.currentChar;
textPrinter->printerTemplate.fgColor = *textPrinter->printerTemplate.currentChar++; textPrinter->printerTemplate.bgColor = *++textPrinter->printerTemplate.currentChar;
GenerateFontHalfRowLookupTable(textPrinter->printerTemplate.fgColor, textPrinter->printerTemplate.bgColor, textPrinter->printerTemplate.shadowColor); textPrinter->printerTemplate.shadowColor = *++textPrinter->printerTemplate.currentChar;
return 2; textPrinter->printerTemplate.currentChar++;
case EXT_CTRL_CODE_HIGHLIGHT:
textPrinter->printerTemplate.bgColor = *textPrinter->printerTemplate.currentChar++;
GenerateFontHalfRowLookupTable(textPrinter->printerTemplate.fgColor, textPrinter->printerTemplate.bgColor, textPrinter->printerTemplate.shadowColor);
return 2;
case EXT_CTRL_CODE_SHADOW:
textPrinter->printerTemplate.shadowColor = *textPrinter->printerTemplate.currentChar++;
GenerateFontHalfRowLookupTable(textPrinter->printerTemplate.fgColor, textPrinter->printerTemplate.bgColor, textPrinter->printerTemplate.shadowColor);
return 2;
case EXT_CTRL_CODE_COLOR_HIGHLIGHT_SHADOW:
textPrinter->printerTemplate.fgColor = *textPrinter->printerTemplate.currentChar;
textPrinter->printerTemplate.bgColor = *++textPrinter->printerTemplate.currentChar;
textPrinter->printerTemplate.shadowColor = *++textPrinter->printerTemplate.currentChar;
textPrinter->printerTemplate.currentChar++;
GenerateFontHalfRowLookupTable(textPrinter->printerTemplate.fgColor, textPrinter->printerTemplate.bgColor, textPrinter->printerTemplate.shadowColor); GenerateFontHalfRowLookupTable(textPrinter->printerTemplate.fgColor, textPrinter->printerTemplate.bgColor, textPrinter->printerTemplate.shadowColor);
return 2; return RENDER_REPEAT;
case EXT_CTRL_CODE_PALETTE: case EXT_CTRL_CODE_PALETTE:
textPrinter->printerTemplate.currentChar++; textPrinter->printerTemplate.currentChar++;
return 2; return RENDER_REPEAT;
case EXT_CTRL_CODE_FONT: case EXT_CTRL_CODE_FONT:
subStruct->fontId = *textPrinter->printerTemplate.currentChar; subStruct->fontId = *textPrinter->printerTemplate.currentChar;
textPrinter->printerTemplate.currentChar++; textPrinter->printerTemplate.currentChar++;
return 2; return RENDER_REPEAT;
case EXT_CTRL_CODE_RESET_SIZE: case EXT_CTRL_CODE_RESET_SIZE:
return 2; return RENDER_REPEAT;
case EXT_CTRL_CODE_PAUSE: case EXT_CTRL_CODE_PAUSE:
textPrinter->delayCounter = *textPrinter->printerTemplate.currentChar++; textPrinter->delayCounter = *textPrinter->printerTemplate.currentChar++;
textPrinter->state = 6; textPrinter->state = RENDER_STATE_PAUSE;
return 2; return RENDER_REPEAT;
case EXT_CTRL_CODE_PAUSE_UNTIL_PRESS: case EXT_CTRL_CODE_PAUSE_UNTIL_PRESS:
textPrinter->state = 1; textPrinter->state = RENDER_STATE_WAIT;
if (gTextFlags.autoScroll) if (gTextFlags.autoScroll)
{ subStruct->autoScrollDelay = 0;
subStruct->autoScrollDelay = 0; return RENDER_UPDATE;
} case EXT_CTRL_CODE_WAIT_SE:
return 3; textPrinter->state = RENDER_STATE_WAIT_SE;
case EXT_CTRL_CODE_WAIT_SE: return RENDER_UPDATE;
textPrinter->state = 5; case EXT_CTRL_CODE_PLAY_BGM:
return 3; case EXT_CTRL_CODE_PLAY_SE:
case EXT_CTRL_CODE_PLAY_BGM: textPrinter->printerTemplate.currentChar += 2;
case EXT_CTRL_CODE_PLAY_SE: return RENDER_REPEAT;
textPrinter->printerTemplate.currentChar += 2; case EXT_CTRL_CODE_ESCAPE:
return 2; char_ = *++textPrinter->printerTemplate.currentChar;
case EXT_CTRL_CODE_ESCAPE: break;
char_ = *++textPrinter->printerTemplate.currentChar; case EXT_CTRL_CODE_SHIFT_TEXT:
break; textPrinter->printerTemplate.currentX = textPrinter->printerTemplate.x + *textPrinter->printerTemplate.currentChar++;
case EXT_CTRL_CODE_SHIFT_TEXT: return RENDER_REPEAT;
textPrinter->printerTemplate.currentX = textPrinter->printerTemplate.x + *textPrinter->printerTemplate.currentChar++; case EXT_CTRL_CODE_SHIFT_DOWN:
return 2; textPrinter->printerTemplate.currentY = textPrinter->printerTemplate.y + *textPrinter->printerTemplate.currentChar++;
case EXT_CTRL_CODE_SHIFT_DOWN: return RENDER_REPEAT;
textPrinter->printerTemplate.currentY = textPrinter->printerTemplate.y + *textPrinter->printerTemplate.currentChar++; case EXT_CTRL_CODE_FILL_WINDOW:
return 2;
case EXT_CTRL_CODE_FILL_WINDOW:
FillWindowPixelBuffer(textPrinter->printerTemplate.windowId, PIXEL_FILL(textPrinter->printerTemplate.bgColor));
return 2;
}
break;
case CHAR_PROMPT_CLEAR:
textPrinter->state = 2;
TextPrinterInitDownArrowCounters(textPrinter);
return 3;
case CHAR_PROMPT_SCROLL:
textPrinter->state = 3;
TextPrinterInitDownArrowCounters(textPrinter);
return 3;
case CHAR_EXTRA_SYMBOL:
char_ = *textPrinter->printerTemplate.currentChar++| 0x100;
break;
case CHAR_KEYPAD_ICON:
textPrinter->printerTemplate.currentChar++;
return 0;
}
DecompressGlyph_Braille(char_);
CopyGlyphToWindow(textPrinter);
textPrinter->printerTemplate.currentX += gCurGlyph.width + textPrinter->printerTemplate.letterSpacing;
return 0;
case 1:
if (TextPrinterWait(textPrinter))
{
textPrinter->state = 0;
}
return 3;
case 2:
if (TextPrinterWaitWithDownArrow(textPrinter))
{
FillWindowPixelBuffer(textPrinter->printerTemplate.windowId, PIXEL_FILL(textPrinter->printerTemplate.bgColor)); FillWindowPixelBuffer(textPrinter->printerTemplate.windowId, PIXEL_FILL(textPrinter->printerTemplate.bgColor));
textPrinter->printerTemplate.currentX = textPrinter->printerTemplate.x; return RENDER_REPEAT;
textPrinter->printerTemplate.currentY = textPrinter->printerTemplate.y;
textPrinter->state = 0;
} }
return 3; break;
case 3: case CHAR_PROMPT_CLEAR:
if (TextPrinterWaitWithDownArrow(textPrinter)) textPrinter->state = RENDER_STATE_CLEAR;
TextPrinterInitDownArrowCounters(textPrinter);
return RENDER_UPDATE;
case CHAR_PROMPT_SCROLL:
textPrinter->state = RENDER_STATE_SCROLL_START;
TextPrinterInitDownArrowCounters(textPrinter);
return RENDER_UPDATE;
case CHAR_EXTRA_SYMBOL:
char_ = *textPrinter->printerTemplate.currentChar++| 0x100;
break;
case CHAR_KEYPAD_ICON:
textPrinter->printerTemplate.currentChar++;
return RENDER_PRINT;
}
DecompressGlyph_Braille(char_);
CopyGlyphToWindow(textPrinter);
textPrinter->printerTemplate.currentX += gCurGlyph.width + textPrinter->printerTemplate.letterSpacing;
return RENDER_PRINT;
case RENDER_STATE_WAIT:
if (TextPrinterWait(textPrinter))
textPrinter->state = RENDER_STATE_HANDLE_CHAR;
return RENDER_UPDATE;
case RENDER_STATE_CLEAR:
if (TextPrinterWaitWithDownArrow(textPrinter))
{
FillWindowPixelBuffer(textPrinter->printerTemplate.windowId, PIXEL_FILL(textPrinter->printerTemplate.bgColor));
textPrinter->printerTemplate.currentX = textPrinter->printerTemplate.x;
textPrinter->printerTemplate.currentY = textPrinter->printerTemplate.y;
textPrinter->state = RENDER_STATE_HANDLE_CHAR;
}
return RENDER_UPDATE;
case RENDER_STATE_SCROLL_START:
if (TextPrinterWaitWithDownArrow(textPrinter))
{
TextPrinterClearDownArrow(textPrinter);
textPrinter->scrollDistance = gFonts[textPrinter->printerTemplate.fontId].maxLetterHeight + textPrinter->printerTemplate.lineSpacing;
textPrinter->printerTemplate.currentX = textPrinter->printerTemplate.x;
textPrinter->state = RENDER_STATE_SCROLL;
}
return RENDER_UPDATE;
case RENDER_STATE_SCROLL:
if (textPrinter->scrollDistance)
{
if (textPrinter->scrollDistance < sScrollDistances[gSaveBlock2Ptr->optionsTextSpeed])
{ {
TextPrinterClearDownArrow(textPrinter); ScrollWindow(textPrinter->printerTemplate.windowId, 0, textPrinter->scrollDistance, PIXEL_FILL(textPrinter->printerTemplate.bgColor));
textPrinter->scrollDistance = gFonts[textPrinter->printerTemplate.fontId].maxLetterHeight + textPrinter->printerTemplate.lineSpacing; textPrinter->scrollDistance = 0;
textPrinter->printerTemplate.currentX = textPrinter->printerTemplate.x;
textPrinter->state = 4;
}
return 3;
case 4:
if (textPrinter->scrollDistance)
{
if (textPrinter->scrollDistance < sScrollDistances[gSaveBlock2Ptr->optionsTextSpeed])
{
ScrollWindow(textPrinter->printerTemplate.windowId, 0, textPrinter->scrollDistance, PIXEL_FILL(textPrinter->printerTemplate.bgColor));
textPrinter->scrollDistance = 0;
}
else
{
ScrollWindow(textPrinter->printerTemplate.windowId, 0, sScrollDistances[gSaveBlock2Ptr->optionsTextSpeed], PIXEL_FILL(textPrinter->printerTemplate.bgColor));
textPrinter->scrollDistance -= sScrollDistances[gSaveBlock2Ptr->optionsTextSpeed];
}
CopyWindowToVram(textPrinter->printerTemplate.windowId, 2);
} }
else else
{ {
textPrinter->state = 0; ScrollWindow(textPrinter->printerTemplate.windowId, 0, sScrollDistances[gSaveBlock2Ptr->optionsTextSpeed], PIXEL_FILL(textPrinter->printerTemplate.bgColor));
textPrinter->scrollDistance -= sScrollDistances[gSaveBlock2Ptr->optionsTextSpeed];
} }
return 3; CopyWindowToVram(textPrinter->printerTemplate.windowId, COPYWIN_GFX);
case 5: }
if (!IsSEPlaying()) else
{ {
textPrinter->state = 0; textPrinter->state = RENDER_STATE_HANDLE_CHAR;
} }
return 3; return RENDER_UPDATE;
case 6: case RENDER_STATE_WAIT_SE:
if (textPrinter->delayCounter) if (!IsSEPlaying())
{ textPrinter->state = RENDER_STATE_HANDLE_CHAR;
textPrinter->delayCounter --; return RENDER_UPDATE;
} case RENDER_STATE_PAUSE:
else if (textPrinter->delayCounter)
{ textPrinter->delayCounter --;
textPrinter->state = 0; else
} textPrinter->state = RENDER_STATE_HANDLE_CHAR;
return 3; return RENDER_UPDATE;
} }
return 1; return RENDER_FINISH;
} }
static void DecompressGlyph_Braille(u16 glyph) static void DecompressGlyph_Braille(u16 glyph)
+5 -5
View File
@@ -100,16 +100,16 @@ static void PrintNumPlayersInLink(u16 windowId, u32 numPlayers)
SetStandardWindowBorderStyle(windowId, 0); SetStandardWindowBorderStyle(windowId, 0);
StringExpandPlaceholders(gStringVar4, gText_NumPlayerLink); StringExpandPlaceholders(gStringVar4, gText_NumPlayerLink);
xPos = GetStringCenterAlignXOffset(FONT_NORMAL, gStringVar4, 88); xPos = GetStringCenterAlignXOffset(FONT_NORMAL, gStringVar4, 88);
AddTextPrinterParameterized(windowId, FONT_NORMAL, gStringVar4, xPos, 1, 0xFF, NULL); AddTextPrinterParameterized(windowId, FONT_NORMAL, gStringVar4, xPos, 1, TEXT_SKIP_DRAW, NULL);
CopyWindowToVram(windowId, 3); CopyWindowToVram(windowId, COPYWIN_FULL);
} }
static void ClearLinkPlayerCountWindow(u16 windowId) static void ClearLinkPlayerCountWindow(u16 windowId)
{ {
// Following this call with a copy-to-vram with mode 3 is identical to // Following this call with a copy-to-vram with mode COPYWIN_FULL is identical to
// calling ClearStdWindowAndFrame(windowId, TRUE). // calling ClearStdWindowAndFrame(windowId, TRUE).
ClearStdWindowAndFrame(windowId, FALSE); ClearStdWindowAndFrame(windowId, FALSE);
CopyWindowToVram(windowId, 3); CopyWindowToVram(windowId, COPYWIN_FULL);
} }
static void UpdateLinkPlayerCountDisplay(u8 taskId, u8 numPlayers) static void UpdateLinkPlayerCountDisplay(u8 taskId, u8 numPlayers)
@@ -1078,7 +1078,7 @@ static void Task_EnterCableClubSeat(u8 taskId)
case 3: case 3:
// Exit, failure // Exit, failure
SetLinkWaitingForScript(); SetLinkWaitingForScript();
sub_8197AE8(TRUE); EraseFieldMessageBox(TRUE);
DestroyTask(taskId); DestroyTask(taskId);
EnableBothScriptContexts(); EnableBothScriptContexts();
break; break;
+2 -2
View File
@@ -1667,7 +1667,7 @@ static void Task_HideMoveSelectScreen(u8 taskId)
{ {
FillWindowPixelBuffer(MOVE_WINDOWS_START + i, PIXEL_FILL(0)); FillWindowPixelBuffer(MOVE_WINDOWS_START + i, PIXEL_FILL(0));
PutWindowTilemap(MOVE_WINDOWS_START + i); PutWindowTilemap(MOVE_WINDOWS_START + i);
CopyWindowToVram(MOVE_WINDOWS_START + i, 2); CopyWindowToVram(MOVE_WINDOWS_START + i, COPYWIN_GFX);
} }
Contest_SetBgCopyFlags(0); Contest_SetBgCopyFlags(0);
// This seems to be a bug; it should have just copied PLTT_BUFFER_SIZE. // This seems to be a bug; it should have just copied PLTT_BUFFER_SIZE.
@@ -3377,7 +3377,7 @@ static void DrawStatusSymbols(void)
static void ContestClearGeneralTextWindow(void) static void ContestClearGeneralTextWindow(void)
{ {
FillWindowPixelBuffer(WIN_GENERAL_TEXT, PIXEL_FILL(0)); FillWindowPixelBuffer(WIN_GENERAL_TEXT, PIXEL_FILL(0));
CopyWindowToVram(WIN_GENERAL_TEXT, 2); CopyWindowToVram(WIN_GENERAL_TEXT, COPYWIN_GFX);
Contest_SetBgCopyFlags(0); Contest_SetBgCopyFlags(0);
} }
+3 -3
View File
@@ -267,14 +267,14 @@ static void InitContestPaintingWindow(void)
{ {
ResetBgsAndClearDma3BusyFlags(0); ResetBgsAndClearDma3BusyFlags(0);
InitBgsFromTemplates(0, sBgTemplates, ARRAY_COUNT(sBgTemplates)); InitBgsFromTemplates(0, sBgTemplates, ARRAY_COUNT(sBgTemplates));
ChangeBgX(1, 0, 0); ChangeBgX(1, 0, BG_COORD_SET);
ChangeBgY(1, 0, 0); ChangeBgY(1, 0, BG_COORD_SET);
SetBgTilemapBuffer(1, AllocZeroed(BG_SCREEN_SIZE)); SetBgTilemapBuffer(1, AllocZeroed(BG_SCREEN_SIZE));
sWindowId = AddWindow(&sWindowTemplate); sWindowId = AddWindow(&sWindowTemplate);
DeactivateAllTextPrinters(); DeactivateAllTextPrinters();
FillWindowPixelBuffer(sWindowId, PIXEL_FILL(0)); FillWindowPixelBuffer(sWindowId, PIXEL_FILL(0));
PutWindowTilemap(sWindowId); PutWindowTilemap(sWindowId);
CopyWindowToVram(sWindowId, 3); CopyWindowToVram(sWindowId, COPYWIN_FULL);
ShowBg(1); ShowBg(1);
} }
+1 -1
View File
@@ -1181,7 +1181,7 @@ static s32 DrawResultsTextWindow(const u8 *text, u8 spriteId)
if (strWidth > 30) if (strWidth > 30)
strWidth = 30; strWidth = 30;
AddTextPrinterParameterized3(windowId, FONT_NORMAL, (strWidth * 8 - origWidth) / 2, 1, sContestLinkTextColors, -1, text); AddTextPrinterParameterized3(windowId, FONT_NORMAL, (strWidth * 8 - origWidth) / 2, 1, sContestLinkTextColors, TEXT_SKIP_DRAW, text);
{ {
s32 i; s32 i;
struct Sprite *sprite; struct Sprite *sprite;
+4 -4
View File
@@ -369,7 +369,7 @@ static void InitCreditsBgsAndWindows(void)
InitWindows(sWindowTemplates); InitWindows(sWindowTemplates);
DeactivateAllTextPrinters(); DeactivateAllTextPrinters();
PutWindowTilemap(0); PutWindowTilemap(0);
CopyWindowToVram(0, 3); CopyWindowToVram(0, COPYWIN_FULL);
ShowBg(0); ShowBg(0);
} }
@@ -401,7 +401,7 @@ static void PrintCreditsText(const u8 *string, u8 y, bool8 isTitle)
} }
x = GetStringCenterAlignXOffsetWithLetterSpacing(FONT_NORMAL, string, DISPLAY_WIDTH, 1); x = GetStringCenterAlignXOffsetWithLetterSpacing(FONT_NORMAL, string, DISPLAY_WIDTH, 1);
AddTextPrinterParameterized4(0, FONT_NORMAL, x, y, 1, 0, color, -1, string); AddTextPrinterParameterized4(0, FONT_NORMAL, x, y, 1, 0, color, TEXT_SKIP_DRAW, string);
} }
#define tMainTaskId data[1] #define tMainTaskId data[1]
@@ -761,7 +761,7 @@ static void Task_UpdatePage(u8 taskId)
sCreditsEntryPointerTable[gTasks[taskId].tCurrentPage][i]->text, sCreditsEntryPointerTable[gTasks[taskId].tCurrentPage][i]->text,
5 + i * 16, 5 + i * 16,
sCreditsEntryPointerTable[gTasks[taskId].tCurrentPage][i]->isTitle); sCreditsEntryPointerTable[gTasks[taskId].tCurrentPage][i]->isTitle);
CopyWindowToVram(0, 2); CopyWindowToVram(0, COPYWIN_GFX);
gTasks[taskId].tCurrentPage++; gTasks[taskId].tCurrentPage++;
gTasks[taskId].tState++; gTasks[taskId].tState++;
@@ -811,7 +811,7 @@ static void Task_UpdatePage(u8 taskId)
{ {
// Still more Credits pages to show, return to state 2 to print // Still more Credits pages to show, return to state 2 to print
FillWindowPixelBuffer(0, PIXEL_FILL(0)); FillWindowPixelBuffer(0, PIXEL_FILL(0));
CopyWindowToVram(0, 2); CopyWindowToVram(0, COPYWIN_GFX);
gTasks[taskId].tState = 2; gTasks[taskId].tState = 2;
} }
return; return;
+2 -2
View File
@@ -1199,7 +1199,7 @@ static void DaycareAddTextPrinter(u8 windowId, const u8 *text, u32 x, u32 y)
printer.bgColor = 1; printer.bgColor = 1;
printer.shadowColor = 3; printer.shadowColor = 3;
AddTextPrinter(&printer, 0xFF, NULL); AddTextPrinter(&printer, TEXT_SKIP_DRAW, NULL);
} }
static void DaycarePrintMonNickname(struct DayCare *daycare, u8 windowId, u32 daycareSlotId, u32 y) static void DaycarePrintMonNickname(struct DayCare *daycare, u8 windowId, u32 daycareSlotId, u32 y)
@@ -1285,7 +1285,7 @@ void ShowDaycareLevelMenu(void)
menuTemplate.windowId = windowId; menuTemplate.windowId = windowId;
listMenuTaskId = ListMenuInit(&menuTemplate, 0, 0); listMenuTaskId = ListMenuInit(&menuTemplate, 0, 0);
CopyWindowToVram(windowId, 3); CopyWindowToVram(windowId, COPYWIN_FULL);
daycareMenuTaskId = CreateTask(Task_HandleDaycareLevelMenuInput, 3); daycareMenuTaskId = CreateTask(Task_HandleDaycareLevelMenuInput, 3);
gTasks[daycareMenuTaskId].tMenuListTaskId = listMenuTaskId; gTasks[daycareMenuTaskId].tMenuListTaskId = listMenuTaskId;
+5 -5
View File
@@ -557,7 +557,7 @@ static void AddDecorationActionsWindow(void)
{ {
u8 windowId = AddDecorationWindow(WINDOW_MAIN_MENU); u8 windowId = AddDecorationWindow(WINDOW_MAIN_MENU);
PrintMenuTable(windowId, ARRAY_COUNT(sDecorationMainMenuActions), sDecorationMainMenuActions); PrintMenuTable(windowId, ARRAY_COUNT(sDecorationMainMenuActions), sDecorationMainMenuActions);
InitMenuInUpperLeftCornerPlaySoundWhenAPressed(windowId, ARRAY_COUNT(sDecorationMainMenuActions), sDecorationActionsCursorPos); InitMenuInUpperLeftCornerNormal(windowId, ARRAY_COUNT(sDecorationMainMenuActions), sDecorationActionsCursorPos);
} }
static void InitDecorationActionsWindow(void) static void InitDecorationActionsWindow(void)
@@ -697,7 +697,7 @@ static void InitDecorationCategoriesWindow(u8 taskId)
{ {
u8 windowId = AddDecorationWindow(WINDOW_DECORATION_CATEGORIES); u8 windowId = AddDecorationWindow(WINDOW_DECORATION_CATEGORIES);
PrintDecorationCategoryMenuItems(taskId); PrintDecorationCategoryMenuItems(taskId);
InitMenuInUpperLeftCornerPlaySoundWhenAPressed(windowId, DECORCAT_COUNT + 1, sCurDecorationCategory); InitMenuInUpperLeftCornerNormal(windowId, DECORCAT_COUNT + 1, sCurDecorationCategory);
gTasks[taskId].func = HandleDecorationCategoriesMenuInput; gTasks[taskId].func = HandleDecorationCategoriesMenuInput;
} }
@@ -705,7 +705,7 @@ static void ReinitDecorationCategoriesWindow(u8 taskId)
{ {
FillWindowPixelBuffer(sDecorMenuWindowIds[WINDOW_DECORATION_CATEGORIES], PIXEL_FILL(1)); FillWindowPixelBuffer(sDecorMenuWindowIds[WINDOW_DECORATION_CATEGORIES], PIXEL_FILL(1));
PrintDecorationCategoryMenuItems(taskId); PrintDecorationCategoryMenuItems(taskId);
InitMenuInUpperLeftCornerPlaySoundWhenAPressed(sDecorMenuWindowIds[WINDOW_DECORATION_CATEGORIES], DECORCAT_COUNT + 1, sCurDecorationCategory); InitMenuInUpperLeftCornerNormal(sDecorMenuWindowIds[WINDOW_DECORATION_CATEGORIES], DECORCAT_COUNT + 1, sCurDecorationCategory);
gTasks[taskId].func = HandleDecorationCategoriesMenuInput; gTasks[taskId].func = HandleDecorationCategoriesMenuInput;
} }
@@ -723,9 +723,9 @@ static void PrintDecorationCategoryMenuItems(u8 taskId)
{ {
// Only DOLL and CUSHION decorations are enabled when decorating the player's room. // Only DOLL and CUSHION decorations are enabled when decorating the player's room.
if (shouldDisable == TRUE && i != DECORCAT_DOLL && i != DECORCAT_CUSHION) if (shouldDisable == TRUE && i != DECORCAT_DOLL && i != DECORCAT_CUSHION)
PrintDecorationCategoryMenuItem(windowId, i, 8, i * 16, TRUE, TEXT_SPEED_FF); PrintDecorationCategoryMenuItem(windowId, i, 8, i * 16, TRUE, TEXT_SKIP_DRAW);
else else
PrintDecorationCategoryMenuItem(windowId, i, 8, i * 16, FALSE, TEXT_SPEED_FF); PrintDecorationCategoryMenuItem(windowId, i, 8, i * 16, FALSE, TEXT_SKIP_DRAW);
} }
AddTextPrinterParameterized(windowId, FONT_NORMAL, gTasks[taskId].tDecorationMenuCommand == DECOR_MENU_TRADE ? gText_Exit : gText_Cancel, 8, i * 16 + 1, 0, NULL); AddTextPrinterParameterized(windowId, FONT_NORMAL, gTasks[taskId].tDecorationMenuCommand == DECOR_MENU_TRADE ? gText_Exit : gText_Cancel, 8, i * 16 + 1, 0, NULL);
+2 -2
View File
@@ -140,7 +140,7 @@ static void DisplayDiplomaText(void)
StringExpandPlaceholders(gStringVar4, gText_PokedexDiploma); StringExpandPlaceholders(gStringVar4, gText_PokedexDiploma);
PrintDiplomaText(gStringVar4, 0, 1); PrintDiplomaText(gStringVar4, 0, 1);
PutWindowTilemap(0); PutWindowTilemap(0);
CopyWindowToVram(0, 3); CopyWindowToVram(0, COPYWIN_FULL);
} }
static const struct BgTemplate sDiplomaBgTemplates[2] = static const struct BgTemplate sDiplomaBgTemplates[2] =
@@ -205,5 +205,5 @@ static void PrintDiplomaText(u8 *text, u8 var1, u8 var2)
{ {
u8 color[3] = {0, 2, 3}; u8 color[3] = {0, 2, 3};
AddTextPrinterParameterized4(0, FONT_NORMAL, var1, var2, 0, 0, color, -1, text); AddTextPrinterParameterized4(0, FONT_NORMAL, var1, var2, 0, 0, color, TEXT_SKIP_DRAW, text);
} }
+57 -57
View File
@@ -1352,14 +1352,14 @@ static void ResetGame(void)
} }
break; break;
case 2: case 2:
ChangeBgX(0, 0, 0); ChangeBgX(0, 0, BG_COORD_SET);
ChangeBgY(0, 0, 0); ChangeBgY(0, 0, BG_COORD_SET);
ChangeBgX(1, 0, 0); ChangeBgX(1, 0, BG_COORD_SET);
ChangeBgY(1, 0, 0); ChangeBgY(1, 0, BG_COORD_SET);
ChangeBgX(2, 0, 0); ChangeBgX(2, 0, BG_COORD_SET);
ChangeBgY(2, 0, 0); ChangeBgY(2, 0, BG_COORD_SET);
ChangeBgX(3, 0, 0); ChangeBgX(3, 0, BG_COORD_SET);
ChangeBgY(3, 0, 0); ChangeBgY(3, 0, BG_COORD_SET);
sGame->state++; sGame->state++;
break; break;
case 3: case 3:
@@ -2968,7 +2968,7 @@ static void Task_ShowDodrioBerryPickingRecords(u8 taskId)
window.width = width; window.width = width;
tWindowId = AddWindow(&window); tWindowId = AddWindow(&window);
PrintRecordsText(tWindowId, width); PrintRecordsText(tWindowId, width);
CopyWindowToVram(tWindowId, 3); CopyWindowToVram(tWindowId, COPYWIN_FULL);
tState++; tState++;
break; break;
case 1: case 1:
@@ -2979,7 +2979,7 @@ static void Task_ShowDodrioBerryPickingRecords(u8 taskId)
if (JOY_NEW(A_BUTTON | B_BUTTON)) if (JOY_NEW(A_BUTTON | B_BUTTON))
{ {
rbox_fill_rectangle(tWindowId); rbox_fill_rectangle(tWindowId);
CopyWindowToVram(tWindowId, 1); CopyWindowToVram(tWindowId, COPYWIN_MAP);
tState++; tState++;
} }
break; break;
@@ -3008,14 +3008,14 @@ static void PrintRecordsText(u8 windowId, s32 width)
LoadUserWindowBorderGfx_(windowId, 0x21D, 0xD0); LoadUserWindowBorderGfx_(windowId, 0x21D, 0xD0);
DrawTextBorderOuter(windowId, 0x21D, 0xD); DrawTextBorderOuter(windowId, 0x21D, 0xD);
FillWindowPixelBuffer(windowId, PIXEL_FILL(1)); FillWindowPixelBuffer(windowId, PIXEL_FILL(1));
AddTextPrinterParameterized(windowId, FONT_NORMAL, gText_BerryPickingRecords, GetStringCenterAlignXOffset(FONT_NORMAL, gText_BerryPickingRecords, width * 8), 1, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(windowId, FONT_NORMAL, gText_BerryPickingRecords, GetStringCenterAlignXOffset(FONT_NORMAL, gText_BerryPickingRecords, width * 8), 1, TEXT_SKIP_DRAW, NULL);
for (i = 0; i < NUM_RECORD_TYPES; i++) for (i = 0; i < NUM_RECORD_TYPES; i++)
{ {
ConvertIntToDecimalStringN(gStringVar1, recordNums[i], STR_CONV_MODE_LEFT_ALIGN, sRecordNumMaxDigits[i]); ConvertIntToDecimalStringN(gStringVar1, recordNums[i], STR_CONV_MODE_LEFT_ALIGN, sRecordNumMaxDigits[i]);
numWidth = GetStringWidth(FONT_NORMAL, gStringVar1, -1); numWidth = GetStringWidth(FONT_NORMAL, gStringVar1, -1);
AddTextPrinterParameterized(windowId, FONT_NORMAL, sRecordsTexts[i], 0, sRecordTextYCoords[i][0], TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(windowId, FONT_NORMAL, sRecordsTexts[i], 0, sRecordTextYCoords[i][0], TEXT_SKIP_DRAW, NULL);
x = (width * 8) - numWidth; x = (width * 8) - numWidth;
AddTextPrinterParameterized(windowId, FONT_NORMAL, gStringVar1, x, sRecordNumYCoords[i][0], TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(windowId, FONT_NORMAL, gStringVar1, x, sRecordNumYCoords[i][0], TEXT_SKIP_DRAW, NULL);
} }
PutWindowTilemap(windowId); PutWindowTilemap(windowId);
} }
@@ -4649,8 +4649,8 @@ static void ShowNames(void)
if (playerId == GetMultiplayerId()) if (playerId == GetMultiplayerId())
colorsId = COLORID_BLUE; colorsId = COLORID_BLUE;
name = GetPlayerName(playerId); name = GetPlayerName(playerId);
AddTextPrinterParameterized3(sGfx->windowIds[i], FONT_NORMAL, left, 1, sTextColorTable[colorsId], -1, name); AddTextPrinterParameterized3(sGfx->windowIds[i], FONT_NORMAL, left, 1, sTextColorTable[colorsId], TEXT_SKIP_DRAW, name);
CopyWindowToVram(sGfx->windowIds[i], 2); CopyWindowToVram(sGfx->windowIds[i], COPYWIN_GFX);
window.baseBlock += 0xE; window.baseBlock += 0xE;
DrawMessageWindow(&window); DrawMessageWindow(&window);
} }
@@ -4733,15 +4733,15 @@ static void PrintRankedScores(u8 numPlayers_)
u8 playerId = playersByRanking[i]; u8 playerId = playersByRanking[i];
u32 points = scoreResults[playerId].score; u32 points = scoreResults[playerId].score;
AddTextPrinterParameterized(sGfx->windowIds[1], FONT_NORMAL, sRankingTexts[scoreResults[playerId].ranking], 8, sRankingYCoords[i], -1, NULL); AddTextPrinterParameterized(sGfx->windowIds[1], FONT_NORMAL, sRankingTexts[scoreResults[playerId].ranking], 8, sRankingYCoords[i], TEXT_SKIP_DRAW, NULL);
if (playerId == GetMultiplayerId()) if (playerId == GetMultiplayerId())
colorsId = COLORID_BLUE; colorsId = COLORID_BLUE;
name = GetPlayerName(playerId); name = GetPlayerName(playerId);
AddTextPrinterParameterized3(sGfx->windowIds[1], FONT_NORMAL, 28, sRankingYCoords[i], sTextColorTable[colorsId], -1, name); AddTextPrinterParameterized3(sGfx->windowIds[1], FONT_NORMAL, 28, sRankingYCoords[i], sTextColorTable[colorsId], TEXT_SKIP_DRAW, name);
ConvertIntToDecimalStringN(numString, points, STR_CONV_MODE_LEFT_ALIGN, 7); ConvertIntToDecimalStringN(numString, points, STR_CONV_MODE_LEFT_ALIGN, 7);
numWidth = GetStringWidth(FONT_NORMAL, numString, -1); numWidth = GetStringWidth(FONT_NORMAL, numString, -1);
AddTextPrinterParameterized(sGfx->windowIds[1], FONT_NORMAL, numString, x - numWidth, sRankingYCoords[i], -1, NULL); AddTextPrinterParameterized(sGfx->windowIds[1], FONT_NORMAL, numString, x - numWidth, sRankingYCoords[i], TEXT_SKIP_DRAW, NULL);
AddTextPrinterParameterized(sGfx->windowIds[1], FONT_NORMAL, gText_SpacePoints, x, sRankingYCoords[i], -1, NULL); AddTextPrinterParameterized(sGfx->windowIds[1], FONT_NORMAL, gText_SpacePoints, x, sRankingYCoords[i], TEXT_SKIP_DRAW, NULL);
} }
} }
@@ -4772,8 +4772,8 @@ static void ShowResults(void)
FillWindowPixelBuffer(sGfx->windowIds[1], PIXEL_FILL(1)); FillWindowPixelBuffer(sGfx->windowIds[1], PIXEL_FILL(1));
strWidth = GetStringWidth(FONT_NORMAL, gText_BerryPickingResults, -1); strWidth = GetStringWidth(FONT_NORMAL, gText_BerryPickingResults, -1);
x = (224 - strWidth) / 2; x = (224 - strWidth) / 2;
AddTextPrinterParameterized(sGfx->windowIds[0], FONT_NORMAL, gText_BerryPickingResults, x, 1, -1, NULL); AddTextPrinterParameterized(sGfx->windowIds[0], FONT_NORMAL, gText_BerryPickingResults, x, 1, TEXT_SKIP_DRAW, NULL);
AddTextPrinterParameterized(sGfx->windowIds[1], FONT_NORMAL, gText_10P30P50P50P, 68, 17, -1, NULL); AddTextPrinterParameterized(sGfx->windowIds[1], FONT_NORMAL, gText_10P30P50P50P, 68, 17, TEXT_SKIP_DRAW, NULL);
for (i = 0; i < numPlayers; i++) for (i = 0; i < numPlayers; i++)
{ {
u8 colorsId = COLORID_GRAY; u8 colorsId = COLORID_GRAY;
@@ -4781,7 +4781,7 @@ static void ShowResults(void)
colorsId = COLORID_BLUE; colorsId = COLORID_BLUE;
name = GetPlayerName(i); name = GetPlayerName(i);
AddTextPrinterParameterized3(sGfx->windowIds[1], FONT_NORMAL, 0, sResultsYCoords[i], sTextColorTable[colorsId], -1, name); AddTextPrinterParameterized3(sGfx->windowIds[1], FONT_NORMAL, 0, sResultsYCoords[i], sTextColorTable[colorsId], TEXT_SKIP_DRAW, name);
for (j = 0; j < 4; j++) for (j = 0; j < 4; j++)
{ {
u32 width; u32 width;
@@ -4793,13 +4793,13 @@ static void ShowResults(void)
// If player got the most of a berry type, highlight their number in red // If player got the most of a berry type, highlight their number in red
if (maxBerriesPicked == berriesPicked && maxBerriesPicked != 0) if (maxBerriesPicked == berriesPicked && maxBerriesPicked != 0)
AddTextPrinterParameterized3(sGfx->windowIds[1], FONT_NORMAL, sResultsXCoords[j] - width, sResultsYCoords[i], sTextColorTable[COLORID_RED], -1, gStringVar4); AddTextPrinterParameterized3(sGfx->windowIds[1], FONT_NORMAL, sResultsXCoords[j] - width, sResultsYCoords[i], sTextColorTable[COLORID_RED], TEXT_SKIP_DRAW, gStringVar4);
else else
AddTextPrinterParameterized(sGfx->windowIds[1], FONT_NORMAL, gStringVar4, sResultsXCoords[j] - width, sResultsYCoords[i], -1, NULL); AddTextPrinterParameterized(sGfx->windowIds[1], FONT_NORMAL, gStringVar4, sResultsXCoords[j] - width, sResultsYCoords[i], TEXT_SKIP_DRAW, NULL);
} }
} }
CopyWindowToVram(sGfx->windowIds[0], 2); CopyWindowToVram(sGfx->windowIds[0], COPYWIN_GFX);
CopyWindowToVram(sGfx->windowIds[1], 2); CopyWindowToVram(sGfx->windowIds[1], COPYWIN_GFX);
sGfx->state++; sGfx->state++;
break; break;
case 3: case 3:
@@ -4826,13 +4826,13 @@ static void ShowResults(void)
FillWindowPixelBuffer(sGfx->windowIds[1], PIXEL_FILL(1)); FillWindowPixelBuffer(sGfx->windowIds[1], PIXEL_FILL(1));
strWidth = GetStringWidth(FONT_NORMAL, gText_AnnouncingRankings, -1); strWidth = GetStringWidth(FONT_NORMAL, gText_AnnouncingRankings, -1);
x = (224 - strWidth) / 2; x = (224 - strWidth) / 2;
AddTextPrinterParameterized(sGfx->windowIds[0], FONT_NORMAL, gText_AnnouncingRankings, x, 1, -1, NULL); AddTextPrinterParameterized(sGfx->windowIds[0], FONT_NORMAL, gText_AnnouncingRankings, x, 1, TEXT_SKIP_DRAW, NULL);
sGfx->state++; sGfx->state++;
break; break;
case 6: case 6:
PrintRankedScores(numPlayers); PrintRankedScores(numPlayers);
CopyWindowToVram(sGfx->windowIds[0], 2); CopyWindowToVram(sGfx->windowIds[0], COPYWIN_GFX);
CopyWindowToVram(sGfx->windowIds[1], 2); CopyWindowToVram(sGfx->windowIds[1], COPYWIN_GFX);
sGfx->state++; sGfx->state++;
break; break;
case 7: case 7:
@@ -4872,12 +4872,12 @@ static void ShowResults(void)
FillWindowPixelBuffer(sGfx->windowIds[1], PIXEL_FILL(1)); FillWindowPixelBuffer(sGfx->windowIds[1], PIXEL_FILL(1));
strWidth = GetStringWidth(FONT_NORMAL, gText_AnnouncingPrizes, -1); strWidth = GetStringWidth(FONT_NORMAL, gText_AnnouncingPrizes, -1);
x = (224 - strWidth) / 2; x = (224 - strWidth) / 2;
AddTextPrinterParameterized(sGfx->windowIds[0], FONT_NORMAL, gText_AnnouncingPrizes, x, 1, -1, NULL); AddTextPrinterParameterized(sGfx->windowIds[0], FONT_NORMAL, gText_AnnouncingPrizes, x, 1, TEXT_SKIP_DRAW, NULL);
DynamicPlaceholderTextUtil_Reset(); DynamicPlaceholderTextUtil_Reset();
CopyItemName(GetPrizeItemId(), gStringVar1); CopyItemName(GetPrizeItemId(), gStringVar1);
DynamicPlaceholderTextUtil_SetPlaceholderPtr(0, gStringVar1); DynamicPlaceholderTextUtil_SetPlaceholderPtr(0, gStringVar1);
DynamicPlaceholderTextUtil_ExpandPlaceholders(gStringVar4, gText_FirstPlacePrize); DynamicPlaceholderTextUtil_ExpandPlaceholders(gStringVar4, gText_FirstPlacePrize);
AddTextPrinterParameterized(sGfx->windowIds[1], FONT_NORMAL, gStringVar4, 0, 1, -1, NULL); AddTextPrinterParameterized(sGfx->windowIds[1], FONT_NORMAL, gStringVar4, 0, 1, TEXT_SKIP_DRAW, NULL);
prizeState = TryGivePrize(); prizeState = TryGivePrize();
if (prizeState != PRIZE_RECEIVED && prizeState != NO_PRIZE) if (prizeState != PRIZE_RECEIVED && prizeState != NO_PRIZE)
{ {
@@ -4888,10 +4888,10 @@ static void ShowResults(void)
DynamicPlaceholderTextUtil_ExpandPlaceholders(gStringVar4, gText_CantHoldAnyMore); DynamicPlaceholderTextUtil_ExpandPlaceholders(gStringVar4, gText_CantHoldAnyMore);
else if (prizeState == PRIZE_FILLED_BAG) else if (prizeState == PRIZE_FILLED_BAG)
DynamicPlaceholderTextUtil_ExpandPlaceholders(gStringVar4, gText_FilledStorageSpace); DynamicPlaceholderTextUtil_ExpandPlaceholders(gStringVar4, gText_FilledStorageSpace);
AddTextPrinterParameterized(sGfx->windowIds[1], FONT_NORMAL, gStringVar4, 0, 41, -1, NULL); AddTextPrinterParameterized(sGfx->windowIds[1], FONT_NORMAL, gStringVar4, 0, 41, TEXT_SKIP_DRAW, NULL);
} }
CopyWindowToVram(sGfx->windowIds[0], 2); CopyWindowToVram(sGfx->windowIds[0], COPYWIN_GFX);
CopyWindowToVram(sGfx->windowIds[1], 2); CopyWindowToVram(sGfx->windowIds[1], COPYWIN_GFX);
sGfx->state++; sGfx->state++;
break; break;
case 10: case 10:
@@ -4946,12 +4946,12 @@ static void Msg_WantToPlayAgain(void)
// Print text // Print text
FillWindowPixelBuffer(sGfx->windowIds[WIN_PLAY_AGAIN], PIXEL_FILL(1)); FillWindowPixelBuffer(sGfx->windowIds[WIN_PLAY_AGAIN], PIXEL_FILL(1));
FillWindowPixelBuffer(sGfx->windowIds[WIN_YES_NO], PIXEL_FILL(1)); FillWindowPixelBuffer(sGfx->windowIds[WIN_YES_NO], PIXEL_FILL(1));
AddTextPrinterParameterized(sGfx->windowIds[WIN_PLAY_AGAIN], FONT_NORMAL, gText_WantToPlayAgain, 0, 5, -1, NULL); AddTextPrinterParameterized(sGfx->windowIds[WIN_PLAY_AGAIN], FONT_NORMAL, gText_WantToPlayAgain, 0, 5, TEXT_SKIP_DRAW, NULL);
AddTextPrinterParameterized(sGfx->windowIds[WIN_YES_NO], FONT_NORMAL, gText_Yes, 8, 1, -1, NULL); AddTextPrinterParameterized(sGfx->windowIds[WIN_YES_NO], FONT_NORMAL, gText_Yes, 8, 1, TEXT_SKIP_DRAW, NULL);
AddTextPrinterParameterized(sGfx->windowIds[WIN_YES_NO], FONT_NORMAL, gText_No, 8, 17, -1, NULL); AddTextPrinterParameterized(sGfx->windowIds[WIN_YES_NO], FONT_NORMAL, gText_No, 8, 17, TEXT_SKIP_DRAW, NULL);
AddTextPrinterParameterized(sGfx->windowIds[WIN_YES_NO], FONT_NORMAL, gText_SelectorArrow2, 0, 1, -1, NULL); AddTextPrinterParameterized(sGfx->windowIds[WIN_YES_NO], FONT_NORMAL, gText_SelectorArrow2, 0, 1, TEXT_SKIP_DRAW, NULL);
CopyWindowToVram(sGfx->windowIds[WIN_PLAY_AGAIN], 2); CopyWindowToVram(sGfx->windowIds[WIN_PLAY_AGAIN], COPYWIN_GFX);
CopyWindowToVram(sGfx->windowIds[WIN_YES_NO], 2); CopyWindowToVram(sGfx->windowIds[WIN_YES_NO], COPYWIN_GFX);
sGfx->state++; sGfx->state++;
break; break;
case 2: case 2:
@@ -4970,10 +4970,10 @@ static void Msg_WantToPlayAgain(void)
if (y == PLAY_AGAIN_NONE) if (y == PLAY_AGAIN_NONE)
y = PLAY_AGAIN_YES; y = PLAY_AGAIN_YES;
FillWindowPixelBuffer(sGfx->windowIds[WIN_YES_NO], PIXEL_FILL(1)); FillWindowPixelBuffer(sGfx->windowIds[WIN_YES_NO], PIXEL_FILL(1));
AddTextPrinterParameterized(sGfx->windowIds[WIN_YES_NO], FONT_NORMAL, gText_Yes, 8, 1, -1, NULL); AddTextPrinterParameterized(sGfx->windowIds[WIN_YES_NO], FONT_NORMAL, gText_Yes, 8, 1, TEXT_SKIP_DRAW, NULL);
AddTextPrinterParameterized(sGfx->windowIds[WIN_YES_NO], FONT_NORMAL, gText_No, 8, 17, -1, NULL); AddTextPrinterParameterized(sGfx->windowIds[WIN_YES_NO], FONT_NORMAL, gText_No, 8, 17, TEXT_SKIP_DRAW, NULL);
AddTextPrinterParameterized(sGfx->windowIds[WIN_YES_NO], FONT_NORMAL, gText_SelectorArrow2, 0, ((y - 1) * 16) + 1, -1, NULL); AddTextPrinterParameterized(sGfx->windowIds[WIN_YES_NO], FONT_NORMAL, gText_SelectorArrow2, 0, ((y - 1) * 16) + 1, TEXT_SKIP_DRAW, NULL);
CopyWindowToVram(sGfx->windowIds[WIN_YES_NO], 3); CopyWindowToVram(sGfx->windowIds[WIN_YES_NO], COPYWIN_FULL);
// Increment state only if A or B button have been pressed. // Increment state only if A or B button have been pressed.
if (JOY_NEW(A_BUTTON)) if (JOY_NEW(A_BUTTON))
@@ -5029,7 +5029,7 @@ static void Msg_SavingDontTurnOff(void)
sGfx->state++; sGfx->state++;
break; break;
case 1: case 1:
CopyWindowToVram(0, 3); CopyWindowToVram(0, COPYWIN_FULL);
sGfx->state++; sGfx->state++;
break; break;
case 2: case 2:
@@ -5063,8 +5063,8 @@ static void Msg_CommunicationStandby(void)
break; break;
case 1: case 1:
FillWindowPixelBuffer(sGfx->windowIds[0], PIXEL_FILL(1)); FillWindowPixelBuffer(sGfx->windowIds[0], PIXEL_FILL(1));
AddTextPrinterParameterized(sGfx->windowIds[0], FONT_NORMAL, gText_CommunicationStandby3, 0, 5, -1, NULL); AddTextPrinterParameterized(sGfx->windowIds[0], FONT_NORMAL, gText_CommunicationStandby3, 0, 5, TEXT_SKIP_DRAW, NULL);
CopyWindowToVram(sGfx->windowIds[0], 2); CopyWindowToVram(sGfx->windowIds[0], COPYWIN_GFX);
sGfx->state++; sGfx->state++;
break; break;
case 2: case 2:
@@ -5103,8 +5103,8 @@ static void Msg_SomeoneDroppedOut(void)
break; break;
case 1: case 1:
FillWindowPixelBuffer(sGfx->windowIds[0], PIXEL_FILL(1)); FillWindowPixelBuffer(sGfx->windowIds[0], PIXEL_FILL(1));
AddTextPrinterParameterized(sGfx->windowIds[0], FONT_NORMAL, gText_SomeoneDroppedOut, 0, 5, -1, NULL); AddTextPrinterParameterized(sGfx->windowIds[0], FONT_NORMAL, gText_SomeoneDroppedOut, 0, 5, TEXT_SKIP_DRAW, NULL);
CopyWindowToVram(sGfx->windowIds[0], 2); CopyWindowToVram(sGfx->windowIds[0], COPYWIN_GFX);
sGfx->state++; sGfx->state++;
break; break;
case 2: case 2:
@@ -5172,14 +5172,14 @@ static void InitBgs(void)
SetGpuReg(REG_OFFSET_DISPCNT, 0); SetGpuReg(REG_OFFSET_DISPCNT, 0);
ResetBgsAndClearDma3BusyFlags(0); ResetBgsAndClearDma3BusyFlags(0);
InitBgsFromTemplates(0, sBgTemplates, ARRAY_COUNT(sBgTemplates)); InitBgsFromTemplates(0, sBgTemplates, ARRAY_COUNT(sBgTemplates));
ChangeBgX(0, 0, 0); ChangeBgX(0, 0, BG_COORD_SET);
ChangeBgY(0, 0, 0); ChangeBgY(0, 0, BG_COORD_SET);
ChangeBgX(1, 0, 0); ChangeBgX(1, 0, BG_COORD_SET);
ChangeBgY(1, 0, 0); ChangeBgY(1, 0, BG_COORD_SET);
ChangeBgX(2, 0, 0); ChangeBgX(2, 0, BG_COORD_SET);
ChangeBgY(2, 0, 0); ChangeBgY(2, 0, BG_COORD_SET);
ChangeBgX(3, 0, 0); ChangeBgX(3, 0, BG_COORD_SET);
ChangeBgY(3, 0, 0); ChangeBgY(3, 0, BG_COORD_SET);
InitStandardTextBoxWindows(); InitStandardTextBoxWindows();
InitTextBoxGfxAndPrinters(); InitTextBoxGfxAndPrinters();
SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_OBJ_ON | DISPCNT_OBJ_1D_MAP); SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_OBJ_ON | DISPCNT_OBJ_1D_MAP);
+25 -25
View File
@@ -3900,14 +3900,14 @@ static bool8 InitEasyChatScreenControl_(void)
static void InitEasyChatBgs(void) static void InitEasyChatBgs(void)
{ {
ChangeBgX(3, 0, 0); ChangeBgX(3, 0, BG_COORD_SET);
ChangeBgY(3, 0, 0); ChangeBgY(3, 0, BG_COORD_SET);
ChangeBgX(1, 0, 0); ChangeBgX(1, 0, BG_COORD_SET);
ChangeBgY(1, 0, 0); ChangeBgY(1, 0, BG_COORD_SET);
ChangeBgX(2, 0, 0); ChangeBgX(2, 0, BG_COORD_SET);
ChangeBgY(2, 0, 0); ChangeBgY(2, 0, BG_COORD_SET);
ChangeBgX(0, 0, 0); ChangeBgX(0, 0, BG_COORD_SET);
ChangeBgY(0, 0, 0); ChangeBgY(0, 0, BG_COORD_SET);
SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_MODE_0 | DISPCNT_OBJ_1D_MAP | DISPCNT_OBJ_ON | DISPCNT_WIN0_ON); SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_MODE_0 | DISPCNT_OBJ_1D_MAP | DISPCNT_OBJ_ON | DISPCNT_WIN0_ON);
} }
@@ -3932,9 +3932,9 @@ static void PrintTitle(void)
xOffset = GetStringCenterAlignXOffset(FONT_NORMAL, titleText, 144); xOffset = GetStringCenterAlignXOffset(FONT_NORMAL, titleText, 144);
FillWindowPixelBuffer(0, PIXEL_FILL(0)); FillWindowPixelBuffer(0, PIXEL_FILL(0));
PrintEasyChatTextWithColors(0, FONT_NORMAL, titleText, xOffset, 1, TEXT_SPEED_FF, TEXT_COLOR_TRANSPARENT, TEXT_COLOR_DARK_GRAY, TEXT_COLOR_LIGHT_GRAY); PrintEasyChatTextWithColors(0, FONT_NORMAL, titleText, xOffset, 1, TEXT_SKIP_DRAW, TEXT_COLOR_TRANSPARENT, TEXT_COLOR_DARK_GRAY, TEXT_COLOR_LIGHT_GRAY);
PutWindowTilemap(0); PutWindowTilemap(0);
CopyWindowToVram(0, 3); CopyWindowToVram(0, COPYWIN_FULL);
} }
static void PrintEasyChatText(u8 windowId, u8 fontId, const u8 *str, u8 x, u8 y, u8 speed, void (*callback)(struct TextPrinterTemplate *, u16)) static void PrintEasyChatText(u8 windowId, u8 fontId, const u8 *str, u8 x, u8 y, u8 speed, void (*callback)(struct TextPrinterTemplate *, u16))
@@ -4003,12 +4003,12 @@ static void PrintEasyChatStdMessage(u8 msgId)
FillWindowPixelBuffer(1, PIXEL_FILL(1)); FillWindowPixelBuffer(1, PIXEL_FILL(1));
if (text1) if (text1)
PrintEasyChatText(1, FONT_NORMAL, text1, 0, 1, TEXT_SPEED_FF, 0); PrintEasyChatText(1, FONT_NORMAL, text1, 0, 1, TEXT_SKIP_DRAW, 0);
if (text2) if (text2)
PrintEasyChatText(1, FONT_NORMAL, text2, 0, 17, TEXT_SPEED_FF, 0); PrintEasyChatText(1, FONT_NORMAL, text2, 0, 17, TEXT_SKIP_DRAW, 0);
CopyWindowToVram(1, 3); CopyWindowToVram(1, COPYWIN_FULL);
} }
static void CreateEasyChatYesNoMenu(u8 initialCursorPos) static void CreateEasyChatYesNoMenu(u8 initialCursorPos)
@@ -4099,10 +4099,10 @@ static void PrintCurrentPhrase(void)
} }
*str = EOS; *str = EOS;
PrintEasyChatText(sScreenControl->windowId, FONT_NORMAL, sScreenControl->phrasePrintBuffer, 0, i * 16 + 1, TEXT_SPEED_FF, 0); PrintEasyChatText(sScreenControl->windowId, FONT_NORMAL, sScreenControl->phrasePrintBuffer, 0, i * 16 + 1, TEXT_SKIP_DRAW, 0);
} }
CopyWindowToVram(sScreenControl->windowId, 3); CopyWindowToVram(sScreenControl->windowId, COPYWIN_FULL);
} }
static void BufferFrameTilemap(u16 *tilemap) static void BufferFrameTilemap(u16 *tilemap)
@@ -4216,7 +4216,7 @@ static void InitLowerWindowText(u32 whichText)
break; break;
} }
CopyWindowToVram(2, 2); CopyWindowToVram(2, COPYWIN_GFX);
} }
static void PrintKeyboardText(void) static void PrintKeyboardText(void)
@@ -4245,7 +4245,7 @@ static void PrintKeyboardGroupNames(void)
return; return;
} }
PrintEasyChatText(2, FONT_NORMAL, GetEasyChatWordGroupName(groupId), x * 84 + 10, y, TEXT_SPEED_FF, NULL); PrintEasyChatText(2, FONT_NORMAL, GetEasyChatWordGroupName(groupId), x * 84 + 10, y, TEXT_SKIP_DRAW, NULL);
} }
y += 16; y += 16;
@@ -4257,7 +4257,7 @@ static void PrintKeyboardAlphabet(void)
u32 i; u32 i;
for (i = 0; i < ARRAY_COUNT(sEasyChatKeyboardAlphabet); i++) for (i = 0; i < ARRAY_COUNT(sEasyChatKeyboardAlphabet); i++)
PrintEasyChatText(2, FONT_NORMAL, sEasyChatKeyboardAlphabet[i], 10, 97 + i * 16, TEXT_SPEED_FF, NULL); PrintEasyChatText(2, FONT_NORMAL, sEasyChatKeyboardAlphabet[i], 10, 97 + i * 16, TEXT_SKIP_DRAW, NULL);
} }
static void PrintInitialWordSelectText(void) static void PrintInitialWordSelectText(void)
@@ -4328,16 +4328,16 @@ static void PrintWordSelectText(u8 scrollOffset, u8 numRows)
{ {
CopyEasyChatWordPadded(sScreenControl->wordSelectPrintBuffer, easyChatWord, 0); CopyEasyChatWordPadded(sScreenControl->wordSelectPrintBuffer, easyChatWord, 0);
if (!DummyWordCheck(easyChatWord)) if (!DummyWordCheck(easyChatWord))
PrintEasyChatText(2, FONT_NORMAL, sScreenControl->wordSelectPrintBuffer, (j * 13 + 3) * 8, y, TEXT_SPEED_FF, NULL); PrintEasyChatText(2, FONT_NORMAL, sScreenControl->wordSelectPrintBuffer, (j * 13 + 3) * 8, y, TEXT_SKIP_DRAW, NULL);
else // Never reached else // Never reached
PrintEasyChatTextWithColors(2, FONT_NORMAL, sScreenControl->wordSelectPrintBuffer, (j * 13 + 3) * 8, y, TEXT_SPEED_FF, TEXT_COLOR_WHITE, TEXT_COLOR_LIGHT_RED, TEXT_COLOR_LIGHT_GRAY); PrintEasyChatTextWithColors(2, FONT_NORMAL, sScreenControl->wordSelectPrintBuffer, (j * 13 + 3) * 8, y, TEXT_SKIP_DRAW, TEXT_COLOR_WHITE, TEXT_COLOR_LIGHT_RED, TEXT_COLOR_LIGHT_GRAY);
} }
} }
y += 16; y += 16;
} }
CopyWindowToVram(2, 2); CopyWindowToVram(2, COPYWIN_GFX);
} }
static void EraseWordSelectRows(u8 scrollOffset, u8 numRows) static void EraseWordSelectRows(u8 scrollOffset, u8 numRows)
@@ -4369,7 +4369,7 @@ static void EraseWordSelectRows(u8 scrollOffset, u8 numRows)
static void ClearWordSelectWindow(void) static void ClearWordSelectWindow(void)
{ {
FillWindowPixelBuffer(2, PIXEL_FILL(1)); FillWindowPixelBuffer(2, PIXEL_FILL(1));
CopyWindowToVram(2, 2); CopyWindowToVram(2, COPYWIN_GFX);
} }
static void InitLowerWindowAnim(int winAnimType) static void InitLowerWindowAnim(int winAnimType)
@@ -4550,7 +4550,7 @@ static void BufferLowerWindowFrame(int left, int top, int width, int height)
static void ResetLowerWindowScroll(void) static void ResetLowerWindowScroll(void)
{ {
ChangeBgY(2, 0x800, 0); ChangeBgY(2, 0x800, BG_COORD_SET);
sScreenControl->scrollOffset = 0; sScreenControl->scrollOffset = 0;
} }
@@ -4572,7 +4572,7 @@ static void InitLowerWindowScroll(s16 scrollChange, u8 speed)
} }
else else
{ {
ChangeBgY(2, bgY, 0); ChangeBgY(2, bgY, BG_COORD_SET);
} }
} }
@@ -4587,7 +4587,7 @@ static bool8 UpdateLowerWindowScroll(void)
} }
else else
{ {
ChangeBgY(2, sScreenControl->scrollSpeed, 1); ChangeBgY(2, sScreenControl->scrollSpeed, BG_COORD_ADD);
return TRUE; return TRUE;
} }
} }
+6 -6
View File
@@ -495,10 +495,10 @@ static void CB2_EggHatch_0(void)
ResetBgsAndClearDma3BusyFlags(0); ResetBgsAndClearDma3BusyFlags(0);
InitBgsFromTemplates(0, sBgTemplates_EggHatch, ARRAY_COUNT(sBgTemplates_EggHatch)); InitBgsFromTemplates(0, sBgTemplates_EggHatch, ARRAY_COUNT(sBgTemplates_EggHatch));
ChangeBgX(1, 0, 0); ChangeBgX(1, 0, BG_COORD_SET);
ChangeBgY(1, 0, 0); ChangeBgY(1, 0, BG_COORD_SET);
ChangeBgX(0, 0, 0); ChangeBgX(0, 0, BG_COORD_SET);
ChangeBgY(0, 0, 0); ChangeBgY(0, 0, BG_COORD_SET);
SetBgAttribute(1, BG_ATTR_PRIORITY, 2); SetBgAttribute(1, BG_ATTR_PRIORITY, 2);
SetBgTilemapBuffer(1, Alloc(0x1000)); SetBgTilemapBuffer(1, Alloc(0x1000));
@@ -640,11 +640,11 @@ static void CB2_EggHatch_1(void)
case 5: case 5:
GetMonNickname2(&gPlayerParty[sEggHatchData->eggPartyID], gStringVar1); GetMonNickname2(&gPlayerParty[sEggHatchData->eggPartyID], gStringVar1);
StringExpandPlaceholders(gStringVar4, gText_HatchedFromEgg); StringExpandPlaceholders(gStringVar4, gText_HatchedFromEgg);
EggHatchPrintMessage(sEggHatchData->windowId, gStringVar4, 0, 3, 0xFF); EggHatchPrintMessage(sEggHatchData->windowId, gStringVar4, 0, 3, TEXT_SKIP_DRAW);
PlayFanfare(MUS_EVOLVED); PlayFanfare(MUS_EVOLVED);
sEggHatchData->CB2_state++; sEggHatchData->CB2_state++;
PutWindowTilemap(sEggHatchData->windowId); PutWindowTilemap(sEggHatchData->windowId);
CopyWindowToVram(sEggHatchData->windowId, 3); CopyWindowToVram(sEggHatchData->windowId, COPYWIN_FULL);
break; break;
case 6: case 6:
if (IsFanfareTaskInactive()) if (IsFanfareTaskInactive())
+1 -1
View File
@@ -1764,7 +1764,7 @@ static bool8 Fishing_InitDots(struct Task *task)
{ {
u32 randVal; u32 randVal;
sub_819786C(0, TRUE); LoadMessageBoxAndFrameGfx(0, TRUE);
task->tStep++; task->tStep++;
task->tFrameCounter = 0; task->tFrameCounter = 0;
task->tNumDots = 0; task->tNumDots = 0;
+1 -1
View File
@@ -213,6 +213,6 @@ static void PrintRegionMapSecName(void)
else else
{ {
FillWindowPixelBuffer(0, PIXEL_FILL(1)); FillWindowPixelBuffer(0, PIXEL_FILL(1));
CopyWindowToVram(0, 3); CopyWindowToVram(0, COPYWIN_FULL);
} }
} }
+2 -2
View File
@@ -1145,7 +1145,7 @@ static void Task_OrbEffect(u8 taskId)
tState = 1; tState = 1;
break; break;
case 1: case 1:
sub_8199DF0(0, PIXEL_FILL(1), 0, 1); BgDmaFill(0, PIXEL_FILL(1), 0, 1);
LoadOrbEffectPalette(tBlueOrb); LoadOrbEffectPalette(tBlueOrb);
StartUpdateOrbFlashEffect(tCenterX, tCenterY, 1, 160, 1, 2); StartUpdateOrbFlashEffect(tCenterX, tCenterY, 1, 160, 1, 2);
tState = 2; tState = 2;
@@ -1190,7 +1190,7 @@ static void Task_OrbEffect(u8 taskId)
if (UpdateOrbEffectBlend(tShakeDir) == TRUE) if (UpdateOrbEffectBlend(tShakeDir) == TRUE)
{ {
tState = 5; tState = 5;
sub_8199DF0(0, PIXEL_FILL(0), 0, 1); BgDmaFill(0, PIXEL_FILL(0), 0, 1);
} }
} }
break; break;
+10 -18
View File
@@ -1911,13 +1911,13 @@ void ShowDeptStoreElevatorFloorSelect(void)
SetStandardWindowBorderStyle(sTutorMoveAndElevatorWindowId, 0); SetStandardWindowBorderStyle(sTutorMoveAndElevatorWindowId, 0);
xPos = GetStringCenterAlignXOffset(FONT_NORMAL, gText_ElevatorNowOn, 64); xPos = GetStringCenterAlignXOffset(FONT_NORMAL, gText_ElevatorNowOn, 64);
AddTextPrinterParameterized(sTutorMoveAndElevatorWindowId, FONT_NORMAL, gText_ElevatorNowOn, xPos, 1, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(sTutorMoveAndElevatorWindowId, FONT_NORMAL, gText_ElevatorNowOn, xPos, 1, TEXT_SKIP_DRAW, NULL);
xPos = GetStringCenterAlignXOffset(FONT_NORMAL, gDeptStoreFloorNames[gSpecialVar_0x8005], 64); xPos = GetStringCenterAlignXOffset(FONT_NORMAL, gDeptStoreFloorNames[gSpecialVar_0x8005], 64);
AddTextPrinterParameterized(sTutorMoveAndElevatorWindowId, FONT_NORMAL, gDeptStoreFloorNames[gSpecialVar_0x8005], xPos, 17, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(sTutorMoveAndElevatorWindowId, FONT_NORMAL, gDeptStoreFloorNames[gSpecialVar_0x8005], xPos, 17, TEXT_SKIP_DRAW, NULL);
PutWindowTilemap(sTutorMoveAndElevatorWindowId); PutWindowTilemap(sTutorMoveAndElevatorWindowId);
CopyWindowToVram(sTutorMoveAndElevatorWindowId, 3); CopyWindowToVram(sTutorMoveAndElevatorWindowId, COPYWIN_FULL);
} }
void CloseDeptStoreElevatorWindow(void) void CloseDeptStoreElevatorWindow(void)
@@ -2723,7 +2723,7 @@ static void CloseScrollableMultichoice(u8 taskId)
Free(sScrollableMultichoice_ListMenuItem); Free(sScrollableMultichoice_ListMenuItem);
ClearStdWindowAndFrameToTransparent(task->tWindowId, 1); ClearStdWindowAndFrameToTransparent(task->tWindowId, 1);
FillWindowPixelBuffer(task->tWindowId, PIXEL_FILL(0)); FillWindowPixelBuffer(task->tWindowId, PIXEL_FILL(0));
CopyWindowToVram(task->tWindowId, 2); CopyWindowToVram(task->tWindowId, COPYWIN_GFX);
RemoveWindow(task->tWindowId); RemoveWindow(task->tWindowId);
DestroyTask(taskId); DestroyTask(taskId);
EnableBothScriptContexts(); EnableBothScriptContexts();
@@ -2976,7 +2976,7 @@ void ShowBattlePointsWindow(void)
sBattlePointsWindowId = AddWindow(&sBattlePoints_WindowTemplate); sBattlePointsWindowId = AddWindow(&sBattlePoints_WindowTemplate);
SetStandardWindowBorderStyle(sBattlePointsWindowId, 0); SetStandardWindowBorderStyle(sBattlePointsWindowId, 0);
UpdateBattlePointsWindow(); UpdateBattlePointsWindow();
CopyWindowToVram(sBattlePointsWindowId, 2); CopyWindowToVram(sBattlePointsWindowId, COPYWIN_GFX);
} }
void CloseBattlePointsWindow(void) void CloseBattlePointsWindow(void)
@@ -2988,25 +2988,17 @@ void CloseBattlePointsWindow(void)
void TakeFrontierBattlePoints(void) void TakeFrontierBattlePoints(void)
{ {
if (gSaveBlock2Ptr->frontier.battlePoints < gSpecialVar_0x8004) if (gSaveBlock2Ptr->frontier.battlePoints < gSpecialVar_0x8004)
{
gSaveBlock2Ptr->frontier.battlePoints = 0; gSaveBlock2Ptr->frontier.battlePoints = 0;
}
else else
{
gSaveBlock2Ptr->frontier.battlePoints -= gSpecialVar_0x8004; gSaveBlock2Ptr->frontier.battlePoints -= gSpecialVar_0x8004;
}
} }
void GiveFrontierBattlePoints(void) void GiveFrontierBattlePoints(void)
{ {
if (gSaveBlock2Ptr->frontier.battlePoints + gSpecialVar_0x8004 > MAX_BATTLE_FRONTIER_POINTS) if (gSaveBlock2Ptr->frontier.battlePoints + gSpecialVar_0x8004 > MAX_BATTLE_FRONTIER_POINTS)
{
gSaveBlock2Ptr->frontier.battlePoints = MAX_BATTLE_FRONTIER_POINTS; gSaveBlock2Ptr->frontier.battlePoints = MAX_BATTLE_FRONTIER_POINTS;
}
else else
{
gSaveBlock2Ptr->frontier.battlePoints = gSaveBlock2Ptr->frontier.battlePoints + gSpecialVar_0x8004; gSaveBlock2Ptr->frontier.battlePoints = gSaveBlock2Ptr->frontier.battlePoints + gSpecialVar_0x8004;
}
} }
u16 GetFrontierBattlePoints(void) u16 GetFrontierBattlePoints(void)
@@ -3028,7 +3020,7 @@ void ShowFrontierExchangeCornerItemIconWindow(void)
sFrontierExchangeCorner_ItemIconWindowId = AddWindow(&sFrontierExchangeCorner_ItemIconWindowTemplate); sFrontierExchangeCorner_ItemIconWindowId = AddWindow(&sFrontierExchangeCorner_ItemIconWindowTemplate);
SetStandardWindowBorderStyle(sFrontierExchangeCorner_ItemIconWindowId, 0); SetStandardWindowBorderStyle(sFrontierExchangeCorner_ItemIconWindowId, 0);
CopyWindowToVram(sFrontierExchangeCorner_ItemIconWindowId, 2); CopyWindowToVram(sFrontierExchangeCorner_ItemIconWindowId, COPYWIN_GFX);
} }
void CloseFrontierExchangeCornerItemIconWindow(void) void CloseFrontierExchangeCornerItemIconWindow(void)
@@ -3244,11 +3236,11 @@ void ScrollableMultichoice_RedrawPersistentMenu(void)
SetStandardWindowBorderStyle(task->tWindowId, 0); SetStandardWindowBorderStyle(task->tWindowId, 0);
for (i = 0; i < MAX_SCROLL_MULTI_ON_SCREEN; i++) for (i = 0; i < MAX_SCROLL_MULTI_ON_SCREEN; i++)
AddTextPrinterParameterized5(task->tWindowId, FONT_NORMAL, sScrollableMultichoiceOptions[gSpecialVar_0x8004][scrollOffset + i], 10, i * 16, TEXT_SPEED_FF, NULL, 0, 0); AddTextPrinterParameterized5(task->tWindowId, FONT_NORMAL, sScrollableMultichoiceOptions[gSpecialVar_0x8004][scrollOffset + i], 10, i * 16, TEXT_SKIP_DRAW, NULL, 0, 0);
AddTextPrinterParameterized(task->tWindowId, FONT_NORMAL, gText_SelectorArrow, 0, selectedRow * 16, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(task->tWindowId, FONT_NORMAL, gText_SelectorArrow, 0, selectedRow * 16, TEXT_SKIP_DRAW, NULL);
PutWindowTilemap(task->tWindowId); PutWindowTilemap(task->tWindowId);
CopyWindowToVram(task->tWindowId, 3); CopyWindowToVram(task->tWindowId, COPYWIN_FULL);
} }
} }
@@ -3303,7 +3295,7 @@ void ScrollableMultichoice_ClosePersistentMenu(void)
ClearStdWindowAndFrameToTransparent(task->tWindowId, TRUE); ClearStdWindowAndFrameToTransparent(task->tWindowId, TRUE);
FillWindowPixelBuffer(task->tWindowId, PIXEL_FILL(0)); FillWindowPixelBuffer(task->tWindowId, PIXEL_FILL(0));
ClearWindowTilemap(task->tWindowId); ClearWindowTilemap(task->tWindowId);
CopyWindowToVram(task->tWindowId, 2); CopyWindowToVram(task->tWindowId, COPYWIN_GFX);
RemoveWindow(task->tWindowId); RemoveWindow(task->tWindowId);
DestroyTask(taskId); DestroyTask(taskId);
} }
+12 -12
View File
@@ -561,14 +561,14 @@ static void ResetGpuRegsAndBgs(void)
SetGpuReg(REG_OFFSET_BG2CNT, 0); SetGpuReg(REG_OFFSET_BG2CNT, 0);
SetGpuReg(REG_OFFSET_BG1CNT, 0); SetGpuReg(REG_OFFSET_BG1CNT, 0);
SetGpuReg(REG_OFFSET_BG0CNT, 0); SetGpuReg(REG_OFFSET_BG0CNT, 0);
ChangeBgX(0, 0, 0); ChangeBgX(0, 0, BG_COORD_SET);
ChangeBgY(0, 0, 0); ChangeBgY(0, 0, BG_COORD_SET);
ChangeBgX(1, 0, 0); ChangeBgX(1, 0, BG_COORD_SET);
ChangeBgY(1, 0, 0); ChangeBgY(1, 0, BG_COORD_SET);
ChangeBgX(2, 0, 0); ChangeBgX(2, 0, BG_COORD_SET);
ChangeBgY(2, 0, 0); ChangeBgY(2, 0, BG_COORD_SET);
ChangeBgX(3, 0, 0); ChangeBgX(3, 0, BG_COORD_SET);
ChangeBgY(3, 0, 0); ChangeBgY(3, 0, BG_COORD_SET);
SetGpuReg(REG_OFFSET_BLDCNT, 0); SetGpuReg(REG_OFFSET_BLDCNT, 0);
SetGpuReg(REG_OFFSET_BLDY, 0); SetGpuReg(REG_OFFSET_BLDY, 0);
SetGpuReg(REG_OFFSET_BLDALPHA, 0); SetGpuReg(REG_OFFSET_BLDALPHA, 0);
@@ -1166,7 +1166,7 @@ static void ShowAndPrintWindows(void)
PrintAreaDescription(sPassData->cursorArea); PrintAreaDescription(sPassData->cursorArea);
for (i = 0; i < WINDOW_COUNT; i++) for (i = 0; i < WINDOW_COUNT; i++)
CopyWindowToVram(i, 3); CopyWindowToVram(i, COPYWIN_FULL);
CopyBgTilemapBufferToVram(0); CopyBgTilemapBufferToVram(0);
} }
@@ -1180,7 +1180,7 @@ static void PrintAreaDescription(u8 cursorArea)
else if (cursorArea != CURSOR_AREA_NOTHING) else if (cursorArea != CURSOR_AREA_NOTHING)
AddTextPrinterParameterized3(WINDOW_DESCRIPTION, FONT_NORMAL, 2, 0, sTextColors[1], 0, sPassAreaDescriptions[cursorArea]); AddTextPrinterParameterized3(WINDOW_DESCRIPTION, FONT_NORMAL, 2, 0, sTextColors[1], 0, sPassAreaDescriptions[cursorArea]);
CopyWindowToVram(WINDOW_DESCRIPTION, 3); CopyWindowToVram(WINDOW_DESCRIPTION, COPYWIN_FULL);
CopyBgTilemapBufferToVram(0); CopyBgTilemapBufferToVram(0);
} }
@@ -1723,7 +1723,7 @@ static void PrintOnFrontierMap(void)
AddTextPrinterParameterized3(MAP_WINDOW_DESCRIPTION, FONT_NORMAL, 4, 0, sTextColors[0], 0, sMapLandmarks[sMapData->cursorPos].description); AddTextPrinterParameterized3(MAP_WINDOW_DESCRIPTION, FONT_NORMAL, 4, 0, sTextColors[0], 0, sMapLandmarks[sMapData->cursorPos].description);
for (i = 0; i < MAP_WINDOW_COUNT; i++) for (i = 0; i < MAP_WINDOW_COUNT; i++)
CopyWindowToVram(i, 3); CopyWindowToVram(i, COPYWIN_FULL);
CopyBgTilemapBufferToVram(0); CopyBgTilemapBufferToVram(0);
} }
@@ -1755,7 +1755,7 @@ static void HandleFrontierMapCursorMove(u8 direction)
AddTextPrinterParameterized3(MAP_WINDOW_DESCRIPTION, FONT_NORMAL, 4, 0, sTextColors[0], 0, sMapLandmarks[sMapData->cursorPos].description); AddTextPrinterParameterized3(MAP_WINDOW_DESCRIPTION, FONT_NORMAL, 4, 0, sTextColors[0], 0, sMapLandmarks[sMapData->cursorPos].description);
for (i = 0; i < MAP_WINDOW_COUNT; i++) for (i = 0; i < MAP_WINDOW_COUNT; i++)
CopyWindowToVram(i, 3); CopyWindowToVram(i, COPYWIN_FULL);
CopyBgTilemapBufferToVram(0); CopyBgTilemapBufferToVram(0);
PlaySE(SE_DEX_SCROLL); PlaySE(SE_DEX_SCROLL);
+62 -62
View File
@@ -960,7 +960,7 @@ static void PrintAligned(const u8 *str, s32 y)
{ {
s32 x = GetStringCenterAlignXOffset(FONT_NORMAL, str, 224); s32 x = GetStringCenterAlignXOffset(FONT_NORMAL, str, 224);
y = (y * 8) + 1; y = (y * 8) + 1;
AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, str, x, y, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, str, x, y, TEXT_SKIP_DRAW, NULL);
} }
static void PrintHyphens(s32 y) static void PrintHyphens(s32 y)
@@ -973,18 +973,18 @@ static void PrintHyphens(s32 y)
text[i] = EOS; text[i] = EOS;
y = (y * 8) + 1; y = (y * 8) + 1;
AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, text, 4, y, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, text, 4, y, TEXT_SKIP_DRAW, NULL);
} }
// Battle Tower records. // Battle Tower records.
static void TowerPrintStreak(const u8 *str, u16 num, u8 x1, u8 x2, u8 y) static void TowerPrintStreak(const u8 *str, u16 num, u8 x1, u8 x2, u8 y)
{ {
AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, str, x1, y, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, str, x1, y, TEXT_SKIP_DRAW, NULL);
if (num > MAX_STREAK) if (num > MAX_STREAK)
num = MAX_STREAK; num = MAX_STREAK;
ConvertIntToDecimalStringN(gStringVar1, num, STR_CONV_MODE_RIGHT_ALIGN, 4); ConvertIntToDecimalStringN(gStringVar1, num, STR_CONV_MODE_RIGHT_ALIGN, 4);
StringExpandPlaceholders(gStringVar4, gText_WinStreak); StringExpandPlaceholders(gStringVar4, gText_WinStreak);
AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, gStringVar4, x2, y, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, gStringVar4, x2, y, TEXT_SKIP_DRAW, NULL);
} }
static void TowerPrintRecordStreak(u8 battleMode, u8 lvlMode, u8 x1, u8 x2, u8 y) static void TowerPrintRecordStreak(u8 battleMode, u8 lvlMode, u8 x1, u8 x2, u8 y)
@@ -1056,15 +1056,15 @@ static void ShowTowerResultsWindow(u8 battleMode)
StringExpandPlaceholders(gStringVar4, gText_LinkMultiBattleRoomResults); StringExpandPlaceholders(gStringVar4, gText_LinkMultiBattleRoomResults);
PrintAligned(gStringVar4, 2); PrintAligned(gStringVar4, 2);
AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, gText_Lv502, 16, 49, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, gText_Lv502, 16, 49, TEXT_SKIP_DRAW, NULL);
AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, gText_OpenLv, 16, 97, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, gText_OpenLv, 16, 97, TEXT_SKIP_DRAW, NULL);
PrintHyphens(10); PrintHyphens(10);
TowerPrintPrevOrCurrentStreak(battleMode, FRONTIER_LVL_50, 72, 132, 49); TowerPrintPrevOrCurrentStreak(battleMode, FRONTIER_LVL_50, 72, 132, 49);
TowerPrintRecordStreak(battleMode, FRONTIER_LVL_50, 72, 132, 65); TowerPrintRecordStreak(battleMode, FRONTIER_LVL_50, 72, 132, 65);
TowerPrintPrevOrCurrentStreak(battleMode, FRONTIER_LVL_OPEN, 72, 132, 97); TowerPrintPrevOrCurrentStreak(battleMode, FRONTIER_LVL_OPEN, 72, 132, 97);
TowerPrintRecordStreak(battleMode, FRONTIER_LVL_OPEN, 72, 132, 113); TowerPrintRecordStreak(battleMode, FRONTIER_LVL_OPEN, 72, 132, 113);
PutWindowTilemap(gRecordsWindowId); PutWindowTilemap(gRecordsWindowId);
CopyWindowToVram(gRecordsWindowId, 3); CopyWindowToVram(gRecordsWindowId, COPYWIN_FULL);
} }
// Battle Dome records. // Battle Dome records.
@@ -1079,10 +1079,10 @@ static u16 DomeGetWinStreak(u8 battleMode, u8 lvlMode)
static void PrintTwoStrings(const u8 *str1, const u8 *str2, u16 num, u8 x1, u8 x2, u8 y) static void PrintTwoStrings(const u8 *str1, const u8 *str2, u16 num, u8 x1, u8 x2, u8 y)
{ {
AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, str1, x1, y, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, str1, x1, y, TEXT_SKIP_DRAW, NULL);
ConvertIntToDecimalStringN(gStringVar1, num, STR_CONV_MODE_RIGHT_ALIGN, 4); ConvertIntToDecimalStringN(gStringVar1, num, STR_CONV_MODE_RIGHT_ALIGN, 4);
StringExpandPlaceholders(gStringVar4, str2); StringExpandPlaceholders(gStringVar4, str2);
AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, gStringVar4, x2, y, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, gStringVar4, x2, y, TEXT_SKIP_DRAW, NULL);
} }
static void DomePrintPrevOrCurrentStreak(u8 battleMode, u8 lvlMode, u8 x1, u8 x2, u8 y) static void DomePrintPrevOrCurrentStreak(u8 battleMode, u8 lvlMode, u8 x1, u8 x2, u8 y)
@@ -1123,8 +1123,8 @@ static void ShowDomeResultsWindow(u8 battleMode)
StringExpandPlaceholders(gStringVar4, gText_DoubleBattleTourneyResults); StringExpandPlaceholders(gStringVar4, gText_DoubleBattleTourneyResults);
PrintAligned(gStringVar4, 0); PrintAligned(gStringVar4, 0);
AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, gText_Lv502, 8, 33, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, gText_Lv502, 8, 33, TEXT_SKIP_DRAW, NULL);
AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, gText_OpenLv, 8, 97, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, gText_OpenLv, 8, 97, TEXT_SKIP_DRAW, NULL);
PrintHyphens(10); PrintHyphens(10);
DomePrintPrevOrCurrentStreak(battleMode, FRONTIER_LVL_50, 64, 121, 33); DomePrintPrevOrCurrentStreak(battleMode, FRONTIER_LVL_50, 64, 121, 33);
PrintTwoStrings(gText_Record, gText_ClearStreak, gSaveBlock2Ptr->frontier.domeRecordWinStreaks[battleMode][FRONTIER_LVL_50], 64, 121, 49); PrintTwoStrings(gText_Record, gText_ClearStreak, gSaveBlock2Ptr->frontier.domeRecordWinStreaks[battleMode][FRONTIER_LVL_50], 64, 121, 49);
@@ -1133,18 +1133,18 @@ static void ShowDomeResultsWindow(u8 battleMode)
PrintTwoStrings(gText_Record, gText_ClearStreak, gSaveBlock2Ptr->frontier.domeRecordWinStreaks[battleMode][FRONTIER_LVL_OPEN], 64, 121, 113); PrintTwoStrings(gText_Record, gText_ClearStreak, gSaveBlock2Ptr->frontier.domeRecordWinStreaks[battleMode][FRONTIER_LVL_OPEN], 64, 121, 113);
PrintTwoStrings(gText_Total, gText_Championships, gSaveBlock2Ptr->frontier.domeTotalChampionships[battleMode][FRONTIER_LVL_OPEN], 64, 112, 129); PrintTwoStrings(gText_Total, gText_Championships, gSaveBlock2Ptr->frontier.domeTotalChampionships[battleMode][FRONTIER_LVL_OPEN], 64, 112, 129);
PutWindowTilemap(gRecordsWindowId); PutWindowTilemap(gRecordsWindowId);
CopyWindowToVram(gRecordsWindowId, 3); CopyWindowToVram(gRecordsWindowId, COPYWIN_FULL);
} }
// Battle Palace records. // Battle Palace records.
static void PalacePrintStreak(const u8 *str, u16 num, u8 x1, u8 x2, u8 y) static void PalacePrintStreak(const u8 *str, u16 num, u8 x1, u8 x2, u8 y)
{ {
AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, str, x1, y, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, str, x1, y, TEXT_SKIP_DRAW, NULL);
if (num > MAX_STREAK) if (num > MAX_STREAK)
num = MAX_STREAK; num = MAX_STREAK;
ConvertIntToDecimalStringN(gStringVar1, num, STR_CONV_MODE_RIGHT_ALIGN, 4); ConvertIntToDecimalStringN(gStringVar1, num, STR_CONV_MODE_RIGHT_ALIGN, 4);
StringExpandPlaceholders(gStringVar4, gText_WinStreak); StringExpandPlaceholders(gStringVar4, gText_WinStreak);
AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, gStringVar4, x2, y, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, gStringVar4, x2, y, TEXT_SKIP_DRAW, NULL);
} }
static void PalacePrintRecordStreak(u8 battleMode, u8 lvlMode, u8 x1, u8 x2, u8 y) static void PalacePrintRecordStreak(u8 battleMode, u8 lvlMode, u8 x1, u8 x2, u8 y)
@@ -1199,15 +1199,15 @@ static void ShowPalaceResultsWindow(u8 battleMode)
StringExpandPlaceholders(gStringVar4, gText_DoubleBattleHallResults); StringExpandPlaceholders(gStringVar4, gText_DoubleBattleHallResults);
PrintAligned(gStringVar4, 2); PrintAligned(gStringVar4, 2);
AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, gText_Lv502, 16, 49, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, gText_Lv502, 16, 49, TEXT_SKIP_DRAW, NULL);
AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, gText_OpenLv, 16, 97, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, gText_OpenLv, 16, 97, TEXT_SKIP_DRAW, NULL);
PrintHyphens(10); PrintHyphens(10);
PalacePrintPrevOrCurrentStreak(battleMode, FRONTIER_LVL_50, 72, 131, 49); PalacePrintPrevOrCurrentStreak(battleMode, FRONTIER_LVL_50, 72, 131, 49);
PalacePrintRecordStreak(battleMode, FRONTIER_LVL_50, 72, 131, 65); PalacePrintRecordStreak(battleMode, FRONTIER_LVL_50, 72, 131, 65);
PalacePrintPrevOrCurrentStreak(battleMode, FRONTIER_LVL_OPEN, 72, 131, 97); PalacePrintPrevOrCurrentStreak(battleMode, FRONTIER_LVL_OPEN, 72, 131, 97);
PalacePrintRecordStreak(battleMode, FRONTIER_LVL_OPEN, 72, 131, 113); PalacePrintRecordStreak(battleMode, FRONTIER_LVL_OPEN, 72, 131, 113);
PutWindowTilemap(gRecordsWindowId); PutWindowTilemap(gRecordsWindowId);
CopyWindowToVram(gRecordsWindowId, 3); CopyWindowToVram(gRecordsWindowId, COPYWIN_FULL);
} }
// Battle Pike records. // Battle Pike records.
@@ -1222,10 +1222,10 @@ static u16 PikeGetWinStreak(u8 lvlMode)
static void PikePrintCleared(const u8 *str1, const u8 *str2, u16 num, u8 x1, u8 x2, u8 y) static void PikePrintCleared(const u8 *str1, const u8 *str2, u16 num, u8 x1, u8 x2, u8 y)
{ {
AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, str1, x1, y, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, str1, x1, y, TEXT_SKIP_DRAW, NULL);
ConvertIntToDecimalStringN(gStringVar1, num, STR_CONV_MODE_RIGHT_ALIGN, 4); ConvertIntToDecimalStringN(gStringVar1, num, STR_CONV_MODE_RIGHT_ALIGN, 4);
StringExpandPlaceholders(gStringVar4, str2); StringExpandPlaceholders(gStringVar4, str2);
AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, gStringVar4, x2, y, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, gStringVar4, x2, y, TEXT_SKIP_DRAW, NULL);
} }
static void PikePrintPrevOrCurrentStreak(u8 lvlMode, u8 x1, u8 x2, u8 y) static void PikePrintPrevOrCurrentStreak(u8 lvlMode, u8 x1, u8 x2, u8 y)
@@ -1251,8 +1251,8 @@ static void ShowPikeResultsWindow(void)
FillWindowPixelBuffer(gRecordsWindowId, PIXEL_FILL(1)); FillWindowPixelBuffer(gRecordsWindowId, PIXEL_FILL(1));
StringExpandPlaceholders(gStringVar4, gText_BattleChoiceResults); StringExpandPlaceholders(gStringVar4, gText_BattleChoiceResults);
PrintAligned(gStringVar4, 0); PrintAligned(gStringVar4, 0);
AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, gText_Lv502, 8, 33, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, gText_Lv502, 8, 33, TEXT_SKIP_DRAW, NULL);
AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, gText_OpenLv, 8, 97, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, gText_OpenLv, 8, 97, TEXT_SKIP_DRAW, NULL);
PrintHyphens(10); PrintHyphens(10);
PikePrintPrevOrCurrentStreak(FRONTIER_LVL_50, 64, 114, 33); PikePrintPrevOrCurrentStreak(FRONTIER_LVL_50, 64, 114, 33);
PikePrintCleared(gText_Record, gText_RoomsCleared, gSaveBlock2Ptr->frontier.pikeRecordStreaks[FRONTIER_LVL_50], 64, 114, 49); PikePrintCleared(gText_Record, gText_RoomsCleared, gSaveBlock2Ptr->frontier.pikeRecordStreaks[FRONTIER_LVL_50], 64, 114, 49);
@@ -1261,18 +1261,18 @@ static void ShowPikeResultsWindow(void)
PikePrintCleared(gText_Record, gText_RoomsCleared, gSaveBlock2Ptr->frontier.pikeRecordStreaks[FRONTIER_LVL_OPEN], 64, 114, 113); PikePrintCleared(gText_Record, gText_RoomsCleared, gSaveBlock2Ptr->frontier.pikeRecordStreaks[FRONTIER_LVL_OPEN], 64, 114, 113);
PikePrintCleared(gText_Total, gText_TimesCleared, gSaveBlock2Ptr->frontier.pikeTotalStreaks[FRONTIER_LVL_OPEN], 64, 114, 129); PikePrintCleared(gText_Total, gText_TimesCleared, gSaveBlock2Ptr->frontier.pikeTotalStreaks[FRONTIER_LVL_OPEN], 64, 114, 129);
PutWindowTilemap(gRecordsWindowId); PutWindowTilemap(gRecordsWindowId);
CopyWindowToVram(gRecordsWindowId, 3); CopyWindowToVram(gRecordsWindowId, COPYWIN_FULL);
} }
// Battle Arena records. // Battle Arena records.
static void ArenaPrintStreak(const u8 *str, u16 num, u8 x1, u8 x2, u8 y) static void ArenaPrintStreak(const u8 *str, u16 num, u8 x1, u8 x2, u8 y)
{ {
AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, str, x1, y, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, str, x1, y, TEXT_SKIP_DRAW, NULL);
if (num > MAX_STREAK) if (num > MAX_STREAK)
num = MAX_STREAK; num = MAX_STREAK;
ConvertIntToDecimalStringN(gStringVar1, num, STR_CONV_MODE_RIGHT_ALIGN, 4); ConvertIntToDecimalStringN(gStringVar1, num, STR_CONV_MODE_RIGHT_ALIGN, 4);
StringExpandPlaceholders(gStringVar4, gText_KOsInARow); StringExpandPlaceholders(gStringVar4, gText_KOsInARow);
AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, gStringVar4, x2, y, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, gStringVar4, x2, y, TEXT_SKIP_DRAW, NULL);
} }
static void ArenaPrintRecordStreak(u8 lvlMode, u8 x1, u8 x2, u8 y) static void ArenaPrintRecordStreak(u8 lvlMode, u8 x1, u8 x2, u8 y)
@@ -1314,29 +1314,29 @@ static void ShowArenaResultsWindow(void)
PrintHyphens(10); PrintHyphens(10);
StringExpandPlaceholders(gStringVar4, gText_SetKOTourneyResults); StringExpandPlaceholders(gStringVar4, gText_SetKOTourneyResults);
PrintAligned(gStringVar4, 2); PrintAligned(gStringVar4, 2);
AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, gText_Lv502, 16, 49, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, gText_Lv502, 16, 49, TEXT_SKIP_DRAW, NULL);
AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, gText_OpenLv, 16, 97, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, gText_OpenLv, 16, 97, TEXT_SKIP_DRAW, NULL);
ArenaPrintPrevOrCurrentStreak(FRONTIER_LVL_50, 72, 126, 49); ArenaPrintPrevOrCurrentStreak(FRONTIER_LVL_50, 72, 126, 49);
ArenaPrintRecordStreak(FRONTIER_LVL_50, 72, 126, 65); ArenaPrintRecordStreak(FRONTIER_LVL_50, 72, 126, 65);
ArenaPrintPrevOrCurrentStreak(FRONTIER_LVL_OPEN, 72, 126, 97); ArenaPrintPrevOrCurrentStreak(FRONTIER_LVL_OPEN, 72, 126, 97);
ArenaPrintRecordStreak(FRONTIER_LVL_OPEN, 72, 126, 113); ArenaPrintRecordStreak(FRONTIER_LVL_OPEN, 72, 126, 113);
PutWindowTilemap(gRecordsWindowId); PutWindowTilemap(gRecordsWindowId);
CopyWindowToVram(gRecordsWindowId, 3); CopyWindowToVram(gRecordsWindowId, COPYWIN_FULL);
} }
// Battle Factory records. // Battle Factory records.
static void FactoryPrintStreak(const u8 *str, u16 num1, u16 num2, u8 x1, u8 x2, u8 x3, u8 y) static void FactoryPrintStreak(const u8 *str, u16 num1, u16 num2, u8 x1, u8 x2, u8 x3, u8 y)
{ {
AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, str, x1, y, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, str, x1, y, TEXT_SKIP_DRAW, NULL);
if (num1 > MAX_STREAK) if (num1 > MAX_STREAK)
num1 = MAX_STREAK; num1 = MAX_STREAK;
ConvertIntToDecimalStringN(gStringVar1, num1, STR_CONV_MODE_RIGHT_ALIGN, 4); ConvertIntToDecimalStringN(gStringVar1, num1, STR_CONV_MODE_RIGHT_ALIGN, 4);
StringExpandPlaceholders(gStringVar4, gText_WinStreak); StringExpandPlaceholders(gStringVar4, gText_WinStreak);
AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, gStringVar4, x2, y, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, gStringVar4, x2, y, TEXT_SKIP_DRAW, NULL);
ConvertIntToDecimalStringN(gStringVar1, num2, STR_CONV_MODE_RIGHT_ALIGN, 4); ConvertIntToDecimalStringN(gStringVar1, num2, STR_CONV_MODE_RIGHT_ALIGN, 4);
StringExpandPlaceholders(gStringVar4, gText_TimesVar1); StringExpandPlaceholders(gStringVar4, gText_TimesVar1);
AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, gStringVar4, x3, y, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, gStringVar4, x3, y, TEXT_SKIP_DRAW, NULL);
} }
static void FactoryPrintRecordStreak(u8 battleMode, u8 lvlMode, u8 x1, u8 x2, u8 x3, u8 y) static void FactoryPrintRecordStreak(u8 battleMode, u8 lvlMode, u8 x1, u8 x2, u8 x3, u8 y)
@@ -1403,27 +1403,27 @@ static void ShowFactoryResultsWindow(u8 battleMode)
StringExpandPlaceholders(gStringVar4, gText_BattleSwapDoubleResults); StringExpandPlaceholders(gStringVar4, gText_BattleSwapDoubleResults);
PrintAligned(gStringVar4, 0); PrintAligned(gStringVar4, 0);
AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, gText_Lv502, 8, 33, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, gText_Lv502, 8, 33, TEXT_SKIP_DRAW, NULL);
AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, gText_RentalSwap, 152, 33, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, gText_RentalSwap, 152, 33, TEXT_SKIP_DRAW, NULL);
AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, gText_OpenLv, 8, 97, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, gText_OpenLv, 8, 97, TEXT_SKIP_DRAW, NULL);
PrintHyphens(10); PrintHyphens(10);
FactoryPrintPrevOrCurrentStreak(battleMode, FRONTIER_LVL_50, 8, 64, 158, 49); FactoryPrintPrevOrCurrentStreak(battleMode, FRONTIER_LVL_50, 8, 64, 158, 49);
FactoryPrintRecordStreak(battleMode, FRONTIER_LVL_50, 8, 64, 158, 65); FactoryPrintRecordStreak(battleMode, FRONTIER_LVL_50, 8, 64, 158, 65);
FactoryPrintPrevOrCurrentStreak(battleMode, FRONTIER_LVL_OPEN, 8, 64, 158, 113); FactoryPrintPrevOrCurrentStreak(battleMode, FRONTIER_LVL_OPEN, 8, 64, 158, 113);
FactoryPrintRecordStreak(battleMode, FRONTIER_LVL_OPEN, 8, 64, 158, 129); FactoryPrintRecordStreak(battleMode, FRONTIER_LVL_OPEN, 8, 64, 158, 129);
PutWindowTilemap(gRecordsWindowId); PutWindowTilemap(gRecordsWindowId);
CopyWindowToVram(gRecordsWindowId, 3); CopyWindowToVram(gRecordsWindowId, COPYWIN_FULL);
} }
// Battle Pyramid records. // Battle Pyramid records.
static void PyramidPrintStreak(const u8 *str, u16 num, u8 x1, u8 x2, u8 y) static void PyramidPrintStreak(const u8 *str, u16 num, u8 x1, u8 x2, u8 y)
{ {
AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, str, x1, y, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, str, x1, y, TEXT_SKIP_DRAW, NULL);
if (num > MAX_STREAK) if (num > MAX_STREAK)
num = MAX_STREAK; num = MAX_STREAK;
ConvertIntToDecimalStringN(gStringVar1, num, STR_CONV_MODE_RIGHT_ALIGN, 4); ConvertIntToDecimalStringN(gStringVar1, num, STR_CONV_MODE_RIGHT_ALIGN, 4);
StringExpandPlaceholders(gStringVar4, gText_FloorsCleared); StringExpandPlaceholders(gStringVar4, gText_FloorsCleared);
AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, gStringVar4, x2, y, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, gStringVar4, x2, y, TEXT_SKIP_DRAW, NULL);
} }
static void PyramidPrintRecordStreak(u8 lvlMode, u8 x1, u8 x2, u8 y) static void PyramidPrintRecordStreak(u8 lvlMode, u8 x1, u8 x2, u8 y)
@@ -1464,15 +1464,15 @@ static void ShowPyramidResultsWindow(void)
FillWindowPixelBuffer(gRecordsWindowId, PIXEL_FILL(1)); FillWindowPixelBuffer(gRecordsWindowId, PIXEL_FILL(1));
StringExpandPlaceholders(gStringVar4, gText_BattleQuestResults); StringExpandPlaceholders(gStringVar4, gText_BattleQuestResults);
PrintAligned(gStringVar4, 2); PrintAligned(gStringVar4, 2);
AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, gText_Lv502, 8, 49, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, gText_Lv502, 8, 49, TEXT_SKIP_DRAW, NULL);
AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, gText_OpenLv, 8, 97, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, gText_OpenLv, 8, 97, TEXT_SKIP_DRAW, NULL);
PrintHyphens(10); PrintHyphens(10);
PyramidPrintPrevOrCurrentStreak(FRONTIER_LVL_50, 64, 111, 49); PyramidPrintPrevOrCurrentStreak(FRONTIER_LVL_50, 64, 111, 49);
PyramidPrintRecordStreak(FRONTIER_LVL_50, 64, 111, 65); PyramidPrintRecordStreak(FRONTIER_LVL_50, 64, 111, 65);
PyramidPrintPrevOrCurrentStreak(FRONTIER_LVL_OPEN, 64, 111, 97); PyramidPrintPrevOrCurrentStreak(FRONTIER_LVL_OPEN, 64, 111, 97);
PyramidPrintRecordStreak(FRONTIER_LVL_OPEN, 64, 111, 113); PyramidPrintRecordStreak(FRONTIER_LVL_OPEN, 64, 111, 113);
PutWindowTilemap(gRecordsWindowId); PutWindowTilemap(gRecordsWindowId);
CopyWindowToVram(gRecordsWindowId, 3); CopyWindowToVram(gRecordsWindowId, COPYWIN_FULL);
} }
// Link contest records. Why is it in this file? // Link contest records. Why is it in this file?
@@ -1488,42 +1488,42 @@ static void ShowLinkContestResultsWindow(void)
StringExpandPlaceholders(gStringVar4, gText_LinkContestResults); StringExpandPlaceholders(gStringVar4, gText_LinkContestResults);
x = GetStringCenterAlignXOffset(FONT_NORMAL, gStringVar4, 208); x = GetStringCenterAlignXOffset(FONT_NORMAL, gStringVar4, 208);
AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, gStringVar4, x, 1, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, gStringVar4, x, 1, TEXT_SKIP_DRAW, NULL);
str = gText_1st; str = gText_1st;
x = GetStringRightAlignXOffset(FONT_NORMAL, str, 38) + 50; x = GetStringRightAlignXOffset(FONT_NORMAL, str, 38) + 50;
AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, str, x, 25, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, str, x, 25, TEXT_SKIP_DRAW, NULL);
str = gText_2nd; str = gText_2nd;
x = GetStringRightAlignXOffset(FONT_NORMAL, str, 38) + 88; x = GetStringRightAlignXOffset(FONT_NORMAL, str, 38) + 88;
AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, str, x, 25, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, str, x, 25, TEXT_SKIP_DRAW, NULL);
str = gText_3rd; str = gText_3rd;
x = GetStringRightAlignXOffset(FONT_NORMAL, str, 38) + 126; x = GetStringRightAlignXOffset(FONT_NORMAL, str, 38) + 126;
AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, str, x, 25, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, str, x, 25, TEXT_SKIP_DRAW, NULL);
str = gText_4th; str = gText_4th;
x = GetStringRightAlignXOffset(FONT_NORMAL, str, 38) + 164; x = GetStringRightAlignXOffset(FONT_NORMAL, str, 38) + 164;
AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, str, x, 25, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, str, x, 25, TEXT_SKIP_DRAW, NULL);
x = 6; x = 6;
AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, gText_Cool, x, 41, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, gText_Cool, x, 41, TEXT_SKIP_DRAW, NULL);
AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, gText_Beauty, x, 57, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, gText_Beauty, x, 57, TEXT_SKIP_DRAW, NULL);
AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, gText_Cute, x, 73, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, gText_Cute, x, 73, TEXT_SKIP_DRAW, NULL);
AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, gText_Smart, x, 89, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, gText_Smart, x, 89, TEXT_SKIP_DRAW, NULL);
AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, gText_Tough, x, 105, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, gText_Tough, x, 105, TEXT_SKIP_DRAW, NULL);
for (i = 0; i < CONTEST_CATEGORIES_COUNT; i++) for (i = 0; i < CONTEST_CATEGORIES_COUNT; i++)
{ {
for (j = 0; j < CONTESTANT_COUNT; j++) for (j = 0; j < CONTESTANT_COUNT; j++)
{ {
ConvertIntToDecimalStringN(gStringVar4, gSaveBlock2Ptr->contestLinkResults[i][j], STR_CONV_MODE_RIGHT_ALIGN, 4); ConvertIntToDecimalStringN(gStringVar4, gSaveBlock2Ptr->contestLinkResults[i][j], STR_CONV_MODE_RIGHT_ALIGN, 4);
AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, gStringVar4, (j * 38) + 64, (i * 16) + 41, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, gStringVar4, (j * 38) + 64, (i * 16) + 41, TEXT_SKIP_DRAW, NULL);
} }
} }
PutWindowTilemap(gRecordsWindowId); PutWindowTilemap(gRecordsWindowId);
CopyWindowToVram(gRecordsWindowId, 3); CopyWindowToVram(gRecordsWindowId, COPYWIN_FULL);
} }
static void CheckPutFrontierTVShowOnAir(void) static void CheckPutFrontierTVShowOnAir(void)
@@ -2224,18 +2224,18 @@ static void Print1PRecord(s32 position, s32 x, s32 y, struct RankingHall1P *hall
u8 text[32]; u8 text[32];
u16 winStreak; u16 winStreak;
AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, gText_123Dot[position], x * 8, (8 * (y + 5 * position)) + 1, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, gText_123Dot[position], x * 8, (8 * (y + 5 * position)) + 1, TEXT_SKIP_DRAW, NULL);
hallRecord->name[PLAYER_NAME_LENGTH] = EOS; hallRecord->name[PLAYER_NAME_LENGTH] = EOS;
if (hallRecord->winStreak) if (hallRecord->winStreak)
{ {
TVShowConvertInternationalString(text, hallRecord->name, hallRecord->language); TVShowConvertInternationalString(text, hallRecord->name, hallRecord->language);
AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, text, (x + 2) * 8, (8 * (y + 5 * position)) + 1, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, text, (x + 2) * 8, (8 * (y + 5 * position)) + 1, TEXT_SKIP_DRAW, NULL);
winStreak = hallRecord->winStreak; winStreak = hallRecord->winStreak;
if (winStreak > MAX_STREAK) if (winStreak > MAX_STREAK)
winStreak = MAX_STREAK; winStreak = MAX_STREAK;
ConvertIntToDecimalStringN(gStringVar2, winStreak, STR_CONV_MODE_RIGHT_ALIGN, 4); ConvertIntToDecimalStringN(gStringVar2, winStreak, STR_CONV_MODE_RIGHT_ALIGN, 4);
StringExpandPlaceholders(gStringVar4, sHallFacilityToRecordsText[hallFacilityId]); StringExpandPlaceholders(gStringVar4, sHallFacilityToRecordsText[hallFacilityId]);
AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, gStringVar4, GetStringRightAlignXOffset(FONT_NORMAL, sHallFacilityToRecordsText[hallFacilityId], 0xC8), (8 * (y + 5 * position)) + 1, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, gStringVar4, GetStringRightAlignXOffset(FONT_NORMAL, sHallFacilityToRecordsText[hallFacilityId], 0xC8), (8 * (y + 5 * position)) + 1, TEXT_SKIP_DRAW, NULL);
} }
} }
@@ -2244,25 +2244,25 @@ static void Print2PRecord(s32 position, s32 x, s32 y, struct RankingHall2P *hall
u8 text[32]; u8 text[32];
u16 winStreak; u16 winStreak;
AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, gText_123Dot[position], x * 8, (8 * (y + 5 * position)) + 1, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, gText_123Dot[position], x * 8, (8 * (y + 5 * position)) + 1, TEXT_SKIP_DRAW, NULL);
if (hallRecord->winStreak) if (hallRecord->winStreak)
{ {
hallRecord->name1[PLAYER_NAME_LENGTH] = EOS; hallRecord->name1[PLAYER_NAME_LENGTH] = EOS;
hallRecord->name2[PLAYER_NAME_LENGTH] = EOS; hallRecord->name2[PLAYER_NAME_LENGTH] = EOS;
TVShowConvertInternationalString(text, hallRecord->name1, hallRecord->language); TVShowConvertInternationalString(text, hallRecord->name1, hallRecord->language);
AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, text, (x + 2) * 8, (8 * (y + 5 * position - 1)) + 1, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, text, (x + 2) * 8, (8 * (y + 5 * position - 1)) + 1, TEXT_SKIP_DRAW, NULL);
if (IsStringJapanese(hallRecord->name2)) if (IsStringJapanese(hallRecord->name2))
TVShowConvertInternationalString(text, hallRecord->name2, LANGUAGE_JAPANESE); TVShowConvertInternationalString(text, hallRecord->name2, LANGUAGE_JAPANESE);
else else
StringCopy(text, hallRecord->name2); StringCopy(text, hallRecord->name2);
AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, text, (x + 4) * 8, (8 * (y + 5 * position + 1)) + 1, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, text, (x + 4) * 8, (8 * (y + 5 * position + 1)) + 1, TEXT_SKIP_DRAW, NULL);
winStreak = hallRecord->winStreak; winStreak = hallRecord->winStreak;
if (winStreak > MAX_STREAK) if (winStreak > MAX_STREAK)
winStreak = MAX_STREAK; winStreak = MAX_STREAK;
ConvertIntToDecimalStringN(gStringVar2, winStreak, STR_CONV_MODE_RIGHT_ALIGN, 4); ConvertIntToDecimalStringN(gStringVar2, winStreak, STR_CONV_MODE_RIGHT_ALIGN, 4);
StringExpandPlaceholders(gStringVar4, sHallFacilityToRecordsText[RANKING_HALL_TOWER_LINK]); StringExpandPlaceholders(gStringVar4, sHallFacilityToRecordsText[RANKING_HALL_TOWER_LINK]);
AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, gStringVar4, GetStringRightAlignXOffset(FONT_NORMAL, sHallFacilityToRecordsText[RANKING_HALL_TOWER_LINK], 0xC8), (8 * (y + 5 * position)) + 1, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, gStringVar4, GetStringRightAlignXOffset(FONT_NORMAL, sHallFacilityToRecordsText[RANKING_HALL_TOWER_LINK], 0xC8), (8 * (y + 5 * position)) + 1, TEXT_SKIP_DRAW, NULL);
} }
} }
@@ -2343,9 +2343,9 @@ static void PrintHallRecords(s32 hallFacilityId, s32 lvlMode)
StringCopy(gStringVar1, sRecordsWindowChallengeTexts[hallFacilityId][0]); StringCopy(gStringVar1, sRecordsWindowChallengeTexts[hallFacilityId][0]);
StringExpandPlaceholders(gStringVar4, sRecordsWindowChallengeTexts[hallFacilityId][1]); StringExpandPlaceholders(gStringVar4, sRecordsWindowChallengeTexts[hallFacilityId][1]);
AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, gStringVar4, 0, 1, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, gStringVar4, 0, 1, TEXT_SKIP_DRAW, NULL);
x = GetStringRightAlignXOffset(FONT_NORMAL, sLevelModeText[lvlMode], 0xD0); x = GetStringRightAlignXOffset(FONT_NORMAL, sLevelModeText[lvlMode], 0xD0);
AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, sLevelModeText[lvlMode], x, 1, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, sLevelModeText[lvlMode], x, 1, TEXT_SKIP_DRAW, NULL);
if (hallFacilityId == RANKING_HALL_TOWER_LINK) if (hallFacilityId == RANKING_HALL_TOWER_LINK)
{ {
gSaveBlock2Ptr->frontier.opponentNames[0][PLAYER_NAME_LENGTH] = EOS; gSaveBlock2Ptr->frontier.opponentNames[0][PLAYER_NAME_LENGTH] = EOS;
@@ -2369,14 +2369,14 @@ void ShowRankingHallRecordsWindow(void)
FillWindowPixelBuffer(gRecordsWindowId, PIXEL_FILL(1)); FillWindowPixelBuffer(gRecordsWindowId, PIXEL_FILL(1));
PrintHallRecords(gSpecialVar_0x8005, FRONTIER_LVL_50); PrintHallRecords(gSpecialVar_0x8005, FRONTIER_LVL_50);
PutWindowTilemap(gRecordsWindowId); PutWindowTilemap(gRecordsWindowId);
CopyWindowToVram(gRecordsWindowId, 3); CopyWindowToVram(gRecordsWindowId, COPYWIN_FULL);
} }
void ScrollRankingHallRecordsWindow(void) void ScrollRankingHallRecordsWindow(void)
{ {
FillWindowPixelBuffer(gRecordsWindowId, PIXEL_FILL(1)); FillWindowPixelBuffer(gRecordsWindowId, PIXEL_FILL(1));
PrintHallRecords(gSpecialVar_0x8005, FRONTIER_LVL_OPEN); PrintHallRecords(gSpecialVar_0x8005, FRONTIER_LVL_OPEN);
CopyWindowToVram(gRecordsWindowId, 2); CopyWindowToVram(gRecordsWindowId, COPYWIN_GFX);
} }
void ClearRankingHallRecords(void) void ClearRankingHallRecords(void)
+4 -4
View File
@@ -1272,10 +1272,10 @@ const u32 gPokedexAreaScreenAreaUnknown_Gfx[] = INCBIN_U32("graphics/pokedex/are
// seems to be fire red leftovers, but the menu elements is reused in the item menu for TM descriptions. // seems to be fire red leftovers, but the menu elements is reused in the item menu for TM descriptions.
const u16 gFireRedMenuElements1_Pal[] = INCBIN_U16("graphics/interface_fr/menu1.gbapal"); const u16 gMenuInfoElements1_Pal[] = INCBIN_U16("graphics/interface/menu_info1.gbapal");
const u16 gFireRedMenuElements2_Pal[] = INCBIN_U16("graphics/interface_fr/menu2.gbapal"); const u16 gMenuInfoElements2_Pal[] = INCBIN_U16("graphics/interface/menu_info2.gbapal");
const u16 gFireRedMenuElements3_Pal[] = INCBIN_U16("graphics/interface_fr/menu3.gbapal"); const u16 gMenuInfoElements3_Pal[] = INCBIN_U16("graphics/interface/menu_info3.gbapal");
const u8 gFireRedMenuElements_Gfx[] = INCBIN_U8("graphics/interface_fr/menu.4bpp"); //the types are reused for item menu const u8 gMenuInfoElements_Gfx[] = INCBIN_U8("graphics/interface/menu_info.4bpp"); //the types are reused for item menu
const u8 gBagMenuHMIcon_Gfx[] = INCBIN_U8("graphics/interface/hm.4bpp"); const u8 gBagMenuHMIcon_Gfx[] = INCBIN_U8("graphics/interface/hm.4bpp");
+30 -31
View File
@@ -343,7 +343,6 @@ static const struct HallofFameMon sDummyFameMon =
static const u8 sHallOfFame_SlotOrder[] = { static const u8 sHallOfFame_SlotOrder[] = {
2, 1, 3, 2, 1, 3,
6, 4, 5, 6, 4, 5,
0, 0
}; };
// code // code
@@ -515,7 +514,7 @@ static void Task_Hof_InitTeamSaveData(u8 taskId)
DrawDialogueFrame(0, 0); DrawDialogueFrame(0, 0);
AddTextPrinterParameterized2(0, FONT_NORMAL, gText_SavingDontTurnOffPower, 0, NULL, 2, 1, 3); AddTextPrinterParameterized2(0, FONT_NORMAL, gText_SavingDontTurnOffPower, 0, NULL, 2, 1, 3);
CopyWindowToVram(0, 3); CopyWindowToVram(0, COPYWIN_FULL);
gTasks[taskId].func = Task_Hof_TrySaveData; gTasks[taskId].func = Task_Hof_TrySaveData;
} }
@@ -676,7 +675,7 @@ static void Task_Hof_DoConfetti(u8 taskId)
} }
BeginNormalPaletteFade(sHofFadePalettes, 0, 12, 12, RGB(16, 29, 24)); BeginNormalPaletteFade(sHofFadePalettes, 0, 12, 12, RGB(16, 29, 24));
FillWindowPixelBuffer(0, PIXEL_FILL(0)); FillWindowPixelBuffer(0, PIXEL_FILL(0));
CopyWindowToVram(0, 3); CopyWindowToVram(0, COPYWIN_FULL);
gTasks[taskId].tFrameCount = 7; gTasks[taskId].tFrameCount = 7;
gTasks[taskId].func = Task_Hof_WaitToDisplayPlayer; gTasks[taskId].func = Task_Hof_WaitToDisplayPlayer;
} }
@@ -725,7 +724,7 @@ static void Task_Hof_WaitAndPrintPlayerInfo(u8 taskId)
HallOfFame_PrintPlayerInfo(1, 2); HallOfFame_PrintPlayerInfo(1, 2);
DrawDialogueFrame(0, 0); DrawDialogueFrame(0, 0);
AddTextPrinterParameterized2(0, FONT_NORMAL, gText_LeagueChamp, 0, NULL, 2, 1, 3); AddTextPrinterParameterized2(0, FONT_NORMAL, gText_LeagueChamp, 0, NULL, 2, 1, 3);
CopyWindowToVram(0, 3); CopyWindowToVram(0, COPYWIN_FULL);
gTasks[taskId].func = Task_Hof_ExitOnKeyPressed; gTasks[taskId].func = Task_Hof_ExitOnKeyPressed;
} }
} }
@@ -862,7 +861,7 @@ void CB2_DoHallOfFamePC(void)
static void Task_HofPC_CopySaveData(u8 taskId) static void Task_HofPC_CopySaveData(u8 taskId)
{ {
sub_81980F0(0, 0x1E, 0, 0xC, 0x226); HofPCTopBar_AddWindow(0, 30, 0, 12, 0x226);
if (Save_LoadGameData(SAVE_HALL_OF_FAME) != SAVE_STATUS_OK) if (Save_LoadGameData(SAVE_HALL_OF_FAME) != SAVE_STATUS_OK)
{ {
gTasks[taskId].func = Task_HofPC_PrintDataIsCorrupted; gTasks[taskId].func = Task_HofPC_PrintDataIsCorrupted;
@@ -950,9 +949,9 @@ static void Task_HofPC_DrawSpritesPrintText(u8 taskId)
StringExpandPlaceholders(gStringVar4, gText_HOFNumber); StringExpandPlaceholders(gStringVar4, gText_HOFNumber);
if (gTasks[taskId].tCurrTeamNo <= 0) if (gTasks[taskId].tCurrTeamNo <= 0)
sub_8198204(gStringVar4, gText_PickCancel, 0, 0, TRUE); HofPCTopBar_PrintPair(gStringVar4, gText_PickCancel, FALSE, 0, TRUE);
else else
sub_8198204(gStringVar4, gText_PickNextCancel, 0, 0, TRUE); HofPCTopBar_PrintPair(gStringVar4, gText_PickNextCancel, FALSE, 0, TRUE);
gTasks[taskId].func = Task_HofPC_PrintMonInfo; gTasks[taskId].func = Task_HofPC_PrintMonInfo;
} }
@@ -1073,7 +1072,7 @@ static void Task_HofPC_HandleExit(u8 taskId)
HideBg(0); HideBg(0);
HideBg(1); HideBg(1);
HideBg(3); HideBg(3);
sub_8198314(); HofPCTopBar_RemoveWindow();
FreeAllWindowBuffers(); FreeAllWindowBuffers();
UnsetBgTilemapBuffer(1); UnsetBgTilemapBuffer(1);
UnsetBgTilemapBuffer(3); UnsetBgTilemapBuffer(3);
@@ -1091,10 +1090,10 @@ static void Task_HofPC_HandleExit(u8 taskId)
static void Task_HofPC_PrintDataIsCorrupted(u8 taskId) static void Task_HofPC_PrintDataIsCorrupted(u8 taskId)
{ {
sub_8198180(gText_AButtonExit, 8, TRUE); HofPCTopBar_Print(gText_AButtonExit, 8, TRUE);
DrawDialogueFrame(0, 0); DrawDialogueFrame(0, 0);
AddTextPrinterParameterized2(0, FONT_NORMAL, gText_HOFCorrupted, 0, NULL, 2, 1, 3); AddTextPrinterParameterized2(0, FONT_NORMAL, gText_HOFCorrupted, 0, NULL, 2, 1, 3);
CopyWindowToVram(0, 3); CopyWindowToVram(0, COPYWIN_FULL);
gTasks[taskId].func = Task_HofPC_ExitOnButtonPress; gTasks[taskId].func = Task_HofPC_ExitOnButtonPress;
} }
@@ -1115,7 +1114,7 @@ static void HallOfFame_PrintWelcomeText(u8 unusedPossiblyWindowId, u8 unused2)
FillWindowPixelBuffer(0, PIXEL_FILL(0)); FillWindowPixelBuffer(0, PIXEL_FILL(0));
PutWindowTilemap(0); PutWindowTilemap(0);
AddTextPrinterParameterized3(0, FONT_NORMAL, GetStringCenterAlignXOffset(FONT_NORMAL, gText_WelcomeToHOF, 0xD0), 1, sMonInfoTextColors, 0, gText_WelcomeToHOF); AddTextPrinterParameterized3(0, FONT_NORMAL, GetStringCenterAlignXOffset(FONT_NORMAL, gText_WelcomeToHOF, 0xD0), 1, sMonInfoTextColors, 0, gText_WelcomeToHOF);
CopyWindowToVram(0, 3); CopyWindowToVram(0, COPYWIN_FULL);
} }
static void HallOfFame_PrintMonInfo(struct HallofFameMon* currMon, u8 unused1, u8 unused2) static void HallOfFame_PrintMonInfo(struct HallofFameMon* currMon, u8 unused1, u8 unused2)
@@ -1150,7 +1149,7 @@ static void HallOfFame_PrintMonInfo(struct HallofFameMon* currMon, u8 unused1, u
*(stringPtr)++ = CHAR_QUESTION_MARK; *(stringPtr)++ = CHAR_QUESTION_MARK;
} }
stringPtr[0] = EOS; stringPtr[0] = EOS;
AddTextPrinterParameterized3(0, FONT_NORMAL, 0x10, 1, sMonInfoTextColors, -1, text); AddTextPrinterParameterized3(0, FONT_NORMAL, 0x10, 1, sMonInfoTextColors, TEXT_SKIP_DRAW, text);
} }
// nick, species names, gender and level // nick, species names, gender and level
@@ -1159,13 +1158,13 @@ static void HallOfFame_PrintMonInfo(struct HallofFameMon* currMon, u8 unused1, u
if (currMon->species == SPECIES_EGG) if (currMon->species == SPECIES_EGG)
{ {
width = GetStringCenterAlignXOffset(FONT_NORMAL, text, 0xD0); width = GetStringCenterAlignXOffset(FONT_NORMAL, text, 0xD0);
AddTextPrinterParameterized3(0, FONT_NORMAL, width, 1, sMonInfoTextColors, -1, text); AddTextPrinterParameterized3(0, FONT_NORMAL, width, 1, sMonInfoTextColors, TEXT_SKIP_DRAW, text);
CopyWindowToVram(0, 3); CopyWindowToVram(0, COPYWIN_FULL);
} }
else else
{ {
width = GetStringRightAlignXOffset(FONT_NORMAL, text, 0x80); width = GetStringRightAlignXOffset(FONT_NORMAL, text, 0x80);
AddTextPrinterParameterized3(0, FONT_NORMAL, width, 1, sMonInfoTextColors, -1, text); AddTextPrinterParameterized3(0, FONT_NORMAL, width, 1, sMonInfoTextColors, TEXT_SKIP_DRAW, text);
text[0] = CHAR_SLASH; text[0] = CHAR_SLASH;
stringPtr = StringCopy(text + 1, gSpeciesNames[currMon->species]); stringPtr = StringCopy(text + 1, gSpeciesNames[currMon->species]);
@@ -1186,17 +1185,17 @@ static void HallOfFame_PrintMonInfo(struct HallofFameMon* currMon, u8 unused1, u
} }
stringPtr[0] = EOS; stringPtr[0] = EOS;
AddTextPrinterParameterized3(0, FONT_NORMAL, 0x80, 1, sMonInfoTextColors, -1, text); AddTextPrinterParameterized3(0, FONT_NORMAL, 0x80, 1, sMonInfoTextColors, TEXT_SKIP_DRAW, text);
stringPtr = StringCopy(text, gText_Level); stringPtr = StringCopy(text, gText_Level);
ConvertIntToDecimalStringN(stringPtr, currMon->lvl, STR_CONV_MODE_LEFT_ALIGN, 3); ConvertIntToDecimalStringN(stringPtr, currMon->lvl, STR_CONV_MODE_LEFT_ALIGN, 3);
AddTextPrinterParameterized3(0, FONT_NORMAL, 0x24, 0x11, sMonInfoTextColors, -1, text); AddTextPrinterParameterized3(0, FONT_NORMAL, 0x24, 0x11, sMonInfoTextColors, TEXT_SKIP_DRAW, text);
stringPtr = StringCopy(text, gText_IDNumber); stringPtr = StringCopy(text, gText_IDNumber);
ConvertIntToDecimalStringN(stringPtr, (u16)(currMon->tid), STR_CONV_MODE_LEADING_ZEROS, 5); ConvertIntToDecimalStringN(stringPtr, (u16)(currMon->tid), STR_CONV_MODE_LEADING_ZEROS, 5);
AddTextPrinterParameterized3(0, FONT_NORMAL, 0x68, 0x11, sMonInfoTextColors, -1, text); AddTextPrinterParameterized3(0, FONT_NORMAL, 0x68, 0x11, sMonInfoTextColors, TEXT_SKIP_DRAW, text);
CopyWindowToVram(0, 3); CopyWindowToVram(0, COPYWIN_FULL);
} }
} }
@@ -1209,10 +1208,10 @@ static void HallOfFame_PrintPlayerInfo(u8 unused1, u8 unused2)
FillWindowPixelBuffer(1, PIXEL_FILL(1)); FillWindowPixelBuffer(1, PIXEL_FILL(1));
PutWindowTilemap(1); PutWindowTilemap(1);
DrawStdFrameWithCustomTileAndPalette(1, FALSE, 0x21D, 0xD); DrawStdFrameWithCustomTileAndPalette(1, FALSE, 0x21D, 0xD);
AddTextPrinterParameterized3(1, FONT_NORMAL, 0, 1, sPlayerInfoTextColors, -1, gText_Name); AddTextPrinterParameterized3(1, FONT_NORMAL, 0, 1, sPlayerInfoTextColors, TEXT_SKIP_DRAW, gText_Name);
width = GetStringRightAlignXOffset(FONT_NORMAL, gSaveBlock2Ptr->playerName, 0x70); width = GetStringRightAlignXOffset(FONT_NORMAL, gSaveBlock2Ptr->playerName, 0x70);
AddTextPrinterParameterized3(1, FONT_NORMAL, width, 1, sPlayerInfoTextColors, -1, gSaveBlock2Ptr->playerName); AddTextPrinterParameterized3(1, FONT_NORMAL, width, 1, sPlayerInfoTextColors, TEXT_SKIP_DRAW, gSaveBlock2Ptr->playerName);
trainerId = (gSaveBlock2Ptr->playerTrainerId[0]) | (gSaveBlock2Ptr->playerTrainerId[1] << 8); trainerId = (gSaveBlock2Ptr->playerTrainerId[0]) | (gSaveBlock2Ptr->playerTrainerId[1] << 8);
AddTextPrinterParameterized3(1, FONT_NORMAL, 0, 0x11, sPlayerInfoTextColors, 0, gText_IDNumber); AddTextPrinterParameterized3(1, FONT_NORMAL, 0, 0x11, sPlayerInfoTextColors, 0, gText_IDNumber);
@@ -1223,9 +1222,9 @@ static void HallOfFame_PrintPlayerInfo(u8 unused1, u8 unused2)
text[4] = (trainerId % 10) / 1 + CHAR_0; text[4] = (trainerId % 10) / 1 + CHAR_0;
text[5] = EOS; text[5] = EOS;
width = GetStringRightAlignXOffset(FONT_NORMAL, text, 0x70); width = GetStringRightAlignXOffset(FONT_NORMAL, text, 0x70);
AddTextPrinterParameterized3(1, FONT_NORMAL, width, 0x11, sPlayerInfoTextColors, -1, text); AddTextPrinterParameterized3(1, FONT_NORMAL, width, 0x11, sPlayerInfoTextColors, TEXT_SKIP_DRAW, text);
AddTextPrinterParameterized3(1, FONT_NORMAL, 0, 0x21, sPlayerInfoTextColors, -1, gText_Time); AddTextPrinterParameterized3(1, FONT_NORMAL, 0, 0x21, sPlayerInfoTextColors, TEXT_SKIP_DRAW, gText_Time);
text[0] = (gSaveBlock2Ptr->playTimeHours / 100) + CHAR_0; text[0] = (gSaveBlock2Ptr->playTimeHours / 100) + CHAR_0;
text[1] = (gSaveBlock2Ptr->playTimeHours % 100) / 10 + CHAR_0; text[1] = (gSaveBlock2Ptr->playTimeHours % 100) / 10 + CHAR_0;
text[2] = (gSaveBlock2Ptr->playTimeHours % 10) + CHAR_0; text[2] = (gSaveBlock2Ptr->playTimeHours % 10) + CHAR_0;
@@ -1241,9 +1240,9 @@ static void HallOfFame_PrintPlayerInfo(u8 unused1, u8 unused2)
text[6] = EOS; text[6] = EOS;
width = GetStringRightAlignXOffset(FONT_NORMAL, text, 0x70); width = GetStringRightAlignXOffset(FONT_NORMAL, text, 0x70);
AddTextPrinterParameterized3(1, FONT_NORMAL, width, 0x21, sPlayerInfoTextColors, -1, text); AddTextPrinterParameterized3(1, FONT_NORMAL, width, 0x21, sPlayerInfoTextColors, TEXT_SKIP_DRAW, text);
CopyWindowToVram(1, 3); CopyWindowToVram(1, COPYWIN_FULL);
} }
static void ClearVramOamPltt_LoadHofPal(void) static void ClearVramOamPltt_LoadHofPal(void)
@@ -1296,12 +1295,12 @@ static void InitHofBgs(void)
InitBgsFromTemplates(0, sHof_BgTemplates, ARRAY_COUNT(sHof_BgTemplates)); InitBgsFromTemplates(0, sHof_BgTemplates, ARRAY_COUNT(sHof_BgTemplates));
SetBgTilemapBuffer(1, sHofGfxPtr->tilemap1); SetBgTilemapBuffer(1, sHofGfxPtr->tilemap1);
SetBgTilemapBuffer(3, sHofGfxPtr->tilemap2); SetBgTilemapBuffer(3, sHofGfxPtr->tilemap2);
ChangeBgX(0, 0, 0); ChangeBgX(0, 0, BG_COORD_SET);
ChangeBgY(0, 0, 0); ChangeBgY(0, 0, BG_COORD_SET);
ChangeBgX(1, 0, 0); ChangeBgX(1, 0, BG_COORD_SET);
ChangeBgY(1, 0, 0); ChangeBgY(1, 0, BG_COORD_SET);
ChangeBgX(3, 0, 0); ChangeBgX(3, 0, BG_COORD_SET);
ChangeBgY(3, 0, 0); ChangeBgY(3, 0, BG_COORD_SET);
} }
static bool8 LoadHofBgs(void) static bool8 LoadHofBgs(void)
+20 -20
View File
@@ -974,7 +974,7 @@ static void BagMenu_ItemPrintCallback(u8 windowId, u32 itemIndex, u8 y)
ConvertIntToDecimalStringN(gStringVar1, itemQuantity, STR_CONV_MODE_RIGHT_ALIGN, BERRY_CAPACITY_DIGITS); ConvertIntToDecimalStringN(gStringVar1, itemQuantity, STR_CONV_MODE_RIGHT_ALIGN, BERRY_CAPACITY_DIGITS);
StringExpandPlaceholders(gStringVar4, gText_xVar1); StringExpandPlaceholders(gStringVar4, gText_xVar1);
offset = GetStringRightAlignXOffset(FONT_NARROW, gStringVar4, 119); offset = GetStringRightAlignXOffset(FONT_NARROW, gStringVar4, 119);
BagMenu_Print(windowId, FONT_NARROW, gStringVar4, offset, y, 0, 0, TEXT_SPEED_FF, COLORID_NORMAL); BagMenu_Print(windowId, FONT_NARROW, gStringVar4, offset, y, 0, 0, TEXT_SKIP_DRAW, COLORID_NORMAL);
} }
else if (gBagPosition.pocket != KEYITEMS_POCKET && ItemId_GetImportance(itemId) == FALSE) else if (gBagPosition.pocket != KEYITEMS_POCKET && ItemId_GetImportance(itemId) == FALSE)
{ {
@@ -982,7 +982,7 @@ static void BagMenu_ItemPrintCallback(u8 windowId, u32 itemIndex, u8 y)
ConvertIntToDecimalStringN(gStringVar1, itemQuantity, STR_CONV_MODE_RIGHT_ALIGN, BAG_ITEM_CAPACITY_DIGITS); ConvertIntToDecimalStringN(gStringVar1, itemQuantity, STR_CONV_MODE_RIGHT_ALIGN, BAG_ITEM_CAPACITY_DIGITS);
StringExpandPlaceholders(gStringVar4, gText_xVar1); StringExpandPlaceholders(gStringVar4, gText_xVar1);
offset = GetStringRightAlignXOffset(FONT_NARROW, gStringVar4, 119); offset = GetStringRightAlignXOffset(FONT_NARROW, gStringVar4, 119);
BagMenu_Print(windowId, FONT_NARROW, gStringVar4, offset, y, 0, 0, TEXT_SPEED_FF, COLORID_NORMAL); BagMenu_Print(windowId, FONT_NARROW, gStringVar4, offset, y, 0, 0, TEXT_SKIP_DRAW, COLORID_NORMAL);
} }
else else
{ {
@@ -1204,7 +1204,7 @@ static void PrintItemSoldAmount(int windowId, int numSold, int moneyEarned)
u8 numDigits = (gBagPosition.pocket == BERRIES_POCKET) ? BERRY_CAPACITY_DIGITS : BAG_ITEM_CAPACITY_DIGITS; u8 numDigits = (gBagPosition.pocket == BERRIES_POCKET) ? BERRY_CAPACITY_DIGITS : BAG_ITEM_CAPACITY_DIGITS;
ConvertIntToDecimalStringN(gStringVar1, numSold, STR_CONV_MODE_LEADING_ZEROS, numDigits); ConvertIntToDecimalStringN(gStringVar1, numSold, STR_CONV_MODE_LEADING_ZEROS, numDigits);
StringExpandPlaceholders(gStringVar4, gText_xVar1); StringExpandPlaceholders(gStringVar4, gText_xVar1);
AddTextPrinterParameterized(windowId, FONT_NORMAL, gStringVar4, 0, 1, TEXT_SPEED_FF, 0); AddTextPrinterParameterized(windowId, FONT_NORMAL, gStringVar4, 0, 1, TEXT_SKIP_DRAW, 0);
PrintMoneyAmount(windowId, 38, 1, moneyEarned, 0); PrintMoneyAmount(windowId, 38, 1, moneyEarned, 0);
} }
@@ -1667,8 +1667,8 @@ static void OpenContextMenu(u8 taskId)
static void PrintContextMenuItems(u8 windowId) static void PrintContextMenuItems(u8 windowId)
{ {
AddItemMenuActionTextPrinters(windowId, FONT_NARROW, 8, 1, 0, 16, gBagMenu->contextMenuNumItems, sItemMenuActions, gBagMenu->contextMenuItemsPtr); PrintMenuActionTexts(windowId, FONT_NARROW, 8, 1, 0, 16, gBagMenu->contextMenuNumItems, sItemMenuActions, gBagMenu->contextMenuItemsPtr);
InitMenuInUpperLeftCornerPlaySoundWhenAPressed(windowId, gBagMenu->contextMenuNumItems, 0); InitMenuInUpperLeftCornerNormal(windowId, gBagMenu->contextMenuNumItems, 0);
} }
static void PrintContextMenuItemGrid(u8 windowId, u8 columns, u8 rows) static void PrintContextMenuItemGrid(u8 windowId, u8 columns, u8 rows)
@@ -1720,7 +1720,7 @@ static void Task_ItemContext_MultipleRows(u8 taskId)
if (cursorPos > 0 && IsValidContextMenuPos(cursorPos - 2)) if (cursorPos > 0 && IsValidContextMenuPos(cursorPos - 2))
{ {
PlaySE(SE_SELECT); PlaySE(SE_SELECT);
ChangeListMenuCursorPosition(MENU_CURSOR_DELTA_NONE, MENU_CURSOR_DELTA_UP); ChangeMenuGridCursorPosition(MENU_CURSOR_DELTA_NONE, MENU_CURSOR_DELTA_UP);
} }
} }
else if (JOY_NEW(DPAD_DOWN)) else if (JOY_NEW(DPAD_DOWN))
@@ -1728,7 +1728,7 @@ static void Task_ItemContext_MultipleRows(u8 taskId)
if (cursorPos < (gBagMenu->contextMenuNumItems - 2) && IsValidContextMenuPos(cursorPos + 2)) if (cursorPos < (gBagMenu->contextMenuNumItems - 2) && IsValidContextMenuPos(cursorPos + 2))
{ {
PlaySE(SE_SELECT); PlaySE(SE_SELECT);
ChangeListMenuCursorPosition(MENU_CURSOR_DELTA_NONE, MENU_CURSOR_DELTA_DOWN); ChangeMenuGridCursorPosition(MENU_CURSOR_DELTA_NONE, MENU_CURSOR_DELTA_DOWN);
} }
} }
else if (JOY_NEW(DPAD_LEFT) || GetLRKeysPressed() == MENU_L_PRESSED) else if (JOY_NEW(DPAD_LEFT) || GetLRKeysPressed() == MENU_L_PRESSED)
@@ -1736,7 +1736,7 @@ static void Task_ItemContext_MultipleRows(u8 taskId)
if ((cursorPos & 1) && IsValidContextMenuPos(cursorPos - 1)) if ((cursorPos & 1) && IsValidContextMenuPos(cursorPos - 1))
{ {
PlaySE(SE_SELECT); PlaySE(SE_SELECT);
ChangeListMenuCursorPosition(MENU_CURSOR_DELTA_LEFT, MENU_CURSOR_DELTA_NONE); ChangeMenuGridCursorPosition(MENU_CURSOR_DELTA_LEFT, MENU_CURSOR_DELTA_NONE);
} }
} }
else if (JOY_NEW(DPAD_RIGHT) || GetLRKeysPressed() == MENU_R_PRESSED) else if (JOY_NEW(DPAD_RIGHT) || GetLRKeysPressed() == MENU_R_PRESSED)
@@ -1744,7 +1744,7 @@ static void Task_ItemContext_MultipleRows(u8 taskId)
if (!(cursorPos & 1) && IsValidContextMenuPos(cursorPos + 1)) if (!(cursorPos & 1) && IsValidContextMenuPos(cursorPos + 1))
{ {
PlaySE(SE_SELECT); PlaySE(SE_SELECT);
ChangeListMenuCursorPosition(MENU_CURSOR_DELTA_RIGHT, MENU_CURSOR_DELTA_NONE); ChangeMenuGridCursorPosition(MENU_CURSOR_DELTA_RIGHT, MENU_CURSOR_DELTA_NONE);
} }
} }
else if (JOY_NEW(A_BUTTON)) else if (JOY_NEW(A_BUTTON))
@@ -2039,7 +2039,7 @@ bool8 UseRegisteredKeyItemOnField(void)
if (InUnionRoom() == TRUE || InBattlePyramid() || InBattlePike() || InMultiPartnerRoom() == TRUE) if (InUnionRoom() == TRUE || InBattlePyramid() || InBattlePike() || InMultiPartnerRoom() == TRUE)
return FALSE; return FALSE;
HideMapNamePopUpWindow(); HideMapNamePopUpWindow();
ChangeBgY_ScreenOff(0, 0, 0); ChangeBgY_ScreenOff(0, 0, BG_COORD_SET);
if (gSaveBlock1Ptr->registeredItem != ITEM_NONE) if (gSaveBlock1Ptr->registeredItem != ITEM_NONE)
{ {
if (CheckBagHasItem(gSaveBlock1Ptr->registeredItem, 1) == TRUE) if (CheckBagHasItem(gSaveBlock1Ptr->registeredItem, 1) == TRUE)
@@ -2417,11 +2417,11 @@ static void PrintPocketNames(const u8 *pocketName1, const u8 *pocketName2)
windowId = AddWindow(&window); windowId = AddWindow(&window);
FillWindowPixelBuffer(windowId, PIXEL_FILL(0)); FillWindowPixelBuffer(windowId, PIXEL_FILL(0));
offset = GetStringCenterAlignXOffset(FONT_NORMAL, pocketName1, 0x40); offset = GetStringCenterAlignXOffset(FONT_NORMAL, pocketName1, 0x40);
BagMenu_Print(windowId, FONT_NORMAL, pocketName1, offset, 1, 0, 0, TEXT_SPEED_FF, COLORID_POCKET_NAME); BagMenu_Print(windowId, FONT_NORMAL, pocketName1, offset, 1, 0, 0, TEXT_SKIP_DRAW, COLORID_POCKET_NAME);
if (pocketName2) if (pocketName2)
{ {
offset = GetStringCenterAlignXOffset(FONT_NORMAL, pocketName2, 0x40); offset = GetStringCenterAlignXOffset(FONT_NORMAL, pocketName2, 0x40);
BagMenu_Print(windowId, FONT_NORMAL, pocketName2, offset + 0x40, 1, 0, 0, TEXT_SPEED_FF, COLORID_POCKET_NAME); BagMenu_Print(windowId, FONT_NORMAL, pocketName2, offset + 0x40, 1, 0, 0, TEXT_SKIP_DRAW, COLORID_POCKET_NAME);
} }
CpuCopy32((u8*)GetWindowAttribute(windowId, WINDOW_TILE_DATA), gBagMenu->pocketNameBuffer, sizeof(gBagMenu->pocketNameBuffer)); CpuCopy32((u8*)GetWindowAttribute(windowId, WINDOW_TILE_DATA), gBagMenu->pocketNameBuffer, sizeof(gBagMenu->pocketNameBuffer));
RemoveWindow(windowId); RemoveWindow(windowId);
@@ -2439,7 +2439,7 @@ static void CopyPocketNameToWindow(u32 a)
CpuCopy32(tileDataBuffer[0][a], windowTileData, 0x100); // Top half of pocket name CpuCopy32(tileDataBuffer[0][a], windowTileData, 0x100); // Top half of pocket name
b = a + 16; b = a + 16;
CpuCopy32(tileDataBuffer[0][b], windowTileData + 0x100, 0x100); // Bottom half of pocket name CpuCopy32(tileDataBuffer[0][b], windowTileData + 0x100, 0x100); // Bottom half of pocket name
CopyWindowToVram(WIN_POCKET_NAME, 2); CopyWindowToVram(WIN_POCKET_NAME, COPYWIN_GFX);
} }
static void LoadBagMenuTextWindows(void) static void LoadBagMenuTextWindows(void)
@@ -2544,7 +2544,7 @@ static void PrepareTMHMMoveWindow(void)
BlitMenuInfoIcon(WIN_TMHM_INFO_ICONS, MENU_INFO_ICON_POWER, 0, 12); BlitMenuInfoIcon(WIN_TMHM_INFO_ICONS, MENU_INFO_ICON_POWER, 0, 12);
BlitMenuInfoIcon(WIN_TMHM_INFO_ICONS, MENU_INFO_ICON_ACCURACY, 0, 24); BlitMenuInfoIcon(WIN_TMHM_INFO_ICONS, MENU_INFO_ICON_ACCURACY, 0, 24);
BlitMenuInfoIcon(WIN_TMHM_INFO_ICONS, MENU_INFO_ICON_PP, 0, 36); BlitMenuInfoIcon(WIN_TMHM_INFO_ICONS, MENU_INFO_ICON_PP, 0, 36);
CopyWindowToVram(WIN_TMHM_INFO_ICONS, 2); CopyWindowToVram(WIN_TMHM_INFO_ICONS, COPYWIN_GFX);
} }
static void PrintTMHMMoveData(u16 itemId) static void PrintTMHMMoveData(u16 itemId)
@@ -2557,8 +2557,8 @@ static void PrintTMHMMoveData(u16 itemId)
if (itemId == ITEM_NONE) if (itemId == ITEM_NONE)
{ {
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
BagMenu_Print(WIN_TMHM_INFO, FONT_NORMAL, gText_ThreeDashes, 7, i * 12, 0, 0, TEXT_SPEED_FF, COLORID_TMHM_INFO); BagMenu_Print(WIN_TMHM_INFO, FONT_NORMAL, gText_ThreeDashes, 7, i * 12, 0, 0, TEXT_SKIP_DRAW, COLORID_TMHM_INFO);
CopyWindowToVram(WIN_TMHM_INFO, 2); CopyWindowToVram(WIN_TMHM_INFO, COPYWIN_GFX);
} }
else else
{ {
@@ -2575,7 +2575,7 @@ static void PrintTMHMMoveData(u16 itemId)
ConvertIntToDecimalStringN(gStringVar1, gBattleMoves[moveId].power, STR_CONV_MODE_RIGHT_ALIGN, 3); ConvertIntToDecimalStringN(gStringVar1, gBattleMoves[moveId].power, STR_CONV_MODE_RIGHT_ALIGN, 3);
text = gStringVar1; text = gStringVar1;
} }
BagMenu_Print(WIN_TMHM_INFO, FONT_NORMAL, text, 7, 12, 0, 0, TEXT_SPEED_FF, COLORID_TMHM_INFO); BagMenu_Print(WIN_TMHM_INFO, FONT_NORMAL, text, 7, 12, 0, 0, TEXT_SKIP_DRAW, COLORID_TMHM_INFO);
// Print TMHM accuracy // Print TMHM accuracy
if (gBattleMoves[moveId].accuracy == 0) if (gBattleMoves[moveId].accuracy == 0)
@@ -2587,12 +2587,12 @@ static void PrintTMHMMoveData(u16 itemId)
ConvertIntToDecimalStringN(gStringVar1, gBattleMoves[moveId].accuracy, STR_CONV_MODE_RIGHT_ALIGN, 3); ConvertIntToDecimalStringN(gStringVar1, gBattleMoves[moveId].accuracy, STR_CONV_MODE_RIGHT_ALIGN, 3);
text = gStringVar1; text = gStringVar1;
} }
BagMenu_Print(WIN_TMHM_INFO, FONT_NORMAL, text, 7, 24, 0, 0, TEXT_SPEED_FF, COLORID_TMHM_INFO); BagMenu_Print(WIN_TMHM_INFO, FONT_NORMAL, text, 7, 24, 0, 0, TEXT_SKIP_DRAW, COLORID_TMHM_INFO);
// Print TMHM pp // Print TMHM pp
ConvertIntToDecimalStringN(gStringVar1, gBattleMoves[moveId].pp, STR_CONV_MODE_RIGHT_ALIGN, 3); ConvertIntToDecimalStringN(gStringVar1, gBattleMoves[moveId].pp, STR_CONV_MODE_RIGHT_ALIGN, 3);
BagMenu_Print(WIN_TMHM_INFO, FONT_NORMAL, gStringVar1, 7, 36, 0, 0, TEXT_SPEED_FF, COLORID_TMHM_INFO); BagMenu_Print(WIN_TMHM_INFO, FONT_NORMAL, gStringVar1, 7, 36, 0, 0, TEXT_SKIP_DRAW, COLORID_TMHM_INFO);
CopyWindowToVram(WIN_TMHM_INFO, 2); CopyWindowToVram(WIN_TMHM_INFO, COPYWIN_GFX);
} }
} }
+4 -4
View File
@@ -1648,8 +1648,8 @@ static void ErrorMsg_MoveCloserToPartner(void)
AddTextPrinterParameterized3(2, FONT_SHORT_COPY_1, 2, 1, sTextColors, 0, gText_MoveCloserToLinkPartner); AddTextPrinterParameterized3(2, FONT_SHORT_COPY_1, 2, 1, sTextColors, 0, gText_MoveCloserToLinkPartner);
PutWindowTilemap(0); PutWindowTilemap(0);
PutWindowTilemap(2); PutWindowTilemap(2);
CopyWindowToVram(0, 0); CopyWindowToVram(0, COPYWIN_NONE); // Does nothing
CopyWindowToVram(2, 3); CopyWindowToVram(2, COPYWIN_FULL);
} }
static void ErrorMsg_CheckConnections(void) static void ErrorMsg_CheckConnections(void)
@@ -1660,8 +1660,8 @@ static void ErrorMsg_CheckConnections(void)
AddTextPrinterParameterized3(1, FONT_SHORT_COPY_1, 2, 0, sTextColors, 0, gText_CommErrorCheckConnections); AddTextPrinterParameterized3(1, FONT_SHORT_COPY_1, 2, 0, sTextColors, 0, gText_CommErrorCheckConnections);
PutWindowTilemap(1); PutWindowTilemap(1);
PutWindowTilemap(2); PutWindowTilemap(2);
CopyWindowToVram(1, 0); CopyWindowToVram(1, COPYWIN_NONE); // Does nothing
CopyWindowToVram(2, 3); CopyWindowToVram(2, COPYWIN_FULL);
} }
static void CB2_PrintErrorMessage(void) static void CB2_PrintErrorMessage(void)
+9 -9
View File
@@ -330,7 +330,7 @@ s32 DoMysteryGiftListMenu(const struct WindowTemplate *windowTemplate, const str
gMultiuseListMenuTemplate = *listMenuTemplate; gMultiuseListMenuTemplate = *listMenuTemplate;
gMultiuseListMenuTemplate.windowId = sMysteryGiftLinkMenu.windowId; gMultiuseListMenuTemplate.windowId = sMysteryGiftLinkMenu.windowId;
sMysteryGiftLinkMenu.listTaskId = ListMenuInit(&gMultiuseListMenuTemplate, 0, 0); sMysteryGiftLinkMenu.listTaskId = ListMenuInit(&gMultiuseListMenuTemplate, 0, 0);
CopyWindowToVram(sMysteryGiftLinkMenu.windowId, 1); CopyWindowToVram(sMysteryGiftLinkMenu.windowId, COPYWIN_MAP);
sMysteryGiftLinkMenu.state = 1; sMysteryGiftLinkMenu.state = 1;
break; break;
case 1: case 1:
@@ -364,7 +364,7 @@ s32 DoMysteryGiftListMenu(const struct WindowTemplate *windowTemplate, const str
} }
} }
CopyWindowToVram(sMysteryGiftLinkMenu.windowId, 1); CopyWindowToVram(sMysteryGiftLinkMenu.windowId, COPYWIN_MAP);
} }
break; break;
case 2: case 2:
@@ -381,7 +381,7 @@ u8 ListMenuInit(struct ListMenuTemplate *listMenuTemplate, u16 scrollOffset, u16
{ {
u8 taskId = ListMenuInitInternal(listMenuTemplate, scrollOffset, selectedRow); u8 taskId = ListMenuInitInternal(listMenuTemplate, scrollOffset, selectedRow);
PutWindowTilemap(listMenuTemplate->windowId); PutWindowTilemap(listMenuTemplate->windowId);
CopyWindowToVram(listMenuTemplate->windowId, 2); CopyWindowToVram(listMenuTemplate->windowId, COPYWIN_GFX);
return taskId; return taskId;
} }
@@ -401,7 +401,7 @@ u8 ListMenuInitInRect(struct ListMenuTemplate *listMenuTemplate, struct ListMenu
rect[i].height, rect[i].height,
rect[i].palNum); rect[i].palNum);
} }
CopyWindowToVram(listMenuTemplate->windowId, 2); CopyWindowToVram(listMenuTemplate->windowId, COPYWIN_GFX);
return taskId; return taskId;
} }
@@ -489,7 +489,7 @@ void RedrawListMenu(u8 listTaskId)
FillWindowPixelBuffer(list->template.windowId, PIXEL_FILL(list->template.fillValue)); FillWindowPixelBuffer(list->template.windowId, PIXEL_FILL(list->template.fillValue));
ListMenuPrintEntries(list, list->scrollOffset, 0, list->template.maxShowed); ListMenuPrintEntries(list, list->scrollOffset, 0, list->template.maxShowed);
ListMenuDrawCursor(list); ListMenuDrawCursor(list);
CopyWindowToVram(list->template.windowId, 2); CopyWindowToVram(list->template.windowId, COPYWIN_GFX);
} }
// unused // unused
@@ -604,7 +604,7 @@ static void ListMenuPrint(struct ListMenu *list, const u8 *str, u8 x, u8 y)
gListMenuOverride.fontId, gListMenuOverride.fontId,
x, y, x, y,
gListMenuOverride.lettersSpacing, gListMenuOverride.lettersSpacing,
0, colors, TEXT_SPEED_FF, str); 0, colors, TEXT_SKIP_DRAW, str);
gListMenuOverride.enabled = FALSE; gListMenuOverride.enabled = FALSE;
} }
@@ -617,7 +617,7 @@ static void ListMenuPrint(struct ListMenu *list, const u8 *str, u8 x, u8 y)
list->template.fontId, list->template.fontId,
x, y, x, y,
list->template.lettersSpacing, list->template.lettersSpacing,
0, colors, TEXT_SPEED_FF, str); 0, colors, TEXT_SKIP_DRAW, str);
} }
} }
@@ -862,7 +862,7 @@ static bool8 ListMenuChangeSelection(struct ListMenu *list, bool8 updateCursorAn
ListMenuErasePrintedCursor(list, oldSelectedRow); ListMenuErasePrintedCursor(list, oldSelectedRow);
ListMenuDrawCursor(list); ListMenuDrawCursor(list);
ListMenuCallSelectionChangedCallback(list, FALSE); ListMenuCallSelectionChangedCallback(list, FALSE);
CopyWindowToVram(list->template.windowId, 2); CopyWindowToVram(list->template.windowId, COPYWIN_GFX);
break; break;
case 2: case 2:
case 3: case 3:
@@ -870,7 +870,7 @@ static bool8 ListMenuChangeSelection(struct ListMenu *list, bool8 updateCursorAn
ListMenuScroll(list, cursorCount, movingDown); ListMenuScroll(list, cursorCount, movingDown);
ListMenuDrawCursor(list); ListMenuDrawCursor(list);
ListMenuCallSelectionChangedCallback(list, FALSE); ListMenuCallSelectionChangedCallback(list, FALSE);
CopyWindowToVram(list->template.windowId, 2); CopyWindowToVram(list->template.windowId, COPYWIN_GFX);
break; break;
} }
} }
+2 -2
View File
@@ -698,8 +698,8 @@ static void PrintMailText(void)
box_x = GetStringCenterAlignXOffset(FONT_NORMAL, signature, sMailRead->signatureWidth) + 104; box_x = GetStringCenterAlignXOffset(FONT_NORMAL, signature, sMailRead->signatureWidth) + 104;
box_y = sMailRead->layout->signatureYPos + 88; box_y = sMailRead->layout->signatureYPos + 88;
AddTextPrinterParameterized3(0, FONT_NORMAL, box_x, box_y, sTextColors, 0, signature); AddTextPrinterParameterized3(0, FONT_NORMAL, box_x, box_y, sTextColors, 0, signature);
CopyWindowToVram(0, 3); CopyWindowToVram(0, COPYWIN_FULL);
CopyWindowToVram(1, 3); CopyWindowToVram(1, COPYWIN_FULL);
} }
static void VBlankCB_MailRead(void) static void VBlankCB_MailRead(void)
+55 -55
View File
@@ -583,10 +583,10 @@ static u32 InitMainMenu(bool8 returningFromOptionsMenu)
BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_WHITEALPHA); // fade to white BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_WHITEALPHA); // fade to white
ResetBgsAndClearDma3BusyFlags(0); ResetBgsAndClearDma3BusyFlags(0);
InitBgsFromTemplates(0, sMainMenuBgTemplates, ARRAY_COUNT(sMainMenuBgTemplates)); InitBgsFromTemplates(0, sMainMenuBgTemplates, ARRAY_COUNT(sMainMenuBgTemplates));
ChangeBgX(0, 0, 0); ChangeBgX(0, 0, BG_COORD_SET);
ChangeBgY(0, 0, 0); ChangeBgY(0, 0, BG_COORD_SET);
ChangeBgX(1, 0, 0); ChangeBgX(1, 0, BG_COORD_SET);
ChangeBgY(1, 0, 0); ChangeBgY(1, 0, BG_COORD_SET);
InitWindows(sWindowTemplates_MainMenu); InitWindows(sWindowTemplates_MainMenu);
DeactivateAllTextPrinters(); DeactivateAllTextPrinters();
LoadMainMenuWindowFrameTiles(0, MAIN_MENU_BORDER_TILE); LoadMainMenuWindowFrameTiles(0, MAIN_MENU_BORDER_TILE);
@@ -780,12 +780,12 @@ static void Task_DisplayMainMenu(u8 taskId)
default: default:
FillWindowPixelBuffer(0, PIXEL_FILL(0xA)); FillWindowPixelBuffer(0, PIXEL_FILL(0xA));
FillWindowPixelBuffer(1, PIXEL_FILL(0xA)); FillWindowPixelBuffer(1, PIXEL_FILL(0xA));
AddTextPrinterParameterized3(0, FONT_NORMAL, 0, 1, sTextColor_Headers, -1, gText_MainMenuNewGame); AddTextPrinterParameterized3(0, FONT_NORMAL, 0, 1, sTextColor_Headers, TEXT_SKIP_DRAW, gText_MainMenuNewGame);
AddTextPrinterParameterized3(1, FONT_NORMAL, 0, 1, sTextColor_Headers, -1, gText_MainMenuOption); AddTextPrinterParameterized3(1, FONT_NORMAL, 0, 1, sTextColor_Headers, TEXT_SKIP_DRAW, gText_MainMenuOption);
PutWindowTilemap(0); PutWindowTilemap(0);
PutWindowTilemap(1); PutWindowTilemap(1);
CopyWindowToVram(0, 2); CopyWindowToVram(0, COPYWIN_GFX);
CopyWindowToVram(1, 2); CopyWindowToVram(1, COPYWIN_GFX);
DrawMainMenuWindowBorder(&sWindowTemplates_MainMenu[0], MAIN_MENU_BORDER_TILE); DrawMainMenuWindowBorder(&sWindowTemplates_MainMenu[0], MAIN_MENU_BORDER_TILE);
DrawMainMenuWindowBorder(&sWindowTemplates_MainMenu[1], MAIN_MENU_BORDER_TILE); DrawMainMenuWindowBorder(&sWindowTemplates_MainMenu[1], MAIN_MENU_BORDER_TILE);
break; break;
@@ -793,16 +793,16 @@ static void Task_DisplayMainMenu(u8 taskId)
FillWindowPixelBuffer(2, PIXEL_FILL(0xA)); FillWindowPixelBuffer(2, PIXEL_FILL(0xA));
FillWindowPixelBuffer(3, PIXEL_FILL(0xA)); FillWindowPixelBuffer(3, PIXEL_FILL(0xA));
FillWindowPixelBuffer(4, PIXEL_FILL(0xA)); FillWindowPixelBuffer(4, PIXEL_FILL(0xA));
AddTextPrinterParameterized3(2, FONT_NORMAL, 0, 1, sTextColor_Headers, -1, gText_MainMenuContinue); AddTextPrinterParameterized3(2, FONT_NORMAL, 0, 1, sTextColor_Headers, TEXT_SKIP_DRAW, gText_MainMenuContinue);
AddTextPrinterParameterized3(3, FONT_NORMAL, 0, 1, sTextColor_Headers, -1, gText_MainMenuNewGame); AddTextPrinterParameterized3(3, FONT_NORMAL, 0, 1, sTextColor_Headers, TEXT_SKIP_DRAW, gText_MainMenuNewGame);
AddTextPrinterParameterized3(4, FONT_NORMAL, 0, 1, sTextColor_Headers, -1, gText_MainMenuOption); AddTextPrinterParameterized3(4, FONT_NORMAL, 0, 1, sTextColor_Headers, TEXT_SKIP_DRAW, gText_MainMenuOption);
MainMenu_FormatSavegameText(); MainMenu_FormatSavegameText();
PutWindowTilemap(2); PutWindowTilemap(2);
PutWindowTilemap(3); PutWindowTilemap(3);
PutWindowTilemap(4); PutWindowTilemap(4);
CopyWindowToVram(2, 2); CopyWindowToVram(2, COPYWIN_GFX);
CopyWindowToVram(3, 2); CopyWindowToVram(3, COPYWIN_GFX);
CopyWindowToVram(4, 2); CopyWindowToVram(4, COPYWIN_GFX);
DrawMainMenuWindowBorder(&sWindowTemplates_MainMenu[2], MAIN_MENU_BORDER_TILE); DrawMainMenuWindowBorder(&sWindowTemplates_MainMenu[2], MAIN_MENU_BORDER_TILE);
DrawMainMenuWindowBorder(&sWindowTemplates_MainMenu[3], MAIN_MENU_BORDER_TILE); DrawMainMenuWindowBorder(&sWindowTemplates_MainMenu[3], MAIN_MENU_BORDER_TILE);
DrawMainMenuWindowBorder(&sWindowTemplates_MainMenu[4], MAIN_MENU_BORDER_TILE); DrawMainMenuWindowBorder(&sWindowTemplates_MainMenu[4], MAIN_MENU_BORDER_TILE);
@@ -812,19 +812,19 @@ static void Task_DisplayMainMenu(u8 taskId)
FillWindowPixelBuffer(3, PIXEL_FILL(0xA)); FillWindowPixelBuffer(3, PIXEL_FILL(0xA));
FillWindowPixelBuffer(4, PIXEL_FILL(0xA)); FillWindowPixelBuffer(4, PIXEL_FILL(0xA));
FillWindowPixelBuffer(5, PIXEL_FILL(0xA)); FillWindowPixelBuffer(5, PIXEL_FILL(0xA));
AddTextPrinterParameterized3(2, FONT_NORMAL, 0, 1, sTextColor_Headers, -1, gText_MainMenuContinue); AddTextPrinterParameterized3(2, FONT_NORMAL, 0, 1, sTextColor_Headers, TEXT_SKIP_DRAW, gText_MainMenuContinue);
AddTextPrinterParameterized3(3, FONT_NORMAL, 0, 1, sTextColor_Headers, -1, gText_MainMenuNewGame); AddTextPrinterParameterized3(3, FONT_NORMAL, 0, 1, sTextColor_Headers, TEXT_SKIP_DRAW, gText_MainMenuNewGame);
AddTextPrinterParameterized3(4, FONT_NORMAL, 0, 1, sTextColor_Headers, -1, gText_MainMenuMysteryGift); AddTextPrinterParameterized3(4, FONT_NORMAL, 0, 1, sTextColor_Headers, TEXT_SKIP_DRAW, gText_MainMenuMysteryGift);
AddTextPrinterParameterized3(5, FONT_NORMAL, 0, 1, sTextColor_Headers, -1, gText_MainMenuOption); AddTextPrinterParameterized3(5, FONT_NORMAL, 0, 1, sTextColor_Headers, TEXT_SKIP_DRAW, gText_MainMenuOption);
MainMenu_FormatSavegameText(); MainMenu_FormatSavegameText();
PutWindowTilemap(2); PutWindowTilemap(2);
PutWindowTilemap(3); PutWindowTilemap(3);
PutWindowTilemap(4); PutWindowTilemap(4);
PutWindowTilemap(5); PutWindowTilemap(5);
CopyWindowToVram(2, 2); CopyWindowToVram(2, COPYWIN_GFX);
CopyWindowToVram(3, 2); CopyWindowToVram(3, COPYWIN_GFX);
CopyWindowToVram(4, 2); CopyWindowToVram(4, COPYWIN_GFX);
CopyWindowToVram(5, 2); CopyWindowToVram(5, COPYWIN_GFX);
DrawMainMenuWindowBorder(&sWindowTemplates_MainMenu[2], MAIN_MENU_BORDER_TILE); DrawMainMenuWindowBorder(&sWindowTemplates_MainMenu[2], MAIN_MENU_BORDER_TILE);
DrawMainMenuWindowBorder(&sWindowTemplates_MainMenu[3], MAIN_MENU_BORDER_TILE); DrawMainMenuWindowBorder(&sWindowTemplates_MainMenu[3], MAIN_MENU_BORDER_TILE);
DrawMainMenuWindowBorder(&sWindowTemplates_MainMenu[4], MAIN_MENU_BORDER_TILE); DrawMainMenuWindowBorder(&sWindowTemplates_MainMenu[4], MAIN_MENU_BORDER_TILE);
@@ -836,22 +836,22 @@ static void Task_DisplayMainMenu(u8 taskId)
FillWindowPixelBuffer(4, PIXEL_FILL(0xA)); FillWindowPixelBuffer(4, PIXEL_FILL(0xA));
FillWindowPixelBuffer(5, PIXEL_FILL(0xA)); FillWindowPixelBuffer(5, PIXEL_FILL(0xA));
FillWindowPixelBuffer(6, PIXEL_FILL(0xA)); FillWindowPixelBuffer(6, PIXEL_FILL(0xA));
AddTextPrinterParameterized3(2, FONT_NORMAL, 0, 1, sTextColor_Headers, -1, gText_MainMenuContinue); AddTextPrinterParameterized3(2, FONT_NORMAL, 0, 1, sTextColor_Headers, TEXT_SKIP_DRAW, gText_MainMenuContinue);
AddTextPrinterParameterized3(3, FONT_NORMAL, 0, 1, sTextColor_Headers, -1, gText_MainMenuNewGame); AddTextPrinterParameterized3(3, FONT_NORMAL, 0, 1, sTextColor_Headers, TEXT_SKIP_DRAW, gText_MainMenuNewGame);
AddTextPrinterParameterized3(4, FONT_NORMAL, 0, 1, sTextColor_Headers, -1, gText_MainMenuMysteryGift2); AddTextPrinterParameterized3(4, FONT_NORMAL, 0, 1, sTextColor_Headers, TEXT_SKIP_DRAW, gText_MainMenuMysteryGift2);
AddTextPrinterParameterized3(5, FONT_NORMAL, 0, 1, sTextColor_Headers, -1, gText_MainMenuMysteryEvents); AddTextPrinterParameterized3(5, FONT_NORMAL, 0, 1, sTextColor_Headers, TEXT_SKIP_DRAW, gText_MainMenuMysteryEvents);
AddTextPrinterParameterized3(6, FONT_NORMAL, 0, 1, sTextColor_Headers, -1, gText_MainMenuOption); AddTextPrinterParameterized3(6, FONT_NORMAL, 0, 1, sTextColor_Headers, TEXT_SKIP_DRAW, gText_MainMenuOption);
MainMenu_FormatSavegameText(); MainMenu_FormatSavegameText();
PutWindowTilemap(2); PutWindowTilemap(2);
PutWindowTilemap(3); PutWindowTilemap(3);
PutWindowTilemap(4); PutWindowTilemap(4);
PutWindowTilemap(5); PutWindowTilemap(5);
PutWindowTilemap(6); PutWindowTilemap(6);
CopyWindowToVram(2, 2); CopyWindowToVram(2, COPYWIN_GFX);
CopyWindowToVram(3, 2); CopyWindowToVram(3, COPYWIN_GFX);
CopyWindowToVram(4, 2); CopyWindowToVram(4, COPYWIN_GFX);
CopyWindowToVram(5, 2); CopyWindowToVram(5, COPYWIN_GFX);
CopyWindowToVram(6, 2); CopyWindowToVram(6, COPYWIN_GFX);
DrawMainMenuWindowBorder(&sWindowTemplates_MainMenu[2], MAIN_MENU_BORDER_TILE); DrawMainMenuWindowBorder(&sWindowTemplates_MainMenu[2], MAIN_MENU_BORDER_TILE);
DrawMainMenuWindowBorder(&sWindowTemplates_MainMenu[3], MAIN_MENU_BORDER_TILE); DrawMainMenuWindowBorder(&sWindowTemplates_MainMenu[3], MAIN_MENU_BORDER_TILE);
DrawMainMenuWindowBorder(&sWindowTemplates_MainMenu[4], MAIN_MENU_BORDER_TILE); DrawMainMenuWindowBorder(&sWindowTemplates_MainMenu[4], MAIN_MENU_BORDER_TILE);
@@ -861,8 +861,8 @@ static void Task_DisplayMainMenu(u8 taskId)
gTasks[tScrollArrowTaskId].func = Task_ScrollIndicatorArrowPairOnMainMenu; gTasks[tScrollArrowTaskId].func = Task_ScrollIndicatorArrowPairOnMainMenu;
if (sCurrItemAndOptionMenuCheck == 4) if (sCurrItemAndOptionMenuCheck == 4)
{ {
ChangeBgY(0, 0x2000, 1); ChangeBgY(0, 0x2000, BG_COORD_ADD);
ChangeBgY(1, 0x2000, 1); ChangeBgY(1, 0x2000, BG_COORD_ADD);
tIsScrolled = TRUE; tIsScrolled = TRUE;
gTasks[tScrollArrowTaskId].tArrowTaskIsScrolled = TRUE; gTasks[tScrollArrowTaskId].tArrowTaskIsScrolled = TRUE;
} }
@@ -901,8 +901,8 @@ static bool8 HandleMainMenuInput(u8 taskId)
{ {
if (tMenuType == HAS_MYSTERY_EVENTS && tIsScrolled == TRUE && tCurrItem == 1) if (tMenuType == HAS_MYSTERY_EVENTS && tIsScrolled == TRUE && tCurrItem == 1)
{ {
ChangeBgY(0, 0x2000, 2); ChangeBgY(0, 0x2000, BG_COORD_SUB);
ChangeBgY(1, 0x2000, 2); ChangeBgY(1, 0x2000, BG_COORD_SUB);
gTasks[tScrollArrowTaskId].tArrowTaskIsScrolled = tIsScrolled = FALSE; gTasks[tScrollArrowTaskId].tArrowTaskIsScrolled = tIsScrolled = FALSE;
} }
tCurrItem--; tCurrItem--;
@@ -913,8 +913,8 @@ static bool8 HandleMainMenuInput(u8 taskId)
{ {
if (tMenuType == HAS_MYSTERY_EVENTS && tCurrItem == 3 && tIsScrolled == FALSE) if (tMenuType == HAS_MYSTERY_EVENTS && tCurrItem == 3 && tIsScrolled == FALSE)
{ {
ChangeBgY(0, 0x2000, 1); ChangeBgY(0, 0x2000, BG_COORD_ADD);
ChangeBgY(1, 0x2000, 1); ChangeBgY(1, 0x2000, BG_COORD_ADD);
gTasks[tScrollArrowTaskId].tArrowTaskIsScrolled = tIsScrolled = TRUE; gTasks[tScrollArrowTaskId].tArrowTaskIsScrolled = tIsScrolled = TRUE;
} }
tCurrItem++; tCurrItem++;
@@ -1048,8 +1048,8 @@ static void Task_HandleMainMenuAPressed(u8 taskId)
} }
break; break;
} }
ChangeBgY(0, 0, 0); ChangeBgY(0, 0, BG_COORD_SET);
ChangeBgY(1, 0, 0); ChangeBgY(1, 0, BG_COORD_SET);
switch (action) switch (action)
{ {
case ACTION_NEW_GAME: case ACTION_NEW_GAME:
@@ -1330,7 +1330,7 @@ static void Task_NewGameBirchSpeech_WaitForSpriteFadeInWelcome(u8 taskId)
LoadMessageBoxGfx(0, 0xFC, 0xF0); LoadMessageBoxGfx(0, 0xFC, 0xF0);
NewGameBirchSpeech_ShowDialogueWindow(0, 1); NewGameBirchSpeech_ShowDialogueWindow(0, 1);
PutWindowTilemap(0); PutWindowTilemap(0);
CopyWindowToVram(0, 2); CopyWindowToVram(0, COPYWIN_GFX);
NewGameBirchSpeech_ClearWindow(0); NewGameBirchSpeech_ClearWindow(0);
StringExpandPlaceholders(gStringVar4, gText_Birch_Welcome); StringExpandPlaceholders(gStringVar4, gText_Birch_Welcome);
AddTextPrinterForMessage(1); AddTextPrinterForMessage(1);
@@ -1855,7 +1855,7 @@ static void CB2_NewGameBirchSpeech_ReturnFromNamingScreen(void)
LoadMainMenuWindowFrameTiles(0, 0xF3); LoadMainMenuWindowFrameTiles(0, 0xF3);
LoadMessageBoxGfx(0, 0xFC, 0xF0); LoadMessageBoxGfx(0, 0xFC, 0xF0);
PutWindowTilemap(0); PutWindowTilemap(0);
CopyWindowToVram(0, 3); CopyWindowToVram(0, COPYWIN_FULL);
} }
static void SpriteCB_Null(struct Sprite *sprite) static void SpriteCB_Null(struct Sprite *sprite)
@@ -2090,9 +2090,9 @@ static void NewGameBirchSpeech_ShowGenderMenu(void)
DrawMainMenuWindowBorder(&gNewGameBirchSpeechTextWindows[1], 0xF3); DrawMainMenuWindowBorder(&gNewGameBirchSpeechTextWindows[1], 0xF3);
FillWindowPixelBuffer(1, PIXEL_FILL(1)); FillWindowPixelBuffer(1, PIXEL_FILL(1));
PrintMenuTable(1, ARRAY_COUNT(sMenuActions_Gender), sMenuActions_Gender); PrintMenuTable(1, ARRAY_COUNT(sMenuActions_Gender), sMenuActions_Gender);
InitMenuInUpperLeftCornerPlaySoundWhenAPressed(1, 2, 0); InitMenuInUpperLeftCornerNormal(1, 2, 0);
PutWindowTilemap(1); PutWindowTilemap(1);
CopyWindowToVram(1, 3); CopyWindowToVram(1, COPYWIN_FULL);
} }
static s8 NewGameBirchSpeech_ProcessGenderMenuInput(void) static s8 NewGameBirchSpeech_ProcessGenderMenuInput(void)
@@ -2119,7 +2119,7 @@ static void CreateMainMenuErrorWindow(const u8* str)
FillWindowPixelBuffer(7, PIXEL_FILL(1)); FillWindowPixelBuffer(7, PIXEL_FILL(1));
AddTextPrinterParameterized(7, FONT_NORMAL, str, 0, 1, 2, 0); AddTextPrinterParameterized(7, FONT_NORMAL, str, 0, 1, 2, 0);
PutWindowTilemap(7); PutWindowTilemap(7);
CopyWindowToVram(7, 2); CopyWindowToVram(7, COPYWIN_GFX);
DrawMainMenuWindowBorder(&sWindowTemplates_MainMenu[7], MAIN_MENU_BORDER_TILE); DrawMainMenuWindowBorder(&sWindowTemplates_MainMenu[7], MAIN_MENU_BORDER_TILE);
SetGpuReg(REG_OFFSET_WIN0H, WIN_RANGE(9, DISPLAY_WIDTH - 9)); SetGpuReg(REG_OFFSET_WIN0H, WIN_RANGE(9, DISPLAY_WIDTH - 9));
SetGpuReg(REG_OFFSET_WIN0V, WIN_RANGE(113, DISPLAY_HEIGHT - 1)); SetGpuReg(REG_OFFSET_WIN0V, WIN_RANGE(113, DISPLAY_HEIGHT - 1));
@@ -2136,8 +2136,8 @@ static void MainMenu_FormatSavegameText(void)
static void MainMenu_FormatSavegamePlayer(void) static void MainMenu_FormatSavegamePlayer(void)
{ {
StringExpandPlaceholders(gStringVar4, gText_ContinueMenuPlayer); StringExpandPlaceholders(gStringVar4, gText_ContinueMenuPlayer);
AddTextPrinterParameterized3(2, FONT_NORMAL, 0, 17, sTextColor_MenuInfo, -1, gStringVar4); AddTextPrinterParameterized3(2, FONT_NORMAL, 0, 17, sTextColor_MenuInfo, TEXT_SKIP_DRAW, gStringVar4);
AddTextPrinterParameterized3(2, FONT_NORMAL, GetStringRightAlignXOffset(FONT_NORMAL, gSaveBlock2Ptr->playerName, 100), 17, sTextColor_MenuInfo, -1, gSaveBlock2Ptr->playerName); AddTextPrinterParameterized3(2, FONT_NORMAL, GetStringRightAlignXOffset(FONT_NORMAL, gSaveBlock2Ptr->playerName, 100), 17, sTextColor_MenuInfo, TEXT_SKIP_DRAW, gSaveBlock2Ptr->playerName);
} }
static void MainMenu_FormatSavegameTime(void) static void MainMenu_FormatSavegameTime(void)
@@ -2146,11 +2146,11 @@ static void MainMenu_FormatSavegameTime(void)
u8* ptr; u8* ptr;
StringExpandPlaceholders(gStringVar4, gText_ContinueMenuTime); StringExpandPlaceholders(gStringVar4, gText_ContinueMenuTime);
AddTextPrinterParameterized3(2, FONT_NORMAL, 0x6C, 17, sTextColor_MenuInfo, -1, gStringVar4); AddTextPrinterParameterized3(2, FONT_NORMAL, 0x6C, 17, sTextColor_MenuInfo, TEXT_SKIP_DRAW, gStringVar4);
ptr = ConvertIntToDecimalStringN(str, gSaveBlock2Ptr->playTimeHours, STR_CONV_MODE_LEFT_ALIGN, 3); ptr = ConvertIntToDecimalStringN(str, gSaveBlock2Ptr->playTimeHours, STR_CONV_MODE_LEFT_ALIGN, 3);
*ptr = 0xF0; *ptr = 0xF0;
ConvertIntToDecimalStringN(ptr + 1, gSaveBlock2Ptr->playTimeMinutes, STR_CONV_MODE_LEADING_ZEROS, 2); ConvertIntToDecimalStringN(ptr + 1, gSaveBlock2Ptr->playTimeMinutes, STR_CONV_MODE_LEADING_ZEROS, 2);
AddTextPrinterParameterized3(2, FONT_NORMAL, GetStringRightAlignXOffset(FONT_NORMAL, str, 0xD0), 17, sTextColor_MenuInfo, -1, str); AddTextPrinterParameterized3(2, FONT_NORMAL, GetStringRightAlignXOffset(FONT_NORMAL, str, 0xD0), 17, sTextColor_MenuInfo, TEXT_SKIP_DRAW, str);
} }
static void MainMenu_FormatSavegamePokedex(void) static void MainMenu_FormatSavegamePokedex(void)
@@ -2165,9 +2165,9 @@ static void MainMenu_FormatSavegamePokedex(void)
else else
dexCount = GetHoennPokedexCount(FLAG_GET_CAUGHT); dexCount = GetHoennPokedexCount(FLAG_GET_CAUGHT);
StringExpandPlaceholders(gStringVar4, gText_ContinueMenuPokedex); StringExpandPlaceholders(gStringVar4, gText_ContinueMenuPokedex);
AddTextPrinterParameterized3(2, FONT_NORMAL, 0, 33, sTextColor_MenuInfo, -1, gStringVar4); AddTextPrinterParameterized3(2, FONT_NORMAL, 0, 33, sTextColor_MenuInfo, TEXT_SKIP_DRAW, gStringVar4);
ConvertIntToDecimalStringN(str, dexCount, STR_CONV_MODE_LEFT_ALIGN, 3); ConvertIntToDecimalStringN(str, dexCount, STR_CONV_MODE_LEFT_ALIGN, 3);
AddTextPrinterParameterized3(2, FONT_NORMAL, GetStringRightAlignXOffset(FONT_NORMAL, str, 100), 33, sTextColor_MenuInfo, -1, str); AddTextPrinterParameterized3(2, FONT_NORMAL, GetStringRightAlignXOffset(FONT_NORMAL, str, 100), 33, sTextColor_MenuInfo, TEXT_SKIP_DRAW, str);
} }
} }
@@ -2183,9 +2183,9 @@ static void MainMenu_FormatSavegameBadges(void)
badgeCount++; badgeCount++;
} }
StringExpandPlaceholders(gStringVar4, gText_ContinueMenuBadges); StringExpandPlaceholders(gStringVar4, gText_ContinueMenuBadges);
AddTextPrinterParameterized3(2, FONT_NORMAL, 0x6C, 33, sTextColor_MenuInfo, -1, gStringVar4); AddTextPrinterParameterized3(2, FONT_NORMAL, 0x6C, 33, sTextColor_MenuInfo, TEXT_SKIP_DRAW, gStringVar4);
ConvertIntToDecimalStringN(str, badgeCount, STR_CONV_MODE_LEADING_ZEROS, 1); ConvertIntToDecimalStringN(str, badgeCount, STR_CONV_MODE_LEADING_ZEROS, 1);
AddTextPrinterParameterized3(2, FONT_NORMAL, GetStringRightAlignXOffset(FONT_NORMAL, str, 0xD0), 33, sTextColor_MenuInfo, -1, str); AddTextPrinterParameterized3(2, FONT_NORMAL, GetStringRightAlignXOffset(FONT_NORMAL, str, 0xD0), 33, sTextColor_MenuInfo, TEXT_SKIP_DRAW, str);
} }
static void LoadMainMenuWindowFrameTiles(u8 bgId, u16 tileOffset) static void LoadMainMenuWindowFrameTiles(u8 bgId, u16 tileOffset)
@@ -2232,7 +2232,7 @@ static void NewGameBirchSpeech_ClearGenderWindow(u8 windowId, bool8 copyToVram)
FillWindowPixelBuffer(windowId, PIXEL_FILL(1)); FillWindowPixelBuffer(windowId, PIXEL_FILL(1));
ClearWindowTilemap(windowId); ClearWindowTilemap(windowId);
if (copyToVram == TRUE) if (copyToVram == TRUE)
CopyWindowToVram(windowId, 3); CopyWindowToVram(windowId, COPYWIN_FULL);
} }
static void NewGameBirchSpeech_ClearWindow(u8 windowId) static void NewGameBirchSpeech_ClearWindow(u8 windowId)
@@ -2244,7 +2244,7 @@ static void NewGameBirchSpeech_ClearWindow(u8 windowId)
u8 winHeight = GetWindowAttribute(windowId, WINDOW_HEIGHT); u8 winHeight = GetWindowAttribute(windowId, WINDOW_HEIGHT);
FillWindowPixelRect(windowId, bgColor, 0, 0, maxCharWidth * winWidth, maxCharHeight * winHeight); FillWindowPixelRect(windowId, bgColor, 0, 0, maxCharWidth * winWidth, maxCharHeight * winHeight);
CopyWindowToVram(windowId, 2); CopyWindowToVram(windowId, COPYWIN_GFX);
} }
static void NewGameBirchSpeech_WaitForThisIsPokemonText(struct TextPrinterTemplate *printer, u16 a) static void NewGameBirchSpeech_WaitForThisIsPokemonText(struct TextPrinterTemplate *printer, u16 a)
+2 -2
View File
@@ -329,8 +329,8 @@ static void ShowMapNamePopUpWindow(void)
mapDisplayHeader[0] = EXT_CTRL_CODE_BEGIN; mapDisplayHeader[0] = EXT_CTRL_CODE_BEGIN;
mapDisplayHeader[1] = EXT_CTRL_CODE_HIGHLIGHT; mapDisplayHeader[1] = EXT_CTRL_CODE_HIGHLIGHT;
mapDisplayHeader[2] = TEXT_COLOR_TRANSPARENT; mapDisplayHeader[2] = TEXT_COLOR_TRANSPARENT;
AddTextPrinterParameterized(GetMapNamePopUpWindowId(), FONT_NARROW, mapDisplayHeader, x, 3, 0xFF, NULL); AddTextPrinterParameterized(GetMapNamePopUpWindowId(), FONT_NARROW, mapDisplayHeader, x, 3, TEXT_SKIP_DRAW, NULL);
CopyWindowToVram(GetMapNamePopUpWindowId(), 3); CopyWindowToVram(GetMapNamePopUpWindowId(), COPYWIN_FULL);
} }
#define TILE_TOP_EDGE_START 0x21D #define TILE_TOP_EDGE_START 0x21D
+7 -7
View File
@@ -1263,7 +1263,7 @@ static bool32 MatchCall_LoadGfx(u8 taskId)
FillWindowPixelBuffer(tWindowId, PIXEL_FILL(8)); FillWindowPixelBuffer(tWindowId, PIXEL_FILL(8));
LoadPalette(sMatchCallWindow_Pal, 0xE0, sizeof(sMatchCallWindow_Pal)); LoadPalette(sMatchCallWindow_Pal, 0xE0, sizeof(sMatchCallWindow_Pal));
LoadPalette(sPokenavIcon_Pal, 0xF0, sizeof(sPokenavIcon_Pal)); LoadPalette(sPokenavIcon_Pal, 0xF0, sizeof(sPokenavIcon_Pal));
ChangeBgY(0, -0x2000, 0); ChangeBgY(0, -0x2000, BG_COORD_SET);
return TRUE; return TRUE;
} }
@@ -1277,7 +1277,7 @@ static bool32 MatchCall_DrawWindow(u8 taskId)
DrawMatchCallTextBoxBorder_Internal(tWindowId, TILE_MC_WINDOW, 14); DrawMatchCallTextBoxBorder_Internal(tWindowId, TILE_MC_WINDOW, 14);
WriteSequenceToBgTilemapBuffer(0, (0xF << 12) | TILE_POKENAV_ICON, 1, 15, 4, 4, 17, 1); WriteSequenceToBgTilemapBuffer(0, (0xF << 12) | TILE_POKENAV_ICON, 1, 15, 4, 4, 17, 1);
tIconTaskId = CreateTask(Task_SpinPokenavIcon, 10); tIconTaskId = CreateTask(Task_SpinPokenavIcon, 10);
CopyWindowToVram(tWindowId, 2); CopyWindowToVram(tWindowId, COPYWIN_GFX);
CopyBgTilemapBufferToVram(0); CopyBgTilemapBufferToVram(0);
return TRUE; return TRUE;
} }
@@ -1297,9 +1297,9 @@ static bool32 MatchCall_ReadyIntro(u8 taskId)
static bool32 MatchCall_SlideWindowIn(u8 taskId) static bool32 MatchCall_SlideWindowIn(u8 taskId)
{ {
if (ChangeBgY(0, 0x600, 1) >= 0) if (ChangeBgY(0, 0x600, BG_COORD_ADD) >= 0)
{ {
ChangeBgY(0, 0, 0); ChangeBgY(0, 0, BG_COORD_SET);
return TRUE; return TRUE;
} }
@@ -1329,7 +1329,7 @@ static bool32 MatchCall_PrintMessage(u8 taskId)
if (!RunMatchCallTextPrinter(tWindowId) && !IsSEPlaying() && JOY_NEW(A_BUTTON | B_BUTTON)) if (!RunMatchCallTextPrinter(tWindowId) && !IsSEPlaying() && JOY_NEW(A_BUTTON | B_BUTTON))
{ {
FillWindowPixelBuffer(tWindowId, PIXEL_FILL(8)); FillWindowPixelBuffer(tWindowId, PIXEL_FILL(8));
CopyWindowToVram(tWindowId, 2); CopyWindowToVram(tWindowId, COPYWIN_GFX);
PlaySE(SE_POKENAV_HANG_UP); PlaySE(SE_POKENAV_HANG_UP);
return TRUE; return TRUE;
} }
@@ -1340,7 +1340,7 @@ static bool32 MatchCall_PrintMessage(u8 taskId)
static bool32 MatchCall_SlideWindowOut(u8 taskId) static bool32 MatchCall_SlideWindowOut(u8 taskId)
{ {
s16 *data = gTasks[taskId].data; s16 *data = gTasks[taskId].data;
if (ChangeBgY(0, 0x600, 2) <= -0x2000) if (ChangeBgY(0, 0x600, BG_COORD_SUB) <= -0x2000)
{ {
FillBgTilemapBufferRect_Palette0(0, 0, 0, 14, 30, 6); FillBgTilemapBufferRect_Palette0(0, 0, 0, 14, 30, 6);
DestroyTask(tIconTaskId); DestroyTask(tIconTaskId);
@@ -1357,7 +1357,7 @@ static bool32 MatchCall_EndCall(u8 taskId)
u8 playerObjectId; u8 playerObjectId;
if (!IsDma3ManagerBusyWithBgCopy() && !IsSEPlaying()) if (!IsDma3ManagerBusyWithBgCopy() && !IsSEPlaying())
{ {
ChangeBgY(0, 0, 0); ChangeBgY(0, 0, BG_COORD_SET);
if (!sMatchCallState.triggeredFromScript) if (!sMatchCallState.triggeredFromScript)
{ {
LoadMessageBoxAndBorderGfx(); LoadMessageBoxAndBorderGfx();
+5 -5
View File
@@ -449,7 +449,7 @@ static void DrawSongTextWindow(const u8 * str)
DrawDialogueFrame(0, 0); DrawDialogueFrame(0, 0);
AddTextPrinterParameterized(0, FONT_NORMAL, str, 0, 1, 1, DisableTextPrinters); AddTextPrinterParameterized(0, FONT_NORMAL, str, 0, 1, 1, DisableTextPrinters);
gDisableTextPrinters = TRUE; gDisableTextPrinters = TRUE;
CopyWindowToVram(0, 3); CopyWindowToVram(0, COPYWIN_FULL);
} }
static void BardSing(struct Task *task, struct BardSong *song) static void BardSing(struct Task *task, struct BardSong *song)
@@ -1343,11 +1343,11 @@ static void PrintStoryList(void)
u16 gameStatID = sStorytellerPtr->gameStatIDs[i]; u16 gameStatID = sStorytellerPtr->gameStatIDs[i];
if (gameStatID == 0) if (gameStatID == 0)
break; break;
AddTextPrinterParameterized(sStorytellerWindowId, FONT_NORMAL, GetStoryTitleByStat(gameStatID), 8, 16 * i + 1, 0xFF, NULL); AddTextPrinterParameterized(sStorytellerWindowId, FONT_NORMAL, GetStoryTitleByStat(gameStatID), 8, 16 * i + 1, TEXT_SKIP_DRAW, NULL);
} }
AddTextPrinterParameterized(sStorytellerWindowId, FONT_NORMAL, gText_Exit, 8, 16 * i + 1, 0xFF, NULL); AddTextPrinterParameterized(sStorytellerWindowId, FONT_NORMAL, gText_Exit, 8, 16 * i + 1, TEXT_SKIP_DRAW, NULL);
InitMenuInUpperLeftCornerPlaySoundWhenAPressed(sStorytellerWindowId, GetFreeStorySlot() + 1, 0); InitMenuInUpperLeftCornerNormal(sStorytellerWindowId, GetFreeStorySlot() + 1, 0);
CopyWindowToVram(sStorytellerWindowId, 3); CopyWindowToVram(sStorytellerWindowId, COPYWIN_FULL);
} }
static void Task_StoryListMenu(u8 taskId) static void Task_StoryListMenu(u8 taskId)
+216 -221
View File
File diff suppressed because it is too large Load Diff
+8 -8
View File
@@ -106,14 +106,14 @@ void ResetVramOamAndBgCntRegs(void)
void ResetAllBgsCoordinates(void) void ResetAllBgsCoordinates(void)
{ {
ChangeBgX(0, 0, 0); ChangeBgX(0, 0, BG_COORD_SET);
ChangeBgY(0, 0, 0); ChangeBgY(0, 0, BG_COORD_SET);
ChangeBgX(1, 0, 0); ChangeBgX(1, 0, BG_COORD_SET);
ChangeBgY(1, 0, 0); ChangeBgY(1, 0, BG_COORD_SET);
ChangeBgX(2, 0, 0); ChangeBgX(2, 0, BG_COORD_SET);
ChangeBgY(2, 0, 0); ChangeBgY(2, 0, BG_COORD_SET);
ChangeBgX(3, 0, 0); ChangeBgX(3, 0, BG_COORD_SET);
ChangeBgY(3, 0, 0); ChangeBgY(3, 0, BG_COORD_SET);
} }
void SetVBlankHBlankCallbacksToNull(void) void SetVBlankHBlankCallbacksToNull(void)
+17 -17
View File
@@ -268,7 +268,7 @@ static void MailboxMenu_ItemPrintFunc(u8 windowId, u32 itemId, u8 y)
length = StringLength(buffer); length = StringLength(buffer);
if (length < PLAYER_NAME_LENGTH - 1) if (length < PLAYER_NAME_LENGTH - 1)
ConvertInternationalString(buffer, LANGUAGE_JAPANESE); ConvertInternationalString(buffer, LANGUAGE_JAPANESE);
AddTextPrinterParameterized4(windowId, FONT_NORMAL, 8, y, 0, 0, sPlayerNameTextColors, -1, buffer); AddTextPrinterParameterized4(windowId, FONT_NORMAL, 8, y, 0, 0, sPlayerNameTextColors, TEXT_SKIP_DRAW, buffer);
} }
u8 MailboxMenu_CreateList(struct PlayerPCItemPageStruct *page) u8 MailboxMenu_CreateList(struct PlayerPCItemPageStruct *page)
@@ -740,30 +740,30 @@ static void MoveRelearnerLoadBattleMoveDescription(u32 chosenMove)
FillWindowPixelBuffer(0, PIXEL_FILL(1)); FillWindowPixelBuffer(0, PIXEL_FILL(1));
str = gText_MoveRelearnerBattleMoves; str = gText_MoveRelearnerBattleMoves;
x = GetStringCenterAlignXOffset(FONT_NORMAL, str, 0x80); x = GetStringCenterAlignXOffset(FONT_NORMAL, str, 0x80);
AddTextPrinterParameterized(0, FONT_NORMAL, str, x, 1, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(0, FONT_NORMAL, str, x, 1, TEXT_SKIP_DRAW, NULL);
str = gText_MoveRelearnerPP; str = gText_MoveRelearnerPP;
AddTextPrinterParameterized(0, FONT_NORMAL, str, 4, 0x29, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(0, FONT_NORMAL, str, 4, 0x29, TEXT_SKIP_DRAW, NULL);
str = gText_MoveRelearnerPower; str = gText_MoveRelearnerPower;
x = GetStringRightAlignXOffset(FONT_NORMAL, str, 0x6A); x = GetStringRightAlignXOffset(FONT_NORMAL, str, 0x6A);
AddTextPrinterParameterized(0, FONT_NORMAL, str, x, 0x19, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(0, FONT_NORMAL, str, x, 0x19, TEXT_SKIP_DRAW, NULL);
str = gText_MoveRelearnerAccuracy; str = gText_MoveRelearnerAccuracy;
x = GetStringRightAlignXOffset(FONT_NORMAL, str, 0x6A); x = GetStringRightAlignXOffset(FONT_NORMAL, str, 0x6A);
AddTextPrinterParameterized(0, FONT_NORMAL, str, x, 0x29, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(0, FONT_NORMAL, str, x, 0x29, TEXT_SKIP_DRAW, NULL);
if (chosenMove == LIST_CANCEL) if (chosenMove == LIST_CANCEL)
{ {
CopyWindowToVram(0, 2); CopyWindowToVram(0, COPYWIN_GFX);
return; return;
} }
move = &gBattleMoves[chosenMove]; move = &gBattleMoves[chosenMove];
str = gTypeNames[move->type]; str = gTypeNames[move->type];
AddTextPrinterParameterized(0, FONT_NORMAL, str, 4, 0x19, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(0, FONT_NORMAL, str, 4, 0x19, TEXT_SKIP_DRAW, NULL);
x = 4 + GetStringWidth(FONT_NORMAL, gText_MoveRelearnerPP, 0); x = 4 + GetStringWidth(FONT_NORMAL, gText_MoveRelearnerPP, 0);
ConvertIntToDecimalStringN(buffer, move->pp, STR_CONV_MODE_LEFT_ALIGN, 2); ConvertIntToDecimalStringN(buffer, move->pp, STR_CONV_MODE_LEFT_ALIGN, 2);
AddTextPrinterParameterized(0, FONT_NORMAL, buffer, x, 0x29, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(0, FONT_NORMAL, buffer, x, 0x29, TEXT_SKIP_DRAW, NULL);
if (move->power < 2) if (move->power < 2)
{ {
@@ -774,7 +774,7 @@ static void MoveRelearnerLoadBattleMoveDescription(u32 chosenMove)
ConvertIntToDecimalStringN(buffer, move->power, STR_CONV_MODE_LEFT_ALIGN, 3); ConvertIntToDecimalStringN(buffer, move->power, STR_CONV_MODE_LEFT_ALIGN, 3);
str = buffer; str = buffer;
} }
AddTextPrinterParameterized(0, FONT_NORMAL, str, 0x6A, 0x19, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(0, FONT_NORMAL, str, 0x6A, 0x19, TEXT_SKIP_DRAW, NULL);
if (move->accuracy == 0) if (move->accuracy == 0)
{ {
@@ -785,7 +785,7 @@ static void MoveRelearnerLoadBattleMoveDescription(u32 chosenMove)
ConvertIntToDecimalStringN(buffer, move->accuracy, STR_CONV_MODE_LEFT_ALIGN, 3); ConvertIntToDecimalStringN(buffer, move->accuracy, STR_CONV_MODE_LEFT_ALIGN, 3);
str = buffer; str = buffer;
} }
AddTextPrinterParameterized(0, FONT_NORMAL, str, 0x6A, 0x29, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(0, FONT_NORMAL, str, 0x6A, 0x29, TEXT_SKIP_DRAW, NULL);
str = gMoveDescriptionPointers[chosenMove - 1]; str = gMoveDescriptionPointers[chosenMove - 1];
AddTextPrinterParameterized(0, FONT_NARROW, str, 0, 0x41, 0, NULL); AddTextPrinterParameterized(0, FONT_NARROW, str, 0, 0x41, 0, NULL);
@@ -801,30 +801,30 @@ static void MoveRelearnerMenuLoadContestMoveDescription(u32 chosenMove)
FillWindowPixelBuffer(1, PIXEL_FILL(1)); FillWindowPixelBuffer(1, PIXEL_FILL(1));
str = gText_MoveRelearnerContestMovesTitle; str = gText_MoveRelearnerContestMovesTitle;
x = GetStringCenterAlignXOffset(FONT_NORMAL, str, 0x80); x = GetStringCenterAlignXOffset(FONT_NORMAL, str, 0x80);
AddTextPrinterParameterized(1, FONT_NORMAL, str, x, 1, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(1, FONT_NORMAL, str, x, 1, TEXT_SKIP_DRAW, NULL);
str = gText_MoveRelearnerAppeal; str = gText_MoveRelearnerAppeal;
x = GetStringRightAlignXOffset(FONT_NORMAL, str, 0x5C); x = GetStringRightAlignXOffset(FONT_NORMAL, str, 0x5C);
AddTextPrinterParameterized(1, FONT_NORMAL, str, x, 0x19, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(1, FONT_NORMAL, str, x, 0x19, TEXT_SKIP_DRAW, NULL);
str = gText_MoveRelearnerJam; str = gText_MoveRelearnerJam;
x = GetStringRightAlignXOffset(FONT_NORMAL, str, 0x5C); x = GetStringRightAlignXOffset(FONT_NORMAL, str, 0x5C);
AddTextPrinterParameterized(1, FONT_NORMAL, str, x, 0x29, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(1, FONT_NORMAL, str, x, 0x29, TEXT_SKIP_DRAW, NULL);
if (chosenMove == MENU_NOTHING_CHOSEN) if (chosenMove == MENU_NOTHING_CHOSEN)
{ {
CopyWindowToVram(1, 2); CopyWindowToVram(1, COPYWIN_GFX);
return; return;
} }
move = &gContestMoves[chosenMove]; move = &gContestMoves[chosenMove];
str = gContestMoveTypeTextPointers[move->contestCategory]; str = gContestMoveTypeTextPointers[move->contestCategory];
AddTextPrinterParameterized(1, FONT_NORMAL, str, 4, 0x19, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(1, FONT_NORMAL, str, 4, 0x19, TEXT_SKIP_DRAW, NULL);
str = gContestEffectDescriptionPointers[move->effect]; str = gContestEffectDescriptionPointers[move->effect];
AddTextPrinterParameterized(1, FONT_NARROW, str, 0, 0x41, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(1, FONT_NARROW, str, 0, 0x41, TEXT_SKIP_DRAW, NULL);
CopyWindowToVram(1, 2); CopyWindowToVram(1, COPYWIN_GFX);
} }
static void MoveRelearnerCursorCallback(s32 itemIndex, bool8 onInit, struct ListMenu *list) static void MoveRelearnerCursorCallback(s32 itemIndex, bool8 onInit, struct ListMenu *list)
+2 -2
View File
@@ -536,8 +536,8 @@ static void InitMirageTowerShake(u8 taskId)
case 1: case 1:
sMirageTowerGfxBuffer = (u8 *)AllocZeroed(MIRAGE_TOWER_GFX_LENGTH); sMirageTowerGfxBuffer = (u8 *)AllocZeroed(MIRAGE_TOWER_GFX_LENGTH);
sMirageTowerTilemapBuffer = (u8 *)AllocZeroed(BG_SCREEN_SIZE); sMirageTowerTilemapBuffer = (u8 *)AllocZeroed(BG_SCREEN_SIZE);
ChangeBgX(0, 0, 0); ChangeBgX(0, 0, BG_COORD_SET);
ChangeBgY(0, 0, 0); ChangeBgY(0, 0, BG_COORD_SET);
gTasks[taskId].tState++; gTasks[taskId].tState++;
break; break;
case 2: case 2:
+2 -2
View File
@@ -171,7 +171,7 @@ void DrawMoneyBox(int amount, u8 x, u8 y)
sMoneyBoxWindowId = AddWindow(&template); sMoneyBoxWindowId = AddWindow(&template);
FillWindowPixelBuffer(sMoneyBoxWindowId, PIXEL_FILL(0)); FillWindowPixelBuffer(sMoneyBoxWindowId, PIXEL_FILL(0));
PutWindowTilemap(sMoneyBoxWindowId); PutWindowTilemap(sMoneyBoxWindowId);
CopyWindowToVram(sMoneyBoxWindowId, 1); CopyWindowToVram(sMoneyBoxWindowId, COPYWIN_MAP);
PrintMoneyAmountInMoneyBoxWithBorder(sMoneyBoxWindowId, 0x214, 14, amount); PrintMoneyAmountInMoneyBoxWithBorder(sMoneyBoxWindowId, 0x214, 14, amount);
AddMoneyLabelObject((8 * x) + 19, (8 * y) + 11); AddMoneyLabelObject((8 * x) + 19, (8 * y) + 11);
} }
@@ -180,7 +180,7 @@ void HideMoneyBox(void)
{ {
RemoveMoneyLabelObject(); RemoveMoneyLabelObject();
ClearStdWindowAndFrameToTransparent(sMoneyBoxWindowId, FALSE); ClearStdWindowAndFrameToTransparent(sMoneyBoxWindowId, FALSE);
CopyWindowToVram(sMoneyBoxWindowId, 2); CopyWindowToVram(sMoneyBoxWindowId, COPYWIN_GFX);
RemoveWindow(sMoneyBoxWindowId); RemoveWindow(sMoneyBoxWindowId);
} }
+1 -1
View File
@@ -687,7 +687,7 @@ static void DoMoveRelearnerMain(void)
ShowTeachMoveText(TRUE); ShowTeachMoveText(TRUE);
} }
RemoveScrollArrows(); RemoveScrollArrows();
CopyWindowToVram(3, 2); CopyWindowToVram(3, COPYWIN_GFX);
break; break;
case MENU_STATE_TRY_OVERWRITE_MOVE: case MENU_STATE_TRY_OVERWRITE_MOVE:
if (!gPaletteFade.active) if (!gPaletteFade.active)
+2 -2
View File
@@ -133,7 +133,7 @@ static void CB2_MysteryEventMenu(void)
case 0: case 0:
DrawStdFrameWithCustomTileAndPalette(0, 1, 1, 0xD); DrawStdFrameWithCustomTileAndPalette(0, 1, 1, 0xD);
PutWindowTilemap(0); PutWindowTilemap(0);
CopyWindowToVram(0, 3); CopyWindowToVram(0, COPYWIN_FULL);
ShowBg(0); ShowBg(0);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_BLACK); BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_BLACK);
gMain.state++; gMain.state++;
@@ -181,7 +181,7 @@ static void CB2_MysteryEventMenu(void)
DrawStdFrameWithCustomTileAndPalette(1, 1, 1, 0xD); DrawStdFrameWithCustomTileAndPalette(1, 1, 1, 0xD);
PrintMysteryMenuText(1, gText_LoadingEvent, 1, 2, 0); PrintMysteryMenuText(1, gText_LoadingEvent, 1, 2, 0);
PutWindowTilemap(1); PutWindowTilemap(1);
CopyWindowToVram(1, 3); CopyWindowToVram(1, COPYWIN_FULL);
gMain.state++; gMain.state++;
} }
else if (JOY_NEW(B_BUTTON)) else if (JOY_NEW(B_BUTTON))
+20 -20
View File
@@ -387,14 +387,14 @@ static bool32 HandleMysteryGiftOrEReaderSetup(s32 isEReader)
ResetBgsAndClearDma3BusyFlags(0); ResetBgsAndClearDma3BusyFlags(0);
InitBgsFromTemplates(0, sBGTemplates, ARRAY_COUNT(sBGTemplates)); InitBgsFromTemplates(0, sBGTemplates, ARRAY_COUNT(sBGTemplates));
ChangeBgX(0, 0, 0); ChangeBgX(0, 0, BG_COORD_SET);
ChangeBgY(0, 0, 0); ChangeBgY(0, 0, BG_COORD_SET);
ChangeBgX(1, 0, 0); ChangeBgX(1, 0, BG_COORD_SET);
ChangeBgY(1, 0, 0); ChangeBgY(1, 0, BG_COORD_SET);
ChangeBgX(2, 0, 0); ChangeBgX(2, 0, BG_COORD_SET);
ChangeBgY(2, 0, 0); ChangeBgY(2, 0, BG_COORD_SET);
ChangeBgX(3, 0, 0); ChangeBgX(3, 0, BG_COORD_SET);
ChangeBgY(3, 0, 0); ChangeBgY(3, 0, BG_COORD_SET);
SetBgTilemapBuffer(3, Alloc(BG_SCREEN_SIZE)); SetBgTilemapBuffer(3, Alloc(BG_SCREEN_SIZE));
SetBgTilemapBuffer(2, Alloc(BG_SCREEN_SIZE)); SetBgTilemapBuffer(2, Alloc(BG_SCREEN_SIZE));
@@ -490,9 +490,9 @@ void PrintMysteryGiftOrEReaderTopMenu(bool8 isEReader, bool32 useCancel)
options = gJPText_DecideStop; options = gJPText_DecideStop;
} }
AddTextPrinterParameterized4(0, FONT_NORMAL, 4, 1, 0, 0, sTextColors_TopMenu, TEXT_SPEED_FF, header); AddTextPrinterParameterized4(0, FONT_NORMAL, 4, 1, 0, 0, sTextColors_TopMenu, TEXT_SKIP_DRAW, header);
AddTextPrinterParameterized4(0, FONT_SMALL, GetStringRightAlignXOffset(FONT_SMALL, options, 0xDE), 1, 0, 0, sTextColors_TopMenu, TEXT_SPEED_FF, options); AddTextPrinterParameterized4(0, FONT_SMALL, GetStringRightAlignXOffset(FONT_SMALL, options, 0xDE), 1, 0, 0, sTextColors_TopMenu, TEXT_SKIP_DRAW, options);
CopyWindowToVram(0, 2); CopyWindowToVram(0, COPYWIN_GFX);
PutWindowTilemap(0); PutWindowTilemap(0);
} }
@@ -540,14 +540,14 @@ void AddTextPrinterToWindow1(const u8 *str)
AddTextPrinterParameterized4(1, FONT_NORMAL, 0, 1, 0, 0, sMG_Ereader_TextColor_2, 0, gStringVar4); AddTextPrinterParameterized4(1, FONT_NORMAL, 0, 1, 0, 0, sMG_Ereader_TextColor_2, 0, gStringVar4);
DrawTextBorderOuter(1, 0x001, 0xF); DrawTextBorderOuter(1, 0x001, 0xF);
PutWindowTilemap(1); PutWindowTilemap(1);
CopyWindowToVram(1, 3); CopyWindowToVram(1, COPYWIN_FULL);
} }
static void ClearTextWindow(void) static void ClearTextWindow(void)
{ {
rbox_fill_rectangle(1); rbox_fill_rectangle(1);
ClearWindowTilemap(1); ClearWindowTilemap(1);
CopyWindowToVram(1, 1); CopyWindowToVram(1, COPYWIN_MAP);
} }
#define DOWN_ARROW_X 208 #define DOWN_ARROW_X 208
@@ -649,7 +649,7 @@ static u32 MysteryGift_HandleThreeOptionMenu(u8 * unused0, u16 * unused1, u8 whi
if (response != LIST_NOTHING_CHOSEN) if (response != LIST_NOTHING_CHOSEN)
{ {
ClearWindowTilemap(2); ClearWindowTilemap(2);
CopyWindowToVram(2, 1); CopyWindowToVram(2, COPYWIN_MAP);
} }
return response; return response;
} }
@@ -671,7 +671,7 @@ s8 DoMysteryGiftYesNo(u8 * textState, u16 * windowId, bool8 yesNoBoxPlacement, c
FillWindowPixelBuffer(*windowId, 0x11); FillWindowPixelBuffer(*windowId, 0x11);
AddTextPrinterParameterized4(*windowId, FONT_NORMAL, 0, 1, 0, 0, sMG_Ereader_TextColor_2, 0, gStringVar4); AddTextPrinterParameterized4(*windowId, FONT_NORMAL, 0, 1, 0, 0, sMG_Ereader_TextColor_2, 0, gStringVar4);
DrawTextBorderOuter(*windowId, 0x001, 0x0F); DrawTextBorderOuter(*windowId, 0x001, 0x0F);
CopyWindowToVram(*windowId, 2); CopyWindowToVram(*windowId, COPYWIN_GFX);
PutWindowTilemap(*windowId); PutWindowTilemap(*windowId);
(*textState)++; (*textState)++;
break; break;
@@ -693,7 +693,7 @@ s8 DoMysteryGiftYesNo(u8 * textState, u16 * windowId, bool8 yesNoBoxPlacement, c
*textState = 0; *textState = 0;
rbox_fill_rectangle(*windowId); rbox_fill_rectangle(*windowId);
ClearWindowTilemap(*windowId); ClearWindowTilemap(*windowId);
CopyWindowToVram(*windowId, 1); CopyWindowToVram(*windowId, COPYWIN_MAP);
RemoveWindow(*windowId); RemoveWindow(*windowId);
return input; return input;
} }
@@ -702,7 +702,7 @@ s8 DoMysteryGiftYesNo(u8 * textState, u16 * windowId, bool8 yesNoBoxPlacement, c
*textState = 0; *textState = 0;
rbox_fill_rectangle(*windowId); rbox_fill_rectangle(*windowId);
ClearWindowTilemap(*windowId); ClearWindowTilemap(*windowId);
CopyWindowToVram(*windowId, 1); CopyWindowToVram(*windowId, COPYWIN_MAP);
RemoveWindow(*windowId); RemoveWindow(*windowId);
return MENU_B_PRESSED; return MENU_B_PRESSED;
} }
@@ -728,7 +728,7 @@ static s32 HandleGiftSelectMenu(u8 * textState, u16 * windowId, bool32 cannotTos
FillWindowPixelBuffer(*windowId, 0x11); FillWindowPixelBuffer(*windowId, 0x11);
AddTextPrinterParameterized4(*windowId, FONT_NORMAL, 0, 1, 0, 0, sMG_Ereader_TextColor_2, 0, gStringVar4); AddTextPrinterParameterized4(*windowId, FONT_NORMAL, 0, 1, 0, 0, sMG_Ereader_TextColor_2, 0, gStringVar4);
DrawTextBorderOuter(*windowId, 0x001, 0x0F); DrawTextBorderOuter(*windowId, 0x001, 0x0F);
CopyWindowToVram(*windowId, 2); CopyWindowToVram(*windowId, COPYWIN_GFX);
PutWindowTilemap(*windowId); PutWindowTilemap(*windowId);
(*textState)++; (*textState)++;
break; break;
@@ -753,7 +753,7 @@ static s32 HandleGiftSelectMenu(u8 * textState, u16 * windowId, bool32 cannotTos
*textState = 0; *textState = 0;
rbox_fill_rectangle(*windowId); rbox_fill_rectangle(*windowId);
ClearWindowTilemap(*windowId); ClearWindowTilemap(*windowId);
CopyWindowToVram(*windowId, 1); CopyWindowToVram(*windowId, COPYWIN_MAP);
RemoveWindow(*windowId); RemoveWindow(*windowId);
return input; return input;
} }
@@ -762,7 +762,7 @@ static s32 HandleGiftSelectMenu(u8 * textState, u16 * windowId, bool32 cannotTos
*textState = 0; *textState = 0;
rbox_fill_rectangle(*windowId); rbox_fill_rectangle(*windowId);
ClearWindowTilemap(*windowId); ClearWindowTilemap(*windowId);
CopyWindowToVram(*windowId, 1); CopyWindowToVram(*windowId, COPYWIN_MAP);
RemoveWindow(*windowId); RemoveWindow(*windowId);
return LIST_CANCEL; return LIST_CANCEL;
} }
+10 -10
View File
@@ -479,7 +479,7 @@ static void DrawCardWindow(u8 whichWindow)
} }
break; break;
} }
CopyWindowToVram(windowId, 3); CopyWindowToVram(windowId, COPYWIN_FULL);
} }
static void CreateCardSprites(void) static void CreateCardSprites(void)
@@ -678,10 +678,10 @@ s32 WonderNews_Enter(void)
case 1: case 1:
if (UpdatePaletteFade()) if (UpdatePaletteFade())
return 0; return 0;
ChangeBgY(0, 0, 0); ChangeBgY(0, 0, BG_COORD_SET);
ChangeBgY(1, 0, 0); ChangeBgY(1, 0, BG_COORD_SET);
ChangeBgY(2, 0, 0); ChangeBgY(2, 0, BG_COORD_SET);
ChangeBgY(3, 0, 0); ChangeBgY(3, 0, BG_COORD_SET);
SetGpuReg(REG_OFFSET_WIN0H, WIN_RANGE(0, DISPLAY_WIDTH)); SetGpuReg(REG_OFFSET_WIN0H, WIN_RANGE(0, DISPLAY_WIDTH));
SetGpuReg(REG_OFFSET_WIN0V, WIN_RANGE(26, 152)); SetGpuReg(REG_OFFSET_WIN0V, WIN_RANGE(26, 152));
SetGpuReg(REG_OFFSET_WININ, WININ_WIN0_BG_ALL | WININ_WIN0_OBJ); SetGpuReg(REG_OFFSET_WININ, WININ_WIN0_BG_ALL | WININ_WIN0_OBJ);
@@ -753,7 +753,7 @@ s32 WonderNews_Exit(bool32 useCancel)
case 1: case 1:
if (UpdatePaletteFade()) if (UpdatePaletteFade())
return 0; return 0;
ChangeBgY(2, 0, 0); ChangeBgY(2, 0, BG_COORD_SET);
SetGpuReg(REG_OFFSET_WIN0H, 0); SetGpuReg(REG_OFFSET_WIN0H, 0);
SetGpuReg(REG_OFFSET_WIN0V, 0); SetGpuReg(REG_OFFSET_WIN0V, 0);
SetGpuReg(REG_OFFSET_WININ, 0); SetGpuReg(REG_OFFSET_WININ, 0);
@@ -777,8 +777,8 @@ s32 WonderNews_Exit(bool32 useCancel)
RemoveWindow(sWonderNewsData->windowIds[NEWS_WIN_TITLE]); RemoveWindow(sWonderNewsData->windowIds[NEWS_WIN_TITLE]);
break; break;
case 4: case 4:
ChangeBgY(2, 0, 0); ChangeBgY(2, 0, BG_COORD_SET);
ChangeBgY(3, 0, 0); ChangeBgY(3, 0, BG_COORD_SET);
if (sWonderNewsData->arrowTaskId != TASK_NONE) if (sWonderNewsData->arrowTaskId != TASK_NONE)
{ {
RemoveScrollIndicatorArrowPair(sWonderNewsData->arrowTaskId); RemoveScrollIndicatorArrowPair(sWonderNewsData->arrowTaskId);
@@ -905,8 +905,8 @@ static void DrawNewsWindows(void)
sNews_TextColorTable[sWonderNewsData->gfx->bodyTextPal], sNews_TextColorTable[sWonderNewsData->gfx->bodyTextPal],
0, sWonderNewsData->bodyText[i]); 0, sWonderNewsData->bodyText[i]);
CopyWindowToVram(sWonderNewsData->windowIds[NEWS_WIN_TITLE], 3); CopyWindowToVram(sWonderNewsData->windowIds[NEWS_WIN_TITLE], COPYWIN_FULL);
CopyWindowToVram(sWonderNewsData->windowIds[NEWS_WIN_BODY], 3); CopyWindowToVram(sWonderNewsData->windowIds[NEWS_WIN_BODY], COPYWIN_FULL);
} }
static void UpdateNewsScroll(void) static void UpdateNewsScroll(void)
+13 -13
View File
@@ -516,14 +516,14 @@ static void NamingScreen_InitBGs(void)
ResetBgsAndClearDma3BusyFlags(0); ResetBgsAndClearDma3BusyFlags(0);
InitBgsFromTemplates(0, sBgTemplates, ARRAY_COUNT(sBgTemplates)); InitBgsFromTemplates(0, sBgTemplates, ARRAY_COUNT(sBgTemplates));
ChangeBgX(0, 0, 0); ChangeBgX(0, 0, BG_COORD_SET);
ChangeBgY(0, 0, 0); ChangeBgY(0, 0, BG_COORD_SET);
ChangeBgX(1, 0, 0); ChangeBgX(1, 0, BG_COORD_SET);
ChangeBgY(1, 0, 0); ChangeBgY(1, 0, BG_COORD_SET);
ChangeBgX(2, 0, 0); ChangeBgX(2, 0, BG_COORD_SET);
ChangeBgY(2, 0, 0); ChangeBgY(2, 0, BG_COORD_SET);
ChangeBgX(3, 0, 0); ChangeBgX(3, 0, BG_COORD_SET);
ChangeBgY(3, 0, 0); ChangeBgY(3, 0, BG_COORD_SET);
InitStandardTextBoxWindows(); InitStandardTextBoxWindows();
InitTextBoxGfxAndPrinters(); InitTextBoxGfxAndPrinters();
@@ -741,7 +741,7 @@ static void DisplaySentToPCMessage(void)
DrawDialogueFrame(0, 0); DrawDialogueFrame(0, 0);
gTextFlags.canABSpeedUpPrint = TRUE; gTextFlags.canABSpeedUpPrint = TRUE;
AddTextPrinterParameterized2(0, FONT_NORMAL, gStringVar4, GetPlayerTextSpeedDelay(), 0, 2, 1, 3); AddTextPrinterParameterized2(0, FONT_NORMAL, gStringVar4, GetPlayerTextSpeedDelay(), 0, 2, 1, 3);
CopyWindowToVram(0, 3); CopyWindowToVram(0, COPYWIN_FULL);
} }
static bool8 MainState_WaitSentToPCMessage(void) static bool8 MainState_WaitSentToPCMessage(void)
@@ -1781,7 +1781,7 @@ static void DrawGenderIcon(void)
StringCopy(text, gText_FemaleSymbol); StringCopy(text, gText_FemaleSymbol);
isFemale = TRUE; isFemale = TRUE;
} }
AddTextPrinterParameterized3(sNamingScreen->windows[WIN_TEXT_ENTRY], FONT_NORMAL, 0x68, 1, sGenderColors[isFemale], -1, text); AddTextPrinterParameterized3(sNamingScreen->windows[WIN_TEXT_ENTRY], FONT_NORMAL, 0x68, 1, sGenderColors[isFemale], TEXT_SKIP_DRAW, text);
} }
} }
@@ -1921,11 +1921,11 @@ static void DrawTextEntry(void)
temp[1] = gText_ExpandedPlaceholder_Empty[0]; temp[1] = gText_ExpandedPlaceholder_Empty[0];
extraWidth = (IsWideLetter(temp[0]) == TRUE) ? 2 : 0; extraWidth = (IsWideLetter(temp[0]) == TRUE) ? 2 : 0;
AddTextPrinterParameterized(sNamingScreen->windows[WIN_TEXT_ENTRY], FONT_NORMAL, temp, i * 8 + x + extraWidth, 1, 0xFF, NULL); AddTextPrinterParameterized(sNamingScreen->windows[WIN_TEXT_ENTRY], FONT_NORMAL, temp, i * 8 + x + extraWidth, 1, TEXT_SKIP_DRAW, NULL);
} }
TryDrawGenderIcon(); TryDrawGenderIcon();
CopyWindowToVram(sNamingScreen->windows[WIN_TEXT_ENTRY], 2); CopyWindowToVram(sNamingScreen->windows[WIN_TEXT_ENTRY], COPYWIN_GFX);
PutWindowTilemap(sNamingScreen->windows[WIN_TEXT_ENTRY]); PutWindowTilemap(sNamingScreen->windows[WIN_TEXT_ENTRY]);
} }
@@ -2012,7 +2012,7 @@ static void PrintControls(void)
FillWindowPixelBuffer(sNamingScreen->windows[WIN_BANNER], PIXEL_FILL(15)); FillWindowPixelBuffer(sNamingScreen->windows[WIN_BANNER], PIXEL_FILL(15));
AddTextPrinterParameterized3(sNamingScreen->windows[WIN_BANNER], FONT_SMALL, 2, 1, color, 0, gText_MoveOkBack); AddTextPrinterParameterized3(sNamingScreen->windows[WIN_BANNER], FONT_SMALL, 2, 1, color, 0, gText_MoveOkBack);
PutWindowTilemap(sNamingScreen->windows[WIN_BANNER]); PutWindowTilemap(sNamingScreen->windows[WIN_BANNER]);
CopyWindowToVram(sNamingScreen->windows[WIN_BANNER], 3); CopyWindowToVram(sNamingScreen->windows[WIN_BANNER], COPYWIN_FULL);
} }
static void CB2_NamingScreen(void) static void CB2_NamingScreen(void)
+15 -17
View File
@@ -173,14 +173,14 @@ void CB2_InitOptionMenu(void)
SetGpuReg(REG_OFFSET_DISPCNT, 0); SetGpuReg(REG_OFFSET_DISPCNT, 0);
ResetBgsAndClearDma3BusyFlags(0); ResetBgsAndClearDma3BusyFlags(0);
InitBgsFromTemplates(0, sOptionMenuBgTemplates, ARRAY_COUNT(sOptionMenuBgTemplates)); InitBgsFromTemplates(0, sOptionMenuBgTemplates, ARRAY_COUNT(sOptionMenuBgTemplates));
ChangeBgX(0, 0, 0); ChangeBgX(0, 0, BG_COORD_SET);
ChangeBgY(0, 0, 0); ChangeBgY(0, 0, BG_COORD_SET);
ChangeBgX(1, 0, 0); ChangeBgX(1, 0, BG_COORD_SET);
ChangeBgY(1, 0, 0); ChangeBgY(1, 0, BG_COORD_SET);
ChangeBgX(2, 0, 0); ChangeBgX(2, 0, BG_COORD_SET);
ChangeBgY(2, 0, 0); ChangeBgY(2, 0, BG_COORD_SET);
ChangeBgX(3, 0, 0); ChangeBgX(3, 0, BG_COORD_SET);
ChangeBgY(3, 0, 0); ChangeBgY(3, 0, BG_COORD_SET);
InitWindows(sOptionMenuWinTemplates); InitWindows(sOptionMenuWinTemplates);
DeactivateAllTextPrinters(); DeactivateAllTextPrinters();
SetGpuReg(REG_OFFSET_WIN0H, 0); SetGpuReg(REG_OFFSET_WIN0H, 0);
@@ -251,7 +251,7 @@ void CB2_InitOptionMenu(void)
FrameType_DrawChoices(gTasks[taskId].data[TD_FRAMETYPE]); FrameType_DrawChoices(gTasks[taskId].data[TD_FRAMETYPE]);
HighlightOptionMenuItem(gTasks[taskId].data[TD_MENUSELECTION]); HighlightOptionMenuItem(gTasks[taskId].data[TD_MENUSELECTION]);
CopyWindowToVram(WIN_OPTIONS, 3); CopyWindowToVram(WIN_OPTIONS, COPYWIN_FULL);
gMain.state++; gMain.state++;
break; break;
} }
@@ -351,7 +351,7 @@ static void Task_OptionMenuProcessInput(u8 taskId)
if (sArrowPressed) if (sArrowPressed)
{ {
sArrowPressed = FALSE; sArrowPressed = FALSE;
CopyWindowToVram(WIN_OPTIONS, 2); CopyWindowToVram(WIN_OPTIONS, COPYWIN_GFX);
} }
} }
} }
@@ -400,7 +400,7 @@ static void DrawOptionMenuChoice(const u8 *text, u8 x, u8 y, u8 style)
} }
dst[i] = EOS; dst[i] = EOS;
AddTextPrinterParameterized(WIN_OPTIONS, FONT_NORMAL, dst, x, y + 1, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(WIN_OPTIONS, FONT_NORMAL, dst, x, y + 1, TEXT_SKIP_DRAW, NULL);
} }
static u8 TextSpeed_ProcessInput(u8 selection) static u8 TextSpeed_ProcessInput(u8 selection)
@@ -626,8 +626,8 @@ static void ButtonMode_DrawChoices(u8 selection)
static void DrawTextOption(void) static void DrawTextOption(void)
{ {
FillWindowPixelBuffer(WIN_TEXT_OPTION, PIXEL_FILL(1)); FillWindowPixelBuffer(WIN_TEXT_OPTION, PIXEL_FILL(1));
AddTextPrinterParameterized(WIN_TEXT_OPTION, FONT_NORMAL, gText_Option, 8, 1, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(WIN_TEXT_OPTION, FONT_NORMAL, gText_Option, 8, 1, TEXT_SKIP_DRAW, NULL);
CopyWindowToVram(WIN_TEXT_OPTION, 3); CopyWindowToVram(WIN_TEXT_OPTION, COPYWIN_FULL);
} }
static void DrawOptionMenuTexts(void) static void DrawOptionMenuTexts(void)
@@ -636,10 +636,8 @@ static void DrawOptionMenuTexts(void)
FillWindowPixelBuffer(WIN_OPTIONS, PIXEL_FILL(1)); FillWindowPixelBuffer(WIN_OPTIONS, PIXEL_FILL(1));
for (i = 0; i < MENUITEM_COUNT; i++) for (i = 0; i < MENUITEM_COUNT; i++)
{ AddTextPrinterParameterized(WIN_OPTIONS, FONT_NORMAL, sOptionMenuItemsNames[i], 8, (i * 16) + 1, TEXT_SKIP_DRAW, NULL);
AddTextPrinterParameterized(WIN_OPTIONS, FONT_NORMAL, sOptionMenuItemsNames[i], 8, (i * 16) + 1, TEXT_SPEED_FF, NULL); CopyWindowToVram(WIN_OPTIONS, COPYWIN_FULL);
}
CopyWindowToVram(WIN_OPTIONS, 3);
} }
#define TILE_TOP_CORNER_L 0x1A2 #define TILE_TOP_CORNER_L 0x1A2
+8 -8
View File
@@ -2101,14 +2101,14 @@ static void InitOverworldGraphicsRegisters(void)
ScheduleBgCopyTilemapToVram(1); ScheduleBgCopyTilemapToVram(1);
ScheduleBgCopyTilemapToVram(2); ScheduleBgCopyTilemapToVram(2);
ScheduleBgCopyTilemapToVram(3); ScheduleBgCopyTilemapToVram(3);
ChangeBgX(0, 0, 0); ChangeBgX(0, 0, BG_COORD_SET);
ChangeBgY(0, 0, 0); ChangeBgY(0, 0, BG_COORD_SET);
ChangeBgX(1, 0, 0); ChangeBgX(1, 0, BG_COORD_SET);
ChangeBgY(1, 0, 0); ChangeBgY(1, 0, BG_COORD_SET);
ChangeBgX(2, 0, 0); ChangeBgX(2, 0, BG_COORD_SET);
ChangeBgY(2, 0, 0); ChangeBgY(2, 0, BG_COORD_SET);
ChangeBgX(3, 0, 0); ChangeBgX(3, 0, BG_COORD_SET);
ChangeBgY(3, 0, 0); ChangeBgY(3, 0, BG_COORD_SET);
SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_OBJ_ON | DISPCNT_WIN0_ON | DISPCNT_WIN1_ON SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_OBJ_ON | DISPCNT_WIN0_ON | DISPCNT_WIN1_ON
| DISPCNT_OBJ_1D_MAP | DISPCNT_HBLANK_INTERVAL); | DISPCNT_OBJ_1D_MAP | DISPCNT_HBLANK_INTERVAL);
ShowBg(0); ShowBg(0);
+15 -15
View File
@@ -754,7 +754,7 @@ static void RenderPartyMenuBox(u8 slot)
LoadPartyBoxPalette(&sPartyMenuBoxes[slot], PARTY_PAL_NO_MON); LoadPartyBoxPalette(&sPartyMenuBoxes[slot], PARTY_PAL_NO_MON);
else else
LoadPartyBoxPalette(&sPartyMenuBoxes[slot], PARTY_PAL_MULTI_ALT); LoadPartyBoxPalette(&sPartyMenuBoxes[slot], PARTY_PAL_MULTI_ALT);
CopyWindowToVram(sPartyMenuBoxes[slot].windowId, 2); CopyWindowToVram(sPartyMenuBoxes[slot].windowId, COPYWIN_GFX);
PutWindowTilemap(sPartyMenuBoxes[slot].windowId); PutWindowTilemap(sPartyMenuBoxes[slot].windowId);
ScheduleBgCopyTilemapToVram(2); ScheduleBgCopyTilemapToVram(2);
} }
@@ -764,7 +764,7 @@ static void RenderPartyMenuBox(u8 slot)
{ {
DrawEmptySlot(sPartyMenuBoxes[slot].windowId); DrawEmptySlot(sPartyMenuBoxes[slot].windowId);
LoadPartyBoxPalette(&sPartyMenuBoxes[slot], PARTY_PAL_NO_MON); LoadPartyBoxPalette(&sPartyMenuBoxes[slot], PARTY_PAL_NO_MON);
CopyWindowToVram(sPartyMenuBoxes[slot].windowId, 2); CopyWindowToVram(sPartyMenuBoxes[slot].windowId, COPYWIN_GFX);
} }
else else
{ {
@@ -2036,9 +2036,9 @@ static void CreateCancelConfirmWindows(bool8 chooseHalf)
confirmWindowId = AddWindow(&sConfirmButtonWindowTemplate); confirmWindowId = AddWindow(&sConfirmButtonWindowTemplate);
FillWindowPixelBuffer(confirmWindowId, PIXEL_FILL(0)); FillWindowPixelBuffer(confirmWindowId, PIXEL_FILL(0));
mainOffset = GetStringCenterAlignXOffset(FONT_SMALL, gMenuText_Confirm, 48); mainOffset = GetStringCenterAlignXOffset(FONT_SMALL, gMenuText_Confirm, 48);
AddTextPrinterParameterized4(confirmWindowId, FONT_SMALL, mainOffset, 1, 0, 0, sFontColorTable[0], -1, gMenuText_Confirm); AddTextPrinterParameterized4(confirmWindowId, FONT_SMALL, mainOffset, 1, 0, 0, sFontColorTable[0], TEXT_SKIP_DRAW, gMenuText_Confirm);
PutWindowTilemap(confirmWindowId); PutWindowTilemap(confirmWindowId);
CopyWindowToVram(confirmWindowId, 2); CopyWindowToVram(confirmWindowId, COPYWIN_GFX);
cancelWindowId = AddWindow(&sMultiCancelButtonWindowTemplate); cancelWindowId = AddWindow(&sMultiCancelButtonWindowTemplate);
offset = 0; offset = 0;
} }
@@ -2053,15 +2053,15 @@ static void CreateCancelConfirmWindows(bool8 chooseHalf)
if (gPartyMenu.menuType != PARTY_MENU_TYPE_SPIN_TRADE) if (gPartyMenu.menuType != PARTY_MENU_TYPE_SPIN_TRADE)
{ {
mainOffset = GetStringCenterAlignXOffset(FONT_SMALL, gText_Cancel, 48); mainOffset = GetStringCenterAlignXOffset(FONT_SMALL, gText_Cancel, 48);
AddTextPrinterParameterized3(cancelWindowId, FONT_SMALL, mainOffset + offset, 1, sFontColorTable[0], -1, gText_Cancel); AddTextPrinterParameterized3(cancelWindowId, FONT_SMALL, mainOffset + offset, 1, sFontColorTable[0], TEXT_SKIP_DRAW, gText_Cancel);
} }
else else
{ {
mainOffset = GetStringCenterAlignXOffset(FONT_SMALL, gText_Cancel2, 48); mainOffset = GetStringCenterAlignXOffset(FONT_SMALL, gText_Cancel2, 48);
AddTextPrinterParameterized3(cancelWindowId, FONT_SMALL, mainOffset + offset, 1, sFontColorTable[0], -1, gText_Cancel2); AddTextPrinterParameterized3(cancelWindowId, FONT_SMALL, mainOffset + offset, 1, sFontColorTable[0], TEXT_SKIP_DRAW, gText_Cancel2);
} }
PutWindowTilemap(cancelWindowId); PutWindowTilemap(cancelWindowId);
CopyWindowToVram(cancelWindowId, 2); CopyWindowToVram(cancelWindowId, COPYWIN_GFX);
ScheduleBgCopyTilemapToVram(0); ScheduleBgCopyTilemapToVram(0);
} }
} }
@@ -2354,7 +2354,7 @@ static void DisplayPartyPokemonHPBar(u16 hp, u16 maxhp, struct PartyMenuBox *men
FillWindowPixelRect(menuBox->windowId, 0x0D, menuBox->infoRects->dimensions[20] + hpFraction, menuBox->infoRects->dimensions[21], menuBox->infoRects->dimensions[22] - hpFraction, 1); FillWindowPixelRect(menuBox->windowId, 0x0D, menuBox->infoRects->dimensions[20] + hpFraction, menuBox->infoRects->dimensions[21], menuBox->infoRects->dimensions[22] - hpFraction, 1);
FillWindowPixelRect(menuBox->windowId, 0x02, menuBox->infoRects->dimensions[20] + hpFraction, menuBox->infoRects->dimensions[21] + 1, menuBox->infoRects->dimensions[22] - hpFraction, 2); FillWindowPixelRect(menuBox->windowId, 0x02, menuBox->infoRects->dimensions[20] + hpFraction, menuBox->infoRects->dimensions[21] + 1, menuBox->infoRects->dimensions[22] - hpFraction, 2);
} }
CopyWindowToVram(menuBox->windowId, 2); CopyWindowToVram(menuBox->windowId, COPYWIN_GFX);
} }
static void DisplayPartyPokemonDescriptionText(u8 stringID, struct PartyMenuBox *menuBox, u8 c) static void DisplayPartyPokemonDescriptionText(u8 stringID, struct PartyMenuBox *menuBox, u8 c)
@@ -2481,7 +2481,7 @@ static u8 DisplaySelectionWindow(u8 windowType)
AddTextPrinterParameterized4(sPartyMenuInternal->windowId[0], FONT_NORMAL, cursorDimension, (i * 16) + 1, letterSpacing, 0, sFontColorTable[fontColorsId], 0, sCursorOptions[sPartyMenuInternal->actions[i]].text); AddTextPrinterParameterized4(sPartyMenuInternal->windowId[0], FONT_NORMAL, cursorDimension, (i * 16) + 1, letterSpacing, 0, sFontColorTable[fontColorsId], 0, sCursorOptions[sPartyMenuInternal->actions[i]].text);
} }
InitMenuInUpperLeftCorner(sPartyMenuInternal->windowId[0], sPartyMenuInternal->numActions, 0, 1); InitMenuInUpperLeftCorner(sPartyMenuInternal->windowId[0], sPartyMenuInternal->numActions, 0, TRUE);
ScheduleBgCopyTilemapToVram(2); ScheduleBgCopyTilemapToVram(2);
return sPartyMenuInternal->windowId[0]; return sPartyMenuInternal->windowId[0];
@@ -4504,11 +4504,11 @@ static void ShowMoveSelectWindow(u8 slot)
for (i = 0; i < MAX_MON_MOVES; i++) for (i = 0; i < MAX_MON_MOVES; i++)
{ {
move = GetMonData(&gPlayerParty[slot], MON_DATA_MOVE1 + i); move = GetMonData(&gPlayerParty[slot], MON_DATA_MOVE1 + i);
AddTextPrinterParameterized(windowId, fontId, gMoveNames[move], 8, (i * 16) + 1, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(windowId, fontId, gMoveNames[move], 8, (i * 16) + 1, TEXT_SKIP_DRAW, NULL);
if (move != MOVE_NONE) if (move != MOVE_NONE)
moveCount++; moveCount++;
} }
InitMenuInUpperLeftCornerPlaySoundWhenAPressed(windowId, moveCount, 0); InitMenuInUpperLeftCornerNormal(windowId, moveCount, 0);
ScheduleBgCopyTilemapToVram(2); ScheduleBgCopyTilemapToVram(2);
} }
@@ -4954,7 +4954,7 @@ static void DisplayLevelUpStatsPg1(u8 taskId)
arrayPtr[12] = CreateLevelUpStatsWindow(); arrayPtr[12] = CreateLevelUpStatsWindow();
DrawLevelUpWindowPg1(arrayPtr[12], arrayPtr, &arrayPtr[6], TEXT_COLOR_WHITE, TEXT_COLOR_DARK_GRAY, TEXT_COLOR_LIGHT_GRAY); DrawLevelUpWindowPg1(arrayPtr[12], arrayPtr, &arrayPtr[6], TEXT_COLOR_WHITE, TEXT_COLOR_DARK_GRAY, TEXT_COLOR_LIGHT_GRAY);
CopyWindowToVram(arrayPtr[12], 2); CopyWindowToVram(arrayPtr[12], COPYWIN_GFX);
ScheduleBgCopyTilemapToVram(2); ScheduleBgCopyTilemapToVram(2);
} }
@@ -4963,7 +4963,7 @@ static void DisplayLevelUpStatsPg2(u8 taskId)
s16 *arrayPtr = sPartyMenuInternal->data; s16 *arrayPtr = sPartyMenuInternal->data;
DrawLevelUpWindowPg2(arrayPtr[12], &arrayPtr[6], TEXT_COLOR_WHITE, TEXT_COLOR_DARK_GRAY, TEXT_COLOR_LIGHT_GRAY); DrawLevelUpWindowPg2(arrayPtr[12], &arrayPtr[6], TEXT_COLOR_WHITE, TEXT_COLOR_DARK_GRAY, TEXT_COLOR_LIGHT_GRAY);
CopyWindowToVram(arrayPtr[12], 2); CopyWindowToVram(arrayPtr[12], COPYWIN_GFX);
ScheduleBgCopyTilemapToVram(2); ScheduleBgCopyTilemapToVram(2);
} }
@@ -6056,7 +6056,7 @@ static void Task_InitMultiPartnerPartySlideIn(u8 taskId)
// The first slide step also sets the sprites offscreen // The first slide step also sets the sprites offscreen
gTasks[taskId].tXPos = 256; gTasks[taskId].tXPos = 256;
SlideMultiPartyMenuBoxSpritesOneStep(taskId); SlideMultiPartyMenuBoxSpritesOneStep(taskId);
ChangeBgX(2, 0x10000, 0); ChangeBgX(2, 0x10000, BG_COORD_SET);
gTasks[taskId].func = Task_MultiPartnerPartySlideIn; gTasks[taskId].func = Task_MultiPartnerPartySlideIn;
} }
@@ -6112,7 +6112,7 @@ static void SlideMultiPartyMenuBoxSpritesOneStep(u8 taskId)
MoveMultiPartyMenuBoxSprite(sPartyMenuBoxes[i].statusSpriteId, tXPos - 8); MoveMultiPartyMenuBoxSprite(sPartyMenuBoxes[i].statusSpriteId, tXPos - 8);
} }
} }
ChangeBgX(2, 0x800, 1); ChangeBgX(2, 0x800, BG_COORD_ADD);
} }
#undef tXpos #undef tXpos
+8 -8
View File
@@ -399,8 +399,8 @@ static void InitPlayerPCMenu(u8 taskId)
windowTemplate.width = GetMaxWidthInSubsetOfMenuTable(sPlayerPCMenuActions, sTopMenuOptionOrder, sTopMenuNumOptions); windowTemplate.width = GetMaxWidthInSubsetOfMenuTable(sPlayerPCMenuActions, sTopMenuOptionOrder, sTopMenuNumOptions);
tWindowId = AddWindow(&windowTemplate); tWindowId = AddWindow(&windowTemplate);
SetStandardWindowBorderStyle(tWindowId, 0); SetStandardWindowBorderStyle(tWindowId, 0);
sub_81995E4(tWindowId, sTopMenuNumOptions, sPlayerPCMenuActions, sTopMenuOptionOrder); PrintMenuActionTextsInUpperLeftCorner(tWindowId, sTopMenuNumOptions, sPlayerPCMenuActions, sTopMenuOptionOrder);
InitMenuInUpperLeftCornerPlaySoundWhenAPressed(tWindowId, sTopMenuNumOptions, 0); InitMenuInUpperLeftCornerNormal(tWindowId, sTopMenuNumOptions, 0);
ScheduleBgCopyTilemapToVram(0); ScheduleBgCopyTilemapToVram(0);
gTasks[taskId].func = PlayerPCProcessMenuInput; gTasks[taskId].func = PlayerPCProcessMenuInput;
} }
@@ -511,7 +511,7 @@ static void InitItemStorageMenu(u8 taskId, u8 var)
tWindowId = AddWindow(&windowTemplate); tWindowId = AddWindow(&windowTemplate);
SetStandardWindowBorderStyle(tWindowId, 0); SetStandardWindowBorderStyle(tWindowId, 0);
PrintMenuTable(tWindowId, ARRAY_COUNT(sItemStorage_MenuActions), sItemStorage_MenuActions); PrintMenuTable(tWindowId, ARRAY_COUNT(sItemStorage_MenuActions), sItemStorage_MenuActions);
InitMenuInUpperLeftCornerPlaySoundWhenAPressed(tWindowId, 4, var); InitMenuInUpperLeftCornerNormal(tWindowId, 4, var);
ScheduleBgCopyTilemapToVram(0); ScheduleBgCopyTilemapToVram(0);
ItemStorageMenuPrint(sItemStorage_OptionDescriptions[var]); ItemStorageMenuPrint(sItemStorage_OptionDescriptions[var]);
} }
@@ -753,7 +753,7 @@ static void Mailbox_PrintMailOptions(u8 taskId)
{ {
u8 windowId = MailboxMenu_AddWindow(MAILBOXWIN_OPTIONS); u8 windowId = MailboxMenu_AddWindow(MAILBOXWIN_OPTIONS);
PrintMenuTable(windowId, ARRAY_COUNT(gMailboxMailOptions), gMailboxMailOptions); PrintMenuTable(windowId, ARRAY_COUNT(gMailboxMailOptions), gMailboxMailOptions);
InitMenuInUpperLeftCornerPlaySoundWhenAPressed(windowId, 4, 0); InitMenuInUpperLeftCornerNormal(windowId, 4, 0);
ScheduleBgCopyTilemapToVram(0); ScheduleBgCopyTilemapToVram(0);
gTasks[taskId].func = Mailbox_MailOptionsProcessInput; gTasks[taskId].func = Mailbox_MailOptionsProcessInput;
} }
@@ -1027,13 +1027,13 @@ static void ItemStorage_PrintMenuItem(u8 windowId, u32 id, u8 yOffset)
if (sItemStorageMenu->toSwapPos != NOT_SWAPPING) if (sItemStorageMenu->toSwapPos != NOT_SWAPPING)
{ {
if (sItemStorageMenu->toSwapPos == (u8)id) if (sItemStorageMenu->toSwapPos == (u8)id)
ItemStorage_DrawSwapArrow(yOffset, 0, TEXT_SPEED_FF); ItemStorage_DrawSwapArrow(yOffset, 0, TEXT_SKIP_DRAW);
else else
ItemStorage_DrawSwapArrow(yOffset, 0xFF, TEXT_SPEED_FF); ItemStorage_DrawSwapArrow(yOffset, 0xFF, TEXT_SKIP_DRAW);
} }
ConvertIntToDecimalStringN(gStringVar1, gSaveBlock1Ptr->pcItems[id].quantity, STR_CONV_MODE_RIGHT_ALIGN, 3); ConvertIntToDecimalStringN(gStringVar1, gSaveBlock1Ptr->pcItems[id].quantity, STR_CONV_MODE_RIGHT_ALIGN, 3);
StringExpandPlaceholders(gStringVar4, gText_xVar1); StringExpandPlaceholders(gStringVar4, gText_xVar1);
AddTextPrinterParameterized(windowId, FONT_NARROW, gStringVar4, GetStringRightAlignXOffset(FONT_NARROW, gStringVar4, 104), yOffset, 0xFF, NULL); AddTextPrinterParameterized(windowId, FONT_NARROW, gStringVar4, GetStringRightAlignXOffset(FONT_NARROW, gStringVar4, 104), yOffset, TEXT_SKIP_DRAW, NULL);
} }
} }
@@ -1144,7 +1144,7 @@ static void ItemStorage_CreateListMenu(u8 taskId)
text = gText_WithdrawItem; text = gText_WithdrawItem;
x = GetStringCenterAlignXOffset(FONT_NORMAL, text, 104); x = GetStringCenterAlignXOffset(FONT_NORMAL, text, 104);
AddTextPrinterParameterized(sItemStorageMenu->windowIds[ITEMPC_WIN_TITLE], FONT_NORMAL, text, x, 1, 0, NULL); AddTextPrinterParameterized(sItemStorageMenu->windowIds[ITEMPC_WIN_TITLE], FONT_NORMAL, text, x, 1, 0, NULL);
CopyWindowToVram(sItemStorageMenu->windowIds[ITEMPC_WIN_ICON], 2); CopyWindowToVram(sItemStorageMenu->windowIds[ITEMPC_WIN_ICON], COPYWIN_GFX);
ItemStorage_CompactList(); ItemStorage_CompactList();
ItemStorage_CompactCursor(); ItemStorage_CompactCursor();
ItemStorage_RefreshListMenu(); ItemStorage_RefreshListMenu();
+3 -3
View File
@@ -802,7 +802,7 @@ static void DrawPokeblockInfo(s32 pkblId)
for (i = 0; i < FLAVOR_COUNT; i++) for (i = 0; i < FLAVOR_COUNT; i++)
CopyToBgTilemapBufferRect(2, rectTilemapSrc, (i / 3 * 6) + 1, (i % 3 * 2) + 13, 1, 2); CopyToBgTilemapBufferRect(2, rectTilemapSrc, (i / 3 * 6) + 1, (i % 3 * 2) + 13, 1, 2);
CopyWindowToVram(7, 2); CopyWindowToVram(7, COPYWIN_GFX);
} }
ScheduleBgCopyTilemapToVram(0); ScheduleBgCopyTilemapToVram(0);
@@ -1149,8 +1149,8 @@ static void ShowPokeblockActionsWindow(u8 taskId)
DestroyScrollArrows(); DestroyScrollArrows();
DrawStdFrameWithCustomTileAndPalette(tWindowId, 0, 1, 0xE); DrawStdFrameWithCustomTileAndPalette(tWindowId, 0, 1, 0xE);
sub_81995E4(tWindowId, sPokeblockMenu->numActions, sPokeblockMenuActions, sPokeblockMenu->pokeblockActionIds); PrintMenuActionTextsInUpperLeftCorner(tWindowId, sPokeblockMenu->numActions, sPokeblockMenuActions, sPokeblockMenu->pokeblockActionIds);
InitMenuInUpperLeftCornerPlaySoundWhenAPressed(tWindowId, sPokeblockMenu->numActions, 0); InitMenuInUpperLeftCornerNormal(tWindowId, sPokeblockMenu->numActions, 0);
PutWindowTilemap(tWindowId); PutWindowTilemap(tWindowId);
ScheduleBgCopyTilemapToVram(1); ScheduleBgCopyTilemapToVram(1);
+29 -29
View File
@@ -2081,7 +2081,7 @@ static bool8 LoadPokedexListPage(u8 page)
InitWindows(sPokemonList_WindowTemplate); InitWindows(sPokemonList_WindowTemplate);
DeactivateAllTextPrinters(); DeactivateAllTextPrinters();
PutWindowTilemap(0); PutWindowTilemap(0);
CopyWindowToVram(0, 3); CopyWindowToVram(0, COPYWIN_FULL);
gMain.state = 1; gMain.state = 1;
break; break;
case 1: case 1:
@@ -2324,7 +2324,7 @@ static void PrintMonDexNumAndName(u8 windowId, u8 fontId, const u8* str, u8 left
color[0] = TEXT_COLOR_TRANSPARENT; color[0] = TEXT_COLOR_TRANSPARENT;
color[1] = TEXT_DYNAMIC_COLOR_6; color[1] = TEXT_DYNAMIC_COLOR_6;
color[2] = TEXT_COLOR_LIGHT_GRAY; color[2] = TEXT_COLOR_LIGHT_GRAY;
AddTextPrinterParameterized4(windowId, fontId, left * 8, (top * 8) + 1, 0, 0, color, -1, str); AddTextPrinterParameterized4(windowId, fontId, left * 8, (top * 8) + 1, 0, 0, color, TEXT_SKIP_DRAW, str);
} }
// u16 ignored is passed but never used // u16 ignored is passed but never used
@@ -2412,7 +2412,7 @@ static void CreateMonListEntry(u8 position, u16 b, u16 ignored)
} }
break; break;
} }
CopyWindowToVram(0, 2); CopyWindowToVram(0, COPYWIN_GFX);
} }
static void CreateMonDexNum(u16 entryNum, u8 left, u8 top, u16 unused) static void CreateMonDexNum(u16 entryNum, u8 left, u8 top, u16 unused)
@@ -3167,7 +3167,7 @@ static void PrintInfoScreenText(const u8* str, u8 left, u8 top)
color[1] = TEXT_DYNAMIC_COLOR_6; color[1] = TEXT_DYNAMIC_COLOR_6;
color[2] = TEXT_COLOR_LIGHT_GRAY; color[2] = TEXT_COLOR_LIGHT_GRAY;
AddTextPrinterParameterized4(0, FONT_NORMAL, left, top, 0, 0, color, -1, str); AddTextPrinterParameterized4(0, FONT_NORMAL, left, top, 0, 0, color, TEXT_SKIP_DRAW, str);
} }
#define tScrolling data[0] #define tScrolling data[0]
@@ -3248,7 +3248,7 @@ static void Task_LoadInfoScreen(u8 taskId)
PutWindowTilemap(WIN_INFO); PutWindowTilemap(WIN_INFO);
PutWindowTilemap(WIN_FOOTPRINT); PutWindowTilemap(WIN_FOOTPRINT);
DrawFootprint(WIN_FOOTPRINT, sPokedexListItem->dexNum); DrawFootprint(WIN_FOOTPRINT, sPokedexListItem->dexNum);
CopyWindowToVram(WIN_FOOTPRINT, 2); CopyWindowToVram(WIN_FOOTPRINT, COPYWIN_GFX);
gMain.state++; gMain.state++;
break; break;
case 2: case 2:
@@ -3264,7 +3264,7 @@ static void Task_LoadInfoScreen(u8 taskId)
PrintMonInfo(sPokedexListItem->dexNum, sPokedexView->dexMode == DEX_MODE_HOENN ? FALSE : TRUE, sPokedexListItem->owned, 0); PrintMonInfo(sPokedexListItem->dexNum, sPokedexView->dexMode == DEX_MODE_HOENN ? FALSE : TRUE, sPokedexListItem->owned, 0);
if (!sPokedexListItem->owned) if (!sPokedexListItem->owned)
LoadPalette(gPlttBufferUnfaded + 1, 0x31, 0x1E); LoadPalette(gPlttBufferUnfaded + 1, 0x31, 0x1E);
CopyWindowToVram(WIN_INFO, 3); CopyWindowToVram(WIN_INFO, COPYWIN_FULL);
CopyBgTilemapBufferToVram(1); CopyBgTilemapBufferToVram(1);
CopyBgTilemapBufferToVram(2); CopyBgTilemapBufferToVram(2);
CopyBgTilemapBufferToVram(3); CopyBgTilemapBufferToVram(3);
@@ -3594,8 +3594,8 @@ static void Task_LoadCryScreen(u8 taskId)
cryMeter.yPos = 3; cryMeter.yPos = 3;
if (LoadCryMeter(&cryMeter, 3)) if (LoadCryMeter(&cryMeter, 3))
gMain.state++; gMain.state++;
CopyWindowToVram(WIN_VU_METER, 2); CopyWindowToVram(WIN_VU_METER, COPYWIN_GFX);
CopyWindowToVram(WIN_INFO, 3); CopyWindowToVram(WIN_INFO, COPYWIN_FULL);
CopyBgTilemapBufferToVram(0); CopyBgTilemapBufferToVram(0);
CopyBgTilemapBufferToVram(1); CopyBgTilemapBufferToVram(1);
CopyBgTilemapBufferToVram(2); CopyBgTilemapBufferToVram(2);
@@ -3780,7 +3780,7 @@ static void Task_LoadSizeScreen(u8 taskId)
SetOamMatrix(2, gPokedexEntries[sPokedexListItem->dexNum].pokemonScale, 0, 0, gPokedexEntries[sPokedexListItem->dexNum].pokemonScale); SetOamMatrix(2, gPokedexEntries[sPokedexListItem->dexNum].pokemonScale, 0, 0, gPokedexEntries[sPokedexListItem->dexNum].pokemonScale);
LoadPalette(sSizeScreenSilhouette_Pal, (gSprites[spriteId].oam.paletteNum + 16) * 16, 0x20); LoadPalette(sSizeScreenSilhouette_Pal, (gSprites[spriteId].oam.paletteNum + 16) * 16, 0x20);
gTasks[taskId].tMonSpriteId = spriteId; gTasks[taskId].tMonSpriteId = spriteId;
CopyWindowToVram(WIN_INFO, 3); CopyWindowToVram(WIN_INFO, COPYWIN_FULL);
CopyBgTilemapBufferToVram(1); CopyBgTilemapBufferToVram(1);
CopyBgTilemapBufferToVram(2); CopyBgTilemapBufferToVram(2);
CopyBgTilemapBufferToVram(3); CopyBgTilemapBufferToVram(3);
@@ -3975,7 +3975,7 @@ static void Task_DisplayCaughtMonDexPage(u8 taskId)
PutWindowTilemap(WIN_INFO); PutWindowTilemap(WIN_INFO);
PutWindowTilemap(WIN_FOOTPRINT); PutWindowTilemap(WIN_FOOTPRINT);
DrawFootprint(WIN_FOOTPRINT, gTasks[taskId].tDexNum); DrawFootprint(WIN_FOOTPRINT, gTasks[taskId].tDexNum);
CopyWindowToVram(WIN_FOOTPRINT, 2); CopyWindowToVram(WIN_FOOTPRINT, COPYWIN_GFX);
ResetPaletteFade(); ResetPaletteFade();
LoadPokedexBgPalette(FALSE); LoadPokedexBgPalette(FALSE);
gTasks[taskId].tState++; gTasks[taskId].tState++;
@@ -3985,7 +3985,7 @@ static void Task_DisplayCaughtMonDexPage(u8 taskId)
break; break;
case 3: case 3:
PrintMonInfo(dexNum, IsNationalPokedexEnabled(), 1, 1); PrintMonInfo(dexNum, IsNationalPokedexEnabled(), 1, 1);
CopyWindowToVram(WIN_INFO, 3); CopyWindowToVram(WIN_INFO, COPYWIN_FULL);
CopyBgTilemapBufferToVram(2); CopyBgTilemapBufferToVram(2);
CopyBgTilemapBufferToVram(3); CopyBgTilemapBufferToVram(3);
gTasks[taskId].tState++; gTasks[taskId].tState++;
@@ -4474,7 +4474,7 @@ static void PrintInfoSubMenuText(u8 windowId, const u8 *str, u8 left, u8 top)
color[1] = TEXT_DYNAMIC_COLOR_6; color[1] = TEXT_DYNAMIC_COLOR_6;
color[2] = TEXT_COLOR_LIGHT_GRAY; color[2] = TEXT_COLOR_LIGHT_GRAY;
AddTextPrinterParameterized4(windowId, FONT_NORMAL, left, top, 0, 0, color, -1, str); AddTextPrinterParameterized4(windowId, FONT_NORMAL, left, top, 0, 0, color, TEXT_SKIP_DRAW, str);
} }
static void UnusedPrintNum(u8 windowId, u16 num, u8 left, u8 top) static void UnusedPrintNum(u8 windowId, u16 num, u8 left, u8 top)
@@ -4781,7 +4781,7 @@ static void PrintSearchText(const u8 *str, u32 x, u32 y)
color[0] = TEXT_COLOR_TRANSPARENT; color[0] = TEXT_COLOR_TRANSPARENT;
color[1] = TEXT_DYNAMIC_COLOR_6; color[1] = TEXT_DYNAMIC_COLOR_6;
color[2] = TEXT_COLOR_DARK_GRAY; color[2] = TEXT_COLOR_DARK_GRAY;
AddTextPrinterParameterized4(0, FONT_NORMAL, x, y, 0, 0, color, -1, str); AddTextPrinterParameterized4(0, FONT_NORMAL, x, y, 0, 0, color, TEXT_SKIP_DRAW, str);
} }
static void ClearSearchMenuRect(u32 x, u32 y, u32 width, u32 height) static void ClearSearchMenuRect(u32 x, u32 y, u32 width, u32 height)
@@ -4847,7 +4847,7 @@ static void Task_LoadSearchMenu(u8 taskId)
SetDefaultSearchModeAndOrder(taskId); SetDefaultSearchModeAndOrder(taskId);
HighlightSelectedSearchTopBarItem(SEARCH_TOPBAR_SEARCH); HighlightSelectedSearchTopBarItem(SEARCH_TOPBAR_SEARCH);
PrintSelectedSearchParameters(taskId); PrintSelectedSearchParameters(taskId);
CopyWindowToVram(0, 3); CopyWindowToVram(0, COPYWIN_FULL);
CopyBgTilemapBufferToVram(1); CopyBgTilemapBufferToVram(1);
CopyBgTilemapBufferToVram(2); CopyBgTilemapBufferToVram(2);
CopyBgTilemapBufferToVram(3); CopyBgTilemapBufferToVram(3);
@@ -4901,7 +4901,7 @@ static void Task_SwitchToSearchMenuTopBar(u8 taskId)
{ {
HighlightSelectedSearchTopBarItem(gTasks[taskId].tTopBarItem); HighlightSelectedSearchTopBarItem(gTasks[taskId].tTopBarItem);
PrintSelectedSearchParameters(taskId); PrintSelectedSearchParameters(taskId);
CopyWindowToVram(0, 2); CopyWindowToVram(0, COPYWIN_GFX);
CopyBgTilemapBufferToVram(3); CopyBgTilemapBufferToVram(3);
gTasks[taskId].func = Task_HandleSearchTopBarInput; gTasks[taskId].func = Task_HandleSearchTopBarInput;
} }
@@ -4940,7 +4940,7 @@ static void Task_HandleSearchTopBarInput(u8 taskId)
PlaySE(SE_DEX_PAGE); PlaySE(SE_DEX_PAGE);
gTasks[taskId].tTopBarItem--; gTasks[taskId].tTopBarItem--;
HighlightSelectedSearchTopBarItem(gTasks[taskId].tTopBarItem); HighlightSelectedSearchTopBarItem(gTasks[taskId].tTopBarItem);
CopyWindowToVram(0, 2); CopyWindowToVram(0, COPYWIN_GFX);
CopyBgTilemapBufferToVram(3); CopyBgTilemapBufferToVram(3);
} }
if (JOY_NEW(DPAD_RIGHT) && gTasks[taskId].tTopBarItem < SEARCH_TOPBAR_CANCEL) if (JOY_NEW(DPAD_RIGHT) && gTasks[taskId].tTopBarItem < SEARCH_TOPBAR_CANCEL)
@@ -4948,7 +4948,7 @@ static void Task_HandleSearchTopBarInput(u8 taskId)
PlaySE(SE_DEX_PAGE); PlaySE(SE_DEX_PAGE);
gTasks[taskId].tTopBarItem++; gTasks[taskId].tTopBarItem++;
HighlightSelectedSearchTopBarItem(gTasks[taskId].tTopBarItem); HighlightSelectedSearchTopBarItem(gTasks[taskId].tTopBarItem);
CopyWindowToVram(0, 2); CopyWindowToVram(0, COPYWIN_GFX);
CopyBgTilemapBufferToVram(3); CopyBgTilemapBufferToVram(3);
} }
} }
@@ -4957,7 +4957,7 @@ static void Task_SwitchToSearchMenu(u8 taskId)
{ {
HighlightSelectedSearchMenuItem(gTasks[taskId].tTopBarItem, gTasks[taskId].tMenuItem); HighlightSelectedSearchMenuItem(gTasks[taskId].tTopBarItem, gTasks[taskId].tMenuItem);
PrintSelectedSearchParameters(taskId); PrintSelectedSearchParameters(taskId);
CopyWindowToVram(0, 2); CopyWindowToVram(0, COPYWIN_GFX);
CopyBgTilemapBufferToVram(3); CopyBgTilemapBufferToVram(3);
gTasks[taskId].func = Task_HandleSearchMenuInput; gTasks[taskId].func = Task_HandleSearchMenuInput;
} }
@@ -5013,7 +5013,7 @@ static void Task_HandleSearchMenuInput(u8 taskId)
EraseAndPrintSearchTextBox(gText_SearchingPleaseWait); EraseAndPrintSearchTextBox(gText_SearchingPleaseWait);
gTasks[taskId].func = Task_StartPokedexSearch; gTasks[taskId].func = Task_StartPokedexSearch;
PlaySE(SE_DEX_SEARCH); PlaySE(SE_DEX_SEARCH);
CopyWindowToVram(0, 2); CopyWindowToVram(0, COPYWIN_GFX);
} }
} }
else else
@@ -5029,7 +5029,7 @@ static void Task_HandleSearchMenuInput(u8 taskId)
PlaySE(SE_SELECT); PlaySE(SE_SELECT);
gTasks[taskId].tMenuItem = movementMap[gTasks[taskId].tMenuItem][0]; gTasks[taskId].tMenuItem = movementMap[gTasks[taskId].tMenuItem][0];
HighlightSelectedSearchMenuItem(gTasks[taskId].tTopBarItem, gTasks[taskId].tMenuItem); HighlightSelectedSearchMenuItem(gTasks[taskId].tTopBarItem, gTasks[taskId].tMenuItem);
CopyWindowToVram(0, 2); CopyWindowToVram(0, COPYWIN_GFX);
CopyBgTilemapBufferToVram(3); CopyBgTilemapBufferToVram(3);
} }
if (JOY_NEW(DPAD_RIGHT) && movementMap[gTasks[taskId].tMenuItem][1] != 0xFF) if (JOY_NEW(DPAD_RIGHT) && movementMap[gTasks[taskId].tMenuItem][1] != 0xFF)
@@ -5037,7 +5037,7 @@ static void Task_HandleSearchMenuInput(u8 taskId)
PlaySE(SE_SELECT); PlaySE(SE_SELECT);
gTasks[taskId].tMenuItem = movementMap[gTasks[taskId].tMenuItem][1]; gTasks[taskId].tMenuItem = movementMap[gTasks[taskId].tMenuItem][1];
HighlightSelectedSearchMenuItem(gTasks[taskId].tTopBarItem, gTasks[taskId].tMenuItem); HighlightSelectedSearchMenuItem(gTasks[taskId].tTopBarItem, gTasks[taskId].tMenuItem);
CopyWindowToVram(0, 2); CopyWindowToVram(0, COPYWIN_GFX);
CopyBgTilemapBufferToVram(3); CopyBgTilemapBufferToVram(3);
} }
if (JOY_NEW(DPAD_UP) && movementMap[gTasks[taskId].tMenuItem][2] != 0xFF) if (JOY_NEW(DPAD_UP) && movementMap[gTasks[taskId].tMenuItem][2] != 0xFF)
@@ -5045,7 +5045,7 @@ static void Task_HandleSearchMenuInput(u8 taskId)
PlaySE(SE_SELECT); PlaySE(SE_SELECT);
gTasks[taskId].tMenuItem = movementMap[gTasks[taskId].tMenuItem][2]; gTasks[taskId].tMenuItem = movementMap[gTasks[taskId].tMenuItem][2];
HighlightSelectedSearchMenuItem(gTasks[taskId].tTopBarItem, gTasks[taskId].tMenuItem); HighlightSelectedSearchMenuItem(gTasks[taskId].tTopBarItem, gTasks[taskId].tMenuItem);
CopyWindowToVram(0, 2); CopyWindowToVram(0, COPYWIN_GFX);
CopyBgTilemapBufferToVram(3); CopyBgTilemapBufferToVram(3);
} }
if (JOY_NEW(DPAD_DOWN) && movementMap[gTasks[taskId].tMenuItem][3] != 0xFF) if (JOY_NEW(DPAD_DOWN) && movementMap[gTasks[taskId].tMenuItem][3] != 0xFF)
@@ -5053,7 +5053,7 @@ static void Task_HandleSearchMenuInput(u8 taskId)
PlaySE(SE_SELECT); PlaySE(SE_SELECT);
gTasks[taskId].tMenuItem = movementMap[gTasks[taskId].tMenuItem][3]; gTasks[taskId].tMenuItem = movementMap[gTasks[taskId].tMenuItem][3];
HighlightSelectedSearchMenuItem(gTasks[taskId].tTopBarItem, gTasks[taskId].tMenuItem); HighlightSelectedSearchMenuItem(gTasks[taskId].tTopBarItem, gTasks[taskId].tMenuItem);
CopyWindowToVram(0, 2); CopyWindowToVram(0, COPYWIN_GFX);
CopyBgTilemapBufferToVram(3); CopyBgTilemapBufferToVram(3);
} }
} }
@@ -5086,7 +5086,7 @@ static void Task_WaitAndCompleteSearch(u8 taskId)
EraseAndPrintSearchTextBox(gText_NoMatchingPkmnWereFound); EraseAndPrintSearchTextBox(gText_NoMatchingPkmnWereFound);
} }
gTasks[taskId].func = Task_SearchCompleteWaitForInput; gTasks[taskId].func = Task_SearchCompleteWaitForInput;
CopyWindowToVram(0, 2); CopyWindowToVram(0, COPYWIN_GFX);
} }
} }
@@ -5126,7 +5126,7 @@ static void Task_SelectSearchMenuItem(u8 taskId)
PrintSearchParameterText(taskId); PrintSearchParameterText(taskId);
PrintSelectorArrow(*cursorPos); PrintSelectorArrow(*cursorPos);
gTasks[taskId].func = Task_HandleSearchParameterInput; gTasks[taskId].func = Task_HandleSearchParameterInput;
CopyWindowToVram(0, 2); CopyWindowToVram(0, COPYWIN_GFX);
CopyBgTilemapBufferToVram(3); CopyBgTilemapBufferToVram(3);
} }
@@ -5151,7 +5151,7 @@ static void Task_HandleSearchParameterInput(u8 taskId)
ClearSearchParameterBoxText(); ClearSearchParameterBoxText();
DrawOrEraseSearchParameterBox(TRUE); DrawOrEraseSearchParameterBox(TRUE);
gTasks[taskId].func = Task_SwitchToSearchMenu; gTasks[taskId].func = Task_SwitchToSearchMenu;
CopyWindowToVram(0, 2); CopyWindowToVram(0, COPYWIN_GFX);
CopyBgTilemapBufferToVram(3); CopyBgTilemapBufferToVram(3);
return; return;
} }
@@ -5163,7 +5163,7 @@ static void Task_HandleSearchParameterInput(u8 taskId)
*cursorPos = gTasks[taskId].tCursorPos; *cursorPos = gTasks[taskId].tCursorPos;
*scrollOffset = gTasks[taskId].tScrollOffset; *scrollOffset = gTasks[taskId].tScrollOffset;
gTasks[taskId].func = Task_SwitchToSearchMenu; gTasks[taskId].func = Task_SwitchToSearchMenu;
CopyWindowToVram(0, 2); CopyWindowToVram(0, COPYWIN_GFX);
CopyBgTilemapBufferToVram(3); CopyBgTilemapBufferToVram(3);
return; return;
} }
@@ -5190,7 +5190,7 @@ static void Task_HandleSearchParameterInput(u8 taskId)
{ {
PlaySE(SE_SELECT); PlaySE(SE_SELECT);
EraseAndPrintSearchTextBox(texts[*cursorPos + *scrollOffset].description); EraseAndPrintSearchTextBox(texts[*cursorPos + *scrollOffset].description);
CopyWindowToVram(0, 2); CopyWindowToVram(0, COPYWIN_GFX);
} }
return; return;
} }
@@ -5216,7 +5216,7 @@ static void Task_HandleSearchParameterInput(u8 taskId)
{ {
PlaySE(SE_SELECT); PlaySE(SE_SELECT);
EraseAndPrintSearchTextBox(texts[*cursorPos + *scrollOffset].description); EraseAndPrintSearchTextBox(texts[*cursorPos + *scrollOffset].description);
CopyWindowToVram(0, 2); CopyWindowToVram(0, COPYWIN_GFX);
} }
return; return;
} }
+8 -5
View File
@@ -17,6 +17,7 @@ static const u32 sPokedexAreaMapAffine_Tilemap[] = INCBIN_U32("graphics/interfac
void LoadPokedexAreaMapGfx(const struct PokedexAreaMapTemplate *template) void LoadPokedexAreaMapGfx(const struct PokedexAreaMapTemplate *template)
{ {
u8 mode; u8 mode;
void * tilemap;
sPokedexAreaMapBgNum = Alloc(sizeof(sPokedexAreaMapBgNum)); sPokedexAreaMapBgNum = Alloc(sizeof(sPokedexAreaMapBgNum));
mode = template->mode; mode = template->mode;
@@ -24,7 +25,8 @@ void LoadPokedexAreaMapGfx(const struct PokedexAreaMapTemplate *template)
{ {
SetBgAttribute(template->bg, BG_ATTR_METRIC, 0); SetBgAttribute(template->bg, BG_ATTR_METRIC, 0);
DecompressAndCopyTileDataToVram(template->bg, sPokedexAreaMap_Gfx, 0, template->offset, 0); DecompressAndCopyTileDataToVram(template->bg, sPokedexAreaMap_Gfx, 0, template->offset, 0);
sub_8199D3C(DecompressAndCopyTileDataToVram(template->bg, sPokedexAreaMap_Tilemap, 0, 0, 1), template->offset, 32, 32, FALSE); tilemap = DecompressAndCopyTileDataToVram(template->bg, sPokedexAreaMap_Tilemap, 0, 0, 1);
AddValToTilemapBuffer(tilemap, template->offset, 32, 32, FALSE); // template->offset is always 0, so this does nothing.
} }
else else
{ {
@@ -32,11 +34,12 @@ void LoadPokedexAreaMapGfx(const struct PokedexAreaMapTemplate *template)
SetBgAttribute(template->bg, BG_ATTR_METRIC, 2); SetBgAttribute(template->bg, BG_ATTR_METRIC, 2);
SetBgAttribute(template->bg, BG_ATTR_TYPE, BG_TYPE_AFFINE); // This does nothing. BG_ATTR_TYPE can't be set with this function SetBgAttribute(template->bg, BG_ATTR_TYPE, BG_TYPE_AFFINE); // This does nothing. BG_ATTR_TYPE can't be set with this function
DecompressAndCopyTileDataToVram(template->bg, sPokedexAreaMapAffine_Gfx, 0, template->offset, 0); DecompressAndCopyTileDataToVram(template->bg, sPokedexAreaMapAffine_Gfx, 0, template->offset, 0);
sub_8199D3C(DecompressAndCopyTileDataToVram(template->bg, sPokedexAreaMapAffine_Tilemap, 0, 0, 1), template->offset, 64, 64, TRUE); tilemap = DecompressAndCopyTileDataToVram(template->bg, sPokedexAreaMapAffine_Tilemap, 0, 0, 1);
AddValToTilemapBuffer(tilemap, template->offset, 64, 64, TRUE); // template->offset is always 0, so this does nothing.
} }
ChangeBgX(template->bg, 0, 0); ChangeBgX(template->bg, 0, BG_COORD_SET);
ChangeBgY(template->bg, 0, 0); ChangeBgY(template->bg, 0, BG_COORD_SET);
SetBgAttribute(template->bg, BG_ATTR_PALETTEMODE, 1); SetBgAttribute(template->bg, BG_ATTR_PALETTEMODE, 1);
CpuCopy32(sPokedexAreaMap_Pal, &gPlttBufferUnfaded[0x70], 0x60); CpuCopy32(sPokedexAreaMap_Pal, &gPlttBufferUnfaded[0x70], 0x60);
*sPokedexAreaMapBgNum = template->bg; *sPokedexAreaMapBgNum = template->bg;
@@ -62,5 +65,5 @@ void FreePokedexAreaMapBgNum(void)
void PokedexAreaMapChangeBgY(u32 a0) void PokedexAreaMapChangeBgY(u32 a0)
{ {
ChangeBgY(*sPokedexAreaMapBgNum, a0 * 0x100, 0); ChangeBgY(*sPokedexAreaMapBgNum, a0 * 0x100, BG_COORD_SET);
} }
+2 -2
View File
@@ -319,7 +319,7 @@ static bool8 DrawAreaGlow(void)
} }
return TRUE; return TRUE;
case 4: case 4:
ChangeBgY(2, -0x800, 0); ChangeBgY(2, -0x800, BG_COORD_SET);
break; break;
default: default:
return FALSE; return FALSE;
@@ -367,7 +367,7 @@ static void FindMapsWithMon(u16 species)
} }
} }
for (i = 0; gWildMonHeaders[i].mapGroup != 0xFF; i++) for (i = 0; gWildMonHeaders[i].mapGroup != MAP_GROUP(UNDEFINED); i++)
{ {
if (MapHasMon(&gWildMonHeaders[i], species)) if (MapHasMon(&gWildMonHeaders[i], species))
{ {
+2 -2
View File
@@ -432,7 +432,7 @@ static void DrawWaveformSegment(u8 position, u8 amplitude)
static void DrawWaveformWindow(u8 windowId) static void DrawWaveformWindow(u8 windowId)
{ {
CopyWindowToVram(windowId, 2); CopyWindowToVram(windowId, COPYWIN_GFX);
} }
// rsVertical is leftover from a very different version of this function in RS // rsVertical is leftover from a very different version of this function in RS
@@ -443,7 +443,7 @@ static void ShiftWaveformOver(u8 windowId, s16 offset, bool8 rsVertical)
if (!rsVertical) if (!rsVertical)
{ {
u8 bg = GetWindowAttribute(windowId, WINDOW_BG); u8 bg = GetWindowAttribute(windowId, WINDOW_BG);
ChangeBgX(bg, offset << 8, 0); ChangeBgX(bg, offset << 8, BG_COORD_SET);
} }
} }
+27 -27
View File
@@ -3313,8 +3313,8 @@ static void Msg_WantToPlayAgain(void)
{ {
case 0: case 0:
sPokemonJumpGfx->msgWindowId = AddMessageWindow(1, 8, 20, 2); sPokemonJumpGfx->msgWindowId = AddMessageWindow(1, 8, 20, 2);
AddTextPrinterParameterized(sPokemonJumpGfx->msgWindowId, FONT_NORMAL, gText_WantToPlayAgain2, 0, 1, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(sPokemonJumpGfx->msgWindowId, FONT_NORMAL, gText_WantToPlayAgain2, 0, 1, TEXT_SKIP_DRAW, NULL);
CopyWindowToVram(sPokemonJumpGfx->msgWindowId, 2); CopyWindowToVram(sPokemonJumpGfx->msgWindowId, COPYWIN_GFX);
sPokemonJumpGfx->mainState++; sPokemonJumpGfx->mainState++;
break; break;
case 1: case 1:
@@ -3340,8 +3340,8 @@ static void Msg_SavingDontTurnOff(void)
{ {
case 0: case 0:
sPokemonJumpGfx->msgWindowId = AddMessageWindow(2, 7, 26, 4); sPokemonJumpGfx->msgWindowId = AddMessageWindow(2, 7, 26, 4);
AddTextPrinterParameterized(sPokemonJumpGfx->msgWindowId, FONT_NORMAL, gText_SavingDontTurnOffPower, 0, 1, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(sPokemonJumpGfx->msgWindowId, FONT_NORMAL, gText_SavingDontTurnOffPower, 0, 1, TEXT_SKIP_DRAW, NULL);
CopyWindowToVram(sPokemonJumpGfx->msgWindowId, 2); CopyWindowToVram(sPokemonJumpGfx->msgWindowId, COPYWIN_GFX);
sPokemonJumpGfx->mainState++; sPokemonJumpGfx->mainState++;
break; break;
case 1: case 1:
@@ -3366,7 +3366,7 @@ static void EraseMessage(void)
{ {
case 0: case 0:
ClearMessageWindow(); ClearMessageWindow();
sub_8198C78(); EraseYesNoWindow();
CopyBgTilemapBufferToVram(BG_INTERFACE); CopyBgTilemapBufferToVram(BG_INTERFACE);
sPokemonJumpGfx->mainState++; sPokemonJumpGfx->mainState++;
break; break;
@@ -3383,8 +3383,8 @@ static void Msg_SomeoneDroppedOut(void)
{ {
case 0: case 0:
sPokemonJumpGfx->msgWindowId = AddMessageWindow(2, 8, 22, 4); sPokemonJumpGfx->msgWindowId = AddMessageWindow(2, 8, 22, 4);
AddTextPrinterParameterized(sPokemonJumpGfx->msgWindowId, FONT_NORMAL, gText_SomeoneDroppedOut2, 0, 1, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(sPokemonJumpGfx->msgWindowId, FONT_NORMAL, gText_SomeoneDroppedOut2, 0, 1, TEXT_SKIP_DRAW, NULL);
CopyWindowToVram(sPokemonJumpGfx->msgWindowId, 2); CopyWindowToVram(sPokemonJumpGfx->msgWindowId, COPYWIN_GFX);
sPokemonJumpGfx->mainState++; sPokemonJumpGfx->mainState++;
break; break;
case 1: case 1:
@@ -3409,8 +3409,8 @@ static void Msg_CommunicationStandby(void)
{ {
case 0: case 0:
sPokemonJumpGfx->msgWindowId = AddMessageWindow(7, 10, 16, 2); sPokemonJumpGfx->msgWindowId = AddMessageWindow(7, 10, 16, 2);
AddTextPrinterParameterized(sPokemonJumpGfx->msgWindowId, FONT_NORMAL, gText_CommunicationStandby4, 0, 1, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(sPokemonJumpGfx->msgWindowId, FONT_NORMAL, gText_CommunicationStandby4, 0, 1, TEXT_SKIP_DRAW, NULL);
CopyWindowToVram(sPokemonJumpGfx->msgWindowId, 2); CopyWindowToVram(sPokemonJumpGfx->msgWindowId, COPYWIN_GFX);
sPokemonJumpGfx->mainState++; sPokemonJumpGfx->mainState++;
break; break;
case 1: case 1:
@@ -3487,8 +3487,8 @@ static void PrintPrizeMessage(u16 itemId, u16 quantity)
DynamicPlaceholderTextUtil_SetPlaceholderPtr(1, sPokemonJumpGfx->itemQuantityStr); DynamicPlaceholderTextUtil_SetPlaceholderPtr(1, sPokemonJumpGfx->itemQuantityStr);
DynamicPlaceholderTextUtil_ExpandPlaceholders(sPokemonJumpGfx->prizeMsg, gText_AwesomeWonF701F700); DynamicPlaceholderTextUtil_ExpandPlaceholders(sPokemonJumpGfx->prizeMsg, gText_AwesomeWonF701F700);
sPokemonJumpGfx->msgWindowId = AddMessageWindow(4, 8, 22, 4); sPokemonJumpGfx->msgWindowId = AddMessageWindow(4, 8, 22, 4);
AddTextPrinterParameterized(sPokemonJumpGfx->msgWindowId, FONT_NORMAL, sPokemonJumpGfx->prizeMsg, 0, 1, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(sPokemonJumpGfx->msgWindowId, FONT_NORMAL, sPokemonJumpGfx->prizeMsg, 0, 1, TEXT_SKIP_DRAW, NULL);
CopyWindowToVram(sPokemonJumpGfx->msgWindowId, 2); CopyWindowToVram(sPokemonJumpGfx->msgWindowId, COPYWIN_GFX);
sPokemonJumpGfx->fanfare = MUS_LEVEL_UP; sPokemonJumpGfx->fanfare = MUS_LEVEL_UP;
sPokemonJumpGfx->msgWindowState = 0; sPokemonJumpGfx->msgWindowState = 0;
} }
@@ -3500,8 +3500,8 @@ static void PrintPrizeFilledBagMessage(u16 itemId)
DynamicPlaceholderTextUtil_SetPlaceholderPtr(0, sPokemonJumpGfx->itemName); DynamicPlaceholderTextUtil_SetPlaceholderPtr(0, sPokemonJumpGfx->itemName);
DynamicPlaceholderTextUtil_ExpandPlaceholders(sPokemonJumpGfx->prizeMsg, gText_FilledStorageSpace2); DynamicPlaceholderTextUtil_ExpandPlaceholders(sPokemonJumpGfx->prizeMsg, gText_FilledStorageSpace2);
sPokemonJumpGfx->msgWindowId = AddMessageWindow(4, 8, 22, 4); sPokemonJumpGfx->msgWindowId = AddMessageWindow(4, 8, 22, 4);
AddTextPrinterParameterized(sPokemonJumpGfx->msgWindowId, FONT_NORMAL, sPokemonJumpGfx->prizeMsg, 0, 1, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(sPokemonJumpGfx->msgWindowId, FONT_NORMAL, sPokemonJumpGfx->prizeMsg, 0, 1, TEXT_SKIP_DRAW, NULL);
CopyWindowToVram(sPokemonJumpGfx->msgWindowId, 2); CopyWindowToVram(sPokemonJumpGfx->msgWindowId, COPYWIN_GFX);
sPokemonJumpGfx->fanfare = MUS_DUMMY; sPokemonJumpGfx->fanfare = MUS_DUMMY;
sPokemonJumpGfx->msgWindowState = 0; sPokemonJumpGfx->msgWindowState = 0;
} }
@@ -3513,8 +3513,8 @@ static void PrintNoRoomForPrizeMessage(u16 itemId)
DynamicPlaceholderTextUtil_SetPlaceholderPtr(0, sPokemonJumpGfx->itemName); DynamicPlaceholderTextUtil_SetPlaceholderPtr(0, sPokemonJumpGfx->itemName);
DynamicPlaceholderTextUtil_ExpandPlaceholders(sPokemonJumpGfx->prizeMsg, gText_CantHoldMore); DynamicPlaceholderTextUtil_ExpandPlaceholders(sPokemonJumpGfx->prizeMsg, gText_CantHoldMore);
sPokemonJumpGfx->msgWindowId = AddMessageWindow(4, 9, 22, 2); sPokemonJumpGfx->msgWindowId = AddMessageWindow(4, 9, 22, 2);
AddTextPrinterParameterized(sPokemonJumpGfx->msgWindowId, FONT_NORMAL, sPokemonJumpGfx->prizeMsg, 0, 1, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(sPokemonJumpGfx->msgWindowId, FONT_NORMAL, sPokemonJumpGfx->prizeMsg, 0, 1, TEXT_SKIP_DRAW, NULL);
CopyWindowToVram(sPokemonJumpGfx->msgWindowId, 2); CopyWindowToVram(sPokemonJumpGfx->msgWindowId, COPYWIN_GFX);
sPokemonJumpGfx->fanfare = MUS_DUMMY; sPokemonJumpGfx->fanfare = MUS_DUMMY;
sPokemonJumpGfx->msgWindowState = 0; sPokemonJumpGfx->msgWindowState = 0;
} }
@@ -3558,7 +3558,7 @@ static void ClearMessageWindow(void)
if (sPokemonJumpGfx->msgWindowId != WINDOW_NONE) if (sPokemonJumpGfx->msgWindowId != WINDOW_NONE)
{ {
rbox_fill_rectangle(sPokemonJumpGfx->msgWindowId); rbox_fill_rectangle(sPokemonJumpGfx->msgWindowId);
CopyWindowToVram(sPokemonJumpGfx->msgWindowId, 1); CopyWindowToVram(sPokemonJumpGfx->msgWindowId, COPYWIN_MAP);
sPokemonJumpGfx->msgWindowState = 0; sPokemonJumpGfx->msgWindowState = 0;
} }
} }
@@ -3732,7 +3732,7 @@ static void SetMonSpriteY(u32 id, s16 y)
static void UpdateVineSwing(int vineState) static void UpdateVineSwing(int vineState)
{ {
UpdateVineAnim(sPokemonJumpGfx, vineState); UpdateVineAnim(sPokemonJumpGfx, vineState);
ChangeBgY(BG_VENUSAUR, (sVenusaurStates[vineState] * 5) << 13, 0); ChangeBgY(BG_VENUSAUR, (sVenusaurStates[vineState] * 5) << 13, BG_COORD_SET);
} }
static int DoSameJumpTimeBonus(u8 flags) static int DoSameJumpTimeBonus(u8 flags)
@@ -3857,8 +3857,8 @@ static void PrintPokeJumpPlayerName(int multiplayerId, u8 bgColor, u8 fgColor, u
FillWindowPixelBuffer(sPokemonJumpGfx->nameWindowIds[multiplayerId], 0); FillWindowPixelBuffer(sPokemonJumpGfx->nameWindowIds[multiplayerId], 0);
x = 64 - GetStringWidth(FONT_NORMAL, GetPokeJumpPlayerName(multiplayerId), -1); x = 64 - GetStringWidth(FONT_NORMAL, GetPokeJumpPlayerName(multiplayerId), -1);
x /= 2; x /= 2;
AddTextPrinterParameterized3(sPokemonJumpGfx->nameWindowIds[multiplayerId], FONT_NORMAL, x, 1, colors, -1, GetPokeJumpPlayerName(multiplayerId)); AddTextPrinterParameterized3(sPokemonJumpGfx->nameWindowIds[multiplayerId], FONT_NORMAL, x, 1, colors, TEXT_SKIP_DRAW, GetPokeJumpPlayerName(multiplayerId));
CopyWindowToVram(sPokemonJumpGfx->nameWindowIds[multiplayerId], 2); CopyWindowToVram(sPokemonJumpGfx->nameWindowIds[multiplayerId], COPYWIN_GFX);
} }
static void PrintPokeJumpPlayerNames(bool32 highlightSelf) static void PrintPokeJumpPlayerNames(bool32 highlightSelf)
@@ -3896,8 +3896,8 @@ static void DrawPlayerNameWindows(void)
static void ShowBonus(u8 bonusId) static void ShowBonus(u8 bonusId)
{ {
sPokemonJumpGfx->bonusTimer = 0; sPokemonJumpGfx->bonusTimer = 0;
ChangeBgX(BG_BONUSES, (bonusId / 2) * 256 * 256, 0); ChangeBgX(BG_BONUSES, (bonusId / 2) * 256 * 256, BG_COORD_SET);
ChangeBgY(BG_BONUSES, (((bonusId % 2) * 256) - 40) * 256, 0); ChangeBgY(BG_BONUSES, (((bonusId % 2) * 256) - 40) * 256, BG_COORD_SET);
ShowBg(BG_BONUSES); ShowBg(BG_BONUSES);
CreateTask(Task_UpdateBonus, 4); CreateTask(Task_UpdateBonus, 4);
} }
@@ -3910,7 +3910,7 @@ static bool32 UpdateBonus(void)
} }
else else
{ {
ChangeBgY(BG_BONUSES, 128, 1); ChangeBgY(BG_BONUSES, 128, BG_COORD_ADD);
if (++sPokemonJumpGfx->bonusTimer >= 32) if (++sPokemonJumpGfx->bonusTimer >= 32)
HideBg(BG_BONUSES); HideBg(BG_BONUSES);
return TRUE; return TRUE;
@@ -4176,7 +4176,7 @@ static void Task_ShowPokemonJumpRecords(u8 taskId)
window.width = width; window.width = width;
tWindowId = AddWindow(&window); tWindowId = AddWindow(&window);
PrintRecordsText(tWindowId, width); PrintRecordsText(tWindowId, width);
CopyWindowToVram(tWindowId, 3); CopyWindowToVram(tWindowId, COPYWIN_FULL);
tState++; tState++;
break; break;
case 1: case 1:
@@ -4187,7 +4187,7 @@ static void Task_ShowPokemonJumpRecords(u8 taskId)
if (JOY_NEW(A_BUTTON | B_BUTTON)) if (JOY_NEW(A_BUTTON | B_BUTTON))
{ {
rbox_fill_rectangle(tWindowId); rbox_fill_rectangle(tWindowId);
CopyWindowToVram(tWindowId, 1); CopyWindowToVram(tWindowId, COPYWIN_MAP);
tState++; tState++;
} }
break; break;
@@ -4217,14 +4217,14 @@ static void PrintRecordsText(u16 windowId, int width)
LoadUserWindowBorderGfx_(windowId, 0x21D, 0xD0); LoadUserWindowBorderGfx_(windowId, 0x21D, 0xD0);
DrawTextBorderOuter(windowId, 0x21D, 0xD); DrawTextBorderOuter(windowId, 0x21D, 0xD);
FillWindowPixelBuffer(windowId, PIXEL_FILL(1)); FillWindowPixelBuffer(windowId, PIXEL_FILL(1));
AddTextPrinterParameterized(windowId, FONT_NORMAL, gText_PkmnJumpRecords, GetStringCenterAlignXOffset(FONT_NORMAL, gText_PkmnJumpRecords, width * 8), 1, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(windowId, FONT_NORMAL, gText_PkmnJumpRecords, GetStringCenterAlignXOffset(FONT_NORMAL, gText_PkmnJumpRecords, width * 8), 1, TEXT_SKIP_DRAW, NULL);
for (i = 0; i < ARRAY_COUNT(sRecordsTexts); i++) for (i = 0; i < ARRAY_COUNT(sRecordsTexts); i++)
{ {
AddTextPrinterParameterized(windowId, FONT_NORMAL, sRecordsTexts[i], 0, 25 + (i * 16), TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(windowId, FONT_NORMAL, sRecordsTexts[i], 0, 25 + (i * 16), TEXT_SKIP_DRAW, NULL);
ConvertIntToDecimalStringN(gStringVar1, recordNums[i], STR_CONV_MODE_LEFT_ALIGN, 5); ConvertIntToDecimalStringN(gStringVar1, recordNums[i], STR_CONV_MODE_LEFT_ALIGN, 5);
TruncateToFirstWordOnly(gStringVar1); TruncateToFirstWordOnly(gStringVar1);
x = (width * 8) - GetStringWidth(FONT_NORMAL, gStringVar1, 0); x = (width * 8) - GetStringWidth(FONT_NORMAL, gStringVar1, 0);
AddTextPrinterParameterized(windowId, FONT_NORMAL, gStringVar1, x, 25 + (i * 16), TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(windowId, FONT_NORMAL, gStringVar1, x, 25 + (i * 16), TEXT_SKIP_DRAW, NULL);
} }
PutWindowTilemap(windowId); PutWindowTilemap(windowId);
} }
+30 -30
View File
@@ -1358,7 +1358,7 @@ void DrawTextWindowAndBufferTiles(const u8 *string, void *dst, u8 zero1, u8 zero
txtColor[0] = zero2; txtColor[0] = zero2;
txtColor[1] = TEXT_DYNAMIC_COLOR_6; txtColor[1] = TEXT_DYNAMIC_COLOR_6;
txtColor[2] = TEXT_DYNAMIC_COLOR_5; txtColor[2] = TEXT_DYNAMIC_COLOR_5;
AddTextPrinterParameterized4(windowId, FONT_NORMAL, 0, 1, 0, 0, txtColor, -1, string); AddTextPrinterParameterized4(windowId, FONT_NORMAL, 0, 1, 0, 0, txtColor, TEXT_SKIP_DRAW, string);
tileBytesToBuffer = bytesToBuffer; tileBytesToBuffer = bytesToBuffer;
if (tileBytesToBuffer > 6u) if (tileBytesToBuffer > 6u)
@@ -1402,7 +1402,7 @@ static void UnusedDrawTextWindow(const u8 *string, void *dst, u16 offset, u8 bgC
txtColor[0] = bgColor; txtColor[0] = bgColor;
txtColor[1] = fgColor; txtColor[1] = fgColor;
txtColor[2] = shadowColor; txtColor[2] = shadowColor;
AddTextPrinterParameterized4(windowId, FONT_NORMAL, 0, 2, 0, 0, txtColor, -1, string); AddTextPrinterParameterized4(windowId, FONT_NORMAL, 0, 2, 0, 0, txtColor, TEXT_SKIP_DRAW, string);
CpuCopy16(tileData1, dst, tileSize); CpuCopy16(tileData1, dst, tileSize);
CpuCopy16(tileData2, dst + offset, tileSize); CpuCopy16(tileData2, dst + offset, tileSize);
RemoveWindow(windowId); RemoveWindow(windowId);
@@ -1561,9 +1561,9 @@ static void Task_PCMainMenu(u8 taskId)
LoadMessageBoxAndBorderGfx(); LoadMessageBoxAndBorderGfx();
DrawDialogueFrame(0, 0); DrawDialogueFrame(0, 0);
FillWindowPixelBuffer(0, PIXEL_FILL(1)); FillWindowPixelBuffer(0, PIXEL_FILL(1));
AddTextPrinterParameterized2(0, FONT_NORMAL, sMainMenuTexts[task->tSelectedOption].desc, TEXT_SPEED_FF, NULL, 2, 1, 3); AddTextPrinterParameterized2(0, FONT_NORMAL, sMainMenuTexts[task->tSelectedOption].desc, TEXT_SKIP_DRAW, NULL, 2, 1, 3);
CopyWindowToVram(0, 3); CopyWindowToVram(0, COPYWIN_FULL);
CopyWindowToVram(task->tWindowId, 3); CopyWindowToVram(task->tWindowId, COPYWIN_FULL);
task->tState++; task->tState++;
break; break;
case STATE_FADE_IN: case STATE_FADE_IN:
@@ -1699,7 +1699,7 @@ static void CreateMainMenu(u8 whichMenu, s16 *windowIdPtr)
DrawStdWindowFrame(windowId, FALSE); DrawStdWindowFrame(windowId, FALSE);
PrintMenuTable(windowId, OPTIONS_COUNT, (void *)sMainMenuTexts); PrintMenuTable(windowId, OPTIONS_COUNT, (void *)sMainMenuTexts);
InitMenuInUpperLeftCornerPlaySoundWhenAPressed(windowId, OPTIONS_COUNT, whichMenu); InitMenuInUpperLeftCornerNormal(windowId, OPTIONS_COUNT, whichMenu);
*windowIdPtr = windowId; *windowIdPtr = windowId;
} }
@@ -1951,13 +1951,13 @@ static void ChooseBoxMenu_PrintInfo(void)
// Print box name // Print box name
center = GetStringCenterAlignXOffset(FONT_NORMAL, boxName, 64); center = GetStringCenterAlignXOffset(FONT_NORMAL, boxName, 64);
AddTextPrinterParameterized3(windowId, FONT_NORMAL, center, 1, sChooseBoxMenu_TextColors, TEXT_SPEED_FF, boxName); AddTextPrinterParameterized3(windowId, FONT_NORMAL, center, 1, sChooseBoxMenu_TextColors, TEXT_SKIP_DRAW, boxName);
// Print #/30 for number of Pokémon in the box // Print #/30 for number of Pokémon in the box
ConvertIntToDecimalStringN(numBoxMonsText, numInBox, STR_CONV_MODE_RIGHT_ALIGN, 2); ConvertIntToDecimalStringN(numBoxMonsText, numInBox, STR_CONV_MODE_RIGHT_ALIGN, 2);
StringAppend(numBoxMonsText, sText_OutOf30); StringAppend(numBoxMonsText, sText_OutOf30);
center = GetStringCenterAlignXOffset(FONT_NORMAL, numBoxMonsText, 64); center = GetStringCenterAlignXOffset(FONT_NORMAL, numBoxMonsText, 64);
AddTextPrinterParameterized3(windowId, FONT_NORMAL, center, 17, sChooseBoxMenu_TextColors, TEXT_SPEED_FF, numBoxMonsText); AddTextPrinterParameterized3(windowId, FONT_NORMAL, center, 17, sChooseBoxMenu_TextColors, TEXT_SKIP_DRAW, numBoxMonsText);
winTileData = GetWindowAttribute(windowId, WINDOW_TILE_DATA); winTileData = GetWindowAttribute(windowId, WINDOW_TILE_DATA);
CpuCopy32((void *)winTileData, (void *)OBJ_VRAM0 + 0x100 + (GetSpriteTileStartByTag(sChooseBoxMenu->tileTag) * 32), 0x400); CpuCopy32((void *)winTileData, (void *)OBJ_VRAM0 + 0x100 + (GetSpriteTileStartByTag(sChooseBoxMenu->tileTag) * 32), 0x400);
@@ -3827,8 +3827,8 @@ static void SetScrollingBackground(void)
static void ScrollBackground(void) static void ScrollBackground(void)
{ {
ChangeBgX(3, 128, 1); ChangeBgX(3, 128, BG_COORD_ADD);
ChangeBgY(3, 128, 2); ChangeBgY(3, 128, BG_COORD_SUB);
} }
static void LoadPokeStorageMenuGfx(void) static void LoadPokeStorageMenuGfx(void)
@@ -4005,20 +4005,20 @@ static void PrintDisplayMonInfo(void)
FillWindowPixelBuffer(0, PIXEL_FILL(1)); FillWindowPixelBuffer(0, PIXEL_FILL(1));
if (sStorage->boxOption != OPTION_MOVE_ITEMS) if (sStorage->boxOption != OPTION_MOVE_ITEMS)
{ {
AddTextPrinterParameterized(0, FONT_NORMAL, sStorage->displayMonNameText, 6, 0, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(0, FONT_NORMAL, sStorage->displayMonNameText, 6, 0, TEXT_SKIP_DRAW, NULL);
AddTextPrinterParameterized(0, FONT_SHORT, sStorage->displayMonSpeciesName, 6, 15, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(0, FONT_SHORT, sStorage->displayMonSpeciesName, 6, 15, TEXT_SKIP_DRAW, NULL);
AddTextPrinterParameterized(0, FONT_SHORT, sStorage->displayMonGenderLvlText, 10, 29, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(0, FONT_SHORT, sStorage->displayMonGenderLvlText, 10, 29, TEXT_SKIP_DRAW, NULL);
AddTextPrinterParameterized(0, FONT_SMALL, sStorage->displayMonItemName, 6, 43, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(0, FONT_SMALL, sStorage->displayMonItemName, 6, 43, TEXT_SKIP_DRAW, NULL);
} }
else else
{ {
AddTextPrinterParameterized(0, FONT_SMALL, sStorage->displayMonItemName, 6, 0, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(0, FONT_SMALL, sStorage->displayMonItemName, 6, 0, TEXT_SKIP_DRAW, NULL);
AddTextPrinterParameterized(0, FONT_NORMAL, sStorage->displayMonNameText, 6, 13, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(0, FONT_NORMAL, sStorage->displayMonNameText, 6, 13, TEXT_SKIP_DRAW, NULL);
AddTextPrinterParameterized(0, FONT_SHORT, sStorage->displayMonSpeciesName, 6, 28, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(0, FONT_SHORT, sStorage->displayMonSpeciesName, 6, 28, TEXT_SKIP_DRAW, NULL);
AddTextPrinterParameterized(0, FONT_SHORT, sStorage->displayMonGenderLvlText, 10, 42, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(0, FONT_SHORT, sStorage->displayMonGenderLvlText, 10, 42, TEXT_SKIP_DRAW, NULL);
} }
CopyWindowToVram(0, 2); CopyWindowToVram(0, COPYWIN_GFX);
if (sStorage->displayMonSpecies != SPECIES_NONE) if (sStorage->displayMonSpecies != SPECIES_NONE)
{ {
UpdateMonMarkingTiles(sStorage->displayMonMarkings, sStorage->markingComboTilesPtr); UpdateMonMarkingTiles(sStorage->displayMonMarkings, sStorage->markingComboTilesPtr);
@@ -4319,10 +4319,10 @@ static void PrintMessage(u8 id)
DynamicPlaceholderTextUtil_ExpandPlaceholders(sStorage->messageText, sMessages[id].text); DynamicPlaceholderTextUtil_ExpandPlaceholders(sStorage->messageText, sMessages[id].text);
FillWindowPixelBuffer(1, PIXEL_FILL(1)); FillWindowPixelBuffer(1, PIXEL_FILL(1));
AddTextPrinterParameterized(1, FONT_NORMAL, sStorage->messageText, 0, 1, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(1, FONT_NORMAL, sStorage->messageText, 0, 1, TEXT_SKIP_DRAW, NULL);
DrawTextBorderOuter(1, 2, 14); DrawTextBorderOuter(1, 2, 14);
PutWindowTilemap(1); PutWindowTilemap(1);
CopyWindowToVram(1, 2); CopyWindowToVram(1, COPYWIN_GFX);
ScheduleBgCopyTilemapToVram(0); ScheduleBgCopyTilemapToVram(0);
} }
@@ -8024,7 +8024,7 @@ static void AddMenu(void)
ClearWindowTilemap(sStorage->menuWindowId); ClearWindowTilemap(sStorage->menuWindowId);
DrawStdFrameWithCustomTileAndPalette(sStorage->menuWindowId, FALSE, 11, 14); DrawStdFrameWithCustomTileAndPalette(sStorage->menuWindowId, FALSE, 11, 14);
PrintMenuTable(sStorage->menuWindowId, sStorage->menuItemsCount, (void*)sStorage->menuItems); PrintMenuTable(sStorage->menuWindowId, sStorage->menuItemsCount, (void*)sStorage->menuItems);
InitMenuInUpperLeftCornerPlaySoundWhenAPressed(sStorage->menuWindowId, sStorage->menuItemsCount, 0); InitMenuInUpperLeftCornerNormal(sStorage->menuWindowId, sStorage->menuItemsCount, 0);
ScheduleBgCopyTilemapToVram(0); ScheduleBgCopyTilemapToVram(0);
sStorage->menuUnusedField = 0; sStorage->menuUnusedField = 0;
} }
@@ -8184,14 +8184,14 @@ static bool8 MultiMove_Start(void)
GetCursorBoxColumnAndRow(&sMultiMove->fromColumn, &sMultiMove->fromRow); GetCursorBoxColumnAndRow(&sMultiMove->fromColumn, &sMultiMove->fromRow);
sMultiMove->toColumn = sMultiMove->fromColumn; sMultiMove->toColumn = sMultiMove->fromColumn;
sMultiMove->toRow = sMultiMove->fromRow; sMultiMove->toRow = sMultiMove->fromRow;
ChangeBgX(0, -1024, 0); ChangeBgX(0, -1024, BG_COORD_SET);
ChangeBgY(0, -1024, 0); ChangeBgY(0, -1024, BG_COORD_SET);
FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 0x20, 0x20); FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 0x20, 0x20);
FillWindowPixelBuffer8Bit(sStorage->multiMoveWindowId, PIXEL_FILL(0)); FillWindowPixelBuffer8Bit(sStorage->multiMoveWindowId, PIXEL_FILL(0));
MultiMove_SetIconToBg(sMultiMove->fromColumn, sMultiMove->fromRow); MultiMove_SetIconToBg(sMultiMove->fromColumn, sMultiMove->fromRow);
SetBgAttribute(0, BG_ATTR_PALETTEMODE, 1); SetBgAttribute(0, BG_ATTR_PALETTEMODE, 1);
PutWindowTilemap(sStorage->multiMoveWindowId); PutWindowTilemap(sStorage->multiMoveWindowId);
CopyWindowToVram8Bit(sStorage->multiMoveWindowId, 3); CopyWindowToVram8Bit(sStorage->multiMoveWindowId, COPYWIN_FULL);
BlendPalettes(0x3F00, 8, RGB_WHITE); BlendPalettes(0x3F00, 8, RGB_WHITE);
StartCursorAnim(CURSOR_ANIM_OPEN); StartCursorAnim(CURSOR_ANIM_OPEN);
SetGpuRegBits(REG_OFFSET_BG0CNT, BGCNT_256COLOR); SetGpuRegBits(REG_OFFSET_BG0CNT, BGCNT_256COLOR);
@@ -8247,7 +8247,7 @@ static bool8 MultiMove_ChangeSelection(void)
MultiMove_UpdateSelectedIcons(); MultiMove_UpdateSelectedIcons();
sMultiMove->toColumn = sMultiMove->cursorColumn; sMultiMove->toColumn = sMultiMove->cursorColumn;
sMultiMove->toRow = sMultiMove->cursorRow; sMultiMove->toRow = sMultiMove->cursorRow;
CopyWindowToVram8Bit(sStorage->multiMoveWindowId, 2); CopyWindowToVram8Bit(sStorage->multiMoveWindowId, COPYWIN_GFX);
sMultiMove->state++; sMultiMove->state++;
} }
break; break;
@@ -8499,8 +8499,8 @@ static u8 MultiMove_UpdateMove(void)
{ {
if (sMultiMove->bgMoveSteps != 0) if (sMultiMove->bgMoveSteps != 0)
{ {
ChangeBgX(0, sMultiMove->bgX, 1); ChangeBgX(0, sMultiMove->bgX, BG_COORD_ADD);
ChangeBgY(0, sMultiMove->bgY, 1); ChangeBgY(0, sMultiMove->bgY, BG_COORD_ADD);
sMultiMove->bgMoveSteps--; sMultiMove->bgMoveSteps--;
} }
@@ -8605,8 +8605,8 @@ static void MultiMove_SetPlacedMonData(void)
static void MultiMove_ResetBg(void) static void MultiMove_ResetBg(void)
{ {
ChangeBgX(0, 0, 0); ChangeBgX(0, 0, BG_COORD_SET);
ChangeBgY(0, 0, 0); ChangeBgY(0, 0, BG_COORD_SET);
SetBgAttribute(0, BG_ATTR_PALETTEMODE, 0); SetBgAttribute(0, BG_ATTR_PALETTEMODE, 0);
ClearGpuRegBits(REG_OFFSET_BG0CNT, BGCNT_256COLOR); ClearGpuRegBits(REG_OFFSET_BG0CNT, BGCNT_256COLOR);
FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 32, 32); FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 32, 32);
+9 -9
View File
@@ -1462,7 +1462,7 @@ static void SetDefaultTilemaps(void)
TilemapFiveMovesDisplay(sMonSummaryScreen->bgTilemapBuffers[PSS_PAGE_CONTEST_MOVES][0], 1, FALSE); TilemapFiveMovesDisplay(sMonSummaryScreen->bgTilemapBuffers[PSS_PAGE_CONTEST_MOVES][0], 1, FALSE);
SetBgTilemapBuffer(1, sMonSummaryScreen->bgTilemapBuffers[PSS_PAGE_CONTEST_MOVES][0]); SetBgTilemapBuffer(1, sMonSummaryScreen->bgTilemapBuffers[PSS_PAGE_CONTEST_MOVES][0]);
SetBgTilemapBuffer(2, sMonSummaryScreen->bgTilemapBuffers[PSS_PAGE_BATTLE_MOVES][0]); SetBgTilemapBuffer(2, sMonSummaryScreen->bgTilemapBuffers[PSS_PAGE_BATTLE_MOVES][0]);
ChangeBgX(2, 0x10000, 1); ChangeBgX(2, 0x10000, BG_COORD_ADD);
ClearWindowTilemap(PSS_LABEL_WINDOW_PORTRAIT_SPECIES); ClearWindowTilemap(PSS_LABEL_WINDOW_PORTRAIT_SPECIES);
ClearWindowTilemap(PSS_LABEL_WINDOW_POKEMON_SKILLS_STATUS); ClearWindowTilemap(PSS_LABEL_WINDOW_POKEMON_SKILLS_STATUS);
} }
@@ -1778,12 +1778,12 @@ static void PssScrollRight(u8 taskId) // Scroll right
SetBgAttribute(1, BG_ATTR_PRIORITY, 2); SetBgAttribute(1, BG_ATTR_PRIORITY, 2);
ScheduleBgCopyTilemapToVram(2); ScheduleBgCopyTilemapToVram(2);
} }
ChangeBgX(data[1], 0, 0); ChangeBgX(data[1], 0, BG_COORD_SET);
SetBgTilemapBuffer(data[1], sMonSummaryScreen->bgTilemapBuffers[sMonSummaryScreen->currPageIndex][0]); SetBgTilemapBuffer(data[1], sMonSummaryScreen->bgTilemapBuffers[sMonSummaryScreen->currPageIndex][0]);
ShowBg(1); ShowBg(1);
ShowBg(2); ShowBg(2);
} }
ChangeBgX(data[1], 0x2000, 1); ChangeBgX(data[1], 0x2000, BG_COORD_ADD);
data[0] += 32; data[0] += 32;
if (data[0] > 0xFF) if (data[0] > 0xFF)
gTasks[taskId].func = PssScrollRightEnd; gTasks[taskId].func = PssScrollRightEnd;
@@ -1811,9 +1811,9 @@ static void PssScrollLeft(u8 taskId) // Scroll left
data[1] = 2; data[1] = 2;
else else
data[1] = 1; data[1] = 1;
ChangeBgX(data[1], 0x10000, 0); ChangeBgX(data[1], 0x10000, BG_COORD_SET);
} }
ChangeBgX(data[1], 0x2000, 2); ChangeBgX(data[1], 0x2000, BG_COORD_SUB);
data[0] += 32; data[0] += 32;
if (data[0] > 0xFF) if (data[0] > 0xFF)
gTasks[taskId].func = PssScrollLeftEnd; gTasks[taskId].func = PssScrollLeftEnd;
@@ -1837,7 +1837,7 @@ static void PssScrollLeftEnd(u8 taskId) // display left
if (sMonSummaryScreen->currPageIndex > 1) if (sMonSummaryScreen->currPageIndex > 1)
{ {
SetBgTilemapBuffer(data[1], sMonSummaryScreen->bgTilemapBuffers[sMonSummaryScreen->currPageIndex - 1][0]); SetBgTilemapBuffer(data[1], sMonSummaryScreen->bgTilemapBuffers[sMonSummaryScreen->currPageIndex - 1][0]);
ChangeBgX(data[1], 0x10000, 0); ChangeBgX(data[1], 0x10000, BG_COORD_SET);
} }
ShowBg(1); ShowBg(1);
ShowBg(2); ShowBg(2);
@@ -2681,9 +2681,9 @@ static void DrawContestMoveHearts(u16 move)
static void LimitEggSummaryPageDisplay(void) // If the pokemon is an egg, limit the number of pages displayed to 1 static void LimitEggSummaryPageDisplay(void) // If the pokemon is an egg, limit the number of pages displayed to 1
{ {
if (sMonSummaryScreen->summary.isEgg) if (sMonSummaryScreen->summary.isEgg)
ChangeBgX(3, 0x10000, 0); ChangeBgX(3, 0x10000, BG_COORD_SET);
else else
ChangeBgX(3, 0, 0); ChangeBgX(3, 0, BG_COORD_SET);
} }
static void ResetWindows(void) static void ResetWindows(void)
@@ -3677,7 +3677,7 @@ static void AddAndFillMoveNamesWindow(void)
{ {
u8 windowId = AddWindowFromTemplateList(sPageMovesTemplate, PSS_DATA_WINDOW_MOVE_NAMES); u8 windowId = AddWindowFromTemplateList(sPageMovesTemplate, PSS_DATA_WINDOW_MOVE_NAMES);
FillWindowPixelRect(windowId, PIXEL_FILL(0), 0, 66, 72, 16); FillWindowPixelRect(windowId, PIXEL_FILL(0), 0, 66, 72, 16);
CopyWindowToVram(windowId, 2); CopyWindowToVram(windowId, COPYWIN_GFX);
} }
static void SwapMovesNamesPP(u8 moveIndex1, u8 moveIndex2) static void SwapMovesNamesPP(u8 moveIndex1, u8 moveIndex2)
+14 -14
View File
@@ -199,12 +199,12 @@ u32 LoopedTask_OpenPartyConditionGraph(s32 state)
return LT_INC_AND_PAUSE; return LT_INC_AND_PAUSE;
case 1: case 1:
InitBgTemplates(sPartyConditionBgTemplates, ARRAY_COUNT(sPartyConditionBgTemplates)); InitBgTemplates(sPartyConditionBgTemplates, ARRAY_COUNT(sPartyConditionBgTemplates));
ChangeBgX(1, 0, 0); ChangeBgX(1, 0, BG_COORD_SET);
ChangeBgY(1, 0, 0); ChangeBgY(1, 0, BG_COORD_SET);
ChangeBgX(2, 0, 0); ChangeBgX(2, 0, BG_COORD_SET);
ChangeBgY(2, 0, 0); ChangeBgY(2, 0, BG_COORD_SET);
ChangeBgX(3, 0, 0); ChangeBgX(3, 0, BG_COORD_SET);
ChangeBgY(3, 0, 0); ChangeBgY(3, 0, BG_COORD_SET);
SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_WIN0_ON | DISPCNT_WIN1_ON | DISPCNT_OBJ_ON | DISPCNT_OBJ_1D_MAP | DISPCNT_BG0_ON | DISPCNT_BG3_ON); SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_WIN0_ON | DISPCNT_WIN1_ON | DISPCNT_OBJ_ON | DISPCNT_OBJ_1D_MAP | DISPCNT_BG0_ON | DISPCNT_BG3_ON);
SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT1_BG2 | BLDCNT_EFFECT_BLEND | BLDCNT_TGT2_BG3); SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT1_BG2 | BLDCNT_EFFECT_BLEND | BLDCNT_TGT2_BG3);
SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(11, 4)); SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(11, 4));
@@ -240,8 +240,8 @@ u32 LoopedTask_OpenPartyConditionGraph(s32 state)
SetConditionGraphIOWindows(2); SetConditionGraphIOWindows(2);
return LT_INC_AND_PAUSE; return LT_INC_AND_PAUSE;
case 5: case 5:
sub_8199DF0(1, 0, 0, 1); BgDmaFill(1, 0, 0, 1);
sub_8199DF0(1, 17, 1, 1); BgDmaFill(1, 17, 1, 1);
CpuFill32(0, structPtr->tilemapBuffers[1], BG_SCREEN_SIZE); CpuFill32(0, structPtr->tilemapBuffers[1], BG_SCREEN_SIZE);
SetBgTilemapBuffer(1, structPtr->tilemapBuffers[1]); SetBgTilemapBuffer(1, structPtr->tilemapBuffers[1]);
return LT_INC_AND_PAUSE; return LT_INC_AND_PAUSE;
@@ -596,9 +596,9 @@ bool32 UpdateConditionGraphWindows(u8 mode, u16 bufferIndex, bool8 winMode)
{ {
case 0: case 0:
if (winMode) if (winMode)
CopyWindowToVram(structPtr->nameGenderWindowId, 3); CopyWindowToVram(structPtr->nameGenderWindowId, COPYWIN_FULL);
else else
CopyWindowToVram(structPtr->nameGenderWindowId, 2); CopyWindowToVram(structPtr->nameGenderWindowId, COPYWIN_GFX);
if (IsConditionMenuSearchMode() == TRUE) if (IsConditionMenuSearchMode() == TRUE)
{ {
@@ -612,9 +612,9 @@ bool32 UpdateConditionGraphWindows(u8 mode, u16 bufferIndex, bool8 winMode)
} }
case 1: case 1:
if (winMode) if (winMode)
CopyWindowToVram(structPtr->listIndexWindowId, 3); CopyWindowToVram(structPtr->listIndexWindowId, COPYWIN_FULL);
else else
CopyWindowToVram(structPtr->listIndexWindowId, 2); CopyWindowToVram(structPtr->listIndexWindowId, COPYWIN_GFX);
structPtr->windowModeState = 0; structPtr->windowModeState = 0;
return TRUE; return TRUE;
@@ -628,8 +628,8 @@ void CopyUnusedConditionWindowsToVram(void)
{ {
struct Pokenav7Struct *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MON_MARK_MENU); struct Pokenav7Struct *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MON_MARK_MENU);
CopyWindowToVram(structPtr->unusedWindowId1, 3); CopyWindowToVram(structPtr->unusedWindowId1, COPYWIN_FULL);
CopyWindowToVram(structPtr->unusedWindowId2, 3); CopyWindowToVram(structPtr->unusedWindowId2, COPYWIN_FULL);
} }
void sub_81CE964(struct Sprite *sprite) void sub_81CE964(struct Sprite *sprite)
+6 -6
View File
@@ -448,8 +448,8 @@ static u32 LoopedTask_OpenConditionSearchResults(s32 state)
case 4: case 4:
if (FreeTempTileDataBuffersIfPossible()) if (FreeTempTileDataBuffersIfPossible())
return LT_PAUSE; return LT_PAUSE;
ChangeBgX(1, 0, 0); ChangeBgX(1, 0, BG_COORD_SET);
ChangeBgY(1, 0, 0); ChangeBgY(1, 0, BG_COORD_SET);
ShowBg(1); ShowBg(1);
ShowBg(2); ShowBg(2);
HideBg(3); HideBg(3);
@@ -644,7 +644,7 @@ static void AddSearchResultListMenuWindow(struct PokenavSub8 *searchList)
{ {
searchList->winid = AddWindow(&sSearchResultListMenuWindowTemplate); searchList->winid = AddWindow(&sSearchResultListMenuWindowTemplate);
PutWindowTilemap(searchList->winid); PutWindowTilemap(searchList->winid);
CopyWindowToVram(searchList->winid, 1); CopyWindowToVram(searchList->winid, COPYWIN_MAP);
PrintSearchResultListMenuItems(searchList); PrintSearchResultListMenuItems(searchList);
} }
@@ -655,10 +655,10 @@ static void PrintSearchResultListMenuItems(struct PokenavSub8 *searchList)
DynamicPlaceholderTextUtil_SetPlaceholderPtr(0, gStringVar1); DynamicPlaceholderTextUtil_SetPlaceholderPtr(0, gStringVar1);
*gStringVar1 = EOS; *gStringVar1 = EOS;
DynamicPlaceholderTextUtil_ExpandPlaceholders(gStringVar2, gText_NumberF700); DynamicPlaceholderTextUtil_ExpandPlaceholders(gStringVar2, gText_NumberF700);
AddTextPrinterParameterized(searchList->winid, FONT_NORMAL, gStringVar2, 4, 1, 0xFF, NULL); AddTextPrinterParameterized(searchList->winid, FONT_NORMAL, gStringVar2, 4, 1, TEXT_SKIP_DRAW, NULL);
ConvertIntToDecimalStringN(gStringVar1, r7, STR_CONV_MODE_RIGHT_ALIGN, 3); ConvertIntToDecimalStringN(gStringVar1, r7, STR_CONV_MODE_RIGHT_ALIGN, 3);
AddTextPrinterParameterized(searchList->winid, FONT_NORMAL, gStringVar1, 34, 1, 0xFF, NULL); AddTextPrinterParameterized(searchList->winid, FONT_NORMAL, gStringVar1, 34, 1, TEXT_SKIP_DRAW, NULL);
CopyWindowToVram(searchList->winid, 2); CopyWindowToVram(searchList->winid, COPYWIN_GFX);
} }
static void InitConditionSearchListMenuTemplate(void) static void InitConditionSearchListMenuTemplate(void)
+5 -5
View File
@@ -421,9 +421,9 @@ static u32 LoopedTask_SlideMenuHeaderUp(s32 a0)
case 0: case 0:
return LT_INC_AND_PAUSE; return LT_INC_AND_PAUSE;
case 2: case 2:
if (ChangeBgY(0, 384, 1) >= 0x2000u) if (ChangeBgY(0, 384, BG_COORD_ADD) >= 0x2000u)
{ {
ChangeBgY(0, 0x2000, 0); ChangeBgY(0, 0x2000, BG_COORD_SET);
return LT_FINISH; return LT_FINISH;
} }
@@ -433,9 +433,9 @@ static u32 LoopedTask_SlideMenuHeaderUp(s32 a0)
static u32 LoopedTask_SlideMenuHeaderDown(s32 a0) static u32 LoopedTask_SlideMenuHeaderDown(s32 a0)
{ {
if (ChangeBgY(0, 384, 2) <= 0) if (ChangeBgY(0, 384, BG_COORD_SUB) <= 0)
{ {
ChangeBgY(0, 0, 0); ChangeBgY(0, 0, BG_COORD_SET);
return LT_FINISH; return LT_FINISH;
} }
return LT_PAUSE; return LT_PAUSE;
@@ -555,7 +555,7 @@ static void InitHelpBar(void)
structPtr->helpBarWindowId = 0; structPtr->helpBarWindowId = 0;
DrawHelpBar(structPtr->helpBarWindowId); DrawHelpBar(structPtr->helpBarWindowId);
PutWindowTilemap(structPtr->helpBarWindowId); PutWindowTilemap(structPtr->helpBarWindowId);
CopyWindowToVram(structPtr->helpBarWindowId, 3); // TODO: Use a defined constant here. CopyWindowToVram(structPtr->helpBarWindowId, COPYWIN_FULL);
} }
void PrintHelpBarText(u32 textId) void PrintHelpBarText(u32 textId)
+14 -14
View File
@@ -322,8 +322,8 @@ static u32 LoopedTask_OpenMatchCall(s32 taskState)
{ {
case 0: case 0:
InitBgTemplates(sMatchCallBgTemplates, ARRAY_COUNT(sMatchCallBgTemplates)); InitBgTemplates(sMatchCallBgTemplates, ARRAY_COUNT(sMatchCallBgTemplates));
ChangeBgX(2, 0, 0); ChangeBgX(2, 0, BG_COORD_SET);
ChangeBgY(2, 0, 0); ChangeBgY(2, 0, BG_COORD_SET);
DecompressAndCopyTileDataToVram(2, sMatchCallUI_Gfx, 0, 0, 0); DecompressAndCopyTileDataToVram(2, sMatchCallUI_Gfx, 0, 0, 0);
SetBgTilemapBuffer(2, state->unk1024); SetBgTilemapBuffer(2, state->unk1024);
CopyToBgTilemapBuffer(2, sMatchCallUI_Tilemap, 0, 0); CopyToBgTilemapBuffer(2, sMatchCallUI_Tilemap, 0, 0);
@@ -335,7 +335,7 @@ static u32 LoopedTask_OpenMatchCall(s32 taskState)
if (FreeTempTileDataBuffersIfPossible()) if (FreeTempTileDataBuffersIfPossible())
return LT_PAUSE; return LT_PAUSE;
sub_8199DF0(1, 0, 0, 1); BgDmaFill(1, 0, 0, 1);
SetBgTilemapBuffer(1, state->unk24); SetBgTilemapBuffer(1, state->unk24);
FillBgTilemapBufferRect_Palette0(1, 0x1000, 0, 0, 32, 20); FillBgTilemapBufferRect_Palette0(1, 0x1000, 0, 0, 32, 20);
CopyPaletteIntoBufferUnfaded(gUnknown_086226E0, 0x10, 0x20); CopyPaletteIntoBufferUnfaded(gUnknown_086226E0, 0x10, 0x20);
@@ -367,8 +367,8 @@ static u32 LoopedTask_OpenMatchCall(s32 taskState)
PrintMatchCallLocation(state, 0); PrintMatchCallLocation(state, 0);
return LT_INC_AND_PAUSE; return LT_INC_AND_PAUSE;
case 6: case 6:
ChangeBgX(1, 0, 0); ChangeBgX(1, 0, BG_COORD_SET);
ChangeBgY(1, 0, 0); ChangeBgY(1, 0, BG_COORD_SET);
ShowBg(2); ShowBg(2);
ShowBg(3); ShowBg(3);
ShowBg(1); ShowBg(1);
@@ -942,7 +942,7 @@ static void DrawMatchCallLeftColumnWindows(struct Pokenav4Struct *state)
PutWindowTilemap(state->locWindowId); PutWindowTilemap(state->locWindowId);
FillWindowPixelBuffer(state->infoBoxWindowId, PIXEL_FILL(1)); FillWindowPixelBuffer(state->infoBoxWindowId, PIXEL_FILL(1));
PutWindowTilemap(state->infoBoxWindowId); PutWindowTilemap(state->infoBoxWindowId);
CopyWindowToVram(state->locWindowId, 1); CopyWindowToVram(state->locWindowId, COPYWIN_MAP);
} }
static void UpdateMatchCallInfoBox(struct Pokenav4Struct *state) static void UpdateMatchCallInfoBox(struct Pokenav4Struct *state)
@@ -952,7 +952,7 @@ static void UpdateMatchCallInfoBox(struct Pokenav4Struct *state)
PrintNumberRegistered(state->infoBoxWindowId); PrintNumberRegistered(state->infoBoxWindowId);
PrintNumberOfBattlesLabel(state->infoBoxWindowId); PrintNumberOfBattlesLabel(state->infoBoxWindowId);
PrintNumberOfBattles(state->infoBoxWindowId); PrintNumberOfBattles(state->infoBoxWindowId);
CopyWindowToVram(state->infoBoxWindowId, 2); CopyWindowToVram(state->infoBoxWindowId, COPYWIN_GFX);
} }
static void PrintNumberRegisteredLabel(u16 windowId) static void PrintNumberRegisteredLabel(u16 windowId)
@@ -986,14 +986,14 @@ static void PrintNumberOfBattles(u16 windowId)
static void PrintMatchCallInfoLabel(u16 windowId, const u8 *str, int top) static void PrintMatchCallInfoLabel(u16 windowId, const u8 *str, int top)
{ {
int y = top * 16 + 1; int y = top * 16 + 1;
AddTextPrinterParameterized(windowId, FONT_NARROW, str, 2, y, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(windowId, FONT_NARROW, str, 2, y, TEXT_SKIP_DRAW, NULL);
} }
static void PrintMatchCallInfoNumber(u16 windowId, const u8 *str, int top) static void PrintMatchCallInfoNumber(u16 windowId, const u8 *str, int top)
{ {
int x = GetStringRightAlignXOffset(FONT_NARROW, str, 86); int x = GetStringRightAlignXOffset(FONT_NARROW, str, 86);
int y = top * 16 + 1; int y = top * 16 + 1;
AddTextPrinterParameterized(windowId, FONT_NARROW, str, x, y, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(windowId, FONT_NARROW, str, x, y, TEXT_SKIP_DRAW, NULL);
} }
static void PrintMatchCallLocation(struct Pokenav4Struct *state, int arg1) static void PrintMatchCallLocation(struct Pokenav4Struct *state, int arg1)
@@ -1023,10 +1023,10 @@ static void PrintMatchCallSelectionOptions(struct Pokenav4Struct *state)
if (optionText == MATCH_CALL_OPTION_COUNT) if (optionText == MATCH_CALL_OPTION_COUNT)
break; break;
AddTextPrinterParameterized(state->infoBoxWindowId, FONT_NARROW, sMatchCallOptionTexts[optionText], 16, i * 16 + 1, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(state->infoBoxWindowId, FONT_NARROW, sMatchCallOptionTexts[optionText], 16, i * 16 + 1, TEXT_SKIP_DRAW, NULL);
} }
CopyWindowToVram(state->infoBoxWindowId, 2); CopyWindowToVram(state->infoBoxWindowId, COPYWIN_GFX);
} }
static bool32 sub_81CBFC4(struct Pokenav4Struct *state) static bool32 sub_81CBFC4(struct Pokenav4Struct *state)
@@ -1055,7 +1055,7 @@ static void UpdateWindowsToShowCheckPage(struct Pokenav4Struct *state)
{ {
CloseMatchCallSelectOptionsWindow(state); CloseMatchCallSelectOptionsWindow(state);
FillWindowPixelBuffer(state->infoBoxWindowId, PIXEL_FILL(1)); FillWindowPixelBuffer(state->infoBoxWindowId, PIXEL_FILL(1));
CopyWindowToVram(state->infoBoxWindowId, 2); CopyWindowToVram(state->infoBoxWindowId, COPYWIN_GFX);
} }
static void sub_81CC034(struct Pokenav4Struct *state) static void sub_81CC034(struct Pokenav4Struct *state)
@@ -1072,7 +1072,7 @@ static void DrawMsgBoxForMatchCallMsg(struct Pokenav4Struct *state)
DrawMatchCallTextBoxBorder(state->msgBoxWindowId, 1, 4); DrawMatchCallTextBoxBorder(state->msgBoxWindowId, 1, 4);
FillWindowPixelBuffer(state->msgBoxWindowId, PIXEL_FILL(1)); FillWindowPixelBuffer(state->msgBoxWindowId, PIXEL_FILL(1));
PutWindowTilemap(state->msgBoxWindowId); PutWindowTilemap(state->msgBoxWindowId);
CopyWindowToVram(state->msgBoxWindowId, 3); CopyWindowToVram(state->msgBoxWindowId, COPYWIN_FULL);
sprite = PauseSpinningPokenavSprite(); sprite = PauseSpinningPokenavSprite();
sprite->x = 24; sprite->x = 24;
sprite->y = 112; sprite->y = 112;
@@ -1085,7 +1085,7 @@ static void DrawMsgBoxForCloseByMsg(struct Pokenav4Struct *state)
DrawTextBorderOuter(state->msgBoxWindowId, 1, 4); DrawTextBorderOuter(state->msgBoxWindowId, 1, 4);
FillWindowPixelBuffer(state->msgBoxWindowId, PIXEL_FILL(1)); FillWindowPixelBuffer(state->msgBoxWindowId, PIXEL_FILL(1));
PutWindowTilemap(state->msgBoxWindowId); PutWindowTilemap(state->msgBoxWindowId);
CopyWindowToVram(state->msgBoxWindowId, 3); CopyWindowToVram(state->msgBoxWindowId, COPYWIN_FULL);
} }
static bool32 IsDma3ManagerBusyWithBgCopy2(struct Pokenav4Struct *state) static bool32 IsDma3ManagerBusyWithBgCopy2(struct Pokenav4Struct *state)
+25 -25
View File
@@ -169,13 +169,13 @@ u32 LoopedTask_sub_81C8254(s32 state)
void sub_81C82E4(struct PokenavSub17 *matchCall) void sub_81C82E4(struct PokenavSub17 *matchCall)
{ {
u16 tileNum = (matchCall->list.listWindow.unk1 << 12) | matchCall->list.listWindow.unk6; u16 tileNum = (matchCall->list.listWindow.unk1 << 12) | matchCall->list.listWindow.unk6;
sub_8199DF0(matchCall->list.listWindow.bg, PIXEL_FILL(1), matchCall->list.listWindow.unk6, 1); BgDmaFill(matchCall->list.listWindow.bg, PIXEL_FILL(1), matchCall->list.listWindow.unk6, 1);
sub_8199DF0(matchCall->list.listWindow.bg, PIXEL_FILL(4), matchCall->list.listWindow.unk6 + 1, 1); BgDmaFill(matchCall->list.listWindow.bg, PIXEL_FILL(4), matchCall->list.listWindow.unk6 + 1, 1);
SetBgTilemapBuffer(matchCall->list.listWindow.bg, matchCall->tilemapBuffer); SetBgTilemapBuffer(matchCall->list.listWindow.bg, matchCall->tilemapBuffer);
FillBgTilemapBufferRect_Palette0(matchCall->list.listWindow.bg, tileNum, 0, 0, 32, 32); FillBgTilemapBufferRect_Palette0(matchCall->list.listWindow.bg, tileNum, 0, 0, 32, 32);
ChangeBgY(matchCall->list.listWindow.bg, 0, 0); ChangeBgY(matchCall->list.listWindow.bg, 0, BG_COORD_SET);
ChangeBgX(matchCall->list.listWindow.bg, 0, 0); ChangeBgX(matchCall->list.listWindow.bg, 0, BG_COORD_SET);
ChangeBgY(matchCall->list.listWindow.bg, matchCall->list.listWindow.unk3 << 11, 2); ChangeBgY(matchCall->list.listWindow.bg, matchCall->list.listWindow.unk3 << 11, BG_COORD_SUB);
CopyBgTilemapBufferToVram(matchCall->list.listWindow.bg); CopyBgTilemapBufferToVram(matchCall->list.listWindow.bg);
} }
@@ -183,7 +183,7 @@ void sub_81C835C(struct PokenavListMenuWindow *listWindow)
{ {
FillWindowPixelBuffer(listWindow->windowId, PIXEL_FILL(1)); FillWindowPixelBuffer(listWindow->windowId, PIXEL_FILL(1));
PutWindowTilemap(listWindow->windowId); PutWindowTilemap(listWindow->windowId);
CopyWindowToVram(listWindow->windowId, 1); CopyWindowToVram(listWindow->windowId, COPYWIN_MAP);
} }
void sub_81C837C(struct MatchCallWindowState *state, struct PokenavSub17Substruct *a1) void sub_81C837C(struct MatchCallWindowState *state, struct PokenavSub17Substruct *a1)
@@ -231,9 +231,9 @@ u32 LoopedTask_sub_81C83F0(s32 state)
if (++structPtr->listWindow.unkC >= structPtr->listWindow.unkE) if (++structPtr->listWindow.unkC >= structPtr->listWindow.unkE)
{ {
if (structPtr->unk38 != NULL) if (structPtr->unk38 != NULL)
CopyWindowToVram(structPtr->listWindow.windowId, 3); CopyWindowToVram(structPtr->listWindow.windowId, COPYWIN_FULL);
else else
CopyWindowToVram(structPtr->listWindow.windowId, 2); CopyWindowToVram(structPtr->listWindow.windowId, COPYWIN_GFX);
return LT_INC_AND_PAUSE; return LT_INC_AND_PAUSE;
} }
else else
@@ -295,9 +295,9 @@ void sub_81C8568(s32 a0, struct PokenavSub17Substruct *list)
list->unk20 = GetBgY(list->listWindow.bg); list->unk20 = GetBgY(list->listWindow.bg);
list->unk24 = list->unk20 + (a0 << 12); list->unk24 = list->unk20 + (a0 << 12);
if (a0 > 0) if (a0 > 0)
list->unk30 = 1; list->unk30 = BG_COORD_ADD;
else else
list->unk30 = 2; list->unk30 = BG_COORD_SUB;
list->unk2C = a0; list->unk2C = a0;
list->loopedTaskId = CreateLoopedTask(LoopedTask_sub_81C85A0, 6); list->loopedTaskId = CreateLoopedTask(LoopedTask_sub_81C85A0, 6);
} }
@@ -319,12 +319,12 @@ u32 LoopedTask_sub_81C85A0(s32 state)
flag = FALSE; flag = FALSE;
y = GetBgY(subPtr->listWindow.bg); y = GetBgY(subPtr->listWindow.bg);
v1 = ChangeBgY(subPtr->listWindow.bg, 0x1000, subPtr->unk30); v1 = ChangeBgY(subPtr->listWindow.bg, 0x1000, subPtr->unk30);
if (subPtr->unk30 == 2) if (subPtr->unk30 == BG_COORD_SUB)
{ {
if ((y > subPtr->unk24 || y <= subPtr->unk20) && v1 <= subPtr->unk24) if ((y > subPtr->unk24 || y <= subPtr->unk20) && v1 <= subPtr->unk24)
flag = TRUE; flag = TRUE;
} }
else else // BG_COORD_ADD
{ {
if ((y < subPtr->unk24 || y >= subPtr->unk20) && v1 >= subPtr->unk24) if ((y < subPtr->unk24 || y >= subPtr->unk20) && v1 >= subPtr->unk24)
flag = TRUE; flag = TRUE;
@@ -333,7 +333,7 @@ u32 LoopedTask_sub_81C85A0(s32 state)
if (flag) if (flag)
{ {
subPtr->listWindow.unkA = (subPtr->listWindow.unkA + subPtr->unk2C) & 0xF; subPtr->listWindow.unkA = (subPtr->listWindow.unkA + subPtr->unk2C) & 0xF;
ChangeBgY(subPtr->listWindow.bg, subPtr->unk24, 0); ChangeBgY(subPtr->listWindow.bg, subPtr->unk24, BG_COORD_SET);
return LT_FINISH; return LT_FINISH;
} }
return LT_PAUSE; return LT_PAUSE;
@@ -494,7 +494,7 @@ void sub_81C8838(void)
struct PokenavSub17 *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MATCH_CALL_LIST); struct PokenavSub17 *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MATCH_CALL_LIST);
struct MatchCallWindowState *subPtr = &structPtr->unk888; struct MatchCallWindowState *subPtr = &structPtr->unk888;
structPtr->list.unk38(structPtr->list.listWindow.windowId, subPtr->windowTopIndex + subPtr->selectedIndexOffset, (structPtr->list.listWindow.unkA + subPtr->selectedIndexOffset) & 0xF); structPtr->list.unk38(structPtr->list.listWindow.windowId, subPtr->windowTopIndex + subPtr->selectedIndexOffset, (structPtr->list.listWindow.unkA + subPtr->selectedIndexOffset) & 0xF);
CopyWindowToVram(structPtr->list.listWindow.windowId, 1); CopyWindowToVram(structPtr->list.listWindow.windowId, COPYWIN_MAP);
} }
// TODO: // TODO:
@@ -672,7 +672,7 @@ void sub_81C8B70(struct PokenavListMenuWindow *listWindow, s32 a1, s32 a2)
if (a1 + a2 <= 16) if (a1 + a2 <= 16)
{ {
CpuFastFill8(PIXEL_FILL(1), v1 + a1 * v2, a2 * v2); CpuFastFill8(PIXEL_FILL(1), v1 + a1 * v2, a2 * v2);
CopyWindowToVram(listWindow->windowId, 2); CopyWindowToVram(listWindow->windowId, COPYWIN_GFX);
} }
else else
{ {
@@ -681,13 +681,13 @@ void sub_81C8B70(struct PokenavListMenuWindow *listWindow, s32 a1, s32 a2)
CpuFastFill8(PIXEL_FILL(1), v1 + a1 * v2, v3 * v2); CpuFastFill8(PIXEL_FILL(1), v1 + a1 * v2, v3 * v2);
CpuFastFill8(PIXEL_FILL(1), v1, v4 * v2); CpuFastFill8(PIXEL_FILL(1), v1, v4 * v2);
CopyWindowToVram(listWindow->windowId, 2); CopyWindowToVram(listWindow->windowId, COPYWIN_GFX);
} }
for (a2--; a2 != -1; a1 = (a1 + 1) & 0xF, a2--) for (a2--; a2 != -1; a1 = (a1 + 1) & 0xF, a2--)
ClearRematchPokeballIcon(listWindow->windowId, a1); ClearRematchPokeballIcon(listWindow->windowId, a1);
CopyWindowToVram(listWindow->windowId, 1); CopyWindowToVram(listWindow->windowId, COPYWIN_MAP);
} }
void sub_81C8C64(struct PokenavListMenuWindow *listWindow, u32 a1) void sub_81C8C64(struct PokenavListMenuWindow *listWindow, u32 a1)
@@ -712,18 +712,18 @@ void sub_81C8CB4(struct MatchCallWindowState *state, struct PokenavSub17Substruc
list->unk34(state->unk10 + state->unkC * state->windowTopIndex, list->unkTextBuffer); list->unk34(state->unk10 + state->unkC * state->windowTopIndex, list->unkTextBuffer);
list->unk38(list->listWindow.windowId, state->windowTopIndex, list->listWindow.unkA); list->unk38(list->listWindow.windowId, state->windowTopIndex, list->listWindow.unkA);
FillWindowPixelRect(list->listWindow.windowId, PIXEL_FILL(4), 0, list->listWindow.unkA * 16, list->listWindow.unk4 * 8, 16); FillWindowPixelRect(list->listWindow.windowId, PIXEL_FILL(4), 0, list->listWindow.unkA * 16, list->listWindow.unk4 * 8, 16);
AddTextPrinterParameterized3(list->listWindow.windowId, list->listWindow.fontId, 8, (list->listWindow.unkA * 16) + 1, colors, TEXT_SPEED_FF, list->unkTextBuffer); AddTextPrinterParameterized3(list->listWindow.windowId, list->listWindow.fontId, 8, (list->listWindow.unkA * 16) + 1, colors, TEXT_SKIP_DRAW, list->unkTextBuffer);
sub_81C8C64(&list->listWindow, 1); sub_81C8C64(&list->listWindow, 1);
CopyWindowRectToVram(list->listWindow.windowId, 3, 0, list->listWindow.unkA * 2, list->listWindow.unk4, 2); CopyWindowRectToVram(list->listWindow.windowId, COPYWIN_FULL, 0, list->listWindow.unkA * 2, list->listWindow.unk4, 2);
} }
void sub_81C8D4C(struct MatchCallWindowState *state, struct PokenavSub17Substruct *list) void sub_81C8D4C(struct MatchCallWindowState *state, struct PokenavSub17Substruct *list)
{ {
list->unk34(state->unk10 + state->unkC * state->windowTopIndex, list->unkTextBuffer); list->unk34(state->unk10 + state->unkC * state->windowTopIndex, list->unkTextBuffer);
FillWindowPixelRect(list->listWindow.windowId, PIXEL_FILL(1), 0, list->listWindow.unkA * 16, list->listWindow.unk4 * 8, 16); FillWindowPixelRect(list->listWindow.windowId, PIXEL_FILL(1), 0, list->listWindow.unkA * 16, list->listWindow.unk4 * 8, 16);
AddTextPrinterParameterized(list->listWindow.windowId, list->listWindow.fontId, list->unkTextBuffer, 8, list->listWindow.unkA * 16 + 1, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(list->listWindow.windowId, list->listWindow.fontId, list->unkTextBuffer, 8, list->listWindow.unkA * 16 + 1, TEXT_SKIP_DRAW, NULL);
sub_81C8C64(&list->listWindow, 0); sub_81C8C64(&list->listWindow, 0);
CopyWindowToVram(list->listWindow.windowId, 3); CopyWindowToVram(list->listWindow.windowId, COPYWIN_FULL);
} }
void PrintMatchCallFieldNames(struct PokenavSub17Substruct *list, u32 fieldId) void PrintMatchCallFieldNames(struct PokenavSub17Substruct *list, u32 fieldId)
@@ -733,8 +733,8 @@ void PrintMatchCallFieldNames(struct PokenavSub17Substruct *list, u32 fieldId)
u32 top = (list->listWindow.unkA + 1 + (fieldId * 2)) & 0xF; u32 top = (list->listWindow.unkA + 1 + (fieldId * 2)) & 0xF;
FillWindowPixelRect(list->listWindow.windowId, PIXEL_FILL(1), 0, top << 4, list->listWindow.unk4, 16); FillWindowPixelRect(list->listWindow.windowId, PIXEL_FILL(1), 0, top << 4, list->listWindow.unk4, 16);
AddTextPrinterParameterized3(list->listWindow.windowId, FONT_NARROW, 2, (top << 4) + 1, colors, -1, fieldNames[fieldId]); AddTextPrinterParameterized3(list->listWindow.windowId, FONT_NARROW, 2, (top << 4) + 1, colors, TEXT_SKIP_DRAW, fieldNames[fieldId]);
CopyWindowRectToVram(list->listWindow.windowId, 2, 0, top << 1, list->listWindow.unk4, 2); CopyWindowRectToVram(list->listWindow.windowId, COPYWIN_GFX, 0, top << 1, list->listWindow.unk4, 2);
} }
static void PrintMatchCallFlavorText(struct MatchCallWindowState *a0, struct PokenavSub17Substruct *list, u32 checkPageEntry) static void PrintMatchCallFlavorText(struct MatchCallWindowState *a0, struct PokenavSub17Substruct *list, u32 checkPageEntry)
@@ -754,8 +754,8 @@ static void PrintMatchCallFlavorText(struct MatchCallWindowState *a0, struct Pok
if (str != NULL) if (str != NULL)
{ {
FillWindowTilesByRow(list->listWindow.windowId, 1, r6 * 2, list->listWindow.unk4 - 1, 2); FillWindowTilesByRow(list->listWindow.windowId, 1, r6 * 2, list->listWindow.unk4 - 1, 2);
AddTextPrinterParameterized(list->listWindow.windowId, FONT_NARROW, str, 2, (r6 << 4) + 1, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(list->listWindow.windowId, FONT_NARROW, str, 2, (r6 << 4) + 1, TEXT_SKIP_DRAW, NULL);
CopyWindowRectToVram(list->listWindow.windowId, 2, 0, r6 * 2, list->listWindow.unk4, 2); CopyWindowRectToVram(list->listWindow.windowId, COPYWIN_GFX, 0, r6 * 2, list->listWindow.unk4, 2);
} }
} }
+8 -8
View File
@@ -415,12 +415,12 @@ static u32 LoopedTask_OpenMenu(s32 state)
CopyToBgTilemapBuffer(1, gPokenavMessageBox_Tilemap, 0, 0); CopyToBgTilemapBuffer(1, gPokenavMessageBox_Tilemap, 0, 0);
CopyBgTilemapBufferToVram(1); CopyBgTilemapBufferToVram(1);
CopyPaletteIntoBufferUnfaded(gPokenavMessageBox_Pal, 0x10, 0x20); CopyPaletteIntoBufferUnfaded(gPokenavMessageBox_Pal, 0x10, 0x20);
ChangeBgX(1, 0, 0); ChangeBgX(1, 0, BG_COORD_SET);
ChangeBgY(1, 0, 0); ChangeBgY(1, 0, BG_COORD_SET);
ChangeBgX(2, 0, 0); ChangeBgX(2, 0, BG_COORD_SET);
ChangeBgY(2, 0, 0); ChangeBgY(2, 0, BG_COORD_SET);
ChangeBgX(3, 0, 0); ChangeBgX(3, 0, BG_COORD_SET);
ChangeBgY(3, 0, 0); ChangeBgY(3, 0, BG_COORD_SET);
return LT_INC_AND_PAUSE; return LT_INC_AND_PAUSE;
case 1: case 1:
if (FreeTempTileDataBuffersIfPossible()) if (FreeTempTileDataBuffersIfPossible())
@@ -1125,7 +1125,7 @@ static void AddOptionDescriptionWindow(void)
ptr->optionDescWindowId = AddWindow(&sOptionDescWindowTemplate); ptr->optionDescWindowId = AddWindow(&sOptionDescWindowTemplate);
PutWindowTilemap(ptr->optionDescWindowId); PutWindowTilemap(ptr->optionDescWindowId);
FillWindowPixelBuffer(ptr->optionDescWindowId, PIXEL_FILL(6)); FillWindowPixelBuffer(ptr->optionDescWindowId, PIXEL_FILL(6));
CopyWindowToVram(ptr->optionDescWindowId, 3); CopyWindowToVram(ptr->optionDescWindowId, COPYWIN_FULL);
} }
static void PrintCurrentOptionDescription(void) static void PrintCurrentOptionDescription(void)
@@ -1168,7 +1168,7 @@ static void DestroyMovingDotsBgTask(void)
static void Task_MoveBgDots(u8 taskId) static void Task_MoveBgDots(u8 taskId)
{ {
ChangeBgX(3, 0x80, 1); ChangeBgX(3, 0x80, BG_COORD_ADD);
} }
static void CreateBgDotPurplePalTask(void) static void CreateBgDotPurplePalTask(void)
+17 -17
View File
@@ -501,8 +501,8 @@ static void FreeCityZoomViewGfx(void)
static void LoadPokenavRegionMapGfx(struct Pokenav5Struct_2 *state) static void LoadPokenavRegionMapGfx(struct Pokenav5Struct_2 *state)
{ {
sub_8199DF0(1, PIXEL_FILL(0), 0x40, 1); BgDmaFill(1, PIXEL_FILL(0), 0x40, 1);
sub_8199DF0(1, PIXEL_FILL(1), 0x41, 1); BgDmaFill(1, PIXEL_FILL(1), 0x41, 1);
CpuFill16(0x1040, state->tilemapBuffer, 0x800); CpuFill16(0x1040, state->tilemapBuffer, 0x800);
SetBgTilemapBuffer(1, state->tilemapBuffer); SetBgTilemapBuffer(1, state->tilemapBuffer);
state->infoWindowId = AddWindow(&sMapSecInfoWindowTemplate); state->infoWindowId = AddWindow(&sMapSecInfoWindowTemplate);
@@ -511,15 +511,15 @@ static void LoadPokenavRegionMapGfx(struct Pokenav5Struct_2 *state)
DecompressAndCopyTileDataToVram(1, sRegionMapCityZoomTiles_Gfx, 0, 0, 0); DecompressAndCopyTileDataToVram(1, sRegionMapCityZoomTiles_Gfx, 0, 0, 0);
FillWindowPixelBuffer(state->infoWindowId, PIXEL_FILL(1)); FillWindowPixelBuffer(state->infoWindowId, PIXEL_FILL(1));
PutWindowTilemap(state->infoWindowId); PutWindowTilemap(state->infoWindowId);
CopyWindowToVram(state->infoWindowId, 3); CopyWindowToVram(state->infoWindowId, COPYWIN_FULL);
CopyPaletteIntoBufferUnfaded(sMapSecInfoWindow_Pal, 0x10, 0x20); CopyPaletteIntoBufferUnfaded(sMapSecInfoWindow_Pal, 0x10, 0x20);
CopyPaletteIntoBufferUnfaded(gRegionMapCityZoomTiles_Pal, 0x30, 0x20); CopyPaletteIntoBufferUnfaded(gRegionMapCityZoomTiles_Pal, 0x30, 0x20);
if (!IsRegionMapZoomed()) if (!IsRegionMapZoomed())
ChangeBgY(1, -0x6000, 0); ChangeBgY(1, -0x6000, BG_COORD_SET);
else else
ChangeBgY(1, 0, 0); ChangeBgY(1, 0, BG_COORD_SET);
ChangeBgX(1, 0, 0); ChangeBgX(1, 0, BG_COORD_SET);
} }
static bool32 TryFreeTempTileDataBuffers(void) static bool32 TryFreeTempTileDataBuffers(void)
@@ -535,26 +535,26 @@ static void UpdateMapSecInfoWindow(struct Pokenav5Struct_2 *state)
case MAPSECTYPE_CITY_CANFLY: case MAPSECTYPE_CITY_CANFLY:
FillWindowPixelBuffer(state->infoWindowId, PIXEL_FILL(1)); FillWindowPixelBuffer(state->infoWindowId, PIXEL_FILL(1));
PutWindowRectTilemap(state->infoWindowId, 0, 0, 12, 2); PutWindowRectTilemap(state->infoWindowId, 0, 0, 12, 2);
AddTextPrinterParameterized(state->infoWindowId, FONT_NARROW, regionMap->mapSecName, 0, 1, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(state->infoWindowId, FONT_NARROW, regionMap->mapSecName, 0, 1, TEXT_SKIP_DRAW, NULL);
DrawCityMap(state, regionMap->mapSecId, regionMap->posWithinMapSec); DrawCityMap(state, regionMap->mapSecId, regionMap->posWithinMapSec);
CopyWindowToVram(state->infoWindowId, 3); CopyWindowToVram(state->infoWindowId, COPYWIN_FULL);
SetCityZoomTextInvisibility(FALSE); SetCityZoomTextInvisibility(FALSE);
break; break;
case MAPSECTYPE_CITY_CANTFLY: case MAPSECTYPE_CITY_CANTFLY:
FillWindowPixelBuffer(state->infoWindowId, PIXEL_FILL(1)); FillWindowPixelBuffer(state->infoWindowId, PIXEL_FILL(1));
PutWindowRectTilemap(state->infoWindowId, 0, 0, 12, 2); PutWindowRectTilemap(state->infoWindowId, 0, 0, 12, 2);
AddTextPrinterParameterized(state->infoWindowId, FONT_NARROW, regionMap->mapSecName, 0, 1, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(state->infoWindowId, FONT_NARROW, regionMap->mapSecName, 0, 1, TEXT_SKIP_DRAW, NULL);
FillBgTilemapBufferRect(1, 0x1041, 17, 6, 12, 11, 17); FillBgTilemapBufferRect(1, 0x1041, 17, 6, 12, 11, 17);
CopyWindowToVram(state->infoWindowId, 3); CopyWindowToVram(state->infoWindowId, COPYWIN_FULL);
SetCityZoomTextInvisibility(TRUE); SetCityZoomTextInvisibility(TRUE);
break; break;
case MAPSECTYPE_ROUTE: case MAPSECTYPE_ROUTE:
case MAPSECTYPE_BATTLE_FRONTIER: case MAPSECTYPE_BATTLE_FRONTIER:
FillWindowPixelBuffer(state->infoWindowId, PIXEL_FILL(1)); FillWindowPixelBuffer(state->infoWindowId, PIXEL_FILL(1));
PutWindowTilemap(state->infoWindowId); PutWindowTilemap(state->infoWindowId);
AddTextPrinterParameterized(state->infoWindowId, FONT_NARROW, regionMap->mapSecName, 0, 1, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(state->infoWindowId, FONT_NARROW, regionMap->mapSecName, 0, 1, TEXT_SKIP_DRAW, NULL);
PrintLandmarkNames(state, regionMap->mapSecId, regionMap->posWithinMapSec); PrintLandmarkNames(state, regionMap->mapSecId, regionMap->posWithinMapSec);
CopyWindowToVram(state->infoWindowId, 3); CopyWindowToVram(state->infoWindowId, COPYWIN_FULL);
SetCityZoomTextInvisibility(TRUE); SetCityZoomTextInvisibility(TRUE);
break; break;
case MAPSECTYPE_NONE: case MAPSECTYPE_NONE:
@@ -587,9 +587,9 @@ static void Task_ChangeBgYForZoom(u8 taskId)
{ {
if (gTasks[taskId].tZoomIn) if (gTasks[taskId].tZoomIn)
{ {
if (ChangeBgY(1, 0x480, 1) >= 0) if (ChangeBgY(1, 0x480, BG_COORD_ADD) >= 0)
{ {
ChangeBgY(1, 0, 0); ChangeBgY(1, 0, BG_COORD_SET);
DestroyTask(taskId); DestroyTask(taskId);
} }
@@ -597,9 +597,9 @@ static void Task_ChangeBgYForZoom(u8 taskId)
} }
else else
{ {
if (ChangeBgY(1, 0x480, 2) <= -0x6000) if (ChangeBgY(1, 0x480, BG_COORD_SUB) <= -0x6000)
{ {
ChangeBgY(1, -0x6000, 0); ChangeBgY(1, -0x6000, BG_COORD_SET);
DestroyTask(taskId); DestroyTask(taskId);
} }
@@ -654,7 +654,7 @@ static void PrintLandmarkNames(struct Pokenav5Struct_2 *state, int mapSecId, int
break; break;
StringCopyPadded(gStringVar1, landmarkName, CHAR_SPACE, 12); StringCopyPadded(gStringVar1, landmarkName, CHAR_SPACE, 12);
AddTextPrinterParameterized(state->infoWindowId, FONT_NARROW, gStringVar1, 0, i * 16 + 17, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(state->infoWindowId, FONT_NARROW, gStringVar1, 0, i * 16 + 17, TEXT_SKIP_DRAW, NULL);
i++; i++;
} }
} }
+5 -5
View File
@@ -439,8 +439,8 @@ static u32 LoopedTask_OpenRibbonsMonList(s32 state)
return LT_PAUSE; return LT_PAUSE;
if (!UpdateMonListBgs()) if (!UpdateMonListBgs())
return LT_PAUSE; return LT_PAUSE;
ChangeBgX(1, 0, 0); ChangeBgX(1, 0, BG_COORD_SET);
ChangeBgY(1, 0, 0); ChangeBgY(1, 0, BG_COORD_SET);
ShowBg(1); ShowBg(1);
return LT_INC_AND_PAUSE; return LT_INC_AND_PAUSE;
case 2: case 2:
@@ -652,7 +652,7 @@ static void AddRibbonsMonListWindow(struct PokenavSub10 *monMenu)
PutWindowTilemap(monMenu->winid); PutWindowTilemap(monMenu->winid);
r2 = GetRibbonsMonListCount(); r2 = GetRibbonsMonListCount();
sub_81D02B0(monMenu->winid, 0, r2); sub_81D02B0(monMenu->winid, 0, r2);
CopyWindowToVram(monMenu->winid, 1); CopyWindowToVram(monMenu->winid, COPYWIN_MAP);
sub_81D0288(monMenu); sub_81D0288(monMenu);
} }
@@ -661,7 +661,7 @@ static void sub_81D0288(struct PokenavSub10 *monMenu)
s32 r4 = GetSelectedPokenavListIndex(); s32 r4 = GetSelectedPokenavListIndex();
s32 r2 = GetRibbonsMonListCount(); s32 r2 = GetRibbonsMonListCount();
sub_81D02B0(monMenu->winid, r4 + 1, r2); sub_81D02B0(monMenu->winid, r4 + 1, r2);
CopyWindowToVram(monMenu->winid, 2); CopyWindowToVram(monMenu->winid, COPYWIN_GFX);
} }
static void sub_81D02B0(s32 windowId, s32 val1, s32 val2) static void sub_81D02B0(s32 windowId, s32 val1, s32 val2)
@@ -674,7 +674,7 @@ static void sub_81D02B0(s32 windowId, s32 val1, s32 val2)
*ptr++ = CHAR_SLASH; *ptr++ = CHAR_SLASH;
ConvertIntToDecimalStringN(ptr, val2, STR_CONV_MODE_RIGHT_ALIGN, 3); ConvertIntToDecimalStringN(ptr, val2, STR_CONV_MODE_RIGHT_ALIGN, 3);
x = GetStringCenterAlignXOffset(FONT_NORMAL, strbuf, 56); x = GetStringCenterAlignXOffset(FONT_NORMAL, strbuf, 56);
AddTextPrinterParameterized(windowId, FONT_NORMAL, strbuf, x, 1, 0xFF, NULL); AddTextPrinterParameterized(windowId, FONT_NORMAL, strbuf, x, 1, TEXT_SKIP_DRAW, NULL);
} }
static void InitMonRibbonPokenavListMenuTemplate(void) static void InitMonRibbonPokenavListMenuTemplate(void)
+15 -15
View File
@@ -578,7 +578,7 @@ static u32 LoopedTask_OpenRibbonsSummaryMenu(s32 state)
case 1: case 1:
if (!FreeTempTileDataBuffersIfPossible()) if (!FreeTempTileDataBuffersIfPossible())
{ {
sub_8199DF0(1, 0, 0, 1); BgDmaFill(1, 0, 0, 1);
DecompressAndCopyTileDataToVram(1, sRibbonIconsSmall_Gfx, 0, 1, 0); DecompressAndCopyTileDataToVram(1, sRibbonIconsSmall_Gfx, 0, 1, 0);
SetBgTilemapBuffer(1, structPtr->tilemapBuffers[1]); SetBgTilemapBuffer(1, structPtr->tilemapBuffers[1]);
FillBgTilemapBufferRect_Palette0(1, 0, 0, 0, 32, 20); FillBgTilemapBufferRect_Palette0(1, 0, 0, 0, 32, 20);
@@ -631,10 +631,10 @@ static u32 LoopedTask_OpenRibbonsSummaryMenu(s32 state)
if (!IsDma3ManagerBusyWithBgCopy()) if (!IsDma3ManagerBusyWithBgCopy())
{ {
CreateBigRibbonSprite(structPtr); CreateBigRibbonSprite(structPtr);
ChangeBgX(1, 0, 0); ChangeBgX(1, 0, BG_COORD_SET);
ChangeBgY(1, 0, 0); ChangeBgY(1, 0, BG_COORD_SET);
ChangeBgX(2, 0, 0); ChangeBgX(2, 0, BG_COORD_SET);
ChangeBgY(2, 0, 0); ChangeBgY(2, 0, BG_COORD_SET);
ShowBg(1); ShowBg(1);
ShowBg(2); ShowBg(2);
HideBg(3); HideBg(3);
@@ -809,8 +809,8 @@ static void PrintCurrentMonRibbonCount(struct PokenavSub14 *structPtr)
DynamicPlaceholderTextUtil_SetPlaceholderPtr(0, gStringVar1); DynamicPlaceholderTextUtil_SetPlaceholderPtr(0, gStringVar1);
DynamicPlaceholderTextUtil_ExpandPlaceholders(gStringVar4, gText_RibbonsF700); DynamicPlaceholderTextUtil_ExpandPlaceholders(gStringVar4, gText_RibbonsF700);
FillWindowPixelBuffer(structPtr->ribbonCountWindowId, PIXEL_FILL(4)); FillWindowPixelBuffer(structPtr->ribbonCountWindowId, PIXEL_FILL(4));
AddTextPrinterParameterized3(structPtr->ribbonCountWindowId, FONT_NORMAL, 0, 1, color, -1, gStringVar4); AddTextPrinterParameterized3(structPtr->ribbonCountWindowId, FONT_NORMAL, 0, 1, color, TEXT_SKIP_DRAW, gStringVar4);
CopyWindowToVram(structPtr->ribbonCountWindowId, 2); CopyWindowToVram(structPtr->ribbonCountWindowId, COPYWIN_GFX);
} }
static void PrintRibbonNameAndDescription(struct PokenavSub14 *structPtr) static void PrintRibbonNameAndDescription(struct PokenavSub14 *structPtr)
@@ -824,7 +824,7 @@ static void PrintRibbonNameAndDescription(struct PokenavSub14 *structPtr)
{ {
// Print normal ribbon name/description // Print normal ribbon name/description
for (i = 0; i < 2; i++) for (i = 0; i < 2; i++)
AddTextPrinterParameterized3(structPtr->ribbonCountWindowId, FONT_NORMAL, 0, (i * 16) + 1, color, -1, gRibbonDescriptionPointers[ribbonId][i]); AddTextPrinterParameterized3(structPtr->ribbonCountWindowId, FONT_NORMAL, 0, (i * 16) + 1, color, TEXT_SKIP_DRAW, gRibbonDescriptionPointers[ribbonId][i]);
} }
else else
{ {
@@ -840,10 +840,10 @@ static void PrintRibbonNameAndDescription(struct PokenavSub14 *structPtr)
// Print gift ribbon name/description // Print gift ribbon name/description
ribbonId--; ribbonId--;
for (i = 0; i < 2; i++) for (i = 0; i < 2; i++)
AddTextPrinterParameterized3(structPtr->ribbonCountWindowId, FONT_NORMAL, 0, (i * 16) + 1, color, -1, gGiftRibbonDescriptionPointers[ribbonId][i]); AddTextPrinterParameterized3(structPtr->ribbonCountWindowId, FONT_NORMAL, 0, (i * 16) + 1, color, TEXT_SKIP_DRAW, gGiftRibbonDescriptionPointers[ribbonId][i]);
} }
CopyWindowToVram(structPtr->ribbonCountWindowId, 2); CopyWindowToVram(structPtr->ribbonCountWindowId, COPYWIN_GFX);
} }
static const struct WindowTemplate sRibbonSummaryMonNameWindowTemplate = static const struct WindowTemplate sRibbonSummaryMonNameWindowTemplate =
@@ -877,7 +877,7 @@ static void PrintRibbbonsSummaryMonInfo(struct PokenavSub14 *structPtr)
FillWindowPixelBuffer(windowId, PIXEL_FILL(1)); FillWindowPixelBuffer(windowId, PIXEL_FILL(1));
GetMonNicknameLevelGender(gStringVar3, &level, &gender); GetMonNicknameLevelGender(gStringVar3, &level, &gender);
AddTextPrinterParameterized(windowId, FONT_NORMAL, gStringVar3, 0, 1, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(windowId, FONT_NORMAL, gStringVar3, 0, 1, TEXT_SKIP_DRAW, NULL);
switch (gender) switch (gender)
{ {
case MON_MALE: case MON_MALE:
@@ -896,8 +896,8 @@ static void PrintRibbbonsSummaryMonInfo(struct PokenavSub14 *structPtr)
*(txtPtr++) = CHAR_EXTRA_SYMBOL; *(txtPtr++) = CHAR_EXTRA_SYMBOL;
*(txtPtr++) = CHAR_LV_2; *(txtPtr++) = CHAR_LV_2;
ConvertIntToDecimalStringN(txtPtr, level, STR_CONV_MODE_LEFT_ALIGN, 3); ConvertIntToDecimalStringN(txtPtr, level, STR_CONV_MODE_LEFT_ALIGN, 3);
AddTextPrinterParameterized(windowId, FONT_NORMAL, gStringVar1, 60, 1, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(windowId, FONT_NORMAL, gStringVar1, 60, 1, TEXT_SKIP_DRAW, NULL);
CopyWindowToVram(windowId, 2); CopyWindowToVram(windowId, COPYWIN_GFX);
} }
static const struct WindowTemplate sRibbonMonListIndexWindowTemplate[] = static const struct WindowTemplate sRibbonMonListIndexWindowTemplate[] =
@@ -933,8 +933,8 @@ static void PrintRibbonsMonListIndex(struct PokenavSub14 *structPtr)
*(txtPtr++) = CHAR_SLASH; *(txtPtr++) = CHAR_SLASH;
ConvertIntToDecimalStringN(txtPtr, count, STR_CONV_MODE_RIGHT_ALIGN, 3); ConvertIntToDecimalStringN(txtPtr, count, STR_CONV_MODE_RIGHT_ALIGN, 3);
x = GetStringCenterAlignXOffset(FONT_NORMAL, gStringVar1, 56); x = GetStringCenterAlignXOffset(FONT_NORMAL, gStringVar1, 56);
AddTextPrinterParameterized(structPtr->listIdxWindowId, FONT_NORMAL, gStringVar1, x, 1, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(structPtr->listIdxWindowId, FONT_NORMAL, gStringVar1, x, 1, TEXT_SKIP_DRAW, NULL);
CopyWindowToVram(structPtr->listIdxWindowId, 2); CopyWindowToVram(structPtr->listIdxWindowId, COPYWIN_GFX);
} }
static void ResetSpritesAndDrawMonFrontPic(struct PokenavSub14 *structPtr) static void ResetSpritesAndDrawMonFrontPic(struct PokenavSub14 *structPtr)
+14 -14
View File
@@ -1757,8 +1757,8 @@ static void DuoFight_LightningLong(void)
static void DuoFight_AnimateRain(void) static void DuoFight_AnimateRain(void)
{ {
ChangeBgX(2, 0x400, 1); ChangeBgX(2, 0x400, BG_COORD_ADD);
ChangeBgY(2, 0x800, 2); ChangeBgY(2, 0x800, BG_COORD_SUB);
} }
// Only used by the full version, which pans up at the end (so scene objects move down) // Only used by the full version, which pans up at the end (so scene objects move down)
@@ -1772,7 +1772,7 @@ static void DuoFight_PanOffScene(u8 taskId)
bgY = GetBgY(1); bgY = GetBgY(1);
if (GetBgY(1) == 0 || bgY > 0x8000) if (GetBgY(1) == 0 || bgY > 0x8000)
ChangeBgY(1, 0x400, 2); ChangeBgY(1, 0x400, BG_COORD_SUB);
if (tTimer != 16) if (tTimer != 16)
{ {
@@ -1795,7 +1795,7 @@ static void Task_DuoFightEnd(u8 taskId)
if (!gPaletteFade.active) if (!gPaletteFade.active)
{ {
DestroyTask(tHelperTaskId); DestroyTask(tHelperTaskId);
ChangeBgY(1, 0, 0); ChangeBgY(1, 0, BG_COORD_SET);
SetVBlankCallback(NULL); SetVBlankCallback(NULL);
ScanlineEffect_Stop(); ScanlineEffect_Stop();
ResetSpriteData(); ResetSpriteData();
@@ -2579,8 +2579,8 @@ static void Task_RayCharges_ShakeRayquaza(u8 taskId)
s16 *data = gTasks[taskId].data; s16 *data = gTasks[taskId].data;
if ((tTimer & 3) == 0) if ((tTimer & 3) == 0)
{ {
ChangeBgX(1, (Random() % 8 - 4) << 8, 0); ChangeBgX(1, (Random() % 8 - 4) << 8, BG_COORD_SET);
ChangeBgY(1, (Random() % 8 - 4) << 8, 0); ChangeBgY(1, (Random() % 8 - 4) << 8, BG_COORD_SET);
} }
tTimer++; tTimer++;
@@ -2592,16 +2592,16 @@ static void Task_RayCharges_FlyOffscreen(u8 taskId)
s16 *data = gTasks[taskId].data; s16 *data = gTasks[taskId].data;
if (tState == 0) if (tState == 0)
{ {
ChangeBgX(1, 0, 0); ChangeBgX(1, 0, BG_COORD_SET);
ChangeBgY(1, 0, 0); ChangeBgY(1, 0, BG_COORD_SET);
tState++; tState++;
tOffset = 10; tOffset = 10;
tShakeDir = -1; tShakeDir = -1;
} }
else if (tState == 1) else if (tState == 1)
{ {
ChangeBgX(1, tOffset << 8, 2); ChangeBgX(1, tOffset << 8, BG_COORD_SUB);
ChangeBgY(1, tOffset << 8, 1); ChangeBgY(1, tOffset << 8, BG_COORD_ADD);
tOffset += tShakeDir; tOffset += tShakeDir;
if (tOffset == -10) if (tOffset == -10)
tShakeDir *= -1; tShakeDir *= -1;
@@ -2616,12 +2616,12 @@ static void Task_RayCharges_FlyOffscreen(u8 taskId)
static void RayCharges_AnimateBg(void) static void RayCharges_AnimateBg(void)
{ {
// Update yellow orbs // Update yellow orbs
ChangeBgX(2, 0x400, 2); ChangeBgX(2, 0x400, BG_COORD_SUB);
ChangeBgY(2, 0x400, 1); ChangeBgY(2, 0x400, BG_COORD_ADD);
// Update blue streaks // Update blue streaks
ChangeBgX(0, 0x800, 2); ChangeBgX(0, 0x800, BG_COORD_SUB);
ChangeBgY(0, 0x800, 1); ChangeBgY(0, 0x800, BG_COORD_ADD);
} }
static void Task_RayChargesEnd(u8 taskId) static void Task_RayChargesEnd(u8 taskId)
+1 -1
View File
@@ -287,7 +287,7 @@ static void PrintTextOnRecordMixing(const u8 *src)
{ {
DrawDialogueFrame(0, 0); DrawDialogueFrame(0, 0);
AddTextPrinterParameterized(0, FONT_NORMAL, src, 0, 1, 0, NULL); AddTextPrinterParameterized(0, FONT_NORMAL, src, 0, 1, 0, NULL);
CopyWindowToVram(0, 3); CopyWindowToVram(0, COPYWIN_FULL);
} }
#define tCounter data[0] #define tCounter data[0]
+1 -1
View File
@@ -1819,7 +1819,7 @@ static void DrawFlyDestTextWindow(void)
DrawStdFrameWithCustomTileAndPalette(0, FALSE, 101, 13); DrawStdFrameWithCustomTileAndPalette(0, FALSE, 101, 13);
} }
FillWindowPixelBuffer(0, PIXEL_FILL(1)); FillWindowPixelBuffer(0, PIXEL_FILL(1));
CopyWindowToVram(0, 2); CopyWindowToVram(0, COPYWIN_GFX);
ScheduleBgCopyTilemapToVram(0); ScheduleBgCopyTilemapToVram(0);
sDrawFlyDestTextWindow = FALSE; sDrawFlyDestTextWindow = FALSE;
} }
+5 -5
View File
@@ -381,7 +381,7 @@ static void PrintTime(u8 windowId, u8 x, u8 y, u16 days, u8 hours, u8 minutes, u
ConvertIntToDecimalStringN(gStringVar1, seconds, STR_CONV_MODE_LEADING_ZEROS, 2); ConvertIntToDecimalStringN(gStringVar1, seconds, STR_CONV_MODE_LEADING_ZEROS, 2);
dest = StringCopy(dest, gStringVar1); dest = StringCopy(dest, gStringVar1);
AddTextPrinterParameterized(windowId, FONT_NORMAL, gStringVar4, x, y, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(windowId, FONT_NORMAL, gStringVar4, x, y, TEXT_SKIP_DRAW, NULL);
} }
static void ShowChooseTimeWindow(u8 windowId, u16 days, u8 hours, u8 minutes, u8 seconds) static void ShowChooseTimeWindow(u8 windowId, u16 days, u8 hours, u8 minutes, u8 seconds)
@@ -493,7 +493,7 @@ static void Task_ResetRtc_HandleInput(u8 taskId)
{ {
PlaySE(SE_SELECT); PlaySE(SE_SELECT);
PrintTime(tWindowId, 0, 1, tDays, tHours, tMinutes, tSeconds); PrintTime(tWindowId, 0, 1, tDays, tHours, tMinutes, tSeconds);
CopyWindowToVram(tWindowId, 2); CopyWindowToVram(tWindowId, COPYWIN_GFX);
} }
} }
@@ -578,7 +578,7 @@ static void Task_ShowResetRtcPrompt(u8 taskId)
case 0: case 0:
DrawStdFrameWithCustomTileAndPalette(0, FALSE, 0x214, 0xE); DrawStdFrameWithCustomTileAndPalette(0, FALSE, 0x214, 0xE);
AddTextPrinterParameterized(0, FONT_NORMAL, gText_PresentTime, 0, 1, TEXT_SPEED_FF, 0); AddTextPrinterParameterized(0, FONT_NORMAL, gText_PresentTime, 0, 1, TEXT_SKIP_DRAW, 0);
PrintTime( PrintTime(
0, 0,
0, 0,
@@ -588,7 +588,7 @@ static void Task_ShowResetRtcPrompt(u8 taskId)
gLocalTime.minutes, gLocalTime.minutes,
gLocalTime.seconds); gLocalTime.seconds);
AddTextPrinterParameterized(0, FONT_NORMAL, gText_PreviousTime, 0, 33, TEXT_SPEED_FF, 0); AddTextPrinterParameterized(0, FONT_NORMAL, gText_PreviousTime, 0, 33, TEXT_SKIP_DRAW, 0);
PrintTime( PrintTime(
0, 0,
0, 0,
@@ -599,7 +599,7 @@ static void Task_ShowResetRtcPrompt(u8 taskId)
gSaveBlock2Ptr->lastBerryTreeUpdate.seconds); gSaveBlock2Ptr->lastBerryTreeUpdate.seconds);
ShowMessage(gText_ResetRTCConfirmCancel); ShowMessage(gText_ResetRTCConfirmCancel);
CopyWindowToVram(0, 2); CopyWindowToVram(0, COPYWIN_GFX);
ScheduleBgCopyTilemapToVram(0); ScheduleBgCopyTilemapToVram(0);
tState++; tState++;
case 1: case 1:
+28 -28
View File
@@ -1223,8 +1223,8 @@ static void CB2_LoadRoulette(void)
SetMultiplierSprite(SELECTION_NONE); SetMultiplierSprite(SELECTION_NONE);
DrawGridBackground(SELECTION_NONE); DrawGridBackground(SELECTION_NONE);
DrawStdWindowFrame(sTextWindowId, FALSE); DrawStdWindowFrame(sTextWindowId, FALSE);
AddTextPrinterParameterized(sTextWindowId, FONT_NORMAL, Roulette_Text_ControlsInstruction, 0, 1, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(sTextWindowId, FONT_NORMAL, Roulette_Text_ControlsInstruction, 0, 1, TEXT_SKIP_DRAW, NULL);
CopyWindowToVram(sTextWindowId, 3); CopyWindowToVram(sTextWindowId, COPYWIN_FULL);
gSpriteCoordOffsetX = -60; gSpriteCoordOffsetX = -60;
gSpriteCoordOffsetY = 0; gSpriteCoordOffsetY = 0;
break; break;
@@ -1294,8 +1294,8 @@ static void Task_AskKeepPlaying(u8 taskId)
{ {
DisplayYesNoMenuDefaultYes(); DisplayYesNoMenuDefaultYes();
DrawStdWindowFrame(sTextWindowId, 0); DrawStdWindowFrame(sTextWindowId, 0);
AddTextPrinterParameterized(sTextWindowId, FONT_NORMAL, Roulette_Text_KeepPlaying, 0, 1, TEXT_SPEED_FF, 0); AddTextPrinterParameterized(sTextWindowId, FONT_NORMAL, Roulette_Text_KeepPlaying, 0, 1, TEXT_SKIP_DRAW, 0);
CopyWindowToVram(sTextWindowId, 3); CopyWindowToVram(sTextWindowId, COPYWIN_FULL);
DoYesNoFuncWithChoice(taskId, &sYesNoTable_KeepPlaying); DoYesNoFuncWithChoice(taskId, &sYesNoTable_KeepPlaying);
} }
@@ -1806,23 +1806,23 @@ static void Task_PrintSpinResult(u8 taskId)
{ {
PlayFanfare(MUS_SLOTS_JACKPOT); PlayFanfare(MUS_SLOTS_JACKPOT);
DrawStdWindowFrame(sTextWindowId, FALSE); DrawStdWindowFrame(sTextWindowId, FALSE);
AddTextPrinterParameterized(sTextWindowId, FONT_NORMAL, Roulette_Text_Jackpot, 0, 1, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(sTextWindowId, FONT_NORMAL, Roulette_Text_Jackpot, 0, 1, TEXT_SKIP_DRAW, NULL);
CopyWindowToVram(sTextWindowId, 3); CopyWindowToVram(sTextWindowId, COPYWIN_FULL);
} }
else else
{ {
PlayFanfare(MUS_SLOTS_WIN); PlayFanfare(MUS_SLOTS_WIN);
DrawStdWindowFrame(sTextWindowId, FALSE); DrawStdWindowFrame(sTextWindowId, FALSE);
AddTextPrinterParameterized(sTextWindowId, FONT_NORMAL, Roulette_Text_ItsAHit, 0, 1, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(sTextWindowId, FONT_NORMAL, Roulette_Text_ItsAHit, 0, 1, TEXT_SKIP_DRAW, NULL);
CopyWindowToVram(sTextWindowId, 3); CopyWindowToVram(sTextWindowId, COPYWIN_FULL);
} }
break; break;
case FALSE: case FALSE:
default: default:
m4aSongNumStart(SE_FAILURE); m4aSongNumStart(SE_FAILURE);
DrawStdWindowFrame(sTextWindowId, FALSE); DrawStdWindowFrame(sTextWindowId, FALSE);
AddTextPrinterParameterized(sTextWindowId, FONT_NORMAL, Roulette_Text_NothingDoing, 0, 1, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(sTextWindowId, FONT_NORMAL, Roulette_Text_NothingDoing, 0, 1, TEXT_SKIP_DRAW, NULL);
CopyWindowToVram(sTextWindowId, 3); CopyWindowToVram(sTextWindowId, COPYWIN_FULL);
break; break;
} }
gTasks[taskId].data[1] = 0; gTasks[taskId].data[1] = 0;
@@ -1866,8 +1866,8 @@ static void Task_PrintPayout(u8 taskId)
ConvertIntToDecimalStringN(gStringVar1, (sRoulette->minBet * gTasks[taskId].tMultiplier), STR_CONV_MODE_LEFT_ALIGN, 2); ConvertIntToDecimalStringN(gStringVar1, (sRoulette->minBet * gTasks[taskId].tMultiplier), STR_CONV_MODE_LEFT_ALIGN, 2);
StringExpandPlaceholders(gStringVar4, Roulette_Text_YouveWonXCoins); StringExpandPlaceholders(gStringVar4, Roulette_Text_YouveWonXCoins);
DrawStdWindowFrame(sTextWindowId, FALSE); DrawStdWindowFrame(sTextWindowId, FALSE);
AddTextPrinterParameterized(sTextWindowId, FONT_NORMAL, gStringVar4, 0, 1, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(sTextWindowId, FONT_NORMAL, gStringVar4, 0, 1, TEXT_SKIP_DRAW, NULL);
CopyWindowToVram(sTextWindowId, 3); CopyWindowToVram(sTextWindowId, COPYWIN_FULL);
gTasks[taskId].tPayout = (sRoulette->minBet * gTasks[taskId].tMultiplier); gTasks[taskId].tPayout = (sRoulette->minBet * gTasks[taskId].tMultiplier);
gTasks[taskId].data[7] = 0; gTasks[taskId].data[7] = 0;
gTasks[taskId].func = Task_GivePayout; gTasks[taskId].func = Task_GivePayout;
@@ -1902,16 +1902,16 @@ static void Task_TryPrintEndTurnMsg(u8 taskId)
{ {
// Reached Ball 6, clear board // Reached Ball 6, clear board
DrawStdWindowFrame(sTextWindowId, FALSE); DrawStdWindowFrame(sTextWindowId, FALSE);
AddTextPrinterParameterized(sTextWindowId, FONT_NORMAL, Roulette_Text_BoardWillBeCleared, 0, 1, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(sTextWindowId, FONT_NORMAL, Roulette_Text_BoardWillBeCleared, 0, 1, TEXT_SKIP_DRAW, NULL);
CopyWindowToVram(sTextWindowId, 3); CopyWindowToVram(sTextWindowId, COPYWIN_FULL);
StartTaskAfterDelayOrInput(taskId, Task_ClearBoard, NO_DELAY, A_BUTTON | B_BUTTON); StartTaskAfterDelayOrInput(taskId, Task_ClearBoard, NO_DELAY, A_BUTTON | B_BUTTON);
} }
else if (gTasks[taskId].tCoins == MAX_COINS) else if (gTasks[taskId].tCoins == MAX_COINS)
{ {
// Player maxed out coins // Player maxed out coins
DrawStdWindowFrame(sTextWindowId, FALSE); DrawStdWindowFrame(sTextWindowId, FALSE);
AddTextPrinterParameterized(sTextWindowId, FONT_NORMAL, Roulette_Text_CoinCaseIsFull, 0, 1, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(sTextWindowId, FONT_NORMAL, Roulette_Text_CoinCaseIsFull, 0, 1, TEXT_SKIP_DRAW, NULL);
CopyWindowToVram(sTextWindowId, 3); CopyWindowToVram(sTextWindowId, COPYWIN_FULL);
StartTaskAfterDelayOrInput(taskId, Task_AskKeepPlaying, NO_DELAY, A_BUTTON | B_BUTTON); StartTaskAfterDelayOrInput(taskId, Task_AskKeepPlaying, NO_DELAY, A_BUTTON | B_BUTTON);
} }
else else
@@ -1924,8 +1924,8 @@ static void Task_TryPrintEndTurnMsg(u8 taskId)
{ {
// Player out of coins // Player out of coins
DrawStdWindowFrame(sTextWindowId, FALSE); DrawStdWindowFrame(sTextWindowId, FALSE);
AddTextPrinterParameterized(sTextWindowId, FONT_NORMAL, Roulette_Text_NoCoinsLeft, 0, 1, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(sTextWindowId, FONT_NORMAL, Roulette_Text_NoCoinsLeft, 0, 1, TEXT_SKIP_DRAW, NULL);
CopyWindowToVram(sTextWindowId, 3); CopyWindowToVram(sTextWindowId, COPYWIN_FULL);
StartTaskAfterDelayOrInput(taskId, Task_StopPlaying, 60, A_BUTTON | B_BUTTON); StartTaskAfterDelayOrInput(taskId, Task_StopPlaying, 60, A_BUTTON | B_BUTTON);
} }
} }
@@ -1949,8 +1949,8 @@ static void Task_ClearBoard(u8 taskId)
if (gTasks[taskId].tCoins == MAX_COINS) if (gTasks[taskId].tCoins == MAX_COINS)
{ {
DrawStdWindowFrame(sTextWindowId, FALSE); DrawStdWindowFrame(sTextWindowId, FALSE);
AddTextPrinterParameterized(sTextWindowId, FONT_NORMAL, Roulette_Text_CoinCaseIsFull, 0, 1, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(sTextWindowId, FONT_NORMAL, Roulette_Text_CoinCaseIsFull, 0, 1, TEXT_SKIP_DRAW, NULL);
CopyWindowToVram(sTextWindowId, 3); CopyWindowToVram(sTextWindowId, COPYWIN_FULL);
StartTaskAfterDelayOrInput(taskId, Task_AskKeepPlaying, NO_DELAY, A_BUTTON | B_BUTTON); StartTaskAfterDelayOrInput(taskId, Task_AskKeepPlaying, NO_DELAY, A_BUTTON | B_BUTTON);
} }
else else
@@ -3426,8 +3426,8 @@ static void Task_PrintMinBet(u8 taskId)
ConvertIntToDecimalStringN(gStringVar1, minBet, STR_CONV_MODE_LEADING_ZEROS, 1); ConvertIntToDecimalStringN(gStringVar1, minBet, STR_CONV_MODE_LEADING_ZEROS, 1);
StringExpandPlaceholders(gStringVar4, Roulette_Text_PlayMinimumWagerIsX); StringExpandPlaceholders(gStringVar4, Roulette_Text_PlayMinimumWagerIsX);
DrawStdWindowFrame(0, FALSE); DrawStdWindowFrame(0, FALSE);
AddTextPrinterParameterized(0, FONT_NORMAL, gStringVar4, 0, 1, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(0, FONT_NORMAL, gStringVar4, 0, 1, TEXT_SKIP_DRAW, NULL);
CopyWindowToVram(0, 3); CopyWindowToVram(0, COPYWIN_FULL);
gTasks[taskId].func = Task_ShowMinBetYesNo; gTasks[taskId].func = Task_ShowMinBetYesNo;
} }
} }
@@ -3445,8 +3445,8 @@ static void Task_PrintRouletteEntryMsg(u8 taskId)
{ {
// Special rate for Game Corner service day (only at second table) // Special rate for Game Corner service day (only at second table)
DrawStdWindowFrame(0, FALSE); DrawStdWindowFrame(0, FALSE);
AddTextPrinterParameterized(0, FONT_NORMAL, Roulette_Text_SpecialRateTable, 0, 1, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(0, FONT_NORMAL, Roulette_Text_SpecialRateTable, 0, 1, TEXT_SKIP_DRAW, NULL);
CopyWindowToVram(0, 3); CopyWindowToVram(0, COPYWIN_FULL);
gTasks[taskId].func = Task_PrintMinBet; gTasks[taskId].func = Task_PrintMinBet;
} }
else else
@@ -3454,8 +3454,8 @@ static void Task_PrintRouletteEntryMsg(u8 taskId)
// Print minimum bet // Print minimum bet
StringExpandPlaceholders(gStringVar4, Roulette_Text_PlayMinimumWagerIsX); StringExpandPlaceholders(gStringVar4, Roulette_Text_PlayMinimumWagerIsX);
DrawStdWindowFrame(0, FALSE); DrawStdWindowFrame(0, FALSE);
AddTextPrinterParameterized(0, FONT_NORMAL, gStringVar4, 0, 1, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(0, FONT_NORMAL, gStringVar4, 0, 1, TEXT_SKIP_DRAW, NULL);
CopyWindowToVram(0, 3); CopyWindowToVram(0, COPYWIN_FULL);
gTasks[taskId].func = Task_ShowMinBetYesNo; gTasks[taskId].func = Task_ShowMinBetYesNo;
} }
} }
@@ -3464,8 +3464,8 @@ static void Task_PrintRouletteEntryMsg(u8 taskId)
// Not enough for minimum bet // Not enough for minimum bet
StringExpandPlaceholders(gStringVar4, Roulette_Text_NotEnoughCoins); StringExpandPlaceholders(gStringVar4, Roulette_Text_NotEnoughCoins);
DrawStdWindowFrame(0, FALSE); DrawStdWindowFrame(0, FALSE);
AddTextPrinterParameterized(0, FONT_NORMAL, gStringVar4, 0, 1, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(0, FONT_NORMAL, gStringVar4, 0, 1, TEXT_SKIP_DRAW, NULL);
CopyWindowToVram(0, 3); CopyWindowToVram(0, COPYWIN_FULL);
gTasks[taskId].func = Task_NotEnoughForMinBet; gTasks[taskId].func = Task_NotEnoughForMinBet;
gTasks[taskId].tCoins = 0; gTasks[taskId].tCoins = 0;
gTasks[taskId].data[0] = 0; gTasks[taskId].data[0] = 0;
+2 -2
View File
@@ -222,8 +222,8 @@ static void CB2_SaveFailedScreen(void)
DrawStdFrameWithCustomTileAndPalette(sWindowIds[CLOCK_WIN_ID], FALSE, 0x214, 0xE); DrawStdFrameWithCustomTileAndPalette(sWindowIds[CLOCK_WIN_ID], FALSE, 0x214, 0xE);
FillWindowPixelBuffer(sWindowIds[CLOCK_WIN_ID], PIXEL_FILL(1)); // backwards? FillWindowPixelBuffer(sWindowIds[CLOCK_WIN_ID], PIXEL_FILL(1)); // backwards?
FillWindowPixelBuffer(sWindowIds[TEXT_WIN_ID], PIXEL_FILL(1)); FillWindowPixelBuffer(sWindowIds[TEXT_WIN_ID], PIXEL_FILL(1));
CopyWindowToVram(sWindowIds[CLOCK_WIN_ID], 2); // again? CopyWindowToVram(sWindowIds[CLOCK_WIN_ID], COPYWIN_GFX); // again?
CopyWindowToVram(sWindowIds[TEXT_WIN_ID], 1); CopyWindowToVram(sWindowIds[TEXT_WIN_ID], COPYWIN_MAP);
SaveFailedScreenTextPrint(gText_SaveFailedCheckingBackup, 1, 0); SaveFailedScreenTextPrint(gText_SaveFailedCheckingBackup, 1, 0);
BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_BLACK); BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_BLACK);
EnableInterrupts(1); EnableInterrupts(1);
+4 -3
View File
@@ -49,6 +49,7 @@
#include "tv.h" #include "tv.h"
#include "window.h" #include "window.h"
#include "constants/event_objects.h" #include "constants/event_objects.h"
#include "constants/maps.h"
typedef u16 (*SpecialFunc)(void); typedef u16 (*SpecialFunc)(void);
typedef void (*NativeFunc)(void); typedef void (*NativeFunc)(void);
@@ -790,7 +791,7 @@ bool8 ScrCmd_warphole(struct ScriptContext *ctx)
u16 y; u16 y;
PlayerGetDestCoords(&x, &y); PlayerGetDestCoords(&x, &y);
if (mapGroup == 0xFF && mapNum == 0xFF) if (mapGroup == MAP_GROUP(UNDEFINED) && mapNum == MAP_NUM(UNDEFINED))
SetWarpDestinationToFixedHoleWarp(x - MAP_OFFSET, y - MAP_OFFSET); SetWarpDestinationToFixedHoleWarp(x - MAP_OFFSET, y - MAP_OFFSET);
else else
SetWarpDestination(mapGroup, mapNum, -1, x - MAP_OFFSET, y - MAP_OFFSET); SetWarpDestination(mapGroup, mapNum, -1, x - MAP_OFFSET, y - MAP_OFFSET);
@@ -1532,8 +1533,8 @@ bool8 ScrCmd_braillemessage(struct ScriptContext *ctx)
DrawStdWindowFrame(gBrailleWindowId, 0); DrawStdWindowFrame(gBrailleWindowId, 0);
PutWindowTilemap(gBrailleWindowId); PutWindowTilemap(gBrailleWindowId);
FillWindowPixelBuffer(gBrailleWindowId, PIXEL_FILL(1)); FillWindowPixelBuffer(gBrailleWindowId, PIXEL_FILL(1));
AddTextPrinterParameterized(gBrailleWindowId, FONT_BRAILLE, gStringVar4, xText, yText, 0xFF, 0x0); AddTextPrinterParameterized(gBrailleWindowId, FONT_BRAILLE, gStringVar4, xText, yText, TEXT_SKIP_DRAW, NULL);
CopyWindowToVram(gBrailleWindowId, 3); CopyWindowToVram(gBrailleWindowId, COPYWIN_FULL);
return FALSE; return FALSE;
} }
+24 -24
View File
@@ -109,7 +109,7 @@ static void DrawMultichoiceMenu(u8 left, u8 top, u8 multichoiceId, bool8 ignoreB
windowId = CreateWindowFromRect(left, top, newWidth, count * 2); windowId = CreateWindowFromRect(left, top, newWidth, count * 2);
SetStandardWindowBorderStyle(windowId, 0); SetStandardWindowBorderStyle(windowId, 0);
PrintMenuTable(windowId, count, actions); PrintMenuTable(windowId, count, actions);
InitMenuInUpperLeftCornerPlaySoundWhenAPressed(windowId, count, cursorPos); InitMenuInUpperLeftCornerNormal(windowId, count, cursorPos);
ScheduleBgCopyTilemapToVram(0); ScheduleBgCopyTilemapToVram(0);
InitMultichoiceCheckWrap(ignoreBPress, count, windowId, multichoiceId); InitMultichoiceCheckWrap(ignoreBPress, count, windowId, multichoiceId);
} }
@@ -280,7 +280,7 @@ bool8 ScriptMenu_MultichoiceGrid(u8 left, u8 top, u8 multichoiceId, bool8 ignore
SetStandardWindowBorderStyle(gTasks[taskId].tWindowId, 0); SetStandardWindowBorderStyle(gTasks[taskId].tWindowId, 0);
PrintMenuGridTable(gTasks[taskId].tWindowId, newWidth * 8, columnCount, rowCount, sMultichoiceLists[multichoiceId].list); PrintMenuGridTable(gTasks[taskId].tWindowId, newWidth * 8, columnCount, rowCount, sMultichoiceLists[multichoiceId].list);
InitMenuActionGrid(gTasks[taskId].tWindowId, newWidth * 8, columnCount, rowCount, 0); InitMenuActionGrid(gTasks[taskId].tWindowId, newWidth * 8, columnCount, rowCount, 0);
CopyWindowToVram(gTasks[taskId].tWindowId, 3); CopyWindowToVram(gTasks[taskId].tWindowId, COPYWIN_FULL);
return TRUE; return TRUE;
} }
} }
@@ -288,7 +288,7 @@ bool8 ScriptMenu_MultichoiceGrid(u8 left, u8 top, u8 multichoiceId, bool8 ignore
static void Task_HandleMultichoiceGridInput(u8 taskId) static void Task_HandleMultichoiceGridInput(u8 taskId)
{ {
s16 *data = gTasks[taskId].data; s16 *data = gTasks[taskId].data;
s8 selection = Menu_ProcessInputGridLayout(); s8 selection = Menu_ProcessGridInput();
switch (selection) switch (selection)
{ {
@@ -353,33 +353,33 @@ static void CreatePCMultichoice(void)
numChoices = 4; numChoices = 4;
windowId = CreateWindowFromRect(0, 0, width, 8); windowId = CreateWindowFromRect(0, 0, width, 8);
SetStandardWindowBorderStyle(windowId, 0); SetStandardWindowBorderStyle(windowId, 0);
AddTextPrinterParameterized(windowId, FONT_NORMAL, gText_HallOfFame, y, 33, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(windowId, FONT_NORMAL, gText_HallOfFame, y, 33, TEXT_SKIP_DRAW, NULL);
AddTextPrinterParameterized(windowId, FONT_NORMAL, gText_LogOff, y, 49, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(windowId, FONT_NORMAL, gText_LogOff, y, 49, TEXT_SKIP_DRAW, NULL);
} }
else else
{ {
numChoices = 3; numChoices = 3;
windowId = CreateWindowFromRect(0, 0, width, 6); windowId = CreateWindowFromRect(0, 0, width, 6);
SetStandardWindowBorderStyle(windowId, 0); SetStandardWindowBorderStyle(windowId, 0);
AddTextPrinterParameterized(windowId, FONT_NORMAL, gText_LogOff, y, 33, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(windowId, FONT_NORMAL, gText_LogOff, y, 33, TEXT_SKIP_DRAW, NULL);
} }
// Change PC name if player has met Lanette // Change PC name if player has met Lanette
if (FlagGet(FLAG_SYS_PC_LANETTE)) if (FlagGet(FLAG_SYS_PC_LANETTE))
AddTextPrinterParameterized(windowId, FONT_NORMAL, gText_LanettesPC, y, 1, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(windowId, FONT_NORMAL, gText_LanettesPC, y, 1, TEXT_SKIP_DRAW, NULL);
else else
AddTextPrinterParameterized(windowId, FONT_NORMAL, gText_SomeonesPC, y, 1, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(windowId, FONT_NORMAL, gText_SomeonesPC, y, 1, TEXT_SKIP_DRAW, NULL);
StringExpandPlaceholders(gStringVar4, gText_PlayersPC); StringExpandPlaceholders(gStringVar4, gText_PlayersPC);
PrintPlayerNameOnWindow(windowId, gStringVar4, y, 17); PrintPlayerNameOnWindow(windowId, gStringVar4, y, 17);
InitMenuInUpperLeftCornerPlaySoundWhenAPressed(windowId, numChoices, 0); InitMenuInUpperLeftCornerNormal(windowId, numChoices, 0);
CopyWindowToVram(windowId, 3); CopyWindowToVram(windowId, COPYWIN_FULL);
InitMultichoiceCheckWrap(FALSE, numChoices, windowId, MULTI_PC); InitMultichoiceCheckWrap(FALSE, numChoices, windowId, MULTI_PC);
} }
void ScriptMenu_DisplayPCStartupPrompt(void) void ScriptMenu_DisplayPCStartupPrompt(void)
{ {
sub_819786C(0, TRUE); LoadMessageBoxAndFrameGfx(0, TRUE);
AddTextPrinterParameterized2(0, FONT_NORMAL, gText_WhichPCShouldBeAccessed, 0, NULL, 2, 1, 3); AddTextPrinterParameterized2(0, FONT_NORMAL, gText_WhichPCShouldBeAccessed, 0, NULL, 2, 1, 3);
} }
@@ -527,13 +527,13 @@ static void CreateLilycoveSSTidalMultichoice(void)
{ {
if (sLilycoveSSTidalSelections[i] != 0xFF) if (sLilycoveSSTidalSelections[i] != 0xFF)
{ {
AddTextPrinterParameterized(windowId, FONT_NORMAL, sLilycoveSSTidalDestinations[sLilycoveSSTidalSelections[i]], 8, selectionCount * 16 + 1, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(windowId, FONT_NORMAL, sLilycoveSSTidalDestinations[sLilycoveSSTidalSelections[i]], 8, selectionCount * 16 + 1, TEXT_SKIP_DRAW, NULL);
selectionCount++; selectionCount++;
} }
} }
InitMenuInUpperLeftCornerPlaySoundWhenAPressed(windowId, count, count - 1); InitMenuInUpperLeftCornerNormal(windowId, count, count - 1);
CopyWindowToVram(windowId, 3); CopyWindowToVram(windowId, COPYWIN_FULL);
InitMultichoiceCheckWrap(FALSE, count, windowId, MULTI_SSTIDAL_LILYCOVE); InitMultichoiceCheckWrap(FALSE, count, windowId, MULTI_SSTIDAL_LILYCOVE);
} }
} }
@@ -688,17 +688,17 @@ static void CreateStartMenuForPokenavTutorial(void)
{ {
u8 windowId = CreateWindowFromRect(21, 0, 7, 18); u8 windowId = CreateWindowFromRect(21, 0, 7, 18);
SetStandardWindowBorderStyle(windowId, 0); SetStandardWindowBorderStyle(windowId, 0);
AddTextPrinterParameterized(windowId, FONT_NORMAL, gText_MenuOptionPokedex, 8, 9, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(windowId, FONT_NORMAL, gText_MenuOptionPokedex, 8, 9, TEXT_SKIP_DRAW, NULL);
AddTextPrinterParameterized(windowId, FONT_NORMAL, gText_MenuOptionPokemon, 8, 25, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(windowId, FONT_NORMAL, gText_MenuOptionPokemon, 8, 25, TEXT_SKIP_DRAW, NULL);
AddTextPrinterParameterized(windowId, FONT_NORMAL, gText_MenuOptionBag, 8, 41, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(windowId, FONT_NORMAL, gText_MenuOptionBag, 8, 41, TEXT_SKIP_DRAW, NULL);
AddTextPrinterParameterized(windowId, FONT_NORMAL, gText_MenuOptionPokenav, 8, 57, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(windowId, FONT_NORMAL, gText_MenuOptionPokenav, 8, 57, TEXT_SKIP_DRAW, NULL);
AddTextPrinterParameterized(windowId, FONT_NORMAL, gSaveBlock2Ptr->playerName, 8, 73, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(windowId, FONT_NORMAL, gSaveBlock2Ptr->playerName, 8, 73, TEXT_SKIP_DRAW, NULL);
AddTextPrinterParameterized(windowId, FONT_NORMAL, gText_MenuOptionSave, 8, 89, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(windowId, FONT_NORMAL, gText_MenuOptionSave, 8, 89, TEXT_SKIP_DRAW, NULL);
AddTextPrinterParameterized(windowId, FONT_NORMAL, gText_MenuOptionOption, 8, 105, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(windowId, FONT_NORMAL, gText_MenuOptionOption, 8, 105, TEXT_SKIP_DRAW, NULL);
AddTextPrinterParameterized(windowId, FONT_NORMAL, gText_MenuOptionExit, 8, 121, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(windowId, FONT_NORMAL, gText_MenuOptionExit, 8, 121, TEXT_SKIP_DRAW, NULL);
sub_81983AC(windowId, FONT_NORMAL, 0, 9, 16, ARRAY_COUNT(MultichoiceList_ForcedStartMenu), 0); InitMenuNormal(windowId, FONT_NORMAL, 0, 9, 16, ARRAY_COUNT(MultichoiceList_ForcedStartMenu), 0);
InitMultichoiceNoWrap(FALSE, ARRAY_COUNT(MultichoiceList_ForcedStartMenu), windowId, MULTI_FORCED_START_MENU); InitMultichoiceNoWrap(FALSE, ARRAY_COUNT(MultichoiceList_ForcedStartMenu), windowId, MULTI_FORCED_START_MENU);
CopyWindowToVram(windowId, 3); CopyWindowToVram(windowId, COPYWIN_FULL);
} }
#define tWindowId data[6] #define tWindowId data[6]
+1 -1
View File
@@ -1028,7 +1028,7 @@ static void ShowRegistryMenuActions(u8 taskId)
tActionWindowId = AddWindow(&template); tActionWindowId = AddWindow(&template);
SetStandardWindowBorderStyle(tActionWindowId, 0); SetStandardWindowBorderStyle(tActionWindowId, 0);
PrintMenuTable(tActionWindowId, ARRAY_COUNT(sRegistryMenuActions), sRegistryMenuActions); PrintMenuTable(tActionWindowId, ARRAY_COUNT(sRegistryMenuActions), sRegistryMenuActions);
InitMenuInUpperLeftCornerPlaySoundWhenAPressed(tActionWindowId, 2, 0); InitMenuInUpperLeftCornerNormal(tActionWindowId, 2, 0);
ScheduleBgCopyTilemapToVram(0); ScheduleBgCopyTilemapToVram(0);
gTasks[taskId].func = HandleRegistryMenuActionsInput; gTasks[taskId].func = HandleRegistryMenuActionsInput;
} }
+4 -4
View File
@@ -301,9 +301,9 @@ static u8 CreateShopMenu(u8 martType)
SetStandardWindowBorderStyle(sMartInfo.windowId, 0); SetStandardWindowBorderStyle(sMartInfo.windowId, 0);
PrintMenuTable(sMartInfo.windowId, numMenuItems, sMartInfo.menuActions); PrintMenuTable(sMartInfo.windowId, numMenuItems, sMartInfo.menuActions);
InitMenuInUpperLeftCornerPlaySoundWhenAPressed(sMartInfo.windowId, numMenuItems, 0); InitMenuInUpperLeftCornerNormal(sMartInfo.windowId, numMenuItems, 0);
PutWindowTilemap(sMartInfo.windowId); PutWindowTilemap(sMartInfo.windowId);
CopyWindowToVram(sMartInfo.windowId, 1); CopyWindowToVram(sMartInfo.windowId, COPYWIN_MAP);
return CreateTask(Task_ShopMenu, 8); return CreateTask(Task_ShopMenu, 8);
} }
@@ -577,7 +577,7 @@ static void BuyMenuPrintPriceInList(u8 windowId, u32 itemId, u8 y)
StringExpandPlaceholders(gStringVar4, gText_PokedollarVar1); StringExpandPlaceholders(gStringVar4, gText_PokedollarVar1);
x = GetStringRightAlignXOffset(FONT_NARROW, gStringVar4, 0x78); x = GetStringRightAlignXOffset(FONT_NARROW, gStringVar4, 0x78);
AddTextPrinterParameterized4(windowId, FONT_NARROW, x, y, 0, 0, sShopBuyMenuTextColors[1], -1, gStringVar4); AddTextPrinterParameterized4(windowId, FONT_NARROW, x, y, 0, 0, sShopBuyMenuTextColors[1], TEXT_SKIP_DRAW, gStringVar4);
} }
} }
@@ -1145,7 +1145,7 @@ static void BuyMenuPrintItemQuantityAndPrice(u8 taskId)
s16 *data = gTasks[taskId].data; s16 *data = gTasks[taskId].data;
FillWindowPixelBuffer(4, PIXEL_FILL(1)); FillWindowPixelBuffer(4, PIXEL_FILL(1));
PrintMoneyAmount(4, 38, 1, sShopData->totalCost, TEXT_SPEED_FF); PrintMoneyAmount(4, 38, 1, sShopData->totalCost, TEXT_SKIP_DRAW);
ConvertIntToDecimalStringN(gStringVar1, tItemCount, STR_CONV_MODE_LEADING_ZEROS, BAG_ITEM_CAPACITY_DIGITS); ConvertIntToDecimalStringN(gStringVar1, tItemCount, STR_CONV_MODE_LEADING_ZEROS, BAG_ITEM_CAPACITY_DIGITS);
StringExpandPlaceholders(gStringVar4, gText_xVar1); StringExpandPlaceholders(gStringVar4, gText_xVar1);
BuyMenuPrint(4, gStringVar4, 0, 1, 0, 0); BuyMenuPrint(4, gStringVar4, 0, 1, 0, 0);

Some files were not shown because too many files have changed in this diff Show More