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

Kermalis mega clean numero2 #158

Merged
merged 47 commits into from
Sep 25, 2023
Merged

Conversation

Kermalis
Copy link
Contributor

@Kermalis Kermalis commented Sep 23, 2023

Continuing the work from my previous PR, I did these things:

  • Split files that weren't supposed to be together. For example, Wigglytuff shop was originally multiple files, but was all in one massive .c file. I split those and added their data. A lot of data has been moved into src finally
  • Create .h files for structs and code. This is unfinished but is necessary. For example, two .h files that reference structs within each other. The structs need to be moved to a separate structs file. This also makes compiling faster in general. Unnecessary extern functions aren't included if you only include the necessary structs. I hope to continue this for others (like wonder_mail.h)
  • Clean up more NULL vs 0 vs FALSE
  • Define more EWRAM_DATA/EWRAM_DATA_2/IWRAM_DATA and mark up file boundaries

This PR also tackled the massive block of strings that I call common_strings. It has some stuff used in most menus like "Info" or "Yes". For some reason, it also includes the dialogue for all the shops and the hints. It's pretty weird but that's what they did so I moved all of that out of data and now we have a simple #include "common_strings.h" instead of defining extern const *gCommonInfo[]; etc in dozens of files.

Also did some charmap work where it was needed

There's probably more I'm forgetting. I decomp'd some functions also, but only like 5 if I had to guess.

So here's stuff that needs to be finished in my next PR:

  • Separate global structs from their .c/.h counterparts (like wonder_mail)
  • Continue splitting/renaming/data for the massive files. Looking at the wonder_mail mess of .c files and also a few that I made comments in
  • Continue removing externs
  • Continue defining rigid file boundaries and making things static
  • Continue cleaning up indentation etc (not that important but it helps me know a file is "done" for real)

include/structs/str_items.h Show resolved Hide resolved
include/constants/main_menu.h Outdated Show resolved Hide resolved
src/code_8012A18_1.c Show resolved Hide resolved
src/data/luminous_cave.h Outdated Show resolved Hide resolved
src/options_menu2.c Outdated Show resolved Hide resolved
Copy link
Collaborator

@SethBarberee SethBarberee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason why we use structs versus sticking it in global.h like pokeemerald/pokefirered? Speed? Trying to understand the reasoning.

include/constants/common_strings_hints.h Show resolved Hide resolved
include/pokemon_3.h Show resolved Hide resolved
@SethBarberee SethBarberee merged commit c4d38b5 into pret:master Sep 25, 2023
1 check passed
@Kermalis Kermalis deleted the kermalis-more-clean branch September 25, 2023 23:10
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.

4 participants