-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Use OBJ_SIZE and TILE_SIZE constants
#532
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
base: master
Are you sure you want to change the base?
Conversation
Rangi42
left a comment
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.
Thanks for these improvements!
engine/battle/animations.asm
Outdated
| call FillMemory | ||
| pop hl | ||
| ld de, 7 * 3 * $10 + 4 * $10 + 4 | ||
| ld de, 7 * 3 tiles + 4 tiles + 4 |
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.
| ld de, 7 * 3 tiles + 4 tiles + 4 | |
| ld de, (7 * 3 + 4) tiles + (1 tiles) / 4 |
engine/gfx/sprite_oam.asm
Outdated
| ld h, HIGH(wShadowOAM) | ||
| ld de, $4 | ||
| ld de, OBJ_SIZE | ||
| ld b, $a0 |
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 think the $a0s here and below should be OAM_SIZE, and $90 should be OBJ_SIZE * (OAM_COUNT - 4).
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 used SCREEN_HEIGHT_PX + OAM_Y_OFS due to ld [hl], b below, and replaced $90 and $a0 with your suggestions.
Edit: what about LOW(wShadowOAMEnd), since the loop uses an address comparison to stop ?
This aims to continue replacing more hex number with constants:
OBJ_SIZEandTILE_SIZEfrom hardware.inc.SPRITESTATEDATA1_LENGTH,NUM_SPRITESTATEDATA_STRUCTSandTILE_1BPP_SIZEare used in some places.The changes below are also included:
OakSpeechwhere several direct MBC bank switches are requested. It's aimed to be added to bug documentation later.FillBgMapfunction to avoid a byte of dead codeSaveMainData