From 9cd3f40a2f5af009cfc755973d116aec086672d6 Mon Sep 17 00:00:00 2001 From: gamer147 Date: Fri, 5 Jun 2026 22:08:36 -0400 Subject: [PATCH] feat(battle-engine): CRI Atom/Mana audio+movie shim (3916->3526) Hand-model the CRI ADX2 (audio) + CRI Mana (movie) SDK surface exercised by the copied audio/movie engine files (AudioManager/Voice/Se/Effect/MoviePlayer). No decomp source exists; signatures mirror the real CRI API as called at the sites (arg counts/types from the call sites). All no-op, cosmetic, off the battle path. Reconciled with the empty CRI stubs already in SdkStubs (CriAtomExAcb/CriAtomExPlayback/CriManaMovieMaterial). Co-Authored-By: Claude Opus 4.8 --- SVSim.BattleEngine/Shim/External/CriShim.cs | 100 ++++++++++++++++++ SVSim.BattleEngine/Shim/External/SdkStubs.cs | 8 +- .../Shim/External/ThirdParty.cs | 7 +- 3 files changed, 105 insertions(+), 10 deletions(-) create mode 100644 SVSim.BattleEngine/Shim/External/CriShim.cs diff --git a/SVSim.BattleEngine/Shim/External/CriShim.cs b/SVSim.BattleEngine/Shim/External/CriShim.cs new file mode 100644 index 0000000..742d7bc --- /dev/null +++ b/SVSim.BattleEngine/Shim/External/CriShim.cs @@ -0,0 +1,100 @@ +// AUTHORED SHIM (not copied). CRI ADX2 (Atom) audio + CRI Mana (movie) middleware. +// A precompiled SDK with no decompiled source, referenced by the copied audio/movie +// engine files (Cute/AudioManager.cs, Voice.cs, Se.cs, Effect.cs, MoviePlayer.cs). +// Pure cosmetic surface — never on the battle-resolution path; every member is a no-op +// returning a safe default. Signatures mirror the real CRI API as exercised by the +// decomp (arg counts/types taken from the call sites) so the copied code compiles. +using System; + +namespace CriWare +{ + // ---- CRI Atom (audio) ---- + public class CriAtomExPlayer + { + public void SetFadeOutTime(int ms) { } + public void SetFadeInTime(int ms) { } + public void SetFadeInStartOffset(int ms) { } + public void SetStartTime(long ms) { } + public void ResetFaderParameters() { } + public void Update(CriAtomExPlayback playback) { } + } + + public struct CriAtomExPlayback + { + public bool GetNumPlayedSamples(out long numSamples, out int samplingRate) + { numSamples = 0L; samplingRate = 0; return false; } + } + + public class CriAtomExAcb : IDisposable + { + public void Dispose() { } + public bool GetCueInfo(int index, out CriAtomEx.CueInfo cueInfo) + { cueInfo = default; return false; } + } + + public static class CriAtomEx + { + public struct CueInfo { public long length; } + } + + public class CriAtomCueSheet { } + + public class CriAtomSource : UnityEngine.MonoBehaviour + { + public enum Status { Stop, Prep, Playing, PlayEnd, Removed, Removing, Error } + public Status status => Status.Stop; + public CriAtomExPlayer player { get; } = new CriAtomExPlayer(); + public bool loop; + public bool playOnStart; + public float volume; + public bool use3dPositioning; + public string cueSheet; + public string cueName; + public CriAtomExPlayback Play() => default; + public CriAtomExPlayback Play(int cueId) => default; + public CriAtomExPlayback Play(string cue) => default; + public CriAtomExPlayback Play(string sheet, string cue) => default; + public void Stop() { } + public void Pause(bool sw) { } + public void Pause() { } + public void SetAisacControl(string name, float value) { } + public void SetAisacControl(uint id, float value) { } + } + + public static class CriAtom + { + public static CriAtomCueSheet AddCueSheet(string name, string acbPath, string awbPath) => null; + public static CriAtomCueSheet GetCueSheet(string name) => null; + public static void RemoveCueSheet(string name) { } + public static CriAtomExAcb GetAcb(string acbName) => null; + public static void AttachDspBusSetting(string name) { } + } + + // ---- CRI Mana (movie) ---- (CriManaMovieMaterial lives in External/SdkStubs.cs) + public class CriFsBinder { } +} + +namespace CriWare.CriMana +{ + public struct MovieInfo + { + public uint framerateN; + public uint totalFrames; + } + + public class Player + { + public enum Status { Stop, Decheader, WaitPrep, Prep, Ready, Playing, PlayEnd, Error, StopProcessing } + public Status status => Status.Stop; + public MovieInfo movieInfo => default; + public long GetTime() => 0L; + public bool IsPaused() => false; + public void Pause(bool sw) { } + public void Prepare() { } + public void Start() { } + public void Stop() { } + public void SetFile(CriFsBinder binder, string moviePath) { } + public void SetSeekPosition(int frameNumber) { } + public void SetVolume(float volume) { } + } +} diff --git a/SVSim.BattleEngine/Shim/External/SdkStubs.cs b/SVSim.BattleEngine/Shim/External/SdkStubs.cs index 7e05f8b..61ced4e 100644 --- a/SVSim.BattleEngine/Shim/External/SdkStubs.cs +++ b/SVSim.BattleEngine/Shim/External/SdkStubs.cs @@ -3,18 +3,18 @@ // resolution path. Namespaces must merely exist (anchors); the few types referenced // by member get a minimal no-op surface. Members grow only as the compile loop demands. -// ---- CriWare audio + movie ---- +// ---- CriWare audio + movie (CRI types with members live in External/CriShim.cs) ---- namespace CriWare { - public class CriAtomExAcb { } - public class CriAtomExPlayback { } internal class _ShimAnchor { } } namespace CriWare.CriMana { - public class CriManaMovieMaterial + public class CriManaMovieMaterial : UnityEngine.MonoBehaviour { public enum MaxFrameDrop { Disable, One, Two, Three, Four, Five, Six, Seven, Eight, Nine, Ten } + public MaxFrameDrop maxFrameDrop; + public Player player { get; } = new Player(); } internal class _ShimAnchor { } } diff --git a/SVSim.BattleEngine/Shim/External/ThirdParty.cs b/SVSim.BattleEngine/Shim/External/ThirdParty.cs index 92ce9bb..1c63936 100644 --- a/SVSim.BattleEngine/Shim/External/ThirdParty.cs +++ b/SVSim.BattleEngine/Shim/External/ThirdParty.cs @@ -18,12 +18,7 @@ namespace UnityEngine.Networking public class UnityWebRequest : IDisposable { public void Dispose() { } } } -// ---- CRI Atom audio middleware ---- -namespace CriWare -{ - public class CriAtomSource { } - public class CriAtom { } -} +// ---- CRI Atom/Mana audio+movie middleware: see External/CriShim.cs ---- // ---- Steamworks.NET ---- namespace Steamworks