2012-11-22 10:28:01 +00:00
|
|
|
vector<uint8_t> Ananke::extractROM() {
|
|
|
|
unzip archive;
|
|
|
|
if(archive.open(information.archive)) {
|
2013-12-07 09:12:37 +00:00
|
|
|
for(auto& file : archive.file) {
|
|
|
|
if(file.name.endsWith(".fc") || file.name.endsWith(".nes")
|
|
|
|
|| file.name.endsWith(".sfc") || file.name.endsWith(".smc")
|
|
|
|
|| file.name.endsWith(".st") || file.name.endsWith(".bs")
|
|
|
|
|| file.name.endsWith(".gb") || file.name.endsWith(".gbc")
|
|
|
|
|| file.name.endsWith(".gba")
|
Update to ananke v00r02 release.
byuu says:
This should be basically final now.
Works with all media types (nes, sfc, gb, gbc, gba, bs, st), strips
headers, can use internal or external firmware, imports saves on first
run.
Added a custom file dialog. It seems both GTK+ and Windows XP have
(un)intelligent file sorting, which puts eg "ActRaiser 2 (NA)" before
"ActRaiser (NA)". So, screw 'em.
2012-12-24 05:48:23 +00:00
|
|
|
) {
|
2012-11-22 10:28:01 +00:00
|
|
|
information.name = notdir(file.name);
|
|
|
|
return archive.extract(file);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return vector<uint8_t>();
|
|
|
|
}
|
|
|
|
|
2013-12-07 09:12:37 +00:00
|
|
|
vector<uint8_t> Ananke::extractFile(const string& filename) {
|
2012-11-22 10:28:01 +00:00
|
|
|
unzip archive;
|
|
|
|
if(archive.open(information.archive)) {
|
2013-12-07 09:12:37 +00:00
|
|
|
for(auto& file : archive.file) {
|
2012-11-22 10:28:01 +00:00
|
|
|
if(notdir(file.name) == filename) {
|
|
|
|
return archive.extract(file);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return vector<uint8_t>();
|
|
|
|
}
|