You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the NES, OAM (sprite) data can be DMAed into the PPU by setting the OAMDMA register to the most significant byte ($XX) of an address and then the CPU will DMA into the PPU data from $XX00-$XXFF.
This means that if you have this array in your code then it must be aligned with $XX00 in ram.
Is it possible to preallocate this memory somehow at a particular location and then reference it in C? I assume it would be done in the linker with a section but I don't know how to do that.
The text was updated successfully, but these errors were encountered:
You can also decrease the memory usage incurred by alignment by passing --sort-section=alignment. This will order input sections within each output section by decreasing alignment, which helps decrease the amount of filler emitted in the final object file. It's not a complete binary packing solution though; I'd eventually like to have one, but that sort of thing isn't really in GNU ld or lld, so it'd be greenfield work.
I'll leave this open to track the work of making --sort-section=alignment the default.
In the NES, OAM (sprite) data can be DMAed into the PPU by setting the OAMDMA register to the most significant byte ($XX) of an address and then the CPU will DMA into the PPU data from $XX00-$XXFF.
This means that if you have this array in your code then it must be aligned with $XX00 in ram.
Is it possible to preallocate this memory somehow at a particular location and then reference it in C? I assume it would be done in the linker with a section but I don't know how to do that.
The text was updated successfully, but these errors were encountered: