102 Dalmatians: Puppies to the Rescue
Decompilation Source Reference |
GitLab repository
Toggle main menu visibility
Loading...
Searching...
No Matches
preferences.c
Go to the documentation of this file.
1
/* Recovered game implementation; original addresses identify provenance. */
2
#include "
pcdogs/audio/functions.h
"
3
#include "
pcdogs/game/globals.h
"
4
#include "
pcdogs/image/globals.h
"
5
#include "
pcdogs/settings/functions.h
"
6
#include "
pcdogs/settings/globals.h
"
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.
13
uint16_t
Settings_GetSfxVolume
()
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.
20
void
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.
27
uint16_t
Settings_GetMusicVolume
()
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.
34
void
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.
41
int32_t
Settings_IsSoundEnabled
()
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.
48
void
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.
56
int32_t
Settings_GetSelectedSaveSlot
()
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.
63
void
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.
70
void
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.
77
int32_t
Settings_GetRumbleSuppressFlag
()
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.
84
void
Settings_SetRumbleSuppressFlag
(uint8_t suppress_rumble)
85
{
86
g_rumbleSuppressFlag
= suppress_rumble;
87
}
functions.h
Audio_SetEnabledFlag
void Audio_SetEnabledFlag(uint8_t enabled)
Definition
system.c:166
Audio_GetEnabledFlag
int32_t Audio_GetEnabledFlag(void)
Definition
system.c:159
globals.h
g_gameSettings
#define g_gameSettings
Definition
globals.h:32
globals.h
Settings_SetPlayerCharacter
void Settings_SetPlayerCharacter(uint8_t character_id)
Definition
preferences.c:70
Settings_SetRumbleSuppressFlag
void Settings_SetRumbleSuppressFlag(uint8_t suppress_rumble)
Definition
preferences.c:84
Settings_GetSfxVolume
uint16_t Settings_GetSfxVolume()
Definition
preferences.c:13
Settings_GetSelectedSaveSlot
int32_t Settings_GetSelectedSaveSlot()
Definition
preferences.c:56
Settings_SetMusicVolume
void Settings_SetMusicVolume(uint16_t volume_fp12)
Definition
preferences.c:34
Settings_SetSelectedSaveSlot
void Settings_SetSelectedSaveSlot(uint8_t slot_index)
Definition
preferences.c:63
Settings_IsSoundEnabled
int32_t Settings_IsSoundEnabled()
Definition
preferences.c:41
Settings_GetMusicVolume
uint16_t Settings_GetMusicVolume()
Definition
preferences.c:27
Settings_SetSfxVolume
void Settings_SetSfxVolume(uint16_t volume_fp12)
Definition
preferences.c:20
Settings_GetRumbleSuppressFlag
int32_t Settings_GetRumbleSuppressFlag()
Definition
preferences.c:77
Settings_SetSoundEnabled
void Settings_SetSoundEnabled(int32_t enabled)
Definition
preferences.c:48
functions.h
globals.h
g_volumeSettings
#define g_volumeSettings
Definition
globals.h:31
g_rumbleSuppressFlag
#define g_rumbleSuppressFlag
Definition
values.h:393
src
settings
preferences.c
Generated by
1.17.0