Turn off disk acceleration immediately when there is a sound

This commit is contained in:
tudnai 2020-05-27 17:27:11 -07:00
parent d008094078
commit 17927f4ab0
2 changed files with 10 additions and 0 deletions

View File

@ -16,6 +16,7 @@
#include "speaker.h"
#include "6502.h"
#include "disk.h" // to be able to disable disk acceleration
#define min(x,y) (x) < (y) ? (x) : (y)
@ -143,6 +144,12 @@ void spkr_toggle() {
spkr_play_time = 0;
if ( diskAccelerator_count ) {
// turn off disk acceleration immediately
diskAccelerator_count = 0;
clk_6502_per_frm = clk_6502_per_frm_max = clk_6502_per_frm_set;
}
if ( clk_6502_per_frm_set < clk_6502_per_frm_max_sound ) {
spkr_play_time = spkr_play_timeout;

View File

@ -57,6 +57,9 @@ extern const int diskAccelerator_frames; // number of frames disk acceleratio
extern int diskAccelerator_count; // counter for the disk acceleration frames
extern int diskAccelerator_speed; // if less than the actual CPU speed, no acceleration
extern int diskAccelerator_count;
//extern const unsigned long long clk_6502_per_frm_diskAccelerator;
//extern const unsigned long long clk_diskAcceleratorTimeout;