Fixed issues with dreamcast dsf playback.
parent
a49cd40952
commit
40c723df79
|
@ -1226,6 +1226,8 @@ void *aica_start(const void *config)
|
|||
|
||||
void aica_stop(void)
|
||||
{
|
||||
free(AllocedAICA->buffertmpl);
|
||||
free(AllocedAICA->buffertmpr);
|
||||
free(AllocedAICA);
|
||||
}
|
||||
|
||||
|
|
|
@ -172,3 +172,4 @@ void dc_hw_init(void)
|
|||
aica_start(&aica_interface);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -33,6 +33,7 @@ static char psfby[256];
|
|||
static uint32 decaybegin, decayend, total_samples;
|
||||
|
||||
void *aica_start(const void *config);
|
||||
void aica_stop(void);
|
||||
void AICA_Update(void *param, INT16 **inputs, INT16 **buf, int samples);
|
||||
|
||||
int32 dsf_start(uint8 *buffer, uint32 length)
|
||||
|
@ -88,6 +89,7 @@ int32 dsf_start(uint8 *buffer, uint32 length)
|
|||
|
||||
// Dispose the corlett structure for the lib - we don't use it
|
||||
free(lib);
|
||||
free(lib_decoded);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -209,6 +211,9 @@ int32 dsf_gen(int16 *buffer, uint32 samples)
|
|||
|
||||
int32 dsf_stop(void)
|
||||
{
|
||||
aica_stop();
|
||||
free(c);
|
||||
|
||||
return AO_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
|
@ -193,6 +193,7 @@ int32 qsf_start(uint8 *buffer, uint32 length)
|
|||
|
||||
// Dispose the corlett structure for the lib - we don't use it
|
||||
free(lib);
|
||||
free(lib_decoded);
|
||||
}
|
||||
|
||||
// now patch the file into RAM OVER the libraries
|
||||
|
@ -305,6 +306,7 @@ int32 qsf_stop(void)
|
|||
{
|
||||
free(Z80ROM);
|
||||
free(QSamples);
|
||||
free(c);
|
||||
|
||||
return AO_SUCCESS;
|
||||
}
|
||||
|
|
|
@ -103,7 +103,7 @@ int ao_get_lib(char *fn, uint8 **buf, uint64 *length)
|
|||
{
|
||||
NSMutableDictionary *dict = [NSMutableDictionary dictionary];
|
||||
|
||||
for (int i =0 ; i < 8; i++) {
|
||||
for (int i = 1 ; i < 9; i++) {
|
||||
NSString *key = [[NSString alloc] initWithUTF8String:info.title[i]];
|
||||
NSString *value = [[NSString alloc] initWithUTF8String:info.info[i]];
|
||||
|
||||
|
@ -137,7 +137,7 @@ int ao_get_lib(char *fn, uint8 **buf, uint64 *length)
|
|||
ao_display_info info;
|
||||
if ((*types[type].fillinfo)(&info) == AO_SUCCESS)
|
||||
{
|
||||
for (int i =0 ; i < 8; i++) {
|
||||
for (int i = 1 ; i < 9; i++) {
|
||||
NSString *key = [[NSString alloc] initWithUTF8String:info.title[i]];
|
||||
NSString *value = [[NSString alloc] initWithUTF8String:info.info[i]];
|
||||
|
||||
|
@ -247,7 +247,19 @@ int ao_get_lib(char *fn, uint8 **buf, uint64 *length)
|
|||
return 0;
|
||||
}
|
||||
|
||||
(*types[type].gen)(buf, frames);
|
||||
const int maxFrames = 1470; // The Dreamcast decoder starts smashing things if you try decoding more than this
|
||||
|
||||
int amountRead = 0;
|
||||
while (amountRead < frames) {
|
||||
int requestAmount = frames - amountRead;
|
||||
if (requestAmount > maxFrames) {
|
||||
requestAmount = maxFrames;
|
||||
}
|
||||
|
||||
(*types[type].gen)((int16_t *)((int32_t *)buf + amountRead), requestAmount);
|
||||
|
||||
amountRead += requestAmount;
|
||||
}
|
||||
|
||||
framesRead += frames;
|
||||
|
||||
|
@ -319,7 +331,7 @@ int ao_get_lib(char *fn, uint8 **buf, uint64 *length)
|
|||
|
||||
+ (NSArray *)fileTypes
|
||||
{
|
||||
return [NSArray arrayWithObjects:@"psf",@"minipsf",@"psf2", @"spu", @"psf2", @"ssf", @"dsf", @"qsf", nil];
|
||||
return [NSArray arrayWithObjects:@"psf",@"minipsf",@"psf2", @"spu", @"psf2", @"ssf", @"dsf", @"minidsf", @"qsf", nil];
|
||||
}
|
||||
|
||||
+ (NSArray *)mimeTypes
|
||||
|
|
Loading…
Reference in New Issue