[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-115829":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":12,"contributorsCount":14,"subscribersCount":14,"size":14,"stars1d":14,"stars7d":15,"stars30d":15,"stars90d":14,"forks30d":14,"starsTrendScore":13,"compositeScore":16,"rankGlobal":9,"rankLanguage":9,"license":17,"archived":18,"fork":18,"defaultBranch":19,"hasWiki":20,"hasPages":18,"topics":21,"createdAt":9,"pushedAt":22,"updatedAt":23,"readmeContent":24,"aiSummary":25,"trendingCount":14,"starSnapshotCount":14,"syncStatus":15,"lastSyncTime":26,"discoverSource":27},115829,"FH2-Port-AppleSilicon","fladnaG86\u002FFH2-Port-AppleSilicon","fladnaG86","Run Azimuth (Forza Horizon 2 for Xbox One) on Apple Silicon Macs via CrossOver + D3DMetal: D3D12 layer, keyboard gamepad, launcher. No game or Azimuth files.",null,"C",52,6,1,0,2,43.74,"MIT License",false,"main",true,[],"2026-11-16 12:00:55","2026-11-20 21:45:48","# FH2 Port for Apple Silicon\n\n[![A race on a MacBook Pro M1 Max with the Metal HUD (click for the video)](media\u002Frace.jpg)](https:\u002F\u002Fgithub.com\u002FfladnaG86\u002FFH2-Port-AppleSilicon\u002Freleases\u002Ftag\u002Fvideo)\n\n*MacBook Pro M1 Max, Azimuth set to 60 fps and 1440 lines: about 60 fps, 11–13 ms of GPU per frame\nin races (Metal HUD, top right). [Watch the video](https:\u002F\u002Fgithub.com\u002FfladnaG86\u002FFH2-Port-AppleSilicon\u002Freleases\u002Ftag\u002Fvideo).*\n\n**[English](#english) · [Italiano](#italiano)**\n\n> Not affiliated with, endorsed by or connected to Microsoft, Xbox Game Studios, Playground Games,\n> Turn 10 Studios, Almost There Games, CodeWeavers or Apple. This repository contains **no game\n> files, no Azimuth files and no keys**, and nothing in it modifies Azimuth. You need your own\n> legitimate copy of Forza Horizon 2 for Xbox One and Azimuth from its\n> [official page](https:\u002F\u002Falmost-there-games.itch.io\u002Fazimuth). Almost There Games does not support\n> setups with third-party layers: **do not send them reports about this one.**\n\n---\n\n## English\n\nThis project lets **Azimuth 1.0.4**, Almost There Games' compatibility wrapper for the Xbox One\nversion of **Forza Horizon 2 (1.0.0.64)**, run on Apple Silicon Macs through **CrossOver** and\nApple's **Game Porting Toolkit (D3DMetal)**. Azimuth itself targets Windows and Linux; this repo\nonly adds layers *underneath* it, the way DXVK or vkd3d sit under a game:\n\n- **`d3d12.dll`**: a D3D12 layer between Azimuth and D3DMetal (loaded through a Wine DLL override).\n- **`fh2pad.dll`**: the bottle's provider of `Windows.Gaming.Input.Gamepad`, adding a keyboard.\n- **FH2 Port.app**: a launcher that installs both into a CrossOver bottle and starts the game.\n\nDeveloped and tested on a MacBook Pro M1 Max (32 GB), macOS 27.3, CrossOver on Wine 11 with\nGPTK 4.0b3 and Azimuth 1.0.4 (1.0.2 and 0.9.10 start with this layer too). Free roam, races, menus,\naudio, controllers and keyboard work. **Forza Horizon 3 (1.0.125.0) is playable too** (played here on\nAzimuth 1.0.4), and so is **Forza Motorsport 6 (1.0.0.44)** (played on 1.0.2, not yet retried on\n1.0.4). Azimuth 1.0.4 fixes Forza Horizon 2's brightness at render heights other than 1080p, so\nupdating is recommended (see below).\n\n### What's new\n\n- **0.1.11**: **Forza Horizon 3 no longer stops after about a minute on macOS 26** (PR #22 by\n  @FraSharp). Rosetta before macOS 27 aborts the process when an AVX instruction takes a page fault\n  (\"unexpectedly need to EmulateForward on a synchronous exception\"); the launch now advertises AVX\n  to Rosetta on macOS 27 and later only, and `ROSETTA_ADVERTISE_AVX` set in the environment still\n  wins. New switches: `FH2_MIN=1` minimal mode for a complete D3D12 implementation such as\n  vkd3d-proton (PR #19 by @ssaltarenn), `FH2_FENCE_WAIT` \u002F `FH2_FENCE_TRACE` fence diagnostics (PR\n  #18 by @ssaltarenn). Nothing changes on macOS 27 with the default settings.\n- **0.1.10**: **sharper picture on Retina displays with a spatial upscaler** (played on an M1 Max\n  with Azimuth 1.0.4). Without Wine's Retina mode the window has the display's points (1728x1117 on\n  a 16\" MacBook Pro): Azimuth rendered at 1440p, shrank it to 1117p and macOS stretched that 2x.\n  With Retina mode on (`HKCU\\Software\\Wine\\Mac Driver`, `RetinaMode` = `y`, now set by the install\n  for the whole bottle; `FH2_RETINA=0` leaves it alone) the window has the real pixels, and the\n  layer now hands Azimuth back buffers sized for its render height, then enlarges them to the window\n  with two passes modelled on AMD FSR 1 (EASU edge-adaptive upscale + RCAS sharpening). It turns\n  itself off when the render height is at or above the window's (supersampling). `FH2_UPSCALE=0`\n  turns it off, `FH2_SHARP=\u003Cstops>` sets the sharpening (0 = most, default 0.25). Keyboard: driving\n  moved to the arrow keys, W A S D is now the D-pad.\n- **0.1.9**: **Forza Horizon 3 starts and is playable** (1.0.125.0, played on an M1 Max with Azimuth\n  1.0.2). FH3 uses Azimuth's private VC14 runtime, which Wine replaced with its builtin DLLs, and\n  Azimuth stopped with \"Private VC14 runtime was overridden\". The install now sets `vcruntime140`,\n  `vcruntime140_1`, `msvcp140` and `concrt140` to native for `azimuth.exe`, and the app reinstalls\n  whenever its version changes, even if the layer DLLs did not.\n- **0.1.8**: with anti-aliasing on, the **car customisation, purchase and upgrade screens no longer\n  stop the game** (issue #15). The showroom asks for 8x MSAA targets; Apple GPUs take at most 4x,\n  so D3DMetal offers no 8x and Azimuth stopped with \"the host takes no 8 samples of format 10\". The\n  layer now creates those targets and their pipelines with 4 samples (`FH2_MSAA8=0` turns this\n  off). MSAA still draws dashes in the sky, so anti-aliasing off stays the recommended setting.\n  - The fiber fix finds its sites at run time and also knows **Forza Horizon 2 Presents Fast &\n    Furious, Forza Horizon 3, Forza Motorsport 5 and 6** (PR #3 by @danielgpinheiro). **Forza\n    Motorsport 6 is playable**: with this layer it starts and was played on an M1 Max with Azimuth\n    1.0.2 (before it crashed on the splash, reading `0x8ff`). Forza Horizon 2 and Forza Motorsport 6\n    tested here.\n- **0.1.7**: **Azimuth 1.0.x** works (it froze after a few minutes, issue #14), and the **stutter\n  near buildings is gone**.\n  - Azimuth 1.0 drives two GPU queues at once. The layer held every queue's signals with one\n    fence and one worker thread, so each queue could end up waiting for the other; each queue\n    now has its own.\n  - The stutter: near busy places Azimuth reserves memory with `VirtualAlloc2`, asking for an\n    address between 4 GB and 1 TB. Wine looks for room from the bottom of that range, trying every\n    64 KB with `mach_vm_map`, and right above 4 GB macOS has Wine, Rosetta, D3DMetal and Metal\n    mapped: thousands of failed tries, 40–170 ms per call, 2–7 s of every 10 s. The layer now picks\n    a free address in the upper half of the range and asks for exactly that one: under 1 ms.\n  - `FlushProcessWriteBuffers` no longer reads every thread's registers: one page protection change\n    (macOS `mprotect`, called directly) drains the other cores' write buffers. ~17 µs instead of\n    ~1.8 ms, and it cannot hang in `thread_get_state` (seen once with a single caller).\n- **0.1.6**: about **half the stutter** in busy places. Wine on macOS runs threads\n  of normal Windows priority below native apps (Mach priority 26 instead of 31), and Azimuth's\n  worker and many game threads sit there; the layer now raises them to the native level.\n- **0.1.5**: fixes the **random freeze** (no Present, Azimuth's watchdog reporting its worker stuck)\n  seen after anything from 1 to 30 minutes, in the intro movie or in game. Wine on macOS implements\n  `FlushProcessWriteBuffers` by reading every thread's registers; under Rosetta two threads doing\n  that at once wait on each other forever. The layer now lets one call through at a time.\n- **0.1.4**: the launcher also finds **CrossOver Preview**. The install steps no longer tell you to\n  start `azimuth.exe` from CrossOver first: without the layer it stops with heap \u002F DX12 errors\n  before it asks for the game folder. Open FH2 Port instead; Azimuth then asks for the folder.\n- **0.1.3**: bottles in a custom Bottles folder (for example on an external SSD) are found, and\n  **Other bottle folder…** lets you pick any bottle by hand.\n\n### What the layer does\n\n| Problem on D3DMetal | What the layer does |\n|---|---|\n| `ID3D12Device3::OpenExistingHeapFromAddress` is not implemented, and Azimuth places GPU heaps over the game's memory | Emulated: a CPU-visible heap mirrors that memory, synced in 64-byte blocks before each submit and after the GPU; queue signals are held until the data is visible |\n| `WriteBufferImmediate` does nothing | Replayed on the CPU before the fence, or turned into a copy from an upload ring |\n| Queue signals held until the data is visible (row above) must stay in each queue's order; Azimuth 1.0 uses two queues | Each queue has its own fence, list and worker thread |\n| Azimuth only starts on devices that report existing heaps and resource binding tier 3 | Both reported as supported (existing heaps are the emulation above) |\n| Tiled resources do not alias | Reported as unsupported, so Azimuth takes another path |\n| `FlushProcessWriteBuffers` (Wine on macOS reads every thread's registers) deadlocks under Rosetta when two threads call it at once, and costs ~1.8 ms a call | ntdll's `NtFlushProcessWriteBuffers` is hooked in memory: one caller at a time, and a page protection change (macOS `mprotect`) instead of the register reads |\n| Wine looks for an address that fits Azimuth's `VirtualAlloc2` requirements (4 GB–1 TB) by trying every 64 KB from the bottom, through macOS's own mappings: up to 170 ms a call | ntdll's `NtAllocateVirtualMemoryEx` is hooked: the layer picks a free address in the upper half of the range and asks for it; Wine's search is the fallback |\n| Threads of normal Windows priority get Mach priority 26, below native apps' 31 | Every 2 s, threads below above-normal are raised to above-normal (Mach 31) |\n| **Input layouts using `D3D12_APPEND_ALIGNED_ELEMENT` over several vertex buffers get wrong offsets.** In the world-prop layout `I_YAXIS` is fetched 28 bytes and `I_COLOUR` 56 bytes past their real position | Offsets are written out per slot before the layout reaches D3DMetal. This fixes the giant \"phantom walls\", black or upside-down trees, bent poles and misaligned barriers |\n\nThe input-layout bug has a standalone repro, `layout_test` in `src\u002Fd3d12\u002Fd3d12.c`, run by\n`tools\u002Ffh2test.c`: with append-aligned offsets 17 of 17 instances read the wrong attributes, with\nexplicit offsets 0 of 17.\n\nThe game itself also needs one fix on macOS Wine: it reads the current fiber inline with\n`mov reg, gs:[0x20]`, which does not reach the TEB there. The layer reroutes those reads **in\nmemory**, after Azimuth has loaded the game; the game files on disk stay untouched.\n\nIt is not only Forza Horizon 2: the same read is in **Forza Horizon 2 Presents Fast & Furious**\n(`Spire_1.0.0.6`), **Forza Horizon 3** (`Opus_1.0.125.0`), **Forza Motorsport 5**\n(`Forza_1.0.0.20`, two hundred of them) and **Forza Motorsport 6** (`Monument_1.0.0.44`), and each\nbuild puts them at different addresses with different registers. So the layer knows a title only by\nits PE timestamp and image size, and finds the sites itself: it scans the game image's executable\nsections for `65 REX.W 8b modrm(SIB) 25 20 00 00 00`, patches what it finds into a jump to a cave in\nthat section's `int3` padding (one cave per register), and patches the rest as more of the image\narrives. In the log: `game image found at … (Forza Horizon 3 1.0.125.0)` and\n`fiber fix: 12 inline fiber reads rerouted … (…)`. An unidentified build is left alone, and a new\ntitle costs two numbers in `known_images[]` — its timestamp and image size.\n\n### Install with the app\n\n1. In CrossOver (or CrossOver Preview) create a **Windows 10 64-bit** bottle and copy the Azimuth\n   folder into its `drive_c` (the folder name is up to you). From the Terminal, with a bottle\n   named `fh2` and Azimuth unzipped in Downloads:\n   ```sh\n   ditto ~\u002FDownloads\u002Fazimuth-windows \"$HOME\u002FLibrary\u002FApplication Support\u002FCrossOver\u002FBottles\u002Ffh2\u002Fdrive_c\u002FAzimuth\"\n   ```\n   Do not start `azimuth.exe` from CrossOver: without the layer it stops at D3D12 checks\n   (heap \u002F DX12 errors) before it asks for the game folder.\n2. Put Microsoft's **`d3dcompiler_47.dll`** in the Azimuth folder (Wine's one cannot compile\n   Azimuth's GPU detile shader). It is not included here; one source is the `core\u002F` folder of the\n   Firefox 62 Windows 64-bit installer.\n3. Open the DMG from the [Releases](..\u002F..\u002Freleases), drag **FH2 Port** to Applications and open it.\n   It is not notarized: the first time, click \"Done\", then System Settings › Privacy & Security ›\n   **Open Anyway**.\n4. Choose the bottle, then the folder that contains `azimuth.exe`. The app installs the layer and\n   starts Azimuth, which asks for your game folder the first time (open the app once more after\n   that so it applies its settings); later a double-click is enough. The game folder must be a real\n   folder: Azimuth refuses symbolic links (copy it, or make an APFS clone with `cp -c -R`). Wine\n   shows your home folder as a drive letter (often **Y:**), which is where to look for a game kept\n   under your home. Hold **Option** while opening it to choose\n   again or to uninstall. Bottles in a custom Bottles folder (for example on an external disk)\n   are found too; otherwise pick **Other bottle folder…** and choose the bottle's folder.\n\nThe app also sets `antialiasing=off` (MSAA draws dashes in the sky on D3DMetal) and\n`resolution=1440`, which supersamples and smooths the edges.\n\n### Updating Azimuth without losing your saves\n\nSaves live in each Azimuth folder (`data\u002Ftitles\u002F1A96545B\u002Fsaves`). Close the game first, then\neither:\n\n- unzip the new Azimuth **over** the old folder: it keeps `data\u002Ftitles`, `data\u002Fazimuth.ini` (which\n  Azimuth converts itself), `d3dcompiler_47.dll` and the layer. `ditto` merges folders and deletes\n  nothing; in the Finder choose **Merge** for `data`, never **Replace**, which would delete the\n  saves:\n  ```sh\n  ditto ~\u002FDownloads\u002Fazimuth-windows \"$HOME\u002FLibrary\u002FApplication Support\u002FCrossOver\u002FBottles\u002F\u003Cbottle>\u002Fdrive_c\u002F\u003Cfolder>\"\n  ```\n- or install it in a **new folder or a new bottle** (steps above) and copy `data\u002Ftitles` from the\n  old folder before the first start:\n  ```sh\n  B=\"$HOME\u002FLibrary\u002FApplication Support\u002FCrossOver\u002FBottles\"\n  ditto \"$B\u002F\u003Cold bottle>\u002Fdrive_c\u002F\u003Cold folder>\u002Fdata\u002Ftitles\" \"$B\u002F\u003Cnew bottle>\u002Fdrive_c\u002F\u003Cnew folder>\u002Fdata\u002Ftitles\"\n  ```\n\nThen open FH2 Port with **Option** held and choose the new folder if it changed; the app installs\nthe layer there. Updating FH2 Port itself never touches the saves. Copying `data\u002Ftitles` somewhere\nelse first is a cheap backup.\n\n### Install by hand\n\n```sh\nbrew install mingw-w64\nmake                                             # build\u002Fd3d12.dll, build\u002Ffh2pad.dll\nBOTTLE=\u003Cbottle> AZDIR=\u003Cfolder> scripts\u002Finstall.sh --settings\nBOTTLE=\u003Cbottle> AZDIR=\u003Cfolder> scripts\u002Frun.sh    # MTL_HUD_ENABLED=1 for the Metal HUD\n```\n\n`install.sh` copies the two DLLs next to `azimuth.exe`, adds per-application DLL overrides for\n`azimuth.exe` (`d3d12` native-then-builtin, `d3dcompiler_47` and the VC++ 2012 runtime native),\nregisters `fh2pad.dll` for `Windows.Gaming.Input.Gamepad`, and sets WineBus `DisableHidraw=1` so a\nDualSense shows up as a gamepad. `install.sh --uninstall` undoes it. `tools\u002Fapp\u002Fmake_app.sh \u003Cversion>`\nbuilds the app and the DMG.\n\n### Keyboard\n\n| Key | Pad |\n|---|---|\n| Up \u002F Down arrows | throttle (RT) \u002F brake (LT) |\n| Left \u002F Right arrows | steering (eased: full lock in ~150 ms, back to centre in ~80 ms) |\n| I J K L | right stick (look around) |\n| Enter \u002F Space | A |\n| Esc \u002F Backspace | B |\n| F \u002F R | X \u002F Y (rewind) |\n| Tab \u002F C | Menu \u002F View |\n| Q \u002F E | LB \u002F RB |\n| H \u002F V | left \u002F right stick click |\n| W A S D | D-pad |\n\nKeys count only while the game window has focus; keyboard and controllers work together.\n`FH2_KEYBOARD=0` hands out Wine's gamepads unchanged.\n\n### Known issues\n\n- **Hang \u002F GPU reset crash**: the game can stop waiting for a value the GPU should have written\n  (Azimuth's \"the GPU passed the work that writes the value … and the value is not there\", or its\n  watchdog reporting its worker stuck). Before 0.1.1 this happened after 8–20 minutes: the layer\n  lost the immediate writes of command lists once more than 4096 lists had been created. The\n  remaining freezes were the `FlushProcessWriteBuffers` deadlock fixed in 0.1.5; please report it\n  if it still happens, with `azimuth.log` and `fh2port.log`.\n- **Stutter** in busy places (the buildings around Place Masséna in Nice, for example): fixed in\n  0.1.7, it was Wine's address search (see What's new). Please report it if you still see it, with\n  `fh2port.log`.\n- If the picture stops on **\"Press RT to accelerate\"** in the intro while the music goes on, the\n  game is waiting for RT: check that the controller is on, or click the game window and hold the Up arrow.\n- **MSAA** (anti-aliasing 2x\u002F4x in Azimuth's settings) draws dashes in the sky on D3DMetal: keep\n  it off and use a render height above your screen's instead (\"supersampled\"). Since 0.1.8 it no\n  longer stops the game in the car screens. The intro movies play (no intro skip).\n\n### Debugging\n\nLogs are in `data\u002Flogs` of the Azimuth folder (`fh2port.log`, `fh2pad.log`, `azimuth.log`) and\n`~\u002FLibrary\u002FLogs\u002FFH2Port\u002Flauncher.log`. Switches: `FH2_COUNT=1` (per-PSO draw counters),\n`FH2_TINT=1` (magenta twins of instanced PSOs for live bisection), `FH2_APPEND=0` (layouts passed\nthrough unfixed), `FH2_FIBER=0`, `FH2_TILED=1`, `FH2_SKIP_EI=1`, `FH2_SKIP_VID=1`, `FH2_PATCH=…`,\n`FH2_LABEL=\u003Caddress>` (traces the values written to that address through record, execute, signal\nand completion), `FH2_FLUSH=real|0|nolock|skip` (Wine's real flush, serialized as in 0.1.5–0.1.6 \u002F\nflush fix off \u002F timed without the lock \u002F replaced by a local fence, diagnostic only), `FH2_PLACE=0`\n(leave address placement to Wine), `FH2_VMSTATS=12` (every 10 s: virtual memory calls, their cost,\nshapes and callers), `FH2_QUIET=1` (no periodic log lines, control file not polled),\n`FH2_PRIO=\u003Cn>` (Windows priority threads are raised to; default 1, `0` leaves them alone),\n`FH2_MSAA8=0` (8x MSAA targets passed to D3DMetal as they are, which stops the car screens),\n`FH2_UPSCALE=0` (no upscaler), `FH2_SHARP=\u003Cstops>` (upscaler sharpening), `FH2_PRESENT=0` (dxgi left\nalone: no upscaler and no swap chain log lines), `FH2_MIN=1` (minimal mode: no D3D12 interception\nand no upscaler, the layer only does the fiber fix and the Wine-level fixes; for a complete D3D12\nimplementation under it, such as vkd3d-proton, whose D3DMetal workarounds do not apply),\n`FH2_FENCE_WAIT=\u003Cms>` (bounded wait for the GPU fence in the signal worker, `0` = no wait,\ndiagnostic) and `FH2_FENCE_TRACE=1` (fence steps logged, plus every 5 s where each queue's worker is).\nCalls into D3DMetal slower than 4 ms are logged as `slow:`. Live commands go through `data\u002Flogs\u002Ffh2port.ctl` (`top`, `reset`, `dump N`,\n`tint …`, `tintlist`, `tintset …`, `watch …`, `patch on|off`, `stacks` for the Windows-side call\nstack of every thread, useful when the game hangs).\n\n### License\n\n[MIT](LICENSE) for the code in this repository.\n\n---\n\n## Italiano\n\nQuesto progetto fa girare **Azimuth 1.0.4**, il wrapper di compatibilità di Almost There Games per\nla versione Xbox One di **Forza Horizon 2 (1.0.0.64)**, sui Mac Apple Silicon tramite **CrossOver**\ne **Game Porting Toolkit (D3DMetal)** di Apple. Azimuth è pensato per Windows e Linux; questo repo\naggiunge solo dei layer *sotto* di lui, come fanno DXVK o vkd3d sotto un gioco:\n\n- **`d3d12.dll`**: un layer D3D12 fra Azimuth e D3DMetal (caricato con un override DLL di Wine).\n- **`fh2pad.dll`**: il provider di `Windows.Gaming.Input.Gamepad` della bottle, con la tastiera.\n- **FH2 Port.app**: un launcher che installa entrambi in una bottle di CrossOver e avvia il gioco.\n\nSviluppato e provato su MacBook Pro M1 Max (32 GB), macOS 27.3, CrossOver su Wine 11 con GPTK\n4.0b3 e Azimuth 1.0.4 (anche la 1.0.2 e la 0.9.10 partono con questo layer). Mondo aperto, gare, menu, audio, controller e tastiera funzionano; con Azimuth a 60 fps e\n1440 righe il gioco sta intorno ai 60 fps ([video](https:\u002F\u002Fgithub.com\u002FfladnaG86\u002FFH2-Port-AppleSilicon\u002Freleases\u002Ftag\u002Fvideo)).\n**Anche Forza Horizon 3 (1.0.125.0) è giocabile** (giocato qui su Azimuth 1.0.4), e così **Forza\nMotorsport 6 (1.0.0.44)** (giocato sulla 1.0.2, non ancora riprovato sulla 1.0.4). Azimuth 1.0.4\ncorregge la luminosità di Forza Horizon 2 alle altezze di rendering diverse da 1080p, quindi conviene\naggiornare (vedi sotto).\n\n### Novità\n\n- **0.1.11**: **Forza Horizon 3 non si ferma più dopo circa un minuto su macOS 26** (PR #22 di\n  @FraSharp). Rosetta prima di macOS 27 chiude il processo quando un'istruzione AVX prende un page\n  fault (\"unexpectedly need to EmulateForward on a synchronous exception\"); ora l'avvio dichiara\n  l'AVX a Rosetta solo da macOS 27 in poi, e `ROSETTA_ADVERTISE_AVX` impostata nell'ambiente vale\n  ancora. Nuove opzioni: `FH2_MIN=1` modalità minima per un'implementazione D3D12 completa come\n  vkd3d-proton (PR #19 di @ssaltarenn), diagnostica delle fence `FH2_FENCE_WAIT` \u002F `FH2_FENCE_TRACE`\n  (PR #18 di @ssaltarenn). Su macOS 27 con le impostazioni predefinite non cambia nulla.\n- **0.1.10**: **immagine più nitida sugli schermi Retina con un upscaler spaziale** (giocato su M1\n  Max con Azimuth 1.0.4). Senza la Retina mode di Wine la finestra ha i punti dello schermo\n  (1728x1117 su un MacBook Pro 16\"): Azimuth renderizzava a 1440p, rimpiccioliva a 1117p e macOS\n  ingrandiva 2x. Con la Retina mode (`HKCU\\Software\\Wine\\Mac Driver`, `RetinaMode` = `y`, ora\n  impostata dall'installazione per tutta la bottle; `FH2_RETINA=0` la lascia com'è) la finestra ha i\n  pixel veri, e il layer ora dà ad Azimuth back buffer della sua altezza di rendering e li\n  ingrandisce alla finestra con due passaggi modellati su AMD FSR 1 (EASU, ingrandimento che segue i\n  bordi, + RCAS, nitidezza). Si spegne da solo quando l'altezza di rendering è pari o superiore a\n  quella della finestra (supersampling). `FH2_UPSCALE=0` lo spegne, `FH2_SHARP=\u003Cstop>` regola la\n  nitidezza (0 = massima, predefinito 0.25). Tastiera: la guida passa alle frecce, W A S D ora fanno\n  da D-pad.\n- **0.1.9**: **Forza Horizon 3 parte ed è giocabile** (1.0.125.0, giocato su M1 Max con Azimuth 1.0.2).\n  FH3 usa il runtime VC14 privato di Azimuth, che Wine sostituiva con le sue DLL builtin, e Azimuth\n  si fermava con \"Private VC14 runtime was overridden\". Ora l'installazione imposta `vcruntime140`,\n  `vcruntime140_1`, `msvcp140` e `concrt140` su native per `azimuth.exe`, e l'app reinstalla a ogni\n  cambio di versione, anche se le DLL del layer non cambiano.\n- **0.1.8**: con l'anti-aliasing attivo, **le schermate di personalizzazione, acquisto e\n  potenziamento auto non fermano più il gioco** (issue #15). Lo showroom chiede target MSAA 8x; le\n  GPU Apple arrivano a 4x, quindi D3DMetal non offre l'8x e Azimuth si fermava con \"the host takes\n  no 8 samples of format 10\". Ora il layer crea quei target e le loro pipeline a 4 campioni\n  (`FH2_MSAA8=0` lo disattiva). L'MSAA disegna ancora trattini nel cielo, quindi resta consigliato\n  tenere l'anti-aliasing spento.\n  - La correzione delle fiber trova i punti da sola e riconosce anche **Forza Horizon 2 Presents\n    Fast & Furious, Forza Horizon 3, Forza Motorsport 5 e 6** (PR #3 di @danielgpinheiro). **Forza\n    Motorsport 6 è giocabile**: con questo layer parte ed è stato giocato su M1 Max con Azimuth 1.0.2\n    (prima crashava sullo splash leggendo `0x8ff`). Qui sono stati provati Forza Horizon 2 e Forza\n    Motorsport 6.\n- **0.1.7**: **Azimuth 1.0.x** funziona (si bloccava dopo pochi minuti, issue #14) e **gli scatti\n  vicino ai palazzi sono spariti**.\n  - Azimuth 1.0 usa due code della GPU insieme. Il layer tratteneva i signal di tutte le code con un\n    solo fence e un solo thread, e una coda poteva finire ad aspettare l'altra; ora ogni coda ha i suoi.\n  - Gli scatti: nei punti affollati Azimuth riserva memoria con `VirtualAlloc2` chiedendo un\n    indirizzo fra 4 GB e 1 TB. Wine cerca spazio dal fondo dell'intervallo provando ogni 64 KB con\n    `mach_vm_map`, e subito sopra i 4 GB macOS ha Wine, Rosetta, D3DMetal e Metal: migliaia di\n    tentativi a vuoto, 40–170 ms a chiamata, 2–7 s ogni 10 s. Ora il layer sceglie un indirizzo\n    libero nella metà alta dell'intervallo e chiede proprio quello: meno di 1 ms.\n  - `FlushProcessWriteBuffers` non legge più i registri di ogni thread: un cambio di protezione di\n    una pagina (`mprotect` di macOS, chiamata diretta) svuota i buffer di scrittura degli altri core.\n    ~17 µs invece di ~1,8 ms, e non può bloccarsi in `thread_get_state` (visto una volta con un solo chiamante).\n- **0.1.6**: circa **metà degli scatti** nei punti affollati. Wine su macOS\n  fa girare i thread a priorità normale di Windows sotto le app native (priorità Mach 26 invece di\n  31), e lì stanno il worker di Azimuth e molti thread del gioco; ora il layer li porta al livello nativo.\n- **0.1.5**: corregge il **blocco casuale** (nessun Present, il watchdog di Azimuth segnala il\n  worker fermo) che arrivava dopo 1–30 minuti, nel filmato iniziale o in gioco. Wine su macOS\n  implementa `FlushProcessWriteBuffers` leggendo i registri di ogni thread; sotto Rosetta due thread\n  che lo fanno insieme si aspettano a vicenda per sempre. Ora il layer fa passare una chiamata alla volta.\n- **0.1.4**: il launcher trova anche **CrossOver Preview**. I passi di installazione non dicono più\n  di avviare prima `azimuth.exe` da CrossOver: senza il layer si ferma con errori heap \u002F DX12 prima\n  di chiedere la cartella del gioco. Apri invece FH2 Port; poi Azimuth chiede la cartella.\n- **0.1.3**: trova le bottle in una cartella Bottles personalizzata (per esempio su un SSD esterno),\n  e **Other bottle folder…** permette di scegliere a mano qualsiasi bottle.\n\n### Cosa fa il layer\n\n| Problema su D3DMetal | Cosa fa il layer |\n|---|---|\n| `OpenExistingHeapFromAddress` non è implementato, e Azimuth mette gli heap GPU sopra la memoria del gioco | Emulato: un heap visibile dalla CPU fa da specchio a quella memoria, sincronizzato a blocchi di 64 byte prima di ogni invio e dopo la GPU; i signal della coda aspettano che i dati siano visibili |\n| `WriteBufferImmediate` non fa nulla | Rieseguito sulla CPU prima del fence, oppure trasformato in una copia da un buffer di upload |\n| I signal trattenuti finché i dati sono visibili (riga sopra) devono seguire l'ordine di ogni coda; Azimuth 1.0 usa due code | Ogni coda ha fence, lista e thread propri |\n| Azimuth parte solo se il device dichiara existing heaps e resource binding tier 3 | Entrambi dichiarati supportati (gli existing heaps sono l'emulazione qui sopra) |\n| Le tiled resource non fanno aliasing | Dichiarate non supportate, così Azimuth usa un'altra strada |\n| `FlushProcessWriteBuffers` (Wine su macOS legge i registri di ogni thread) si blocca sotto Rosetta se due thread la chiamano insieme, e costa ~1,8 ms a chiamata | `NtFlushProcessWriteBuffers` di ntdll è agganciata in memoria: un chiamante alla volta, e un cambio di protezione di una pagina (`mprotect` di macOS) al posto della lettura dei registri |\n| Wine cerca un indirizzo che rispetti i requisiti di `VirtualAlloc2` di Azimuth (4 GB–1 TB) provando ogni 64 KB dal fondo, attraverso la memoria di macOS: fino a 170 ms a chiamata | `NtAllocateVirtualMemoryEx` di ntdll è agganciata: il layer sceglie un indirizzo libero nella metà alta dell'intervallo e chiede quello; la ricerca di Wine resta come ripiego |\n| I thread a priorità normale di Windows ricevono priorità Mach 26, sotto il 31 delle app native | Ogni 2 s i thread sotto above-normal vengono portati ad above-normal (Mach 31) |\n| **I layout con `D3D12_APPEND_ALIGNED_ELEMENT` su più vertex buffer ricevono offset sbagliati.** Nel layout degli oggetti del mondo `I_YAXIS` viene letto 28 byte e `I_COLOUR` 56 byte più avanti | Gli offset vengono scritti per ogni slot prima di passare il layout a D3DMetal. Questo corregge i \"muri fantasma\" giganti, gli alberi neri o capovolti, i pali storti e le sponde disallineate |\n\nIl bug dei layout ha una riproduzione autonoma, `layout_test` in `src\u002Fd3d12\u002Fd3d12.c`, eseguita da\n`tools\u002Ffh2test.c`: con offset append-aligned 17 istanze su 17 leggono attributi sbagliati, con\noffset espliciti 0 su 17.\n\nAnche il gioco ha bisogno di una correzione su Wine per macOS: legge la fiber corrente con\n`mov reg, gs:[0x20]`, che lì non arriva al TEB. Il layer reindirizza quelle letture **in\nmemoria**, dopo che Azimuth ha caricato il gioco; i file del gioco su disco restano intatti.\n\nNon è solo Forza Horizon 2: la stessa lettura è in **Forza Horizon 2 Presents Fast & Furious**\n(`Spire_1.0.0.6`), **Forza Horizon 3** (`Opus_1.0.125.0`), **Forza Motorsport 5**\n(`Forza_1.0.0.20`, duecento letture) e **Forza Motorsport 6** (`Monument_1.0.0.44`), e ogni build le\nmette ad indirizzi e in registri diversi. Il layer riconosce quindi un titolo solo dal timestamp PE e\ndalla dimensione dell'immagine, e trova i punti da solo: scansiona le sezioni eseguibili\ndell'immagine del gioco cercando `65 REX.W 8b modrm(SIB) 25 20 00 00 00`, trasforma quelli che trova\nin un salto a una cave nel padding `int3` della sezione (una cave per registro) e sistema il resto\nman mano che l'immagine arriva. Nel log: `game image found at … (Forza Horizon 3 1.0.125.0)` e\n`fiber fix: 12 inline fiber reads rerouted … (…)`. Una build non riconosciuta resta intatta, e un\ntitolo nuovo costa due numeri in `known_images[]`: il suo timestamp e la dimensione dell'immagine.\n\n### Installazione con l'app\n\n1. In CrossOver (o CrossOver Preview) crea una bottle **Windows 10 64-bit** e copia la cartella di\n   Azimuth nel suo `drive_c` (il nome della cartella è libero). Dal Terminale, con una bottle\n   chiamata `fh2` e Azimuth scompattato in Download:\n   ```sh\n   ditto ~\u002FDownloads\u002Fazimuth-windows \"$HOME\u002FLibrary\u002FApplication Support\u002FCrossOver\u002FBottles\u002Ffh2\u002Fdrive_c\u002FAzimuth\"\n   ```\n   Non avviare `azimuth.exe` da CrossOver: senza il layer si ferma ai controlli D3D12 (errori\n   heap \u002F DX12) prima di chiedere la cartella del gioco.\n2. Metti **`d3dcompiler_47.dll`** di Microsoft nella cartella di Azimuth (quello di Wine non compila\n   il suo shader di detile). Non è incluso; si trova per esempio nella cartella `core\u002F`\n   dell'installer Windows 64-bit di Firefox 62.\n3. Apri la DMG dalle [Release](..\u002F..\u002Freleases), trascina **FH2 Port** in Applicazioni e aprila.\n   Non è notarizzata: la prima volta clicca \"Fine\", poi Impostazioni di Sistema › Privacy e\n   sicurezza › **Apri comunque**.\n4. Scegli la bottle e poi la cartella che contiene `azimuth.exe`. L'app installa il layer e avvia\n   Azimuth, che la prima volta chiede la cartella del gioco (dopo riapri l'app una volta perché\n   applichi le sue impostazioni); le volte dopo basta il doppio clic. La cartella del gioco deve\n   essere una cartella vera: Azimuth rifiuta i link simbolici (copiala, oppure fai un clone APFS con\n   `cp -c -R`). Wine mostra la tua cartella home come un'unità (spesso **Y:**): è lì che trovi un\n   gioco tenuto nella home. Tieni premuto **Opzione** mentre la apri per\n   scegliere di nuovo o per disinstallare. Trova anche le bottle in una cartella Bottles\n   personalizzata (per esempio su un disco esterno); altrimenti scegli **Other bottle folder…** e\n   indica la cartella della bottle.\n\nL'app imposta anche `antialiasing=off` (con l'MSAA il cielo ha dei trattini su D3DMetal) e\n`resolution=1440`, che fa supersampling e ammorbidisce i bordi.\n\n### Aggiornare Azimuth senza perdere i salvataggi\n\nI salvataggi stanno in ogni cartella di Azimuth (`data\u002Ftitles\u002F1A96545B\u002Fsaves`). Chiudi prima il\ngioco, poi:\n\n- scompatta il nuovo Azimuth **sopra** la cartella vecchia: restano `data\u002Ftitles`,\n  `data\u002Fazimuth.ini` (che Azimuth converte da solo), `d3dcompiler_47.dll` e il layer. `ditto` unisce\n  le cartelle e non cancella niente; nel Finder scegli **Unisci** per `data`, mai **Sostituisci**,\n  che cancellerebbe i salvataggi:\n  ```sh\n  ditto ~\u002FDownloads\u002Fazimuth-windows \"$HOME\u002FLibrary\u002FApplication Support\u002FCrossOver\u002FBottles\u002F\u003Cbottle>\u002Fdrive_c\u002F\u003Ccartella>\"\n  ```\n- oppure installalo in una **cartella o bottle nuova** (passi sopra) e copia `data\u002Ftitles` dalla\n  cartella vecchia prima del primo avvio:\n  ```sh\n  B=\"$HOME\u002FLibrary\u002FApplication Support\u002FCrossOver\u002FBottles\"\n  ditto \"$B\u002F\u003Cbottle vecchia>\u002Fdrive_c\u002F\u003Ccartella vecchia>\u002Fdata\u002Ftitles\" \"$B\u002F\u003Cbottle nuova>\u002Fdrive_c\u002F\u003Ccartella nuova>\u002Fdata\u002Ftitles\"\n  ```\n\nPoi apri FH2 Port tenendo premuto **Opzione** e scegli la cartella nuova se è cambiata: l'app ci\ninstalla il layer. Aggiornare FH2 Port non tocca mai i salvataggi. Copiare prima `data\u002Ftitles` da\nun'altra parte è un backup che costa poco.\n\n### Installazione a mano\n\nComandi nella sezione inglese: `make`, poi `scripts\u002Finstall.sh --settings` e `scripts\u002Frun.sh` con\n`BOTTLE` e `AZDIR`. `install.sh --uninstall` annulla tutto; `tools\u002Fapp\u002Fmake_app.sh \u003Cversione>`\ncostruisce app e DMG.\n\n### Tastiera\n\n| Tasto | Pad |\n|---|---|\n| Freccia su \u002F giù | acceleratore (RT) \u002F freno (LT) |\n| Freccia sinistra \u002F destra | sterzo (graduale: fine corsa in ~150 ms, ritorno al centro in ~80 ms) |\n| I J K L | stick destro (guardarsi intorno) |\n| Invio \u002F Spazio | A |\n| Esc \u002F Backspace | B |\n| F \u002F R | X \u002F Y (rewind) |\n| Tab \u002F C | Menu \u002F View |\n| Q \u002F E | LB \u002F RB |\n| H \u002F V | click stick sinistro \u002F destro |\n| W A S D | D-pad |\n\nI tasti contano solo quando la finestra del gioco ha il focus; tastiera e controller funzionano\ninsieme. `FH2_KEYBOARD=0` lascia i gamepad di Wine come sono.\n\n### Problemi noti\n\n- **Blocco \u002F crash con reset della GPU**: il gioco può fermarsi in attesa di un valore che la GPU\n  avrebbe dovuto scrivere (\"the GPU passed the work that writes the value … and the value is not\n  there\" di Azimuth, oppure il suo watchdog che segnala il worker bloccato). Prima della 0.1.1\n  succedeva dopo 8–20 minuti: il layer perdeva le scritture immediate delle command list dopo che\n  ne erano state create più di 4096. I blocchi rimasti erano lo stallo di\n  `FlushProcessWriteBuffers` corretto nella 0.1.5; se succede ancora, segnalalo con `azimuth.log` e\n  `fh2port.log`.\n- **Scatti** nei punti affollati (per esempio i palazzi intorno a Place Masséna a Nizza): corretti\n  nella 0.1.7, erano la ricerca di indirizzi di Wine (vedi Novità). Se li vedi ancora segnalalo con\n  `fh2port.log`.\n- Se nell'intro l'immagine si ferma su **\"Premi RT per accelerare\"** mentre la musica continua, il\n  gioco aspetta RT: controlla che il controller sia acceso, oppure clicca la finestra del gioco e tieni premuto Freccia su.\n- **MSAA** (anti-aliasing 2x\u002F4x nelle impostazioni di Azimuth): su D3DMetal disegna trattini nel\n  cielo. Tienilo spento e usa invece un'altezza di rendering superiore a quella dello schermo\n  (\"supersampled\"). Dalla 0.1.8 non ferma più il gioco nelle schermate auto. I filmati iniziali\n  vengono riprodotti (niente salto dell'intro).\n\n### Licenza\n\n[MIT](LICENSE) per il codice di questo repository.\n\n## Support \u002F Supporto\n\nIf this project is useful to you, you can support my work by buying me a coffee and\u002For starring this repository, which helps other Mac players find it.\n\nSe questo progetto ti è utile, puoi sostenere il mio lavoro offrendomi un caffè e\u002Fo mettendo una stella al repository, così altri giocatori Mac lo trovano più facilmente.\n\n\u003Cp>\n  \u003Ca href=\"https:\u002F\u002Fko-fi.com\u002Fmauriziolante\">\u003Cimg src=\".github\u002Fassets\u002Fsupport-kofi.svg\" height=\"44\" alt=\"Buy me a coffee on Ko-fi\">\u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fwww.linkedin.com\u002Fin\u002Fmaurizio-lanterna-1a519323b\u002F\">\u003Cimg src=\".github\u002Fassets\u002Fsupport-linkedin.svg\" height=\"44\" alt=\"Maurizio on LinkedIn\">\u003C\u002Fa>\n\u003C\u002Fp>\n","这是一个为 Apple Silicon Mac 适配 Forza Horizon 系列游戏（特别是 Horizon 2\u002F3、Motorsport 6）的兼容性补丁项目，通过 CrossOver + Apple Game Porting Toolkit（D3DMetal）实现运行。核心包含自研 D3D12 层（d3d12.dll）、键盘模拟游戏手柄组件（fh2pad.dll）及一键配置启动器（FH2 Port.app），不包含任何游戏文件或授权内容。技术上基于 Wine 架构，利用 Metal 后端实现 DirectX 12 API 转译，并针对 macOS 26+\u002F27 和 M1\u002FM2\u002FM3 硬件优化帧率、分辨率适配与 AVX 兼容性。适用于拥有合法 Xbox One 版 Forza 游戏及 Azimuth 工具的 macOS 用户在原生 ARM 设备上本地运行。","2026-11-24 04:52:19","CREATED_QUERY"]