Architecture Deep-Dive — Local AOT Pipeline, .text-Scoped Collectible Overlays & Schema B Controls
- Parent Document:
ARCHITECTURE.md - Contract Reference:
INTERFACES.md - Version:
0.5.0(2026-11-29)
1. Zero-*.g.cs Clean-Room Distribution & Local <dataDir>\cache\ AOT
- Packaged Payload (
MeadowValley-BackToEarth-SlateOne-04.recomp): - Ships strictly clean-room assemblies (MeadowValley-BackToEarth-SlateOne-04.recomp.dll), byte-identicalmodule.recomp.json, andaot-recipe.json(14module descriptors,4,334unique entry addresses including explicit resident seed0x8002C5B8, derived fromMeadowValley-BackToEarth-SlateOne-04.decompv0.2.1). - Both the Launcher pre-flight check (LauncherContainmentAndModule) and test suite (ArchitectureAndHygieneTests) reject any.g.cs,*Generated.dll, or retail ISO/disc files. - Cold vs. Warm Launch on the Player PC &
.text-Scoped Overlays: - Media Check & Non-Destructive Save/Settings Migration: DiscoversSLUS-01115media recursively under<dataDir>\rom\, verifiesbyo_media_sha256.jsonlocally, migrates legacy<dataDir>\settings.json-><dataDir>\config\settings.json, and copies legacy.mcr/.rstfiles viaSaveMigrationHelperinto--save-dir(or<dataDir>)memcards\memcard_meadowvalley-backtoearth-slateone-04_slot{1,2}.mcrandsaves\with fail-closed containment (AppEnvironment.AssertPathContained/MemCardMcrStore.ResolveSaveBaseDir) without altering originals. - Cold Compile, Pure-Static Readiness &TextScopedOverlayModuleAdapter: When<dataDir>\cache\meadowvalley-backtoearth-slateone-04\<cacheKey>\meadowvalley-backtoearth-slateone-04.Generated.dllis absent or stale,reSlate v0.4.0+AotCacheManagercompile locally usingaot-recipe.json. Overlay slots wrap inTextScopedOverlayModuleAdapter(ITextScopedOverlayRecompModule, IRecompCompiledEntryLookup) soPsxCpu.IsOverlayRamMatchhashes strictly immutable.textbytes (Part 110x800BBC34416,588B,Part 270x800B7EEC11,636B), preventing mutable.data/.bsswrites from thrashing AOT, whileSlus01115PureStaticReadiness.Evaluatecertifies14/14resident and dual-slot overlay execution (jit=0, threadedIr=0, interp=0understaticAotOnly). - Collectible Assembly Unloading: Overlay slots load through collectibleAssemblyLoadContextinstances verified byWeakReferencecollection tests (AotRecipeAndCacheTests) acrossPart 11<->Part 15/Part 30transitions.
2. Schema B Input Pipeline & "PRESS START" Bridge
Slus01115InputProfile declares 21 atomic actionIds organized across 15 UI rows (Settings -> Keybinds) supporting all three input tiers (Global 1:1, Game 1:1, and Modern PC) with KBM+controller rebinding (<= 3-slot KBM [1st, 2nd, 3rd] 4..511/1001..1007, gamepad 2001..2032 incl. LT/RT triggers, right-click/Del clear to 0, and move* defaulting to DPadUp..DPadRight with zero map/journal/callMount/callCompanion D-Pad collisions).
- Menu Navigation Isolation (
!IsGameplayContextActive(cpu)):Slus01115NativeActionHookalways reads physicalGamepadButtonsMaskD-Pad +Left Stick+move*actions with zeroPadSelectleakage, while bridgingmenuConfirm/primaryAttack(E,Enter,Space,LClick,Pad A,Start) ontoStart(0x0800) across0x01Uand0x0DUphases2/6/0x1D(0x800B8698) cleanly intoOVL_part11_id06phase7->Cross. - Crop-Grid Isometric Mode (
isometricMoveMode): "cropGrid"(default): rotates KBM movement (KbmMoveMask) by45°(W->Up+Right,S->Down+Left,A->Up+Left,D->Down+Right) without rotating physical controller D-Pad or analog stick vectors."screenSpace": mapsW/S/A/D(KbmMoveMask) and physical D-Pad to raw cardinal SlateOne directions.- 360° Radial Analog Deadzone & Zero-RAM Haptic Rumble (
v0.5.0):Slus01115NativeActionHook.ComputeRescaledAnalogVectorrescales circular stick magnitude usingstickDeadzoneInnerPercent(5–50%, default15%) andstickDeadzoneOuterPercent(60–100%, default95%) around neutral byte0x80(0x5C..0xA4safe neutral bounds), whileSlus01115HapticRumbleController.ObserveTickEndreads committed-tick DualShock motor levels (0x42–0x4Dsmall/large motor state) strictly outsideInSubTickRenderwith zero guest RAM mutations. - Controller D-Pad Mode (
controllerDpadMode) & Collision Isolation: "quickActions"(default): unclaimed physical D-Pad directions emit Free-Roam quick actions (D-Pad UpHorseL2,D-Pad DownDogL1,D-Pad RightStatusStart,D-Pad LeftMapSelect), yielding any direction flagged inControllerDpadClaimedByNonMoveMaskwhile keeping keyboardmap/journal/callMount/callCompanionindependent."dpadWalkStickRun"/"stickWalkDpadRun": controls walk/runCircle(0x2000) chord behavior between Left Stick and unclaimed physical D-Pad while keeping explicit keyboard quick-actions intact.- 4:3 Default Presentation & Settings Preservation:
SettingsMigratormigrates legacyschemaVersion: 1settings toschemaVersion: 2, keepingisWidescreen16By9 = false(4:3pillarbox), preserving v2 idempotence whenkeyBindings.controllerBindingsis absent, and retaining valid0/2001..2032entries across migrations.