Native iPhone port of Factorio 2.0.77

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.
This commit is contained in:
SashaGoncharov19 committed 2026-10-23 15:27:58 +04:00
commit 51d085e865
89 files changed
+7999

No files matched your search

+23
View File
@@ -0,0 +1,23 @@
// Objective-C symbols missing from iOS Foundation and Metal.
#import <Foundation/Foundation.h>
#import "fx.h"
#ifdef FX_LIB_FOUNDATION
@interface NSAppleEventManager : NSObject
@end
@implementation NSAppleEventManager
+ (instancetype)sharedAppleEventManager { static NSAppleEventManager *m; static dispatch_once_t o; dispatch_once(&o, ^{ m = [self new]; }); return m; }
- (void)setEventHandler:(id)handler andSelector:(SEL)sel forEventClass:(uint32_t)c andEventID:(uint32_t)e { }
- (void)removeEventHandlerForEventClass:(uint32_t)c andEventID:(uint32_t)e { }
@end
#endif
#ifdef FX_LIB_METAL
#import <Metal/Metal.h>
FX_EXPORT NSArray *MTLCopyAllDevicesWithObserver(id *observer, void (^handler)(id, NSString *)) {
if (observer) *observer = nil;
id device = MTLCreateSystemDefaultDevice();
return device ? @[device] : @[];
}
FX_EXPORT void MTLRemoveDeviceObserver(id observer) { }
#endif