EDIT: und zu HacKmaN's unteren Post Wink
Ihr habt mir supper geholfen, wie ich es machen soll, aber von wo habe ich Codes geklaut?
Du hast mir mal des Despertar Del Cementerio V7 gegeben (src) Immer wenn ich was builde, dann kommen haufenweiße errors
Deswegen habe ich auch den Archiv gelöscht!
// Updater - by DarK_TonY
#include <pspsdk.h>
#include <pspkernel.h>
#include <pspdebug.h>
#include <pspctrl.h>
#include <psprtc.h>
#include <pspgu.h>
#include <pspgum.h>
#include <stdlib.h>
#include <stdio.h>
#include <vlf.h>
PSP_MODULE_INFO("updater", 1, 1, 0);
PSP_MAIN_THREAD_ATTR(0);
int MainMenu();
typedef struct _SampleConfiguration
{
u16 password[128];
} SampleConfiguration;
SampleConfiguration config;
int focus;
VlfText password_label, signin;
VlfInputBox password;
int Exit()
{
sceKernelExitGame();
return VLF_EV_RET_NOTHING;
}
int copyFile(char * src, char * dst) {
SceUID srcID = sceIoOpen(src, PSP_O_RDONLY, 0777);
SceUID dstID = sceIoOpen(dst, PSP_O_CREAT | PSP_O_WRONLY, 0777);
char buffer[128 * 1024];
int read_bytes = 0;
if (srcID && dstID) {
while ((read_bytes = sceIoRead(srcID, buffer, sizeof(buffer)))) {
sceIoWrite(dstID, buffer, read_bytes);
}
sceIoClose(srcID);
sceIoClose(dstID);
return 0;
} else {
return -1;
}
return 0;
}
void WriteFile(char *file, void *buf, int size);
void Reassign() {
sceIoUnassign("flash0:");
sceIoAssign("flash0:", "lflash0:0,0", "flashfat0:", IOASSIGN_RDWR, NULL, 0);
}
void Reassign1() {
sceIoUnassign("flash1:");
sceIoAssign("flash1:", "lflash0:0,1", "flashfat1:", IOASSIGN_RDWR, NULL, 0);
}
void formatFlash() {
// Hier kommt der Code: formatting Flash0 hinein!!!
}
int OnLoginScreenUp(void *param)
{
switch (focus)
{
case 1:
focus = 0;
vlfGuiSetInputBoxFocus(password, 1);
vlfGuiRemoveTextFocus(signin, 1);
break;
}
return VLF_EV_RET_NOTHING;
}
int OnMainMenuSelect(int sel)
{
switch (sel)
{
case 0: // Erste Option
{
vlfGuiCancelCentralMenu();
vlfGuiAddText( 100, 110 ,"Formatting all Flashes...");
sceKernelDelayThread(500);
Reassign();
Reassign1();
formatFlash();
vlfGuiAddText( 100, 120 ,"Installing CFW X.XX-XX");
vlfGuiAddText( 100, 160 ,"CFW X.XX-XX are installed!\nCFW Coder: XXX\nUpdater by DarK_TonY");
vlfGuiCustomBottomDialog("Exit", NULL, 1, 0, VLF_DEFAULT, Exit);
return VLF_EV_RET_NOTHING;
}
break;
case 1: //2.Option
{
vlfGuiCancelCentralMenu();
vlfGuiAddText( 100, 110 ,"Installing OFW X.XX");
sceKernelDelayThread(500);
Reassign();
Reassign1();
vlfGuiAddText( 100, 160 ,"OFW X.XX installed!\nUpdater by DarK_TonY");
vlfGuiCustomBottomDialog("Exit", NULL, 1, 0, VLF_DEFAULT, Exit);
return VLF_EV_RET_NOTHING;
}
break;
case 2: //3.option
{
vlfGuiCancelCentralMenu();
sceIoRemove("iop.prx");
sceIoRemove("intraFont.prx");
sceIoRemove("vlf.prx");
Exit();
return VLF_EV_RET_NOTHING;
}
break;
}
return VLF_EV_RET_REMOVE_OBJECTS | VLF_EV_RET_REMOVE_HANDLERS;
}
int MainMenu(int sel)
{
char *items[] =
{
"Install CFW X.XX-XX",
"Install OFW X.XX",
"Exit",
};
vlfGuiCentralMenu(3, items, sel, OnMainMenuSelect, 0, 0);
vlfGuiSetPageControlEnable(1);
vlfGuiSetRectangleVisibility( 0, 230, 480, 5, 0);
return VLF_EV_RET_NOTHING;
}
int Title()
{
vlfGuiSetModelSystem();
vlfGuiSetBackgroundSystem(1);
int model = 0;
model = sceKernelGetModel();
char titel_str[15];
memset(titel_str, 0, sizeof(titel_str));
sprintf(titel_str, "X.XX Updater - by DarK_TonY [Model:] %s", ((!model) ? "1000" : ((model == 1) ? "2000" : ((model == 2) ? "3000" : "GO"))));
vlfGuiSetTitleBar(vlfGuiAddText(0, 0, titel_str), NULL, 1, 1);
vlfGuiAddBatteryIconSystem(10*1000*1000);
vlfGuiAddClock();
vlfGuiSetPageControlEnable(0);
MainMenu(0);
while (1)
{
vlfGuiDrawFrame();
};
return VLF_EV_RET_NOTHING;
}