Commit 804215a4 authored by Libretro-Admin's avatar Libretro-Admin
Browse files

Take out _SNESPPC ifdefs

parent b5020d05
......@@ -542,13 +542,11 @@ void S9xStartScreenRefresh ()
{
if (IPPU.RenderThisFrame)
{
#ifndef _SNESPPC
if (!S9xInitUpdate ())
{
IPPU.RenderThisFrame = FALSE;
return;
}
#endif
IPPU.RenderedFramesCount++;
IPPU.PreviousLine = IPPU.CurrentLine = 0;
IPPU.MaxBrightness = PPU.Brightness;
......
......@@ -547,13 +547,11 @@ void S9xStartScreenRefresh ()
{
if (IPPU.RenderThisFrame)
{
#ifndef _SNESPPC
if (!S9xInitUpdate ())
{
IPPU.RenderThisFrame = FALSE;
return;
}
#endif
IPPU.RenderedFramesCount++;
IPPU.PreviousLine = IPPU.CurrentLine = 0;
IPPU.MaxBrightness = PPU.Brightness;
......
......@@ -187,9 +187,7 @@ bool8 S9xSaveCheatFile (const char *filename)
{
if (Cheat.num_cheats == 0)
{
#ifndef _SNESPPC
(void) remove (filename);
#endif
return (TRUE);
}
......
......@@ -65,11 +65,7 @@ struct Band
R.Left = MAX(A.Left, B.Left); \
R.Right = MIN(A.Right, B.Right);}
#ifndef _SNESPPC
static int IntCompare (const void *d1, const void *d2)
#else
static int _cdecl IntCompare (const void *d1, const void *d2)
#endif
{
/*
if (*(uint32 *) d1 > *(uint32 *) d2)
......@@ -82,11 +78,7 @@ static int _cdecl IntCompare (const void *d1, const void *d2)
return (*(uint32 *) d1 - *(uint32 *) d2);
}
#ifndef _SNESPPC
static int BandCompare (const void *d1, const void *d2)
#else
static int _cdecl BandCompare (const void *d1, const void *d2)
#endif
{
/*
if (((struct Band *) d1)->Left > ((struct Band *) d2)->Left)
......
......@@ -546,13 +546,11 @@ void S9xStartScreenRefresh ()
{
if (IPPU.RenderThisFrame)
{
#ifndef _SNESPPC
if (!S9xInitUpdate ())
{
IPPU.RenderThisFrame = FALSE;
return;
}
#endif
IPPU.RenderedFramesCount++;
IPPU.PreviousLine = IPPU.CurrentLine = 0;
IPPU.MaxBrightness = PPU.Brightness;
......
......@@ -559,13 +559,11 @@ void S9xStartScreenRefresh ()
if (IPPU.RenderThisFrame)
{
#ifndef _SNESPPC
if (!S9xInitUpdate ())
{
IPPU.RenderThisFrame = FALSE;
return;
}
#endif
IPPU.RenderedFramesCount++;
IPPU.PreviousLine = IPPU.CurrentLine = 0;
IPPU.MaxBrightness = PPU.Brightness;
......
......@@ -52,9 +52,6 @@
#include "soundux.h"
#include "cheats.h"
#include "sa1.h"
#ifndef _SNESPPC
//#include "netplay.h"
#endif
}
START_EXTERN_C
char String[513];
......
......@@ -315,10 +315,6 @@ int checkzip( char * fn )
/* LoadROM() */
/* This function loads a Snes-Backup image */
/**********************************************************************************************/
#ifdef _SNESPPC
#pragma warning(disable : 4101)
#pragma warning(disable : 4700)
#endif
bool8_32 CMemory::LoadROM (const char *filename)
{
unsigned long FileSize = 0;
......@@ -341,13 +337,8 @@ bool8_32 CMemory::LoadROM (const char *filename)
CalculatedSize = 0;
again:
#ifndef _SNESPPC
_splitpath (filename, drive, dir, name, ext);
_makepath (fname, drive, dir, name, ext);
#else
strcpy(fname, filename);
// strupr(fname);
#endif
#ifdef __WIN32__
memmove (&ext [0], &ext[1], 4);
......@@ -391,9 +382,7 @@ again:
memmove (&ext [1], &ext [0], 4);
ext [0] = '.';
#endif
#ifndef _SNESPPC
_makepath (fname, drive, dir, name, ext);
#endif
}
else
if (ptr - ROM < MAX_ROM_SIZE + 0x200 &&
......@@ -408,9 +397,7 @@ again:
memmove (&ext [1], &ext [0], 4);
ext [0] = '.';
#endif
#ifndef _SNESPPC
_makepath (fname, drive, dir, name, ext);
#endif
}
else
more = FALSE;
......
......@@ -167,11 +167,7 @@ public:
uint32 SDD1LoggedDataCountPrev;
uint32 SDD1LoggedDataCount;
uint8 SDD1LoggedData [MEMMAP_MAX_SDD1_LOGGED_ENTRIES];
#ifndef _SNESPPC
char ROMFilename [_MAX_PATH];
#else
char ROMFilename [1024];
#endif
};
START_EXTERN_C
......
......@@ -53,10 +53,6 @@ I can't take it anymore, it's too convoluted. So I've commented out the entire
with a single define-block for each target platform.
*/
/*
** _SNESPPC DEFINES
*/
#if 1
//Title
......@@ -145,7 +141,6 @@ typedef short int16_32;
EXTERN_C void S9xGenerateSound ();
//Additional Items for _SNESPPC port
void _makepath (char *path, const char *drive, const char *dir,
const char *fname, const char *ext);
void _splitpath (const char *path, char *drive, char *dir, char *fname,
......@@ -163,6 +158,6 @@ void _splitpath (const char *path, char *drive, char *dir, char *fname,
#define inline __inline
#endif
#endif // _SNESPPC
#endif //
#endif // _PORT_H_
......@@ -48,9 +48,6 @@
#include "gfx.h"
#include "display.h"
#include "sa1.h"
#ifndef _SNESPPC
//#include "netplay.h"
#endif
#include "sdd1.h"
#include "srtc.h"
......@@ -128,19 +125,17 @@ void S9xUpdateHTimer ()
void S9xFixColourBrightness ()
{
IPPU.XB = mul_brightness [PPU.Brightness];
#ifndef _SNESPPC
if (Settings.SixteenBit)
#endif
{
for (unsigned int i = 0; i < 256; i++)
{
//IPPU.Red [i] = IPPU.XB [PPU.CGDATA [i] & 0x1f];
//IPPU.Green [i] = IPPU.XB [(PPU.CGDATA [i] >> 5) & 0x1f];
//IPPU.Blue [i] = IPPU.XB [(PPU.CGDATA [i] >> 10) & 0x1f];
IPPU.ScreenColors [i] = BUILD_PIXEL (IPPU.XB[IPPU.Red [i]], IPPU.XB[IPPU.Green [i]], IPPU.XB[IPPU.Blue [i]]);
}
}
IPPU.XB = mul_brightness [PPU.Brightness];
if (Settings.SixteenBit)
{
for (unsigned int i = 0; i < 256; i++)
{
//IPPU.Red [i] = IPPU.XB [PPU.CGDATA [i] & 0x1f];
//IPPU.Green [i] = IPPU.XB [(PPU.CGDATA [i] >> 5) & 0x1f];
//IPPU.Blue [i] = IPPU.XB [(PPU.CGDATA [i] >> 10) & 0x1f];
IPPU.ScreenColors [i] = BUILD_PIXEL (IPPU.XB[IPPU.Red [i]], IPPU.XB[IPPU.Green [i]], IPPU.XB[IPPU.Blue [i]]);
}
}
}
/**********************************************************************************************/
......
......@@ -48,9 +48,6 @@
#include "gfx.h"
#include "display.h"
#include "sa1.h"
#ifndef _SNESPPC
//#include "netplay.h"
#endif
#include "sdd1.h"
#include "srtc.h"
......@@ -126,20 +123,18 @@ void S9xUpdateHTimer ()
void S9xFixColourBrightness ()
{
IPPU.XB = mul_brightness [PPU.Brightness];
#ifndef _SNESPPC
if (Settings.SixteenBit)
#endif
{
for (int i = 0; i < 256; i++)
{
IPPU.Red [i] = IPPU.XB [PPU.CGDATA [i] & 0x1f];
IPPU.Green [i] = IPPU.XB [(PPU.CGDATA [i] >> 5) & 0x1f];
IPPU.Blue [i] = IPPU.XB [(PPU.CGDATA [i] >> 10) & 0x1f];
IPPU.ScreenColors [i] = BUILD_PIXEL (IPPU.Red [i], IPPU.Green [i],
IPPU.Blue [i]);
}
}
IPPU.XB = mul_brightness [PPU.Brightness];
if (Settings.SixteenBit)
{
for (int i = 0; i < 256; i++)
{
IPPU.Red [i] = IPPU.XB [PPU.CGDATA [i] & 0x1f];
IPPU.Green [i] = IPPU.XB [(PPU.CGDATA [i] >> 5) & 0x1f];
IPPU.Blue [i] = IPPU.XB [(PPU.CGDATA [i] >> 10) & 0x1f];
IPPU.ScreenColors [i] = BUILD_PIXEL (IPPU.Red [i], IPPU.Green [i],
IPPU.Blue [i]);
}
}
}
/**********************************************************************************************/
......@@ -2396,77 +2391,73 @@ void S9xNextController ()
void S9xUpdateJoypads ()
{
#ifdef _SNESPPC
int i = 0;
#else
int i;
for (i = 0; i < 5; i++)
#endif
{
IPPU.Joypads [i] = S9xReadJoypad (i);
if (IPPU.Joypads [i] & SNES_LEFT_MASK)
IPPU.Joypads [i] &= ~SNES_RIGHT_MASK;
if (IPPU.Joypads [i] & SNES_UP_MASK)
IPPU.Joypads [i] &= ~SNES_DOWN_MASK;
}
//touhaiden controller Fix
if (SNESGameFixes.TouhaidenControllerFix &&
(IPPU.Controller == SNES_JOYPAD || IPPU.Controller == SNES_MULTIPLAYER5))
{
for (i = 0; i < 5; i++)
{
if (IPPU.Joypads [i])
IPPU.Joypads [i] |= 0xffff0000;
}
}
// Read mouse position if enabled
if (Settings.MouseMaster)
{
for (i = 0; i < 2; i++)
S9xProcessMouse (i);
}
// Read SuperScope if enabled
if (Settings.SuperScopeMaster)
ProcessSuperScope ();
if (Memory.FillRAM [0x4200] & 1)
{
PPU.Joypad1ButtonReadPos = 16;
if (Memory.FillRAM [0x4201] & 0x80)
{
PPU.Joypad2ButtonReadPos = 16;
PPU.Joypad3ButtonReadPos = 0;
}
else
{
PPU.Joypad2ButtonReadPos = 0;
PPU.Joypad3ButtonReadPos = 16;
}
int ind = Settings.SwapJoypads ? 1 : 0;
Memory.FillRAM [0x4218] = (uint8) IPPU.Joypads [ind];
Memory.FillRAM [0x4219] = (uint8) (IPPU.Joypads [ind] >> 8);
Memory.FillRAM [0x421a] = (uint8) IPPU.Joypads [ind ^ 1];
Memory.FillRAM [0x421b] = (uint8) (IPPU.Joypads [ind ^ 1] >> 8);
if (Memory.FillRAM [0x4201] & 0x80)
{
Memory.FillRAM [0x421c] = (uint8) IPPU.Joypads [ind];
Memory.FillRAM [0x421d] = (uint8) (IPPU.Joypads [ind] >> 8);
Memory.FillRAM [0x421e] = (uint8) IPPU.Joypads [2];
Memory.FillRAM [0x421f] = (uint8) (IPPU.Joypads [2] >> 8);
}
else
{
Memory.FillRAM [0x421c] = (uint8) IPPU.Joypads [3];
Memory.FillRAM [0x421d] = (uint8) (IPPU.Joypads [3] >> 8);
Memory.FillRAM [0x421e] = (uint8) IPPU.Joypads [4];
Memory.FillRAM [0x421f] = (uint8) (IPPU.Joypads [4] >> 8);
}
}
int i;
for (i = 0; i < 5; i++)
{
IPPU.Joypads [i] = S9xReadJoypad (i);
if (IPPU.Joypads [i] & SNES_LEFT_MASK)
IPPU.Joypads [i] &= ~SNES_RIGHT_MASK;
if (IPPU.Joypads [i] & SNES_UP_MASK)
IPPU.Joypads [i] &= ~SNES_DOWN_MASK;
}
//touhaiden controller Fix
if (SNESGameFixes.TouhaidenControllerFix &&
(IPPU.Controller == SNES_JOYPAD || IPPU.Controller == SNES_MULTIPLAYER5))
{
for (i = 0; i < 5; i++)
{
if (IPPU.Joypads [i])
IPPU.Joypads [i] |= 0xffff0000;
}
}
// Read mouse position if enabled
if (Settings.MouseMaster)
{
for (i = 0; i < 2; i++)
S9xProcessMouse (i);
}
// Read SuperScope if enabled
if (Settings.SuperScopeMaster)
ProcessSuperScope ();
if (Memory.FillRAM [0x4200] & 1)
{
PPU.Joypad1ButtonReadPos = 16;
if (Memory.FillRAM [0x4201] & 0x80)
{
PPU.Joypad2ButtonReadPos = 16;
PPU.Joypad3ButtonReadPos = 0;
}
else
{
PPU.Joypad2ButtonReadPos = 0;
PPU.Joypad3ButtonReadPos = 16;
}
int ind = Settings.SwapJoypads ? 1 : 0;
Memory.FillRAM [0x4218] = (uint8) IPPU.Joypads [ind];
Memory.FillRAM [0x4219] = (uint8) (IPPU.Joypads [ind] >> 8);
Memory.FillRAM [0x421a] = (uint8) IPPU.Joypads [ind ^ 1];
Memory.FillRAM [0x421b] = (uint8) (IPPU.Joypads [ind ^ 1] >> 8);
if (Memory.FillRAM [0x4201] & 0x80)
{
Memory.FillRAM [0x421c] = (uint8) IPPU.Joypads [ind];
Memory.FillRAM [0x421d] = (uint8) (IPPU.Joypads [ind] >> 8);
Memory.FillRAM [0x421e] = (uint8) IPPU.Joypads [2];
Memory.FillRAM [0x421f] = (uint8) (IPPU.Joypads [2] >> 8);
}
else
{
Memory.FillRAM [0x421c] = (uint8) IPPU.Joypads [3];
Memory.FillRAM [0x421d] = (uint8) (IPPU.Joypads [3] >> 8);
Memory.FillRAM [0x421e] = (uint8) IPPU.Joypads [4];
Memory.FillRAM [0x421f] = (uint8) (IPPU.Joypads [4] >> 8);
}
}
}
#ifndef ZSNES_FX
......
......@@ -81,11 +81,7 @@ void S9xSDD1PostLoadState ()
S9xSetSDD1MemoryMap (i, Memory.FillRAM [0x4804 + i]);
}
#ifndef _SNESPPC
static int S9xCompareSDD1LoggedDataEntries (const void *p1, const void *p2)
#else
static int _cdecl S9xCompareSDD1LoggedDataEntries (const void *p1, const void *p2)
#endif
{
uint8 *b1 = (uint8 *) p1;
uint8 *b2 = (uint8 *) p2;
......
......@@ -87,9 +87,6 @@ bool8_32 S9xLoadOrigSnapshot (const char *filename)
return (FALSE);
}
#ifdef _SNESPPC
#pragma warning(disable : 4018)
#endif
static int ReadBlock (const char *key, void *block, int max_len, STREAM snap)
{
char buffer [20];
......
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