fceugx/source/ngc/fceuconfig.cpp

104 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()
{
if(!(GCSettings.ZoomLevel > 0.5 && GCSettings.ZoomLevel < 1.5))
GCSettings.ZoomLevel = 1.0;
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 ()
{
ResetControls(); // controller button mappings
GCSettings.currpal = 0; // 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
GCSettings.currpal = 1;
2008-10-24 07:38:46 +02:00
GCSettings.ZoomLevel = 1.0; // zoom amount
GCSettings.render = 2; // Unfiltered
GCSettings.widescreen = 0; // no aspect ratio correction
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-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)
GCSettings.SaveMethod = DEVICE_AUTO; // Auto, SD, Memory Card Slot A, Memory Card Slot B, USB, Network (SMB)
2008-09-02 03:57:21 +02:00
sprintf (GCSettings.LoadFolder,"fceugx/roms"); // Path to game files
sprintf (GCSettings.SaveFolder,"fceugx/saves"); // Path to save files
sprintf (GCSettings.CheatFolder,"fceugx/cheats"); // Path to cheat files
GCSettings.AutoLoad = 1; // Auto Load RAM
GCSettings.AutoSave = 1; // Auto Save RAM
2008-09-02 03:57:21 +02:00
// custom SMB settings
strncpy (GCSettings.smbip, "", 15); // IP Address of share server
strncpy (GCSettings.smbuser, "", 19); // Your share user
strncpy (GCSettings.smbpwd, "", 19); // Your share user password
strncpy (GCSettings.smbshare, "", 19); // Share name on server
GCSettings.smbip[15] = 0;
GCSettings.smbuser[19] = 0;
GCSettings.smbpwd[19] = 0;
GCSettings.smbshare[19] = 0;
2008-09-02 03:57:21 +02:00
}