bsnes/ananke/patch.cpp
Tim Allen 019fc1a2c6 Update to v091r13 release, and ananke v00r01.
byuu says (about higan):

- dropped release/ root node for individual games (still there in
  ananke's database.)
- Memory export uses smarter names (vram.rwm -> video.ram, etc.)
- cheat database moved from XML to BML (3.1MB to 1.9MB file size.)
- cheat codes moved from XML to BML
- resource manifest moved from XML to BML

What can I say, I like consistency. But I'll leave the shaders alone
until I get around to shader folders.

byuu says (about ananke):

Works with higan v091r13. Only does SNES stuff so far.
2012-12-26 17:46:57 +11:00

16 lines
482 B
C++

void Ananke::applyBeatPatch(vector<uint8_t> &buffer) {
string name = {nall::basename(information.name), ".bps"};
if(!file::exists(name)) return;
bpspatch patch;
if(patch.modify(name) == false) return;
patch.source(buffer.data(), buffer.size());
vector<uint8_t> output;
output.resize(patch.size());
patch.target(output.data(), output.size());
if(patch.apply() == bpspatch::result::success) {
buffer = output;
information.manifest = patch.metadata();
}
}