#include "bsnes.hpp" #include Video video; Audio audio; Input input; unique_pointer emulator; auto locate(string name) -> string { string location = {Path::program(), name}; if(inode::exists(location)) return location; if(name.beginsWith("database/")) { location = {Path::userData(), "icarus/", name}; if(inode::exists(location)) return location; } directory::create({Path::userData(), "bsnes/"}); return {Path::userData(), "bsnes/", name}; } auto hiro::initialize() -> void { Application::setName("bsnes"); } #include auto nall::main(vector arguments) -> void { string locale; // = "日本語"; for(auto argument : arguments) { if(argument.beginsWith("--locale=")) { locale = argument.trimLeft("--locale=", 1L); } } Application::setScreenSaver(!settings["UserInterface/SuppressScreenSaver"].boolean()); Application::locale().scan(locate("locales/")); Application::locale().select(locale); emulator = new SuperFamicom::Interface; program.create(arguments); Application::run(); }