Protect unused bits from being set in window flags

Former-commit-id: a618b4775de7276618dd11ace2e140d200fb066b
This commit is contained in:
Michel Heily 2019-12-14 15:10:37 +02:00
parent cb36db688e
commit 29df4231e9

View file

@ -192,10 +192,12 @@ impl Bus for IoDevices {
io.gpu.win1.top = top as u8; io.gpu.win1.top = top as u8;
} }
REG_WININ => { REG_WININ => {
let value = value & !0xc0c0;
io.gpu.win0.flags = WindowFlags::from(value & 0xff); io.gpu.win0.flags = WindowFlags::from(value & 0xff);
io.gpu.win1.flags = WindowFlags::from(value >> 8); io.gpu.win1.flags = WindowFlags::from(value >> 8);
} }
REG_WINOUT => { REG_WINOUT => {
let value = value & !0xc0c0;
io.gpu.winout_flags = WindowFlags::from(value & 0xff); io.gpu.winout_flags = WindowFlags::from(value & 0xff);
io.gpu.winobj_flags = WindowFlags::from(value >> 8); io.gpu.winobj_flags = WindowFlags::from(value >> 8);
} }