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 

run app under PSP/GAME/UPDATE

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



Joined: 14 Nov 2007
Posts: 34

PostPosted: Sun Feb 03, 2008 8:38 pm    Post subject: run app under PSP/GAME/UPDATE Reply with quote

hey all, me again lol

everytime i use a kernel or user eboot under UPDATE it doesnt work (shows currupt), i know im going wrong somewere, just dunno (im using 1.50 kernel btw)

all im doing is reading from flash0, not flashing or anything. the other things im doing is like putting a eboot on the ms & making directiories on it aswell.

i've searched around, google and http://forums.ps2dev.org/search.php lolol

can anyone help me get this to run under UPDATE please??

Code:

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

#define FILE_SIZE          0000

char file_buffer[FILE_SIZE];

u8 file_md5[16] =
{
   /*md5*/
};

void ErrorExit(int milisecs, char *fmt, ...)
{
   va_list list;
   char msg[256];   

   va_start(list, fmt);
   vsprintf(msg, fmt, list);
   va_end(list);

   printf(msg);

   sceKernelDelayThread(milisecs*1000);
   sceKernelExitGame();
}

void read_file(char *file, u8 *md5, char *buf, int size)
{
   SceUID fd;
   int read;
   u8 digest[16];
   
   fd= sceIoOpen(file, PSP_O_RDONLY, 0777);

   if (fd < 0)
   {
      ErrorExit(4000, "blah blah\n", file);
   }
   
   read = sceIoRead(fd, buf, size);

   if (read != size)
   {
      ErrorExit(4000, "blah blah\n", file);
   }

   if (sceKernelUtilsMd5Digest((u8 *)buf, size, digest) < 0)
   {
      ErrorExit(4000, "blah blah\n");
   }

   if (memcmp(digest, md5, 16) != 0)
   {
      ErrorExit(4000, "blah blah\n", file);
   }
}

/*i know this involves the use of the buffers lol, might be my problem in user??*/
int check_file()
{
   
    read_file("flash0:/blah", filemd5, file_buffer, FILE_SIZE);
   
                 
    return 0;
}

int menu()
{
    pspDebugScreenClear();
   
    printf("blahblah\n");
   
    return 0;
}

int Eboots()
{
   
    sceIoMkdir("ms0:/blah", 0777);
   
            
               SceUID fd = sceIoOpen("ms0:/blah.PBP", PSP_O_WRONLY | PSP_O_CREAT, 0777);
                if(fd < 0)
                {
                      TextColor(RED);
                      ErrorExit(5000, "\n\nCannot open file for writing.\n");
                }
               
                int written = sceIoWrite(fd, EBOOTS, size_EBOOTS);
               
                if(written != size_EBOOTS)
                {
                           sceIoClose(fd);
                           TextColor(RED);
                           ErrorExit(5000, "\n\nCannot write file.\n");
                }
               
                sceIoClose(fd);               
            
              
    return 0;
}

int main()
{
    pspDebugScreenClear();
   
    check_file();
   
    menu();
   
    while (1)
   {
      SceCtrlData pad;

      sceCtrlReadBufferPositive(&pad, 1);
       
      if (pad.Buttons & PSP_CTRL_RTRIGGER)
      {
                        sceKernelExitGame();
      }
       
      else if (pad.Buttons & PSP_CTRL_CROSS)
      {
         break;
      }

      sceKernelDelayThread(10000);
   }
   
   Eboots();

    printf("\n\n\nDone");
   
    sceKernelExitGame(); 
   return 0;
}
 

Back to top
View user's profile Send private message
Mashphealh



Joined: 28 Nov 2007
Posts: 18

PostPosted: Mon Feb 04, 2008 5:06 am    Post subject: Reply with quote

You must put eboot in vsh mode or user mode.

// - Vsh -
PSP_MODULE_INFO("Example", 0x0800, 1, 1);
PSP_MAIN_THREAD_ATTR(PSP_THREAD_ATTR_VSH);

// - User -
PSP_MODULE_INFO("Example", 0, 1, 1);
PSP_MAIN_THREAD_ATTR(PSP_THREAD_ATTR_USER);

Then the param.sfo of the eboot must be the param.sfo that have official sony update.
Extract it and with hex editor search the offset 0x00000840 edit the text x.yz and write a firmware version more big than 3.90. Save the param.sfo and put it on your eboot.
Back to top
View user's profile Send private message
PSPfreak!



Joined: 14 Nov 2007
Posts: 34

PostPosted: Mon Feb 04, 2008 4:50 pm    Post subject: Reply with quote

ok, that makes it show. but when i try and launch it, it doesn't load it gets to a black screen then shuts down in a few seconds. i tried it using user & vsh, then i reduced the code to see if it would work, it still doesnt load

Code:


#include <pspsdk.h>
#include <pspctrl.h>

PSP_MODULE_INFO("Example", 0, 1, 1);
PSP_MAIN_THREAD_ATTR(PSP_THREAD_ATTR_USER);

#define printf pspDebugScreenPrintf

int main()
{   
    printf("blahblah");
   
    while (1)
   {
      SceCtrlData pad;

      sceCtrlReadBufferPositive(&pad, 1);
       
      if (pad.Buttons & PSP_CTRL_RTRIGGER)
      {
                        sceKernelExitGame();
      }
       
      else if (pad.Buttons & PSP_CTRL_CROSS)
      {
         break;
      }

      sceKernelDelayThread(10000);
   }

    printf("blah");
   
    sceKernelExitGame();
   
   return 0;
}
 



i even took sceKernelExitGame(); & sceKernelDelayThread(10000); out and tried again with both user & vsh. still doesn't work...???


Last edited by PSPfreak! on Mon Feb 04, 2008 5:00 pm; edited 2 times in total
Back to top
View user's profile Send private message
moonlight



Joined: 26 Oct 2005
Posts: 567

PostPosted: Mon Feb 04, 2008 4:55 pm    Post subject: Reply with quote

you are missing pspDebugScreenInit...
Back to top
View user's profile Send private message
PSPfreak!



Joined: 14 Nov 2007
Posts: 34

PostPosted: Mon Feb 04, 2008 5:01 pm    Post subject: Reply with quote

moonlight wrote:
you are missing pspDebugScreenInit...


thanks man ill give a try now
Back to top
View user's profile Send private message
PSPfreak!



Joined: 14 Nov 2007
Posts: 34

PostPosted: Mon Feb 04, 2008 5:21 pm    Post subject: Reply with quote

now i get a error saying the game could not be started. (800200D9)

lol starting to get somewere

edit: this is using the full app were it uses the ms, and reads from flash0
Back to top
View user's profile Send private message
PSPfreak!



Joined: 14 Nov 2007
Posts: 34

PostPosted: Mon Feb 04, 2008 5:56 pm    Post subject: Reply with quote

i found out 800200D9 = failed to allocate the memory block
Back to top
View user's profile Send private message
Mashphealh



Joined: 28 Nov 2007
Posts: 18

PostPosted: Tue Feb 05, 2008 2:34 am    Post subject: Reply with quote

You are missing also sceKernelSleepThread(); .
Write it above of return 0 of the main function and try again.
Back to top
View user's profile Send private message
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Tue Feb 05, 2008 5:09 am    Post subject: Reply with quote

Remember that if you compile your app as a 3.xx prx, you NEED to specify the heap size in main.c.

Code:
PSP_HEAP_SIZE_MAX();


or

Code:
PSP_HEAP_SIZE_KB(no_of_kBs);
Back to top
View user's profile Send private message AIM Address
PSPfreak!



Joined: 14 Nov 2007
Posts: 34

PostPosted: Tue Feb 05, 2008 4:45 pm    Post subject: Reply with quote

Mashphealh wrote:
You are missing also sceKernelSleepThread(); .
Write it above of return 0 of the main function and try again.


i just tried that, still ended with 800200D9, then i used the one were it prints just text, i get a error 80020001 (i believe its a kernel error i think though but im not sure)

J.F. wrote:
Remember that if you compile your app as a 3.xx prx, you NEED to specify the heap size in main.c.

Code:
PSP_HEAP_SIZE_MAX();


or

Code:
PSP_HEAP_SIZE_KB(no_of_kBs);


lol im using 1.50, but can you use this on 1.50?? i have naver used it, but by the sounds of it you cant

do you have to compile it to a higher kernel for it to work??(currently compiling as 1.50) on the PARAM.SFO im using the 3.90's, but changed the PSP Update Ver. 3.80 to PSP Update Ver. 3.99, (i didnt change PSP Update Ver, just an example of were i did it)
Back to top
View user's profile Send private message
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Tue Feb 05, 2008 7:25 pm    Post subject: Reply with quote

PSPfreak! wrote:
Mashphealh wrote:
You are missing also sceKernelSleepThread(); .
Write it above of return 0 of the main function and try again.


i just tried that, still ended with 800200D9, then i used the one were it prints just text, i get a error 80020001 (i believe its a kernel error i think though but im not sure)

J.F. wrote:
Remember that if you compile your app as a 3.xx prx, you NEED to specify the heap size in main.c.

Code:
PSP_HEAP_SIZE_MAX();


or

Code:
PSP_HEAP_SIZE_KB(no_of_kBs);


lol im using 1.50, but can you use this on 1.50?? i have naver used it, but by the sounds of it you cant


If you compile it as a prx, you get a tiny heap (I forget exactly how small) unless you specify one or the other, regardless of the firmware. If you don't compile as a prx, it defaults to MAX, but you can use KB to set how much heap space you want. At least, that's how I understand it to work.
Back to top
View user's profile Send private message AIM Address
PSPfreak!



Joined: 14 Nov 2007
Posts: 34

PostPosted: Wed Feb 06, 2008 6:07 pm    Post subject: Reply with quote

so do i try & get a working app that launches from UPDATE, make a prx that writes the files to the ms, then launch the game which loads the prx? all by using fw 1.50, will that work? coz i though 1.50 cant load prx's coz there elf's but i do know that elf's can be launched.
Back to top
View user's profile Send private message
PSPfreak!



Joined: 14 Nov 2007
Posts: 34

PostPosted: Tue Feb 12, 2008 4:13 pm    Post subject: Reply with quote

*BUMP* soz
Back to top
View user's profile Send private message
Viper8896



Joined: 26 Jan 2006
Posts: 110

PostPosted: Tue Feb 12, 2008 5:16 pm    Post subject: Reply with quote

dont bump just search
Back to top
View user's profile Send private message
PSPfreak!



Joined: 14 Nov 2007
Posts: 34

PostPosted: Wed Feb 13, 2008 5:42 pm    Post subject: Reply with quote

Viper8896 wrote:
dont bump just search


pffft, did you not read at the top of this page? or can you not read?
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