Skip to content
This repository was archived by the owner on Jul 3, 2021. It is now read-only.

Commit 7583eec

Browse files
committed
Fix x64->x86 transition on AMD processors
1 parent 3890428 commit 7583eec

File tree

3 files changed

+440
-301
lines changed

3 files changed

+440
-301
lines changed

terraingen/tgen2/tools/createwrappers.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@
4242
a:
4343
mov dword [rsp + 4], 0x23
4444
add dword [rsp], b - a
45+
46+
; needed for AMD processors on Windows, for some reason
47+
push rax
48+
mov ax, 0x2b
49+
mov ss, ax
50+
pop rax
4551
use32
4652
retf
4753
b:
@@ -81,6 +87,12 @@
8187
c:
8288
mov dword [rsp+4], 0x23
8389
add dword [rsp], d - c
90+
91+
; needed for AMD processors on Windows, for some reason
92+
push rax
93+
mov ax, 0x2b
94+
mov ss, ax
95+
pop rax
8496
use32
8597
retf
8698
d:

0 commit comments

Comments
 (0)