bsnes/ananke/archive.cpp
Tim Allen 35f1605829 Update to v093r06 release.
byuu says:

Changelog:
- Windows port should compile out-of-the-box
- InputManager::scancode[] initialized at startup
- Library menu shows item for each bootable media type (notably Game Boy
  Color)
- Display Emulation menu selection fix
- LibraryManager load button works now
- Added hotkey to show library manager (defaults to L)
- Added color emulation to video settings (missing on GBA for now)
- SFC loading SGB without GB cartridge no longer segfaults
- GB/GBC system.load() after cartridge.load()
- GB/GBC BG-over-OAM fix
- GB/GBC disallow up+down and left+right
2013-12-07 20:12:37 +11:00

30 lines
863 B
C++

vector<uint8_t> Ananke::extractROM() {
unzip archive;
if(archive.open(information.archive)) {
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")
) {
information.name = notdir(file.name);
return archive.extract(file);
}
}
}
return vector<uint8_t>();
}
vector<uint8_t> Ananke::extractFile(const string& filename) {
unzip archive;
if(archive.open(information.archive)) {
for(auto& file : archive.file) {
if(notdir(file.name) == filename) {
return archive.extract(file);
}
}
}
return vector<uint8_t>();
}