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 

Writing to flash0, need help!

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



Joined: 15 Jul 2005
Posts: 14

PostPosted: Wed Sep 07, 2005 10:06 am    Post subject: Writing to flash0, need help! Reply with quote

Kay, at first don't say "dude don't do this, this can ownz your PSP"
I relleay know what I do!

So anyone has a Idea why this not work :
(the wallpaper I copy here is not more than a test!)

Code:

//placas src:
#include <pspkernel.h>
#include <pspsdk.h>
#include <pspiofilemgr.h>
#include <pspmodulemgr.h>
#include <pspdisplay.h>
#include <pspdebug.h>
#include <pspctrl.h>


#define O_RDONLY   0x0001
#define O_WRONLY   0x0002
#define O_RDWR     0x0003
#define O_NBLOCK   0x0010
#define O_APPEND   0x0100
#define O_CREAT    0x0200
#define O_TRUNC    0x0400
#define O_NOWAIT   0x8000
#define printf   pspDebugScreenPrintf
#define BUFSIZE      65536

SceCtrlData pad_data;

PSP_MODULE_INFO("test", 0x1000, 1, 1);
PSP_MAIN_THREAD_ATTR(0);

int ex = 1;

char   buf[BUFSIZE];

void copy(const char* zFileSrc , const char* zFileDest)
{
   int fd1,fd2,len;
   

       fd1 = sceIoOpen(zFileSrc, O_RDONLY, 0);

       fd2 = sceIoOpen(zFileDest,O_WRONLY | O_CREAT | O_TRUNC, 0777);
       
       if (ex == 1)
       {
       if(fd1 < 0)
       {
printf("File does not exist, all stoped\n");   
printf("Missing file : %s\n", zFileSrc);   
ex = 0;   
       }else{
printf("File was copied to %s \n", zFileDest);                 
     while(1) {
      len = sceIoRead(fd1, buf, BUFSIZE);
      if (len == 0) break;
      sceIoWrite(fd2,buf,len);
   }
}
}
   sceIoClose(fd1);
   sceIoClose(fd2);
}

int main(void)
{   
   pspDebugScreenInit();
   sceIoUnassign("flash0");
  sceIoAssign("flash0", "lflash0:0,0", "fatflash0:", IOASSIGN_RDWR, NULL, 0);
   pspDebugScreenInit();
  copy("ms0:/1.bmp", "flash0:/vsh/resource/wallpaper.bmp");
   return 0;
}



Thx 4 help
Reigel!
Back to top
View user's profile Send private message
Agoln



Joined: 08 Jun 2005
Posts: 326
Location: Fort Wayne, IN

PostPosted: Thu Sep 08, 2005 3:18 am    Post subject: Reply with quote

writing to flash0:// is more than just opening it up and trying to write to it.

It involves doing a handstand on a single hand, sipping coffee from the other, and balancing three elephents on each leg. But, if you are willing, check out PSPersonalize, I *believe* that writes to flash0:// and will probably give you more insite into what circus tricks need to be done.
_________________
Lego of my Ago!
Back to top
View user's profile Send private message AIM Address
reigel



Joined: 15 Jul 2005
Posts: 14

PostPosted: Thu Sep 08, 2005 3:35 am    Post subject: Reply with quote

Thx,
the funny thing is i can write into "flash1".
PSPersonalize isnīt opensrc :( ... plz help me guys!
Back to top
View user's profile Send private message
Vampire



Joined: 12 Apr 2005
Posts: 138

PostPosted: Thu Sep 08, 2005 10:16 pm    Post subject: Reply with quote

there was a bug in the sceIoAssign example...
the third parameter is "flashfat0:" and not "fatflash0:"
Back to top
View user's profile Send private message
OmahaStylee



Joined: 29 Aug 2005
Posts: 14
Location: Los Angeles, CA

PostPosted: Mon Sep 19, 2005 4:47 am    Post subject: Reply with quote

After fixing that error, did it work?
_________________
Back to top
View user's profile Send private message Visit poster's website AIM Address
EdwardFMA



Joined: 06 Jul 2005
Posts: 40

PostPosted: Mon Sep 19, 2005 5:03 am    Post subject: Reply with quote

Vampire wrote:
there was a bug in the sceIoAssign example...
the third parameter is "flashfat0:" and not "fatflash0:"


no i tried that it dosen't fix it T_T i've been trying to access flash0: to write but sadly i can't do all this at once:

Agoln wrote:
It involves doing a handstand on a single hand, sipping coffee from the other, and balancing three elephents on each leg.

_________________
EdwardFMA/IchigoKurosaki - PSP Expert
Athlon 64 - Socket 939 - 3000+
1GB 333 DDR-Ram
Geforce 6600 GT PCI-Express

Orbis PSP Development
Open-Source Development
Back to top
View user's profile Send private message
OmahaStylee



Joined: 29 Aug 2005
Posts: 14
Location: Los Angeles, CA

PostPosted: Mon Sep 19, 2005 5:20 am    Post subject: Reply with quote

Arg, somebody said there is some source code floating around these forums somewhere that can write to flash0. I still havent been able to find it.

Anybody seen it?
_________________


Last edited by OmahaStylee on Mon Sep 19, 2005 11:28 am; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website AIM Address
EdwardFMA



Joined: 06 Jul 2005
Posts: 40

PostPosted: Mon Sep 19, 2005 8:45 am    Post subject: Reply with quote

once you find it tell me ;) lol
_________________
EdwardFMA/IchigoKurosaki - PSP Expert
Athlon 64 - Socket 939 - 3000+
1GB 333 DDR-Ram
Geforce 6600 GT PCI-Express

Orbis PSP Development
Open-Source Development
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