Make palette OOBs not fatal

This commit is contained in:
Kevin Hamacher 2020-02-20 20:20:55 +01:00
parent 2fb40e7b10
commit cd48f4c4c8

View File

@ -372,7 +372,8 @@ impl Display {
if idx < 64 { if idx < 64 {
self.background_palette_cgb[idx / 8].0[idx % 8] = val; self.background_palette_cgb[idx / 8].0[idx % 8] = val;
} else { } else {
panic!("OOB palette w/ autoinc"); println!("OOB palette w/ autoinc");
return;
} }
if self.background_palette_autoinc { if self.background_palette_autoinc {
self.background_palette_index += 1; self.background_palette_index += 1;
@ -387,7 +388,8 @@ impl Display {
if idx < 64 { if idx < 64 {
self.object_palette_cgb[idx / 8].0[idx % 8] = val; self.object_palette_cgb[idx / 8].0[idx % 8] = val;
} else { } else {
panic!("OOB obj palette w/ autoinc"); println!("OOB obj palette w/ autoinc");
return;
} }
if self.object_palette_autoinc { if self.object_palette_autoinc {
self.object_palette_index += 1; self.object_palette_index += 1;