Previous 199869 Revisions Next

r30666 Sunday 25th May, 2014 at 22:00:17 UTC by Curt Coder
(MESS) ql: Expansion port/floppy WIP. (nw)
[src/emu/bus]bus.mak
[src/emu/bus/ql]exp.c exp.h qimi.c qimi.h sandy_superdisk.c sandy_superdisk.h sandy_superqboard.c sandy_superqboard.h trumpcard.c trumpcard.h

trunk/src/emu/bus/bus.mak
r30665r30666
11421142ifneq ($(filter QL,$(BUSES)),)
11431143OBJDIRS += $(BUSOBJ)/ql
11441144BUSOBJS += $(BUSOBJ)/ql/exp.o
1145BUSOBJS += $(BUSOBJ)/ql/qimi.o
11461145BUSOBJS += $(BUSOBJ)/ql/sandy_superdisk.o
11471146BUSOBJS += $(BUSOBJ)/ql/sandy_superqboard.o
11481147BUSOBJS += $(BUSOBJ)/ql/trumpcard.o
trunk/src/emu/bus/ql/qimi.c
r30665r30666
1// license:BSD-3-Clause
2// copyright-holders:Curt Coder
3/**********************************************************************
4
5    QIMI (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 MOUSEX_TAG              "MOUSEX"
21#define MOUSEY_TAG              "MOUSEY"
22#define MOUSEB_TAG              "MOUSEB"
23
24
25// Mouse bits in Sandy port order
26#define MOUSE_MIDDLE            0x02
27#define MOUSE_RIGHT             0x04
28#define MOUSE_LEFT              0x08
29#define MOUSE_DIRY              0x10
30#define MOUSE_DIRX              0x20
31#define MOUSE_INTY              0x40
32#define MOUSE_INTX              0x80
33#define MOUSE_INT_MASK          (MOUSE_INTX | MOUSE_INTY)
34
35
36
37//**************************************************************************
38//  DEVICE DEFINITIONS
39//**************************************************************************
40
41const device_type QIMI = &device_creator<qimi_t>;
42
43
44//-------------------------------------------------
45//  MACHINE_CONFIG_FRAGMENT( qimi )
46//-------------------------------------------------
47
48static MACHINE_CONFIG_FRAGMENT( qimi )
49MACHINE_CONFIG_END
50
51
52//-------------------------------------------------
53//  machine_config_additions - device-specific
54//  machine configurations
55//-------------------------------------------------
56
57machine_config_constructor qimi_t::device_mconfig_additions() const
58{
59   return MACHINE_CONFIG_NAME( qimi );
60}
61
62
63//-------------------------------------------------
64//  INPUT_PORTS( qimi )
65//-------------------------------------------------
66
67static INPUT_PORTS_START( qimi )
68   PORT_START(MOUSEX_TAG)
69   PORT_BIT( 0xff, 0x00, IPT_MOUSE_X ) PORT_SENSITIVITY(50) PORT_KEYDELTA(5) PORT_MINMAX(0, 255) PORT_PLAYER(1)
70
71   PORT_START(MOUSEY_TAG)
72   PORT_BIT( 0xff, 0x00, IPT_MOUSE_Y ) PORT_SENSITIVITY(50) PORT_KEYDELTA(5) PORT_MINMAX(0, 255) PORT_PLAYER(1)
73
74   PORT_START(MOUSEB_TAG)  /* Mouse buttons */
75   PORT_BIT( MOUSE_RIGHT, IP_ACTIVE_LOW, IPT_BUTTON1) PORT_NAME("Mouse Button 1") PORT_CODE(MOUSECODE_BUTTON1)
76   PORT_BIT( MOUSE_LEFT,  IP_ACTIVE_LOW, IPT_BUTTON2) PORT_NAME("Mouse Button 2") PORT_CODE(MOUSECODE_BUTTON2)
77   PORT_BIT( MOUSE_MIDDLE, IP_ACTIVE_LOW, IPT_BUTTON3) PORT_NAME("Mouse Button 3") PORT_CODE(MOUSECODE_BUTTON3)
78INPUT_PORTS_END
79
80
81//-------------------------------------------------
82//  input_ports - device-specific input ports
83//-------------------------------------------------
84
85ioport_constructor qimi_t::device_input_ports() const
86{
87   return INPUT_PORTS_NAME( qimi );
88}
89
90
91
92//**************************************************************************
93//  LIVE DEVICE
94//**************************************************************************
95
96//-------------------------------------------------
97//  qimi_t - constructor
98//-------------------------------------------------
99
100qimi_t::qimi_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
101   device_t(mconfig, QIMI, "QIMI", tag, owner, clock, "qimi", __FILE__),
102   device_ql_expansion_card_interface(mconfig, *this),
103   m_mousex(*this, MOUSEX_TAG),
104   m_mousey(*this, MOUSEY_TAG),
105   m_mouseb(*this, MOUSEB_TAG)
106{
107}
108
109
110//-------------------------------------------------
111//  device_start - device-specific startup
112//-------------------------------------------------
113
114void qimi_t::device_start()
115{
116}
117
118
119//-------------------------------------------------
120//  device_reset - device-specific reset
121//-------------------------------------------------
122
123void qimi_t::device_reset()
124{
125}
trunk/src/emu/bus/ql/qimi.h
r30665r30666
1// license:BSD-3-Clause
2// copyright-holders:Curt Coder
3/**********************************************************************
4
5    QIMI (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 "exp.h"
18
19
20
21//**************************************************************************
22//  TYPE DEFINITIONS
23//**************************************************************************
24
25// ======================> qimi_device
26
27class qimi_t : public device_t,
28            public device_ql_expansion_card_interface
29{
30public:
31   // construction/destruction
32   qimi_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
33
34   // optional information overrides
35   virtual machine_config_constructor device_mconfig_additions() const;
36   virtual ioport_constructor device_input_ports() const;
37
38protected:
39   // device-level overrides
40   virtual void device_start();
41   virtual void device_reset();
42
43   // device_ql_expansion_card_interface overrides
44
45private:
46   required_ioport m_mousex;
47   required_ioport m_mousey;
48   required_ioport m_mouseb;
49};
50
51
52// device type definition
53extern const device_type QIMI;
54
55
56#endif
trunk/src/emu/bus/ql/sandy_superqboard.h
r30665r30666
22// copyright-holders:Curt Coder
33/**********************************************************************
44
5    Sandy SuperQBoard emulation
5    Sandy SuperQBoard (with HD upgrade) emulation
66
77    Copyright MESS Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
r30665r30666
3737   virtual const rom_entry *device_rom_region() const;
3838   virtual machine_config_constructor device_mconfig_additions() const;
3939
40   WRITE_LINE_MEMBER( busy_w );
41
4042protected:
4143   // device-level overrides
4244   virtual void device_start();
4345   virtual void device_reset();
4446
4547   // device_ql_expansion_card_interface overrides
48    virtual UINT8 read(address_space &space, offs_t offset, UINT8 data);
49    virtual void write(address_space &space, offs_t offset, UINT8 data);
4650
4751private:
52   required_device<wd1772_t> m_fdc;
53   required_device<floppy_connector> m_floppy0;
54   required_device<floppy_connector> m_floppy1;
55   required_device<centronics_device> m_centronics;
56   required_device<output_latch_device> m_latch;
4857   required_memory_region m_rom;
58   optional_shared_ptr<UINT8> m_ram;
59
60   int m_busy;
61   int m_int2;
62   int m_int3;
4963};
5064
5165
trunk/src/emu/bus/ql/exp.c
r30665r30666
7777//-------------------------------------------------
7878
7979// slot devices
80#include "qimi.h"
8180#include "sandy_superdisk.h"
8281#include "sandy_superqboard.h"
8382#include "trumpcard.h"
8483
8584SLOT_INTERFACE_START( ql_expansion_cards )
86   SLOT_INTERFACE("qimi", QIMI)
8785   SLOT_INTERFACE("superdisk", SANDY_SUPER_DISK)
8886   SLOT_INTERFACE("superqboard", SANDY_SUPERQBOARD)
8987   SLOT_INTERFACE("trumpcard", QL_TRUMP_CARD)
trunk/src/emu/bus/ql/sandy_superdisk.h
r30665r30666
1515#define __SANDY_SUPER_DISK__
1616
1717#include "exp.h"
18#include "bus/centronics/ctronics.h"
1819#include "machine/wd_fdc.h"
1920
2021
r30665r30666
4546
4647private:
4748   required_memory_region m_rom;
49   optional_shared_ptr<UINT8> m_ram;
4850};
4951
5052
trunk/src/emu/bus/ql/exp.h
r30665r30666
9393   // construction/destruction
9494   device_ql_expansion_card_interface(const machine_config &mconfig, device_t &device);
9595
96    virtual void romoeh_w(int state) { m_romoeh = state; }
97    virtual UINT8 read(address_space &space, offs_t offset, UINT8 data) { return data; }
98    virtual void write(address_space &space, offs_t offset, UINT8 data) { }
99
96100protected:
97101   ql_expansion_slot_t  *m_slot;
102
103    int m_romoeh;
98104};
99105
100106
r30665r30666
112118    template<class _Object> static devcb_base &set_berrl_wr_callback(device_t &device, _Object object) { return downcast<ql_expansion_slot_t &>(device).m_write_berrl.set_callback(object); }
113119   template<class _Object> static devcb_base &set_extintl_wr_callback(device_t &device, _Object object) { return downcast<ql_expansion_slot_t &>(device).m_write_extintl.set_callback(object); }
114120
121    // computer interface
122    UINT8 read(address_space &space, offs_t offset, UINT8 data) { if (m_card) data = m_card->read(space, offset, data); return data; }
123    void write(address_space &space, offs_t offset, UINT8 data) { if (m_card) m_card->write(space, offset, data); }
124    DECLARE_WRITE_LINE_MEMBER( romoeh_w ) { if (m_card) m_card->romoeh_w(state); }
125
126    // card interface
127    DECLARE_WRITE_LINE_MEMBER( ipl0l_w ) { m_write_ipl0l(state); }
128    DECLARE_WRITE_LINE_MEMBER( ipl1l_w ) { m_write_ipl1l(state); }
129    DECLARE_WRITE_LINE_MEMBER( berrl_w ) { m_write_berrl(state); }
115130   DECLARE_WRITE_LINE_MEMBER( extintl_w ) { m_write_extintl(state); }
116131
117132protected:
118133   // device-level overrides
119134   virtual void device_start();
135    virtual void device_reset() { if (get_card_device()) get_card_device()->reset(); }
120136
121137   devcb_write_line   m_write_ipl0l;
122138    devcb_write_line   m_write_ipl1l;
trunk/src/emu/bus/ql/trumpcard.c
r30665r30666
1717//  MACROS/CONSTANTS
1818//**************************************************************************
1919
20#define WD1772_TAG      "wd1772"
2021
2122
23
2224//**************************************************************************
2325//  DEVICE DEFINITIONS
2426//**************************************************************************
r30665r30666
3335ROM_START( ql_trump_card )
3436   ROM_REGION( 0x8000, "rom", 0 )
3537   ROM_LOAD( "trumpcard-125.rom", 0x0000, 0x8000, CRC(938eaa46) SHA1(9b3458cf3a279ed86ba395dc45c8f26939d6c44d) )
38
39   ROM_REGION( 0x100, "plds", 0 )
40   ROM_LOAD( "1u4", 0x000, 0x000, NO_DUMP )
41   ROM_LOAD( "2u4", 0x000, 0x000, NO_DUMP )
3642ROM_END
3743
3844
r30665r30666
4753
4854
4955//-------------------------------------------------
56//  SLOT_INTERFACE( ql_trump_card_floppies )
57//-------------------------------------------------
58
59static SLOT_INTERFACE_START( ql_trump_card_floppies )
60   SLOT_INTERFACE( "35dd", FLOPPY_35_DD )
61SLOT_INTERFACE_END
62
63
64//-------------------------------------------------
5065//  MACHINE_CONFIG_FRAGMENT( ql_trump_card )
5166//-------------------------------------------------
5267
5368static MACHINE_CONFIG_FRAGMENT( ql_trump_card )
69   MCFG_DEVICE_ADD(WD1772_TAG, WD1772x, 8000000)
70   //MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(ql_trump_card_t, fdc_intrq_w))
71   //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)
5474MACHINE_CONFIG_END
5575
5676
r30665r30666
7797ql_trump_card_t::ql_trump_card_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
7898   device_t(mconfig, QL_TRUMP_CARD, "QL Trump Card", tag, owner, clock, "ql_trump_card", __FILE__),
7999   device_ql_expansion_card_interface(mconfig, *this),
80   m_rom(*this, "rom")
100   m_rom(*this, "rom"),
101   m_ram(*this, "ram")
81102{
82103}
83104
trunk/src/emu/bus/ql/sandy_superqboard.c
r30665r30666
22// copyright-holders:Curt Coder
33/**********************************************************************
44
5    Sandy SuperQBoard emulation
5    Sandy SuperQBoard (with HD upgrade) emulation
66
77    Copyright MESS Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
r30665r30666
1717//  MACROS/CONSTANTS
1818//**************************************************************************
1919
20#define WD1772_TAG      "ic3"
21#define TTL74273_TAG   "ic10"
22#define CENTRONICS_TAG   "j2"
2023
2124
25
2226//**************************************************************************
2327//  DEVICE DEFINITIONS
2428//**************************************************************************
r30665r30666
3236
3337ROM_START( sandy_superqboard )
3438   ROM_REGION( 0x8000, "rom", 0 )
35   ROM_LOAD( "sandy_disk_controller_v1.18y_1984.rom", 0x0000, 0x8000, CRC(d02425be) SHA1(e730576e3e0c6a1acad042c09e15fc62a32d8fbd) )
39   ROM_LOAD( "sandy_disk_controller_v1.18y_1984.ic2", 0x0000, 0x8000, CRC(d02425be) SHA1(e730576e3e0c6a1acad042c09e15fc62a32d8fbd) )
40
41   ROM_REGION( 0x100, "plds", 0 )
42   ROM_LOAD( "gal16v8.ic5", 0x000, 0x000, NO_DUMP )
3643ROM_END
3744
3845
r30665r30666
4754
4855
4956//-------------------------------------------------
57//  SLOT_INTERFACE( sandy_superqboard_floppies )
58//-------------------------------------------------
59
60static SLOT_INTERFACE_START( sandy_superqboard_floppies )
61   SLOT_INTERFACE( "35dd", FLOPPY_35_DD )
62   SLOT_INTERFACE( "35hd", FLOPPY_35_HD )
63SLOT_INTERFACE_END
64
65
66//-------------------------------------------------
67//  centronics
68//-------------------------------------------------
69
70WRITE_LINE_MEMBER( sandy_superqboard_t::busy_w )
71{
72   m_busy = state;
73}
74
75
76//-------------------------------------------------
5077//  MACHINE_CONFIG_FRAGMENT( sandy_superqboard )
5178//-------------------------------------------------
5279
5380static MACHINE_CONFIG_FRAGMENT( sandy_superqboard )
81   MCFG_DEVICE_ADD(WD1772_TAG, WD1772x, XTAL_16MHz/2)
82   MCFG_FLOPPY_DRIVE_ADD(WD1772_TAG":0", sandy_superqboard_floppies, "35dd", floppy_image_device::default_floppy_formats)
83   MCFG_FLOPPY_DRIVE_ADD(WD1772_TAG":1", sandy_superqboard_floppies, NULL, floppy_image_device::default_floppy_formats)
84
85   MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "printer")
86   MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(sandy_superqboard_t, busy_w))
87   MCFG_CENTRONICS_OUTPUT_LATCH_ADD(TTL74273_TAG, CENTRONICS_TAG)
5488MACHINE_CONFIG_END
5589
5690
r30665r30666
77111sandy_superqboard_t::sandy_superqboard_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
78112   device_t(mconfig, SANDY_SUPERQBOARD, "SANDY_SUPERQBOARD", tag, owner, clock, "sandy_superqboard", __FILE__),
79113   device_ql_expansion_card_interface(mconfig, *this),
80   m_rom(*this, "rom")
114   m_fdc(*this, WD1772_TAG),
115   m_floppy0(*this, WD1772_TAG":0"),
116   m_floppy1(*this, WD1772_TAG":1"),
117   m_centronics(*this, CENTRONICS_TAG),
118   m_latch(*this, TTL74273_TAG),
119   m_rom(*this, "rom"),
120   m_ram(*this, "ram"),
121   m_busy(1),
122   m_int2(0),
123   m_int3(0)
81124{
82125}
83126
r30665r30666
97140
98141void sandy_superqboard_t::device_reset()
99142{
143   m_fdc->reset();
144   m_latch->write(0);
145   
146   m_int2 = 0;
147   m_int3 = 0;
100148}
149
150
151//-------------------------------------------------
152//  read -
153//-------------------------------------------------
154
155UINT8 sandy_superqboard_t::read(address_space &space, offs_t offset, UINT8 data)
156{
157   switch ((offset >> 2) & 0x03)
158   {
159   case 0:
160      data = m_fdc->read(space, offset & 0x03);
161      break;
162   
163   case 3:
164      /*
165
166         bit      description
167
168         0       BUSY
169         1       mouse pin 8
170         2       mouse pin 1
171         3       mouse pin 2
172         4       mouse pin 4 flip-flop Q
173         5       mouse pin 3 flip-flop Q
174         6       INT3
175         7       INT2
176
177      */
178
179      data = m_busy;
180      data |= m_int3 << 6;
181      data |= m_int2 << 7;
182      break;
183   }
184
185   return data;
186}
187
188
189//-------------------------------------------------
190//  write -
191//-------------------------------------------------
192
193void sandy_superqboard_t::write(address_space &space, offs_t offset, UINT8 data)
194{
195   switch ((offset >> 2) & 0x03)
196   {
197   case 0:
198      m_fdc->write(space, offset & 0x03, data);
199      break;
200
201   case 1:
202      {
203      /*
204
205         bit      description
206
207         0       SIDE ONE
208         1       DSEL0
209         2       DSEL1
210         3       M ON0
211         4       /DDEN
212         5       STROBE inverted
213         6       GAL pin 11
214         7       GAL pin 9
215
216      */
217
218      floppy_image_device *floppy = NULL;
219
220      if (BIT(data, 1))
221      {
222         floppy = m_floppy0->get_device();
223      }
224      else if (BIT(data, 2))
225      {
226         floppy = m_floppy1->get_device();
227      }
228
229      m_fdc->set_floppy(floppy);
230
231      if (floppy)
232      {
233         floppy->ss_w(BIT(data, 0));
234         floppy->mon_w(BIT(data, 3));
235      }
236
237      m_fdc->dden_w(BIT(data, 4));
238
239      m_centronics->write_strobe(!BIT(data, 5));
240      }
241      break;
242
243   case 2:
244      m_latch->write(data);
245      break;
246
247   case 4:
248      m_int2 = 0;
249      m_int3 = 0;
250      break;
251
252   case 5:
253      m_fdc->set_unscaled_clock(XTAL_16MHz >> !BIT(data, 0));
254      break;
255   }
256}
trunk/src/emu/bus/ql/trumpcard.h
r30665r30666
1515#define __QL_TRUMP_CARD__
1616
1717#include "exp.h"
18#include "machine/wd_fdc.h"
1819
1920
2021
r30665r30666
4445
4546private:
4647   required_memory_region m_rom;
48   optional_shared_ptr<UINT8> m_ram;
4749};
4850
4951
trunk/src/emu/bus/ql/sandy_superdisk.c
r30665r30666
1717//  MACROS/CONSTANTS
1818//**************************************************************************
1919
20#define WD1772_TAG      "wd1772"
21#define CENTRONICS_TAG   "centronics"
2022
2123
24
2225//**************************************************************************
2326//  DEVICE DEFINITIONS
2427//**************************************************************************
r30665r30666
4750
4851
4952//-------------------------------------------------
53//  SLOT_INTERFACE( sandy_super_disk_floppies )
54//-------------------------------------------------
55
56static SLOT_INTERFACE_START( sandy_super_disk_floppies )
57   SLOT_INTERFACE( "35dd", FLOPPY_35_DD )
58SLOT_INTERFACE_END
59
60
61//-------------------------------------------------
5062//  MACHINE_CONFIG_FRAGMENT( sandy_super_disk )
5163//-------------------------------------------------
5264
5365static MACHINE_CONFIG_FRAGMENT( sandy_super_disk )
66   MCFG_DEVICE_ADD(WD1772_TAG, WD1772x, 8000000)
67   //MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(sandy_super_disk_t, fdc_intrq_w))
68   //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)
71
72   MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "printer")
5473MACHINE_CONFIG_END
5574
5675
r30665r30666
7796sandy_super_disk_t::sandy_super_disk_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
7897   device_t(mconfig, SANDY_SUPER_DISK, "Sandy Super Disk", tag, owner, clock, "sandy_super_disk", __FILE__),
7998   device_ql_expansion_card_interface(mconfig, *this),
80   m_rom(*this, "rom")
99   m_rom(*this, "rom"),
100   m_ram(*this, "ram")
81101{
82102}
83103

Previous 199869 Revisions Next


© 1997-2024 The MAME Team