2010-08-09 23:28:56 +10:00
|
|
|
#include <ruby/ruby.hpp>
|
|
|
|
|
Update to v094r09 release.
byuu says:
This will easily be the biggest diff in the history of higan. And not in
a good way.
* target-higan and target-loki have been blown away completely
* nall and ruby massively updated
* phoenix replaced with hiro (pretty near a total rewrite)
* target-higan restarted using hiro (just a window for now)
* all emulation cores updated to compile again
* installation changed to not require root privileges (installs locally)
For the foreseeable future (maybe even permanently?), the new higan UI
will only build under Linux/BSD with GTK+ 2.20+. Probably the most
likely route for Windows/OS X will be to try and figure out how to build
hiro/GTK on those platforms, as awful as that would be. The other
alternative would be to produce new UIs for those platforms ... which
would actually be a good opportunity to make something much more user
friendly.
Being that I just started on this a few hours ago, that means that for
at least a few weeks, don't expect to be able to actually play any
games. Right now, you can pretty much just compile the binary and that's
it. It's quite possible that some nall changes didn't produce
compilation errors, but will produce runtime errors. So until the UI can
actually load games, we won't know if anything is broken. But we should
mostly be okay. It was mostly just trim<1> -> trim changes, moving to
Hash::SHA256 (much cleaner), and patching some reckless memory copy
functions enough to compile.
Progress isn't going to be like it was before: I'm now dividing my time
much thinner between studying and other hobbies.
My aim this time is not to produce a binary for everyone to play games
on. Rather, it's to keep the emulator alive. I want to be able to apply
critical patches again. And I would also like the base of the emulator
to live on, for use in other emulator frontends that utilize higan.
2015-02-26 21:10:46 +11:00
|
|
|
#undef deprecated
|
2010-10-23 16:08:05 +11:00
|
|
|
#undef mkdir
|
|
|
|
#undef usleep
|
2013-04-14 18:52:47 +10:00
|
|
|
#include <ruby/implementation.cpp>
|
2010-08-09 23:28:56 +10:00
|
|
|
|
|
|
|
namespace ruby {
|
|
|
|
|
|
|
|
VideoInterface video;
|
|
|
|
AudioInterface audio;
|
|
|
|
InputInterface input;
|
|
|
|
|
|
|
|
/* VideoInterface */
|
|
|
|
|
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 22:23:49 +10:00
|
|
|
const string Video::Handle = "Handle";
|
|
|
|
const string Video::Synchronize = "Synchronize";
|
|
|
|
const string Video::Depth = "Depth";
|
|
|
|
const string Video::Filter = "Filter";
|
|
|
|
const string Video::Shader = "Shader";
|
2010-08-09 23:28:56 +10:00
|
|
|
|
2013-04-14 18:52:47 +10:00
|
|
|
const unsigned Video::FilterNearest = 0;
|
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 22:23:49 +10:00
|
|
|
const unsigned Video::FilterLinear = 1;
|
2013-04-14 18:52:47 +10:00
|
|
|
|
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 22:23:49 +10:00
|
|
|
auto VideoInterface::driver(string driver) -> void {
|
2010-08-09 23:28:56 +10:00
|
|
|
if(p) term();
|
|
|
|
|
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 22:23:49 +10:00
|
|
|
if(!driver) driver = optimalDriver();
|
2010-08-09 23:28:56 +10:00
|
|
|
|
|
|
|
if(0);
|
|
|
|
|
2013-03-19 19:48:50 +11:00
|
|
|
#ifdef VIDEO_CGL
|
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 22:23:49 +10:00
|
|
|
else if(driver == "OpenGL") p = new VideoCGL();
|
2013-03-19 19:48:50 +11:00
|
|
|
#endif
|
|
|
|
|
2010-08-09 23:28:56 +10:00
|
|
|
#ifdef VIDEO_DIRECT3D
|
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 22:23:49 +10:00
|
|
|
else if(driver == "Direct3D") p = new VideoD3D();
|
2010-08-09 23:28:56 +10:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef VIDEO_DIRECTDRAW
|
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 22:23:49 +10:00
|
|
|
else if(driver == "DirectDraw") p = new VideoDD();
|
2010-08-09 23:28:56 +10:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef VIDEO_GDI
|
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 22:23:49 +10:00
|
|
|
else if(driver == "GDI") p = new VideoGDI();
|
2010-08-09 23:28:56 +10:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef VIDEO_GLX
|
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 22:23:49 +10:00
|
|
|
else if(driver == "OpenGL") p = new VideoGLX();
|
2010-08-09 23:28:56 +10:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef VIDEO_QTOPENGL
|
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 22:23:49 +10:00
|
|
|
else if(driver == "Qt-OpenGL") p = new VideoQtOpenGL();
|
2010-08-09 23:28:56 +10:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef VIDEO_QTRASTER
|
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 22:23:49 +10:00
|
|
|
else if(driver == "Qt-Raster") p = new VideoQtRaster();
|
2010-08-09 23:28:56 +10:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef VIDEO_SDL
|
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 22:23:49 +10:00
|
|
|
else if(driver == "SDL") p = new VideoSDL();
|
2010-08-09 23:28:56 +10:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef VIDEO_WGL
|
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 22:23:49 +10:00
|
|
|
else if(driver == "OpenGL") p = new VideoWGL();
|
2010-08-09 23:28:56 +10:00
|
|
|
#endif
|
|
|
|
|
Update to v084r03 release.
(r02 was not posted to the WIP thread)
byuu says:
Internally, all color is processed with 30-bit precision. The filters
also operate at 30-bit depth.
There's a new config file setting, video.depth, which defaults to 24.
This causes the final output to downsample to 24-bit, as most will
require.
If you set it to 30-bit, the downsampling will not occur, and bsnes will
ask ruby for a 30-bit surface. If you don't have one available, you're
going to get bad colors. Or maybe even a crash with OpenGL.
I don't yet have detection code to make sure you have an appropriate
visual in place.
30-bit mode will really only work if you are running Linux, running Xorg
at Depth 30, use the OpenGL or XShm driver, have an nVidia Quadro or AMD
FireGL card with the official drivers, and have a 30-bit capable
monitor.
Lots of planning and work for very little gain here, but it's nice that
it's finally finished.
Oh, I had to change the contrast/brightness formulas a tiny bit, but
they still work and look nice.
2011-12-03 14:22:54 +11:00
|
|
|
#ifdef VIDEO_XSHM
|
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 22:23:49 +10:00
|
|
|
else if(driver == "XShm") p = new VideoXShm();
|
Update to v084r03 release.
(r02 was not posted to the WIP thread)
byuu says:
Internally, all color is processed with 30-bit precision. The filters
also operate at 30-bit depth.
There's a new config file setting, video.depth, which defaults to 24.
This causes the final output to downsample to 24-bit, as most will
require.
If you set it to 30-bit, the downsampling will not occur, and bsnes will
ask ruby for a 30-bit surface. If you don't have one available, you're
going to get bad colors. Or maybe even a crash with OpenGL.
I don't yet have detection code to make sure you have an appropriate
visual in place.
30-bit mode will really only work if you are running Linux, running Xorg
at Depth 30, use the OpenGL or XShm driver, have an nVidia Quadro or AMD
FireGL card with the official drivers, and have a 30-bit capable
monitor.
Lots of planning and work for very little gain here, but it's nice that
it's finally finished.
Oh, I had to change the contrast/brightness formulas a tiny bit, but
they still work and look nice.
2011-12-03 14:22:54 +11:00
|
|
|
#endif
|
|
|
|
|
2010-08-09 23:28:56 +10:00
|
|
|
#ifdef VIDEO_XV
|
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 22:23:49 +10:00
|
|
|
else if(driver == "X-Video") p = new VideoXv();
|
2010-08-09 23:28:56 +10:00
|
|
|
#endif
|
|
|
|
|
|
|
|
else p = new Video();
|
|
|
|
}
|
|
|
|
|
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 22:23:49 +10:00
|
|
|
auto VideoInterface::optimalDriver() -> string {
|
2013-07-29 19:42:45 +10:00
|
|
|
#if defined(VIDEO_WGL)
|
|
|
|
return "OpenGL";
|
|
|
|
#elif defined(VIDEO_DIRECT3D)
|
|
|
|
return "Direct3D";
|
|
|
|
#elif defined(VIDEO_DIRECTDRAW)
|
|
|
|
return "DirectDraw";
|
|
|
|
#elif defined(VIDEO_GDI)
|
|
|
|
return "GDI";
|
|
|
|
|
|
|
|
#elif defined(VIDEO_CGL)
|
|
|
|
return "OpenGL";
|
|
|
|
|
|
|
|
#elif defined(VIDEO_GLX)
|
|
|
|
return "OpenGL";
|
|
|
|
#elif defined(VIDEO_XV)
|
|
|
|
return "X-Video";
|
|
|
|
#elif defined(VIDEO_XSHM)
|
|
|
|
return "XShm";
|
|
|
|
#elif defined(VIDEO_SDL)
|
|
|
|
return "SDL";
|
|
|
|
|
|
|
|
#else
|
|
|
|
return "None";
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
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 22:23:49 +10:00
|
|
|
auto VideoInterface::safestDriver() -> string {
|
2010-08-09 23:28:56 +10:00
|
|
|
#if defined(VIDEO_DIRECT3D)
|
|
|
|
return "Direct3D";
|
|
|
|
#elif defined(VIDEO_WGL)
|
|
|
|
return "OpenGL";
|
|
|
|
#elif defined(VIDEO_DIRECTDRAW)
|
|
|
|
return "DirectDraw";
|
|
|
|
#elif defined(VIDEO_GDI)
|
|
|
|
return "GDI";
|
2013-07-29 19:42:45 +10:00
|
|
|
|
2013-03-19 19:48:50 +11:00
|
|
|
#elif defined(VIDEO_CGL)
|
|
|
|
return "OpenGL";
|
2013-07-29 19:42:45 +10:00
|
|
|
|
Update to v084r03 release.
(r02 was not posted to the WIP thread)
byuu says:
Internally, all color is processed with 30-bit precision. The filters
also operate at 30-bit depth.
There's a new config file setting, video.depth, which defaults to 24.
This causes the final output to downsample to 24-bit, as most will
require.
If you set it to 30-bit, the downsampling will not occur, and bsnes will
ask ruby for a 30-bit surface. If you don't have one available, you're
going to get bad colors. Or maybe even a crash with OpenGL.
I don't yet have detection code to make sure you have an appropriate
visual in place.
30-bit mode will really only work if you are running Linux, running Xorg
at Depth 30, use the OpenGL or XShm driver, have an nVidia Quadro or AMD
FireGL card with the official drivers, and have a 30-bit capable
monitor.
Lots of planning and work for very little gain here, but it's nice that
it's finally finished.
Oh, I had to change the contrast/brightness formulas a tiny bit, but
they still work and look nice.
2011-12-03 14:22:54 +11:00
|
|
|
#elif defined(VIDEO_XSHM)
|
|
|
|
return "XShm";
|
2010-08-09 23:28:56 +10:00
|
|
|
#elif defined(VIDEO_SDL)
|
|
|
|
return "SDL";
|
|
|
|
#elif defined(VIDEO_XV)
|
|
|
|
return "X-Video";
|
|
|
|
#elif defined(VIDEO_GLX)
|
|
|
|
return "OpenGL";
|
2013-07-29 19:42:45 +10:00
|
|
|
|
2010-08-09 23:28:56 +10:00
|
|
|
#else
|
|
|
|
return "None";
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
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 22:23:49 +10:00
|
|
|
auto VideoInterface::availableDrivers() -> string {
|
2010-08-09 23:28:56 +10:00
|
|
|
return
|
|
|
|
|
|
|
|
//Windows
|
|
|
|
|
|
|
|
#if defined(VIDEO_WGL)
|
|
|
|
"OpenGL;"
|
|
|
|
#endif
|
|
|
|
|
2013-07-29 19:42:45 +10:00
|
|
|
#if defined(VIDEO_DIRECT3D)
|
|
|
|
"Direct3D;"
|
|
|
|
#endif
|
|
|
|
|
2010-08-09 23:28:56 +10:00
|
|
|
#if defined(VIDEO_DIRECTDRAW)
|
|
|
|
"DirectDraw;"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(VIDEO_GDI)
|
|
|
|
"GDI;"
|
|
|
|
#endif
|
|
|
|
|
2013-03-19 19:48:50 +11:00
|
|
|
//OS X
|
|
|
|
|
|
|
|
#if defined(VIDEO_CGL)
|
|
|
|
"OpenGL;"
|
|
|
|
#endif
|
|
|
|
|
2010-08-09 23:28:56 +10:00
|
|
|
//Linux
|
|
|
|
|
|
|
|
#if defined(VIDEO_GLX)
|
|
|
|
"OpenGL;"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(VIDEO_XV)
|
|
|
|
"X-Video;"
|
|
|
|
#endif
|
|
|
|
|
Update to v084r03 release.
(r02 was not posted to the WIP thread)
byuu says:
Internally, all color is processed with 30-bit precision. The filters
also operate at 30-bit depth.
There's a new config file setting, video.depth, which defaults to 24.
This causes the final output to downsample to 24-bit, as most will
require.
If you set it to 30-bit, the downsampling will not occur, and bsnes will
ask ruby for a 30-bit surface. If you don't have one available, you're
going to get bad colors. Or maybe even a crash with OpenGL.
I don't yet have detection code to make sure you have an appropriate
visual in place.
30-bit mode will really only work if you are running Linux, running Xorg
at Depth 30, use the OpenGL or XShm driver, have an nVidia Quadro or AMD
FireGL card with the official drivers, and have a 30-bit capable
monitor.
Lots of planning and work for very little gain here, but it's nice that
it's finally finished.
Oh, I had to change the contrast/brightness formulas a tiny bit, but
they still work and look nice.
2011-12-03 14:22:54 +11:00
|
|
|
#if defined(VIDEO_XSHM)
|
|
|
|
"XShm;"
|
|
|
|
#endif
|
|
|
|
|
2010-08-09 23:28:56 +10:00
|
|
|
#if defined(VIDEO_SDL)
|
|
|
|
"SDL;"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
"None";
|
|
|
|
}
|
|
|
|
|
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 22:23:49 +10:00
|
|
|
auto VideoInterface::init() -> bool {
|
2010-08-09 23:28:56 +10:00
|
|
|
if(!p) driver();
|
|
|
|
return p->init();
|
|
|
|
}
|
|
|
|
|
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 22:23:49 +10:00
|
|
|
auto VideoInterface::term() -> void {
|
2010-08-09 23:28:56 +10:00
|
|
|
if(p) {
|
2013-08-18 13:21:14 +10:00
|
|
|
p->term();
|
2010-08-09 23:28:56 +10:00
|
|
|
delete p;
|
2011-09-27 21:55:02 +10:00
|
|
|
p = nullptr;
|
2010-08-09 23:28:56 +10:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
VideoInterface::~VideoInterface() { term(); }
|
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 22:23:49 +10:00
|
|
|
auto VideoInterface::cap(const string& name) -> bool { return p ? p->cap(name) : false; }
|
|
|
|
auto VideoInterface::get(const string& name) -> any { return p ? p->get(name) : false; }
|
|
|
|
auto VideoInterface::set(const string& name, const any& value) -> bool { return p ? p->set(name, value) : false; }
|
|
|
|
auto VideoInterface::lock(uint32_t*& data, unsigned& pitch, unsigned width, unsigned height) -> bool { return p ? p->lock(data, pitch, width, height) : false; }
|
|
|
|
auto VideoInterface::unlock() -> void { if(p) p->unlock(); }
|
|
|
|
auto VideoInterface::clear() -> void { if(p) p->clear(); }
|
|
|
|
auto VideoInterface::refresh() -> void { if(p) p->refresh(); }
|
2010-08-09 23:28:56 +10:00
|
|
|
|
|
|
|
/* AudioInterface */
|
|
|
|
|
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 22:23:49 +10:00
|
|
|
const string Audio::Device = "Device";
|
|
|
|
const string Audio::Handle = "Handle";
|
|
|
|
const string Audio::Synchronize = "Synchronize";
|
|
|
|
const string Audio::Frequency = "Frequency";
|
|
|
|
const string Audio::Latency = "Latency";
|
2011-08-14 20:34:11 +10:00
|
|
|
|
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 22:23:49 +10:00
|
|
|
auto AudioInterface::driver(string driver) -> void {
|
2010-08-09 23:28:56 +10:00
|
|
|
if(p) term();
|
|
|
|
|
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 22:23:49 +10:00
|
|
|
if(!driver) driver = optimalDriver();
|
2010-08-09 23:28:56 +10:00
|
|
|
|
|
|
|
if(0);
|
|
|
|
|
|
|
|
#ifdef AUDIO_ALSA
|
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 22:23:49 +10:00
|
|
|
else if(driver == "ALSA") p = new AudioALSA();
|
2010-08-09 23:28:56 +10:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef AUDIO_AO
|
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 22:23:49 +10:00
|
|
|
else if(driver == "libao") p = new AudioAO();
|
2010-08-09 23:28:56 +10:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef AUDIO_DIRECTSOUND
|
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 22:23:49 +10:00
|
|
|
else if(driver == "DirectSound") p = new AudioDS();
|
2010-08-09 23:28:56 +10:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef AUDIO_OPENAL
|
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 22:23:49 +10:00
|
|
|
else if(driver == "OpenAL") p = new AudioOpenAL();
|
2010-08-09 23:28:56 +10:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef AUDIO_OSS
|
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 22:23:49 +10:00
|
|
|
else if(driver == "OSS") p = new AudioOSS();
|
2010-08-09 23:28:56 +10:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef AUDIO_PULSEAUDIO
|
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 22:23:49 +10:00
|
|
|
else if(driver == "PulseAudio") p = new AudioPulseAudio();
|
2010-08-09 23:28:56 +10:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef AUDIO_PULSEAUDIOSIMPLE
|
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 22:23:49 +10:00
|
|
|
else if(driver == "PulseAudioSimple") p = new AudioPulseAudioSimple();
|
2010-08-09 23:28:56 +10:00
|
|
|
#endif
|
|
|
|
|
2010-08-16 14:10:50 +10:00
|
|
|
#ifdef AUDIO_XAUDIO2
|
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 22:23:49 +10:00
|
|
|
else if(driver == "XAudio2") p = new AudioXAudio2();
|
2010-08-16 14:10:50 +10:00
|
|
|
#endif
|
|
|
|
|
2010-08-09 23:28:56 +10:00
|
|
|
else p = new Audio();
|
|
|
|
}
|
|
|
|
|
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 22:23:49 +10:00
|
|
|
auto AudioInterface::optimalDriver() -> string {
|
2013-07-29 19:42:45 +10:00
|
|
|
#if defined(AUDIO_XAUDIO2)
|
|
|
|
return "XAudio2";
|
|
|
|
#elif defined(AUDIO_DIRECTSOUND)
|
|
|
|
return "DirectSound";
|
|
|
|
|
|
|
|
#elif defined(AUDIO_ALSA)
|
|
|
|
return "ALSA";
|
|
|
|
#elif defined(AUDIO_OPENAL)
|
|
|
|
return "OpenAL";
|
|
|
|
#elif defined(AUDIO_OSS)
|
|
|
|
return "OSS";
|
|
|
|
#elif defined(AUDIO_PULSEAUDIO)
|
|
|
|
return "PulseAudio";
|
|
|
|
#elif defined(AUDIO_PULSEAUDIOSIMPLE)
|
|
|
|
return "PulseAudioSimple";
|
|
|
|
#elif defined(AUDIO_AO)
|
|
|
|
return "libao";
|
|
|
|
|
|
|
|
#else
|
|
|
|
return "None";
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
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 22:23:49 +10:00
|
|
|
auto AudioInterface::safestDriver() -> string {
|
2010-08-09 23:28:56 +10:00
|
|
|
#if defined(AUDIO_DIRECTSOUND)
|
|
|
|
return "DirectSound";
|
2010-08-16 14:10:50 +10:00
|
|
|
#elif defined(AUDIO_XAUDIO2)
|
|
|
|
return "XAudio2";
|
2013-07-29 19:42:45 +10:00
|
|
|
|
2010-08-09 23:28:56 +10:00
|
|
|
#elif defined(AUDIO_ALSA)
|
|
|
|
return "ALSA";
|
|
|
|
#elif defined(AUDIO_OPENAL)
|
|
|
|
return "OpenAL";
|
|
|
|
#elif defined(AUDIO_PULSEAUDIO)
|
|
|
|
return "PulseAudio";
|
|
|
|
#elif defined(AUDIO_PULSEAUDIOSIMPLE)
|
|
|
|
return "PulseAudioSimple";
|
|
|
|
#elif defined(AUDIO_AO)
|
|
|
|
return "libao";
|
|
|
|
#elif defined(AUDIO_OSS)
|
|
|
|
return "OSS";
|
2013-07-29 19:42:45 +10:00
|
|
|
|
2010-08-09 23:28:56 +10:00
|
|
|
#else
|
|
|
|
return "None";
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
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 22:23:49 +10:00
|
|
|
auto AudioInterface::availableDrivers() -> string {
|
2010-08-09 23:28:56 +10:00
|
|
|
return
|
|
|
|
|
|
|
|
//Windows
|
|
|
|
|
2010-08-16 14:10:50 +10:00
|
|
|
#if defined(AUDIO_XAUDIO2)
|
|
|
|
"XAudio2;"
|
|
|
|
#endif
|
|
|
|
|
2013-07-29 19:42:45 +10:00
|
|
|
#if defined(AUDIO_DIRECTSOUND)
|
|
|
|
"DirectSound;"
|
|
|
|
#endif
|
|
|
|
|
2010-08-09 23:28:56 +10:00
|
|
|
//Linux
|
|
|
|
|
|
|
|
#if defined(AUDIO_ALSA)
|
|
|
|
"ALSA;"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(AUDIO_OPENAL)
|
|
|
|
"OpenAL;"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(AUDIO_OSS)
|
|
|
|
"OSS;"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(AUDIO_PULSEAUDIO)
|
|
|
|
"PulseAudio;"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(AUDIO_PULSEAUDIOSIMPLE)
|
|
|
|
"PulseAudioSimple;"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(AUDIO_AO)
|
|
|
|
"libao;"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
"None";
|
|
|
|
}
|
|
|
|
|
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 22:23:49 +10:00
|
|
|
auto AudioInterface::init() -> bool {
|
2011-08-14 20:34:11 +10:00
|
|
|
if(!p) driver();
|
|
|
|
return p->init();
|
|
|
|
}
|
|
|
|
|
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 22:23:49 +10:00
|
|
|
auto AudioInterface::term() -> void {
|
2011-08-14 20:34:11 +10:00
|
|
|
if(p) {
|
2013-08-18 13:21:14 +10:00
|
|
|
p->term();
|
2011-08-14 20:34:11 +10:00
|
|
|
delete p;
|
2011-09-27 21:55:02 +10:00
|
|
|
p = nullptr;
|
2011-08-14 20:34:11 +10:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
AudioInterface::~AudioInterface() { term(); }
|
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 22:23:49 +10:00
|
|
|
auto AudioInterface::cap(const string& name) -> bool { return p ? p->cap(name) : false; }
|
|
|
|
auto AudioInterface::get(const string& name) -> any { return p ? p->get(name) : false; }
|
|
|
|
auto AudioInterface::set(const string& name, const any& value) -> bool { return p ? p->set(name, value) : false; }
|
|
|
|
auto AudioInterface::sample(uint16_t left, uint16_t right) -> void { if(p) p->sample(left, right); }
|
|
|
|
auto AudioInterface::clear() -> void { if(p) p->clear(); }
|
2010-08-09 23:28:56 +10:00
|
|
|
|
|
|
|
/* InputInterface */
|
|
|
|
|
2015-05-24 19:44:28 +10:00
|
|
|
const string Input::Handle = "Handle";
|
|
|
|
const string Input::KeyboardSupport = "KeyboardSupport";
|
|
|
|
const string Input::MouseSupport = "MouseSupport";
|
|
|
|
const string Input::JoypadSupport = "JoypadSupport";
|
|
|
|
const string Input::JoypadRumbleSupport = "JoypadRumbleSupport";
|
2010-08-09 23:28:56 +10:00
|
|
|
|
2015-05-24 19:44:28 +10:00
|
|
|
auto InputInterface::driver(string driver) -> void {
|
2010-08-09 23:28:56 +10:00
|
|
|
if(p) term();
|
|
|
|
|
2015-05-24 19:44:28 +10:00
|
|
|
if(!driver) driver = optimalDriver();
|
2010-08-09 23:28:56 +10:00
|
|
|
|
|
|
|
if(0);
|
|
|
|
|
2014-01-05 20:59:17 +11:00
|
|
|
#ifdef INPUT_WINDOWS
|
2015-05-24 19:44:28 +10:00
|
|
|
else if(driver == "Windows") p = new InputWindows();
|
2010-08-09 23:28:56 +10:00
|
|
|
#endif
|
|
|
|
|
2013-03-19 19:48:50 +11:00
|
|
|
#ifdef INPUT_CARBON
|
2015-05-24 19:44:28 +10:00
|
|
|
else if(driver == "Carbon") p = new InputCarbon();
|
2013-03-19 19:48:50 +11:00
|
|
|
#endif
|
|
|
|
|
2013-12-21 21:45:58 +11:00
|
|
|
#ifdef INPUT_UDEV
|
2015-05-24 19:44:28 +10:00
|
|
|
else if(driver == "udev") p = new InputUdev();
|
2013-12-21 21:45:58 +11:00
|
|
|
#endif
|
|
|
|
|
2010-08-09 23:28:56 +10:00
|
|
|
#ifdef INPUT_SDL
|
2015-05-24 19:44:28 +10:00
|
|
|
else if(driver == "SDL") p = new InputSDL();
|
2010-08-09 23:28:56 +10:00
|
|
|
#endif
|
|
|
|
|
Update to v093r12 release.
byuu says:
I've completely redone the ethos InputManager and ruby to work on
HID::Device objects instead of one giant scancode pool.
Currently only the udev driver supports the changes to ruby, so only
Linux users will be able to compile and run this WIP build.
The nice thing about the new system is that it's now possible to
uniquely identify controllers, so if you swap out gamepads, you won't
end up with it working but with all the mappings all screwed up. Since
higan lets you map multiple physical inputs to one emulated input, you
can now configure your keyboard and multiple gamepads to the same
emulated input, and then just use whatever controller you want.
Because USB gamepad makers failed to provide unique serial#s with each
controller, we have to limit the mapping to specific USB ports.
Otherwise, we couldn't distinguish two otherwise identical gamepads. So
basically your computer USB ports act like real game console input port
numbers. Which is kind of neat, I guess.
And the really nice thing about the new system is that we now have the
capability to support hotplugging input devices. I haven't yet added
this to any drivers, but I'm definitely going to add it to udev for v094
official.
Finally, with the device ID (vendor ID + product ID) exposed, we gain
one last really cool feature that we may be able to develop more in the
future. Say we created a joypad.bml file to include with higan. In it,
we'd store the Xbox 360 controller, and pre-defined button mappings for
each emulated system. So if higan detects you have an Xbox 360
controller, you can just plug it in and use it. Even better, we can
clearly specify the difference between triggers and analog axes, and
name each individual input. So you'd see "Xbox 360 Gamepad #1: Left
Trigger" instead of higan v093's "JP0::Axis2.Hi"
Note: for right now, ethos' input manager isn't filtering the device IDs
to look pretty. So you're going to see a 64-bit hex value for a device
ID right now instead of something like Joypad#N for now.
2013-12-23 22:43:51 +11:00
|
|
|
#ifdef INPUT_XLIB
|
2015-05-24 19:44:28 +10:00
|
|
|
else if(driver == "Xlib") p = new InputXlib();
|
2010-08-09 23:28:56 +10:00
|
|
|
#endif
|
|
|
|
|
|
|
|
else p = new Input();
|
|
|
|
}
|
|
|
|
|
2015-05-24 19:44:28 +10:00
|
|
|
auto InputInterface::optimalDriver() -> string {
|
2014-01-05 20:59:17 +11:00
|
|
|
#if defined(INPUT_WINDOWS)
|
|
|
|
return "Windows";
|
2013-07-29 19:42:45 +10:00
|
|
|
|
2013-03-19 19:48:50 +11:00
|
|
|
#elif defined(INPUT_CARBON)
|
|
|
|
return "Carbon";
|
2013-07-29 19:42:45 +10:00
|
|
|
|
2013-12-21 21:45:58 +11:00
|
|
|
#elif defined(INPUT_UDEV)
|
|
|
|
return "udev";
|
2010-08-09 23:28:56 +10:00
|
|
|
#elif defined(INPUT_SDL)
|
|
|
|
return "SDL";
|
Update to v093r12 release.
byuu says:
I've completely redone the ethos InputManager and ruby to work on
HID::Device objects instead of one giant scancode pool.
Currently only the udev driver supports the changes to ruby, so only
Linux users will be able to compile and run this WIP build.
The nice thing about the new system is that it's now possible to
uniquely identify controllers, so if you swap out gamepads, you won't
end up with it working but with all the mappings all screwed up. Since
higan lets you map multiple physical inputs to one emulated input, you
can now configure your keyboard and multiple gamepads to the same
emulated input, and then just use whatever controller you want.
Because USB gamepad makers failed to provide unique serial#s with each
controller, we have to limit the mapping to specific USB ports.
Otherwise, we couldn't distinguish two otherwise identical gamepads. So
basically your computer USB ports act like real game console input port
numbers. Which is kind of neat, I guess.
And the really nice thing about the new system is that we now have the
capability to support hotplugging input devices. I haven't yet added
this to any drivers, but I'm definitely going to add it to udev for v094
official.
Finally, with the device ID (vendor ID + product ID) exposed, we gain
one last really cool feature that we may be able to develop more in the
future. Say we created a joypad.bml file to include with higan. In it,
we'd store the Xbox 360 controller, and pre-defined button mappings for
each emulated system. So if higan detects you have an Xbox 360
controller, you can just plug it in and use it. Even better, we can
clearly specify the difference between triggers and analog axes, and
name each individual input. So you'd see "Xbox 360 Gamepad #1: Left
Trigger" instead of higan v093's "JP0::Axis2.Hi"
Note: for right now, ethos' input manager isn't filtering the device IDs
to look pretty. So you're going to see a 64-bit hex value for a device
ID right now instead of something like Joypad#N for now.
2013-12-23 22:43:51 +11:00
|
|
|
#elif defined(INPUT_XLIB)
|
|
|
|
return "Xlib";
|
2013-07-29 19:42:45 +10:00
|
|
|
|
|
|
|
#else
|
|
|
|
return "None";
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2015-05-24 19:44:28 +10:00
|
|
|
auto InputInterface::safestDriver() -> string {
|
2014-01-05 20:59:17 +11:00
|
|
|
#if defined(INPUT_WINDOWS)
|
|
|
|
return "Windows";
|
2013-07-29 19:42:45 +10:00
|
|
|
|
|
|
|
#elif defined(INPUT_CARBON)
|
|
|
|
return "Carbon";
|
|
|
|
|
2013-12-21 21:45:58 +11:00
|
|
|
#elif defined(INPUT_UDEV)
|
|
|
|
return "udev";
|
2013-07-29 19:42:45 +10:00
|
|
|
#elif defined(INPUT_SDL)
|
|
|
|
return "SDL";
|
Update to v093r12 release.
byuu says:
I've completely redone the ethos InputManager and ruby to work on
HID::Device objects instead of one giant scancode pool.
Currently only the udev driver supports the changes to ruby, so only
Linux users will be able to compile and run this WIP build.
The nice thing about the new system is that it's now possible to
uniquely identify controllers, so if you swap out gamepads, you won't
end up with it working but with all the mappings all screwed up. Since
higan lets you map multiple physical inputs to one emulated input, you
can now configure your keyboard and multiple gamepads to the same
emulated input, and then just use whatever controller you want.
Because USB gamepad makers failed to provide unique serial#s with each
controller, we have to limit the mapping to specific USB ports.
Otherwise, we couldn't distinguish two otherwise identical gamepads. So
basically your computer USB ports act like real game console input port
numbers. Which is kind of neat, I guess.
And the really nice thing about the new system is that we now have the
capability to support hotplugging input devices. I haven't yet added
this to any drivers, but I'm definitely going to add it to udev for v094
official.
Finally, with the device ID (vendor ID + product ID) exposed, we gain
one last really cool feature that we may be able to develop more in the
future. Say we created a joypad.bml file to include with higan. In it,
we'd store the Xbox 360 controller, and pre-defined button mappings for
each emulated system. So if higan detects you have an Xbox 360
controller, you can just plug it in and use it. Even better, we can
clearly specify the difference between triggers and analog axes, and
name each individual input. So you'd see "Xbox 360 Gamepad #1: Left
Trigger" instead of higan v093's "JP0::Axis2.Hi"
Note: for right now, ethos' input manager isn't filtering the device IDs
to look pretty. So you're going to see a 64-bit hex value for a device
ID right now instead of something like Joypad#N for now.
2013-12-23 22:43:51 +11:00
|
|
|
#elif defined(INPUT_XLIB)
|
|
|
|
return "Xlib";
|
2013-07-29 19:42:45 +10:00
|
|
|
|
2010-08-09 23:28:56 +10:00
|
|
|
#else
|
|
|
|
return "none";
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2015-05-24 19:44:28 +10:00
|
|
|
auto InputInterface::availableDrivers() -> string {
|
2010-08-09 23:28:56 +10:00
|
|
|
return
|
|
|
|
|
|
|
|
//Windows
|
|
|
|
|
2014-01-05 20:59:17 +11:00
|
|
|
#if defined(INPUT_WINDOWS)
|
|
|
|
"Windows;"
|
2010-08-09 23:28:56 +10:00
|
|
|
#endif
|
|
|
|
|
2013-03-19 19:48:50 +11:00
|
|
|
//OS X
|
|
|
|
|
|
|
|
#if defined(INPUT_CARBON)
|
|
|
|
"Carbon;"
|
|
|
|
#endif
|
|
|
|
|
2010-08-09 23:28:56 +10:00
|
|
|
//Linux
|
|
|
|
|
2013-12-21 21:45:58 +11:00
|
|
|
#if defined(INPUT_UDEV)
|
|
|
|
"udev;"
|
|
|
|
#endif
|
|
|
|
|
2010-08-09 23:28:56 +10:00
|
|
|
#if defined(INPUT_SDL)
|
|
|
|
"SDL;"
|
|
|
|
#endif
|
|
|
|
|
Update to v093r12 release.
byuu says:
I've completely redone the ethos InputManager and ruby to work on
HID::Device objects instead of one giant scancode pool.
Currently only the udev driver supports the changes to ruby, so only
Linux users will be able to compile and run this WIP build.
The nice thing about the new system is that it's now possible to
uniquely identify controllers, so if you swap out gamepads, you won't
end up with it working but with all the mappings all screwed up. Since
higan lets you map multiple physical inputs to one emulated input, you
can now configure your keyboard and multiple gamepads to the same
emulated input, and then just use whatever controller you want.
Because USB gamepad makers failed to provide unique serial#s with each
controller, we have to limit the mapping to specific USB ports.
Otherwise, we couldn't distinguish two otherwise identical gamepads. So
basically your computer USB ports act like real game console input port
numbers. Which is kind of neat, I guess.
And the really nice thing about the new system is that we now have the
capability to support hotplugging input devices. I haven't yet added
this to any drivers, but I'm definitely going to add it to udev for v094
official.
Finally, with the device ID (vendor ID + product ID) exposed, we gain
one last really cool feature that we may be able to develop more in the
future. Say we created a joypad.bml file to include with higan. In it,
we'd store the Xbox 360 controller, and pre-defined button mappings for
each emulated system. So if higan detects you have an Xbox 360
controller, you can just plug it in and use it. Even better, we can
clearly specify the difference between triggers and analog axes, and
name each individual input. So you'd see "Xbox 360 Gamepad #1: Left
Trigger" instead of higan v093's "JP0::Axis2.Hi"
Note: for right now, ethos' input manager isn't filtering the device IDs
to look pretty. So you're going to see a 64-bit hex value for a device
ID right now instead of something like Joypad#N for now.
2013-12-23 22:43:51 +11:00
|
|
|
#if defined(INPUT_XLIB)
|
|
|
|
"Xlib;"
|
2010-08-09 23:28:56 +10:00
|
|
|
#endif
|
|
|
|
|
|
|
|
"None";
|
|
|
|
}
|
|
|
|
|
2015-05-24 19:44:28 +10:00
|
|
|
auto InputInterface::init() -> bool {
|
2010-08-09 23:28:56 +10:00
|
|
|
if(!p) driver();
|
|
|
|
return p->init();
|
|
|
|
}
|
|
|
|
|
2015-05-24 19:44:28 +10:00
|
|
|
auto InputInterface::term() -> void {
|
2010-08-09 23:28:56 +10:00
|
|
|
if(p) {
|
2013-08-18 13:21:14 +10:00
|
|
|
p->term();
|
2010-08-09 23:28:56 +10:00
|
|
|
delete p;
|
2011-09-27 21:55:02 +10:00
|
|
|
p = nullptr;
|
2010-08-09 23:28:56 +10:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
InputInterface::~InputInterface() { term(); }
|
2015-05-24 19:44:28 +10:00
|
|
|
auto InputInterface::cap(const string& name) -> bool { return p ? p->cap(name) : false; }
|
|
|
|
auto InputInterface::get(const string& name) -> any { return p ? p->get(name) : false; }
|
|
|
|
auto InputInterface::set(const string& name, const any& value) -> bool { return p ? p->set(name, value) : false; }
|
|
|
|
auto InputInterface::acquire() -> bool { return p ? p->acquire() : false; }
|
|
|
|
auto InputInterface::unacquire() -> bool { return p ? p->unacquire() : false; }
|
|
|
|
auto InputInterface::acquired() -> bool { return p ? p->acquired() : false; }
|
|
|
|
auto InputInterface::poll() -> vector<shared_pointer<HID::Device>> { return p ? p->poll() : vector<shared_pointer<HID::Device>>(); }
|
|
|
|
auto InputInterface::rumble(uint64_t id, bool enable) -> bool { return p ? p->rumble(id, enable) : false; }
|
2010-08-09 23:28:56 +10:00
|
|
|
|
|
|
|
};
|