mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-08-26 01:13:50 +02:00
Update to v095r07 release.
byuu says: Changelog: - entire GBA core ported to auto function() -> return; syntax - fixed GBA BLDY bug that was causing flickering in a few games - replaced nall/config usage with nall/string/markup/node - this merges all configuration files to a unified settings.bml file - added "Ignore Manifests" option to the advanced setting tab - this lets you keep a manifest.bml for an older version of higan; if you want to do regression testing Be sure to remap your controller/hotkey inputs, and for SNES, choose "Gamepad" from "Controller Port 1" in the system menu. Otherwise you won't get any input. No need to blow away your old config files, unless you want to.
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
namespace nall {
|
||||
namespace Eval {
|
||||
|
||||
inline string evaluateExpression(Node* node) {
|
||||
inline auto evaluateExpression(Node* node) -> string {
|
||||
#define p(n) evaluateExpression(node->link[n])
|
||||
switch(node->type) {
|
||||
case Node::Type::Null: return "Null";
|
||||
@@ -37,15 +37,8 @@ inline string evaluateExpression(Node* node) {
|
||||
throw "invalid operator";
|
||||
}
|
||||
|
||||
inline int64_t evaluateInteger(Node* node) {
|
||||
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);
|
||||
}
|
||||
inline auto evaluateInteger(Node* node) -> int64 {
|
||||
if(node->type == Node::Type::Literal) return nall::integer(node->literal);
|
||||
|
||||
#define p(n) evaluateInteger(node->link[n])
|
||||
switch(node->type) {
|
||||
@@ -93,7 +86,7 @@ inline int64_t evaluateInteger(Node* node) {
|
||||
throw "invalid operator";
|
||||
}
|
||||
|
||||
inline maybe<int64_t> integer(const string& expression) {
|
||||
inline auto integer(const string& expression) -> maybe<int64> {
|
||||
try {
|
||||
auto tree = new Node;
|
||||
const char* p = expression;
|
||||
@@ -106,7 +99,7 @@ inline maybe<int64_t> integer(const string& expression) {
|
||||
}
|
||||
}
|
||||
|
||||
inline long double evaluateReal(Node* node) {
|
||||
inline auto evaluateReal(Node* node) -> long double {
|
||||
if(node->type == Node::Type::Literal) return nall::real(node->literal);
|
||||
|
||||
#define p(n) evaluateReal(node->link[n])
|
||||
@@ -138,7 +131,7 @@ inline long double evaluateReal(Node* node) {
|
||||
throw "invalid operator";
|
||||
}
|
||||
|
||||
inline maybe<long double> real(const string& expression) {
|
||||
inline auto real(const string& expression) -> maybe<long double> {
|
||||
try {
|
||||
auto tree = new Node;
|
||||
const char* p = expression;
|
||||
|
@@ -3,7 +3,7 @@
|
||||
namespace nall {
|
||||
namespace Eval {
|
||||
|
||||
inline bool isLiteral(const char*& s) {
|
||||
inline auto isLiteral(const char*& s) -> bool {
|
||||
char n = s[0];
|
||||
return (n >= 'A' && n <= 'Z')
|
||||
|| (n >= 'a' && n <= 'z')
|
||||
@@ -12,7 +12,7 @@ inline bool isLiteral(const char*& s) {
|
||||
|| (n == '\'' || n == '\"');
|
||||
}
|
||||
|
||||
inline string literalNumber(const char*& s) {
|
||||
inline auto literalNumber(const char*& s) -> string {
|
||||
const char* p = s;
|
||||
|
||||
//binary
|
||||
@@ -64,7 +64,7 @@ inline string literalNumber(const char*& s) {
|
||||
return result;
|
||||
}
|
||||
|
||||
inline string literalString(const char*& s) {
|
||||
inline auto literalString(const char*& s) -> string {
|
||||
const char* p = s;
|
||||
char escape = *p++;
|
||||
|
||||
@@ -76,7 +76,7 @@ inline string literalString(const char*& s) {
|
||||
return result;
|
||||
}
|
||||
|
||||
inline string literalVariable(const char*& s) {
|
||||
inline auto literalVariable(const char*& s) -> string {
|
||||
const char* p = s;
|
||||
|
||||
while(p[0] == '_' || p[0] == '.' || (p[0] >= 'A' && p[0] <= 'Z') || (p[0] >= 'a' && p[0] <= 'z') || (p[0] >= '0' && p[0] <= '9')) p++;
|
||||
@@ -86,7 +86,7 @@ inline string literalVariable(const char*& s) {
|
||||
return result;
|
||||
}
|
||||
|
||||
inline string literal(const char*& s) {
|
||||
inline auto literal(const char*& s) -> string {
|
||||
const char* p = s;
|
||||
|
||||
if(p[0] >= '0' && p[0] <= '9') return literalNumber(s);
|
||||
|
@@ -4,7 +4,7 @@ namespace nall {
|
||||
namespace Eval {
|
||||
|
||||
struct Node {
|
||||
enum class Type : unsigned {
|
||||
enum class Type : uint {
|
||||
Null,
|
||||
Literal,
|
||||
Function, Subscript, Member, SuffixIncrement, SuffixDecrement,
|
||||
|
@@ -3,32 +3,32 @@
|
||||
namespace nall {
|
||||
namespace Eval {
|
||||
|
||||
inline bool whitespace(char n) {
|
||||
inline auto whitespace(char n) -> bool {
|
||||
return n == ' ' || n == '\t' || n == '\r' || n == '\n';
|
||||
}
|
||||
|
||||
inline void parse(Node*& node, const char*& s, unsigned depth) {
|
||||
auto unaryPrefix = [&](Node::Type type, unsigned seek, unsigned depth) {
|
||||
inline auto parse(Node*& node, const char*& s, uint depth) -> void {
|
||||
auto unaryPrefix = [&](Node::Type type, uint seek, uint depth) {
|
||||
auto parent = new Node(type);
|
||||
parse(parent->link(0) = new Node, s += seek, depth);
|
||||
node = parent;
|
||||
};
|
||||
|
||||
auto unarySuffix = [&](Node::Type type, unsigned seek, unsigned depth) {
|
||||
auto unarySuffix = [&](Node::Type type, uint seek, uint depth) {
|
||||
auto parent = new Node(type);
|
||||
parent->link(0) = node;
|
||||
parse(parent, s += seek, depth);
|
||||
node = parent;
|
||||
};
|
||||
|
||||
auto binary = [&](Node::Type type, unsigned seek, unsigned depth) {
|
||||
auto binary = [&](Node::Type type, uint seek, uint depth) {
|
||||
auto parent = new Node(type);
|
||||
parent->link(0) = node;
|
||||
parse(parent->link(1) = new Node, s += seek, depth);
|
||||
node = parent;
|
||||
};
|
||||
|
||||
auto ternary = [&](Node::Type type, unsigned seek, unsigned depth) {
|
||||
auto ternary = [&](Node::Type type, uint seek, uint depth) {
|
||||
auto parent = new Node(type);
|
||||
parent->link(0) = node;
|
||||
parse(parent->link(1) = new Node, s += seek, depth);
|
||||
@@ -37,9 +37,9 @@ inline void parse(Node*& node, const char*& s, unsigned depth) {
|
||||
node = parent;
|
||||
};
|
||||
|
||||
auto separator = [&](Node::Type type, unsigned seek, unsigned depth) {
|
||||
auto separator = [&](Node::Type type, uint seek, uint depth) {
|
||||
if(node->type != Node::Type::Separator) return binary(type, seek, depth);
|
||||
unsigned n = node->link.size();
|
||||
uint n = node->link.size();
|
||||
parse(node->link(n) = new Node, s += seek, depth);
|
||||
};
|
||||
|
||||
@@ -155,7 +155,7 @@ inline void parse(Node*& node, const char*& s, unsigned depth) {
|
||||
#undef p
|
||||
}
|
||||
|
||||
inline Node* parse(const string& expression) {
|
||||
inline auto parse(const string& expression) -> Node* {
|
||||
auto result = new Node;
|
||||
const char* p = expression;
|
||||
parse(result, p, 0);
|
||||
|
Reference in New Issue
Block a user