diff --git a/src/boards/269.c b/src/boards/269.c index 358ccce..b62f50f 100644 --- a/src/boards/269.c +++ b/src/boards/269.c @@ -80,7 +80,7 @@ static uint8 unscrambleCHR(uint8 data) { } void Mapper269_Init(CartInfo *info) { - uint8 i; + uint32 i; GenMMC3_Init(info, 512, 0, 8, 0); cwrap = M269CW; pwrap = M269PW; diff --git a/src/input/shadow.c b/src/input/shadow.c index 8f9d767..e8b0aa9 100644 --- a/src/input/shadow.c +++ b/src/input/shadow.c @@ -66,7 +66,7 @@ static void FP_FASTAPASS(3) ZapperFrapper(uint8 * bg, uint8 * spr, uint32 linets sum = palo[a1].r + palo[a1].g + palo[a1].b; if (sum >= 100 * 3) { - ZD.zaphit = ((uint64)linets + (xs + 16) * (PAL ? 15 : 16)) / 48 + timestampbase; + ZD.zaphit = ((uint64)linets + (uint64)(xs + 16) * (PAL ? 15 : 16)) / 48 + timestampbase; goto endo; } } diff --git a/src/input/zapper.c b/src/input/zapper.c index 40a182a..3d891f4 100644 --- a/src/input/zapper.c +++ b/src/input/zapper.c @@ -82,7 +82,7 @@ static void FP_FASTAPASS(3) ZapperFrapper(int w, uint8 * bg, uint8 * spr, uint32 sum = palo[a1].r + palo[a1].g + palo[a1].b; if (sum >= 100 * 3) { - ZD[w].zaphit = ((uint64)linets + (xs + 16) * (PAL ? 15 : 16)) / 48 + timestampbase; + ZD[w].zaphit = ((uint64)linets + (uint64)(xs + 16) * (PAL ? 15 : 16)) / 48 + timestampbase; goto endo; } } diff --git a/src/sound.c b/src/sound.c index a3f331b..2fd2ca2 100644 --- a/src/sound.c +++ b/src/sound.c @@ -1254,7 +1254,7 @@ void FCEUSND_LoadState(int version) { /* minimal validation */ for (i = 0; i < 5; i++) { - int BC_max = 15; + uint32 BC_max = 15; if (FSettings.soundq == 2) { @@ -1264,7 +1264,7 @@ void FCEUSND_LoadState(int version) { { BC_max = 485; } - if (ChannelBC[i] < 0 || ChannelBC[i] > BC_max) + if (/* ChannelBC[i] < 0 || */ ChannelBC[i] > BC_max) { ChannelBC[i] = 0; } @@ -1283,14 +1283,16 @@ void FCEUSND_LoadState(int version) { RectDutyCount[i] = 7; } } - if (sound_timestamp < 0) + + /* Comparison is always false because access to array >= 0. */ + /* if (sound_timestamp < 0) { sound_timestamp = 0; } if (soundtsoffs < 0) { soundtsoffs = 0; - } + } */ if (soundtsoffs + sound_timestamp >= soundtsinc) { soundtsoffs = 0;