CORE: Few fixes from mupen64plus-ae
[mupen64plus-pandora.git] / source / mupen64plus-core / src / r4300 / r4300.c
index 7f58def..b7ed7c3 100755 (executable)
@@ -45,6 +45,7 @@
 
 unsigned int r4300emu = 0;
 int no_compiled_jump = 0;
+unsigned int count_per_op = 2;
 int llbit, rompause;
 #if NEW_DYNAREC != NEW_DYNAREC_ARM
 int stop;
@@ -166,15 +167,15 @@ int rounding_mode = 0x33F, trunc_mode = 0xF3F, round_mode = 0x33F,
           current_instruction_table.NOTCOMPILED) \
          invalid_code[address>>12] = 1;
 
-#include "interpreter.def"
-
 // two functions are defined from the macros above but never used
 // these prototype declarations will prevent a warning
 #if defined(__GNUC__)
-  void JR_IDLE(void) __attribute__((used));
-  void JALR_IDLE(void) __attribute__((used));
+  static void JR_IDLE(void) __attribute__((used));
+  static void JALR_IDLE(void) __attribute__((used));
 #endif
 
+#include "interpreter.def"
+
 // -----------------------------------------------------------
 // Flow control 'fake' instructions
 // -----------------------------------------------------------
@@ -704,7 +705,7 @@ void update_count(void)
     if (r4300emu != CORE_DYNAREC)
     {
 #endif
-        Count = Count + (PC->addr - last_addr)/2;
+        Count += ((PC->addr - last_addr) >> 2) * count_per_op;
         last_addr = PC->addr;
 #ifdef NEW_DYNAREC
     }