int dfd = sceIoDopen("flash0:/");
then calls to sceIoDread work fine
int dfd = sceIoDopen("ms0:/"); shuts down the psp after a short pause
int dfd = sceIoDopen("ms0:/PSP/GAME/gen/data/base/");
returns a valid handle (3) but a call to sceIoDread leaves the memory stick access light on for a while then shuts off the psp
I'm out of ideas, any ideas on what else i can try?
Anybody used these functions and had problems?
sceIoDopen
I recently used these functions with success.
Try using a recent version of pspsdk for exception handling. This might stop the shutdowns.
... and/or perhaps you forgot to allocate memory and you're lucky in round one.
Try using a recent version of pspsdk for exception handling. This might stop the shutdowns.
... and/or perhaps you forgot to allocate memory and you're lucky in round one.
Last edited by rinco on Wed Jul 06, 2005 10:13 pm, edited 1 time in total.
kernel mode.
It seems to be a problem related to kernel mode startup.
I am not sure anyway...
Use search button with "kernel mode" and try it out.
I am not sure anyway...
Use search button with "kernel mode" and try it out.
Whoa, I didn't even notice exception handling! thanks for pointing it out! I'll try it now...rinco wrote:I recently used these functions with success.
Try using a recent version of pspsdk for exception handling. This might stop the shutdowns.
... and/or perhaps you forgot to allocate memory and you're lucky in round one.
edit: psp crashes installing exception handler -_-; (including in the sample program)
edit2: if I set PSP_MAIN_THREAD_ATTR(0) then it works o_O, and that was by accident because I was trying to install the exception handler
sceIoDopen and sceIoDread
I have come to realize that the sample given in the PSPSDK is faulty. If you don't feel like hacking around with your kernelmode/usermode functionality and stability, just use the following fix for the fileio code in the pspsdk.
SceIoDirent *dir = (SceIoDirent *) malloc(sizeof(SceIoDirent));
while (sceIoDread(dfd, dir) > 0) {
if (dir->d_stat.st_attr & FIO_SO_IFDIR) {
....
Just be sure to use -> instead of . from then on, since now we're dealing with a pointer.
Happy coding!
SceIoDirent *dir = (SceIoDirent *) malloc(sizeof(SceIoDirent));
while (sceIoDread(dfd, dir) > 0) {
if (dir->d_stat.st_attr & FIO_SO_IFDIR) {
....
Just be sure to use -> instead of . from then on, since now we're dealing with a pointer.
Happy coding!
Actually it would have been sufficient to just memset the structure to 0 (see this thread).