fceugx/source/ngc/fceuconfig.cpp

101 lines
3.6 KiB
C++
Raw Normal View History

2008-09-02 03:57:21 +02:00
/****************************************************************************
2009-07-22 04:05:49 +02:00
* FCE Ultra
2008-09-02 03:57:21 +02:00
* Nintendo Wii/Gamecube Port
*
2009-03-28 18:23:08 +01:00
* Tantric 2008-2009
2008-09-02 03:57:21 +02:00
*
2009-03-28 18:23:08 +01:00
* fceuconfig.cpp
2008-09-02 03:57:21 +02:00
*
* Configuration parameters
****************************************************************************/
#include <gccore.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
2009-07-17 19:27:04 +02:00
#include "fceusupport.h"
#include "fceugx.h"
2009-07-21 08:26:38 +02:00
#include "videofilter.h"
#include "pad.h"
2008-09-02 03:57:21 +02:00
struct SGCSettings GCSettings;
2009-03-28 18:23:08 +01:00
/****************************************************************************
* FixInvalidSettings
*
* Attempts to correct at least some invalid settings - the ones that
* might cause crashes
***************************************************************************/
void FixInvalidSettings()
{
2009-12-02 07:42:30 +01:00
if(GCSettings.LoadMethod > 4)
GCSettings.LoadMethod = DEVICE_AUTO;
if(GCSettings.SaveMethod > 4)
GCSettings.SaveMethod = DEVICE_AUTO;
2009-11-16 09:14:38 +01:00
if(!(GCSettings.zoomHor > 0.5 && GCSettings.zoomHor < 1.5))
GCSettings.zoomHor = 1.0;
if(!(GCSettings.zoomVert > 0.5 && GCSettings.zoomVert < 1.5))
GCSettings.zoomVert = 1.0;
2009-03-28 18:23:08 +01: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-03-28 20:33:14 +01:00
if(GCSettings.Controller > CTRL_PAD4 || GCSettings.Controller < CTRL_ZAPPER)
GCSettings.Controller = CTRL_PAD2;
2009-03-30 10:22:55 +02:00
if(!(GCSettings.render >= 0 && GCSettings.render < 3))
GCSettings.render = 2;
2009-04-22 00:36:46 +02:00
if(GCSettings.timing != 0 && GCSettings.timing != 1)
GCSettings.timing = 0;
if(!(GCSettings.videomode >= 0 && GCSettings.videomode < 5))
GCSettings.videomode = 0;
2009-03-28 18:23:08 +01:00
}
/****************************************************************************
* DefaultSettings
*
* Sets all the defaults!
***************************************************************************/
2008-09-02 03:57:21 +02:00
void
DefaultSettings ()
{
2009-12-23 08:23:08 +01:00
memset (&GCSettings, 0, sizeof (GCSettings));
ResetControls(); // controller button mappings
2009-10-07 08:59:10 +02:00
GCSettings.currpal = 1; // color palette
GCSettings.timing = 0; // 0 - NTSC, 1 - PAL
GCSettings.videomode = 0; // automatic video mode detection
2009-03-28 18:23:08 +01:00
GCSettings.Controller = CTRL_PAD2; // NES pad, Four Score, Zapper
GCSettings.crosshair = 1; // show zapper crosshair
GCSettings.spritelimit = 1; // enforce 8 sprite limit
2009-10-07 08:59:10 +02:00
GCSettings.gamegenie = 1;
GCSettings.render = 2; // Unfiltered
2008-11-10 04:36:21 +01:00
GCSettings.hideoverscan = 2; // hide both horizontal and vertical
2009-07-21 08:26:38 +02:00
GCSettings.FilterMethod = FILTER_NONE; // no hq2x
2008-09-02 03:57:21 +02:00
2009-11-16 09:14:38 +01:00
GCSettings.widescreen = 0; // no aspect ratio correction
GCSettings.zoomHor = 1.0; // horizontal zoom level
GCSettings.zoomVert = 1.0; // vertical zoom level
2009-03-28 18:23:08 +01:00
GCSettings.xshift = 0; // horizontal video shift
GCSettings.yshift = 0; // vertical video shift
GCSettings.WiimoteOrientation = 0;
GCSettings.ExitAction = 0;
GCSettings.MusicVolume = 40;
GCSettings.SFXVolume = 40;
GCSettings.Rumble = 1;
2009-01-26 08:10:20 +01:00
2009-10-02 00:21:25 +02:00
GCSettings.LoadMethod = DEVICE_AUTO; // Auto, SD, DVD, USB, Network (SMB)
2009-12-23 08:23:08 +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
GCSettings.AutoLoad = 1; // Auto Load RAM
GCSettings.AutoSave = 1; // Auto Save RAM
2008-09-02 03:57:21 +02:00
}