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: Select all
//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!