Skip to content

Commit 27f3659

Browse files
committed
[app] Volume control for CDDA and romdisk unmount fix.
For both ISO Loader and Games Menu apps.
1 parent ecda44e commit 27f3659

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

applications/games_menu/modules/utils.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* DreamShell ##version##
22
33
utils.c - app utils
4-
Copyright (C) 2022-2024 SWAT
4+
Copyright (C) 2022-2025 SWAT
55
Copyright (C) 2024-2025 Maniac Vera
66
77
*/
@@ -12,6 +12,7 @@
1212
#include <img/copy.h>
1313
#include "app_utils.h"
1414
#include "audio/wav.h"
15+
#include "settings.h"
1516

1617
static uint8 *romdisk_data[3] = {NULL, NULL, NULL};
1718
static const char *mount_points[] = {"/presets_cd", "/presets_sd", "/presets_ide"};
@@ -701,6 +702,11 @@ void PlayCDDATrack(const char *file, int loop)
701702
return;
702703
}
703704
ds_printf("DS_OK: Start playing: %s\n", file);
705+
706+
int volume = GetVolumeFromSettings();
707+
if(volume >= 0) {
708+
wav_volume(wav_hnd, volume);
709+
}
704710
wav_play(wav_hnd);
705711
}
706712
}
@@ -724,7 +730,7 @@ int MountPresetsRomdisk(int device_type)
724730
return -1;
725731
}
726732

727-
if (fs_romdisk_mount(mount_points[device_type], romdisk_data[device_type], 1) < 0)
733+
if (fs_romdisk_mount(mount_points[device_type], romdisk_data[device_type], 0) < 0)
728734
{
729735
ds_printf("DS_ERROR: Failed to mount romdisk %s\n", mount_points[device_type]);
730736
free(romdisk_data[device_type]);

applications/iso_loader/modules/utils.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
/* DreamShell ##version##
22
33
utils.c - ISO Loader app utils
4-
Copyright (C) 2022-2024 SWAT
4+
Copyright (C) 2022-2025 SWAT
55
66
*/
77

88
#include "ds.h"
99
#include "isoldr.h"
1010
#include "app_utils.h"
1111
#include "audio/wav.h"
12+
#include "settings.h"
1213

1314
/* Trim begin/end spaces and copy into output buffer */
1415
void trim_spaces(char *input, char *output, int size) {
@@ -228,6 +229,11 @@ void PlayCDDATrack(const char *file, int loop) {
228229
return;
229230
}
230231
ds_printf("DS_OK: Start playing: %s\n", file);
232+
233+
int volume = GetVolumeFromSettings();
234+
if(volume >= 0) {
235+
wav_volume(wav_hnd, volume);
236+
}
231237
wav_play(wav_hnd);
232238
}
233239
}
@@ -251,7 +257,7 @@ int mountPresetsRomdisk(int device_type) {
251257
return -1;
252258
}
253259

254-
if (fs_romdisk_mount(mount_points[device_type], romdisk_data[device_type], 1) < 0) {
260+
if (fs_romdisk_mount(mount_points[device_type], romdisk_data[device_type], 0) < 0) {
255261
ds_printf("DS_ERROR: Failed to mount romdisk %s\n", mount_points[device_type]);
256262
free(romdisk_data[device_type]);
257263
romdisk_data[device_type] = NULL;

0 commit comments

Comments
 (0)