Random Homebrew: Catch
Catch is a game where you are a glove and try to catch baseballs. The game contains an unlimited num [...]
Friends: Coding 'n Cracking - Nymphaea - PS3 Forum - darkforestgroup - daxhordes.org - Tgames - coldbird - gopsp.it - pspstation.org - prometheus - hgoel.info - MakeSmartTV - ps vita

Writing a menu for VHBL

VHBL (Vita Half Byte Loader) is an open source tool to load PSP homebrews on the Playstation Vita.
VHBL can be downloaded at http://wololo.net/wagic/vhbl

Re: Writing a menu for VHBL

Postby Acid_Snake » Tue May 29, 2012 5:02 pm

nice, it's becoming clearer for me each time. one more question: where is ebootPath imported from? or is declared in the go?
edit: what is the counterpart of dlls for psp?
"V2h5IGFyZSB5b3UgcmVhZGluZyBteSBzaWduYXR1cmU/\n".decode("base64")
My forum:
Console Heaven
My Homebrews:
pyMenu 0.3.2, multiBootMenu V3, PSvid 3.0, PSP Tools 0.2
User avatar
Acid_Snake
Moderator
 
Posts: 2048
Joined: Tue May 01, 2012 11:32 am
Location: Behind you!

Re: Writing a menu for VHBL

Postby wololo » Tue May 29, 2012 10:26 pm

Ebootpath is a pointer to one of the elements in the api struct. Check the sample code at the first post:
ebootPath = (void *) settings->filename;

It is the same on the vita and the psp.
I have a few US PSN codes to sell for a reasonable price (cheaper than pcgamesupply). PM me if interested, 1st come 1st serve basis..

Looking for guest bloggers and news hunters here at wololo.net, PM me!
wololo
Site Admin
 
Posts: 4641
Joined: Wed Oct 15, 2008 12:42 am
Location: Japan

Re: Writing a menu for VHBL

Postby m0skit0 » Wed May 30, 2012 6:15 am

Acid_Snake wrote:edit: what is the counterpart of dlls for psp?

DLLs are only and exclusively for Windows, and they're far from being standard. They are dynamically loaded libraries. The equivalent on PSP are PRXs, but PRXs can also be executables. PSP, like most *IX systems, uses ELF format (which kind of standard for every OS except Windows) for both executables and libraries.
I wanna lots of mov al,0xb
Image
"just not into this RA stuffz"
User avatar
m0skit0
Guru
 
Posts: 4784
Joined: Mon Sep 27, 2010 6:01 pm

Re: Writing a menu for VHBL

Postby wth » Thu May 31, 2012 9:59 pm

wololo wrote:The command we write is usually the path to an eboot (to run a homebrew), but can also be the string "quit" if we want to ask HBL to qui back to the XMB:

To quit:
Code: Select all
strcpy(ebootPath, "quit");
sceKernelExitGame();

The problem is about all HBL binaries really do attempt a call to sceKernelExitGame() when quitting, and this produces a nasty error on PSVita, which then gets logged on the system's error historic ..
So we shouldn't ever tell HBL to quit on a vita menu imho
wth
HBL Developer
 
Posts: 587
Joined: Wed Aug 31, 2011 4:44 pm

Re: Writing a menu for VHBL

Postby wololo » Thu May 31, 2012 10:13 pm

The one from the menu is hooked by hbl, it never gets to the system, except when people actually want to quit the menu itself.
I have a few US PSN codes to sell for a reasonable price (cheaper than pcgamesupply). PM me if interested, 1st come 1st serve basis..

Looking for guest bloggers and news hunters here at wololo.net, PM me!
wololo
Site Admin
 
Posts: 4641
Joined: Wed Oct 15, 2008 12:42 am
Location: Japan

Re: Writing a menu for VHBL

Postby wth » Fri Jun 01, 2012 4:44 am

wololo wrote:The one from the menu is hooked by hbl, it never gets to the system, except when people actually want to quit the menu itself.

I know I don't speak about the call in the menu itself, but about the "quit" string
Code: Select all
strcpy(ebootPath, "quit");

Code: Select all
    //...otherwise launch the menu
    while (!exit)
    {
        int initial_free_ram = sceKernelTotalFreeMemSize();
        //Load default config
        loadGlobalConfig();
        //run menu
        run_menu();
        wait_for_eboot_end();
        cleanup(num_lib);
        ramcheck(initial_free_ram);
        if (strcmp("quit", g->hb_filename) == 0 || g->exit_callback_called){
            exit = 1;
            continue;
        }
       
        initial_free_ram = sceKernelTotalFreeMemSize();
        char filename[512];
        strcpy(filename, g->hb_filename);
        LOGSTR1("Eboot is: %s\n", (u32)filename);
        //re-Load default config
        loadGlobalConfig();
        LOGSTR0("Config Loaded OK\n");
        LOGSTR1("Eboot is: %s\n", (u32)filename);
        //run homebrew
        run_eboot(filename, 1);
        LOGSTR0("Eboot Started OK\n");
        wait_for_eboot_end();
        cleanup(num_lib);
        ramcheck(initial_free_ram);
        if (g->exit_callback_called)
         exit = 1;     
    }
   
   sceKernelExitGame();
   
   return 0;
}


I mean this sceKernelExitGame inside hbl produces a nasty error on PSVita, which then gets logged on the system's error historic ..
So we shouldn't ever tell HBL to quit with the "quit" string on a vita menu imho (like the triangle button on wmenu)
wth
HBL Developer
 
Posts: 587
Joined: Wed Aug 31, 2011 4:44 pm

Re: Writing a menu for VHBL

Postby wololo » Fri Jun 01, 2012 4:54 am

Well, we are not going to rewrite every single homebrew anyway, it's ot only about the menus. It would be much better to hook the cal inside HBL with a void function, in that case. Or a function that displays an "error" of some sort.
I have a few US PSN codes to sell for a reasonable price (cheaper than pcgamesupply). PM me if interested, 1st come 1st serve basis..

Looking for guest bloggers and news hunters here at wololo.net, PM me!
wololo
Site Admin
 
Posts: 4641
Joined: Wed Oct 15, 2008 12:42 am
Location: Japan

Re: Writing a menu for VHBL

Postby wth » Sat Jun 02, 2012 7:38 pm

wth wrote:I also just found this http://forums.ps2dev.org/viewtopic.php? ... eae4389fee : AnonymousTipster's zip/rar unpacker's source code :)
[...]
Also about unzipToDir,
it changes the current working directory to the output folder you mention, so it could be good to change current directory back to normal after it if you're using relative paths

Update :
Just fixed unzipToDir to stop using chdir which changed the current working path, and also compiled this unzip/unrar lib statically to make it easier

Here's the lib's static binary + header & src (sample included) : http://www.mediafire.com/?987ejimjiswz453


Nb : For it to extract homebrews correctly on PSVita, you still have to make the lib replace all EBOOT.PBP names with wmenu.bin ones, since we can't create EBOOT.PBP files on PSVita
I personally already have done that, but I'll let you guys modify the src accordingly and recompile it, really easy
wth
HBL Developer
 
Posts: 587
Joined: Wed Aug 31, 2011 4:44 pm

Previous

Return to Vita Half Byte Loader

Who is online

Users browsing this forum: FEGuy, sharkie545 and 1 guest

cron