Skip to content

Fix AudioOut stop buffer release, add Unity 2019 ComputeShaders and Pokémon Brilliant Diamond - #190

Closed
widestorm wants to merge 2 commits into
seedds:mainfrom
widestorm:pokemon-bd-support
Closed

widestorm wants to merge 2 commits into
seedds:mainfrom
widestorm:pokemon-bd-support

Conversation

@widestorm

Copy link
Copy Markdown

Summary

Adds Pokémon Brilliant Diamond 1.0.0 (0100000011D90000) support and the generic fixes required to bring it up on the Mac host.

Tested on Apple M4.

SDK 11.4.3 AddressRegionManager

Adds the existing AddressRegionManager node-area reduction for SDK build:

2d369d9999e3e10e665106f840ffff9b

Without the cut, nninitStartup aborts in StandardAllocator::Initialize before reaching nnMain.

The two node-area constants are changed from 0x3fe00000 to 0x3e00000, following the existing fix used by other affected SDK builds.

Unity 2019.4 ComputeShader support

Brilliant Diamond uses Unity 2019.4.27f1.

Adds the ComputeShader class 72 layout for type hash:

1a95529ac2eb1a97cd9d2a4356bd722f

Unity 2019 stores program code directly in each kernel rather than through uniqueVariants or variantMap, so shader_split.py now handles that layout as well.

Before the fix, the built-in Internal-Skinning and Internal-BlendShape compute shaders were omitted.

Shader count increases from:

14,366 → 14,385

The runtime-missing shader:

2c1e06378edbd813

is now mapped as:

/Data/Resources/unity default resources#Internal-Skinning#main.0

This fixes the missing animated character models during the opening sequence.

AudioOut stop / FMOD deadlock

During the transition after character selection, FMOD stopped its AudioOut while four buffers were still pending:

pending=4 released=0

StopAudioOut previously stopped the backend without returning those pending buffers.

The FMOD audio-output thread consequently waited indefinitely for its buffer-release event, while the main thread waited indefinitely for the FMOD thread to terminate.

StopAudioOut now:

  • stops the backend;
  • moves remaining pending buffers to the released queue;
  • resets the partial-buffer position; and
  • notifies the buffer-release event.

This allows FMOD to reclaim its outstanding buffers and terminate its audio-output thread normally. The game then proceeds past the character-selection transition.

Game profile

Adds the Pokémon Brilliant Diamond 1.0.0 profile:

0100000011D90000

Build IDs:

  • main: f87fc6075104ec4d9642a4aa6bb22216
  • subsdk0: 507f19d1240d09d00992248e8a0fd77e
  • sdk: 2d369d9999e3e10e665106f840ffff9b

Validation

Verified on the Mac host that:

  • nninitStartup completes and reaches nnMain;
  • all 14,385 discovered shaders build successfully;
  • the previously missing skinning compute shader is mapped;
  • Professor Rowan and the character models render correctly;
  • the character-selection transition completes without the previous FMOD deadlock; and
  • gameplay proceeds beyond the opening sequence.

@widestorm widestorm changed the title Pokémon Brilliant Diamond 1.0.0 support Fix AudioOut stop buffer release, add Unity 2019 ComputeShaders and Pokémon Brilliant Diamond Oct 25, 2026
@seedds

seedds commented Oct 26, 2026

Copy link
Copy Markdown
Owner

Closing as superseded by ecbeae1, which adds the upstream Pokémon Brilliant Diamond 1.3.0 port and includes the shared SDK allocator cut, Unity 2019.4 compute-shader support, and the general AudioOut stop fix. The game note credits this PR for the independent 1.0.0 findings and the AudioOut/FMOD diagnosis.

This closes the PR without merging its branch. Its 1.0.0 shader tables and Mac validation remain useful evidence here; upstream currently registers 1.3.0, so this closure does not claim that 1.0.0 is registered or revalidated on current main. Thanks for the contribution.

@seedds seedds closed this Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants