This commit is contained in:
RichardG867
2020-10-10 17:02:39 -03:00
16 changed files with 1352 additions and 703 deletions

View File

@@ -216,7 +216,7 @@ acpi_reg_read_intel(int size, uint16_t addr, void *p)
static uint32_t
acpi_reg_read_via(int size, uint16_t addr, void *p)
acpi_reg_read_via_common(int size, uint16_t addr, void *p)
{
acpi_t *dev = (acpi_t *) p;
uint32_t ret = 0x00000000;
@@ -279,6 +279,27 @@ acpi_reg_read_via(int size, uint16_t addr, void *p)
/* GP Timer Reload Enable */
ret = (dev->regs.gptren >> shift32) & 0xff;
break;
default:
ret = acpi_reg_read_common_regs(size, addr, p);
break;
}
acpi_log("(%i) ACPI Read (%i) %02X: %02X\n", in_smm, size, addr, ret);
return ret;
}
static uint32_t
acpi_reg_read_via(int size, uint16_t addr, void *p)
{
acpi_t *dev = (acpi_t *) p;
uint32_t ret = 0x00000000;
int shift16;
addr &= 0xff;
shift16 = (addr & 1) << 3;
switch (addr) {
case 0x40:
/* GPIO Direction Control */
if (size == 1)
@@ -303,7 +324,41 @@ acpi_reg_read_via(int size, uint16_t addr, void *p)
ret = (dev->regs.gpi_val >> shift16) & 0xff;
break;
default:
ret = acpi_reg_read_common_regs(size, addr, p);
ret = acpi_reg_read_via_common(size, addr, p);
break;
}
acpi_log("(%i) ACPI Read (%i) %02X: %02X\n", in_smm, size, addr, ret);
return ret;
}
static uint32_t
acpi_reg_read_via_596b(int size, uint16_t addr, void *p)
{
acpi_t *dev = (acpi_t *) p;
uint32_t ret = 0x00000000;
int shift16, shift32;
addr &= 0x7f;
shift16 = (addr & 1) << 3;
shift32 = (addr & 3) << 3;
switch (addr) {
case 0x44: case 0x45:
/* External SMI Input Value */
ret = (dev->regs.extsmi_val >> shift16) & 0xff;
break;
case 0x48: case 0x49: case 0x4a: case 0x4b:
/* GPI Port Input Value */
ret = (dev->regs.gpi_val >> shift32) & 0xff;
break;
case 0x4c: case 0x4d: case 0x4e: case 0x4f:
/* GPO Port Output Value */
ret = (dev->regs.gpi_val >> shift32) & 0xff;
break;
default:
ret = acpi_reg_read_via_common(size, addr, p);
break;
}
@@ -492,7 +547,7 @@ acpi_reg_write_intel(int size, uint16_t addr, uint8_t val, void *p)
static void
acpi_reg_write_via(int size, uint16_t addr, uint8_t val, void *p)
acpi_reg_write_via_common(int size, uint16_t addr, uint8_t val, void *p)
{
acpi_t *dev = (acpi_t *) p;
int shift16, shift32;
@@ -569,6 +624,32 @@ acpi_reg_write_via(int size, uint16_t addr, uint8_t val, void *p)
/* GP Timer Reload Enable */
dev->regs.gptren = ((dev->regs.gptren & ~(0xff << shift32)) | (val << shift32)) & 0x000000d9;
break;
default:
acpi_reg_write_common_regs(size, addr, val, p);
/* Setting GBL_RLS also sets BIOS_STS and generates SMI. */
if ((addr == 0x00) && !(dev->regs.pmsts & 0x20))
dev->regs.glbctl &= ~0x0002;
else if ((addr == 0x04) && (dev->regs.pmcntrl & 0x0004)) {
dev->regs.glbsts |= 0x20;
if (dev->regs.glben & 0x20)
acpi_raise_smi(dev);
}
break;
}
}
static void
acpi_reg_write_via(int size, uint16_t addr, uint8_t val, void *p)
{
acpi_t *dev = (acpi_t *) p;
int shift16;
addr &= 0xff;
acpi_log("(%i) ACPI Write (%i) %02X: %02X\n", in_smm, size, addr, val);
shift16 = (addr & 1) << 3;
switch (addr) {
case 0x40:
/* GPIO Direction Control */
if (size == 1)
@@ -584,15 +665,29 @@ acpi_reg_write_via(int size, uint16_t addr, uint8_t val, void *p)
dev->regs.gpo_val = ((dev->regs.gpo_val & ~(0xff << shift16)) | (val << shift16)) & 0xffff;
break;
default:
acpi_reg_write_common_regs(size, addr, val, p);
/* Setting GBL_RLS also sets BIOS_STS and generates SMI. */
if ((addr == 0x00) && !(dev->regs.pmsts & 0x20))
dev->regs.glbctl &= ~0x0002;
else if ((addr == 0x04) && (dev->regs.pmcntrl & 0x0004)) {
dev->regs.glbsts |= 0x20;
if (dev->regs.glben & 0x20)
acpi_raise_smi(dev);
}
acpi_reg_write_via_common(size, addr, val, p);
break;
}
}
static void
acpi_reg_write_via_596b(int size, uint16_t addr, uint8_t val, void *p)
{
acpi_t *dev = (acpi_t *) p;
int shift32;
addr &= 0x7f;
acpi_log("(%i) ACPI Write (%i) %02X: %02X\n", in_smm, size, addr, val);
shift32 = (addr & 3) << 3;
switch (addr) {
case 0x4c: case 0x4d: case 0x4e: case 0x4f:
/* GPO Port Output Value */
dev->regs.gpo_val = ((dev->regs.gpo_val & ~(0xff << shift32)) | (val << shift32)) & 0x7fffffff;
break;
default:
acpi_reg_write_via_common(size, addr, val, p);
break;
}
}
@@ -672,6 +767,8 @@ acpi_reg_read_common(int size, uint16_t addr, void *p)
if (dev->vendor == VEN_VIA)
ret = acpi_reg_read_via(size, addr, p);
else if (dev->vendor == VEN_VIA_596B)
ret = acpi_reg_read_via_596b(size, addr, p);
else if (dev->vendor == VEN_INTEL)
ret = acpi_reg_read_intel(size, addr, p);
else if (dev->vendor == VEN_SMC)
@@ -688,6 +785,8 @@ acpi_reg_write_common(int size, uint16_t addr, uint8_t val, void *p)
if (dev->vendor == VEN_VIA)
acpi_reg_write_via(size, addr, val, p);
else if (dev->vendor == VEN_VIA_596B)
acpi_reg_write_via_596b(size, addr, val, p);
else if (dev->vendor == VEN_INTEL)
acpi_reg_write_intel(size, addr, val, p);
else if (dev->vendor == VEN_SMC)
@@ -853,7 +952,23 @@ acpi_aux_reg_write(uint16_t addr, uint8_t val, void *p)
void
acpi_update_io_mapping(acpi_t *dev, uint32_t base, int chipset_en)
{
int size = (dev->vendor == VEN_SMC) ? 0x10 : 0x40;
int size;
switch (dev->vendor) {
case VEN_INTEL:
default:
size = 0x040;
break;
case VEN_SMC:
size = 0x010;
break;
case VEN_VIA:
size = 0x100;
break;
case VEN_VIA_596B:
size = 0x080;
break;
}
if (dev->io_base != 0x0000) {
io_removehandler(dev->io_base, size,
@@ -1022,6 +1137,8 @@ acpi_reset(void *priv)
dev->regs.gpireg[0] = dev->regs.gpireg[1] = dev->regs.gpireg[2] = 0xff;
for (i = 0; i < 4; i++)
dev->regs.gporeg[i] = dev->gporeg_default[i];
if (dev->vendor == VEN_VIA_596B)
dev->regs.gpo_val = 0x7fffffff;
}
@@ -1067,7 +1184,7 @@ acpi_init(const device_t *info)
timer_add(&dev->timer, acpi_timer_count, dev, 0);
timer_set_delay_u64(&dev->timer, ACPICONST);
dev->regs.gpireg[0] = dev->regs.gpireg[1] = dev->regs.gpireg[2] = 0xff;
acpi_reset(dev);
return dev;
}
@@ -1103,6 +1220,21 @@ const device_t acpi_via_device =
};
const device_t acpi_via_596b_device =
{
"VIA ACPI (VT82C596B)",
DEVICE_PCI,
VEN_VIA_596B,
acpi_init,
acpi_close,
acpi_reset,
NULL,
acpi_speed_changed,
NULL,
NULL
};
const device_t acpi_smc_device =
{
"SMC FDC73C931APM ACPI",

View File

@@ -42,30 +42,32 @@ extern "C" {
#define ACPI_ENABLE 0xf1
#define ACPI_DISABLE 0xf0
#define VEN_INTEL 0x8086
#define VEN_SMC 0x1055
#define VEN_VIA 0x1106
#define VEN_INTEL 0x08086
#define VEN_SMC 0x01055
#define VEN_VIA 0x01106
#define VEN_VIA_596B 0x11106
typedef struct
{
uint8_t plvl2, plvl3,
smicmd, gpio_dir,
gpio_val, extsmi_val,
gpio_val, pad,
timer32,
gpireg[3], gporeg[4];
uint16_t pmsts, pmen,
pmcntrl, gpsts,
gpen, gpscien,
gpsmien, pscntrl,
gpo_val, gpi_val,
gpscists;
int smi_lock, smi_active;
uint32_t pcntrl, glbsts,
devsts, glben,
glbctl, devctl,
padsts, paden,
gptren, timer_val;
gptren, timer_val,
gpo_val, gpi_val,
extsmi_val, pad0;
uint64_t tmr_overflow_time;
} acpi_regs_t;
@@ -88,6 +90,7 @@ typedef struct
extern const device_t acpi_intel_device;
extern const device_t acpi_smc_device;
extern const device_t acpi_via_device;
extern const device_t acpi_via_596b_device;
/* Functions. */

View File

@@ -374,6 +374,7 @@ extern int machine_at_i430vx_init(const machine_t *);
extern int machine_at_brio80xx_init(const machine_t *);
extern int machine_at_8500tvxa_init(const machine_t *);
extern int machine_at_presario4500_init(const machine_t *);
extern int machine_at_gw2kte_init(const machine_t *);
extern int machine_at_pb680_init(const machine_t *);
extern int machine_at_nupro592_init(const machine_t *);
@@ -387,6 +388,7 @@ extern int machine_at_ficva502_init(const machine_t *);
extern int machine_at_ficpa2012_init(const machine_t *);
#ifdef EMU_DEVICE_H
extern const device_t *at_thor_get_device(void);
extern const device_t *at_pb640_get_device(void);
#endif
@@ -460,6 +462,9 @@ extern const device_t europc_device;
/* m_oivetti_m24.c */
extern int machine_olim24_init(const machine_t *);
#ifdef EMU_DEVICE_H
extern const device_t *m24_get_device(void);
#endif
/* m_pcjr.c */
extern int machine_pcjr_init(const machine_t *);
@@ -504,6 +509,7 @@ extern int machine_tandy1000sl2_init(const machine_t *);
#ifdef EMU_DEVICE_H
extern const device_t *tandy1k_get_device(void);
extern const device_t *tandy1k_hx_get_device(void);
extern const device_t *tandy1k_sl_get_device(void);
#endif
/* m_xt.c */
@@ -529,7 +535,8 @@ extern int machine_xt_hed919_init(const machine_t *);
#endif
/* m_xt_compaq.c */
extern int machine_xt_compaq_init(const machine_t *);
extern int machine_xt_compaq_deskpro_init(const machine_t *);
extern int machine_xt_compaq_portable_init(const machine_t *);
/* m_xt_laserxt.c */
#if defined(DEV_BRANCH) && defined(USE_LASERXT)

View File

@@ -312,6 +312,8 @@ extern const device_t s3_phoenix_trio32_pci_device;
extern const device_t s3_phoenix_trio64_vlb_device;
extern const device_t s3_phoenix_trio64_onboard_pci_device;
extern const device_t s3_phoenix_trio64_pci_device;
extern const device_t s3_phoenix_trio64vplus_vlb_device;
extern const device_t s3_phoenix_trio64vplus_pci_device;
extern const device_t s3_phoenix_vision864_pci_device;
extern const device_t s3_phoenix_vision864_vlb_device;
extern const device_t s3_diamond_stealth64_pci_device;
@@ -329,7 +331,9 @@ extern const device_t s3_virge_375_vlb_device;
extern const device_t s3_virge_375_pci_device;
extern const device_t s3_virge_375_4_vlb_device;
extern const device_t s3_virge_375_4_pci_device;
#if defined(DEV_BRANCH) && defined(USE_S3TRIO3D2X)
extern const device_t s3_trio3d_2x_pci_device;
#endif
/* Sigma Color 400 */
extern const device_t sigma_device;
@@ -345,6 +349,7 @@ extern const device_t ibm_ps1_2121_device;
/* Trident TVGA 8900 */
extern const device_t tvga8900b_device;
extern const device_t tvga8900d_device;
extern const device_t tvga9000b_device;
/* IBM VGA */
extern const device_t vga_device;

View File

@@ -753,6 +753,40 @@ machine_at_pb680_init(const machine_t *model)
}
int
machine_at_gw2kte_init(const machine_t *model)
{
int ret;
ret = bios_load_linear_combined2(L"roms/machines/gw2kte/1008CY1T.BIO",
L"roms/machines/gw2kte/1008CY1T.BI1",
L"roms/machines/gw2kte/1008CY1T.BI2",
L"roms/machines/gw2kte/1008CY1T.BI3",
L"roms/machines/gw2kte/1008CY1T.RCV",
0x3a000, 128);
if (bios_only || !ret)
return ret;
machine_at_common_init(model);
pci_init(PCI_CONFIG_TYPE_1);
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
pci_register_slot(0x08, PCI_CARD_ONBOARD, 4, 0, 0, 0);
pci_register_slot(0x11, PCI_CARD_NORMAL, 1, 2, 3, 4);
pci_register_slot(0x13, PCI_CARD_NORMAL, 2, 3, 4, 1);
pci_register_slot(0x0B, PCI_CARD_NORMAL, 3, 4, 1, 2);
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
device_add(&i430vx_device);
device_add(&piix3_device);
device_add(&keyboard_ps2_ami_pci_device);
device_add(&pc87306_device);
device_add(&intel_flash_bxt_ami_device);
return ret;
}
int
machine_at_nupro592_init(const machine_t *model)
{

View File

@@ -818,6 +818,12 @@ const device_t m24_device = {
NULL
};
const device_t *
m24_get_device(void)
{
return &m24_device;
}
static void
kbd_reset(void *priv)

View File

@@ -1192,6 +1192,12 @@ tandy1k_hx_get_device(void)
return &vid_device_hx;
}
const device_t *
tandy1k_sl_get_device(void)
{
return &vid_device_sl;
}
static void
eep_write(uint16_t addr, uint8_t val, void *priv)

View File

@@ -37,9 +37,37 @@
#include <86box/lpt.h>
#include <86box/machine.h>
int
machine_xt_compaq_deskpro_init(const machine_t *model)
{
int ret;
ret = bios_load_linear(L"roms/machines/deskpro/Compaq - BIOS - Revision J - 106265-002.bin",
0x000fe000, 8192, 0);
if (bios_only || !ret)
return ret;
machine_common_init(model);
pit_ctr_set_out_func(&pit->counters[1], pit_refresh_timer_xt);
device_add(&keyboard_xt_compaq_device);
if (fdc_type == FDC_INTERNAL)
device_add(&fdc_xt_device);
nmi_init();
if (joystick_type != JOYSTICK_TYPE_NONE)
device_add(&gameport_device);
lpt1_remove();
lpt1_init(0x03bc);
return ret;
}
int
machine_xt_compaq_init(const machine_t *model)
machine_xt_compaq_portable_init(const machine_t *model)
{
int ret;

View File

@@ -97,7 +97,7 @@ const machine_t machines[] = {
{ "[8088] AMI XT clone", "amixt", MACHINE_TYPE_8088, {{"Intel", cpus_8088}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, MACHINE_ISA, 64, 640, 64, 0, machine_xt_amixt_init, NULL },
{ "[8088] Tandy 1000", "tandy", MACHINE_TYPE_8088, {{"Intel", cpus_europc}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, MACHINE_ISA | MACHINE_VIDEO | MACHINE_VIDEO_FIXED, 128, 640, 128, 0, machine_tandy_init, tandy1k_get_device },
{ "[8088] Tandy 1000 HX", "tandy1000hx", MACHINE_TYPE_8088, {{"Intel", cpus_europc}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, MACHINE_ISA | MACHINE_VIDEO | MACHINE_VIDEO_FIXED, 256, 640, 128, 0, machine_tandy1000hx_init, tandy1k_hx_get_device },
{ "[8088] Compaq Portable", "portable", MACHINE_TYPE_8088, {{"Intel", cpus_8088}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, MACHINE_ISA | MACHINE_VIDEO, 128, 640, 128, 0, machine_xt_compaq_init, NULL },
{ "[8088] Compaq Portable", "portable", MACHINE_TYPE_8088, {{"Intel", cpus_8088}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, MACHINE_ISA, 128, 640, 128, 0, machine_xt_compaq_portable_init, NULL },
{ "[8088] Generic XT clone", "genxt", MACHINE_TYPE_8088, {{"Intel", cpus_8088}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, MACHINE_ISA, 64, 640, 64, 0, machine_genxt_init, NULL },
{ "[8088] DTK XT clone", "dtk", MACHINE_TYPE_8088, {{"Intel", cpus_8088}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, MACHINE_ISA, 64, 640, 64, 0, machine_xt_dtk_init, NULL },
{ "[8088] Juko XT clone", "jukopc", MACHINE_TYPE_8088, {{"Intel", cpus_8088}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, MACHINE_ISA, 64, 640, 64, 0, machine_xt_jukopc_init, NULL },
@@ -118,9 +118,10 @@ const machine_t machines[] = {
{ "[8086] Amstrad PC3086", "pc3086", MACHINE_TYPE_8086, {{"Intel", cpus_8086}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, MACHINE_ISA | MACHINE_VIDEO | MACHINE_VIDEO_FIXED | MACHINE_MOUSE, 640, 640, 0, 63, machine_pc3086_init, pc3086_get_device },
{ "[8086] Amstrad PC20(0)", "pc200", MACHINE_TYPE_8086, {{"Intel", cpus_8086}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, MACHINE_ISA | MACHINE_VIDEO | MACHINE_MOUSE | MACHINE_NONMI, 512, 640, 128, 63, machine_pc200_init, pc200_get_device },
{ "[8086] Amstrad PPC512/640", "ppc512", MACHINE_TYPE_8086, {{"Intel", cpus_8086}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, MACHINE_ISA | MACHINE_VIDEO | MACHINE_MOUSE | MACHINE_NONMI, 512, 640, 128, 63, machine_ppc512_init, ppc512_get_device },
{ "[8086] Olivetti M24", "olivetti_m24", MACHINE_TYPE_8086, {{"Intel", cpus_8086}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, MACHINE_ISA | MACHINE_VIDEO | MACHINE_VIDEO_FIXED | MACHINE_MOUSE, 128, 640, 128, 0, machine_olim24_init, NULL },
{ "[8086] Compaq Deskpro", "deskpro", MACHINE_TYPE_8086, {{"Intel", cpus_8086}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, MACHINE_ISA, 128, 640, 128, 0, machine_xt_compaq_deskpro_init, NULL },
{ "[8086] Olivetti M24", "olivetti_m24", MACHINE_TYPE_8086, {{"Intel", cpus_8086}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, MACHINE_ISA | MACHINE_VIDEO | MACHINE_VIDEO_FIXED | MACHINE_MOUSE, 128, 640, 128, 0, machine_olim24_init, m24_get_device },
{ "[8086] Schetmash Iskra-3104", "iskra3104", MACHINE_TYPE_8086, {{"Intel", cpus_8086}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, MACHINE_ISA, 128, 640, 128, 0, machine_xt_iskra3104_init, NULL },
{ "[8086] Tandy 1000 SL/2", "tandy1000sl2", MACHINE_TYPE_8086, {{"Intel", cpus_8086}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, MACHINE_ISA | MACHINE_VIDEO | MACHINE_VIDEO_FIXED, 512, 768, 128, 0, machine_tandy1000sl2_init, NULL },
{ "[8086] Tandy 1000 SL/2", "tandy1000sl2", MACHINE_TYPE_8086, {{"Intel", cpus_8086}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, MACHINE_ISA | MACHINE_VIDEO | MACHINE_VIDEO_FIXED, 512, 768, 128, 0, machine_tandy1000sl2_init, tandy1k_sl_get_device },
{ "[8086] Toshiba T1200", "t1200", MACHINE_TYPE_8086, {{"Intel", cpus_8086}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, MACHINE_ISA | MACHINE_VIDEO, 1024, 2048,1024, 63, machine_xt_t1200_init, t1200_get_device },
#if defined(DEV_BRANCH) && defined(USE_LASERXT)
{ "[8086] VTech Laser XT3", "lxt3", MACHINE_TYPE_8086, {{"Intel", cpus_8086}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, MACHINE_ISA, 256, 640, 256, 0, machine_xt_lxt3_init, NULL },
@@ -284,8 +285,8 @@ const machine_t machines[] = {
/* 430FX */
{ "[i430FX] ASUS P/I-P54TP4XE", "p54tp4xe", MACHINE_TYPE_SOCKET7_3V, MACHINE_CPUS_PENTIUM_S73V, MACHINE_PCI | MACHINE_ISA | MACHINE_AT | MACHINE_PS2 | MACHINE_HDC, 8, 128, 8, 127, machine_at_p54tp4xe_init, NULL },
{ "[i430FX] ASUS P/I-P54TP4XE (MR BIOS)", "mr586", MACHINE_TYPE_SOCKET7_3V, MACHINE_CPUS_PENTIUM_S73V, MACHINE_PCI | MACHINE_ISA | MACHINE_AT | MACHINE_HDC | MACHINE_PS2, 8, 128, 8, 127, machine_at_mr586_init, NULL },
{ "[i430FX] Gateway 2000 P5-xxx", "gw2katx", MACHINE_TYPE_SOCKET7_3V, MACHINE_CPUS_PENTIUM_S73V, MACHINE_PCI | MACHINE_ISA | MACHINE_AT | MACHINE_PS2 | MACHINE_HDC, 8, 128, 8, 127, machine_at_gw2katx_init, NULL },
{ "[i430FX] Intel Advanced/ATX", "thor", MACHINE_TYPE_SOCKET7_3V, MACHINE_CPUS_PENTIUM_S73V, MACHINE_PCI | MACHINE_ISA | MACHINE_AT | MACHINE_PS2 | MACHINE_HDC, 8, 128, 8, 127, machine_at_thor_init, NULL },
{ "[i430FX] Gateway 2000 Thor", "gw2katx", MACHINE_TYPE_SOCKET7_3V, MACHINE_CPUS_PENTIUM_S73V, MACHINE_PCI | MACHINE_ISA | MACHINE_AT | MACHINE_PS2 | MACHINE_HDC, 8, 128, 8, 127, machine_at_gw2katx_init, NULL },
{ "[i430FX] Intel Advanced/ATX", "thor", MACHINE_TYPE_SOCKET7_3V, MACHINE_CPUS_PENTIUM_S73V, MACHINE_PCI | MACHINE_ISA | MACHINE_AT | MACHINE_PS2 | MACHINE_HDC | MACHINE_VIDEO, 8, 128, 8, 127, machine_at_thor_init, NULL },
{ "[i430FX] Intel Advanced/ATX (MR BIOS)", "mrthor", MACHINE_TYPE_SOCKET7_3V, MACHINE_CPUS_PENTIUM_S73V, MACHINE_PCI | MACHINE_ISA | MACHINE_AT | MACHINE_PS2 | MACHINE_HDC, 8, 128, 8, 127, machine_at_mrthor_init, NULL },
{ "[i430FX] Intel Advanced/EV", "endeavor", MACHINE_TYPE_SOCKET7_3V, MACHINE_CPUS_PENTIUM_S73V, MACHINE_PCI | MACHINE_ISA | MACHINE_AT | MACHINE_PS2 | MACHINE_HDC | MACHINE_VIDEO, 8, 128, 8, 127, machine_at_endeavor_init, at_endeavor_get_device },
{ "[i430FX] Packard Bell PB640", "pb640", MACHINE_TYPE_SOCKET7_3V, MACHINE_CPUS_PENTIUM_S73V, MACHINE_PCI | MACHINE_ISA | MACHINE_AT | MACHINE_PS2 | MACHINE_HDC | MACHINE_VIDEO, 8, 128, 8, 127, machine_at_pb640_init, at_pb640_get_device },
@@ -312,6 +313,7 @@ const machine_t machines[] = {
{ "[i430VX] HP Brio 80xx", "brio80xx", MACHINE_TYPE_SOCKET7, MACHINE_CPUS_PENTIUM_S7, MACHINE_PCI | MACHINE_ISA | MACHINE_AT | MACHINE_PS2 | MACHINE_HDC, 8, 128, 8, 127, machine_at_brio80xx_init, NULL },
{ "[i430VX] Biostar MB-8500TVX-A", "8500tvxa", MACHINE_TYPE_SOCKET7, MACHINE_CPUS_PENTIUM_S7, MACHINE_PCI | MACHINE_ISA | MACHINE_AT | MACHINE_PS2 | MACHINE_HDC, 8, 128, 8, 127, machine_at_8500tvxa_init, NULL },
{ "[i430VX] Compaq Presario 4500", "presario4500", MACHINE_TYPE_SOCKET7, MACHINE_CPUS_PENTIUM_S7, MACHINE_PCI | MACHINE_ISA | MACHINE_AT | MACHINE_PS2 | MACHINE_HDC | MACHINE_VIDEO, 8, 128, 8, 127, machine_at_presario4500_init, NULL },
{ "[i430VX] Gateway 2000 Tigereye", "gw2kte", MACHINE_TYPE_SOCKET7, MACHINE_CPUS_PENTIUM_S7, MACHINE_PCI | MACHINE_ISA | MACHINE_AT | MACHINE_PS2 | MACHINE_HDC, 8, 128, 8, 127, machine_at_gw2kte_init, NULL },
{ "[i430VX] Packard Bell PB680", "pb680", MACHINE_TYPE_SOCKET7, MACHINE_CPUS_PENTIUM_S7, MACHINE_PCI | MACHINE_ISA | MACHINE_AT | MACHINE_PS2 | MACHINE_HDC, 8, 128, 8, 127, machine_at_pb680_init, NULL },
/* 430TX */

View File

@@ -537,7 +537,12 @@ ega_poll(void *p)
ega->vc++;
ega->vc &= 1023;
if (ega->vc == ega->split) {
ega->ma = ega->maback = 0;
if (ega->interlace && ega->oddeven)
ega->ma = ega->maback = ega->ma_latch + (ega->rowoffset << 1);
else
ega->ma = ega->maback = ega->ma_latch;
ega->ma <<= 2;
ega->maback <<= 2;
ega->sc = 0;
if (ega->attrregs[0x10] & 0x20) {
ega->scrollcache = 0;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -741,7 +741,12 @@ svga_poll(void *p)
ret = svga->line_compare(svga);
if (ret) {
svga->ma = svga->maback = 0;
if (svga->interlace && svga->oddeven)
svga->ma = svga->maback = (svga->rowoffset << 1) + ((svga->crtc[5] & 0x60) >> 5);
else
svga->ma = svga->maback = ((svga->crtc[5] & 0x60) >> 5);
svga->ma = (svga->ma << 2);
svga->maback = (svga->maback << 2);
svga->sc = 0;
if (svga->attrregs[0x10] & 0x20) {
svga->scrollcache = 0;
@@ -805,7 +810,7 @@ svga_poll(void *p)
changeframecount = svga->interlace ? 3 : 2;
svga->vslines = 0;
if (svga->interlace && svga->oddeven)
if (svga->interlace && svga->oddeven)
svga->ma = svga->maback = svga->ma_latch + (svga->rowoffset << 1) + ((svga->crtc[5] & 0x60) >> 5);
else
svga->ma = svga->maback = svga->ma_latch + ((svga->crtc[5] & 0x60) >> 5);

View File

@@ -88,10 +88,11 @@ video_cards[] = {
{ "[ISA] Hercules Plus", "hercules_plus", &herculesplus_device },
{ "[ISA] Hercules InColor", "incolor", &incolor_device },
{ "[ISA] Image Manager 1024", "im1024", &im1024_device },
{ "[ISA] Schetmash Iskra EGA (Cyrillic ROM)", "iskra_ega", &iskra_ega_device },
{ "[ISA] Schetmash Iskra EGA (Cyrillic ROM)", "iskra_ega", &iskra_ega_device },
{ "[ISA] Kasan Hangulmadang-16 VGA (ET4000AX)", "kasan16vga", &et4000_kasan_isa_device },
{ "[ISA] MDA", "mda", &mda_device },
{ "[ISA] MDSI Genius", "genius", &genius_device },
{ "[ISA] Metheus Premier 928 (S3 86c928)", "metheus928_isa", &s3_metheus_86c928_isa_device },
{ "[ISA] OAK OTI-037C", "oti037c", &oti037c_device },
{ "[ISA] OAK OTI-067", "oti067", &oti067_device },
{ "[ISA] OAK OTI-077", "oti077", &oti077_device },
@@ -105,6 +106,7 @@ video_cards[] = {
{ "[ISA] SPEA V7 Mirage (S3 86c801)", "px_s3_v7_801_isa", &s3_v7mirage_86c801_isa_device },
{ "[ISA] Trident TVGA8900B", "tvga8900b", &tvga8900b_device },
{ "[ISA] Trident TVGA8900D", "tvga8900d", &tvga8900d_device },
{ "[ISA] Trident TVGA9000B", "tvga9000b", &tvga9000b_device },
{ "[ISA] Trigem Korean VGA (ET4000AX)", "tgkorvga", &et4000k_isa_device },
{ "[ISA] Tseng ET4000AX", "et4000ax", &et4000_isa_device },
{ "[ISA] VGA", "vga", &vga_device },
@@ -135,8 +137,11 @@ video_cards[] = {
{ "[PCI] Phoenix S3 Vision864", "px_vision864_pci", &s3_phoenix_vision864_pci_device },
{ "[PCI] Phoenix S3 Trio32", "px_trio32_pci", &s3_phoenix_trio32_pci_device },
{ "[PCI] Phoenix S3 Trio64", "px_trio64_pci", &s3_phoenix_trio64_pci_device },
{ "[PCI] Phoenix S3 Trio64V+", "px_trio64vplus_pci", &s3_phoenix_trio64vplus_pci_device },
#if defined(DEV_BRANCH) && defined(USE_S3TRIO3D2X)
{ "[PCI] S3 Trio3D/2X", "trio3d2x", &s3_trio3d_2x_pci_device },
{ "[PCI] S3 Trio64V2/DX", "trio64v2dx_pci", &s3_trio64v2_dx_pci_device },
#endif
{ "[PCI] S3 Trio64V2/DX", "trio64v2dx_pci", &s3_trio64v2_dx_pci_device },
{ "[PCI] S3 ViRGE/DX", "virge375_pci", &s3_virge_375_pci_device },
{ "[PCI] S3 ViRGE/DX (VBE 2.0)", "virge375_vbe20_pci", &s3_virge_375_4_pci_device },
{ "[PCI] STB Nitro 64V (CL-GD 5446)", "cl_gd5446_stb_pci", &gd5446_stb_pci_device },
@@ -156,12 +161,14 @@ video_cards[] = {
{ "[VLB] Diamond Stealth 3D 3000 (S3 ViRGE/VX)", "stealth3d_3000_vlb", &s3_virge_988_vlb_device },
{ "[VLB] Diamond Stealth 64 DRAM (S3 Trio64)", "stealth64d_vlb", &s3_diamond_stealth64_vlb_device },
{ "[VLB] Diamond Stealth 64 VRAM (S3 Vision964)", "stealth64v_vlb", &s3_diamond_stealth64_964_vlb_device },
{ "[VLB] Metheus Premier 928 (S3 86c928)", "metheus928_vlb", &s3_metheus_86c928_vlb_device },
{ "[VLB] Number Nine 9FX (S3 Trio64)", "n9_9fx_vlb", &s3_9fx_vlb_device },
{ "[VLB] Paradise Bahamas 64 (S3 Vision864)", "bahamas64_vlb", &s3_bahamas64_vlb_device },
{ "[VLB] Phoenix S3 86c805", "px_86c805_vlb", &s3_phoenix_86c805_vlb_device },
{ "[VLB] Phoenix S3 Vision864", "px_vision864_vlb", &s3_phoenix_vision864_vlb_device },
{ "[VLB] Phoenix S3 Trio32", "px_trio32_vlb", &s3_phoenix_trio32_vlb_device },
{ "[VLB] Phoenix S3 Trio64", "px_trio64_vlb", &s3_phoenix_trio64_vlb_device },
{ "[VLB] Phoenix S3 Trio64V+", "px_trio64vplus_vlb", &s3_phoenix_trio64vplus_vlb_device },
{ "[VLB] S3 ViRGE/DX", "virge375_vlb", &s3_virge_375_vlb_device },
{ "[VLB] S3 ViRGE/DX (VBE 2.0)", "virge375_vbe20_vlb", &s3_virge_375_4_vlb_device },
{ "[VLB] Trident TGUI9400CXi", "tgui9400cxi_vlb", &tgui9400cxi_device },

View File

@@ -32,10 +32,12 @@
#include <86box/vid_svga_render.h>
#define TVGA8900B_ID 0x03
#define TVGA9000B_ID 0x23
#define TVGA8900CLD_ID 0x33
#define ROM_TVGA_8900B L"roms/video/tvga/tvga8900B.VBI"
#define ROM_TVGA_8900CLD L"roms/video/tvga/trident.bin"
#define ROM_TVGA_9000B L"roms/video/tvga/tvga9000b.bin"
typedef struct tvga_t
{
@@ -56,7 +58,8 @@ typedef struct tvga_t
uint32_t vram_mask;
} tvga_t;
video_timings_t timing_tvga = {VIDEO_ISA, 3, 3, 6, 8, 8, 12};
video_timings_t timing_tvga8900 = {VIDEO_ISA, 3, 3, 6, 8, 8, 12};
video_timings_t timing_tvga9000 = {VIDEO_ISA, 7, 7, 12, 7, 7, 12};
static uint8_t crtc_mask[0x40] =
{
@@ -115,8 +118,11 @@ void tvga_out(uint16_t addr, uint8_t val, void *p)
break;
case 0x3C6: case 0x3C7: case 0x3C8: case 0x3C9:
tkd8001_ramdac_out(addr, val, svga->ramdac, svga);
return;
if (tvga->card_id != TVGA9000B_ID) {
tkd8001_ramdac_out(addr, val, svga->ramdac, svga);
return;
}
break;
case 0x3CF:
switch (svga->gdcaddr & 15)
@@ -143,35 +149,39 @@ void tvga_out(uint16_t addr, uint8_t val, void *p)
old = svga->crtc[svga->crtcreg];
val &= crtc_mask[svga->crtcreg];
svga->crtc[svga->crtcreg] = val;
if (old != val)
{
if (svga->crtcreg < 0xE || svga->crtcreg > 0x10)
{
if (old != val) {
if (svga->crtcreg < 0xE || svga->crtcreg > 0x10) {
svga->fullchange = changeframecount;
svga_recalctimings(svga);
}
}
switch (svga->crtcreg)
{
switch (svga->crtcreg) {
case 0x1e:
svga->vram_display_mask = (val & 0x80) ? tvga->vram_mask : 0x3ffff;
break;
}
return;
case 0x3D8:
if (svga->gdcreg[0xf] & 4)
{
if (svga->gdcreg[0xf] & 4) {
tvga->tvga_3d8 = val;
tvga_recalcbanking(tvga);
}
return;
case 0x3D9:
if (svga->gdcreg[0xf] & 4)
{
if (svga->gdcreg[0xf] & 4) {
tvga->tvga_3d9 = val;
tvga_recalcbanking(tvga);
}
return;
case 0x3DB:
if (tvga->card_id != TVGA9000B_ID) {
/*3db appears to be a 4 bit clock select register on 8900D*/
svga->miscout = (svga->miscout & ~0x0c) | ((val & 3) << 2);
tvga->newctrl2 = (tvga->newctrl2 & ~0x01) | ((val & 4) >> 2);
tvga->oldctrl1 = (tvga->oldctrl1 & ~0x10) | ((val & 8) << 1);
svga_recalctimings(svga);
}
break;
}
svga_out(addr, val, svga);
}
@@ -203,7 +213,10 @@ uint8_t tvga_in(uint16_t addr, void *p)
}
break;
case 0x3C6: case 0x3C7: case 0x3C8: case 0x3C9:
return tkd8001_ramdac_in(addr, svga->ramdac, svga);
if (tvga->card_id != TVGA9000B_ID) {
return tkd8001_ramdac_in(addr, svga->ramdac, svga);
}
break;
case 0x3D4:
return svga->crtcreg;
case 0x3D5:
@@ -233,6 +246,9 @@ static void tvga_recalcbanking(tvga_t *tvga)
void tvga_recalctimings(svga_t *svga)
{
tvga_t *tvga = (tvga_t *)svga->p;
int clksel;
int high_res_256 = 0;
if (!svga->rowoffset) svga->rowoffset = 0x100; /*This is the only sensible way I can see this being handled,
given that TVGA8900D has no overflow bits.
Some sort of overflow is required for 320x200x24 and 1024x768x16*/
@@ -264,18 +280,43 @@ void tvga_recalctimings(svga_t *svga)
if (svga->interlace)
svga->rowoffset >>= 1;
switch (((svga->miscout >> 2) & 3) | ((tvga->newctrl2 << 2) & 4))
{
case 2: svga->clock = (cpuclock * (double)(1ull << 32))/44900000.0; break;
case 3: svga->clock = (cpuclock * (double)(1ull << 32))/36000000.0; break;
case 4: svga->clock = (cpuclock * (double)(1ull << 32))/57272000.0; break;
case 5: svga->clock = (cpuclock * (double)(1ull << 32))/65000000.0; break;
case 6: svga->clock = (cpuclock * (double)(1ull << 32))/50350000.0; break;
case 7: svga->clock = (cpuclock * (double)(1ull << 32))/40000000.0; break;
if (tvga->card_id == TVGA8900CLD_ID)
clksel = ((svga->miscout >> 2) & 3) | ((tvga->newctrl2 & 0x01) << 2) | ((tvga->oldctrl1 & 0x10) >> 1);
else
clksel = ((svga->miscout >> 2) & 3) | ((tvga->newctrl2 & 0x01) << 2) | ((tvga->newctrl2 & 0x40) >> 3);
switch (clksel) {
case 0x2: svga->clock = (cpuclock * (double)(1ull << 32)) / 44900000.0; break;
case 0x3: svga->clock = (cpuclock * (double)(1ull << 32)) / 36000000.0; break;
case 0x4: svga->clock = (cpuclock * (double)(1ull << 32)) / 57272000.0; break;
case 0x5: svga->clock = (cpuclock * (double)(1ull << 32)) / 65000000.0; break;
case 0x6: svga->clock = (cpuclock * (double)(1ull << 32)) / 50350000.0; break;
case 0x7: svga->clock = (cpuclock * (double)(1ull << 32)) / 40000000.0; break;
case 0x8: svga->clock = (cpuclock * (double)(1ull << 32)) / 88000000.0; break;
case 0x9: svga->clock = (cpuclock * (double)(1ull << 32)) / 98000000.0; break;
case 0xa: svga->clock = (cpuclock * (double)(1ull << 32)) / 118800000.0; break;
case 0xb: svga->clock = (cpuclock * (double)(1ull << 32)) / 108000000.0; break;
case 0xc: svga->clock = (cpuclock * (double)(1ull << 32)) / 72000000.0; break;
case 0xd: svga->clock = (cpuclock * (double)(1ull << 32)) / 77000000.0; break;
case 0xe: svga->clock = (cpuclock * (double)(1ull << 32)) / 80000000.0; break;
case 0xf: svga->clock = (cpuclock * (double)(1ull << 32)) / 75000000.0; break;
}
if (tvga->oldctrl2 & 0x10)
if (tvga->card_id != TVGA8900CLD_ID) {
/*TVGA9000 doesn't seem to have support for a 'high res' 256 colour mode
(without the VGA pixel doubling). Instead it implements these modes by
doubling the horizontal pixel count and pixel clock. Hence we use a
basic heuristic to detect this*/
if (svga->interlace)
high_res_256 = (svga->htotal * 8) > (svga->vtotal * 4);
else
high_res_256 = (svga->htotal * 8) > (svga->vtotal * 2);
}
if ((tvga->oldctrl2 & 0x10) || high_res_256)
{
if (high_res_256)
svga->hdisp /= 2;
switch (svga->bpp)
{
case 8:
@@ -304,11 +345,16 @@ static void *tvga_init(const device_t *info)
const wchar_t *bios_fn;
tvga_t *tvga = malloc(sizeof(tvga_t));
memset(tvga, 0, sizeof(tvga_t));
video_inform(VIDEO_FLAG_TYPE_SPECIAL, &timing_tvga);
tvga->vram_size = device_get_config_int("memory") << 10;
tvga->vram_mask = tvga->vram_size - 1;
if (info->local == TVGA9000B_ID) {
video_inform(VIDEO_FLAG_TYPE_SPECIAL, &timing_tvga9000);
tvga->vram_size = 512 << 10;
} else {
video_inform(VIDEO_FLAG_TYPE_SPECIAL, &timing_tvga8900);
tvga->vram_size = device_get_config_int("memory") << 10;
}
tvga->vram_mask = tvga->vram_size - 1;
tvga->card_id = info->local;
@@ -320,6 +366,9 @@ static void *tvga_init(const device_t *info)
case TVGA8900CLD_ID:
bios_fn = ROM_TVGA_8900CLD;
break;
case TVGA9000B_ID:
bios_fn = ROM_TVGA_9000B;
break;
default:
free(tvga);
return NULL;
@@ -333,7 +382,8 @@ static void *tvga_init(const device_t *info)
NULL,
NULL);
tvga->svga.ramdac = device_add(&tkd8001_ramdac_device);
if (info->local != TVGA9000B_ID)
tvga->svga.ramdac = device_add(&tkd8001_ramdac_device);
io_sethandler(0x03c0, 0x0020, tvga_in, NULL, NULL, tvga_out, NULL, NULL, tvga);
@@ -350,6 +400,11 @@ static int tvga8900d_available(void)
return rom_present(ROM_TVGA_8900CLD);
}
static int tvga9000b_available(void)
{
return rom_present(ROM_TVGA_9000B);
}
void tvga_close(void *p)
{
tvga_t *tvga = (tvga_t *)p;
@@ -425,3 +480,17 @@ const device_t tvga8900d_device =
tvga_force_redraw,
tvga_config
};
const device_t tvga9000b_device =
{
"Trident TVGA 9000B",
DEVICE_ISA,
TVGA9000B_ID,
tvga_init,
tvga_close,
NULL,
tvga9000b_available,
tvga_speed_changed,
tvga_force_redraw,
NULL
};

View File

@@ -72,6 +72,9 @@ ifeq ($(DEV_BUILD), y)
ifndef VECTRA54
VECTRA54 := y
endif
ifndef S3TRIO3D2X
S3TRIO3D2X := y
endif
ifndef SIEMENS
SIEMENS := y
endif
@@ -151,6 +154,9 @@ else
ifndef VECTRA54
VECTRA54 := n
endif
ifndef S3TRIO3D2X
S3TRIO3D2X := n
endif
ifndef SIEMENS
SIEMENS := n
endif
@@ -550,6 +556,10 @@ ifeq ($(VECTRA54), y)
OPTS += -DUSE_VECTRA54
endif
ifeq ($(S3TRIO3D2X), y)
OPTS += -DUSE_S3TRIO3D2X
endif
ifeq ($(SIEMENS), y)
OPTS += -DUSE_SIEMENS
endif