Unverified Commit a54da1c0 authored by kps501's avatar kps501 Committed by GitHub
Browse files

libretro: compile warnings, port tags

parent 80ba8ad3
......@@ -1207,11 +1207,12 @@ void S9xSetC4 (uint8 byte, uint16 Address)
if (Memory.C4RAM[0x1f4d] != 0x0e)
printf("$7f4d=%02x, expected 0e for command 54 %02x\n", Memory.C4RAM[0x1f4d], Memory.C4RAM[0x1f4d]);
#endif
int64 b = (int64) READ_3WORD(Memory.C4RAM + 0x1f80);
int64 c = b << 40;
int64 a = SAR(c, 30);
// libretro: msvc2005 hack
int64 b = (int64) READ_3WORD(Memory.C4RAM + 0x1f80);
int64 c = b << 40;
int64 a = SAR(c, 30);
//printf("%08X%08X\n", (uint32) (a>>32), (uint32) (a&0xFFFFFFFF));
a = SAR(c, 10);
a = SAR(c, 10);
a *= a;
//printf("%08X%08X\n", (uint32) (a>>32), (uint32) (a&0xFFFFFFFF));
WRITE_3WORD(Memory.C4RAM + 0x1f83, a);
......
......@@ -1274,14 +1274,6 @@ static bool8 is_GNEXT_Add_On (const uint8 *data, uint32 size)
return (FALSE);
}
static bool8 MsuRomExists (void)
{
struct stat buf;
const char *path = S9xGetFilename(".msu", ROMFILENAME_DIR);
return (stat(path, &buf) == 0);
}
int CMemory::ScoreHiROM (bool8 skip_header, int32 romoff)
{
uint8 *buf = ROM + 0xff00 + romoff + (skip_header ? 0x200 : 0);
......@@ -2043,13 +2035,12 @@ bool8 CMemory::LoadGNEXT ()
bool8 CMemory::LoadSRTC (void)
{
FILE *fp;
size_t ignore;
fp = fopen(S9xGetFilename(".rtc", SRAM_DIR), "rb");
if (!fp)
return (FALSE);
ignore = fread(RTCData.reg, 1, 20, fp);
fread(RTCData.reg, 1, 20, fp);
fclose(fp);
return (TRUE);
......@@ -2058,13 +2049,12 @@ bool8 CMemory::LoadSRTC (void)
bool8 CMemory::SaveSRTC (void)
{
FILE *fp;
size_t ignore;
fp = fopen(S9xGetFilename(".rtc", SRAM_DIR), "wb");
if (!fp)
return (FALSE);
ignore = fwrite(RTCData.reg, 1, 20, fp);
fwrite(RTCData.reg, 1, 20, fp);
fclose(fp);
return (TRUE);
......@@ -2191,8 +2181,7 @@ bool8 CMemory::SaveSRAM (const char *filename)
file = fopen(name, "wb");
if (file)
{
size_t ignore;
ignore = fwrite((char *) Multi.sramB, size, 1, file);
fwrite((char *) Multi.sramB, size, 1, file);
fclose(file);
}
......@@ -2208,8 +2197,7 @@ bool8 CMemory::SaveSRAM (const char *filename)
file = fopen(sramName, "wb");
if (file)
{
size_t ignore;
ignore = fwrite((char *) SRAM, size, 1, file);
fwrite((char *) SRAM, size, 1, file);
fclose(file);
if (Settings.SRTC || Settings.SPC7110RTC)
......@@ -2800,7 +2788,7 @@ void CMemory::map_lorom (uint32 bank_s, uint32 bank_e, uint32 addr_s, uint32 add
if (auto_export_map)
{
struct retro_memory_descriptor desc = {0};
struct retro_memory_descriptor desc = {0,0,0,0,0,0,0};
desc.flags=RETRO_MEMDESC_CONST;
desc.ptr=ROM;
desc.start=bank_s<<16 | addr_s;
......@@ -2829,7 +2817,7 @@ void CMemory::map_hirom (uint32 bank_s, uint32 bank_e, uint32 addr_s, uint32 add
if (auto_export_map)
{
struct retro_memory_descriptor desc = {0};
struct retro_memory_descriptor desc = {0,0,0,0,0,0,0};
desc.flags=RETRO_MEMDESC_CONST;
desc.ptr=ROM;
desc.offset=map_mirror(size, addr_s);
......@@ -2858,7 +2846,7 @@ void CMemory::map_lorom_offset (uint32 bank_s, uint32 bank_e, uint32 addr_s, uin
if (auto_export_map)
{
struct retro_memory_descriptor desc = {0};
struct retro_memory_descriptor desc = {0,0,0,0,0,0,0};
desc.flags=RETRO_MEMDESC_CONST;
desc.ptr=ROM;
desc.offset=offset;
......@@ -2888,7 +2876,7 @@ void CMemory::map_hirom_offset (uint32 bank_s, uint32 bank_e, uint32 addr_s, uin
if (auto_export_map)
{
struct retro_memory_descriptor desc = {0};
struct retro_memory_descriptor desc = {0,0,0,0,0,0,0};
desc.flags=RETRO_MEMDESC_CONST;
desc.ptr=ROM;
desc.offset=map_mirror(size, offset + addr_s);
......@@ -2915,7 +2903,7 @@ void CMemory::map_space (uint32 bank_s, uint32 bank_e, uint32 addr_s, uint32 add
}
if (auto_export_map)
{
struct retro_memory_descriptor desc = {0};
struct retro_memory_descriptor desc = {0,0,0,0,0,0,0};
desc.ptr=data;
desc.start=bank_s<<16 | addr_s;
desc.select=(bank_s<<16 | addr_s) ^ (bank_e<<16 | addr_e) ^ 0xFFFFFF;
......@@ -2945,7 +2933,7 @@ void CMemory::map_index (uint32 bank_s, uint32 bank_e, uint32 addr_s, uint32 add
if (auto_export_map)
{
struct retro_memory_descriptor desc = {0};
struct retro_memory_descriptor desc = {0,0,0,0,0,0,0};
desc.start=bank_s<<16 | addr_s;
desc.select=(bank_s<<16 | addr_s) ^ (bank_e<<16 | addr_e) ^ 0xFFFFFF;
if (type==MAP_LOROM_SRAM || type==MAP_SA1RAM)
......
......@@ -1404,8 +1404,11 @@ void S9xFreezeToStream (STREAM stream)
if (Settings.BS)
FreezeStruct(stream, "BSX", &BSX, SnapBSX, COUNT(SnapBSX));
// libretro: g++ guard warning
if (Settings.MSU1)
{
FreezeStruct(stream, "MSU", &MSU1, SnapMSU1, COUNT(SnapMSU1));
}
delete [] soundsnapshot;
}
......@@ -2055,7 +2058,6 @@ static bool CheckBlockName(STREAM stream, const char *name, int &len)
{
char buffer[16];
len = 0;
long rewind = FIND_STREAM(stream);
size_t l = READ_STREAM(buffer, 11, stream);
buffer[l] = 0;
......
......@@ -211,13 +211,13 @@ extern FILE *trace;
#define S9X_CONF_FILE_NAME "snes9x.conf"
#ifndef __LIBRETRO__
static char *rom_filename = NULL;
static bool parse_controller_spec (int, const char *);
static void parse_crosshair_spec (enum crosscontrols, const char *);
static bool try_load_config_file (const char *, ConfigFile &);
#ifndef __LIBRETRO__
static bool parse_controller_spec (int port, const char *arg)
{
if (!strcasecmp(arg, "none"))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment