Update to v077 release.

byuu says:

Changelog (since v076):
- video filters and shaders now populate inside main menu; no longer
  have to select them as files
- fixed 2xSaI, Super 2xSaI and Super Eagle on 32-bit platforms; still
  buggy on 64-bit Windows
- fixed linear mirroring issues (fixes Mega Man X dash bug)
- fixed RAM memory mapping bug in Sufami Turbo games
- home folder is now %APPDATA%/bsnes or ~/.config/bsnes
- added paths.cfg file, which will allow you to specify custom paths for
  any file types
- save states and cheat files for multi-slot games are based on slot
  names instead of BIOS names
- fixed compilation warning on OS X with nall::decimal
- fixed calculation bug in nall::fp
- Makefile now has options variable, example: make options=debugger
- configuration files and cheat database can now reside in the same
  folder as the binary itself
- updated to 2011-03-11 release of mightymo's cheat database
This commit is contained in:
Tim Allen 2011-03-17 23:49:46 +11:00
parent 348bace8ed
commit 9ea35ce569
38 changed files with 3527 additions and 3351 deletions

View File

@ -1,7 +1,7 @@
include nall/Makefile
snes := snes
gameboy := gameboy
profile := compatibility
profile := accuracy
ui := ui
# debugger

File diff suppressed because it is too large Load Diff

View File

@ -41,14 +41,14 @@ struct directory {
if(handle != INVALID_HANDLE_VALUE) {
if(wcscmp(data.cFileName, L".") && wcscmp(data.cFileName, L"..")) {
if(data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
string name = utf8_t(data.cFileName);
string name = (const char*)utf8_t(data.cFileName);
if(wildcard(name, pattern)) list.append(string(name, "/"));
}
}
while(FindNextFile(handle, &data) != false) {
if(wcscmp(data.cFileName, L".") && wcscmp(data.cFileName, L"..")) {
if(data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
string name = utf8_t(data.cFileName);
string name = (const char*)utf8_t(data.cFileName);
if(wildcard(name, pattern)) list.append(string(name, "/"));
}
}
@ -70,12 +70,12 @@ struct directory {
handle = FindFirstFile(utf16_t(path), &data);
if(handle != INVALID_HANDLE_VALUE) {
if((data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0) {
string name = utf8_t(data.cFileName);
string name = (const char*)utf8_t(data.cFileName);
if(wildcard(name, pattern)) list.append(name);
}
while(FindNextFile(handle, &data) != false) {
if((data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0) {
string name = utf8_t(data.cFileName);
string name = (const char*)utf8_t(data.cFileName);
if(wildcard(name, pattern)) list.append(name);
}
}

View File

@ -6,8 +6,8 @@ namespace nall {
//this is needed, as C++0x does not support explicit template specialization inside classes
template<> inline const char* to_string<bool> (bool v) { return v ? "true" : "false"; }
template<> inline const char* to_string<signed int> (signed int v) { static char temp[256]; snprintf(temp, 255, "%+d", v); return temp; }
template<> inline const char* to_string<unsigned int> (unsigned int v) { static char temp[256]; snprintf(temp, 255, "%u", v); return temp; }
template<> inline const char* to_string<double> (double v) { static char temp[256]; snprintf(temp, 255, "%f", v); return temp; }
template<> inline const char* to_string<unsigned int> (unsigned int v) { static char temp[256]; snprintf(temp, 255, "%u", v); return temp; }
template<> inline const char* to_string<double> (double v) { static char temp[256]; snprintf(temp, 255, "%f", v); return temp; }
template<> inline const char* to_string<char*> (char *v) { return v; }
template<> inline const char* to_string<const char*> (const char *v) { return v; }
template<> inline const char* to_string<string> (string v) { return v; }

View File

@ -13,7 +13,7 @@ string pLineEdit::text() {
wchar_t text[length + 1];
GetWindowText(hwnd, text, length + 1);
text[length] = 0;
return utf8_t(text);
return (const char*)utf8_t(text);
}
void pLineEdit::constructor() {

View File

@ -29,7 +29,7 @@ string pTextEdit::text() {
wchar_t buffer[length + 1];
GetWindowText(hwnd, buffer, length + 1);
buffer[length] = 0;
string text = utf8_t(buffer);
string text = (const char*)utf8_t(buffer);
text.replace("\r", "");
return text;
}

View File

@ -80,7 +80,7 @@ static string pOS_fileDialog(bool save, Window &parent, const string &path, cons
bool result = (save == false ? GetOpenFileName(&ofn) : GetSaveFileName(&ofn));
if(result == false) return "";
string name = utf8_t(wfilename);
string name = (const char*)utf8_t(wfilename);
name.transform("\\", "/");
return name;
}
@ -117,7 +117,7 @@ string pOS::folderSelect(Window &parent, const string &path) {
}
}
if(result == false) return "";
string name = utf8_t(wfilename);
string name = (const char*)utf8_t(wfilename);
if(name == "") return "";
name.transform("\\", "/");
if(name.endswith("/") == false) name.append("/");

View File

@ -342,7 +342,7 @@ public:
//per MSDN: XInput devices have "IG_" in their device strings,
//which is how they should be identified.
string p = utf8_t(pool[i].name);
string p = (const char*)utf8_t(pool[i].name);
if(auto position = strpos(p, "IG_")) {
lgamepad[n].isXInputDevice = true;
} else {

View File

@ -1,7 +1,7 @@
namespace SNES {
namespace Info {
static const char Name[] = "bsnes";
static const char Version[] = "076.07";
static const char Version[] = "077";
static const unsigned SerializerVersion = 18;
}
}

View File

@ -21,12 +21,12 @@ dllexport void filter_render(
const uint16_t *input, unsigned pitch, unsigned width, unsigned height
) {
for(unsigned y = 0; y < height; y++) {
const uint16_t *line_in = (const uint16_t *) (((const uint8_t*)input) + pitch * y);
const uint16_t *line_in = (const uint16_t*)(((const uint8_t*)input) + pitch * y);
uint32_t *line_out = temp + y * width;
for(unsigned x = 0; x < width; x++) {
line_out[x] = colortable[line_in[x]];
}
}
_2xSaI32( (unsigned char *) temp, 2048, 0, (unsigned char *) output, outpitch, width, height );
_2xSaI32((unsigned char*)temp, 1024, 0, (unsigned char*)output, outpitch, width, height);
}

View File

@ -21,12 +21,12 @@ dllexport void filter_render(
const uint16_t *input, unsigned pitch, unsigned width, unsigned height
) {
for(unsigned y = 0; y < height; y++) {
const uint16_t *line_in = (const uint16_t *) (((const uint8_t*)input) + pitch * y);
const uint16_t *line_in = (const uint16_t*)(((const uint8_t*)input) + pitch * y);
uint32_t *line_out = temp + y * width;
for(unsigned x = 0; x < width; x++) {
line_out[x] = colortable[line_in[x]];
}
}
Super2xSaI32( (unsigned char *) temp, 2048, 0, (unsigned char *) output, outpitch, width, height );
Super2xSaI32((unsigned char*)temp, 1024, 0, (unsigned char*)output, outpitch, width, height);
}

View File

@ -21,12 +21,12 @@ dllexport void filter_render(
const uint16_t *input, unsigned pitch, unsigned width, unsigned height
) {
for(unsigned y = 0; y < height; y++) {
const uint16_t *line_in = (const uint16_t *) (((const uint8_t*)input) + pitch * y);
const uint16_t *line_in = (const uint16_t*)(((const uint8_t*)input) + pitch * y);
uint32_t *line_out = temp + y * width;
for(unsigned x = 0; x < width; x++) {
line_out[x] = colortable[line_in[x]];
}
}
SuperEagle32( (unsigned char *) temp, 2048, 0, (unsigned char *) output, outpitch, width, height );
SuperEagle32((unsigned char*)temp, 1024, 0, (unsigned char*)output, outpitch, width, height);
}

View File

@ -2,25 +2,24 @@ include nall/Makefile
c := $(compiler) -std=gnu99
cpp := $(subst cc,++,$(compiler)) -std=gnu++0x
flags := -O3 -I. -Iobj -fomit-frame-pointer
flags := -fPIC -O3 -I. -Iobj -fomit-frame-pointer
link := -s
objects :=
objects += out/pixellate2x.filter
objects += out/scanline-00.filter
objects += out/scanline-25.filter
objects += out/scanline-50.filter
objects += out/scanline-75.filter
objects += out/scale2x.filter
objects += out/2xsai.filter
objects += out/super-2xsai.filter
objects += out/super-eagle.filter
objects += out/lq2x.filter
objects += out/hq2x.filter
objects += out/ntsc-rf.filter
objects += out/ntsc-composite.filter
objects += out/ntsc-svideo.filter
objects += out/ntsc-rgb.filter
objects += out/Pixellate2x.filter
objects += out/Scanline-Black.filter
objects += out/Scanline-Dark.filter
objects += out/Scanline-Light.filter
objects += out/Scale2x.filter
objects += out/2xSaI.filter
objects += out/Super-2xSaI.filter
objects += out/Super-Eagle.filter
objects += out/LQ2x.filter
objects += out/HQ2x.filter
objects += out/NTSC-RF.filter
objects += out/NTSC-Composite.filter
objects += out/NTSC-SVideo.filter
objects += out/NTSC-RGB.filter
compile = $(cpp) $(link) $(flags) -o $@ -shared $<
@ -28,24 +27,27 @@ compile = $(cpp) $(link) $(flags) -o $@ -shared $<
all: build;
out/pixellate2x.filter: pixellate2x/pixellate2x.cpp pixellate2x/*
out/scanline-00.filter: scanline/scanline-00.cpp scanline/*
out/scanline-25.filter: scanline/scanline-25.cpp scanline/*
out/scanline-50.filter: scanline/scanline-50.cpp scanline/*
out/scanline-75.filter: scanline/scanline-75.cpp scanline/*
out/scale2x.filter: scale2x/scale2x.cpp scale2x/*
out/2xsai.filter: 2xsai/2xsai.cpp 2xsai/*
out/super-2xsai.filter: 2xsai/super-2xsai.cpp 2xsai/*
out/super-eagle.filter: 2xsai/super-eagle.cpp 2xsai/*
out/lq2x.filter: lq2x/lq2x.cpp lq2x/*
out/hq2x.filter: hq2x/hq2x.cpp hq2x/*
out/ntsc-rf.filter: ntsc/ntsc-rf.cpp ntsc/*
out/ntsc-composite.filter: ntsc/ntsc-composite.cpp ntsc/*
out/ntsc-svideo.filter: ntsc/ntsc-svideo.cpp ntsc/*
out/ntsc-rgb.filter: ntsc/ntsc-rgb.cpp ntsc/*
out/Pixellate2x.filter: Pixellate2x/Pixellate2x.cpp Pixellate2x/*
out/Scanline-Black.filter: Scanline/Scanline-Black.cpp Scanline/*
out/Scanline-Dark.filter: Scanline/Scanline-Dark.cpp Scanline/*
out/Scanline-Light.filter: Scanline/Scanline-Light.cpp Scanline/*
out/Scale2x.filter: Scale2x/Scale2x.cpp Scale2x/*
out/2xSaI.filter: 2xSaI/2xSaI.cpp 2xSaI/*
out/Super-2xSaI.filter: 2xSaI/Super-2xSaI.cpp 2xSaI/*
out/Super-Eagle.filter: 2xSaI/Super-Eagle.cpp 2xSaI/*
out/LQ2x.filter: LQ2x/LQ2x.cpp LQ2x/*
out/HQ2x.filter: HQ2x/HQ2x.cpp HQ2x/*
out/NTSC-RF.filter: NTSC/NTSC-RF.cpp NTSC/*
out/NTSC-Composite.filter: NTSC/NTSC-Composite.cpp NTSC/*
out/NTSC-SVideo.filter: NTSC/NTSC-SVideo.cpp NTSC/*
out/NTSC-RGB.filter: NTSC/NTSC-RGB.cpp NTSC/*
build: $(objects)
install:
mkdir -p ~/.config/bsnes/filters
chmod 777 ~/.config/bsnes/filters
cp out/*.filter ~/.config/bsnes/filters
clean:
rm out/*.filter

View File

@ -18,9 +18,9 @@ void initialize() {
uint8_t r = (i >> 10) & 31;
uint8_t g = (i >> 5) & 31;
uint8_t b = (i >> 0) & 31;
r *= 0.50;
g *= 0.50;
b *= 0.50;
r *= 0.333;
g *= 0.333;
b *= 0.333;
adjust[i] = (r << 10) + (g << 5) + (b << 0);
}
}

View File

@ -18,9 +18,9 @@ void initialize() {
uint8_t r = (i >> 10) & 31;
uint8_t g = (i >> 5) & 31;
uint8_t b = (i >> 0) & 31;
r *= 0.75;
g *= 0.75;
b *= 0.75;
r *= 0.666;
g *= 0.666;
b *= 0.666;
adjust[i] = (r << 10) + (g << 5) + (b << 0);
}
}

View File

@ -1,55 +0,0 @@
#include <nall/platform.hpp>
#include <nall/stdint.hpp>
using namespace nall;
extern "C" {
void filter_size(unsigned&, unsigned&);
void filter_render(uint32_t*, uint32_t*, unsigned, const uint16_t*, unsigned, unsigned, unsigned);
};
uint16_t adjust[32768];
void initialize() {
static bool initialized = false;
if(initialized == true) return;
initialized = true;
for(unsigned i = 0; i < 32768; i++) {
uint8_t r = (i >> 10) & 31;
uint8_t g = (i >> 5) & 31;
uint8_t b = (i >> 0) & 31;
r *= 0.25;
g *= 0.25;
b *= 0.25;
adjust[i] = (r << 10) + (g << 5) + (b << 0);
}
}
dllexport void filter_size(unsigned &width, unsigned &height) {
initialize();
height *= 2;
}
dllexport void filter_render(
uint32_t *palette, uint32_t *output, unsigned outpitch,
const uint16_t *input, unsigned pitch, unsigned width, unsigned height
) {
initialize();
pitch >>= 1;
outpitch >>= 2;
uint32_t *out0 = output;
uint32_t *out1 = output + outpitch;
for(unsigned y = 0; y < height; y++) {
const uint16_t *in = input + y * pitch;
uint32_t *out0 = output + y * outpitch * 2;
uint32_t *out1 = output + y * outpitch * 2 + outpitch;
for(unsigned x = 0; x < width; x++) {
uint16_t color = *in++;
*out0++ = palette[color];
*out1++ = palette[adjust[color]];
}
}
}

4
snesshader/Makefile Executable file
View File

@ -0,0 +1,4 @@
install:
mkdir -p ~/.config/bsnes/shaders
chmod 777 ~/.config/bsnes/shaders
cp *.shader ~/.config/bsnes/shaders

View File

@ -0,0 +1,65 @@
<?xml version="1.0" encoding="UTF-8"?>
<shader language="GLSL">
<vertex><![CDATA[
uniform vec2 rubyTextureSize;
void main()
{
float x = 0.5 * (1.0 / rubyTextureSize.x);
float y = 0.5 * (1.0 / rubyTextureSize.y);
vec2 dg1 = vec2( x, y);
vec2 dg2 = vec2(-x, y);
vec2 dx = vec2(x, 0.0);
vec2 dy = vec2(0.0, y);
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
gl_TexCoord[0] = gl_MultiTexCoord0;
gl_TexCoord[1].xy = gl_TexCoord[0].xy - dg1;
gl_TexCoord[1].zw = gl_TexCoord[0].xy - dy;
gl_TexCoord[2].xy = gl_TexCoord[0].xy - dg2;
gl_TexCoord[2].zw = gl_TexCoord[0].xy + dx;
gl_TexCoord[3].xy = gl_TexCoord[0].xy + dg1;
gl_TexCoord[3].zw = gl_TexCoord[0].xy + dy;
gl_TexCoord[4].xy = gl_TexCoord[0].xy + dg2;
gl_TexCoord[4].zw = gl_TexCoord[0].xy - dx;
}
]]></vertex>
<fragment><![CDATA[
vec4 compress(vec4 in_color, float threshold, float ratio)
{
vec4 diff = in_color - vec4(threshold);
diff = clamp(diff, 0.0, 100.0);
return in_color - (diff * (1.0 - 1.0/ratio));
}
uniform sampler2D rubyTexture;
uniform vec2 rubyTextureSize;
void main ()
{
vec3 c00 = texture2D(rubyTexture, gl_TexCoord[1].xy).xyz;
vec3 c01 = texture2D(rubyTexture, gl_TexCoord[4].zw).xyz;
vec3 c02 = texture2D(rubyTexture, gl_TexCoord[4].xy).xyz;
vec3 c10 = texture2D(rubyTexture, gl_TexCoord[1].zw).xyz;
vec3 c11 = texture2D(rubyTexture, gl_TexCoord[0].xy).xyz;
vec3 c12 = texture2D(rubyTexture, gl_TexCoord[3].zw).xyz;
vec3 c20 = texture2D(rubyTexture, gl_TexCoord[2].xy).xyz;
vec3 c21 = texture2D(rubyTexture, gl_TexCoord[2].zw).xyz;
vec3 c22 = texture2D(rubyTexture, gl_TexCoord[3].xy).xyz;
vec2 tex = gl_TexCoord[0].xy;
vec2 texsize = rubyTextureSize;
vec3 first = mix(c00, c20, fract(tex.x * texsize.x + 0.5));
vec3 second = mix(c02, c22, fract(tex.x * texsize.x + 0.5));
vec3 mid_horiz = mix(c01, c21, fract(tex.x * texsize.x + 0.5));
vec3 mid_vert = mix(c10, c12, fract(tex.y * texsize.y + 0.5));
vec3 res = mix(first, second, fract(tex.y * texsize.y + 0.5));
vec4 final = vec4(0.26 * (res + mid_horiz + mid_vert) + 3.5 * abs(res - mix(mid_horiz, mid_vert, 0.5)), 1.0);
gl_FragColor = compress(final, 0.8, 5.0);
}
]]></fragment>
</shader>