From 3c1474e99df836dbe81819f50884f0aa2a153e6b Mon Sep 17 00:00:00 2001 From: Alcaro Date: Sat, 13 Dec 2014 22:05:06 +0100 Subject: [PATCH] Implement idle loop skipping. The framerate on SMA4 is NINE times faster this way! --- cpu_orig.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cpu_orig.c b/cpu_orig.c index 493bb69..9cde70e 100644 --- a/cpu_orig.c +++ b/cpu_orig.c @@ -3275,6 +3275,8 @@ skip_instruction: /* End of Execute ARM instruction */ cycles_remaining -= cycles_per_instruction; + + if (pc == idle_loop_target_pc && cycles_remaining > 0) cycles_remaining = 0; } while(cycles_remaining > 0); collapse_flags(); @@ -4242,6 +4244,8 @@ thumb_loop: /* End of Execute THUMB instruction */ cycles_remaining -= cycles_per_instruction; + + if (pc == idle_loop_target_pc && cycles_remaining > 0) cycles_remaining = 0; } while(cycles_remaining > 0); collapse_flags();