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

feat: audio and video API for enable and disable

Will allow performance update when not using audio.
Done for benchmark purposes.
parent 63f47c86
No related branches found
No related tags found
No related merge requests found
Pipeline #2322 passed
......@@ -653,6 +653,30 @@ export class GameboyEmulator extends EmulatorBase implements Emulator {
this.gameBoy?.key_lift(keyCode);
}
pauseVideo() {
this.gameBoy?.set_ppu_enabled(false);
}
resumeVideo() {
this.gameBoy?.set_ppu_enabled(true);
}
getVideoState(): boolean {
return this.gameBoy?.get_ppu_enabled() ?? false;
}
pauseAudio() {
this.gameBoy?.set_apu_enabled(false);
}
resumeAudio() {
this.gameBoy?.set_apu_enabled(true);
}
getAudioState(): boolean {
return this.gameBoy?.get_apu_enabled() ?? false;
}
getTile(index: number): Uint8Array {
return this.gameBoy?.get_tile_buffer(index) ?? new Uint8Array();
}
......
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