Program::Program(int argc, char** argv) { program = this; basepath = dir(realpath(argv[0])); userpath = {nall::configpath(), "termboy/"}; sharedpath = {nall::sharedpath(), "termboy/"}; directory::create(userpath); bootstrap(); active = nullptr; config = new ConfigurationSettings; utility = new Utility; audio.driver("ALSA"); if(audio.init() == false) { audio.driver("None"); audio.init(); } init_curses(); inputManager = new InputManager(); inputManager->setupKeyboard(); dspaudio.setPrecision(16); dspaudio.setBalance(0.0); dspaudio.setFrequency(96000); utility->synchronizeRuby(); utility->updateShader(); if(argc >= 2) utility->loadMedia(argv[1]); //TODO: This is bad! Remove hardcoded string and use appropriate path //TODO: periodically sync RAM in case of crash? Ananke ananke; ananke.sync("/home/dobyrch/ROMs/Game Boy/pokemon_blue.gb"); while(true) { main(); } utility->unload(); //config->save(); }
extern "C" string ananke_sync(const string &pathname) { Ananke ananke; return ananke.sync(pathname); }