2008-09-16 07:42:21 +02:00
|
|
|
/****************************************************************************
|
2008-09-17 04:27:55 +02:00
|
|
|
* Visual Boy Advance GX
|
2008-09-16 07:42:21 +02:00
|
|
|
*
|
|
|
|
* Tantric September 2008
|
|
|
|
*
|
2008-09-17 04:27:55 +02:00
|
|
|
* vbaconfig.cpp
|
2008-09-16 07:42:21 +02:00
|
|
|
*
|
2008-09-17 04:27:55 +02:00
|
|
|
* Configuration parameters are here for easy maintenance
|
2008-09-16 07:42:21 +02:00
|
|
|
***************************************************************************/
|
|
|
|
|
|
|
|
#include <gccore.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include "vba.h"
|
2008-12-20 00:08:24 +01:00
|
|
|
#include "input.h"
|
2008-09-16 07:42:21 +02:00
|
|
|
|
|
|
|
struct SGCSettings GCSettings;
|
|
|
|
|
2009-04-08 09:08:12 +02:00
|
|
|
/****************************************************************************
|
|
|
|
* FixInvalidSettings
|
|
|
|
*
|
|
|
|
* Attempts to correct at least some invalid settings - the ones that
|
|
|
|
* might cause crashes
|
|
|
|
***************************************************************************/
|
|
|
|
void FixInvalidSettings()
|
|
|
|
{
|
2009-12-02 08:02:25 +01:00
|
|
|
if(GCSettings.LoadMethod > 4)
|
|
|
|
GCSettings.LoadMethod = DEVICE_AUTO;
|
|
|
|
if(GCSettings.SaveMethod > 4)
|
|
|
|
GCSettings.SaveMethod = DEVICE_AUTO;
|
2009-11-16 10:02:17 +01:00
|
|
|
if(!(GCSettings.gbaZoomHor > 0.5 && GCSettings.gbaZoomHor < 1.5))
|
|
|
|
GCSettings.gbaZoomHor = 1.0;
|
|
|
|
if(!(GCSettings.gbaZoomVert > 0.5 && GCSettings.gbaZoomVert < 1.5))
|
|
|
|
GCSettings.gbaZoomVert = 1.0;
|
|
|
|
if(!(GCSettings.gbZoomHor > 0.5 && GCSettings.gbZoomHor < 1.5))
|
|
|
|
GCSettings.gbZoomHor = 1.0;
|
|
|
|
if(!(GCSettings.gbZoomVert > 0.5 && GCSettings.gbZoomVert < 1.5))
|
|
|
|
GCSettings.gbZoomVert = 1.0;
|
2009-04-08 09:08:12 +02:00
|
|
|
if(!(GCSettings.xshift > -50 && GCSettings.xshift < 50))
|
|
|
|
GCSettings.xshift = 0;
|
|
|
|
if(!(GCSettings.yshift > -50 && GCSettings.yshift < 50))
|
|
|
|
GCSettings.yshift = 0;
|
|
|
|
if(!(GCSettings.MusicVolume >= 0 && GCSettings.MusicVolume <= 100))
|
|
|
|
GCSettings.MusicVolume = 40;
|
|
|
|
if(!(GCSettings.SFXVolume >= 0 && GCSettings.SFXVolume <= 100))
|
|
|
|
GCSettings.SFXVolume = 40;
|
2009-05-12 08:59:05 +02:00
|
|
|
if(!(GCSettings.render >= 0 && GCSettings.render < 3))
|
2009-04-08 09:08:12 +02:00
|
|
|
GCSettings.render = 1;
|
2009-04-22 20:24:05 +02:00
|
|
|
if(!(GCSettings.videomode >= 0 && GCSettings.videomode < 5))
|
|
|
|
GCSettings.videomode = 0;
|
2009-04-08 09:08:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* DefaultSettings
|
|
|
|
*
|
|
|
|
* Sets all the defaults!
|
|
|
|
***************************************************************************/
|
2008-09-16 07:42:21 +02:00
|
|
|
void
|
|
|
|
DefaultSettings ()
|
|
|
|
{
|
2009-12-23 08:22:19 +01:00
|
|
|
memset (&GCSettings, 0, sizeof (GCSettings));
|
2008-12-19 23:01:15 +01:00
|
|
|
ResetControls(); // controller button mappings
|
|
|
|
|
2009-10-02 00:42:02 +02:00
|
|
|
GCSettings.LoadMethod = DEVICE_AUTO; // Auto, SD, DVD, USB, Network (SMB)
|
2009-12-23 08:22:19 +01:00
|
|
|
GCSettings.SaveMethod = DEVICE_AUTO; // Auto, SD, USB, Network (SMB)
|
|
|
|
sprintf (GCSettings.LoadFolder, "%s/roms", APPFOLDER); // Path to game files
|
|
|
|
sprintf (GCSettings.SaveFolder, "%s/saves", APPFOLDER); // Path to save files
|
|
|
|
sprintf (GCSettings.CheatFolder, "%s/cheats", APPFOLDER); // Path to cheat files
|
2008-09-16 07:42:21 +02:00
|
|
|
GCSettings.AutoLoad = 1;
|
|
|
|
GCSettings.AutoSave = 1;
|
|
|
|
|
2009-03-04 08:01:04 +01:00
|
|
|
GCSettings.WiimoteOrientation = 0;
|
|
|
|
|
2009-11-16 10:02:17 +01:00
|
|
|
GCSettings.gbaZoomHor = 1.0; // GBA horizontal zoom level
|
|
|
|
GCSettings.gbaZoomVert = 1.0; // GBA vertical zoom level
|
|
|
|
GCSettings.gbZoomHor = 1.0; // GBA horizontal zoom level
|
|
|
|
GCSettings.gbZoomVert = 1.0; // GBA vertical zoom level
|
2009-04-22 20:24:05 +02:00
|
|
|
GCSettings.videomode = 0; // automatic video mode detection
|
2008-10-28 08:50:13 +01:00
|
|
|
GCSettings.render = 1; // Filtered
|
2009-03-04 08:01:04 +01:00
|
|
|
GCSettings.scaling = 1; // partial stretch
|
2009-04-08 09:08:12 +02:00
|
|
|
GCSettings.WiiControls = false; // Match Wii Game
|
2009-01-26 08:11:02 +01:00
|
|
|
|
2009-04-08 09:08:12 +02:00
|
|
|
GCSettings.xshift = 0; // horizontal video shift
|
|
|
|
GCSettings.yshift = 0; // vertical video shift
|
2009-06-10 04:06:56 +02:00
|
|
|
GCSettings.colorize = 0; // Colorize mono gameboy games
|
2009-04-08 09:08:12 +02:00
|
|
|
|
|
|
|
GCSettings.WiimoteOrientation = 0;
|
|
|
|
GCSettings.ExitAction = 0;
|
|
|
|
GCSettings.MusicVolume = 40;
|
|
|
|
GCSettings.SFXVolume = 40;
|
2009-05-20 07:23:49 +02:00
|
|
|
GCSettings.Rumble = 1;
|
2008-09-16 07:42:21 +02:00
|
|
|
}
|