From 406f87c534090825e668935b1ed5efaddca61275 Mon Sep 17 00:00:00 2001 From: RavePossum Date: Mon, 15 Apr 2024 15:26:43 -0400 Subject: [PATCH] first stab at making configable BW map pop-ups in expansion --- graphics/map_popup/bw/black.pal | 19 ++ graphics/map_popup/bw/bw_primary.png | Bin 0 -> 9264 bytes graphics/map_popup/bw/bw_secondary.png | Bin 0 -> 9265 bytes graphics/map_popup/bw/white.pal | 19 ++ include/config/map_name_popup.h | 23 +++ include/field_weather.h | 1 + include/menu.h | 5 + include/rtc.h | 1 + include/strings.h | 4 + src/field_weather.c | 8 + src/map_name_popup.c | 260 +++++++++++++++++++++++-- src/menu.c | 56 ++++++ src/rtc.c | 31 +++ src/strings.c | 2 + 14 files changed, 410 insertions(+), 19 deletions(-) create mode 100644 graphics/map_popup/bw/black.pal create mode 100644 graphics/map_popup/bw/bw_primary.png create mode 100644 graphics/map_popup/bw/bw_secondary.png create mode 100644 graphics/map_popup/bw/white.pal create mode 100644 include/config/map_name_popup.h diff --git a/graphics/map_popup/bw/black.pal b/graphics/map_popup/bw/black.pal new file mode 100644 index 0000000000..696191f6ba --- /dev/null +++ b/graphics/map_popup/bw/black.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +0 0 0 +0 0 0 +255 255 255 +41 49 90 +0 0 0 +238 230 238 +189 180 197 +139 139 164 +90 90 123 +41 49 90 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 diff --git a/graphics/map_popup/bw/bw_primary.png b/graphics/map_popup/bw/bw_primary.png new file mode 100644 index 0000000000000000000000000000000000000000..72602052fe3e30f2d01371a5c526bc34e08f3fb0 GIT binary patch literal 9264 zcmYjXWmFq&u*Nl5(E>$UiWNz5m*Q63y|}vuhe9dZVuj-F6qiDS7ea$Wa3~fi?oMv_ z?vH!-oa|;Z@B7T`$TM^HBv#|S0s$U19tsKyfs&%E7V>(G{7~VbBhP2qVd^L-uLK=r zWHe+Qyxg5F0~jaa(wn#MwO@_^I2d31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L{#>oS-W9qsrW1Nwg_u3PRrY_HBRj>c#T9({b^DrfaINtZZ_en+GTJz)FaBWC zuf~raqGkicV%6uIIYuYfuIoPQa;8D+-ll7k(J+N48vG_IUqWz65I7vh`Uf1F>vQHo z3WnDN<5TvJSKqL9E$3kbdHemu>9Sta~gpcz9%9#xN+Ou8jLkyO(06J0hPG&#urL5W(NKf>c+2}Fojjy|itlRgbXPs4n5=U(KTy~vNd9~|7M`6a+><{! z7Se=VeWH?`%bUY9;$bU1C_!+1ZT`@lNB*$|(z9QjSQaTJ5AQM}u7#IDU7SZGwHY_} zkoINdc2k#yeco@-a)O4X@dC~?0gYUTdO{AC$n3HB4@dUGyTQ7$ESfP3PYWkjfDda# zcc%%+VB&G1o8l~eG!gvJWr5;CSDn0HchV;M8*)Gb&x9ZFwXvp(;0%$q8haCpgh=*V z=XVcVu%ul1Dac9iY-E6n2fvrI<^vA&8tfo_#kmy(fTD%-2RiP5gw@L?9(cPmN_lCu z3+4O-r1`G2;`#Z#`<=eg_1b?AnNMsn+N;d<^8AqBWE~RON|u+9-4?HTytCG{FFAU< zTS?_CT}#x;%#{hpd?ECXSN09o4C0?OKy?*uS;Q4_z~OM#cZP^BM>|JdO#?A8MTUl; z|NZ4Z`Tw0nOscZ8mrAGDsg{r{s|Jw_TKGf|Y0($@ccINpQTO$R`eS`MDReUnT4 zg27yWO}B2^FnWXI-b!kcB2|-fI qQnua)?)03V3qXl2P%L~e1yv%Yhw!f)O%vy{Ns6)`WNO}currWeather == WEATHER_FOG_HORIZONTAL || + gWeatherPtr->currWeather == WEATHER_FOG_DIAGONAL || + gWeatherPtr->currWeather == WEATHER_UNDERWATER_BUBBLES || + gWeatherPtr->currWeather == WEATHER_UNDERWATER; +} diff --git a/src/map_name_popup.c b/src/map_name_popup.c index 725bb80838..cfde934f73 100644 --- a/src/map_name_popup.c +++ b/src/map_name_popup.c @@ -2,12 +2,16 @@ #include "battle_pyramid.h" #include "bg.h" #include "event_data.h" +#include "field_weather.h" #include "gpu_regs.h" +#include "graphics.h" #include "international_string_util.h" +#include "main.h" #include "menu.h" #include "map_name_popup.h" #include "palette.h" #include "region_map.h" +#include "rtc.h" #include "start_menu.h" #include "string_util.h" #include "task.h" @@ -16,7 +20,142 @@ #include "constants/layouts.h" #include "constants/region_map_sections.h" #include "constants/weather.h" +#include "config/map_name_popup.h" +#include "config.h" +#if MAP_POPUP_GENERATION != GEN_3 && MAP_POPUP_GENERATION != GEN_5 +#error "Invalid choice for MAP_POPUP_GENERATION, must be one of [GEN_3, GEN_5]" +#endif + +// static functions +static void Task_MapNamePopUpWindow(u8 taskId); +static void ShowMapNamePopUpWindow(void); +static void LoadMapNamePopUpWindowBg(void); + +// EWRAM +EWRAM_DATA u8 gPopupTaskId = 0; + +#if MAP_POPUP_GENERATION == GEN_5 +// enums +enum MapPopUp_Themes +{ + MAPPOPUP_THEME_DEFAULT, +}; + +// .rodata +static const u8 sMapPopUpTilesPrimary_BW[] = INCBIN_U8("graphics/map_popup/bw/bw_primary.4bpp"); +static const u8 sMapPopUpTilesSecondary_BW[] = INCBIN_U8("graphics/map_popup/bw/bw_secondary.4bpp"); +static const u16 sMapPopUpTilesPalette_BW_Black[16] = INCBIN_U16("graphics/map_popup/bw/black.gbapal"); +static const u16 sMapPopUpTilesPalette_BW_White[16] = INCBIN_U16("graphics/map_popup/bw/white.gbapal"); + +static const u8 sRegionMapSectionId_To_PopUpThemeIdMapping[] = +{ + [MAPSEC_LITTLEROOT_TOWN] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_OLDALE_TOWN] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_DEWFORD_TOWN] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_LAVARIDGE_TOWN] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_FALLARBOR_TOWN] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_VERDANTURF_TOWN] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_PACIFIDLOG_TOWN] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_PETALBURG_CITY] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_SLATEPORT_CITY] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_MAUVILLE_CITY] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_RUSTBORO_CITY] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_FORTREE_CITY] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_LILYCOVE_CITY] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_MOSSDEEP_CITY] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_SOOTOPOLIS_CITY] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_EVER_GRANDE_CITY] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_ROUTE_101] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_ROUTE_102] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_ROUTE_103] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_ROUTE_104] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_ROUTE_105] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_ROUTE_106] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_ROUTE_107] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_ROUTE_108] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_ROUTE_109] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_ROUTE_110] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_ROUTE_111] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_ROUTE_112] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_ROUTE_113] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_ROUTE_114] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_ROUTE_115] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_ROUTE_116] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_ROUTE_117] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_ROUTE_118] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_ROUTE_119] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_ROUTE_120] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_ROUTE_121] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_ROUTE_122] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_ROUTE_123] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_ROUTE_124] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_ROUTE_125] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_ROUTE_126] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_ROUTE_127] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_ROUTE_128] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_ROUTE_129] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_ROUTE_130] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_ROUTE_131] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_ROUTE_132] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_ROUTE_133] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_ROUTE_134] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_UNDERWATER_124] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_UNDERWATER_126] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_UNDERWATER_127] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_UNDERWATER_128] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_UNDERWATER_SOOTOPOLIS] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_GRANITE_CAVE] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_MT_CHIMNEY] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_SAFARI_ZONE] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_BATTLE_FRONTIER] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_PETALBURG_WOODS] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_RUSTURF_TUNNEL] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_ABANDONED_SHIP] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_NEW_MAUVILLE] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_METEOR_FALLS] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_METEOR_FALLS2] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_MT_PYRE] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_AQUA_HIDEOUT_OLD] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_SHOAL_CAVE] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_SEAFLOOR_CAVERN] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_UNDERWATER_SEAFLOOR_CAVERN] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_VICTORY_ROAD] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_MIRAGE_ISLAND] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_CAVE_OF_ORIGIN] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_SOUTHERN_ISLAND] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_FIERY_PATH] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_FIERY_PATH2] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_JAGGED_PASS] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_JAGGED_PASS2] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_SEALED_CHAMBER] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_UNDERWATER_SEALED_CHAMBER] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_SCORCHED_SLAB] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_ISLAND_CAVE] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_DESERT_RUINS] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_ANCIENT_TOMB] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_INSIDE_OF_TRUCK] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_SKY_PILLAR] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_SECRET_BASE] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_DYNAMIC] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_AQUA_HIDEOUT - KANTO_MAPSEC_COUNT] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_MAGMA_HIDEOUT - KANTO_MAPSEC_COUNT] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_MIRAGE_TOWER - KANTO_MAPSEC_COUNT] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_BIRTH_ISLAND - KANTO_MAPSEC_COUNT] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_FARAWAY_ISLAND - KANTO_MAPSEC_COUNT] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_ARTISAN_CAVE - KANTO_MAPSEC_COUNT] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_MARINE_CAVE - KANTO_MAPSEC_COUNT] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_UNDERWATER_MARINE_CAVE - KANTO_MAPSEC_COUNT] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_TERRA_CAVE - KANTO_MAPSEC_COUNT] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_UNDERWATER_105 - KANTO_MAPSEC_COUNT] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_UNDERWATER_125 - KANTO_MAPSEC_COUNT] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_UNDERWATER_129 - KANTO_MAPSEC_COUNT] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_DESERT_UNDERPASS - KANTO_MAPSEC_COUNT] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_ALTERING_CAVE - KANTO_MAPSEC_COUNT] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_NAVEL_ROCK - KANTO_MAPSEC_COUNT] = MAPPOPUP_THEME_DEFAULT, + [MAPSEC_TRAINER_HILL - KANTO_MAPSEC_COUNT] = MAPPOPUP_THEME_DEFAULT, +}; +#else // enums enum MapPopUp_Themes { @@ -28,14 +167,6 @@ enum MapPopUp_Themes MAPPOPUP_THEME_STONE2, }; -// static functions -static void Task_MapNamePopUpWindow(u8 taskId); -static void ShowMapNamePopUpWindow(void); -static void LoadMapNamePopUpWindowBg(void); - -// EWRAM -static EWRAM_DATA u8 sPopupTaskId = 0; - // .rodata static const u8 sMapPopUp_Table[][960] = { @@ -176,6 +307,7 @@ static const u8 sRegionMapSectionId_To_PopUpThemeIdMapping[] = [MAPSEC_NAVEL_ROCK - KANTO_MAPSEC_COUNT] = MAPPOPUP_THEME_STONE, [MAPSEC_TRAINER_HILL - KANTO_MAPSEC_COUNT] = MAPPOPUP_THEME_MARBLE }; +#endif static const u8 sText_PyramidFloor1[] = _("PYRAMID FLOOR 1"); static const u8 sText_PyramidFloor2[] = _("PYRAMID FLOOR 2"); @@ -216,7 +348,7 @@ enum { STATE_PRINT, // For some reason the first state is numerically last. }; -#define POPUP_OFFSCREEN_Y 40 +#define POPUP_OFFSCREEN_Y ((MAP_POPUP_GENERATION == GEN_5) ? 24 : 40) #define POPUP_SLIDE_SPEED 2 #define tState data[0] @@ -232,18 +364,26 @@ void ShowMapNamePopup(void) if (!FuncIsActiveTask(Task_MapNamePopUpWindow)) { // New pop up window - sPopupTaskId = CreateTask(Task_MapNamePopUpWindow, 90); + #if MAP_POPUP_GENERATION == GEN_5 + gPopupTaskId = CreateTask(Task_MapNamePopUpWindow, 100); + + if (MAP_POPUP_BW_ALPHA_BLEND && !IsWeatherAlphaBlend()) + SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT1_BG0 | BLDCNT_TGT2_ALL | BLDCNT_EFFECT_BLEND); + #else + gPopupTaskId = CreateTask(Task_MapNamePopUpWindow, 90); SetGpuReg(REG_OFFSET_BG0VOFS, POPUP_OFFSCREEN_Y); - gTasks[sPopupTaskId].tState = STATE_PRINT; - gTasks[sPopupTaskId].tYOffset = POPUP_OFFSCREEN_Y; + #endif + + gTasks[gPopupTaskId].tState = STATE_PRINT; + gTasks[gPopupTaskId].tYOffset = POPUP_OFFSCREEN_Y; } else { // There's already a pop up window running. // Hurry the old pop up offscreen so the new one can appear. - if (gTasks[sPopupTaskId].tState != STATE_SLIDE_OUT) - gTasks[sPopupTaskId].tState = STATE_SLIDE_OUT; - gTasks[sPopupTaskId].tIncomingPopUp = TRUE; + if (gTasks[gPopupTaskId].tState != STATE_SLIDE_OUT) + gTasks[gPopupTaskId].tState = STATE_SLIDE_OUT; + gTasks[gPopupTaskId].tIncomingPopUp = TRUE; } } } @@ -261,6 +401,10 @@ static void Task_MapNamePopUpWindow(u8 taskId) task->tState = STATE_SLIDE_IN; task->tPrintTimer = 0; ShowMapNamePopUpWindow(); + #if MAP_POPUP_GENERATION == GEN_5 + EnableInterrupts(INTR_FLAG_HBLANK); + SetHBlankCallback(HBlankCB_DoublePopupWindow); + #endif } break; case STATE_SLIDE_IN: @@ -270,7 +414,7 @@ static void Task_MapNamePopUpWindow(u8 taskId) { task->tYOffset = 0; task->tState = STATE_WAIT; - gTasks[sPopupTaskId].data[1] = 0; + gTasks[gPopupTaskId].data[1] = 0; } break; case STATE_WAIT: @@ -304,13 +448,18 @@ static void Task_MapNamePopUpWindow(u8 taskId) break; case STATE_ERASE: ClearStdWindowAndFrame(GetMapNamePopUpWindowId(), TRUE); + #if MAP_POPUP_GENERATION == GEN_5 + ClearStdWindowAndFrame(GetSecondaryPopUpWindowId(), TRUE); + #endif task->tState = STATE_END; break; case STATE_END: HideMapNamePopUpWindow(); return; } +#if MAP_POPUP_GENERATION != GEN_5 SetGpuReg(REG_OFFSET_BG0VOFS, task->tYOffset); +#endif } void HideMapNamePopUpWindow(void) @@ -324,8 +473,28 @@ void HideMapNamePopUpWindow(void) ClearStdWindowAndFrame(GetMapNamePopUpWindowId(), TRUE); RemoveMapNamePopUpWindow(); } + + #if MAP_POPUP_GENERATION == GEN_5 + #ifdef UBFIX + if (GetSecondaryPopUpWindowId() != WINDOW_NONE) + #endif // UBFIX + { + ClearStdWindowAndFrame(GetSecondaryPopUpWindowId(), TRUE); + RemoveSecondaryPopUpWindow(); + } + + DisableInterrupts(INTR_FLAG_HBLANK); + SetHBlankCallback(NULL); + + if (MAP_POPUP_BW_ALPHA_BLEND && !IsWeatherAlphaBlend()) + { + SetGpuReg(REG_OFFSET_WININ, WININ_WIN0_BG_ALL | WININ_WIN0_OBJ | WININ_WIN1_BG_ALL | WININ_WIN1_OBJ); + SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT2_BG1 | BLDCNT_TGT2_BG2 | BLDCNT_TGT2_BG3 | BLDCNT_TGT2_OBJ | BLDCNT_EFFECT_BLEND); + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(8, 10)); + } + #endif SetGpuReg_ForcedBlank(REG_OFFSET_BG0VOFS, 0); - DestroyTask(sPopupTaskId); + DestroyTask(gPopupTaskId); } } @@ -333,8 +502,12 @@ static void ShowMapNamePopUpWindow(void) { u8 mapDisplayHeader[24]; u8 *withoutPrefixPtr; - u8 x; const u8 *mapDisplayHeaderSource; +#if MAP_POPUP_GENERATION == GEN_5 + u8 mapNamePopUpWindowId, secondaryPopUpWindowId; +#else + u8 x; +#endif if (InBattlePyramid()) { @@ -355,16 +528,43 @@ static void ShowMapNamePopUpWindow(void) withoutPrefixPtr = &(mapDisplayHeader[3]); GetMapName(withoutPrefixPtr, gMapHeader.regionMapSectionId, 0); } + +#if MAP_POPUP_GENERATION == GEN_5 + if (MAP_POPUP_BW_ALPHA_BLEND && !IsWeatherAlphaBlend()) + SetGpuRegBits(REG_OFFSET_WININ, WININ_WIN0_CLR); + + mapNamePopUpWindowId = AddMapNamePopUpWindow(); + secondaryPopUpWindowId = AddSecondaryPopUpWindow(); +#else AddMapNamePopUpWindow(); +#endif + LoadMapNamePopUpWindowBg(); - x = GetStringCenterAlignXOffset(FONT_NARROW, withoutPrefixPtr, 80); + mapDisplayHeader[0] = EXT_CTRL_CODE_BEGIN; mapDisplayHeader[1] = EXT_CTRL_CODE_HIGHLIGHT; mapDisplayHeader[2] = TEXT_COLOR_TRANSPARENT; + +#if MAP_POPUP_GENERATION == GEN_5 + AddTextPrinterParameterized(mapNamePopUpWindowId, FONT_SHORT, mapDisplayHeader, 8, 2, TEXT_SKIP_DRAW, NULL); + + if (MAP_POPUP_BW_TIME_MODE != MAP_POPUP_BW_TIME_NONE) + { + RtcCalcLocalTime(); + FormatDecimalTimeWithoutSeconds(withoutPrefixPtr, gLocalTime.hours, gLocalTime.minutes, MAP_POPUP_BW_TIME_MODE == MAP_POPUP_BW_TIME_24_HR); + AddTextPrinterParameterized(secondaryPopUpWindowId, FONT_SMALL, mapDisplayHeader, GetStringRightAlignXOffset(FONT_SMALL, mapDisplayHeader, DISPLAY_WIDTH) - 5, 8, TEXT_SKIP_DRAW, NULL); + } + + CopyWindowToVram(mapNamePopUpWindowId, COPYWIN_FULL); + CopyWindowToVram(secondaryPopUpWindowId, COPYWIN_FULL); +#else + x = GetStringCenterAlignXOffset(FONT_NARROW, withoutPrefixPtr, 80); AddTextPrinterParameterized(GetMapNamePopUpWindowId(), FONT_NARROW, mapDisplayHeader, x, 3, TEXT_SKIP_DRAW, NULL); CopyWindowToVram(GetMapNamePopUpWindowId(), COPYWIN_FULL); +#endif } +#if MAP_POPUP_GENERATION != GEN_5 #define TILE_TOP_EDGE_START 0x21D #define TILE_TOP_EDGE_END 0x228 #define TILE_LEFT_EDGE_TOP 0x229 @@ -396,12 +596,16 @@ static void DrawMapNamePopUpFrame(u8 bg, u8 x, u8 y, u8 deltaX, u8 deltaY, u8 un for (i = 0; i < 1 + TILE_BOT_EDGE_END - TILE_BOT_EDGE_START; i++) FillBgTilemapBufferRect(bg, TILE_BOT_EDGE_START + i, i - 1 + x, y + deltaY, 1, 1, 14); } +#endif static void LoadMapNamePopUpWindowBg(void) { u8 popUpThemeId; u8 popupWindowId = GetMapNamePopUpWindowId(); u16 regionMapSectionId = gMapHeader.regionMapSectionId; +#if MAP_POPUP_GENERATION == GEN_5 + u8 secondaryPopUpWindowId = GetSecondaryPopUpWindowId(); +#endif if (regionMapSectionId >= KANTO_MAPSEC_START) { @@ -412,6 +616,23 @@ static void LoadMapNamePopUpWindowBg(void) } popUpThemeId = sRegionMapSectionId_To_PopUpThemeIdMapping[regionMapSectionId]; +#if MAP_POPUP_GENERATION == GEN_5 + switch (popUpThemeId) { + // add more themes as case statements here + default: + if (MAP_POPUP_BW_COLOR == MAP_POPUP_BW_COLOR_WHITE) + LoadPalette(sMapPopUpTilesPalette_BW_White, BG_PLTT_ID(14), sizeof(sMapPopUpTilesPalette_BW_White)); + else + LoadPalette(sMapPopUpTilesPalette_BW_Black, BG_PLTT_ID(14), sizeof(sMapPopUpTilesPalette_BW_Black)); + + CopyToWindowPixelBuffer(popupWindowId, sMapPopUpTilesPrimary_BW, sizeof(sMapPopUpTilesPrimary_BW), 0); + CopyToWindowPixelBuffer(secondaryPopUpWindowId, sMapPopUpTilesSecondary_BW, sizeof(sMapPopUpTilesSecondary_BW), 0); + break; + } + + PutWindowTilemap(popupWindowId); + PutWindowTilemap(secondaryPopUpWindowId); +#else LoadBgTiles(GetWindowAttribute(popupWindowId, WINDOW_BG), sMapPopUp_OutlineTable[popUpThemeId], 0x400, 0x21D); CallWindowFunction(popupWindowId, DrawMapNamePopUpFrame); PutWindowTilemap(popupWindowId); @@ -420,4 +641,5 @@ static void LoadMapNamePopUpWindowBg(void) else LoadPalette(sMapPopUp_PaletteTable[popUpThemeId], BG_PLTT_ID(14), sizeof(sMapPopUp_PaletteTable[0])); BlitBitmapToWindow(popupWindowId, sMapPopUp_Table[popUpThemeId], 0, 0, 80, 24); +#endif } diff --git a/src/menu.c b/src/menu.c index a6bd9ae2bc..9c257d5521 100644 --- a/src/menu.c +++ b/src/menu.c @@ -4,8 +4,10 @@ #include "blit.h" #include "dma3.h" #include "event_data.h" +#include "field_weather.h" #include "graphics.h" #include "main.h" +#include "map_name_popup.h" #include "menu.h" #include "menu_helpers.h" #include "palette.h" @@ -18,6 +20,7 @@ #include "task.h" #include "text_window.h" #include "window.h" +#include "config/map_name_popup.h" #include "constants/songs.h" #define DLG_WINDOW_PALETTE_NUM 15 @@ -62,6 +65,9 @@ static void task_free_buf_after_copying_tile_data_to_vram(u8 taskId); static EWRAM_DATA u8 sStartMenuWindowId = 0; static EWRAM_DATA u8 sMapNamePopupWindowId = 0; +#if MAP_POPUP_GENERATION == GEN_5 +static EWRAM_DATA u8 sSecondaryPopupWindowId = 0; +#endif static EWRAM_DATA struct Menu sMenu = {0}; static EWRAM_DATA u16 sTileNum = 0; static EWRAM_DATA u8 sPaletteNum = 0; @@ -145,6 +151,9 @@ void InitStandardTextBoxWindows(void) InitWindows(sStandardTextBox_WindowTemplates); sStartMenuWindowId = WINDOW_NONE; sMapNamePopupWindowId = WINDOW_NONE; +#if MAP_POPUP_GENERATION == GEN_5 + sSecondaryPopupWindowId = WINDOW_NONE; +#endif } void FreeAllOverworldWindowBuffers(void) @@ -521,7 +530,13 @@ static u16 UNUSED GetStandardFrameBaseTileNum(void) u8 AddMapNamePopUpWindow(void) { if (sMapNamePopupWindowId == WINDOW_NONE) + { + #if MAP_POPUP_GENERATION == GEN_5 + sMapNamePopupWindowId = AddWindowParameterized(0, 0, 0, 30, 3, 14, 0x107); + #else sMapNamePopupWindowId = AddWindowParameterized(0, 1, 1, 10, 3, 14, 0x107); + #endif + } return sMapNamePopupWindowId; } @@ -2145,3 +2160,44 @@ void BufferSaveMenuText(u8 textId, u8 *dest, u8 color) break; } } + +// BW map pop-ups +#if MAP_POPUP_GENERATION == GEN_5 +u8 AddSecondaryPopUpWindow(void) +{ + if (sSecondaryPopupWindowId == WINDOW_NONE) + sSecondaryPopupWindowId = AddWindowParameterized(0, 0, 17, 30, 3, 14, 0x161); + return sSecondaryPopupWindowId; +} + +u8 GetSecondaryPopUpWindowId(void) +{ + return sSecondaryPopupWindowId; +} + +void RemoveSecondaryPopUpWindow(void) +{ + if (sSecondaryPopupWindowId != WINDOW_NONE) + { + RemoveWindow(sSecondaryPopupWindowId); + sSecondaryPopupWindowId = WINDOW_NONE; + } +} + +void HBlankCB_DoublePopupWindow(void) +{ + u16 offset = gTasks[gPopupTaskId].data[2]; + u16 scanline = REG_VCOUNT; + + if (scanline < 80 || scanline > 160) + { + REG_BG0VOFS = offset; + if(MAP_POPUP_BW_ALPHA_BLEND && !IsWeatherAlphaBlend()) + REG_BLDALPHA = BLDALPHA_BLEND(15, 5); + } + else + { + REG_BG0VOFS = 512 - offset; + } +} +#endif \ No newline at end of file diff --git a/src/rtc.c b/src/rtc.c index a90c9aa89b..c77d7dd9fd 100644 --- a/src/rtc.c +++ b/src/rtc.c @@ -1,6 +1,7 @@ #include "global.h" #include "rtc.h" #include "string_util.h" +#include "strings.h" #include "text.h" // iwram bss @@ -364,3 +365,33 @@ u32 RtcGetLocalDayCount(void) { return RtcGetDayCount(&sRtc); } + +void FormatDecimalTimeWithoutSeconds(u8 *txtPtr, s8 hour, s8 minute, bool8 is24Hour) +{ + if (is24Hour) + { + txtPtr = ConvertIntToDecimalStringN(txtPtr, hour, STR_CONV_MODE_LEADING_ZEROS, 2); + *txtPtr++ = CHAR_COLON; + txtPtr = ConvertIntToDecimalStringN(txtPtr, minute, STR_CONV_MODE_LEADING_ZEROS, 2); + } + else + { + if (hour == 0) + txtPtr = ConvertIntToDecimalStringN(txtPtr, 12, STR_CONV_MODE_LEADING_ZEROS, 2); + else if (hour < 13) + txtPtr = ConvertIntToDecimalStringN(txtPtr, hour, STR_CONV_MODE_LEADING_ZEROS, 2); + else + txtPtr = ConvertIntToDecimalStringN(txtPtr, hour - 12, STR_CONV_MODE_LEADING_ZEROS, 2); + + *txtPtr++ = CHAR_COLON; + txtPtr = ConvertIntToDecimalStringN(txtPtr, minute, STR_CONV_MODE_LEADING_ZEROS, 2); + txtPtr = StringAppend(txtPtr, gText_Space); + if (hour < 12) + txtPtr = StringAppend(txtPtr, gText_AM); + else + txtPtr = StringAppend(txtPtr, gText_PM); + } + + *txtPtr++ = EOS; + *txtPtr = EOS; +} diff --git a/src/strings.c b/src/strings.c index 4fde380240..a28489dd91 100644 --- a/src/strings.c +++ b/src/strings.c @@ -1856,3 +1856,5 @@ const u8 gText_ExpShareOff[] = _("The Exp. Share has been turned off.{PAUSE_UNTI const u8 gText_BasePointsResetToZero[] = _("{STR_VAR_1}'s base points\nwere all reset to zero!{PAUSE_UNTIL_PRESS}"); const u8 gText_Fertilize[] = _("FERTILIZE"); const u8 gText_PlantBerry[] = _("PLANT BERRY"); +const u8 gText_AM[] = _("AM"); +const u8 gText_PM[] = _("PM");