switch to INI for settings (easier), make settings a singleton thingy, slightly simplify core pause/stop/reset. Drop support for remappable inputs for now
This commit is contained in:
@@ -8,22 +8,22 @@ Core::Core() : cpu(std::make_unique<Interpreter>(parallel)) {}
|
||||
void Core::Stop() {
|
||||
pause = true;
|
||||
romLoaded = false;
|
||||
rom = {};
|
||||
cpu->Reset();
|
||||
}
|
||||
|
||||
bool Core::LoadTAS(const fs::path &path) const { return cpu->GetMem().mmio.si.pif.movie.Load(path); }
|
||||
|
||||
void Core::LoadROM(const std::string &rom_) {
|
||||
pause = true;
|
||||
Stop();
|
||||
rom = rom_;
|
||||
cpu->Reset();
|
||||
romLoaded = true;
|
||||
|
||||
|
||||
std::string archive_types[] = {".zip", ".7z", ".rar", ".tar"};
|
||||
|
||||
|
||||
auto extension = fs::path(rom).extension().string();
|
||||
const bool isArchive = std::ranges::any_of(archive_types, [&extension](const auto &e) { return e == extension; });
|
||||
|
||||
|
||||
cpu->GetMem().LoadROM(isArchive, rom);
|
||||
GameDB::match(cpu->GetMem());
|
||||
if (cpu->GetMem().rom.gameNameDB.empty()) {
|
||||
@@ -37,6 +37,7 @@ void Core::LoadROM(const std::string &rom_) {
|
||||
cpu->GetMem().LoadSRAM(cpu->GetMem().saveType, rom);
|
||||
cpu->GetMem().mmio.si.pif.Execute();
|
||||
pause = false;
|
||||
romLoaded = true;
|
||||
}
|
||||
|
||||
void Core::Run(float volumeL, float volumeR) {
|
||||
|
||||
Reference in New Issue
Block a user