This repo contains source code for a PSP module that patches what percentage of battery should the console shut down with.
I got one of those bad clone batteries that not only have a bad cell inside them
but also measure the remaining battery life inaccurately. One way I was able to
address this is by creating stealing this module that changes when the PSP
would shut down or consider the battery needing a charge.
Well basically it patches a system function using some CFW dark magic.
main.c
shows how the functions got patchedrethook.h
contains the function prototypes of the functions being patched; andrethook.S
contain the patched function machine code (MIPS assembly)
For our uses only fx_rethookIsLowBattery
is used (although this isn't the
actual functions name). In it, we have a single instruction as follows:
addiu $v0, $zero, 50
where 50 is the percentage value that we want.
- Modify the
rethook.S
function with the value that you want. - Install the psp toolchain
- Install this library using said toolchain
- Run these two before compiling tho:
find . -type f -not -path . -exec sed -i 's/-mno-crt0 //g' {} +
find . -type f -not -path . -exec sed -i 's/python/python2/g' {} +
- These should fix compilation issues that I've encountered
- To install the above library you need two more steps:
sudo cp -rf include/* /usr/psp/include/
sudo cp -rf libs/* /usr/psp/libs/
- Run make in this repo
- Copy the resulting .prx file onto your MemoryStick(TM)
- Update your
seplugins/vsh.txt
accordingly
Or if you can't be bothered to set up YET ANOTHER TOOLCHAIN, you can just always:
- Download the release from this repo
- Get the PRX file for your desired percentage
- Put it somewhere on your MemoryStick (TM)(C)(Patented)(Sony)
- Update
vsh.txt
accordingly
I used the library uofwinst which is GPL-3 and automatically makes this GPL-3 as well. As well as the fact that I've stolen 99% of the code from this