I can call sceIoDopen and get a valid SceUID (3), but as soon as I call sceIoDread on that UID, the PSP crashes (sometimes with the mem stick light on and sometimes with it off).
Here's some code:
Code: Select all
void loadDirectory(char* path) {
int dfd, f = 0, i = 0;
SceIoDirent dir;
oslDebug("hi\n");
dfd = sceIoDopen("ms0:/PSP/GAME/");
if (dfd <= 0)
oslFatalError("sceIoDopen returned %i", dfd);
oslDebug("sceIoDopen returned: %i\n", dfd);
while (sceIoDread(dfd, &dir) > 0) {
oslDebug("%s\n", dir.d_name);
if (!dir.d_stat.st_attr & FIO_SO_IFDIR) {
if (dir.d_name[0] != '.') {
strcpy(cwdFolders[f], dir.d_name);
f++;
}
} else {
strcpy(cwdFiles[i], dir.d_name);
i++;
}
}
oslDebug("bye\n");
sceIoDclose(dfd);
}
Edit: Just installed a quick exception handler if it helps.
Exception: Bus error (data)
EPC: 8802BAB8
Cause: 0000001C
Status: 60008603
BadVAddr: 412090C8
zr:00000000
a0:FFFFFFFF
t0:0000002E
t4:0000000D
s0:88229E88
s4:882E8878
t8:000001A1
gp:08950530
at:BC600000
a1:88229FAA
t1:00000000
t5:00001220
s1:882E8820
s5:00010000
t9:000001AE
sp:882E87A0
v0:00000000
a2:0000000D
t2:00000001
t6:00000244
s2:88229FA9
s6:08940000
k0:00000000
fp:08940000
v1:00000000
a3:FFFFFFFF
t3:88040000
t7:00000068
s3:00000003
s7:08940000
k1:00000003
ra:88151B88