2015-02-28 01:51:53 +00:00
|
|
|
//request from emulation core to load non-volatile media folder
|
2015-12-21 09:16:47 +00:00
|
|
|
auto Program::loadRequest(uint id, string name, string type, bool required) -> void {
|
Update to v094r22 release.
byuu says:
I fixed the hiro layout enable bug, so when you go to assign joypad
input, the window disables itself so your input doesn't mess with the
controls.
I added "reset" to the hotkeys, in case you feel like clearing all of
them at once.
I added device selection support and the ability to disable audio
synchronization (run > 60fps) to the ruby/OSS driver. This is exposed in
tomoko's configuration file.
I added checks to stringify so that assigning null char* strings to
nall::string won't cause crashes anymore (technically the crash was in
strlen(), which doesn't check for null strings, but whatever ... I'll do
the check myself.)
I hooked up BrowserDialog::folderSelect() to loading slotted media for
now. Tested it by loading a Game Boy game successfully through the Super
Game Boy. Definitely want to write a custom window for this though, that
looks more like the library dialog.
Remaining issues:
- finish slotted cart loader (SGB, BSX, ST)
- add DIP switch selection window (NSS) [I may end up punting this one
to v096]
- add more configuration panels (video, audio, timing)
2015-05-25 12:23:49 +00:00
|
|
|
string location = BrowserDialog()
|
|
|
|
.setTitle({"Load ", name})
|
2015-11-16 08:38:05 +00:00
|
|
|
.setPath({settings["Library/Location"].text(), name})
|
2016-02-28 11:42:52 +00:00
|
|
|
.setFilters({string{name, "|*.", type}, "All|*.*"})
|
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
|
|
|
.openFolder();
|
Update to v094r22 release.
byuu says:
I fixed the hiro layout enable bug, so when you go to assign joypad
input, the window disables itself so your input doesn't mess with the
controls.
I added "reset" to the hotkeys, in case you feel like clearing all of
them at once.
I added device selection support and the ability to disable audio
synchronization (run > 60fps) to the ruby/OSS driver. This is exposed in
tomoko's configuration file.
I added checks to stringify so that assigning null char* strings to
nall::string won't cause crashes anymore (technically the crash was in
strlen(), which doesn't check for null strings, but whatever ... I'll do
the check myself.)
I hooked up BrowserDialog::folderSelect() to loading slotted media for
now. Tested it by loading a Game Boy game successfully through the Super
Game Boy. Definitely want to write a custom window for this though, that
looks more like the library dialog.
Remaining issues:
- finish slotted cart loader (SGB, BSX, ST)
- add DIP switch selection window (NSS) [I may end up punting this one
to v096]
- add more configuration panels (video, audio, timing)
2015-05-25 12:23:49 +00:00
|
|
|
if(!directory::exists(location)) return;
|
|
|
|
|
|
|
|
mediaPaths(id) = location;
|
|
|
|
folderPaths.append(location);
|
|
|
|
emulator->load(id);
|
2015-02-28 01:51:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//request from emulation core to load non-volatile media file
|
2015-12-21 09:16:47 +00:00
|
|
|
auto Program::loadRequest(uint id, string filename, bool required) -> void {
|
Update to v094r39 release.
byuu says:
Changelog:
- SNES mid-scanline BGMODE fixes finally merged (can run
atx2.zip{mode7.smc}+mtest(2).sfc properly now)
- Makefile now discards all built-in rules and variables
- switch on bool warning disabled for GCC now as well (was already
disabled for Clang)
- when loading a game, if any required files are missing, display
a warning message box (manifest.bml, program.rom, bios.rom, etc)
- when loading a game (or a game slot), if manifest.bml is missing, it
will invoke icarus to try and generate it
- if that fails (icarus is missing or the folder is bad), you will get
a warning telling you that the manifest can't be loaded
The warning prompt on missing files work for both games and the .sys
folders and their files. For some reason, failing to load the DMG/CGB
BIOS is causing a crash before I can display the modal dialog. I have no
idea why, and the stack frame backtrace is junk.
I also can't seem to abort the failed loading process. If I call
Program::unloadMedia(), I get a nasty segfault. Again with a really
nasty stack trace. So for now, it'll just end up sitting there emulating
an empty ROM (solid black screen.) In time, I'd like to fix that too.
Lastly, I need a better method than popen for Windows. popen is kind of
ugly and flashes a console window for a brief second even if the
application launched is linked with -mwindows. Not sure if there even is
one (I need to read the stdout result, so CreateProcess may not work
unless I do something nasty like "> %tmp%/temp") I'm also using the
regular popen instead of _wpopen, so for this WIP, it won't work if your
game folder has non-English letters in the path.
2015-08-04 09:00:55 +00:00
|
|
|
string pathname = mediaPaths(emulator->group(id));
|
|
|
|
string location = {pathname, filename};
|
2015-11-16 08:38:05 +00:00
|
|
|
|
2016-02-28 11:42:52 +00:00
|
|
|
if(filename == "manifest.bml" && pathname && !pathname.endsWith(".sys/")) {
|
2015-11-16 08:38:05 +00:00
|
|
|
if(!file::exists(location) || settings["Library/IgnoreManifests"].boolean()) {
|
Update to v096r06 release.
byuu says:
This WIP finally achieves the vision I've had for icarus.
I also fixed a mapping issue with Cx4 that, oddly enough, only caused
the "2" from the Mega Man X2 title screen to disappear.
[Editor's note - "the vision for icarus" was described in a separate,
public forum post: http://board.byuu.org/phpbb3/viewtopic.php?p=20584
Quoting for posterity:
icarus is now a full-fledged part of higan, and will be bundled with
each higan WIP as well. This will ensure that in the future, the
exact version of icarus you need to run higan will be included right
along with it. As of this WIP, physical manifest files are now truly
and entirely optional.
From now on, you can associate your ROM image files with higan's
main binary, or drop them directly on top of it, to load and play
your games.
Furthermore, there are two new menu options that appear under the
library menu when icarus is present:
- "Load ROM File ..." => gives you a single-file selection dialog to
import (and if possible) run the game
- "Import ROM Files ..." => gives you a multi-file import dialog
with checkboxes to pull in multiple games at once
Finally, as before, icarus can generate manifest.bml files for
folders that lack them.
For people who like the game folder and library system, nothing's
changed. Keep using higan as you have been.
For people who hate it, you can now use higan like your classic
emulators. Treat the "Library->{System Name}" entries as your
"favorites" list: the games you actually play. Treat the
"Library->Load ROM" as your standard open file dialog in other
emulators. And finally, treat "Advanced->Game Library" as your save
data path for cheat codes, save states, save RAM, etc.
]
2016-01-13 10:47:45 +00:00
|
|
|
if(auto manifest = execute("icarus", "--manifest", pathname)) {
|
2016-02-16 09:27:55 +00:00
|
|
|
memorystream stream{(const uint8_t*)manifest.data(), manifest.size()};
|
2015-11-16 08:38:05 +00:00
|
|
|
return emulator->load(id, stream);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
Update to v094r39 release.
byuu says:
Changelog:
- SNES mid-scanline BGMODE fixes finally merged (can run
atx2.zip{mode7.smc}+mtest(2).sfc properly now)
- Makefile now discards all built-in rules and variables
- switch on bool warning disabled for GCC now as well (was already
disabled for Clang)
- when loading a game, if any required files are missing, display
a warning message box (manifest.bml, program.rom, bios.rom, etc)
- when loading a game (or a game slot), if manifest.bml is missing, it
will invoke icarus to try and generate it
- if that fails (icarus is missing or the folder is bad), you will get
a warning telling you that the manifest can't be loaded
The warning prompt on missing files work for both games and the .sys
folders and their files. For some reason, failing to load the DMG/CGB
BIOS is causing a crash before I can display the modal dialog. I have no
idea why, and the stack frame backtrace is junk.
I also can't seem to abort the failed loading process. If I call
Program::unloadMedia(), I get a nasty segfault. Again with a really
nasty stack trace. So for now, it'll just end up sitting there emulating
an empty ROM (solid black screen.) In time, I'd like to fix that too.
Lastly, I need a better method than popen for Windows. popen is kind of
ugly and flashes a console window for a brief second even if the
application launched is linked with -mwindows. Not sure if there even is
one (I need to read the stdout result, so CreateProcess may not work
unless I do something nasty like "> %tmp%/temp") I'm also using the
regular popen instead of _wpopen, so for this WIP, it won't work if your
game folder has non-English letters in the path.
2015-08-04 09:00:55 +00:00
|
|
|
if(file::exists(location)) {
|
|
|
|
mmapstream stream{location};
|
|
|
|
return emulator->load(id, stream);
|
|
|
|
}
|
2015-11-16 08:38:05 +00:00
|
|
|
|
Update to v094r39 release.
byuu says:
Changelog:
- SNES mid-scanline BGMODE fixes finally merged (can run
atx2.zip{mode7.smc}+mtest(2).sfc properly now)
- Makefile now discards all built-in rules and variables
- switch on bool warning disabled for GCC now as well (was already
disabled for Clang)
- when loading a game, if any required files are missing, display
a warning message box (manifest.bml, program.rom, bios.rom, etc)
- when loading a game (or a game slot), if manifest.bml is missing, it
will invoke icarus to try and generate it
- if that fails (icarus is missing or the folder is bad), you will get
a warning telling you that the manifest can't be loaded
The warning prompt on missing files work for both games and the .sys
folders and their files. For some reason, failing to load the DMG/CGB
BIOS is causing a crash before I can display the modal dialog. I have no
idea why, and the stack frame backtrace is junk.
I also can't seem to abort the failed loading process. If I call
Program::unloadMedia(), I get a nasty segfault. Again with a really
nasty stack trace. So for now, it'll just end up sitting there emulating
an empty ROM (solid black screen.) In time, I'd like to fix that too.
Lastly, I need a better method than popen for Windows. popen is kind of
ugly and flashes a console window for a brief second even if the
application launched is linked with -mwindows. Not sure if there even is
one (I need to read the stdout result, so CreateProcess may not work
unless I do something nasty like "> %tmp%/temp") I'm also using the
regular popen instead of _wpopen, so for this WIP, it won't work if your
game folder has non-English letters in the path.
2015-08-04 09:00:55 +00:00
|
|
|
if(required) MessageDialog().setTitle("higan").setText({
|
2015-09-28 11:56:46 +00:00
|
|
|
"Missing required file: ", nall::filename(location), "\n\n",
|
|
|
|
"From location:\n", nall::pathname(location)
|
Update to v094r39 release.
byuu says:
Changelog:
- SNES mid-scanline BGMODE fixes finally merged (can run
atx2.zip{mode7.smc}+mtest(2).sfc properly now)
- Makefile now discards all built-in rules and variables
- switch on bool warning disabled for GCC now as well (was already
disabled for Clang)
- when loading a game, if any required files are missing, display
a warning message box (manifest.bml, program.rom, bios.rom, etc)
- when loading a game (or a game slot), if manifest.bml is missing, it
will invoke icarus to try and generate it
- if that fails (icarus is missing or the folder is bad), you will get
a warning telling you that the manifest can't be loaded
The warning prompt on missing files work for both games and the .sys
folders and their files. For some reason, failing to load the DMG/CGB
BIOS is causing a crash before I can display the modal dialog. I have no
idea why, and the stack frame backtrace is junk.
I also can't seem to abort the failed loading process. If I call
Program::unloadMedia(), I get a nasty segfault. Again with a really
nasty stack trace. So for now, it'll just end up sitting there emulating
an empty ROM (solid black screen.) In time, I'd like to fix that too.
Lastly, I need a better method than popen for Windows. popen is kind of
ugly and flashes a console window for a brief second even if the
application launched is linked with -mwindows. Not sure if there even is
one (I need to read the stdout result, so CreateProcess may not work
unless I do something nasty like "> %tmp%/temp") I'm also using the
regular popen instead of _wpopen, so for this WIP, it won't work if your
game folder has non-English letters in the path.
2015-08-04 09:00:55 +00:00
|
|
|
}).error();
|
2015-02-28 01:51:53 +00:00
|
|
|
}
|
|
|
|
|
2015-03-02 09:13:28 +00:00
|
|
|
//request from emulation core to save non-volatile media file
|
2015-12-21 09:16:47 +00:00
|
|
|
auto Program::saveRequest(uint id, string filename) -> void {
|
Update to v094r39 release.
byuu says:
Changelog:
- SNES mid-scanline BGMODE fixes finally merged (can run
atx2.zip{mode7.smc}+mtest(2).sfc properly now)
- Makefile now discards all built-in rules and variables
- switch on bool warning disabled for GCC now as well (was already
disabled for Clang)
- when loading a game, if any required files are missing, display
a warning message box (manifest.bml, program.rom, bios.rom, etc)
- when loading a game (or a game slot), if manifest.bml is missing, it
will invoke icarus to try and generate it
- if that fails (icarus is missing or the folder is bad), you will get
a warning telling you that the manifest can't be loaded
The warning prompt on missing files work for both games and the .sys
folders and their files. For some reason, failing to load the DMG/CGB
BIOS is causing a crash before I can display the modal dialog. I have no
idea why, and the stack frame backtrace is junk.
I also can't seem to abort the failed loading process. If I call
Program::unloadMedia(), I get a nasty segfault. Again with a really
nasty stack trace. So for now, it'll just end up sitting there emulating
an empty ROM (solid black screen.) In time, I'd like to fix that too.
Lastly, I need a better method than popen for Windows. popen is kind of
ugly and flashes a console window for a brief second even if the
application launched is linked with -mwindows. Not sure if there even is
one (I need to read the stdout result, so CreateProcess may not work
unless I do something nasty like "> %tmp%/temp") I'm also using the
regular popen instead of _wpopen, so for this WIP, it won't work if your
game folder has non-English letters in the path.
2015-08-04 09:00:55 +00:00
|
|
|
string pathname = mediaPaths(emulator->group(id));
|
|
|
|
string location = {pathname, filename};
|
2016-02-28 11:42:52 +00:00
|
|
|
|
2015-03-02 09:13:28 +00:00
|
|
|
filestream stream{location, file::mode::write};
|
2015-04-21 11:51:57 +00:00
|
|
|
return emulator->save(id, stream);
|
2015-02-28 01:51:53 +00:00
|
|
|
}
|
|
|
|
|
Update to v096r07 release.
byuu says:
Changelog:
- configuration files are now stored in localpath() instead of configpath()
- Video gamma/saturation/luminance sliders are gone now, sorry
- added Video Filter->Blur Emulation [1]
- added Video Filter->Scanline Emulation [2]
- improvements to GBA audio emulation (fixes Minish Cap) [Jonas Quinn]
[1] For the Famicom, this does nothing. For the Super Famicom, this
performs horizontal blending for proper pseudo-hires translucency. For
the Game Boy, Game Boy Color, and Game Boy Advance, this performs
interframe blending (each frame is the average of the current and
previous frame), which is important for things like the GBVideoPlayer.
[2] Right now, this only applies to the Super Famicom, but it'll come to
the Famicom in the future. For the Super Famicom, this option doesn't
just add scanlines, it simulates the phosphor decay that's visible in
interlace mode. If you observe an interlaced game like RPM Racing on
a real SNES, you'll notice that even on perfectly still screens, the
image appears to shake. This option emulates that effect.
Note 1: the buffering right now is a little sub-optimal, so there will
be a slight speed hit with this new support. Since the core is now
generating native ARGB8888 colors, it might as well call out to the
interface to lock/unlock/refresh the video, that way it can render
directly to the screen. Although ... that might not be such a hot idea,
since the GBx interframe blending reads from the target buffer, and that
tends to be a catastrophic option for performance.
Note 2: the balanced and performance profiles for the SNES are
completely busted again. This WIP took 6 1/2 hours, and I'm exhausted.
Very much not looking forward to working on those, since those two have
all kinds of fucked up speedup tricks for non-interlaced and/or
non-hires video modes.
Note 3: if you're on Windows and you saved your system folders somewhere
else, now'd be a good time to move them to %localappdata%/higan
2016-01-15 10:06:51 +00:00
|
|
|
auto Program::videoRefresh(const uint32* data, uint pitch, uint width, uint height) -> void {
|
Update to v097r14 release.
byuu says:
This is a few days old, but oh well.
This WIP changes nall,hiro,ruby,icarus back to (u)int(8,16,32,64)_t.
I'm slowly pushing for (u)int(8,16,32,64) to use my custom
Integer<Size>/Natural<Size> classes instead. But it's going to be one
hell of a struggle to get that into higan.
2016-02-16 09:11:58 +00:00
|
|
|
uint32_t* output;
|
2015-12-21 09:16:47 +00:00
|
|
|
uint length;
|
2015-02-28 01:51:53 +00:00
|
|
|
|
2015-06-20 05:44:05 +00:00
|
|
|
if(video->lock(output, length, width, height)) {
|
2015-02-28 01:51:53 +00:00
|
|
|
pitch >>= 2, length >>= 2;
|
|
|
|
|
|
|
|
for(auto y : range(height)) {
|
2016-01-15 10:28:51 +00:00
|
|
|
memory::copy(output + y * length, data + y * pitch, width * sizeof(uint32));
|
2015-02-28 01:51:53 +00:00
|
|
|
}
|
|
|
|
|
2015-11-16 08:38:05 +00:00
|
|
|
if(emulator->information.overscan && settings["Video/Overscan/Mask"].boolean()) {
|
|
|
|
auto h = settings["Video/Overscan/Horizontal"].natural();
|
|
|
|
auto v = settings["Video/Overscan/Vertical"].natural();
|
2015-04-21 11:58:59 +00:00
|
|
|
|
|
|
|
if(h) for(auto y : range(height)) {
|
|
|
|
memory::fill(output + y * length, 4 * h);
|
|
|
|
memory::fill(output + y * length + (width - h), 4 * h);
|
|
|
|
}
|
|
|
|
|
|
|
|
if(v) for(auto y : range(v)) {
|
|
|
|
memory::fill(output + y * length, 4 * width);
|
|
|
|
memory::fill(output + (height - 1 - y) * length, 4 * width);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-06-20 05:44:05 +00:00
|
|
|
video->unlock();
|
|
|
|
video->refresh();
|
2015-02-28 01:51:53 +00:00
|
|
|
}
|
|
|
|
|
2015-12-21 09:16:47 +00:00
|
|
|
static uint frameCounter = 0;
|
2015-02-28 01:51:53 +00:00
|
|
|
static time_t previous, current;
|
|
|
|
frameCounter++;
|
|
|
|
|
|
|
|
time(¤t);
|
|
|
|
if(current != previous) {
|
|
|
|
previous = current;
|
2015-04-13 11:16:33 +00:00
|
|
|
statusText = {"FPS: ", frameCounter};
|
2015-02-28 01:51:53 +00:00
|
|
|
frameCounter = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
auto Program::audioSample(int16 lsample, int16 rsample) -> void {
|
2015-12-21 09:16:47 +00:00
|
|
|
int samples[] = {lsample, rsample};
|
2015-02-28 01:51:53 +00:00
|
|
|
dsp.sample(samples);
|
|
|
|
while(dsp.pending()) {
|
|
|
|
dsp.read(samples);
|
2015-06-20 05:44:05 +00:00
|
|
|
audio->sample(samples[0], samples[1]);
|
2015-02-28 01:51:53 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-12-21 09:16:47 +00:00
|
|
|
auto Program::inputPoll(uint port, uint device, uint input) -> int16 {
|
2016-01-15 10:28:51 +00:00
|
|
|
if(presentation->focused() || settings["Input/FocusLoss/AllowInput"].boolean()) {
|
2015-04-21 11:51:57 +00:00
|
|
|
auto guid = emulator->port[port].device[device].input[input].guid;
|
2015-03-03 10:14:49 +00:00
|
|
|
auto mapping = (InputMapping*)guid;
|
|
|
|
if(mapping) return mapping->poll();
|
|
|
|
}
|
2015-03-02 09:13:28 +00:00
|
|
|
return 0;
|
2015-02-28 01:51:53 +00:00
|
|
|
}
|
|
|
|
|
2015-12-21 09:16:47 +00:00
|
|
|
auto Program::inputRumble(uint port, uint device, uint input, bool enable) -> void {
|
2016-01-15 10:28:51 +00:00
|
|
|
if(presentation->focused() || settings["Input/FocusLoss/AllowInput"].boolean() || !enable) {
|
2015-08-24 09:42:11 +00:00
|
|
|
auto guid = emulator->port[port].device[device].input[input].guid;
|
|
|
|
auto mapping = (InputMapping*)guid;
|
|
|
|
if(mapping) return mapping->rumble(enable);
|
|
|
|
}
|
2015-02-28 01:51:53 +00:00
|
|
|
}
|
|
|
|
|
2015-12-21 09:16:47 +00:00
|
|
|
auto Program::dipSettings(const Markup::Node& node) -> uint {
|
2016-02-28 11:42:52 +00:00
|
|
|
return 0;
|
2015-02-28 01:51:53 +00:00
|
|
|
}
|
|
|
|
|
2015-12-21 09:16:47 +00:00
|
|
|
auto Program::path(uint group) -> string {
|
2015-02-28 01:51:53 +00:00
|
|
|
return mediaPaths(group);
|
|
|
|
}
|
|
|
|
|
|
|
|
auto Program::notify(string text) -> void {
|
|
|
|
}
|