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 { typedef struct mda_t {
mem_mapping_t mapping; mem_mapping_t mapping;
uint8_t crtc[MDA_CRTC_NUM_REGISTERS]; uint8_t crtc[MDA_CRTC_NUM_REGISTERS];
int crtcreg; int32_t crtcreg;
uint8_t mode; uint8_t mode;
uint8_t status; uint8_t status;
uint64_t dispontime; uint64_t dispontime;
uint64_t dispofftime; uint64_t dispofftime;
pc_timer_t timer; pc_timer_t timer;
int firstline; int32_t firstline;
int lastline; int32_t lastline;
int fontbase; int32_t fontbase;
int linepos; int32_t linepos;
int displine; int32_t displine;
int vc; int32_t vc;
int scanline; int32_t scanline;
uint16_t memaddr; uint16_t memaddr;
uint16_t memaddr_backup; uint16_t memaddr_backup;
int cursorvisible; int32_t cursorvisible;
int cursoron; int32_t cursoron;
int dispon; int32_t dispon;
int blink; int32_t blink;
int vsynctime; int32_t vsynctime;
int vadj; int32_t vadj;
int monitor_index; int32_t monitor_index;
int prev_monitor_index; int32_t prev_monitor_index;
int32_t monitor_type; // Used for MDA Colour support (REV0 u64)
uint8_t *vram; uint8_t *vram;
} mda_t; } mda_t;

View File

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