summaryrefslogtreecommitdiff
path: root/cpu.c
diff options
context:
space:
mode:
authorDavid Guillen Fandos2021-05-05 02:20:00 +0200
committerDavid G. F2021-05-05 21:15:27 +0200
commit4fd456e1583a4c8686c8de87c2aeb1eb78125be1 (patch)
treea808a15f40df0f09226fc8e4a620b0f546b48729 /cpu.c
parent52088a4d10af9a8c0e95b0eb168d4dfd0a13639f (diff)
downloadpicogpsp-4fd456e1583a4c8686c8de87c2aeb1eb78125be1.tar.gz
picogpsp-4fd456e1583a4c8686c8de87c2aeb1eb78125be1.tar.bz2
picogpsp-4fd456e1583a4c8686c8de87c2aeb1eb78125be1.zip
Adding Code Breaker cheat support
This works on both interpreter and dynarec. Tested in MIPS, ARM and x86, still needs some more testing, some edge cases can be buggy.
Diffstat (limited to 'cpu.c')
-rw-r--r--cpu.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/cpu.c b/cpu.c
index badb9c2..5df8bb8 100644
--- a/cpu.c
+++ b/cpu.c
@@ -1679,6 +1679,10 @@ arm_loop:
collapse_flags();
cycles_per_instruction = global_cycles_per_instruction;
+ /* Process cheats if we are about to execute the cheat hook */
+ if (pc == cheat_master_hook)
+ process_cheats();
+
old_pc = pc;
/* Execute ARM instruction */
@@ -3294,6 +3298,10 @@ thumb_loop:
collapse_flags();
+ /* Process cheats if we are about to execute the cheat hook */
+ if (pc == cheat_master_hook)
+ process_cheats();
+
old_pc = pc;
/* Execute THUMB instruction */