Add support for more ATI Rage video modes

Cherrypicks a small piece of joevt/dingusppc@117ca1e449
so that booting from the 10.2 CD gets past it trying to change the video
mode to 15bpp.

Co-authored-by: joevt <joevt@shaw.ca>
This commit is contained in:
Mihai Parparita 2023-12-06 23:47:51 -08:00
parent 65a343ce5c
commit 30ded5e803
1 changed files with 32 additions and 3 deletions

View File

@ -546,16 +546,45 @@ void ATIRage::crtc_update() {
int pix_fmt = extract_bits<uint32_t>(this->regs[ATI_CRTC_GEN_CNTL], 8, 3);
switch (pix_fmt) {
case 1:
this->convert_fb_cb = [this](uint8_t *dst_buf, int dst_pitch) {
this->convert_frame_4bpp_indexed(dst_buf, dst_pitch);
};
break;
case 2:
if (bit_set(this->regs[ATI_DAC_CNTL], 10)) {
ABORT_F("%s: DAC_DIRECT set!", this->name.c_str());
this->convert_fb_cb = [this](uint8_t *dst_buf, int dst_pitch) {
this->convert_frame_8bpp(dst_buf, dst_pitch);
};
}
else {
this->convert_fb_cb = [this](uint8_t *dst_buf, int dst_pitch) {
this->convert_frame_8bpp_indexed(dst_buf, dst_pitch);
};
}
break;
case 3:
this->convert_fb_cb = [this](uint8_t *dst_buf, int dst_pitch) {
this->convert_frame_8bpp_indexed(dst_buf, dst_pitch);
this->convert_frame_15bpp(dst_buf, dst_pitch);
};
break;
case 4:
this->convert_fb_cb = [this](uint8_t *dst_buf, int dst_pitch) {
this->convert_frame_16bpp(dst_buf, dst_pitch);
};
break;
case 5:
this->convert_fb_cb = [this](uint8_t *dst_buf, int dst_pitch) {
this->convert_frame_24bpp(dst_buf, dst_pitch);
};
break;
case 6:
this->convert_fb_cb = [this](uint8_t *dst_buf, int dst_pitch) {
this->convert_frame_32bpp(dst_buf, dst_pitch);
};
break;
default:
ABORT_F("%s: unsupported pixel format %d", this->name.c_str(), pix_fmt);
LOG_F(ERROR, "%s: unsupported pixel format %d", this->name.c_str(), pix_fmt);
}
LOG_F(INFO, "%s: primary CRT controller enabled:", this->name.c_str());