From ac5b4346416483ec7668ce5a5979131fd563b1e1 Mon Sep 17 00:00:00 2001 From: joevt Date: Tue, 27 Feb 2024 22:09:00 -0800 Subject: [PATCH] atimach64gx: Add verbose_pixel_format. It is used to log the pixel format/depth. --- devices/video/atimach64gx.cpp | 34 ++++++++++++++++++++++++++++++++++ devices/video/atimach64gx.h | 1 + 2 files changed, 35 insertions(+) diff --git a/devices/video/atimach64gx.cpp b/devices/video/atimach64gx.cpp index e93bc56..92f2d0a 100644 --- a/devices/video/atimach64gx.cpp +++ b/devices/video/atimach64gx.cpp @@ -440,6 +440,40 @@ void AtiMach64Gx::write(uint32_t rgn_start, uint32_t offset, uint32_t value, int } } +void AtiMach64Gx::verbose_pixel_format(int crtc_index) { + if (crtc_index) { + LOG_F(ERROR, "CRTC2 not supported yet"); + return; + } + +/* + int fmt = extract_bits(this->regs[ATI_CRTC_GEN_CNTL], ATI_CRTC_PIX_WIDTH, ATI_CRTC_PIX_WIDTH_size); +*/ + int pix_fmt = this->pixel_format; + + const char* what = "Pixel format:"; + + switch (pix_fmt) { + case 2: + LOG_F(INFO, "%s 4 bpp with DAC palette", what); + break; + case 3: + LOG_F(INFO, "%s 8 bpp with DAC palette", what); + break; + case 4: + LOG_F(INFO, "%s 15 bpp direct color (RGB555)", what); + break; + case 5: + LOG_F(INFO, "%s 24 bpp direct color (RGB888)", what); + break; + case 6: + LOG_F(INFO, "%s 32 bpp direct color (ARGB8888)", what); + break; + default: + LOG_F(ERROR, "%s: CRTC pixel format %d not supported", this->name.c_str(), pix_fmt); + } +} + void AtiMach64Gx::enable_crtc_internal() { uint32_t new_width, new_height; diff --git a/devices/video/atimach64gx.h b/devices/video/atimach64gx.h index 96bcb0d..9054b67 100644 --- a/devices/video/atimach64gx.h +++ b/devices/video/atimach64gx.h @@ -65,6 +65,7 @@ protected: void rgb514_write_reg(uint8_t reg_addr, uint8_t value); void rgb514_write_ind_reg(uint8_t reg_addr, uint8_t value); + void verbose_pixel_format(int crtc_index); private: void change_one_bar(uint32_t &aperture, uint32_t aperture_size, uint32_t aperture_new, int bar_num);