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

chore: support for disabling dma

parent 0f28ad42
No related branches found
No related tags found
1 merge request!16Support for Game Boy Color (CGB) 😎🖍️
Pipeline #2667 failed
...@@ -471,6 +471,9 @@ struct Args { ...@@ -471,6 +471,9 @@ struct Args {
#[arg(long, default_value_t = false)] #[arg(long, default_value_t = false)]
no_apu: bool, no_apu: bool,
#[arg(long, default_value_t = false)]
no_dma: bool,
#[arg(long, default_value_t = false)] #[arg(long, default_value_t = false)]
no_timer: bool, no_timer: bool,
...@@ -490,6 +493,7 @@ fn main() { ...@@ -490,6 +493,7 @@ fn main() {
let device = build_device(&args.device); let device = build_device(&args.device);
game_boy.set_ppu_enabled(!args.no_ppu); game_boy.set_ppu_enabled(!args.no_ppu);
game_boy.set_apu_enabled(!args.no_apu); game_boy.set_apu_enabled(!args.no_apu);
game_boy.set_dma_enabled(!args.no_dma);
game_boy.set_timer_enabled(!args.no_timer); game_boy.set_timer_enabled(!args.no_timer);
game_boy.attach_serial(device); game_boy.attach_serial(device);
game_boy.load(true); game_boy.load(true);
......
...@@ -643,6 +643,15 @@ impl GameBoy { ...@@ -643,6 +643,15 @@ impl GameBoy {
(*self.gbc).borrow_mut().set_apu_enabled(value); (*self.gbc).borrow_mut().set_apu_enabled(value);
} }
pub fn dma_enabled(&self) -> bool {
self.dma_enabled
}
pub fn set_dma_enabled(&mut self, value: bool) {
self.dma_enabled = value;
(*self.gbc).borrow_mut().set_dma_enabled(value);
}
pub fn timer_enabled(&self) -> bool { pub fn timer_enabled(&self) -> bool {
self.timer_enabled self.timer_enabled
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment