-
Notifications
You must be signed in to change notification settings - Fork 12
Split credits between shared/fusion #178
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| from enum import Enum | ||
|
|
||
|
|
||
| class LineType(Enum): | ||
| BLANK = 0 | ||
| BLUE = 1 | ||
| RED = 2 | ||
| WHITE1 = 3 | ||
| WHITE2 = 4 | ||
| COPYRIGHT1 = 5 | ||
| COPYRIGHT2 = 6 | ||
| COPYRIGHT3 = 7 | ||
| COPYRIGHT4 = 8 | ||
| END = 9 | ||
|
|
||
|
|
||
| LINE_TYPE_VALS = { | ||
| LineType.BLANK: 0x5, | ||
| LineType.BLUE: 0x0, | ||
| LineType.RED: 0x1, | ||
| LineType.WHITE1: 0x3, | ||
| LineType.WHITE2: 0x2, | ||
| LineType.COPYRIGHT1: 0xA, | ||
| LineType.COPYRIGHT2: 0xB, | ||
| LineType.COPYRIGHT3: 0xC, | ||
| LineType.COPYRIGHT4: 0xD, | ||
| LineType.END: 0x6, | ||
| } | ||
|
|
||
| LINE_TYPE_HEIGHTS = { | ||
| LineType.BLANK: 1, | ||
| LineType.BLUE: 1, | ||
| LineType.RED: 1, | ||
| LineType.WHITE1: 1, | ||
| LineType.WHITE2: 2, | ||
| LineType.COPYRIGHT1: 1, | ||
| LineType.COPYRIGHT2: 1, | ||
| LineType.COPYRIGHT3: 1, | ||
| LineType.COPYRIGHT4: 1, | ||
| LineType.END: 0, | ||
| } | ||
|
|
||
| TEXT_LINE_TYPES = {LineType.BLUE, LineType.RED, LineType.WHITE1, LineType.WHITE2} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| from mars_patcher.credits import CreditsLine, CreditsWriter | ||
| from mars_patcher.mf.auto_generated_types import MarsschemamfCreditstextItem | ||
| from mars_patcher.mf.constants.credits_lines import ( | ||
| FUSION_STAFF_LINES, | ||
| MARS_CREDITS, | ||
| RDV_CREDITS, | ||
| ) | ||
| from mars_patcher.rom import Rom | ||
|
|
||
| CREDITS_ADDR = 0x74B0B0 | ||
| CREDITS_LEN = 0x2B98 | ||
|
|
||
|
|
||
| def write_credits(rom: Rom, data: list[MarsschemamfCreditstextItem]) -> None: | ||
| writer = CreditsWriter(rom, CREDITS_ADDR) | ||
| # Write MARS credits | ||
| lines = [CreditsLine(*line) for line in MARS_CREDITS] | ||
| writer.write_lines(lines) | ||
| # Write RDV credits | ||
| lines = [CreditsLine(*line) for line in RDV_CREDITS] | ||
| writer.write_lines(lines) | ||
| # Write custom credits | ||
| lines = [CreditsLine.from_json(d) for d in data] | ||
| writer.write_lines(lines) | ||
| # Write fusion staff credits | ||
| lines = [CreditsLine(*line) for line in FUSION_STAFF_LINES] | ||
| writer.write_lines(lines) | ||
| # Verify that credits don't exceed existing space | ||
| if writer.addr > CREDITS_ADDR + CREDITS_LEN: | ||
| raise ValueError("Credits exceeded existing space") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
surprised to see that both fusion and zm have 4 copyrights
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They're basically the same https://github.com/metroidret/mzm/blob/master/include/constants/ending_and_gallery.h#L25