mirror of
https://github.com/dborth/snes9xgx.git
synced 2024-12-24 18:21:50 +01:00
- Fix compilation errors with latest libOGC/devkitPPC
- Fix GameCube build - Add PowerPC specific Blargg makefile flags - Add LTO to Makefile.gc
This commit is contained in:
parent
127504ca8e
commit
a417745817
@ -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
|
||||
|
@ -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));
|
||||
|
@ -16,6 +16,7 @@
|
||||
|
||||
#include <unistd.h>
|
||||
#include <gccore.h>
|
||||
#include <snes9xgx.h>
|
||||
|
||||
#define MAXJOLIET 255
|
||||
#ifdef HW_DOL
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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"
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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();
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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();
|
||||
|
@ -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_
|
||||
|
@ -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) {
|
||||
|
@ -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;
|
||||
|
@ -14,6 +14,7 @@
|
||||
#ifndef _SNES9XGX_H_
|
||||
#define _SNES9XGX_H_
|
||||
|
||||
#define MAXPATHLEN 1024
|
||||
#include "utils/FreeTypeGX.h"
|
||||
#include "snes9x.h"
|
||||
#include "filter.h"
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user