Skip to content

Commit

Permalink
Fix x64->x86 transition on AMD processors
Browse files Browse the repository at this point in the history
  • Loading branch information
matpow2 committed Nov 29, 2018
1 parent 3890428 commit 7583eec
Show file tree
Hide file tree
Showing 3 changed files with 440 additions and 301 deletions.
12 changes: 12 additions & 0 deletions terraingen/tgen2/tools/createwrappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@
a:
mov dword [rsp + 4], 0x23
add dword [rsp], b - a
; needed for AMD processors on Windows, for some reason
push rax
mov ax, 0x2b
mov ss, ax
pop rax
use32
retf
b:
Expand Down Expand Up @@ -81,6 +87,12 @@
c:
mov dword [rsp+4], 0x23
add dword [rsp], d - c
; needed for AMD processors on Windows, for some reason
push rax
mov ax, 0x2b
mov ss, ax
pop rax
use32
retf
d:
Expand Down
Loading

0 comments on commit 7583eec

Please sign in to comment.