Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Libretro
tyrquake
Commits
8a229769
Commit
8a229769
authored
Oct 09, 2019
by
Libretro-Admin
Browse files
Change to 48Khz - will allow for non-crackling sound at > 60fps
parent
d80db75a
Changes
1
Hide whitespace changes
Inline
Side-by-side
common/libretro.c
View file @
8a229769
...
@@ -95,7 +95,7 @@ static bool libretro_supports_bitmasks = false;
...
@@ -95,7 +95,7 @@ static bool libretro_supports_bitmasks = false;
#define DEFAULT_MEMSIZE_MB 32
#define DEFAULT_MEMSIZE_MB 32
#endif
#endif
#define SAMPLERATE 4
41
00
#define SAMPLERATE 4
80
00
// System analog stick range is -0x8000 to 0x8000
// System analog stick range is -0x8000 to 0x8000
#define ANALOG_RANGE 0x8000
#define ANALOG_RANGE 0x8000
...
@@ -1252,9 +1252,9 @@ void D_EndDirectRect(int x, int y, int width, int height)
...
@@ -1252,9 +1252,9 @@ void D_EndDirectRect(int x, int y, int width, int height)
* SOUND (TODO)
* SOUND (TODO)
*/
*/
#define
AUDIO_
BUFFER_S
AMPLES
(4096)
#define BUFFER_S
IZE
(4096)
static
int16_t
audio_buffer
[
AUDIO_
BUFFER_S
AMPLES
];
static
int16_t
audio_buffer
[
BUFFER_S
IZE
];
static
unsigned
audio_buffer_ptr
;
static
unsigned
audio_buffer_ptr
;
static
void
audio_process
(
void
)
static
void
audio_process
(
void
)
...
@@ -1279,8 +1279,8 @@ static void audio_callback(void)
...
@@ -1279,8 +1279,8 @@ static void audio_callback(void)
float
samples_per_frame
=
(
2
*
SAMPLERATE
)
/
framerate
.
value
;
float
samples_per_frame
=
(
2
*
SAMPLERATE
)
/
framerate
.
value
;
unsigned
read_end
=
audio_buffer_ptr
+
samples_per_frame
;
unsigned
read_end
=
audio_buffer_ptr
+
samples_per_frame
;
if
(
read_end
>
AUDIO_
BUFFER_S
AMPLES
)
if
(
read_end
>
BUFFER_S
IZE
)
read_end
=
AUDIO_
BUFFER_S
AMPLES
;
read_end
=
BUFFER_S
IZE
;
read_first
=
read_end
-
audio_buffer_ptr
;
read_first
=
read_end
-
audio_buffer_ptr
;
read_second
=
samples_per_frame
-
read_first
;
read_second
=
samples_per_frame
-
read_first
;
...
@@ -1301,7 +1301,7 @@ qboolean SNDDMA_Init(dma_t *dma)
...
@@ -1301,7 +1301,7 @@ qboolean SNDDMA_Init(dma_t *dma)
shm
->
samplepos
=
0
;
shm
->
samplepos
=
0
;
shm
->
samplebits
=
16
;
shm
->
samplebits
=
16
;
shm
->
signed8
=
0
;
shm
->
signed8
=
0
;
shm
->
samples
=
AUDIO_
BUFFER_S
AMPLES
;
shm
->
samples
=
BUFFER_S
IZE
;
shm
->
buffer
=
(
unsigned
char
*
volatile
)
audio_buffer
;
shm
->
buffer
=
(
unsigned
char
*
volatile
)
audio_buffer
;
return
true
;
return
true
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment