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

Implement oam_spr, conditionally emit methods #50

Merged
merged 1 commit into from
Sep 17, 2024
Merged

Conversation

jonathanpeppers
Copy link
Owner

Usage of the oam_spr method from neslib shows that some methods are optionally written to an NES binary. This makes sense, as they are trying hard to save space.

To do this:

  • Walk the TypeReference table in IL, look for NES.NESLib.

  • Walk the MemberReference table in IL, saving any methods that are called from the NES.NESLib type.

  • At the end of WriteFinalBuiltIns(), write oam_spr if it is used.

Usage of the `oam_spr` method from neslib shows that some methods are
optionally written to an NES binary. This makes sense, as they are
trying hard to save space.

To do this:

* Walk the `TypeReference` table in IL, look for `NES.NESLib`.

* Walk the `MemberReference` table in IL, saving any methods that are
  called from the `NES.NESLib` type.

* At the end of `WriteFinalBuiltIns()`, write `oam_spr` if it is used.

Co-authored-by: Mike Corsaro <corsarom@gmail.com>
@jonathanpeppers jonathanpeppers merged commit 90b42a2 into main Sep 17, 2024
1 check passed
@jonathanpeppers jonathanpeppers deleted the UsedMethods branch September 17, 2024 01:15
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