Some fixes, Socket 7 3 V, and the on-board Vibra 16S.
This commit is contained in:
@@ -41,11 +41,43 @@
|
||||
#include <86box/fdc.h>
|
||||
#include <86box/nvr.h>
|
||||
#include <86box/plat_unused.h>
|
||||
#include <86box/sound.h>
|
||||
|
||||
static void
|
||||
machine_at_thor_gpio_init(void)
|
||||
{
|
||||
uint32_t gpio = 0xffffffff;
|
||||
|
||||
/* Register 0x0079: */
|
||||
/* Bit 7: 0 = Clear password, 1 = Keep password. */
|
||||
/* Bit 6: 0 = NVRAM cleared by jumper, 1 = NVRAM normal. */
|
||||
/* Bit 5: 0 = CMOS Setup disabled, 1 = CMOS Setup enabled. */
|
||||
/* Bit 4: External CPU clock (Switch 8). */
|
||||
/* Bit 3: External CPU clock (Switch 7). */
|
||||
/* 50 MHz: Switch 7 = Off, Switch 8 = Off. */
|
||||
/* 60 MHz: Switch 7 = On, Switch 8 = Off. */
|
||||
/* 66 MHz: Switch 7 = Off, Switch 8 = On. */
|
||||
/* Bit 2: 0 = On-board audio absent, 1 = On-board audio present. */
|
||||
/* Bit 1: 0 = Soft-off capable power supply present, 1 = Soft-off capable power supply absent. */
|
||||
/* Bit 0: 0 = Reserved. */
|
||||
/* NOTE: A bit is read as 1 if switch is off, and as 0 if switch is on. */
|
||||
gpio = 0xffffe1ff;
|
||||
|
||||
if (cpu_busspeed <= 50000000)
|
||||
gpio |= 0xffff10ff;
|
||||
else if ((cpu_busspeed > 50000000) && (cpu_busspeed <= 60000000))
|
||||
gpio |= 0xffff18ff;
|
||||
else if (cpu_busspeed > 60000000)
|
||||
gpio |= 0xffff00ff;
|
||||
|
||||
machine_set_gpio_default(gpio);
|
||||
}
|
||||
|
||||
static void
|
||||
machine_at_thor_common_init(const machine_t *model, UNUSED(int mr))
|
||||
{
|
||||
machine_at_common_init_ex(model, 2);
|
||||
machine_at_thor_gpio_init();
|
||||
|
||||
pci_init(PCI_CONFIG_TYPE_1);
|
||||
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
|
||||
@@ -196,6 +228,92 @@ machine_at_mrthor_init(const machine_t *model)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void
|
||||
machine_at_endeavor_gpio_init(void)
|
||||
{
|
||||
uint32_t gpio = 0xffffe0cf;
|
||||
uint16_t addr;
|
||||
|
||||
/* Register 0x0078: */
|
||||
/* Bit 5,4: Vibra 16S base address: 0 = 220h, 1 = 260h, 2 = 240h, 3 = 280h. */
|
||||
device_context(machine_get_snd_device(machine));
|
||||
addr = device_get_config_hex16("base");
|
||||
switch (addr) {
|
||||
case 0x0220:
|
||||
gpio |= 0xffff00cf;
|
||||
break;
|
||||
case 0x0240:
|
||||
gpio |= 0xffff00ef;
|
||||
break;
|
||||
case 0x0260:
|
||||
gpio |= 0xffff00df;
|
||||
break;
|
||||
case 0x0280:
|
||||
gpio |= 0xffff00ff;
|
||||
break;
|
||||
}
|
||||
device_context_restore();
|
||||
|
||||
/* Register 0x0079: */
|
||||
/* Bit 7: 0 = Clear password, 1 = Keep password. */
|
||||
/* Bit 6: 0 = NVRAM cleared by jumper, 1 = NVRAM normal. */
|
||||
/* Bit 5: 0 = CMOS Setup disabled, 1 = CMOS Setup enabled. */
|
||||
/* Bit 4: External CPU clock (Switch 8). */
|
||||
/* Bit 3: External CPU clock (Switch 7). */
|
||||
/* 50 MHz: Switch 7 = Off, Switch 8 = Off. */
|
||||
/* 60 MHz: Switch 7 = On, Switch 8 = Off. */
|
||||
/* 66 MHz: Switch 7 = Off, Switch 8 = On. */
|
||||
/* Bit 2: 0 = On-board audio absent, 1 = On-board audio present. */
|
||||
/* Bit 1: 0 = Soft-off capable power supply present, 1 = Soft-off capable power supply absent. */
|
||||
/* Bit 0: 0 = 2x multiplier, 1 = 1.5x multiplier (Switch 6). */
|
||||
/* NOTE: A bit is read as 1 if switch is off, and as 0 if switch is on. */
|
||||
if (cpu_busspeed <= 50000000)
|
||||
gpio |= 0xffff10cf;
|
||||
else if ((cpu_busspeed > 50000000) && (cpu_busspeed <= 60000000))
|
||||
gpio |= 0xffff18cf;
|
||||
else if (cpu_busspeed > 60000000)
|
||||
gpio |= 0xffff00cf;
|
||||
|
||||
if (sound_card_current[0] == SOUND_INTERNAL)
|
||||
gpio |= 0xffff04cf;
|
||||
|
||||
if (cpu_dmulti <= 1.5)
|
||||
gpio |= 0xffff01cf;
|
||||
else
|
||||
gpio |= 0xffff00cf;
|
||||
|
||||
machine_set_gpio_default(gpio);
|
||||
}
|
||||
|
||||
uint32_t
|
||||
machine_at_endeavor_gpio_handler(uint8_t write, uint32_t val)
|
||||
{
|
||||
uint32_t ret = machine_get_gpio_default();
|
||||
|
||||
if (write) {
|
||||
ret &= (val | 0xffff00ff);
|
||||
ret = (ret & 0xffffffcf) | (val & 0x0000ff30);
|
||||
if (machine_snd != NULL) switch ((val >> 4) & 0x03) {
|
||||
case 0x00:
|
||||
sb_vibra16s_onboard_relocate_base(0x0220, machine_snd);
|
||||
break;
|
||||
case 0x01:
|
||||
sb_vibra16s_onboard_relocate_base(0x0260, machine_snd);
|
||||
break;
|
||||
case 0x02:
|
||||
sb_vibra16s_onboard_relocate_base(0x0240, machine_snd);
|
||||
break;
|
||||
case 0x03:
|
||||
sb_vibra16s_onboard_relocate_base(0x0280, machine_snd);
|
||||
break;
|
||||
}
|
||||
machine_set_gpio(ret);
|
||||
} else
|
||||
ret = machine_get_gpio();
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
machine_at_endeavor_init(const machine_t *model)
|
||||
{
|
||||
@@ -209,6 +327,7 @@ machine_at_endeavor_init(const machine_t *model)
|
||||
return ret;
|
||||
|
||||
machine_at_common_init_ex(model, 2);
|
||||
machine_at_endeavor_gpio_init();
|
||||
|
||||
pci_init(PCI_CONFIG_TYPE_1);
|
||||
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
|
||||
@@ -220,7 +339,10 @@ machine_at_endeavor_init(const machine_t *model)
|
||||
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
|
||||
|
||||
if (gfxcard[0] == VID_INTERNAL)
|
||||
device_add(&s3_phoenix_trio64_onboard_pci_device);
|
||||
device_add(machine_get_vid_device(machine));
|
||||
|
||||
if (sound_card_current[0] == SOUND_INTERNAL)
|
||||
machine_snd = device_add(machine_get_snd_device(machine));
|
||||
|
||||
device_add(&keyboard_ps2_intel_ami_pci_device);
|
||||
device_add(&i430fx_device);
|
||||
@@ -260,6 +382,41 @@ machine_at_ms5119_init(const machine_t *model)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void
|
||||
machine_at_pb640_gpio_init(void)
|
||||
{
|
||||
uint32_t gpio = 0xffffffff;
|
||||
|
||||
/* Register 0x0079: */
|
||||
/* Bit 7: 0 = Clear password, 1 = Keep password. */
|
||||
/* Bit 6: 0 = NVRAM cleared by jumper, 1 = NVRAM normal. */
|
||||
/* Bit 5: 0 = CMOS Setup disabled, 1 = CMOS Setup enabled. */
|
||||
/* Bit 4: External CPU clock (Switch 8). */
|
||||
/* Bit 3: External CPU clock (Switch 7). */
|
||||
/* 50 MHz: Switch 7 = Off, Switch 8 = Off. */
|
||||
/* 60 MHz: Switch 7 = On, Switch 8 = Off. */
|
||||
/* 66 MHz: Switch 7 = Off, Switch 8 = On. */
|
||||
/* Bit 2: No Connect. */
|
||||
/* Bit 1: No Connect. */
|
||||
/* Bit 0: 2x multiplier, 1 = 1.5x multiplier (Switch 6). */
|
||||
/* NOTE: A bit is read as 1 if switch is off, and as 0 if switch is on. */
|
||||
gpio = 0xffffe6ff;
|
||||
|
||||
if (cpu_busspeed <= 50000000)
|
||||
gpio |= 0xffff10ff;
|
||||
else if ((cpu_busspeed > 50000000) && (cpu_busspeed <= 60000000))
|
||||
gpio |= 0xffff18ff;
|
||||
else if (cpu_busspeed > 60000000)
|
||||
gpio |= 0xffff00ff;
|
||||
|
||||
if (cpu_dmulti <= 1.5)
|
||||
gpio |= 0xffff01ff;
|
||||
else
|
||||
gpio |= 0xffff00ff;
|
||||
|
||||
machine_set_gpio_default(gpio);
|
||||
}
|
||||
|
||||
int
|
||||
machine_at_pb640_init(const machine_t *model)
|
||||
{
|
||||
@@ -272,6 +429,7 @@ machine_at_pb640_init(const machine_t *model)
|
||||
return ret;
|
||||
|
||||
machine_at_common_init_ex(model, 2);
|
||||
machine_at_pb640_gpio_init();
|
||||
|
||||
pci_init(PCI_CONFIG_TYPE_1);
|
||||
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
|
||||
|
||||
Reference in New Issue
Block a user