trunk/src/emu/bus/ql/sandy_superqboard.c
| r30798 | r30799 | |
| 39 | 39 | ROM_LOAD( "sandy_disk_controller_v1.18y_1984.ic2", 0x0000, 0x8000, CRC(d02425be) SHA1(e730576e3e0c6a1acad042c09e15fc62a32d8fbd) ) |
| 40 | 40 | |
| 41 | 41 | ROM_REGION( 0x100, "plds", 0 ) |
| 42 | | ROM_LOAD( "gal16v8.ic5", 0x000, 0x000, NO_DUMP ) |
| 42 | ROM_LOAD( "gal16v8.ic5", 0x000, 0x100, NO_DUMP ) |
| 43 | 43 | ROM_END |
| 44 | 44 | |
| 45 | 45 | |
| r30798 | r30799 | |
| 64 | 64 | |
| 65 | 65 | |
| 66 | 66 | //------------------------------------------------- |
| 67 | // FLOPPY_FORMATS( floppy_formats ) |
| 68 | //------------------------------------------------- |
| 69 | |
| 70 | FLOPPY_FORMATS_MEMBER( sandy_superqboard_t::floppy_formats ) |
| 71 | FLOPPY_QL_FORMAT |
| 72 | FLOPPY_FORMATS_END |
| 73 | |
| 74 | |
| 75 | //------------------------------------------------- |
| 67 | 76 | // centronics |
| 68 | 77 | //------------------------------------------------- |
| 69 | 78 | |
| r30798 | r30799 | |
| 80 | 89 | |
| 81 | 90 | static MACHINE_CONFIG_FRAGMENT( sandy_superqboard ) |
| 82 | 91 | MCFG_DEVICE_ADD(WD1772_TAG, WD1772x, XTAL_16MHz/2) |
| 83 | | MCFG_FLOPPY_DRIVE_ADD(WD1772_TAG":0", sandy_superqboard_floppies, "35hd", floppy_image_device::default_floppy_formats) |
| 84 | | MCFG_FLOPPY_DRIVE_ADD(WD1772_TAG":1", sandy_superqboard_floppies, NULL, floppy_image_device::default_floppy_formats) |
| 92 | MCFG_FLOPPY_DRIVE_ADD(WD1772_TAG":0", sandy_superqboard_floppies, "35hd", sandy_superqboard_t::floppy_formats) |
| 93 | MCFG_FLOPPY_DRIVE_ADD(WD1772_TAG":1", sandy_superqboard_floppies, NULL, sandy_superqboard_t::floppy_formats) |
| 85 | 94 | |
| 86 | 95 | MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "printer") |
| 87 | 96 | MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(sandy_superqboard_t, busy_w)) |
trunk/src/emu/bus/ql/sandy_superdisk.c
| r30798 | r30799 | |
| 59 | 59 | |
| 60 | 60 | |
| 61 | 61 | //------------------------------------------------- |
| 62 | // FLOPPY_FORMATS( floppy_formats ) |
| 63 | //------------------------------------------------- |
| 64 | |
| 65 | FLOPPY_FORMATS_MEMBER( sandy_super_disk_t::floppy_formats ) |
| 66 | FLOPPY_QL_FORMAT |
| 67 | FLOPPY_FORMATS_END |
| 68 | |
| 69 | |
| 70 | //------------------------------------------------- |
| 62 | 71 | // MACHINE_CONFIG_FRAGMENT( sandy_super_disk ) |
| 63 | 72 | //------------------------------------------------- |
| 64 | 73 | |
| r30798 | r30799 | |
| 66 | 75 | MCFG_DEVICE_ADD(WD1772_TAG, WD1772x, 8000000) |
| 67 | 76 | //MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(sandy_super_disk_t, fdc_intrq_w)) |
| 68 | 77 | //MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(sandy_super_disk_t, fdc_drq_w)) |
| 69 | | MCFG_FLOPPY_DRIVE_ADD(WD1772_TAG":0", sandy_super_disk_floppies, "35dd", floppy_image_device::default_floppy_formats) |
| 70 | | MCFG_FLOPPY_DRIVE_ADD(WD1772_TAG":1", sandy_super_disk_floppies, NULL, floppy_image_device::default_floppy_formats) |
| 78 | MCFG_FLOPPY_DRIVE_ADD(WD1772_TAG":0", sandy_super_disk_floppies, "35dd", sandy_super_disk_t::floppy_formats) |
| 79 | MCFG_FLOPPY_DRIVE_ADD(WD1772_TAG":1", sandy_super_disk_floppies, NULL, sandy_super_disk_t::floppy_formats) |
| 71 | 80 | |
| 72 | 81 | MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "printer") |
| 73 | 82 | MACHINE_CONFIG_END |
trunk/src/emu/bus/ql/trumpcard.c
| r30798 | r30799 | |
| 37 | 37 | ROM_LOAD( "trumpcard-125.rom", 0x0000, 0x8000, CRC(938eaa46) SHA1(9b3458cf3a279ed86ba395dc45c8f26939d6c44d) ) |
| 38 | 38 | |
| 39 | 39 | ROM_REGION( 0x100, "plds", 0 ) |
| 40 | | ROM_LOAD( "1u4", 0x000, 0x000, NO_DUMP ) |
| 41 | | ROM_LOAD( "2u4", 0x000, 0x000, NO_DUMP ) |
| 40 | ROM_LOAD( "1u4", 0x000, 0x100, NO_DUMP ) |
| 41 | ROM_LOAD( "2u4", 0x000, 0x100, NO_DUMP ) |
| 42 | 42 | ROM_END |
| 43 | 43 | |
| 44 | 44 | |
| r30798 | r30799 | |
| 62 | 62 | |
| 63 | 63 | |
| 64 | 64 | //------------------------------------------------- |
| 65 | // FLOPPY_FORMATS( floppy_formats ) |
| 66 | //------------------------------------------------- |
| 67 | |
| 68 | FLOPPY_FORMATS_MEMBER( ql_trump_card_t::floppy_formats ) |
| 69 | FLOPPY_QL_FORMAT |
| 70 | FLOPPY_FORMATS_END |
| 71 | |
| 72 | |
| 73 | //------------------------------------------------- |
| 65 | 74 | // MACHINE_CONFIG_FRAGMENT( ql_trump_card ) |
| 66 | 75 | //------------------------------------------------- |
| 67 | 76 | |
| r30798 | r30799 | |
| 69 | 78 | MCFG_DEVICE_ADD(WD1772_TAG, WD1772x, 8000000) |
| 70 | 79 | //MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(ql_trump_card_t, fdc_intrq_w)) |
| 71 | 80 | //MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(ql_trump_card_t, fdc_drq_w)) |
| 72 | | MCFG_FLOPPY_DRIVE_ADD(WD1772_TAG":0", ql_trump_card_floppies, "35dd", floppy_image_device::default_floppy_formats) |
| 73 | | MCFG_FLOPPY_DRIVE_ADD(WD1772_TAG":1", ql_trump_card_floppies, NULL, floppy_image_device::default_floppy_formats) |
| 81 | MCFG_FLOPPY_DRIVE_ADD(WD1772_TAG":0", ql_trump_card_floppies, "35dd", ql_trump_card_t::floppy_formats) |
| 82 | MCFG_FLOPPY_DRIVE_ADD(WD1772_TAG":1", ql_trump_card_floppies, NULL, ql_trump_card_t::floppy_formats) |
| 74 | 83 | MACHINE_CONFIG_END |
| 75 | 84 | |
| 76 | 85 | |
trunk/src/lib/formats/ql_dsk.c
| r0 | r30799 | |
| 1 | // license:BSD-3-Clause |
| 2 | // copyright-holders:Curt Coder |
| 3 | /********************************************************************* |
| 4 | |
| 5 | formats/ql_dsk.c |
| 6 | |
| 7 | Sinclair QL disk image formats |
| 8 | |
| 9 | *********************************************************************/ |
| 10 | |
| 11 | #include "emu.h" |
| 12 | #include "formats/ql_dsk.h" |
| 13 | |
| 14 | ql_format::ql_format() : wd177x_format(formats) |
| 15 | { |
| 16 | } |
| 17 | |
| 18 | const char *ql_format::name() const |
| 19 | { |
| 20 | return "ql"; |
| 21 | } |
| 22 | |
| 23 | const char *ql_format::description() const |
| 24 | { |
| 25 | return "Sinclair QL disk image"; |
| 26 | } |
| 27 | |
| 28 | const char *ql_format::extensions() const |
| 29 | { |
| 30 | return "dsk,img"; |
| 31 | } |
| 32 | |
| 33 | // unverified gaps |
| 34 | const ql_format::format ql_format::formats[] = { |
| 35 | { // QDOS 800KB |
| 36 | floppy_image::FF_35, floppy_image::SSSD, floppy_image::MFM, |
| 37 | 2000, 5, 80, 2, 1024, {}, 1, {}, 80, 22, 24 |
| 38 | }, |
| 39 | { // 720KB DSDD |
| 40 | floppy_image::FF_35, floppy_image::SSSD, floppy_image::MFM, |
| 41 | 2000, 9, 80, 2, 512, {}, 1, {}, 80, 22, 24 |
| 42 | }, |
| 43 | { // 1.44MB DSHD |
| 44 | floppy_image::FF_35, floppy_image::SSSD, floppy_image::MFM, |
| 45 | 2000, 18, 80, 2, 512, {}, 1, {}, 80, 22, 24 |
| 46 | }, |
| 47 | { // 2.88MB DSED |
| 48 | floppy_image::FF_35, floppy_image::SSSD, floppy_image::MFM, |
| 49 | 2000, 40, 80, 2, 512, {}, 1, {}, 80, 41, 24 |
| 50 | }, |
| 51 | {} |
| 52 | }; |
| 53 | |
| 54 | const floppy_format_type FLOPPY_QL_FORMAT = &floppy_image_format_creator<ql_format>; |
trunk/src/mess/machine/qimi.c
| r0 | r30799 | |
| 1 | // license:BSD-3-Clause |
| 2 | // copyright-holders:Curt Coder |
| 3 | /********************************************************************** |
| 4 | |
| 5 | QL Internal Mouse Interface emulation |
| 6 | |
| 7 | Copyright MESS Team. |
| 8 | Visit http://mamedev.org for licensing and usage restrictions. |
| 9 | |
| 10 | **********************************************************************/ |
| 11 | |
| 12 | #include "qimi.h" |
| 13 | |
| 14 | |
| 15 | |
| 16 | //************************************************************************** |
| 17 | // MACROS / CONSTANTS |
| 18 | //************************************************************************** |
| 19 | |
| 20 | #define QL_CONFIG_PORT "config" |
| 21 | #define QIMI_PORT_MASK 0x01 |
| 22 | #define QIMI_NONE 0x00 |
| 23 | #define QIMI_MOUSE 0x01 |
| 24 | |
| 25 | #define MOUSEX_TAG "MOUSEX" |
| 26 | #define MOUSEY_TAG "MOUSEY" |
| 27 | #define MOUSEB_TAG "MOUSEB" |
| 28 | |
| 29 | // Mouse bits in Sandy port order |
| 30 | #define MOUSE_MIDDLE 0x02 |
| 31 | #define MOUSE_RIGHT 0x04 |
| 32 | #define MOUSE_LEFT 0x08 |
| 33 | #define MOUSE_DIRY 0x10 |
| 34 | #define MOUSE_DIRX 0x20 |
| 35 | #define MOUSE_INTY 0x40 |
| 36 | #define MOUSE_INTX 0x80 |
| 37 | #define MOUSE_INT_MASK (MOUSE_INTX | MOUSE_INTY) |
| 38 | |
| 39 | #define QIMI_INTX 0x04 |
| 40 | #define QIMI_INTY 0x20 |
| 41 | #define QIMI_DIRX 0x10 |
| 42 | #define QIMI_DIRY 0x01 |
| 43 | #define QIMI_LEFT 0x20 |
| 44 | #define QIMI_RIGHT 0x10 |
| 45 | #define QIMI_INT_MASK (QIMI_INTX | QIMI_INTY) |
| 46 | |
| 47 | |
| 48 | |
| 49 | //************************************************************************** |
| 50 | // DEVICE DEFINITIONS |
| 51 | //************************************************************************** |
| 52 | |
| 53 | const device_type QIMI = &device_creator<qimi_t>; |
| 54 | |
| 55 | |
| 56 | //------------------------------------------------- |
| 57 | // INPUT_PORTS( qimi ) |
| 58 | //------------------------------------------------- |
| 59 | |
| 60 | INPUT_PORTS_START( qimi ) |
| 61 | PORT_START(QL_CONFIG_PORT) |
| 62 | PORT_CONFNAME( QIMI_PORT_MASK, QIMI_NONE, "QIMI enabled") |
| 63 | PORT_CONFSETTING( QIMI_NONE, "No" ) |
| 64 | PORT_CONFSETTING( QIMI_MOUSE, "Yes" ) |
| 65 | |
| 66 | PORT_START(MOUSEX_TAG) |
| 67 | PORT_BIT( 0xff, 0x00, IPT_MOUSE_X ) PORT_SENSITIVITY(50) PORT_KEYDELTA(5) PORT_MINMAX(0, 255) PORT_PLAYER(1) |
| 68 | |
| 69 | PORT_START(MOUSEY_TAG) |
| 70 | PORT_BIT( 0xff, 0x00, IPT_MOUSE_Y ) PORT_SENSITIVITY(50) PORT_KEYDELTA(5) PORT_MINMAX(0, 255) PORT_PLAYER(1) |
| 71 | |
| 72 | PORT_START(MOUSEB_TAG) /* Mouse buttons */ |
| 73 | PORT_BIT( MOUSE_RIGHT, IP_ACTIVE_LOW, IPT_BUTTON1) PORT_NAME("Mouse Button 1") PORT_CODE(MOUSECODE_BUTTON1) |
| 74 | PORT_BIT( MOUSE_LEFT, IP_ACTIVE_LOW, IPT_BUTTON2) PORT_NAME("Mouse Button 2") PORT_CODE(MOUSECODE_BUTTON2) |
| 75 | PORT_BIT( MOUSE_MIDDLE, IP_ACTIVE_LOW, IPT_BUTTON3) PORT_NAME("Mouse Button 3") PORT_CODE(MOUSECODE_BUTTON3) |
| 76 | INPUT_PORTS_END |
| 77 | |
| 78 | |
| 79 | //------------------------------------------------- |
| 80 | // input_ports - device-specific input ports |
| 81 | //------------------------------------------------- |
| 82 | |
| 83 | ioport_constructor qimi_t::device_input_ports() const |
| 84 | { |
| 85 | return INPUT_PORTS_NAME( qimi ); |
| 86 | } |
| 87 | |
| 88 | |
| 89 | |
| 90 | //************************************************************************** |
| 91 | // LIVE DEVICE |
| 92 | //************************************************************************** |
| 93 | |
| 94 | //------------------------------------------------- |
| 95 | // qimi_t - constructor |
| 96 | //------------------------------------------------- |
| 97 | |
| 98 | qimi_t::qimi_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 99 | device_t(mconfig, QIMI, "QL Internal Mouse Interface", tag, owner, clock, "qimi", __FILE__), |
| 100 | m_write_extint(*this), |
| 101 | m_mousex(*this, MOUSEX_TAG), |
| 102 | m_mousey(*this, MOUSEY_TAG), |
| 103 | m_mouseb(*this, MOUSEB_TAG), |
| 104 | m_config(*this, QL_CONFIG_PORT) |
| 105 | { |
| 106 | } |
| 107 | |
| 108 | |
| 109 | //------------------------------------------------- |
| 110 | // device_start - device-specific startup |
| 111 | //------------------------------------------------- |
| 112 | |
| 113 | void qimi_t::device_start() |
| 114 | { |
| 115 | // resolve callbacks |
| 116 | m_write_extint.resolve_safe(); |
| 117 | |
| 118 | // allocate timer |
| 119 | m_mouse_timer = timer_alloc(); |
| 120 | m_mouse_timer->adjust(attotime::zero, 0, attotime::from_hz(500)); |
| 121 | } |
| 122 | |
| 123 | |
| 124 | //------------------------------------------------- |
| 125 | // device_timer - handler timer events |
| 126 | //------------------------------------------------- |
| 127 | |
| 128 | void qimi_t::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) |
| 129 | { |
| 130 | UINT8 x = m_mousex->read(); |
| 131 | UINT8 y = m_mousey->read(); |
| 132 | UINT8 do_int = 0; |
| 133 | |
| 134 | //m_mouse_int = 0; |
| 135 | |
| 136 | // Set X interupt flag and direction if x has changed |
| 137 | if (x > m_ql_mouse_x) |
| 138 | { |
| 139 | m_mouse_int |= MOUSE_INTX; |
| 140 | m_mouse_int |= MOUSE_DIRX; |
| 141 | } |
| 142 | else if (x < m_ql_mouse_x) |
| 143 | { |
| 144 | m_mouse_int |= MOUSE_INTX; |
| 145 | m_mouse_int &= ~MOUSE_DIRX; |
| 146 | } |
| 147 | |
| 148 | // Set Y interupt flag and direction if y has changed |
| 149 | if (y > m_ql_mouse_y) |
| 150 | { |
| 151 | m_mouse_int |= MOUSE_INTY; |
| 152 | m_mouse_int &= ~MOUSE_DIRY; |
| 153 | } |
| 154 | else if (y < m_ql_mouse_y) |
| 155 | { |
| 156 | m_mouse_int |= MOUSE_INTY; |
| 157 | m_mouse_int |= MOUSE_DIRY; |
| 158 | } |
| 159 | |
| 160 | // Update saved location |
| 161 | m_ql_mouse_x = x; |
| 162 | m_ql_mouse_y = y; |
| 163 | |
| 164 | // if it is a QIMI, then always do int if triggered. |
| 165 | // if this is a Sandy mouse, only trigger an int if it is enabled in the mask register |
| 166 | do_int = 1; |
| 167 | |
| 168 | //logerror("m_mouse_int=%02X, MOUSE_INT_MASK=%02X, m_disk_io_byte=%02X, (m_disk_io_byte & SANDY_MOUSE_INTMASK)=%02x\n",m_mouse_int,MOUSE_INT_MASK,m_disk_io_byte,(m_disk_io_byte & SANDY_MOUSE_INTMASK)); |
| 169 | |
| 170 | // if mouse moved trigger external int |
| 171 | if((m_mouse_int & MOUSE_INT_MASK) && do_int) |
| 172 | { |
| 173 | m_write_extint(ASSERT_LINE); |
| 174 | } |
| 175 | } |
| 176 | |
| 177 | |
| 178 | //------------------------------------------------- |
| 179 | // read - |
| 180 | //------------------------------------------------- |
| 181 | |
| 182 | READ8_MEMBER( qimi_t::read ) |
| 183 | { |
| 184 | UINT8 result = 0; |
| 185 | UINT8 buttons; |
| 186 | |
| 187 | switch (offset) |
| 188 | { |
| 189 | // 0x1bf9c, button status |
| 190 | case 0x00 : |
| 191 | buttons = m_mouseb->read(); |
| 192 | result = ((buttons & MOUSE_RIGHT) << 2) | ((buttons & MOUSE_LEFT) << 2); |
| 193 | break; |
| 194 | |
| 195 | // 0x1bfbc, direction status |
| 196 | case 0x20 : |
| 197 | result = ((m_mouse_int & MOUSE_INTX) >> 5) | ((m_mouse_int & MOUSE_INTY) >> 1) | |
| 198 | ((m_mouse_int & MOUSE_DIRX) >> 1) | ((m_mouse_int & MOUSE_DIRY) >> 4); |
| 199 | break; |
| 200 | case 0x22 : |
| 201 | m_mouse_int &= ~MOUSE_INT_MASK; |
| 202 | break; |
| 203 | } |
| 204 | |
| 205 | return result; |
| 206 | } |
| 207 | |
| 208 | |
| 209 | //------------------------------------------------- |
| 210 | // write - |
| 211 | //------------------------------------------------- |
| 212 | |
| 213 | WRITE8_MEMBER( qimi_t::write ) |
| 214 | { |
| 215 | // write to 0x1bfbe resets int status |
| 216 | if (offset == 0x22) |
| 217 | { |
| 218 | m_mouse_int = 0; |
| 219 | } |
| 220 | } |
trunk/src/mess/machine/qimi.h
| r0 | r30799 | |
| 1 | // license:BSD-3-Clause |
| 2 | // copyright-holders:Curt Coder |
| 3 | /********************************************************************** |
| 4 | |
| 5 | QL Internal Mouse Interface emulation |
| 6 | |
| 7 | Copyright MESS Team. |
| 8 | Visit http://mamedev.org for licensing and usage restrictions. |
| 9 | |
| 10 | **********************************************************************/ |
| 11 | |
| 12 | #pragma once |
| 13 | |
| 14 | #ifndef __QIMI__ |
| 15 | #define __QIMI__ |
| 16 | |
| 17 | #include "emu.h" |
| 18 | |
| 19 | |
| 20 | |
| 21 | //************************************************************************** |
| 22 | // MACROS / CONSTANTS |
| 23 | //************************************************************************** |
| 24 | |
| 25 | #define QIMI_IO_BASE 0x1bf9c |
| 26 | #define QIMI_IO_LEN 0x22 |
| 27 | #define QIMI_IO_END (QIMI_IO_BASE + QIMI_IO_LEN ) |
| 28 | |
| 29 | |
| 30 | |
| 31 | //************************************************************************** |
| 32 | // INTERFACE CONFIGURATION MACROS |
| 33 | //************************************************************************** |
| 34 | |
| 35 | #define MCFG_QIMI_EXTINT_CALLBACK(_write) \ |
| 36 | devcb = &qimi_t::set_exting_wr_callback(*device, DEVCB_##_write); |
| 37 | |
| 38 | |
| 39 | |
| 40 | //************************************************************************** |
| 41 | // TYPE DEFINITIONS |
| 42 | //************************************************************************** |
| 43 | |
| 44 | // ======================> qimi_t |
| 45 | |
| 46 | class qimi_t : public device_t |
| 47 | { |
| 48 | public: |
| 49 | // construction/destruction |
| 50 | qimi_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 51 | |
| 52 | template<class _Object> static devcb_base &set_exting_wr_callback(device_t &device, _Object object) { return downcast<qimi_t &>(device).m_write_extint.set_callback(object); } |
| 53 | |
| 54 | // optional information overrides |
| 55 | virtual ioport_constructor device_input_ports() const; |
| 56 | |
| 57 | DECLARE_READ8_MEMBER( read ); |
| 58 | DECLARE_WRITE8_MEMBER( write ); |
| 59 | |
| 60 | protected: |
| 61 | // device-level overrides |
| 62 | virtual void device_start(); |
| 63 | virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); |
| 64 | |
| 65 | private: |
| 66 | devcb_write_line m_write_extint; |
| 67 | |
| 68 | required_ioport m_mousex; |
| 69 | required_ioport m_mousey; |
| 70 | required_ioport m_mouseb; |
| 71 | required_ioport m_config; |
| 72 | |
| 73 | UINT8 m_mouse_int; |
| 74 | |
| 75 | emu_timer *m_mouse_timer; |
| 76 | |
| 77 | UINT8 m_ql_mouse_x; |
| 78 | UINT8 m_ql_mouse_y; |
| 79 | }; |
| 80 | |
| 81 | |
| 82 | // device type definition |
| 83 | extern const device_type QIMI; |
| 84 | |
| 85 | |
| 86 | |
| 87 | #endif |