From fb06e4a3c94ae17b73df6d3aecf2d18213aa183e Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Wed, 26 Jun 2019 08:13:38 -0400 Subject: Modernize code Can compile with arm-none-eabi-gcc 8.3.0 gbafix correctly handles ELF input --- src/ghost.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/ghost.c') diff --git a/src/ghost.c b/src/ghost.c index 97b86aa76..dd29fb7ca 100644 --- a/src/ghost.c +++ b/src/ghost.c @@ -1148,7 +1148,8 @@ static void sub_8112B78(struct Sprite *sprite) if (++coeffB > 16) coeffB = 16; - if (--(s16)coeffA < 0) + --coeffA; + if ((s16)coeffA < 0) coeffA = 0; SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(coeffA, coeffB)); -- cgit v1.2.3