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
snes9x2002
Commits
8e9722d2
Commit
8e9722d2
authored
Jun 14, 2012
by
Toad King
Browse files
some work on sound
parent
ec460362
Changes
2
Hide whitespace changes
Inline
Side-by-side
README.txt
View file @
8e9722d2
------------------------------------------------------------------------------
Stuff that currently doesn't work:
* Sound
* Savestates
* Some games don't work
------------------------------------------------------------------------------
Stuff that I might fix:
* Sound may be a bit off, but I don't know if that's just my ALSA drivers or
something with the core.
* SA-1 games are slow, could use some optimization.
libretro/libretro.cpp
View file @
8e9722d2
...
...
@@ -167,7 +167,8 @@ void retro_get_system_info(struct retro_system_info *info)
}
static
int16
audio_buf
[
0x10000
];
int
avail
=
534
;
static
int
avail
;
static
int
samplerate
=
32000
;
void
S9xGenerateSound
()
{
...
...
@@ -194,7 +195,7 @@ void retro_get_system_av_info(struct retro_system_av_info *info)
info
->
timing
.
fps
=
21477272.0
/
357366.0
;
else
info
->
timing
.
fps
=
21281370.0
/
425568.0
;
info
->
timing
.
sample_rate
=
32040.5
;
info
->
timing
.
sample_rate
=
samplerate
;
info
->
geometry
.
aspect_ratio
=
4.0
f
/
3.0
f
;
}
...
...
@@ -202,7 +203,7 @@ static void snes_init (void)
{
memset
(
&
Settings
,
0
,
sizeof
(
Settings
));
Settings
.
JoystickEnabled
=
FALSE
;
Settings
.
SoundPlaybackRate
=
32000
;
Settings
.
SoundPlaybackRate
=
samplerate
;
Settings
.
Stereo
=
TRUE
;
Settings
.
SoundBufferSize
=
0
;
Settings
.
CyclesPercentage
=
100
;
...
...
@@ -425,6 +426,7 @@ bool retro_load_game(const struct retro_game_info *game)
//S9xGraphicsInit();
S9xReset
();
Settings
.
asmspc700
=
true
;
CPU
.
APU_APUExecuting
=
Settings
.
APUEnabled
=
3
;
Settings
.
SixteenBitSound
=
true
;
so
.
stereo
=
Settings
.
Stereo
;
...
...
@@ -432,6 +434,10 @@ bool retro_load_game(const struct retro_game_info *game)
S9xSetPlaybackRate
(
so
.
playback_rate
);
S9xSetSoundMute
(
FALSE
);
avail
=
samplerate
/
(
Settings
.
PAL
?
50
:
60
);
ZeroMemory
(
audio_buf
,
sizeof
(
audio_buf
));
return
TRUE
;
}
...
...
@@ -537,7 +543,7 @@ bool8 S9xOpenSoundDevice (int mode, bool8 stereo, int buffer_size) {
//so.sixteen_bit = 1;
so
.
stereo
=
TRUE
;
//so.buffer_size = 534;
so
.
playback_rate
=
32000
;
so
.
playback_rate
=
samplerate
;
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