`MEMSIZE` would not be set as expected if `PSP_FW_VERSION` was set to `1` above firmware 3.90 and the warning was sent to the console. This is addressed.
I've also made the `MEMSIZE` field a make var (`EXPAND_MEMORY`) that gets set on/off in the tree and just gets used by `SFO` flags at the end of it, instead of setting them in multiple spaces.
The current state of building .SFO binaries is rather primitive --
as it stood, build.mak forced its own flags to be used, always.
If you were building without PSP_LARGE_MEMORY, build.mak would use
a deprecated tool for generation as well, one that cobbles together
undocumented flags in an array of bytes and shoves it into a file.
The first change this commit makes is by enabling use of the "new"
mkfsoex, which creates a smaller but still bootable SFO without
any arguments given. Developers are now able to provide custom
SFO flags now using this, added via `SFOFLAGS` in their Makefile.
This means that developers can now (at their own discretion) provide
custom region information, parental control level, minimum firmware
boot level, etc. with:
```make
SFOFLAGS = -d REGION=16394 -d PARENTAL_LEVEL=4 -s PSP_SYSTEM_VER=4.01
```
As a side-effect, this also makes the SDK more adapted to new
custom firmware releases that may add new SFO flags.
The second change made is turning `PSP_LARGE_MEMORY` into an opt-out
/enabled by default flag if developers are targeting a firmware
version newer than 3.90. Custom firmware versions starting from
4.01 M33 guard against expanding the user memory partition to 52mB
if the unit detected is PSP-1000. Therefore having this check in
place becomes redundant, potentially complicating Makefiles. A
warning is printed out allowing developers to be aware of this fact
and removing the flag from their Makefile.
Updated fourth argument of decompression routines.
When not NULL, the routines will store a pointer to the next unprocessed compressed byte (src + n_compressed_bytes_processed).
This can be useful to implement stream-based decompression, calculating number of processed compressed bytes, etc.