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.
22 lines
1.1 KiB
Python
22 lines
1.1 KiB
Python
import struct
|
|
import sys
|
|
from pathlib import Path
|
|
sys.path.insert(0, str(Path(__file__).parents[1] / 'tools'))
|
|
from a64_lift import Compiler, UnsupportedInstruction
|
|
|
|
for words, reason in [([0x14000000, 0xd65f03c0], 'loop with unreachable return'),
|
|
([0x94000000, 0xd65f03c0], 'undeclared host call'),
|
|
([0x91000400], 'missing return'),
|
|
([0xd65f03c0, 0xd503201f], 'code after return'),
|
|
([0x9a010000, 0xd65f03c0], 'unsupported carry arithmetic'),
|
|
([0x9a810000, 0xd65f03c0], 'conditional select without defined flags'),
|
|
([0x3cc18020, 0xd65f03c0], '128-bit load without adjacent store'),
|
|
([0x3d800000, 0xd65f03c0], '128-bit store without adjacent load'),
|
|
([0x14000002, 0x3cc18020, 0x3d800000, 0xd65f03c0], 'branch into middle of copy')]:
|
|
try:
|
|
Compiler().compile(b''.join(struct.pack('<I', word) for word in words), 0x1000)
|
|
except UnsupportedInstruction:
|
|
print('PASS: rejected', reason)
|
|
else:
|
|
raise AssertionError('Unexpected support for ' + reason)
|