]> git.sesse.net Git - pistorm/blobdiff - emulator.c
Created address translation fast path for code reads, separated slow path into separa...
[pistorm] / emulator.c
index 1174bd06f455e61f6fa2852d3214a0b6c5313ecf..1be7bcd00ebb3e58229ac6a725a9ae801378e272 100644 (file)
@@ -1,7 +1,10 @@
+// SPDX-License-Identifier: MIT
+
 #include "m68k.h"
 #include "emulator.h"
 #include "platforms/platforms.h"
 #include "input/input.h"
+#include "m68kcpu.h"
 
 #include "platforms/amiga/Gayle.h"
 #include "platforms/amiga/amiga-registers.h"
@@ -41,6 +44,7 @@ unsigned char write_ranges;
 unsigned int write_addr[8];
 unsigned int write_upper[8];
 unsigned char *write_data[8];
+address_translation_cache code_translation_cache = {0};
 
 int kb_hook_enabled = 0;
 int mouse_hook_enabled = 0;
@@ -57,6 +61,7 @@ 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 rtg_on;
 uint8_t realtime_disassembly, int2_enabled = 0;
 uint32_t do_disasm = 0, old_level;
 uint32_t last_irq = 8, last_last_irq = 8;
@@ -233,9 +238,9 @@ cpu_loop:
   }*/
   if (do_reset) {
     cpu_pulse_reset();
-    m68k_pulse_reset();
     do_reset=0;
     usleep(1000000); // 1sec
+    rtg_on=0;
 //    while(amiga_reset==0);
 //    printf("CPU emulation reset.\n");
   }
@@ -264,6 +269,7 @@ cpu_loop:
 
 stop_cpu_emulation:
   printf("[CPU] End of CPU thread\n");
+  return (void *)NULL;
 }
 
 void *keyboard_task() {
@@ -430,11 +436,6 @@ int main(int argc, char *argv[]) {
   int g;
   //const struct sched_param priority = {99};
 
-  if (argc > 1) {
-    irq_delay = atoi(argv[1]);
-    printf("Setting IRQ delay to %d loops (%s).\n", irq_delay, argv[1]);
-  }
-
   // Some command line switch stuffles
   for (g = 1; g < argc; g++) {
     if (strcmp(argv[g], "--cpu_type") == 0 || strcmp(argv[g], "--cpu") == 0) {