I'm doing a small demo and I want to load my .mod file (using mikmod).
During development I loaded it from "ms0:/music.mod", that is the root of the memstick. However for a release, I want all my data contained in the same folder as the executable.
So I tested to put the mod-file in the same dir as the EBP (ms0:/PSP/GAME150/mydemo/music.mod) and then loaded it with just "music.mod" as filename. It worked fine for me (using 3.40OE and having my prod in the GAME150 dir).
However, is this the "correct" way to do it (that is, will it work for other firmwares etc.) or is there a situation where the executable will not be able to find it without having a full, absolute path?
Loading data from 'current directory'
This should work (i.e. just the filename without path). You could also use a sub dir (e.g. "data/file.dat").
One problem I had where it didn't work was in a kernel app where I started a user thread and wanted to load a file in the user thread. Then you need to get the current working directory ("getcwd") in the kernel thread.
One problem I had where it didn't work was in a kernel app where I started a user thread and wanted to load a file in the user thread. Then you need to get the current working directory ("getcwd") in the kernel thread.
Ask and it will be given to you; seek and you will find; knock and the door will be opened to you.
Should be fine for executables, but just be aware that it doesn't work for PRXs - although they maintain a record of their current directory, that isn't set to any useful initial value.
Got a v2.0-v2.80 firmware PSP? Download the eLoader here to run homebrew on it!
The PSP Homebrew Database needs you!
The PSP Homebrew Database needs you!