1
0
Fork 0
forked from len0rd/rockbox

Alpha sound driver for rockboy, should work in theory, but in practice,

it doesn't. disabled by default with a define.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6218 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Michiel Van Der Kolk 2005-03-20 23:06:47 +00:00
parent 457e138fff
commit b045f00d21
3 changed files with 11 additions and 3 deletions

View file

@ -0,0 +1,51 @@
#include "rockmacros.h"
#include "defs.h"
#include "pcm.h"
#include "rc.h"
struct pcm pcm;
static byte buf[4096];
rcvar_t pcm_exports[] =
{
RCV_END
};
void pcm_init(void)
{
pcm.hz = 44100;
pcm.stereo = 1;
pcm.buf = buf;
pcm.len = sizeof buf;
pcm.pos = 0;
}
void pcm_close(void)
{
memset(&pcm, 0, sizeof pcm);
}
int pcm_submit(void)
{
#ifdef RBSOUND
rb->pcm_play_data(pcm.buf,pcm.pos,NULL);
while(rb->pcm_is_playing()); /* spinlock */
pcm.pos = 0;
return 1;
#else
pcm.pos = 0;
return 0;
#endif
}