diff options
Diffstat (limited to 'src/dodrio_berry_picking.c')
-rw-r--r-- | src/dodrio_berry_picking.c | 126 |
1 files changed, 63 insertions, 63 deletions
diff --git a/src/dodrio_berry_picking.c b/src/dodrio_berry_picking.c index 838e8ed94..691ca6b2a 100644 --- a/src/dodrio_berry_picking.c +++ b/src/dodrio_berry_picking.c @@ -1352,14 +1352,14 @@ static void ResetGame(void) } break; case 2: - ChangeBgX(0, 0, 0); - ChangeBgY(0, 0, 0); - ChangeBgX(1, 0, 0); - ChangeBgY(1, 0, 0); - ChangeBgX(2, 0, 0); - ChangeBgY(2, 0, 0); - ChangeBgX(3, 0, 0); - ChangeBgY(3, 0, 0); + ChangeBgX(0, 0, BG_COORD_SET); + ChangeBgY(0, 0, BG_COORD_SET); + ChangeBgX(1, 0, BG_COORD_SET); + ChangeBgY(1, 0, BG_COORD_SET); + ChangeBgX(2, 0, BG_COORD_SET); + ChangeBgY(2, 0, BG_COORD_SET); + ChangeBgX(3, 0, BG_COORD_SET); + ChangeBgY(3, 0, BG_COORD_SET); sGame->state++; break; case 3: @@ -2968,7 +2968,7 @@ static void Task_ShowDodrioBerryPickingRecords(u8 taskId) window.width = width; tWindowId = AddWindow(&window); PrintRecordsText(tWindowId, width); - CopyWindowToVram(tWindowId, 3); + CopyWindowToVram(tWindowId, COPYWIN_FULL); tState++; break; case 1: @@ -2979,7 +2979,7 @@ static void Task_ShowDodrioBerryPickingRecords(u8 taskId) if (JOY_NEW(A_BUTTON | B_BUTTON)) { rbox_fill_rectangle(tWindowId); - CopyWindowToVram(tWindowId, 1); + CopyWindowToVram(tWindowId, COPYWIN_MAP); tState++; } break; @@ -3008,14 +3008,14 @@ static void PrintRecordsText(u8 windowId, s32 width) LoadUserWindowBorderGfx_(windowId, 0x21D, 0xD0); DrawTextBorderOuter(windowId, 0x21D, 0xD); 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++) { ConvertIntToDecimalStringN(gStringVar1, recordNums[i], STR_CONV_MODE_LEFT_ALIGN, sRecordNumMaxDigits[i]); 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; - 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); } @@ -3056,16 +3056,16 @@ static const u16 sDebug_BerryResults[MAX_RFU_PLAYERS][4] = }; static const u8 sJPText_Vowels[] = _("あいうえおかき"); -static const u8 sText_ABCDEFG[] = _("ABCDEFG"); -static const u8 sText_0123456[] = _("0123456"); +static const u8 sText_Letters[] = _("ABCDEFG"); +static const u8 sText_Digits[] = _("0123456"); static const u8 *const sDebug_PlayerNames[] = { sJPText_Vowels, sJPText_Vowels, sJPText_Vowels, - sText_ABCDEFG, - sText_0123456 + sText_Letters, + sText_Digits }; static void Debug_UpdateNumPlayers(void) @@ -4649,8 +4649,8 @@ static void ShowNames(void) if (playerId == GetMultiplayerId()) colorsId = COLORID_BLUE; name = GetPlayerName(playerId); - AddTextPrinterParameterized3(sGfx->windowIds[i], FONT_NORMAL, left, 1, sTextColorTable[colorsId], -1, name); - CopyWindowToVram(sGfx->windowIds[i], 2); + AddTextPrinterParameterized3(sGfx->windowIds[i], FONT_NORMAL, left, 1, sTextColorTable[colorsId], TEXT_SKIP_DRAW, name); + CopyWindowToVram(sGfx->windowIds[i], COPYWIN_GFX); window.baseBlock += 0xE; DrawMessageWindow(&window); } @@ -4733,15 +4733,15 @@ static void PrintRankedScores(u8 numPlayers_) u8 playerId = playersByRanking[i]; 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()) colorsId = COLORID_BLUE; 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); 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, gText_SpacePoints, x, 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], TEXT_SKIP_DRAW, NULL); } } @@ -4772,8 +4772,8 @@ static void ShowResults(void) FillWindowPixelBuffer(sGfx->windowIds[1], PIXEL_FILL(1)); strWidth = GetStringWidth(FONT_NORMAL, gText_BerryPickingResults, -1); x = (224 - strWidth) / 2; - AddTextPrinterParameterized(sGfx->windowIds[0], FONT_NORMAL, gText_BerryPickingResults, x, 1, -1, NULL); - AddTextPrinterParameterized(sGfx->windowIds[1], FONT_NORMAL, gText_10P30P50P50P, 68, 17, -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, TEXT_SKIP_DRAW, NULL); for (i = 0; i < numPlayers; i++) { u8 colorsId = COLORID_GRAY; @@ -4781,7 +4781,7 @@ static void ShowResults(void) colorsId = COLORID_BLUE; 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++) { 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 (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 - 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[1], 2); + CopyWindowToVram(sGfx->windowIds[0], COPYWIN_GFX); + CopyWindowToVram(sGfx->windowIds[1], COPYWIN_GFX); sGfx->state++; break; case 3: @@ -4826,13 +4826,13 @@ static void ShowResults(void) FillWindowPixelBuffer(sGfx->windowIds[1], PIXEL_FILL(1)); strWidth = GetStringWidth(FONT_NORMAL, gText_AnnouncingRankings, -1); 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++; break; case 6: PrintRankedScores(numPlayers); - CopyWindowToVram(sGfx->windowIds[0], 2); - CopyWindowToVram(sGfx->windowIds[1], 2); + CopyWindowToVram(sGfx->windowIds[0], COPYWIN_GFX); + CopyWindowToVram(sGfx->windowIds[1], COPYWIN_GFX); sGfx->state++; break; case 7: @@ -4872,12 +4872,12 @@ static void ShowResults(void) FillWindowPixelBuffer(sGfx->windowIds[1], PIXEL_FILL(1)); strWidth = GetStringWidth(FONT_NORMAL, gText_AnnouncingPrizes, -1); 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(); CopyItemName(GetPrizeItemId(), gStringVar1); DynamicPlaceholderTextUtil_SetPlaceholderPtr(0, gStringVar1); 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(); if (prizeState != PRIZE_RECEIVED && prizeState != NO_PRIZE) { @@ -4888,10 +4888,10 @@ static void ShowResults(void) DynamicPlaceholderTextUtil_ExpandPlaceholders(gStringVar4, gText_CantHoldAnyMore); else if (prizeState == PRIZE_FILLED_BAG) 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[1], 2); + CopyWindowToVram(sGfx->windowIds[0], COPYWIN_GFX); + CopyWindowToVram(sGfx->windowIds[1], COPYWIN_GFX); sGfx->state++; break; case 10: @@ -4946,12 +4946,12 @@ static void Msg_WantToPlayAgain(void) // Print text FillWindowPixelBuffer(sGfx->windowIds[WIN_PLAY_AGAIN], 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_YES_NO], FONT_NORMAL, gText_Yes, 8, 1, -1, NULL); - AddTextPrinterParameterized(sGfx->windowIds[WIN_YES_NO], FONT_NORMAL, gText_No, 8, 17, -1, NULL); - AddTextPrinterParameterized(sGfx->windowIds[WIN_YES_NO], FONT_NORMAL, gText_SelectorArrow2, 0, 1, -1, NULL); - CopyWindowToVram(sGfx->windowIds[WIN_PLAY_AGAIN], 2); - CopyWindowToVram(sGfx->windowIds[WIN_YES_NO], 2); + 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, TEXT_SKIP_DRAW, 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, TEXT_SKIP_DRAW, NULL); + CopyWindowToVram(sGfx->windowIds[WIN_PLAY_AGAIN], COPYWIN_GFX); + CopyWindowToVram(sGfx->windowIds[WIN_YES_NO], COPYWIN_GFX); sGfx->state++; break; case 2: @@ -4970,10 +4970,10 @@ static void Msg_WantToPlayAgain(void) if (y == PLAY_AGAIN_NONE) y = PLAY_AGAIN_YES; 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_No, 8, 17, -1, NULL); - AddTextPrinterParameterized(sGfx->windowIds[WIN_YES_NO], FONT_NORMAL, gText_SelectorArrow2, 0, ((y - 1) * 16) + 1, -1, NULL); - CopyWindowToVram(sGfx->windowIds[WIN_YES_NO], 3); + 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, TEXT_SKIP_DRAW, 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], COPYWIN_FULL); // Increment state only if A or B button have been pressed. if (JOY_NEW(A_BUTTON)) @@ -5029,18 +5029,18 @@ static void Msg_SavingDontTurnOff(void) sGfx->state++; break; case 1: - CopyWindowToVram(0, 3); + CopyWindowToVram(0, COPYWIN_FULL); sGfx->state++; break; case 2: if (!IsDma3ManagerBusyWithBgCopy()) { - CreateTask(Task_LinkSave, 0); + CreateTask(Task_LinkFullSave, 0); sGfx->state++; } break; case 3: - if (!FuncIsActiveTask(Task_LinkSave)) + if (!FuncIsActiveTask(Task_LinkFullSave)) sGfx->state++; break; default: @@ -5063,8 +5063,8 @@ static void Msg_CommunicationStandby(void) break; case 1: FillWindowPixelBuffer(sGfx->windowIds[0], PIXEL_FILL(1)); - AddTextPrinterParameterized(sGfx->windowIds[0], FONT_NORMAL, gText_CommunicationStandby3, 0, 5, -1, NULL); - CopyWindowToVram(sGfx->windowIds[0], 2); + AddTextPrinterParameterized(sGfx->windowIds[0], FONT_NORMAL, gText_CommunicationStandby3, 0, 5, TEXT_SKIP_DRAW, NULL); + CopyWindowToVram(sGfx->windowIds[0], COPYWIN_GFX); sGfx->state++; break; case 2: @@ -5103,8 +5103,8 @@ static void Msg_SomeoneDroppedOut(void) break; case 1: FillWindowPixelBuffer(sGfx->windowIds[0], PIXEL_FILL(1)); - AddTextPrinterParameterized(sGfx->windowIds[0], FONT_NORMAL, gText_SomeoneDroppedOut, 0, 5, -1, NULL); - CopyWindowToVram(sGfx->windowIds[0], 2); + AddTextPrinterParameterized(sGfx->windowIds[0], FONT_NORMAL, gText_SomeoneDroppedOut, 0, 5, TEXT_SKIP_DRAW, NULL); + CopyWindowToVram(sGfx->windowIds[0], COPYWIN_GFX); sGfx->state++; break; case 2: @@ -5172,14 +5172,14 @@ static void InitBgs(void) SetGpuReg(REG_OFFSET_DISPCNT, 0); ResetBgsAndClearDma3BusyFlags(0); InitBgsFromTemplates(0, sBgTemplates, ARRAY_COUNT(sBgTemplates)); - ChangeBgX(0, 0, 0); - ChangeBgY(0, 0, 0); - ChangeBgX(1, 0, 0); - ChangeBgY(1, 0, 0); - ChangeBgX(2, 0, 0); - ChangeBgY(2, 0, 0); - ChangeBgX(3, 0, 0); - ChangeBgY(3, 0, 0); + ChangeBgX(0, 0, BG_COORD_SET); + ChangeBgY(0, 0, BG_COORD_SET); + ChangeBgX(1, 0, BG_COORD_SET); + ChangeBgY(1, 0, BG_COORD_SET); + ChangeBgX(2, 0, BG_COORD_SET); + ChangeBgY(2, 0, BG_COORD_SET); + ChangeBgX(3, 0, BG_COORD_SET); + ChangeBgY(3, 0, BG_COORD_SET); InitStandardTextBoxWindows(); InitTextBoxGfxAndPrinters(); SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_OBJ_ON | DISPCNT_OBJ_1D_MAP); |