src/mess/machine/c1581.c
| r11258 | r11259 | |
| 7 | 7 | |
| 8 | 8 | **********************************************************************/ |
| 9 | 9 | |
| 10 | | /* |
| 11 | | |
| 12 | | TODO: |
| 13 | | |
| 14 | | - C1563 device |
| 15 | | |
| 16 | | */ |
| 17 | | |
| 18 | 10 | #include "c1581.h" |
| 19 | 11 | |
| 20 | 12 | |
| r11258 | r11259 | |
| 41 | 33 | //************************************************************************** |
| 42 | 34 | |
| 43 | 35 | const device_type C1581 = c1581_device_config::static_alloc_device_config; |
| 36 | const device_type C1563 = c1581_device_config::static_alloc_device_config; |
| 44 | 37 | |
| 45 | 38 | |
| 46 | 39 | |
| r11258 | r11259 | |
| 97 | 90 | // static_set_config - configuration helper |
| 98 | 91 | //------------------------------------------------- |
| 99 | 92 | |
| 100 | | void c1581_device_config::static_set_config(device_config *device, int address) |
| 93 | void c1581_device_config::static_set_config(device_config *device, int address, const char *rom_region) |
| 101 | 94 | { |
| 102 | 95 | c1581_device_config *c1581 = downcast<c1581_device_config *>(device); |
| 103 | 96 | |
| 104 | 97 | assert((address > 7) && (address < 12)); |
| 105 | 98 | |
| 106 | 99 | c1581->m_address = address - 8; |
| 100 | c1581->m_rom_region = rom_region; |
| 107 | 101 | } |
| 108 | 102 | |
| 109 | 103 | |
| r11258 | r11259 | |
| 432 | 426 | m_cia(*this, M8520_TAG), |
| 433 | 427 | m_fdc(*this, WD1770_TAG), |
| 434 | 428 | m_image(*this, FLOPPY_0), |
| 435 | | m_bus(machine().device<cbm_iec_device>(CBM_IEC_TAG)), |
| 429 | m_bus(*this->owner(), CBM_IEC_TAG), |
| 436 | 430 | m_config(_config) |
| 437 | 431 | { |
| 438 | 432 | } |
| r11258 | r11259 | |
| 444 | 438 | |
| 445 | 439 | void c1581_device::device_start() |
| 446 | 440 | { |
| 441 | // map ROM |
| 442 | address_space *program = m_maincpu->memory().space(AS_PROGRAM); |
| 443 | program->install_rom(0x8000, 0xbfff, subregion(m_config.m_rom_region)->base()); |
| 444 | |
| 447 | 445 | // state saving |
| 448 | 446 | save_item(NAME(m_data_out)); |
| 449 | 447 | save_item(NAME(m_atn_ack)); |
src/mess/machine/c1581.h
| r11258 | r11259 | |
| 25 | 25 | |
| 26 | 26 | |
| 27 | 27 | //************************************************************************** |
| 28 | // MACROS / CONSTANTS |
| 29 | //************************************************************************** |
| 30 | |
| 31 | #define C1581_TAG "c1581" |
| 32 | |
| 33 | |
| 34 | |
| 35 | //************************************************************************** |
| 28 | 36 | // INTERFACE CONFIGURATION MACROS |
| 29 | 37 | //************************************************************************** |
| 30 | 38 | |
| 31 | 39 | #define MCFG_C1581_ADD(_tag, _address) \ |
| 32 | 40 | MCFG_DEVICE_ADD(_tag, C1581, 0) \ |
| 33 | | c1581_device_config::static_set_config(device, _address); |
| 41 | c1581_device_config::static_set_config(device, _address, "c1581"); |
| 34 | 42 | |
| 43 | #define MCFG_C1563_ADD(_tag, _address) \ |
| 44 | MCFG_DEVICE_ADD(_tag, C1563, 0) \ |
| 45 | c1581_device_config::static_set_config(device, _address, "c1563"); |
| 35 | 46 | |
| 36 | 47 | |
| 48 | |
| 37 | 49 | //************************************************************************** |
| 38 | 50 | // TYPE DEFINITIONS |
| 39 | 51 | //************************************************************************** |
| r11258 | r11259 | |
| 44 | 56 | public device_config_cbm_iec_interface |
| 45 | 57 | { |
| 46 | 58 | friend class c1581_device; |
| 59 | friend class c1563_device; |
| 47 | 60 | |
| 48 | 61 | // construction/destruction |
| 49 | 62 | c1581_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock); |
| r11258 | r11259 | |
| 54 | 67 | virtual device_t *alloc_device(running_machine &machine) const; |
| 55 | 68 | |
| 56 | 69 | // inline configuration helpers |
| 57 | | static void static_set_config(device_config *device, int address); |
| 70 | static void static_set_config(device_config *device, int address, const char *rom_region); |
| 58 | 71 | |
| 59 | 72 | // optional information overrides |
| 60 | 73 | virtual const rom_entry *device_rom_region() const; |
| r11258 | r11259 | |
| 66 | 79 | |
| 67 | 80 | private: |
| 68 | 81 | int m_address; |
| 82 | const char *m_rom_region; |
| 69 | 83 | }; |
| 70 | 84 | |
| 71 | 85 | |
| r11258 | r11259 | |
| 107 | 121 | required_device<mos6526_device> m_cia; |
| 108 | 122 | required_device<device_t> m_fdc; |
| 109 | 123 | required_device<device_t> m_image; |
| 110 | | cbm_iec_device *m_bus; |
| 124 | required_device<cbm_iec_device> m_bus; |
| 111 | 125 | |
| 112 | 126 | int m_data_out; // serial data out |
| 113 | 127 | int m_atn_ack; // attention acknowledge |
| r11258 | r11259 | |
| 119 | 133 | }; |
| 120 | 134 | |
| 121 | 135 | |
| 136 | // ======================> c1563_device |
| 122 | 137 | |
| 138 | class c1563_device : public c1581_device |
| 139 | { |
| 140 | friend class c1581_device_config; |
| 141 | |
| 142 | // construction/destruction |
| 143 | c1563_device(running_machine &_machine, const c1581_device_config &_config); |
| 144 | }; |
| 145 | |
| 146 | |
| 123 | 147 | // device type definition |
| 124 | 148 | extern const device_type C1581; |
| 149 | extern const device_type C1563; |
| 125 | 150 | |
| 126 | 151 | |
| 127 | 152 | |
src/mess/machine/c1541.c
| r11258 | r11259 | |
| 11 | 11 | |
| 12 | 12 | TODO: |
| 13 | 13 | |
| 14 | | - 1540/1541C/1541-II/SX1541/OC118/2031 |
| 14 | - 1541C/2031 |
| 15 | 15 | - some copy protections fail |
| 16 | 16 | - more accurate timing |
| 17 | 17 | - power/activity LEDs |
| r11258 | r11259 | |
| 222 | 222 | // static_set_config - configuration helper |
| 223 | 223 | //------------------------------------------------- |
| 224 | 224 | |
| 225 | | void c1541_device_config::static_set_config(device_config *device, int address) |
| 225 | void c1541_device_config::static_set_config(device_config *device, int address, const char *rom_region) |
| 226 | 226 | { |
| 227 | 227 | c1541_device_config *c1541 = downcast<c1541_device_config *>(device); |
| 228 | 228 | |
| 229 | 229 | assert((address > 7) && (address < 12)); |
| 230 | 230 | |
| 231 | 231 | c1541->m_address = address - 8; |
| 232 | c1541->m_rom_region = rom_region; |
| 232 | 233 | } |
| 233 | 234 | |
| 234 | 235 | |
| r11258 | r11259 | |
| 237 | 238 | //------------------------------------------------- |
| 238 | 239 | |
| 239 | 240 | ROM_START( c1541 ) |
| 240 | | ROM_REGION( 0x4000, "c1540", ROMREGION_LOADBYNAME ) |
| 241 | ROM_REGION( 0x4000, "c1540", 0 ) |
| 241 | 242 | ROM_LOAD_OPTIONAL( "325302-01.uab4", 0x0000, 0x2000, CRC(29ae9752) SHA1(8e0547430135ba462525c224e76356bd3d430f11) ) |
| 242 | 243 | ROM_LOAD_OPTIONAL( "325303-01.uab5", 0x2000, 0x2000, CRC(10b39158) SHA1(56dfe79b26f50af4e83fd9604857756d196516b9) ) |
| 243 | 244 | |
| 244 | | ROM_REGION( 0x6000, "c1541", ROMREGION_LOADBYNAME ) |
| 245 | ROM_REGION( 0x6000, "c1541", 0 ) |
| 245 | 246 | ROM_LOAD( "325302-01.uab4", 0x0000, 0x2000, CRC(29ae9752) SHA1(8e0547430135ba462525c224e76356bd3d430f11) ) |
| 246 | 247 | ROM_LOAD_OPTIONAL( "901229-01.uab5", 0x2000, 0x2000, CRC(9a48d3f0) SHA1(7a1054c6156b51c25410caec0f609efb079d3a77) ) |
| 247 | 248 | ROM_LOAD_OPTIONAL( "901229-02.uab5", 0x2000, 0x2000, CRC(b29bab75) SHA1(91321142e226168b1139c30c83896933f317d000) ) |
| r11258 | r11259 | |
| 251 | 252 | ROM_LOAD( "901229-06 aa.uab5", 0x2000, 0x2000, CRC(3a235039) SHA1(c7f94f4f51d6de4cdc21ecbb7e57bb209f0530c0) ) |
| 252 | 253 | ROM_LOAD_OPTIONAL( "jiffydos 1541.uab5", 0x4000, 0x2000, CRC(bc7e4aeb) SHA1(db6cfaa6d9b78d58746c811de29f3b1f44d99ddf) ) |
| 253 | 254 | |
| 254 | | ROM_REGION( 0x4000, "c1541c", ROMREGION_LOADBYNAME ) |
| 255 | ROM_REGION( 0x4000, "c1541c", 0 ) |
| 255 | 256 | ROM_LOAD_OPTIONAL( "251968-01.ua2", 0x0000, 0x4000, CRC(1b3ca08d) SHA1(8e893932de8cce244117fcea4c46b7c39c6a7765) ) |
| 256 | 257 | ROM_LOAD_OPTIONAL( "251968-02.ua2", 0x0000, 0x4000, CRC(2d862d20) SHA1(38a7a489c7bbc8661cf63476bf1eb07b38b1c704) ) |
| 257 | 258 | |
| 258 | | ROM_REGION( 0x8000, "c1541ii", ROMREGION_LOADBYNAME ) |
| 259 | ROM_REGION( 0x8000, "c1541ii", 0 ) |
| 259 | 260 | ROM_LOAD_OPTIONAL( "251968-03.u4", 0x0000, 0x4000, CRC(899fa3c5) SHA1(d3b78c3dbac55f5199f33f3fe0036439811f7fb3) ) |
| 260 | 261 | ROM_LOAD_OPTIONAL( "355640-01.u4", 0x0000, 0x4000, CRC(57224cde) SHA1(ab16f56989b27d89babe5f89c5a8cb3da71a82f0) ) |
| 261 | 262 | ROM_LOAD_OPTIONAL( "jiffydos 1541-ii.u4", 0x4000, 0x4000, CRC(dd409902) SHA1(b1a5b826304d3df2a27d7163c6a81a532e040d32) ) |
| 262 | 263 | |
| 263 | | ROM_REGION( 0xa000, "sx1541", ROMREGION_LOADBYNAME ) |
| 264 | ROM_REGION( 0xa000, "sx1541", 0 ) |
| 264 | 265 | ROM_LOAD_OPTIONAL( "325302-01.uab4", 0x0000, 0x2000, CRC(29ae9752) SHA1(8e0547430135ba462525c224e76356bd3d430f11) ) |
| 265 | 266 | ROM_LOAD_OPTIONAL( "901229-05 ae.uab5", 0x2000, 0x2000, CRC(361c9f37) SHA1(f5d60777440829e46dc91285e662ba072acd2d8b) ) |
| 266 | 267 | ROM_LOAD_OPTIONAL( "jiffydos sx1541", 0x4000, 0x4000, CRC(783575f6) SHA1(36ccb9ff60328c4460b68522443ecdb7f002a234) ) |
| 267 | 268 | ROM_LOAD_OPTIONAL( "1541 flash.uab5", 0x8000, 0x2000, CRC(22f7757e) SHA1(86a1e43d3d22b35677064cca400a6bd06767a3dc) ) |
| 268 | 269 | |
| 269 | | ROM_REGION( 0x4000, "c2031", ROMREGION_LOADBYNAME ) |
| 270 | ROM_REGION( 0x4000, "c2031", 0 ) |
| 270 | 271 | ROM_LOAD_OPTIONAL( "901484-03.u5f", 0x0000, 0x2000, CRC(ee4b893b) SHA1(54d608f7f07860f24186749f21c96724dd48bc50) ) |
| 271 | 272 | ROM_LOAD_OPTIONAL( "901484-05.u5h", 0x2000, 0x2000, CRC(6a629054) SHA1(ec6b75ecfdd4744e5d57979ef6af990444c11ae1) ) |
| 272 | 273 | |
| 273 | | ROM_REGION( 0x8000, "oc118", ROMREGION_LOADBYNAME ) |
| 274 | | ROM_LOAD_OPTIONAL( "oc118.bin", 0x0000, 0x4000, NO_DUMP ) |
| 275 | | ROM_LOAD_OPTIONAL( "jiffydos oc118.bin", 0x4000, 0x4000, CRC(46c3302c) SHA1(e3623658cb7af30c9d3bce2ba3b6ad5ee89ac1b8) ) |
| 274 | ROM_REGION( 0x4000, "oc118", 0 ) |
| 275 | ROM_LOAD_OPTIONAL( "oc118.u3", 0x0000, 0x4000, NO_DUMP ) |
| 276 | ROM_LOAD_OPTIONAL( "jiffydos v5.0.u3", 0x0000, 0x4000, CRC(46c3302c) SHA1(e3623658cb7af30c9d3bce2ba3b6ad5ee89ac1b8) ) |
| 276 | 277 | ROM_END |
| 277 | 278 | |
| 278 | 279 | |
| r11258 | r11259 | |
| 294 | 295 | AM_RANGE(0x0000, 0x07ff) AM_MIRROR(0x6000) AM_RAM |
| 295 | 296 | AM_RANGE(0x1800, 0x180f) AM_MIRROR(0x63f0) AM_DEVREADWRITE(M6522_0_TAG, via6522_device, read, write) |
| 296 | 297 | AM_RANGE(0x1c00, 0x1c0f) AM_MIRROR(0x63f0) AM_DEVREADWRITE(M6522_1_TAG, via6522_device, read, write) |
| 297 | | AM_RANGE(0x8000, 0xbfff) AM_MIRROR(0x4000) AM_ROM AM_REGION("c1541:c1541", 0) |
| 298 | AM_RANGE(0x8000, 0xbfff) AM_MIRROR(0x4000) // AM_ROM |
| 298 | 299 | ADDRESS_MAP_END |
| 299 | 300 | |
| 300 | 301 | |
| r11258 | r11259 | |
| 831 | 832 | m_via1(*this, M6522_1_TAG), |
| 832 | 833 | m_ga(*this, C64H156_TAG), |
| 833 | 834 | m_image(*this, FLOPPY_0), |
| 834 | | m_bus(machine().device<cbm_iec_device>(CBM_IEC_TAG)), |
| 835 | m_bus(*this->owner(), CBM_IEC_TAG), |
| 835 | 836 | m_data_out(1), |
| 836 | 837 | m_via0_irq(0), |
| 837 | 838 | m_via1_irq(0), |
| r11258 | r11259 | |
| 846 | 847 | |
| 847 | 848 | void c1541_device::device_start() |
| 848 | 849 | { |
| 850 | // map ROM |
| 851 | address_space *program = m_maincpu->memory().space(AS_PROGRAM); |
| 852 | program->install_rom(0x8000, 0xbfff, 0, 0x4000, subregion(m_config.m_rom_region)->base()); |
| 853 | |
| 849 | 854 | // install image callbacks |
| 850 | 855 | floppy_install_unload_proc(m_image, c1541_device::on_disk_change); |
| 851 | 856 | floppy_install_load_proc(m_image, c1541_device::on_disk_change); |
src/mess/machine/c1541.h
| r11258 | r11259 | |
| 27 | 27 | |
| 28 | 28 | |
| 29 | 29 | //************************************************************************** |
| 30 | // MACROS / CONSTANTS |
| 31 | //************************************************************************** |
| 32 | |
| 33 | #define C1541_TAG "c1541" |
| 34 | #define C2031_TAG "c2031" |
| 35 | |
| 36 | |
| 37 | |
| 38 | //************************************************************************** |
| 30 | 39 | // INTERFACE CONFIGURATION MACROS |
| 31 | 40 | //************************************************************************** |
| 32 | 41 | |
| 42 | #define MCFG_C1540_ADD(_tag, _address) \ |
| 43 | MCFG_DEVICE_ADD(_tag, C1540, 0) \ |
| 44 | c1541_device_config::static_set_config(device, _address, "c1540"); |
| 45 | |
| 33 | 46 | #define MCFG_C1541_ADD(_tag, _address) \ |
| 34 | 47 | MCFG_DEVICE_ADD(_tag, C1541, 0) \ |
| 35 | | c1541_device_config::static_set_config(device, _address); |
| 48 | c1541_device_config::static_set_config(device, _address, "c1541"); |
| 36 | 49 | |
| 50 | #define MCFG_C1541C_ADD(_tag, _address) \ |
| 51 | MCFG_DEVICE_ADD(_tag, C1541C, 0) \ |
| 52 | c1541_device_config::static_set_config(device, _address, "c1541c"); |
| 37 | 53 | |
| 54 | #define MCFG_C1541II_ADD(_tag, _address) \ |
| 55 | MCFG_DEVICE_ADD(_tag, C1541II, 0) \ |
| 56 | c1541_device_config::static_set_config(device, _address, "c1541ii"); |
| 38 | 57 | |
| 58 | #define MCFG_SX1541_ADD(_tag, _address) \ |
| 59 | MCFG_DEVICE_ADD(_tag, SX1541, 0) \ |
| 60 | c1541_device_config::static_set_config(device, _address, "sx1541"); |
| 61 | |
| 62 | #define MCFG_OC118_ADD(_tag, _address) \ |
| 63 | MCFG_DEVICE_ADD(_tag, OC118, 0) \ |
| 64 | c1541_device_config::static_set_config(device, _address, "oc118"); |
| 65 | |
| 66 | #define MCFG_C2031_ADD(_tag, _address) \ |
| 67 | MCFG_DEVICE_ADD(_tag, C2031, 0) \ |
| 68 | c1541_device_config::static_set_config(device, _address, "c2031"); |
| 69 | |
| 70 | |
| 71 | |
| 39 | 72 | //************************************************************************** |
| 40 | 73 | // TYPE DEFINITIONS |
| 41 | 74 | //************************************************************************** |
| r11258 | r11259 | |
| 45 | 78 | class c1541_device_config : public device_config, |
| 46 | 79 | public device_config_cbm_iec_interface |
| 47 | 80 | { |
| 81 | friend class c1540_device; |
| 48 | 82 | friend class c1541_device; |
| 83 | friend class c1541c_device; |
| 84 | friend class c1541ii_device; |
| 85 | friend class sx1541_device; |
| 86 | friend class oc118_device; |
| 87 | friend class c2031_device; |
| 49 | 88 | |
| 50 | 89 | // construction/destruction |
| 51 | 90 | c1541_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock); |
| r11258 | r11259 | |
| 56 | 95 | virtual device_t *alloc_device(running_machine &machine) const; |
| 57 | 96 | |
| 58 | 97 | // inline configuration helpers |
| 59 | | static void static_set_config(device_config *device, int address); |
| 98 | static void static_set_config(device_config *device, int address, const char *rom_region); |
| 60 | 99 | |
| 61 | 100 | // optional information overrides |
| 62 | 101 | virtual const rom_entry *device_rom_region() const; |
| r11258 | r11259 | |
| 67 | 106 | virtual void device_config_complete(); |
| 68 | 107 | |
| 69 | 108 | int m_address; |
| 109 | const char *m_rom_region; |
| 70 | 110 | }; |
| 71 | 111 | |
| 72 | 112 | |
| r11258 | r11259 | |
| 112 | 152 | required_device<via6522_device> m_via1; |
| 113 | 153 | required_device<c64h156_device> m_ga; |
| 114 | 154 | required_device<device_t> m_image; |
| 115 | | cbm_iec_device *m_bus; |
| 155 | required_device<cbm_iec_device> m_bus; |
| 116 | 156 | |
| 117 | 157 | // IEC bus |
| 118 | 158 | int m_data_out; // serial data out |
| r11258 | r11259 | |
| 125 | 165 | }; |
| 126 | 166 | |
| 127 | 167 | |
| 128 | | // ======================> c1541_device |
| 168 | // ======================> c1540_device |
| 129 | 169 | |
| 170 | class c1540_device : public c1541_device |
| 171 | { |
| 172 | friend class c1541_device_config; |
| 173 | |
| 174 | // construction/destruction |
| 175 | c1540_device(running_machine &_machine, const c1541_device_config &_config); |
| 176 | }; |
| 177 | |
| 178 | |
| 179 | // ======================> c1541c_device |
| 180 | |
| 130 | 181 | class c1541c_device : public c1541_device |
| 131 | 182 | { |
| 132 | 183 | friend class c1541_device_config; |
| r11258 | r11259 | |
| 140 | 191 | }; |
| 141 | 192 | |
| 142 | 193 | |
| 194 | // ======================> c1541ii_device |
| 195 | |
| 196 | class c1541ii_device : public c1541_device |
| 197 | { |
| 198 | friend class c1541_device_config; |
| 199 | |
| 200 | // construction/destruction |
| 201 | c1541ii_device(running_machine &_machine, const c1541_device_config &_config); |
| 202 | }; |
| 203 | |
| 204 | |
| 205 | // ======================> sx1541_device |
| 206 | |
| 207 | class sx1541_device : public c1541_device |
| 208 | { |
| 209 | friend class c1541_device_config; |
| 210 | |
| 211 | // construction/destruction |
| 212 | sx1541_device(running_machine &_machine, const c1541_device_config &_config); |
| 213 | }; |
| 214 | |
| 215 | |
| 216 | // ======================> oc118_device |
| 217 | |
| 218 | class oc118_device : public c1541_device |
| 219 | { |
| 220 | friend class c1541_device_config; |
| 221 | |
| 222 | // construction/destruction |
| 223 | oc118_device(running_machine &_machine, const c1541_device_config &_config); |
| 224 | }; |
| 225 | |
| 226 | |
| 143 | 227 | // ======================> c2031_device |
| 144 | 228 | |
| 145 | 229 | class c2031_device : public c1541_device |
src/mess/machine/c1571.c
| r11258 | r11259 | |
| 11 | 11 | |
| 12 | 12 | TODO: |
| 13 | 13 | |
| 14 | | - C1570 |
| 15 | | - C1571CR |
| 16 | 14 | - fast serial |
| 17 | 15 | - 1541/1571 Alignment shows drive speed as 266 rpm, should be 310 |
| 18 | 16 | - CP/M disks |
| r11258 | r11259 | |
| 47 | 45 | // DEVICE DEFINITIONS |
| 48 | 46 | //************************************************************************** |
| 49 | 47 | |
| 48 | const device_type C1570 = c1571_device_config::static_alloc_device_config; |
| 50 | 49 | const device_type C1571 = c1571_device_config::static_alloc_device_config; |
| 50 | const device_type C1571CR = c1571_device_config::static_alloc_device_config; |
| 51 | 51 | |
| 52 | 52 | |
| 53 | 53 | |
| r11258 | r11259 | |
| 103 | 103 | // static_set_config - configuration helper |
| 104 | 104 | //------------------------------------------------- |
| 105 | 105 | |
| 106 | | void c1571_device_config::static_set_config(device_config *device, int address) |
| 106 | void c1571_device_config::static_set_config(device_config *device, int address, const char *rom_region) |
| 107 | 107 | { |
| 108 | 108 | c1571_device_config *c1571 = downcast<c1571_device_config *>(device); |
| 109 | 109 | |
| 110 | 110 | assert((address > 7) && (address < 12)); |
| 111 | 111 | |
| 112 | 112 | c1571->m_address = address - 8; |
| 113 | c1571->m_rom_region = rom_region; |
| 113 | 114 | } |
| 114 | 115 | |
| 115 | 116 | |
| r11258 | r11259 | |
| 152 | 153 | AM_RANGE(0x1c00, 0x1c0f) AM_MIRROR(0x03f0) AM_DEVREADWRITE(M6522_1_TAG, via6522_device, read, write) |
| 153 | 154 | AM_RANGE(0x2000, 0x2003) AM_MIRROR(0x1ffc) AM_DEVREADWRITE_LEGACY(WD1770_TAG, wd17xx_r, wd17xx_w) |
| 154 | 155 | AM_RANGE(0x4000, 0x400f) AM_MIRROR(0x3ff0) AM_DEVREADWRITE_LEGACY(M6526_TAG, mos6526_r, mos6526_w) |
| 155 | | AM_RANGE(0x8000, 0xffff) AM_ROM AM_REGION("c1571:c1571", 0) |
| 156 | AM_RANGE(0x8000, 0xffff) // AM_ROM |
| 156 | 157 | ADDRESS_MAP_END |
| 157 | 158 | |
| 158 | 159 | |
| r11258 | r11259 | |
| 638 | 639 | m_fdc(*this, WD1770_TAG), |
| 639 | 640 | m_ga(*this, C64H156_TAG), |
| 640 | 641 | m_image(*this, FLOPPY_0), |
| 641 | | m_bus(machine().device<cbm_iec_device>(CBM_IEC_TAG)), |
| 642 | m_bus(*this->owner(), CBM_IEC_TAG), |
| 642 | 643 | m_1_2mhz(0), |
| 643 | 644 | m_data_out(1), |
| 644 | 645 | m_ser_dir(0), |
| r11258 | r11259 | |
| 658 | 659 | |
| 659 | 660 | void c1571_device::device_start() |
| 660 | 661 | { |
| 662 | // map ROM |
| 663 | address_space *program = m_maincpu->memory().space(AS_PROGRAM); |
| 664 | program->install_rom(0x8000, 0xffff, subregion(m_config.m_rom_region)->base()); |
| 665 | |
| 661 | 666 | // install image callbacks |
| 662 | 667 | floppy_install_unload_proc(m_image, c1571_device::on_disk_change); |
| 663 | 668 | floppy_install_load_proc(m_image, c1571_device::on_disk_change); |
src/mess/machine/c1571.h
| r11258 | r11259 | |
| 28 | 28 | |
| 29 | 29 | |
| 30 | 30 | //************************************************************************** |
| 31 | // MACROS / CONSTANTS |
| 32 | //************************************************************************** |
| 33 | |
| 34 | #define C1571_TAG "c1571" |
| 35 | |
| 36 | |
| 37 | |
| 38 | //************************************************************************** |
| 31 | 39 | // INTERFACE CONFIGURATION MACROS |
| 32 | 40 | //************************************************************************** |
| 33 | 41 | |
| 42 | #define MCFG_C1570_ADD(_tag, _address) \ |
| 43 | MCFG_DEVICE_ADD(_tag, C1570, 0) \ |
| 44 | c1571_device_config::static_set_config(device, _address, "c1570"); |
| 45 | |
| 34 | 46 | #define MCFG_C1571_ADD(_tag, _address) \ |
| 35 | 47 | MCFG_DEVICE_ADD(_tag, C1571, 0) \ |
| 36 | | c1571_device_config::static_set_config(device, _address); |
| 48 | c1571_device_config::static_set_config(device, _address, "c1571"); |
| 37 | 49 | |
| 50 | #define MCFG_C1571CR_ADD(_tag, _address) \ |
| 51 | MCFG_DEVICE_ADD(_tag, C1571CR, 0) \ |
| 52 | c1571_device_config::static_set_config(device, _address, "c1571cr"); |
| 38 | 53 | |
| 39 | 54 | |
| 55 | |
| 40 | 56 | //************************************************************************** |
| 41 | 57 | // TYPE DEFINITIONS |
| 42 | 58 | //************************************************************************** |
| r11258 | r11259 | |
| 46 | 62 | class c1571_device_config : public device_config, |
| 47 | 63 | public device_config_cbm_iec_interface |
| 48 | 64 | { |
| 65 | friend class c1570_device; |
| 49 | 66 | friend class c1571_device; |
| 67 | friend class c1571cr_device; |
| 50 | 68 | |
| 51 | 69 | // construction/destruction |
| 52 | 70 | c1571_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock); |
| r11258 | r11259 | |
| 57 | 75 | virtual device_t *alloc_device(running_machine &machine) const; |
| 58 | 76 | |
| 59 | 77 | // inline configuration helpers |
| 60 | | static void static_set_config(device_config *device, int address); |
| 78 | static void static_set_config(device_config *device, int address, const char *rom_region); |
| 61 | 79 | |
| 62 | 80 | // optional information overrides |
| 63 | 81 | virtual const rom_entry *device_rom_region() const; |
| r11258 | r11259 | |
| 69 | 87 | |
| 70 | 88 | private: |
| 71 | 89 | int m_address; |
| 90 | const char *m_rom_region; |
| 72 | 91 | }; |
| 73 | 92 | |
| 74 | 93 | |
| r11258 | r11259 | |
| 125 | 144 | required_device<device_t> m_fdc; |
| 126 | 145 | required_device<c64h156_device> m_ga; |
| 127 | 146 | required_device<device_t> m_image; |
| 128 | | cbm_iec_device *m_bus; |
| 147 | required_device<cbm_iec_device> m_bus; |
| 129 | 148 | |
| 130 | 149 | // signals |
| 131 | 150 | int m_1_2mhz; // clock speed |
| r11258 | r11259 | |
| 145 | 164 | }; |
| 146 | 165 | |
| 147 | 166 | |
| 167 | // ======================> c1570_device |
| 148 | 168 | |
| 169 | class c1570_device : public c1571_device |
| 170 | { |
| 171 | friend class c1571_device_config; |
| 172 | |
| 173 | // construction/destruction |
| 174 | c1570_device(running_machine &_machine, const c1571_device_config &_config); |
| 175 | }; |
| 176 | |
| 177 | |
| 178 | // ======================> c1571cr_device |
| 179 | |
| 180 | class c1571cr_device : public c1571_device |
| 181 | { |
| 182 | friend class c1571_device_config; |
| 183 | |
| 184 | // construction/destruction |
| 185 | c1571cr_device(running_machine &_machine, const c1571_device_config &_config); |
| 186 | }; |
| 187 | |
| 188 | |
| 149 | 189 | // device type definition |
| 190 | extern const device_type C1570; |
| 150 | 191 | extern const device_type C1571; |
| 192 | extern const device_type C1571CR; |
| 151 | 193 | |
| 152 | 194 | |
| 153 | 195 | |
src/mess/drivers/vic20.c
| r11258 | r11259 | |
| 433 | 433 | |
| 434 | 434 | static CBM_IEC_DAISY( cbm_iec_daisy ) |
| 435 | 435 | { |
| 436 | | { C1540_TAG }, |
| 436 | { C1541_TAG }, |
| 437 | 437 | { NULL } |
| 438 | 438 | }; |
| 439 | 439 | |
| r11258 | r11259 | |
| 685 | 685 | } |
| 686 | 686 | |
| 687 | 687 | static MACHINE_CONFIG_START( vic20_common, vic20_state ) |
| 688 | | |
| 689 | 688 | MCFG_TIMER_ADD_PERIODIC(TIMER_C1530_TAG, cassette_tick, attotime::from_hz(44100)) |
| 690 | 689 | |
| 691 | 690 | /* devices */ |
| r11258 | r11259 | |
| 695 | 694 | MCFG_QUICKLOAD_ADD("quickload", cbm_vc20, "p00,prg", CBM_QUICKLOAD_DELAY_SECONDS) |
| 696 | 695 | MCFG_CASSETTE_ADD(CASSETTE_TAG, cbm_cassette_config ) |
| 697 | 696 | MCFG_CBM_IEC_CONFIG_ADD(cbm_iec_daisy, cbm_iec_intf) |
| 698 | | //MCFG_C1540_ADD(C1540_TAG, 8) |
| 699 | | MCFG_C1541_ADD(C1540_TAG, 8) |
| 697 | MCFG_C1540_ADD(C1541_TAG, 8) |
| 700 | 698 | #ifdef INCLUDE_C2031 |
| 701 | 699 | MCFG_IEEE488_ADD(IEEE488_TAG, ieee488_daisy) |
| 702 | 700 | MCFG_VIC1112_ADD(vic1112_intf) |
| r11258 | r11259 | |
| 718 | 716 | MACHINE_CONFIG_END |
| 719 | 717 | |
| 720 | 718 | static MACHINE_CONFIG_DERIVED( vic20_ntsc, vic20_common ) |
| 721 | | |
| 722 | 719 | /* basic machine hardware */ |
| 723 | 720 | MCFG_CPU_ADD(M6502_TAG, M6502, MOS6560_CLOCK) |
| 724 | 721 | MCFG_CPU_PROGRAM_MAP(vic20_mem) |
| r11258 | r11259 | |
| 747 | 744 | MACHINE_CONFIG_END |
| 748 | 745 | |
| 749 | 746 | static MACHINE_CONFIG_DERIVED( vic20_pal, vic20_common ) |
| 750 | | |
| 751 | 747 | /* basic machine hardware */ |
| 752 | 748 | MCFG_CPU_ADD(M6502_TAG, M6502, MOS6561_CLOCK) |
| 753 | 749 | MCFG_CPU_PROGRAM_MAP(vic20_mem) |
src/mess/drivers/c16.c
| r11258 | r11259 | |
| 424 | 424 | |
| 425 | 425 | static CBM_IEC_DAISY( c16_iec_1541 ) |
| 426 | 426 | { |
| 427 | | { "c1541" }, |
| 427 | { C1541_TAG }, |
| 428 | 428 | { NULL } |
| 429 | 429 | }; |
| 430 | 430 | |
| r11258 | r11259 | |
| 499 | 499 | |
| 500 | 500 | /* IEC serial bus */ |
| 501 | 501 | MCFG_CBM_IEC_ADD(c16_iec_no_drives) |
| 502 | | |
| 502 | |
| 503 | 503 | /* internal ram */ |
| 504 | 504 | MCFG_RAM_ADD(RAM_TAG) |
| 505 | 505 | MCFG_RAM_DEFAULT_SIZE("64K") |
| r11258 | r11259 | |
| 509 | 509 | |
| 510 | 510 | static MACHINE_CONFIG_DERIVED( c16c, c16 ) |
| 511 | 511 | |
| 512 | | MCFG_C1551_ADD("c1551", 8) |
| 512 | MCFG_C1551_ADD(C1551_TAG, 8) |
| 513 | 513 | |
| 514 | 514 | #ifdef CPU_SYNC |
| 515 | 515 | MCFG_QUANTUM_TIME(attotime::from_hz(60)) |
| r11258 | r11259 | |
| 524 | 524 | /* floppy from serial bus */ |
| 525 | 525 | MCFG_CBM_IEC_REMOVE() |
| 526 | 526 | MCFG_CBM_IEC_ADD(c16_iec_1541) |
| 527 | | MCFG_C1541_ADD("c1541", 8) |
| 527 | MCFG_C1541_ADD(C1541_TAG, 8) |
| 528 | 528 | #ifdef CPU_SYNC |
| 529 | 529 | MCFG_QUANTUM_TIME(attotime::from_hz(60)) |
| 530 | 530 | #else |
| r11258 | r11259 | |
| 555 | 555 | |
| 556 | 556 | static MACHINE_CONFIG_DERIVED( plus4c, plus4 ) |
| 557 | 557 | |
| 558 | | MCFG_C1551_ADD("c1551", 8) |
| 558 | MCFG_C1551_ADD(C1551_TAG, 8) |
| 559 | 559 | |
| 560 | 560 | MCFG_SCREEN_MODIFY("screen") |
| 561 | 561 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */ |
| r11258 | r11259 | |
| 572 | 572 | /* floppy from serial bus */ |
| 573 | 573 | MCFG_CBM_IEC_REMOVE() |
| 574 | 574 | MCFG_CBM_IEC_ADD(c16_iec_1541) |
| 575 | | MCFG_C1541_ADD("c1541", 8) |
| 575 | MCFG_C1541_ADD(C1541_TAG, 8) |
| 576 | 576 | |
| 577 | 577 | MCFG_SCREEN_MODIFY("screen") |
| 578 | 578 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */ |
src/mess/drivers/c64.c
| r11258 | r11259 | |
| 554 | 554 | |
| 555 | 555 | static CBM_IEC_DAISY( cbm_iec_daisy ) |
| 556 | 556 | { |
| 557 | | { "c1541" }, |
| 557 | { C1541_TAG }, |
| 558 | 558 | { NULL } |
| 559 | 559 | }; |
| 560 | 560 | |
| r11258 | r11259 | |
| 717 | 717 | |
| 718 | 718 | /* floppy from serial bus */ |
| 719 | 719 | MCFG_CBM_IEC_ADD(cbm_iec_daisy) |
| 720 | | MCFG_C1541_ADD("c1541", 8) |
| 720 | MCFG_C1541_ADD(C1541_TAG, 8) |
| 721 | 721 | |
| 722 | 722 | MCFG_FRAGMENT_ADD(c64_cartslot) |
| 723 | 723 | MACHINE_CONFIG_END |
| r11258 | r11259 | |
| 767 | 767 | |
| 768 | 768 | /* floppy from serial bus */ |
| 769 | 769 | MCFG_CBM_IEC_ADD(cbm_iec_daisy) |
| 770 | | MCFG_C1541_ADD("c1541", 8) |
| 770 | MCFG_C1541_ADD(C1541_TAG, 8) |
| 771 | 771 | |
| 772 | 772 | MCFG_FRAGMENT_ADD(c64_cartslot) |
| 773 | 773 | MACHINE_CONFIG_END |
| r11258 | r11259 | |
| 785 | 785 | MCFG_VIC2_ADD("vic2", ultimax_vic2_intf) |
| 786 | 786 | |
| 787 | 787 | MCFG_CBM_IEC_REMOVE() |
| 788 | | MCFG_DEVICE_REMOVE("c1541") |
| 788 | MCFG_DEVICE_REMOVE(C1541_TAG) |
| 789 | 789 | MCFG_DEVICE_REMOVE("cart1") |
| 790 | 790 | MCFG_DEVICE_REMOVE("cart2") |
| 791 | 791 | |
| r11258 | r11259 | |
| 802 | 802 | MCFG_DEVICE_REMOVE( "cassette" ) |
| 803 | 803 | MCFG_DEVICE_REMOVE( "quickload" ) |
| 804 | 804 | //MCFG_CBM_IEC_REMOVE() |
| 805 | | //MCFG_DEVICE_REMOVE("c1541") |
| 805 | //MCFG_DEVICE_REMOVE(C1541_TAG) |
| 806 | 806 | MACHINE_CONFIG_END |
| 807 | 807 | |
| 808 | 808 | |
| 809 | 809 | static MACHINE_CONFIG_DERIVED( sx64, c64pal ) |
| 810 | MCFG_DEVICE_REMOVE( C1541_TAG ) |
| 811 | MCFG_SX1541_ADD(C1541_TAG, 8) |
| 810 | 812 | |
| 811 | | // MCFG_DEVICE_REMOVE( "c1541" ) |
| 812 | | // MCFG_SX1541_ADD("c1541", 8) |
| 813 | | |
| 814 | 813 | MCFG_DEVICE_REMOVE( "dac" ) |
| 815 | 814 | MCFG_DEVICE_REMOVE( "cassette" ) |
| 816 | 815 | #ifdef CPU_SYNC |