here is the code:
Code: Select all
WaveInfo *wavLoad (char *filename)
{
unsigned int filelen;
unsigned long datalength;
int data_offset;
int id;
int size;
int fd;
unsigned char *wavfile;
char path_name[256];
WaveInfo *wi;
SceIoStat stat;
sprintf(path_name,"%s%s", g_boot_path, filename);
fd = sceIoOpen(path_name, PSP_O_RDONLY, 0777);
if (fd<0)
{
printf("Failed loading: %s",path_name);
}
else
{
// ---- Definatly gets here...
printf("1-GOT HERE\n");
sceIoGetstat(path_name,&stat);
printf("2-GOT HERE\n");
wi = malloc(stat.st_size + sizeof(WaveInfo));
printf("3-GOT HERE\n");
wavfile = (char*)(wi + sizeof(WaveInfo));
printf("4-GOT HERE\n");
filelen = sceIoRead(fd, wavfile, stat.st_size);
printf("5-GOT HERE\n");
sceIoClose(fd);
printf("6-GOT HERE\n");
// dies before here