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>
This commit is contained in:
easyaspi314
2025-01-17 19:32:48 -05:00
parent a805bbad0a
commit e4ef25e20e
52 changed files with 185 additions and 202 deletions

View File

@@ -225,6 +225,7 @@ void sprite_var::set_start()
void sprite_var::insert_sprite_data(u8 mg_array[], const unsigned int sprite_array[], unsigned int size, const unsigned short palette_array[])
{
set_start();
u32 pointer = curr_rom.loc_gSaveDataBuffer + *curr_loc_ptr + 8;
for (int i = 0; i < 4; i++)
@@ -237,11 +238,10 @@ void sprite_var::insert_sprite_data(u8 mg_array[], const unsigned int sprite_arr
mg_array[*curr_loc_ptr] = size >> (8 * i);
(*curr_loc_ptr)++;
}
for (unsigned int parser = 0; parser < size; parser++)
{
mg_array[*curr_loc_ptr] = sprite_array[parser / 4] >> (8 * (parser % 4));
(*curr_loc_ptr)++;
}
LZ77UnCompWram(sprite_array, &mg_array[*curr_loc_ptr]);
*curr_loc_ptr += size;
for (unsigned int parser = 0; parser < 32; parser++)
{
mg_array[*curr_loc_ptr] = palette_array[parser / 2] >> (8 * (parser % 2));