summaryrefslogtreecommitdiff
path: root/src/core/core.cpp
diff options
context:
space:
mode:
authorGravatar bunnei2014-08-06 18:30:01 -0400
committerGravatar bunnei2014-08-06 18:30:01 -0400
commitd0c179485392903fa413543d6b6908d45bc1f0fb (patch)
treea2e85ca4b091042e2e45446fda5b36bf6f62d2b3 /src/core/core.cpp
parentMerge pull request #36 from bunnei/fix-memory-unaligned-reads (diff)
parentGPU: Updated g_last_ticks variable to be more descriptive (represents CPU tic... (diff)
downloadyuzu-d0c179485392903fa413543d6b6908d45bc1f0fb.tar.gz
yuzu-d0c179485392903fa413543d6b6908d45bc1f0fb.tar.xz
yuzu-d0c179485392903fa413543d6b6908d45bc1f0fb.zip
Merge pull request #34 from bunnei/gsp-command-synch
Gsp command synch
Diffstat (limited to 'src/core/core.cpp')
-rw-r--r--src/core/core.cpp20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/core/core.cpp b/src/core/core.cpp
index 7dc0809d0..fc9909377 100644
--- a/src/core/core.cpp
+++ b/src/core/core.cpp
@@ -26,21 +26,25 @@ ARM_Interface* g_sys_core = nullptr; ///< ARM11 system (OS) core
26/// Run the core CPU loop 26/// Run the core CPU loop
27void RunLoop() { 27void RunLoop() {
28 for (;;){ 28 for (;;){
29 g_app_core->Run(GPU::kFrameTicks); 29 // This function loops for 100 instructions in the CPU before trying to update hardware.
30 // This is a little bit faster than SingleStep, and should be pretty much equivalent. The
31 // number of instructions chosen is fairly arbitrary, however a large number will more
32 // drastically affect the frequency of GSP interrupts and likely break things. The point of
33 // this is to just loop in the CPU for more than 1 instruction to reduce overhead and make
34 // it a little bit faster...
35 g_app_core->Run(100);
30 HW::Update(); 36 HW::Update();
31 Kernel::Reschedule(); 37 if (HLE::g_reschedule) {
38 Kernel::Reschedule();
39 }
32 } 40 }
33} 41}
34 42
35/// Step the CPU one instruction 43/// Step the CPU one instruction
36void SingleStep() { 44void SingleStep() {
37 g_app_core->Step(); 45 g_app_core->Step();
38 46 HW::Update();
39 // Update and reschedule after approx. 1 frame 47 if (HLE::g_reschedule) {
40 u64 current_ticks = Core::g_app_core->GetTicks();
41 if ((current_ticks - g_last_ticks) >= GPU::kFrameTicks || HLE::g_reschedule) {
42 g_last_ticks = current_ticks;
43 HW::Update();
44 Kernel::Reschedule(); 48 Kernel::Reschedule();
45 } 49 }
46} 50}