[TUTORIAL] Set up vita-sdk for DevkitARM and start compiling Vita homebrew! (w/pictures)

Discussion in 'PS Vita - Hacking & Homebrew' started by Voxel, Feb 13, 2016.

  1. Voxel

    Voxel Clumsy Coder

    GBAtemp Patron
    Voxel is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    Jun 27, 2015
    United Kingdom
    England, UK
    Ever wanted to compile sources which never had an executable released for them? Ever wanted to compile your own Rejuvenate homebrew, but don't know how to set everything up first? Follow this guide, and hopefully you should be all set up to create and compile Vita homebrew in no time. :)

    Before we start though...
    This guide is primarily for Win32/64 users, since I don't have a linux machine or a Mac etc... although using common sense, you could essentially put things where they belong and it all should still work.
    Another thing before we start is that there is a few common misconceptions that you need to use the PSP2SDK. That's outdated now; you usually have to use the more-developed Vita-sdk to this day.
    And last, but not least, make sure you have already installed Devkitpro before attempting this. (which can be found here). Also be aware that this tutorial assumes you've set up Rejuvenate/Rejuvenate for Unity too.

    Things you'll need!
    -Vita-sdk (download the latest nightly)
    - Vita-helloworld (just so we can test whether compilation is working)
    - The latest version of Rejuvenate
    - (optional) Vita portlibs - Please find the attached file of pre-compiled and working portlibs below, as it's a real pickle to set up from scratch.
    - (optional) Vita2dlib (for building/making projects with graphics. I didn't link to it's Github page because I included it in the portlibs attached at the bottom of the tutorial. However, we will need the sample folder from the G.H. page later.)

    The steps:

    1) Download the Vita-sdk if you haven't already.

    2) And extract the contents to a convenient place.

    your extracted folder should look like this:

    3) Assuming you installed DevkitPro to the default location (C:\devkitpro), copy all the contents of the extracted folder to C:\devkitpro\devkitARM.

    The C:\devkitpro\devkitARM directory should look like this afterwards:

    4) Now let's test whether compiling works. Download the vita-helloworld from the above links, if you haven't already. Then extract the contents, yet again to a convenient place. Just to save time, we will just use Command Prompt to compile stuff.

    5) Open up CMD, then type "cd <location-of-vita-helloworld>", where <location-of-vita-helloworld> is the location of the vita-helloworld folder.

    Example image:

    Now press enter. CMD should now redirect all commands to this folder. :)

    6) Now type "make" (without quotation marks) and it should compile the example, hopefully. (It spits out an .elf file and a .velf file.)


    7) Be sure to always use the .velf file! Copy the .velf to your pre-set-up Rejuvenate folder.

    8) Now drag and drop the copied .velf file into either "run_homebrew.bat" or "run_homebrew_unity.bat" (It depends on what Dev Assistant you set it up for).
    And then run VitaDefilerClient on your Vita, making sure that the wifi is on.

    9) If you get a NOT_SUSPENDED error with "run_homebrew_unity.bat", just try step 8 again, and make sure you run the batch file before you open VitaDefiler on your Vita.

    10) If all successful, the Vita should now run the compiled code! :D
    (This screenshot was taken directly on the Vita)

    Optional - Set up Vita2dlib and portlibs for PNG/JPEG/BMP graphics compilation

    1) Download the portlibs attachment at the bottom of the tutorial and, once again, extract it to a convenient place.

    2) There should be two folders: an "include" folder, and a "lib" folder. Copy both folders to C:\devkitpro\devkitARM\arm-vita-eabi.

    3) Download vita2dlib from github. We only need the sample folder from it, but if you ever need to update to the latest vita2dlib anyway, just run "make install" in the libvita2d source folder.

    4) With the portlibs and libvita2d all set up, go ahead and run "make" in the sample folder using CMD again. It should spit out an elf and a velf again. ;)

    5) Proceed from step 7 in the last section, this time using this velf instead.

    6) When ran on the Vita, it should display a rotating rejuvenate logo:

    7) Congrats, you've completed the tutorial! You should now be ready to make your own Rejuvenate homebrew! :D

    Note: As you should already know, the Rejuvenate hack only works for 3.51 and under. No 3.52 and above support!
    Please feel free to ask any questions about this tutorial, or tell me whether something went wrong; I should be able to answer\rectify the questions\problems in great detail, hopefully.

    Attached Files:

    Last edited by Voxel, Feb 13, 2016
    LaGaipaG and Garou like this.