mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-20 20:49:12 +12:00
[Cheats] Split gateway and AR
This commit is contained in:
parent
0904638df0
commit
ae69c8f8c4
5 changed files with 78 additions and 16 deletions
14
src/core/action_replay.cpp
Normal file
14
src/core/action_replay.cpp
Normal file
|
@ -0,0 +1,14 @@
|
|||
#include "action_replay.hpp"
|
||||
|
||||
ActionReplay::ActionReplay() { reset(); }
|
||||
|
||||
void ActionReplay::reset() {
|
||||
// Default value of storage regs is 0
|
||||
storage1 = 0;
|
||||
storage2 = 0;
|
||||
}
|
||||
|
||||
void ActionReplay::runCheat(const Cheat& cheat) {
|
||||
// Set offset and data registers to 0 at the start of a cheat
|
||||
data1 = data2 = offset1 = offset2 = 0;
|
||||
}
|
|
@ -1,5 +1,26 @@
|
|||
#include "cheats.hpp"
|
||||
|
||||
ActionReplay::ActionReplay() { reset(); }
|
||||
Cheats::Cheats() { reset(); }
|
||||
|
||||
void ActionReplay::reset() { cheats.clear(); }
|
||||
void Cheats::reset() {
|
||||
cheats.clear(); // Unload loaded cheats
|
||||
ar.reset(); // Reset AR boi
|
||||
}
|
||||
|
||||
void Cheats::runCheats() {
|
||||
for (const Cheat& cheat : cheats) {
|
||||
switch (cheat.type) {
|
||||
case CheatType::ActionReplay: {
|
||||
ar.runCheat(cheat.instructions);
|
||||
break;
|
||||
}
|
||||
|
||||
case CheatType::Gateway: {
|
||||
Helpers::panic("Gateway cheats not supported yet! Only Action Replay is supported!");
|
||||
break;
|
||||
}
|
||||
|
||||
default: Helpers::panic("Unknown cheat type");
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue