summaryrefslogtreecommitdiff
path: root/src/pokedex.c
diff options
context:
space:
mode:
authorPikalaxALT <PikalaxALT@users.noreply.github.com>2020-09-05 10:25:10 -0400
committerGitHub <noreply@github.com>2020-09-05 10:25:10 -0400
commit16ecbc6446f4e8d308e71aa5e649c69acb8a6b3e (patch)
tree309ee7f0dd15192ad2ead860c8a6e2cabe5b9214 /src/pokedex.c
parentbb98e346e537ffa71a529db71688975b9a850cfa (diff)
parent3e25d9e5a2e0346a53b1bfdf9e14f98e14cceb21 (diff)
Merge pull request #1177 from PokeCodec/MatchEmerald
Match All but 2 remaining naked functions
Diffstat (limited to 'src/pokedex.c')
-rw-r--r--src/pokedex.c185
1 files changed, 63 insertions, 122 deletions
diff --git a/src/pokedex.c b/src/pokedex.c
index 4f41c5557..e49911891 100644
--- a/src/pokedex.c
+++ b/src/pokedex.c
@@ -1673,7 +1673,7 @@ static void Task_HandlePokedexInput(u8 taskId)
}
else
{
- if ((gMain.newKeys & A_BUTTON) && sPokedexView->pokedexList[sPokedexView->selectedPokemon].seen)
+ if ((JOY_NEW(A_BUTTON)) && sPokedexView->pokedexList[sPokedexView->selectedPokemon].seen)
{
UpdateSelectedMonSpriteId();
BeginNormalPaletteFade(~(1 << (gSprites[sPokedexView->selectedMonSpriteId].oam.paletteNum + 16)), 0, 0, 0x10, RGB_BLACK);
@@ -1682,7 +1682,7 @@ static void Task_HandlePokedexInput(u8 taskId)
PlaySE(SE_PIN);
FreeWindowAndBgBuffers();
}
- else if (gMain.newKeys & START_BUTTON)
+ else if (JOY_NEW(START_BUTTON))
{
sPokedexView->menuY = 0;
sPokedexView->menuIsOpen = TRUE;
@@ -1690,7 +1690,7 @@ static void Task_HandlePokedexInput(u8 taskId)
gTasks[taskId].func = Task_HandlePokedexStartMenuInput;
PlaySE(SE_SELECT);
}
- else if (gMain.newKeys & SELECT_BUTTON)
+ else if (JOY_NEW(SELECT_BUTTON))
{
PlaySE(SE_SELECT);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK);
@@ -1704,7 +1704,7 @@ static void Task_HandlePokedexInput(u8 taskId)
PlaySE(SE_PC_LOGIN);
FreeWindowAndBgBuffers();
}
- else if (gMain.newKeys & B_BUTTON)
+ else if (JOY_NEW(B_BUTTON))
{
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK);
gTasks[taskId].func = Task_ClosePokedex;
@@ -1737,7 +1737,7 @@ static void Task_HandlePokedexStartMenuInput(u8 taskId)
}
else
{
- if (gMain.newKeys & A_BUTTON)
+ if (JOY_NEW(A_BUTTON))
{
switch (sPokedexView->menuCursorPos)
{
@@ -1768,18 +1768,18 @@ static void Task_HandlePokedexStartMenuInput(u8 taskId)
}
//Exit menu when Start or B is pressed
- if (gMain.newKeys & (START_BUTTON | B_BUTTON))
+ if (JOY_NEW(START_BUTTON | B_BUTTON))
{
sPokedexView->menuIsOpen = FALSE;
gTasks[taskId].func = Task_HandlePokedexInput;
PlaySE(SE_SELECT);
}
- else if ((gMain.newAndRepeatedKeys & DPAD_UP) && sPokedexView->menuCursorPos != 0)
+ else if ((JOY_REPEAT(DPAD_UP)) && sPokedexView->menuCursorPos != 0)
{
sPokedexView->menuCursorPos--;
PlaySE(SE_SELECT);
}
- else if ((gMain.newAndRepeatedKeys & DPAD_DOWN) && sPokedexView->menuCursorPos < 3)
+ else if ((JOY_REPEAT(DPAD_DOWN)) && sPokedexView->menuCursorPos < 3)
{
sPokedexView->menuCursorPos++;
PlaySE(SE_SELECT);
@@ -1873,7 +1873,7 @@ static void Task_HandleSearchResultsInput(u8 taskId)
}
else
{
- if ((gMain.newKeys & A_BUTTON) && sPokedexView->pokedexList[sPokedexView->selectedPokemon].seen)
+ if ((JOY_NEW(A_BUTTON)) && sPokedexView->pokedexList[sPokedexView->selectedPokemon].seen)
{
u32 a;
@@ -1885,7 +1885,7 @@ static void Task_HandleSearchResultsInput(u8 taskId)
PlaySE(SE_PIN);
FreeWindowAndBgBuffers();
}
- else if (gMain.newKeys & START_BUTTON)
+ else if (JOY_NEW(START_BUTTON))
{
sPokedexView->menuY = 0;
sPokedexView->menuIsOpen = TRUE;
@@ -1893,7 +1893,7 @@ static void Task_HandleSearchResultsInput(u8 taskId)
gTasks[taskId].func = Task_HandleSearchResultsStartMenuInput;
PlaySE(SE_SELECT);
}
- else if (gMain.newKeys & SELECT_BUTTON)
+ else if (JOY_NEW(SELECT_BUTTON))
{
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK);
gTasks[taskId].tTaskId = LoadSearchMenu();
@@ -1902,7 +1902,7 @@ static void Task_HandleSearchResultsInput(u8 taskId)
PlaySE(SE_PC_LOGIN);
FreeWindowAndBgBuffers();
}
- else if (gMain.newKeys & B_BUTTON)
+ else if (JOY_NEW(B_BUTTON))
{
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK);
gTasks[taskId].func = Task_ReturnToPokedexFromSearchResults;
@@ -1934,7 +1934,7 @@ static void Task_HandleSearchResultsStartMenuInput(u8 taskId)
}
else
{
- if (gMain.newKeys & A_BUTTON)
+ if (JOY_NEW(A_BUTTON))
{
switch (sPokedexView->menuCursorPos)
{
@@ -1970,18 +1970,18 @@ static void Task_HandleSearchResultsStartMenuInput(u8 taskId)
}
//Exit menu when Start or B is pressed
- if (gMain.newKeys & (START_BUTTON | B_BUTTON))
+ if (JOY_NEW(START_BUTTON | B_BUTTON))
{
sPokedexView->menuIsOpen = FALSE;
gTasks[taskId].func = Task_HandleSearchResultsInput;
PlaySE(SE_SELECT);
}
- else if ((gMain.newAndRepeatedKeys & DPAD_UP) && sPokedexView->menuCursorPos)
+ else if ((JOY_REPEAT(DPAD_UP)) && sPokedexView->menuCursorPos)
{
sPokedexView->menuCursorPos--;
PlaySE(SE_SELECT);
}
- else if ((gMain.newAndRepeatedKeys & DPAD_DOWN) && sPokedexView->menuCursorPos < 4)
+ else if ((JOY_REPEAT(DPAD_DOWN)) && sPokedexView->menuCursorPos < 4)
{
sPokedexView->menuCursorPos++;
PlaySE(SE_SELECT);
@@ -2590,7 +2590,7 @@ static u16 TryDoPokedexScroll(u16 selectedMon, u16 ignored)
u16 startingPos;
u8 scrollDir = 0;
- if ((gMain.heldKeys & DPAD_UP) && (selectedMon > 0))
+ if ((JOY_HELD(DPAD_UP)) && (selectedMon > 0))
{
scrollDir = 1;
selectedMon = GetNextPosition(1, selectedMon, 0, sPokedexView->pokemonListCount - 1);
@@ -2598,7 +2598,7 @@ static u16 TryDoPokedexScroll(u16 selectedMon, u16 ignored)
CreateMonListEntry(1, selectedMon, ignored);
PlaySE(SE_DEX_SCROLL);
}
- else if ((gMain.heldKeys & DPAD_DOWN) && (selectedMon < sPokedexView->pokemonListCount - 1))
+ else if (JOY_HELD(DPAD_DOWN) && (selectedMon < sPokedexView->pokemonListCount - 1))
{
scrollDir = 2;
selectedMon = GetNextPosition(0, selectedMon, 0, sPokedexView->pokemonListCount - 1);
@@ -2606,7 +2606,7 @@ static u16 TryDoPokedexScroll(u16 selectedMon, u16 ignored)
CreateMonListEntry(2, selectedMon, ignored);
PlaySE(SE_DEX_SCROLL);
}
- else if ((gMain.newKeys & DPAD_LEFT) && (selectedMon > 0))
+ else if (JOY_NEW(DPAD_LEFT) && (selectedMon > 0))
{
startingPos = selectedMon;
@@ -2617,7 +2617,7 @@ static u16 TryDoPokedexScroll(u16 selectedMon, u16 ignored)
CreateMonSpritesAtPos(selectedMon, 0xE);
PlaySE(SE_DEX_PAGE);
}
- else if ((gMain.newKeys & DPAD_RIGHT) && (selectedMon < sPokedexView->pokemonListCount - 1))
+ else if ((JOY_NEW(DPAD_RIGHT)) && (selectedMon < sPokedexView->pokemonListCount - 1))
{
startingPos = selectedMon;
for (i = 0; i < 7; i++)
@@ -2666,7 +2666,7 @@ static bool8 TryDoInfoScreenScroll(void)
u16 nextPokemon;
u16 selectedPokemon = sPokedexView->selectedPokemon;
- if ((gMain.newKeys & DPAD_UP) && selectedPokemon)
+ if ((JOY_NEW(DPAD_UP)) && selectedPokemon)
{
nextPokemon = selectedPokemon;
while (nextPokemon != 0)
@@ -2689,7 +2689,7 @@ static bool8 TryDoInfoScreenScroll(void)
return TRUE;
}
}
- else if ((gMain.newKeys & DPAD_DOWN) && selectedPokemon < sPokedexView->pokemonListCount - 1)
+ else if ((JOY_NEW(DPAD_DOWN)) && selectedPokemon < sPokedexView->pokemonListCount - 1)
{
nextPokemon = selectedPokemon;
while (nextPokemon < sPokedexView->pokemonListCount - 1)
@@ -3356,14 +3356,14 @@ static void Task_HandleInfoScreenInput(u8 taskId)
PlaySE(SE_DEX_SCROLL);
return;
}
- if (gMain.newKeys & B_BUTTON)
+ if (JOY_NEW(B_BUTTON))
{
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK);
gTasks[taskId].func = Task_ExitInfoScreen;
PlaySE(SE_PC_OFF);
return;
}
- if (gMain.newKeys & A_BUTTON)
+ if (JOY_NEW(A_BUTTON))
{
switch (sPokedexView->selectedScreen)
{
@@ -3400,8 +3400,8 @@ static void Task_HandleInfoScreenInput(u8 taskId)
}
return;
}
- if (((gMain.newKeys & DPAD_LEFT)
- || ((gMain.newKeys & L_BUTTON) && gSaveBlock2Ptr->optionsButtonMode == OPTIONS_BUTTON_MODE_LR))
+ if ((JOY_NEW(DPAD_LEFT)
+ || (JOY_NEW(L_BUTTON) && gSaveBlock2Ptr->optionsButtonMode == OPTIONS_BUTTON_MODE_LR))
&& sPokedexView->selectedScreen > 0)
{
sPokedexView->selectedScreen--;
@@ -3409,8 +3409,8 @@ static void Task_HandleInfoScreenInput(u8 taskId)
PlaySE(SE_DEX_PAGE);
return;
}
- if (((gMain.newKeys & DPAD_RIGHT)
- || ((gMain.newKeys & R_BUTTON) && gSaveBlock2Ptr->optionsButtonMode == OPTIONS_BUTTON_MODE_LR))
+ if ((JOY_NEW(DPAD_RIGHT)
+ || (JOY_NEW(R_BUTTON) && gSaveBlock2Ptr->optionsButtonMode == OPTIONS_BUTTON_MODE_LR))
&& sPokedexView->selectedScreen < CANCEL_SCREEN)
{
sPokedexView->selectedScreen++;
@@ -3630,7 +3630,7 @@ static void Task_HandleCryScreenInput(u8 taskId)
else
LoadPlayArrowPalette(FALSE);
- if (gMain.newKeys & A_BUTTON)
+ if (JOY_NEW(A_BUTTON))
{
LoadPlayArrowPalette(TRUE);
CryScreenPlayButton(NationalPokedexNumToSpecies(sPokedexListItem->dexNum));
@@ -3638,7 +3638,7 @@ static void Task_HandleCryScreenInput(u8 taskId)
}
else if (!gPaletteFade.active)
{
- if (gMain.newKeys & B_BUTTON)
+ if (JOY_NEW(B_BUTTON))
{
BeginNormalPaletteFade(0xFFFFFFEB, 0, 0, 0x10, RGB_BLACK);
m4aMPlayContinue(&gMPlayInfo_BGM);
@@ -3647,8 +3647,8 @@ static void Task_HandleCryScreenInput(u8 taskId)
PlaySE(SE_PC_OFF);
return;
}
- if ((gMain.newKeys & DPAD_LEFT)
- || ((gMain.newKeys & L_BUTTON) && gSaveBlock2Ptr->optionsButtonMode == OPTIONS_BUTTON_MODE_LR))
+ if ((JOY_NEW(DPAD_LEFT))
+ || ((JOY_NEW(L_BUTTON)) && gSaveBlock2Ptr->optionsButtonMode == OPTIONS_BUTTON_MODE_LR))
{
BeginNormalPaletteFade(0xFFFFFFEB, 0, 0, 0x10, RGB_BLACK);
m4aMPlayContinue(&gMPlayInfo_BGM);
@@ -3657,8 +3657,8 @@ static void Task_HandleCryScreenInput(u8 taskId)
PlaySE(SE_DEX_PAGE);
return;
}
- if ((gMain.newKeys & DPAD_RIGHT)
- || ((gMain.newKeys & R_BUTTON) && gSaveBlock2Ptr->optionsButtonMode == OPTIONS_BUTTON_MODE_LR))
+ if (JOY_NEW(DPAD_RIGHT)
+ || (JOY_NEW(R_BUTTON) && gSaveBlock2Ptr->optionsButtonMode == OPTIONS_BUTTON_MODE_LR))
{
if (!sPokedexListItem->owned)
{
@@ -3810,15 +3810,15 @@ static void Task_LoadSizeScreen(u8 taskId)
static void Task_HandleSizeScreenInput(u8 taskId)
{
- if (gMain.newKeys & B_BUTTON)
+ if (JOY_NEW(B_BUTTON))
{
BeginNormalPaletteFade(0xFFFFFFEB, 0, 0, 0x10, RGB_BLACK);
sPokedexView->screenSwitchState = 1;
gTasks[taskId].func = Task_SwitchScreensFromSizeScreen;
PlaySE(SE_PC_OFF);
}
- else if ((gMain.newKeys & DPAD_LEFT)
- || ((gMain.newKeys & L_BUTTON) && gSaveBlock2Ptr->optionsButtonMode == OPTIONS_BUTTON_MODE_LR))
+ else if ((JOY_NEW(DPAD_LEFT))
+ || ((JOY_NEW(L_BUTTON)) && gSaveBlock2Ptr->optionsButtonMode == OPTIONS_BUTTON_MODE_LR))
{
BeginNormalPaletteFade(0xFFFFFFEB, 0, 0, 0x10, RGB_BLACK);
sPokedexView->screenSwitchState = 2;
@@ -4010,7 +4010,7 @@ static void Task_DisplayCaughtMonDexPage(u8 taskId)
static void Task_HandleCaughtMonPageInput(u8 taskId)
{
- if (gMain.newKeys & (A_BUTTON | B_BUTTON))
+ if (JOY_NEW(A_BUTTON | B_BUTTON))
{
BeginNormalPaletteFade(0x0000FFFF, 0, 0, 16, RGB_BLACK);
gSprites[gTasks[taskId].tMonSpriteId].callback = SpriteCB_SlideCaughtMonToCenter;
@@ -4907,13 +4907,13 @@ static void Task_SwitchToSearchMenuTopBar(u8 taskId)
static void Task_HandleSearchTopBarInput(u8 taskId)
{
- if (gMain.newKeys & B_BUTTON)
+ if (JOY_NEW(B_BUTTON))
{
PlaySE(SE_PC_OFF);
gTasks[taskId].func = Task_ExitSearch;
return;
}
- if (gMain.newKeys & A_BUTTON)
+ if (JOY_NEW(A_BUTTON))
{
switch (gTasks[taskId].tTopBarItem)
{
@@ -4934,7 +4934,7 @@ static void Task_HandleSearchTopBarInput(u8 taskId)
}
return;
}
- if ((gMain.newKeys & DPAD_LEFT) && gTasks[taskId].tTopBarItem > SEARCH_TOPBAR_SEARCH)
+ if ((JOY_NEW(DPAD_LEFT)) && gTasks[taskId].tTopBarItem > SEARCH_TOPBAR_SEARCH)
{
PlaySE(SE_DEX_PAGE);
gTasks[taskId].tTopBarItem--;
@@ -4942,7 +4942,7 @@ static void Task_HandleSearchTopBarInput(u8 taskId)
CopyWindowToVram(0, 2);
CopyBgTilemapBufferToVram(3);
}
- if ((gMain.newKeys & DPAD_RIGHT) && gTasks[taskId].tTopBarItem < SEARCH_TOPBAR_CANCEL)
+ if ((JOY_NEW(DPAD_RIGHT)) && gTasks[taskId].tTopBarItem < SEARCH_TOPBAR_CANCEL)
{
PlaySE(SE_DEX_PAGE);
gTasks[taskId].tTopBarItem++;
@@ -4981,14 +4981,14 @@ static void Task_HandleSearchMenuInput(u8 taskId)
movementMap = sSearchMovementMap_SearchNatDex;
}
- if (gMain.newKeys & B_BUTTON)
+ if (JOY_NEW(B_BUTTON))
{
PlaySE(SE_BALL);
SetDefaultSearchModeAndOrder(taskId);
gTasks[taskId].func = Task_SwitchToSearchMenuTopBar;
return;
}
- if (gMain.newKeys & A_BUTTON)
+ if (JOY_NEW(A_BUTTON))
{
if (gTasks[taskId].tMenuItem == SEARCH_OK)
{
@@ -5023,7 +5023,7 @@ static void Task_HandleSearchMenuInput(u8 taskId)
return;
}
- if ((gMain.newKeys & DPAD_LEFT) && movementMap[gTasks[taskId].tMenuItem][0] != 0xFF)
+ if ((JOY_NEW(DPAD_LEFT)) && movementMap[gTasks[taskId].tMenuItem][0] != 0xFF)
{
PlaySE(SE_SELECT);
gTasks[taskId].tMenuItem = movementMap[gTasks[taskId].tMenuItem][0];
@@ -5031,7 +5031,7 @@ static void Task_HandleSearchMenuInput(u8 taskId)
CopyWindowToVram(0, 2);
CopyBgTilemapBufferToVram(3);
}
- if ((gMain.newKeys & DPAD_RIGHT) && movementMap[gTasks[taskId].tMenuItem][1] != 0xFF)
+ if (JOY_NEW(DPAD_RIGHT) && movementMap[gTasks[taskId].tMenuItem][1] != 0xFF)
{
PlaySE(SE_SELECT);
gTasks[taskId].tMenuItem = movementMap[gTasks[taskId].tMenuItem][1];
@@ -5039,7 +5039,7 @@ static void Task_HandleSearchMenuInput(u8 taskId)
CopyWindowToVram(0, 2);
CopyBgTilemapBufferToVram(3);
}
- if ((gMain.newKeys & DPAD_UP) && movementMap[gTasks[taskId].tMenuItem][2] != 0xFF)
+ if ((JOY_NEW(DPAD_UP)) && movementMap[gTasks[taskId].tMenuItem][2] != 0xFF)
{
PlaySE(SE_SELECT);
gTasks[taskId].tMenuItem = movementMap[gTasks[taskId].tMenuItem][2];
@@ -5047,7 +5047,7 @@ static void Task_HandleSearchMenuInput(u8 taskId)
CopyWindowToVram(0, 2);
CopyBgTilemapBufferToVram(3);
}
- if ((gMain.newKeys & DPAD_DOWN) && movementMap[gTasks[taskId].tMenuItem][3] != 0xFF)
+ if ((JOY_NEW(DPAD_DOWN)) && movementMap[gTasks[taskId].tMenuItem][3] != 0xFF)
{
PlaySE(SE_SELECT);
gTasks[taskId].tMenuItem = movementMap[gTasks[taskId].tMenuItem][3];
@@ -5091,7 +5091,7 @@ static void Task_WaitAndCompleteSearch(u8 taskId)
static void Task_SearchCompleteWaitForInput(u8 taskId)
{
- if (gMain.newKeys & A_BUTTON)
+ if (JOY_NEW(A_BUTTON))
{
if (sPokedexView->pokemonListCount != 0)
{
@@ -5144,7 +5144,7 @@ static void Task_HandleSearchParameterInput(u8 taskId)
cursorPos = &gTasks[taskId].data[sSearchOptions[menuItem].taskDataCursorPos];
scrollOffset = &gTasks[taskId].data[sSearchOptions[menuItem].taskDataScrollOffset];
maxOption = sSearchOptions[menuItem].numOptions - 1;
- if (gMain.newKeys & A_BUTTON)
+ if (JOY_NEW(A_BUTTON))
{
PlaySE(SE_PIN);
ClearSearchParameterBoxText();
@@ -5154,7 +5154,7 @@ static void Task_HandleSearchParameterInput(u8 taskId)
CopyBgTilemapBufferToVram(3);
return;
}
- if (gMain.newKeys & B_BUTTON)
+ if (JOY_NEW(B_BUTTON))
{
PlaySE(SE_BALL);
ClearSearchParameterBoxText();
@@ -5167,7 +5167,7 @@ static void Task_HandleSearchParameterInput(u8 taskId)
return;
}
moved = FALSE;
- if (gMain.newAndRepeatedKeys & DPAD_UP)
+ if (JOY_REPEAT(DPAD_UP))
{
if (*cursorPos != 0)
{
@@ -5193,7 +5193,7 @@ static void Task_HandleSearchParameterInput(u8 taskId)
}
return;
}
- if (gMain.newAndRepeatedKeys & DPAD_DOWN)
+ if (JOY_REPEAT(DPAD_DOWN))
{
if (*cursorPos < MAX_SEARCH_PARAM_CURSOR_POS && *cursorPos < maxOption)
{
@@ -5236,83 +5236,24 @@ static void Task_ExitSearchWaitForFade(u8 taskId)
}
}
-#ifdef NONMATCHING
-// This doesn't match because gcc flips the naming of the r7 and r6
-// registers. It also does one of the additions backwards.
void SetSearchRectHighlight(u8 flags, u8 x, u8 y, u8 width)
{
- u16 i;
- u16* ptr = GetBgTilemapBuffer(3);
+ u16 i, temp; //This would have been better as a pointer but here we are
+ u32 ptr = (u32)GetBgTilemapBuffer(3); //This should be a pointer, but this only matches as a u32.
- u16* temp;
for (i = 0; i < width; i++)
{
- // This addition is supposed to be done in this order; however,
- // gcc will always do it in ptr + (y * 32) order.
- temp = (y * 32) + ptr;
- temp[x + i] %= 0x1000;
- temp[x + i] |= flags * 0x1000;
+ temp = *(u16 *)(ptr + (y + 0) * 64 + (x + i) * 2);
+ temp &= 0x0fff;
+ temp |= (flags << 12);
+ *(u16 *)(ptr + (y + 0) * 64 + (x + i) * 2) = temp;
- temp[x + i + 32] %= 0x1000;
- temp[x + i + 32] |= flags * 0x1000;
+ temp = *(u16 *)(ptr + (y + 1) * 64 + (x + i) * 2);
+ temp &= 0x0fff;
+ temp |= (flags << 12);
+ *(u16 *)(ptr + (y + 1) * 64 + (x + i) * 2) = temp;
}
}
-#else
-NAKED
-void SetSearchRectHighlight(u8 flags, u8 x, u8 y, u8 width)
-{
- asm_unified(
- "push {r4-r7,lr}\n\
- mov r7, r8\n\
- push {r7}\n\
- adds r4, r3, 0\n\
- lsls r0, 24\n\
- lsrs r6, r0, 24\n\
- lsls r1, 24\n\
- lsrs r1, 24\n\
- mov r8, r1\n\
- lsls r2, 24\n\
- lsrs r5, r2, 24\n\
- lsls r4, 24\n\
- lsrs r4, 24\n\
- movs r0, 0x3\n\
- bl GetBgTilemapBuffer\n\
- adds r2, r0, 0\n\
- movs r3, 0\n\
- cmp r3, r4\n\
- bcs _080C1DEC\n\
- lsls r0, r5, 6\n\
- adds r7, r0, r2\n\
- ldr r5, =0x00000fff\n\
- lsls r2, r6, 12\n\
-_080C1DC8:\n\
- mov r0, r8\n\
- adds r1, r0, r3\n\
- lsls r1, 1\n\
- adds r1, r7\n\
- ldrh r0, [r1]\n\
- ands r0, r5\n\
- orrs r0, r2\n\
- strh r0, [r1]\n\
- adds r1, 0x40\n\
- ldrh r0, [r1]\n\
- ands r0, r5\n\
- orrs r0, r2\n\
- strh r0, [r1]\n\
- adds r0, r3, 0x1\n\
- lsls r0, 16\n\
- lsrs r3, r0, 16\n\
- cmp r3, r4\n\
- bcc _080C1DC8\n\
-_080C1DEC:\n\
- pop {r3}\n\
- mov r8, r3\n\
- pop {r4-r7}\n\
- pop {r0}\n\
- bx r0\n\
- .pool");
-}
-#endif
#define SEARCH_BG_SEARCH SEARCH_TOPBAR_SEARCH
#define SEARCH_BG_SHIFT SEARCH_TOPBAR_SHIFT