Update to v094r08 release.
byuu says:
Lots of changes this time around. FreeBSD stability and compilation is
still a work in progress.
FreeBSD 10 + Clang 3.3 = 108fps
FreeBSD 10 + GCC 4.7 = 130fps
Errata 1: I've been fighting that god-damned endian.h header for the
past nine WIPs now. The above WIP isn't building now because FreeBSD
isn't including headers before using certain types, and you end up with
a trillion error messages. So just delete all the endian.h includes from
nall/intrinsics.hpp to build.
Errata 2: I was trying to match g++ and g++47, so I used $(findstring
g++,$(compiler)), which ends up also matching clang++. Oops. Easy fix,
put Clang first and then else if g++ next. Not ideal, but oh well. All
it's doing for now is declaring -fwrapv twice, so you don't have to fix
it just yet. Probably just going to alias g++="g++47" and do exact
matching instead.
Errata 3: both OpenGL::term and VideoGLX::term are causing a core dump
on BSD. No idea why. The resources are initialized and valid, but
releasing them crashes the application.
Changelog:
- nall/Makefile is more flexible with overriding $(compiler), so you can
build with GCC or Clang on BSD (defaults to GCC now)
- PLATFORM_X was renamed to PLATFORM_XORG, and it's also declared with
PLATFORM_LINUX or PLATFORM_BSD
- PLATFORM_XORG probably isn't the best name ... still thinking about
what best to call LINUX|BSD|SOLARIS or ^(WINDOWS|MACOSX)
- fixed a few legitimate Clang warning messages in nall
- Compiler::VisualCPP is ugly as hell, renamed to Compiler::CL
- nall/platform includes nall/intrinsics first. Trying to move away from
testing for _WIN32, etc directly in all files. Work in progress.
- nall turns off Clang warnings that I won't "fix", because they aren't
broken. It's much less noisy to compile with warnings on now.
- phoenix gains the ability to set background and foreground colors on
various text container widgets (GTK only for now.)
- rewrote a lot of the MSU1 code to try and simplify it. Really hope
I didn't break anything ... I don't have any MSU1 test ROMs handy
- SNES coprocessor audio is now mixed as sclamp<16>(system_sample
+ coprocessor_sample) instead of sclamp<16>((sys + cop) / 2)
- allows for greater chance of aliasing (still low, SNES audio is
quiet), but doesn't cut base system volume in half anymore
- fixed Super Scope and Justifier cursor colors
- use input.xlib instead of input.x ... allows Xlib input driver to be
visible on Linux and BSD once again
- make install and make uninstall must be run as root again; no longer
using install but cp instead for BSD compatibility
- killed $(DESTDIR) ... use make prefix=$DESTDIR$prefix instead
- you can now set text/background colors for the loki console via (eg):
- settings.terminal.background-color 0x000000
- settings.terminal.foreground-color 0xffffff
2014-02-24 09:39:09 +00:00
|
|
|
#if defined(PLATFORM_XORG)
|
2013-04-09 13:31:46 +00:00
|
|
|
#include <GL/gl.h>
|
|
|
|
#include <GL/glx.h>
|
|
|
|
#define glGetProcAddress(name) (*glXGetProcAddress)((const GLubyte*)(name))
|
Update to v093r02 release.
byuu says:
Changelog:
- nall: fixed major memory leak in string class
- ruby: video shaders support #define-based settings now
- phoenix/GTK+: support > 256x256 icons for window / task bar / alt-tab
- sfc: remove random/ and config/, merge into system/
- ethos: delete higan.png (48x48), replace with higan512.png (512x512)
as new higan.png
- ethos: default gamma to 100% (no color adjustment)
- ethos: use "Video Shaders/Display Emulation/" instead of "Video
Shaders/Emulation/"
- use g++ instead of g++-4.7 (g++ -v must be >= 4.7)
- use -std=c++11 instead of -std=gnu++11
- applied a few patches from Debian upstream to make their packaging job
easier
So because colors are normalized in GLSL, I won't be able to offer video
shaders absolute color literals. We will have to perform basic color
conversion inside the core.
As such, the current plan is to create some sort of Emulator::Settings
interface. With that, I'll connect an option for color correction, which
will be on by default. For FC/SFC, that will mean gamma correction
(darker / stronger colors), and for GB/GBC/GBA, it will mean simulating
the weird brightness levels of the displays. I am undecided on whether
to use pea soup green for the GB or not. By not doing so, it'll be
easier for the display emulation shader to do it.
2013-11-09 11:45:54 +00:00
|
|
|
#elif defined(PLATFORM_MACOSX)
|
2013-04-09 13:31:46 +00:00
|
|
|
#include <OpenGL/gl.h>
|
2013-04-14 08:52:47 +00:00
|
|
|
#include <OpenGL/gl3.h>
|
Update to v093r02 release.
byuu says:
Changelog:
- nall: fixed major memory leak in string class
- ruby: video shaders support #define-based settings now
- phoenix/GTK+: support > 256x256 icons for window / task bar / alt-tab
- sfc: remove random/ and config/, merge into system/
- ethos: delete higan.png (48x48), replace with higan512.png (512x512)
as new higan.png
- ethos: default gamma to 100% (no color adjustment)
- ethos: use "Video Shaders/Display Emulation/" instead of "Video
Shaders/Emulation/"
- use g++ instead of g++-4.7 (g++ -v must be >= 4.7)
- use -std=c++11 instead of -std=gnu++11
- applied a few patches from Debian upstream to make their packaging job
easier
So because colors are normalized in GLSL, I won't be able to offer video
shaders absolute color literals. We will have to perform basic color
conversion inside the core.
As such, the current plan is to create some sort of Emulator::Settings
interface. With that, I'll connect an option for color correction, which
will be on by default. For FC/SFC, that will mean gamma correction
(darker / stronger colors), and for GB/GBC/GBA, it will mean simulating
the weird brightness levels of the displays. I am undecided on whether
to use pea soup green for the GB or not. By not doing so, it'll be
easier for the display emulation shader to do it.
2013-11-09 11:45:54 +00:00
|
|
|
#elif defined(PLATFORM_WINDOWS)
|
2013-04-09 13:31:46 +00:00
|
|
|
#include <GL/gl.h>
|
|
|
|
#include <GL/glext.h>
|
|
|
|
#define glGetProcAddress(name) wglGetProcAddress(name)
|
|
|
|
#else
|
|
|
|
#error "ruby::OpenGL: unsupported platform"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
namespace ruby {
|
|
|
|
|
|
|
|
#include "bind.hpp"
|
|
|
|
#include "shaders.hpp"
|
|
|
|
#include "utility.hpp"
|
|
|
|
|
|
|
|
struct OpenGL;
|
|
|
|
|
|
|
|
struct OpenGLTexture {
|
|
|
|
GLuint texture = 0;
|
|
|
|
unsigned width = 0;
|
|
|
|
unsigned height = 0;
|
|
|
|
GLuint format = GL_RGBA8;
|
|
|
|
GLuint filter = GL_LINEAR;
|
|
|
|
GLuint wrap = GL_CLAMP_TO_BORDER;
|
2014-01-05 09:59:17 +00:00
|
|
|
|
|
|
|
GLuint getFormat() const;
|
|
|
|
GLuint getType() const;
|
2013-04-09 13:31:46 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct OpenGLSurface : OpenGLTexture {
|
|
|
|
GLuint program = 0;
|
|
|
|
GLuint framebuffer = 0;
|
2013-04-14 08:52:47 +00:00
|
|
|
GLuint vao = 0;
|
|
|
|
GLuint vbo[3] = {0, 0, 0};
|
2013-04-09 13:31:46 +00:00
|
|
|
GLuint vertex = 0;
|
|
|
|
GLuint geometry = 0;
|
|
|
|
GLuint fragment = 0;
|
2013-05-02 11:25:45 +00:00
|
|
|
uint32_t* buffer = nullptr;
|
2013-04-09 13:31:46 +00:00
|
|
|
|
2013-04-14 08:52:47 +00:00
|
|
|
void allocate();
|
2013-04-09 13:31:46 +00:00
|
|
|
void size(unsigned width, unsigned height);
|
|
|
|
void release();
|
2013-04-14 08:52:47 +00:00
|
|
|
void render(unsigned sourceWidth, unsigned sourceHeight, unsigned targetWidth, unsigned targetHeight);
|
2013-04-09 13:31:46 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct OpenGLProgram : OpenGLSurface {
|
|
|
|
unsigned phase = 0; //frame counter
|
|
|
|
unsigned modulo = 0; //frame counter modulus
|
|
|
|
unsigned absoluteWidth = 0;
|
|
|
|
unsigned absoluteHeight = 0;
|
|
|
|
double relativeWidth = 0;
|
|
|
|
double relativeHeight = 0;
|
2013-04-14 08:52:47 +00:00
|
|
|
vector<OpenGLTexture> pixmaps;
|
2013-04-09 13:31:46 +00:00
|
|
|
|
2013-05-02 11:25:45 +00:00
|
|
|
void bind(OpenGL* instance, const Markup::Node& node, const string& pathname);
|
Update to v093r02 release.
byuu says:
Changelog:
- nall: fixed major memory leak in string class
- ruby: video shaders support #define-based settings now
- phoenix/GTK+: support > 256x256 icons for window / task bar / alt-tab
- sfc: remove random/ and config/, merge into system/
- ethos: delete higan.png (48x48), replace with higan512.png (512x512)
as new higan.png
- ethos: default gamma to 100% (no color adjustment)
- ethos: use "Video Shaders/Display Emulation/" instead of "Video
Shaders/Emulation/"
- use g++ instead of g++-4.7 (g++ -v must be >= 4.7)
- use -std=c++11 instead of -std=gnu++11
- applied a few patches from Debian upstream to make their packaging job
easier
So because colors are normalized in GLSL, I won't be able to offer video
shaders absolute color literals. We will have to perform basic color
conversion inside the core.
As such, the current plan is to create some sort of Emulator::Settings
interface. With that, I'll connect an option for color correction, which
will be on by default. For FC/SFC, that will mean gamma correction
(darker / stronger colors), and for GB/GBC/GBA, it will mean simulating
the weird brightness levels of the displays. I am undecided on whether
to use pea soup green for the GB or not. By not doing so, it'll be
easier for the display emulation shader to do it.
2013-11-09 11:45:54 +00:00
|
|
|
void parse(OpenGL* instance, string& source);
|
2013-04-09 13:31:46 +00:00
|
|
|
void release();
|
|
|
|
};
|
|
|
|
|
|
|
|
struct OpenGL : OpenGLProgram {
|
|
|
|
vector<OpenGLProgram> programs;
|
2014-01-05 09:59:17 +00:00
|
|
|
vector<OpenGLTexture> history;
|
2014-01-13 09:35:46 +00:00
|
|
|
GLuint inputFormat = GL_RGBA8;
|
2013-04-09 13:31:46 +00:00
|
|
|
unsigned outputWidth = 0;
|
|
|
|
unsigned outputHeight = 0;
|
Update to v093r02 release.
byuu says:
Changelog:
- nall: fixed major memory leak in string class
- ruby: video shaders support #define-based settings now
- phoenix/GTK+: support > 256x256 icons for window / task bar / alt-tab
- sfc: remove random/ and config/, merge into system/
- ethos: delete higan.png (48x48), replace with higan512.png (512x512)
as new higan.png
- ethos: default gamma to 100% (no color adjustment)
- ethos: use "Video Shaders/Display Emulation/" instead of "Video
Shaders/Emulation/"
- use g++ instead of g++-4.7 (g++ -v must be >= 4.7)
- use -std=c++11 instead of -std=gnu++11
- applied a few patches from Debian upstream to make their packaging job
easier
So because colors are normalized in GLSL, I won't be able to offer video
shaders absolute color literals. We will have to perform basic color
conversion inside the core.
As such, the current plan is to create some sort of Emulator::Settings
interface. With that, I'll connect an option for color correction, which
will be on by default. For FC/SFC, that will mean gamma correction
(darker / stronger colors), and for GB/GBC/GBA, it will mean simulating
the weird brightness levels of the displays. I am undecided on whether
to use pea soup green for the GB or not. By not doing so, it'll be
easier for the display emulation shader to do it.
2013-11-09 11:45:54 +00:00
|
|
|
struct Setting {
|
|
|
|
string name;
|
|
|
|
string value;
|
|
|
|
bool operator< (const Setting& source) { return name < source.name; }
|
|
|
|
bool operator==(const Setting& source) { return name == source.name; }
|
|
|
|
Setting() {}
|
|
|
|
Setting(const string& name) : name(name) {}
|
|
|
|
Setting(const string& name, const string& value) : name(name), value(value) {}
|
|
|
|
};
|
|
|
|
set<Setting> settings;
|
2014-01-28 10:04:58 +00:00
|
|
|
bool initialized = false;
|
Update to v093r02 release.
byuu says:
Changelog:
- nall: fixed major memory leak in string class
- ruby: video shaders support #define-based settings now
- phoenix/GTK+: support > 256x256 icons for window / task bar / alt-tab
- sfc: remove random/ and config/, merge into system/
- ethos: delete higan.png (48x48), replace with higan512.png (512x512)
as new higan.png
- ethos: default gamma to 100% (no color adjustment)
- ethos: use "Video Shaders/Display Emulation/" instead of "Video
Shaders/Emulation/"
- use g++ instead of g++-4.7 (g++ -v must be >= 4.7)
- use -std=c++11 instead of -std=gnu++11
- applied a few patches from Debian upstream to make their packaging job
easier
So because colors are normalized in GLSL, I won't be able to offer video
shaders absolute color literals. We will have to perform basic color
conversion inside the core.
As such, the current plan is to create some sort of Emulator::Settings
interface. With that, I'll connect an option for color correction, which
will be on by default. For FC/SFC, that will mean gamma correction
(darker / stronger colors), and for GB/GBC/GBA, it will mean simulating
the weird brightness levels of the displays. I am undecided on whether
to use pea soup green for the GB or not. By not doing so, it'll be
easier for the display emulation shader to do it.
2013-11-09 11:45:54 +00:00
|
|
|
|
2013-05-02 11:25:45 +00:00
|
|
|
void shader(const char* pathname);
|
2014-01-05 09:59:17 +00:00
|
|
|
void allocateHistory(unsigned size);
|
2013-05-02 11:25:45 +00:00
|
|
|
bool lock(uint32_t*& data, unsigned& pitch);
|
2013-04-09 13:31:46 +00:00
|
|
|
void clear();
|
|
|
|
void refresh();
|
|
|
|
bool init();
|
|
|
|
void term();
|
|
|
|
};
|
|
|
|
|
2014-01-05 09:59:17 +00:00
|
|
|
#include "texture.hpp"
|
2013-04-09 13:31:46 +00:00
|
|
|
#include "surface.hpp"
|
|
|
|
#include "program.hpp"
|
|
|
|
#include "main.hpp"
|
|
|
|
|
|
|
|
}
|