mirror of
https://github.com/seedds/nxnative.git
synced 2026-11-23 11:39:42 -10:00
games/dream-buffet: order dependent module initialization
BaseSystem creates GamePauseManager while Info setup caches it, but the game queues both in one parallel initialization batch. Complete BaseSystem through the existing queue before Info and Decor are submitted. Match the native Add, ExecuteAndWait and task-runner functions, and restrict the added dependency boundary to the exact Modules/BaseSystem task. Register the tested base profile, document the diagnosis and add an ARM64 replay of the emitted wrapper. Refs #1569 Co-authored-by: Haitham Alshari <[email protected]>
This commit is contained in:
1 parent
bf93977b89
commit
2925d7afec
14 files changed
+8489
No files matched your search
@@ -0,0 +1,45 @@
|
||||
# Kirby's Dream Buffet (`0100A8E016236000`)
|
||||
|
||||
Base game 1.0.0 (v0), SDK 13.3.0, HAL Laboratory's engine and Basil scripts on NintendoWare, NVN. Modules `main`, `subsdk0` (NintendoSDK_movie) and `sdk`. Plays on the Mac through the intro, title and the standing-still hub scene. Races and iOS are untested.
|
||||
|
||||
## What it needs
|
||||
|
||||
| Setting | Where | Why |
|
||||
|---|---|---|
|
||||
| `mem_reserve 0x100000000`, `mem_alias 0x10000000`, `mem_stack 0x10000000`, `app_pool 0xCD500000` | [`game.tsv`](game.tsv) | no system resource; the game sets a 3.14 GB heap in the 3.25 GB heap region |
|
||||
| `modules main subsdk0 sdk` | `game.tsv` | the game demuxes its WebM with NintendoSDK_movie; the host decodes VP9 video and Vorbis audio |
|
||||
| BaseSystem initialization before dependent Info setup | [`patches.py`](patches.py) | the game's parallel initialization caches a manager before the job that creates it finishes; see below |
|
||||
|
||||
The profile contains 4,503 shaders, all built for the Mac. No frame-step patch or shared-host behavior switch is needed.
|
||||
|
||||
## Intro transition: initialization dependency
|
||||
|
||||
**Resolved ([issue #1569](https://github.com/seedds/nxnative/issues/1569)).** Both skipping the intro and letting it finish crashed at `main+0x7f23ec`, address `0x8`, LR `main+0x7f14d8`. On an M4 Pro the original code failed after 7.6 s with `DM_KEYS=5:Plus`, and after 38.4 s without input. The font errors were separately resolved before these runs.
|
||||
|
||||
The fault is Basil's integer member-load instruction: `Scn.Step.Info.RewardGet.MasterImpl.OnUpdate()` reads `_gamePause.__bf_IsPause`, but `_gamePause` is null. Its `OnSetup()` caches `Scn.Step.Modules.GamePauseManager`. `Modules.Initialize()` queues `InitializeBaseSystem`, `InitializeInfo` and `InitializeDecor` in one parallel batch; BaseSystem creates the manager while Info calls the dependent UI setup. A targeted trace captured the null cache assignment at 6.9021 s on one worker, then the source manager's initialization at 6.9029 s on another, followed by the exact crash. Both workers belong to that same batch. The native queue claims tasks under its mutex and waits for every worker's completion LightEvent before returning; both events start unsignalled and clear automatically.
|
||||
|
||||
This is a dependency in the game's own code. The existing movie Stop/destructor fences do not order these jobs, and `DM_PREEMPT=1` still reproduced the crash. Shared decoder/event code is left alone. Logging before the source read can hide the race by changing timing; it is not a fix.
|
||||
|
||||
The function-matched game patch wraps the native `Parallel.Manager.Add` binding. After the original Add, only the exact `Scn.Step.Modules` / `InitializeBaseSystem` task invokes the game's own `ExecuteAndWait`, using its original VM-call context. The caller then queues Info and Decor for its existing parallel batch. Other classes and methods retain their original queue behavior. Complete-function fingerprints locate Add, ExecuteAndWait and the task runner that proves the instance/type-name layout; a missing or ambiguous function installs no patch. There are no fixed addresses or game checks in the host, no sleep, movie skip or null guard. The binding is **game**, at its loosest correct scope: other Basil games do not establish this initialization dependency.
|
||||
|
||||
The extra queue wait occurs during module initialization. The short name predicate also runs for other Add calls; its CPU cost is estimated negligible, while the change in scene-loading time from ordering the dependent jobs has not been measured.
|
||||
|
||||
For the inspected v0, native Add is `main+0x76b2f0`, ExecuteAndWait `main+0x76b3e8`. In `basil/ScnCommon.bin`, Modules.Initialize queues the three jobs at `0x3ae28`, `0x3ae34`, `0x3ae40` and waits at `0x3ae48`; BaseSystem assigns GamePauseManager at `0x3bb8c`; RewardGet.OnSetup caches it at `0x45faac`; OnUpdate reads it at `0x45fc74` and its IsPause field at `0x45fc7c`. These offsets describe this build; patch placement uses the reviewed function fingerprints.
|
||||
|
||||
## Mac routes
|
||||
|
||||
- Build the base with `scripts/build_ipa_from_nsp.py <NSP folder> -k <prod.keys> --package v0 --platform mac`; the last command runs it. The tested input folder contains only the base NSP.
|
||||
- From an empty save, no input lets the intro finish; `DM_KEYS=5:Plus` skips it. Both routes must reach the scene after the movie without the null read.
|
||||
- `A` at the title enters the hub. The tested route is `DM_KEYS=5:Plus,10:A`; it leaves Kirby standing on the starting plate, facing Main Menu.
|
||||
|
||||
## Testing
|
||||
|
||||
- 2026-11-17, Apple M4 Pro (Mac16,7): original natural and skip routes reproduce the same crash. An ARM64 instruction replay verifies the inserted dependency boundary, unchanged queuing of Info/Decor and unrelated tasks, exact class/method matching, original context arguments, aligned stacks and preserved callee-saved registers.
|
||||
- The fixed game, with no probes: the skip route reaches the title and continues presenting through 30 s; natural completion reaches the same title and continues through 60 s. A visible HUD-enabled 180 s title run also returns from two further attract-movie cycles without the crash. Another visible run enters the hub with `A`; its screenshot shows Kirby standing on the starting plate. These runs verify the transition and initial scene, not a completed race.
|
||||
- All 4,503 Mac shaders are ready; the NSP script builds from the registered profile. The registry/matcher tests and Python lint/type ratchet pass. Final review added the task-runner matcher precondition; rewriting the real module with it is byte-identical to the live-tested code.
|
||||
|
||||
## Open
|
||||
|
||||
- The supplied v65536 update fails to layer over this base with `ResultFsInvalidArgument (2002-6001)` in `OpenRawStorageWithPatch`; no update was tested. Its extraction failure also occurred in the original report and is separate from the base game's crash.
|
||||
- The transition still logs a texture-type mismatch for shader `6927d8e65dd8ffe2_b`, slot 1. The captured title and hub look correct; other uses of that shader are unchecked. We should leave it for this fix.
|
||||
- iOS, multiplayer and later gameplay are untested.
|
||||
@@ -0,0 +1 @@
|
||||
# generated
|
||||
|
@@ -0,0 +1,35 @@
|
||||
# Kirby's Dream Buffet 1.0.0 (SDK 13.3.0, HAL Laboratory, NVN).
|
||||
# Initialization ordering: patches.py and README.md.
|
||||
|
||||
# ---- Identity ----
|
||||
title_id 0100A8E016236000
|
||||
program_id 0100A8E016236000
|
||||
|
||||
# ---- App ----
|
||||
name Kirby's Dream Buffet
|
||||
ipa KirbysDreamBuffet.ipa
|
||||
app_category public.app-category.games
|
||||
|
||||
# ---- Versions ----
|
||||
build v0 1.0.0 main=82af4e16bbc0bec8df70cd03e99bfc8c subsdk0=7e9f31f59e001cf5d9b546ffb233f480 sdk=2bf3519216f5b9d3e8ce26863c2e98b6
|
||||
package v0
|
||||
shader_versions v0
|
||||
|
||||
# ---- Files ----
|
||||
# every module main imports from
|
||||
modules main subsdk0 sdk
|
||||
romfs_marker basil/ScnCommon.bin
|
||||
zip_store .bfstm:.opus:.webm:.metallib
|
||||
|
||||
# ---- Memory ----
|
||||
# main sets a heap of at most the pool − 64 MB: a 3328 MB heap region
|
||||
mem_reserve 0x100000000
|
||||
mem_alias 0x10000000
|
||||
mem_stack 0x10000000
|
||||
app_pool 0xCD500000
|
||||
# the NPDM declares 0 MB of system resource: IsVirtualAddressMemoryEnabled is false, as on Horizon (Big Brain Academy: Brain vs. Brain sets a heap only then)
|
||||
sys_resource 0x0
|
||||
|
||||
# ---- Shader split ----
|
||||
shader_groups /ubin/=ubin /gfx/=gfx /msg/=msg /snd/=snd /yaml/=yaml /lyt/=lyt /hidvib/=hidvib /font/=font /ptcl/=ptcl /shader/=shader /exlyml/=exlyml /param/=param /basil/=basil /fdg/=fdg /mov/=mov
|
||||
shader_note Kirby's Dream Buffet shaders
|
||||
|
@@ -0,0 +1,84 @@
|
||||
"""Kirby's Dream Buffet: order the dependent module initialization jobs."""
|
||||
import struct
|
||||
|
||||
from nso_asm import ADDI, ADRP, B, BEQ, BL, BLR, CBNZW, LDP_POST, LDRX, LDUR, STP_PRE, STRX
|
||||
|
||||
# Modules.Initialize queues BaseSystem, Info and Decor together. Info's
|
||||
# RewardGet.OnSetup caches the GamePauseManager before BaseSystem creates it:
|
||||
# OnUpdate then reads __bf_IsPause through null (main+0x7f23ec on 1.0.0).
|
||||
# Complete the BaseSystem job through the game's own queue, before its caller
|
||||
# submits Info and Decor. The remaining jobs still run in parallel. The native
|
||||
# bindings and task runner are matched as complete functions; the runner proves
|
||||
# the instance/type-name layout. The extra wait also requires the
|
||||
# exact class and method names, since this queue serves unrelated frame work.
|
||||
|
||||
|
||||
def initialize_base_system(ctx):
|
||||
"""Complete BaseSystem before the caller queues dependent Info setup."""
|
||||
execute = ctx.others.get('execute and wait')
|
||||
if execute is None or ctx.others.get('task runner') is None:
|
||||
return # The matcher already reported the missing companion; install nothing.
|
||||
add = ctx.base
|
||||
ctx.site(add, 'ff0302d1') # sub sp,sp,#0x80
|
||||
ctx.site(execute, 'fd7bbda9') # stp x29,x30,[sp,#-0x30]!
|
||||
start, words, labels = ctx.here(), [], {}
|
||||
|
||||
def label(name):
|
||||
labels[name] = start + 4 * len(words)
|
||||
|
||||
def address(register, name):
|
||||
words.append(lambda pc: ADRP(register, pc, labels[name]))
|
||||
words.append(lambda pc: ADDI(register, register, labels[name] & 0xfff))
|
||||
|
||||
def match_string(name):
|
||||
address(10, name)
|
||||
label(name + ' loop')
|
||||
words.extend((0x3840152b, 0x3840154c, 0x6b0c017f)) # ldrb w11,[x9],#1; ldrb w12,[x10],#1; cmp w11,w12
|
||||
words.append(lambda pc: BEQ(pc, labels['return']) | 1) # b.ne return
|
||||
words.append(lambda pc: CBNZW(11, pc, labels[name + ' loop']))
|
||||
|
||||
# Keep the original native-call context across Add, whose x0 result is not
|
||||
# the context. Its argument slots remain {queue, instance, method name}.
|
||||
words.extend((STP_PRE(29, 30, 31, -0x20), 0x910003fd, STRX(0, 31, 2)))
|
||||
words.append(lambda pc: BL(pc, labels['original']))
|
||||
words.extend((LDRX(0, 31, 2), LDRX(8, 0), LDRX(8, 8, 0x88 // 8), LDRX(9, 8, 2)))
|
||||
# Null names/instances are not the Modules task; compare the full names,
|
||||
# including NUL, so unrelated tasks and similarly named classes keep Add.
|
||||
words.append(lambda pc: CBNZW(9, pc, labels['return']) ^ 0x81000000) # cbz x9,return
|
||||
match_string('method')
|
||||
words.append(LDRX(9, 8, 1))
|
||||
words.append(lambda pc: CBNZW(9, pc, labels['return']) ^ 0x81000000) # cbz x9,return
|
||||
words.extend((LDUR(9, 9, -8), LDRX(9, 9, 1)))
|
||||
match_string('class')
|
||||
words.append(LDRX(0, 31, 2))
|
||||
words.append(lambda pc: ADRP(16, pc, execute))
|
||||
words.extend((ADDI(16, 16, execute & 0xfff), BLR(16)))
|
||||
label('return')
|
||||
words.extend((LDP_POST(29, 30, 31, 0x20), 0xd65f03c0))
|
||||
label('original')
|
||||
words.append(0xd10203ff) # original sub sp,sp,#0x80
|
||||
words.append(lambda pc: B(pc, add + 4))
|
||||
for name, value in [('method', b'InitializeBaseSystem\0'), ('class', b'Scn.Step.Modules\0')]:
|
||||
label(name)
|
||||
value += b'\0' * (-len(value) % 4)
|
||||
words.extend(struct.unpack('<' + 'I' * (len(value) // 4), value))
|
||||
for word in words:
|
||||
ctx.emit(word(ctx.here()) if callable(word) else word)
|
||||
ctx.put(add, [B(add, start)], 'Modules.InitializeBaseSystem: finish its queued initialization before Info/Decor are added')
|
||||
|
||||
|
||||
MATCH_STUBS = {'main': [
|
||||
{'name': 'BaseSystem initialization precedes Info setup', 'size': 248,
|
||||
'fingerprints': ['0904214804ff466cc9a0d9911656bb8888f89d08a9b5819b4709f696b8bdceca'],
|
||||
'stub': initialize_base_system,
|
||||
'others': {
|
||||
'execute and wait': {'size': 208, 'fingerprints': ['436e2422d30d906519630af2c9f3da3e7019c30f23d692d5246b39d5f6217494']},
|
||||
'task runner': {'size': 672, 'fingerprints': ['6d177ae833a2260661809aeee11c69454659857235deed9000bfc44a9ec33913']},
|
||||
}},
|
||||
]}
|
||||
|
||||
BINDING = [
|
||||
{'what': 'BaseSystem initialization before dependent Info setup', 'now': 'game', 'goal': 'game', 'purpose': 'race',
|
||||
'why': "Scn.Step.Modules queues BaseSystem and Info setup together, but RewardGet.OnSetup caches the GamePauseManager that BaseSystem creates",
|
||||
'checked': 'Dream Buffet 1.0.0: complete Add/ExecuteAndWait/task-runner functions, Basil initialization call graph, and null-cache-before-source-write runtime trace'},
|
||||
]
|
||||
@@ -0,0 +1,2 @@
|
||||
# Prewarm seed list (shipped in the app, next to shader_map.tsv). Rows: S<TAB>shader key<TAB>stage / R<TAB>render pipeline key (pso_skey hex) / C<TAB>compute shader key / M<TAB>task shader key or -<TAB>native task / mesh pipeline key (pso_skey hex: the mesh shader in the vertex place).
|
||||
# Provisional profile: empty until recorded on the Mac (DM_PSO_MANIFEST=off DM_PSO_RECORD).
|
||||
|
@@ -0,0 +1 @@
|
||||
# kind: evidence supplemental vertex / pixel shader pairs (BAHS program variations and legacy Unity pass-input covers) for vertex output padding and the pipeline prebuild (generated by dm/gfx/tools/shader_split.py, do not edit): vertex key <TAB> pixel key
|
||||
|
@@ -0,0 +1,15 @@
|
||||
# Answer table for translation queries (generated by dm/gfx/tools/shader_split.py, do not edit): key <TAB> fact JSON. No PC shader pairing supplied: only the thread group / shared memory of compute shaders (taken from the control section); other queries get the translator defaults
|
||||
24a43b8209a2ec22 {"local":[8,5,4],"shared":0}
|
||||
24c448ad389062a1 {"local":[32,1,1],"shared":640}
|
||||
292e0e541e404211 {"local":[32,1,1],"shared":0}
|
||||
2f869796f9335a02 {"local":[32,1,1],"shared":0}
|
||||
472b8b43988d20be {"local":[32,1,1],"shared":384}
|
||||
4905a007d2ae01a6 {"local":[32,1,1],"shared":640}
|
||||
4941a29622e122d7 {"local":[32,1,1],"shared":0}
|
||||
ab15ea75fe3291a3 {"local":[32,1,1],"shared":0}
|
||||
ad647cd4b79e2046 {"local":[32,1,1],"shared":640}
|
||||
cdde46561e6372a8 {"local":[8,5,1],"shared":0}
|
||||
d8e0fff3cd90c08e {"local":[32,1,1],"shared":640}
|
||||
e896fb14c9eecf63 {"local":[32,1,1],"shared":0}
|
||||
f6f276e7966b2e12 {"local":[32,1,1],"shared":384}
|
||||
fdfa1551153ac6fe {"local":[32,1,1],"shared":0}
|
||||
|
Can't render this file because it contains an unexpected character in line 2 and column 19.
|
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,2 @@
|
||||
# kind: evidence control-section key conflict rulings: empty
|
||||
dm_ctl_sha16 chosen_pc class candidates records
|
||||
|
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,8 @@
|
||||
# Empty-save intro through natural completion into the title; no movie skip.
|
||||
save new
|
||||
secs 60
|
||||
quick 55
|
||||
reach 2500@55
|
||||
window 45 10
|
||||
shots 45,55
|
||||
prebuild on
|
||||
|
@@ -120,6 +120,7 @@ One row per profile; the notes are each profile's `README.md`.
|
||||
| [Hyrule Warriors: Definitive Edition](0100AE00096EA000/README.md) | `0100AE00096EA000` | 1.0.1 | 3.5.1 | Koei Tecmo's KTGL | NVN |
|
||||
| [Kirby Air Riders](040077201BE50000/README.md) | `040077201BE50000` | v458752 (Switch 2) | 20.5.26 (Ounce) | Its own engine (`phx`, `Aurora`) | NVN2 |
|
||||
| [Kirby and the Forgotten Land](01004D300C5AE000/README.md) | `01004D300C5AE000` | 1.1.0 | 11.4.0 | HAL Laboratory's engine (NintendoWare) | NVN |
|
||||
| [Kirby's Dream Buffet](0100A8E016236000/README.md) | `0100A8E016236000` | 1.0.0 | 13.3.0 | HAL Laboratory's engine (Basil, NintendoWare) | NVN |
|
||||
| [Kirby Star Allies](01007E3006DDA000/README.md) | `01007E3006DDA000` | 4.0.0a | 4.4.1 | HAL Laboratory's engine (NintendoWare) | NVN |
|
||||
| [Luigi's Mansion 3](0100DCA0064A6000/README.md) | `0100DCA0064A6000` | 1.4.0 | 7.3.2 | Next Level Games' engine | NVN |
|
||||
| [Mario & Luigi: Brothership](01006D0017F7A000/README.md) | `01006D0017F7A000` | 1.0.0 | 12.3.2 | Unreal Engine 4.27.2, Wwise | NVN |
|
||||
|
||||
@@ -0,0 +1,123 @@
|
||||
"""Replay the emitted game patch at its native Add/ExecuteAndWait boundary."""
|
||||
import importlib
|
||||
import importlib.util
|
||||
from pathlib import Path
|
||||
import struct
|
||||
import sys
|
||||
from types import SimpleNamespace
|
||||
import unittest
|
||||
|
||||
try:
|
||||
uc = importlib.import_module('unicorn')
|
||||
except ImportError:
|
||||
uc = None
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[3]
|
||||
sys.path.insert(0, str(ROOT / 'dm/tools'))
|
||||
spec = importlib.util.spec_from_file_location('dream_buffet_patches', ROOT / 'dm/games/0100A8E016236000/patches.py')
|
||||
assert spec is not None and spec.loader is not None
|
||||
patches = importlib.util.module_from_spec(spec)
|
||||
spec.loader.exec_module(patches)
|
||||
|
||||
CODE, ADD, EXECUTE, STOP = 0x100000, 0x110000, 0x120000, 0x130000
|
||||
DATA, STACK = 0x200000, 0x300000
|
||||
|
||||
|
||||
@unittest.skipIf(uc is None, 'instruction replay needs unicorn')
|
||||
class Initialization(unittest.TestCase):
|
||||
def setUp(self):
|
||||
assert uc is not None
|
||||
self.arm = importlib.import_module('unicorn.arm64_const')
|
||||
self.vm = uc.Uc(uc.UC_ARCH_ARM64, uc.UC_MODE_ARM)
|
||||
for address, size in ((CODE, 0x40000), (DATA, 0x10000), (STACK, 0x10000)):
|
||||
self.vm.mem_map(address, size)
|
||||
self.context, self.args, self.owner, self.instance = DATA + 0x1000, DATA + 0x2000, DATA + 0x3000, DATA + 0x4020
|
||||
self.put(DATA, self.context)
|
||||
self.put(self.context + 0x88, self.args)
|
||||
self.put(self.args, self.owner)
|
||||
self.put(self.args + 8, self.instance)
|
||||
self.put(self.args + 16, DATA + 0x7000)
|
||||
self.put(self.instance - 8, DATA + 0x5000)
|
||||
self.put(DATA + 0x5008, DATA + 0x6000)
|
||||
self.vm.mem_write(ADD, bytes.fromhex('ff0302d1')) # original first instruction: sub sp,sp,#0x80
|
||||
self.vm.mem_write(EXECUTE, bytes.fromhex('fd7bbda9'))
|
||||
words = []
|
||||
def put_site(address, instructions, reason):
|
||||
self.vm.mem_write(address, struct.pack('<' + 'I' * len(instructions), *instructions))
|
||||
ctx = SimpleNamespace(base=ADD, others={'execute and wait': EXECUTE, 'task runner': 0x140000},
|
||||
here=lambda: CODE + 4 * len(words), emit=words.append,
|
||||
site=lambda address, original: self.assertEqual(bytes(self.vm.mem_read(address, len(bytes.fromhex(original)))), bytes.fromhex(original)),
|
||||
put=put_site)
|
||||
patches.initialize_base_system(ctx)
|
||||
if words:
|
||||
self.vm.mem_write(CODE, struct.pack('<' + 'I' * len(words), *words))
|
||||
self.pending, self.executed = [], []
|
||||
self.base_ready = False
|
||||
self.vm.hook_add(uc.UC_HOOK_CODE, self.native_call)
|
||||
|
||||
def put(self, address, value):
|
||||
self.vm.mem_write(address, struct.pack('<Q', value))
|
||||
|
||||
def string(self, address):
|
||||
return bytes(self.vm.mem_read(address, 128)).split(b'\0', 1)[0].decode()
|
||||
|
||||
def native_call(self, vm, pc, size, user):
|
||||
if pc not in (ADD + 4, EXECUTE):
|
||||
return
|
||||
self.assertEqual(vm.reg_read(self.arm.UC_ARM64_REG_SP) % 16, 0)
|
||||
self.assertEqual(vm.reg_read(self.arm.UC_ARM64_REG_X0), DATA)
|
||||
if pc == ADD + 4:
|
||||
self.pending.append(self.string(DATA + 0x7000))
|
||||
vm.reg_write(self.arm.UC_ARM64_REG_SP, vm.reg_read(self.arm.UC_ARM64_REG_SP) + 0x80)
|
||||
vm.reg_write(self.arm.UC_ARM64_REG_X0, 0xdead) # Add does not return its original context.
|
||||
else:
|
||||
# An allowed adverse schedule: Info consumes its dependency first
|
||||
# if both jobs were incorrectly left in the same parallel batch.
|
||||
for task in sorted(self.pending, key=lambda name: name != 'InitializeInfo'):
|
||||
if task == 'InitializeInfo':
|
||||
self.assertTrue(self.base_ready, 'Info cached a null GamePauseManager before BaseSystem finished')
|
||||
if task == 'InitializeBaseSystem':
|
||||
self.base_ready = True
|
||||
self.executed.append(task)
|
||||
self.pending.clear()
|
||||
vm.reg_write(self.arm.UC_ARM64_REG_PC, vm.reg_read(self.arm.UC_ARM64_REG_LR))
|
||||
|
||||
def call(self, address):
|
||||
saved = {index: 0x900000 + index for index in range(19, 30)}
|
||||
for index, value in saved.items():
|
||||
self.vm.reg_write(getattr(self.arm, f'UC_ARM64_REG_X{index}'), value)
|
||||
self.vm.reg_write(self.arm.UC_ARM64_REG_X0, DATA)
|
||||
self.vm.reg_write(self.arm.UC_ARM64_REG_SP, STACK + 0xfff0)
|
||||
self.vm.reg_write(self.arm.UC_ARM64_REG_LR, STOP)
|
||||
self.vm.emu_start(address, STOP, count=2000)
|
||||
self.assertEqual(self.vm.reg_read(self.arm.UC_ARM64_REG_PC), STOP)
|
||||
self.assertEqual(self.vm.reg_read(self.arm.UC_ARM64_REG_SP), STACK + 0xfff0)
|
||||
for index, value in saved.items():
|
||||
self.assertEqual(self.vm.reg_read(getattr(self.arm, f'UC_ARM64_REG_X{index}')), value)
|
||||
|
||||
def add(self, method, klass='Scn.Step.Modules'):
|
||||
self.vm.mem_write(DATA + 0x6000, klass.encode() + b'\0')
|
||||
self.vm.mem_write(DATA + 0x7000, method.encode() + b'\0')
|
||||
self.call(ADD)
|
||||
|
||||
def test_dependent_setup_waits_but_independent_jobs_stay_queued(self):
|
||||
self.add('InitializeBaseSystem')
|
||||
self.add('InitializeInfo')
|
||||
self.add('InitializeDecor')
|
||||
self.assertEqual(self.pending, ['InitializeInfo', 'InitializeDecor'])
|
||||
self.call(EXECUTE)
|
||||
self.assertEqual(self.executed, ['InitializeBaseSystem', 'InitializeInfo', 'InitializeDecor'])
|
||||
|
||||
def test_other_methods_and_classes_do_not_drain_the_queue(self):
|
||||
for method, klass in [('OnUpdate', 'Scn.Step.Modules'),
|
||||
('InitializeBaseSystemExtra', 'Scn.Step.Modules'),
|
||||
('InitializeBaseSystem', 'Scn.Step.ModulesExtra'),
|
||||
('InitializeBaseSystem', 'Other.Modules')]:
|
||||
with self.subTest(method=method, klass=klass):
|
||||
self.add(method, klass)
|
||||
self.assertEqual(len(self.pending), 4)
|
||||
self.assertFalse(self.executed)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
@@ -65,6 +65,7 @@ Every patch bound tighter than it could be: the open gaps, then the blocked, kep
|
||||
| [Fire Emblem: Three Houses](#fire-emblem-three-houses) | 7 | 0 | 0 | 0 | 0 | `build` → `game` |
|
||||
| [Hades II](#hades-ii) | 0 | 0 | 1 | 0 | 0 | `game` |
|
||||
| [Hyrule Warriors: Age of Calamity](#hyrule-warriors-age-of-calamity) | 0 | 0 | 10 | 0 | 0 | `game`, `build` → `game` |
|
||||
| [Kirby's Dream Buffet](#kirbys-dream-buffet) | 0 | 0 | 1 | 0 | 0 | `game` |
|
||||
| [Luigi's Mansion 3](#luigis-mansion-3) | 0 | 0 | 0 | 0 | 1 | `build` → `engine` |
|
||||
| [Mario + Rabbids® Sparks of Hope](#mario--rabbids-sparks-of-hope) | 1 | 0 | 0 | 0 | 0 | `build` → `game` |
|
||||
| [Mario Kart World](#mario-kart-world) | 0 | 0 | 1 | 0 | 0 | `game` |
|
||||
@@ -335,6 +336,14 @@ Every patch bound tighter than it could be: the open gaps, then the blocked, kep
|
||||
- frame step `+0x166dc60`: KIDS frame task: the frame-rate object's steps × its fps × vsyncs per update / 60 (state page target fps; 0 = as the game sets them)
|
||||
- **function-matched frame step** (`main` of builds without FRAME_STEP): 60 fps frame step: the KIDS frame task, frame-rate block and event cutscene counters: a function of 0x1078 bytes, `+0x134`, `+0x2e0` in it; nnMain, a function of 0x3a40 bytes, `+0x1e60` in it; scene update, a function of 0xb88 bytes, `+0x86c`, `+0x890` in it; frame-rate block writer, a function of 0x7c bytes, in it
|
||||
|
||||
### Kirby's Dream Buffet
|
||||
|
||||
[Kirby's Dream Buffet](../../dm/games/0100A8E016236000/README.md), `0100A8E016236000`, [patches.py](../../dm/games/0100A8E016236000/patches.py).
|
||||
|
||||
- **`game`**, race, at goal, checked: Dream Buffet 1.0.0: complete Add/ExecuteAndWait/task-runner functions, Basil initialization call graph, and null-cache-before-source-write runtime trace: BaseSystem initialization before dependent Info setup. Scn.Step.Modules queues BaseSystem and Info setup together, but RewardGet.OnSetup caches the GamePauseManager that BaseSystem creates
|
||||
|
||||
- **function-matched stub** (`main` of builds without STUBS): BaseSystem initialization precedes Info setup: a function of 0xf8 bytes, `+0x0` in it
|
||||
|
||||
### Luigi's Mansion 3
|
||||
|
||||
[Luigi's Mansion 3](../../dm/games/0100DCA0064A6000/README.md), `0100DCA0064A6000`.
|
||||
|
||||
Reference in new issue
Block a user