sceIoDopen

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
beatwho
Posts: 28
Joined: Wed Dec 15, 2004 4:58 pm

sceIoDopen

Post by beatwho »

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?
rinco
Posts: 255
Joined: Fri Jan 21, 2005 2:12 pm
Location: Canberra, Australia

Post by rinco »

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.
Last edited by rinco on Wed Jul 06, 2005 10:13 pm, edited 1 time in total.
pspkrazy
Posts: 49
Joined: Mon Jul 04, 2005 1:31 am

kernel mode.

Post by pspkrazy »

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.
beatwho
Posts: 28
Joined: Wed Dec 15, 2004 4:58 pm

Post by beatwho »

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.
Whoa, I didn't even notice exception handling! thanks for pointing it out! I'll try it now...

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
calebgray
Posts: 1
Joined: Tue May 01, 2007 5:19 pm
Location: Lynden, WA
Contact:

sceIoDopen and sceIoDread

Post by calebgray »

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!
Mihawk
Posts: 29
Joined: Tue Apr 03, 2007 2:04 am

Post by Mihawk »

Actually it would have been sufficient to just memset the structure to 0 (see this thread).
Post Reply