This commit allows you to use the Write Cbl Data debug option and new Load Cbl Data debug option to dump a link's data to SRAM
or load it from SRAM and pretend like you got it over the link cable.
This is useful for capturing the link process on gameboy and replay + debug it later in an emulator.
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.
We need to erase the sector before copying the data.
I also fixed an endianness problem in initialize_memory_locations(). This one was not caused by me.
va args passing was broken in my initial implementation, causing garbage values to get printed whenever you try
to print an actual argument.
Moreover, I also had a bug in the PTGB_MGBA_XYZ macros.
Sorry, I should've tested it with actual arguments.
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.