Skip to content

Conversation

@Narishma-gb
Copy link
Contributor

This aims to continue replacing more hex number with constants:
OBJ_SIZE and TILE_SIZE from hardware.inc.
SPRITESTATEDATA1_LENGTH, NUM_SPRITESTATEDATA_STRUCTS and TILE_1BPP_SIZE are used in some places.

The changes below are also included:

  • Highlight an oversight in OakSpeech where several direct MBC bank switches are requested. It's aimed to be added to bug documentation later.
  • Remove redundant comments in home/overworld.asm
  • Add unreferenced FillBgMap function to avoid a byte of dead code
  • Some constants added in wram.asm
  • Correctly separate the commented code in SaveMainData

Copy link
Member

@Rangi42 Rangi42 left a 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!

call FillMemory
pop hl
ld de, 7 * 3 * $10 + 4 * $10 + 4
ld de, 7 * 3 tiles + 4 tiles + 4
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ld de, 7 * 3 tiles + 4 tiles + 4
ld de, (7 * 3 + 4) tiles + (1 tiles) / 4

ld h, HIGH(wShadowOAM)
ld de, $4
ld de, OBJ_SIZE
ld b, $a0
Copy link
Member

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).

Copy link
Contributor Author

@Narishma-gb Narishma-gb Nov 10, 2025

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 ?

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