mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-10-04 13:11:53 +02:00
byuu says: I imagine you guys will like this WIP very much. Changelog: - ListView check boxes on Windows - ListView removal of columns on reset (changing input dropdowns) - DirectSound audio duplication on latency change - DirectSound crash on 20ms latency - Fullscreen window sizing in multi-monitor setups - Allow joypad bindings of hotkeys - Allow triggers to be mapped (Xbox 360 / XInput / Windows only) - Support joypad rumble for Game Boy Player - Video scale settings modified from {1x,2x,3x} to {2x,3x,4x} - System menu now renames to active emulation core - Added fast forward hotkey Not changing for v095: - not adding input focus settings yet - not adding shaders yet Not changing at all: - not implementing maximize
53 lines
1.6 KiB
C++
53 lines
1.6 KiB
C++
auto Program::loadMedia(string location) -> void {
|
|
location.transform("\\", "/");
|
|
if(!location.endsWith("/")) location.append("/");
|
|
if(!directory::exists(location)) return;
|
|
|
|
string type = suffixname(location).ltrim(".", 1L);
|
|
for(auto& emulator : emulators) {
|
|
for(auto& media : emulator->media) {
|
|
if(media.bootable == false) continue;
|
|
if(media.type != type) continue;
|
|
return loadMedia(*emulator, media, location);
|
|
}
|
|
}
|
|
}
|
|
|
|
auto Program::loadMedia(Emulator::Interface& emulator_, Emulator::Interface::Media& media, const string& location) -> void {
|
|
unloadMedia();
|
|
|
|
mediaPaths(0) = locate({config->library.location, "System/"}, {media.name, ".sys/"});
|
|
mediaPaths(media.id) = location;
|
|
folderPaths.append(location);
|
|
|
|
emulator = &emulator_;
|
|
emulator->load(media.id);
|
|
updateVideoPalette();
|
|
dsp.setFrequency(emulator->audioFrequency());
|
|
emulator->power();
|
|
|
|
presentation->resizeViewport();
|
|
presentation->setTitle(emulator->title());
|
|
presentation->systemMenu.setText(media.name).setVisible(true);
|
|
presentation->toolsMenu.setVisible(true);
|
|
presentation->updateEmulator();
|
|
toolsManager->cheatEditor.loadCheats();
|
|
toolsManager->stateManager.doRefresh();
|
|
}
|
|
|
|
auto Program::unloadMedia() -> void {
|
|
if(!emulator) return;
|
|
|
|
toolsManager->cheatEditor.saveCheats();
|
|
emulator->unload();
|
|
emulator = nullptr;
|
|
|
|
mediaPaths.reset();
|
|
folderPaths.reset();
|
|
|
|
presentation->setTitle({"higan v", Emulator::Version});
|
|
presentation->systemMenu.setVisible(false);
|
|
presentation->toolsMenu.setVisible(false);
|
|
toolsManager->setVisible(false);
|
|
}
|