Add method to hide background

This commit is contained in:
Gwilym Kuiper 2022-01-17 23:12:37 +00:00
parent 93d82f309e
commit 7c3725497c

View file

@ -255,6 +255,12 @@ impl RegularMap {
DISPLAY_CONTROL.set(new_mode);
}
pub fn hide(&mut self) {
let mode = DISPLAY_CONTROL.get();
let new_mode = mode & !(1 << (self.background_id + 0x08));
DISPLAY_CONTROL.set(new_mode);
}
pub fn commit(&mut self) {
let new_bg_control_value = (self.priority as u16) | ((self.screenblock as u16) << 8);