Contributing to Adrenaline
Contribution to the project is always welcome. The process is straight-forward:
- Create a fork of the project on GitHub
- Commit your changes (remember to do good commit messages)
- Send a Pull Request (PR) to the project
This is the gist of it, but you will need to be able to compile the project to test before sending a PR.
Project parts overview
Adrenaline Application (a.k.a. VITA-side)
bubble: The bubble launcher for Adrenalineuser: The userspace plugin that patches the PSPemu and allows extra communication between the VITA-side with the PSP-sidekernel: The kernel plugin that do the necessary patches to fix the double launch bugusbdevice: The USB mass storage pluginvsh: The plugin that patches VITA VSH for Adrenaline
Epinephrine eCFW (a.k.a. ePSP-side)
The Epinephrine eCFW part can be separated in two parts: The core parts and the extra parts.
The core parts are essential to support the most basic functionality of a CFW. The extra parts are not necessary for the CFW, but might provide quality of life features for end-users.
Core parts:
cef/systemctrl: The heart of the eCFW, therefore it’s nameSystemControl. It provide patches for unsigned code execution, handles anti-CFW protection in games, and provides extra libraries API that serves the rest of the eCFW module and third-party plugins.cef/pentazemin: ThePentazeminmodule patches the necessary system modules and old homebrew modules to make the vPSP environment to work. It also works as a compatibility layer for other PSP CFW to run on Adrenaline more easily (like ARK).cef/vshctrl: TheVshControlmodule handles the main patches for theXMB/VSHto allow launching unsigned applications from the XMB. It also provides extra API for plugins meant to be run onXMB/VSHcontexts.cef/galaxy: TheGalaxyControllermodule provide patches to use ISO and Compressed ISO with the Sony’s NP9660 driver.cef/inferno: TheInfernoDrivermodule is the custom driver that allows executing ISO and Compressed ISO.cef/march33: TheMarch33Drivermodule is the custom driver that allows executing ISO and Compressed ISO.cef/popcorn: ThePopcornManagermodule allows the PS1 emulator (POPS) to launch custom PS1 images.cef/recovery: TheRecovery Menumodule. It provides the Recovery Menu, that can be used to configure the eCFW, or reset it in case of bad configuration/plugins making the system not boot-up correctly.cef/kermit_idstorage: A custom implementation ofsceIdStorage_driverthat enables the vPSP environment to work properly.cef/payloadexandcef/rebootex: Handles the actual injection of the CFW in the (re)boot process.Payloadexis used byuserto launch Adrenaline CFW, whileRebootexis set to relaunch it during a ePSP reboot.
Extra Parts:
cef/satelite: Provides theVSH Menuto the eCFW, allowing to quick access the most basic configurations in any place of the XMB.cef/xmbctrl: TheXMB Controlmodule provides access to CFW configuration and plugin management directly from the XMBSettingssection.
Setting up the development environment
To be able to build the project, you will need to setup the necessary development environment parts. Adrenaline depends on four thing: VITASDK, PSPSDK, PSP CFW SDK, Python3 and psp-packer.
For the VITASDK and PSPSDK, follow their instructions to install it in your system.
For the PSP CFW SDK, prefer to install from source, as CFW development and updates to the CFW SDK move hand-in-hand.
Python3 installation will depend on your system and setup. Google is your friend on this one.
For psp-packer, either install via cargo or install from source.
Once everything is installed, you can build the project.
Building the project
First, you need to compile the eCFW (ePSP-side) code:
make -C cef -j1
Then, you have to build the VITA-side part:
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build
For every change, you must recompile the project for the changes to take effect. This may be obvious for many programmers, but absolute novice in compiled languages may not understand this right away.
grayjack comment
I do not recommend to start in a project as complex as this one. Going through the complexity ladder with small steps is statistically a better way to learn.
That being said, over 10 years ago, I started with baremetal software on the 3DS. I had many frustrations as a novice, but I end up just fine. So if you absolutely want to start with Adrenaline, who am I to stop you.
tip
If you did not change a thing on the cef directory, you don’t need to recompile the Epinephrine eCFW.
Manually testing the project
After building the project, you have to install it. For that you can follow the manual update instructions.
You need to reboot the system if there was any modifications on the vsh or kernel code.
Test things your code change affect.
Logs
On the ePSP-side, you can pass next the definition to the make call that enables logging on the subprojects that form the Adrenaline ePSP CFW. The ones available are:
GALAXY_DEBUG: Enables logs only on thecef/galaxymoduleINFERNO_DEBUG: Enables logs only on thecef/infernomoduleMARCH33_DEBUG: Enables logs only on thecef/march33moduleKERMIT_IDSTORAGE_DEBUG: Enables logs only on thecef/kermit_idstoragemoduleRECOVERY_DEBUG: Enables logs only on thecef/newrecoverymodulePOPCORN_DEBUG: Enables logs only on thecef/popcornmoduleSATELITE_DEBUG: Enables logs only on thecef/satelitemoduleSCTRL_DEBUG: Enables logs only on thecef/systemctrlmoduleVSHCTRL_DEBUG: Enables logs only on thecef/vshctrlmoduleXMBCTRL_DEBUG: Enables logs only on thecef/xmbctrlmoduleDEBUG: Enables logs to all subprojects with the same level
It is recommended to use the specific ones. Another recommendation is to avoid using more than level 2 unless really necessary, as the excessive logging message can make the vPSP system very slow.
example
make -C cef -j1 SCTRL_DEBUG=2 VSHCTRL_DEBUG=1
On the VITA-side, we don’t have something super well stablished, you can use sceClibPrintf function, and the messages will show up in the tty, that you can access through log homebrews (we recommend catlog).
Accessing the logs
You can access in real-time and in your computer all logs by using logs homebrew such as catlog. This is the easiest way to access them.
For the eCFW modules, you can later access them by looking into log files at the ???0:/pspemu/ directory. They are all named using the following pattern: log_⟨MODULE_NAME⟩.txt.