mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-10-05 06:01:43 +02:00
Update to v093r13 release.
byuu says: This WIP removes nall/input.hpp entirely, and implements the new universal cheat format for FC/SFC/GB/GBC/SGB. GBA is going to be tricky since there's some consternation around byte/word/dword overrides. It's also not immediately obvious to me how to implement the code search in logarithmic time, due to the optional compare value. Lastly, the cheat values inside cheats.bml seem to be broken for the SFC. Likely there's a bug somewhere in the conversion process. Obviously I'll have to fix that before v094. I received no feedback on the universal cheat format. If nobody adds anything before v094, then I don't want to hear any complaining about the formatting :P
This commit is contained in:
@@ -310,32 +310,31 @@ bool Interface::unserialize(serializer& s) {
|
||||
}
|
||||
|
||||
void Interface::cheatSet(const lstring& list) {
|
||||
cheat.reset();
|
||||
|
||||
//Super Game Boy
|
||||
if(cartridge.has_gb_slot()) {
|
||||
GameBoy::cheat.reset();
|
||||
for(auto& code : list) {
|
||||
lstring codelist = code.split("+");
|
||||
for(auto& part : codelist) {
|
||||
unsigned addr, data, comp;
|
||||
part.trim();
|
||||
if(GameBoy::Cheat::decode(part, addr, data, comp)) GameBoy::cheat.append({addr, data, comp});
|
||||
for(auto& codeset : list) {
|
||||
lstring codes = codeset.split("+");
|
||||
for(auto& code : codes) {
|
||||
lstring part = code.split("/");
|
||||
if(part.size() == 2) GameBoy::cheat.append(hex(part[0]), hex(part[1]));
|
||||
if(part.size() == 3) GameBoy::cheat.append(hex(part[0]), hex(part[1]), hex(part[2]));
|
||||
}
|
||||
}
|
||||
GameBoy::cheat.synchronize();
|
||||
return;
|
||||
}
|
||||
|
||||
//Super Famicom, Broadcast Satellaview, Sufami Turbo
|
||||
cheat.reset();
|
||||
for(auto& code : list) {
|
||||
lstring codelist = code.split("+");
|
||||
for(auto& part : codelist) {
|
||||
unsigned addr, data;
|
||||
part.trim();
|
||||
if(Cheat::decode(part, addr, data)) cheat.append({addr, data});
|
||||
for(auto& codeset : list) {
|
||||
lstring codes = codeset.split("+");
|
||||
for(auto& code : codes) {
|
||||
lstring part = code.split("/");
|
||||
if(part.size() == 2) cheat.append(hex(part[0]), hex(part[1]));
|
||||
if(part.size() == 3) cheat.append(hex(part[0]), hex(part[1]), hex(part[2]));
|
||||
}
|
||||
}
|
||||
cheat.synchronize();
|
||||
}
|
||||
|
||||
void Interface::paletteUpdate(PaletteMode mode) {
|
||||
|
Reference in New Issue
Block a user