Run the original macOS ARM64 game code on iOS: - tools/retarget.py: header-only Mach-O retargeting to an iOS dylib - platform/native: UIKit host and macOS API shims (AppKit for SDL's Cocoa backend, CoreGraphics displays, CoreAudio device, Metal device properties, Wuffs PNG decoding, Steam and peripheral stubs) - touch, overlay, iOS keyboard and hardware keyboard input - tools/build_native.py: build, sign, install, data copy, launch - docs: build guide, controls, architecture Also includes the earlier static-translation research (ARM64 -> WASM -> native) under docs/research, runtime/, tests/ and tools/. No game files are included; the build reads them from a local install.
19 lines
449 B
ArmAsm
19 lines
449 B
ArmAsm
// void fx_call_on_stack(void *stack_top, void (*fn)(void *), void *arg)
|
|
// Calls fn(arg) with sp moved to stack_top on the current thread, then restores sp.
|
|
.text
|
|
.globl _fx_call_on_stack
|
|
.p2align 2
|
|
_fx_call_on_stack:
|
|
stp x29, x30, [sp, #-16]!
|
|
mov x29, sp
|
|
mov x9, sp
|
|
and x0, x0, #~15
|
|
mov sp, x0
|
|
stp x9, xzr, [sp, #-16]!
|
|
mov x0, x2
|
|
blr x1
|
|
ldp x9, xzr, [sp], #16
|
|
mov sp, x9
|
|
ldp x29, x30, [sp], #16
|
|
ret
|