about summary refs log tree commit diff stats
path: root/src/emu
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2022-07-03 15:49:23 +0200
committerptitSeb <sebastien.chev@gmail.com>2022-07-03 15:49:23 +0200
commitebce5998de914d13fc840fc1fe1594f4054aaec8 (patch)
tree0ee04d42258ecf07d576afe7af3f8f95fe98d129 /src/emu
parent672a41a79cbcfa095d6951112d592354e0efbd5a (diff)
downloadbox64-ebce5998de914d13fc840fc1fe1594f4054aaec8.tar.gz
box64-ebce5998de914d13fc840fc1fe1594f4054aaec8.zip
Added 66 F0 0F C1 opcode ([DYNAREC] too) (for FRAMED Collection on Steam)
Diffstat (limited to 'src/emu')
-rw-r--r--src/emu/x64run66f0.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/emu/x64run66f0.c b/src/emu/x64run66f0.c
index 3837eba1..cbf08825 100644
--- a/src/emu/x64run66f0.c
+++ b/src/emu/x64run66f0.c
@@ -78,6 +78,48 @@ int Run66F0(x64emu_t *emu, rex_t rex)
 #endif
                     break;
 
+                case 0xC1:                      /* XADD Gw,Ew */
+                    nextop = F8;
+                    GETEW(0);
+                    GETGW;
+#ifdef DYNAREC
+                    if(rex.w) {
+                        do {
+                            tmp64u = native_lock_read_dd(ED);
+                            tmp64u2 = add64(emu, tmp64u, GD->q[0]);
+                        } while(native_lock_write_dd(ED, tmp64u2));
+                        GD->q[0] = tmp64u;
+                    } else {
+                        if(((uintptr_t)ED)&1) {
+                            do {
+                                tmp16u = ED->word[0] & ~0xff;
+                                tmp16u |= native_lock_read_h(ED);
+                                tmp16u2 = add16(emu, tmp16u, GD->word[0]);
+                            } while(native_lock_write_h(ED, tmp16u2&0xff));
+                            ED->word[0] = tmp16u2;
+                        } else {
+                            do {
+                                tmp16u = native_lock_read_h(ED);
+                                tmp16u2 = add16(emu, tmp16u, GD->word[0]);
+                            } while(native_lock_write_h(ED, tmp16u2));
+                        }
+                        GD->word[0] = tmp16u;
+                    }
+#else
+                    pthread_mutex_lock(&emu->context->mutex_lock);
+                    if(rex.w) {
+                        tmp64u = add64(emu, ED->q[0], GD->q[0]);
+                        GD->q[0] = ED->q[0];
+                        ED->q[0] = tmp64u;
+                    } else {
+                        tmp16u = add16(emu, ED->word[0], GD->word[0]);
+                        GD->word[0] = ED->word[0];
+                        ED->word[0] = tmp16u;
+                    }
+                    pthread_mutex_unlock(&emu->context->mutex_lock);
+#endif
+                    break;
+
                 default:
                     return 1;
             }