summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorAutechre2021-03-09 20:31:50 +0100
committerGitHub2021-03-09 20:31:50 +0100
commit45c8ef0a0bdf0557ab9c1153b5a6e77298cca34a (patch)
tree45b66118646d122a395cfecf2d740bed854c4e45 /main.c
parent6a8aa84200eb92a7f3f1b4befb0630d95ad59b8e (diff)
parent0522d9a4f535a61953da64518097fc7f64d7120c (diff)
downloadpicogpsp-45c8ef0a0bdf0557ab9c1153b5a6e77298cca34a.tar.gz
picogpsp-45c8ef0a0bdf0557ab9c1153b5a6e77298cca34a.tar.bz2
picogpsp-45c8ef0a0bdf0557ab9c1153b5a6e77298cca34a.zip
Merge pull request #101 from davidgfnet/master
Remove libco
Diffstat (limited to 'main.c')
-rw-r--r--main.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/main.c b/main.c
index 0f9bb88..a2f6d8e 100644
--- a/main.c
+++ b/main.c
@@ -132,6 +132,7 @@ u32 update_gba(void)
cpu_ticks += execute_cycles;
reg[CHANGED_PC_STATUS] = 0;
+ reg[COMPLETED_FRAME] = 0;
if(gbc_sound_update)
{
@@ -227,14 +228,14 @@ u32 update_gba(void)
oam_update_count = 0;
flush_ram_count = 0;
- switch_to_main_thread();
-
update_gbc_sound(cpu_ticks);
gbc_sound_update = 0;
process_cheats();
vcount = 0;
+ // We completed a frame, tell the dynarec to exit to the main thread
+ reg[COMPLETED_FRAME] = 1;
}
if(vcount == (dispstat >> 8))
@@ -267,7 +268,7 @@ u32 update_gba(void)
if(timer[i].count < execute_cycles)
execute_cycles = timer[i].count;
}
- } while(reg[CPU_HALT_STATE] != CPU_ACTIVE);
+ } while(reg[CPU_HALT_STATE] != CPU_ACTIVE && !reg[COMPLETED_FRAME]);
return execute_cycles;
}