mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-02-23 14:42:33 +01:00
byuu says: Changelog: - game/memory/category → game/memory/content - game/memory/model → game/memory/architecture - game/memory/identity → game/memory/identifier - Super Famicom: memory/content=Bitmap → memory/content=Save - Super Famicom: memory/architecture=DMG,MGB → memory/architecture=LR35902 The game manifest field names are now officially set in stone. I won't change them again, I'll only add new fields if required. As for the values in the field, I'm still undecided on the manufacturer of the ST018, and I could be talked into different identifiers for the Super Game Boy (SGB1/SGB2, DMG/MGB, or just ICD(2)?) The board manifest format is still in flux, as is the choice of what to name firmware files (it's between manufacturer and architecture, where I'm leaning toward the latter currently.) Board memory to Game memory mappings will require both the manufacturer and architecture fields to match. I'll be updating doc.byuu.org soon with the finalized game manifest format.
37 lines
963 B
C++
37 lines
963 B
C++
namespace Heuristics {
|
|
|
|
struct PCEngine {
|
|
PCEngine(vector<uint8_t>& data, string location);
|
|
explicit operator bool() const;
|
|
auto manifest() const -> string;
|
|
|
|
private:
|
|
vector<uint8_t>& data;
|
|
string location;
|
|
};
|
|
|
|
PCEngine::PCEngine(vector<uint8_t>& data, string location) : data(data), location(location) {
|
|
if((data.size() & 0x1fff) == 512) {
|
|
//remove header if present
|
|
memory::move(&data[0], &data[512], data.size() - 512);
|
|
data.resize(data.size() - 512);
|
|
}
|
|
}
|
|
|
|
PCEngine::operator bool() const {
|
|
return (bool)data;
|
|
}
|
|
|
|
auto PCEngine::manifest() const -> string {
|
|
string output;
|
|
output.append("game\n");
|
|
output.append(" sha256: ", Hash::SHA256(data).digest(), "\n");
|
|
output.append(" label: ", Location::prefix(location), "\n");
|
|
output.append(" name: ", Location::prefix(location), "\n");
|
|
output.append(" board\n");
|
|
output.append(Memory{}.type("ROM").size(data.size()).content("Program").text());
|
|
return output;
|
|
}
|
|
|
|
}
|