Merge pull request #724 from emukidid/master

- Fix compilation errors with latest libOGC/devkitPPC
This commit is contained in:
dborth 2018-06-06 19:16:30 -06:00 committed by GitHub
commit 967190c5bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 42 additions and 32 deletions

View File

@ -27,14 +27,15 @@ INCLUDES := source source/snes9x
# options for code generation
#---------------------------------------------------------------------------------
CFLAGS = -g -O3 -Wall $(MACHDEP) $(INCLUDE) -DNO_SOUND \
CFLAGS = -g -O3 -LTO -Wall $(MACHDEP) $(INCLUDE) -DNO_SOUND \
-DHAVE_STDINT_H -DBLARGG_NONPORTABLE -DBLARGG_BIG_ENDIAN -DBLARGG_CPU_POWERPC \
-DZLIB -DRIGHTSHIFT_IS_SAR -DCPU_SHUTDOWN -DCORRECT_VRAM_READS \
-D_SZ_ONE_DIRECTORY -D_LZMA_IN_CB -D_LZMA_OUT_READ \
-fomit-frame-pointer \
-Wno-unused-parameter -Wno-strict-aliasing \
-Wno-write-strings -Wno-parentheses
CXXFLAGS = $(CFLAGS)
LDFLAGS = -g $(MACHDEP) -Wl,-Map,$(notdir $@).map
LDFLAGS = -g $(MACHDEP) -LTO -Wl,-Map,$(notdir $@).map
#---------------------------------------------------------------------------------
# any extra libraries we wish to link with the project

View File

@ -332,7 +332,7 @@ int FileSortCallback(const void *f1, const void *f2)
if(((BROWSERENTRY *)f1)->isdir && !(((BROWSERENTRY *)f2)->isdir)) return -1;
if(!(((BROWSERENTRY *)f1)->isdir) && ((BROWSERENTRY *)f2)->isdir) return 1;
return stricmp(((BROWSERENTRY *)f1)->filename, ((BROWSERENTRY *)f2)->filename);
return strcasecmp(((BROWSERENTRY *)f1)->filename, ((BROWSERENTRY *)f2)->filename);
}
/****************************************************************************
@ -361,7 +361,7 @@ static bool IsValidROM()
{
char * zippedFilename = NULL;
if(stricmp(p, ".zip") == 0 && !inSz)
if(strcasecmp(p, ".zip") == 0 && !inSz)
{
// we need to check the file extension of the first file in the archive
zippedFilename = GetFirstZipFilename ();
@ -374,10 +374,10 @@ static bool IsValidROM()
if(p != NULL)
{
if (stricmp(p, ".smc") == 0 ||
stricmp(p, ".fig") == 0 ||
stricmp(p, ".sfc") == 0 ||
stricmp(p, ".swc") == 0)
if (strcasecmp(p, ".smc") == 0 ||
strcasecmp(p, ".fig") == 0 ||
strcasecmp(p, ".sfc") == 0 ||
strcasecmp(p, ".swc") == 0)
{
if(zippedFilename) free(zippedFilename);
return true;
@ -402,7 +402,7 @@ bool IsSz()
char * p = strrchr(browserList[browser.selIndex].filename, '.');
if (p != NULL)
if(stricmp(p, ".7z") == 0)
if(strcasecmp(p, ".7z") == 0)
return true;
}
return false;
@ -454,7 +454,7 @@ int BrowserLoadSz()
int WiiFileLoader()
{
int size;
u32 size;
char filepath[1024];
memset(Memory.NSRTHeader, 0, sizeof(Memory.NSRTHeader));

View File

@ -16,6 +16,7 @@
#include <unistd.h>
#include <gccore.h>
#include <snes9xgx.h>
#define MAXJOLIET 255
#ifdef HW_DOL

View File

@ -566,9 +566,9 @@ static bool ParseDirEntries()
if(ext == NULL)
continue;
if( stricmp(ext, "smc") != 0 && stricmp(ext, "fig") != 0 &&
stricmp(ext, "sfc") != 0 && stricmp(ext, "swc") != 0 &&
stricmp(ext, "zip") != 0 && stricmp(ext, "7z") != 0)
if( strcasecmp(ext, "smc") != 0 && strcasecmp(ext, "fig") != 0 &&
strcasecmp(ext, "sfc") != 0 && strcasecmp(ext, "swc") != 0 &&
strcasecmp(ext, "zip") != 0 && strcasecmp(ext, "7z") != 0)
continue;
}
}

View File

@ -19,8 +19,10 @@
#include <ogcsys.h>
#include <unistd.h>
#ifdef HW_RVL
#include <wiiuse/wpad.h>
#include <wupc/wupc.h>
#endif
#include <ogc/lwp_watchdog.h>
#include "snes9xgx.h"

View File

@ -13,12 +13,12 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <wiiuse/wpad.h>
#include <wupc/wupc.h>
#include <sys/stat.h>
#ifdef HW_RVL
#include <di/di.h>
#include <wiiuse/wpad.h>
#include <wupc/wupc.h>
#endif
#include "snes9xgx.h"
@ -3263,7 +3263,8 @@ static int MenuSettingsVideo()
case 1: Settings.SuperFXSpeedPerLine = 0.417 * 40.5e6; reset_sfx = true; break;
case 2: Settings.SuperFXSpeedPerLine = 0.417 * 60.5e6; reset_sfx = true; break;
}
if (reset_sfx) S9xResetSuperFX(); S9xReset();
if (reset_sfx) S9xResetSuperFX();
S9xReset();
break;
}

View File

@ -313,7 +313,7 @@ bool InitializeNetwork(bool silent)
break;
}
#else
networkInit = !(if_config(wiiIP, NULL, NULL, true) < 0);
networkInit = !(if_config(wiiIP, NULL, NULL, true, 10) < 0);
#endif
CancelAction();

View File

@ -64,7 +64,7 @@ static void createXMLSetting(const char * name, const char * description, const
mxmlElementSetAttr(item, "description", description);
}
static void createXMLController(unsigned int controller[], const char * name, const char * description)
static void createXMLController(u32 controller[], const char * name, const char * description)
{
item = mxmlNewElement(section, "controller");
mxmlElementSetAttr(item, "name", name);
@ -153,7 +153,9 @@ preparePrefsData ()
createXMLSection("Menu", "Menu Settings");
#ifdef HW_RVL
createXMLSetting("WiimoteOrientation", "Wiimote Orientation", toStr(GCSettings.WiimoteOrientation));
#endif
createXMLSetting("ExitAction", "Exit Action", toStr(GCSettings.ExitAction));
createXMLSetting("MusicVolume", "Music Volume", toStr(GCSettings.MusicVolume));
createXMLSetting("SFXVolume", "Sound Effects Volume", toStr(GCSettings.SFXVolume));
@ -166,16 +168,23 @@ preparePrefsData ()
createXMLSetting("Controller", "Controller", toStr(GCSettings.Controller));
createXMLController(btnmap[CTRL_PAD][CTRLR_GCPAD], "btnmap_pad_gcpad", "SNES Pad - GameCube Controller");
#ifdef HW_RVL
createXMLController(btnmap[CTRL_PAD][CTRLR_WIIMOTE], "btnmap_pad_wiimote", "SNES Pad - Wiimote");
createXMLController(btnmap[CTRL_PAD][CTRLR_CLASSIC], "btnmap_pad_classic", "SNES Pad - Classic Controller");
createXMLController(btnmap[CTRL_PAD][CTRLR_NUNCHUK], "btnmap_pad_nunchuk", "SNES Pad - Nunchuk + Wiimote");
#endif
createXMLController(btnmap[CTRL_SCOPE][CTRLR_GCPAD], "btnmap_scope_gcpad", "Superscope - GameCube Controller");
#ifdef HW_RVL
createXMLController(btnmap[CTRL_SCOPE][CTRLR_WIIMOTE], "btnmap_scope_wiimote", "Superscope - Wiimote");
#endif
createXMLController(btnmap[CTRL_MOUSE][CTRLR_GCPAD], "btnmap_mouse_gcpad", "Mouse - GameCube Controller");
#ifdef HW_RVL
createXMLController(btnmap[CTRL_MOUSE][CTRLR_WIIMOTE], "btnmap_mouse_wiimote", "Mouse - Wiimote");
#endif
createXMLController(btnmap[CTRL_JUST][CTRLR_GCPAD], "btnmap_just_gcpad", "Justifier - GameCube Controller");
#ifdef HW_RVL
createXMLController(btnmap[CTRL_JUST][CTRLR_WIIMOTE], "btnmap_just_wiimote", "Justifier - Wiimote");
#endif
int datasize = mxmlSaveString(xml, (char *)savebuffer, SAVEBUFFERSIZE, XMLSaveCallback);
mxmlDelete(xml);
@ -226,7 +235,7 @@ static void loadXMLSetting(float * var, const char * name)
* Load XML elements into variables for a controller mapping
***************************************************************************/
static void loadXMLController(unsigned int controller[], const char * name)
static void loadXMLController(u32 controller[], const char * name)
{
item = mxmlFindElement(xml, xml, "controller", "name", name, MXML_DESCEND);

View File

@ -255,12 +255,6 @@ void _makepath(char *filename, const char *drive, const char *dir,
ExitApp();
}
int dup(int fildes)
{
ExitApp();
return 1;
}
int access(const char *pathname, int mode)
{
ExitApp();

View File

@ -173,7 +173,7 @@
Super NES and Super Nintendo Entertainment System are trademarks of
Nintendo Co., Limited and its subsidiary companies.
***********************************************************************************/
#include "port.h"
#ifndef _CONTROLS_H_
#define _CONTROLS_H_

View File

@ -3914,7 +3914,7 @@ void CMemory::ApplyROMFixes (void)
// BPS % UPS % IPS
// number decoding used for both BPS and UPS
static uint32 XPSdecode (const uint8 *data, unsigned &addr, unsigned size)
static uint32 XPSdecode (const uint8 *data, uint32 &addr, uint32 size)
{
uint32 offset = 0, shift = 1;
while(addr < size) {

View File

@ -18,14 +18,14 @@
#include <string>
#include <ogcsys.h>
#include <unistd.h>
#include <wiiuse/wpad.h>
#include <wupc/wupc.h>
#include <fat.h>
#include <debug.h>
#include <sys/iosupport.h>
#ifdef HW_RVL
#include <di/di.h>
#include <wiiuse/wpad.h>
#include <wupc/wupc.h>
#endif
#include "snes9xgx.h"
@ -58,6 +58,7 @@ char appPath[1024] = { 0 };
static int currentMode;
extern "C" {
extern char* strcasestr(const char *, const char *);
extern void __exception_setreload(int t);
}
@ -306,7 +307,7 @@ bool SaneIOS(u32 ios)
static bool gecko = false;
static mutex_t gecko_mutex = 0;
static ssize_t __out_write(struct _reent *r, int fd, const char *ptr, size_t len)
static ssize_t __out_write(struct _reent *r, void* fd, const char *ptr, size_t len)
{
if (!gecko || len == 0)
return len;

View File

@ -14,6 +14,7 @@
#ifndef _SNES9XGX_H_
#define _SNES9XGX_H_
#define MAXPATHLEN 1024
#include "utils/FreeTypeGX.h"
#include "snes9x.h"
#include "filter.h"

View File

@ -40,7 +40,7 @@ static unsigned char * snes9xgfx = NULL;
unsigned char * filtermem = NULL; // only want ((512*2) X (239*2))
/*** 2D Video ***/
static unsigned int *xfb[2] = { NULL, NULL }; // Double buffered
static u32 *xfb[2] = { NULL, NULL }; // Double buffered
static int whichfb = 0; // Switch
GXRModeObj *vmode = NULL; // Current video mode
int screenheight = 480;