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:
Tim Allen
2015-11-16 19:38:05 +11:00
parent 40f4b91000
commit 41c478ac4a
96 changed files with 1055 additions and 1156 deletions

View File

@@ -19,22 +19,22 @@ protected:
}
//determine indentation level, without incrementing pointer
auto readDepth(const char* p) -> unsigned {
unsigned depth = 0;
auto readDepth(const char* p) -> uint {
uint depth = 0;
while(p[depth] == '\t' || p[depth] == ' ') depth++;
return depth;
}
//determine indentation level
auto parseDepth(const char*& p) -> unsigned {
unsigned depth = readDepth(p);
auto parseDepth(const char*& p) -> uint {
uint depth = readDepth(p);
p += depth;
return depth;
}
//read name
auto parseName(const char*& p) -> void {
unsigned length = 0;
uint length = 0;
while(valid(p[length])) length++;
if(length == 0) throw "Invalid node name";
_name = slice(p, 0, length);
@@ -43,19 +43,19 @@ protected:
auto parseData(const char*& p) -> void {
if(*p == '=' && *(p + 1) == '\"') {
unsigned length = 2;
uint length = 2;
while(p[length] && p[length] != '\n' && p[length] != '\"') length++;
if(p[length] != '\"') throw "Unescaped value";
_value = {slice(p, 2, length - 2), "\n"};
p += length + 1;
} else if(*p == '=') {
unsigned length = 1;
uint length = 1;
while(p[length] && p[length] != '\n' && p[length] != '\"' && p[length] != ' ') length++;
if(p[length] == '\"') throw "Illegal character in value";
_value = {slice(p, 1, length - 1), "\n"};
p += length;
} else if(*p == ':') {
unsigned length = 1;
uint length = 1;
while(p[length] && p[length] != '\n') length++;
_value = {slice(p, 1, length - 1), "\n"};
p += length;
@@ -70,7 +70,7 @@ protected:
if(*(p + 0) == '/' && *(p + 1) == '/') break; //skip comments
SharedNode node(new ManagedNode);
unsigned length = 0;
uint length = 0;
while(valid(p[length])) length++;
if(length == 0) throw "Invalid attribute name";
node->_name = slice(p, 0, length);
@@ -81,7 +81,7 @@ protected:
}
//read a node and all of its child nodes
auto parseNode(const lstring& text, unsigned& y) -> void {
auto parseNode(const lstring& text, uint& y) -> void {
const char* p = text[y++];
_metadata = parseDepth(p);
parseName(p);
@@ -89,7 +89,7 @@ protected:
parseAttributes(p);
while(y < text.size()) {
unsigned depth = readDepth(text[y]);
uint depth = readDepth(text[y]);
if(depth <= _metadata) break;
if(text[y][depth] == ':') {
@@ -132,7 +132,7 @@ protected:
if(document.size() == 0) return; //empty document
auto text = document.split("\n");
unsigned y = 0;
uint y = 0;
while(y < text.size()) {
SharedNode node(new ManagedNode);
node->parseNode(text, y);
@@ -154,7 +154,7 @@ inline auto unserialize(const string& markup) -> Markup::Node {
return (Markup::SharedNode&)node;
}
inline auto serialize(const Markup::Node& node, unsigned depth = 0) -> string {
inline auto serialize(const Markup::Node& node, uint depth = 0) -> string {
if(!node.name()) {
string result;
for(auto leaf : node) {

View File

@@ -7,7 +7,7 @@ auto ManagedNode::_evaluate(string query) const -> bool {
if(!query) return true;
for(auto& rule : query.replace(" ", "").split(",")) {
enum class Comparator : unsigned { ID, EQ, NE, LT, LE, GT, GE };
enum class Comparator : uint { ID, EQ, NE, LT, LE, GT, GE };
auto comparator = Comparator::ID;
if(rule.match("*!=*")) comparator = Comparator::NE;
else if(rule.match("*<=*")) comparator = Comparator::LE;
@@ -58,7 +58,7 @@ auto ManagedNode::_find(const string& query) const -> vector<Node> {
lstring path = query.split("/");
string name = path.take(0), rule;
unsigned lo = 0u, hi = ~0u;
uint lo = 0u, hi = ~0u;
if(name.match("*[*]")) {
auto p = name.rtrim("]", 1L).split("[", 1L);
@@ -78,7 +78,7 @@ auto ManagedNode::_find(const string& query) const -> vector<Node> {
rule = p(1);
}
unsigned position = 0;
uint position = 0;
for(auto& node : _children) {
if(!node->_name.match(name)) continue;
if(!node->_evaluate(rule)) continue;

View File

@@ -62,12 +62,13 @@ struct Node {
auto boolean() const -> bool { return text() == "true"; }
auto integer() const -> intmax { return text().integer(); }
auto natural() const -> uintmax { return text().natural(); }
auto real() const -> double { return text().real(); }
auto setName(const string& name = "") -> Node& { shared->_name = name; return *this; }
auto setValue(const string& value = "") -> Node& { shared->_value = value; return *this; }
auto reset() -> void { shared->_children.reset(); }
auto size() const -> unsigned { return shared->_children.size(); }
auto size() const -> uint { return shared->_children.size(); }
auto prepend(const Node& node) -> void { shared->_children.prepend(node.shared); }
auto append(const Node& node) -> void { shared->_children.append(node.shared); }
@@ -80,17 +81,17 @@ struct Node {
return false;
}
auto insert(unsigned position, const Node& node) -> bool {
auto insert(uint position, const Node& node) -> bool {
if(position > size()) return false; //used > instead of >= to allow indexed-equivalent of append()
return shared->_children.insert(position, node.shared), true;
}
auto remove(unsigned position) -> bool {
auto remove(uint position) -> bool {
if(position >= size()) return false;
return shared->_children.remove(position), true;
}
auto swap(unsigned x, unsigned y) -> bool {
auto swap(uint x, uint y) -> bool {
if(x >= size() || y >= size()) return false;
return std::swap(shared->_children[x], shared->_children[y]), true;
}
@@ -103,7 +104,7 @@ struct Node {
});
}
auto operator[](signed position) -> Node {
auto operator[](int position) -> Node {
if(position >= size()) return {};
return shared->_children[position];
}
@@ -116,11 +117,11 @@ struct Node {
auto operator*() -> Node { return {source.shared->_children[position]}; }
auto operator!=(const iterator& source) const -> bool { return position != source.position; }
auto operator++() -> iterator& { return position++, *this; }
iterator(const Node& source, unsigned position) : source(source), position(position) {}
iterator(const Node& source, uint position) : source(source), position(position) {}
private:
const Node& source;
unsigned position;
uint position;
};
auto begin() const -> iterator { return iterator(*this, 0); }
@@ -136,7 +137,7 @@ protected:
namespace nall {
inline range_t range(const Markup::Node& node) {
return range_t{0, (signed)node.size(), 1};
return range_t{0, (int)node.size(), 1};
}
}

View File

@@ -43,7 +43,7 @@ protected:
}
//copy part of string from source document into target string; decode markup while copying
inline void copy(string& target, const char* source, unsigned length) {
inline void copy(string& target, const char* source, uint length) {
target.reserve(length + 1);
#if defined(NALL_XML_LITERAL)
@@ -106,7 +106,7 @@ protected:
//DOCTYPE
if(!memory::compare(p, "<!DOCTYPE", 9)) {
unsigned counter = 0;
uint counter = 0;
do {
char n = *p++;
if(!n) throw "unclosed DOCTYPE";