2018-02-21 00:12:09 +00:00
|
|
|
namespace Heuristics {
|
2016-01-30 06:40:35 +00:00
|
|
|
|
2018-03-05 22:42:10 +00:00
|
|
|
struct WonderSwan {
|
2018-02-21 00:12:09 +00:00
|
|
|
WonderSwan(vector<uint8_t>& buffer, string location);
|
|
|
|
explicit operator bool() const;
|
|
|
|
auto manifest() const -> string;
|
2016-01-30 06:40:35 +00:00
|
|
|
|
2018-02-21 00:12:09 +00:00
|
|
|
private:
|
|
|
|
vector<uint8_t>& data;
|
|
|
|
string location;
|
2016-01-30 06:40:35 +00:00
|
|
|
};
|
|
|
|
|
2018-02-21 00:12:09 +00:00
|
|
|
WonderSwan::WonderSwan(vector<uint8_t>& data, string location) : data(data), location(location) {
|
|
|
|
}
|
|
|
|
|
|
|
|
WonderSwan::operator bool() const {
|
|
|
|
return data.size() >= 0x10000;
|
|
|
|
}
|
2016-01-30 06:40:35 +00:00
|
|
|
|
2018-02-21 00:12:09 +00:00
|
|
|
auto WonderSwan::manifest() const -> string {
|
|
|
|
if(!operator bool()) return {};
|
2016-03-02 11:19:33 +00:00
|
|
|
|
2018-02-21 00:12:09 +00:00
|
|
|
auto metadata = &data[data.size() - 16];
|
2016-03-02 11:19:33 +00:00
|
|
|
|
2018-02-21 00:12:09 +00:00
|
|
|
bool color = metadata[7];
|
|
|
|
|
|
|
|
string ramType;
|
|
|
|
uint ramSize = 0;
|
2016-03-02 11:19:33 +00:00
|
|
|
switch(metadata[11]) {
|
Update to v106r09 release.
byuu says:
Changelog:
- higan, icarus, genius: new manifest syntax (work in progress)
Pretty much only LoROM and HiROM SNES games will load right now, and RAM
will only work right if the save.ram file already exists to pull its
file size from (a temporary cheap hack was used.)
Basically, I'm just getting this out there for evaluation.
One minor errata is that I switched icarus to using “memory/battery” to
indicate battery-backed RAM, whereas genius still uses “memory/volatile”
to indicate non-battery-backed RAM.
I intend to make it “memory/battery” in genius, and have the field
auto-enable when RAM or RTC is selected for type (obviously allowing it
to be unchecked for volatile memory.)
I need to update all 64 production boards, and 25 of 29 generic boards,
to use the new slot syntax; and I also need to update every single core
in higan to use the new manifest game syntax. I want to build out a
generic manifest game parser that all emulation cores will use.
Once I finish this, I'll also need to write a database converter to
update all of my licensed game dumps to the new database syntax.
I also need to write up something for doc.byuu.org explaining the new
manifest game syntax. The manifest board syntax will still be “internal”
and subject to revisions, but once v107 is out, the gamepak manifest
format will be set in stone sans extensions.
2018-03-05 04:34:07 +00:00
|
|
|
case 0x01: ramType = "RAM"; ramSize = 8 * 1024; break;
|
|
|
|
case 0x02: ramType = "RAM"; ramSize = 32 * 1024; break;
|
|
|
|
case 0x03: ramType = "RAM"; ramSize = 128 * 1024; break;
|
|
|
|
case 0x04: ramType = "RAM"; ramSize = 256 * 1024; break;
|
|
|
|
case 0x05: ramType = "RAM"; ramSize = 512 * 1024; break;
|
2018-02-21 00:12:09 +00:00
|
|
|
case 0x10: ramType = "EEPROM"; ramSize = 128; break;
|
|
|
|
case 0x20: ramType = "EEPROM"; ramSize = 2048; break;
|
|
|
|
case 0x50: ramType = "EEPROM"; ramSize = 1024; break;
|
2016-03-02 11:19:33 +00:00
|
|
|
}
|
|
|
|
|
2018-02-21 00:12:09 +00:00
|
|
|
bool orientation = metadata[12] & 1; //0 = horizontal; 1 = vertical
|
|
|
|
bool hasRTC = metadata[13] & 1;
|
|
|
|
|
|
|
|
string output;
|
|
|
|
output.append("game\n");
|
|
|
|
output.append(" sha256: ", Hash::SHA256(data).digest(), "\n");
|
|
|
|
output.append(" label: ", Location::prefix(location), "\n");
|
Update to v106r09 release.
byuu says:
Changelog:
- higan, icarus, genius: new manifest syntax (work in progress)
Pretty much only LoROM and HiROM SNES games will load right now, and RAM
will only work right if the save.ram file already exists to pull its
file size from (a temporary cheap hack was used.)
Basically, I'm just getting this out there for evaluation.
One minor errata is that I switched icarus to using “memory/battery” to
indicate battery-backed RAM, whereas genius still uses “memory/volatile”
to indicate non-battery-backed RAM.
I intend to make it “memory/battery” in genius, and have the field
auto-enable when RAM or RTC is selected for type (obviously allowing it
to be unchecked for volatile memory.)
I need to update all 64 production boards, and 25 of 29 generic boards,
to use the new slot syntax; and I also need to update every single core
in higan to use the new manifest game syntax. I want to build out a
generic manifest game parser that all emulation cores will use.
Once I finish this, I'll also need to write a database converter to
update all of my licensed game dumps to the new database syntax.
I also need to write up something for doc.byuu.org explaining the new
manifest game syntax. The manifest board syntax will still be “internal”
and subject to revisions, but once v107 is out, the gamepak manifest
format will be set in stone sans extensions.
2018-03-05 04:34:07 +00:00
|
|
|
output.append(" name: ", Location::prefix(location), "\n");
|
2018-02-21 00:12:09 +00:00
|
|
|
output.append(" orientation: ", !orientation ? "horizontal" : "vertical", "\n");
|
Update to v106r09 release.
byuu says:
Changelog:
- higan, icarus, genius: new manifest syntax (work in progress)
Pretty much only LoROM and HiROM SNES games will load right now, and RAM
will only work right if the save.ram file already exists to pull its
file size from (a temporary cheap hack was used.)
Basically, I'm just getting this out there for evaluation.
One minor errata is that I switched icarus to using “memory/battery” to
indicate battery-backed RAM, whereas genius still uses “memory/volatile”
to indicate non-battery-backed RAM.
I intend to make it “memory/battery” in genius, and have the field
auto-enable when RAM or RTC is selected for type (obviously allowing it
to be unchecked for volatile memory.)
I need to update all 64 production boards, and 25 of 29 generic boards,
to use the new slot syntax; and I also need to update every single core
in higan to use the new manifest game syntax. I want to build out a
generic manifest game parser that all emulation cores will use.
Once I finish this, I'll also need to write a database converter to
update all of my licensed game dumps to the new database syntax.
I also need to write up something for doc.byuu.org explaining the new
manifest game syntax. The manifest board syntax will still be “internal”
and subject to revisions, but once v107 is out, the gamepak manifest
format will be set in stone sans extensions.
2018-03-05 04:34:07 +00:00
|
|
|
output.append(" board\n");
|
|
|
|
output.append(Memory{}.type("ROM").size(data.size()).category("Program").text());
|
|
|
|
if(ramType && ramSize)
|
|
|
|
output.append(Memory{}.type(ramType).size(ramSize).category("Save").battery(ramType == "RAM").text());
|
|
|
|
if(hasRTC)
|
|
|
|
output.append(Memory{}.type("RTC").size(0x10).category("Time").text());
|
2018-02-21 00:12:09 +00:00
|
|
|
return output;
|
|
|
|
}
|
|
|
|
|
2016-01-30 06:40:35 +00:00
|
|
|
}
|