mirror of https://github.com/n64decomp/mk64.git
Replace effect bit_flags with defined values
This commit is contained in:
parent
1dc1592082
commit
495a7f428c
|
|
@ -2375,17 +2375,17 @@ void func_800C70A8(u8 playerId) {
|
|||
D_800E9E74[playerId] = 0x0000001B;
|
||||
break;
|
||||
}
|
||||
if (((gPlayers[playerId].speed < 0.5f) || ((gPlayers[playerId].effects & 8) == 8)) &&
|
||||
if (((gPlayers[playerId].speed < 0.5f) || ((gPlayers[playerId].effects & MIDAIR_EFFECT) == MIDAIR_EFFECT)) &&
|
||||
(D_800E9E74[playerId] != 0x0000001C)) {
|
||||
D_800E9E74[playerId] = 0;
|
||||
}
|
||||
if ((((gPlayers[playerId].effects & 0x4000) == 0x4000) && ((gPlayers[playerId].type & 0x2000) != 0x2000)) ||
|
||||
((gPlayers[playerId].effects & 0x800) == 0x800) || ((gPlayers[playerId].effects & 0x80) == 0x80) ||
|
||||
((gPlayers[playerId].effects & 0x40) == 0x40) || ((gPlayers[playerId].unk_044 & 0x4000) == 0x4000)) {
|
||||
if ((((gPlayers[playerId].effects & EARLY_START_SPINOUT_EFFECT) == EARLY_START_SPINOUT_EFFECT) && ((gPlayers[playerId].type & 0x2000) != 0x2000)) ||
|
||||
((gPlayers[playerId].effects & BANANA_NEAR_SPINOUT_EFFECT) == BANANA_NEAR_SPINOUT_EFFECT) || ((gPlayers[playerId].effects & BANANA_SPINOUT_EFFECT) == BANANA_SPINOUT_EFFECT) ||
|
||||
((gPlayers[playerId].effects & DRIVING_SPINOUT_EFFECT) == DRIVING_SPINOUT_EFFECT) || ((gPlayers[playerId].unk_044 & 0x4000) == 0x4000)) {
|
||||
D_800E9E74[playerId] = 0x00000012;
|
||||
}
|
||||
if ((((gPlayers[playerId].effects & 0x20) == 0x20) && ((gPlayers[playerId].type & 0x2000) != 0x2000)) ||
|
||||
((gPlayers[playerId].effects & 0x800) == 0x800)) {
|
||||
if ((((gPlayers[playerId].effects & AB_SPIN_EFFECT) == AB_SPIN_EFFECT) && ((gPlayers[playerId].type & 0x2000) != 0x2000)) ||
|
||||
((gPlayers[playerId].effects & BANANA_NEAR_SPINOUT_EFFECT) == BANANA_NEAR_SPINOUT_EFFECT)) {
|
||||
D_800E9E74[playerId] = 0x00000013;
|
||||
}
|
||||
if (gPlayers[playerId].unk_20C != 0.0f) {
|
||||
|
|
@ -2714,13 +2714,13 @@ void func_800C847C(u8 playerId) {
|
|||
}
|
||||
|
||||
void func_800C86D8(u8 playerId) {
|
||||
if (((gPlayers[playerId].effects & 0x40000000) != 0x40000000) && (D_800E9F24[playerId] == 1)) {
|
||||
if (((gPlayers[playerId].effects & LIGHTNING_EFFECT) != LIGHTNING_EFFECT) && (D_800E9F24[playerId] == 1)) {
|
||||
func_800C90F4(playerId, (gPlayers[playerId].characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x08));
|
||||
}
|
||||
}
|
||||
|
||||
void func_800C8770(u8 playerId) {
|
||||
if ((gPlayers[playerId].effects & 0x40000000) == 0x40000000) {
|
||||
if ((gPlayers[playerId].effects & LIGHTNING_EFFECT) == LIGHTNING_EFFECT) {
|
||||
D_800E9F24[playerId] = 1;
|
||||
if (D_800E9F2C[playerId] < 0xFA) {
|
||||
D_800E9F2C[playerId]++;
|
||||
|
|
@ -2753,11 +2753,11 @@ void func_800C8770(u8 playerId) {
|
|||
|
||||
// Checks the same field for all players before doing something?
|
||||
void func_800C8920(void) {
|
||||
if (((u8) D_800EA168 != 0) && ((gPlayers[0].effects & 0x40000000) != 0x40000000) &&
|
||||
((gPlayers[1].effects & 0x40000000) != 0x40000000) && ((gPlayers[2].effects & 0x40000000) != 0x40000000) &&
|
||||
((gPlayers[3].effects & 0x40000000) != 0x40000000) && ((gPlayers[4].effects & 0x40000000) != 0x40000000) &&
|
||||
((gPlayers[5].effects & 0x40000000) != 0x40000000) && ((gPlayers[6].effects & 0x40000000) != 0x40000000) &&
|
||||
((gPlayers[7].effects & 0x40000000) != 0x40000000)) {
|
||||
if (((u8) D_800EA168 != 0) && ((gPlayers[0].effects & LIGHTNING_EFFECT) != LIGHTNING_EFFECT) &&
|
||||
((gPlayers[1].effects & LIGHTNING_EFFECT) != LIGHTNING_EFFECT) && ((gPlayers[2].effects & LIGHTNING_EFFECT) != LIGHTNING_EFFECT) &&
|
||||
((gPlayers[3].effects & LIGHTNING_EFFECT) != LIGHTNING_EFFECT) && ((gPlayers[4].effects & LIGHTNING_EFFECT) != LIGHTNING_EFFECT) &&
|
||||
((gPlayers[5].effects & LIGHTNING_EFFECT) != LIGHTNING_EFFECT) && ((gPlayers[6].effects & LIGHTNING_EFFECT) != LIGHTNING_EFFECT) &&
|
||||
((gPlayers[7].effects & LIGHTNING_EFFECT) != LIGHTNING_EFFECT)) {
|
||||
func_800CAC08();
|
||||
}
|
||||
}
|
||||
|
|
@ -2928,7 +2928,7 @@ void func_800C90F4(u8 playerId, u32 soundBits) {
|
|||
((soundBits & ~0xF0) == SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x05))) {
|
||||
D_800EA180 = 1;
|
||||
}
|
||||
if (((gPlayers[playerId].effects & 0x40000000) == 0x40000000) && ((s32) D_800E9F2C[playerId] >= 0x1F)) {
|
||||
if (((gPlayers[playerId].effects & LIGHTNING_EFFECT) == LIGHTNING_EFFECT) && ((s32) D_800E9F2C[playerId] >= 0x1F)) {
|
||||
play_sound(soundBits, &D_800E9F7C[playerId].pos, playerId, &D_800EA150, &D_800EA1D4,
|
||||
(s8*) &D_800E9F7C[playerId].unk_14);
|
||||
} else {
|
||||
|
|
@ -2957,7 +2957,7 @@ void func_800C92CC(u8 playerId, u32 soundBits) {
|
|||
(u8) var_s0, soundBits);
|
||||
if (temp_v0 != NULL) {
|
||||
temp_v0->unk34 = 170.0f;
|
||||
if (((gPlayers[playerId].effects & 0x40000000) == 0x40000000) && ((s32) D_800E9F2C[playerId] >= 0x1F)) {
|
||||
if (((gPlayers[playerId].effects & LIGHTNING_EFFECT) == LIGHTNING_EFFECT) && ((s32) D_800E9F2C[playerId] >= 0x1F)) {
|
||||
play_sound((gPlayers[playerId].characterId * 0x10) + soundBits, &temp_v0->unk18, var_s0,
|
||||
&D_800EA150, &D_800EA1D4, (s8*) &D_800EA06C[playerId].unk0C);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -1187,8 +1187,8 @@ u8* gKartPalettes[] = {
|
|||
**/
|
||||
void load_kart_texture(Player* player, s8 playerId, s8 screenId, s8 screenId2, s8 index) {
|
||||
s32 temp = player->effects;
|
||||
if (((temp & 0x80) == 0x80) || ((temp & 0x40) == 0x40) || ((temp & 0x80000) == 0x80000) ||
|
||||
((temp & 0x800000) == 0x800000) || ((temp & 0x20000) == 0x20000) || ((player->unk_044 & 0x800) != 0)) {
|
||||
if (((temp & BANANA_SPINOUT_EFFECT) == BANANA_SPINOUT_EFFECT) || ((temp & DRIVING_SPINOUT_EFFECT) == DRIVING_SPINOUT_EFFECT) || ((temp & UNKNOWN_EFFECT_0x80000) == UNKNOWN_EFFECT_0x80000) ||
|
||||
((temp & UNKNOWN_EFFECT_0x800000) == UNKNOWN_EFFECT_0x800000) || ((temp & LIGHTNING_STRIKE_EFFECT) == LIGHTNING_STRIKE_EFFECT) || ((player->unk_044 & 0x800) != 0)) {
|
||||
if (player->animFrameSelector[screenId] != 0) {
|
||||
osInvalDCache(&gEncodedKartTexture[index][screenId2][playerId], D_800DDEB0[player->characterId]);
|
||||
|
||||
|
|
@ -1212,8 +1212,8 @@ void load_kart_texture(Player* player, s8 playerId, s8 screenId, s8 screenId2, s
|
|||
|
||||
osRecvMesg(&gDmaMesgQueue, &gMainReceivedMesg, OS_MESG_BLOCK);
|
||||
}
|
||||
} else if (((temp & 0x400) == 0x400) || ((temp & 0x01000000) == 0x01000000) ||
|
||||
((temp & 0x02000000) == 0x02000000) || ((temp & 0x10000) == 0x10000)) {
|
||||
} else if (((temp & HIT_BY_GREEN_SHELL_EFFECT) == HIT_BY_GREEN_SHELL_EFFECT) || ((temp & EXPLOSION_CRASH_EFFECT) == EXPLOSION_CRASH_EFFECT) ||
|
||||
((temp & HIT_BY_STAR_EFFECT) == HIT_BY_STAR_EFFECT) || ((temp & TERRAIN_TUMBLE_EFFECT) == TERRAIN_TUMBLE_EFFECT)) {
|
||||
osInvalDCache(&gEncodedKartTexture[index][screenId2][playerId], 0x780U);
|
||||
// player->unk_0A8 >> 8 converts an 8.8 fixed-point animation frame to a whole number.
|
||||
osPiStartDma(&gDmaIoMesg, OS_MESG_PRI_NORMAL, OS_READ,
|
||||
|
|
@ -1238,8 +1238,8 @@ void load_kart_texture(Player* player, s8 playerId, s8 screenId, s8 screenId2, s
|
|||
void load_kart_texture_non_blocking(Player* player, s8 arg1, s8 arg2, s8 arg3, s8 arg4) {
|
||||
s32 temp = player->effects;
|
||||
|
||||
if (((temp & 0x80) == 0x80) || ((temp & 0x40) == 0x40) || ((temp & 0x80000) == 0x80000) ||
|
||||
((temp & 0x800000) == 0x800000) || ((temp & 0x20000) == 0x20000) || ((player->unk_044 & 0x800) != 0)) {
|
||||
if (((temp & BANANA_SPINOUT_EFFECT) == BANANA_SPINOUT_EFFECT) || ((temp & DRIVING_SPINOUT_EFFECT) == DRIVING_SPINOUT_EFFECT) || ((temp & UNKNOWN_EFFECT_0x80000) == UNKNOWN_EFFECT_0x80000) ||
|
||||
((temp & UNKNOWN_EFFECT_0x800000) == UNKNOWN_EFFECT_0x800000) || ((temp & LIGHTNING_STRIKE_EFFECT) == LIGHTNING_STRIKE_EFFECT) || ((player->unk_044 & 0x800) != 0)) {
|
||||
if (player->animFrameSelector[arg2] != 0) {
|
||||
osInvalDCache(&gEncodedKartTexture[arg4][arg3][arg1], D_800DDEB0[player->characterId]);
|
||||
|
||||
|
|
@ -1257,8 +1257,8 @@ void load_kart_texture_non_blocking(Player* player, s8 arg1, s8 arg2, s8 arg3, s
|
|||
[player->animFrameSelector[arg2]])],
|
||||
&gEncodedKartTexture[arg4][arg3][arg1], D_800DDEB0[player->characterId], &gDmaMesgQueue);
|
||||
}
|
||||
} else if (((temp & 0x400) == 0x400) || ((temp & 0x01000000) == 0x01000000) ||
|
||||
((temp & 0x02000000) == 0x02000000) || ((temp & 0x10000) == 0x10000)) {
|
||||
} else if (((temp & HIT_BY_GREEN_SHELL_EFFECT) == HIT_BY_GREEN_SHELL_EFFECT) || ((temp & EXPLOSION_CRASH_EFFECT) == EXPLOSION_CRASH_EFFECT) ||
|
||||
((temp & HIT_BY_STAR_EFFECT) == HIT_BY_STAR_EFFECT) || ((temp & TERRAIN_TUMBLE_EFFECT) == TERRAIN_TUMBLE_EFFECT)) {
|
||||
osInvalDCache(&gEncodedKartTexture[arg4][arg3][arg1], 0x780);
|
||||
// player->unk_0A8 >> 8 converts an 8.8 fixed-point animation frame to a whole number.
|
||||
osPiStartDma(&gDmaIoMesg, OS_MESG_PRI_NORMAL, OS_READ,
|
||||
|
|
|
|||
|
|
@ -576,7 +576,7 @@ void func_80028C44(Player* player, Camera* camera, s8 playerId, s8 screenId) {
|
|||
func_8002D268(player, camera, screenId, playerId);
|
||||
}
|
||||
} else {
|
||||
player->effects &= -9;
|
||||
player->effects &= ~MIDAIR_EFFECT;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2129,8 +2129,8 @@ void func_8002D268(Player* player, UNUSED Camera* camera, s8 screenId, s8 player
|
|||
} else {
|
||||
player->unk_044 &= 0xFFF7;
|
||||
}
|
||||
if (((player->unk_08C <= 0.0f) && ((temp_v0_3 = player->effects, (temp_v0_3 & 1) == 1))) &&
|
||||
((temp_v0_3 & 0x20) != 0x20)) {
|
||||
if (((player->unk_08C <= 0.0f) && ((temp_v0_3 = player->effects, (temp_v0_3 & BRAKING_EFFECT) == BRAKING_EFFECT))) &&
|
||||
((temp_v0_3 & AB_SPIN_EFFECT) != AB_SPIN_EFFECT)) {
|
||||
sp178[2] = temp_f2_2 * 4500.0f;
|
||||
} else {
|
||||
sp178[2] = 0.0f;
|
||||
|
|
|
|||
Loading…
Reference in New Issue