mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-02-24 23:22:25 +01:00
byuu says: Changelog: - return open bus instead of mirroring addresses on the bus (fixes Mario&Luigi, Minish Cap, etc) [Jonas Quinn] - add boolean flag to load requests for slotted game carts (fixes slot load prompts) - rename BS-X Town cart from psram to ram - icarus: add support for game database Note: I didn't rename "bsx" to "mcc" in the database for icarus before uploading that. But I just fixed it locally, so it'll be in the next WIP. For now, make it create the manifest for you and then rename it yourself. I did fix the PSRAM size to 256kbit.
45 lines
1.6 KiB
C++
45 lines
1.6 KiB
C++
auto Icarus::gameBoyManifest(const string& location) -> string {
|
|
vector<uint8_t> buffer;
|
|
concatenate(buffer, {location, "program.rom"});
|
|
return gameBoyManifest(buffer, location);
|
|
}
|
|
|
|
auto Icarus::gameBoyManifest(vector<uint8_t>& buffer, const string& location) -> string {
|
|
GameBoyCartridge cartridge{buffer.data(), buffer.size()};
|
|
if(auto markup = cartridge.markup) {
|
|
markup.append("\n");
|
|
markup.append("information\n");
|
|
markup.append(" sha256: ", Hash::SHA256(buffer.data(), buffer.size()).digest(), "\n");
|
|
markup.append(" title: ", prefixname(location), "\n");
|
|
markup.append(" note: ", "heuristically generated by icarus\n");
|
|
return markup;
|
|
}
|
|
return "";
|
|
}
|
|
|
|
auto Icarus::gameBoyImport(vector<uint8_t>& buffer, const string& location) -> bool {
|
|
auto name = prefixname(location);
|
|
auto source = pathname(location);
|
|
string target{settings.libraryPath, "Game Boy/", name, ".gb/"};
|
|
//if(directory::exists(target)) return failure("game already exists");
|
|
|
|
string markup;
|
|
|
|
if(settings.useHeuristics && !markup) {
|
|
GameBoyCartridge cartridge{buffer.data(), buffer.size()};
|
|
if(markup = cartridge.markup) {
|
|
markup.append("\n");
|
|
markup.append("information\n");
|
|
markup.append(" title: ", name, "\n");
|
|
markup.append(" note: heuristically generated by icarus\n");
|
|
}
|
|
}
|
|
|
|
if(!markup) return failure("failed to parse ROM image");
|
|
if(!directory::create(target)) return failure("library path unwritable");
|
|
|
|
if(settings.createManifests) file::write({target, "manifest.bml"}, markup);
|
|
file::write({target, "program.rom"}, buffer);
|
|
return success();
|
|
}
|