// getters //const game_driver &system() const { assert(m_system != NULL); return *m_system; } // inline configuration helpers //------------------------------------------------- // set_game_driver - set the game in the device // configuration //------------------------------------------------- public void set_game_driver(game_driver game) { assert(m_system == null); // set the system m_system = game; // and set the search path to include all parents m_searchpath = game.name; std.set <game_driver> seen = new std.set <game_driver>(); for (int parent = driver_list.clone(game); parent != -1; parent = driver_list.clone(parent)) { if (!seen.insert(driver_list.driver(parent))) //.second) { throw new emu_fatalerror("driver_device::set_game_driver({0}): parent/clone relationships form a loop", game.name); } m_searchpath += ";" + driver_list.driver(parent).name; } }
// construction/destruction //------------------------------------------------- // driver_device - constructor //------------------------------------------------- public driver_device(machine_config mconfig, device_type type, string tag) : base(mconfig, type, tag, null, 0) { m_system = mconfig.gamedrv(); m_flip_screen_x = 0; m_flip_screen_y = 0; // set the search path to include all parents and cache it because devices search system paths m_searchpath.emplace_back(m_system.name); std.set <game_driver> seen = new std.set <game_driver>(); for (int ancestor = driver_list.clone(m_system); 0 <= ancestor; ancestor = driver_list.clone((size_t)ancestor)) { if (!seen.insert(driver_list.driver((size_t)ancestor))) { throw new emu_fatalerror("driver_device({0}): parent/clone relationships form a loop", m_system.name); } m_searchpath.emplace_back(driver_list.driver((size_t)ancestor).name); } }