mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-02-23 22:52:34 +01:00
byuu says: New terminal is in. Much nicer to use now. Command history makes a major difference in usability. The SMP is now fully traceable and debuggable. Basically they act as separate entities, you can trace both at the same time, but for the most part running and stepping is performed on the chip you select. I'm going to put off CPU+SMP interleave support for a while. I don't actually think it'll be too hard. Will get trickier if/when we support coprocessor debugging. Remaining tasks: - aliases - hotkeys - save states - window geometry Basically, the debugger's done. Just have to add the UI fluff. I also removed tracing/memory export from higan. It was always meant to be temporary until the debugger was remade.
33 lines
672 B
C++
33 lines
672 B
C++
#include <sfc/sfc.hpp>
|
|
|
|
#define CHEAT_CPP
|
|
namespace SuperFamicom {
|
|
|
|
Cheat cheat;
|
|
|
|
void Cheat::reset() {
|
|
codes.reset();
|
|
}
|
|
|
|
void Cheat::append(unsigned addr, unsigned data) {
|
|
codes.append({addr, Unused, data});
|
|
}
|
|
|
|
void Cheat::append(unsigned addr, unsigned comp, unsigned data) {
|
|
codes.append({addr, comp, data});
|
|
}
|
|
|
|
maybe<unsigned> Cheat::find(unsigned addr, unsigned comp) {
|
|
//WRAM mirroring: $00-3f,80-bf:0000-1fff -> $7e:0000-1fff
|
|
if((addr & 0x40e000) == 0x000000) addr = 0x7e0000 | (addr & 0x1fff);
|
|
|
|
for(auto& code : codes) {
|
|
if(code.addr == addr && (code.comp == Unused || code.comp == comp)) {
|
|
return code.data;
|
|
}
|
|
}
|
|
return nothing;
|
|
}
|
|
|
|
}
|