about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2025-09-09 11:59:29 +0200
committerptitSeb <sebastien.chev@gmail.com>2025-09-09 11:59:29 +0200
commit7acdd87198ac42e95f97fe943dafab9c73a22fc3 (patch)
treebc13d2e0236e03757750cb9d317c80953ec8e6a7
parent4fb9c658a13a7f1909b5929d1a0895b6e3488075 (diff)
downloadbox64-7acdd87198ac42e95f97fe943dafab9c73a22fc3.tar.gz
box64-7acdd87198ac42e95f97fe943dafab9c73a22fc3.zip
[DYNAREC] Fully trust volatile metadata when they are present (fixes Starfield freeze)
-rw-r--r--src/dynarec/dynarec_native_pass.c4
-rw-r--r--system/box64.box64rc4
2 files changed, 6 insertions, 2 deletions
diff --git a/src/dynarec/dynarec_native_pass.c b/src/dynarec/dynarec_native_pass.c
index a90206fb..fc3d06a9 100644
--- a/src/dynarec/dynarec_native_pass.c
+++ b/src/dynarec/dynarec_native_pass.c
@@ -135,7 +135,7 @@ uintptr_t native_pass(dynarec_native_t* dyn, uintptr_t addr, int alternate, int
         }
 
         int is_opcode_volatile = box64_wine && VolatileRangesContains(ip) && VolatileOpcodesHas(ip);
-        if (is_opcode_volatile && !dyn->insts[ninst].lock_prefixed && dyn->insts[ninst].will_write)
+        if (is_opcode_volatile && !dyn->insts[ninst].lock_prefixed)
             DMB_ISHST();
         #endif
         if((dyn->insts[ninst].x64.need_before&~X_PEND) && !ninst) {
@@ -198,7 +198,7 @@ uintptr_t native_pass(dynarec_native_t* dyn, uintptr_t addr, int alternate, int
         INST_EPILOG;
 
         #if STEP > 1
-        if (is_opcode_volatile && !dyn->insts[ninst].lock_prefixed && dyn->insts[ninst].will_read)
+        if (is_opcode_volatile && !dyn->insts[ninst].lock_prefixed)
             DMB_ISHLD();
         #endif
 
diff --git a/system/box64.box64rc b/system/box64.box64rc
index 05ddfdf4..d00221e6 100644
--- a/system/box64.box64rc
+++ b/system/box64.box64rc
@@ -821,6 +821,10 @@ BOX64_DYNAREC_CALLRET=1
 BOX64_DYNAREC_CALLRET=1
 BOX64_DYNAREC_BIGBLOCK=3
 
+[Starfield.exe]
+BOX64_DYNAREC_BIGBLOCK=3
+BOX64_DYNAREC_CALLRET=1
+
 [steam.exe]
 BOX64_DYNAREC_BIGBLOCK=3
 BOX64_DYNAREC_CALLRET=1