mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-09-03 03:42:51 +02:00
Update to v093r01 release.
byuu says: Changelog: - added SA-1 MDR; fixes bug in SD Gundam G-Next where the main battleship was unable to fire - added out-of-the-box support for any BSD running Clang 3.3+ (FreeBSD 10+, notably) - added new video shader, "Display Emulation", which changes the shader based on the emulated system - fixed the home button to go to your default library path - phoenix: Windows port won't send onActivate unless an item is selected (prevents crashing on pressing enter in file dialog) - ruby: removed vec4 position from out Vertex {} (helps AMD cards) - shaders: updated all shaders to use texture() instead of texture2D() (helps AMD cards) The "Display Emulation" option works like this: when selected, it tries to load "<path>/Video Shaders/Emulation/<systemName>.shader/"; otherwise it falls back to the blur shader. <path> is the usual (next to binary, then in <config>/higan, then in /usr/share/higan, etc); and <systemName> is "Famicom", "Super Famicom", "Game Boy", "Game Boy Color", "Game Boy Advance" To support BSD, I had to modify the $(platform) variable to differentiate between Linux and BSD. As such, the new $(platform) values are: win -> windows osx -> macosx x -> linux or bsd I am also checking uname -s instead of uname -a now. No reason to potentially match the hostname to the wrong OS type.
This commit is contained in:
@@ -153,7 +153,8 @@ public:
|
||||
//list.hpp
|
||||
struct lstring : vector<string> {
|
||||
inline optional<unsigned> find(rstring) const;
|
||||
inline string concatenate(const string&) const;
|
||||
inline string merge(const string&) const;
|
||||
inline string concatenate(const string&) const; //deprecated
|
||||
inline lstring& isort();
|
||||
inline lstring& strip();
|
||||
inline void append() {}
|
||||
|
@@ -38,7 +38,14 @@ inline string evaluateExpression(Node* node) {
|
||||
}
|
||||
|
||||
inline int64_t evaluateInteger(Node* node) {
|
||||
if(node->type == Node::Type::Literal) return nall::integer(node->literal);
|
||||
if(node->type == Node::Type::Literal) {
|
||||
if(node->literal.beginswith("0b")) return nall::binary(node->literal);
|
||||
if(node->literal.beginswith("0o")) return nall::octal(node->literal);
|
||||
if(node->literal.beginswith("0x")) return nall::hex(node->literal);
|
||||
if(node->literal.beginswith("%")) return nall::binary(node->literal);
|
||||
if(node->literal.beginswith("$")) return nall::hex(node->literal);
|
||||
return nall::integer(node->literal);
|
||||
}
|
||||
|
||||
#define p(n) evaluateInteger(node->link[n])
|
||||
switch(node->type) {
|
||||
|
@@ -8,17 +8,19 @@ inline bool isLiteral(const char*& s) {
|
||||
return (n >= 'A' && n <= 'Z')
|
||||
|| (n >= 'a' && n <= 'z')
|
||||
|| (n >= '0' && n <= '9')
|
||||
|| n == '_' || n == '\"';
|
||||
|| (n == '%' || n == '$' || n == '_' || n == '.')
|
||||
|| (n == '\'' || n == '\"');
|
||||
}
|
||||
|
||||
inline string literalNumber(const char*& s) {
|
||||
const char* p = s;
|
||||
|
||||
//binary
|
||||
if(p[0] == '0' && p[1] == 'b') {
|
||||
p += 2;
|
||||
if(p[0] == '%' || (p[0] == '0' && p[1] == 'b')) {
|
||||
unsigned prefix = 1 + (p[0] == '0');
|
||||
p += prefix;
|
||||
while(p[0] == '0' || p[0] == '1') p++;
|
||||
if(p - s < 3) throw "invalid binary literal";
|
||||
if(p - s <= prefix) throw "invalid binary literal";
|
||||
string result = substr(s, 0, p - s);
|
||||
s = p;
|
||||
return result;
|
||||
@@ -26,19 +28,21 @@ inline string literalNumber(const char*& s) {
|
||||
|
||||
//octal
|
||||
if(p[0] == '0' && p[1] == 'o') {
|
||||
p += 2;
|
||||
unsigned prefix = 1 + (p[0] == '0');
|
||||
p += prefix;
|
||||
while(p[0] >= '0' && p[0] <= '7') p++;
|
||||
if(p - s < 3) throw "invalid octal literal";
|
||||
if(p - s <= prefix) throw "invalid octal literal";
|
||||
string result = substr(s, 0, p - s);
|
||||
s = p;
|
||||
return result;
|
||||
}
|
||||
|
||||
//hex
|
||||
if(p[0] == '0' && p[1] == 'x') {
|
||||
p += 2;
|
||||
if(p[0] == '$' || (p[0] == '0' && p[1] == 'x')) {
|
||||
unsigned prefix = 1 + (p[0] == '0');
|
||||
p += prefix;
|
||||
while((p[0] >= '0' && p[0] <= '9') || (p[0] >= 'A' && p[0] <= 'F') || (p[0] >= 'a' && p[0] <= 'f')) p++;
|
||||
if(p - s < 3) throw "invalid hex literal";
|
||||
if(p - s <= prefix) throw "invalid hex literal";
|
||||
string result = substr(s, 0, p - s);
|
||||
s = p;
|
||||
return result;
|
||||
@@ -61,10 +65,11 @@ inline string literalNumber(const char*& s) {
|
||||
}
|
||||
|
||||
inline string literalString(const char*& s) {
|
||||
const char* p = s + 1;
|
||||
const char* p = s;
|
||||
char escape = *p++;
|
||||
|
||||
while(p[0] && p[0] != '\"') p++;
|
||||
if(*p++ != '\"') throw "unclosed string literal";
|
||||
while(p[0] && p[0] != escape) p++;
|
||||
if(*p++ != escape) throw "unclosed string literal";
|
||||
|
||||
string result = substr(s, 0, p - s);
|
||||
s = p;
|
||||
@@ -74,7 +79,7 @@ inline string literalString(const char*& s) {
|
||||
inline string literalVariable(const char*& s) {
|
||||
const char* p = s;
|
||||
|
||||
while(p[0] == '_' || (p[0] >= 'A' && p[0] <= 'Z') || (p[0] >= 'a' && p[0] <= 'z') || (p[0] >= '0' && p[0] <= '9')) p++;
|
||||
while(p[0] == '_' || p[0] == '.' || (p[0] >= 'A' && p[0] <= 'Z') || (p[0] >= 'a' && p[0] <= 'z') || (p[0] >= '0' && p[0] <= '9')) p++;
|
||||
|
||||
string result = substr(s, 0, p - s);
|
||||
s = p;
|
||||
@@ -85,8 +90,9 @@ inline string literal(const char*& s) {
|
||||
const char* p = s;
|
||||
|
||||
if(p[0] >= '0' && p[0] <= '9') return literalNumber(s);
|
||||
if(p[0] == '\"') return literalString(s);
|
||||
if(p[0] == '_' || (p[0] >= 'A' && p[0] <= 'Z') || (p[0] >= 'a' && p[0] <= 'z')) return literalVariable(s);
|
||||
if(p[0] == '%' || p[0] == '$') return literalNumber(s);
|
||||
if(p[0] == '\'' || p[0] == '\"') return literalString(s);
|
||||
if(p[0] == '_' || p[0] == '.' || (p[0] >= 'A' && p[0] <= 'Z') || (p[0] >= 'a' && p[0] <= 'z')) return literalVariable(s);
|
||||
|
||||
throw "invalid literal";
|
||||
}
|
||||
|
@@ -9,7 +9,7 @@ optional<unsigned> lstring::find(rstring key) const {
|
||||
return false;
|
||||
}
|
||||
|
||||
string lstring::concatenate(const string& separator) const {
|
||||
string lstring::merge(const string& separator) const {
|
||||
string output;
|
||||
for(unsigned i = 0; i < size(); i++) {
|
||||
output.append(operator[](i));
|
||||
@@ -18,6 +18,11 @@ string lstring::concatenate(const string& separator) const {
|
||||
return output;
|
||||
}
|
||||
|
||||
//deprecated: alias to merge()
|
||||
string lstring::concatenate(const string& separator) const {
|
||||
return merge(separator);
|
||||
}
|
||||
|
||||
lstring& lstring::isort() {
|
||||
nall::sort(pool, objectsize, [](const string& x, const string& y) {
|
||||
return istrcmp(x, y) < 0;
|
||||
|
Reference in New Issue
Block a user