Skip to content

Commit

Permalink
Merge pull request #65 from esp-cpp/feature/genesis-sound-disable-muted
Browse files Browse the repository at this point in the history
feat(genesis): disable sound emulation when muted for better performance
  • Loading branch information
finger563 committed May 19, 2024
2 parents ceb543a + 6c62ecc commit 7eae0d5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions components/genesis/src/genesis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,14 +216,16 @@ void run_genesis_rom() {

gwenesis_vdp_render_config();

bool sound_enabled = !hal::is_muted();

/* Reset the difference clocks and audio index */
system_clock = 0;
zclk = 0; // z80_enabled ? 0 : 0x1000000;
zclk = sound_enabled ? 0 : 0x1000000;

ym2612_clock = 0; // yfm_enabled ? 0 : 0x1000000;
ym2612_clock = sound_enabled ? 0 : 0x1000000;
ym2612_index = 0;

sn76489_clock = 0; // sn76489_enabled ? 0 : 0x1000000;
sn76489_clock = sound_enabled ? 0 : 0x1000000;
sn76489_index = 0;

scan_line = 0;
Expand Down

0 comments on commit 7eae0d5

Please sign in to comment.