src/mess/drivers/abc1600.c
| r13073 | r13074 | |
| 3 | 3 | Luxor ABC 1600 |
| 4 | 4 | |
| 5 | 5 | Skeleton driver |
| 6 | */ |
| 6 | 7 | |
| 8 | /* |
| 9 | |
| 10 | How to create HDD image: |
| 11 | ------------------------ |
| 12 | chdman -createblankhd necd5126a.chd 615 4 17 512 |
| 13 | |
| 14 | How to format HDD: |
| 15 | ------------------ |
| 16 | mf(2,0) |
| 17 | mf(2,0) |
| 18 | abcenix |
| 19 | sas/format/format |
| 20 | sa(40,0) |
| 21 | y |
| 22 | 5 |
| 23 | necd5126a |
| 24 | |
| 25 | How to install OS: |
| 26 | ------------------ |
| 27 | mf(2,0) |
| 28 | mf(2,0) |
| 29 | abcenix |
| 30 | loadsys1 |
| 31 | <enter> |
| 32 | <enter> |
| 33 | |
| 7 | 34 | */ |
| 8 | 35 | |
| 9 | 36 | /* |
| 10 | 37 | |
| 11 | 38 | TODO: |
| 12 | 39 | |
| 40 | - segment/page RAM addresses are not correctly decoded, "sas/format/format" can't find the SASI interface because of this |
| 41 | forcetask0 1 t0 0 t1 0 t2 0 t3 0 |
| 42 | sega19 0 task 0 |
| 43 | sega 000 segd 00 pga 008 pgd 4058 virtual 02c730 (should be 004730) |
| 44 | |
| 13 | 45 | - floppy |
| 14 | 46 | - internal floppy is really drive 2, but wd17xx.c doesn't like having NULL drives |
| 15 | | - BUS0I/0X/1/2 |
| 16 | 47 | - short/long reset (RSTBUT) |
| 17 | 48 | - CIO |
| 18 | 49 | - optimize timers! |
| 19 | | - vectored interrupts with status |
| 20 | | - port A bit mode, OR-PEVM, interrupt when bit=1 |
| 21 | | - port B bit mode, OR-PEVM, interrupt when bit=1 |
| 22 | | - port C, open drain output bit PC1 (RTC, NVRAM) |
| 23 | | - counter 1 disabled |
| 24 | | - counter 2 enabled, TC=000d, IE=0, output to PB0 |
| 25 | | - counter 3 enabled, TC=9c40, IE=1 |
| 50 | - port C, open drain output bit PC1 (RTC/NVRAM data) |
| 26 | 51 | - hard disk |
| 27 | | - 4105 sasi interface card |
| 28 | | - sasi interface |
| 29 | | - implement command 0x08 READ (legacy) |
| 30 | | - Xebec S1410 card |
| 31 | | - necd5126a HDD (http://stason.org/TULARC/pc/hard-drives-hdd/nec/D5126-20MB-5-25-HH-MFM-ST506.html) |
| 32 | | chdman -createblankhd necd5126a.chd 615 4 17 512 |
| 52 | - 4105 SASI interface card |
| 53 | - SASI interface (scsibus.c) |
| 33 | 54 | |
| 34 | 55 | */ |
| 35 | 56 | |
| r13073 | r13074 | |
| 41 | 62 | // CONSTANTS / MACROS |
| 42 | 63 | //************************************************************************** |
| 43 | 64 | |
| 44 | | #define LOG |
| 65 | #define LOG 1 |
| 45 | 66 | |
| 46 | 67 | |
| 47 | 68 | // MAC |
| r13073 | r13074 | |
| 621 | 642 | UINT16 page_data = m_page_ram[pga]; |
| 622 | 643 | |
| 623 | 644 | offs_t virtual_offset = ((page_data & 0x3ff) << 11) | (offset & 0x7ff); |
| 624 | | |
| 645 | |
| 625 | 646 | if (PAGE_NONX) |
| 626 | 647 | { |
| 627 | 648 | //logerror("Bus error %06x : %06x\n", offset, virtual_offset); |
| r13073 | r13074 | |
| 690 | 711 | address_space *program = m_maincpu->memory().space(AS_PROGRAM); |
| 691 | 712 | UINT8 data = 0; |
| 692 | 713 | |
| 693 | | if (!A19) |
| 714 | if (!A2 & !A1) |
| 694 | 715 | { |
| 695 | | data = read_user_memory(offset); |
| 716 | // _EP |
| 717 | data = page_r(*program, offset); |
| 696 | 718 | } |
| 697 | | else |
| 719 | else if (!A2 & A1 & A0) |
| 698 | 720 | { |
| 699 | | if (!A2 & !A1) |
| 700 | | { |
| 701 | | // _EP |
| 702 | | data = page_r(*program, offset); |
| 703 | | } |
| 704 | | else if (!A2 & A1 & A0) |
| 705 | | { |
| 706 | | // _ES |
| 707 | | data = segment_r(*program, offset); |
| 708 | | } |
| 709 | | else if (A2 & A1 & A0) |
| 710 | | { |
| 711 | | // _CAUSE |
| 712 | | data = cause_r(*program, offset); |
| 713 | | } |
| 721 | // _ES |
| 722 | data = segment_r(*program, offset); |
| 714 | 723 | } |
| 724 | else if (A2 & A1 & A0) |
| 725 | { |
| 726 | // _CAUSE |
| 727 | data = cause_r(*program, offset); |
| 728 | } |
| 715 | 729 | |
| 716 | 730 | return data; |
| 717 | 731 | } |
| r13073 | r13074 | |
| 725 | 739 | { |
| 726 | 740 | address_space *program = m_maincpu->memory().space(AS_PROGRAM); |
| 727 | 741 | |
| 728 | | if (!A19) |
| 742 | if (!A2 & !A1) |
| 729 | 743 | { |
| 730 | | write_user_memory(offset, data); |
| 744 | // _WEP |
| 745 | page_w(*program, offset, data); |
| 731 | 746 | } |
| 732 | | else |
| 747 | else if (!A2 & A1 & A0) |
| 733 | 748 | { |
| 734 | | if (!A2 & !A1) |
| 735 | | { |
| 736 | | // _WEP |
| 737 | | page_w(*program, offset, data); |
| 738 | | } |
| 739 | | else if (!A2 & A1 & A0) |
| 740 | | { |
| 741 | | // _WES |
| 742 | | segment_w(*program, offset, data); |
| 743 | | } |
| 744 | | else if (A2 & !A1 & A0) |
| 745 | | { |
| 746 | | // W(C) |
| 747 | | task_w(*program, offset, data); |
| 748 | | } |
| 749 | // _WES |
| 750 | segment_w(*program, offset, data); |
| 749 | 751 | } |
| 752 | else if (A2 & !A1 & A0) |
| 753 | { |
| 754 | // W(C) |
| 755 | task_w(*program, offset, data); |
| 756 | } |
| 750 | 757 | } |
| 751 | 758 | |
| 752 | 759 | |
| r13073 | r13074 | |
| 780 | 787 | UINT8 *rom = machine().region(MC68008P8_TAG)->base(); |
| 781 | 788 | data = rom[offset & 0x3fff]; |
| 782 | 789 | } |
| 783 | | else if (!m_ifc2 && !FC1) |
| 790 | else if (A19 && !m_ifc2 && !FC1) |
| 784 | 791 | { |
| 785 | 792 | data = read_supervisor_memory(offset); |
| 786 | 793 | } |
| r13073 | r13074 | |
| 801 | 808 | { |
| 802 | 809 | int fc = get_fc(); |
| 803 | 810 | |
| 804 | | if (!m_ifc2 && !FC1) |
| 811 | if (A19 && !m_ifc2 && !FC1) |
| 805 | 812 | { |
| 806 | 813 | write_supervisor_memory(offset, data); |
| 807 | 814 | } |
| r13073 | r13074 | |
| 1697 | 1704 | DEVCB_DEVICE_LINE_MEMBER(Z8536B1_TAG, z8536_device, pa6_w), |
| 1698 | 1705 | DEVCB_NULL, |
| 1699 | 1706 | DEVCB_NULL, |
| 1700 | | DEVCB_NULL, |
| 1707 | DEVCB_CPU_INPUT_LINE(MC68008P8_TAG, M68K_IRQ_7), |
| 1701 | 1708 | DEVCB_DEVICE_LINE_MEMBER(Z8536B1_TAG, z8536_device, pa5_w), |
| 1702 | 1709 | DEVCB_DEVICE_LINE_MEMBER(Z8536B1_TAG, z8536_device, pa4_w), |
| 1703 | 1710 | DEVCB_DEVICE_LINE_MEMBER(Z8536B1_TAG, z8536_device, pa3_w), |
| r13073 | r13074 | |
| 1713 | 1720 | |
| 1714 | 1721 | static ABC1600BUS_INTERFACE( bus2_intf ) |
| 1715 | 1722 | { |
| 1716 | | DEVCB_DEVICE_LINE_MEMBER(Z8536B1_TAG, z8536_device, pa0_w), |
| 1723 | DEVCB_DEVICE_LINE_MEMBER(Z8536B1_TAG, z8536_device, pa0_w), // really inverted but ASSERT_LINE takes care of that |
| 1717 | 1724 | DEVCB_NULL, // DEVCB_DEVICE_LINE_MEMBER(Z8410AB1_2_TAG, z80dma_device, iei_w) inverted |
| 1718 | 1725 | DEVCB_DEVICE_LINE_MEMBER(Z8410AB1_2_TAG, z80dma_device, rdy_w) |
| 1719 | 1726 | }; |
| r13073 | r13074 | |
| 1757 | 1764 | // interrupt callback |
| 1758 | 1765 | device_set_irq_callback(m_maincpu, abc1600_int_ack); |
| 1759 | 1766 | |
| 1760 | | // fill segment RAM with non-zero values or no boot |
| 1767 | // HACK fill segment RAM with non-zero values or no boot |
| 1761 | 1768 | memset(m_segment_ram, 0xcd, 0x400); |
| 1762 | 1769 | |
| 1763 | 1770 | // state saving |