drc/gte: decode MVMVA data deps
[pcsx_rearmed.git] / libpcsxcore / new_dynarec / new_dynarec.c
index 5e6e66e..533ec79 100644 (file)
@@ -44,9 +44,6 @@
 #define MAXBLOCK 4096
 #define MAX_OUTPUT_BLOCK_SIZE 262144
 
-int cycle_multiplier; // 100 for 1.0
-#define CLOCK_ADJUST(x) (((x) * cycle_multiplier + 50) / 100)
-
 struct regstat
 {
   signed char regmap_entry[HOST_REGS];
@@ -279,6 +276,14 @@ int tracedebug=0;
 
 //#define DEBUG_CYCLE_COUNT 1
 
+int cycle_multiplier; // 100 for 1.0
+
+static int CLOCK_ADJUST(int x)
+{
+  int s=(x>>31)|1;
+  return (x * cycle_multiplier + s * 50) / 100;
+}
+
 static void tlb_hacks()
 {
 #ifndef DISABLE_TLB
@@ -8694,6 +8699,12 @@ int new_recompile_block(int addr)
         gte_rs[i]=gte_reg_reads[source[i]&0x3f];
         gte_rt[i]=gte_reg_writes[source[i]&0x3f];
         gte_rt[i]|=1ll<<63; // every op changes flags
+        if((source[i]&0x3f)==GTE_MVMVA) {
+          int v = (source[i] >> 15) & 3;
+          gte_rs[i]&=~0xe3fll;
+          if(v==3) gte_rs[i]|=0xe00ll;
+          else gte_rs[i]|=3ll<<(v*2);
+        }
         break;
       case FLOAT:
       case FCONV: