This commit integrates the pregenerated payload into mystery_gift_injector.
It currently hardcodes the English Ruby v1.2 payload for testing purposes though.
The next test I'll have to do is to see if the transfer process works with this specific rom.
If it works, I can start integrating Pi's work in regards to delta patching using BPS.
Memory manufacturers and AAA game studios hate her!
With some clever rearranging, PTGB now uses only 36 KiB of the 64 KiB
BG VRAM. This means the remaining 28 KiB is free to use in the future.
Caveats: The flex tileset must not use more that 6 KiB. There is a check
for it added.
VRAM Map
06000000 - 06000800 ( 2K): Eternal backdrop and textbox tileset
06000800 - 06002000 ( 6K): Flex BG tileset
06002000 - 06002400 ( 2K): BG0: Backdrop tilemap
06002800 - 06003000 ( 2K): BG1: Flex BG tilemap
06003000 - 06003800 ( 2K): BG2: Textbox tilemap
06003800 - 06004000 ( 2K): BG3: Text tilemap
06004000 -~06009000 (20K): Text rendering bitmap
06009000 - 06010000 (28K): Free work RAM
06010000 - 06018000 (32K): Sprite tileset
Additionally:
- Explicitly clear VRAM on boot
- Dirty workaround to fix box drawing buffer overflow.
- Flex backgrounds use a table instead of a huge switch statement
- Textbox tile IDs are now const u16[] instead of int[]
text_data_table was very similar in concept to FileContainerReader.
But FileContainerReader is generally more flexible, as it allows you to split up your table into several chunks.
This takes away the worry of these files getting too big to compress.
However, we now have a maintenance duty for the text_tables file, which maps a table index to the list of chunks.
We also need to be careful about every use of FileContainerReader::getPointerToFileInDecompressionBuffer().
Using it is fine when you're dealing with a single chunk or if you're sure the file doesn't span multiple chunks.
But the moment you seek to a different chunk, any pointer obtained from getPointerToFileInDecompressionBuffer()
becomes stale as the decompression buffer gets overwritten.
Still, this function is necessary for high memory pressure situations, such as mystery_gift_builder, because we can't maintain
multiple lineBuffers there.
This allows us to log to mgba's logging window.
It will be very useful to debug issues.
But we only allow enabling this for debug builds for license reasons.
This adds a lot of the debug_mode.h options as an option you can modify at runtime.
I also moved both the text debug screen and the regular debug info screen in there.
And I added an option to start song playback.
This commit integrates the MaxMod sound engine into PTGB.
Some test code already existed, but now it's done for real.
I added a thin API wrapper in sound.c/sound.h to abstract the sound engine.
One of AquaticAlloy's test songs was added to the main menu as a proof of concept.
We may want to disable it before the actual merge though.