update comments

This commit is contained in:
dborth 2009-03-28 19:03:35 +00:00
parent 9d3f522588
commit de13cf6927
20 changed files with 228 additions and 147 deletions

View File

@ -94,6 +94,11 @@ InitAudio ()
LWP_CreateThread (&athread, AudioThread, NULL, astack, AUDIOSTACK, 150);
}
/****************************************************************************
* SwitchAudioMode
*
* Switches between menu sound and emulator sound
***************************************************************************/
void
SwitchAudioMode(int mode)
{
@ -117,6 +122,12 @@ SwitchAudioMode(int mode)
}
}
/****************************************************************************
* ShutdownAudio
*
* Shuts down audio subsystem. Useful to avoid unpleasant sounds if a
* crash occurs during shutdown.
***************************************************************************/
void ShutdownAudio()
{
#ifndef NO_SOUND

View File

@ -2,6 +2,7 @@
* Snes9x 1.51 Nintendo Wii/Gamecube Port
*
* michniewski August 2008
* Tantric 2008-2009
*
* button_mapping.c
*

View File

@ -2,6 +2,7 @@
* Snes9x 1.51 Nintendo Wii/Gamecube Port
*
* michniewski August 2008
* Tantric 2008-2009
*
* button_mapping.h
*

View File

@ -3,7 +3,7 @@
*
* softdev July 2006
* svpe & crunchy2 June 2007
* Tantric September 2008
* Tantric 2008-2009
*
* dvd.cpp
*
@ -144,7 +144,6 @@ static int dvd_buffered_read(void *dst, u32 len, u64 offset)
* This function relies on dvddir (file offset) being prepopulated!
* returns: 1 - ok ; 0 - error
***************************************************************************/
int dvd_safe_read(void *dst_v, u32 len, u64 fileoffset)
{
u64 offset = dvddir + fileoffset;
@ -321,7 +320,6 @@ getpvd ()
*
* Tests if a ISO9660 DVD is inserted and available, and mounts it
***************************************************************************/
bool MountDVD(bool silent)
{
bool res = false;
@ -364,7 +362,6 @@ bool MountDVD(bool silent)
* Support function to return the next file entry, if any
* Declared static to avoid accidental external entry.
***************************************************************************/
static int
getentry (int entrycount, unsigned char dvdbuffer[])
{
@ -548,7 +545,6 @@ ParseDVDdirectory ()
* SetDVDdirectory
* Set the current DVD file offset
***************************************************************************/
void SetDVDdirectory(u64 dir, int length)
{
dvddir = dir;
@ -647,7 +643,6 @@ bool SwitchDVDFolder(char origdir[])
* This function will load a file from DVD
* It assumes dvddir and dvddirlength are prepopulated
***************************************************************************/
int
LoadDVDFileOffset (unsigned char *buffer, int length)
{
@ -719,7 +714,6 @@ done:
* It will attempt to find the offset of the file, and if successful it
* will populate dvddir and dvddirlength, and load the file
***************************************************************************/
int
LoadDVDFile(char * buffer, char *filepath, int datasize, bool silent)
{

View File

@ -3,7 +3,7 @@
*
* softdev July 2006
* svpe & crunchy2 June 2007
* Tantric September 2008
* Tantric 2008-2009
*
* dvd.h
*
@ -25,7 +25,6 @@ int dvd_safe_read (void *dst, unsigned int len, u64 offset);
void SetDVDDriveType();
#ifdef HW_DOL
void dvd_motor_off ();
void uselessinquiry ();
#endif
#endif

View File

@ -7,7 +7,7 @@
* Michniewski 2008
* Tantric 2008-2009
*
* filesel.cpp
* filebrowser.cpp
*
* Generic file routines - reading, writing, browsing
***************************************************************************/
@ -306,7 +306,6 @@ int FileSortCallback(const void *f1, const void *f2)
* If the file is a zip, we will check the file extension / file size of the
* first file inside
***************************************************************************/
static bool IsValidROM(int method)
{
// file size should be between 96K and 8MB
@ -357,7 +356,6 @@ static bool IsValidROM(int method)
*
* Checks if the specified file is a 7z
***************************************************************************/
bool IsSz()
{
if (strlen(browserList[browser.selIndex].filename) > 4)
@ -376,7 +374,6 @@ bool IsSz()
*
* Strips an extension from a filename
***************************************************************************/
void StripExt(char* returnstring, char * inputstring)
{
char* loc_dot;
@ -391,7 +388,11 @@ void StripExt(char* returnstring, char * inputstring)
*loc_dot = 0; // strip file extension
}
// 7z file - let's open it up to select a file inside
/****************************************************************************
* BrowserLoadSz
*
* Opens the selected 7z file, and parses a listing of the files within
***************************************************************************/
int BrowserLoadSz(int method)
{
char filepath[MAXPATHLEN];
@ -417,6 +418,11 @@ int BrowserLoadSz(int method)
return szfiles;
}
/****************************************************************************
* BrowserLoadFile
*
* Loads the selected ROM
***************************************************************************/
int BrowserLoadFile(int method)
{
char filepath[1024];
@ -483,7 +489,11 @@ done:
return loaded;
}
/* update current directory and set new entry list if directory has changed */
/****************************************************************************
* BrowserChangeFolder
*
* Update current directory and set new entry list if directory has changed
***************************************************************************/
int BrowserChangeFolder(int method)
{
if(inSz && browser.selIndex == 0) // inside a 7z, requesting to leave
@ -521,7 +531,6 @@ int BrowserChangeFolder(int method)
* OpenROM
* Displays a list of ROMS on load device
***************************************************************************/
int
OpenGameList ()
{

View File

@ -6,13 +6,13 @@
* Michniewski 2008
* Tantric 2008-2009
*
* filesel.h
* filebrowser.h
*
* Generic file routines - reading, writing, browsing
****************************************************************************/
#ifndef _NGCFILESEL_
#define _NGCFILESEL_
#ifndef _FILEBROWSER_H_
#define _FILEBROWSER_H_
#include <unistd.h>
#include <gccore.h>

View File

@ -9,8 +9,6 @@
***************************************************************************/
#include "gui.h"
#include "snes9xGX.h"
#include "filelist.h"
static int currentSize = 0;
static int presetSize = 0;

View File

@ -602,7 +602,7 @@ void NGCReportButtons ()
}
}
void SetControllers ()
void SetControllers()
{
if (Settings.MultiPlayer5Master == true)
{
@ -637,104 +637,102 @@ void SetControllers ()
***************************************************************************/
void SetDefaultButtonMap ()
{
int maxcode = 0x10;
s9xcommand_t cmd;
int maxcode = 0x10;
s9xcommand_t cmd;
/*** Joypad 1 ***/
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad1 A");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad1 B");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad1 X");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad1 Y");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad1 L");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad1 R");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad1 Start");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad1 Select");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad1 Up");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad1 Down");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad1 Left");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad1 Right");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad1 A");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad1 B");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad1 X");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad1 Y");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad1 L");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad1 R");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad1 Start");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad1 Select");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad1 Up");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad1 Down");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad1 Left");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad1 Right");
maxcode = 0x20;
maxcode = 0x20;
/*** Joypad 2 ***/
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad2 A");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad2 B");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad2 X");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad2 Y");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad2 L");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad2 R");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad2 Start");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad2 Select");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad2 Up");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad2 Down");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad2 Left");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad2 Right");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad2 A");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad2 B");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad2 X");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad2 Y");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad2 L");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad2 R");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad2 Start");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad2 Select");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad2 Up");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad2 Down");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad2 Left");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad2 Right");
maxcode = 0x30;
maxcode = 0x30;
/*** Joypad 3 ***/
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad3 A");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad3 B");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad3 X");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad3 Y");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad3 L");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad3 R");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad3 Start");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad3 Select");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad3 Up");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad3 Down");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad3 Left");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad3 Right");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad3 A");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad3 B");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad3 X");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad3 Y");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad3 L");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad3 R");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad3 Start");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad3 Select");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad3 Up");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad3 Down");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad3 Left");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad3 Right");
maxcode = 0x40;
maxcode = 0x40;
/*** Joypad 4 ***/
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad4 A");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad4 B");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad4 X");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad4 Y");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad4 L");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad4 R");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad4 Start");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad4 Select");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad4 Up");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad4 Down");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad4 Left");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad4 Right");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad4 A");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad4 B");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad4 X");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad4 Y");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad4 L");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad4 R");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad4 Start");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad4 Select");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad4 Up");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad4 Down");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad4 Left");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad4 Right");
maxcode = 0x50;
maxcode = 0x50;
/*** Superscope ***/
ASSIGN_BUTTON_FALSE (maxcode++, "Superscope Fire");
ASSIGN_BUTTON_FALSE (maxcode++, "Superscope AimOffscreen");
ASSIGN_BUTTON_FALSE (maxcode++, "Superscope Cursor");
ASSIGN_BUTTON_FALSE (maxcode++, "Superscope ToggleTurbo");
ASSIGN_BUTTON_FALSE (maxcode++, "Superscope ToggleTurbo");
ASSIGN_BUTTON_FALSE (maxcode++, "Superscope Pause");
ASSIGN_BUTTON_FALSE (maxcode++, "Superscope Fire");
ASSIGN_BUTTON_FALSE (maxcode++, "Superscope AimOffscreen");
ASSIGN_BUTTON_FALSE (maxcode++, "Superscope Cursor");
ASSIGN_BUTTON_FALSE (maxcode++, "Superscope ToggleTurbo");
ASSIGN_BUTTON_FALSE (maxcode++, "Superscope ToggleTurbo");
ASSIGN_BUTTON_FALSE (maxcode++, "Superscope Pause");
maxcode = 0x60;
maxcode = 0x60;
/*** Mouse ***/
ASSIGN_BUTTON_FALSE (maxcode++, "Mouse1 L");
ASSIGN_BUTTON_FALSE (maxcode++, "Mouse1 R");
ASSIGN_BUTTON_FALSE (maxcode++, "Mouse2 L");
ASSIGN_BUTTON_FALSE (maxcode++, "Mouse2 R");
ASSIGN_BUTTON_FALSE (maxcode++, "Mouse1 L");
ASSIGN_BUTTON_FALSE (maxcode++, "Mouse1 R");
ASSIGN_BUTTON_FALSE (maxcode++, "Mouse2 L");
ASSIGN_BUTTON_FALSE (maxcode++, "Mouse2 R");
maxcode = 0x70;
maxcode = 0x70;
/*** Justifier ***/
ASSIGN_BUTTON_FALSE (maxcode++, "Justifier1 Trigger");
ASSIGN_BUTTON_FALSE (maxcode++, "Justifier1 AimOffscreen");
ASSIGN_BUTTON_FALSE (maxcode++, "Justifier1 Start");
ASSIGN_BUTTON_FALSE (maxcode++, "Justifier2 Trigger");
ASSIGN_BUTTON_FALSE (maxcode++, "Justifier2 AimOffscreen");
ASSIGN_BUTTON_FALSE (maxcode++, "Justifier2 Start");
ASSIGN_BUTTON_FALSE (maxcode++, "Justifier1 Trigger");
ASSIGN_BUTTON_FALSE (maxcode++, "Justifier1 AimOffscreen");
ASSIGN_BUTTON_FALSE (maxcode++, "Justifier1 Start");
ASSIGN_BUTTON_FALSE (maxcode++, "Justifier2 Trigger");
ASSIGN_BUTTON_FALSE (maxcode++, "Justifier2 AimOffscreen");
ASSIGN_BUTTON_FALSE (maxcode++, "Justifier2 Start");
maxcode = 0x80;
S9xMapPointer( maxcode++, S9xGetCommandT("Pointer Superscope"), false);
S9xMapPointer( maxcode++, S9xGetCommandT("Pointer Mouse1"), false);
S9xMapPointer( maxcode++, S9xGetCommandT("Pointer Mouse2"), false);
S9xMapPointer( maxcode++, S9xGetCommandT("Pointer Justifier1"), false);
S9xMapPointer( maxcode++, S9xGetCommandT("Pointer Justifier2"), false);
maxcode = 0x80;
S9xMapPointer(maxcode++, S9xGetCommandT("Pointer Superscope"), false);
S9xMapPointer(maxcode++, S9xGetCommandT("Pointer Mouse1"), false);
S9xMapPointer(maxcode++, S9xGetCommandT("Pointer Mouse2"), false);
S9xMapPointer(maxcode++, S9xGetCommandT("Pointer Justifier1"), false);
S9xMapPointer(maxcode++, S9xGetCommandT("Pointer Justifier2"), false);
maxcode = 0x90;
ASSIGN_BUTTON_FALSE (maxcode++, "Screenshot");
SetControllers ();
maxcode = 0x90;
ASSIGN_BUTTON_FALSE (maxcode++, "Screenshot");
SetControllers();
}

View File

@ -10,8 +10,8 @@
* Memory Card routines
***************************************************************************/
#ifndef _NGCMCSAVE_
#define _NGCMCSAVE_
#ifndef _MEMCARDOP_
#define _MEMCARDOP_
int ParseMCDirectory (int slot);
int LoadMCFile (char *buf, int slot, char *filename, bool silent);

View File

@ -42,7 +42,6 @@ extern "C" {
#include "networkop.h"
#include "memcardop.h"
#include "fileop.h"
#include "dvd.h"
#include "s9xconfig.h"
#include "sram.h"
@ -53,7 +52,6 @@ extern "C" {
#include "input.h"
#include "patch.h"
#include "filter.h"
#include "filelist.h"
#include "gui/gui.h"
#include "menu.h"
@ -947,10 +945,10 @@ static void ControllerWindowUpdate(void * ptr, int dir)
{
GCSettings.Controller += dir;
if(GCSettings.Controller > CTRL_LENGTH-1)
GCSettings.Controller = 0;
else if(GCSettings.Controller < 0)
GCSettings.Controller = CTRL_LENGTH-1;
if(GCSettings.Controller > CTRL_PAD4)
GCSettings.Controller = CTRL_MOUSE;
if(GCSettings.Controller < CTRL_MOUSE)
GCSettings.Controller = CTRL_PAD4;
settingText->SetText(ctrlName[GCSettings.Controller]);
b->ResetState();
@ -962,7 +960,7 @@ static void ControllerWindowRightClick(void * ptr) { ControllerWindowUpdate(ptr,
static void ControllerWindow()
{
GuiWindow * w = new GuiWindow(250,250);
GuiWindow * w = new GuiWindow(300,250);
w->SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE);
GuiTrigger trigA;

View File

@ -21,7 +21,6 @@ void InfoPrompt(const char * msg);
void ShowAction (const char *msg);
void CancelAction();
void ShowProgress (const char *msg, int done, int total);
void ShutoffRumble();
enum
{

View File

@ -65,20 +65,51 @@ void UpdateCheck()
item = mxmlFindElement(xml, xml, "app", "version", NULL, MXML_DESCEND);
if(item) // a version entry exists
{
const char * versionstr = mxmlElementGetAttr(item, "version");
const char * version = mxmlElementGetAttr(item, "version");
if(versionstr)
if(version && strlen(version) == 5)
{
int version = atoi(versionstr);
int currVersion = atoi(APPVERSION);
int verMajor = version[0] - '0';
int verMinor = version[2] - '0';
int verPoint = version[4] - '0';
int curMajor = APPVERSION[0] - '0';
int curMinor = APPVERSION[2] - '0';
int curPoint = APPVERSION[4] - '0';
if(version > currVersion) // a new version is available
// check that the versioning is valid and is a newer version
if((verMajor >= 0 && verMajor <= 9 &&
verMinor >= 0 && verMinor <= 9 &&
verPoint >= 0 && verPoint <= 9) &&
(verMajor > curMajor ||
verMinor > curMinor ||
verPoint > curPoint))
{
item = mxmlFindElement(xml, xml, "file", NULL, NULL, MXML_DESCEND);
if(item)
{
snprintf(updateURL, 128, "%s", mxmlElementGetAttr(item, "url"));
updateFound = true;
const char * tmp = mxmlElementGetAttr(item, "url");
if(tmp)
{
snprintf(updateURL, 128, "%s", tmp);
updateFound = true;
}
}
}
}
else // temporary, for compatibility
{
int versionnum = atoi(version);
if(versionnum > 10) // 010
{
item = mxmlFindElement(xml, xml, "file", NULL, NULL, MXML_DESCEND);
if(item)
{
const char * tmp = mxmlElementGetAttr(item, "url");
if(tmp)
{
snprintf(updateURL, 128, "%s", tmp);
updateFound = true;
}
}
}
}

View File

@ -256,9 +256,28 @@ decodePrefsData (int method)
{
const char * version = mxmlElementGetAttr(item, "version");
if(version)
if(version && strlen(version) == 5)
{
result = true; // assume version is valid
// this code assumes version in format X.X.X
// XX.X.X, X.XX.X, or X.X.XX will NOT work
int verMajor = version[0] - '0';
int verMinor = version[2] - '0';
int verPoint = version[4] - '0';
int curMajor = APPVERSION[0] - '0';
int curMinor = APPVERSION[2] - '0';
int curPoint = APPVERSION[4] - '0';
// first we'll check that the versioning is valid
if(!(verMajor >= 0 && verMajor <= 9 &&
verMinor >= 0 && verMinor <= 9 &&
verPoint >= 0 && verPoint <= 9))
result = false;
else if(verPoint < 8 && verMajor == 1) // less than version 1.0.8
result = false; // reset settings (sorry, should update settings instead)
else if(verMajor > curMajor || verMinor > curMinor || verPoint > curPoint) // some future version
result = false; // reset settings
else
result = true;
}
}

View File

@ -22,10 +22,11 @@
struct SGCSettings GCSettings;
/****************************************************************************
* FixInvalidSettings
*
* Attempts to correct at least some invalid settings - the ones that
* might cause crashes
***************************************************************************/
void FixInvalidSettings()
{
if(!(GCSettings.ZoomLevel > 0.5 && GCSettings.ZoomLevel < 1.5))
@ -38,8 +39,15 @@ void FixInvalidSettings()
GCSettings.MusicVolume = 40;
if(!(GCSettings.SFXVolume >= 0 && GCSettings.SFXVolume <= 100))
GCSettings.SFXVolume = 40;
if(GCSettings.Controller > CTRL_PAD4 || GCSettings.Controller < CTRL_MOUSE)
GCSettings.Controller = CTRL_PAD2;
}
/****************************************************************************
* DefaultSettings
*
* Sets all the defaults!
***************************************************************************/
void
DefaultSettings ()
{
@ -67,15 +75,15 @@ DefaultSettings ()
GCSettings.smbpwd[19] = 0;
GCSettings.smbshare[19] = 0;
GCSettings.Controller = 0;
GCSettings.Controller = CTRL_PAD2;
GCSettings.ZoomLevel = 1.0; // zoom level
GCSettings.render = 2; // Unfiltered
GCSettings.widescreen = 0; // no aspect ratio correction
GCSettings.FilterMethod = FILTER_NONE; // no hq2x
GCSettings.xshift = 0; // video shift
GCSettings.yshift = 0;
GCSettings.xshift = 0; // horizontal video shift
GCSettings.yshift = 0; // vertical video shift
GCSettings.WiimoteOrientation = 0;
GCSettings.ExitAction = 0;
@ -144,4 +152,3 @@ DefaultSettings ()
Settings.ForceDSP1 = 0;
Settings.ForceNoDSP1 = 0;
}

View File

@ -14,10 +14,9 @@
***************************************************************************/
#ifndef _S9XCONFIG_
#define _S9XCONFIG_
void FixInvalidSettings();
void DefaultSettings ();
void DefaultSettings();
#endif

View File

@ -303,11 +303,11 @@ static void * InitThread (void *arg)
// Allocate SNES Memory
if (!Memory.Init ())
while (1);
ExitApp();
// Allocate APU
if (!S9xInitAPU ())
while (1);
ExitApp();
// Set Pixel Renderer to match 565
S9xSetRenderPixelFormat (RGB565);
@ -318,7 +318,7 @@ static void * InitThread (void *arg)
// Initialise Graphics
setGFX ();
if (!S9xGraphicsInit ())
while (1);
ExitApp();
// Check if DVD drive belongs to a Wii
SetDVDDriveType();
@ -374,7 +374,7 @@ main(int argc, char *argv[])
#ifdef HW_RVL
// read wiimote accelerometer and IR data
WPAD_SetDataFormat(WPAD_CHAN_ALL,WPAD_FMT_BTNS_ACC_IR);
WPAD_SetVRes(WPAD_CHAN_ALL,screenwidth, screenheight);
WPAD_SetVRes(WPAD_CHAN_ALL, screenwidth, screenheight);
// Wii Power/Reset buttons
WPAD_SetPowerButtonCallback((WPADShutdownCallback)ShutdownCB);

View File

@ -20,7 +20,7 @@
#include "filelist.h"
#define APPNAME "Snes9x GX"
#define APPVERSION "009"
#define APPVERSION "4.0.0"
#define PREF_FILE_NAME "settings.xml"
#define NOTSILENT 0
@ -58,8 +58,8 @@ enum
CTRL_LENGTH
};
const char ctrlName[6][20] =
{ "SNES Controller", "SNES Mouse", "Superscope", "Justifier", "SNES Pad (2)", "SNES Pad (4)" };
const char ctrlName[6][24] =
{ "SNES Controller", "SNES Mouse", "Superscope", "Justifier", "SNES Controllers (2)", "SNES Controllers (4)" };
struct SGCSettings{
int AutoLoad;

View File

@ -388,7 +388,7 @@ draw_square (Mtx v)
/****************************************************************************
* StartGX
*
* This function initialises the GX.
* Initialises GX and sets it up for use
***************************************************************************/
static void
StartGX ()
@ -409,6 +409,11 @@ StartGX ()
vheight = 100;
}
/****************************************************************************
* StopGX
*
* Stops GX (when exiting)
***************************************************************************/
void StopGX()
{
GX_AbortFrame();
@ -859,13 +864,10 @@ setGFX ()
}
/****************************************************************************
* GX Menu drawing routines
* TakeScreenshot
*
* Copies the current screen into a GX texture
***************************************************************************/
/**
* Make a snapshot of the screen in a texture.
* @return A pointer to a texture representing the screen or NULL if an error occurs.
*/
void TakeScreenshot()
{
int texSize = vmode->fbWidth * vmode->efbHeight * 4;
@ -960,6 +962,11 @@ ResetVideo_Menu ()
GX_SetAlphaUpdate(GX_TRUE);
}
/****************************************************************************
* Menu_Render
*
* Renders everything current sent to GX, and flushes video
***************************************************************************/
void Menu_Render()
{
GX_DrawDone ();
@ -973,7 +980,13 @@ void Menu_Render()
VIDEO_WaitVSync();
}
void Menu_DrawImg(f32 xpos, f32 ypos, u16 width, u16 height, u8 data[], f32 degrees, f32 scaleX, f32 scaleY, u8 alpha)
/****************************************************************************
* Menu_DrawImg
*
* Draws the specified image on screen using GX
***************************************************************************/
void Menu_DrawImg(f32 xpos, f32 ypos, u16 width, u16 height, u8 data[],
f32 degrees, f32 scaleX, f32 scaleY, u8 alpha)
{
if(data == NULL)
return;
@ -1023,6 +1036,11 @@ void Menu_DrawImg(f32 xpos, f32 ypos, u16 width, u16 height, u8 data[], f32 degr
GX_SetVtxDesc (GX_VA_TEX0, GX_NONE);
}
/****************************************************************************
* Menu_DrawRectangle
*
* Draws a rectangle at the specified coordinates using GX
***************************************************************************/
void Menu_DrawRectangle(f32 x, f32 y, f32 width, f32 height, GXColor color, u8 filled)
{
u8 fmt;

View File

@ -10,7 +10,6 @@
***************************************************************************/
#ifndef _GCVIDEOH_
#define _GCVIDEOH_
#include <ogcsys.h>