sexdwarf
Joined: 14 Jul 2005 Posts: 34
|
Posted: Tue Jul 26, 2005 12:56 pm Post subject: subsequenct sceIoRead calls crashing |
|
|
i am having an issue reading with sceIoRead... any initial call works, however any subsequent calls crash the PSP, and i've concluded that it's not related to the file (switching the order works the same way) etc...
here is the code:
| Code: |
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
|
it always dies right after "4-GOT HERE" when being called a second time...anyone have any ideas? _________________ ...isn't it nice, sugar and spice...
...luring disco dollies to a life of vice... |
|