Deprecate VRAM address constants.#18
Conversation
|
Perhaps they should be named something like |
|
That's a good point, I've updated the constants. |
ISSOtm
left a comment
There was a problem hiding this comment.
While it makes sense to deprecate those symbols for the reasons you gave, it makes less sense to define the constants you suggest, simply because laying out VRAM in this way is a convention, not something intrinsic to the hardware.
I'd argue that defining PADF_* like they are is a problem, but it's a convention accepted largely in the community, so I can give it a pass. This, however, is dependent on several factors, and may even vary within a single game. Hence, I'm for rejecting the new symbols.
|
Okay, it seems like I had a different idea of what hardware.inc was for. I've moved those address constants down to the deprecated section and removed the |
|
Oh, good point. This should probably be 4.2.1, not 4.3 (I also forgot to update the version check macro) |
|
I'm new to Game Boy programming... The pandocs refer to three "blocks" in VRAM. https://gbdev.io/pandocs/Tile_Data.html I load my object sprites into block 0 and background tiles into block 2. It looks like certain blocks can only be used for certain types of VRAM data. Won't every game need to reference these three blocks at least once at some point? Does it make sense to have some reference to them here? Or, is having a reference to the three VRAM blocks outside the scope of the "hardware.inc" file? Thank you! |
|
While it's extremely likely for a program to reference at least one of those three areas, almost all will reference two, and many will reference all three, the reason why they don't belong here is that they don't have a specific meaning that you can name. The only limitation is that sprites' tile data cannot use block 2. The proper way to address them is to give them a meaning through labels in your own program, typically through |
These 3 lines are completely useless, literally just prefixing a few addresses with
_VRAM_. I think replacing them with_VRAM_BG,_VRAM_SHARED, and_VRAM_OBJ(and moving the old constants to the deprecated section withIEF_LCDC) would be much more descriptive. I believe the reason this was not done was because the first 256 tiles can be unified into a single shared section, but I this is actually already solved byhardware.inc: just use the plain_VRAMconstant.