mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-09-09 22:50:49 +02:00
byuu says: Changelog: - hiro: BrowserDialog can navigate up to drive selection on Windows - nall: (file,path,dir,base,prefix,suffix)name => Location::(file,path,dir,base,prefix,suffix) - higan/tomoko: rename audio filter label from "Sinc" to "IIR - Biquad" - higan/tomoko: allow loading files via icarus on the command-line once again - higan/tomoko: (begrudging) quick hack to fix presentation window focus on startup - higan/audio: don't divide output audio volume by number of streams - processor/r65816: fix a regression in (read,write)DB; fixes Taz-Mania - fixed compilation regressions on Windows and Linux I'm happy with where we are at with code cleanups and stability, so I'd like to release v100. But even though I'm not assigning any special significance to this version, we should probably test it more thoroughly first.
102 lines
2.6 KiB
C++
102 lines
2.6 KiB
C++
#include <nall/nall.hpp>
|
|
using namespace nall;
|
|
|
|
#include <hiro/hiro.hpp>
|
|
using namespace hiro;
|
|
|
|
auto locate(string name) -> string {
|
|
string location = {Path::program(), name};
|
|
if(inode::exists(location)) return location;
|
|
|
|
location = {Path::config(), "icarus/", name};
|
|
if(inode::exists(location)) return location;
|
|
|
|
directory::create({Path::local(), "icarus/"});
|
|
return {Path::local(), "icarus/", name};
|
|
}
|
|
|
|
#include "settings.cpp"
|
|
Settings settings;
|
|
|
|
#include "heuristics/famicom.cpp"
|
|
#include "heuristics/super-famicom.cpp"
|
|
#include "heuristics/game-boy.cpp"
|
|
#include "heuristics/game-boy-advance.cpp"
|
|
#include "heuristics/wonderswan.cpp"
|
|
#include "heuristics/bs-memory.cpp"
|
|
#include "heuristics/sufami-turbo.cpp"
|
|
|
|
#include "core/core.hpp"
|
|
#include "core/core.cpp"
|
|
#include "core/famicom.cpp"
|
|
#include "core/super-famicom.cpp"
|
|
#include "core/game-boy.cpp"
|
|
#include "core/game-boy-color.cpp"
|
|
#include "core/game-boy-advance.cpp"
|
|
#include "core/wonderswan.cpp"
|
|
#include "core/wonderswan-color.cpp"
|
|
#include "core/bs-memory.cpp"
|
|
#include "core/sufami-turbo.cpp"
|
|
Icarus icarus;
|
|
|
|
#include "ui/ui.hpp"
|
|
#include "ui/scan-dialog.cpp"
|
|
#include "ui/settings-dialog.cpp"
|
|
#include "ui/import-dialog.cpp"
|
|
#include "ui/error-dialog.cpp"
|
|
|
|
#include <nall/main.hpp>
|
|
auto nall::main(string_vector args) -> void {
|
|
if(args.size() == 2 && args[1] == "--name") {
|
|
return print("icarus");
|
|
}
|
|
|
|
if(args.size() == 3 && args[1] == "--manifest" && directory::exists(args[2])) {
|
|
return print(icarus.manifest(args[2]));
|
|
}
|
|
|
|
if(args.size() == 3 && args[1] == "--import" && file::exists(args[2])) {
|
|
if(string target = icarus.import(args[2])) {
|
|
return print(target, "\n");
|
|
}
|
|
return;
|
|
}
|
|
|
|
if(args.size() == 2 && args[1] == "--import") {
|
|
if(string source = BrowserDialog()
|
|
.setTitle("Load ROM Image")
|
|
.setPath(settings["icarus/Path"].text())
|
|
.setFilters("ROM Files|*.fc:*.nes:*.sfc:*.smc:*.gb:*.gbc:*.gba:*.ws:*.wsc:*.bs:*.st:*.zip")
|
|
.openFile()) {
|
|
if(string target = icarus.import(source)) {
|
|
settings["icarus/Path"].setValue(Location::path(source));
|
|
return print(target, "\n");
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
|
|
new ScanDialog;
|
|
new SettingsDialog;
|
|
new ImportDialog;
|
|
new ErrorDialog;
|
|
#if defined(PLATFORM_MACOSX)
|
|
Application::Cocoa::onAbout([&] {
|
|
MessageDialog().setTitle("About icarus").setText({
|
|
"icarus\n\n"
|
|
"Author: byuu\n"
|
|
"License: GPLv3\n"
|
|
"Website: http://byuu.org/\n"
|
|
}).information();
|
|
});
|
|
Application::Cocoa::onPreferences([&] {
|
|
scanDialog->settingsButton.doActivate();
|
|
});
|
|
Application::Cocoa::onQuit([&] {
|
|
Application::quit();
|
|
});
|
|
#endif
|
|
scanDialog->show();
|
|
Application::run();
|
|
}
|