17
17
18
18
#include "state.h"
19
19
20
- /*
21
- * Only the DSITMBK sound effect in DOOM1.WAD uses sample rate 22050
22
- * nonetheless, since we are playing single-player rather than multiplayer,
23
- * sticking with 11025 is acceptable.
20
+ /* The DSITMBK sound effect in DOOM1.WAD uses a sample rate of 22050, but since
21
+ * the game is played in single-player mode, it is acceptable to stick with
22
+ * 11025.
24
23
*
25
- * In Quake, most sound effects with sample rate 11025
24
+ * In Quake, most sound effects have a sample rate of 11025.
26
25
*/
27
26
#define SAMPLE_RATE 11025
28
27
@@ -357,12 +356,11 @@ void syscall_submit_queue(riscv_t *rv)
357
356
* 3. This notice may not be removed or altered from any source distribution.
358
357
*/
359
358
360
- /*
361
- * This is a straightforward MUS to MIDI converter made for programs
362
- * like DOOM that use MIDI to store sound.
359
+ /* This is a simple MUS to MIDI converter designed for programs such as DOOM
360
+ * that utilize MIDI for sound storage.
363
361
*
364
- * Sfx_handler can handle Quake's sound effects because they are all in WAV
365
- * format.
362
+ * The sfx_handler can also manage Quake's sound effects since they are all in
363
+ * WAV format.
366
364
*/
367
365
368
366
typedef PACKED (struct {
@@ -627,8 +625,7 @@ static void *music_handler(void *arg)
627
625
return NULL ;
628
626
}
629
627
630
- /*
631
- * multiplied by 8 because sfx->volume's max is 15
628
+ /* multiplied by 8 because sfx->volume's max is 15
632
629
* further setting volume via syscall_set_music_volume
633
630
*/
634
631
Mix_VolumeMusic (music -> volume * 8 );
@@ -651,11 +648,9 @@ static void play_sfx(riscv_t *rv)
651
648
sfxinfo_t sfxinfo ;
652
649
memory_read (s -> mem , (uint8_t * ) & sfxinfo , sfxinfo_addr , sizeof (sfxinfo_t ));
653
650
654
- /*
655
- * data and size in application must be placed at
656
- * first two fields in structure so that it makes emulator
657
- * compatible to any applications when accessing different sfxinfo_t
658
- * from applications
651
+ /* The data and size in the application must be positioned in the first two
652
+ * fields of the structure. This ensures emulator compatibility with
653
+ * various applications when accessing different sfxinfo_t instances.
659
654
*/
660
655
uint32_t sfx_data_offset = * ((uint32_t * ) & sfxinfo );
661
656
uint32_t sfx_data_size = * (uint32_t * ) ((uint32_t * ) & sfxinfo + 1 );
@@ -683,11 +678,9 @@ static void play_music(riscv_t *rv)
683
678
memory_read (s -> mem , (uint8_t * ) & musicinfo , musicinfo_addr ,
684
679
sizeof (musicinfo_t ));
685
680
686
- /*
687
- * data and size in application must be placed at
688
- * first two fields in structure so that it makes emulator
689
- * compatible to any applications when accessing different sfxinfo_t
690
- * from applications
681
+ /* The data and size in the application must be positioned in the first two
682
+ * fields of the structure. This ensures emulator compatibility with
683
+ * various applications when accessing different sfxinfo_t instances.
691
684
*/
692
685
uint32_t music_data_offset = * ((uint32_t * ) & musicinfo );
693
686
uint32_t music_data_size = * (uint32_t * ) ((uint32_t * ) & musicinfo + 1 );
0 commit comments