Fix C89 build

This commit is contained in:
twinaphex
2020-01-23 19:46:08 +01:00
parent 30e8730508
commit fb516c853a
5 changed files with 38 additions and 35 deletions

View File

@@ -148,17 +148,16 @@ static DECLFR(BS110ReadHi)
}
static void BS110Power(void) {
static void BS110Power(void)
{
int i = 0;
dipswitch = 0;
mmc3_reg[0] = 0x00; mmc3_reg[1] = 0x02;
mmc3_reg[2] = 0x04; mmc3_reg[3] = 0x05; mmc3_reg[4] = 0x06; mmc3_reg[5] = 0x07;
mmc3_reg[6] = 0x00; mmc3_reg[7] = 0x01;
int i = 0;
for (i = 0;i<4;i++)
{
exRegs[i] = 0;
}
GenMMC3Power();
SetWriteHandler(0x6000, 0x7FFF, BS110WriteLo);
@@ -166,18 +165,17 @@ static void BS110Power(void) {
SetReadHandler(0x8000, 0xFFFF, BS110ReadHi);
}
static void BS110Reset(void) {
static void BS110Reset(void)
{
int i = 0;
dipswitch++;
mmc3_reg[0] = 0x00; mmc3_reg[1] = 0x02;
mmc3_reg[2] = 0x04; mmc3_reg[3] = 0x05; mmc3_reg[4] = 0x06; mmc3_reg[5] = 0x07;
mmc3_reg[6] = 0x00; mmc3_reg[7] = 0x01;
int i = 0;
for (i = 0;i<4;i++)
{
exRegs[i] = 0;
}
MMC3RegReset();
}

View File

@@ -174,24 +174,21 @@ static DECLFW(Bs5652WriteLo) {
static DECLFR(Bs5652ReadHi)
{
if (readDIP)
{
return dipswitch;
}
else
return CartBR(A);
return CartBR(A);
}
static void Bs5652Power(void) {
static void Bs5652Power(void)
{
int i=0;
dipswitch = 0;
mmc3_reg[0] = 0x00; mmc3_reg[1] = 0x02;
mmc3_reg[2] = 0x04; mmc3_reg[3] = 0x05; mmc3_reg[4] = 0x06; mmc3_reg[5] = 0x07;
mmc3_reg[6] = 0x00; mmc3_reg[7] = 0x01;
int i=0;
for(i=0;i<4;i++)
{
exRegs[i]=0;
}
Bs5652AnalyzeReg();
@@ -201,30 +198,34 @@ static void Bs5652Power(void) {
SetReadHandler(0x8000, 0xFFFF, Bs5652ReadHi);
}
static void Bs5652Reset(void) {
static void Bs5652Reset(void)
{
int i=0;
dipswitch++;
mmc3_reg[0] = 0x00; mmc3_reg[1] = 0x02;
mmc3_reg[2] = 0x04; mmc3_reg[3] = 0x05; mmc3_reg[4] = 0x06; mmc3_reg[5] = 0x07;
mmc3_reg[6] = 0x00; mmc3_reg[7] = 0x01;
int i=0;
for(i=0;i<4;i++)
{
exRegs[i]=0;
}
Bs5652AnalyzeReg();
MMC3RegReset();
}
static void Bs5652Close(void) {
static void Bs5652Close(void)
{
if (WRAM)
FCEU_gfree(WRAM);
WRAM = NULL;
}
void Bs5652_Init(CartInfo *info) {
void Bs5652_Init(CartInfo *info)
{
uint32 unif_crc;
GenMMC3_Init(info, 512, 512, 0, 0);
pwrap = Bs5652PW;
cwrap = Bs5652CW;
@@ -242,7 +243,7 @@ void Bs5652_Init(CartInfo *info) {
//SetupCartCHRMapping(0x10, CHRRAM, CHRRAMSIZE, 1);
//AddExState(CHRRAM, CHRRAMSIZE, 0, "CHRR");
uint32 unif_crc = CalcCRC32(0, PRGptr[0], PRGsize[0]);
unif_crc = CalcCRC32(0, PRGptr[0], PRGsize[0]);
if (unif_crc == 0xb97641b5) //Fix my own error, unif CHR 0 error
{

View File

@@ -31,13 +31,13 @@ static SFORMAT StateRegs[] =
{ 0 }
};
static void Sync(void) {
static void Sync(void)
{
uint8 mirr;
int r = 0;
if ((regs[1]) & 0x20)
{
r = 1;
}
if ((regs[1] >> 4) & 0x01)
{
setprg16(0x8000, regs[1] & 0x07 | (r) << 3);
@@ -50,7 +50,7 @@ static void Sync(void) {
setchr8(regs[2] & 0x01 | (r) << 3);
}
uint8 mirr = (((regs[0] >> 4 & 0x1)));
mirr = (((regs[0] >> 4 & 0x1)));
if (mirr)
setmirror(0);

View File

@@ -595,11 +595,11 @@ static void J2282Sync(void) {
}
else
{
uint8 bank;
if (latche & 0x800)
{
setprg8(0x6000, ((latche << 1) & 0x3F) | 3);
}
uint8 bank = (latche >> 1) & 0x1F;
bank = (latche >> 1) & 0x1F;
setprg32(0x8000, bank);
}

View File

@@ -125,24 +125,28 @@ void Super24_Init(CartInfo *info) {
if (oldversion == 0)
{
uint8* _CHRptr;
uint8* _PRGptr;
uint32 _CHROffset = 0;
uint32 _PRGOffset = 0;
uint32 _PRGsize = 0;
uint32 _CHRsize = 0;
int i = 0;
for (i = 0;i < 4;i++)
{
_PRGsize += PRGsize[i];
_CHRsize += CHRsize[i];
}
uint8* _CHRptr = (uint8*)FCEU_gmalloc(_CHRsize);
uint32 _CHROffset = 0;
_CHRptr = (uint8*)FCEU_gmalloc(_CHRsize);
for (i = 0;i < 4;i++)
{
memcpy(&_CHRptr[_CHROffset], CHRptr[i], CHRsize[i]);
_CHROffset += CHRsize[i];
}
uint8* _PRGptr = (uint8*)FCEU_gmalloc(_PRGsize);
uint32 _PRGOffset = 0;
_PRGptr = (uint8*)FCEU_gmalloc(_PRGsize);
for (i = 0;i < 4;i++)
{
memcpy(&_PRGptr[_PRGOffset], PRGptr[i], PRGsize[i]);