Added a legacy way to address some issues with the SVGA scrolling and such (such as Pinball Illusions on S3 cards, including the ViRGE).
This commit is contained in:
@@ -404,9 +404,9 @@ static void s3_pci_write(int func, int addr, uint8_t val, void *p);
|
||||
static __inline uint32_t
|
||||
dword_remap(svga_t *svga, uint32_t in_addr)
|
||||
{
|
||||
if (svga->packed_chain4)
|
||||
if (svga->packed_chain4 || svga->force_old_addr)
|
||||
return in_addr;
|
||||
|
||||
|
||||
return ((in_addr << 2) & 0x3fff0) |
|
||||
((in_addr >> 14) & 0xc) |
|
||||
(in_addr & ~0x3fffc);
|
||||
@@ -414,9 +414,9 @@ dword_remap(svga_t *svga, uint32_t in_addr)
|
||||
static __inline uint32_t
|
||||
dword_remap_w(svga_t *svga, uint32_t in_addr)
|
||||
{
|
||||
if (svga->packed_chain4)
|
||||
return in_addr;
|
||||
|
||||
if (svga->packed_chain4 || svga->force_old_addr)
|
||||
return in_addr;
|
||||
|
||||
return ((in_addr << 2) & 0x1fff8) |
|
||||
((in_addr >> 14) & 0x6) |
|
||||
(in_addr & ~0x1fffe);
|
||||
@@ -424,9 +424,9 @@ dword_remap_w(svga_t *svga, uint32_t in_addr)
|
||||
static __inline uint32_t
|
||||
dword_remap_l(svga_t *svga, uint32_t in_addr)
|
||||
{
|
||||
if (svga->packed_chain4)
|
||||
return in_addr;
|
||||
|
||||
if (svga->packed_chain4 || svga->force_old_addr)
|
||||
return in_addr;
|
||||
|
||||
return ((in_addr << 2) & 0xfffc) |
|
||||
((in_addr >> 14) & 0x3) |
|
||||
(in_addr & ~0xffff);
|
||||
@@ -2552,6 +2552,7 @@ s3_out(uint16_t addr, uint8_t val, void *p)
|
||||
{
|
||||
case 0x31:
|
||||
s3->ma_ext = (s3->ma_ext & 0x1c) | ((val & 0x30) >> 4);
|
||||
svga->force_dword_mode = !!(val & 0x08);
|
||||
break;
|
||||
case 0x32:
|
||||
if ((svga->crtc[0x31] & 0x30) && (svga->crtc[0x51] & 0x01) && (val & 0x40))
|
||||
@@ -2971,7 +2972,6 @@ static void s3_recalctimings(svga_t *svga)
|
||||
}
|
||||
|
||||
if ((svga->gdcreg[5] & 0x40) && (svga->crtc[0x3a] & 0x10)) {
|
||||
svga->fb_only = 1;
|
||||
switch (svga->bpp) {
|
||||
case 8:
|
||||
svga->render = svga_render_8bpp_highres;
|
||||
@@ -3154,7 +3154,6 @@ static void s3_recalctimings(svga_t *svga)
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
svga->fb_only = 0;
|
||||
if (!svga->scrblank && svga->attr_palette_enable) {
|
||||
if ((svga->gdcreg[6] & 1) || (svga->attrregs[0x10] & 1)) {
|
||||
if ((svga->crtc[0x31] & 0x08) && ((svga->gdcreg[5] & 0x60) == 0x00)) {
|
||||
@@ -3208,7 +3207,6 @@ static void s3_trio64v_recalctimings(svga_t *svga)
|
||||
svga->lowres = !((svga->gdcreg[5] & 0x40) && (svga->crtc[0x3a] & 0x10));
|
||||
|
||||
if ((svga->gdcreg[5] & 0x40) && (svga->crtc[0x3a] & 0x10)) {
|
||||
svga->fb_only = 1;
|
||||
switch (svga->bpp) {
|
||||
case 8:
|
||||
svga->render = svga_render_8bpp_highres;
|
||||
@@ -3229,13 +3227,10 @@ static void s3_trio64v_recalctimings(svga_t *svga)
|
||||
svga->render = svga_render_32bpp_highres;
|
||||
break;
|
||||
}
|
||||
} else
|
||||
svga->fb_only = 0;
|
||||
}
|
||||
}
|
||||
else /*Streams mode*/
|
||||
{
|
||||
svga->fb_only = 1;
|
||||
|
||||
if (s3->streams.buffer_ctrl & 1)
|
||||
svga->ma_latch = s3->streams.pri_fb1 >> 2;
|
||||
else
|
||||
@@ -3379,7 +3374,12 @@ s3_updatemapping(s3_t *s3)
|
||||
|
||||
mem_mapping_set_addr(&s3->linear_mapping, s3->linear_base, s3->linear_size);
|
||||
}
|
||||
if (s3->chip >= S3_TRIO64V)
|
||||
svga->fb_only = 1;
|
||||
} else {
|
||||
if (s3->chip >= S3_TRIO64V)
|
||||
svga->fb_only = 0;
|
||||
|
||||
mem_mapping_disable(&s3->linear_mapping);
|
||||
}
|
||||
|
||||
@@ -7140,6 +7140,8 @@ static void *s3_init(const device_t *info)
|
||||
|
||||
s3->card_type = info->local;
|
||||
|
||||
svga->force_old_addr = 1;
|
||||
|
||||
switch(s3->card_type) {
|
||||
case S3_ORCHID_86C911:
|
||||
case S3_DIAMOND_STEALTH_VRAM:
|
||||
@@ -7401,8 +7403,6 @@ static void *s3_init(const device_t *info)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
svga->packed_chain4 = 1;
|
||||
|
||||
if (s3->pci)
|
||||
s3->card = pci_add_card(PCI_ADD_VIDEO, s3_pci_read, s3_pci_write, s3);
|
||||
|
||||
@@ -7609,73 +7609,124 @@ static void s3_force_redraw(void *p)
|
||||
s3->svga.fullchange = changeframecount;
|
||||
}
|
||||
|
||||
// clang-format off
|
||||
static const device_config_t s3_orchid_86c911_config[] = {
|
||||
{
|
||||
"memory", "Memory size", CONFIG_SELECTION, "", 1, "", { 0 },
|
||||
{
|
||||
{ "512 KB", 0 },
|
||||
{ "1 MB", 1 },
|
||||
{ "" }
|
||||
}
|
||||
},
|
||||
{ "", "", -1 }
|
||||
static const device_config_t s3_orchid_86c911_config[] =
|
||||
{
|
||||
{
|
||||
"memory", "Memory size", CONFIG_SELECTION, "", 1, "", { 0 },
|
||||
{
|
||||
{
|
||||
"512 KB", 0
|
||||
},
|
||||
{
|
||||
"1 MB", 1
|
||||
},
|
||||
{
|
||||
""
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"", "", -1
|
||||
}
|
||||
};
|
||||
|
||||
static const device_config_t s3_9fx_config[] = {
|
||||
{
|
||||
"memory", "Memory size", CONFIG_SELECTION, "", 2, "", { 0 },
|
||||
{
|
||||
{ "1 MB", 1 },
|
||||
{ "2 MB", 2 },
|
||||
/*Trio64 also supports 4 MB, however the Number Nine BIOS does not*/
|
||||
{ "" }
|
||||
}
|
||||
},
|
||||
{ "", "", -1 }
|
||||
static const device_config_t s3_9fx_config[] =
|
||||
{
|
||||
{
|
||||
"memory", "Memory size", CONFIG_SELECTION, "", 2, "", { 0 },
|
||||
{
|
||||
{
|
||||
"1 MB", 1
|
||||
},
|
||||
{
|
||||
"2 MB", 2
|
||||
},
|
||||
/*Trio64 also supports 4 MB, however the Number Nine BIOS does not*/
|
||||
{
|
||||
""
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"", "", -1
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
static const device_config_t s3_phoenix_trio32_config[] = {
|
||||
{
|
||||
"memory", "Memory size", CONFIG_SELECTION, "", 2, "", { 0 },
|
||||
{
|
||||
{ "512 KB", 0 },
|
||||
{ "1 MB", 1 },
|
||||
{ "2 MB", 2 },
|
||||
{ "" }
|
||||
}
|
||||
},
|
||||
{ "", "", -1 }
|
||||
static const device_config_t s3_phoenix_trio32_config[] =
|
||||
{
|
||||
{
|
||||
"memory", "Memory size", CONFIG_SELECTION, "", 2, "", { 0 },
|
||||
{
|
||||
{
|
||||
"512 KB", 0
|
||||
},
|
||||
{
|
||||
"1 MB", 1
|
||||
},
|
||||
{
|
||||
"2 MB", 2
|
||||
},
|
||||
{
|
||||
""
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"", "", -1
|
||||
}
|
||||
};
|
||||
|
||||
static const device_config_t s3_standard_config[] = {
|
||||
{
|
||||
"memory", "Memory size", CONFIG_SELECTION, "", 4, "", { 0 },
|
||||
{
|
||||
{ "1 MB", 1 },
|
||||
{ "2 MB", 2 },
|
||||
{ "4 MB", 4 },
|
||||
{ "" }
|
||||
}
|
||||
},
|
||||
{ "", "", -1 }
|
||||
static const device_config_t s3_standard_config[] =
|
||||
{
|
||||
{
|
||||
"memory", "Memory size", CONFIG_SELECTION, "", 4, "", { 0 },
|
||||
{
|
||||
{
|
||||
"1 MB", 1
|
||||
},
|
||||
{
|
||||
"2 MB", 2
|
||||
},
|
||||
{
|
||||
"4 MB", 4
|
||||
},
|
||||
{
|
||||
""
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"", "", -1
|
||||
}
|
||||
};
|
||||
|
||||
static const device_config_t s3_968_config[] = {
|
||||
{
|
||||
"memory", "Memory size", CONFIG_SELECTION, "", 4, "", { 0 },
|
||||
{
|
||||
{ "1 MB", 1 },
|
||||
{ "2 MB", 2 },
|
||||
{ "4 MB", 4 },
|
||||
{ "8 MB", 8 },
|
||||
{ "" }
|
||||
}
|
||||
},
|
||||
{ "", "", -1 }
|
||||
static const device_config_t s3_968_config[] =
|
||||
{
|
||||
{
|
||||
"memory", "Memory size", CONFIG_SELECTION, "", 4, "", { 0 },
|
||||
{
|
||||
{
|
||||
"1 MB", 1
|
||||
},
|
||||
{
|
||||
"2 MB", 2
|
||||
},
|
||||
{
|
||||
"4 MB", 4
|
||||
},
|
||||
{
|
||||
"8 MB", 8
|
||||
},
|
||||
{
|
||||
""
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"", "", -1
|
||||
}
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
const device_t s3_orchid_86c911_isa_device =
|
||||
{
|
||||
@@ -8333,7 +8384,7 @@ const device_t s3_elsa_winner2000_pro_x_964_pci_device =
|
||||
S3_ELSAWIN2KPROX_964,
|
||||
s3_init,
|
||||
s3_close,
|
||||
s3_reset,
|
||||
s3_reset,
|
||||
{ s3_elsa_winner2000_pro_x_964_available },
|
||||
s3_speed_changed,
|
||||
s3_force_redraw,
|
||||
@@ -8348,7 +8399,7 @@ const device_t s3_elsa_winner2000_pro_x_pci_device =
|
||||
S3_ELSAWIN2KPROX,
|
||||
s3_init,
|
||||
s3_close,
|
||||
s3_reset,
|
||||
s3_reset,
|
||||
{ s3_elsa_winner2000_pro_x_available },
|
||||
s3_speed_changed,
|
||||
s3_force_redraw,
|
||||
@@ -8363,7 +8414,7 @@ const device_t s3_trio64v2_dx_pci_device =
|
||||
S3_TRIO64V2_DX,
|
||||
s3_init,
|
||||
s3_close,
|
||||
s3_reset,
|
||||
s3_reset,
|
||||
{ s3_trio64v2_dx_available },
|
||||
s3_speed_changed,
|
||||
s3_force_redraw,
|
||||
@@ -8379,7 +8430,7 @@ const device_t s3_trio64v2_dx_onboard_pci_device =
|
||||
S3_TRIO64V2_DX_ONBOARD,
|
||||
s3_init,
|
||||
s3_close,
|
||||
NULL,
|
||||
NULL,
|
||||
{ NULL },
|
||||
s3_speed_changed,
|
||||
s3_force_redraw,
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -179,7 +179,7 @@ svga_out(uint16_t addr, uint8_t val, void *p)
|
||||
svga->chain2_write = !(val & 4);
|
||||
svga->chain4 = val & 8;
|
||||
svga->fast = (svga->gdcreg[8] == 0xff && !(svga->gdcreg[3] & 0x18) &&
|
||||
!svga->gdcreg[1]) && ((svga->chain4 && svga->packed_chain4) || svga->fb_only) && !(svga->adv_flags & FLAG_ADDR_BY8);
|
||||
!svga->gdcreg[1]) && ((svga->chain4 && (svga->packed_chain4 || svga->force_old_addr)) || svga->fb_only) && !(svga->adv_flags & FLAG_ADDR_BY8);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
@@ -264,7 +264,7 @@ svga_out(uint16_t addr, uint8_t val, void *p)
|
||||
}
|
||||
svga->gdcreg[svga->gdcaddr & 15] = val;
|
||||
svga->fast = (svga->gdcreg[8] == 0xff && !(svga->gdcreg[3] & 0x18) &&
|
||||
!svga->gdcreg[1]) && ((svga->chain4 && svga->packed_chain4) || svga->fb_only);
|
||||
!svga->gdcreg[1]) && ((svga->chain4 && (svga->packed_chain4 || svga->force_old_addr)) || svga->fb_only);
|
||||
if (((svga->gdcaddr & 15) == 5 && (val ^ o) & 0x70) ||
|
||||
((svga->gdcaddr & 15) == 6 && (val ^ o) & 1))
|
||||
svga_recalctimings(svga);
|
||||
@@ -582,7 +582,8 @@ svga_recalctimings(svga_t *svga)
|
||||
if (svga->dispofftime < TIMER_USEC)
|
||||
svga->dispofftime = TIMER_USEC;
|
||||
|
||||
svga_recalc_remap_func(svga);
|
||||
if (!svga->force_old_addr)
|
||||
svga_recalc_remap_func(svga);
|
||||
|
||||
/* Inform the user interface of any DPMS mode changes. */
|
||||
if (svga->dpms) {
|
||||
@@ -1068,7 +1069,7 @@ svga_write_common(uint32_t addr, uint8_t val, uint8_t linear, void *p)
|
||||
addr <<= 4;
|
||||
else if ((svga->adv_flags & FLAG_ADDR_BY8) && (svga->writemode < 4))
|
||||
addr <<= 3;
|
||||
else if (((svga->chain4 && svga->packed_chain4) || svga->fb_only) && (svga->writemode < 4)) {
|
||||
else if (((svga->chain4 && (svga->packed_chain4 || svga->force_old_addr)) || svga->fb_only) && (svga->writemode < 4)) {
|
||||
writemask2 = 1 << (addr & 3);
|
||||
addr &= ~3;
|
||||
} else if (svga->chain4 && (svga->writemode < 4)) {
|
||||
@@ -1256,7 +1257,7 @@ svga_read_common(uint32_t addr, uint8_t linear, void *p)
|
||||
addr <<= 4;
|
||||
else if (svga->adv_flags & FLAG_ADDR_BY8)
|
||||
addr <<= 3;
|
||||
else if ((svga->chain4 && svga->packed_chain4) || svga->fb_only) {
|
||||
else if ((svga->chain4 && (svga->packed_chain4 || svga->force_old_addr)) || svga->fb_only) {
|
||||
addr &= svga->decode_mask;
|
||||
if (svga->translate_address)
|
||||
addr = svga->translate_address(addr, p);
|
||||
@@ -1266,7 +1267,7 @@ svga_read_common(uint32_t addr, uint8_t linear, void *p)
|
||||
for (i = 0; i < count; i++)
|
||||
svga->latch.b[i] = svga->vram[latch_addr | i];
|
||||
return svga->vram[addr & svga->vram_mask];
|
||||
} else if (svga->chain4) {
|
||||
} else if (svga->chain4 && !svga->force_old_addr) {
|
||||
readplane = addr & 3;
|
||||
addr = ((addr & 0xfffc) << 2) | ((addr & 0x30000) >> 14) | (addr & ~0x3ffff);
|
||||
} else if (svga->chain2_read) {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user