I'm having a problem loading any sort of file from ms0: when running an app from flash0:...
My program starts when the PSP is load, as its in place of vshmain.prx, the app itself works perfect when saved on the memstick, and can access everything it needs, but when its loaded from flash, it causes lots of errors and crashes.
The app starts, and tries to access a config file, if the config file fails to load, I display a RSoD, this appears every time I boot the PSP, if I remove the line that reads the config, it gets as far as loading the images but crashes again as it fails to read them...
I tried making a plugin to load the app a while back, and I made a mistake and loaded it using this code:
struct SceKernelLoadExecVSHParam param;
memset(¶m, 0, sizeof(param));
param.size = sizeof(param);
param.argp = bpath;
param.args = strlen(bpath)+1;
param.key = "vsh"; //should have been game
sctrlKernelLoadExecVSHMs2(bpath, ¶m);
this gave the exact same problems as I'm experiancing when loading from flash, but when I changed the key to game, it worked perfect.
I've tried replacing vshmain.prx with some code to force load my app with the game key, but I've had no luck, I can't get it to load at all.
I also had the thought that because it was a usermode app that it might not be able to access ms0: from flash0:, so I tried loading the image from flash0:, same error.
I'm assuming its possible to work around this somehow, but I've had little luck finding one myself, and I have no idea how to word a search to see if anyone has had this same problem.
I could imagine that the device is not mapped at the time you try to access it.
It would make sense if vshmain.prx is loaded as one of the first prx, meaning that it might take 5-10 seconds until ms0:/ was mapped to the correct device / driver
That seems quite a logical idea, but unfortunatly its having none of it, I've also tried unassigning and reassigning ms0:/ but that didn't make any difference either.
I have realised though that I had absolutly no problem what so ever in a previous app I made to replace vshmain.prx which read from ms0:/ and flash1:/, so I'll check that and see if I can spot any differences.
I've just removed the PSP_HEAP_SIZE_KB macro, and this has allowed the config file to be read, but I still crash upon loading images, so I've had a fiddle with the heap size, it appears I can't go above 1930, but this value doesn't quite allow me to load all the images I require, even freeing those images that arn't needed, then re-assigning them when they are required doesn't work, any advice is greatly welcome.
All of the above was based on PSPLink and using reset vsh then loading the plugin... I've just tried this in the actual flash and its crashing again.
-Aura
*Oops, quoted myself instead of editing by accident >.>
I've tried making a replacement vshmain.prx to load the main (infact, this is exactly what I need to do when its complete anyway).
The %% in the pspbtcnf.txt indicates a file which is to be loaded in the vsh partition, removing these just seems to do nothing, which I actually think is rather odd because it must be loaded for some purpose, but I'm not sure to what purpose.
I think the way forward would be to load it with a different key, such as with the game key, but all my attempts thus far have proved fruitless, I get nothing happen at all, and the only functions that appear to work are those which just load it in the current key (vsh in this case), which isn't much help.
I found a good balance between the heap sizes that work, 1930 was the highest it would go and still read the config file, anything higher would cause a bug, but setting the heap to this size meant images wouldn't load correctly, I have to load various and its just not enough to cover them all. And either way, changing the heap size didn't appear to make any difference when it was actually flashed, no images would load what so ever.
Anyway, I guess its back to the drawing board, somethings got to work eventually (I hope...).
-Aura
Edit:
Ok, I've taken a long look through most of the headers and I've come across this
SceUID sceKernelCreateHeap(SceUID partitionid, SceSize size, int unk, const char *name);
which looks promising, but obviously it doesn't work as required because its a kmode function (and I've not got my kmode stuff set up yet), so I was just wondering if anyone knows if this is likely to work, and also if they can tell me what to put in the first argument?