Add option to control memory initialization.
Signed-off-by: Andrea Odetti <mariofutire@gmail.com>
This commit is contained in:
parent
8515b20327
commit
f42d7e9fcc
1 changed files with 16 additions and 0 deletions
|
@ -28,6 +28,7 @@ namespace
|
|||
std::string disk1;
|
||||
std::string disk2;
|
||||
std::string snapshot;
|
||||
int memclear;
|
||||
bool run;
|
||||
};
|
||||
|
||||
|
@ -48,6 +49,11 @@ namespace
|
|||
("load-state,ls", po::value<std::string>(), "Load snapshot from file");
|
||||
desc.add(snapshotDesc);
|
||||
|
||||
po::options_description memoryDesc("Memory");
|
||||
memoryDesc.add_options()
|
||||
("memclear,m", po::value<int>(), "Memory initialization pattern [0..7]");
|
||||
desc.add(memoryDesc);
|
||||
|
||||
po::variables_map vm;
|
||||
try
|
||||
{
|
||||
|
@ -74,6 +80,13 @@ namespace
|
|||
options.snapshot = vm["load-state"].as<std::string>();
|
||||
}
|
||||
|
||||
if (vm.count("memclear"))
|
||||
{
|
||||
const int memclear = vm["memclear"].as<int>();
|
||||
if (memclear >=0 && memclear < NUM_MIP)
|
||||
options.memclear = memclear;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
catch (const po::error& e)
|
||||
|
@ -190,11 +203,14 @@ namespace
|
|||
int foo(int argc, const char * argv [])
|
||||
{
|
||||
EmulatorOptions options;
|
||||
options.memclear = g_nMemoryClearType;
|
||||
const bool run = getEmulatorOptions(argc, argv, options);
|
||||
|
||||
if (!run)
|
||||
return 1;
|
||||
|
||||
g_nMemoryClearType = options.memclear;
|
||||
|
||||
g_fh = fopen("/tmp/applewin.txt", "w");
|
||||
setbuf(g_fh, NULL);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue