mirror of
https://github.com/86Box/86Box.git
synced 2026-03-04 11:48:23 -07:00
Merge branch 'master' into ich2-up
This commit is contained in:
@@ -2059,7 +2059,7 @@ kbd_write(uint16_t port, uint8_t val, void *priv)
|
||||
speaker_enable = val & 0x02;
|
||||
if (speaker_enable)
|
||||
was_speaker_enable = 1;
|
||||
pit_ctr_set_gate(&pit->counters[2], val & 0x01);
|
||||
pit_devs[0].set_gate(pit_devs[0].data, 2, val & 0x01);
|
||||
|
||||
if (val & 0x80) {
|
||||
/* Keyboard enabled, so enable PA reading. */
|
||||
|
||||
@@ -66,7 +66,7 @@ machine_at_common_init_ex(const machine_t *model, int type)
|
||||
machine_common_init(model);
|
||||
|
||||
refresh_at_enable = 1;
|
||||
pit_ctr_set_out_func(&pit->counters[1], pit_refresh_timer_at);
|
||||
pit_devs[0].set_out_func(pit_devs[0].data, 1, pit_refresh_timer_at);
|
||||
pic2_init();
|
||||
dma16_init();
|
||||
|
||||
|
||||
@@ -717,7 +717,6 @@ machine_at_m729_init(const machine_t *model)
|
||||
pci_register_slot(0x10, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
device_add(&ali1621_device);
|
||||
device_add(&ali1543c_device); /* +0 */
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&sst_flash_29ee010_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0x7, 512);
|
||||
|
||||
|
||||
@@ -1005,7 +1005,6 @@ machine_at_m560_init(const machine_t *model)
|
||||
pci_register_slot(0x06, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
device_add(&ali1531_device);
|
||||
device_add(&ali1543_device); /* -5 */
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&sst_flash_29ee010_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0x3, 256);
|
||||
|
||||
@@ -1040,7 +1039,6 @@ machine_at_ms5164_init(const machine_t *model)
|
||||
|
||||
device_add(&ali1531_device);
|
||||
device_add(&ali1543_device); /* -5 */
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&sst_flash_29ee010_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0x3, 256);
|
||||
|
||||
|
||||
@@ -73,7 +73,6 @@ machine_at_p5a_init(const machine_t *model)
|
||||
pci_register_slot(0x06, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
device_add(&ali1541_device);
|
||||
device_add(&ali1543c_device); /* +0 */
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&sst_flash_39sf020_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0x7, 512);
|
||||
device_add(&w83781d_p5a_device); /* fans: Chassis, CPU, Power; temperatures: MB, unused, CPU */
|
||||
@@ -107,7 +106,6 @@ machine_at_m579_init(const machine_t *model)
|
||||
pci_register_slot(0x14, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
device_add(&ali1541_device);
|
||||
device_add(&ali1543c_device); /* +0 */
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&sst_flash_29ee010_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0x7, 512);
|
||||
|
||||
@@ -140,7 +138,6 @@ machine_at_5aa_init(const machine_t *model)
|
||||
pci_register_slot(0x0A, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
device_add(&ali1541_device);
|
||||
device_add(&ali1543c_device); /* +0 */
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&sst_flash_29ee010_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0x7, 512);
|
||||
|
||||
@@ -175,7 +172,6 @@ machine_at_5ax_init(const machine_t *model)
|
||||
pci_register_slot(0x0C, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
device_add(&ali1541_device);
|
||||
device_add(&ali1543c_device); /* +0 */
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&sst_flash_29ee010_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0x7, 512);
|
||||
|
||||
|
||||
@@ -718,7 +718,7 @@ machine_europc_init(const machine_t *model)
|
||||
return ret;
|
||||
|
||||
machine_common_init(model);
|
||||
pit_ctr_set_out_func(&pit->counters[1], pit_refresh_timer_xt);
|
||||
pit_devs[0].set_out_func(pit_devs[0].data, 1, pit_refresh_timer_xt);
|
||||
|
||||
nmi_init();
|
||||
|
||||
|
||||
@@ -627,7 +627,7 @@ kbd_write(uint16_t port, uint8_t val, void *priv)
|
||||
speaker_enable = val & 2;
|
||||
if (speaker_enable)
|
||||
was_speaker_enable = 1;
|
||||
pit_ctr_set_gate(&pit->counters[2], val & 1);
|
||||
pit_devs[0].set_gate(pit_devs[0].data, 2, val & 1);
|
||||
sn76489_mute = speaker_mute = 1;
|
||||
switch (val & 0x60) {
|
||||
case 0x00:
|
||||
@@ -642,7 +642,7 @@ kbd_write(uint16_t port, uint8_t val, void *priv)
|
||||
|
||||
case 0xa0:
|
||||
nmi_mask = val & 0x80;
|
||||
pit_ctr_set_using_timer(&pit->counters[1], !(val & 0x20));
|
||||
pit_devs[0].set_using_timer(pit_devs[0].data, 1, !(val & 0x20));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -770,6 +770,18 @@ speed_changed(void *priv)
|
||||
recalc_timings(pcjr);
|
||||
}
|
||||
|
||||
void
|
||||
pit_irq0_timer_pcjr(int new_out, int old_out)
|
||||
{
|
||||
if (new_out && !old_out) {
|
||||
picint(1);
|
||||
pit_devs[0].ctr_clock(pit_devs[0].data, 1);
|
||||
}
|
||||
|
||||
if (!new_out)
|
||||
picintc(1);
|
||||
}
|
||||
|
||||
static const device_config_t pcjr_config[] = {
|
||||
{
|
||||
.name = "display_type",
|
||||
|
||||
@@ -327,7 +327,7 @@ ps1_common_init(const machine_t *model)
|
||||
machine_common_init(model);
|
||||
|
||||
refresh_at_enable = 1;
|
||||
pit_ctr_set_out_func(&pit->counters[1], pit_refresh_timer_at);
|
||||
pit_devs[0].set_out_func(pit_devs[0].data, 1, pit_refresh_timer_at);
|
||||
|
||||
dma16_init();
|
||||
pic2_init();
|
||||
|
||||
@@ -190,7 +190,7 @@ ps2_isa_common_init(const machine_t *model)
|
||||
machine_common_init(model);
|
||||
|
||||
refresh_at_enable = 1;
|
||||
pit_ctr_set_out_func(&pit->counters[1], pit_refresh_timer_at);
|
||||
pit_devs[0].set_out_func(pit_devs[0].data, 1, pit_refresh_timer_at);
|
||||
|
||||
dma16_init();
|
||||
pic2_init();
|
||||
|
||||
@@ -1363,7 +1363,8 @@ machine_ps2_common_init(const machine_t *model)
|
||||
device_add(&ps_no_nmi_nvr_device);
|
||||
pic2_init();
|
||||
|
||||
pit_ps2_init();
|
||||
int pit_type = ((pit_mode == -1 && is486) || pit_mode == 1) ? PIT_8254_FAST : PIT_8254;
|
||||
pit_ps2_init(pit_type);
|
||||
|
||||
nmi_mask = 0x80;
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ machine_xt_common_init(const machine_t *model)
|
||||
{
|
||||
machine_common_init(model);
|
||||
|
||||
pit_ctr_set_out_func(&pit->counters[1], pit_refresh_timer_xt);
|
||||
pit_devs[0].set_out_func(pit_devs[0].data, 1, pit_refresh_timer_xt);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
device_add(&fdc_xt_device);
|
||||
|
||||
@@ -50,7 +50,7 @@ machine_xt_compaq_deskpro_init(const machine_t *model)
|
||||
|
||||
machine_common_init(model);
|
||||
|
||||
pit_ctr_set_out_func(&pit->counters[1], pit_refresh_timer_xt);
|
||||
pit_devs[0].set_out_func(pit_devs[0].data, 1, pit_refresh_timer_xt);
|
||||
|
||||
device_add(&keyboard_xt_compaq_device);
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
@@ -78,7 +78,7 @@ machine_xt_compaq_portable_init(const machine_t *model)
|
||||
|
||||
machine_common_init(model);
|
||||
|
||||
pit_ctr_set_out_func(&pit->counters[1], pit_refresh_timer_xt);
|
||||
pit_devs[0].set_out_func(pit_devs[0].data, 1, pit_refresh_timer_xt);
|
||||
|
||||
device_add(&keyboard_xt_compaq_device);
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
|
||||
@@ -167,7 +167,7 @@ machine_xt_lxt3_init(const machine_t *model)
|
||||
|
||||
machine_common_init(model);
|
||||
|
||||
pit_ctr_set_out_func(&pit->counters[1], pit_refresh_timer_xt);
|
||||
pit_devs[0].set_out_func(pit_devs[0].data, 1, pit_refresh_timer_xt);
|
||||
|
||||
device_add(&keyboard_xt_lxt3_device);
|
||||
|
||||
|
||||
@@ -241,7 +241,7 @@ m24_kbd_write(uint16_t port, uint8_t val, void *priv)
|
||||
speaker_enable = val & 2;
|
||||
if (speaker_enable)
|
||||
was_speaker_enable = 1;
|
||||
pit_ctr_set_gate(&pit->counters[2], val & 1);
|
||||
pit_devs[0].set_gate(pit_devs[0].data, 2, val & 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -792,7 +792,7 @@ machine_xt_m240_init(const machine_t *model)
|
||||
|
||||
machine_common_init(model);
|
||||
|
||||
pit_ctr_set_out_func(&pit->counters[1], pit_refresh_timer_xt);
|
||||
pit_devs[0].set_out_func(pit_devs[0].data, 1, pit_refresh_timer_xt);
|
||||
|
||||
/* Address 66-67 = mainboard dip-switch settings */
|
||||
io_sethandler(0x0066, 2, m24_read, NULL, NULL, NULL, NULL, NULL, NULL);
|
||||
@@ -846,7 +846,7 @@ machine_xt_m19_init(const machine_t *model)
|
||||
|
||||
machine_common_init(model);
|
||||
|
||||
pit_ctr_set_out_func(&pit->counters[1], pit_refresh_timer_xt);
|
||||
pit_devs[0].set_out_func(pit_devs[0].data, 1, pit_refresh_timer_xt);
|
||||
|
||||
/* On-board FDC cannot be disabled */
|
||||
device_add(&fdc_xt_device);
|
||||
|
||||
@@ -152,7 +152,7 @@ machine_xt_philips_common_init(const machine_t *model)
|
||||
{
|
||||
machine_common_init(model);
|
||||
|
||||
pit_ctr_set_out_func(&pit->counters[1], pit_refresh_timer_xt);
|
||||
pit_devs[0].set_out_func(pit_devs[0].data, 1, pit_refresh_timer_xt);
|
||||
|
||||
nmi_init();
|
||||
|
||||
|
||||
@@ -911,7 +911,7 @@ machine_xt_t1000_init(const machine_t *model)
|
||||
|
||||
machine_common_init(model);
|
||||
|
||||
pit_ctr_set_out_func(&pit->counters[1], pit_refresh_timer_xt);
|
||||
pit_devs[0].set_out_func(pit_devs[0].data, 1, pit_refresh_timer_xt);
|
||||
device_add(&keyboard_xt_device);
|
||||
t1000.fdc = device_add(&fdc_xt_device);
|
||||
nmi_init();
|
||||
@@ -979,7 +979,7 @@ machine_xt_t1200_init(const machine_t *model)
|
||||
write_t1200_nvram, NULL, NULL,
|
||||
NULL, MEM_MAPPING_EXTERNAL, &t1000);
|
||||
|
||||
pit_ctr_set_out_func(&pit->counters[1], pit_refresh_timer_xt);
|
||||
pit_devs[0].set_out_func(pit_devs[0].data, 1, pit_refresh_timer_xt);
|
||||
device_add(&keyboard_xt_device);
|
||||
t1000.fdc = device_add(&fdc_xt_t1x00_device);
|
||||
nmi_init();
|
||||
|
||||
@@ -122,7 +122,7 @@ machine_zenith_init(const machine_t *model){
|
||||
|
||||
device_add(&zenith_scratchpad_device);
|
||||
|
||||
pit_ctr_set_out_func(&pit->counters[1], pit_refresh_timer_xt);
|
||||
pit_devs[0].set_out_func(pit_devs[0].data, 1, pit_refresh_timer_xt);
|
||||
|
||||
device_add(&keyboard_xt_zenith_device);
|
||||
|
||||
|
||||
@@ -161,6 +161,16 @@ machine_available(int m)
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
pit_irq0_timer(int new_out, int old_out)
|
||||
{
|
||||
if (new_out && !old_out)
|
||||
picint(1);
|
||||
|
||||
if (!new_out)
|
||||
picintc(1);
|
||||
}
|
||||
|
||||
void
|
||||
machine_common_init(const machine_t *model)
|
||||
{
|
||||
@@ -168,5 +178,10 @@ machine_common_init(const machine_t *model)
|
||||
pic_init();
|
||||
dma_init();
|
||||
|
||||
pit_common_init(!!IS_AT(machine), pit_irq0_timer, NULL);
|
||||
int pit_type = IS_AT(machine) ? PIT_8254 : PIT_8253;
|
||||
/* Select fast PIT if needed */
|
||||
if ((pit_mode == -1 && is486) || pit_mode == 1)
|
||||
pit_type += 2;
|
||||
|
||||
pit_common_init(pit_type, pit_irq0_timer, NULL);
|
||||
}
|
||||
|
||||
@@ -4723,7 +4723,7 @@ const machine_t machines[] = {
|
||||
.max_multi = 0
|
||||
},
|
||||
.bus_flags = MACHINE_PS2,
|
||||
.flags = MACHINE_IDE_DUAL | MACHINE_VIDEO,
|
||||
.flags = MACHINE_IDE_DUAL, /* No MACHINE_VIDEO yet, because on-board video is not yet implemented. */
|
||||
.ram = {
|
||||
.min = 1024,
|
||||
.max = 32768,
|
||||
@@ -4758,7 +4758,7 @@ const machine_t machines[] = {
|
||||
.max_multi = 0
|
||||
},
|
||||
.bus_flags = MACHINE_PS2,
|
||||
.flags = MACHINE_IDE_DUAL | MACHINE_VIDEO,
|
||||
.flags = MACHINE_IDE_DUAL,
|
||||
.ram = {
|
||||
.min = 1024,
|
||||
.max = 32768,
|
||||
|
||||
Reference in New Issue
Block a user