1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-10-02 19:54:35 +00:00

Ensured the 6560 knows its real audio clock on a PAL machine; removed some stray semicolons.

This commit is contained in:
Thomas Harte 2016-08-19 13:35:34 -04:00
parent e985c72ce8
commit 99157ad6b2
3 changed files with 17 additions and 5 deletions

View File

@ -95,8 +95,8 @@ static uint8_t noise_pattern[] = {
0xf0, 0xe1, 0xe0, 0x78, 0x70, 0x38, 0x3c, 0x3e, 0x1e, 0x3c, 0x1e, 0x1c, 0x70, 0x3c, 0x38, 0x3f,
};
#define shift(r) _shift_registers[r] = (_shift_registers[r] << 1) | (((_shift_registers[r]^0x80)&_control_registers[r]) >> 7);
#define increment(r) _shift_registers[r] = (_shift_registers[r]+1)%8191;
#define shift(r) _shift_registers[r] = (_shift_registers[r] << 1) | (((_shift_registers[r]^0x80)&_control_registers[r]) >> 7)
#define increment(r) _shift_registers[r] = (_shift_registers[r]+1)%8191
#define update(r, m, up) _counters[r]++; if((_counters[r] >> m) == 0x7f) { up(r); _counters[r] = _control_registers[r]&0x7f; }
void Speaker::get_samples(unsigned int number_of_samples, int16_t *target)

View File

@ -68,7 +68,11 @@ template <class T> class MOS6560 {
// show only the centre
_crt->set_visible_area(_crt->get_rect_for_area(16, 237, 11*4, 55*4, 4.0f / 3.0f));
_speaker->set_input_rate(255681.75); // assuming NTSC; clock rate / 4
}
void set_clock_rate(double clock_rate)
{
_speaker->set_input_rate(clock_rate / 4.0);
}
std::shared_ptr<Outputs::CRT::CRT> get_crt() { return _crt; }

View File

@ -181,11 +181,19 @@ void Machine::set_region(Commodore::Vic20::Region region)
{
case PAL:
set_clock_rate(1108404);
if(_mos6560) _mos6560->set_output_mode(MOS::MOS6560<Commodore::Vic20::Vic6560>::OutputMode::PAL);
if(_mos6560)
{
_mos6560->set_output_mode(MOS::MOS6560<Commodore::Vic20::Vic6560>::OutputMode::PAL);
_mos6560->set_clock_rate(1108404);
}
break;
case NTSC:
set_clock_rate(1022727);
if(_mos6560) _mos6560->set_output_mode(MOS::MOS6560<Commodore::Vic20::Vic6560>::OutputMode::NTSC);
if(_mos6560)
{
_mos6560->set_output_mode(MOS::MOS6560<Commodore::Vic20::Vic6560>::OutputMode::NTSC);
_mos6560->set_clock_rate(1022727);
}
break;
}
}