Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Firmware cleanup #778

Merged
merged 26 commits into from
Sep 13, 2022
Merged

Firmware cleanup #778

merged 26 commits into from
Sep 13, 2022

Conversation

Daft-Freak
Copy link
Collaborator

Some code deleting I did a couple of months ago.

  • removes code for loading pre-pic games (untested for ages as nothing that old would still run)
  • removes remaining parts of the "firmware in ext flash" code
  • replaces/cleans up some HAL GPIO code
  • tidies up stm32 screen mode handling a little
  • removes HAL layers between fatfs and the SD code

This code hasn't been tested for a long time as the SDK hasn't supported
creating an executable including the HAL since
e2df144. Also, The HAL build for
external flash was removed entirely in
8470dd8.

Both changes were included in v0.0.8 (November 2020). It's probably safe
to delete by now.

(Also, the CDC flash code has only allowed relocatable games since
v0.1.0)

Reduces firmware size by ~1.5k
Only set to internal flash base since 8470dd8
... and use it to remove some magic 0x90000000s
Can't use the new header here (this is C code), but can definitly do better than something that expands to inline assembly
All .blit files should have relocs and the CDC flashing already rejects files that don't
... and shuffle some bits around
A bit nicer than the non-inline HAL ones
Doesn't reduce code size due to LTO being enabled (does have an effect with LTO disabled).

Still looks nicer though
... to match get_save_path. Also a few other tweaks
paletted one is unused after merging set_screen_mode[_format], and only the size is used from the other two
There's a bit too much generic ST HAL stuff here... that we don't need
@Gadgetoid
Copy link
Contributor

Wow! RIP obsolete exe switching!

Nice work. It's refreshing to see more and more HAL stuff just disappear 😆

@Daft-Freak
Copy link
Collaborator Author

More small cleanups/space savings. (Ran out of space and slightly forgot about these changes... so found other savings)

@Gadgetoid
Copy link
Contributor

Ah does this now fix the ~100 bytes debug build overflow?

@Daft-Freak
Copy link
Collaborator Author

Can't remember the exact numbers, but I think this already saved a few kb. 3ddd1e2 itself claims ~1.5k... so yes.

@Gadgetoid Gadgetoid merged commit 74b5936 into 32blit:master Sep 13, 2022
@Gadgetoid
Copy link
Contributor

Awesome! Thank you.

@Daft-Freak Daft-Freak deleted the tidy-space-save branch September 13, 2022 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants