Skip to content
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

VRAM labeling is incomplete #466

Closed
CuriouserThing opened this issue Jan 9, 2018 · 2 comments
Closed

VRAM labeling is incomplete #466

CuriouserThing opened this issue Jan 9, 2018 · 2 comments

Comments

@CuriouserThing
Copy link
Contributor

CuriouserThing commented Jan 9, 2018

vram.asm defines labels generic to the GBC, with no information specific to pokecrystal.

These labels are offset by the tile string, + LEN_2BPP_TILE *. This allows tile offsets to be written as tile coords—for example, vTiles0 tile $73 is seven tiles "down" & three tiles "right" from the start of the first part of the tilemap.

VRAM is also offset by the bgcoord macro.

This rabbit hole potentially goes much deeper, since the same principles used to label VRAM could label offsets into (for example) WRAM's TileMap, which itself is referenced by the coord macro.

However, in many cases, hardcoded [tile] coords are either a) single-use, or b) more intuitive as numbers than labels/constants defined elsewhere. As a result, the scope of this issue is hard to pin down.

@aaaaaa123456789
Copy link
Contributor

The tile "operator" is hard to replace as our tools stand right now; it will become cleaner when this is implemented: gbdev/rgbds#201

The same applies to anything coordinate-related. As for hardcoded tile number constants, it's rather hard to give useful names to one-offs. At some point, code comments are just clearer.

@Rangi42
Copy link
Member

Rangi42 commented Sep 2, 2018

Filling vram.asm with feature-specific labels would be more cumbersome than the current solution, offsets to six main labels. When or if rednex/rgbds#201is resolved, we can replace the tile macro (not to mention other improvements, like replacing coord, maskbits, etc.)

@Rangi42 Rangi42 closed this as completed Sep 2, 2018
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

No branches or pull requests

3 participants