mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-13 18:17:39 -04:00
rockboy: rename pcm_*() functions to avoid namespace clash with rockbox
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26327 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
b0146de64c
commit
b36e721aa6
7 changed files with 20 additions and 20 deletions
|
@ -364,22 +364,22 @@ called before reading or writing a sound register, and at the end of
|
|||
each frame.
|
||||
|
||||
The main sound module interfaces with the system-specific code through
|
||||
one structure, pcm, and a few functions: pcm_init, pcm_close, and
|
||||
pcm_submit. While the first two should be obvious, pcm_submit needs
|
||||
one structure, pcm, and a few functions: rockboy_pcm_init, rockboy_pcm_close, and
|
||||
rockboy_pcm_submit. While the first two should be obvious, rockboy_pcm_submit needs
|
||||
some explaining. Whenever realtime sound output is operational,
|
||||
pcm_submit is responsible for timing, and should not return until it
|
||||
rockboy_pcm_submit is responsible for timing, and should not return until it
|
||||
has successfully processed all the data in its input buffer (pcm.buf).
|
||||
On *nix sound devices, this typically means just waiting for the write
|
||||
syscall to return, but on systems such as DOS where low level IO must
|
||||
be handled in the program, pcm_submit needs to delay until the current
|
||||
be handled in the program, rockboy_pcm_submit needs to delay until the current
|
||||
position in the DMA buffer has advanced sufficiently to make space for
|
||||
the new samples, then copy them.
|
||||
|
||||
For special sound output implementations like write-to-file or the
|
||||
dummy sound device, pcm_submit should write the data immediately and
|
||||
dummy sound device, rockboy_pcm_submit should write the data immediately and
|
||||
return 0, indicating to the caller that other methods must be used for
|
||||
timing. On real sound devices that are presently functional,
|
||||
pcm_submit should return 1, regardless of whether it buffered or
|
||||
rockboy_pcm_submit should return 1, regardless of whether it buffered or
|
||||
actually wrote the sound data.
|
||||
|
||||
And yes, for unices without OSS, we hope to add piped audio output
|
||||
|
|
|
@ -56,7 +56,7 @@ void emu_run(void)
|
|||
if (options.sound || !plugbuf)
|
||||
{
|
||||
sound_mix();
|
||||
pcm_submit();
|
||||
rockboy_pcm_submit();
|
||||
}
|
||||
|
||||
doevents();
|
||||
|
|
|
@ -85,7 +85,7 @@ int do_user_menu(void) {
|
|||
"Load Game", "Save Game",
|
||||
"Options", "Quit");
|
||||
|
||||
pcm_init();
|
||||
rockboy_pcm_init();
|
||||
|
||||
while(!done)
|
||||
{
|
||||
|
|
|
@ -15,9 +15,9 @@ struct pcm
|
|||
|
||||
extern struct pcm pcm;
|
||||
|
||||
void pcm_init(void);
|
||||
int pcm_submit(void);
|
||||
void pcm_close(void);
|
||||
void rockboy_pcm_init(void);
|
||||
int rockboy_pcm_submit(void);
|
||||
void rockboy_pcm_close(void);
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ static void get_more(unsigned char** start, size_t* size)
|
|||
doneplay=1;
|
||||
}
|
||||
|
||||
void pcm_init(void)
|
||||
void rockboy_pcm_init(void)
|
||||
{
|
||||
if(plugbuf)
|
||||
return;
|
||||
|
@ -61,7 +61,7 @@ void pcm_init(void)
|
|||
rb->pcm_set_frequency(pcm.hz); /* 44100 22050 11025 */
|
||||
}
|
||||
|
||||
void pcm_close(void)
|
||||
void rockboy_pcm_close(void)
|
||||
{
|
||||
memset(&pcm, 0, sizeof pcm);
|
||||
newly_started = true;
|
||||
|
@ -69,7 +69,7 @@ void pcm_close(void)
|
|||
rb->pcm_set_frequency(HW_SAMPR_DEFAULT);
|
||||
}
|
||||
|
||||
int pcm_submit(void)
|
||||
int rockboy_pcm_submit(void)
|
||||
{
|
||||
if (!pcm.buf) return 0;
|
||||
if (pcm.pos < pcm.len) return 1;
|
||||
|
@ -91,7 +91,7 @@ int pcm_submit(void)
|
|||
|
||||
#else
|
||||
|
||||
void pcm_init(void)
|
||||
void rockboy_pcm_init(void)
|
||||
{
|
||||
pcm.hz = 44100;
|
||||
pcm.stereo = 1;
|
||||
|
@ -100,12 +100,12 @@ void pcm_init(void)
|
|||
pcm.pos = 0;
|
||||
}
|
||||
|
||||
void pcm_close(void)
|
||||
void rockboy_pcm_close(void)
|
||||
{
|
||||
memset(&pcm, 0, sizeof pcm);
|
||||
}
|
||||
|
||||
int pcm_submit(void)
|
||||
int rockboy_pcm_submit(void)
|
||||
{
|
||||
pcm.pos =0;
|
||||
return 0;
|
||||
|
|
|
@ -361,7 +361,7 @@ static int gnuboy_main(const char *rom)
|
|||
rb->lcd_puts(0,0,"Init video");
|
||||
vid_init();
|
||||
rb->lcd_puts(0,1,"Init sound");
|
||||
pcm_init();
|
||||
rockboy_pcm_init();
|
||||
rb->lcd_puts(0,2,"Loading rom");
|
||||
loader_init(rom);
|
||||
if(shut)
|
||||
|
@ -438,7 +438,7 @@ enum plugin_status plugin_start(const void* parameter)
|
|||
return PLUGIN_ERROR;
|
||||
}
|
||||
if(!rb->audio_status())
|
||||
pcm_close();
|
||||
rockboy_pcm_close();
|
||||
|
||||
rb->splash(HZ/2, "Closing Rockboy");
|
||||
|
||||
|
|
|
@ -422,7 +422,7 @@ void sound_mix(void)
|
|||
if (pcm.buf)
|
||||
{
|
||||
if (pcm.pos >= pcm.len)
|
||||
pcm_submit();
|
||||
rockboy_pcm_submit();
|
||||
if (pcm.stereo)
|
||||
{
|
||||
pcm.buf[pcm.pos++] = l;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue