mirror of
https://github.com/italicsjenga/agb.git
synced 2025-01-26 00:56:38 +11:00
Add comment about how silly the implementation of gba_offset is
This commit is contained in:
parent
2853d34b30
commit
3b9909ad5b
1 changed files with 2 additions and 0 deletions
|
@ -53,6 +53,8 @@ impl RegularBackgroundSize {
|
||||||
self.num_tiles() / (32 * 32)
|
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 {
|
pub(crate) fn gba_offset(&self, pos: Vector2D<u16>) -> usize {
|
||||||
let x_mod = pos.x & (self.width() as u16 - 1);
|
let x_mod = pos.x & (self.width() as u16 - 1);
|
||||||
let y_mod = pos.y & (self.height() as u16 - 1);
|
let y_mod = pos.y & (self.height() as u16 - 1);
|
||||||
|
|
Loading…
Add table
Reference in a new issue