src/mame/drivers/mediagx.c
| r2376 | r2377 | |
| 119 | 119 | static UINT32 ad1847_sample_counter = 0; |
| 120 | 120 | static UINT32 ad1847_sample_rate; |
| 121 | 121 | |
| 122 | static struct { |
| 123 | const device_config *pit8254; |
| 124 | const device_config *pic8259_1; |
| 125 | const device_config *pic8259_2; |
| 126 | const device_config *dma8237_1; |
| 127 | const device_config *dma8237_2; |
| 128 | } mediagx_devices; |
| 122 | 129 | |
| 130 | |
| 123 | 131 | // Display controller registers |
| 124 | 132 | #define DC_UNLOCK 0x00/4 |
| 125 | 133 | #define DC_GENERAL_CFG 0x04/4 |
| r2376 | r2377 | |
| 468 | 476 | // 0x20 - 0x21, PIC |
| 469 | 477 | if (ACCESSING_BITS_0_15) |
| 470 | 478 | { |
| 471 | | r |= pic8259_32le_0_r(machine, offset, mem_mask); |
| 479 | r |= read32le_with_read8_device_handler( pic8259_r, (device_config*)mediagx_devices.pic8259_1, offset, mem_mask); |
| 472 | 480 | } |
| 473 | 481 | |
| 474 | 482 | // 0x22, 0x23, Cyrix configuration registers |
| r2376 | r2377 | |
| 488 | 496 | // 0x20 - 0x21, PIC |
| 489 | 497 | if (ACCESSING_BITS_0_15) |
| 490 | 498 | { |
| 491 | | pic8259_32le_0_w(machine, offset, data, mem_mask); |
| 499 | write32le_with_write8_device_handler( pic8259_w, (device_config*)mediagx_devices.pic8259_1, offset, data, mem_mask); |
| 492 | 500 | } |
| 493 | 501 | |
| 494 | 502 | // 0x22, 0x23, Cyrix configuration registers |
| r2376 | r2377 | |
| 839 | 847 | |
| 840 | 848 | DEV_READWRITE8TO32LE( mediagx_pit8254_32le, pit8253_r, pit8253_w ) |
| 841 | 849 | DEV_READWRITE8TO32LE( mediagx_dma8237_32le, dma8237_r, dma8237_w ) |
| 850 | DEV_READWRITE8TO32LE( mediagx_pic8259_32le, pic8259_r, pic8259_w ) |
| 842 | 851 | |
| 843 | 852 | |
| 844 | 853 | /*****************************************************************************/ |
| r2376 | r2377 | |
| 863 | 872 | AM_RANGE(0x0060, 0x006f) AM_READWRITE(kbdc8042_32le_r, kbdc8042_32le_w) |
| 864 | 873 | AM_RANGE(0x0070, 0x007f) AM_READWRITE(mc146818_port32le_r, mc146818_port32le_w) |
| 865 | 874 | AM_RANGE(0x0080, 0x009f) AM_READWRITE(at_page32_r, at_page32_w) |
| 866 | | AM_RANGE(0x00a0, 0x00af) AM_READWRITE(pic8259_32le_1_r, pic8259_32le_1_w) |
| 875 | AM_RANGE(0x00a0, 0x00af) AM_DEVREADWRITE(PIC8259, "pic8259_2", mediagx_pic8259_32le_r, mediagx_pic8259_32le_w) |
| 867 | 876 | AM_RANGE(0x00c0, 0x00cf) AM_DEVREADWRITE(DMA8237, "dma8237_2", at32_dma8237_2_r, at32_dma8237_2_w) |
| 868 | 877 | AM_RANGE(0x00e8, 0x00eb) AM_NOP // I/O delay port |
| 869 | 878 | AM_RANGE(0x01f0, 0x01f7) AM_READWRITE(ide0_r, ide0_w) |
| r2376 | r2377 | |
| 956 | 965 | static IRQ_CALLBACK(irq_callback) |
| 957 | 966 | { |
| 958 | 967 | int r; |
| 959 | | r = pic8259_acknowledge(1); |
| 968 | r = pic8259_acknowledge( mediagx_devices.pic8259_2); |
| 960 | 969 | if (r==0) |
| 961 | 970 | { |
| 962 | | r = pic8259_acknowledge(0); |
| 971 | r = pic8259_acknowledge( mediagx_devices.pic8259_1); |
| 963 | 972 | } |
| 964 | 973 | return r; |
| 965 | 974 | } |
| r2376 | r2377 | |
| 980 | 989 | |
| 981 | 990 | dmadac_enable(0, 2, 1); |
| 982 | 991 | ide_controller_reset(0); |
| 992 | |
| 993 | mediagx_devices.pit8254 = (device_config*)device_list_find_by_tag( machine->config->devicelist, PIT8254, "pit8254" ); |
| 994 | mediagx_devices.pic8259_1 = (device_config*)device_list_find_by_tag( machine->config->devicelist, PIC8259, "pic8259_1" ); |
| 995 | mediagx_devices.pic8259_2 = (device_config*)device_list_find_by_tag( machine->config->devicelist, PIC8259, "pic8259_2" ); |
| 996 | mediagx_devices.dma8237_1 = (device_config*)device_list_find_by_tag( machine->config->devicelist, DMA8237, "dma8237_1" ); |
| 997 | mediagx_devices.dma8237_2 = (device_config*)device_list_find_by_tag( machine->config->devicelist, DMA8237, "dma8237_2" ); |
| 983 | 998 | } |
| 984 | 999 | |
| 1000 | /************************************************************* |
| 1001 | * |
| 1002 | * pic8259 configuration |
| 1003 | * |
| 1004 | *************************************************************/ |
| 1005 | |
| 1006 | static PIC8259_SET_INT_LINE( mediagx_pic8259_1_set_int_line ) { |
| 1007 | cpunum_set_input_line(device->machine, 0, 0, interrupt ? HOLD_LINE : CLEAR_LINE); |
| 1008 | } |
| 1009 | |
| 1010 | |
| 1011 | static PIC8259_SET_INT_LINE( mediagx_pic8259_2_set_int_line ) { |
| 1012 | pic8259_set_irq_line( mediagx_devices.pic8259_1, 2, interrupt); |
| 1013 | } |
| 1014 | |
| 1015 | |
| 1016 | static const struct pic8259_interface mediagx_pic8259_1_config = { |
| 1017 | mediagx_pic8259_1_set_int_line |
| 1018 | }; |
| 1019 | |
| 1020 | |
| 1021 | static const struct pic8259_interface mediagx_pic8259_2_config = { |
| 1022 | mediagx_pic8259_2_set_int_line |
| 1023 | }; |
| 1024 | |
| 1025 | |
| 1026 | /************************************************************* |
| 1027 | * |
| 1028 | * pit8254 configuration |
| 1029 | * |
| 1030 | *************************************************************/ |
| 1031 | |
| 985 | 1032 | static PIT8253_OUTPUT_CHANGED( pc_timer0_w ) |
| 986 | 1033 | { |
| 987 | | pic8259_set_irq_line(0, 0, state); |
| 1034 | pic8259_set_irq_line( mediagx_devices.pic8259_1, 0, state); |
| 988 | 1035 | } |
| 989 | 1036 | |
| 990 | 1037 | |
| r2376 | r2377 | |
| 1026 | 1073 | MDRV_DEVICE_ADD( "dma8237_2", DMA8237 ) |
| 1027 | 1074 | MDRV_DEVICE_CONFIG( dma8237_2_config ) |
| 1028 | 1075 | |
| 1076 | MDRV_DEVICE_ADD( "pic8259_1", PIC8259 ) |
| 1077 | MDRV_DEVICE_CONFIG( mediagx_pic8259_1_config ) |
| 1078 | |
| 1079 | MDRV_DEVICE_ADD( "pic8259_2", PIC8259 ) |
| 1080 | MDRV_DEVICE_CONFIG( mediagx_pic8259_2_config ) |
| 1081 | |
| 1029 | 1082 | MDRV_NVRAM_HANDLER( mc146818 ) |
| 1030 | 1083 | |
| 1031 | 1084 | /* video hardware */ |
| r2376 | r2377 | |
| 1058 | 1111 | |
| 1059 | 1112 | static void keyboard_interrupt(int state) |
| 1060 | 1113 | { |
| 1061 | | pic8259_set_irq_line(0, 1, state); |
| 1114 | pic8259_set_irq_line(mediagx_devices.pic8259_1, 1, state); |
| 1062 | 1115 | } |
| 1063 | 1116 | |
| 1064 | 1117 | static void ide_interrupt(int state) |
| 1065 | 1118 | { |
| 1066 | | pic8259_set_irq_line(1, 6, state); |
| 1119 | pic8259_set_irq_line(mediagx_devices.pic8259_2, 6, state); |
| 1067 | 1120 | } |
| 1068 | 1121 | |
| 1069 | 1122 | static int mediagx_get_out2(running_machine *machine) { |
| 1070 | | return pit8253_get_output((device_config*)device_list_find_by_tag( machine->config->devicelist, PIT8254, "pit8254" ), 2 ); |
| 1123 | return pit8253_get_output( mediagx_devices.pit8254, 2 ); |
| 1071 | 1124 | } |
| 1072 | 1125 | |
| 1073 | 1126 | static const struct kbdc8042_interface at8042 = |
| r2376 | r2377 | |
| 1086 | 1139 | cx5510_pci_w |
| 1087 | 1140 | }; |
| 1088 | 1141 | |
| 1142 | static void mediagx_set_keyb_int(int state) { |
| 1143 | pic8259_set_irq_line(mediagx_devices.pic8259_1, 1, state); |
| 1144 | } |
| 1145 | |
| 1089 | 1146 | static void init_mediagx(running_machine *machine) |
| 1090 | 1147 | { |
| 1091 | | init_pc_common(PCCOMMON_KEYBOARD_AT); |
| 1148 | init_pc_common(PCCOMMON_KEYBOARD_AT,mediagx_set_keyb_int); |
| 1092 | 1149 | mc146818_init(MC146818_STANDARD); |
| 1093 | 1150 | |
| 1094 | 1151 | pci_init(); |
src/mame/drivers/taitowlf.c
| r2376 | r2377 | |
| 21 | 21 | static UINT32 *cga_ram; |
| 22 | 22 | static UINT32 *bios_ram; |
| 23 | 23 | |
| 24 | static struct { |
| 25 | const device_config *pit8254; |
| 26 | const device_config *pic8259_1; |
| 27 | const device_config *pic8259_2; |
| 28 | const device_config *dma8237_1; |
| 29 | const device_config *dma8237_2; |
| 30 | } taitowlf_devices; |
| 31 | |
| 32 | |
| 24 | 33 | static const rgb_t cga_palette[16] = |
| 25 | 34 | { |
| 26 | 35 | MAKE_RGB( 0x00, 0x00, 0x00 ), MAKE_RGB( 0x00, 0x00, 0xaa ), MAKE_RGB( 0x00, 0xaa, 0x00 ), MAKE_RGB( 0x00, 0xaa, 0xaa ), |
| r2376 | r2377 | |
| 419 | 428 | |
| 420 | 429 | DEV_READWRITE8TO32LE( taitowlf_pit8254_32le, pit8253_r, pit8253_w ) |
| 421 | 430 | DEV_READWRITE8TO32LE( taitowlf_dma8237_32le, dma8237_r, dma8237_w ) |
| 431 | DEV_READWRITE8TO32LE( taitowlf_pic8259_32le, pic8259_r, pic8259_w ) |
| 422 | 432 | |
| 423 | 433 | |
| 424 | 434 | /*****************************************************************************/ |
| r2376 | r2377 | |
| 436 | 446 | |
| 437 | 447 | static ADDRESS_MAP_START(taitowlf_io, ADDRESS_SPACE_IO, 32) |
| 438 | 448 | AM_RANGE(0x0000, 0x001f) AM_DEVREADWRITE(DMA8237, "dma8237_1", taitowlf_dma8237_32le_r, taitowlf_dma8237_32le_w) |
| 439 | | AM_RANGE(0x0020, 0x003f) AM_READWRITE(pic8259_32le_0_r, pic8259_32le_0_w) |
| 449 | AM_RANGE(0x0020, 0x003f) AM_DEVREADWRITE(PIC8259, "pic8259_1", taitowlf_pic8259_32le_r, taitowlf_pic8259_32le_w) |
| 440 | 450 | AM_RANGE(0x0040, 0x005f) AM_DEVREADWRITE(PIT8254, "pit8254", taitowlf_pit8254_32le_r, taitowlf_pit8254_32le_w) |
| 441 | 451 | AM_RANGE(0x0060, 0x006f) AM_READWRITE(kbdc8042_32le_r, kbdc8042_32le_w) |
| 442 | 452 | AM_RANGE(0x0070, 0x007f) AM_READWRITE(mc146818_port32le_r, mc146818_port32le_w) |
| 443 | 453 | AM_RANGE(0x0080, 0x009f) AM_READWRITE(at_page32_r, at_page32_w) |
| 444 | | AM_RANGE(0x00a0, 0x00bf) AM_READWRITE(pic8259_32le_1_r, pic8259_32le_1_w) |
| 454 | AM_RANGE(0x00a0, 0x00bf) AM_DEVREADWRITE(PIC8259, "pic8259_2", taitowlf_pic8259_32le_r, taitowlf_pic8259_32le_w) |
| 445 | 455 | AM_RANGE(0x00c0, 0x00df) AM_DEVREADWRITE(DMA8237, "dma8237_2", at32_dma8237_2_r, at32_dma8237_2_w) |
| 446 | 456 | AM_RANGE(0x00e8, 0x00eb) AM_NOP |
| 447 | 457 | AM_RANGE(0x01f0, 0x01f7) AM_READWRITE(ide0_r, ide0_w) |
| r2376 | r2377 | |
| 514 | 524 | static IRQ_CALLBACK(irq_callback) |
| 515 | 525 | { |
| 516 | 526 | int r = 0; |
| 517 | | r = pic8259_acknowledge(1); |
| 527 | r = pic8259_acknowledge( taitowlf_devices.pic8259_2); |
| 518 | 528 | if (r==0) |
| 519 | 529 | { |
| 520 | | r = pic8259_acknowledge(0); |
| 530 | r = pic8259_acknowledge( taitowlf_devices.pic8259_1); |
| 521 | 531 | } |
| 522 | 532 | return r; |
| 523 | 533 | } |
| r2376 | r2377 | |
| 527 | 537 | memory_set_bankptr(1, memory_region(REGION_USER1) + 0x30000); |
| 528 | 538 | |
| 529 | 539 | cpunum_set_irq_callback(0, irq_callback); |
| 540 | |
| 541 | taitowlf_devices.pit8254 = (device_config*)device_list_find_by_tag( machine->config->devicelist, PIT8254, "pit8254" ); |
| 542 | taitowlf_devices.pic8259_1 = (device_config*)device_list_find_by_tag( machine->config->devicelist, PIC8259, "pic8259_1" ); |
| 543 | taitowlf_devices.pic8259_2 = (device_config*)device_list_find_by_tag( machine->config->devicelist, PIC8259, "pic8259_2" ); |
| 544 | taitowlf_devices.dma8237_1 = (device_config*)device_list_find_by_tag( machine->config->devicelist, DMA8237, "dma8237_1" ); |
| 545 | taitowlf_devices.dma8237_2 = (device_config*)device_list_find_by_tag( machine->config->devicelist, DMA8237, "dma8237_2" ); |
| 530 | 546 | } |
| 531 | 547 | |
| 548 | |
| 549 | /************************************************************* |
| 550 | * |
| 551 | * pic8259 configuration |
| 552 | * |
| 553 | *************************************************************/ |
| 554 | |
| 555 | static PIC8259_SET_INT_LINE( taitowlf_pic8259_1_set_int_line ) { |
| 556 | cpunum_set_input_line(device->machine, 0, 0, interrupt ? HOLD_LINE : CLEAR_LINE); |
| 557 | } |
| 558 | |
| 559 | |
| 560 | static PIC8259_SET_INT_LINE( taitowlf_pic8259_2_set_int_line ) { |
| 561 | pic8259_set_irq_line( taitowlf_devices.pic8259_1, 2, interrupt); |
| 562 | } |
| 563 | |
| 564 | |
| 565 | static const struct pic8259_interface taitowlf_pic8259_1_config = { |
| 566 | taitowlf_pic8259_1_set_int_line |
| 567 | }; |
| 568 | |
| 569 | |
| 570 | static const struct pic8259_interface taitowlf_pic8259_2_config = { |
| 571 | taitowlf_pic8259_2_set_int_line |
| 572 | }; |
| 573 | |
| 574 | |
| 575 | /************************************************************* |
| 576 | * |
| 577 | * pit8254 configuration |
| 578 | * |
| 579 | *************************************************************/ |
| 580 | |
| 532 | 581 | static PIT8253_OUTPUT_CHANGED( pc_timer0_w ) |
| 533 | 582 | { |
| 534 | | pic8259_set_irq_line(0, 0, state); |
| 583 | pic8259_set_irq_line(taitowlf_devices.pic8259_1, 0, state); |
| 535 | 584 | } |
| 536 | 585 | |
| 537 | 586 | static const struct pit8253_config taitowlf_pit8254_config = |
| r2376 | r2377 | |
| 571 | 620 | MDRV_DEVICE_ADD( "dma8237_2", DMA8237 ) |
| 572 | 621 | MDRV_DEVICE_CONFIG( dma8237_2_config ) |
| 573 | 622 | |
| 623 | MDRV_DEVICE_ADD( "pic8259_1", PIC8259 ) |
| 624 | MDRV_DEVICE_CONFIG( taitowlf_pic8259_1_config ) |
| 625 | |
| 626 | MDRV_DEVICE_ADD( "pic8259_2", PIC8259 ) |
| 627 | MDRV_DEVICE_CONFIG( taitowlf_pic8259_2_config ) |
| 628 | |
| 574 | 629 | MDRV_NVRAM_HANDLER( mc146818 ) |
| 575 | 630 | |
| 576 | 631 | /* video hardware */ |
| r2376 | r2377 | |
| 608 | 663 | |
| 609 | 664 | static void keyboard_interrupt(int state) |
| 610 | 665 | { |
| 611 | | pic8259_set_irq_line(0, 1, state); |
| 666 | pic8259_set_irq_line(taitowlf_devices.pic8259_1, 1, state); |
| 612 | 667 | } |
| 613 | 668 | |
| 614 | 669 | static void ide_interrupt(int state) |
| 615 | 670 | { |
| 616 | | pic8259_set_irq_line(1, 6, state); |
| 671 | pic8259_set_irq_line(taitowlf_devices.pic8259_2, 6, state); |
| 617 | 672 | } |
| 618 | 673 | |
| 619 | 674 | static int taitowlf_get_out2(running_machine *machine) { |
| 620 | | return pit8253_get_output((device_config*)device_list_find_by_tag( machine->config->devicelist, PIT8254, "pit8254" ), 2 ); |
| 675 | return pit8253_get_output(taitowlf_devices.pit8254, 2 ); |
| 621 | 676 | } |
| 622 | 677 | |
| 623 | 678 | static const struct kbdc8042_interface at8042 = |
| r2376 | r2377 | |
| 630 | 685 | ide_interrupt |
| 631 | 686 | }; |
| 632 | 687 | |
| 688 | static void taitowlf_set_keyb_int(int state) { |
| 689 | pic8259_set_irq_line(taitowlf_devices.pic8259_1, 1, state); |
| 690 | } |
| 691 | |
| 633 | 692 | static DRIVER_INIT( taitowlf ) |
| 634 | 693 | { |
| 635 | 694 | bios_ram = auto_malloc(0x10000); |
| 636 | 695 | |
| 637 | | init_pc_common(PCCOMMON_KEYBOARD_AT); |
| 696 | init_pc_common(PCCOMMON_KEYBOARD_AT, taitowlf_set_keyb_int); |
| 638 | 697 | mc146818_init(MC146818_STANDARD); |
| 639 | 698 | |
| 640 | 699 | intel82439tx_init(); |
src/mame/drivers/gamecstl.c
| r2376 | r2377 | |
| 56 | 56 | static UINT32 *cga_ram; |
| 57 | 57 | static UINT32 *bios_ram; |
| 58 | 58 | |
| 59 | static struct { |
| 60 | const device_config *pit8254; |
| 61 | const device_config *pic8259_1; |
| 62 | const device_config *pic8259_2; |
| 63 | const device_config *dma8237_1; |
| 64 | const device_config *dma8237_2; |
| 65 | } gamecstl_devices; |
| 66 | |
| 67 | |
| 59 | 68 | static const rgb_t cga_palette[16] = |
| 60 | 69 | { |
| 61 | 70 | MAKE_RGB( 0x00, 0x00, 0x00 ), MAKE_RGB( 0x00, 0x00, 0xaa ), MAKE_RGB( 0x00, 0xaa, 0x00 ), MAKE_RGB( 0x00, 0xaa, 0xaa ), |
| r2376 | r2377 | |
| 453 | 462 | |
| 454 | 463 | DEV_READWRITE8TO32LE( gamecstl_pit8254_32le, pit8253_r, pit8253_w ) |
| 455 | 464 | DEV_READWRITE8TO32LE( gamecstl_dma8237_32le, dma8237_r, dma8237_w ) |
| 465 | DEV_READWRITE8TO32LE( gamecstl_pic8259_32le, pic8259_r, pic8259_w ) |
| 456 | 466 | |
| 457 | 467 | |
| 458 | 468 | /*****************************************************************************/ |
| r2376 | r2377 | |
| 470 | 480 | |
| 471 | 481 | static ADDRESS_MAP_START(gamecstl_io, ADDRESS_SPACE_IO, 32) |
| 472 | 482 | AM_RANGE(0x0000, 0x001f) AM_DEVREADWRITE(DMA8237, "dma8237_1", gamecstl_dma8237_32le_r, gamecstl_dma8237_32le_w) |
| 473 | | AM_RANGE(0x0020, 0x003f) AM_READWRITE(pic8259_32le_0_r, pic8259_32le_0_w) |
| 483 | AM_RANGE(0x0020, 0x003f) AM_DEVREADWRITE(PIC8259, "pic8259_1", gamecstl_pic8259_32le_r, gamecstl_pic8259_32le_w) |
| 474 | 484 | AM_RANGE(0x0040, 0x005f) AM_DEVREADWRITE(PIT8254, "pit8254", gamecstl_pit8254_32le_r, gamecstl_pit8254_32le_w) |
| 475 | 485 | AM_RANGE(0x0060, 0x006f) AM_READWRITE(kbdc8042_32le_r, kbdc8042_32le_w) |
| 476 | 486 | AM_RANGE(0x0070, 0x007f) AM_READWRITE(mc146818_port32le_r, mc146818_port32le_w) |
| 477 | 487 | AM_RANGE(0x0080, 0x009f) AM_READWRITE(at_page32_r, at_page32_w) |
| 478 | | AM_RANGE(0x00a0, 0x00bf) AM_READWRITE(pic8259_32le_1_r, pic8259_32le_1_w) |
| 488 | AM_RANGE(0x00a0, 0x00bf) AM_DEVREADWRITE(PIC8259, "pic8259_2", gamecstl_pic8259_32le_r, gamecstl_pic8259_32le_w) |
| 479 | 489 | AM_RANGE(0x00c0, 0x00df) AM_DEVREADWRITE(DMA8237, "dma8237_2", at32_dma8237_2_r, at32_dma8237_2_w) |
| 480 | 490 | AM_RANGE(0x00e8, 0x00eb) AM_NOP |
| 481 | 491 | AM_RANGE(0x01f0, 0x01f7) AM_READWRITE(ide0_r, ide0_w) |
| r2376 | r2377 | |
| 548 | 558 | static IRQ_CALLBACK(irq_callback) |
| 549 | 559 | { |
| 550 | 560 | int r = 0; |
| 551 | | r = pic8259_acknowledge(1); |
| 561 | r = pic8259_acknowledge(gamecstl_devices.pic8259_2); |
| 552 | 562 | if (r==0) |
| 553 | 563 | { |
| 554 | | r = pic8259_acknowledge(0); |
| 564 | r = pic8259_acknowledge(gamecstl_devices.pic8259_1); |
| 555 | 565 | } |
| 556 | 566 | return r; |
| 557 | 567 | } |
| r2376 | r2377 | |
| 561 | 571 | memory_set_bankptr(1, memory_region(REGION_USER1) + 0x30000); |
| 562 | 572 | |
| 563 | 573 | cpunum_set_irq_callback(0, irq_callback); |
| 574 | |
| 575 | gamecstl_devices.pit8254 = (device_config*)device_list_find_by_tag( machine->config->devicelist, PIT8254, "pit8254" ); |
| 576 | gamecstl_devices.pic8259_1 = (device_config*)device_list_find_by_tag( machine->config->devicelist, PIC8259, "pic8259_1" ); |
| 577 | gamecstl_devices.pic8259_2 = (device_config*)device_list_find_by_tag( machine->config->devicelist, PIC8259, "pic8259_2" ); |
| 578 | gamecstl_devices.dma8237_1 = (device_config*)device_list_find_by_tag( machine->config->devicelist, DMA8237, "dma8237_1" ); |
| 579 | gamecstl_devices.dma8237_2 = (device_config*)device_list_find_by_tag( machine->config->devicelist, DMA8237, "dma8237_2" ); |
| 564 | 580 | } |
| 565 | 581 | |
| 582 | |
| 583 | /************************************************************* |
| 584 | * |
| 585 | * pic8259 configuration |
| 586 | * |
| 587 | *************************************************************/ |
| 588 | |
| 589 | static PIC8259_SET_INT_LINE( gamecstl_pic8259_1_set_int_line ) { |
| 590 | cpunum_set_input_line(device->machine, 0, 0, interrupt ? HOLD_LINE : CLEAR_LINE); |
| 591 | } |
| 592 | |
| 593 | |
| 594 | static PIC8259_SET_INT_LINE( gamecstl_pic8259_2_set_int_line ) { |
| 595 | pic8259_set_irq_line( gamecstl_devices.pic8259_1, 2, interrupt); |
| 596 | } |
| 597 | |
| 598 | |
| 599 | static const struct pic8259_interface gamecstl_pic8259_1_config = { |
| 600 | gamecstl_pic8259_1_set_int_line |
| 601 | }; |
| 602 | |
| 603 | |
| 604 | static const struct pic8259_interface gamecstl_pic8259_2_config = { |
| 605 | gamecstl_pic8259_2_set_int_line |
| 606 | }; |
| 607 | |
| 608 | |
| 609 | /************************************************************* |
| 610 | * |
| 611 | * pit8254 configuration |
| 612 | * |
| 613 | *************************************************************/ |
| 614 | |
| 566 | 615 | static PIT8253_OUTPUT_CHANGED( pc_timer0_w ) |
| 567 | 616 | { |
| 568 | | pic8259_set_irq_line(0, 0, state); |
| 617 | pic8259_set_irq_line(gamecstl_devices.pic8259_1, 0, state); |
| 569 | 618 | } |
| 570 | 619 | |
| 571 | 620 | static const struct pit8253_config gamecstl_pit8254_config = |
| r2376 | r2377 | |
| 605 | 654 | MDRV_DEVICE_ADD( "dma8237_2", DMA8237 ) |
| 606 | 655 | MDRV_DEVICE_CONFIG( dma8237_2_config ) |
| 607 | 656 | |
| 657 | MDRV_DEVICE_ADD( "pic8259_1", PIC8259 ) |
| 658 | MDRV_DEVICE_CONFIG( gamecstl_pic8259_1_config ) |
| 659 | |
| 660 | MDRV_DEVICE_ADD( "pic8259_2", PIC8259 ) |
| 661 | MDRV_DEVICE_CONFIG( gamecstl_pic8259_2_config ) |
| 662 | |
| 608 | 663 | MDRV_NVRAM_HANDLER( mc146818 ) |
| 609 | 664 | |
| 610 | 665 | /* video hardware */ |
| r2376 | r2377 | |
| 642 | 697 | |
| 643 | 698 | static void keyboard_interrupt(int state) |
| 644 | 699 | { |
| 645 | | pic8259_set_irq_line(0, 1, state); |
| 700 | pic8259_set_irq_line( gamecstl_devices.pic8259_1, 1, state); |
| 646 | 701 | } |
| 647 | 702 | |
| 648 | 703 | static void ide_interrupt(int state) |
| 649 | 704 | { |
| 650 | | pic8259_set_irq_line(1, 6, state); |
| 705 | pic8259_set_irq_line( gamecstl_devices.pic8259_2, 6, state); |
| 651 | 706 | } |
| 652 | 707 | |
| 653 | 708 | static int gamecstl_get_out2(running_machine *machine) { |
| 654 | | return pit8253_get_output((device_config*)device_list_find_by_tag( machine->config->devicelist, PIT8254, "pit8254" ), 2 ); |
| 709 | return pit8253_get_output( gamecstl_devices.pit8254, 2 ); |
| 655 | 710 | } |
| 656 | 711 | |
| 657 | 712 | static const struct kbdc8042_interface at8042 = |
| r2376 | r2377 | |
| 664 | 719 | ide_interrupt |
| 665 | 720 | }; |
| 666 | 721 | |
| 722 | static void gamecstl_set_keyb_int(int state) { |
| 723 | pic8259_set_irq_line(gamecstl_devices.pic8259_1, 1, state); |
| 724 | } |
| 725 | |
| 667 | 726 | static DRIVER_INIT( gamecstl ) |
| 668 | 727 | { |
| 669 | 728 | bios_ram = auto_malloc(0x10000); |
| 670 | 729 | |
| 671 | | init_pc_common(PCCOMMON_KEYBOARD_AT); |
| 730 | init_pc_common(PCCOMMON_KEYBOARD_AT, gamecstl_set_keyb_int); |
| 672 | 731 | mc146818_init(MC146818_STANDARD); |
| 673 | 732 | |
| 674 | 733 | intel82439tx_init(); |
src/emu/machine/pic8259.c
| r2376 | r2377 | |
| 30 | 30 | STATE_READY |
| 31 | 31 | } pic8259_state_t; |
| 32 | 32 | |
| 33 | typedef struct pic8259 pic8259_t; |
| 34 | |
| 33 | 35 | struct pic8259 |
| 34 | 36 | { |
| 37 | const struct pic8259_interface *intf; |
| 38 | |
| 35 | 39 | emu_timer *timer; |
| 36 | | void (*set_int_line)(int which, int interrupt); |
| 37 | 40 | |
| 38 | 41 | pic8259_state_t state; |
| 39 | 42 | |
| r2376 | r2377 | |
| 65 | 68 | UINT32 is_x86 : 1; |
| 66 | 69 | }; |
| 67 | 70 | |
| 68 | | static struct pic8259 *pic; |
| 69 | 71 | |
| 70 | | static TIMER_CALLBACK( pic8259_timerproc ); |
| 71 | | |
| 72 | | |
| 73 | | /* initializer */ |
| 74 | | int pic8259_init(int count, void (*set_int_line)(int which, int interrupt)) |
| 75 | | { |
| 76 | | int i; |
| 77 | | |
| 78 | | /* allocate pic structures */ |
| 79 | | pic = auto_malloc(count * sizeof(struct pic8259)); |
| 80 | | memset(pic, 0, count * sizeof(struct pic8259)); |
| 81 | | |
| 82 | | for (i = 0; i < count; i++) |
| 83 | | { |
| 84 | | pic[i].timer = timer_alloc(pic8259_timerproc, NULL); |
| 85 | | pic[i].set_int_line = set_int_line; |
| 86 | | } |
| 87 | | |
| 88 | | return 0; |
| 72 | INLINE pic8259_t *get_safe_token(const device_config *device) { |
| 73 | assert( device != NULL ); |
| 74 | assert( device->token != NULL ); |
| 75 | assert( device->type == DEVICE_GET_INFO_NAME(pic8259) ); |
| 76 | return ( pic8259_t *) device->token; |
| 89 | 77 | } |
| 90 | 78 | |
| 91 | 79 | |
| 92 | | |
| 93 | 80 | static TIMER_CALLBACK( pic8259_timerproc ) |
| 94 | 81 | { |
| 95 | | int which = param; |
| 96 | | struct pic8259 *p = &pic[which]; |
| 82 | const device_config *device = ptr; |
| 83 | pic8259_t *pic8259 = get_safe_token(device); |
| 97 | 84 | int irq; |
| 98 | 85 | UINT8 mask; |
| 99 | 86 | |
| r2376 | r2377 | |
| 103 | 90 | mask = 1 << irq; |
| 104 | 91 | |
| 105 | 92 | /* is this IRQ in service? */ |
| 106 | | if (p->in_service & mask) |
| 93 | if (pic8259->in_service & mask) |
| 107 | 94 | { |
| 108 | 95 | if (LOG_GENERAL) |
| 109 | | logerror("pic8259_timerproc(): PIC #%d IRQ #%d still in service\n", which, irq); |
| 96 | logerror("pic8259_timerproc(): PIC IRQ #%d still in service\n", irq); |
| 110 | 97 | return; |
| 111 | 98 | } |
| 112 | 99 | |
| 113 | 100 | /* is this IRQ pending and enabled? */ |
| 114 | | if ((p->state == STATE_READY) && (p->pending & mask) && !(p->interrupt_mask & mask)) |
| 101 | if ((pic8259->state == STATE_READY) && (pic8259->pending & mask) && !(pic8259->interrupt_mask & mask)) |
| 115 | 102 | { |
| 116 | 103 | if (LOG_GENERAL) |
| 117 | | logerror("pic8259_timerproc(): PIC #%d triggering IRQ #%d\n", which, irq); |
| 118 | | if (p->set_int_line) |
| 119 | | p->set_int_line(which, 1); |
| 104 | logerror("pic8259_timerproc(): PIC triggering IRQ #%d\n", irq); |
| 105 | if (pic8259->intf->set_int_line) |
| 106 | pic8259->intf->set_int_line(device, 1); |
| 120 | 107 | return; |
| 121 | 108 | } |
| 122 | 109 | } |
| 123 | | if (p->set_int_line) |
| 124 | | p->set_int_line(which, 0); |
| 110 | if (pic8259->intf->set_int_line) |
| 111 | pic8259->intf->set_int_line(device, 0); |
| 125 | 112 | } |
| 126 | 113 | |
| 127 | 114 | |
| 128 | | |
| 129 | | static void pic8259_set_timer(int which) |
| 115 | INLINE void pic8259_set_timer(pic8259_t *pic8259) |
| 130 | 116 | { |
| 131 | | timer_adjust_oneshot(pic[which].timer, attotime_zero, which); |
| 117 | timer_adjust_oneshot(pic8259->timer, attotime_zero, 0); |
| 132 | 118 | } |
| 133 | 119 | |
| 134 | 120 | |
| 121 | void pic8259_set_irq_line(const device_config *device, int irq, int state) |
| 122 | { |
| 123 | pic8259_t *pic8259 = get_safe_token(device); |
| 135 | 124 | |
| 136 | | void pic8259_set_irq_line(int which, int irq, int state) |
| 137 | | { |
| 138 | 125 | if (state) |
| 139 | 126 | { |
| 140 | 127 | /* setting IRQ line */ |
| 141 | | if (!(pic[which].irq_lines & (1 << irq))) |
| 128 | if (!(pic8259->irq_lines & (1 << irq))) |
| 142 | 129 | { |
| 143 | 130 | if (LOG_GENERAL) |
| 144 | | logerror("pic8259_set_irq_line(): PIC #%d set IRQ line #%d\n", which, irq); |
| 131 | logerror("pic8259_set_irq_line(): PIC set IRQ line #%d\n", irq); |
| 145 | 132 | |
| 146 | | pic[which].irq_lines |= 1 << irq; |
| 147 | | pic[which].pending |= 1 << irq; |
| 148 | | pic8259_set_timer(which); |
| 133 | pic8259->irq_lines |= 1 << irq; |
| 134 | pic8259->pending |= 1 << irq; |
| 135 | pic8259_set_timer(pic8259); |
| 149 | 136 | } |
| 150 | 137 | } |
| 151 | 138 | else |
| 152 | 139 | { |
| 153 | 140 | /* clearing IRQ line */ |
| 154 | | if (pic[which].irq_lines & (1 << irq)) |
| 141 | if (pic8259->irq_lines & (1 << irq)) |
| 155 | 142 | { |
| 156 | 143 | if (LOG_GENERAL) |
| 157 | | logerror("pic8259_set_irq_line(): PIC #%d cleared IRQ line #%d\n", which, irq); |
| 144 | logerror("pic8259_set_irq_line(): PIC cleared IRQ line #%d\n", irq); |
| 158 | 145 | |
| 159 | | pic[which].irq_lines &= ~(1 << irq); |
| 160 | | pic8259_set_timer(which); |
| 146 | pic8259->irq_lines &= ~(1 << irq); |
| 147 | pic8259_set_timer(pic8259); |
| 161 | 148 | } |
| 162 | 149 | } |
| 163 | 150 | } |
| 164 | 151 | |
| 165 | 152 | |
| 166 | 153 | |
| 167 | | int pic8259_acknowledge(int which) |
| 154 | int pic8259_acknowledge(const device_config *device) |
| 168 | 155 | { |
| 169 | | struct pic8259 *p = &pic[which]; |
| 156 | pic8259_t *pic8259 = get_safe_token(device); |
| 170 | 157 | UINT8 mask; |
| 171 | 158 | int irq; |
| 172 | 159 | |
| r2376 | r2377 | |
| 175 | 162 | mask = 1 << irq; |
| 176 | 163 | |
| 177 | 164 | /* is this IRQ pending and enabled? */ |
| 178 | | if ((p->pending & mask) && !(p->interrupt_mask & mask)) |
| 165 | if ((pic8259->pending & mask) && !(pic8259->interrupt_mask & mask)) |
| 179 | 166 | { |
| 180 | 167 | if (LOG_GENERAL) |
| 181 | | logerror("pic8259_acknowledge(): PIC #%d acknowledge IRQ #%d\n", which, irq); |
| 168 | logerror("pic8259_acknowledge(): PIC acknowledge IRQ #%d\n", irq); |
| 182 | 169 | |
| 183 | | p->pending &= ~mask; |
| 184 | | if (!p->auto_eoi) |
| 185 | | p->in_service |= mask; |
| 170 | pic8259->pending &= ~mask; |
| 171 | if (!pic8259->auto_eoi) |
| 172 | pic8259->in_service |= mask; |
| 186 | 173 | |
| 187 | | return irq + p->base; |
| 174 | return irq + pic8259->base; |
| 188 | 175 | } |
| 189 | 176 | } |
| 190 | 177 | return 0; |
| r2376 | r2377 | |
| 192 | 179 | |
| 193 | 180 | |
| 194 | 181 | |
| 195 | | static UINT8 pic8259_read(int which, offs_t offset) |
| 182 | READ8_DEVICE_HANDLER( pic8259_r ) |
| 196 | 183 | { |
| 197 | | struct pic8259 *p = &pic[which]; |
| 184 | pic8259_t *pic8259 = get_safe_token(device); |
| 198 | 185 | |
| 199 | 186 | /* NPW 18-May-2003 - Changing 0xFF to 0x00 as per Ruslan */ |
| 200 | 187 | UINT8 data = 0x00; |
| r2376 | r2377 | |
| 202 | 189 | switch(offset) |
| 203 | 190 | { |
| 204 | 191 | case 0: /* PIC acknowledge IRQ */ |
| 205 | | if (p->special) |
| 192 | if (pic8259->special) |
| 206 | 193 | { |
| 207 | | p->special = 0; |
| 208 | | data = p->input; |
| 194 | pic8259->special = 0; |
| 195 | data = pic8259->input; |
| 209 | 196 | } |
| 210 | 197 | break; |
| 211 | 198 | |
| 212 | 199 | case 1: /* PIC mask register */ |
| 213 | | data = p->interrupt_mask; |
| 200 | data = pic8259->interrupt_mask; |
| 214 | 201 | break; |
| 215 | 202 | } |
| 216 | 203 | return data; |
| r2376 | r2377 | |
| 218 | 205 | |
| 219 | 206 | |
| 220 | 207 | |
| 221 | | static void pic8259_write(int which, offs_t offset, UINT8 data ) |
| 208 | WRITE8_DEVICE_HANDLER( pic8259_w ) |
| 222 | 209 | { |
| 223 | | struct pic8259 *p = &pic[which]; |
| 210 | pic8259_t *pic8259 = get_safe_token(device); |
| 224 | 211 | |
| 225 | 212 | switch(offset) |
| 226 | 213 | { |
| r2376 | r2377 | |
| 229 | 216 | { |
| 230 | 217 | /* write ICW1 - this pretty much resets the chip */ |
| 231 | 218 | if (LOG_ICW) |
| 232 | | logerror("pic8259_write(): ICW1; which=%d data=0x%02X\n", which, data); |
| 219 | logerror("pic8259_w(): ICW1; data=0x%02X\n", data); |
| 233 | 220 | |
| 234 | | p->interrupt_mask = 0x00; |
| 235 | | p->level_trig_mode = (data & 0x08) ? 1 : 0; |
| 236 | | p->vector_size = (data & 0x04) ? 1 : 0; |
| 237 | | p->cascade = (data & 0x02) ? 0 : 1; |
| 238 | | p->icw4_needed = (data & 0x01) ? 1 : 0; |
| 239 | | p->state = STATE_ICW2; |
| 221 | pic8259->interrupt_mask = 0x00; |
| 222 | pic8259->level_trig_mode = (data & 0x08) ? 1 : 0; |
| 223 | pic8259->vector_size = (data & 0x04) ? 1 : 0; |
| 224 | pic8259->cascade = (data & 0x02) ? 0 : 1; |
| 225 | pic8259->icw4_needed = (data & 0x01) ? 1 : 0; |
| 226 | pic8259->state = STATE_ICW2; |
| 240 | 227 | } |
| 241 | | else if (p->state == STATE_READY) |
| 228 | else if (pic8259->state == STATE_READY) |
| 242 | 229 | { |
| 243 | 230 | if ((data & 0x98) == 0x08) |
| 244 | 231 | { |
| 245 | 232 | /* write OCW3 */ |
| 246 | 233 | if (LOG_OCW) |
| 247 | | logerror("pic8259_write(): OCW3; which=%d data=0x%02X\n", which, data); |
| 234 | logerror("pic8259_w(): OCW3; data=0x%02X\n", data); |
| 248 | 235 | |
| 249 | 236 | switch (data & 0x03) |
| 250 | 237 | { |
| 251 | 238 | case 0x02: |
| 252 | | p->special = 1; |
| 253 | | p->input = p->pending; |
| 239 | pic8259->special = 1; |
| 240 | pic8259->input = pic8259->pending; |
| 254 | 241 | break; |
| 255 | 242 | case 0x03: |
| 256 | | p->special = 1; |
| 257 | | p->input = p->in_service & ~p->interrupt_mask; |
| 243 | pic8259->special = 1; |
| 244 | pic8259->input = pic8259->in_service & ~pic8259->interrupt_mask; |
| 258 | 245 | break; |
| 259 | 246 | } |
| 260 | 247 | } |
| r2376 | r2377 | |
| 265 | 252 | |
| 266 | 253 | /* write OCW2 */ |
| 267 | 254 | if (LOG_OCW) |
| 268 | | logerror("pic8259_write(): OCW2; which=%d data=0x%02X\n", which, data); |
| 255 | logerror("pic8259_w(): OCW2; data=0x%02X\n", data); |
| 269 | 256 | |
| 270 | 257 | switch (data & 0xe0) |
| 271 | 258 | { |
| 272 | 259 | case 0x00: |
| 273 | | p->prio = 0; |
| 260 | pic8259->prio = 0; |
| 274 | 261 | break; |
| 275 | 262 | case 0x20: |
| 276 | | for (n = 0, mask = 1<<p->prio; n < 8; n++, mask = (mask<<1) | (mask>>7)) |
| 263 | for (n = 0, mask = 1<<pic8259->prio; n < 8; n++, mask = (mask<<1) | (mask>>7)) |
| 277 | 264 | { |
| 278 | | if (p->in_service & mask) |
| 265 | if (pic8259->in_service & mask) |
| 279 | 266 | { |
| 280 | | p->in_service &= ~mask; |
| 267 | pic8259->in_service &= ~mask; |
| 281 | 268 | break; |
| 282 | 269 | } |
| 283 | 270 | } |
| r2376 | r2377 | |
| 285 | 272 | case 0x40: |
| 286 | 273 | break; |
| 287 | 274 | case 0x60: |
| 288 | | if( p->in_service & mask ) |
| 275 | if( pic8259->in_service & mask ) |
| 289 | 276 | { |
| 290 | | p->in_service &= ~mask; |
| 277 | pic8259->in_service &= ~mask; |
| 291 | 278 | } |
| 292 | 279 | break; |
| 293 | 280 | case 0x80: |
| 294 | | p->prio = ++p->prio & 7; |
| 281 | pic8259->prio = ++pic8259->prio & 7; |
| 295 | 282 | break; |
| 296 | 283 | case 0xa0: |
| 297 | | for (n = 0, mask = 1<<p->prio; n < 8; n++, mask = (mask<<1) | (mask>>7)) |
| 284 | for (n = 0, mask = 1<<pic8259->prio; n < 8; n++, mask = (mask<<1) | (mask>>7)) |
| 298 | 285 | { |
| 299 | | if( p->in_service & mask ) |
| 286 | if( pic8259->in_service & mask ) |
| 300 | 287 | { |
| 301 | | p->in_service &= ~mask; |
| 302 | | p->prio = ++p->prio & 7; |
| 288 | pic8259->in_service &= ~mask; |
| 289 | pic8259->prio = ++pic8259->prio & 7; |
| 303 | 290 | break; |
| 304 | 291 | } |
| 305 | 292 | } |
| 306 | 293 | break; |
| 307 | 294 | case 0xc0: |
| 308 | | p->prio = n & 7; |
| 295 | pic8259->prio = n & 7; |
| 309 | 296 | break; |
| 310 | 297 | case 0xe0: |
| 311 | | if( p->in_service & mask ) |
| 298 | if( pic8259->in_service & mask ) |
| 312 | 299 | { |
| 313 | | p->in_service &= ~mask; |
| 314 | | p->pending &= ~mask; |
| 315 | | p->prio = ++p->prio & 7; |
| 300 | pic8259->in_service &= ~mask; |
| 301 | pic8259->pending &= ~mask; |
| 302 | pic8259->prio = ++pic8259->prio & 7; |
| 316 | 303 | } |
| 317 | 304 | break; |
| 318 | 305 | } |
| r2376 | r2377 | |
| 321 | 308 | break; |
| 322 | 309 | |
| 323 | 310 | case 1: |
| 324 | | switch(p->state) |
| 311 | switch(pic8259->state) |
| 325 | 312 | { |
| 326 | 313 | case STATE_ICW1: |
| 327 | 314 | break; |
| r2376 | r2377 | |
| 329 | 316 | case STATE_ICW2: |
| 330 | 317 | /* write ICW2 */ |
| 331 | 318 | if (LOG_ICW) |
| 332 | | logerror("pic8259_write(): ICW2; which=%d data=0x%02X\n", which, data); |
| 319 | logerror("pic8259_w(): ICW2; data=0x%02X\n", data); |
| 333 | 320 | |
| 334 | | p->base = data & 0xf8; |
| 335 | | if (p->cascade) |
| 336 | | p->state = STATE_ICW3; |
| 321 | pic8259->base = data & 0xf8; |
| 322 | if (pic8259->cascade) |
| 323 | pic8259->state = STATE_ICW3; |
| 337 | 324 | else |
| 338 | | p->state = p->icw4_needed ? STATE_ICW4 : STATE_READY; |
| 325 | pic8259->state = pic8259->icw4_needed ? STATE_ICW4 : STATE_READY; |
| 339 | 326 | break; |
| 340 | 327 | |
| 341 | 328 | case STATE_ICW3: |
| 342 | 329 | /* write ICW3 */ |
| 343 | 330 | if (LOG_ICW) |
| 344 | | logerror("pic8259_write(): ICW3; which=%d data=0x%02X\n", which, data); |
| 331 | logerror("pic8259_w(): ICW3; data=0x%02X\n", data); |
| 345 | 332 | |
| 346 | | p->slave = data; |
| 347 | | p->state = p->icw4_needed ? STATE_ICW4 : STATE_READY; |
| 333 | pic8259->slave = data; |
| 334 | pic8259->state = pic8259->icw4_needed ? STATE_ICW4 : STATE_READY; |
| 348 | 335 | break; |
| 349 | 336 | |
| 350 | 337 | case STATE_ICW4: |
| 351 | 338 | /* write ICW4 */ |
| 352 | 339 | if (LOG_ICW) |
| 353 | | logerror("pic8259_write(): ICW4; which=%d data=0x%02X\n", which, data); |
| 340 | logerror("pic8259_w(): ICW4; data=0x%02X\n", data); |
| 354 | 341 | |
| 355 | | p->nested = (data & 0x10) ? 1 : 0; |
| 356 | | p->mode = (data >> 2) & 3; |
| 357 | | p->auto_eoi = (data & 0x02) ? 1 : 0; |
| 358 | | p->is_x86 = (data & 0x01) ? 1 : 0; |
| 359 | | p->state = STATE_READY; |
| 342 | pic8259->nested = (data & 0x10) ? 1 : 0; |
| 343 | pic8259->mode = (data >> 2) & 3; |
| 344 | pic8259->auto_eoi = (data & 0x02) ? 1 : 0; |
| 345 | pic8259->is_x86 = (data & 0x01) ? 1 : 0; |
| 346 | pic8259->state = STATE_READY; |
| 360 | 347 | break; |
| 361 | 348 | |
| 362 | 349 | case STATE_READY: |
| 363 | 350 | /* write OCW1 - set interrupt mask register */ |
| 364 | 351 | if (LOG_OCW) |
| 365 | | logerror("pic8259_write(): OCW1; which=%d data=0x%02X\n", which, data); |
| 352 | logerror("pic8259_w(): OCW1; data=0x%02X\n", data); |
| 366 | 353 | |
| 367 | | p->interrupt_mask = data; |
| 354 | pic8259->interrupt_mask = data; |
| 368 | 355 | break; |
| 369 | 356 | } |
| 370 | 357 | break; |
| 371 | 358 | } |
| 372 | | pic8259_set_timer(which); |
| 359 | pic8259_set_timer(pic8259); |
| 373 | 360 | } |
| 374 | 361 | |
| 375 | 362 | |
| 376 | 363 | |
| 377 | | /* ----------------------------------------------------------------------- */ |
| 364 | static DEVICE_START( pic8259 ) { |
| 365 | pic8259_t *pic8259 = get_safe_token(device); |
| 378 | 366 | |
| 379 | | READ8_HANDLER ( pic8259_0_r ) { return pic8259_read(0, offset); } |
| 380 | | READ8_HANDLER ( pic8259_1_r ) { return pic8259_read(1, offset); } |
| 381 | | WRITE8_HANDLER ( pic8259_0_w ) { pic8259_write(0, offset, data); } |
| 382 | | WRITE8_HANDLER ( pic8259_1_w ) { pic8259_write(1, offset, data); } |
| 367 | pic8259->intf = device->static_config; |
| 368 | } |
| 383 | 369 | |
| 384 | | READ16_HANDLER ( pic8259_16le_0_r ) { return read16le_with_read8_handler(pic8259_0_r, machine, offset, mem_mask); } |
| 385 | | READ16_HANDLER ( pic8259_16le_1_r ) { return read16le_with_read8_handler(pic8259_1_r, machine, offset, mem_mask); } |
| 386 | | WRITE16_HANDLER ( pic8259_16le_0_w ) { write16le_with_write8_handler(pic8259_0_w, machine, offset, data, mem_mask); } |
| 387 | | WRITE16_HANDLER ( pic8259_16le_1_w ) { write16le_with_write8_handler(pic8259_1_w, machine, offset, data, mem_mask); } |
| 388 | 370 | |
| 389 | | READ32_HANDLER ( pic8259_32le_0_r ) { return read32le_with_read8_handler(pic8259_0_r, machine, offset, mem_mask); } |
| 390 | | READ32_HANDLER ( pic8259_32le_1_r ) { return read32le_with_read8_handler(pic8259_1_r, machine, offset, mem_mask); } |
| 391 | | WRITE32_HANDLER ( pic8259_32le_0_w ) { write32le_with_write8_handler(pic8259_0_w, machine, offset, data, mem_mask); } |
| 392 | | WRITE32_HANDLER ( pic8259_32le_1_w ) { write32le_with_write8_handler(pic8259_1_w, machine, offset, data, mem_mask); } |
| 371 | static DEVICE_RESET( pic8259 ) { |
| 372 | pic8259_t *pic8259 = get_safe_token(device); |
| 393 | 373 | |
| 394 | | READ64_HANDLER ( pic8259_64be_0_r ) { return read64be_with_read8_handler(pic8259_0_r, machine, offset, mem_mask); } |
| 395 | | READ64_HANDLER ( pic8259_64be_1_r ) { return read64be_with_read8_handler(pic8259_1_r, machine, offset, mem_mask); } |
| 396 | | WRITE64_HANDLER ( pic8259_64be_0_w ) { write64be_with_write8_handler(pic8259_0_w, machine, offset, data, mem_mask); } |
| 397 | | WRITE64_HANDLER ( pic8259_64be_1_w ) { write64be_with_write8_handler(pic8259_1_w, machine, offset, data, mem_mask); } |
| 374 | pic8259->timer = timer_alloc( pic8259_timerproc, (void *)device ); |
| 375 | |
| 376 | pic8259->state = STATE_ICW1; /* It is unclear from the original code whether this is correct */ |
| 377 | pic8259->irq_lines = 0; |
| 378 | pic8259->in_service = 0; |
| 379 | pic8259->pending = 0; |
| 380 | pic8259->prio = 0; |
| 381 | pic8259->interrupt_mask = 0; |
| 382 | pic8259->input = 0; |
| 383 | pic8259->special = 0; |
| 384 | pic8259->level_trig_mode = 0; |
| 385 | pic8259->vector_size = 0; |
| 386 | pic8259->cascade = 0; |
| 387 | pic8259->icw4_needed = 0; |
| 388 | pic8259->base = 0; |
| 389 | pic8259->slave = 0; |
| 390 | pic8259->nested = 0; |
| 391 | pic8259->mode = 0; |
| 392 | pic8259->auto_eoi = 0; |
| 393 | pic8259->is_x86 = 0; |
| 394 | } |
| 395 | |
| 396 | |
| 397 | static DEVICE_SET_INFO( pic8259 ) { |
| 398 | switch ( state ) { |
| 399 | /* no parameters to set */ |
| 400 | } |
| 401 | } |
| 402 | |
| 403 | |
| 404 | DEVICE_GET_INFO( pic8259 ) { |
| 405 | switch ( state ) { |
| 406 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 407 | case DEVINFO_INT_TOKEN_BYTES: info->i = sizeof(pic8259_t); break; |
| 408 | case DEVINFO_INT_INLINE_CONFIG_BYTES: info->i = 0; break; |
| 409 | case DEVINFO_INT_CLASS: info->i = DEVICE_CLASS_PERIPHERAL; break; |
| 410 | |
| 411 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 412 | case DEVINFO_FCT_SET_INFO: info->set_info = DEVICE_SET_INFO_NAME(pic8259); break; |
| 413 | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(pic8259); break; |
| 414 | case DEVINFO_FCT_STOP: /* nothing */ break; |
| 415 | case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(pic8259); break; |
| 416 | |
| 417 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 418 | case DEVINFO_STR_NAME: info->s = "Intel PIC8259"; break; |
| 419 | case DEVINFO_STR_FAMILY: info->s = "PIC8259"; break; |
| 420 | case DEVINFO_STR_VERSION: info->s = "1.00"; break; |
| 421 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; |
| 422 | case DEVINFO_STR_CREDITS: info->s = "Copyright the MAME and MESS Teams"; break; |
| 423 | } |
| 424 | } |
| 425 | |
src/mess/machine/at.c
| r2376 | r2377 | |
| 23 | 23 | #include "includes/pc.h" |
| 24 | 24 | #include "includes/at.h" |
| 25 | 25 | #include "machine/pckeybrd.h" |
| 26 | #include "audio/pc.h" |
| 26 | 27 | #include "audio/sblaster.h" |
| 27 | 28 | #include "machine/i82439tx.h" |
| 28 | 29 | |
| r2376 | r2377 | |
| 31 | 32 | |
| 32 | 33 | #define LOG_PORT80 0 |
| 33 | 34 | |
| 35 | static struct { |
| 36 | const device_config *pic8259_master; |
| 37 | const device_config *pic8259_slave; |
| 38 | const device_config *dma8237_1; |
| 39 | const device_config *dma8237_2; |
| 40 | } at_devices; |
| 41 | |
| 34 | 42 | static const SOUNDBLASTER_CONFIG soundblaster = { 1,5, {1,0} }; |
| 35 | 43 | |
| 36 | 44 | |
| 45 | /************************************************************* |
| 46 | * |
| 47 | * pic8259 configuration |
| 48 | * |
| 49 | *************************************************************/ |
| 37 | 50 | |
| 51 | static PIC8259_SET_INT_LINE( at_pic8259_master_set_int_line ) { |
| 52 | cpunum_set_input_line(device->machine, 0, 0, interrupt ? HOLD_LINE : CLEAR_LINE); |
| 53 | } |
| 54 | |
| 55 | |
| 56 | static PIC8259_SET_INT_LINE( at_pic8259_slave_set_int_line ) { |
| 57 | pic8259_set_irq_line( at_devices.pic8259_master, 2, interrupt); |
| 58 | } |
| 59 | |
| 60 | |
| 61 | const struct pic8259_interface at_pic8259_master_config = { |
| 62 | at_pic8259_master_set_int_line |
| 63 | }; |
| 64 | |
| 65 | |
| 66 | const struct pic8259_interface at_pic8259_slave_config = { |
| 67 | at_pic8259_slave_set_int_line |
| 68 | }; |
| 69 | |
| 70 | |
| 71 | |
| 72 | /************************************************************* |
| 73 | * |
| 74 | * pit8254 configuration |
| 75 | * |
| 76 | *************************************************************/ |
| 77 | |
| 78 | static PIT8253_OUTPUT_CHANGED( pc_timer0_w ) |
| 79 | { |
| 80 | if ( at_devices.pic8259_master ) { |
| 81 | pic8259_set_irq_line(at_devices.pic8259_master, 0, state); |
| 82 | } |
| 83 | } |
| 84 | |
| 85 | |
| 86 | const struct pit8253_config at_pit8254_config = |
| 87 | { |
| 88 | { |
| 89 | { |
| 90 | 4772720/4, /* heartbeat IRQ */ |
| 91 | pc_timer0_w, |
| 92 | NULL |
| 93 | }, { |
| 94 | 4772720/4, /* dram refresh */ |
| 95 | NULL, |
| 96 | NULL |
| 97 | }, { |
| 98 | 4772720/4, /* pio port c pin 4, and speaker polling enough */ |
| 99 | NULL, |
| 100 | pc_sh_speaker_change_clock |
| 101 | } |
| 102 | } |
| 103 | }; |
| 104 | |
| 105 | |
| 38 | 106 | static void at_set_gate_a20(int a20) |
| 39 | 107 | { |
| 40 | 108 | /* set the CPU's A20 line */ |
| r2376 | r2377 | |
| 42 | 110 | } |
| 43 | 111 | |
| 44 | 112 | |
| 113 | static void at_set_irq_line(int irq, int state) { |
| 114 | pic8259_set_irq_line(at_devices.pic8259_master, irq, state); |
| 115 | } |
| 45 | 116 | |
| 117 | |
| 118 | static void at_set_keyb_int(int state) { |
| 119 | pic8259_set_irq_line(at_devices.pic8259_master, 1, state); |
| 120 | } |
| 121 | |
| 122 | |
| 46 | 123 | static void init_at_common(const struct kbdc8042_interface *at8042) |
| 47 | 124 | { |
| 48 | | mess_init_pc_common(PCCOMMON_KEYBOARD_AT); |
| 125 | mess_init_pc_common(PCCOMMON_KEYBOARD_AT, at_set_keyb_int, at_set_irq_line); |
| 49 | 126 | mc146818_init(MC146818_STANDARD); |
| 50 | 127 | soundblaster_config(&soundblaster); |
| 51 | 128 | kbdc8042_init(at8042); |
| r2376 | r2377 | |
| 63 | 140 | |
| 64 | 141 | static void at_keyboard_interrupt(int state) |
| 65 | 142 | { |
| 66 | | pic8259_set_irq_line(0, 1, state); |
| 143 | pic8259_set_irq_line(at_devices.pic8259_master, 1, state); |
| 67 | 144 | } |
| 68 | 145 | |
| 69 | 146 | |
| r2376 | r2377 | |
| 213 | 290 | |
| 214 | 291 | static void at_fdc_interrupt(int state) |
| 215 | 292 | { |
| 216 | | pic8259_set_irq_line(0, 6, state); |
| 293 | pic8259_set_irq_line(at_devices.pic8259_master, 6, state); |
| 217 | 294 | } |
| 218 | 295 | |
| 219 | 296 | |
| r2376 | r2377 | |
| 326 | 403 | |
| 327 | 404 | static IRQ_CALLBACK(at_irq_callback) |
| 328 | 405 | { |
| 329 | | return pic8259_acknowledge(0); |
| 406 | return pic8259_acknowledge( at_devices.pic8259_master); |
| 330 | 407 | } |
| 331 | 408 | |
| 332 | 409 | |
| r2376 | r2377 | |
| 341 | 418 | |
| 342 | 419 | MACHINE_RESET( at ) |
| 343 | 420 | { |
| 421 | at_devices.pic8259_master = (device_config*)device_list_find_by_tag( machine->config->devicelist, PIC8259, "pic8259_master" ); |
| 422 | at_devices.pic8259_slave = (device_config*)device_list_find_by_tag( machine->config->devicelist, PIC8259, "pic8259_slave" ); |
| 423 | at_devices.dma8237_1 = (device_config*)device_list_find_by_tag( machine->config->devicelist, DMA8237, "dma8237_1" ); |
| 424 | at_devices.dma8237_2 = (device_config*)device_list_find_by_tag( machine->config->devicelist, DMA8237, "dma8237_2" ); |
| 344 | 425 | } |
| 345 | 426 | |
src/mess/machine/bebox.c
| r2376 | r2377 | |
| 119 | 119 | static UINT32 bebox_interrupts; |
| 120 | 120 | static UINT32 bebox_crossproc_interrupts; |
| 121 | 121 | |
| 122 | static struct { |
| 123 | const device_config *pic8259_master; |
| 124 | const device_config *pic8259_slave; |
| 125 | const device_config *dma8237_1; |
| 126 | const device_config *dma8237_2; |
| 127 | } bebox_devices; |
| 122 | 128 | |
| 129 | |
| 123 | 130 | /************************************* |
| 124 | 131 | * |
| 125 | 132 | * Interrupts and Motherboard Registers |
| r2376 | r2377 | |
| 370 | 377 | static void bebox_fdc_interrupt(int state) |
| 371 | 378 | { |
| 372 | 379 | bebox_set_irq_bit(Machine, 13, state); |
| 373 | | pic8259_set_irq_line(0, 6, state); |
| 380 | if ( bebox_devices.pic8259_master ) { |
| 381 | pic8259_set_irq_line(bebox_devices.pic8259_master, 6, state); |
| 382 | } |
| 374 | 383 | } |
| 375 | 384 | |
| 376 | 385 | |
| 377 | 386 | static void bebox_fdc_dma_drq(int state, int read_) |
| 378 | 387 | { |
| 379 | | dma8237_drq_write(0, FDC_DMA, state); |
| 388 | if ( bebox_devices.dma8237_1 ) { |
| 389 | dma8237_drq_write(bebox_devices.dma8237_1, FDC_DMA, state); |
| 390 | } |
| 380 | 391 | } |
| 381 | 392 | |
| 382 | 393 | |
| r2376 | r2377 | |
| 407 | 418 | READ64_HANDLER( bebox_interrupt_ack_r ) |
| 408 | 419 | { |
| 409 | 420 | int result; |
| 410 | | result = pic8259_acknowledge(0); |
| 421 | result = pic8259_acknowledge( bebox_devices.pic8259_master ); |
| 411 | 422 | if (result == 2) |
| 412 | | result = pic8259_acknowledge(1); |
| 423 | result = pic8259_acknowledge( bebox_devices.pic8259_slave ); |
| 413 | 424 | bebox_set_irq_bit(machine, 5, 0); /* HACK */ |
| 414 | 425 | return ((UINT64) result) << 56; |
| 415 | 426 | } |
| 416 | 427 | |
| 417 | 428 | |
| 429 | /************************************************************* |
| 430 | * |
| 431 | * pic8259 configuration |
| 432 | * |
| 433 | *************************************************************/ |
| 434 | |
| 435 | static PIC8259_SET_INT_LINE( bebox_pic8259_master_set_int_line ) { |
| 436 | bebox_set_irq_bit(device->machine, 5, interrupt); |
| 437 | } |
| 418 | 438 | |
| 419 | | static void bebox_pic_set_int_line(int which, int interrupt) |
| 420 | | { |
| 421 | | switch(which) |
| 422 | | { |
| 423 | | case 0: |
| 424 | | /* Master */ |
| 425 | | bebox_set_irq_bit(Machine, 5, interrupt); |
| 426 | | break; |
| 427 | 439 | |
| 428 | | case 1: |
| 429 | | /* Slave */ |
| 430 | | pic8259_set_irq_line(0, 2, interrupt); |
| 431 | | break; |
| 440 | static PIC8259_SET_INT_LINE( bebox_pic8259_slave_set_int_line ) { |
| 441 | if ( bebox_devices.pic8259_master ) { |
| 442 | pic8259_set_irq_line( bebox_devices.pic8259_master, 2, interrupt ); |
| 432 | 443 | } |
| 433 | 444 | } |
| 434 | 445 | |
| 435 | 446 | |
| 447 | const struct pic8259_interface bebox_pic8259_master_config = { |
| 448 | bebox_pic8259_master_set_int_line |
| 449 | }; |
| 436 | 450 | |
| 451 | |
| 452 | const struct pic8259_interface bebox_pic8259_slave_config = { |
| 453 | bebox_pic8259_slave_set_int_line |
| 454 | }; |
| 455 | |
| 456 | |
| 437 | 457 | /************************************* |
| 438 | 458 | * |
| 439 | 459 | * Floppy/IDE/ATA |
| r2376 | r2377 | |
| 481 | 501 | static void bebox_ide_interrupt(int state) |
| 482 | 502 | { |
| 483 | 503 | bebox_set_irq_bit(Machine, 7, state); |
| 484 | | pic8259_set_irq_line(1, 6, state); |
| 504 | if ( bebox_devices.pic8259_master ) { |
| 505 | pic8259_set_irq_line( bebox_devices.pic8259_master, 6, state); |
| 506 | } |
| 485 | 507 | } |
| 486 | 508 | |
| 487 | 509 | |
| r2376 | r2377 | |
| 729 | 751 | |
| 730 | 752 | static void bebox_timer0_w(const device_config *device, int state) |
| 731 | 753 | { |
| 732 | | pic8259_set_irq_line(0, 0, state); |
| 754 | if ( bebox_devices.pic8259_master ) { |
| 755 | pic8259_set_irq_line(bebox_devices.pic8259_master, 0, state); |
| 756 | } |
| 733 | 757 | } |
| 734 | 758 | |
| 735 | 759 | |
| r2376 | r2377 | |
| 796 | 820 | static void bebox_keyboard_interrupt(int state) |
| 797 | 821 | { |
| 798 | 822 | bebox_set_irq_bit(Machine, 16, state); |
| 799 | | pic8259_set_irq_line(0, 1, state); |
| 823 | if ( bebox_devices.pic8259_master ) { |
| 824 | pic8259_set_irq_line( bebox_devices.pic8259_master, 1, state); |
| 825 | } |
| 800 | 826 | } |
| 801 | 827 | |
| 802 | 828 | static int bebox_get_out2(running_machine *machine) { |
| r2376 | r2377 | |
| 993 | 1019 | }; |
| 994 | 1020 | |
| 995 | 1021 | |
| 1022 | static TIMER_CALLBACK( bebox_get_devices ) { |
| 1023 | bebox_devices.pic8259_master = (device_config*)device_list_find_by_tag( machine->config->devicelist, PIC8259, "pic8259_master" ); |
| 1024 | bebox_devices.pic8259_slave = (device_config*)device_list_find_by_tag( machine->config->devicelist, PIC8259, "pic8259_slave" ); |
| 1025 | bebox_devices.dma8237_1 = (device_config*)device_list_find_by_tag( machine->config->devicelist, DMA8237, "dma8237_1" ); |
| 1026 | bebox_devices.dma8237_2 = (device_config*)device_list_find_by_tag( machine->config->devicelist, DMA8237, "dma8237_2" ); |
| 1027 | } |
| 1028 | |
| 1029 | |
| 996 | 1030 | /************************************* |
| 997 | 1031 | * |
| 998 | 1032 | * Driver main |
| r2376 | r2377 | |
| 1006 | 1040 | |
| 1007 | 1041 | MACHINE_RESET( bebox ) |
| 1008 | 1042 | { |
| 1043 | bebox_devices.pic8259_master = NULL; |
| 1044 | bebox_devices.pic8259_slave = NULL; |
| 1045 | bebox_devices.dma8237_1 = NULL; |
| 1046 | bebox_devices.dma8237_2 = NULL; |
| 1047 | |
| 1048 | timer_set( attotime_zero, NULL, 0, bebox_get_devices ); |
| 1049 | |
| 1009 | 1050 | cpunum_set_input_line(machine, 0, INPUT_LINE_RESET, CLEAR_LINE); |
| 1010 | 1051 | cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, ASSERT_LINE); |
| 1011 | 1052 | ide_controller_reset(0); |
| r2376 | r2377 | |
| 1052 | 1093 | |
| 1053 | 1094 | // pc_fdc_init(&bebox_fdc_interface); |
| 1054 | 1095 | mc146818_init(MC146818_STANDARD); |
| 1055 | | pic8259_init(2, bebox_pic_set_int_line); |
| 1056 | 1096 | ide_controller_init_custom(0, &bebox_ide_interface, NULL); |
| 1057 | 1097 | pc_vga_init(machine, &bebox_vga_interface, &cirrus_svga_interface); |
| 1058 | 1098 | kbdc8042_init(&bebox_8042_interface); |
src/mess/machine/pc.c
| r2376 | r2377 | |
| 48 | 48 | #include "machine/8237dma.h" |
| 49 | 49 | |
| 50 | 50 | |
| 51 | static struct { |
| 52 | const device_config *pic8259_master; |
| 53 | const device_config *pic8259_slave; |
| 54 | const device_config *dma8237_1; |
| 55 | const device_config *dma8237_2; |
| 56 | } pc_devices; |
| 57 | |
| 51 | 58 | /************************************************************************* |
| 52 | 59 | * |
| 53 | 60 | * PC DMA stuff |
| r2376 | r2377 | |
| 143 | 150 | }; |
| 144 | 151 | |
| 145 | 152 | |
| 153 | /************************************************************* |
| 154 | * |
| 155 | * pic8259 configuration |
| 156 | * |
| 157 | *************************************************************/ |
| 158 | |
| 159 | static PIC8259_SET_INT_LINE( pc_pic8259_master_set_int_line ) { |
| 160 | cpunum_set_input_line(device->machine, 0, 0, interrupt ? HOLD_LINE : CLEAR_LINE); |
| 161 | } |
| 162 | |
| 163 | |
| 164 | static PIC8259_SET_INT_LINE( pc_pic8259_slave_set_int_line ) { |
| 165 | pic8259_set_irq_line( pc_devices.pic8259_master, 2, interrupt); |
| 166 | } |
| 167 | |
| 168 | |
| 169 | const struct pic8259_interface pc_pic8259_master_config = { |
| 170 | pc_pic8259_master_set_int_line |
| 171 | }; |
| 172 | |
| 173 | |
| 174 | const struct pic8259_interface pc_pic8259_slave_config = { |
| 175 | pc_pic8259_slave_set_int_line |
| 176 | }; |
| 177 | |
| 178 | |
| 179 | /************************************************************* |
| 180 | * |
| 181 | * pit8253 configuration |
| 182 | * |
| 183 | *************************************************************/ |
| 184 | |
| 185 | static PIT8253_OUTPUT_CHANGED( pc_timer0_w ) |
| 186 | { |
| 187 | pic8259_set_irq_line(pc_devices.pic8259_master, 0, state); |
| 188 | } |
| 189 | |
| 190 | |
| 191 | const struct pit8253_config pc_pit8253_config = |
| 192 | { |
| 193 | { |
| 194 | { |
| 195 | 4772720/4, /* heartbeat IRQ */ |
| 196 | pc_timer0_w, |
| 197 | NULL |
| 198 | }, { |
| 199 | 4772720/4, /* dram refresh */ |
| 200 | NULL, |
| 201 | NULL |
| 202 | }, { |
| 203 | 4772720/4, /* pio port c pin 4, and speaker polling enough */ |
| 204 | NULL, |
| 205 | pc_sh_speaker_change_clock |
| 206 | } |
| 207 | } |
| 208 | }; |
| 209 | |
| 210 | |
| 146 | 211 | /********************************************************** |
| 147 | 212 | * |
| 148 | 213 | * COM hardware |
| r2376 | r2377 | |
| 155 | 220 | static const int irq[4] = {4, 3, 4, 3}; |
| 156 | 221 | |
| 157 | 222 | /* issue COM1/3 IRQ4, COM2/4 IRQ3 */ |
| 158 | | pic8259_set_irq_line(0, irq[nr], state); |
| 223 | pic8259_set_irq_line(pc_devices.pic8259_master, irq[nr], state); |
| 159 | 224 | } |
| 160 | 225 | |
| 161 | 226 | /* called when com registers read/written - used to update peripherals that |
| r2376 | r2377 | |
| 253 | 318 | |
| 254 | 319 | static void pc_fdc_interrupt(int state) |
| 255 | 320 | { |
| 256 | | pic8259_set_irq_line(0, 6, state); |
| 321 | if ( pc_devices.pic8259_master ) { |
| 322 | pic8259_set_irq_line(pc_devices.pic8259_master, 6, state); |
| 323 | } |
| 257 | 324 | } |
| 258 | 325 | |
| 259 | 326 | static void pc_fdc_dma_drq(int state, int read_) |
| r2376 | r2377 | |
| 270 | 337 | pc_fdc_dma_drq, |
| 271 | 338 | }; |
| 272 | 339 | |
| 340 | static void pc_set_irq_line(int irq, int state) { |
| 341 | pic8259_set_irq_line(pc_devices.pic8259_master, irq, state); |
| 342 | } |
| 273 | 343 | |
| 274 | | void mess_init_pc_common(UINT32 flags) { |
| 275 | | init_pc_common(flags); |
| 344 | static void pc_set_keyb_int(int state) { |
| 345 | pc_set_irq_line( 1, state ); |
| 346 | } |
| 276 | 347 | |
| 348 | void mess_init_pc_common(UINT32 flags, void (*set_keyb_int_func)(int), void (*set_hdc_int_func)(int,int)) { |
| 349 | init_pc_common(flags, set_keyb_int_func); |
| 350 | |
| 277 | 351 | /* MESS managed RAM */ |
| 278 | 352 | if ( mess_ram ) |
| 279 | 353 | memory_set_bankptr( 10, mess_ram ); |
| 280 | 354 | |
| 281 | 355 | /* FDC/HDC hardware */ |
| 282 | | pc_hdc_setup(); |
| 356 | pc_hdc_setup(set_hdc_int_func); |
| 283 | 357 | |
| 284 | 358 | /* com hardware */ |
| 285 | 359 | uart8250_init(0, com_interface); |
| r2376 | r2377 | |
| 308 | 382 | |
| 309 | 383 | DRIVER_INIT( pccga ) |
| 310 | 384 | { |
| 311 | | mess_init_pc_common(PCCOMMON_KEYBOARD_PC); |
| 385 | mess_init_pc_common(PCCOMMON_KEYBOARD_PC, pc_set_keyb_int, pc_set_irq_line); |
| 312 | 386 | ppi8255_init(&pc_ppi8255_interface); |
| 313 | 387 | pc_rtc_init(); |
| 314 | 388 | pc_turbo_setup(0, 3, 0x02, 4.77/12, 1); |
| r2376 | r2377 | |
| 316 | 390 | |
| 317 | 391 | DRIVER_INIT( bondwell ) |
| 318 | 392 | { |
| 319 | | mess_init_pc_common(PCCOMMON_KEYBOARD_PC); |
| 393 | mess_init_pc_common(PCCOMMON_KEYBOARD_PC, pc_set_keyb_int, pc_set_irq_line); |
| 320 | 394 | ppi8255_init(&pc_ppi8255_interface); |
| 321 | 395 | pc_turbo_setup(0, 3, 0x02, 4.77/12, 1); |
| 322 | 396 | } |
| 323 | 397 | |
| 324 | 398 | DRIVER_INIT( pcmda ) |
| 325 | 399 | { |
| 326 | | mess_init_pc_common(PCCOMMON_KEYBOARD_PC); |
| 400 | mess_init_pc_common(PCCOMMON_KEYBOARD_PC, pc_set_keyb_int, pc_set_irq_line); |
| 327 | 401 | ppi8255_init(&pc_ppi8255_interface); |
| 328 | 402 | pc_turbo_setup(0, 3, 0x02, 4.77/12, 1); |
| 329 | 403 | } |
| r2376 | r2377 | |
| 349 | 423 | rom[0xfffff]=256-a; |
| 350 | 424 | } |
| 351 | 425 | |
| 352 | | mess_init_pc_common(PCCOMMON_KEYBOARD_PC); |
| 426 | mess_init_pc_common(PCCOMMON_KEYBOARD_PC, pc_set_keyb_int, pc_set_irq_line); |
| 353 | 427 | |
| 354 | 428 | europc_rtc_init(); |
| 355 | 429 | // europc_rtc_set_time(machine); |
| r2376 | r2377 | |
| 362 | 436 | /* just a plain bit pattern for graphics data generation */ |
| 363 | 437 | for (i = 0; i < 256; i++) |
| 364 | 438 | gfx[i] = i; |
| 365 | | mess_init_pc_common(PCCOMMON_KEYBOARD_PC); |
| 439 | mess_init_pc_common(PCCOMMON_KEYBOARD_PC, pc_set_keyb_int, pc_set_irq_line); |
| 366 | 440 | pc_turbo_setup(0, 3, 0x02, 4.77/12, 1); |
| 367 | 441 | } |
| 368 | 442 | |
| r2376 | r2377 | |
| 381 | 455 | videoram=memory_region(REGION_CPU1)+0xb0000; |
| 382 | 456 | memory_install_read16_handler(0, ADDRESS_SPACE_IO, 0x278, 0x27b, 0, 0, pc200_16le_port378_r ); |
| 383 | 457 | |
| 384 | | mess_init_pc_common(PCCOMMON_KEYBOARD_PC); |
| 458 | mess_init_pc_common(PCCOMMON_KEYBOARD_PC, pc_set_keyb_int, pc_set_irq_line); |
| 385 | 459 | } |
| 386 | 460 | |
| 387 | 461 | DRIVER_INIT( pc1512 ) |
| r2376 | r2377 | |
| 402 | 476 | memory_install_read16_handler(0, ADDRESS_SPACE_IO, 0x278, 0x27b, 0, 0, pc16le_parallelport2_r ); |
| 403 | 477 | |
| 404 | 478 | |
| 405 | | mess_init_pc_common(PCCOMMON_KEYBOARD_PC); |
| 479 | mess_init_pc_common(PCCOMMON_KEYBOARD_PC, pc_set_keyb_int, pc_set_irq_line); |
| 406 | 480 | mc146818_init(MC146818_IGNORE_CENTURY); |
| 407 | 481 | } |
| 408 | 482 | |
| r2376 | r2377 | |
| 465 | 539 | memory_install_read16_handler(0, ADDRESS_SPACE_IO, 0x278, 0x27b, 0, 0, pc1640_16le_port278_r ); |
| 466 | 540 | memory_install_read16_handler(0, ADDRESS_SPACE_IO, 0x4278, 0x427b, 0, 0, pc1640_16le_port4278_r ); |
| 467 | 541 | |
| 468 | | mess_init_pc_common(PCCOMMON_KEYBOARD_PC); |
| 542 | mess_init_pc_common(PCCOMMON_KEYBOARD_PC, pc_set_keyb_int, pc_set_irq_line); |
| 469 | 543 | |
| 470 | 544 | mc146818_init(MC146818_IGNORE_CENTURY); |
| 471 | 545 | } |
| 472 | 546 | |
| 473 | 547 | DRIVER_INIT( pc_vga ) |
| 474 | 548 | { |
| 475 | | mess_init_pc_common(PCCOMMON_KEYBOARD_PC); |
| 549 | mess_init_pc_common(PCCOMMON_KEYBOARD_PC, pc_set_keyb_int, pc_set_irq_line); |
| 476 | 550 | ppi8255_init(&pc_ppi8255_interface); |
| 477 | 551 | |
| 478 | 552 | pc_vga_init(machine, &vga_interface, NULL); |
| r2376 | r2377 | |
| 480 | 554 | |
| 481 | 555 | static IRQ_CALLBACK(pc_irq_callback) |
| 482 | 556 | { |
| 483 | | return pic8259_acknowledge(0); |
| 557 | return pic8259_acknowledge( pc_devices.pic8259_master ); |
| 484 | 558 | } |
| 485 | 559 | |
| 486 | 560 | |
| r2376 | r2377 | |
| 492 | 566 | MACHINE_RESET( pc ) |
| 493 | 567 | { |
| 494 | 568 | cpunum_set_irq_callback(0, pc_irq_callback); |
| 569 | |
| 570 | pc_devices.pic8259_master = (device_config*)device_list_find_by_tag( machine->config->devicelist, PIC8259, "pic8259_master" ); |
| 571 | pc_devices.pic8259_slave = (device_config*)device_list_find_by_tag( machine->config->devicelist, PIC8259, "pic8259_slave" ); |
| 572 | pc_devices.dma8237_1 = (device_config*)device_list_find_by_tag( machine->config->devicelist, DMA8237, "dma8237_1" ); |
| 573 | pc_devices.dma8237_2 = (device_config*)device_list_find_by_tag( machine->config->devicelist, DMA8237, "dma8237_2" ); |
| 495 | 574 | } |
| 496 | 575 | |
| 497 | 576 | |
src/mess/machine/compis.c
| r2376 | r2377 | |
| 93 | 93 | struct mem_state mem; |
| 94 | 94 | } i186; |
| 95 | 95 | |
| 96 | static struct { |
| 97 | const device_config *pic8259_master; |
| 98 | const device_config *pic8259_slave; |
| 99 | } compis_devices; |
| 100 | |
| 96 | 101 | /* Keyboard */ |
| 97 | 102 | static const UINT8 compis_keyb_codes[6][16] = { |
| 98 | 103 | {0x39, 0x32, 0x29, 0x20, 0x17, 0x0e, 0x05, 0x56, 0x4d, 0x44, 0x08, 0x57, 0x59, 0x4e, 0x43, 0x3a}, |
| r2376 | r2377 | |
| 198 | 203 | |
| 199 | 204 | static void compis_osp_pic_irq(UINT8 irq) |
| 200 | 205 | { |
| 201 | | pic8259_set_irq_line(0, irq, 1); |
| 202 | | pic8259_set_irq_line(0, irq, 0); |
| 206 | if ( compis_devices.pic8259_master ) { |
| 207 | pic8259_set_irq_line(compis_devices.pic8259_master, irq, 1); |
| 208 | pic8259_set_irq_line(compis_devices.pic8259_master, irq, 0); |
| 209 | } |
| 203 | 210 | } |
| 204 | 211 | |
| 205 | | READ16_HANDLER ( compis_osp_pic_r ) |
| 212 | READ16_DEVICE_HANDLER ( compis_osp_pic_r ) |
| 206 | 213 | { |
| 207 | | return pic8259_0_r(machine, offset); |
| 214 | return pic8259_r(device, offset); |
| 208 | 215 | } |
| 209 | 216 | |
| 210 | | WRITE16_HANDLER ( compis_osp_pic_w ) |
| 217 | WRITE16_DEVICE_HANDLER ( compis_osp_pic_w ) |
| 211 | 218 | { |
| 212 | | pic8259_0_w(machine, offset, data); |
| 219 | pic8259_w(device, offset, data); |
| 213 | 220 | } |
| 214 | 221 | |
| 215 | 222 | /*-------------------------------------------------------------------------*/ |
| r2376 | r2377 | |
| 1540 | 1547 | /* Name: compis */ |
| 1541 | 1548 | /* Desc: Driver - Init */ |
| 1542 | 1549 | /*-------------------------------------------------------------------------*/ |
| 1543 | | static void compis_pic_set_int_line(int which, int interrupt) |
| 1544 | | { |
| 1545 | | switch(which) |
| 1546 | | { |
| 1547 | | case 0: |
| 1548 | | /* Master */ |
| 1549 | | cpunum_set_input_line(Machine, 0, 0, interrupt ? HOLD_LINE : CLEAR_LINE); |
| 1550 | | break; |
| 1551 | 1550 | |
| 1552 | | case 1: |
| 1553 | | /* Slave */ |
| 1554 | | pic8259_set_irq_line(0, 2, interrupt); |
| 1555 | | break; |
| 1551 | /************************************************************* |
| 1552 | * |
| 1553 | * pic8259 configuration |
| 1554 | * |
| 1555 | *************************************************************/ |
| 1556 | |
| 1557 | static PIC8259_SET_INT_LINE( compis_pic8259_master_set_int_line ) { |
| 1558 | cpunum_set_input_line(device->machine, 0, 0, interrupt ? HOLD_LINE : CLEAR_LINE); |
| 1559 | } |
| 1560 | |
| 1561 | |
| 1562 | static PIC8259_SET_INT_LINE( compis_pic8259_slave_set_int_line ) { |
| 1563 | if ( compis_devices.pic8259_master ) { |
| 1564 | pic8259_set_irq_line( compis_devices.pic8259_master, 2, interrupt); |
| 1556 | 1565 | } |
| 1557 | 1566 | } |
| 1558 | 1567 | |
| 1568 | |
| 1569 | const struct pic8259_interface compis_pic8259_master_config = { |
| 1570 | compis_pic8259_master_set_int_line |
| 1571 | }; |
| 1572 | |
| 1573 | |
| 1574 | const struct pic8259_interface compis_pic8259_slave_config = { |
| 1575 | compis_pic8259_slave_set_int_line |
| 1576 | }; |
| 1577 | |
| 1578 | |
| 1559 | 1579 | static IRQ_CALLBACK(compis_irq_callback) |
| 1560 | 1580 | { |
| 1561 | | return pic8259_acknowledge(0); |
| 1581 | return pic8259_acknowledge( compis_devices.pic8259_master); |
| 1562 | 1582 | } |
| 1563 | 1583 | |
| 1564 | 1584 | static const compis_gdc_interface i82720_interface = |
| r2376 | r2377 | |
| 1567 | 1587 | 0x8000 |
| 1568 | 1588 | }; |
| 1569 | 1589 | |
| 1590 | |
| 1570 | 1591 | DRIVER_INIT( compis ) |
| 1571 | 1592 | { |
| 1572 | 1593 | compis_init( &i82720_interface ); |
| 1573 | 1594 | cpunum_set_irq_callback(0, compis_irq_callback); |
| 1574 | | pic8259_init(2, compis_pic_set_int_line); |
| 1575 | 1595 | memset (&compis, 0, sizeof (compis) ); |
| 1576 | 1596 | } |
| 1577 | 1597 | |
| r2376 | r2377 | |
| 1602 | 1622 | |
| 1603 | 1623 | /* OSP PIC 8259 */ |
| 1604 | 1624 | cpunum_set_irq_callback(0, compis_irq_callback); |
| 1625 | |
| 1626 | compis_devices.pic8259_master = (device_config*)device_list_find_by_tag( machine->config->devicelist, PIC8259, "pic8259_master" ); |
| 1627 | compis_devices.pic8259_slave = (device_config*)device_list_find_by_tag( machine->config->devicelist, PIC8259, "pic8259_slave" ); |
| 1605 | 1628 | } |
| 1606 | 1629 | |
| 1607 | 1630 | /*-------------------------------------------------------------------------*/ |
src/mess/drivers/pasogo.c
| r2376 | r2377 | |
| 294 | 294 | |
| 295 | 295 | static ADDRESS_MAP_START(pasogo_io, ADDRESS_SPACE_IO, 8) |
| 296 | 296 | // ADDRESS_MAP_GLOBAL_MASK(0xfFFF) |
| 297 | | AM_RANGE(0x0020, 0x0021) AM_READWRITE(pic8259_0_r, pic8259_0_w) |
| 297 | AM_RANGE(0x0020, 0x0021) AM_DEVREADWRITE(PIC8259, "pic8259", pic8259_r, pic8259_w) |
| 298 | 298 | AM_RANGE(0x26, 0x27) AM_READWRITE(vg230_io_r, vg230_io_w ) |
| 299 | 299 | AM_RANGE(0x0040, 0x0043) AM_DEVREADWRITE(PIT8254, "pit8254", pit8253_r, pit8253_w) |
| 300 | 300 | AM_RANGE(0x6c, 0x6f) AM_READWRITE(ems_r, ems_w ) |
| r2376 | r2377 | |
| 394 | 394 | |
| 395 | 395 | static IRQ_CALLBACK(pasogo_irq_callback) |
| 396 | 396 | { |
| 397 | | return pic8259_acknowledge(0); |
| 397 | return pic8259_acknowledge( (device_config*)device_list_find_by_tag( machine->config->devicelist, PIC8259, "pic8259")); |
| 398 | 398 | } |
| 399 | 399 | |
| 400 | 400 | static MACHINE_RESET( pasogo ) |
| r2376 | r2377 | |
| 406 | 406 | |
| 407 | 407 | static PIT8253_OUTPUT_CHANGED( pc_timer0_w ) |
| 408 | 408 | { |
| 409 | | pic8259_set_irq_line(0, 0, state); |
| 409 | pic8259_set_irq_line((device_config*)device_list_find_by_tag( device->machine->config->devicelist, PIC8259, "pic8259"), 0, state); |
| 410 | 410 | } |
| 411 | 411 | |
| 412 | 412 | static const struct pit8253_config pc_pit8254_config = |
| r2376 | r2377 | |
| 428 | 428 | } |
| 429 | 429 | }; |
| 430 | 430 | |
| 431 | |
| 432 | static PIC8259_SET_INT_LINE( pasogo_pic8259_set_int_line ) { |
| 433 | cpunum_set_input_line(device->machine, 0, 0, interrupt ? HOLD_LINE : CLEAR_LINE); |
| 434 | } |
| 435 | |
| 436 | |
| 437 | static const struct pic8259_interface pasogo_pic8259_config = { |
| 438 | pasogo_pic8259_set_int_line |
| 439 | }; |
| 440 | |
| 441 | |
| 431 | 442 | static MACHINE_DRIVER_START( pasogo ) |
| 432 | 443 | MDRV_CPU_ADD_TAG("main", I80188/*V30HL in vadem vg230*/, 10000000/*?*/) |
| 433 | 444 | MDRV_CPU_PROGRAM_MAP(pasogo_mem, 0) |
| r2376 | r2377 | |
| 439 | 450 | MDRV_DEVICE_ADD( "pit8254", PIT8254 ) |
| 440 | 451 | MDRV_DEVICE_CONFIG( pc_pit8254_config ) |
| 441 | 452 | |
| 453 | MDRV_DEVICE_ADD( "pic8259", PIC8259 ) |
| 454 | MDRV_DEVICE_CONFIG( pasogo_pic8259_config ) |
| 455 | |
| 442 | 456 | MDRV_SCREEN_ADD("main", LCD) |
| 443 | 457 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 444 | 458 | MDRV_SCREEN_REFRESH_RATE(60) |
| r2376 | r2377 | |
| 463 | 477 | ROM_REGION(0x100000,REGION_USER1, 0) |
| 464 | 478 | ROM_END |
| 465 | 479 | |
| 466 | | static void pasogo_pic_set_int_line(int which, int interrupt) |
| 467 | | { |
| 468 | | cpunum_set_input_line(Machine, 0, 0, interrupt ? HOLD_LINE : CLEAR_LINE); |
| 469 | | } |
| 470 | 480 | |
| 471 | 481 | static DRIVER_INIT( pasogo ) |
| 472 | 482 | { |
| r2376 | r2377 | |
| 474 | 484 | memset(&ems, 0, sizeof(ems)); |
| 475 | 485 | memory_set_bankptr( 27, memory_region(REGION_USER1) + 0x00000 ); |
| 476 | 486 | memory_set_bankptr( 28, memory_region(REGION_CPU1) + 0xb8000/*?*/ ); |
| 477 | | pic8259_init(1, pasogo_pic_set_int_line); |
| 478 | 487 | } |
| 479 | 488 | |
| 480 | 489 | |
src/mess/drivers/at.c
| r2376 | r2377 | |
| 104 | 104 | |
| 105 | 105 | |
| 106 | 106 | |
| 107 | | static READ8_HANDLER(at_dma8237_1_r) |
| 107 | static READ8_DEVICE_HANDLER(at_dma8237_1_r) |
| 108 | 108 | { |
| 109 | | return dma8237_r( (device_config*)device_list_find_by_tag( machine->config->devicelist, DMA8237, "dma8237_2" ), offset / 2); |
| 109 | return dma8237_r( device, offset / 2); |
| 110 | 110 | } |
| 111 | 111 | |
| 112 | | static WRITE8_HANDLER(at_dma8237_1_w) |
| 112 | static WRITE8_DEVICE_HANDLER(at_dma8237_1_w) |
| 113 | 113 | { |
| 114 | | dma8237_w( (device_config*)device_list_find_by_tag( machine->config->devicelist, DMA8237, "dma8237_2" ), offset / 2, data); |
| 114 | dma8237_w( device, offset / 2, data); |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | | static READ32_HANDLER(at32_dma8237_1_r) |
| 118 | | { |
| 119 | | return read32le_with_read8_handler(at_dma8237_1_r, machine, offset, mem_mask); |
| 120 | | } |
| 121 | | |
| 122 | | static WRITE32_HANDLER(at32_dma8237_1_w) |
| 123 | | { |
| 124 | | write32le_with_write8_handler(at_dma8237_1_w, machine, offset, data, mem_mask); |
| 125 | | } |
| 126 | | |
| 127 | 117 | DEV_READWRITE8TO32LE_LSB( at_pit8254_32le, pit8253_r, pit8253_w ) |
| 128 | 118 | DEV_READWRITE8TO32LE_LSB( at_dma8237_32le, dma8237_r, dma8237_w ) |
| 119 | DEV_READWRITE8TO32LE( at_pic8259_32le, pic8259_r, pic8259_w ) |
| 120 | DEV_READWRITE8TO32LE( at_dma8237_1_32le, at_dma8237_1_r, at_dma8237_1_w ) |
| 129 | 121 | |
| 130 | 122 | |
| 131 | 123 | static ADDRESS_MAP_START(at_io, ADDRESS_SPACE_IO, 8) |
| 132 | 124 | AM_RANGE(0x0000, 0x001f) AM_DEVREADWRITE(DMA8237, "dma8237_1", dma8237_r, dma8237_w) |
| 133 | | AM_RANGE(0x0020, 0x003f) AM_READWRITE(pic8259_0_r, pic8259_0_w) |
| 125 | AM_RANGE(0x0020, 0x003f) AM_DEVREADWRITE(PIC8259, "pic8259_master", pic8259_r, pic8259_w) |
| 134 | 126 | AM_RANGE(0x0040, 0x005f) AM_DEVREADWRITE(PIT8254, AT_PIT8254, pit8253_r, pit8253_w) |
| 135 | 127 | AM_RANGE(0x0060, 0x006f) AM_READWRITE(kbdc8042_8_r, kbdc8042_8_w) |
| 136 | 128 | AM_RANGE(0x0070, 0x007f) AM_READWRITE(mc146818_port_r, mc146818_port_w) |
| 137 | 129 | AM_RANGE(0x0080, 0x009f) AM_READWRITE(at_page8_r, at_page8_w) |
| 138 | | AM_RANGE(0x00a0, 0x00bf) AM_READWRITE(pic8259_1_r, pic8259_1_w) |
| 139 | | AM_RANGE(0x00c0, 0x00df) AM_READWRITE(at_dma8237_1_r, at_dma8237_1_w) |
| 130 | AM_RANGE(0x00a0, 0x00bf) AM_DEVREADWRITE(PIC8259, "pic8259_slave", pic8259_r, pic8259_w) |
| 131 | AM_RANGE(0x00c0, 0x00df) AM_DEVREADWRITE(DMA8237, "dma8237_2", at_dma8237_1_r, at_dma8237_1_w) |
| 140 | 132 | AM_RANGE(0x01f0, 0x01f7) AM_READWRITE(at_mfm_0_r, at_mfm_0_w) |
| 141 | 133 | AM_RANGE(0x0200, 0x0207) AM_READWRITE(pc_JOY_r, pc_JOY_w) |
| 142 | 134 | AM_RANGE(0x0220, 0x022f) AM_READWRITE(soundblaster_r, soundblaster_w) |
| r2376 | r2377 | |
| 171 | 163 | |
| 172 | 164 | static ADDRESS_MAP_START(at386_io, ADDRESS_SPACE_IO, 32) |
| 173 | 165 | AM_RANGE(0x0000, 0x001f) AM_DEVREADWRITE(DMA8237, "dma8237_1", at_dma8237_32le_r, at_dma8237_32le_w) |
| 174 | | AM_RANGE(0x0020, 0x003f) AM_READWRITE(pic8259_32le_0_r, pic8259_32le_0_w) |
| 166 | AM_RANGE(0x0020, 0x003f) AM_DEVREADWRITE(PIC8259, "pic8259_master", at_pic8259_32le_r, at_pic8259_32le_w) |
| 175 | 167 | AM_RANGE(0x0040, 0x005f) AM_DEVREADWRITE(PIT8254, AT_PIT8254, at_pit8254_32le_r, at_pit8254_32le_w) |
| 176 | 168 | AM_RANGE(0x0060, 0x006f) AM_READWRITE(kbdc8042_32le_r, kbdc8042_32le_w) |
| 177 | 169 | AM_RANGE(0x0070, 0x007f) AM_READWRITE(mc146818_port32le_r, mc146818_port32le_w) |
| 178 | 170 | AM_RANGE(0x0080, 0x009f) AM_READWRITE(at_page32_r, at_page32_w) |
| 179 | | AM_RANGE(0x00a0, 0x00bf) AM_READWRITE(pic8259_32le_1_r, pic8259_32le_1_w) |
| 180 | | AM_RANGE(0x00c0, 0x00df) AM_READWRITE(at32_dma8237_1_r, at32_dma8237_1_w) |
| 171 | AM_RANGE(0x00a0, 0x00bf) AM_DEVREADWRITE(PIC8259, "pic8259_slave", at_pic8259_32le_r, at_pic8259_32le_w) |
| 172 | AM_RANGE(0x00c0, 0x00df) AM_DEVREADWRITE(DMA8237, "dma8237_2", at_dma8237_1_32le_r, at_dma8237_1_32le_w) |
| 181 | 173 | AM_RANGE(0x0278, 0x027f) AM_READWRITE(pc32le_parallelport2_r, pc32le_parallelport2_w) |
| 182 | 174 | AM_RANGE(0x02e8, 0x02ef) AM_READWRITE(uart8250_32le_3_r, uart8250_32le_3_w) |
| 183 | 175 | AM_RANGE(0x02f8, 0x02ff) AM_READWRITE(uart8250_32le_1_r, uart8250_32le_1_w) |
| r2376 | r2377 | |
| 193 | 185 | |
| 194 | 186 | static ADDRESS_MAP_START(at586_io, ADDRESS_SPACE_IO, 32) |
| 195 | 187 | AM_RANGE(0x0000, 0x001f) AM_DEVREADWRITE(DMA8237, "dma8237_1", at_dma8237_32le_r, at_dma8237_32le_w) |
| 196 | | AM_RANGE(0x0020, 0x003f) AM_READWRITE(pic8259_32le_0_r, pic8259_32le_0_w) |
| 188 | AM_RANGE(0x0020, 0x003f) AM_DEVREADWRITE(PIC8259, "pic8259_master", at_pic8259_32le_r, at_pic8259_32le_w) |
| 197 | 189 | AM_RANGE(0x0040, 0x005f) AM_DEVREADWRITE(PIT8254, AT_PIT8254, at_pit8254_32le_r, at_pit8254_32le_w) |
| 198 | 190 | AM_RANGE(0x0060, 0x006f) AM_READWRITE(kbdc8042_32le_r, kbdc8042_32le_w) |
| 199 | 191 | AM_RANGE(0x0070, 0x007f) AM_READWRITE(mc146818_port32le_r, mc146818_port32le_w) |
| 200 | 192 | AM_RANGE(0x0080, 0x009f) AM_READWRITE(at_page32_r, at_page32_w) |
| 201 | | AM_RANGE(0x00a0, 0x00bf) AM_READWRITE(pic8259_32le_1_r, pic8259_32le_1_w) |
| 202 | | AM_RANGE(0x00c0, 0x00df) AM_READWRITE(at32_dma8237_1_r, at32_dma8237_1_w) |
| 193 | AM_RANGE(0x00a0, 0x00bf) AM_DEVREADWRITE(PIC8259, "pic8259_slave", at_pic8259_32le_r, at_pic8259_32le_w) |
| 194 | AM_RANGE(0x00c0, 0x00df) AM_DEVREADWRITE(DMA8237, "dma8237_2", at_dma8237_1_32le_r, at_dma8237_1_32le_w) |
| 203 | 195 | AM_RANGE(0x0278, 0x027f) AM_READWRITE(pc32le_parallelport2_r, pc32le_parallelport2_w) |
| 204 | 196 | AM_RANGE(0x02e8, 0x02ef) AM_READWRITE(uart8250_32le_3_r, uart8250_32le_3_w) |
| 205 | 197 | AM_RANGE(0x02f8, 0x02ff) AM_READWRITE(uart8250_32le_1_r, uart8250_32le_1_w) |
| r2376 | r2377 | |
| 420 | 412 | #endif |
| 421 | 413 | |
| 422 | 414 | |
| 423 | | static PIT8253_OUTPUT_CHANGED( pc_timer0_w ) |
| 424 | | { |
| 425 | | pic8259_set_irq_line(0, 0, state); |
| 426 | | } |
| 427 | | |
| 428 | | |
| 429 | | static const struct pit8253_config at_pit8254_config = |
| 430 | | { |
| 431 | | { |
| 432 | | { |
| 433 | | 4772720/4, /* heartbeat IRQ */ |
| 434 | | pc_timer0_w, |
| 435 | | NULL |
| 436 | | }, { |
| 437 | | 4772720/4, /* dram refresh */ |
| 438 | | NULL, |
| 439 | | NULL |
| 440 | | }, { |
| 441 | | 4772720/4, /* pio port c pin 4, and speaker polling enough */ |
| 442 | | NULL, |
| 443 | | pc_sh_speaker_change_clock |
| 444 | | } |
| 445 | | } |
| 446 | | }; |
| 447 | | |
| 448 | | |
| 449 | | |
| 450 | 415 | #define MDRV_CPU_ATPC(mem, port, type, clock) \ |
| 451 | 416 | MDRV_CPU_ADD_TAG("main", type, clock) \ |
| 452 | 417 | MDRV_CPU_PROGRAM_MAP(mem##_map, 0) \ |
| r2376 | r2377 | |
| 466 | 431 | MDRV_DEVICE_ADD( "dma8237_2", DMA8237 ) |
| 467 | 432 | MDRV_DEVICE_CONFIG( at_dma8237_2_config ) |
| 468 | 433 | |
| 434 | MDRV_DEVICE_ADD( "pic8259_master", PIC8259 ) |
| 435 | MDRV_DEVICE_CONFIG( at_pic8259_master_config ) |
| 436 | |
| 437 | MDRV_DEVICE_ADD( "pic8259_slave", PIC8259 ) |
| 438 | MDRV_DEVICE_CONFIG( at_pic8259_slave_config ) |
| 439 | |
| 469 | 440 | MDRV_MACHINE_START( at ) |
| 470 | 441 | MDRV_MACHINE_RESET( at ) |
| 471 | 442 | |
| r2376 | r2377 | |
| 510 | 481 | MDRV_DEVICE_ADD( "dma8237_2", DMA8237 ) |
| 511 | 482 | MDRV_DEVICE_CONFIG( at_dma8237_2_config ) |
| 512 | 483 | |
| 484 | MDRV_DEVICE_ADD( "pic8259_master", PIC8259 ) |
| 485 | MDRV_DEVICE_CONFIG( at_pic8259_master_config ) |
| 486 | |
| 487 | MDRV_DEVICE_ADD( "pic8259_slave", PIC8259 ) |
| 488 | MDRV_DEVICE_CONFIG( at_pic8259_slave_config ) |
| 489 | |
| 490 | MDRV_MACHINE_START( at ) |
| 491 | MDRV_MACHINE_RESET( at ) |
| 492 | |
| 513 | 493 | MDRV_IMPORT_FROM( pcvideo_vga ) |
| 514 | 494 | |
| 515 | 495 | MDRV_SCREEN_MODIFY("main") |
| r2376 | r2377 | |
| 555 | 535 | MDRV_DEVICE_ADD( "dma8237_2", DMA8237 ) |
| 556 | 536 | MDRV_DEVICE_CONFIG( at_dma8237_2_config ) |
| 557 | 537 | |
| 538 | MDRV_DEVICE_ADD( "pic8259_master", PIC8259 ) |
| 539 | MDRV_DEVICE_CONFIG( at_pic8259_master_config ) |
| 540 | |
| 541 | MDRV_DEVICE_ADD( "pic8259_slave", PIC8259 ) |
| 542 | MDRV_DEVICE_CONFIG( at_pic8259_slave_config ) |
| 543 | |
| 558 | 544 | MDRV_IMPORT_FROM( pcvideo_vga ) |
| 559 | 545 | |
| 560 | 546 | MDRV_SCREEN_MODIFY("main") |
| r2376 | r2377 | |
| 609 | 595 | MDRV_DEVICE_ADD( "dma8237_2", DMA8237 ) |
| 610 | 596 | MDRV_DEVICE_CONFIG( at_dma8237_2_config ) |
| 611 | 597 | |
| 598 | MDRV_DEVICE_ADD( "pic8259_master", PIC8259 ) |
| 599 | MDRV_DEVICE_CONFIG( at_pic8259_master_config ) |
| 600 | |
| 601 | MDRV_DEVICE_ADD( "pic8259_slave", PIC8259 ) |
| 602 | MDRV_DEVICE_CONFIG( at_pic8259_slave_config ) |
| 603 | |
| 612 | 604 | MDRV_IMPORT_FROM( pcvideo_cga ) |
| 613 | 605 | |
| 614 | 606 | /* sound hardware */ |
src/mess/drivers/pc.c
| r2376 | r2377 | |
| 161 | 161 | |
| 162 | 162 | static ADDRESS_MAP_START(pc8_io, ADDRESS_SPACE_IO, 8) |
| 163 | 163 | AM_RANGE(0x0000, 0x000f) AM_DEVREADWRITE(DMA8237, "dma8237", dma8237_r, dma8237_w) |
| 164 | | AM_RANGE(0x0020, 0x0021) AM_READWRITE(pic8259_0_r, pic8259_0_w) |
| 164 | AM_RANGE(0x0020, 0x0021) AM_DEVREADWRITE(PIC8259, "pic8259_master", pic8259_r, pic8259_w) |
| 165 | 165 | AM_RANGE(0x0040, 0x0043) AM_DEVREADWRITE(PIT8253, "pit8253", pit8253_r, pit8253_w) |
| 166 | 166 | AM_RANGE(0x0060, 0x0063) AM_READWRITE(ppi8255_0_r, ppi8255_0_w) |
| 167 | 167 | AM_RANGE(0x0080, 0x0087) AM_READWRITE(pc_page_r, pc_page_w) |
| r2376 | r2377 | |
| 189 | 189 | |
| 190 | 190 | DEV_READWRITE8TO16LE_LSB( pc_pit8253_16le, pit8253_r, pit8253_w ) |
| 191 | 191 | DEV_READWRITE8TO16LE( pc_dma8237_16le, dma8237_r, dma8237_w ) |
| 192 | DEV_READWRITE8TO16LE( pc_pic8259_16le, pic8259_r, pic8259_w ) |
| 192 | 193 | READ16_HANDLER(pc_page16le_r) { return read16le_with_read8_handler(pc_page_r, machine, offset, mem_mask); } |
| 193 | 194 | WRITE16_HANDLER(pc_page16le_w) { write16le_with_write8_handler(pc_page_w, machine, offset, data, mem_mask); } |
| 194 | 195 | |
| 195 | 196 | |
| 196 | 197 | static ADDRESS_MAP_START(pc16_io, ADDRESS_SPACE_IO, 16) |
| 197 | 198 | AM_RANGE(0x0000, 0x000f) AM_DEVREADWRITE(DMA8237, "dma8237", pc_dma8237_16le_r, pc_dma8237_16le_w) |
| 198 | | AM_RANGE(0x0020, 0x0021) AM_READWRITE(pic8259_16le_0_r, pic8259_16le_0_w) |
| 199 | AM_RANGE(0x0020, 0x0021) AM_DEVREADWRITE(PIC8259, "pic8259_master", pc_pic8259_16le_r, pc_pic8259_16le_w) |
| 199 | 200 | AM_RANGE(0x0040, 0x0043) AM_DEVREADWRITE(PIT8253, "pit8253", pc_pit8253_16le_r, pc_pit8253_16le_w) |
| 200 | 201 | AM_RANGE(0x0060, 0x0063) AM_READWRITE(ppi8255_16le_0_r, ppi8255_16le_0_w) |
| 201 | 202 | AM_RANGE(0x0080, 0x0087) AM_READWRITE(pc_page16le_r, pc_page16le_w) |
| r2376 | r2377 | |
| 236 | 237 | |
| 237 | 238 | static ADDRESS_MAP_START(europc_io, ADDRESS_SPACE_IO, 8) |
| 238 | 239 | AM_RANGE(0x0000, 0x000f) AM_DEVREADWRITE(DMA8237, "dma8237", dma8237_r, dma8237_w) |
| 239 | | AM_RANGE(0x0020, 0x0021) AM_READWRITE(pic8259_0_r, pic8259_0_w) |
| 240 | AM_RANGE(0x0020, 0x0021) AM_DEVREADWRITE(PIC8259, "pic8259_master", pic8259_r, pic8259_w) |
| 240 | 241 | AM_RANGE(0x0040, 0x0043) AM_DEVREADWRITE(PIT8253, "pit8253", pit8253_r, pit8253_w) |
| 241 | 242 | AM_RANGE(0x0060, 0x0063) AM_READWRITE(europc_pio_r, europc_pio_w) |
| 242 | 243 | AM_RANGE(0x0080, 0x0087) AM_READWRITE(pc_page_r, pc_page_w) |
| r2376 | r2377 | |
| 276 | 277 | |
| 277 | 278 | static ADDRESS_MAP_START(tandy1000_io, ADDRESS_SPACE_IO, 8) |
| 278 | 279 | AM_RANGE(0x0000, 0x000f) AM_DEVREADWRITE(DMA8237, "dma8237", dma8237_r, dma8237_w) |
| 279 | | AM_RANGE(0x0020, 0x0021) AM_READWRITE(pic8259_0_r, pic8259_0_w) |
| 280 | AM_RANGE(0x0020, 0x0021) AM_DEVREADWRITE(PIC8259, "pic8259_master", pic8259_r, pic8259_w) |
| 280 | 281 | AM_RANGE(0x0040, 0x0043) AM_DEVREADWRITE(PIT8253, "pit8253", pit8253_r, pit8253_w) |
| 281 | 282 | AM_RANGE(0x0060, 0x0063) AM_READWRITE(tandy1000_pio_r, tandy1000_pio_w) |
| 282 | 283 | AM_RANGE(0x0080, 0x0087) AM_READWRITE(pc_page_r, pc_page_w) |
| r2376 | r2377 | |
| 296 | 297 | |
| 297 | 298 | static ADDRESS_MAP_START(pc200_io, ADDRESS_SPACE_IO, 16) |
| 298 | 299 | AM_RANGE(0x0000, 0x000f) AM_DEVREADWRITE(DMA8237, "dma8237", pc_dma8237_16le_r, pc_dma8237_16le_w) |
| 299 | | AM_RANGE(0x0020, 0x0021) AM_READWRITE(pic8259_16le_0_r, pic8259_16le_0_w) |
| 300 | AM_RANGE(0x0020, 0x0021) AM_DEVREADWRITE(PIC8259, "pic8259_master", pc_pic8259_16le_r, pc_pic8259_16le_w) |
| 300 | 301 | AM_RANGE(0x0040, 0x0043) AM_DEVREADWRITE(PIT8253, "pit8253", pc_pit8253_16le_r, pc_pit8253_16le_w) |
| 301 | 302 | AM_RANGE(0x0060, 0x0065) AM_READWRITE(pc1640_16le_port60_r, pc1640_16le_port60_w) |
| 302 | 303 | AM_RANGE(0x0078, 0x0079) AM_READWRITE(pc1640_16le_mouse_x_r, pc1640_16le_mouse_x_w) |
| r2376 | r2377 | |
| 329 | 330 | |
| 330 | 331 | static ADDRESS_MAP_START(pc1640_io, ADDRESS_SPACE_IO, 16) |
| 331 | 332 | AM_RANGE(0x0000, 0x000f) AM_DEVREADWRITE(DMA8237, "dma8237", pc_dma8237_16le_r, pc_dma8237_16le_w) |
| 332 | | AM_RANGE(0x0020, 0x0021) AM_READWRITE(pic8259_16le_0_r, pic8259_16le_0_w) |
| 333 | AM_RANGE(0x0020, 0x0021) AM_DEVREADWRITE(PIC8259, "pic8259_master", pc_pic8259_16le_r, pc_pic8259_16le_w) |
| 333 | 334 | AM_RANGE(0x0040, 0x0043) AM_DEVREADWRITE(PIT8253, "pit8253", pc_pit8253_16le_r, pc_pit8253_16le_w) |
| 334 | 335 | AM_RANGE(0x0060, 0x0065) AM_READWRITE(pc1640_16le_port60_r, pc1640_16le_port60_w) |
| 335 | 336 | AM_RANGE(0x0070, 0x0071) AM_READWRITE(mc146818_port16le_r, mc146818_port16le_w) |
| r2376 | r2377 | |
| 1132 | 1133 | }; |
| 1133 | 1134 | #endif |
| 1134 | 1135 | |
| 1135 | | static PIT8253_OUTPUT_CHANGED( pc_timer0_w ) |
| 1136 | | { |
| 1137 | | pic8259_set_irq_line(0, 0, state); |
| 1138 | | } |
| 1139 | | |
| 1140 | 1136 | |
| 1141 | | static const struct pit8253_config pc_pit8253_config = |
| 1142 | | { |
| 1143 | | { |
| 1144 | | { |
| 1145 | | 4772720/4, /* heartbeat IRQ */ |
| 1146 | | pc_timer0_w, |
| 1147 | | NULL |
| 1148 | | }, { |
| 1149 | | 4772720/4, /* dram refresh */ |
| 1150 | | NULL, |
| 1151 | | NULL |
| 1152 | | }, { |
| 1153 | | 4772720/4, /* pio port c pin 4, and speaker polling enough */ |
| 1154 | | NULL, |
| 1155 | | pc_sh_speaker_change_clock |
| 1156 | | } |
| 1157 | | } |
| 1158 | | }; |
| 1159 | | |
| 1160 | | |
| 1161 | 1137 | #define MDRV_CPU_PC(mem, port, type, clock, vblankfunc) \ |
| 1162 | 1138 | MDRV_CPU_ADD_TAG("main", type, clock) \ |
| 1163 | 1139 | MDRV_CPU_PROGRAM_MAP(mem##_map, 0) \ |
| r2376 | r2377 | |
| 1182 | 1158 | MDRV_DEVICE_ADD( "dma8237", DMA8237 ) |
| 1183 | 1159 | MDRV_DEVICE_CONFIG( pc_dma8237_config ) |
| 1184 | 1160 | |
| 1161 | MDRV_DEVICE_ADD( "pic8259_master", PIC8259 ) |
| 1162 | MDRV_DEVICE_CONFIG( pc_pic8259_master_config ) |
| 1163 | |
| 1164 | MDRV_DEVICE_ADD( "pic8259_slave", PIC8259 ) |
| 1165 | MDRV_DEVICE_CONFIG( pc_pic8259_slave_config ) |
| 1166 | |
| 1185 | 1167 | /* video hardware */ |
| 1186 | 1168 | MDRV_IMPORT_FROM( pcvideo_mda ) |
| 1187 | 1169 | |
| r2376 | r2377 | |
| 1223 | 1205 | MDRV_DEVICE_ADD( "dma8237", DMA8237 ) |
| 1224 | 1206 | MDRV_DEVICE_CONFIG( pc_dma8237_config ) |
| 1225 | 1207 | |
| 1208 | MDRV_DEVICE_ADD( "pic8259_master", PIC8259 ) |
| 1209 | MDRV_DEVICE_CONFIG( pc_pic8259_master_config ) |
| 1210 | |
| 1211 | MDRV_DEVICE_ADD( "pic8259_slave", PIC8259 ) |
| 1212 | MDRV_DEVICE_CONFIG( pc_pic8259_slave_config ) |
| 1213 | |
| 1226 | 1214 | /* video hardware */ |
| 1227 | 1215 | MDRV_IMPORT_FROM( pcvideo_hercules ) |
| 1228 | 1216 | |
| r2376 | r2377 | |
| 1260 | 1248 | MDRV_DEVICE_ADD( "dma8237", DMA8237 ) |
| 1261 | 1249 | MDRV_DEVICE_CONFIG( pc_dma8237_config ) |
| 1262 | 1250 | |
| 1251 | MDRV_DEVICE_ADD( "pic8259_master", PIC8259 ) |
| 1252 | MDRV_DEVICE_CONFIG( pc_pic8259_master_config ) |
| 1253 | |
| 1254 | MDRV_DEVICE_ADD( "pic8259_slave", PIC8259 ) |
| 1255 | MDRV_DEVICE_CONFIG( pc_pic8259_slave_config ) |
| 1256 | |
| 1263 | 1257 | /* video hardware */ |
| 1264 | 1258 | MDRV_IMPORT_FROM( pcvideo_cga ) |
| 1265 | 1259 | |
| r2376 | r2377 | |
| 1298 | 1292 | MDRV_DEVICE_ADD( "dma8237", DMA8237 ) |
| 1299 | 1293 | MDRV_DEVICE_CONFIG( pc_dma8237_config ) |
| 1300 | 1294 | |
| 1295 | MDRV_DEVICE_ADD( "pic8259_master", PIC8259 ) |
| 1296 | MDRV_DEVICE_CONFIG( pc_pic8259_master_config ) |
| 1297 | |
| 1298 | MDRV_DEVICE_ADD( "pic8259_slave", PIC8259 ) |
| 1299 | MDRV_DEVICE_CONFIG( pc_pic8259_slave_config ) |
| 1300 | |
| 1301 | 1301 | /* video hardware */ |
| 1302 | 1302 | MDRV_IMPORT_FROM( pcvideo_aga ) |
| 1303 | 1303 | |
| r2376 | r2377 | |
| 1332 | 1332 | MDRV_DEVICE_ADD( "dma8237", DMA8237 ) |
| 1333 | 1333 | MDRV_DEVICE_CONFIG( pc_dma8237_config ) |
| 1334 | 1334 | |
| 1335 | MDRV_DEVICE_ADD( "pic8259_master", PIC8259 ) |
| 1336 | MDRV_DEVICE_CONFIG( pc_pic8259_master_config ) |
| 1337 | |
| 1338 | MDRV_DEVICE_ADD( "pic8259_slave", PIC8259 ) |
| 1339 | MDRV_DEVICE_CONFIG( pc_pic8259_slave_config ) |
| 1340 | |
| 1335 | 1341 | /* video hardware */ |
| 1336 | 1342 | MDRV_IMPORT_FROM( pcvideo_cga ) |
| 1337 | 1343 | |
| r2376 | r2377 | |
| 1370 | 1376 | MDRV_DEVICE_ADD( "dma8237", DMA8237 ) |
| 1371 | 1377 | MDRV_DEVICE_CONFIG( pc_dma8237_config ) |
| 1372 | 1378 | |
| 1379 | MDRV_DEVICE_ADD( "pic8259_master", PIC8259 ) |
| 1380 | MDRV_DEVICE_CONFIG( pc_pic8259_master_config ) |
| 1381 | |
| 1382 | MDRV_DEVICE_ADD( "pic8259_slave", PIC8259 ) |
| 1383 | MDRV_DEVICE_CONFIG( pc_pic8259_slave_config ) |
| 1384 | |
| 1373 | 1385 | /* video hardware */ |
| 1374 | 1386 | MDRV_IMPORT_FROM( pcvideo_pc200 ) |
| 1375 | 1387 | |
| r2376 | r2377 | |
| 1397 | 1409 | MDRV_DEVICE_ADD( "dma8237", DMA8237 ) |
| 1398 | 1410 | MDRV_DEVICE_CONFIG( pc_dma8237_config ) |
| 1399 | 1411 | |
| 1412 | MDRV_DEVICE_ADD( "pic8259_master", PIC8259 ) |
| 1413 | MDRV_DEVICE_CONFIG( pc_pic8259_master_config ) |
| 1414 | |
| 1415 | MDRV_DEVICE_ADD( "pic8259_slave", PIC8259 ) |
| 1416 | MDRV_DEVICE_CONFIG( pc_pic8259_slave_config ) |
| 1417 | |
| 1400 | 1418 | /* video hardware */ |
| 1401 | 1419 | MDRV_IMPORT_FROM( pcvideo_pc1512 ) |
| 1402 | 1420 | |
| r2376 | r2377 | |
| 1426 | 1444 | MDRV_DEVICE_ADD( "dma8237", DMA8237 ) |
| 1427 | 1445 | MDRV_DEVICE_CONFIG( pc_dma8237_config ) |
| 1428 | 1446 | |
| 1447 | MDRV_DEVICE_ADD( "pic8259_master", PIC8259 ) |
| 1448 | MDRV_DEVICE_CONFIG( pc_pic8259_master_config ) |
| 1449 | |
| 1450 | MDRV_DEVICE_ADD( "pic8259_slave", PIC8259 ) |
| 1451 | MDRV_DEVICE_CONFIG( pc_pic8259_slave_config ) |
| 1452 | |
| 1429 | 1453 | /* video hardware */ |
| 1430 | 1454 | MDRV_IMPORT_FROM(pcvideo_pc1640) |
| 1431 | 1455 | MDRV_SCREEN_MODIFY("main") |
| r2376 | r2377 | |
| 1458 | 1482 | MDRV_DEVICE_ADD( "dma8237", DMA8237 ) |
| 1459 | 1483 | MDRV_DEVICE_CONFIG( pc_dma8237_config ) |
| 1460 | 1484 | |
| 1485 | MDRV_DEVICE_ADD( "pic8259_master", PIC8259 ) |
| 1486 | MDRV_DEVICE_CONFIG( pc_pic8259_master_config ) |
| 1487 | |
| 1488 | MDRV_DEVICE_ADD( "pic8259_slave", PIC8259 ) |
| 1489 | MDRV_DEVICE_CONFIG( pc_pic8259_slave_config ) |
| 1490 | |
| 1461 | 1491 | /* video hardware */ |
| 1462 | 1492 | MDRV_IMPORT_FROM( pcvideo_vga ) |
| 1463 | 1493 | MDRV_SCREEN_MODIFY("main") |
| r2376 | r2377 | |
| 1496 | 1526 | MDRV_DEVICE_ADD( "dma8237", DMA8237 ) |
| 1497 | 1527 | MDRV_DEVICE_CONFIG( pc_dma8237_config ) |
| 1498 | 1528 | |
| 1529 | MDRV_DEVICE_ADD( "pic8259_master", PIC8259 ) |
| 1530 | MDRV_DEVICE_CONFIG( pc_pic8259_master_config ) |
| 1531 | |
| 1532 | MDRV_DEVICE_ADD( "pic8259_slave", PIC8259 ) |
| 1533 | MDRV_DEVICE_CONFIG( pc_pic8259_slave_config ) |
| 1534 | |
| 1499 | 1535 | /* video hardware */ |
| 1500 | 1536 | MDRV_IMPORT_FROM( pcvideo_t1000 ) |
| 1501 | 1537 | |