Previous 199869 Revisions Next

r23297 Thursday 30th May, 2013 at 13:58:06 UTC by Curt Coder
(MESS) softbox: Fixed Corvus hard disk interface. (nw)
[src/mess/drivers]softbox.c
[src/mess/includes]corvushd.h softbox.h
[src/mess/machine]corvushd.c softbox.c softbox.h

trunk/src/mess/includes/corvushd.h
r23296r23297
44 *
55 * Implementation of the Corvus Systems Flat Cable Hard Disk controller
66 *
7 * Corvus Model 6 (5 MB): IMI 5006H hard disk (-chs 144,4,20 -ss 512)
8 * Corvus Model 11 (10 MB): IMI 5012H hard disk (-chs 358,3,20 -ss 512)
9 * Corvus Model 20 (20 MB): IMI 5018H hard disk (-chs 388,5,20 -ss 512)
10 *
711 ****************************************************************************/
812
913#ifndef CORVUSHD_H_
trunk/src/mess/includes/softbox.h
r23296r23297
1515#include "machine/serial.h"
1616
1717#define Z80_TAG         "z80"
18#define I8251_TAG       "i8251"
18#define I8251_TAG       "ic15"
1919#define I8255_0_TAG     "ic17"
2020#define I8255_1_TAG     "ic16"
2121#define COM8116_TAG     "ic14"
r23296r23297
2626public:
2727   softbox_state(const machine_config &mconfig, device_type type, const char *tag)
2828      : driver_device(mconfig, type, tag),
29         m_maincpu(*this, Z80_TAG),
30         m_usart(*this, I8251_TAG),
3129         m_dbrg(*this, COM8116_TAG),
32         m_ieee(*this, IEEE488_TAG),
33         m_corvus_active(false)
30         m_ieee(*this, IEEE488_TAG)
3431   { }
3532
36   required_device<cpu_device> m_maincpu;
37   required_device<i8251_device> m_usart;
3833   required_device<com8116_device> m_dbrg;
3934   required_device<ieee488_device> m_ieee;
4035
r23296r23297
5045   DECLARE_READ8_MEMBER( ppi1_pc_r );
5146   DECLARE_WRITE8_MEMBER( ppi1_pc_w );
5247
53   DECLARE_WRITE_LINE_MEMBER( fr_w );
54   DECLARE_WRITE_LINE_MEMBER( ft_w );
55
5648   enum
5749   {
5850      LED_A,
5951      LED_B,
6052      LED_READY
6153   };
62
63   bool m_corvus_active;
6454};
6555
6656#endif
trunk/src/mess/drivers/softbox.c
r23296r23297
198198     PC2
199199     PC3
200200     PC4     Corvus READY
201     PC5     Corvus ACTIVE
201     PC5     Corvus DIRC
202202     PC6
203203     PC7
204204
205205   */
206206
207   UINT8 status = corvus_hdc_status_r(space, 0);
207208   UINT8 data = 0;
208209
209   data |= (corvus_hdc_status_r(space, 0) & CONTROLLER_BUSY) ? 0x10 : 0;
210   data |= m_corvus_active ? 0x20 : 0;
210   data |= (status & CONTROLLER_BUSY) ? 0 : 0x10;
211   data |= (status & CONTROLLER_DIRECTION) ? 0 : 0x20;
211212
212213   return data;
213214}
r23296r23297
249250//  COM8116_INTERFACE( dbrg_intf )
250251//-------------------------------------------------
251252
252WRITE_LINE_MEMBER( softbox_state::fr_w )
253{
254   m_usart->receive_clock();
255}
256
257WRITE_LINE_MEMBER( softbox_state::ft_w )
258{
259   m_usart->transmit_clock();
260}
261
262253static COM8116_INTERFACE( dbrg_intf )
263254{
264255   DEVCB_NULL, // fX/4
265   DEVCB_DRIVER_LINE_MEMBER(softbox_state, fr_w),
266   DEVCB_DRIVER_LINE_MEMBER(softbox_state, ft_w),
256   DEVCB_DEVICE_LINE_MEMBER(I8251_TAG, i8251_device, rxc_w),
257   DEVCB_DEVICE_LINE_MEMBER(I8251_TAG, i8251_device, txc_w),
267258   COM8116_DIVISORS_16X_5_0688MHz, // receiver
268259   COM8116_DIVISORS_16X_5_0688MHz // transmitter
269260};
r23296r23297
299290
300291void softbox_state::machine_start()
301292{
302   if (corvus_hdc_init(machine()) == TRUE)
303   {
304      m_corvus_active = true;
305   }
293   corvus_hdc_init(machine());
306294}
307295
308296
trunk/src/mess/machine/softbox.c
r23296r23297
1616//**************************************************************************
1717
1818#define Z80_TAG         "z80"
19#define I8251_TAG       "i8251"
19#define I8251_TAG       "ic15"
2020#define I8255_0_TAG     "ic17"
2121#define I8255_1_TAG     "ic16"
2222#define COM8116_TAG     "ic14"
r23296r23297
199199     PC2
200200     PC3
201201     PC4     Corvus READY
202     PC5     Corvus ACTIVE
202     PC5     Corvus DIRC
203203     PC6
204204     PC7
205205
206206   */
207207
208   UINT8 status = corvus_hdc_status_r(space, 0);
208209   UINT8 data = 0;
209210
210   data |= (corvus_hdc_status_r(space, 0) & CONTROLLER_BUSY) ? 0x10 : 0;
211   data |= m_corvus_active ? 0x20 : 0;
211   data |= (status & CONTROLLER_BUSY) ? 0 : 0x10;
212   data |= (status & CONTROLLER_DIRECTION) ? 0 : 0x20;
212213
213214   return data;
214215}
r23296r23297
250251//  COM8116_INTERFACE( dbrg_intf )
251252//-------------------------------------------------
252253
253WRITE_LINE_MEMBER( softbox_device::fr_w )
254{
255   m_usart->receive_clock();
256}
257
258WRITE_LINE_MEMBER( softbox_device::ft_w )
259{
260   m_usart->transmit_clock();
261}
262
263254static COM8116_INTERFACE( dbrg_intf )
264255{
265256   DEVCB_NULL, // fX/4
266   DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, softbox_device, fr_w),
267   DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, softbox_device, ft_w),
257   DEVCB_DEVICE_LINE_MEMBER(I8251_TAG, i8251_device, rxc_w),
258   DEVCB_DEVICE_LINE_MEMBER(I8251_TAG, i8251_device, txc_w),
268259   COM8116_DIVISORS_16X_5_0688MHz, // receiver
269260   COM8116_DIVISORS_16X_5_0688MHz // transmitter
270261};
r23296r23297
354345softbox_device::softbox_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
355346   : device_t(mconfig, SOFTBOX, "PET SoftBox", tag, owner, clock, "pet_softbox", __FILE__),
356347      device_ieee488_interface(mconfig, *this),
357      m_maincpu(*this, Z80_TAG),
358      m_usart(*this, I8251_TAG),
359      m_dbrg(*this, COM8116_TAG),
360      m_corvus_active(false)
348      m_dbrg(*this, COM8116_TAG)
361349{
362350}
363351
r23296r23297
368356
369357void softbox_device::device_start()
370358{
371   if (corvus_hdc_init(machine()) == TRUE)
372   {
373      m_corvus_active = true;
374   }
359   corvus_hdc_init(machine());
375360}
376361
377362
378363//-------------------------------------------------
379//  device_reset - device-specific reset
380//-------------------------------------------------
381
382void softbox_device::device_reset()
383{
384}
385
386
387//-------------------------------------------------
388364//  dbrg_w - baud rate selection
389365//-------------------------------------------------
390366
trunk/src/mess/machine/softbox.h
r23296r23297
1212#ifndef __PET_SOFTBOX__
1313#define __PET_SOFTBOX__
1414
15
1615#include "emu.h"
1716#include "cpu/z80/z80.h"
1817#include "imagedev/harddriv.h"
r23296r23297
5453   DECLARE_READ8_MEMBER( ppi1_pc_r );
5554   DECLARE_WRITE8_MEMBER( ppi1_pc_w );
5655
57   DECLARE_WRITE_LINE_MEMBER( fr_w );
58   DECLARE_WRITE_LINE_MEMBER( ft_w );
59
6056protected:
6157   // device-level overrides
6258   virtual void device_start();
63   virtual void device_reset();
6459
6560private:
6661   enum
r23296r23297
7065      LED_READY
7166   };
7267
73   required_device<cpu_device> m_maincpu;
74   required_device<i8251_device> m_usart;
7568   required_device<com8116_device> m_dbrg;
76
77   bool m_corvus_active;
7869};
7970
8071
trunk/src/mess/machine/corvushd.c
r23296r23297
13061306            default:
13071307               c->xmit_bytes = 1;
13081308               c->buffer.single_byte_response.status = STAT_FAULT | STAT_FATAL_ERR;
1309               logerror("corvus_hdc_data_w: Unimplemented Prep command, returning FATAL FAULT status!\n");
1309               logerror("corvus_hdc_data_w: Unimplemented Prep command %02x, returning FATAL FAULT status!\n", c->buffer.command.code);
13101310         }
13111311      }
13121312      if (VERBOSE_RESPONSES)
r23296r23297
13281328      c->buffer.single_byte_response.status =
13291329         STAT_FATAL_ERR | STAT_ILL_CMD_OP_CODE;      // Respond with an Illegal Op Code
13301330
1331      logerror("corvus_hdc_data_w: Illegal Command, status: 0x%2.2x\n", c->buffer.single_byte_response.status);
1331      logerror("corvus_hdc_data_w: Illegal Command %02x, status: 0x%2.2x\n", c->buffer.single_byte_response.status, c->buffer.command.code);
13321332   }
13331333   //
13341334   // Command execution complete, free up the controller

Previous 199869 Revisions Next


© 1997-2024 The MAME Team