mirror of
https://github.com/italicsjenga/agb.git
synced 2025-01-11 09:31:34 +11:00
Add comment about how silly the implementation of gba_offset is
This commit is contained in:
parent
2853d34b30
commit
3b9909ad5b
|
@ -53,6 +53,8 @@ impl RegularBackgroundSize {
|
|||
self.num_tiles() / (32 * 32)
|
||||
}
|
||||
|
||||
// This is hilariously complicated due to how the GBA stores the background screenblocks.
|
||||
// See https://www.coranac.com/tonc/text/regbg.htm#sec-map for an explanation
|
||||
pub(crate) fn gba_offset(&self, pos: Vector2D<u16>) -> usize {
|
||||
let x_mod = pos.x & (self.width() as u16 - 1);
|
||||
let y_mod = pos.y & (self.height() as u16 - 1);
|
||||
|
|
Loading…
Reference in a new issue