SH2 drc, dummy soc for GP2X
[picodrive.git] / cpu / sh2 / compiler.c
index a243aca..9368b58 100644 (file)
@@ -52,8 +52,32 @@ static u8 *tcache_ptrs[3];
 // ptr for code emiters
 static u8 *tcache_ptr;
 
+#ifdef ARM
+#include "../drc/emit_arm.c"
+
+static const int reg_map_g2h[] = {
+       -1, -1, -1, -1,
+       -1, -1, -1, -1,
+       -1, -1, -1, -1,
+       -1, -1, -1, -1,
+       -1, -1, -1, -1,
+       -1, -1, -1, -1,
+};
+
+#else
 #include "../drc/emit_x86.c"
 
+static const int reg_map_g2h[] = {
+       -1, -1, -1, -1,
+       -1, -1, -1, -1,
+       -1, -1, -1, -1,
+       -1, -1, -1, -1,
+       -1, -1, -1, -1,
+       -1, -1, -1, -1,
+};
+
+#endif
+
 typedef enum {
   SHR_R0 = 0, SHR_R15 = 15,
   SHR_PC,  SHR_PPC, SHR_PR,   SHR_SR,
@@ -364,7 +388,7 @@ static void *sh2_translate(SH2 *sh2, block_desc *other_block)
         tmp2 = delayed_op ? SHR_PPC : SHR_PC;
         emit_move_r_imm32(tmp2, pc + (delayed_op ? 2 : 0));
         emith_test_t();
-        EMIT_CONDITIONAL(emit_move_r_imm32(tmp2, pc + tmp + 2), (op & 0x0200) ? 1 : 0);
+        EMITH_CONDITIONAL(emit_move_r_imm32(tmp2, pc + tmp + 2), (op & 0x0200) ? 1 : 0);
         cycles += 2;
         if (!delayed_op)
           goto end_block;
@@ -617,6 +641,9 @@ int sh2_drc_init(SH2 *sh2)
 {
   if (block_tables[0] == NULL) {
     int i, cnt;
+
+    drc_cmn_init();
+
     cnt = block_max_counts[0] + block_max_counts[1] + block_max_counts[2];
     block_tables[0] = calloc(cnt, sizeof(*block_tables[0]));
     if (block_tables[0] == NULL)
@@ -656,6 +683,8 @@ void sh2_drc_finish(SH2 *sh2)
 #endif
     free(block_tables[0]);
     memset(block_tables, 0, sizeof(block_tables));
+
+    drc_cmn_cleanup();
   }
 
   if (hash_table != NULL) {