sizeOf data type, not pointer value

This commit is contained in:
PokeCodec 2020-08-23 18:50:57 -04:00
parent d7e31f5a85
commit 6aee7d38f3
10 changed files with 27 additions and 27 deletions

View File

@ -5534,7 +5534,7 @@ static void Task_ShowTourneyTree(u8 taskId)
gTasks[taskId].tState++;
break;
case 2:
sTilemapBuffer = AllocZeroed(0x800);
sTilemapBuffer = AllocZeroed(BG_SCREEN_SIZE);
LZDecompressWram(gDomeTourneyLineMask_Tilemap, sTilemapBuffer);
SetBgTilemapBuffer(1, sTilemapBuffer);
CopyBgTilemapBufferToVram(1);

View File

@ -485,7 +485,7 @@ static void CB2_ShowTrainerHillRecords(void)
gMain.state++;
break;
case 2:
sTilemapBuffer = AllocZeroed(0x800);
sTilemapBuffer = AllocZeroed(BG_SCREEN_SIZE);
ResetBgsAndClearDma3BusyFlags(0);
InitBgsFromTemplates(0, sTrainerHillRecordsBgTemplates, ARRAY_COUNT(sTrainerHillRecordsBgTemplates));
SetBgTilemapBuffer(3, sTilemapBuffer);

View File

@ -1160,7 +1160,7 @@ static void sub_8175548(void)
{
ResetBgsAndClearDma3BusyFlags(0);
InitBgsFromTemplates(0, sBackgroundTemplates, 1);
SetBgTilemapBuffer(0, AllocZeroed(0x800));
SetBgTilemapBuffer(0, AllocZeroed(BG_SCREEN_SIZE));
LoadPalette(gUnknown_085E56F0, 0x80, 0x40);
InitWindows(sWindowTemplates);
DeactivateAllTextPrinters();

View File

@ -1075,17 +1075,17 @@ s8 Menu_ProcessInputNoWrapAround_other(void)
PlaySE(SE_SELECT);
return sMenu.cursorPos;
}
else if (gMain.newKeys & B_BUTTON)
if (gMain.newKeys & B_BUTTON)
{
return MENU_B_PRESSED;
}
else if ((gMain.newAndRepeatedKeys & DPAD_ANY) == DPAD_UP)
if ((gMain.newAndRepeatedKeys & DPAD_ANY) == DPAD_UP)
{
if (oldPos != Menu_MoveCursorNoWrapAround(-1))
PlaySE(SE_SELECT);
return MENU_NOTHING_CHOSEN;
}
else if ((gMain.newAndRepeatedKeys & DPAD_ANY) == DPAD_DOWN)
if ((gMain.newAndRepeatedKeys & DPAD_ANY) == DPAD_DOWN)
{
if (oldPos != Menu_MoveCursorNoWrapAround(1))
PlaySE(SE_SELECT);

View File

@ -430,7 +430,7 @@ static const struct ListMenuTemplate sPokeblockListMenuTemplate =
// code
void OpenPokeblockCase(u8 caseId, void (*callback)(void))
{
sPokeblockMenu = Alloc(sizeof(*sPokeblockMenu));
sPokeblockMenu = Alloc(sizeof(struct PokeblockMenuStruct));
sPokeblockMenu->caseId = caseId;
sPokeblockMenu->callbackOnUse = NULL;
sPokeblockMenu->unkTaskId = 0xFF;

View File

@ -2060,10 +2060,10 @@ static bool8 LoadPokedexListPage(u8 page)
SetGpuReg(REG_OFFSET_BG2VOFS, sPokedexView->initialVOffset);
ResetBgsAndClearDma3BusyFlags(0);
InitBgsFromTemplates(0, sPokedex_BgTemplate, ARRAY_COUNT(sPokedex_BgTemplate));
SetBgTilemapBuffer(3, AllocZeroed(0x800));
SetBgTilemapBuffer(2, AllocZeroed(0x800));
SetBgTilemapBuffer(1, AllocZeroed(0x800));
SetBgTilemapBuffer(0, AllocZeroed(0x800));
SetBgTilemapBuffer(3, AllocZeroed(BG_SCREEN_SIZE));
SetBgTilemapBuffer(2, AllocZeroed(BG_SCREEN_SIZE));
SetBgTilemapBuffer(1, AllocZeroed(BG_SCREEN_SIZE));
SetBgTilemapBuffer(0, AllocZeroed(BG_SCREEN_SIZE));
DecompressAndLoadBgGfxUsingHeap(3, gPokedexMenu_Gfx, 0x2000, 0, 0);
CopyToBgTilemapBuffer(1, gPokedexList_Tilemap, 0, 0);
CopyToBgTilemapBuffer(3, gPokedexListUnderlay_Tilemap, 0, 0);
@ -3186,10 +3186,10 @@ static u8 LoadInfoScreen(struct PokedexListItem* item, u8 monSpriteId)
gTasks[taskId].data[5] = 255;
ResetBgsAndClearDma3BusyFlags(0);
InitBgsFromTemplates(0, sInfoScreen_BgTemplate, ARRAY_COUNT(sInfoScreen_BgTemplate));
SetBgTilemapBuffer(3, AllocZeroed(0x800));
SetBgTilemapBuffer(2, AllocZeroed(0x800));
SetBgTilemapBuffer(1, AllocZeroed(0x800));
SetBgTilemapBuffer(0, AllocZeroed(0x800));
SetBgTilemapBuffer(3, AllocZeroed(BG_SCREEN_SIZE));
SetBgTilemapBuffer(2, AllocZeroed(BG_SCREEN_SIZE));
SetBgTilemapBuffer(1, AllocZeroed(BG_SCREEN_SIZE));
SetBgTilemapBuffer(0, AllocZeroed(BG_SCREEN_SIZE));
InitWindows(sInfoScreen_WindowTemplates);
DeactivateAllTextPrinters();
@ -3951,8 +3951,8 @@ static void Task_DisplayCaughtMonDexPage(u8 taskId)
ResetOtherVideoRegisters(DISPCNT_BG0_ON);
ResetBgsAndClearDma3BusyFlags(0);
InitBgsFromTemplates(0, sNewEntryInfoScreen_BgTemplate, ARRAY_COUNT(sNewEntryInfoScreen_BgTemplate));
SetBgTilemapBuffer(3, AllocZeroed(0x800));
SetBgTilemapBuffer(2, AllocZeroed(0x800));
SetBgTilemapBuffer(3, AllocZeroed(BG_SCREEN_SIZE));
SetBgTilemapBuffer(2, AllocZeroed(BG_SCREEN_SIZE));
InitWindows(sNewEntryInfoScreen_WindowTemplates);
DeactivateAllTextPrinters();
gTasks[taskId].tState = 1;
@ -4820,10 +4820,10 @@ static void Task_LoadSearchMenu(u8 taskId)
ResetOtherVideoRegisters(0);
ResetBgsAndClearDma3BusyFlags(0);
InitBgsFromTemplates(0, sSearchMenu_BgTemplate, ARRAY_COUNT(sSearchMenu_BgTemplate));
SetBgTilemapBuffer(3, AllocZeroed(0x800));
SetBgTilemapBuffer(2, AllocZeroed(0x800));
SetBgTilemapBuffer(1, AllocZeroed(0x800));
SetBgTilemapBuffer(0, AllocZeroed(0x800));
SetBgTilemapBuffer(3, AllocZeroed(BG_SCREEN_SIZE));
SetBgTilemapBuffer(2, AllocZeroed(BG_SCREEN_SIZE));
SetBgTilemapBuffer(1, AllocZeroed(BG_SCREEN_SIZE));
SetBgTilemapBuffer(0, AllocZeroed(BG_SCREEN_SIZE));
InitWindows(sSearchMenu_WindowTemplate);
DeactivateAllTextPrinters();
PutWindowTilemap(0);

View File

@ -406,7 +406,7 @@ void StartPokemonJump(u16 partyIndex, MainCallback callback)
if (gReceivedRemoteLinkPlayers)
{
gUnknown_02022CFC = Alloc(sizeof(*gUnknown_02022CFC));
gUnknown_02022CFC = Alloc(sizeof(struct PokemonJump1));
if (gUnknown_02022CFC)
{
ResetTasks();

View File

@ -2157,7 +2157,7 @@ static void Cb2_EnterPSS(u8 boxOption)
{
ResetTasks();
sCurrentBoxOption = boxOption;
sPSSData = Alloc(sizeof(*sPSSData));
sPSSData = Alloc(sizeof(struct PokemonStorageSystemData));
if (sPSSData == NULL)
{
SetMainCallback2(Cb2_ExitPSS);
@ -2177,7 +2177,7 @@ static void Cb2_EnterPSS(u8 boxOption)
static void Cb2_ReturnToPSS(void)
{
ResetTasks();
sPSSData = Alloc(sizeof(*sPSSData));
sPSSData = Alloc(sizeof(struct PokemonStorageSystemData));
if (sPSSData == NULL)
{
SetMainCallback2(Cb2_ExitPSS);

View File

@ -317,7 +317,7 @@ static void Task_RunLoopedTask_LinkMode(u8 taskId)
void CB2_InitPokeNav(void)
{
gPokenavResources = Alloc(sizeof(*gPokenavResources));
gPokenavResources = Alloc(sizeof(struct PokenavResources));
if (gPokenavResources == NULL)
{
SetMainCallback2(CB2_ReturnToFieldWithOpenMenu);
@ -345,7 +345,7 @@ static void CB2_InitPokenavForTutorial(void)
if (gPaletteFade.active)
return;
gPokenavResources = Alloc(sizeof(*gPokenavResources));
gPokenavResources = Alloc(sizeof(struct PokenavResources));
if (gPokenavResources == NULL)
{
SetMainCallback2(CB2_ReturnToFieldContinueScriptPlayMapMusic);

View File

@ -2121,7 +2121,7 @@ static void Task_ReceiveChatMessage(u8 taskId)
static bool8 TryAllocDisplay(void)
{
sDisplay = Alloc(sizeof(*sDisplay));
sDisplay = Alloc(sizeof(struct UnionRoomChatDisplay));
if (sDisplay && TryAllocSprites())
{
ResetBgsAndClearDma3BusyFlags(0);