mirror of
https://github.com/dingusdev/dingusppc.git
synced 2024-06-13 02:29:46 +00:00
atimach64gx: Move pixel clock calculation.
This commit is contained in:
parent
1fb9e37ec5
commit
ab647ec0eb
|
@ -526,6 +526,16 @@ void AtiMach64Gx::crtc_update()
|
||||||
need_recalc = true;
|
need_recalc = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// pixel clock = source_freq / post_div
|
||||||
|
int m = 8 >> (this->dac_regs[Rgb514::F0_M0] >> 6);
|
||||||
|
int vco_div = (this->dac_regs[Rgb514::F0_M0] & 0x3F) + 65;
|
||||||
|
int ref_div = (this->dac_regs[Rgb514::F1_N0] & 0x1F) * m;
|
||||||
|
float new_pixel_clock = ATI_XTAL * vco_div / ref_div;
|
||||||
|
if (new_pixel_clock != this->pixel_clock) {
|
||||||
|
this->pixel_clock = new_pixel_clock;
|
||||||
|
need_recalc = true;
|
||||||
|
}
|
||||||
|
|
||||||
if (!need_recalc)
|
if (!need_recalc)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -603,12 +613,7 @@ void AtiMach64Gx::rgb514_write_ind_reg(uint8_t reg_addr, uint8_t value)
|
||||||
if (value & PLL_ENAB) {
|
if (value & PLL_ENAB) {
|
||||||
if ((this->dac_regs[Rgb514::PLL_CTL_1] & 3) != 1)
|
if ((this->dac_regs[Rgb514::PLL_CTL_1] & 3) != 1)
|
||||||
ABORT_F("RGB514: unsupported PLL source");
|
ABORT_F("RGB514: unsupported PLL source");
|
||||||
|
this->crtc_update();
|
||||||
int m = 8 >> (this->dac_regs[Rgb514::F0_M0] >> 6);
|
|
||||||
int vco_div = (this->dac_regs[Rgb514::F0_M0] & 0x3F) + 65;
|
|
||||||
int ref_div = (this->dac_regs[Rgb514::F1_N0] & 0x1F) * m;
|
|
||||||
this->pixel_clock = ATI_XTAL * vco_div / ref_div;
|
|
||||||
LOG_F(INFO, "RGB514: dot clock set to %f Hz", this->pixel_clock);
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case Rgb514::PIX_FORMAT:
|
case Rgb514::PIX_FORMAT:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user