Some MSVC / C89 buildfixes

This commit is contained in:
twinaphex
2021-09-25 03:41:39 +02:00
parent afe2b4d965
commit 6881c1fd2a
5 changed files with 16 additions and 10 deletions

View File

@@ -77,7 +77,7 @@ static void power(void)
SetWriteHandler(0x6000, 0x7FFF, CartBW);
}
static void reset()
static void reset(void)
{
memset(reg, 0, sizeof(reg));
sync();
@@ -85,13 +85,14 @@ static void reset()
void Mapper162_Init (CartInfo *info)
{
uint8 *WRAM;
uint32 WRAMSIZE = info->iNES2? (info->PRGRamSize + info->PRGRamSaveSize): 8192;
info->Power = power;
info->Reset = reset;
GameHBIRQHook = hblank;
AddExState(StateRegs, ~0, 0, 0);
uint8* WRAM = (uint8*) FCEU_gmalloc(WRAMSIZE);
WRAM = (uint8*) FCEU_gmalloc(WRAMSIZE);
SetupCartPRGMapping(0x10, WRAM, WRAMSIZE, 1);
FCEU_CheatAddRAM(WRAMSIZE >> 10, 0x6000, WRAM);
if (info->battery) {

View File

@@ -82,7 +82,7 @@ static void power(void)
SetWriteHandler(0x6000, 0x7FFF, CartBW);
}
static void reset()
static void reset(void)
{
memset(reg, 0, sizeof(reg));
sync();
@@ -90,13 +90,14 @@ static void reset()
void Mapper163_Init (CartInfo *info)
{
uint8 *WRAM;
uint32 WRAMSIZE = info->iNES2? (info->PRGRamSize + info->PRGRamSaveSize): 8192;
info->Power = power;
info->Reset = reset;
GameHBIRQHook = hblank;
AddExState(StateRegs, ~0, 0, 0);
uint8* WRAM = (uint8*) FCEU_gmalloc(WRAMSIZE);
WRAM = (uint8*) FCEU_gmalloc(WRAMSIZE);
SetupCartPRGMapping(0x10, WRAM, WRAMSIZE, 1);
FCEU_CheatAddRAM(WRAMSIZE >> 10, 0x6000, WRAM);
if (info->battery) {

View File

@@ -95,7 +95,7 @@ static void power(void)
SetWriteHandler(0x6000, 0x7FFF, CartBW);
}
static void reset()
static void reset(void)
{
memset(reg, 0, sizeof(reg));
sync();
@@ -103,12 +103,13 @@ static void reset()
void Mapper164_Init (CartInfo *info)
{
uint8 *WRAM;
uint32 WRAMSIZE = info->iNES2? (info->PRGRamSize + (info->PRGRamSaveSize &~0x7FF)): 8192;
info->Power = power;
info->Reset = reset;
AddExState(StateRegs, ~0, 0, 0);
uint8* WRAM = (uint8*) FCEU_gmalloc(WRAMSIZE);
WRAM = (uint8*) FCEU_gmalloc(WRAMSIZE);
SetupCartPRGMapping(0x10, WRAM, WRAMSIZE, 1);
FCEU_CheatAddRAM(WRAMSIZE >> 10, 0x6000, WRAM);

View File

@@ -91,7 +91,7 @@ static void power(void)
SetWriteHandler(0x6000, 0x7FFF, CartBW);
}
static void reset()
static void reset(void)
{
memset(reg, 0, sizeof(reg));
sync();
@@ -99,13 +99,14 @@ static void reset()
void Mapper558_Init (CartInfo *info)
{
uint8 *WRAM;
uint32 WRAMSIZE = info->PRGRamSize + (info->PRGRamSaveSize &~0x7FF);
info->Power = power;
info->Reset = reset;
GameHBIRQHook = hblank;
AddExState(StateRegs, ~0, 0, 0);
uint8* WRAM = (uint8*) FCEU_gmalloc(WRAMSIZE);
WRAM = (uint8*) FCEU_gmalloc(WRAMSIZE);
SetupCartPRGMapping(0x10, WRAM, WRAMSIZE, 1);
FCEU_CheatAddRAM(WRAMSIZE >> 10, 0x6000, WRAM);
haveEEPROM =!!(info->PRGRamSaveSize &0x200);

View File

@@ -290,8 +290,9 @@ static DECLFW(Write8000)
{
case 0x8000:
{
uint8 old_ctrl;
if (A & 2) return; /* Confirmed on real hardware: writes to 8002 and 8003, or 9FFE and 9FFF, are ignored. Needed for Dr. Mario on some of the "bouncing ball" multis. */
uint8 old_ctrl = mmc3_ctrl;
old_ctrl = mmc3_ctrl;
/* Subtype 2, 8192 or more KiB PRG-ROM, no CHR-ROM: Like Subtype 0,
* but MMC3 registers $46 and $47 swapped. */
@@ -315,8 +316,9 @@ static DECLFW(Write8000)
}
case 0x8001:
{
uint8 ctrl_mask;
if (A & 2) return; /* Confirmed on real hardware: writes to 8002 and 8003, or 9FFE and 9FFF, are ignored. Needed for Dr. Mario on some of the "bouncing ball" multis. */
uint8 ctrl_mask = MMC3_EXTENDED ? 0x0F : 0x07;
ctrl_mask = MMC3_EXTENDED ? 0x0F : 0x07;
if ((mmc3_ctrl & ctrl_mask) < 12)
{