Skip to content

Instantly share code, notes, and snippets.

@xyzz
Last active May 15, 2023 01:47
Show Gist options
  • Star 16 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save xyzz/cb6ad5fd3ce14e6c71cf77a9d810ce4f to your computer and use it in GitHub Desktop.
Save xyzz/cb6ad5fd3ce14e6c71cf77a9d810ce4f to your computer and use it in GitHub Desktop.

how2homebrew

Toolchain setup

Build process

Check out these samples for how to work with Makefiles and the build process: https://github.com/vitasdk/samples

tl;dr:

  • Compile your .c/.cpp files to .o with arm-vita-eabi-gcc -c -o file.obj file.c
  • Link your .o files into an .elf file, using -Wl,-q option: arm-vita-eabi-gcc -Wl,-q -o homebrew.elf file1.o file2.o file3.o
  • Make a .velf file out of the .elf file: vita-elf-create homebrew.elf homebrew.velf
  • Make a eboot.bin file out of the .velf file: vita-make-fself homebrew.velf eboot.bin

Making a .vpk

Homebrew installer uses a .vpk format which is just a ZIP file, start from this template: https://github.com/xyzz/Vita_Doom/releases/download/1.0/vitadoom.vpk (try installing it from the shell)

  • replace eboot.bin with your eboot.bin
  • you can also add template.xml and stuff like icon/background/etc that will be displayed in livearea, check out how it's done in molecular shell (launch it and go to app0)
  • make sure to run pngquant on all your png images https://pngquant.org/
  • to make param.sfo, use vita-mksfoex -s TITLE_ID=XXXX00001 "homebrew name" output/param.sfo

When developing homebrew instead of rebuilding the vpk and reinstalling it on every change, you can upload your new eboot.bin to ux0:app/TITLE_ID/eboot.bin over ftp

NB: all files you place to .vpk will be available as read-only inside app0:. For example, you can add vpk/something.txt and later in your app read app0:something.txt. In the same way, you can read app0:sce_sys/param.sfo and app0:eboot.bin.

Working with core dumps

When your homebrew crashes (normally, with error C2-12828-1), a core dump will be generated and saved to ux0:data. You can transfer this core dump to PC, gunzip it, and then analyze it with https://github.com/xyzz/vita-parse-core

Question/Problem?

If you're having any issues with the toolchain or your homebrew, feel free to join #vitasdk on Freenode, where the VitaSDK discussion happens. You can join this channel by using any IRC client, or via a web client: http://webchat.freenode.net/?channels=vitasdk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment