You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add SGB commands constants, refactor ATTR_BLK and CheckSGB - #597
This makes the sgb_packets.asm file contents easier to grasp, as the raw values are replaced with their CMD_* constants. sgb_cmd has a default packet size of 1, and checks for illegal packet count values. ATTR_BLK will now calculate the number of packets necessary for the data, and add the relevant padding bytes. I reused the "dbing then defining" trick.
Should all macros be moved to sgb_constants.asm, or left in sgb_packets.asm?
In CheckSGB, JOYP_GET_* constants are used instead of the packet handling constants. I renamed JOYP_SGB_MLT_REQ into SGB_JOYP_ID_MASK and moved it to sgb_constants.asm. It helps seeing this function as an attempt to cycle through the 2-player input that we've temporarily set.
I'm going to draft this one for now, because the next hardware.inc release might be ready in the coming weeks and it may include sgb.inc. This is good timing though, I can look at this PR to consider what else might be useful in that file.
This reformats BorderPalettes so that necessary padding isn't confused with empty ROM data.
With the info at https://snes.nesdev.org/wiki/Tilemaps and Pan Docs it stands to reason that the extra $100 bytes are another 4 rows of tilemap data, that doesn't get used. SNES_TILEMAP_WIDTH could be a nice addition to sgb.inc
The "mystery" of the auto assigned palette color 0 is a case of what's known as the backdrop color.
I see hardware.inc v6 was released, but sgb.inc was still WIP at that time and didn't get included. Should this PR be kept on hold, or continue separately with the current constants, or include the latest unreleased sgb.inc? There is no hurry, so I'm fine with either solution.
No sgb.inc is released yet -- if it gets included in hardware.inc, it will be in a future version, or maybe it'll end up being its own repo -- so since this PR does not use sgb.inc directly, it's unaffected. (Although if you're keeping names in sync between here and the planned sgb.inc PR, that's great.)
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.
This makes the
sgb_packets.asmfile contents easier to grasp, as the raw values are replaced with theirCMD_*constants.sgb_cmdhas a default packet size of 1, and checks for illegal packet count values.ATTR_BLKwill now calculate the number of packets necessary for the data, and add the relevant padding bytes. I reused the "dbing then defining" trick.Should all macros be moved to
sgb_constants.asm, or left insgb_packets.asm?In
CheckSGB,JOYP_GET_*constants are used instead of the packet handling constants. I renamedJOYP_SGB_MLT_REQintoSGB_JOYP_ID_MASKand moved it tosgb_constants.asm. It helps seeing this function as an attempt to cycle through the 2-player input that we've temporarily set.