Added RAM init menu option to Qt GUI.
This commit is contained in:
parent
ffc7e70b0d
commit
1cf00640c4
|
@ -715,6 +715,49 @@ void consoleWin_t::createMainMenu(void)
|
|||
connect( region[1], SIGNAL(triggered(void)), this, SLOT(setRegionPAL(void)) );
|
||||
connect( region[2], SIGNAL(triggered(void)), this, SLOT(setRegionDendy(void)) );
|
||||
|
||||
// Emulation -> RAM Init
|
||||
subMenu = emuMenu->addMenu(tr("&RAM Init"));
|
||||
group = new QActionGroup(this);
|
||||
|
||||
group->setExclusive(true);
|
||||
|
||||
for (int i=0; i<4; i++)
|
||||
{
|
||||
const char *txt;
|
||||
|
||||
switch (i)
|
||||
{
|
||||
default:
|
||||
case 0:
|
||||
txt = "&Default";
|
||||
break;
|
||||
case 1:
|
||||
txt = "Fill $&FF";
|
||||
break;
|
||||
case 2:
|
||||
txt = "Fill $&00";
|
||||
break;
|
||||
case 3:
|
||||
txt = "&Random";
|
||||
break;
|
||||
}
|
||||
|
||||
ramInit[i] = new QAction(tr(txt), this);
|
||||
ramInit[i]->setCheckable(true);
|
||||
|
||||
group->addAction(ramInit[i]);
|
||||
subMenu->addAction(ramInit[i]);
|
||||
}
|
||||
|
||||
g_config->getOption ("SDL.RamInitMethod", &RAMInitOption);
|
||||
|
||||
ramInit[ RAMInitOption ]->setChecked(true);
|
||||
|
||||
connect( ramInit[0], SIGNAL(triggered(void)), this, SLOT(setRamInit0(void)) );
|
||||
connect( ramInit[1], SIGNAL(triggered(void)), this, SLOT(setRamInit1(void)) );
|
||||
connect( ramInit[2], SIGNAL(triggered(void)), this, SLOT(setRamInit2(void)) );
|
||||
connect( ramInit[3], SIGNAL(triggered(void)), this, SLOT(setRamInit3(void)) );
|
||||
|
||||
emuMenu->addSeparator();
|
||||
|
||||
// Emulation -> Enable Game Genie
|
||||
|
@ -2027,6 +2070,38 @@ void consoleWin_t::setRegionDendy(void)
|
|||
return;
|
||||
}
|
||||
|
||||
void consoleWin_t::setRamInit0(void)
|
||||
{
|
||||
RAMInitOption = 0;
|
||||
|
||||
g_config->setOption ("SDL.RamInitMethod", RAMInitOption);
|
||||
return;
|
||||
}
|
||||
|
||||
void consoleWin_t::setRamInit1(void)
|
||||
{
|
||||
RAMInitOption = 1;
|
||||
|
||||
g_config->setOption ("SDL.RamInitMethod", RAMInitOption);
|
||||
return;
|
||||
}
|
||||
|
||||
void consoleWin_t::setRamInit2(void)
|
||||
{
|
||||
RAMInitOption = 2;
|
||||
|
||||
g_config->setOption ("SDL.RamInitMethod", RAMInitOption);
|
||||
return;
|
||||
}
|
||||
|
||||
void consoleWin_t::setRamInit3(void)
|
||||
{
|
||||
RAMInitOption = 3;
|
||||
|
||||
g_config->setOption ("SDL.RamInitMethod", RAMInitOption);
|
||||
return;
|
||||
}
|
||||
|
||||
void consoleWin_t::toggleGameGenie(bool checked)
|
||||
{
|
||||
int gg_enabled;
|
||||
|
|
|
@ -181,6 +181,7 @@ class consoleWin_t : public QMainWindow
|
|||
QAction *recMovAct;
|
||||
QAction *recAsMovAct;
|
||||
QAction *region[3];
|
||||
QAction *ramInit[4];
|
||||
|
||||
QTimer *gameTimer;
|
||||
|
||||
|
@ -260,6 +261,10 @@ class consoleWin_t : public QMainWindow
|
|||
void setRegionNTSC(void);
|
||||
void setRegionPAL(void);
|
||||
void setRegionDendy(void);
|
||||
void setRamInit0(void);
|
||||
void setRamInit1(void);
|
||||
void setRamInit2(void);
|
||||
void setRamInit3(void);
|
||||
void insertCoin(void);
|
||||
void fdsSwitchDisk(void);
|
||||
void fdsEjectDisk(void);
|
||||
|
|
|
@ -234,6 +234,7 @@ InitConfig()
|
|||
config->addOption("clipsides", "SDL.ClipSides", 0);
|
||||
config->addOption("nospritelim", "SDL.DisableSpriteLimit", 1);
|
||||
config->addOption("swapduty", "SDL.SwapDuty", 0);
|
||||
config->addOption("ramInit", "SDL.RamInitMethod", 0);
|
||||
|
||||
// color control
|
||||
config->addOption('p', "palette", "SDL.Palette", "");
|
||||
|
|
|
@ -262,6 +262,10 @@ int LoadGame(const char *path, bool silent)
|
|||
|
||||
FCEUI_SetGameGenie (gg_enabled);
|
||||
|
||||
// Set RAM Init Method Prior to Loading New Game
|
||||
g_config->getOption ("SDL.RamInitMethod", &RAMInitOption);
|
||||
|
||||
// Load the game
|
||||
if(!FCEUI_LoadGame(fullpath, 1, silent)) {
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -70,6 +70,7 @@ extern uint8 qtaintramreg;
|
|||
extern uint8 *RAM; //shared memory modifications
|
||||
extern int EmulationPaused;
|
||||
extern int frameAdvance_Delay;
|
||||
extern int RAMInitOption;
|
||||
|
||||
uint8 FCEU_ReadRomByte(uint32 i);
|
||||
void FCEU_WriteRomByte(uint32 i, uint8 value);
|
||||
|
|
Loading…
Reference in New Issue