diff options
Diffstat (limited to 'apps/codecs/sid.c')
-rw-r--r-- | apps/codecs/sid.c | 27 |
1 files changed, 3 insertions, 24 deletions
diff --git a/apps/codecs/sid.c b/apps/codecs/sid.c index d356da7fee..58eb725057 100644 --- a/apps/codecs/sid.c +++ b/apps/codecs/sid.c | |||
@@ -65,21 +65,10 @@ CODEC_HEADER | |||
65 | 65 | ||
66 | #define CHUNK_SIZE (1024*2) | 66 | #define CHUNK_SIZE (1024*2) |
67 | 67 | ||
68 | |||
69 | struct codec_api *rb; | ||
70 | |||
71 | /* This codec supports SID Files: | 68 | /* This codec supports SID Files: |
72 | * | 69 | * |
73 | */ | 70 | */ |
74 | 71 | ||
75 | #ifdef USE_IRAM | ||
76 | extern char iramcopy[]; | ||
77 | extern char iramstart[]; | ||
78 | extern char iramend[]; | ||
79 | extern char iedata[]; | ||
80 | extern char iend[]; | ||
81 | #endif | ||
82 | |||
83 | static int32_t samples[CHUNK_SIZE] IBSS_ATTR; /* The sample buffer */ | 72 | static int32_t samples[CHUNK_SIZE] IBSS_ATTR; /* The sample buffer */ |
84 | 73 | ||
85 | /* Static buffer for the plain SID-File */ | 74 | /* Static buffer for the plain SID-File */ |
@@ -1213,9 +1202,8 @@ unsigned short LoadSIDFromMemory(void *pSidData, unsigned short *load_addr, | |||
1213 | } | 1202 | } |
1214 | 1203 | ||
1215 | 1204 | ||
1216 | enum codec_status codec_start(struct codec_api *api) | 1205 | enum codec_status codec_main(void) |
1217 | { | 1206 | { |
1218 | struct codec_api *ci; | ||
1219 | size_t n, bytesfree; | 1207 | size_t n, bytesfree; |
1220 | unsigned char *p; | 1208 | unsigned char *p; |
1221 | unsigned int filesize; | 1209 | unsigned int filesize; |
@@ -1228,20 +1216,11 @@ enum codec_status codec_start(struct codec_api *api) | |||
1228 | int nSamplesToRender = 0; | 1216 | int nSamplesToRender = 0; |
1229 | 1217 | ||
1230 | /* Generic codec initialisation */ | 1218 | /* Generic codec initialisation */ |
1231 | rb = api; | ||
1232 | ci = api; | ||
1233 | |||
1234 | |||
1235 | #ifdef USE_IRAM | ||
1236 | ci->memcpy(iramstart, iramcopy, iramend - iramstart); | ||
1237 | ci->memset(iedata, 0, iend - iedata); | ||
1238 | #endif | ||
1239 | |||
1240 | ci->configure(CODEC_SET_FILEBUF_WATERMARK, (int *)(1024*512)); | 1219 | ci->configure(CODEC_SET_FILEBUF_WATERMARK, (int *)(1024*512)); |
1241 | ci->configure(CODEC_SET_FILEBUF_CHUNKSIZE, (int *)(1024*256)); | 1220 | ci->configure(CODEC_SET_FILEBUF_CHUNKSIZE, (int *)(1024*256)); |
1242 | 1221 | ||
1243 | next_track: | 1222 | next_track: |
1244 | if (codec_init(api)) { | 1223 | if (codec_init()) { |
1245 | return CODEC_ERROR; | 1224 | return CODEC_ERROR; |
1246 | } | 1225 | } |
1247 | 1226 | ||
@@ -1251,7 +1230,7 @@ next_track: | |||
1251 | /* Load SID file */ | 1230 | /* Load SID file */ |
1252 | p = sidfile; | 1231 | p = sidfile; |
1253 | bytesfree=sizeof(sidfile); | 1232 | bytesfree=sizeof(sidfile); |
1254 | while ((n = rb->read_filebuf(p, bytesfree)) > 0) { | 1233 | while ((n = ci->read_filebuf(p, bytesfree)) > 0) { |
1255 | p += n; | 1234 | p += n; |
1256 | bytesfree -= n; | 1235 | bytesfree -= n; |
1257 | } | 1236 | } |