Preparation for monochrome video selection
This commit is contained in:
@@ -26,10 +26,15 @@ typedef struct mda_t
|
||||
int dispon, blink;
|
||||
int vsynctime;
|
||||
int vadj;
|
||||
int monitor_index;
|
||||
int prev_monitor_index;
|
||||
|
||||
uint8_t *vram;
|
||||
} mda_t;
|
||||
|
||||
#define VIDEO_MONITOR_PROLOGUE() { mda->prev_monitor_index = monitor_index_global; monitor_index_global = mda->monitor_index; }
|
||||
#define VIDEO_MONITOR_EPILOGUE() { monitor_index_global = mda->prev_monitor_index; }
|
||||
|
||||
void mda_init(mda_t *mda);
|
||||
void mda_setcol(int chr, int blink, int fg, uint8_t cga_ink);
|
||||
void mda_out(uint16_t addr, uint8_t val, void *p);
|
||||
|
||||
@@ -223,6 +223,7 @@ extern int video_is_mda(void);
|
||||
extern int video_is_cga(void);
|
||||
extern int video_is_ega_vga(void);
|
||||
extern void video_inform(int type, const video_timings_t *ptr);
|
||||
extern void video_inform_monitor(int type, const video_timings_t *ptr, int monitor_index);
|
||||
extern int video_get_type(void);
|
||||
extern int video_get_type_monitor(int monitor_index);
|
||||
|
||||
|
||||
@@ -110,6 +110,8 @@ void mda_poll(void *p)
|
||||
uint8_t chr, attr;
|
||||
int oldsc;
|
||||
int blink;
|
||||
|
||||
VIDEO_MONITOR_PROLOGUE()
|
||||
if (!mda->linepos)
|
||||
{
|
||||
timer_advance_u64(&mda->timer, mda->dispofftime);
|
||||
@@ -252,6 +254,7 @@ void mda_poll(void *p)
|
||||
mda->con = 1;
|
||||
}
|
||||
}
|
||||
VIDEO_MONITOR_EPILOGUE();
|
||||
}
|
||||
|
||||
void mda_init(mda_t *mda)
|
||||
@@ -278,6 +281,7 @@ void mda_init(mda_t *mda)
|
||||
mdacols[0x88][0][1] = mdacols[0x88][1][1] = 16;
|
||||
|
||||
overscan_x = overscan_y = 0;
|
||||
mda->monitor_index = monitor_index_global;
|
||||
|
||||
cga_palette = device_get_config_int("rgb_type") << 1;
|
||||
if (cga_palette > 6)
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
|
||||
typedef struct {
|
||||
const device_t *device;
|
||||
int flags;
|
||||
} VIDEO_CARD;
|
||||
|
||||
|
||||
@@ -293,16 +294,18 @@ video_prepare(void)
|
||||
fontdatksc5601 = NULL;
|
||||
}
|
||||
|
||||
/* Reset the CGA palette. */
|
||||
cga_palette = 0;
|
||||
cgapal_rebuild();
|
||||
|
||||
/* Reset the blend. */
|
||||
herc_blend = 0;
|
||||
|
||||
for (int i = 0; i < MONITORS_NUM; i++) {
|
||||
/* Reset the CGA palette. */
|
||||
monitors[i].mon_cga_palette = 0;
|
||||
cgapal_rebuild_monitor(i);
|
||||
|
||||
/* Do an inform on the default values, so that that there's some sane values initialized
|
||||
even if the device init function does not do an inform of its own. */
|
||||
video_inform(VIDEO_FLAG_TYPE_SPECIAL, &timing_default);
|
||||
video_inform_monitor(VIDEO_FLAG_TYPE_SPECIAL, &timing_default, i);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user