summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndree Buschmann <AndreeBuschmann@t-online.de>2011-05-22 21:00:32 +0000
committerAndree Buschmann <AndreeBuschmann@t-online.de>2011-05-22 21:00:32 +0000
commitde1529c4eb711a331dfa156efdb799149eb52068 (patch)
treed325cf8651608b6c44785cbcf76e7597c630895f
parentd038f89f3fc403f8a9ef03cd08461988f9c74c59 (diff)
downloadrockbox-de1529c4eb711a331dfa156efdb799149eb52068.tar.gz
rockbox-de1529c4eb711a331dfa156efdb799149eb52068.zip
Save a large static buffer in sid codec.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29915 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/codecs/sid.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/apps/codecs/sid.c b/apps/codecs/sid.c
index 46c4a5408f..291b9ca6f3 100644
--- a/apps/codecs/sid.c
+++ b/apps/codecs/sid.c
@@ -66,6 +66,7 @@
66CODEC_HEADER 66CODEC_HEADER
67 67
68#define CHUNK_SIZE (1024*2) 68#define CHUNK_SIZE (1024*2)
69#define SID_BUFFER_SIZE 0x10000
69 70
70/* This codec supports SID Files: 71/* This codec supports SID Files:
71 * 72 *
@@ -73,9 +74,6 @@ CODEC_HEADER
73 74
74static int32_t samples[CHUNK_SIZE] IBSS_ATTR; /* The sample buffer */ 75static int32_t samples[CHUNK_SIZE] IBSS_ATTR; /* The sample buffer */
75 76
76/* Static buffer for the plain SID-File */
77static unsigned char sidfile[0x10000];
78
79void sidPoke(int reg, unsigned char val) ICODE_ATTR; 77void sidPoke(int reg, unsigned char val) ICODE_ATTR;
80 78
81#define FLAG_N 128 79#define FLAG_N 128
@@ -1225,6 +1223,7 @@ enum codec_status codec_run(void)
1225 unsigned int filesize; 1223 unsigned int filesize;
1226 unsigned short load_addr, init_addr, play_addr; 1224 unsigned short load_addr, init_addr, play_addr;
1227 unsigned char subSongsMax, subSong, song_speed; 1225 unsigned char subSongsMax, subSong, song_speed;
1226 unsigned char *sidfile = NULL;
1228 intptr_t param; 1227 intptr_t param;
1229 1228
1230 if (codec_init()) { 1229 if (codec_init()) {
@@ -1236,7 +1235,7 @@ enum codec_status codec_run(void)
1236 /* Load SID file the read_filebuf callback will return the full requested 1235 /* Load SID file the read_filebuf callback will return the full requested
1237 * size if at all possible, so there is no need to loop */ 1236 * size if at all possible, so there is no need to loop */
1238 ci->seek_buffer(0); 1237 ci->seek_buffer(0);
1239 filesize = ci->read_filebuf(sidfile, sizeof(sidfile)); 1238 sidfile = ci->request_buffer(&filesize, SID_BUFFER_SIZE);
1240 1239
1241 if (filesize == 0) { 1240 if (filesize == 0) {
1242 return CODEC_ERROR; 1241 return CODEC_ERROR;