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:
parent
457e138fff
commit
b045f00d21
3 changed files with 11 additions and 3 deletions
51
apps/plugins/rockboy/rbsound.c
Normal file
51
apps/plugins/rockboy/rbsound.c
Normal 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
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue