2015-02-28 01:51:53 +00:00
|
|
|
auto Program::loadMedia(string location) -> void {
|
|
|
|
location.transform("\\", "/");
|
2015-03-03 10:14:49 +00:00
|
|
|
if(!location.endsWith("/")) location.append("/");
|
2015-02-28 01:51:53 +00:00
|
|
|
if(!directory::exists(location)) return;
|
|
|
|
|
|
|
|
string type = suffixname(location).ltrim(".");
|
|
|
|
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 {
|
2015-03-02 09:13:28 +00:00
|
|
|
unloadMedia();
|
|
|
|
|
2015-02-28 01:51:53 +00:00
|
|
|
mediaPaths(0) = {userpath(), "Emulation/System/", media.name, ".sys/"};
|
|
|
|
mediaPaths(media.id) = location;
|
2015-04-13 11:16:33 +00:00
|
|
|
folderPaths.append(location);
|
2015-02-28 01:51:53 +00:00
|
|
|
|
2015-04-21 11:51:57 +00:00
|
|
|
emulator = &_emulator;
|
|
|
|
emulator->load(media.id);
|
Update to v094r20 release.
byuu says:
Main reason for this WIP was because of all the added lines to hiro for
selective component disabling. May as well get all the diff-noise apart
from code changes.
It also merges something I've been talking to Cydrak about ... making
nall::string::(integer,decimal) do built-in binary,octal,hex decoding
instead of just failing on those. This will have fun little side effects
all over the place, like being able to view a topic on my forum via
"forum.byuu.org/topic/0b10010110", heh.
There are two small changes to higan itself, though. First up, I fixed
the resampler ratio when loading non-SNES games. Tested and I can play
Game Boy games fine now. Second, I hooked up menu option hiding for
reset and controller selection. Right now, this works like higan v094,
but I'm thinking I might want to show the "Device -> Controller" even if
that's all that's there. It kind of jives nicer with the input settings
window to see the labels there, I think. And if we ever do add more
stuff, it'll be nice that people already always expect that menu there.
Remaining issues:
* add slotted cart loader (SGB, BSX, ST)
* add DIP switch selection window (NSS)
* add timing configuration (video/audio sync)
2015-05-23 05:37:08 +00:00
|
|
|
updateVideoPalette();
|
|
|
|
dsp.setFrequency(emulator->audioFrequency());
|
2015-04-21 11:51:57 +00:00
|
|
|
emulator->power();
|
2015-02-28 01:51:53 +00:00
|
|
|
|
2015-03-03 10:14:49 +00:00
|
|
|
presentation->resizeViewport();
|
2015-04-21 11:51:57 +00:00
|
|
|
presentation->setTitle(emulator->title());
|
2015-03-03 10:14:49 +00:00
|
|
|
presentation->systemMenu.setVisible(true);
|
Update to v094r13 release.
byuu says:
This version polishes up the input dialogue (reset, erase, disable
button when item not focused, split device ID from mapping name), adds
color emulation toggle, and add dummy menu items for remaining features
(to be filled in later.)
Also, it now compiles cleanly on Windows with GTK.
I didn't test with TDM-GCC-32, because for god knows what reason, the
32-bit version ships with headers from Windows 95 OSR2 only. So I built
with TDM-GCC-64 with arch=x86.
And uh, apparently, moving or resizing a window causes a Visual C++
runtime exception in the GTK+ DLLs. This doesn't happen with trance or
renshuu built with TDM-GCC-32. So, yeah, like I said, don't use -m32.
2015-03-07 10:21:47 +00:00
|
|
|
presentation->toolsMenu.setVisible(true);
|
2015-05-23 05:29:18 +00:00
|
|
|
presentation->updateEmulator();
|
2015-04-21 11:58:59 +00:00
|
|
|
toolsManager->cheatEditor.loadCheats();
|
2015-04-21 11:51:57 +00:00
|
|
|
toolsManager->stateManager.doRefresh();
|
2015-03-02 09:13:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
auto Program::unloadMedia() -> void {
|
2015-04-21 11:51:57 +00:00
|
|
|
if(!emulator) return;
|
|
|
|
|
2015-04-21 11:58:59 +00:00
|
|
|
toolsManager->cheatEditor.saveCheats();
|
2015-04-21 11:51:57 +00:00
|
|
|
emulator->unload();
|
|
|
|
emulator = nullptr;
|
2015-03-02 09:13:28 +00:00
|
|
|
|
2015-04-13 11:16:33 +00:00
|
|
|
mediaPaths.reset();
|
|
|
|
folderPaths.reset();
|
2015-03-02 09:13:28 +00:00
|
|
|
|
|
|
|
presentation->setTitle({"tomoko v", Emulator::Version});
|
|
|
|
presentation->systemMenu.setVisible(false);
|
Update to v094r13 release.
byuu says:
This version polishes up the input dialogue (reset, erase, disable
button when item not focused, split device ID from mapping name), adds
color emulation toggle, and add dummy menu items for remaining features
(to be filled in later.)
Also, it now compiles cleanly on Windows with GTK.
I didn't test with TDM-GCC-32, because for god knows what reason, the
32-bit version ships with headers from Windows 95 OSR2 only. So I built
with TDM-GCC-64 with arch=x86.
And uh, apparently, moving or resizing a window causes a Visual C++
runtime exception in the GTK+ DLLs. This doesn't happen with trance or
renshuu built with TDM-GCC-32. So, yeah, like I said, don't use -m32.
2015-03-07 10:21:47 +00:00
|
|
|
presentation->toolsMenu.setVisible(false);
|
2015-04-21 11:58:59 +00:00
|
|
|
toolsManager->setVisible(false);
|
2015-02-28 01:51:53 +00:00
|
|
|
}
|