Skip to content

Commit

Permalink
Make Matrox Productiva G100 usable as secondary display
Browse files Browse the repository at this point in the history
Confirmed working in Windows 98 SE at least
  • Loading branch information
Cacodemon345 committed Jan 2, 2024
1 parent 941d5bf commit af5aafb
Show file tree
Hide file tree
Showing 2 changed files with 205 additions and 199 deletions.
28 changes: 17 additions & 11 deletions src/video/vid_mga.c
Original file line number Diff line number Diff line change
Expand Up @@ -2797,11 +2797,14 @@ static uint8_t
mystique_readb_linear(uint32_t addr, void *priv)
{
const svga_t *svga = (svga_t *) priv;
mystique_t *mystique = (mystique_t *) svga->priv;

if (!svga->fast)
return svga_read_linear(addr, priv);
if (mystique->type < MGA_1064SG) {
if (!svga->fast)
return svga_read_linear(addr, priv);
}

cycles -= video_timing_read_b;
cycles -= svga->monitor->mon_video_timing_read_b;

addr &= svga->decode_mask;
if (addr >= svga->vram_max)
Expand All @@ -2815,7 +2818,7 @@ mystique_readw_linear(uint32_t addr, void *priv)
{
svga_t *svga = (svga_t *) priv;

cycles -= video_timing_read_w;
cycles -= svga->monitor->mon_video_timing_read_w;

addr &= svga->decode_mask;
if (addr >= svga->vram_max)
Expand All @@ -2829,7 +2832,7 @@ mystique_readl_linear(uint32_t addr, void *priv)
{
svga_t *svga = (svga_t *) priv;

cycles -= video_timing_read_l;
cycles -= svga->monitor->mon_video_timing_read_l;

addr &= svga->decode_mask;
if (addr >= svga->vram_max)
Expand All @@ -2842,13 +2845,16 @@ static void
mystique_writeb_linear(uint32_t addr, uint8_t val, void *priv)
{
svga_t *svga = (svga_t *) priv;
mystique_t *mystique = (mystique_t *) svga->priv;

if (!svga->fast) {
svga_write_linear(addr, val, priv);
return;
if (mystique->type < MGA_1064SG) {
if (!svga->fast) {
svga_write_linear(addr, val, priv);
return;
}
}

cycles -= video_timing_write_b;
cycles -= svga->monitor->mon_video_timing_write_b;

addr &= svga->decode_mask;
if (addr >= svga->vram_max)
Expand All @@ -2863,7 +2869,7 @@ mystique_writew_linear(uint32_t addr, uint16_t val, void *priv)
{
svga_t *svga = (svga_t *) priv;

cycles -= video_timing_write_w;
cycles -= svga->monitor->mon_video_timing_write_w;

addr &= svga->decode_mask;
if (addr >= svga->vram_max)
Expand All @@ -2878,7 +2884,7 @@ mystique_writel_linear(uint32_t addr, uint32_t val, void *priv)
{
svga_t *svga = (svga_t *) priv;

cycles -= video_timing_write_l;
cycles -= svga->monitor->mon_video_timing_write_l;

addr &= svga->decode_mask;
if (addr >= svga->vram_max)
Expand Down
Loading

0 comments on commit af5aafb

Please sign in to comment.