2016-01-30 06:40:35 +00:00
|
|
|
auto Icarus::wonderSwanManifest(string location) -> string {
|
Update to v097r14 release.
byuu says:
This is a few days old, but oh well.
This WIP changes nall,hiro,ruby,icarus back to (u)int(8,16,32,64)_t.
I'm slowly pushing for (u)int(8,16,32,64) to use my custom
Integer<Size>/Natural<Size> classes instead. But it's going to be one
hell of a struggle to get that into higan.
2016-02-16 09:11:58 +00:00
|
|
|
vector<uint8_t> buffer;
|
2016-01-30 06:40:35 +00:00
|
|
|
concatenate(buffer, {location, "program.rom"});
|
|
|
|
return wonderSwanManifest(buffer, location);
|
|
|
|
}
|
|
|
|
|
Update to v097r14 release.
byuu says:
This is a few days old, but oh well.
This WIP changes nall,hiro,ruby,icarus back to (u)int(8,16,32,64)_t.
I'm slowly pushing for (u)int(8,16,32,64) to use my custom
Integer<Size>/Natural<Size> classes instead. But it's going to be one
hell of a struggle to get that into higan.
2016-02-16 09:11:58 +00:00
|
|
|
auto Icarus::wonderSwanManifest(vector<uint8_t>& buffer, string location) -> string {
|
2018-02-21 00:12:09 +00:00
|
|
|
if(settings["icarus/UseDatabase"].boolean()) {
|
|
|
|
auto digest = Hash::SHA256(buffer).digest();
|
|
|
|
for(auto game : Database::WonderSwan.find("game")) {
|
|
|
|
if(game["sha256"].text() == digest) return BML::serialize(game);
|
2016-01-30 06:40:35 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-02-21 00:12:09 +00:00
|
|
|
if(settings["icarus/UseHeuristics"].boolean()) {
|
|
|
|
Heuristics::WonderSwan game{buffer, location};
|
|
|
|
if(auto manifest = game.manifest()) return manifest;
|
2016-01-30 06:40:35 +00:00
|
|
|
}
|
|
|
|
|
2018-02-21 00:12:09 +00:00
|
|
|
return {};
|
2016-01-30 06:40:35 +00:00
|
|
|
}
|
|
|
|
|
Update to v097r14 release.
byuu says:
This is a few days old, but oh well.
This WIP changes nall,hiro,ruby,icarus back to (u)int(8,16,32,64)_t.
I'm slowly pushing for (u)int(8,16,32,64) to use my custom
Integer<Size>/Natural<Size> classes instead. But it's going to be one
hell of a struggle to get that into higan.
2016-02-16 09:11:58 +00:00
|
|
|
auto Icarus::wonderSwanImport(vector<uint8_t>& buffer, string location) -> string {
|
Update to v099r16 release (public beta).
byuu says:
Changelog:
- hiro: BrowserDialog can navigate up to drive selection on Windows
- nall: (file,path,dir,base,prefix,suffix)name =>
Location::(file,path,dir,base,prefix,suffix)
- higan/tomoko: rename audio filter label from "Sinc" to "IIR - Biquad"
- higan/tomoko: allow loading files via icarus on the command-line
once again
- higan/tomoko: (begrudging) quick hack to fix presentation window focus
on startup
- higan/audio: don't divide output audio volume by number of streams
- processor/r65816: fix a regression in (read,write)DB; fixes Taz-Mania
- fixed compilation regressions on Windows and Linux
I'm happy with where we are at with code cleanups and stability, so I'd
like to release v100. But even though I'm not assigning any special
significance to this version, we should probably test it more thoroughly
first.
2016-07-04 11:53:24 +00:00
|
|
|
auto name = Location::prefix(location);
|
|
|
|
auto source = Location::path(location);
|
2016-01-30 06:40:35 +00:00
|
|
|
string target{settings["Library/Location"].text(), "WonderSwan/", name, ".ws/"};
|
|
|
|
|
|
|
|
auto manifest = wonderSwanManifest(buffer, location);
|
|
|
|
if(!manifest) return failure("failed to parse ROM image");
|
|
|
|
|
2017-09-24 01:01:48 +00:00
|
|
|
if(!create(target)) return failure("library path unwritable");
|
|
|
|
if(exists({source, name, ".sav"}) && !exists({target, "save.ram"})) {
|
|
|
|
copy({source, name, ".sav"}, {target, "save.ram"});
|
2016-01-30 06:40:35 +00:00
|
|
|
}
|
|
|
|
|
2017-09-24 01:01:48 +00:00
|
|
|
if(settings["icarus/CreateManifests"].boolean()) write({target, "manifest.bml"}, manifest);
|
|
|
|
write({target, "program.rom"}, buffer);
|
2016-01-30 06:40:35 +00:00
|
|
|
return success(target);
|
|
|
|
}
|