UMD/Flash over USB?

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

Moderators: cheriff, TyRaNiD

Post Reply
_.-noel-._
Posts: 49
Joined: Mon Aug 13, 2007 12:57 am

UMD/Flash over USB?

Post by _.-noel-._ »

Hi,

i will access the UMD over USB...

(If this is not allowed in this Forum, i delate it...)
In the "pspumd.h" there is a little sample:

Code: Select all

   int i;
   i = sceUmdCheckMedium(0);
   if(i == 0)
   {
       sceUmdWaitDriveStat(UMD_WAITFORDISC);
   }
   sceUmdActivate(1, "disc0:");
   sceUmdWaitDriveStat(UMD_WAITFORINIT);
but when i will access the "disc0" with:

Code: Select all

   int fd1,fd2,akt; 
                
       fd1 = sceIoOpen("disc0:", PSP_O_RDONLY, 0); 

       fd2 = sceIoOpen("ms0:/disc0",PSP_O_WRONLY | PSP_O_CREAT | PSP_O_TRUNC, 0777); 
        
       if&#40;fd1 < 0&#41; 
       &#123; 
         printf&#40;"Keine Daten gefunden. \n"&#41;; 
       &#125;else&#123; 
                  
     while&#40;1&#41; &#123; 
      akt = sceIoRead&#40;fd1, buf, BUFSIZE&#41;; 
      if &#40;akt == 0&#41; break; 
      sceIoWrite&#40;fd2,buf,akt&#41;; 
   &#125; 
&#125; 
   sceIoClose&#40;fd1&#41;; 
   sceIoClose&#40;fd2&#41;;
Why?

Or must i Assign the UMD?
with:

Code: Select all

   sceIoUnassign&#40;"disc0&#58;"&#41;; 
   sceIoAssign&#40;"disc0&#58;", IOASSIGN_RDONLY, NULL, 0&#41;;
?

And with the Flash, i have also some problems...
I have:

Code: Select all

   int fd4;
   int fd5;
   
       fd4 = sceIoUnassign&#40;"flash0&#58;"&#41;;
       fd5 = sceIoAssign&#40;"flash0&#58;", "lflash0&#58;0,0", "flashfat0&#58;", IOASSIGN_RDWR, NULL, 0&#41;;
       if&#40;fd4 < 0&#41;  
            &#123; 
            printf&#40;"Error&#58; sceIoUnassign"&#41;;
            &#125;
        if&#40;fd5 < 0&#41;
            &#123;
                printf&#40;"Error&#58; sceIoAssign"&#41;;
            &#125;
            
  sceIoClose&#40;fd4&#41;;
  sceIoClose&#40;fd5&#41;;
  
    sceIoUnassign&#40;"flash0&#58;"&#41;; 
    sceIoAssign&#40;"flash0&#58;", "lflash0&#58;0,0", "flashfat0&#58;", IOASSIGN_RDWR, NULL, 0&#41;;
Can somebody help me?
It is important, for my project....
Sry for my english
_.-noel-._
Posts: 49
Joined: Mon Aug 13, 2007 12:57 am

Post by _.-noel-._ »

has nobody an answer?

Important is the flash0 access...
plZ help me...

-.-
Sry for my english
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post by TyRaNiD »

I dont think either is important and doesn't some of the custom firmwares already provide this support ?
_.-noel-._
Posts: 49
Joined: Mon Aug 13, 2007 12:57 am

Post by _.-noel-._ »

this is important...
and i will code my programm, dont use the "recovery" or someting like this.

because its my first BIGGER project....

I have written litle tools, befor, but here i need help...

and i think, i can geht here help, but it look bad....

:(
Sry for my english
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

Code: Select all

fd1 = sceIoOpen&#40;"disc0&#58;", PSP_O_RDONLY, 0&#41;;
"disc0:" isn't a file, it's a device. You can't use the standard file commands on a device, only a file.
_.-noel-._
Posts: 49
Joined: Mon Aug 13, 2007 12:57 am

Post by _.-noel-._ »

and how can i access a device?

its my 1 project with Iofilemaneger...
Sry for my english
Post Reply