about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2024-12-28 13:50:32 +0100
committerptitSeb <sebastien.chev@gmail.com>2024-12-28 13:50:32 +0100
commitcace5f0ccbebc86614ca4bf43d8307a57f37fd41 (patch)
tree7e01dffc44ff26a0b4da4caad6119492a3b878de /src
parent4aaa0b5d24fc3aad2032615ecf661cc0710b11bc (diff)
downloadbox64-cace5f0ccbebc86614ca4bf43d8307a57f37fd41.tar.gz
box64-cace5f0ccbebc86614ca4bf43d8307a57f37fd41.zip
[INTERPRETER] Fixed 32bits ADCX/ADOX opcodes
Diffstat (limited to 'src')
-rw-r--r--src/emu/x64run660f.c3
-rw-r--r--src/emu/x64runf30f.c8
2 files changed, 6 insertions, 5 deletions
diff --git a/src/emu/x64run660f.c b/src/emu/x64run660f.c
index 295a76be..291a3513 100644
--- a/src/emu/x64run660f.c
+++ b/src/emu/x64run660f.c
@@ -828,7 +828,7 @@ uintptr_t Run660F(x64emu_t *emu, rex_t rex, uintptr_t addr)
                         tmp64u2 = GD->q[0] + ED->q[0];

                         }

                     tmp64u = (tmp64u >> 32) + (GD->q[0] >> 32) + (ED->q[0] >> 32);

-                    CONDITIONAL_SET_FLAG(tmp64u & 0x100000000L, F_CF);

+                    CONDITIONAL_SET_FLAG(tmp64u & 0x100000000LL, F_CF);

                     GD->q[0] = tmp64u2;

                 } else {

                     if (ACCESS_FLAG(F_CF))

@@ -836,6 +836,7 @@ uintptr_t Run660F(x64emu_t *emu, rex_t rex, uintptr_t addr)
                     else

                         GD->q[0] = (uint64_t)GD->dword[0] + ED->dword[0];

                     CONDITIONAL_SET_FLAG(GD->q[0] & 0x100000000LL, F_CF);

+                    GD->dword[1] = 0;

                 }

                 break;

             default:

diff --git a/src/emu/x64runf30f.c b/src/emu/x64runf30f.c
index 53ec686d..ce69411d 100644
--- a/src/emu/x64runf30f.c
+++ b/src/emu/x64runf30f.c
@@ -190,13 +190,12 @@ uintptr_t RunF30F(x64emu_t *emu, rex_t rex, uintptr_t addr)
                     if (ACCESS_FLAG(F_OF)) {

                         tmp64u = 1 + (GD->q[0] & 0xFFFFFFFF) + (ED->q[0] & 0xFFFFFFFF);

                         tmp64u2 = 1 + GD->q[0] + ED->q[0];

-                        }

-                    else {

+                    } else {

                         tmp64u = (GD->q[0] & 0xFFFFFFFF) + (ED->q[0] & 0xFFFFFFFF);

                         tmp64u2 = GD->q[0] + ED->q[0];

-                        }

+                    }

                     tmp64u = (tmp64u >> 32) + (GD->q[0] >> 32) + (ED->q[0] >> 32);

-                    CONDITIONAL_SET_FLAG(tmp64u & 0x100000000L, F_OF);

+                    CONDITIONAL_SET_FLAG(tmp64u & 0x100000000LL, F_OF);

                     GD->q[0] = tmp64u2;

                 } else {

                     if (ACCESS_FLAG(F_OF))

@@ -204,6 +203,7 @@ uintptr_t RunF30F(x64emu_t *emu, rex_t rex, uintptr_t addr)
                     else

                         GD->q[0] = (uint64_t)GD->dword[0] + ED->dword[0];

                     CONDITIONAL_SET_FLAG(GD->q[0] & 0x100000000LL, F_OF);

+                    GD->dword[1] = 0;

                 }

                 break;