2011-09-29 12:08:22 +00:00
|
|
|
#ifndef NALL_INTRINSICS_HPP
|
|
|
|
#define NALL_INTRINSICS_HPP
|
|
|
|
|
2013-05-02 11:25:45 +00:00
|
|
|
namespace nall {
|
|
|
|
|
2011-09-29 12:08:22 +00:00
|
|
|
struct Intrinsics {
|
2013-04-09 13:31:46 +00:00
|
|
|
enum class Compiler : unsigned { Clang, GCC, VisualC, Unknown };
|
2011-09-29 12:08:22 +00:00
|
|
|
enum class Platform : unsigned { X, OSX, Windows, Unknown };
|
|
|
|
enum class Endian : unsigned { LSB, MSB, Unknown };
|
|
|
|
|
|
|
|
static inline Compiler compiler();
|
|
|
|
static inline Platform platform();
|
|
|
|
static inline Endian endian();
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Compiler detection */
|
|
|
|
|
2013-04-09 13:31:46 +00:00
|
|
|
#if defined(__clang__)
|
|
|
|
#define COMPILER_CLANG
|
|
|
|
Intrinsics::Compiler Intrinsics::compiler() { return Intrinsics::Compiler::Clang; }
|
|
|
|
#elif defined(__GNUC__)
|
2011-09-29 12:08:22 +00:00
|
|
|
#define COMPILER_GCC
|
|
|
|
Intrinsics::Compiler Intrinsics::compiler() { return Intrinsics::Compiler::GCC; }
|
|
|
|
#elif defined(_MSC_VER)
|
|
|
|
#define COMPILER_VISUALC
|
|
|
|
Intrinsics::Compiler Intrinsics::compiler() { return Intrinsics::Compiler::VisualC; }
|
|
|
|
#else
|
Update to v083r09 release.
byuu says:
Added frequency, latency, resampler selection to the audio settings
panel (I really only wanted it there for resampler selection ... having
three options matches the driver selection style though, so whatever.)
The linear/hermite sampler will double the framerate when running Game
Boy games, and sounds the same. Same framerate and sound quality on
SNES. But it will cause buzzing in many NES titles.
Also re-added the composition { never, fullscreen, always } modes.
I think that option is clutter, but it's just impossible to get good
audio+video on Windows 7 without it ...
Lastly, HQ2x was ported over, but not very well. I just convert source
pixels from RGB888 to RGB555, and output pixels in the opposite
direction.
Need someone good to port the diff() and blend functions over to RGB888
in a way that's not terribly slow.
2011-10-31 09:55:48 +00:00
|
|
|
#warning "unable to detect compiler"
|
2011-09-29 12:08:22 +00:00
|
|
|
#define COMPILER_UNKNOWN
|
|
|
|
Intrinsics::Compiler Intrinsics::compiler() { return Intrinsics::Compiler::Unknown; }
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Platform detection */
|
|
|
|
|
Update to v093r01 release.
byuu says:
Changelog:
- added SA-1 MDR; fixes bug in SD Gundam G-Next where the main
battleship was unable to fire
- added out-of-the-box support for any BSD running Clang 3.3+ (FreeBSD
10+, notably)
- added new video shader, "Display Emulation", which changes the shader
based on the emulated system
- fixed the home button to go to your default library path
- phoenix: Windows port won't send onActivate unless an item is selected
(prevents crashing on pressing enter in file dialog)
- ruby: removed vec4 position from out Vertex {} (helps AMD cards)
- shaders: updated all shaders to use texture() instead of texture2D()
(helps AMD cards)
The "Display Emulation" option works like this: when selected, it tries
to load "<path>/Video Shaders/Emulation/<systemName>.shader/"; otherwise
it falls back to the blur shader. <path> is the usual (next to binary,
then in <config>/higan, then in /usr/share/higan, etc); and <systemName>
is "Famicom", "Super Famicom", "Game Boy", "Game Boy Color", "Game Boy
Advance"
To support BSD, I had to modify the $(platform) variable to
differentiate between Linux and BSD.
As such, the new $(platform) values are:
win -> windows
osx -> macosx
x -> linux or bsd
I am also checking uname -s instead of uname -a now. No reason to
potentially match the hostname to the wrong OS type.
2013-10-21 11:45:39 +00:00
|
|
|
#if defined(linux) || defined(__linux__) || defined(__sun__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__)
|
2011-09-29 12:08:22 +00:00
|
|
|
#define PLATFORM_X
|
|
|
|
Intrinsics::Platform Intrinsics::platform() { return Intrinsics::Platform::X; }
|
|
|
|
#elif defined(__APPLE__)
|
|
|
|
#define PLATFORM_OSX
|
|
|
|
Intrinsics::Platform Intrinsics::platform() { return Intrinsics::Platform::OSX; }
|
|
|
|
#elif defined(_WIN32)
|
|
|
|
#define PLATFORM_WINDOWS
|
|
|
|
#define PLATFORM_WIN
|
|
|
|
Intrinsics::Platform Intrinsics::platform() { return Intrinsics::Platform::Windows; }
|
|
|
|
#else
|
Update to v083r09 release.
byuu says:
Added frequency, latency, resampler selection to the audio settings
panel (I really only wanted it there for resampler selection ... having
three options matches the driver selection style though, so whatever.)
The linear/hermite sampler will double the framerate when running Game
Boy games, and sounds the same. Same framerate and sound quality on
SNES. But it will cause buzzing in many NES titles.
Also re-added the composition { never, fullscreen, always } modes.
I think that option is clutter, but it's just impossible to get good
audio+video on Windows 7 without it ...
Lastly, HQ2x was ported over, but not very well. I just convert source
pixels from RGB888 to RGB555, and output pixels in the opposite
direction.
Need someone good to port the diff() and blend functions over to RGB888
in a way that's not terribly slow.
2011-10-31 09:55:48 +00:00
|
|
|
#warning "unable to detect platform"
|
2011-09-29 12:08:22 +00:00
|
|
|
#define PLATFORM_UNKNOWN
|
Update to v083r09 release.
byuu says:
Added frequency, latency, resampler selection to the audio settings
panel (I really only wanted it there for resampler selection ... having
three options matches the driver selection style though, so whatever.)
The linear/hermite sampler will double the framerate when running Game
Boy games, and sounds the same. Same framerate and sound quality on
SNES. But it will cause buzzing in many NES titles.
Also re-added the composition { never, fullscreen, always } modes.
I think that option is clutter, but it's just impossible to get good
audio+video on Windows 7 without it ...
Lastly, HQ2x was ported over, but not very well. I just convert source
pixels from RGB888 to RGB555, and output pixels in the opposite
direction.
Need someone good to port the diff() and blend functions over to RGB888
in a way that's not terribly slow.
2011-10-31 09:55:48 +00:00
|
|
|
Intrinsics::Platform Intrinsics::platform() { return Intrinsics::Platform::Unknown; }
|
2011-09-29 12:08:22 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Endian detection */
|
|
|
|
|
|
|
|
#if defined(__i386__) || defined(__amd64__) || defined(_M_IX86) || defined(_M_AMD64)
|
|
|
|
#define ENDIAN_LSB
|
|
|
|
#define ARCH_LSB
|
|
|
|
Intrinsics::Endian Intrinsics::endian() { return Intrinsics::Endian::LSB; }
|
|
|
|
#elif defined(__powerpc__) || defined(_M_PPC) || defined(__BIG_ENDIAN__)
|
|
|
|
#define ENDIAN_MSB
|
|
|
|
#define ARCH_MSB
|
|
|
|
Intrinsics::Endian Intrinsics::endian() { return Intrinsics::Endian::MSB; }
|
|
|
|
#else
|
Update to v083r09 release.
byuu says:
Added frequency, latency, resampler selection to the audio settings
panel (I really only wanted it there for resampler selection ... having
three options matches the driver selection style though, so whatever.)
The linear/hermite sampler will double the framerate when running Game
Boy games, and sounds the same. Same framerate and sound quality on
SNES. But it will cause buzzing in many NES titles.
Also re-added the composition { never, fullscreen, always } modes.
I think that option is clutter, but it's just impossible to get good
audio+video on Windows 7 without it ...
Lastly, HQ2x was ported over, but not very well. I just convert source
pixels from RGB888 to RGB555, and output pixels in the opposite
direction.
Need someone good to port the diff() and blend functions over to RGB888
in a way that's not terribly slow.
2011-10-31 09:55:48 +00:00
|
|
|
#warning "unable to detect endian"
|
2011-09-29 12:08:22 +00:00
|
|
|
#define ENDIAN_UNKNOWN
|
|
|
|
#define ARCH_UNKNOWN
|
Update to v083r09 release.
byuu says:
Added frequency, latency, resampler selection to the audio settings
panel (I really only wanted it there for resampler selection ... having
three options matches the driver selection style though, so whatever.)
The linear/hermite sampler will double the framerate when running Game
Boy games, and sounds the same. Same framerate and sound quality on
SNES. But it will cause buzzing in many NES titles.
Also re-added the composition { never, fullscreen, always } modes.
I think that option is clutter, but it's just impossible to get good
audio+video on Windows 7 without it ...
Lastly, HQ2x was ported over, but not very well. I just convert source
pixels from RGB888 to RGB555, and output pixels in the opposite
direction.
Need someone good to port the diff() and blend functions over to RGB888
in a way that's not terribly slow.
2011-10-31 09:55:48 +00:00
|
|
|
Intrinsics::Endian Intrinsics::endian() { return Intrinsics::Endian::Unknown; }
|
2011-09-29 12:08:22 +00:00
|
|
|
#endif
|
|
|
|
|
2013-05-02 11:25:45 +00:00
|
|
|
}
|
|
|
|
|
2011-09-29 12:08:22 +00:00
|
|
|
#endif
|