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

feat: initial implementation of palette for SDL

We still need to add more palettes from the Web frontend.
parent e36648d3
No related branches found
No related tags found
No related merge requests found
Pipeline #2181 passed
......@@ -85,6 +85,17 @@ impl Emulator {
);
}
pub fn toggle_palette(&mut self) {
//colors: ["b6a571", "8b7e56", "554d35", "201d13"]
// @todo add more palettes here
self.system.ppu().set_palette_colors(&[
[0xb6, 0xa5, 0x71],
[139, 126, 86],
[85, 77, 83],
[32, 29, 19],
])
}
pub fn run(&mut self) {
// updates the icon of the window to reflect the image
// and style of the emulator
......@@ -131,6 +142,12 @@ impl Emulator {
} => {
self.benchmark();
}
Event::KeyDown {
keycode: Some(Keycode::P),
..
} => {
self.toggle_palette();
}
Event::KeyDown {
keycode: Some(keycode),
..
......
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