Help saving file

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

Moderators: cheriff, TyRaNiD

Post Reply
mongatard
Posts: 5
Joined: Wed Mar 15, 2006 10:11 pm

Help saving file

Post by mongatard »

How can I save a file to the memory stick of a psp such as a highscore list, or savegame?
ipsp
Posts: 26
Joined: Wed Feb 01, 2006 9:46 am
Location: Sydney

Post by ipsp »

I have always just used the standard 'C' file functions and they work.

Note sure if this is the solution you want though
mongatard
Posts: 5
Joined: Wed Mar 15, 2006 10:11 pm

Post by mongatard »

Do you save to the path MS0:/PSP/GAME/FOLDER?
ipsp
Posts: 26
Joined: Wed Feb 01, 2006 9:46 am
Location: Sydney

Post by ipsp »

I typically save to the local folder or subfolder that contain the executable.

I'm sure there is a way to write to the correct save floder but I have never bothered as i was under the impression these saves were restricted in some way.

Otherwise wait for someone else to reply, I'm sure you'll get your answer.
weltall
Posts: 310
Joined: Fri Feb 20, 2004 1:56 am
Contact:

Post by weltall »

saving there is possible with normal function, but if you want to save like an ufficial game you need to use the psputility library and precisely this:
psputility_savedata.h you can also found an example samples\savedata\utility note this will work only on 1.5 and 1.0.
you'll need to use samples\savedata\decrypt and samples\savedata\encrypt with 2.0
Gary13579
Posts: 93
Joined: Mon Aug 15, 2005 7:43 am

Post by Gary13579 »

ipsp wrote:I have always just used the standard 'C' file functions and they work.

Note sure if this is the solution you want though
People have noticed that using sceIoRead and sceIoWrite are faster then the standard C functions.
Not sure where the topic was, but I know it was on this forum. The speed difference was pretty unbelievable.
basaghari
Posts: 1
Joined: Mon May 21, 2007 10:03 am

can't make it work

Post by basaghari »

weltall wrote:saving there is possible with normal function, but if you want to save like an ufficial game you need to use the psputility library and precisely this:
psputility_savedata.h you can also found an example samples\savedata\utility note this will work only on 1.5 and 1.0.
you'll need to use samples\savedata\decrypt and samples\savedata\encrypt with 2.0
sorry bout this. really new in using savedata utility. I can't seem to make this work. when i use the sdk sample it just crashes after pressing either circle or cross. it doesn't seem to create any savedata in psp/savedata folder. im using 1.5 in 3.03oe-c.
User avatar
dot_blank
Posts: 498
Joined: Wed Sep 28, 2005 8:47 am
Location: Brasil

Post by dot_blank »

Gary13579 wrote:
ipsp wrote:I have always just used the standard 'C' file functions and they work.

Note sure if this is the solution you want though
People have noticed that using sceIoRead and sceIoWrite are faster then the standard C functions.
Not sure where the topic was, but I know it was on this forum. The speed difference was pretty unbelievable.
This is because of newlib caches access to read/writes
as for saving files any C/C++ book covers how to use
the stdlib io functions ...just make sure to always clear and THEN
delete the file descriptor that is used in your files and also there is a file
limit of i think 9 files concurrently, so keep this in mind
10011011 00101010 11010111 10001001 10111010
Post Reply