2015-02-28 01:51:53 +00:00
|
|
|
#include "../tomoko.hpp"
|
|
|
|
Presentation* presentation = nullptr;
|
|
|
|
|
|
|
|
Presentation::Presentation() {
|
|
|
|
presentation = this;
|
|
|
|
|
|
|
|
libraryMenu.setText("Library");
|
|
|
|
for(auto& emulator : program->emulators) {
|
|
|
|
for(auto& media : emulator->media) {
|
Update to v094r23 release.
byuu says:
The library window is gone, and replaced with
hiro::BrowserWindow::openFolder(). This gives navigation capabilities to
game loading, and it also completes our slotted cart selection code. As
an added bonus, it's less code this way, too.
I also set the window size to consistent sizes between all emulated
systems, so that switching between SFC and GB don't cause the window
size to keep changing, and so that the scaling size is consistent (eg at
normal scale, GB @ 3x is closer to SNES @ 2x.) This means black borders
in GB/GBA mode, but it doesn't look that bad, and it's not like many
people ever use these modes anyway.
Finally, added the placeholder tabs for video, audio and timing. I don't
intend to add the timing calculator code to v095 (it might be better as
a separate tool), but I'll add the ability to set video/audio rates, at
least.
Glitch 1: despite selecting the first item in the BrowserDialog list, if
you press enter when the window appears, it doesn't activate the item
until you press an arrow key first.
Glitch 2: in Game Boy mode, if you set the 4x window size, it's not
honoring the full requested height because the viewport is smaller than
the window. 8+ years of trying to get GTK+ and Qt to simply set the god
damned window size I ask for, and I still can't get them to do it
reliably.
Remaining issues:
- finish configuration panels (video, audio, timing)
- fix ruby driver compilation on Windows
- add DIP switch selection window (NSS) [I may end up punting this one
to v096]
2015-05-30 11:39:09 +00:00
|
|
|
if(!media.bootable) continue;
|
2015-02-28 01:51:53 +00:00
|
|
|
auto item = new MenuItem{&libraryMenu};
|
|
|
|
item->setText({media.name, " ..."}).onActivate([=] {
|
2015-11-16 08:38:05 +00:00
|
|
|
directory::create({settings["Library/Location"].text(), media.name});
|
Update to v094r23 release.
byuu says:
The library window is gone, and replaced with
hiro::BrowserWindow::openFolder(). This gives navigation capabilities to
game loading, and it also completes our slotted cart selection code. As
an added bonus, it's less code this way, too.
I also set the window size to consistent sizes between all emulated
systems, so that switching between SFC and GB don't cause the window
size to keep changing, and so that the scaling size is consistent (eg at
normal scale, GB @ 3x is closer to SNES @ 2x.) This means black borders
in GB/GBA mode, but it doesn't look that bad, and it's not like many
people ever use these modes anyway.
Finally, added the placeholder tabs for video, audio and timing. I don't
intend to add the timing calculator code to v095 (it might be better as
a separate tool), but I'll add the ability to set video/audio rates, at
least.
Glitch 1: despite selecting the first item in the BrowserDialog list, if
you press enter when the window appears, it doesn't activate the item
until you press an arrow key first.
Glitch 2: in Game Boy mode, if you set the 4x window size, it's not
honoring the full requested height because the viewport is smaller than
the window. 8+ years of trying to get GTK+ and Qt to simply set the god
damned window size I ask for, and I still can't get them to do it
reliably.
Remaining issues:
- finish configuration panels (video, audio, timing)
- fix ruby driver compilation on Windows
- add DIP switch selection window (NSS) [I may end up punting this one
to v096]
2015-05-30 11:39:09 +00:00
|
|
|
auto location = BrowserDialog()
|
|
|
|
.setTitle({"Load ", media.name})
|
2015-11-16 08:38:05 +00:00
|
|
|
.setPath({settings["Library/Location"].text(), media.name})
|
Update to v094r23 release.
byuu says:
The library window is gone, and replaced with
hiro::BrowserWindow::openFolder(). This gives navigation capabilities to
game loading, and it also completes our slotted cart selection code. As
an added bonus, it's less code this way, too.
I also set the window size to consistent sizes between all emulated
systems, so that switching between SFC and GB don't cause the window
size to keep changing, and so that the scaling size is consistent (eg at
normal scale, GB @ 3x is closer to SNES @ 2x.) This means black borders
in GB/GBA mode, but it doesn't look that bad, and it's not like many
people ever use these modes anyway.
Finally, added the placeholder tabs for video, audio and timing. I don't
intend to add the timing calculator code to v095 (it might be better as
a separate tool), but I'll add the ability to set video/audio rates, at
least.
Glitch 1: despite selecting the first item in the BrowserDialog list, if
you press enter when the window appears, it doesn't activate the item
until you press an arrow key first.
Glitch 2: in Game Boy mode, if you set the 4x window size, it's not
honoring the full requested height because the viewport is smaller than
the window. 8+ years of trying to get GTK+ and Qt to simply set the god
damned window size I ask for, and I still can't get them to do it
reliably.
Remaining issues:
- finish configuration panels (video, audio, timing)
- fix ruby driver compilation on Windows
- add DIP switch selection window (NSS) [I may end up punting this one
to v096]
2015-05-30 11:39:09 +00:00
|
|
|
.setFilters(string{media.name, "|*.", media.type})
|
|
|
|
.openFolder();
|
|
|
|
if(directory::exists(location)) {
|
|
|
|
program->loadMedia(location);
|
|
|
|
}
|
2015-02-28 01:51:53 +00:00
|
|
|
});
|
|
|
|
loadBootableMedia.append(item);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-03-03 10:14:49 +00:00
|
|
|
systemMenu.setText("System").setVisible(false);
|
2015-04-21 11:51:57 +00:00
|
|
|
powerSystem.setText("Power").onActivate([&] { program->powerCycle(); });
|
|
|
|
resetSystem.setText("Reset").onActivate([&] { program->softReset(); });
|
2015-03-03 10:14:49 +00:00
|
|
|
unloadSystem.setText("Unload").onActivate([&] { program->unloadMedia(); drawSplashScreen(); });
|
2015-02-28 01:51:53 +00:00
|
|
|
|
|
|
|
settingsMenu.setText("Settings");
|
2015-03-03 10:14:49 +00:00
|
|
|
videoScaleMenu.setText("Video Scale");
|
2015-11-16 08:38:05 +00:00
|
|
|
if(settings["Video/Scale"].text() == "Small") videoScaleSmall.setChecked();
|
|
|
|
if(settings["Video/Scale"].text() == "Medium") videoScaleMedium.setChecked();
|
|
|
|
if(settings["Video/Scale"].text() == "Large") videoScaleLarge.setChecked();
|
2015-03-03 10:14:49 +00:00
|
|
|
videoScaleSmall.setText("Small").onActivate([&] {
|
2015-11-16 08:38:05 +00:00
|
|
|
settings["Video/Scale"].setValue("Small");
|
2015-03-03 10:14:49 +00:00
|
|
|
resizeViewport();
|
|
|
|
});
|
2015-08-24 09:42:11 +00:00
|
|
|
videoScaleMedium.setText("Medium").onActivate([&] {
|
2015-11-16 08:38:05 +00:00
|
|
|
settings["Video/Scale"].setValue("Medium");
|
2015-03-03 10:14:49 +00:00
|
|
|
resizeViewport();
|
|
|
|
});
|
|
|
|
videoScaleLarge.setText("Large").onActivate([&] {
|
2015-11-16 08:38:05 +00:00
|
|
|
settings["Video/Scale"].setValue("Large");
|
2015-03-03 10:14:49 +00:00
|
|
|
resizeViewport();
|
|
|
|
});
|
2015-11-16 08:38:05 +00:00
|
|
|
aspectCorrection.setText("Aspect Correction").setChecked(settings["Video/AspectCorrection"].boolean()).onToggle([&] {
|
|
|
|
settings["Video/AspectCorrection"].setValue(aspectCorrection.checked());
|
2015-04-21 11:58:59 +00:00
|
|
|
resizeViewport();
|
|
|
|
});
|
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
|
|
|
videoFilterMenu.setText("Video Filter");
|
2015-11-16 08:38:05 +00:00
|
|
|
if(settings["Video/Filter"].text() == "None") videoFilterNone.setChecked();
|
|
|
|
if(settings["Video/Filter"].text() == "Blur") videoFilterBlur.setChecked();
|
|
|
|
videoFilterNone.setText("None").onActivate([&] {
|
|
|
|
settings["Video/Filter"].setValue("None");
|
|
|
|
program->updateVideoFilter();
|
|
|
|
});
|
|
|
|
videoFilterBlur.setText("Blur").onActivate([&] {
|
|
|
|
settings["Video/Filter"].setValue("Blur");
|
|
|
|
program->updateVideoFilter();
|
|
|
|
});
|
|
|
|
colorEmulation.setText("Color Emulation").setChecked(settings["Video/ColorEmulation"].boolean()).onToggle([&] {
|
|
|
|
settings["Video/ColorEmulation"].setValue(colorEmulation.checked());
|
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
|
|
|
program->updateVideoPalette();
|
|
|
|
});
|
2015-11-16 08:38:05 +00:00
|
|
|
maskOverscan.setText("Mask Overscan").setChecked(settings["Video/Overscan/Mask"].boolean()).onToggle([&] {
|
|
|
|
settings["Video/Overscan/Mask"].setValue(maskOverscan.checked());
|
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
|
|
|
});
|
2015-11-08 08:54:42 +00:00
|
|
|
loadShaders();
|
2015-11-16 08:38:05 +00:00
|
|
|
synchronizeVideo.setText("Synchronize Video").setChecked(settings["Video/Synchronize"].boolean()).onToggle([&] {
|
|
|
|
settings["Video/Synchronize"].setValue(synchronizeVideo.checked());
|
|
|
|
video->set(Video::Synchronize, synchronizeVideo.checked());
|
2015-03-03 10:14:49 +00:00
|
|
|
});
|
2015-11-16 08:38:05 +00:00
|
|
|
synchronizeAudio.setText("Synchronize Audio").setChecked(settings["Audio/Synchronize"].boolean()).onToggle([&] {
|
|
|
|
settings["Audio/Synchronize"].setValue(synchronizeAudio.checked());
|
2015-12-06 21:11:41 +00:00
|
|
|
audio->set(Audio::Synchronize, synchronizeAudio.checked());
|
2015-03-03 10:14:49 +00:00
|
|
|
});
|
2015-11-16 08:38:05 +00:00
|
|
|
muteAudio.setText("Mute Audio").setChecked(settings["Audio/Mute"].boolean()).onToggle([&] {
|
|
|
|
settings["Audio/Mute"].setValue(muteAudio.checked());
|
|
|
|
program->updateAudioVolume();
|
2015-03-03 10:14:49 +00:00
|
|
|
});
|
2015-11-16 08:38:05 +00:00
|
|
|
showStatusBar.setText("Show Status Bar").setChecked(settings["UserInterface/ShowStatusBar"].boolean()).onToggle([&] {
|
|
|
|
settings["UserInterface/ShowStatusBar"].setValue(showStatusBar.checked());
|
|
|
|
statusBar.setVisible(showStatusBar.checked());
|
2015-04-13 11:16:33 +00:00
|
|
|
if(visible()) resizeViewport();
|
|
|
|
});
|
Update to v094r23 release.
byuu says:
The library window is gone, and replaced with
hiro::BrowserWindow::openFolder(). This gives navigation capabilities to
game loading, and it also completes our slotted cart selection code. As
an added bonus, it's less code this way, too.
I also set the window size to consistent sizes between all emulated
systems, so that switching between SFC and GB don't cause the window
size to keep changing, and so that the scaling size is consistent (eg at
normal scale, GB @ 3x is closer to SNES @ 2x.) This means black borders
in GB/GBA mode, but it doesn't look that bad, and it's not like many
people ever use these modes anyway.
Finally, added the placeholder tabs for video, audio and timing. I don't
intend to add the timing calculator code to v095 (it might be better as
a separate tool), but I'll add the ability to set video/audio rates, at
least.
Glitch 1: despite selecting the first item in the BrowserDialog list, if
you press enter when the window appears, it doesn't activate the item
until you press an arrow key first.
Glitch 2: in Game Boy mode, if you set the 4x window size, it's not
honoring the full requested height because the viewport is smaller than
the window. 8+ years of trying to get GTK+ and Qt to simply set the god
damned window size I ask for, and I still can't get them to do it
reliably.
Remaining issues:
- finish configuration panels (video, audio, timing)
- fix ruby driver compilation on Windows
- add DIP switch selection window (NSS) [I may end up punting this one
to v096]
2015-05-30 11:39:09 +00:00
|
|
|
showConfiguration.setText("Configuration ...").onActivate([&] { settingsManager->show(2); });
|
2015-02-28 01:51:53 +00:00
|
|
|
|
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
|
|
|
toolsMenu.setText("Tools").setVisible(false);
|
|
|
|
saveStateMenu.setText("Save State");
|
2015-04-13 11:16:33 +00:00
|
|
|
saveSlot1.setText("Slot 1").onActivate([&] { program->saveState(1); });
|
|
|
|
saveSlot2.setText("Slot 2").onActivate([&] { program->saveState(2); });
|
|
|
|
saveSlot3.setText("Slot 3").onActivate([&] { program->saveState(3); });
|
|
|
|
saveSlot4.setText("Slot 4").onActivate([&] { program->saveState(4); });
|
|
|
|
saveSlot5.setText("Slot 5").onActivate([&] { program->saveState(5); });
|
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
|
|
|
loadStateMenu.setText("Load State");
|
2015-04-13 11:16:33 +00:00
|
|
|
loadSlot1.setText("Slot 1").onActivate([&] { program->loadState(1); });
|
|
|
|
loadSlot2.setText("Slot 2").onActivate([&] { program->loadState(2); });
|
|
|
|
loadSlot3.setText("Slot 3").onActivate([&] { program->loadState(3); });
|
|
|
|
loadSlot4.setText("Slot 4").onActivate([&] { program->loadState(4); });
|
|
|
|
loadSlot5.setText("Slot 5").onActivate([&] { program->loadState(5); });
|
2015-04-21 11:51:57 +00:00
|
|
|
cheatEditor.setText("Cheat Editor").onActivate([&] { toolsManager->show(0); });
|
|
|
|
stateManager.setText("State Manager").onActivate([&] { toolsManager->show(1); });
|
2015-02-28 01:51:53 +00:00
|
|
|
|
Update to v094r43 release.
byuu says:
Updated to compile with all of the new hiro changes. My next step is to
write up hiro API documentation, and move the API from alpha (constantly
changing) to beta (rarely changing), in preparation for the first stable
release (backward-compatible changes only.)
Added "--fullscreen" command-line option. I like this over
a configuration file option. Lets you use the emulator in both modes
without having to modify the config file each time.
Also enhanced the command-line game loading. You can now use any of
these methods:
higan /path/to/game-folder.sfc
higan /path/to/game-folder.sfc/
higan /path/to/game-folder.sfc/program.rom
The idea is to support launchers that insist on loading files only.
Technically, the file can be any name (manifest.bml also works); the
only criteria is that the file actually exists and is a file, and not
a directory. This is a requirement to support the first version (a
directory lacking the trailing / identifier), because I don't want my
nall::string class to query the file system to determine if the string
is an actual existing file or directory for its pathname() / dirname()
functions.
Anyway, every game folder I've made so far has program.rom, and that's
very unlikely to change, so this should be fine.
Now, of course, if you drop a regular "game.sfc" file on the emulator,
it won't even try to load it, unless it's in a folder that ends in .fc,
.sfc, etc. In which case, it'll bail out immediately by being unable to
produce a manifest for what is obviously not really a game folder.
2015-08-30 02:08:26 +00:00
|
|
|
statusBar.setFont(Font().setBold());
|
2015-11-16 08:38:05 +00:00
|
|
|
statusBar.setVisible(settings["UserInterface/ShowStatusBar"].boolean());
|
2015-02-28 01:51:53 +00:00
|
|
|
|
2015-03-02 09:13:28 +00:00
|
|
|
onClose([&] { program->quit(); });
|
2015-02-28 01:51:53 +00:00
|
|
|
|
2015-07-14 09:32:43 +00:00
|
|
|
setTitle({"higan v", Emulator::Version});
|
2015-03-03 10:14:49 +00:00
|
|
|
setResizable(false);
|
Update to v094r23 release.
byuu says:
The library window is gone, and replaced with
hiro::BrowserWindow::openFolder(). This gives navigation capabilities to
game loading, and it also completes our slotted cart selection code. As
an added bonus, it's less code this way, too.
I also set the window size to consistent sizes between all emulated
systems, so that switching between SFC and GB don't cause the window
size to keep changing, and so that the scaling size is consistent (eg at
normal scale, GB @ 3x is closer to SNES @ 2x.) This means black borders
in GB/GBA mode, but it doesn't look that bad, and it's not like many
people ever use these modes anyway.
Finally, added the placeholder tabs for video, audio and timing. I don't
intend to add the timing calculator code to v095 (it might be better as
a separate tool), but I'll add the ability to set video/audio rates, at
least.
Glitch 1: despite selecting the first item in the BrowserDialog list, if
you press enter when the window appears, it doesn't activate the item
until you press an arrow key first.
Glitch 2: in Game Boy mode, if you set the 4x window size, it's not
honoring the full requested height because the viewport is smaller than
the window. 8+ years of trying to get GTK+ and Qt to simply set the god
damned window size I ask for, and I still can't get them to do it
reliably.
Remaining issues:
- finish configuration panels (video, audio, timing)
- fix ruby driver compilation on Windows
- add DIP switch selection window (NSS) [I may end up punting this one
to v096]
2015-05-30 11:39:09 +00:00
|
|
|
setBackgroundColor({0, 0, 0});
|
2015-03-03 10:14:49 +00:00
|
|
|
resizeViewport();
|
2015-06-27 02:38:08 +00:00
|
|
|
setCentered();
|
2015-03-03 10:14:49 +00:00
|
|
|
}
|
|
|
|
|
2015-05-23 05:29:18 +00:00
|
|
|
auto Presentation::updateEmulator() -> void {
|
|
|
|
if(!emulator) return;
|
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
|
|
|
resetSystem.setVisible(emulator->information.resettable);
|
|
|
|
inputPort1.setVisible(false).reset();
|
|
|
|
inputPort2.setVisible(false).reset();
|
2015-11-10 11:02:29 +00:00
|
|
|
inputPort3.setVisible(false).reset();
|
2015-05-23 05:29:18 +00:00
|
|
|
|
|
|
|
for(auto n : range(emulator->port)) {
|
2015-11-10 11:02:29 +00:00
|
|
|
if(n >= 3) break;
|
2015-05-23 05:29:18 +00:00
|
|
|
auto& port = emulator->port[n];
|
2015-11-10 11:02:29 +00:00
|
|
|
auto& menu = (n == 0 ? inputPort1 : n == 1 ? inputPort2 : inputPort3);
|
2015-05-23 05:29:18 +00:00
|
|
|
menu.setText(port.name);
|
|
|
|
|
2015-06-12 13:14:38 +00:00
|
|
|
Group devices;
|
2015-05-23 05:29:18 +00:00
|
|
|
for(auto& device : port.device) {
|
|
|
|
MenuRadioItem item{&menu};
|
|
|
|
item.setText(device.name).onActivate([=] {
|
2015-11-16 08:38:05 +00:00
|
|
|
auto path = string{emulator->information.name, "/", port.name}.replace(" ", "");
|
|
|
|
settings[path].setValue(device.name);
|
2015-05-23 05:29:18 +00:00
|
|
|
emulator->connect(port.id, device.id);
|
|
|
|
});
|
2015-06-12 13:14:38 +00:00
|
|
|
devices.append(item);
|
2015-05-23 05:29:18 +00:00
|
|
|
}
|
Update to v095r05 release.
byuu says:
Changelog:
- GBA: lots of emulation improvements
- PPU PRAM is 16-bits wide
- DMA masks &~1/Half, &~3/Word
- VRAM OBJ 8-bit writes are ignored
- OAM 8-bit writes are ignored
- BGnCNT unused bits are writable*
- BG(0,1)CNT can't set the d13
- BLDALPHA is readable (fixes Donkey Kong Country, etc)
- SNES: lots of code cleanups
- sfc/chip => sfc/coprocessor
- UI: save most recent controller selection
GBA test scores: 1552/1552, 37/38, 1020/1260
(* forgot to add the value to the read function, so endrift's I/O tests
for them will fail. Fixed locally.)
Note: SNES is the only system with multiple controller/expansion port
options, and as such is the only one with a "None" option. Because it's
shared by the controller and expansion port, it ends up sorted first in
the list. This means that on your first run, you'll need to go to Super
Famicom->Controller Port 1 and select "Gamepad", otherwise input won't
work.
Also note that changing the expansion port device requires loading a new
cart. Unlike controllers, you aren't meant to hotplug expansion port
devices.
2015-11-12 10:15:03 +00:00
|
|
|
if(devices.objectCount() > 1) {
|
2015-11-16 08:38:05 +00:00
|
|
|
auto path = string{emulator->information.name, "/", port.name}.replace(" ", "");
|
|
|
|
auto device = settings(path).text();
|
Update to v095r05 release.
byuu says:
Changelog:
- GBA: lots of emulation improvements
- PPU PRAM is 16-bits wide
- DMA masks &~1/Half, &~3/Word
- VRAM OBJ 8-bit writes are ignored
- OAM 8-bit writes are ignored
- BGnCNT unused bits are writable*
- BG(0,1)CNT can't set the d13
- BLDALPHA is readable (fixes Donkey Kong Country, etc)
- SNES: lots of code cleanups
- sfc/chip => sfc/coprocessor
- UI: save most recent controller selection
GBA test scores: 1552/1552, 37/38, 1020/1260
(* forgot to add the value to the read function, so endrift's I/O tests
for them will fail. Fixed locally.)
Note: SNES is the only system with multiple controller/expansion port
options, and as such is the only one with a "None" option. Because it's
shared by the controller and expansion port, it ends up sorted first in
the list. This means that on your first run, you'll need to go to Super
Famicom->Controller Port 1 and select "Gamepad", otherwise input won't
work.
Also note that changing the expansion port device requires loading a new
cart. Unlike controllers, you aren't meant to hotplug expansion port
devices.
2015-11-12 10:15:03 +00:00
|
|
|
for(auto object : devices.objects()) {
|
2015-11-16 08:38:05 +00:00
|
|
|
if(auto item = object.cast<MenuRadioItem>()) {
|
|
|
|
if(item.text() == device) item.setChecked().doActivate();
|
Update to v095r05 release.
byuu says:
Changelog:
- GBA: lots of emulation improvements
- PPU PRAM is 16-bits wide
- DMA masks &~1/Half, &~3/Word
- VRAM OBJ 8-bit writes are ignored
- OAM 8-bit writes are ignored
- BGnCNT unused bits are writable*
- BG(0,1)CNT can't set the d13
- BLDALPHA is readable (fixes Donkey Kong Country, etc)
- SNES: lots of code cleanups
- sfc/chip => sfc/coprocessor
- UI: save most recent controller selection
GBA test scores: 1552/1552, 37/38, 1020/1260
(* forgot to add the value to the read function, so endrift's I/O tests
for them will fail. Fixed locally.)
Note: SNES is the only system with multiple controller/expansion port
options, and as such is the only one with a "None" option. Because it's
shared by the controller and expansion port, it ends up sorted first in
the list. This means that on your first run, you'll need to go to Super
Famicom->Controller Port 1 and select "Gamepad", otherwise input won't
work.
Also note that changing the expansion port device requires loading a new
cart. Unlike controllers, you aren't meant to hotplug expansion port
devices.
2015-11-12 10:15:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
menu.setVisible();
|
|
|
|
}
|
2015-05-23 05:29:18 +00:00
|
|
|
}
|
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
|
|
|
|
2015-11-10 11:02:29 +00:00
|
|
|
systemMenuSeparatorPorts.setVisible(inputPort1.visible() || inputPort2.visible() || inputPort3.visible());
|
2015-05-23 05:29:18 +00:00
|
|
|
}
|
|
|
|
|
2015-03-03 10:14:49 +00:00
|
|
|
auto Presentation::resizeViewport() -> void {
|
2015-11-08 08:54:42 +00:00
|
|
|
signed width = emulator ? emulator->information.width : 256;
|
|
|
|
signed height = emulator ? emulator->information.height : 240;
|
|
|
|
double stretch = emulator ? emulator->information.aspectRatio : 1.0;
|
|
|
|
if(stretch != 1.0) {
|
|
|
|
//aspect correction is always enabled in fullscreen mode
|
2015-11-16 08:38:05 +00:00
|
|
|
if(!fullScreen() && !settings["Video/AspectCorrection"].boolean()) stretch = 1.0;
|
2015-11-08 08:54:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
signed scale = 2;
|
2015-11-16 08:38:05 +00:00
|
|
|
if(settings["Video/Scale"].text() == "Small" ) scale = 2;
|
|
|
|
if(settings["Video/Scale"].text() == "Medium") scale = 3;
|
|
|
|
if(settings["Video/Scale"].text() == "Large" ) scale = 4;
|
Update to v094r23 release.
byuu says:
The library window is gone, and replaced with
hiro::BrowserWindow::openFolder(). This gives navigation capabilities to
game loading, and it also completes our slotted cart selection code. As
an added bonus, it's less code this way, too.
I also set the window size to consistent sizes between all emulated
systems, so that switching between SFC and GB don't cause the window
size to keep changing, and so that the scaling size is consistent (eg at
normal scale, GB @ 3x is closer to SNES @ 2x.) This means black borders
in GB/GBA mode, but it doesn't look that bad, and it's not like many
people ever use these modes anyway.
Finally, added the placeholder tabs for video, audio and timing. I don't
intend to add the timing calculator code to v095 (it might be better as
a separate tool), but I'll add the ability to set video/audio rates, at
least.
Glitch 1: despite selecting the first item in the BrowserDialog list, if
you press enter when the window appears, it doesn't activate the item
until you press an arrow key first.
Glitch 2: in Game Boy mode, if you set the 4x window size, it's not
honoring the full requested height because the viewport is smaller than
the window. 8+ years of trying to get GTK+ and Qt to simply set the god
damned window size I ask for, and I still can't get them to do it
reliably.
Remaining issues:
- finish configuration panels (video, audio, timing)
- fix ruby driver compilation on Windows
- add DIP switch selection window (NSS) [I may end up punting this one
to v096]
2015-05-30 11:39:09 +00:00
|
|
|
|
2015-11-08 08:54:42 +00:00
|
|
|
signed windowWidth = 0, windowHeight = 0;
|
|
|
|
if(!fullScreen()) {
|
2015-11-16 08:38:05 +00:00
|
|
|
windowWidth = 256 * scale * (settings["Video/AspectCorrection"].boolean() ? 8.0 / 7.0 : 1.0);
|
2015-11-08 08:54:42 +00:00
|
|
|
windowHeight = 240 * scale;
|
|
|
|
} else {
|
|
|
|
windowWidth = geometry().width();
|
|
|
|
windowHeight = geometry().height();
|
2015-03-03 10:14:49 +00:00
|
|
|
}
|
|
|
|
|
2015-11-08 08:54:42 +00:00
|
|
|
signed multiplier = min(windowWidth / (signed)(width * stretch), windowHeight / height);
|
|
|
|
width = width * multiplier * stretch;
|
|
|
|
height = height * multiplier;
|
2015-04-13 11:16:33 +00:00
|
|
|
|
2015-11-08 08:54:42 +00:00
|
|
|
if(!fullScreen()) setSize({windowWidth, windowHeight});
|
|
|
|
viewport.setGeometry({(windowWidth - width) / 2, (windowHeight - height) / 2, width, height});
|
2015-03-03 10:14:49 +00:00
|
|
|
|
2015-04-21 11:51:57 +00:00
|
|
|
if(!emulator) drawSplashScreen();
|
2015-03-03 10:14:49 +00:00
|
|
|
}
|
|
|
|
|
2015-04-13 11:16:33 +00:00
|
|
|
auto Presentation::toggleFullScreen() -> void {
|
|
|
|
if(fullScreen() == false) {
|
|
|
|
menuBar.setVisible(false);
|
|
|
|
statusBar.setVisible(false);
|
|
|
|
setResizable(true);
|
|
|
|
setFullScreen(true);
|
2015-06-20 05:44:05 +00:00
|
|
|
if(!input->acquired()) input->acquire();
|
2015-04-13 11:16:33 +00:00
|
|
|
} else {
|
2015-06-20 05:44:05 +00:00
|
|
|
if(input->acquired()) input->release();
|
2015-04-13 11:16:33 +00:00
|
|
|
setFullScreen(false);
|
|
|
|
setResizable(false);
|
|
|
|
menuBar.setVisible(true);
|
2015-11-16 08:38:05 +00:00
|
|
|
statusBar.setVisible(settings["UserInterface/ShowStatusBar"].boolean());
|
2015-04-13 11:16:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Application::processEvents();
|
|
|
|
resizeViewport();
|
|
|
|
}
|
|
|
|
|
2015-03-03 10:14:49 +00:00
|
|
|
auto Presentation::drawSplashScreen() -> void {
|
2015-06-20 05:44:05 +00:00
|
|
|
if(!video) return;
|
2015-03-03 10:14:49 +00:00
|
|
|
uint32* output;
|
|
|
|
unsigned length;
|
2015-06-20 05:44:05 +00:00
|
|
|
if(video->lock(output, length, 256, 240)) {
|
2015-03-03 10:14:49 +00:00
|
|
|
for(auto y : range(240)) {
|
|
|
|
uint32* dp = output + y * (length >> 2);
|
|
|
|
for(auto x : range(256)) *dp++ = 0xff000000;
|
|
|
|
}
|
2015-06-20 05:44:05 +00:00
|
|
|
video->unlock();
|
|
|
|
video->refresh();
|
2015-03-03 10:14:49 +00:00
|
|
|
}
|
2015-02-28 01:51:53 +00:00
|
|
|
}
|
2015-11-08 08:54:42 +00:00
|
|
|
|
|
|
|
auto Presentation::loadShaders() -> void {
|
2015-11-16 08:38:05 +00:00
|
|
|
if(settings["Video/Driver"].text() != "OpenGL") {
|
2015-11-08 08:54:42 +00:00
|
|
|
videoShaderMenu.setVisible(false);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
auto pathname = locate({localpath(), "tomoko/"}, "Video Shaders/");
|
|
|
|
for(auto shader : directory::folders(pathname, "*.shader")) {
|
|
|
|
MenuRadioItem item{&videoShaderMenu};
|
|
|
|
item.setText(string{shader}.rtrim(".shader/", 1L)).onActivate([=] {
|
2015-11-16 08:38:05 +00:00
|
|
|
settings["Video/Shader"].setValue({pathname, shader});
|
2015-11-08 08:54:42 +00:00
|
|
|
program->updateVideoFilter();
|
|
|
|
});
|
|
|
|
videoShaders.append(item);
|
|
|
|
}
|
|
|
|
|
|
|
|
videoShaderMenu.setText("Video Shaders");
|
|
|
|
videoShaderNone.setChecked().setText("None").onActivate([=] {
|
2015-11-16 08:38:05 +00:00
|
|
|
settings["Video/Shader"].setValue("None");
|
2015-11-08 08:54:42 +00:00
|
|
|
program->updateVideoFilter();
|
|
|
|
});
|
|
|
|
|
|
|
|
for(auto object : videoShaders.objects()) {
|
|
|
|
if(auto radioItem = dynamic_cast<mMenuRadioItem*>(object.data())) {
|
2015-11-16 08:38:05 +00:00
|
|
|
if(settings["Video/Shader"].text() == string{pathname, radioItem->text(), ".shader/"}) {
|
2015-11-08 08:54:42 +00:00
|
|
|
radioItem->setChecked();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|