Files
wowdecomp/Engine/Source/SoundEngine/fmodex/src/fmod_globals.cpp
T
SatyandClaude Opus 5.5 fe133bbc9f fmodex: port core to 4.09 / 12340 behaviour and layout
Port the FMOD Ex core from the 4.30 source to the 4.09.07 behaviour and
layout of 12340, function by function against the binary.

- Plugins, files and DSP: PluginFactory index API, File, DSPNet, the DSP
  units (resampler, wavetable, codec, soundcard, filter), DSPI mix API.
- Sounds: SoundI, Sample/SampleSoftware, Stream, sync points.
- Channels: ChannelReal (37-slot vtable), ChannelSoftware, ChannelStream,
  ChannelEmulated, ChannelRealManual3D, ChannelI (stopEx with 7 bools),
  ChannelGroupI, SoundGroupI, SpeakerLevelsPool.
- System: all 72 SystemI functions of 12340, the System wrappers, and
  the unused 4.09 API on the public signatures.
- Async, memory (LocalMemoryCounter), thread, geometry.
- Outputs: DirectSound, OpenAL, WinMM, WASAPI (timer based), ASIO,
  polled and software; single-device recording.
- Codecs: FSB, MPEG memory block, IT/XM/S3M/MOD/MIDI.
- fmod.hpp: Channel::getFadeVolume (0x8D0F60, used by the client).

fmod_build.sh: 0 errors. Layout: all rows match 12340 except CodecMIDI,
CodecFLAC, CodecOggVorbis and CodecVAG. Not yet run through verify.py.
Notes: re/notes/304_fmod_offsets.md.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
2026-09-26 03:54:45 +02:00

85 lines
1.5 KiB
C++

#include "fmod_globals.h"
#include "fmod_memory.h"
#include "fmod_string.h"
#ifndef PLATFORM_PS2_IOP
#include "fmod_systemi.h"
#endif
namespace FMOD
{
#if defined(FMOD_STATICFORPLUGINS) || defined(FMOD_USE_GETGLOBALS)
#ifndef PLATFORM_SOLARIS // Solaris merges the gGlobals, get rid of this one, keeping the valid non fmod_event one
Global *gGlobal = 0;
#endif
#else
static Global gGlobalMem;
#ifndef PLATFORM_PS3_SPU
#ifndef PLATFORM_PS2_IOP
static SystemI gSystemHeadMem;
#endif
static MemPool gSystemPoolMem;
#endif
Global *gGlobal = &gGlobalMem;
/*
[DESCRIPTION]
[PARAMETERS]
[RETURN_VALUE]
[REMARKS]
[SEE_ALSO]
*/
void Global::init()
{
#ifndef PLATFORM_PS3_SPU
#ifndef PLATFORM_PS2_IOP
gSystemHead = &gSystemHeadMem;
#endif
gSystemPool = &gSystemPoolMem;
#endif
#ifdef FMOD_DEBUG
gDebugLevel = FMOD_DEBUG_LEVEL_LOG | FMOD_DEBUG_LEVEL_WARNING | FMOD_DEBUG_LEVEL_ERROR;
#ifdef FMOD_DEBUG_TOFILE
gDebugMode = DEBUG_FILE;
#else
gDebugMode = DEBUG_STDOUT;
#endif
#ifdef PLATFORM_PS2
FMOD_strcpy(FMOD::gGlobal->gDebugFilename, "host0:fmod.log");
#else
FMOD_strcpy(FMOD::gGlobal->gDebugFilename, "fmod.log");
#endif
#endif
#if defined(PLATFORM_MAC) || defined(PLATFORM_LINUX) || defined(PLATFORM_SOLARIS) || defined(PLATFORM_IPHONE)
gStartTimeSeconds = 0;
#endif
gDSPClock.mHi = 0;
gDSPClock.mLo = 0;
gDSPClockTimeStamp = 0;
gSystemInitCount = 0;
gFileBusy = 0;
}
#endif
}