Previous 199869 Revisions Next

r26317 Wednesday 20th November, 2013 at 21:06:59 UTC by Carl
(mess) isbc: add isbx-218a floppy controller [Carl]
upd765: make soft_reset public so controller resets don't reset the fdds (nw)
[src/emu/bus]bus.mak
[src/emu/bus/isbx]isbc_218a.c* isbc_218a.h* isbx.c isbx.h
[src/emu/machine]upd765.h
[src/mess/drivers]isbc.c

trunk/src/emu/machine/upd765.h
r26316r26317
119119   void set_ready_line_connected(bool ready);
120120   void set_select_lines_connected(bool select);
121121   void set_floppy(floppy_image_device *image);
122   void soft_reset();
122123
123124protected:
124125   virtual void device_start();
r26316r26317
336337
337338   void delay_cycles(emu_timer *tm, int cycles);
338339   void check_irq();
339   void soft_reset();
340340   void fifo_expect(int size, bool write);
341341   void fifo_push(UINT8 data, bool internal);
342342   UINT8 fifo_pop(bool internal);
trunk/src/emu/bus/bus.mak
r26316r26317
287287ifneq ($(filter ISBX,$(BUSES)),)
288288BUSOBJS += $(BUSOBJ)/isbx/isbx.o
289289BUSOBJS += $(BUSOBJ)/isbx/compis_fdc.o
290BUSOBJS += $(BUSOBJ)/isbx/isbc_218a.o
290291endif
291292
292293
trunk/src/emu/bus/isbx/isbc_218a.c
r0r26317
1// license:BSD-3-Clause
2// copyright-holders:Curt Coder
3/**********************************************************************
4
5    ISBX 218a with ISBC configuration
6
7    Copyright MESS Team.
8    Visit http://mamedev.org for licensing and usage restrictions.
9
10**********************************************************************/
11
12#include "isbc_218a.h"
13
14
15//**************************************************************************
16//  MACROS / CONSTANTS
17//**************************************************************************
18
19#define I8272_TAG   "u14"
20
21
22
23//**************************************************************************
24//  DEVICE DEFINITIONS
25//**************************************************************************
26
27const device_type ISBC_218A = &device_creator<isbc_218a_device>;
28
29
30//-------------------------------------------------
31//  floppy_format_type floppy_formats
32//-------------------------------------------------
33
34void isbc_218a_device::fdc_irq(bool state)
35{
36   m_slot->mintr1_w(state);
37}
38
39void isbc_218a_device::fdc_drq(bool state)
40{
41   m_slot->mdrqt_w(state);
42}
43
44FLOPPY_FORMATS_MEMBER( isbc_218a_device::floppy_formats )
45   FLOPPY_PC_FORMAT
46FLOPPY_FORMATS_END
47
48static SLOT_INTERFACE_START( isbc_218a_floppies )
49   SLOT_INTERFACE( "525dd", FLOPPY_525_DD )
50SLOT_INTERFACE_END
51
52
53//-------------------------------------------------
54//  MACHINE_DRIVER( isbc_218a )
55//-------------------------------------------------
56
57static MACHINE_CONFIG_FRAGMENT( isbc_218a )
58   MCFG_I8272A_ADD(I8272_TAG, true)
59   MCFG_FLOPPY_DRIVE_ADD(I8272_TAG":0", isbc_218a_floppies, "525dd", isbc_218a_device::floppy_formats)
60MACHINE_CONFIG_END
61
62
63//-------------------------------------------------
64//  machine_config_additions - device-specific
65//  machine configurations
66//-------------------------------------------------
67
68machine_config_constructor isbc_218a_device::device_mconfig_additions() const
69{
70   return MACHINE_CONFIG_NAME( isbc_218a );
71}
72
73
74
75//**************************************************************************
76//  LIVE DEVICE
77//**************************************************************************
78
79//-------------------------------------------------
80//  isbc_218a_device - constructor
81//-------------------------------------------------
82
83isbc_218a_device::isbc_218a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
84   device_t(mconfig, ISBC_218A, "ISBX 218a for ISBC", tag, owner, clock, "isbc_218a", __FILE__),
85   device_isbx_card_interface(mconfig, *this),
86   m_fdc(*this, I8272_TAG),
87   m_floppy0(*this, I8272_TAG":0")
88{
89}
90
91
92//-------------------------------------------------
93//  device_start - device-specific startup
94//-------------------------------------------------
95
96void isbc_218a_device::device_start()
97{
98   m_fdc->setup_intrq_cb(i8272a_device::line_cb(FUNC(isbc_218a_device::fdc_irq), this));
99   m_fdc->setup_drq_cb(i8272a_device::line_cb(FUNC(isbc_218a_device::fdc_drq), this));
100}
101
102
103//-------------------------------------------------
104//  device_reset - device-specific reset
105//-------------------------------------------------
106
107void isbc_218a_device::device_reset()
108{
109   m_fdc->reset();
110}
111
112
113//-------------------------------------------------
114//  mcs0_r - chip select 0 read
115//-------------------------------------------------
116
117UINT8 isbc_218a_device::mcs0_r(address_space &space, offs_t offset)
118{
119   UINT8 data = 0xff;
120
121   switch (BIT(offset, 0))
122   {
123   case 0: data = m_fdc->msr_r(space, 0); break;
124   case 1: data = m_fdc->fifo_r(space, 0); break;
125   }
126
127   return data;
128}
129
130
131//-------------------------------------------------
132//  mcs0_w - chip select 0 write
133//-------------------------------------------------
134
135void isbc_218a_device::mcs0_w(address_space &space, offs_t offset, UINT8 data)
136{
137   switch (BIT(offset, 0))
138   {
139   case 1: m_fdc->fifo_w(space, 0, data); break;
140   }
141}
142
143
144//-------------------------------------------------
145//  mcs1_r - chip select 1 read
146//-------------------------------------------------
147
148UINT8 isbc_218a_device::mcs1_r(address_space &space, offs_t offset)
149{
150   UINT8 data = 0xff;
151
152   switch (offset)
153   {
154   case 4: data = m_reset; break;
155   }
156
157   return data;
158}
159
160
161//-------------------------------------------------
162//  mcs1_w - chip select 1 write
163//-------------------------------------------------
164
165void isbc_218a_device::mcs1_w(address_space &space, offs_t offset, UINT8 data)
166{
167   switch (offset)
168   {
169   case 2: m_floppy0->get_device()->mon_w(data & 1); break;
170   case 4:
171      if(!(data & 1) && m_reset)
172         m_fdc->soft_reset();
173      m_reset = (data & 1) ? true : false;
174      break;
175   case 6: m_fdc->tc_w(data & 1); break;
176   }
177}
178
179
180//-------------------------------------------------
181//  mdack_r - DMA acknowledge read
182//-------------------------------------------------
183
184UINT8 isbc_218a_device::mdack_r(address_space &space, offs_t offset)
185{
186   return m_fdc->dma_r();
187}
188
189
190//-------------------------------------------------
191//  mdack_w - DMA acknowledge write
192//-------------------------------------------------
193
194void isbc_218a_device::mdack_w(address_space &space, offs_t offset, UINT8 data)
195{
196   m_fdc->dma_w(data);
197}
198
199
200//-------------------------------------------------
201//  opt0_w - option 0 write
202//-------------------------------------------------
203
204void isbc_218a_device::opt0_w(int state)
205{
206   m_fdc->tc_w(state);
207}
Property changes on: trunk/src/emu/bus/isbx/isbc_218a.c
Added: svn:eol-style
   + native
Added: svn:mime-type
   + text/plain
trunk/src/emu/bus/isbx/isbc_218a.h
r0r26317
1// license:BSD-3-Clause
2// copyright-holders:Curt Coder
3/**********************************************************************
4
5    ISBX 218a with ISBC configuration
6
7    Copyright MESS Team.
8    Visit http://mamedev.org for licensing and usage restrictions.
9
10**********************************************************************/
11
12#pragma once
13
14#ifndef __ISBC_218A__
15#define __ISBC_218A__
16
17#include "emu.h"
18#include "isbx.h"
19#include "formats/pc_dsk.h"
20#include "machine/upd765.h"
21
22
23
24//**************************************************************************
25//  TYPE DEFINITIONS
26//**************************************************************************
27
28// ======================> compis_fdc_device
29
30class isbc_218a_device : public device_t,
31                     public device_isbx_card_interface
32{
33public:
34   // construction/destruction
35   isbc_218a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
36
37   // optional information overrides
38   virtual machine_config_constructor device_mconfig_additions() const;
39
40   DECLARE_FLOPPY_FORMATS( floppy_formats );
41
42protected:
43   // device-level overrides
44   virtual void device_start();
45   virtual void device_reset();
46
47   // device_isbx_card_interface overrides
48   virtual UINT8 mcs0_r(address_space &space, offs_t offset);
49   virtual void mcs0_w(address_space &space, offs_t offset, UINT8 data);
50   virtual UINT8 mcs1_r(address_space &space, offs_t offset);
51   virtual void mcs1_w(address_space &space, offs_t offset, UINT8 data);
52   virtual UINT8 mdack_r(address_space &space, offs_t offset);
53   virtual void mdack_w(address_space &space, offs_t offset, UINT8 data);
54   virtual void opt0_w(int state);
55
56private:
57   required_device<i8272a_device> m_fdc;
58   required_device<floppy_connector> m_floppy0;
59
60   void fdc_irq(bool state);
61   void fdc_drq(bool state);
62   bool m_reset;
63};
64
65
66// device type definition
67extern const device_type ISBC_218A;
68
69
70#endif
Property changes on: trunk/src/emu/bus/isbx/isbc_218a.h
Added: svn:eol-style
   + native
Added: svn:mime-type
   + text/plain
trunk/src/emu/bus/isbx/isbx.c
r26316r26317
7373
7474SLOT_INTERFACE_START( isbx_cards )
7575   SLOT_INTERFACE("fdc", COMPIS_FDC)
76   SLOT_INTERFACE("fdc_218a", ISBC_218A)
7677SLOT_INTERFACE_END
trunk/src/emu/bus/isbx/isbx.h
r26316r26317
149149
150150// slot devices
151151#include "compis_fdc.h"
152#include "isbc_218a.h"
152153
153154SLOT_INTERFACE_EXTERN( isbx_cards );
154155
trunk/src/mess/drivers/isbc.c
r26316r26317
3434   m_terminal(*this, "terminal"),
3535   m_uart8251(*this, "uart8251"),
3636   m_uart8274(*this, "uart8274"),
37   m_pic_0(*this, "pic_0"),
3738   m_pic_1(*this, "pic_1"),
3839   m_centronics(*this, "centronics")
3940   { }
r26316r26317
4243   required_device<serial_terminal_device> m_terminal;
4344   optional_device<i8251_device> m_uart8251;
4445   optional_device<i8274_device> m_uart8274;
46   required_device<pic8259_device> m_pic_0;
4547   optional_device<pic8259_device> m_pic_1;
4648   optional_device<centronics_device> m_centronics;
4749
r26316r26317
5153   DECLARE_READ8_MEMBER(get_slave_ack);
5254   DECLARE_READ8_MEMBER(ppi_b_r);
5355   DECLARE_WRITE8_MEMBER(ppi_c_w);
56   IRQ_CALLBACK_MEMBER( irq_callback ) { return m_pic_0->inta_r(); }
57   void driver_start() { m_maincpu->set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(isbc_state::irq_callback),this)); }
5458};
5559
5660static ADDRESS_MAP_START(rpc86_mem, AS_PROGRAM, 16, isbc_state)
r26316r26317
302306   MCFG_CPU_ADD("maincpu", I8086, XTAL_5MHz)
303307   MCFG_CPU_PROGRAM_MAP(rpc86_mem)
304308   MCFG_CPU_IO_MAP(rpc86_io)
309   MCFG_PIC8259_ADD("pic_0", INPUTLINE(":maincpu", 0), VCC, NULL)
305310
306311   /* video hardware */
307312   MCFG_SERIAL_TERMINAL_ADD("terminal", terminal_intf, 300)
r26316r26317
320325   MCFG_I8274_ADD("uart8274", XTAL_16MHz/4, isbc_uart8274_interface)
321326   MCFG_RS232_PORT_ADD("rs232", rs232_intf, default_rs232_devices, NULL)
322327
323   MCFG_ISBX_SLOT_ADD("sbx1", 0, isbx_cards, "fdc")
328   MCFG_ISBX_SLOT_ADD("sbx1", 0, isbx_cards, "fdc_218a")
324329   MCFG_ISBX_SLOT_MINTR0_CALLBACK(DEVWRITELINE("pic_1", pic8259_device, ir3_w))
325330   MCFG_ISBX_SLOT_MINTR1_CALLBACK(DEVWRITELINE("pic_1", pic8259_device, ir4_w))
326331   MCFG_ISBX_SLOT_ADD("sbx2", 0, isbx_cards, NULL)

Previous 199869 Revisions Next


© 1997-2024 The MAME Team