2010-10-26 12:01:41 +00:00
|
|
|
#include <nall/platform.hpp>
|
|
|
|
#include <nall/stdint.hpp>
|
|
|
|
using namespace nall;
|
|
|
|
|
|
|
|
extern "C" {
|
|
|
|
void filter_size(unsigned&, unsigned&);
|
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
|
|
|
void filter_render(uint32_t*, unsigned, const uint32_t*, unsigned, unsigned, unsigned);
|
2010-10-26 12:01:41 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
dllexport void filter_size(unsigned &width, unsigned &height) {
|
|
|
|
height *= 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
dllexport void filter_render(
|
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
|
|
|
uint32_t *output, unsigned outputPitch,
|
|
|
|
const uint32_t *input, unsigned inputPitch,
|
2011-09-22 00:03:11 +00:00
|
|
|
unsigned width, unsigned height
|
2010-10-26 12:01:41 +00: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 03:22:54 +00:00
|
|
|
enum : unsigned { Mask = (1022 << 20) | (1022 << 10) | (1022 << 0) };
|
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
|
|
|
outputPitch >>= 2, inputPitch >>= 2;
|
2010-10-26 12:01:41 +00:00
|
|
|
|
2011-09-22 00:03:11 +00:00
|
|
|
#pragma omp parallel for
|
2010-10-26 12:01:41 +00:00
|
|
|
for(unsigned y = 0; y < height; y++) {
|
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
|
|
|
const uint32_t *in = input + y * inputPitch;
|
|
|
|
uint32_t *out0 = output + y * outputPitch * 2;
|
|
|
|
uint32_t *out1 = output + y * outputPitch * 2 + outputPitch;
|
2010-10-26 12:01:41 +00:00
|
|
|
|
|
|
|
for(unsigned x = 0; x < width; x++) {
|
2011-09-22 00:03:11 +00:00
|
|
|
*out0++ = *in;
|
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
|
|
|
*out1++ = (*in++ & Mask) >> 1;
|
2010-10-26 12:01:41 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|