Previous 199869 Revisions Next

r30799 Tuesday 3rd June, 2014 at 10:54:04 UTC by Curt Coder
(MESS) ql: Expansion WIP. (nw)
[src/emu/bus/ql]exp.c rom.c sandy_superdisk.c sandy_superdisk.h sandy_superqboard.c sandy_superqboard.h trumpcard.c trumpcard.h
[src/lib]lib.mak
[src/lib/formats]ql_dsk.c* ql_dsk.h*
[src/mess]mess.mak
[src/mess/machine]microdrv.c qimi.c* qimi.h*

trunk/src/emu/bus/ql/sandy_superqboard.c
r30798r30799
3939   ROM_LOAD( "sandy_disk_controller_v1.18y_1984.ic2", 0x0000, 0x8000, CRC(d02425be) SHA1(e730576e3e0c6a1acad042c09e15fc62a32d8fbd) )
4040
4141   ROM_REGION( 0x100, "plds", 0 )
42   ROM_LOAD( "gal16v8.ic5", 0x000, 0x000, NO_DUMP )
42   ROM_LOAD( "gal16v8.ic5", 0x000, 0x100, NO_DUMP )
4343ROM_END
4444
4545
r30798r30799
6464
6565
6666//-------------------------------------------------
67//  FLOPPY_FORMATS( floppy_formats )
68//-------------------------------------------------
69
70FLOPPY_FORMATS_MEMBER( sandy_superqboard_t::floppy_formats )
71   FLOPPY_QL_FORMAT
72FLOPPY_FORMATS_END
73
74
75//-------------------------------------------------
6776//  centronics
6877//-------------------------------------------------
6978
r30798r30799
8089
8190static MACHINE_CONFIG_FRAGMENT( sandy_superqboard )
8291   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)
8594
8695   MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "printer")
8796   MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(sandy_superqboard_t, busy_w))
trunk/src/emu/bus/ql/trumpcard.h
r30798r30799
1616
1717#include "exp.h"
1818#include "machine/wd_fdc.h"
19#include "formats/ql_dsk.h"
1920
2021
2122
r30798r30799
3637   virtual const rom_entry *device_rom_region() const;
3738   virtual machine_config_constructor device_mconfig_additions() const;
3839
40   DECLARE_FLOPPY_FORMATS( floppy_formats );
41
3942protected:
4043   // device-level overrides
4144   virtual void device_start();
trunk/src/emu/bus/ql/sandy_superdisk.c
r30798r30799
5959
6060
6161//-------------------------------------------------
62//  FLOPPY_FORMATS( floppy_formats )
63//-------------------------------------------------
64
65FLOPPY_FORMATS_MEMBER( sandy_super_disk_t::floppy_formats )
66   FLOPPY_QL_FORMAT
67FLOPPY_FORMATS_END
68
69
70//-------------------------------------------------
6271//  MACHINE_CONFIG_FRAGMENT( sandy_super_disk )
6372//-------------------------------------------------
6473
r30798r30799
6675   MCFG_DEVICE_ADD(WD1772_TAG, WD1772x, 8000000)
6776   //MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(sandy_super_disk_t, fdc_intrq_w))
6877   //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)
7180
7281   MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "printer")
7382MACHINE_CONFIG_END
trunk/src/emu/bus/ql/sandy_superqboard.h
r30798r30799
1616
1717#include "exp.h"
1818#include "bus/centronics/ctronics.h"
19#include "formats/ql_dsk.h"
1920#include "machine/wd_fdc.h"
2021
2122
r30798r30799
3940
4041   WRITE_LINE_MEMBER( busy_w );
4142
43   DECLARE_FLOPPY_FORMATS( floppy_formats );
44
4245protected:
4346   // device-level overrides
4447   virtual void device_start();
trunk/src/emu/bus/ql/exp.c
r30798r30799
3030//-------------------------------------------------
3131
3232device_ql_expansion_card_interface::device_ql_expansion_card_interface(const machine_config &mconfig, device_t &device) :
33   device_slot_card_interface(mconfig, device)
33   device_slot_card_interface(mconfig, device),
34   m_romoeh(0)
3435{
3536   m_slot = dynamic_cast<ql_expansion_slot_t *>(device.owner());
3637}
trunk/src/emu/bus/ql/sandy_superdisk.h
r30798r30799
1616
1717#include "exp.h"
1818#include "bus/centronics/ctronics.h"
19#include "formats/ql_dsk.h"
1920#include "machine/wd_fdc.h"
2021
2122
r30798r30799
3738   virtual const rom_entry *device_rom_region() const;
3839   virtual machine_config_constructor device_mconfig_additions() const;
3940
41   DECLARE_FLOPPY_FORMATS( floppy_formats );
42
4043protected:
4144   // device-level overrides
4245   virtual void device_start();
trunk/src/emu/bus/ql/rom.c
r30798r30799
3232device_ql_rom_cartridge_card_interface::device_ql_rom_cartridge_card_interface(const machine_config &mconfig, device_t &device) :
3333   device_slot_card_interface(mconfig, device),
3434   m_rom(*this, "rom"),
35   m_romoeh(1)
35   m_romoeh(0)
3636{
3737   m_slot = dynamic_cast<ql_rom_cartridge_slot_t *>(device.owner());
3838}
trunk/src/emu/bus/ql/trumpcard.c
r30798r30799
3737   ROM_LOAD( "trumpcard-125.rom", 0x0000, 0x8000, CRC(938eaa46) SHA1(9b3458cf3a279ed86ba395dc45c8f26939d6c44d) )
3838
3939   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 )
4242ROM_END
4343
4444
r30798r30799
6262
6363
6464//-------------------------------------------------
65//  FLOPPY_FORMATS( floppy_formats )
66//-------------------------------------------------
67
68FLOPPY_FORMATS_MEMBER( ql_trump_card_t::floppy_formats )
69   FLOPPY_QL_FORMAT
70FLOPPY_FORMATS_END
71
72
73//-------------------------------------------------
6574//  MACHINE_CONFIG_FRAGMENT( ql_trump_card )
6675//-------------------------------------------------
6776
r30798r30799
6978   MCFG_DEVICE_ADD(WD1772_TAG, WD1772x, 8000000)
7079   //MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(ql_trump_card_t, fdc_intrq_w))
7180   //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)
7483MACHINE_CONFIG_END
7584
7685
trunk/src/lib/formats/ql_dsk.c
r0r30799
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
14ql_format::ql_format() : wd177x_format(formats)
15{
16}
17
18const char *ql_format::name() const
19{
20   return "ql";
21}
22
23const char *ql_format::description() const
24{
25   return "Sinclair QL disk image";
26}
27
28const char *ql_format::extensions() const
29{
30   return "dsk,img";
31}
32
33// unverified gaps
34const 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
54const floppy_format_type FLOPPY_QL_FORMAT = &floppy_image_format_creator<ql_format>;
Property changes on: trunk/src/lib/formats/ql_dsk.c
Added: svn:eol-style
   + native
Added: svn:mime-type
   + text/plain
trunk/src/lib/formats/ql_dsk.h
r0r30799
1// license:BSD-3-Clause
2// copyright-holders:Curt Coder
3/*********************************************************************
4
5    formats/ql_dsk.h
6
7    Sinclair QL disk image formats
8
9*********************************************************************/
10
11#ifndef QL_DSK_H_
12#define QL_DSK_H_
13
14#include "wd177x_dsk.h"
15
16class ql_format : public wd177x_format {
17public:
18   ql_format();
19
20   virtual const char *name() const;
21   virtual const char *description() const;
22   virtual const char *extensions() const;
23
24private:
25   static const format formats[];
26};
27
28extern const floppy_format_type FLOPPY_QL_FORMAT;
29
30#endif
Property changes on: trunk/src/lib/formats/ql_dsk.h
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native
trunk/src/lib/lib.mak
r30798r30799
182182   $(LIBOBJ)/formats/pmd_cas.o     \
183183   $(LIBOBJ)/formats/primoptp.o    \
184184   $(LIBOBJ)/formats/pyldin_dsk.o  \
185   $(LIBOBJ)/formats/ql_dsk.o      \
185186   $(LIBOBJ)/formats/rk_cas.o      \
186187   $(LIBOBJ)/formats/sc3000_bit.o  \
187188   $(LIBOBJ)/formats/sf7000_dsk.o  \
trunk/src/mess/mess.mak
r30798r30799
17631763   $(MESS_MACHINE)/beta.o      \
17641764   $(MESS_MACHINE)/spec_snqk.o \
17651765   $(MESS_DRIVERS)/ql.o        \
1766   $(MESS_MACHINE)/qimi.o      \
17661767   $(MESS_VIDEO)/zx8301.o      \
17671768   $(MESS_MACHINE)/zx8302.o    \
17681769
trunk/src/mess/machine/qimi.c
r0r30799
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
53const device_type QIMI = &device_creator<qimi_t>;
54
55
56//-------------------------------------------------
57//  INPUT_PORTS( qimi )
58//-------------------------------------------------
59
60INPUT_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)
76INPUT_PORTS_END
77
78
79//-------------------------------------------------
80//  input_ports - device-specific input ports
81//-------------------------------------------------
82
83ioport_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
98qimi_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
113void 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
128void 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
182READ8_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
213WRITE8_MEMBER( qimi_t::write )
214{
215   // write to 0x1bfbe resets int status
216   if (offset == 0x22)
217   {
218      m_mouse_int = 0;
219   }
220}
Property changes on: trunk/src/mess/machine/qimi.c
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native
trunk/src/mess/machine/qimi.h
r0r30799
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
46class qimi_t :  public device_t
47{
48public:
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
60protected:
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
65private:
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
83extern const device_type QIMI;
84
85
86
87#endif
Property changes on: trunk/src/mess/machine/qimi.h
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native
trunk/src/mess/machine/microdrv.c
r30798r30799
1313    CONSTANTS
1414***************************************************************************/
1515
16#define LOG 1
16#define LOG 0
1717
1818#define MDV_SECTOR_COUNT            255
1919#define MDV_SECTOR_LENGTH           686

Previous 199869 Revisions Next


© 1997-2024 The MAME Team