diosmios/Config.c
crediar@rypp.net b6e6f8ca44 -updated to version 2.6-
*Reduced HDD read time out to 25 seconds
*Added two disc feature (Extracted format is unsupported)
 Use the latest DMToolBox (0.3 or higher) to install your two disc games

This will be the last version for some time, since I'm moving my focus to other things.

Always remember; Impossible is nothing!



git-svn-id: svn://localhost/Users/andi/Downloads/code/trunk@34 be6c1b03-d731-4111-a574-e37d80d43941
2012-11-30 21:46:19 +00:00

83 lines
1.6 KiB
C

#include "Config.h"
DML_CFG *DMLCfg;
void ConfigInit( DML_CFG *Cfg )
{
DMLCfg = (DML_CFG*)0xFFFE4200;
memset32( DMLCfg, 0, sizeof(DML_CFG) );
//If a loader supplied any options we use them otherwise use the code defines
if( Cfg->Magicbytes == 0xD1050CF6 )
{
memcpy( DMLCfg, Cfg, sizeof( DML_CFG ) );
} else {
dbgprintf("No valid config found in RAM\n");
dbgprintf("Version:%08X\n", DMLCfg->Version );
dbgprintf("Config :%08X\n", DMLCfg->Config );
DMLCfg->Config = 0;
#ifdef CHEATHOOK
DMLCfg->Config |= DML_CFG_CHEATS;
#endif
#ifdef DEBUGGER
DMLCfg->Config |= DML_CFG_DEBUGGER;
#endif
#ifdef DEBUGGERWAIT
DMLCfg->Config |= DML_CFG_DEBUGWAIT;
#endif
#ifdef CARDMODE
DMLCfg->Config |= DML_CFG_NMM;
#endif
#ifdef CARDDEBUG
DMLCfg->Config |= DML_CFG_NMM_DEBUG;
#endif
#ifdef ACTIVITYLED
DMLCfg->Config |= DML_CFG_ACTIVITY_LED;
#endif
#ifdef PADHOOK
DMLCfg->Config |= DML_CFG_PADHOOK;
#endif
DMLCfg->Magicbytes = 0xD1050CF6;
DMLCfg->Version = CONFIG_VERSION;
DMLCfg->VideoMode = DML_VID_DML_AUTO;
}
//Check if a memcard is inserted in Slot A
if( (read32(0xD806800) & 0x1000) == 0x1000 )
{
DMLCfg->Config &= ~DML_CFG_NMM; // disable NMM
}
dbgprintf("Config:%08X\n", DMLCfg->Config );
}
inline u32 ConfigGetConfig( u32 Config )
{
return !!(DMLCfg->Config & Config);
}
inline void ConfigSetConfig( u32 Config )
{
DMLCfg->Config |= Config;
}
inline void ConfigClearConfig( u32 Config )
{
DMLCfg->Config &= ~Config;
}
u32 ConfigGetVideMode( void )
{
return DMLCfg->VideoMode;
}
char *ConfigGetGamePath( void )
{
return DMLCfg->GamePath;
}
char *ConfigGetCheatPath( void )
{
return DMLCfg->CheatPath;
}