Skip to content

feat(profile): add The Patrick Star Game (01008AF01AD22000) and HLE account fix - #2069

Open
idanfilmedit-art wants to merge 1 commit into
seedds:mainfrom
idanfilmedit-art:main
Open

idanfilmedit-art wants to merge 1 commit into
seedds:mainfrom
idanfilmedit-art:main

Conversation

@idanfilmedit-art

@idanfilmedit-art idanfilmedit-art commented Nov 9, 2026 •

Copy link
Copy Markdown

Bring up The Patrick Star Game (01008AF01AD22000)

Summary

Adds a game profile (dm/games/01008AF01AD22000/game.tsv) and an nn::account::GetUserId HLE fix (dm/host/hle_account.c) to bring The Patrick Star Game (01008AF01AD22000, v1.0.1 / v1, Unity 2022.3 IL2CPP + FMOD, SDK 16.2.4) to an active, rendering in-game state on macOS Apple Silicon.

Screenshot (In-Game / Verification)

צילום מסך 2026-11-09 ב-22 54 13

Root Causes & Changes

  1. Host HLE (dm/host/hle_account.c — nn::account::GetUserId):

    • Symptom: Immediate SIGABRT (exit code 134) during early initialization before creating an NVN window or presenting any frames:
      [RED] FATAL account::GetUserId: the handle was not issued by the host (0)
    • Root Cause: In sub_3f1cbb0 (main+0x3f1ccc0), the title calls nn::account::Initialize(), zero-initializes a 16-byte nn::account::Uid and a 24-byte nn::account::UserHandle on the stack (stp xzr, xzr, [sp, #0x38]; str xzr, [sp, #0x48]), and invokes nn::account::GetUserId(&uid, &userHandle) directly without calling TryOpenPreselectedUser or OpenPreselectedUser first.
    • Fix: When h->v[2] != HANDLE_MAGIC, return the host's fixed local user UID (*out = k_uid; return RES_OK;) instead of aborting via die(). Valid handles issued by TryOpenPreselectedUser / OpenPreselectedUser / OpenUser continue to return h->v[0..1] unchanged.
  2. Game Profile (dm/games/01008AF01AD22000/game.tsv — stdalloc_cap):

    • Symptom: SIGSEGV at main+0x10fe9a0 (str x19, [x22] with x22 = 0x0) at frame 15 during initial Unity scene and shader warmup.
    • Root Cause: The NPDM declares 16 MB of system resource (sys_resource = 0x1000000), enabling virtual address memory. Unity's nninitStartup (main+0x111fc00..0x111fc60) queries TotalMemorySize - UsedMemorySize (3.2 GB - 64 MB = 3.14 GB) and passes the entire size to nn::mem::StandardAllocator::Initialize(nullptr, size). Because StandardAllocator reserves 3.14 GB of virtual address space inside the 4.375 GB alias region (mem_alias = 0x118000000), subsequent nn::os::AllocateAddressRegion calls by Unity's internal allocators exhaust the remaining 1.18 GB alias space at +4.26 GB / 4.38 GB and return NULL.
    • Fix: Set stdalloc_cap 0x3c000000 (960 MB, matching the 1 GB-pool Unity 2022.3 profiles) while preserving the 3.2 GB application pool (app_pool 0xcd500000). StandardAllocator reserves 0.94 GB of virtual address space ([+0.06 GB, +1.00 GB)), leaving 3.38 GB in the alias region for Unity's own address regions.
    • Disabled Unreal Engine overrides (ue_texture_pool / ue_fps_cvar omitted) and set romfs_marker to Data/resources.assets.

Verification on macOS ARM64

  • Hardware / OS: Apple M1 (MacBookAir10,1), macOS 26.1 (25B78), Metal 4 (MTL4Compiler + applegpu_g13g.mtl4a pipeline archive, 581 archived PSOs).
  • Boot & Gameplay Metrics:
    • nn::account::GetUserId succeeds with local user UID; save:/ mounts and commits cleanly.
    • Intro movies (1920x1080 and 960x540 H.264 / AAC via subsdk0 NintendoSDK_movie) decode through VideoToolbox and play smoothly.
    • Reaches title screen and enters gameplay cleanly (tested past frame 1,200+ over 60 seconds at 30 fps target, present interval 2).
    • Alias region virtual address high-water mark stays at +2.75 GB / 4.38 GB (0.98 GB mapped, 1.59 GB resident, 376 MB GPU memory) with zero crashes or allocation failures.

Impact Report

  • Evaluated via python3 scripts/regress.py impact:
    • Only dm/host/hle_account.c (h_acc_GetUserId / _ZN2nn7account9GetUserIdEPNS0_3UidERKNS0_10UserHandleE) and dm/games/01008AF01AD22000/game.tsv (profile) are touched.
    • 3 profiles with usage manifests reference _ZN2nn7account9GetUserIdEPNS0_3UidERKNS0_10UserHandleE (01007EF00011E000 Breath of the Wild, 0100A3D008C5C000 Pokémon Scarlet, 0100F2C0115B6000 Tears of the Kingdom).
    • For all existing titles that pass a host-issued UserHandle (h->v[2] == HANDLE_MAGIC), behavior is bit-for-bit identical.
game status what it uses of the change
The Legend of Zelda: Breath of the Wild 01007EF00011E000 affected hle: _ZN2nn7account9GetUserIdEPNS0_3UidERKNS0_10UserHandleE ×20
Pokémon Scarlet 0100A3D008C5C000 affected hle: _ZN2nn7account9GetUserIdEPNS0_3UidERKNS0_10UserHandleE ×2
The Legend of Zelda: Tears of the Kingdom 0100F2C0115B6000 affected hle: _ZN2nn7account9GetUserIdEPNS0_3UidERKNS0_10UserHandleE ×4
Hades 0100535012974000 not affected

@github-actions github-actions Bot added host The Horizon host: SVCs, services, threads, memory (dm/host) game: 01008AF01AD22000 A game profile new game Adds a game profile that main does not have yet labels Nov 9, 2026
@idanfilmedit-art
idanfilmedit-art marked this pull request as draft November 10, 2026 16:12
@idanfilmedit-art
idanfilmedit-art marked this pull request as ready for review November 10, 2026 16:12
@idanfilmedit-art
idanfilmedit-art marked this pull request as draft November 10, 2026 16:31
@idanfilmedit-art
idanfilmedit-art marked this pull request as ready for review November 10, 2026 16:32
@idanfilmedit-art
idanfilmedit-art marked this pull request as draft November 10, 2026 16:33
@idanfilmedit-art
idanfilmedit-art marked this pull request as ready for review November 10, 2026 16:39
@github-actions github-actions Bot added the docs Documentation label Nov 17, 2026
@idanfilmedit-art
idanfilmedit-art force-pushed the main branch 2 times, most recently from 61ba09d to 637c5a2 Compare November 17, 2026 12:42
@github-actions github-actions Bot added the nvn NVN on Metal and its tests (dm/gfx/nvn, dm/gfx/tests) label Nov 17, 2026
Unity engine profile with main, subsdk0, sdk modules and Data/resources.assets RomFS marker for title 01008AF01AD22000. Verified playable in-game on Apple Silicon.
@github-actions github-actions Bot added the tools Tools and scripts (dm/tools, scripts) label Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation game: 01008AF01AD22000 A game profile host The Horizon host: SVCs, services, threads, memory (dm/host) new game Adds a game profile that main does not have yet nvn NVN on Metal and its tests (dm/gfx/nvn, dm/gfx/tests) tools Tools and scripts (dm/tools, scripts)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant