Skip to content
Snippets Groups Projects
Verified Commit 18fc5a58 authored by João Magalhães's avatar João Magalhães :rocket:
Browse files

refactor: some structure refactor

parent 7569730b
No related branches found
No related tags found
No related merge requests found
......@@ -286,7 +286,7 @@ class GameboyEmulator extends EmulatorBase implements Emulator {
break;
}
// @todo replace this with somethign more flexible
// @TODO replace this with something more flexible
this.gameBoy.set_palette_colors_ws([
"b6a571",
"8b7e56",
......
......@@ -258,14 +258,14 @@ impl GameBoy {
pub fn set_palette_colors_ws(&mut self, value: Vec<JsValue>) {
let palette: Palette = value
.into_iter()
.map(|v| self.convert_value(&v))
.map(|v| Self::js_to_pixel(&v))
.collect::<Vec<Pixel>>()
.try_into()
.unwrap();
self.ppu().set_palette_colors(&palette);
}
fn convert_value(&self, value: &JsValue) -> [u8; 3] {
fn js_to_pixel(value: &JsValue) -> [u8; 3] {
value
.as_string()
.unwrap()
......
......@@ -235,7 +235,7 @@ impl Mmu {
0x50 => match addr & 0x00ff {
// 0xFF50 - Boot active flag
0x50 => self.boot_active = false,
// 0xFF51-0xFF52 - VRAM DMA source (CGB only)
0x51..=0x52 => (),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment