reEngine — Interfaces & Contracts
Synced Version: 0.7.0 (2026-11-29)
Scope: Package Manifests, reEngine.Host Contracts (Focus Isolation, Extended Input Tuning, Dynamic Prompt Glyphs, Accessibility, IHostDialogService, 10-Rail Drawer), Engine Compatibility & Recovery, Split JSON Schemas & >= 0.7.0 CLI Reference
Schema Style: Canonical camelCase JSON keys
1. .recomp, .decomp, and engine.manifest.json Schemas
1.1 .recomp Package Manifest (module.recomp.json / *.recomp)
Parsed by RecompPackageReader.Load(string packagePath) (UTF-8 JSON or ZIP archive with fail-closed Zip-Slip validation).
Field (camelCase) |
Type | Required | Default / Validation | Purpose |
|---|---|---|---|---|
schemaVersion |
int |
Yes | >= 1 (1) |
Manifest schema revision. |
moduleId |
string |
Yes | ^[a-z0-9][a-z0-9-]*$ |
Lowercase kebab slug isolating <dataDir>\modules\<moduleId>\. |
title |
string |
Yes | Non-empty | Human-facing game/module display title. |
version |
string |
Yes | SemVer ("0.5.0") |
Packaged module semantic version. |
engineId |
string |
Yes | Non-empty | Target engine folder or alias ("reSlate"/"reStation", "reCart"/"reCartOne"/"reNes", "reCart64"/"re64", "reBlast16"/"reGenesis", "reCube"). |
engineVersion |
string |
Yes | Valid SemVer |
Minimum compatible engine version required (>=). |
compatibleEngineTrack |
string |
Yes | Track selector | Primary compatibility track (X.Y.x, X.Y.*, X.Y, X.x, X.*, X.Y.Z). |
supportedEngineTracks |
string[]? |
No | null |
Ordered list of compatible engine tracks checked before compatibleEngineTrack. |
incompatibleEngineVersions |
string[]? |
No | null |
Exact SemVer, wildcard (0.2.x, 0.*), or range (>=0.5.0 <0.5.2) exclusions evaluated by EngineCompatibilityEvaluator. |
defaultFramerateMode |
string? |
No | null |
Default framerate cadence requested by the module ("enhanced" or "original"). |
backendId |
string? |
No | null |
Preferred default render backend (opengl, vulkan, directx, parallelCpu, software; dx12 normalized on CLI). |
resolutionScale |
int? |
No | null |
Preferred integer resolution scale factor (1..8). |
executionTierMode |
string? |
No | null |
Execution mode (staticAotOnly, aotWithJitFallback, aotWithThreadedIr, jitBringup, interpreterOracle). |
preloadRomDir |
string |
No | "data/rom" |
Relative preload directory inside ModuleRootDirectory. |
entryExecutable |
string? |
No | null |
Optional module-specific executable path relative to root. |
- Parent-Root & Suite-Tree Discovery (
ResolveModuleRootDirectory&SuiteMediaTreeWalker): Resolves<GameRoot>\app\<Module>.recompback to<GameRoot>\, then searches<SuiteRoot>\games\*\data\rom\,gamedata\, and<SuiteRoot>\data\rom\(ranking local -> SHA-256 -> slug -> unique suite candidate, max depth5, skipping reparse points). - Preload Media Priority:
.cue(0) >.chd(1) >.iso(2) >.gcm/.rvz/.n64/.z64/.v64/.sfc/.smc/.nes/.fds/.gb/.gbc/.gba(3) >.7z/.zip/.img(4) >.bin(5).
1.2 .decomp Package Manifest (module.decomp.json / *.decomp — DecompPackageManifest)
Parsed by DecompPipelineCoordinator.ParseManifest(string packagePath) and implements Foundation.Retro.IDecompPackageManifest:
Field (camelCase) |
Type | Default | Purpose |
|---|---|---|---|
moduleId |
string |
Filename fallback | Canonical lowercase-kebab-case module identifier. |
title |
string |
"" |
Human-facing module display title. |
platformId |
string |
"" |
Target console identifier ("psx", "nes", "n64", "genesis"). |
engineId |
string |
Required | Target platform engine ("reSlate"/"reStation", "reCart"/"reCartOne"/"reNes", "reCart64"/"re64", "reBlast16"/"reGenesis"). |
engineVersion |
string |
"0.1.0" |
Minimum compatible engine SemVer (>=). |
compatibleEngineTrack |
string |
"" |
Primary engine track selector ("0.2.x", "0.3.x"). |
supportedEngineTracks |
string[]? |
null |
Ordered compatible track constraints checked before compatibleEngineTrack. |
decompProviderAssembly |
string? |
null |
Explicit contained relative DLL path overriding default <engineId>.Decomp.dll probing. |
preservedTiers |
string[]? |
null |
Preserved research tiers (D1_Raw, D2_Structured, D3_Mapped, canonical D4_CleanSource, D5_ByteExact). |
d4ParityTier |
string? |
null |
D4 parity level (none, D4a, D4b). |
currentPortTier |
string? |
null |
Separate zero-emulation port axis tier (none, P0–P5). |
expectedSha256 |
string? |
null |
Optional expected 64-char hex SHA-256 of user media for suite-tree disambiguation. |
decompSchemaVersion |
string |
"1.0.0" |
Semantic version of the .decomp container schema. |
targetDecompTier |
string |
"D3" |
Target decompilation tier (none, D0–D5). |
goalDecompTier |
string |
"D3" |
Goal decompilation tier (none, D0–D5). |
packageVersion |
string? |
null |
Optional SemVer of this .decomp package. |
upstreamResearchPath |
string? |
null |
Optional read-only upstream research repository path/id. |
ghidraProjectName |
string? |
null |
Optional CLI Ghidra project name. |
toolchainRequirements |
DecompToolchainRequirements? |
null |
minimumGhidraVersion ("11.2"), requiresHeadlessJdk (true), requiredExtensions (string[]). |
preloadRomDir |
string |
"data/rom" |
Relative preload media directory inside module root. |
recipeEntryPoint |
string? |
null |
Optional clean-room recipe/script path relative to package root. |
1.3 engine.manifest.json & 3-Way engineId Aliases (EngineAliasCatalog)
EngineManifestModel: Typed fieldsschemaVersion,engineId,legacyEngineIds,displayName,version,effectiveVersion,engineVersion,hostProtocolVersion,minSuiteVersion,compatibleEngineTrack,supportedEngineTracks,platformId,entryExecutable,decompProviderAssembly,executionTierMode,backendId,resolutionScale([JsonExtensionData]preserves extra keys).- Equivalence Groups (
EngineAliasCatalog): Exact matches take precedence (reSlate<->reStation, 3-wayreCart<->reCartOne<->reNes,reCart64<->re64,reBlast16<->reGenesis).
2. reEngine.Host Runtime Contracts (SharedLibs\reEngine\v0.7.0\reEngine.Host.dll)
Child platform engines consume reEngine.Host.dll built on Foundation v0.6.0 (PixelOverlayCanvas, HighResFramePacer, AudioRingBuffer, RgbaPngWriter, WavCaptureWriter, GranularSettingsManager), ppy.SDL3-CS, and clean-room OS bindings.
2.1 Focus Isolation, Extended Input Tuning (HostInputTuningContracts) & Dynamic Prompts
HostSessionInputBridge&HostInputFrame: Isolates unfocused KBM events strictly whenever!isWindowFocused(clearing held KBM keys immediately on focus loss), decouplesshouldPauseOnFocusLossfromallowBackgroundControllerInput, and adds trailing optional parameters toHostInputFrame(gyroDeltaX,gyroDeltaY,isGameplayPausedByFocusLoss,activePromptDevice).HostInputTuningProfile&HostInputTuningProcessor: Normalizes and appliesisLookYInverted,stickDeadzoneInnerPercent(5.0..50.0, default15.0),stickDeadzoneOuterPercent(60.0..100.0, default95.0),stickResponseCurve(HostStickCurveKind:linear,exponential,smoothS),isStickSwapped,mouseSensitivityY(0.25..3.0, default1.0),holdToggleActions(HostHoldToggleAction:sprint,aimBlock,crouch,lockOn,fastForward),turboActions+turboRateHz(4..30, default12), andgyroAimMode(HostGyroAimMode:off,always,whileAiming) +gyroSensitivity(0.25..3.0, default1.0) fromHostGyroSample.IHostPromptGlyphProvider(HostPromptGlyphContracts): ExposesPromptGlyphMode(HostPromptGlyphMode:auto,kbm,xbox,playstation,nintendo[switchalias],steamDeck,generic),ActiveDeviceFamily(HostPromptGlyphFamily),NotifyLastActuatedDevice(...),ResolvePrompt(actionOrButtonId) -> HostPromptBadge, andDrawGlyphBadge(...)rendering crisp clean-room geometric button badges ontoPixelOverlayCanvas.IHostDialogService(HostDialogContracts): Cross-platform modal picker/prompt service (ShowOpenFileDialog,ShowSelectFolderDialog,ConfirmYesNo,ShowInfo) honoringFOUNDATION_SUPPRESS_MODALS=1fail-closed (null/false) withoutSystem.Windows.Forms.
2.2 Accessibility, Display Modes, VRR Pacing, 8 Video Filters & 10-Rail F1 Overlay
HostAccessibilityFilterPass&HostColorblindMode: Applies 3x3 daltonization matrices (none,deuteranopia,protanopia,tritanopia) and temporal luminance delta clamping (isFlashReductionEnabled) insideHostVideoFilterPipeline.Process(...), preserving a zero-copy fast path when disabled; paired withisFastTextEnabledandisSubtitlesEnabled.HostViewportGeometry& Presenters: 6 aspect presets (nativePar,fourByThree,squareInteger,nativeFit,horPlus16By9,horPlus21By9+ centered4:3FMVs),ComputeHudAnchorRect,overscanCropPx, inverse pointer normalization across all 5 presenters (OpenGl,Vulkan,DirectX,ParallelCpu,Software),HostDisplayMode(windowed,borderlessFullscreen,exclusiveFullscreen+MonitorIndex),HostFramePacingController,HostVideoFilterPipeline(24-bit vs 15-bit + Bayer dithering + 8 live filters), andF12HostScreenshotService.F1DrawerTwoColumnLayout(HostDrawerTabId10-Rail Map): Preserves existing enum values0..5(Video=0, Controls=1, Keybinds=2, System=3, DiscMedia=4, Audio=5) and appendsQuickActions=6, Accessibility=7, PacksAndMods=8, ManualNotebook=9.OrderedTabsdisplays[QuickActions, Video, Audio, Controls, Keybinds, Accessibility, PacksAndMods, ManualNotebook, System, DiscMedia]plus pinnedDrawer_QuitGamein the Left Rail alongside live footer prompt hints.HostSessionOptions,HostSessionRunner&IHostSessionEventCallbacks: ExposesShouldPauseOnFocusLoss,AllowBackgroundControllerInput,PromptGlyphMode,IsFastTextEnabled,IsFlashReductionEnabled,ColorblindMode,IsSubtitlesEnabled,InitialAotCompileState,InitialMediaGateError,SettingsDataDirectory,SettingsConfigPathOverride, explicit-flag precedence (PreferExplicit*), thread-safeSetAotCompileState/SetMediaGateState/UpdateDrawerDescriptor, and default-interface callbacks for allv0.7.0settings changes.
2.3 Audio DSP, Host Actions, Media Gate & Controller Nav
HostBiquadFilter,HostAudioDspPipeline&HostSoundTestService: Butterworth LP/HP filters (off,crtWarm,handheldSpeaker), category mix,0..200%stereo width, 5 ms focus-loss mute ramp,linear/sincCubicresampling, FF audio clamping, hot-switchable SDL3 devices (Sdl3AudioDeviceNative), andIHostSoundTestProvider.HostActionBindingSet,HostInputMapper&HostDrawerControllerNav: RebindableHostActionBindingIds(toggleMenu,toggleHud,quickSave,quickLoad,fastForward,cutsceneSkip,toggleFullscreen,takeScreenshot), unbound-TabFF hold, 2-frame deferred synthetic key tap auto-release,HostRelativeMouseController, 4-step non-quittingEsc, full-screen GlassFirstRunMediaGateView(HostDialogService),HostAotCompileOverlayView, invariant-widthF3HudOverlayView, and100%controller navigation across all 10 rails and panes.
3. Resolution, Verification & Split-Domain Settings (reEngine.Core)
EngineCompatibilityEvaluator,EngineVersionResolver,DecompPipelineCoordinator&PackageVerificationService: EvaluatesincompatibleEngineVersions, enforcespinnedEngineVersions-> latest.ready-hf.<n>-> bundled fallback, runsSuiteMediaTreeWalker+DecompD4StrictnessValidator(D4_CleanSource), and emits camelCasePackageVerificationReport(isPassed,generatedAtUtc,durationMs,exitCode).settings.json(v2,domain: "core"):schemaVersion(2),appId,domain,updatedAtUtc,executionTierMode,isJitEnabled,shouldPreloadMediaToRam,isFastBootEnabled,isSafeModeActive,shouldFastLoadData,shouldEnableRuntimeLogs,fastForwardMultiplier,shouldPauseOnFocusLoss,allowBackgroundControllerInput,promptGlyphMode,isFastTextEnabled,isFlashReductionEnabled,isSubtitlesEnabled,shutdownTimeoutMs,shouldCheckUpdates,shouldAutoStagePatches,lastUpdateFeedUrl,enginesDirectoryOverride,pinnedEngineVersions,stagedUpdatePath,windowWidth,windowHeight.settings.video.json(v2,domain: "video"):backendId,resolutionScale,displayMode,monitorIndex,isFullscreen,isVsyncEnabled,frameRateMode,targetFps,backgroundFpsCap,aspectRatioMode,overscanCropPx,isFastForwardEnabled,isHdTexturePackEnabled,hudAnchorMode,videoFilterMode,isTrueColor24BitEnabled,isDitheringEnabled,screenshotCaptureMode,uiTextScale(0.75..2.0),isFpsOverlayEnabled,isCleanCaptureModeEnabled,colorblindMode,isFlashReductionEnabled.settings.audio.json(v2,domain: "audio"):audioDriver,audioOutputDevice,masterVolume,isAudioMuted,bgmVolume,sfxVolume,voiceVolume,shouldMuteOnFocusLoss,audioLowPassHz,audioHighPassHz,audioStereoWidthPercent,audioResamplingMode,fastForwardAudioMode.settings.controls.json(HostControlTierStore+HostInputTuningCodec):schemaVersion,appId,domain("controls"),updatedAtUtc,inputProfileMode,activeSchema,controlMode,mouseSensitivity,menuControllerChord,allowBackgroundControllerInput,promptGlyphMode,isLookYInverted,inputTuning(stickDeadzoneInnerPercent,stickDeadzoneOuterPercent,stickResponseCurve,isStickSwapped,mouseSensitivityY,holdToggleActions,turboActions,turboRateHz,gyroAimMode,gyroSensitivity),hostActionBindings, and 3-tier bindings (globalController,perGameController,perGameModern) withSerializeDirtyCheckJson()idle write prevention.
4. CLI Contract, Child Isolation & Exit Code Matrix
4.1 CLI Flags & Launcher Argument Rules
- Subcommands & Package Flags:
decomp --module <file.decomp> [--stage D0..D5] [--media-path <path>] [--engine-dir <dir>] [--toolchain-dir <dir>] [--output-dir <dir>] [--headless],--open <path>(or positional*.recomp/*.decomp),--rom <path>,--disc <path>,--wait,--fullscreen,--window,--save-dir <dir>,--shutdown-timeout-ms <100..30000>,--register-assoc. - Verification, Host &
>= 0.7.0Flags (RecompLaunchFlagRouter.Supports070Routing):--verify-module <pkgOrEngineId> [--json] [--require-media],--host-demo,--demo-cart,--backend <opengl|vulkan|directx|dx12|parallelCpu|software>,--require-backend [<id>](optional value),--aspect-mode <mode>,--scale <1|2|4|8>,--display-mode <windowed|borderlessFullscreen|exclusiveFullscreen>,--monitor <n>,--overscan <px|t,b,l,r>,--fps-mode <original|enhanced>,--target-fps <n>,--bg-fps-cap <n>,--vsync | --no-vsync,--video-filter <mode>,--true-color | --no-true-color,--dithering | --no-dithering,--hud-anchor <mode>,--screenshot-mode <cleanNative|filteredComposite>,--ui-text-scale <0.75..2.0>,--open-settings,--show-fps,--pause-on-focus-loss | --no-pause-on-focus-loss,--bg-controller-input | --no-bg-controller-input,--invert-look-y | --no-invert-look-y,--prompt-glyphs <auto|kbm|xbox|playstation|nintendo|steamDeck|generic>,--fast-text | --no-fast-text,--flash-reduction | --no-flash-reduction,--colorblind-mode <none|deuteranopia|protanopia|tritanopia>,--subtitles | --no-subtitles,--execution-tier <mode>,--jit-bringup,--force-zero-rwx,--preload-media,--preload-media-to-ram | --no-preload-media-to-ram,--fast-boot | --no-fast-boot,--safe-mode-reset,--fast-forward | --no-fast-forward,--ff-multiplier <2.0..4.0>,--audio-driver <id>,--audio-device <name>,--master-volume <0..1>,--bgm-volume <0..1>,--sfx-volume <0..1>,--voice-volume <0..1>,--audio-muted | --no-audio-muted,--mute-on-focus-loss | --no-mute-on-focus-loss,--audio-lowpass-hz <hz>,--audio-highpass-hz <hz>,--stereo-width <0..200>,--audio-resampling <linear|sincCubic>,--ff-audio-mode <attenuatedLowPass|muted|normal>,--verify,--doctor,--tray-only,--automation-port <n>(fail-closed Exit2in Release on both App and Setup),--dry-run,--enable-logs,--frames <n>,--dump-screenshot <path>,--dump-audio <path>,--version(-v),--help(-h,/?,help). LauncherArgsHelper&LauncherJobObjectGuard: Enforces 1:1ValueOptionsparity withRecompLaunchOptions(including--prompt-glyphsand--colorblind-mode), normalizes caller-CWD relative paths, and bindsLauncherJobObjectGuardstrictly whenShouldWaitForChild == true.
4.2 Propagated Exit Codes (reEngine.Launcher <-> reEngine.App <-> reEngine.Host)
| Exit Code | Trigger / Meaning |
|---|---|
0 |
Success, --version/--help/--verify/--dry-run pass, valid --verify-module, interactive child handoff, or non-strict offline --check-updates. |
1 |
General runtime failure, missing compatible re* engine (.recomp), or --verify-module --require-media failure on .recomp. |
2 |
Invalid CLI ArgumentException, Zip-Slip/InvalidDataException/JsonException, containment violation, or --automation-port in a Release build. |
3 |
.decomp unbuilt/missing platform engine (DecompUnbuiltEngineError), or --verify-module --require-media failure on .decomp. |
4 |
--check-updates --strict failure when update feed/network is unavailable. |
6 |
BackendUnavailableException (--require-backend failed: unavailable/unsupported render backend such as metal on Windows or pre-0.3.0 engine). |
130 |
Console.CancelKeyPress / OperationCanceledException (triggers bounded <= 3s graceful WM_CLOSE tree shutdown during --wait). |