2010-08-09 13:28:56 +00:00
|
|
|
#ifndef NALL_ENDIAN_HPP
|
|
|
|
#define NALL_ENDIAN_HPP
|
|
|
|
|
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 03:22:54 +00:00
|
|
|
#include <nall/intrinsics.hpp>
|
|
|
|
|
|
|
|
#if defined(ENDIAN_LSB)
|
2010-08-09 13:28:56 +00:00
|
|
|
//little-endian: uint8_t[] { 0x01, 0x02, 0x03, 0x04 } == 0x04030201
|
|
|
|
#define order_lsb2(a,b) a,b
|
|
|
|
#define order_lsb3(a,b,c) a,b,c
|
|
|
|
#define order_lsb4(a,b,c,d) a,b,c,d
|
|
|
|
#define order_lsb5(a,b,c,d,e) a,b,c,d,e
|
|
|
|
#define order_lsb6(a,b,c,d,e,f) a,b,c,d,e,f
|
|
|
|
#define order_lsb7(a,b,c,d,e,f,g) a,b,c,d,e,f,g
|
|
|
|
#define order_lsb8(a,b,c,d,e,f,g,h) a,b,c,d,e,f,g,h
|
|
|
|
#define order_msb2(a,b) b,a
|
|
|
|
#define order_msb3(a,b,c) c,b,a
|
|
|
|
#define order_msb4(a,b,c,d) d,c,b,a
|
|
|
|
#define order_msb5(a,b,c,d,e) e,d,c,b,a
|
|
|
|
#define order_msb6(a,b,c,d,e,f) f,e,d,c,b,a
|
|
|
|
#define order_msb7(a,b,c,d,e,f,g) g,f,e,d,c,b,a
|
|
|
|
#define order_msb8(a,b,c,d,e,f,g,h) h,g,f,e,d,c,b,a
|
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 03:22:54 +00:00
|
|
|
#elif defined(ENDIAN_MSB)
|
2010-08-09 13:28:56 +00:00
|
|
|
//big-endian: uint8_t[] { 0x01, 0x02, 0x03, 0x04 } == 0x01020304
|
|
|
|
#define order_lsb2(a,b) b,a
|
|
|
|
#define order_lsb3(a,b,c) c,b,a
|
|
|
|
#define order_lsb4(a,b,c,d) d,c,b,a
|
|
|
|
#define order_lsb5(a,b,c,d,e) e,d,c,b,a
|
|
|
|
#define order_lsb6(a,b,c,d,e,f) f,e,d,c,b,a
|
|
|
|
#define order_lsb7(a,b,c,d,e,f,g) g,f,e,d,c,b,a
|
|
|
|
#define order_lsb8(a,b,c,d,e,f,g,h) h,g,f,e,d,c,b,a
|
|
|
|
#define order_msb2(a,b) a,b
|
|
|
|
#define order_msb3(a,b,c) a,b,c
|
|
|
|
#define order_msb4(a,b,c,d) a,b,c,d
|
|
|
|
#define order_msb5(a,b,c,d,e) a,b,c,d,e
|
|
|
|
#define order_msb6(a,b,c,d,e,f) a,b,c,d,e,f
|
|
|
|
#define order_msb7(a,b,c,d,e,f,g) a,b,c,d,e,f,g
|
|
|
|
#define order_msb8(a,b,c,d,e,f,g,h) a,b,c,d,e,f,g,h
|
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 03:22:54 +00:00
|
|
|
#else
|
|
|
|
#error "Unknown endian. Please specify in nall/intrinsics.hpp"
|
2010-08-09 13:28:56 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|