forked from len0rd/rockbox
Save a large static buffer in sid codec.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29915 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
d038f89f3f
commit
de1529c4eb
1 changed files with 3 additions and 4 deletions
|
|
@ -66,6 +66,7 @@
|
||||||
CODEC_HEADER
|
CODEC_HEADER
|
||||||
|
|
||||||
#define CHUNK_SIZE (1024*2)
|
#define CHUNK_SIZE (1024*2)
|
||||||
|
#define SID_BUFFER_SIZE 0x10000
|
||||||
|
|
||||||
/* This codec supports SID Files:
|
/* This codec supports SID Files:
|
||||||
*
|
*
|
||||||
|
|
@ -73,9 +74,6 @@ CODEC_HEADER
|
||||||
|
|
||||||
static int32_t samples[CHUNK_SIZE] IBSS_ATTR; /* The sample buffer */
|
static int32_t samples[CHUNK_SIZE] IBSS_ATTR; /* The sample buffer */
|
||||||
|
|
||||||
/* Static buffer for the plain SID-File */
|
|
||||||
static unsigned char sidfile[0x10000];
|
|
||||||
|
|
||||||
void sidPoke(int reg, unsigned char val) ICODE_ATTR;
|
void sidPoke(int reg, unsigned char val) ICODE_ATTR;
|
||||||
|
|
||||||
#define FLAG_N 128
|
#define FLAG_N 128
|
||||||
|
|
@ -1225,6 +1223,7 @@ enum codec_status codec_run(void)
|
||||||
unsigned int filesize;
|
unsigned int filesize;
|
||||||
unsigned short load_addr, init_addr, play_addr;
|
unsigned short load_addr, init_addr, play_addr;
|
||||||
unsigned char subSongsMax, subSong, song_speed;
|
unsigned char subSongsMax, subSong, song_speed;
|
||||||
|
unsigned char *sidfile = NULL;
|
||||||
intptr_t param;
|
intptr_t param;
|
||||||
|
|
||||||
if (codec_init()) {
|
if (codec_init()) {
|
||||||
|
|
@ -1236,7 +1235,7 @@ enum codec_status codec_run(void)
|
||||||
/* Load SID file the read_filebuf callback will return the full requested
|
/* Load SID file the read_filebuf callback will return the full requested
|
||||||
* size if at all possible, so there is no need to loop */
|
* size if at all possible, so there is no need to loop */
|
||||||
ci->seek_buffer(0);
|
ci->seek_buffer(0);
|
||||||
filesize = ci->read_filebuf(sidfile, sizeof(sidfile));
|
sidfile = ci->request_buffer(&filesize, SID_BUFFER_SIZE);
|
||||||
|
|
||||||
if (filesize == 0) {
|
if (filesize == 0) {
|
||||||
return CODEC_ERROR;
|
return CODEC_ERROR;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue