-
Notifications
You must be signed in to change notification settings - Fork 81
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
Replace gbhw.asm with hardware.inc #479
Conversation
The reason for this is that the Game Boy represents the D-pad as the exact same (lower-nybble) values as the other buttons, but it depends which button matrix you read from. Most games combine these nybbles into one byte when reading from the joypad, and LADX (and |
Hmm, interesting mismatch. I suppose having the issue addressed upstream in hardware.inc would be nice, but meanwhile we can always derive our own |
0e03d7e
to
0de7920
Compare
src/code/bank14.asm
Outdated
@@ -774,7 +774,7 @@ UpdateEntityTimers:: | |||
; When the flash countdown is active, invert the palette every 4 frames | |||
sla a ; $4DE4: $CB $27 | |||
sla a ; $4DE6: $CB $27 | |||
and OAM_DMG_PAL_1 ; $4DE8: $E6 $10 | |||
and OAMF_PAL1 ; $4DE8: $E6 $10 |
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.
I still need to re-align a million billion comments
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.
tools/align_comments.py
might help?
(For what is worth, I think setting up submodules makes setting up the disassembly on a local machine significantly harder: it adds an extra step to the README, without this step nothing compiles… Could simply copying the latest hardware.inc (with a version number) be a good compromise between standardization and simplicity of setting things up?) |
Yes, sure, that's a good idea (and also simplifies the |
Yup, I should definitely remove the existing submodule, which is no longer needed :) |
d961320
to
88a5922
Compare
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.
Nitpick: I'd suggest maybe squashing all these commits together in a single one – but in either case, this is good to me.
Yeah, I approved your suggestions on the phone, but I think I would've been able to batch them in a browser. I'll squash them with the first commit when I get home. As for the alignment commit, I made that a separate one because the script (which I didn't know about until now, haha) uncovered some unrelated misalignments, and I thought maybe this would look less messy in git blame. |
66d6d65
to
230b2a4
Compare
hardware.inc
is the modern de facto standard include file for hardware constants with RGBDS. It's actively maintained, and used by some other disassembly projects (andmgbdis
). This PR pulls it in as a git submodule and replacesgbhw.asm
. Not sure if we should, but I wanted to see if we could.However, currently it doesn't build because
hardware.inc
defines joypad button bits in a different nybble order thangbhw.asm
and I'm not sure why.gbhw.asm
:hardware.inc
: