forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Loading data from 'current directory'

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
Sdw



Joined: 17 Jul 2007
Posts: 29

PostPosted: Tue Aug 14, 2007 9:44 pm    Post subject: Loading data from 'current directory' Reply with quote

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?
Back to top
View user's profile Send private message
Mihawk



Joined: 03 Apr 2007
Posts: 29

PostPosted: Tue Aug 14, 2007 10:41 pm    Post subject: Reply with quote

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.
_________________
Ask and it will be given to you; seek and you will find; knock and the door will be opened to you.
Back to top
View user's profile Send private message
Fanjita



Joined: 28 Sep 2005
Posts: 217

PostPosted: Wed Aug 15, 2007 5:32 am    Post subject: Reply with quote

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!
Back to top
View user's profile Send private message
Sdw



Joined: 17 Jul 2007
Posts: 29

PostPosted: Wed Aug 15, 2007 10:45 pm    Post subject: Reply with quote

Alright, looks like I was on the right track then. Thanks for the answers guys!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group