Add DISPLAY_TILE_* constants

This commit is contained in:
GriffinR 2022-09-26 12:22:27 -04:00
parent b8bf9dea56
commit e515e52abb
18 changed files with 65 additions and 62 deletions

View File

@ -67,6 +67,9 @@
#define DISPLAY_WIDTH 240
#define DISPLAY_HEIGHT 160
#define DISPLAY_TILE_WIDTH (DISPLAY_WIDTH / 8)
#define DISPLAY_TILE_HEIGHT (DISPLAY_HEIGHT / 8)
#define TILE_SIZE_4BPP 32
#define TILE_SIZE_8BPP 64

View File

@ -1008,7 +1008,7 @@ static bool8 LoadBerryBlenderGfx(void)
static void DrawBlenderBg(void)
{
FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 0x1E, 0x14);
FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT);
CopyBgTilemapBufferToVram(0);
ShowBg(0);
ShowBg(1);
@ -1029,7 +1029,7 @@ static void InitBerryBlenderWindows(void)
for (i = 0; i < 5; i++)
FillWindowPixelBuffer(i, PIXEL_FILL(0));
FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 0x1E, 0x14);
FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT);
Menu_LoadStdPalAt(0xE0);
}
}

View File

@ -1167,24 +1167,24 @@ static void TryCreateWirelessSprites(void)
static s32 DrawResultsTextWindow(const u8 *text, u8 spriteId)
{
u16 windowId;
int origWidth;
int tileWidth;
int strWidth;
u8 *spriteTilePtrs[4];
u8 *dst;
struct WindowTemplate windowTemplate;
memset(&windowTemplate, 0, sizeof(windowTemplate));
windowTemplate.width = 30;
windowTemplate.width = DISPLAY_TILE_WIDTH;
windowTemplate.height = 2;
windowId = AddWindow(&windowTemplate);
FillWindowPixelBuffer(windowId, PIXEL_FILL(1));
origWidth = GetStringWidth(FONT_NORMAL, text, 0);
strWidth = (origWidth + 9) / 8;
if (strWidth > 30)
strWidth = 30;
strWidth = GetStringWidth(FONT_NORMAL, text, 0);
tileWidth = (strWidth + 9) / 8;
if (tileWidth > DISPLAY_TILE_WIDTH)
tileWidth = DISPLAY_TILE_WIDTH;
AddTextPrinterParameterized3(windowId, FONT_NORMAL, (strWidth * 8 - origWidth) / 2, 1, sContestLinkTextColors, TEXT_SKIP_DRAW, text);
AddTextPrinterParameterized3(windowId, FONT_NORMAL, (tileWidth * 8 - strWidth) / 2, 1, sContestLinkTextColors, TEXT_SKIP_DRAW, text);
{
s32 i;
struct Sprite *sprite;
@ -1207,7 +1207,7 @@ static s32 DrawResultsTextWindow(const u8 *text, u8 spriteId)
CpuCopy32(src + 128, dst + 0x200, 0x20);
CpuCopy32(src + 64, dst + 0x300, 0x20);
for (i = 0; i < strWidth; i++)
for (i = 0; i < tileWidth; i++)
{
dst = &spriteTilePtrs[(i + 1) / 8][((i + 1) % 8) * 32];
CpuCopy32(src + 192, dst, 0x20);
@ -1225,7 +1225,7 @@ static s32 DrawResultsTextWindow(const u8 *text, u8 spriteId)
}
RemoveWindow(windowId);
return (DISPLAY_WIDTH - (strWidth + 2) * 8) / 2;
return (DISPLAY_WIDTH - (tileWidth + 2) * 8) / 2;
}
static void CreateResultsTextWindowSprites(void)

View File

@ -183,7 +183,7 @@ static const struct WindowTemplate sWindowTemplates[] =
.bg = 0,
.tilemapLeft = 0,
.tilemapTop = 9,
.width = 30,
.width = DISPLAY_TILE_WIDTH,
.height = 12,
.paletteNum = 8,
.baseBlock = 1

View File

@ -4675,7 +4675,7 @@ static void ShowNames(void)
ClearWindowTilemap(sGfx->windowIds[i]);
RemoveWindow(sGfx->windowIds[i]);
}
FillBgTilemapBufferRect_Palette0(BG_INTERFACE, 0, 0, 0, 30, 20);
FillBgTilemapBufferRect_Palette0(BG_INTERFACE, 0, 0, 0, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT);
CopyBgTilemapBufferToVram(BG_INTERFACE);
sGfx->finished = TRUE;
}
@ -4859,7 +4859,7 @@ static void ShowResults(void)
sGfx->state++;
}
FillBgTilemapBufferRect_Palette0(BG_INTERFACE, 0, 0, 5, 30, 15);
FillBgTilemapBufferRect_Palette0(BG_INTERFACE, 0, 0, 5, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT - 5);
RemoveWindow(sGfx->windowIds[1]);
sGfx->windowIds[1] = AddWindow(&sWindowTemplate_Prize);
ClearWindowTilemap(sGfx->windowIds[1]);
@ -4917,7 +4917,7 @@ static void ShowResults(void)
ClearWindowTilemap(sGfx->windowIds[1]);
RemoveWindow(sGfx->windowIds[0]);
RemoveWindow(sGfx->windowIds[1]);
FillBgTilemapBufferRect_Palette0(BG_INTERFACE, 0, 0, 0, 30, 20);
FillBgTilemapBufferRect_Palette0(BG_INTERFACE, 0, 0, 0, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT);
CopyBgTilemapBufferToVram(BG_INTERFACE);
sGfx->finished = TRUE;
break;
@ -5012,7 +5012,7 @@ static void Msg_WantToPlayAgain(void)
ClearWindowTilemap(sGfx->windowIds[WIN_YES_NO]);
RemoveWindow(sGfx->windowIds[WIN_PLAY_AGAIN]);
RemoveWindow(sGfx->windowIds[WIN_YES_NO]);
FillBgTilemapBufferRect_Palette0(BG_INTERFACE, 0, 0, 0, 30, 20);
FillBgTilemapBufferRect_Palette0(BG_INTERFACE, 0, 0, 0, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT);
CopyBgTilemapBufferToVram(BG_INTERFACE);
sGfx->finished = TRUE;
break;
@ -5044,7 +5044,7 @@ static void Msg_SavingDontTurnOff(void)
sGfx->state++;
break;
default:
FillBgTilemapBufferRect_Palette0(BG_INTERFACE, 0, 0, 0, 30, 20);
FillBgTilemapBufferRect_Palette0(BG_INTERFACE, 0, 0, 0, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT);
CopyBgTilemapBufferToVram(BG_INTERFACE);
sGfx->finished = TRUE;
break;
@ -5083,7 +5083,7 @@ static void EraseMessage(void)
{
ClearWindowTilemap(sGfx->windowIds[0]);
RemoveWindow(sGfx->windowIds[0]);
FillBgTilemapBufferRect_Palette0(BG_INTERFACE, 0, 0, 0, 30, 20);
FillBgTilemapBufferRect_Palette0(BG_INTERFACE, 0, 0, 0, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT);
CopyBgTilemapBufferToVram(BG_INTERFACE);
sGfx->finished = TRUE;
}
@ -5121,7 +5121,7 @@ static void Msg_SomeoneDroppedOut(void)
sGfx->playAgainState = PLAY_AGAIN_DROPPED;
ClearWindowTilemap(sGfx->windowIds[0]);
RemoveWindow(sGfx->windowIds[0]);
FillBgTilemapBufferRect_Palette0(BG_INTERFACE, 0, 0, 0, 30, 20);
FillBgTilemapBufferRect_Palette0(BG_INTERFACE, 0, 0, 0, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT);
CopyBgTilemapBufferToVram(BG_INTERFACE);
sGfx->finished = TRUE;
break;

View File

@ -1136,7 +1136,7 @@ static void Task_OrbEffect(u8 taskId)
SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(12, 7));
SetGpuReg(REG_OFFSET_WININ, WININ_WIN0_BG_ALL | WININ_WIN0_OBJ | WININ_WIN0_CLR);
SetGpuReg(REG_OFFSET_WINOUT, WINOUT_WIN01_BG1 | WINOUT_WIN01_BG2 | WINOUT_WIN01_BG3 | WINOUT_WIN01_OBJ);
SetBgTilemapPalette(0, 0, 0, 0x1E, 0x14, 0xF);
SetBgTilemapPalette(0, 0, 0, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT, 0xF);
ScheduleBgCopyTilemapToVram(0);
SetOrbFlashScanlineEffectWindowBoundaries(&gScanlineEffectRegBuffers[0][0], tCenterX, tCenterY, 1);
CpuFastSet(&gScanlineEffectRegBuffers[0], &gScanlineEffectRegBuffers[1], 480);

View File

@ -760,9 +760,9 @@ static bool32 InitFrontierPass(void)
case 7:
if (FreeTempTileDataBuffersIfPossible())
return FALSE;
FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 30, 20);
FillBgTilemapBufferRect_Palette0(1, 0, 0, 0, 30, 20);
FillBgTilemapBufferRect_Palette0(2, 0, 0, 0, 30, 20);
FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT);
FillBgTilemapBufferRect_Palette0(1, 0, 0, 0, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT);
FillBgTilemapBufferRect_Palette0(2, 0, 0, 0, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT);
CopyBgTilemapBufferToVram(0);
CopyBgTilemapBufferToVram(1);
CopyBgTilemapBufferToVram(2);
@ -1396,9 +1396,9 @@ static bool32 InitFrontierMap(void)
SetBgTilemapBuffer(0, sMapData->tilemapBuff0);
SetBgTilemapBuffer(1, sMapData->tilemapBuff1);
SetBgTilemapBuffer(2, sMapData->tilemapBuff2);
FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 30, 20);
FillBgTilemapBufferRect_Palette0(1, 0, 0, 0, 30, 20);
FillBgTilemapBufferRect_Palette0(2, 0, 0, 0, 30, 20);
FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT);
FillBgTilemapBufferRect_Palette0(1, 0, 0, 0, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT);
FillBgTilemapBufferRect_Palette0(2, 0, 0, 0, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT);
CopyBgTilemapBufferToVram(0);
CopyBgTilemapBufferToVram(1);
CopyBgTilemapBufferToVram(2);

View File

@ -198,7 +198,7 @@ static const struct WindowTemplate sLinkErrorWindowTemplates[] = {
.bg = 0,
.tilemapLeft = 0,
.tilemapTop = 0,
.width = 30,
.width = DISPLAY_TILE_WIDTH,
.height = 5,
.paletteNum = 15,
.baseBlock = 0x002
@ -206,7 +206,7 @@ static const struct WindowTemplate sLinkErrorWindowTemplates[] = {
.bg = 0,
.tilemapLeft = 0,
.tilemapTop = 6,
.width = 30,
.width = DISPLAY_TILE_WIDTH,
.height = 7,
.paletteNum = 15,
.baseBlock = 0x098
@ -214,7 +214,7 @@ static const struct WindowTemplate sLinkErrorWindowTemplates[] = {
.bg = 0,
.tilemapLeft = 0,
.tilemapTop = 13,
.width = 30,
.width = DISPLAY_TILE_WIDTH,
.height = 7,
.paletteNum = 15,
.baseBlock = 0x16A

View File

@ -556,8 +556,8 @@ static bool8 MailReadBuildGraphics(void)
}
break;
case 10:
FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 30, 20);
FillBgTilemapBufferRect_Palette0(2, 1, 0, 0, 30, 20);
FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT);
FillBgTilemapBufferRect_Palette0(2, 1, 0, 0, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT);
CopyToBgTilemapBuffer(1, sMailGraphics[sMailRead->mailType].tileMap, 0, 0);
break;
case 11:

View File

@ -1121,7 +1121,7 @@ static void Task_DisplayMainMenuInvalidActionError(u8 taskId)
switch (gTasks[taskId].tCurrItem)
{
case 0:
FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 30, 20);
FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT);
switch (gTasks[taskId].tMenuType)
{
case 0:

View File

@ -90,7 +90,7 @@ void CB2_InitMysteryEventMenu(void)
for (i = 0; i < 2; i++)
FillWindowPixelBuffer(i, PIXEL_FILL(0));
FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 0x1E, 0x14);
FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT);
LoadUserWindowBorderGfx(0, 1u, 0xD0u);
Menu_LoadStdPalAt(0xE0);
SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_MODE_0 | DISPCNT_OBJ_1D_MAP | DISPCNT_BG0_ON);

View File

@ -102,7 +102,7 @@ static const struct WindowTemplate sMainWindows[] = {
.bg = 0,
.tilemapLeft = 0,
.tilemapTop = 0,
.width = 30,
.width = DISPLAY_TILE_WIDTH,
.height = 2,
.paletteNum = 12,
.baseBlock = 0x0013
@ -118,7 +118,7 @@ static const struct WindowTemplate sMainWindows[] = {
.bg = 0,
.tilemapLeft = 0,
.tilemapTop = 15,
.width = 30,
.width = DISPLAY_TILE_WIDTH,
.height = 5,
.paletteNum = 13,
.baseBlock = 0x004f

View File

@ -226,9 +226,9 @@ s32 WonderCard_Enter(void)
return 0;
break;
case 2:
FillBgTilemapBufferRect_Palette0(0, 0x000, 0, 0, 30, 20);
FillBgTilemapBufferRect_Palette0(1, 0x000, 0, 0, 30, 20);
FillBgTilemapBufferRect_Palette0(2, 0x000, 0, 0, 30, 20);
FillBgTilemapBufferRect_Palette0(0, 0x000, 0, 0, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT);
FillBgTilemapBufferRect_Palette0(1, 0x000, 0, 0, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT);
FillBgTilemapBufferRect_Palette0(2, 0x000, 0, 0, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT);
CopyBgTilemapBufferToVram(0);
CopyBgTilemapBufferToVram(1);
CopyBgTilemapBufferToVram(2);
@ -244,7 +244,7 @@ s32 WonderCard_Enter(void)
gPaletteFade.bufferTransferDisabled = TRUE;
LoadPalette(sWonderCardData->gfx->pal, 0x10, 0x20);
LZ77UnCompWram(sWonderCardData->gfx->map, sWonderCardData->bgTilemapBuffer);
CopyRectToBgTilemapBufferRect(2, sWonderCardData->bgTilemapBuffer, 0, 0, 30, 20, 0, 0, 30, 20, 1, 0x008, 0);
CopyRectToBgTilemapBufferRect(2, sWonderCardData->bgTilemapBuffer, 0, 0, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT, 0, 0, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT, 1, 0x008, 0);
CopyBgTilemapBufferToVram(2);
break;
case 4:
@ -291,9 +291,9 @@ s32 WonderCard_Exit(bool32 useCancel)
return 0;
break;
case 2:
FillBgTilemapBufferRect_Palette0(0, 0x000, 0, 0, 30, 20);
FillBgTilemapBufferRect_Palette0(1, 0x000, 0, 0, 30, 20);
FillBgTilemapBufferRect_Palette0(2, 0x000, 0, 0, 30, 20);
FillBgTilemapBufferRect_Palette0(0, 0x000, 0, 0, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT);
FillBgTilemapBufferRect_Palette0(1, 0x000, 0, 0, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT);
FillBgTilemapBufferRect_Palette0(2, 0x000, 0, 0, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT);
CopyBgTilemapBufferToVram(0);
CopyBgTilemapBufferToVram(1);
CopyBgTilemapBufferToVram(2);
@ -595,7 +595,7 @@ static const struct WindowTemplate sNews_WindowTemplates[] = {
.tilemapLeft = 1,
.tilemapTop = 3,
.width = 28,
.height = 20,
.height = DISPLAY_TILE_HEIGHT,
.paletteNum = 2,
.baseBlock = 0x07C
}
@ -688,10 +688,10 @@ s32 WonderNews_Enter(void)
SetGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_WIN0_ON);
break;
case 2:
FillBgTilemapBufferRect_Palette0(0, 0x000, 0, 0, 30, 20);
FillBgTilemapBufferRect_Palette0(1, 0x000, 0, 0, 30, 20);
FillBgTilemapBufferRect_Palette0(2, 0x000, 0, 0, 30, 20);
FillBgTilemapBufferRect_Palette0(3, 0x000, 0, 0, 30, 20);
FillBgTilemapBufferRect_Palette0(0, 0x000, 0, 0, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT);
FillBgTilemapBufferRect_Palette0(1, 0x000, 0, 0, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT);
FillBgTilemapBufferRect_Palette0(2, 0x000, 0, 0, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT);
FillBgTilemapBufferRect_Palette0(3, 0x000, 0, 0, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT);
CopyBgTilemapBufferToVram(0);
CopyBgTilemapBufferToVram(1);
CopyBgTilemapBufferToVram(2);
@ -707,8 +707,8 @@ s32 WonderNews_Enter(void)
gPaletteFade.bufferTransferDisabled = TRUE;
LoadPalette(sWonderNewsData->gfx->pal, 0x10, 0x20);
LZ77UnCompWram(sWonderNewsData->gfx->map, sWonderNewsData->bgTilemapBuffer);
CopyRectToBgTilemapBufferRect(1, sWonderNewsData->bgTilemapBuffer, 0, 0, 30, 3, 0, 0, 30, 3, 1, 8, 0);
CopyRectToBgTilemapBufferRect(3, sWonderNewsData->bgTilemapBuffer, 0, 3, 30, 23, 0, 3, 30, 23, 1, 8, 0);
CopyRectToBgTilemapBufferRect(1, sWonderNewsData->bgTilemapBuffer, 0, 0, DISPLAY_TILE_WIDTH, 3, 0, 0, DISPLAY_TILE_WIDTH, 3, 1, 8, 0);
CopyRectToBgTilemapBufferRect(3, sWonderNewsData->bgTilemapBuffer, 0, 3, DISPLAY_TILE_WIDTH, 3 + DISPLAY_TILE_HEIGHT, 0, 3, DISPLAY_TILE_WIDTH, 3 + DISPLAY_TILE_HEIGHT, 1, 8, 0);
CopyBgTilemapBufferToVram(1);
CopyBgTilemapBufferToVram(3);
break;
@ -760,10 +760,10 @@ s32 WonderNews_Exit(bool32 useCancel)
ClearGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_WIN0_ON);
break;
case 2:
FillBgTilemapBufferRect_Palette0(0, 0x000, 0, 0, 30, 20);
FillBgTilemapBufferRect_Palette0(1, 0x000, 0, 0, 30, 20);
FillBgTilemapBufferRect_Palette0(2, 0x000, 0, 0, 30, 24);
FillBgTilemapBufferRect_Palette0(3, 0x000, 0, 0, 30, 24);
FillBgTilemapBufferRect_Palette0(0, 0x000, 0, 0, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT);
FillBgTilemapBufferRect_Palette0(1, 0x000, 0, 0, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT);
FillBgTilemapBufferRect_Palette0(2, 0x000, 0, 0, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT + 4);
FillBgTilemapBufferRect_Palette0(3, 0x000, 0, 0, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT + 4);
CopyBgTilemapBufferToVram(0);
CopyBgTilemapBufferToVram(1);
CopyBgTilemapBufferToVram(2);

View File

@ -267,7 +267,7 @@ static const struct WindowTemplate sWindowTemplates[WIN_COUNT + 1] =
.bg = 0,
.tilemapLeft = 0,
.tilemapTop = 0,
.width = 30,
.width = DISPLAY_TILE_WIDTH,
.height = 2,
.paletteNum = 11,
.baseBlock = 0x074

View File

@ -2866,7 +2866,7 @@ static bool8 TryMovePartySlot(s16 x, s16 width, u8 *leftMove, u8 *newX, u8 *newW
{
if (x + width < 0)
return FALSE;
if (x > 31)
if (x >= 32)
return FALSE;
if (x < 0)
@ -2879,7 +2879,7 @@ static bool8 TryMovePartySlot(s16 x, s16 width, u8 *leftMove, u8 *newX, u8 *newW
{
*leftMove = 0;
*newX = x;
if (x + width > 31)
if (x + width >= 32)
*newWidth = 32 - x;
else
*newWidth = width;

View File

@ -351,7 +351,7 @@ static void InitTradeMenu(void)
FillWindowPixelBuffer(i, PIXEL_FILL(0));
}
FillBgTilemapBufferRect(0, 0, 0, 0, 30, 20, 15);
FillBgTilemapBufferRect(0, 0, 0, 0, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT, 15);
LoadUserWindowBorderGfx_(0, 20, 0xC0);
LoadUserWindowBorderGfx(2, 1, 0xE0);
LoadMonIconPalettes();
@ -2064,13 +2064,13 @@ static void RedrawTradeMenuParty(u8 whichParty)
static void Task_DrawSelectionSummary(u8 taskId)
{
FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 30, 20);
FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT);
CopyBgTilemapBufferToVram(0);
}
static void Task_DrawSelectionTrade(u8 taskId)
{
FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 30, 20);
FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT);
CopyBgTilemapBufferToVram(0);
}

View File

@ -3680,8 +3680,8 @@ static s32 ListMenuHandler_AllItemsAvailable(u8 *state, u8 *windowId, u8 *listMe
if (winTemplateCopy.width > maxWidth)
winTemplateCopy.width = maxWidth;
if (winTemplateCopy.tilemapLeft + winTemplateCopy.width > 29)
winTemplateCopy.tilemapLeft = max(29 - winTemplateCopy.width, 0);
if (winTemplateCopy.tilemapLeft + winTemplateCopy.width >= DISPLAY_TILE_WIDTH)
winTemplateCopy.tilemapLeft = max(DISPLAY_TILE_WIDTH - 1 - winTemplateCopy.width, 0);
*windowId = AddWindow(&winTemplateCopy);
DrawStdWindowFrame(*windowId, FALSE);

View File

@ -129,7 +129,7 @@ void CB2_UnionRoomBattle(void)
ClearWindowTilemap(0);
FillWindowPixelBuffer(0, PIXEL_FILL(0));
FillWindowPixelBuffer(0, PIXEL_FILL(1));
FillBgTilemapBufferRect(0, 0, 0, 0, 30, 20, 0xF);
FillBgTilemapBufferRect(0, 0, 0, 0, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT, 0xF);
LoadUserWindowBorderGfx(0, 1, 0xD0);
LoadUserWindowBorderGfx_(0, 1, 0xD0);
Menu_LoadStdPal();