Only enable colour support if we are using an RGBI monitor

This commit is contained in:
starfrost013
2025-06-16 20:48:38 +01:00
parent 7f8204f009
commit a64fafcf61
2 changed files with 30 additions and 28 deletions

View File

@@ -69,34 +69,35 @@ typedef enum mda_mode_flags_e
typedef struct mda_t {
mem_mapping_t mapping;
uint8_t crtc[MDA_CRTC_NUM_REGISTERS];
int crtcreg;
uint8_t crtc[MDA_CRTC_NUM_REGISTERS];
int32_t crtcreg;
uint8_t mode;
uint8_t status;
uint8_t mode;
uint8_t status;
uint64_t dispontime;
uint64_t dispofftime;
pc_timer_t timer;
uint64_t dispontime;
uint64_t dispofftime;
pc_timer_t timer;
int firstline;
int lastline;
int32_t firstline;
int32_t lastline;
int fontbase;
int linepos;
int displine;
int vc;
int scanline;
uint16_t memaddr;
uint16_t memaddr_backup;
int cursorvisible;
int cursoron;
int dispon;
int blink;
int vsynctime;
int vadj;
int monitor_index;
int prev_monitor_index;
int32_t fontbase;
int32_t linepos;
int32_t displine;
int32_t vc;
int32_t scanline;
uint16_t memaddr;
uint16_t memaddr_backup;
int32_t cursorvisible;
int32_t cursoron;
int32_t dispon;
int32_t blink;
int32_t vsynctime;
int32_t vadj;
int32_t monitor_index;
int32_t prev_monitor_index;
int32_t monitor_type; // Used for MDA Colour support (REV0 u64)
uint8_t *vram;
} mda_t;

View File

@@ -186,15 +186,15 @@ mda_poll(void *priv)
int32_t color_bg = 0, color_fg = 0;
// If we are using an RGBI monitor allow colour
//if (cga_palette == MDA_MONITOR_TYPE_RGBI)
//{
if (mda->monitor_type == MDA_MONITOR_TYPE_RGBI)
{
if (!(mda->mode & MDA_MODE_BW))
{
color_bg = (attr >> 4) & 0x0F;
color_fg = (attr & 0x0F);
}
//}
}
if (mda->scanline == 12 && ((attr & 7) == 1)) { // underline
for (c = 0; c < 9; c++)
@@ -360,7 +360,8 @@ mda_init(mda_t *mda)
overscan_x = overscan_y = 0;
mda->monitor_index = monitor_index_global;
cga_palette = device_get_config_int("rgb_type") << 1;
mda->monitor_type = device_get_config_int("rgb_type");
cga_palette = mda->monitor_type << 1;
if (cga_palette > 6) {
cga_palette = 0;
}