Inferno Driver
The Epinephrine version of the Inferno 2 driver is an adaptation from the ARK version of the driver. The ARK version is an evolution of the Inferno Driver found, among others, in the PRO CFW, for which ARK itself is an evolution of.
Evolution of the driver
Several different versions of the Inferno driver were created for different purposes. So let’s look at all of them and try to add a versioning system to them, so we can have an idea of the evolution of this driver. We will start with PRO-C, which we will call Inferno 1.
Inferno 1: The originalInfernodriver as seen in PRO-C. It includes theblock offset cachespeedup hack that greatly improved speed withCSOformat in comparison to traditional drivers such asMarch33 Driver. It also included an overall cache that could use the extra RAM on PSP slims to improve speed, this is known asInferno Cache, though it had conflicts with theForce Extra RAMpatch.Inferno 1V: The originalInfernodriver port forPROVITA, used up to ARK-3. It was a stripped-down version of the one in PRO-C, minus theInferno Cachesince the Vita lacked the PSP Slim’s extra RAM.Inferno 1S: An experimentalInferno 1Vfork that added support for Splitted ISO files (SSO), it was meant to improve the experience of transferring ISO files viaFTP, it was scrapped and never used but source code can still be found in the original ARK-1 repository under the nameinferno.new.Inferno 1D: A port ofInferno 1to the ME CFW with added support for theDAXfile format. It uses two separate algorithms to handleCSOandDAX.Inferno 1.5: Available in PRO-C2, 1.5 is one of the greatest updates to a PSP ISO Driver ever made in regards to Compressed ISO reading speed. Thanks to the research of developerCodestation, we were able to figure out a new speedup hack that proved to be the biggest one yet. It uses the fact that whenever a game requests data, the compressed data is always going to be smaller than the requested data, thus the buffer given by the game can be used to read all the compressed data at once and process each block in place, thus hugely reducing the amount of IO calls to satisfy the data request (which for an ISO is only one IO call), to put it in technical forms, the algorithm went from having a linear O(n) complexity (where n = amount of IO calls) to having the same constant O(1) complexity as an ISO. During this research, Codestation also developed a lightweight version ofCSOcalledZSO, which is structurally identical to aCSOfile but data is compressed using theLZ4instead of the standardDEFLATEalgorithm, which offers the fastest decompression speed available, while being identical toCSOin its structure allowed the same algorithm to be used for both formats.Inferno 1.5V: A stripped-down version of the newly updatedInferno 1.5ported over to Adrenaline. It gets rid ofInferno Cacheas it was considered unnecessary on PS Vita, and also removes support forZSOformat, while maintaining the speedup hacks forCSO. This was the version that Adrenaline used up to version7.1.7.
Now that we’ve covered the evolution of the Inferno Driver over the years, we can focus on all the changes made to it in ARK-4 that justify it being called Inferno 2.
Dynamic Patching: all static offset patching done to the isofs library has been replaced with dynamic patching algorithms. This makesInfernocapable of working on a wide variety of configurations, including the original PSP, unmodified PS Vita Emulator, Adrenaline-patched PS Vita Emulator, and PSP Toolkits such as testkits and devkits.Emulation of Empty UMD Drive: On older versions of Inferno, as well as other UMDemu ISO Drivers, it was never intended for the driver to run without an ISO file to be mounted, thus several bugs existed that caused malfunction when the driver was used without an ISO file specified, this prevented emulation of an empty UMD drive, which was needed on PS Vita to run certain homebrew that checked for a UMD. The main bug was in the implementation of the functionsceUmdCheckMedium, a boolean function used to check if a UMD is inserted in the drive. On the ISO driver, this function was hardcoded to always return true, except if an ISO driver is not specified, then it was hardcoded to wait in an infinite loop until one is (which never happens). The solution used by eCFW, such as ARK (up to ARK-3) and TN-CEF (including Adrenaline), was to include a small dummy fake.cso file to mount when no ISO file is specified. On the newInferno 2driver, among other things, this function has been corrected to behave exactly like the original, simply returning False if no ISO has been specified, thus allowing the ISO driver to simulate an empty UMD drive by loading it without an ISO file specified.Completely revamped Compressed ISO Reader: TheCSOdriver available with the original Inferno was heavily hardcoded to work only withCSOand only with the PSP. The entire reader was completely rewritten from scratch with much less and lighter code, much more portability (it has been ported to PC, PS2/OPL, and Wii/Nintendont), as well as a much more generic and configurable structure, allowing for easily adding support for other formats without changing the core reader.Improved Compressed ISO Read Speeds: Not only is the algorithm written with efficiency in mind, it also implements a more aggressive form of the speedup hacks seen onInferno 1.5.Support for other compressed formats: The new reader was also made to be easily configurable and expandable to support other formats, having been given support for not onlyCSOandZSOas seen onInferno 1.5, but also adds support forDAXas seen on ME’s Inferno update as well as early SE/OE CFW, as well as the rarely seen beforeJSOandCSOv2formats. The driver also supports different block sizes, with 2K and 8K being more common (the higher the block size, the better the compression, but also the more memory used by the driver and thus less available for plugins). All formats benefit equally from the speedup hacks, meaning that performance is mainly left to the decompression algorithm they use.Improved Inferno Cache compatibility: Issues between Inferno Cache and Force Extra RAM have been resolved, including being able to use it with PRO Online, as well as allowing the use of Inferno Cache on PS Vita and PSP 1K.Physical UMD seek and read time simulation: Configurable option to simulate the seek time and read time of reading a physical UMD to bypass the anti-CFW checks of some games, or fix games with synchronization issues due to faster read times.