102 Patches: Detours to the Rescue
C reference for DttR maintainers and modders.
Loading...
Searching...
No Matches
mss_sdl.c File Reference
#include "mss_private.h"
#include "sidecar_private.h"
#include <dttr_core.h>
#include <dttr_log.h>
#include <SDL3/SDL.h>
#include <stdbool.h>
#include <stdint.h>
#include <string.h>
#include <windows.h>

Go to the source code of this file.

Data Structures

struct  mss_import_hook

Functions

static bool wave_format_spec (const void *format, SDL_AudioSpec *spec)
void dttr_mss_sdl_shutdown ()
static bool install_pointer_hook (const DTTR_Mods_Context *ctx, const char *name, DTTR_Core_Hook **handle, uintptr_t addr, void *callback)
static bool install_mss_import_hook (const DTTR_Mods_Context *ctx, const char *name, uintptr_t site)
static bool install_mss_import_descriptor (const DTTR_Mods_Context *ctx, uint8_t *base, IMAGE_IMPORT_DESCRIPTOR *desc)
void dttr_mss_sdl_release_hooks ()
bool dttr_mss_sdl_install_hooks (const DTTR_Mods_Context *ctx)
static float master_gain_for_volume (int volume)
int dttr_mss_ail_startup ()
void dttr_mss_ail_shutdown ()
int dttr_mss_ail_set_preference (unsigned int preference, int value)
int dttr_mss_ail_get_preference (unsigned int preference)
int dttr_mss_ail_waveOutOpen (void **driver_out, void *wave_out, int device_id, const void *format)
void dttr_mss_ail_waveOutClose (void *driver)
void dttr_mss_ail_set_digital_master_volume (void *driver, int volume)

Variables

static mss_import_hook mss_import_hooks []

Function Documentation

◆ dttr_mss_ail_get_preference()

int dttr_mss_ail_get_preference ( unsigned int preference)

Definition at line 276 of file mss_sdl.c.

References dttr_mss_core_get_preference().

◆ dttr_mss_ail_set_digital_master_volume()

void dttr_mss_ail_set_digital_master_volume ( void * driver,
int volume )

◆ dttr_mss_ail_set_preference()

int dttr_mss_ail_set_preference ( unsigned int preference,
int value )

Definition at line 272 of file mss_sdl.c.

References dttr_mss_core_set_preference().

◆ dttr_mss_ail_shutdown()

void dttr_mss_ail_shutdown ( )

Definition at line 268 of file mss_sdl.c.

References dttr_mss_sdl_shutdown().

◆ dttr_mss_ail_startup()

int dttr_mss_ail_startup ( )

◆ dttr_mss_ail_waveOutClose()

◆ dttr_mss_ail_waveOutOpen()

int dttr_mss_ail_waveOutOpen ( void ** driver_out,
void * wave_out,
int device_id,
const void * format )

◆ dttr_mss_sdl_install_hooks()

bool dttr_mss_sdl_install_hooks ( const DTTR_Mods_Context * ctx)

Definition at line 228 of file mss_sdl.c.

References ctx, desc, DTTR_MODS_LOG_ERROR, and install_mss_import_descriptor().

Referenced by dttr_audio_init().

◆ dttr_mss_sdl_release_hooks()

◆ dttr_mss_sdl_shutdown()

◆ install_mss_import_descriptor()

bool install_mss_import_descriptor ( const DTTR_Mods_Context * ctx,
uint8_t * base,
IMAGE_IMPORT_DESCRIPTOR * desc )
static

Definition at line 171 of file mss_sdl.c.

References ctx, desc, DTTR_MODS_LOG_ERROR, and install_mss_import_hook().

Referenced by dttr_mss_sdl_install_hooks().

◆ install_mss_import_hook()

bool install_mss_import_hook ( const DTTR_Mods_Context * ctx,
const char * name,
uintptr_t site )
static

◆ install_pointer_hook()

bool install_pointer_hook ( const DTTR_Mods_Context * ctx,
const char * name,
DTTR_Core_Hook ** handle,
uintptr_t addr,
void * callback )
static

◆ master_gain_for_volume()

float master_gain_for_volume ( int volume)
static

Definition at line 251 of file mss_sdl.c.

References DTTR_MSS_DEFAULT_VOLUME, and DTTR_MSS_MAX_VOLUME.

Referenced by dttr_mss_ail_set_digital_master_volume().

◆ wave_format_spec()

bool wave_format_spec ( const void * format,
SDL_AudioSpec * spec )
static

Variable Documentation

◆ mss_import_hooks

mss_import_hook mss_import_hooks[]
static

Definition at line 21 of file mss_sdl.c.

Referenced by dttr_mss_sdl_release_hooks(), and install_mss_import_hook().