Change signedness and add casts to avoid implicit conversion warnings

This commit is contained in:
PokeCodec 2020-07-19 15:57:20 -04:00
parent 69a04f88f4
commit c5aa91741b
22 changed files with 99 additions and 112 deletions

View File

@ -41,7 +41,7 @@ u16 ReadFlashId(void)
u8 (*readFlash1)(u8 *);
SetReadFlash1(readFlash1Buffer);
readFlash1 = (u8 (*)(u8 *))((s32)readFlash1Buffer + 1);
readFlash1 = (u8 (*)(u8 *))((uintptr_t)readFlash1Buffer + 1);
// Enter ID mode.
FLASH_WRITE(0x5555, 0xAA);
@ -113,12 +113,12 @@ void SetReadFlash1(u16 *dest)
u16 *src;
u16 i;
PollFlashStatus = (u8 (*)(u8 *))((s32)dest + 1);
PollFlashStatus = (u8 (*)(u8 *))((uintptr_t)dest + 1);
src = (u16 *)ReadFlash1;
src = (u16 *)((s32)src ^ 1);
src = (u16 *)((uintptr_t)src ^ 1);
i = ((s32)SetReadFlash1 - (s32)ReadFlash1) >> 1;
i = ((uintptr_t)SetReadFlash1 - (uintptr_t)ReadFlash1) >> 1;
while (i != 0)
{
@ -154,10 +154,10 @@ void ReadFlash(u16 sectorNum, u32 offset, u8 *dest, u32 size)
}
funcSrc = (u16 *)ReadFlash_Core;
funcSrc = (u16 *)((s32)funcSrc ^ 1);
funcSrc = (u16 *)((uintptr_t)funcSrc ^ 1);
funcDest = readFlash_Core_Buffer;
i = ((s32)ReadFlash - (s32)ReadFlash_Core) >> 1;
i = ((uintptr_t)ReadFlash - (uintptr_t)ReadFlash_Core) >> 1;
while (i != 0)
{
@ -165,7 +165,7 @@ void ReadFlash(u16 sectorNum, u32 offset, u8 *dest, u32 size)
i--;
}
readFlash_Core = (void (*)(vu8 *, u8 *, u32))((s32)readFlash_Core_Buffer + 1);
readFlash_Core = (void (*)(vu8 *, u8 *, u32))((uintptr_t)readFlash_Core_Buffer + 1);
src = FLASH_BASE + (sectorNum << gFlash->sector.shift) + offset;
@ -202,10 +202,10 @@ u32 VerifyFlashSector(u16 sectorNum, u8 *src)
}
funcSrc = (u16 *)VerifyFlashSector_Core;
funcSrc = (u16 *)((s32)funcSrc ^ 1);
funcSrc = (u16 *)((uintptr_t)funcSrc ^ 1);
funcDest = verifyFlashSector_Core_Buffer;
i = ((s32)VerifyFlashSector - (s32)VerifyFlashSector_Core) >> 1;
i = (u16)(((uintptr_t)VerifyFlashSector - (uintptr_t)VerifyFlashSector_Core) >> 1);
while (i != 0)
{
@ -213,7 +213,7 @@ u32 VerifyFlashSector(u16 sectorNum, u8 *src)
i--;
}
verifyFlashSector_Core = (u32 (*)(u8 *, u8 *, u32))((s32)verifyFlashSector_Core_Buffer + 1);
verifyFlashSector_Core = (u32 (*)(u8 *, u8 *, u32))((uintptr_t)verifyFlashSector_Core_Buffer + 1);
tgt = FLASH_BASE + (sectorNum << gFlash->sector.shift);
size = gFlash->sector.size;
@ -239,10 +239,10 @@ u32 VerifyFlashSectorNBytes(u16 sectorNum, u8 *src, u32 n)
REG_WAITCNT = (REG_WAITCNT & ~WAITCNT_SRAM_MASK) | WAITCNT_SRAM_8;
funcSrc = (u16 *)VerifyFlashSector_Core;
funcSrc = (u16 *)((s32)funcSrc ^ 1);
funcSrc = (u16 *)((uintptr_t)funcSrc ^ 1);
funcDest = verifyFlashSector_Core_Buffer;
i = ((s32)VerifyFlashSector - (s32)VerifyFlashSector_Core) >> 1;
i = (u16)(((uintptr_t)VerifyFlashSector - (uintptr_t)VerifyFlashSector_Core) >> 1);
while (i != 0)
{
@ -250,7 +250,7 @@ u32 VerifyFlashSectorNBytes(u16 sectorNum, u8 *src, u32 n)
i--;
}
verifyFlashSector_Core = (u32 (*)(u8 *, u8 *, u32))((s32)verifyFlashSector_Core_Buffer + 1);
verifyFlashSector_Core = (u32 (*)(u8 *, u8 *, u32))((uintptr_t)verifyFlashSector_Core_Buffer + 1);
tgt = FLASH_BASE + (sectorNum << gFlash->sector.shift);
@ -293,4 +293,4 @@ u32 ProgramFlashSectorAndVerifyNBytes(u16 sectorNum, u8 *src, u32 n)
}
return result;
}
}

View File

@ -372,14 +372,11 @@ static void AnimTranslateStinger(struct Sprite *sprite)
{
gBattleAnimArgs[2] = -gBattleAnimArgs[2];
}
else
else if (GetBattlerSide(gBattleAnimAttacker))
{
if (GetBattlerSide(gBattleAnimAttacker))
{
gBattleAnimArgs[2] = -gBattleAnimArgs[2];
gBattleAnimArgs[1] = -gBattleAnimArgs[1];
gBattleAnimArgs[3] = -gBattleAnimArgs[3];
}
gBattleAnimArgs[2] = -gBattleAnimArgs[2];
gBattleAnimArgs[1] = -gBattleAnimArgs[1];
gBattleAnimArgs[3] = -gBattleAnimArgs[3];
}
if (!IsContest() && GetBattlerSide(gBattleAnimAttacker) == GetBattlerSide(gBattleAnimTarget))
@ -387,13 +384,8 @@ static void AnimTranslateStinger(struct Sprite *sprite)
if (GetBattlerPosition(gBattleAnimTarget) == B_POSITION_PLAYER_LEFT
|| GetBattlerPosition(gBattleAnimTarget) == B_POSITION_OPPONENT_LEFT)
{
s16 temp1, temp2;
temp1 = gBattleAnimArgs[2];
gBattleAnimArgs[2] = -temp1;
temp2 = gBattleAnimArgs[0];
gBattleAnimArgs[0] = -temp2;
gBattleAnimArgs[2] *= -1;
gBattleAnimArgs[0] *= -1;
}
}
@ -448,28 +440,24 @@ static void AnimMissileArc_Step(struct Sprite *sprite)
else
{
s16 tempData[8];
u16 *data = sprite->data;
u16 x1 = sprite->pos1.x;
s16 x2 = sprite->pos2.x;
u16 y1 = sprite->pos1.y;
s16 y2 = sprite->pos2.y;
s16 xpos, ypos;
int i;
for (i = 0; i < 8; i++)
tempData[i] = data[i];
tempData[i] = sprite->data[i];
x2 += x1;
y2 += y1;
xpos = sprite->pos1.x + sprite->pos2.x;
ypos = sprite->pos1.y + sprite->pos2.y;
if (!TranslateAnimHorizontalArc(sprite))
{
u16 rotation = ArcTan2Neg(sprite->pos1.x + sprite->pos2.x - x2,
sprite->pos1.y + sprite->pos2.y - y2);
u16 rotation = ArcTan2Neg(sprite->pos1.x + sprite->pos2.x - xpos, //Isn't this zero lol
sprite->pos1.y + sprite->pos2.y - ypos);
rotation += 0xC000;
TrySetSpriteRotScale(sprite, FALSE, 0x100, 0x100, rotation);
for (i = 0; i < 8; i++)
data[i] = tempData[i];
sprite->data[i] = tempData[i];
}
}
}

View File

@ -4445,7 +4445,7 @@ static void AnimBowMon_Step1_Callback(struct Sprite* sprite)
{
sprite->data[3] = gBattlerSpriteIds[gBattleAnimAttacker];
PrepareBattlerSpriteForRotScale(sprite->data[3], ST_OAM_OBJ_NORMAL);
sprite->data[4] = (sprite->data[6] = GetBattlerSide(gBattleAnimAttacker)) ? 0x300 : 0xFFFFFD00;
sprite->data[4] = (sprite->data[6] = GetBattlerSide(gBattleAnimAttacker)) ? 0x300 : (s16)0xFFFFFD00;
sprite->data[5] = 0;
}

View File

@ -1331,7 +1331,7 @@ void ResetBerryTreeSparkleFlags(void)
s16 bottom;
int i;
GetCameraCoords(&cam_left, &cam_top);
GetCameraCoords((u16*)&cam_left, (u16*)&cam_top);
left = cam_left;
top = cam_top + 3;
right = cam_left + 14;

View File

@ -116,8 +116,8 @@ struct BerryBlenderData
u16 field_116;
u16 field_118;
u16 field_11A;
u16 bg_X;
u16 bg_Y;
s16 bg_X;
s16 bg_Y;
u8 field_120[3];
u8 field_123;
u16 scores[BLENDER_MAX_PLAYERS][BLENDER_SCORES_NO];
@ -3166,13 +3166,13 @@ static void sub_80832E8(s16* a0)
static void sub_808330C(void)
{
sub_80832E8(&sBerryBlenderData->bg_X);
sub_80832E8(&sBerryBlenderData->bg_Y);
sub_80832E8((s16 *)&sBerryBlenderData->bg_X);
sub_80832E8((s16 *)&sBerryBlenderData->bg_Y);
}
static void sub_8083334(s16* a0, u16 a1)
{
s32 var;
u8 var;
if (a1 < 10)
var = 16;

View File

@ -2537,7 +2537,7 @@ u8 sub_811BBBC(void)
return sEasyChatScreen->unk_0c;
}
void sub_811BBC8(u8 *arg0, u8 *arg1)
static void sub_811BBC8(s8 *arg0, s8 *arg1)
{
*arg0 = sEasyChatScreen->unk_10;
*arg1 = sEasyChatScreen->unk_11;
@ -4529,18 +4529,18 @@ static void sub_811E30C(void)
x = var0 * 13;
x = x * 8 + 28;
y = var1 * 16 + 96;
sub_811E34C(x, y);
sub_811E34C((u8)x, (u8)y);
}
static void sub_811E34C(u8 x, u8 y)
{
if (sUnknown_0203A11C->unk2E4)
{
sUnknown_0203A11C->unk2E4->pos1.x = x;
sUnknown_0203A11C->unk2E4->pos1.y = y;
sUnknown_0203A11C->unk2E4->pos2.x = 0;
sUnknown_0203A11C->unk2E4->data[0] = 0;
}
if (!sUnknown_0203A11C->unk2E4)
return;
sUnknown_0203A11C->unk2E4->pos1.x = (s16)x;
sUnknown_0203A11C->unk2E4->pos1.y = (s16)y;
sUnknown_0203A11C->unk2E4->pos2.x = 0;
sUnknown_0203A11C->unk2E4->data[0] = 0;
}
static void sub_811E380(void)

View File

@ -8950,7 +8950,7 @@ void CreateLevitateMovementTask(struct ObjectEvent *objectEvent)
u8 taskId = CreateTask(ApplyLevitateMovement, 0xFF);
struct Task *task = &gTasks[taskId];
StoreWordInTwoHalfwords(&task->data[0], (u32)objectEvent);
StoreWordInTwoHalfwords((u16 *)&task->data[0], (u32)objectEvent);
objectEvent->warpArrowSpriteId = taskId;
task->data[3] = 0xFFFF;
}
@ -8961,7 +8961,7 @@ static void ApplyLevitateMovement(u8 taskId)
struct Sprite *sprite;
struct Task *task = &gTasks[taskId];
LoadWordFromTwoHalfwords(&task->data[0], (u32 *)&objectEvent); // load the map object pointer.
LoadWordFromTwoHalfwords((u16 *)&task->data[0], (u32 *)&objectEvent); // load the map object pointer.
sprite = &gSprites[objectEvent->spriteId];
if(!(task->data[2] & 0x3))
@ -8978,7 +8978,7 @@ void DestroyExtraMovementTask(u8 taskId)
struct ObjectEvent *objectEvent;
struct Task *task = &gTasks[taskId];
LoadWordFromTwoHalfwords(&task->data[0], (u32 *)&objectEvent); // unused objectEvent
LoadWordFromTwoHalfwords((u16 *)&task->data[0], (u32 *)&objectEvent); // unused objectEvent
DestroyTask(taskId);
}

View File

@ -2501,7 +2501,7 @@ static void sub_80B8584(struct Task *task)
{
task->data[11] = REG_WININ;
task->data[12] = REG_WINOUT;
StoreWordInTwoHalfwords(&task->data[13], (u32)gMain.vblankCallback);
StoreWordInTwoHalfwords((u16 *)&task->data[13], (u32)gMain.vblankCallback);
task->data[1] = 0xf0f1;
task->data[2] = 0x5051;
task->data[3] = 0x3f;

View File

@ -612,7 +612,7 @@ static void Task_Hof_PrintMonInfoAfterAnimating(u8 taskId)
static void Task_Hof_TryDisplayAnotherMon(u8 taskId)
{
u16 currPokeID = gTasks[taskId].tDisplayedMonId;
u16 currPokeID = (u16)gTasks[taskId].tDisplayedMonId;
struct HallofFameMon* currMon = &sHofMonPtr->mon[currPokeID];
if (gTasks[taskId].tFrameCount != 0)
@ -1483,7 +1483,7 @@ static void UpdateDomeConfetti(struct ConfettiUtil *util)
static void Task_DoDomeConfetti(u8 taskId)
{
u32 id = 0;
u16 *data = gTasks[taskId].data;
u16 *data = (u16 *)gTasks[taskId].data;
switch (tState)
{

View File

@ -721,7 +721,7 @@ static void ItemUseOnFieldCB_WailmerPailBerry(u8 taskId)
static bool8 TryToWaterSudowoodo(void)
{
u16 x, y;
s16 x, y;
u8 z;
u8 objId;
GetXYCoordsOneStepInFrontOfPlayer(&x, &y);

View File

@ -1257,17 +1257,17 @@ void ListMenuSetUpRedOutlineCursorSpriteOamTable(u16 rowWidth, u16 rowHeight, st
s32 i, j, id = 0;
subsprites[id] = sSubsprite_RedOutline1;
subsprites[id].x = 136;
subsprites[id].y = 136;
subsprites[id].x = -120;
subsprites[id].y = -120;
id++;
subsprites[id] = sSubsprite_RedOutline2;
subsprites[id].x = rowWidth + 128;
subsprites[id].y = 136;
subsprites[id].y = -120;
id++;
subsprites[id] = sSubsprite_RedOutline7;
subsprites[id].x = 136;
subsprites[id].x = -120;
subsprites[id].y = rowHeight + 128;
id++;
@ -1297,7 +1297,7 @@ void ListMenuSetUpRedOutlineCursorSpriteOamTable(u16 rowWidth, u16 rowHeight, st
for (j = 8; j < rowHeight - 8; j += 8)
{
subsprites[id] = sSubsprite_RedOutline4;
subsprites[id].x = 136;
subsprites[id].x = -120;
subsprites[id].y = j - 120;
id++;

View File

@ -168,7 +168,7 @@ const struct PulseBlendSettings gMirageTowerPulseBlendSettings = {
.numColors = 15,
.delay = 5,
.numFadeCycles = -1,
.maxBlendCoeff = 11,
.maxBlendCoeff = -5,
.fadeType = 1,
.restorePaletteOnUnload = FALSE,
.unk7_7 = 1,
@ -412,10 +412,9 @@ void DoMirageTowerCeilingCrumble(void)
static void WaitCeilingCrumble(u8 taskId)
{
u16 *data = gTasks[taskId].data;
data[1]++;
u16 *data = (u16 *)gTasks[taskId].data;
// Either wait 1000 frames, or until all 16 crumble sprites and the one screen-shake task are completed.
if (data[1] == 1000 || data[0] == 17)
if (++data[1] == 1000 || data[0] == 17)
gTasks[taskId].func = FinishCeilingCrumbleTask;
}

View File

@ -3212,7 +3212,7 @@ static void SpriteCB_LinkPlayer(struct Sprite *sprite)
SetObjectSubpriorityByZCoord(objEvent->previousElevation, sprite, 1);
sprite->oam.priority = ZCoordToPriority(objEvent->previousElevation);
if (!linkPlayerObjEvent->movementMode != MOVEMENT_MODE_FREE)
if (linkPlayerObjEvent->movementMode == MOVEMENT_MODE_FREE)
StartSpriteAnim(sprite, GetFaceDirectionAnimNum(objEvent->range.as_byte));
else
StartSpriteAnimIfDifferent(sprite, GetMoveDirectionAnimNum(objEvent->range.as_byte));

View File

@ -1862,7 +1862,7 @@ u8 GetMonAilment(struct Pokemon *mon)
static void SetPartyMonsAllowedInMinigame(void)
{
u16 *ptr;
s16 *ptr;
if (gPartyMenu.menuType == PARTY_MENU_TYPE_MINIGAME)
{
@ -4951,9 +4951,9 @@ static void Task_DisplayLevelUpStatsPg2(u8 taskId)
static void DisplayLevelUpStatsPg1(u8 taskId)
{
s16 *arrayPtr = sPartyMenuInternal->data;
u16 *arrayPtr = (u16*)sPartyMenuInternal->data;
arrayPtr[12] = CreateLevelUpStatsWindow();
arrayPtr[12] = (u16)CreateLevelUpStatsWindow();
DrawLevelUpWindowPg1(arrayPtr[12], arrayPtr, &arrayPtr[6], TEXT_COLOR_WHITE, TEXT_COLOR_DARK_GREY, TEXT_COLOR_LIGHT_GREY);
CopyWindowToVram(arrayPtr[12], 2);
ScheduleBgCopyTilemapToVram(2);
@ -4961,7 +4961,7 @@ static void DisplayLevelUpStatsPg1(u8 taskId)
static void DisplayLevelUpStatsPg2(u8 taskId)
{
s16 *arrayPtr = sPartyMenuInternal->data;
u16 *arrayPtr = (u16 *)sPartyMenuInternal->data;
DrawLevelUpWindowPg2(arrayPtr[12], &arrayPtr[6], TEXT_COLOR_WHITE, TEXT_COLOR_DARK_GREY, TEXT_COLOR_LIGHT_GREY);
CopyWindowToVram(arrayPtr[12], 2);

View File

@ -327,7 +327,7 @@ void PlayerPC(void)
static void InitPlayerPCMenu(u8 taskId)
{
u16 *data;
s16 *data;
struct WindowTemplate windowTemplate;
data = gTasks[taskId].data;
@ -346,7 +346,7 @@ static void InitPlayerPCMenu(u8 taskId)
static void PlayerPCProcessMenuInput(u8 taskId)
{
u16 *data;
s16 *data;
s8 inputOptionId;
data = gTasks[taskId].data;
@ -435,7 +435,7 @@ static void PlayerPC_TurnOff(u8 taskId)
static void InitItemStorageMenu(u8 taskId, u8 var)
{
u16 *data;
s16 *data;
struct WindowTemplate windowTemplate;
data = gTasks[taskId].data;
@ -548,7 +548,7 @@ static void ItemStorage_Toss(u8 taskId)
static void ItemStorage_WithdrawToss_Helper(u8 taskId, bool8 toss)
{
u16 *data = gTasks[taskId].data;
s16 *data = gTasks[taskId].data;
data[3] = toss;
sub_816B4DC(taskId);
@ -581,9 +581,9 @@ static void ItemStorage_SetItemAndMailCount(u8 taskId)
static void sub_816B4DC(u8 taskId)
{
u16 *data = gTasks[taskId].data;
u16 *data = (u16 *)gTasks[taskId].data;
ClearStdWindowAndFrameToTransparent(data[4], FALSE);
ClearStdWindowAndFrameToTransparent((u8)data[4], FALSE);
ClearWindowTilemap(data[4]);
RemoveWindow(data[4]);
ScheduleBgCopyTilemapToVram(0);
@ -1380,7 +1380,7 @@ static void ItemStorage_DoItemToss(u8 taskId)
data = gTasks[taskId].data;
b = (playerPCItemPageInfo.cursorPos + playerPCItemPageInfo.itemsAbove);
if (!ItemId_GetImportance(gSaveBlock1Ptr->pcItems[b].itemId))
if (ItemId_GetImportance(gSaveBlock1Ptr->pcItems[b].itemId) == 0)
{
CopyItemName(gSaveBlock1Ptr->pcItems[b].itemId, gStringVar1);
ConvertIntToDecimalStringN(gStringVar2, data[2], STR_CONV_MODE_LEFT_ALIGN, 3);

View File

@ -5117,9 +5117,9 @@ static void Task_SelectSearchMenuItem(u8 taskId)
u16 *scrollOffset;
DrawOrEraseSearchParameterBox(FALSE);
menuItem = gTasks[taskId].tMenuItem;
cursorPos = &gTasks[taskId].data[sSearchOptions[menuItem].taskDataCursorPos];
scrollOffset = &gTasks[taskId].data[sSearchOptions[menuItem].taskDataScrollOffset];
menuItem = (u16)gTasks[taskId].tMenuItem;
cursorPos = (u16*)&gTasks[taskId].data[sSearchOptions[menuItem].taskDataCursorPos];
scrollOffset = (u16*)&gTasks[taskId].data[sSearchOptions[menuItem].taskDataScrollOffset];
gTasks[taskId].tCursorPos = *cursorPos;
gTasks[taskId].tScrollOffset = *scrollOffset;
PrintSearchParameterText(taskId);

View File

@ -633,7 +633,7 @@ static const struct UnkStruct1 gUnknown_085B6388[] =
.var05 = 1,
.var06 = 0xFF,
.var07_0 = 8,
.var07_5 = 2,
.var07_5 = -2,
.var07_7 = 0
},
{
@ -643,7 +643,7 @@ static const struct UnkStruct1 gUnknown_085B6388[] =
.var05 = 1,
.var06 = 0xFF,
.var07_0 = 8,
.var07_5 = 2,
.var07_5 = -2,
.var07_7 = 0
},
{
@ -653,7 +653,7 @@ static const struct UnkStruct1 gUnknown_085B6388[] =
.var05 = 1,
.var06 = 0xFF,
.var07_0 = 8,
.var07_5 = 2,
.var07_5 = -2,
.var07_7 = 0
},
{
@ -663,7 +663,7 @@ static const struct UnkStruct1 gUnknown_085B6388[] =
.var05 = 1,
.var06 = 0xFF,
.var07_0 = 8,
.var07_5 = 2,
.var07_5 = -2,
.var07_7 = 0
},
{
@ -673,7 +673,7 @@ static const struct UnkStruct1 gUnknown_085B6388[] =
.var05 = 1,
.var06 = 0xFF,
.var07_0 = 8,
.var07_5 = 2,
.var07_5 = -2,
.var07_7 = 0
},
{
@ -683,7 +683,7 @@ static const struct UnkStruct1 gUnknown_085B6388[] =
.var05 = 1,
.var06 = 0xFF,
.var07_0 = 8,
.var07_5 = 2,
.var07_5 = -2,
.var07_7 = 0
},
{
@ -693,7 +693,7 @@ static const struct UnkStruct1 gUnknown_085B6388[] =
.var05 = 1,
.var06 = 0xFF,
.var07_0 = 8,
.var07_5 = 2,
.var07_5 = -2,
.var07_7 = 0
},
{
@ -703,7 +703,7 @@ static const struct UnkStruct1 gUnknown_085B6388[] =
.var05 = 1,
.var06 = 0xFF,
.var07_0 = 8,
.var07_5 = 2,
.var07_5 = -2,
.var07_7 = 0
},
{
@ -713,7 +713,7 @@ static const struct UnkStruct1 gUnknown_085B6388[] =
.var05 = 1,
.var06 = 0xFF,
.var07_0 = 8,
.var07_5 = 2,
.var07_5 = -2,
.var07_7 = 0
},
{
@ -723,7 +723,7 @@ static const struct UnkStruct1 gUnknown_085B6388[] =
.var05 = 1,
.var06 = 0xFF,
.var07_0 = 8,
.var07_5 = 2,
.var07_5 = -2,
.var07_7 = 0
},
{
@ -733,7 +733,7 @@ static const struct UnkStruct1 gUnknown_085B6388[] =
.var05 = 1,
.var06 = 0xFF,
.var07_0 = 8,
.var07_5 = 2,
.var07_5 = -2,
.var07_7 = 0
},
{
@ -743,7 +743,7 @@ static const struct UnkStruct1 gUnknown_085B6388[] =
.var05 = 1,
.var06 = 0xFF,
.var07_0 = 8,
.var07_5 = 2,
.var07_5 = -2,
.var07_7 = 0
},
{
@ -753,7 +753,7 @@ static const struct UnkStruct1 gUnknown_085B6388[] =
.var05 = 10,
.var06 = 0xFF,
.var07_0 = 14,
.var07_5 = 2,
.var07_5 = -2,
.var07_7 = 0
},
};
@ -767,7 +767,7 @@ static const struct UnkStruct1 gUnknown_085B63F0[] =
.var05 = 30,
.var06 = 0xFF,
.var07_0 = 14,
.var07_5 = 2,
.var07_5 = -2,
.var07_7 = 0
},
{
@ -777,7 +777,7 @@ static const struct UnkStruct1 gUnknown_085B63F0[] =
.var05 = 30,
.var06 = 0xFF,
.var07_0 = 14,
.var07_5 = 2,
.var07_5 = -2,
.var07_7 = 0
},
{
@ -787,7 +787,7 @@ static const struct UnkStruct1 gUnknown_085B63F0[] =
.var05 = 30,
.var06 = 0xFF,
.var07_0 = 14,
.var07_5 = 2,
.var07_5 = -2,
.var07_7 = 0
}
};

View File

@ -788,8 +788,8 @@ bool8 ScrCmd_warphole(struct ScriptContext *ctx)
{
u8 mapGroup = ScriptReadByte(ctx);
u8 mapNum = ScriptReadByte(ctx);
u16 x;
u16 y;
s16 x;
s16 y;
PlayerGetDestCoords(&x, &y);
if (mapGroup == 0xFF && mapNum == 0xFF)

View File

@ -964,7 +964,7 @@ static void HandleRegistryMenuInput(u8 taskId)
data = gTasks[taskId].data;
input = ListMenu_ProcessInput(data[5]);
ListMenuGetScrollAndRow(data[5], &data[2], &data[1]);
ListMenuGetScrollAndRow((u8)data[5], (u16 *)&data[2], (u16 *)&data[1]);
switch (input)
{
case LIST_NOTHING_CHOSEN:
@ -1045,10 +1045,10 @@ void DeleteRegistry_Yes_Callback(u8 taskId)
{
s16 *data = gTasks[taskId].data;
ClearDialogWindowAndFrame(0, 0);
DestroyListMenuTask(data[5], &data[2], &data[1]);
DestroyListMenuTask((u8)data[5], (u16 *)&data[2], (u16 *)&data[1]);
gSaveBlock1Ptr->secretBases[data[4]].registryStatus = 0;
BuildRegistryMenuItems(taskId);
sub_812225C(&data[2], &data[1], data[3], data[0]);
sub_812225C((u16 *)&data[2], (u16 *)&data[1], (u16)data[3], (u16)data[0]);
FinalizeRegistryMenu(taskId);
gTasks[taskId].func = HandleRegistryMenuInput;
}
@ -1062,7 +1062,7 @@ static void DeleteRegistry_No(u8 taskId)
{
s16 *data = gTasks[taskId].data;
ClearDialogWindowAndFrame(0, 0);
DestroyListMenuTask(data[5], &data[2], &data[1]);
DestroyListMenuTask((u8)data[5], (u16 *)&data[2], (u16 *)&data[1]);
FinalizeRegistryMenu(taskId);
gTasks[taskId].func = HandleRegistryMenuInput;
}

View File

@ -775,7 +775,7 @@ static void PlaySlotMachine_Internal(u8 slotMachineIndex, MainCallback cb)
{
struct Task *task = &gTasks[CreateTask(SlotMachineDummyTask, 0xFF)];
task->data[0] = slotMachineIndex;
StoreWordInTwoHalfwords(task->data + 1, (intptr_t)cb);
StoreWordInTwoHalfwords((u16 *)(task->data + 1), (intptr_t)cb);
}

View File

@ -463,7 +463,7 @@ static bool32 InitStartMenuStep(void)
sInitStartMenuData[0]++;
break;
case 4:
if (PrintStartMenuActions(&sInitStartMenuData[1], 2))
if (PrintStartMenuActions((s8 *)&sInitStartMenuData[1], 2))
sInitStartMenuData[0]++;
break;
case 5:

View File

@ -603,7 +603,7 @@ static void sub_80B44C8(u8 taskId)
struct ObjectEvent *objEvent;
// another objEvent loaded into by loadword?
LoadWordFromTwoHalfwords(&task->data[1], (u32 *)&objEvent);
LoadWordFromTwoHalfwords((u16*)&task->data[1], (u32 *)&objEvent);
if (!task->data[7])
{
ObjectEventClearHeldMovement(objEvent);
@ -624,7 +624,7 @@ static void sub_80B44C8(u8 taskId)
void sub_80B4578(struct ObjectEvent *var)
{
StoreWordInTwoHalfwords(&gTasks[CreateTask(sub_80B44C8, 0)].data[1], (u32)var);
StoreWordInTwoHalfwords((u16 *)&gTasks[CreateTask(sub_80B44C8, 0)].data[1], (u32)var);
}
void EndTrainerApproach(void)