102 Dalmatians: Puppies to the Rescue
Decompilation Source Reference | GitLab repository
Loading...
Searching...
No Matches
preferences.c
Go to the documentation of this file.
1/* Recovered game implementation; original addresses identify provenance. */
7#include <math.h>
8#include <stdarg.h>
9#include <string.h>
10
11// Original pcdogs.exe: 0x426cd0
12// Returns the stored unsigned 16-bit Q12 sound-effect volume.
14{
15 return g_volumeSettings.sfx_volume;
16}
17
18// Original pcdogs.exe: 0x426ce0
19// Stores the unsigned 16-bit Q12 sound-effect volume without clamping.
20void Settings_SetSfxVolume(uint16_t volume_fp12)
21{
22 g_volumeSettings.sfx_volume = volume_fp12;
23}
24
25// Original pcdogs.exe: 0x426cf0
26// Returns the stored unsigned 16-bit Q12 music volume.
28{
29 return g_volumeSettings.music_volume;
30}
31
32// Original pcdogs.exe: 0x426d00
33// Stores the unsigned 16-bit Q12 music volume without clamping.
34void Settings_SetMusicVolume(uint16_t volume_fp12)
35{
36 g_volumeSettings.music_volume = volume_fp12;
37}
38
39// Original pcdogs.exe: 0x426d10
40// Returns true when the audio-system flag is zero.
42{
43 return !(Audio_GetEnabledFlag());
44}
45
46// Original pcdogs.exe: 0x426d20
47// Stores the low byte of the requested setting and writes its logical inverse to the audio-system flag.
48void Settings_SetSoundEnabled(int32_t enabled)
49{
50 g_gameSettings.sound_enabled = (uint8_t)enabled;
51 Audio_SetEnabledFlag(!enabled);
52}
53
54// Original pcdogs.exe: 0x426d40
55// Returns the selected save-slot byte with signed extension.
57{
58 return (int32_t)(int8_t)g_gameSettings.selected_save_slot;
59}
60
61// Original pcdogs.exe: 0x426d50
62// Stores the selected save-slot byte without range validation.
63void Settings_SetSelectedSaveSlot(uint8_t slot_index)
64{
65 g_gameSettings.selected_save_slot = slot_index;
66}
67
68// Original pcdogs.exe: 0x426d60
69// Stores the player-character save-data byte. It does not switch the level's baked mesh or model.
70void Settings_SetPlayerCharacter(uint8_t character_id)
71{
72 g_gameSettings.player_character = character_id;
73}
74
75// Original pcdogs.exe: 0x426d70
76// Returns the live rumble-suppression byte with signed extension.
78{
79 return (int32_t)(int8_t)g_rumbleSuppressFlag;
80}
81
82// Original pcdogs.exe: 0x426d80
83// Stores the live rumble-suppression byte, where zero allows rumble and one suppresses it.
84void Settings_SetRumbleSuppressFlag(uint8_t suppress_rumble)
85{
86 g_rumbleSuppressFlag = suppress_rumble;
87}
void Audio_SetEnabledFlag(uint8_t enabled)
Definition system.c:166
int32_t Audio_GetEnabledFlag(void)
Definition system.c:159
#define g_gameSettings
Definition globals.h:32
void Settings_SetPlayerCharacter(uint8_t character_id)
Definition preferences.c:70
void Settings_SetRumbleSuppressFlag(uint8_t suppress_rumble)
Definition preferences.c:84
uint16_t Settings_GetSfxVolume()
Definition preferences.c:13
int32_t Settings_GetSelectedSaveSlot()
Definition preferences.c:56
void Settings_SetMusicVolume(uint16_t volume_fp12)
Definition preferences.c:34
void Settings_SetSelectedSaveSlot(uint8_t slot_index)
Definition preferences.c:63
int32_t Settings_IsSoundEnabled()
Definition preferences.c:41
uint16_t Settings_GetMusicVolume()
Definition preferences.c:27
void Settings_SetSfxVolume(uint16_t volume_fp12)
Definition preferences.c:20
int32_t Settings_GetRumbleSuppressFlag()
Definition preferences.c:77
void Settings_SetSoundEnabled(int32_t enabled)
Definition preferences.c:48
#define g_volumeSettings
Definition globals.h:31
#define g_rumbleSuppressFlag
Definition values.h:393