2016-01-07 08:14:33 +00:00
|
|
|
#pragma once
|
Update to v094r17 release.
byuu says:
This updates higan to use the new Markup::Node changes. This is a really
big change, and one slight typo anywhere could break certain classes of
games from playing.
I don't have ananke hooked up again yet, so I don't have the ability to
test this much. If anyone with some v094 game folders wouldn't mind
testing, I'd help out a great deal.
I'm most concerned about testing one of each SNES special chip game.
Most notably, systems like the SA-1, HitachiDSP and NEC-DSP were using
the fancier lookups, eg node["rom[0]/name"], which I had to convert to
a rather ugly node["rom"].at(0)["name"], which I'm fairly confident
won't work. I'm going to blame that on the fumes from the shelves I just
stained >.> Might work with node.find("rom[0]/name")(0) though ...? But
so ugly ... ugh.
That aside, this WIP adds the accuracy-PPU inlining, so the accuracy
profile should run around 7.5% faster than before.
2015-05-02 13:05:46 +00:00
|
|
|
|
|
|
|
namespace nall { namespace Decode {
|
|
|
|
|
|
|
|
//returns empty string on malformed content
|
|
|
|
inline auto URL(const string& input) -> string {
|
|
|
|
string output;
|
2016-10-27 21:16:58 +00:00
|
|
|
for(uint n = 0; n < input.size();) {
|
Update to v094r17 release.
byuu says:
This updates higan to use the new Markup::Node changes. This is a really
big change, and one slight typo anywhere could break certain classes of
games from playing.
I don't have ananke hooked up again yet, so I don't have the ability to
test this much. If anyone with some v094 game folders wouldn't mind
testing, I'd help out a great deal.
I'm most concerned about testing one of each SNES special chip game.
Most notably, systems like the SA-1, HitachiDSP and NEC-DSP were using
the fancier lookups, eg node["rom[0]/name"], which I had to convert to
a rather ugly node["rom"].at(0)["name"], which I'm fairly confident
won't work. I'm going to blame that on the fumes from the shelves I just
stained >.> Might work with node.find("rom[0]/name")(0) though ...? But
so ugly ... ugh.
That aside, this WIP adds the accuracy-PPU inlining, so the accuracy
profile should run around 7.5% faster than before.
2015-05-02 13:05:46 +00:00
|
|
|
char c = input[n];
|
2016-10-27 21:16:58 +00:00
|
|
|
|
|
|
|
//unreserved characters
|
Update to v094r17 release.
byuu says:
This updates higan to use the new Markup::Node changes. This is a really
big change, and one slight typo anywhere could break certain classes of
games from playing.
I don't have ananke hooked up again yet, so I don't have the ability to
test this much. If anyone with some v094 game folders wouldn't mind
testing, I'd help out a great deal.
I'm most concerned about testing one of each SNES special chip game.
Most notably, systems like the SA-1, HitachiDSP and NEC-DSP were using
the fancier lookups, eg node["rom[0]/name"], which I had to convert to
a rather ugly node["rom"].at(0)["name"], which I'm fairly confident
won't work. I'm going to blame that on the fumes from the shelves I just
stained >.> Might work with node.find("rom[0]/name")(0) though ...? But
so ugly ... ugh.
That aside, this WIP adds the accuracy-PPU inlining, so the accuracy
profile should run around 7.5% faster than before.
2015-05-02 13:05:46 +00:00
|
|
|
if(c >= 'A' && c <= 'Z') { output.append(c); n++; continue; }
|
|
|
|
if(c >= 'a' && c <= 'z') { output.append(c); n++; continue; }
|
|
|
|
if(c >= '0' && c <= '9') { output.append(c); n++; continue; }
|
|
|
|
if(c == '-' || c == '_' || c == '.' || c == '~') { output.append(c); n++; continue; }
|
2016-10-27 21:16:58 +00:00
|
|
|
|
|
|
|
//special characters
|
Update to v094r17 release.
byuu says:
This updates higan to use the new Markup::Node changes. This is a really
big change, and one slight typo anywhere could break certain classes of
games from playing.
I don't have ananke hooked up again yet, so I don't have the ability to
test this much. If anyone with some v094 game folders wouldn't mind
testing, I'd help out a great deal.
I'm most concerned about testing one of each SNES special chip game.
Most notably, systems like the SA-1, HitachiDSP and NEC-DSP were using
the fancier lookups, eg node["rom[0]/name"], which I had to convert to
a rather ugly node["rom"].at(0)["name"], which I'm fairly confident
won't work. I'm going to blame that on the fumes from the shelves I just
stained >.> Might work with node.find("rom[0]/name")(0) though ...? But
so ugly ... ugh.
That aside, this WIP adds the accuracy-PPU inlining, so the accuracy
profile should run around 7.5% faster than before.
2015-05-02 13:05:46 +00:00
|
|
|
if(c == '+') { output.append(' '); n++; continue; }
|
2016-10-27 21:16:58 +00:00
|
|
|
|
|
|
|
//reserved characters
|
Update to v094r17 release.
byuu says:
This updates higan to use the new Markup::Node changes. This is a really
big change, and one slight typo anywhere could break certain classes of
games from playing.
I don't have ananke hooked up again yet, so I don't have the ability to
test this much. If anyone with some v094 game folders wouldn't mind
testing, I'd help out a great deal.
I'm most concerned about testing one of each SNES special chip game.
Most notably, systems like the SA-1, HitachiDSP and NEC-DSP were using
the fancier lookups, eg node["rom[0]/name"], which I had to convert to
a rather ugly node["rom"].at(0)["name"], which I'm fairly confident
won't work. I'm going to blame that on the fumes from the shelves I just
stained >.> Might work with node.find("rom[0]/name")(0) though ...? But
so ugly ... ugh.
That aside, this WIP adds the accuracy-PPU inlining, so the accuracy
profile should run around 7.5% faster than before.
2015-05-02 13:05:46 +00:00
|
|
|
if(c != '%' || n + 2 >= input.size()) return "";
|
|
|
|
char hi = input[n + 1];
|
|
|
|
char lo = input[n + 2];
|
|
|
|
if(hi >= '0' && hi <= '9') hi -= '0';
|
|
|
|
else if(hi >= 'A' && hi <= 'F') hi -= 'A' - 10;
|
|
|
|
else if(hi >= 'a' && hi <= 'f') hi -= 'a' - 10;
|
|
|
|
else return "";
|
|
|
|
if(lo >= '0' && lo <= '9') lo -= '0';
|
|
|
|
else if(lo >= 'A' && lo <= 'F') lo -= 'A' - 10;
|
|
|
|
else if(lo >= 'a' && lo <= 'f') lo -= 'a' - 10;
|
|
|
|
else return "";
|
|
|
|
char byte = hi * 16 + lo;
|
|
|
|
output.append(byte);
|
|
|
|
n += 3;
|
|
|
|
}
|
|
|
|
return output;
|
|
|
|
}
|
|
|
|
|
|
|
|
}}
|