mirror of
https://github.com/italicsjenga/agb.git
synced 2024-12-23 08:11:33 +11:00
allow TileSetting palette to be set
This commit is contained in:
parent
1a468e7b55
commit
2f1ad07e43
|
@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
|
||||
### Added
|
||||
- There is now a multiboot feature which you can use to easily make multiboot ROMs.
|
||||
- Can now set palette on a TileSetting struct.
|
||||
|
||||
### Changed
|
||||
- You no longer need the gba.ld or gba_mb.ld files in your repository. You should delete these when upgrading.
|
||||
|
|
|
@ -194,6 +194,11 @@ impl TileSetting {
|
|||
Self(self.0 ^ ((should_flip as u16) << 11))
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub const fn palette(self, palette_id: u8) -> Self {
|
||||
Self(self.0 ^ ((palette_id as u16) << 12))
|
||||
}
|
||||
|
||||
fn index(self) -> u16 {
|
||||
self.0 & ((1 << 10) - 1)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue