Commit Graph

19 Commits

Author SHA1 Message Date
GearsProgress
dc75638d99 Merge branch 'text-debug-screen' into latest-release 2026-02-23 23:23:53 -05:00
easyaspi314
4cbc128c16 Improve movement data storage
Instead of each macro being a ternary (which can't be constant folded),
the values are now stored sequentially.

Additionally, I use byte instead of int and made the tables static

-1300 bytes.
2026-02-18 16:28:18 -05:00
The Gears of Progress
5447b39569 Updating dex menu and selections 2026-01-29 22:42:06 -05:00
The Gears of Progress
ba1a075701 Adding PCCS 2025-10-12 15:08:33 -04:00
Philippe Symons
26fd1e2dd3 Add compression for the text data, output stack usage .su files and rework script_array
Add a binary table format and convert the text entries into this format in text_helper/main.py. It then gets compressed with zx0.

The new text_data_table and streamed_data_table classes exist to read the various entries from this binary table. streamed_data_table specifically
exists to use a decompression buffer that is smaller than the actual binary table. But it requires a decompression buffer that is
still larger than ZX0_DEFAULT_WINDOW_SIZE (default: 2048 bytes) and will only be able to decompress in
chunks of (<decompression_buffer_size> - <ZX0_DEFAULT_WINDOW_SIZE>) bytes

Try to keep the binary text tables sufficiently small though, because since zx0 doesn't actually support random access,
getting to the last entry is significantly more expensive than reading the first one. And unless you use streamed_data_table,
it also requires <uncompressed_size> bytes of stack space, therefore IWRAM to decompress them.

I also had to rework script_array because it can no longer reference the strings directly. Instead we now reference the DIA_* "enum" values.
We also no longer store an array of script_obj instances, because these were getting stored in IWRAM since they're non-const global variables
originally. Instead we now have const arrays of script_obj_params structs, which should end up in .rodata -> therefore EWRAM.

Right now, script_obj only supports the PTGB text table (originally the dialogue array). But if the need arises to support other tables as well,
I'd consider adding a separate enum to script_obj_params to indicate the specific table.

The compilation process will also output .su files in the build folder from now on. These files indicate the stack frame size for every function in
every compilation unit, so be sure to check them from time to time. Note that they will only show the stack consumption for that specific function.
So to get the worst case stack consumption, you need to manually add all the functions in a certain stack flow.
2025-05-21 12:21:06 +02:00
Philippe Symons
532a095d77 Implement zx0 compression
Compress data tables with the ZX0 compression algorithm
2025-04-24 21:14:48 +02:00
Philippe Symons
9268cbd42e Reduce binary size by eliminating libstdc++
This commit removes all references to things in the libstdc++ library to remove a decent chunk of bloat.

This means every std::to_string() call, std::string and std::vector. (as well as iostream related stuff).

I replaced those with my own versions ptgb::to_string() and ptgb::vector. Especially the latter is not exactly the same,
but close enough.

I also replaced operator new and delete with my own implementation to avoid pulling in everything related to exceptions
from libstdc++

Another problem was the fact that libtonc uses siscanf, which pulls in everything related to the scanf family of functions
and locale support. The worst part of that was that it included a 13KB "categories" symbol from libc_a-categories.o,
which was pulled in because of the locale support integrated into newlibc's siscanf() function. To fix that, I created a
custom, extremely restricted implementation of siscanf. libtonc only used this function to parse at most 2 integers from a
string anyway.
2025-04-09 20:04:08 +02:00
The Gears of Progress
1ee46e1719 Resolving build warnings 2025-03-30 11:56:32 -04:00
The Gears of Progress
8160bcd276 updating box menu, pre sprite grabbing 2025-03-22 15:57:22 -04:00
easyaspi314
e4ef25e20e Compress the graphics (mostly), fix potential vram memcpy issue
This greatly decreases the ROM size, from 245 KB to 198 KB with no visual
changes (that I am aware of)

Changes:
- Enable compression on every graphic but the Pokemon sprites (which are
  too large for the GBA to decompress).
- Change grit from emitting .s files to .c files so GCC can strip unused
  palettes and maps
- Fix the empty tiles
- Trim down the font to skip 00-1F and 80-FF which were all zeroes
  - needs a slight workaround because the Pokemon name display was printing
    an invisible FF byte
- Switch memcpy to tonccpy which is vram safe
- Limit palette sizes.

Signed-off-by: easyaspi314 <6258309+easyaspi314@users.noreply.github.com>
2025-01-17 19:32:48 -05:00
The Gears of Progress
73fd2342e9 Last push before release (probably not actually though lol) 2024-08-20 23:31:07 -04:00
The Gears of Progress
1ec09842ad Updating tons of graphics 2024-08-19 14:47:29 -04:00
The Gears of Progress
8f07b1ebdb Re-enabling the old event 2024-07-01 16:45:54 -04:00
The Gears of Progress
f7cc4b5667 Finalizing the mystery events, sans sprites/music 2024-06-28 11:08:47 -04:00
The Gears of Progress
444878de04 Finalizing new event 2024-06-26 13:38:34 -04:00
The Gears of Progress
7181407915 Implementing custom fanfare 2024-06-25 13:20:59 -04:00
The Gears of Progress
5950e53e88 Continuing work on updated event 2024-06-22 11:24:43 -04:00
Remnants of Forgotten Disney
53e7748d48 Organizing files 2024-03-19 13:52:23 -05:00
Remnants of Forgotten Disney
257fe54a76 Finalizing ASM variable rewrite 2024-03-01 19:52:46 -06:00