trunk/hash/c64_flop.xml
| r20774 | r20775 | |
| 825 | 825 | </part> |
| 826 | 826 | </software> |
| 827 | 827 | |
| 828 | <software name="swiftlnk"> |
| 829 | <description>CMD SwiftLink</description> |
| 830 | <year>1990</year> |
| 831 | <publisher>CMD</publisher> |
| 832 | |
| 833 | <part name="flop1" interface="floppy_5_25"> |
| 834 | <feature name="part_id" value="Disk 1 Side 1"/> |
| 835 | <dataarea name="flop" size="174848"> |
| 836 | <rom name="cmd_swiftlink_utils_d1s1.d64" size="174848" crc="f70f4ff8" sha1="d70d6b0c8c2f408286ce0ea9edcfe6c5cf1af60a" offset="0" /> |
| 837 | </dataarea> |
| 838 | </part> |
| 839 | |
| 840 | <part name="flop2" interface="floppy_5_25"> |
| 841 | <feature name="part_id" value="Disk 1 Side 2"/> |
| 842 | <dataarea name="flop" size="174848"> |
| 843 | <rom name="cmd_swiftlink_utils_d1s2.d64" size="174848" crc="b9e18c85" sha1="b8b65c99ac1474b89729756adbdd969a3e9e9aa6" offset="0" /> |
| 844 | </dataarea> |
| 845 | </part> |
| 846 | |
| 847 | <part name="flop3" interface="floppy_5_25"> |
| 848 | <feature name="part_id" value="Disk 2 Side 1"/> |
| 849 | <dataarea name="flop" size="174848"> |
| 850 | <rom name="cmd_swiftlink_utils_d2s1.d64" size="174848" crc="de2828a1" sha1="6516d4674dddc58a9d7787bcb9ea55d4b4fc9898" offset="0" /> |
| 851 | </dataarea> |
| 852 | </part> |
| 853 | |
| 854 | <part name="flop4" interface="floppy_5_25"> |
| 855 | <feature name="part_id" value="Disk 2 Side 2"/> |
| 856 | <dataarea name="flop" size="175531"> |
| 857 | <rom name="cmd_swiftlink_utils_d2s2.d64" size="175531" crc="309d1b76" sha1="847b06a65238861c84dee715e48a635978647303" offset="0" /> |
| 858 | </dataarea> |
| 859 | </part> |
| 860 | |
| 861 | <part name="flop5" interface="floppy_5_25"> |
| 862 | <feature name="part_id" value="Disk 3 Side 1"/> |
| 863 | <dataarea name="flop" size="174848"> |
| 864 | <rom name="cmd_swiftlink_utils_d3s1.d64" size="174848" crc="180ff985" sha1="0b0f4c610cc5a062287ae20e41d9df78b9dc6007" offset="0" /> |
| 865 | </dataarea> |
| 866 | </part> |
| 867 | |
| 868 | <part name="flop6" interface="floppy_5_25"> |
| 869 | <feature name="part_id" value="Disk 3 Side 2"/> |
| 870 | <dataarea name="flop" size="174848"> |
| 871 | <rom name="cmd_swiftlink_utils_d3s2.d64" size="174848" crc="d2ec8d3c" sha1="02413c30f631986c17984f54dac48b9aec0904af" offset="0" /> |
| 872 | </dataarea> |
| 873 | </part> |
| 874 | </software> |
| 875 | |
| 828 | 876 | </softwarelist> |
trunk/src/mess/machine/c64_swiftlink.c
| r0 | r20775 | |
| 1 | /********************************************************************** |
| 2 | |
| 3 | CMD SwiftLink RS-232 cartridge emulation |
| 4 | |
| 5 | Copyright MESS Team. |
| 6 | Visit http://mamedev.org for licensing and usage restrictions. |
| 7 | |
| 8 | **********************************************************************/ |
| 9 | |
| 10 | /* |
| 11 | |
| 12 | http://mclauchlan.site.net.au/scott/C=Hacking/C-Hacking10/C-Hacking10-swiftlink.html |
| 13 | |
| 14 | */ |
| 15 | |
| 16 | #include "c64_swiftlink.h" |
| 17 | |
| 18 | |
| 19 | |
| 20 | //************************************************************************** |
| 21 | // MACROS/CONSTANTS |
| 22 | //************************************************************************** |
| 23 | |
| 24 | #define MOS6551_TAG "mos6551" |
| 25 | |
| 26 | |
| 27 | |
| 28 | //************************************************************************** |
| 29 | // DEVICE DEFINITIONS |
| 30 | //************************************************************************** |
| 31 | |
| 32 | const device_type C64_SWIFTLINK = &device_creator<c64_swiftlink_cartridge_device>; |
| 33 | |
| 34 | |
| 35 | //------------------------------------------------- |
| 36 | // MACHINE_CONFIG_FRAGMENT( c64_swiftlink ) |
| 37 | //------------------------------------------------- |
| 38 | |
| 39 | static MACHINE_CONFIG_FRAGMENT( c64_swiftlink ) |
| 40 | MCFG_MOS6551_ADD(MOS6551_TAG, XTAL_3_6864MHz, DEVWRITELINE(DEVICE_SELF, c64_swiftlink_cartridge_device, acia_irq_w)) |
| 41 | MACHINE_CONFIG_END |
| 42 | |
| 43 | |
| 44 | //------------------------------------------------- |
| 45 | // machine_config_additions - device-specific |
| 46 | // machine configurations |
| 47 | //------------------------------------------------- |
| 48 | |
| 49 | machine_config_constructor c64_swiftlink_cartridge_device::device_mconfig_additions() const |
| 50 | { |
| 51 | return MACHINE_CONFIG_NAME( c64_swiftlink ); |
| 52 | } |
| 53 | |
| 54 | |
| 55 | //------------------------------------------------- |
| 56 | // INPUT_PORTS( c64_swiftlink ) |
| 57 | //------------------------------------------------- |
| 58 | |
| 59 | static INPUT_PORTS_START( c64_swiftlink ) |
| 60 | PORT_START("CS") |
| 61 | PORT_DIPNAME( 0x03, 0x01, "Base Address" ) |
| 62 | PORT_DIPSETTING( 0x00, "$D700 (C128)" ) |
| 63 | PORT_DIPSETTING( 0x01, "$DE00" ) |
| 64 | PORT_DIPSETTING( 0x02, "$DF00" ) |
| 65 | |
| 66 | PORT_START("IRQ") |
| 67 | PORT_DIPNAME( 0x01, 0x01, "Interrupt" ) |
| 68 | PORT_DIPSETTING( 0x00, "IRQ (C128)" ) |
| 69 | PORT_DIPSETTING( 0x01, "NMI" ) |
| 70 | INPUT_PORTS_END |
| 71 | |
| 72 | |
| 73 | //------------------------------------------------- |
| 74 | // input_ports - device-specific input ports |
| 75 | //------------------------------------------------- |
| 76 | |
| 77 | ioport_constructor c64_swiftlink_cartridge_device::device_input_ports() const |
| 78 | { |
| 79 | return INPUT_PORTS_NAME( c64_swiftlink ); |
| 80 | } |
| 81 | |
| 82 | |
| 83 | |
| 84 | //************************************************************************** |
| 85 | // LIVE DEVICE |
| 86 | //************************************************************************** |
| 87 | |
| 88 | //------------------------------------------------- |
| 89 | // c64_swiftlink_cartridge_device - constructor |
| 90 | //------------------------------------------------- |
| 91 | |
| 92 | c64_swiftlink_cartridge_device::c64_swiftlink_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 93 | device_t(mconfig, C64_SWIFTLINK, "C64 SwiftLink cartridge", tag, owner, clock), |
| 94 | device_c64_expansion_card_interface(mconfig, *this), |
| 95 | m_acia(*this, MOS6551_TAG), |
| 96 | m_io_cs(*this, "CS"), |
| 97 | m_io_irq(*this, "IRQ") |
| 98 | { |
| 99 | } |
| 100 | |
| 101 | |
| 102 | //------------------------------------------------- |
| 103 | // device_start - device-specific startup |
| 104 | //------------------------------------------------- |
| 105 | |
| 106 | void c64_swiftlink_cartridge_device::device_start() |
| 107 | { |
| 108 | } |
| 109 | |
| 110 | |
| 111 | //------------------------------------------------- |
| 112 | // device_reset - device-specific reset |
| 113 | //------------------------------------------------- |
| 114 | |
| 115 | void c64_swiftlink_cartridge_device::device_reset() |
| 116 | { |
| 117 | m_acia->reset(); |
| 118 | |
| 119 | m_cs = m_io_cs->read(); |
| 120 | m_irq = m_io_irq->read(); |
| 121 | } |
| 122 | |
| 123 | |
| 124 | //------------------------------------------------- |
| 125 | // c64_cd_r - cartridge data read |
| 126 | //------------------------------------------------- |
| 127 | |
| 128 | UINT8 c64_swiftlink_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) |
| 129 | { |
| 130 | if (((m_cs == DE00) && !io1) || ((m_cs == DF00) && !io2) || |
| 131 | ((m_cs == D700) && ((offset & 0xff00) == 0xd700))) |
| 132 | { |
| 133 | data = m_acia->read(space, offset & 0x03); |
| 134 | } |
| 135 | |
| 136 | return data; |
| 137 | } |
| 138 | |
| 139 | |
| 140 | //------------------------------------------------- |
| 141 | // c64_cd_w - cartridge data write |
| 142 | //------------------------------------------------- |
| 143 | |
| 144 | void c64_swiftlink_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) |
| 145 | { |
| 146 | if (((m_cs == DE00) && !io1) || ((m_cs == DF00) && !io2) || |
| 147 | ((m_cs == D700) && ((offset & 0xff00) == 0xd700))) |
| 148 | { |
| 149 | m_acia->write(space, offset & 0x03, data); |
| 150 | } |
| 151 | } |
| 152 | |
| 153 | |
| 154 | //------------------------------------------------- |
| 155 | // acia_irq_w - |
| 156 | //------------------------------------------------- |
| 157 | |
| 158 | WRITE_LINE_MEMBER( c64_swiftlink_cartridge_device::acia_irq_w ) |
| 159 | { |
| 160 | switch (m_irq) |
| 161 | { |
| 162 | case IRQ: m_slot->irq_w(state); break; |
| 163 | case NMI: m_slot->nmi_w(state); break; |
| 164 | } |
| 165 | } |
trunk/src/mess/machine/c64_swiftlink.h
| r0 | r20775 | |
| 1 | /********************************************************************** |
| 2 | |
| 3 | CMD SwiftLink RS-232 cartridge emulation |
| 4 | |
| 5 | Copyright MESS Team. |
| 6 | Visit http://mamedev.org for licensing and usage restrictions. |
| 7 | |
| 8 | **********************************************************************/ |
| 9 | |
| 10 | #pragma once |
| 11 | |
| 12 | #ifndef __SWIFTLINK__ |
| 13 | #define __SWIFTLINK__ |
| 14 | |
| 15 | |
| 16 | #include "emu.h" |
| 17 | #include "machine/c64exp.h" |
| 18 | #include "machine/mos6551.h" |
| 19 | |
| 20 | |
| 21 | |
| 22 | //************************************************************************** |
| 23 | // TYPE DEFINITIONS |
| 24 | //************************************************************************** |
| 25 | |
| 26 | // ======================> c64_swiftlink_cartridge_device |
| 27 | |
| 28 | class c64_swiftlink_cartridge_device : public device_t, |
| 29 | public device_c64_expansion_card_interface |
| 30 | { |
| 31 | public: |
| 32 | // construction/destruction |
| 33 | c64_swiftlink_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 34 | |
| 35 | // optional information overrides |
| 36 | virtual machine_config_constructor device_mconfig_additions() const; |
| 37 | virtual ioport_constructor device_input_ports() const; |
| 38 | |
| 39 | DECLARE_WRITE_LINE_MEMBER( acia_irq_w ); |
| 40 | |
| 41 | protected: |
| 42 | // device-level overrides |
| 43 | virtual void device_config_complete() { m_shortname = "c64_swiftlink"; } |
| 44 | virtual void device_start(); |
| 45 | virtual void device_reset(); |
| 46 | |
| 47 | // device_c64_expansion_card_interface overrides |
| 48 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); |
| 49 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); |
| 50 | |
| 51 | private: |
| 52 | required_device<mos6551_device> m_acia; |
| 53 | required_ioport m_io_cs; |
| 54 | required_ioport m_io_irq; |
| 55 | |
| 56 | enum |
| 57 | { |
| 58 | D700 = 0, |
| 59 | DE00, |
| 60 | DF00 |
| 61 | }; |
| 62 | |
| 63 | enum |
| 64 | { |
| 65 | IRQ = 0, |
| 66 | NMI |
| 67 | }; |
| 68 | |
| 69 | int m_cs; |
| 70 | int m_irq; |
| 71 | }; |
| 72 | |
| 73 | |
| 74 | // device type definition |
| 75 | extern const device_type C64_SWIFTLINK; |
| 76 | |
| 77 | |
| 78 | #endif |