struct System { enum class Model : uint { MasterSystem, GameGear }; auto loaded() const -> bool { return information.loaded; } auto model() const -> Model { return information.model; } auto colorburst() const -> double { return information.colorburst; } auto run() -> void; auto load(Emulator::Interface* interface, Model model) -> bool; auto save() -> void; auto unload() -> void; auto power() -> void; private: Emulator::Interface* interface = nullptr; struct Information { bool loaded = false; Model model = Model::MasterSystem; string manifest; double colorburst = 0.0; } information; }; struct Peripherals { auto unload() -> void; auto reset() -> void; auto connect(uint port, uint device) -> void; Controller* controllerPort1 = nullptr; Controller* controllerPort2 = nullptr; }; extern System system; extern Peripherals peripherals; auto Model::MasterSystem() -> bool { return system.model() == System::Model::MasterSystem; } auto Model::GameGear() -> bool { return system.model() == System::Model::GameGear; }