Repository navigation
macOS (Apple Silicon) support, part 1: platform layer, no change on Windows - #32
Conversation
Groundwork for running FMMatchLens on macOS (Apple Silicon) with the community macOS BepInEx IL2CPP package: - MacNative: macOS memory region queries (mach_vm_region) and finding the loaded game_plugin image, used by the hook in a follow-up PR. - VirtualMemory: region lookup moved into TryQueryRegion, which uses MacNative on macOS and VirtualQuery otherwise. The Windows logic is unchanged, only moved into the helper. - PluginOptions: default graphics path under ~/Library/Application Support on macOS; Windows default unchanged.
22d529d to
9db07e5
Compare
osnsyc
left a comment
There was a problem hiding this comment.
Thanks for your contribution! Looking forward to full macOS support.
|
Thanks for your contribution! I really appreciate your work on bringing FMMatchLens to macOS. I'll merge this PR. FMMatchLens was originally developed with only Windows in mind, so quite a few parts of the code are platform-dependent. I'm also not sure how much work is needed to support macOS, and how different the memory offsets are. But no worries, please feel free to continue with your plans. The approach in this PR looks good to me. It's fine to keep macOS specific code in separate files and use simple platform checks in the existing code where needed. I'd rather prioritize getting all features working on macOS than spend too much time on architectural changes at this stage. Once macOS support is fully working, I'll look into refactoring the code and properly abstracting the platform-specific parts. Thanks again for taking this on! |
|
superb - yes will open up a couple more I think I have everything working at least from the testing I've done. been super cool to use this so really appreciate all of your work! |
Hi! I’ve ported FMMatchLens’s capture to FM27 on Apple Silicon Macs, running on the community macOS BepInEx IL2CPP package from sortitoutsi. It captures a full match, checked against FM’s own full-time stats, including tactics and attributes. I’d like to send it upstream in small, easy-to-review pieces.
This first PR only adds the platform layer:
MacNative: macOS memory region queries and finding the loaded game_plugin image (used by the hook in the next PR).
VirtualMemory: the region lookup moved into TryQueryRegion, which uses MacNative on macOS and VirtualQuery otherwise. The Windows logic is unchanged, just moved.
PluginOptions: the macOS default graphics path; the Windows default is unchanged.
Planned next, if you’re happy with the approach:
2. macOS hook discovery (an arm64 byte pattern, plus a small compatibility layer for the MonoMod version in the macOS BepInEx package).
3. macOS offsets for FM 27.1, chosen at runtime by platform so every Windows value stays the same.
4. Optionally, macOS developer scripts and an offline test harness.
Happy to restructure if you’d prefer a different approach, for example separate offset files per platform. Thanks for FMMatchLens!