mirror of
https://github.com/captain-amygdala/pistorm.git
synced 2026-02-15 20:26:14 +00:00
Shut down RTG thread with emulator
This commit is contained in:
12
emulator.c
12
emulator.c
@@ -60,7 +60,7 @@ extern uint8_t gayle_emulation_enabled;
|
||||
extern uint8_t gayle_a4k_int;
|
||||
extern volatile unsigned int *gpio;
|
||||
extern volatile uint16_t srdata;
|
||||
extern uint8_t realtime_graphics_debug;
|
||||
extern uint8_t realtime_graphics_debug, emulator_exiting;
|
||||
extern uint8_t rtg_on;
|
||||
uint8_t realtime_disassembly, int2_enabled = 0;
|
||||
uint32_t do_disasm = 0, old_level;
|
||||
@@ -431,6 +431,11 @@ void sigint_handler(int sig_num) {
|
||||
cfg->platform->shutdown(cfg);
|
||||
}
|
||||
|
||||
while (!emulator_exiting) {
|
||||
emulator_exiting = 1;
|
||||
usleep(0);
|
||||
}
|
||||
|
||||
printf("IRQs triggered: %lld\n", trig_irq);
|
||||
printf("IRQs serviced: %lld\n", serv_irq);
|
||||
|
||||
@@ -639,6 +644,11 @@ switch_config:
|
||||
// wait for cpu task to end before closing up and finishing
|
||||
pthread_join(cpu_tid, NULL);
|
||||
|
||||
while (!emulator_exiting) {
|
||||
emulator_exiting = 1;
|
||||
usleep(0);
|
||||
}
|
||||
|
||||
if (load_new_config == 0)
|
||||
printf("[MAIN] All threads appear to have concluded; ending process\n");
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#define DEBUG(...)
|
||||
#endif
|
||||
|
||||
uint8_t busy = 0, rtg_on = 0, rtg_initialized = 0;
|
||||
uint8_t busy = 0, rtg_on = 0, rtg_initialized = 0, emulator_exiting = 0;
|
||||
extern uint8_t *rtg_mem;
|
||||
extern uint32_t framebuffer_addr;
|
||||
extern uint32_t framebuffer_addr_adj;
|
||||
@@ -289,9 +289,9 @@ reinit_raylib:;
|
||||
reinit = 1;
|
||||
goto shutdown_raylib;
|
||||
}
|
||||
/*if (!rtg_on) {
|
||||
if (!emulator_exiting) {
|
||||
goto shutdown_raylib;
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
rtg_initialized = 0;
|
||||
|
||||
Reference in New Issue
Block a user