C89_BUILD fixes

This commit is contained in:
twinaphex
2018-03-20 16:07:46 +01:00
parent 0f6f419067
commit 02840d9cff

View File

@@ -1197,26 +1197,27 @@ void FCEUSND_SaveState(void) {
} }
void FCEUSND_LoadState(int version) { void FCEUSND_LoadState(int version) {
int i;
LoadDMCPeriod(DMCFormat & 0xF); LoadDMCPeriod(DMCFormat & 0xF);
RawDALatch &= 0x7F; RawDALatch &= 0x7F;
DMCAddress &= 0x7FFF; DMCAddress &= 0x7FFF;
//minimal validation //minimal validation
for (int i = 0; i < 5; i++) for (i = 0; i < 5; i++)
{ {
if (ChannelBC[i] < 0 || ChannelBC[i] > 15) if (ChannelBC[i] < 0 || ChannelBC[i] > 15)
{ {
ChannelBC[i] = 0; ChannelBC[i] = 0;
} }
} }
for (int i = 0; i < 4; i++) for (i = 0; i < 4; i++)
{ {
if (wlcount[i] < 0 || wlcount[i] > 2048) if (wlcount[i] < 0 || wlcount[i] > 2048)
{ {
wlcount[i] = 2048; wlcount[i] = 2048;
} }
} }
for (int i = 0; i < 2; i++) for (i = 0; i < 2; i++)
{ {
if (RectDutyCount[i] < 0 || RectDutyCount[i] > 7) if (RectDutyCount[i] < 0 || RectDutyCount[i] > 7)
{ {