diff --git a/include/gba/macro.h b/include/gba/macro.h index 197febede..3b35a1946 100644 --- a/include/gba/macro.h +++ b/include/gba/macro.h @@ -192,29 +192,4 @@ REG_IME = imeTemp; \ } \ -#if MODERN -#define FLOAT_UNS(x, bit) ({ \ - s##bit sx = x; \ - float fx = (float)sx; \ - if (sx < 0) fx += (1 << (bit - 1)) * 2.0f; \ - fx; \ -}) -#define DOUBLE_UNS(x, bit) ({ \ - s##bit sx = x; \ - double dx = (double)sx; \ - if (sx < 0) dx += (1 << (bit - 1)) * 2.0; \ - dx; \ -}) -#else -#define FLOAT_UNS(x, bit) ((float)(x)) -#define DOUBLE_UNS(x, bit) ((double)(x)) -#endif //MODERN - -#define FLOAT_U8(x) FLOAT_UNS(x, 8) -#define FLOAT_U16(x) FLOAT_UNS(x, 16) -#define FLOAT_U32(x) FLOAT_UNS(x, 32) -#define DOUBLE_U8(x) DOUBLE_UNS(x, 8) -#define DOUBLE_U16(x) DOUBLE_UNS(x, 16) -#define DOUBLE_U32(x) DOUBLE_UNS(x, 32) - #endif // GUARD_GBA_MACRO_H diff --git a/src/pokemon_size_record.c b/src/pokemon_size_record.c index d70f57f47..f63e1ccba 100644 --- a/src/pokemon_size_record.c +++ b/src/pokemon_size_record.c @@ -97,7 +97,7 @@ static void FormatMonSizeRecord(u8 *string, u32 size) { #ifdef UNITS_IMPERIAL //Convert size from centimeters to inches - size = DOUBLE_U32(size * 10) / (CM_PER_INCH * 10); + size = (double)(size * 10) / (CM_PER_INCH * 10); #endif string = ConvertIntToDecimalStringN(string, size / 10, 0, 8); diff --git a/src/roulette.c b/src/roulette.c index 5225118d5..662522aae 100644 --- a/src/roulette.c +++ b/src/roulette.c @@ -3969,7 +3969,7 @@ static void sub_8144410(struct Sprite *sprite) if (!sub_8143B48(sprite)) { gUnknown_0203AB88->var90 = 0.0f; - gUnknown_0203AB88->var8C -= FLOAT_U8(gUnknown_085B6348[gUnknown_0203AB88->var04_0].var03) + gUnknown_0203AB88->var8C -= (float)(gUnknown_085B6348[gUnknown_0203AB88->var04_0].var03) / (gUnknown_085B6348[gUnknown_0203AB88->var04_0].var04 + 1); sprite->data[1] = 4; sprite->callback = sub_8144264; @@ -3994,8 +3994,8 @@ static void sub_8144514(struct Sprite *sprite) if (gUnknown_0203AB88->var94 > 40.f) return; - gUnknown_0203AB88->var98 = -(4.0f / FLOAT_U16(gUnknown_0203AB88->var86)); - gUnknown_0203AB88->var90 = -(gUnknown_0203AB88->var8C / FLOAT_U16(gUnknown_0203AB88->var86)); + gUnknown_0203AB88->var98 = -(4.0f / (float)(gUnknown_0203AB88->var86)); + gUnknown_0203AB88->var90 = -(gUnknown_0203AB88->var8C / (float)(gUnknown_0203AB88->var86)); sprite->animNum = 2; sprite->animBeginning = TRUE; sprite->animEnded = FALSE; @@ -4010,8 +4010,8 @@ static void sub_81445D8(struct Sprite *sprite) return; m4aSongNumStartOrChange(SE_TAMAKORO_E); - gUnknown_0203AB88->var98 = -(20.0f / FLOAT_U16(gUnknown_0203AB88->var84)); - gUnknown_0203AB88->var90 = ((1.0f - gUnknown_0203AB88->var8C) / FLOAT_U16(gUnknown_0203AB88->var84)); + gUnknown_0203AB88->var98 = -(20.0f / (float)(gUnknown_0203AB88->var84)); + gUnknown_0203AB88->var90 = ((1.0f - gUnknown_0203AB88->var8C) / (float)(gUnknown_0203AB88->var84)); sprite->animNum = 1; sprite->animBeginning = TRUE; sprite->animEnded = FALSE;