2016-01-07 08:14:33 +00:00
|
|
|
#pragma once
|
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
|
|
|
|
2014-01-13 09:35:46 +00:00
|
|
|
#include <algorithm>
|
|
|
|
|
2018-10-04 10:11:23 +00:00
|
|
|
#include <nall/file-map.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/interpolation.hpp>
|
|
|
|
#include <nall/stdint.hpp>
|
2015-08-02 06:23:13 +00:00
|
|
|
#include <nall/decode/bmp.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 10:10:46 +00:00
|
|
|
#include <nall/decode/png.hpp>
|
2018-08-04 11:44:00 +00:00
|
|
|
|
|
|
|
namespace nall {
|
|
|
|
|
|
|
|
struct image {
|
|
|
|
enum class blend : uint {
|
|
|
|
add,
|
|
|
|
sourceAlpha, //color = sourceColor * sourceAlpha + targetColor * (1 - sourceAlpha)
|
|
|
|
sourceColor, //color = sourceColor
|
|
|
|
targetAlpha, //color = targetColor * targetAlpha + sourceColor * (1 - targetAlpha)
|
|
|
|
targetColor, //color = targetColor
|
|
|
|
};
|
|
|
|
|
|
|
|
struct channel {
|
|
|
|
channel(uint64_t mask, uint depth, uint shift) : _mask(mask), _depth(depth), _shift(shift) {
|
|
|
|
}
|
|
|
|
|
|
|
|
auto operator==(const channel& source) const -> bool {
|
|
|
|
return _mask == source._mask && _depth == source._depth && _shift == source._shift;
|
|
|
|
}
|
|
|
|
|
|
|
|
auto operator!=(const channel& source) const -> bool {
|
|
|
|
return !operator==(source);
|
|
|
|
}
|
|
|
|
|
|
|
|
alwaysinline auto mask() const { return _mask; }
|
|
|
|
alwaysinline auto depth() const { return _depth; }
|
|
|
|
alwaysinline auto shift() const { return _shift; }
|
|
|
|
|
|
|
|
private:
|
|
|
|
uint64_t _mask;
|
|
|
|
uint _depth;
|
|
|
|
uint _shift;
|
|
|
|
};
|
|
|
|
|
|
|
|
//core.hpp
|
|
|
|
inline image(const image& source);
|
|
|
|
inline image(image&& source);
|
|
|
|
inline image(bool endian, uint depth, uint64_t alphaMask, uint64_t redMask, uint64_t greenMask, uint64_t blueMask);
|
|
|
|
inline image(const string& filename);
|
2018-08-05 09:00:15 +00:00
|
|
|
inline image(const void* data, uint size);
|
2018-08-04 11:44:00 +00:00
|
|
|
inline image(const vector<uint8_t>& buffer);
|
Update to v106r57 release.
byuu says:
I've added tool tips to hiro for Windows, GTK, and Qt. I'm unsure how to
add them for Cocoa. I wasted am embarrassing ~14 hours implementing tool
tips from scratch on Windows, because the `TOOLTIPS_CLASS` widget just
absolutely refused to show up, no matter what I tried. As such, they're
not quite 100% native, but I would really appreciate any patch
submissions to help improve my implementation.
I added tool tips to all of the confusing settings in bsnes. And of
course, for those of you who don't like them, there's a configuration
file setting to turn them off globally.
I also improved Mega Drive handling of the Game Genie a bit, and
restructured the way the Settings class works in bsnes.
Starting now, I'm feature-freezing bsnes and higan. From this point
forward:
- polishing up and fixing bugs caused by the ruby/hiro changes
- adding DRC to XAudio2, and maybe exclusive mode to WGL
- correcting FEoEZ (English) to load and work again out of the box
Once that's done, a final beta of bsnes will go out, I'll fix any
reported bugs that I'm able to, and then v107 should be ready. This time
with higan being functional, but marked as v107 beta. v108 will restore
higan to production status again, alongside bsnes.
2018-08-08 08:46:58 +00:00
|
|
|
template<uint Size> inline image(const uint8_t (&Name)[Size]);
|
2018-08-04 11:44:00 +00:00
|
|
|
inline image();
|
|
|
|
inline ~image();
|
|
|
|
|
|
|
|
inline auto operator=(const image& source) -> image&;
|
|
|
|
inline auto operator=(image&& source) -> image&;
|
|
|
|
|
|
|
|
inline explicit operator bool() const;
|
|
|
|
inline auto operator==(const image& source) const -> bool;
|
|
|
|
inline auto operator!=(const image& source) const -> bool;
|
|
|
|
|
|
|
|
inline auto read(const uint8_t* data) const -> uint64_t;
|
|
|
|
inline auto write(uint8_t* data, uint64_t value) const -> void;
|
|
|
|
|
|
|
|
inline auto free() -> void;
|
|
|
|
inline auto load(const string& filename) -> bool;
|
2018-08-06 07:46:00 +00:00
|
|
|
inline auto copy(const void* data, uint pitch, uint width, uint height) -> void;
|
2018-08-04 11:44:00 +00:00
|
|
|
inline auto allocate(uint width, uint height) -> void;
|
|
|
|
|
|
|
|
//fill.hpp
|
|
|
|
inline auto fill(uint64_t color = 0) -> void;
|
|
|
|
inline auto gradient(uint64_t a, uint64_t b, uint64_t c, uint64_t d) -> void;
|
|
|
|
inline auto gradient(uint64_t a, uint64_t b, int radiusX, int radiusY, int centerX, int centerY, function<double (double, double)> callback) -> void;
|
|
|
|
inline auto crossGradient(uint64_t a, uint64_t b, int radiusX, int radiusY, int centerX, int centerY) -> void;
|
|
|
|
inline auto diamondGradient(uint64_t a, uint64_t b, int radiusX, int radiusY, int centerX, int centerY) -> void;
|
|
|
|
inline auto horizontalGradient(uint64_t a, uint64_t b, int radiusX, int radiusY, int centerX, int centerY) -> void;
|
|
|
|
inline auto radialGradient(uint64_t a, uint64_t b, int radiusX, int radiusY, int centerX, int centerY) -> void;
|
|
|
|
inline auto sphericalGradient(uint64_t a, uint64_t b, int radiusX, int radiusY, int centerX, int centerY) -> void;
|
|
|
|
inline auto squareGradient(uint64_t a, uint64_t b, int radiusX, int radiusY, int centerX, int centerY) -> void;
|
|
|
|
inline auto verticalGradient(uint64_t a, uint64_t b, int radiusX, int radiusY, int centerX, int centerY) -> void;
|
|
|
|
|
|
|
|
//scale.hpp
|
|
|
|
inline auto scale(uint width, uint height, bool linear = true) -> void;
|
|
|
|
|
|
|
|
//blend.hpp
|
|
|
|
inline auto impose(blend mode, uint targetX, uint targetY, image source, uint x, uint y, uint width, uint height) -> void;
|
|
|
|
|
|
|
|
//utility.hpp
|
Update to bsnes v107.1 release.
byuu says:
Don't let the point release fool you, there are many significant changes in this
release. I will be keeping bsnes releases using a point system until the new
higan release is ready.
Changelog:
- GUI: added high DPI support
- GUI: fixed the state manager image preview
- Windows: added a new waveOut driver with support for dynamic rate control
- Windows: corrected the XAudio 2.1 dynamic rate control support [BearOso]
- Windows: corrected the Direct3D 9.0 fullscreen exclusive window centering
- Windows: fixed XInput controller support on Windows 10
- SFC: added high-level emulation for the DSP1, DSP2, DSP4, ST010, and Cx4
coprocessors
- SFC: fixed a slight rendering glitch in the intro to Megalomania
If the coprocessor firmware is missing, bsnes will fallback on HLE where it is
supported, which is everything other than SD Gundam GX and the two Hayazashi
Nidan Morita Shougi games.
The Windows dynamic rate control works best with Direct3D in fullscreen
exclusive mode. I recommend the waveOut driver over the XAudio 2.1 driver, as it
is not possible to target a single XAudio2 version on all Windows OS releases.
The waveOut driver should work everywhere out of the box.
Note that with DRC, the synchronization source is your monitor, so you will
want to be running at 60hz (NTSC) or 50hz (PAL). If you have an adaptive sync
monitor, you should instead use the WASAPI (exclusive) or ASIO audio driver.
2019-04-09 01:16:30 +00:00
|
|
|
inline auto shrink(uint64_t transparentColor = 0) -> void;
|
2018-08-04 11:44:00 +00:00
|
|
|
inline auto crop(uint x, uint y, uint width, uint height) -> bool;
|
|
|
|
inline auto alphaBlend(uint64_t alphaColor) -> void;
|
|
|
|
inline auto alphaMultiply() -> void;
|
|
|
|
inline auto transform(const image& source = {}) -> void;
|
|
|
|
inline auto transform(bool endian, uint depth, uint64_t alphaMask, uint64_t redMask, uint64_t greenMask, uint64_t blueMask) -> void;
|
|
|
|
|
|
|
|
//static.hpp
|
|
|
|
static inline auto bitDepth(uint64_t color) -> uint;
|
|
|
|
static inline auto bitShift(uint64_t color) -> uint;
|
|
|
|
static inline auto normalize(uint64_t color, uint sourceDepth, uint targetDepth) -> uint64_t;
|
|
|
|
|
|
|
|
//access
|
|
|
|
alwaysinline auto data() { return _data; }
|
|
|
|
alwaysinline auto data() const { return _data; }
|
|
|
|
alwaysinline auto width() const { return _width; }
|
|
|
|
alwaysinline auto height() const { return _height; }
|
|
|
|
|
|
|
|
alwaysinline auto endian() const { return _endian; }
|
|
|
|
alwaysinline auto depth() const { return _depth; }
|
|
|
|
alwaysinline auto stride() const { return (_depth + 7) >> 3; }
|
|
|
|
|
|
|
|
alwaysinline auto pitch() const { return _width * stride(); }
|
|
|
|
alwaysinline auto size() const { return _height * pitch(); }
|
|
|
|
|
|
|
|
alwaysinline auto alpha() const { return _alpha; }
|
|
|
|
alwaysinline auto red() const { return _red; }
|
|
|
|
alwaysinline auto green() const { return _green; }
|
|
|
|
alwaysinline auto blue() const { return _blue; }
|
|
|
|
|
|
|
|
private:
|
|
|
|
//core.hpp
|
|
|
|
inline auto allocate(uint width, uint height, uint stride) -> uint8_t*;
|
|
|
|
|
|
|
|
//scale.hpp
|
|
|
|
inline auto scaleLinearWidth(uint width) -> void;
|
|
|
|
inline auto scaleLinearHeight(uint height) -> void;
|
|
|
|
inline auto scaleLinear(uint width, uint height) -> void;
|
|
|
|
inline auto scaleNearest(uint width, uint height) -> void;
|
|
|
|
|
|
|
|
//load.hpp
|
|
|
|
inline auto loadBMP(const string& filename) -> bool;
|
|
|
|
inline auto loadBMP(const uint8_t* data, uint size) -> bool;
|
|
|
|
inline auto loadPNG(const string& filename) -> bool;
|
|
|
|
inline auto loadPNG(const uint8_t* data, uint size) -> bool;
|
|
|
|
|
|
|
|
//interpolation.hpp
|
|
|
|
alwaysinline auto isplit(uint64_t* component, uint64_t color) -> void;
|
|
|
|
alwaysinline auto imerge(const uint64_t* component) -> uint64_t;
|
|
|
|
alwaysinline auto interpolate1f(uint64_t a, uint64_t b, double x) -> uint64_t;
|
|
|
|
alwaysinline auto interpolate1f(uint64_t a, uint64_t b, uint64_t c, uint64_t d, double x, double y) -> uint64_t;
|
|
|
|
alwaysinline auto interpolate1i(int64_t a, int64_t b, uint32_t x) -> uint64_t;
|
|
|
|
alwaysinline auto interpolate1i(int64_t a, int64_t b, int64_t c, int64_t d, uint32_t x, uint32_t y) -> uint64_t;
|
|
|
|
inline auto interpolate4f(uint64_t a, uint64_t b, double x) -> uint64_t;
|
|
|
|
inline auto interpolate4f(uint64_t a, uint64_t b, uint64_t c, uint64_t d, double x, double y) -> uint64_t;
|
|
|
|
inline auto interpolate4i(uint64_t a, uint64_t b, uint32_t x) -> uint64_t;
|
|
|
|
inline auto interpolate4i(uint64_t a, uint64_t b, uint64_t c, uint64_t d, uint32_t x, uint32_t y) -> uint64_t;
|
|
|
|
|
|
|
|
uint8_t* _data = nullptr;
|
|
|
|
uint _width = 0;
|
|
|
|
uint _height = 0;
|
|
|
|
|
|
|
|
bool _endian = 0; //0 = lsb, 1 = msb
|
|
|
|
uint _depth = 32;
|
|
|
|
|
|
|
|
channel _alpha{255u << 24, 8, 24};
|
|
|
|
channel _red {255u << 16, 8, 16};
|
|
|
|
channel _green{255u << 8, 8, 8};
|
|
|
|
channel _blue {255u << 0, 8, 0};
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2014-01-13 09:35:46 +00:00
|
|
|
#include <nall/image/static.hpp>
|
|
|
|
#include <nall/image/core.hpp>
|
|
|
|
#include <nall/image/load.hpp>
|
|
|
|
#include <nall/image/interpolation.hpp>
|
|
|
|
#include <nall/image/fill.hpp>
|
|
|
|
#include <nall/image/scale.hpp>
|
|
|
|
#include <nall/image/blend.hpp>
|
|
|
|
#include <nall/image/utility.hpp>
|