Previous 199869 Revisions Next

r19154 Monday 26th November, 2012 at 16:01:51 UTC by Curt Coder
(MESS) Added skeleton for Shugart SA1403D Winchester controller. (nw)
[src/mess]mess.mak
[src/mess/machine]sa1403d.c* sa1403d.h*

trunk/src/mess/machine/sa1403d.c
r0r19154
1/**********************************************************************
2
3    Shugart SA1403D Winchester Disk Controller emulation
4
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7
8**********************************************************************/
9
10#include "sa1403d.h"
11
12
13
14//**************************************************************************
15//  DEVICE DEFINITIONS
16//**************************************************************************
17
18const device_type SA1403D = &device_creator<sa1403d_device>;
19
20
21//-------------------------------------------------
22//  ROM( sa1403d )
23//-------------------------------------------------
24
25ROM_START( sa1403d )
26   ROM_REGION( 0x4000, "sa1403d", 0 )
27   ROM_DEFAULT_BIOS( "as31" )
28   ROM_SYSTEM_BIOS( 0, "as30", "AS30" )
29   ROMX_LOAD( "i",   0x0000, 0x1000, NO_DUMP, ROM_BIOS(1) )
30   ROMX_LOAD( "ii",  0x1000, 0x1000, NO_DUMP, ROM_BIOS(1) )
31   ROMX_LOAD( "iii", 0x2000, 0x1000, NO_DUMP, ROM_BIOS(1) )
32   ROMX_LOAD( "iv",  0x3000, 0x1000, NO_DUMP, ROM_BIOS(1) )
33   ROM_SYSTEM_BIOS( 1, "as31", "AS31" )
34   ROMX_LOAD( "i",   0x0000, 0x1000, NO_DUMP, ROM_BIOS(2) )
35   ROMX_LOAD( "ii",  0x1000, 0x1000, NO_DUMP, ROM_BIOS(2) )
36   ROMX_LOAD( "iii", 0x2000, 0x1000, NO_DUMP, ROM_BIOS(2) )
37   ROMX_LOAD( "iv",  0x3000, 0x1000, NO_DUMP, ROM_BIOS(2) )
38   ROM_SYSTEM_BIOS( 2, "u50", "Diagnostic PROM set 12668" )
39   ROMX_LOAD( "i",   0x0000, 0x1000, NO_DUMP, ROM_BIOS(3) )
40   ROMX_LOAD( "ii",  0x1000, 0x1000, NO_DUMP, ROM_BIOS(3) )
41   ROMX_LOAD( "iii", 0x2000, 0x1000, NO_DUMP, ROM_BIOS(3) )
42   ROMX_LOAD( "iv",  0x3000, 0x1000, NO_DUMP, ROM_BIOS(3) )
43ROM_END
44
45
46//-------------------------------------------------
47//  rom_region - device-specific ROM region
48//-------------------------------------------------
49
50const rom_entry *sa1403d_device::device_rom_region() const
51{
52   return ROM_NAME( sa1403d );
53}
54
55
56//-------------------------------------------------
57//  MACHINE_DRIVER( sa1403d )
58//-------------------------------------------------
59
60static MACHINE_CONFIG_FRAGMENT( sa1403d )
61   MCFG_HARDDISK_ADD("image")
62MACHINE_CONFIG_END
63
64
65//-------------------------------------------------
66//  machine_config_additions - device-specific
67//  machine configurations
68//-------------------------------------------------
69
70machine_config_constructor sa1403d_device::device_mconfig_additions() const
71{
72   return MACHINE_CONFIG_NAME( sa1403d );
73}
74
75
76//-------------------------------------------------
77//  INPUT_PORTS( sa1403d )
78//-------------------------------------------------
79
80INPUT_PORTS_START( sa1403d )
81   PORT_START("2H")
82   PORT_DIPNAME( 0xc0, 0x40, "LUN 0 Drive Type" ) PORT_DIPLOCATION("2H:7,8")
83   PORT_DIPSETTING(    0x00, "SA1002" ) // 2 heads, 256 cylinders
84   PORT_DIPSETTING(    0x40, "SA1004" ) // 4 heads, 256 cylinders
85   PORT_DIPSETTING(    0x80, "SA800" ) // 1 head, 77 cylinders
86   PORT_DIPSETTING(    0xc0, "SA850" ) // 2 heads, 77 cylinders
87   PORT_DIPNAME( 0x30, 0x30, "LUN 1 Drive Type" ) PORT_DIPLOCATION("2H:5,6")
88   PORT_DIPSETTING(    0x00, "SA1002" )
89   PORT_DIPSETTING(    0x10, "SA1004" )
90   PORT_DIPSETTING(    0x20, "SA800" )
91   PORT_DIPSETTING(    0x30, "SA850" )
92   PORT_DIPNAME( 0x0c, 0x0c, "LUN 2 Drive Type" ) PORT_DIPLOCATION("2H:3,4")
93   PORT_DIPSETTING(    0x00, "SA1002" )
94   PORT_DIPSETTING(    0x04, "SA1004" )
95   PORT_DIPSETTING(    0x08, "SA800" )
96   PORT_DIPSETTING(    0x0c, "SA850" )
97   PORT_DIPNAME( 0x03, 0x03, "LUN 3 Drive Type" ) PORT_DIPLOCATION("2H:1,2")
98   PORT_DIPSETTING(    0x00, "SA1002" )
99   PORT_DIPSETTING(    0x01, "SA1004" )
100   PORT_DIPSETTING(    0x02, "SA800" )
101   PORT_DIPSETTING(    0x03, "SA850" )
102INPUT_PORTS_END
103
104
105//-------------------------------------------------
106//  input_ports - device-specific input ports
107//-------------------------------------------------
108
109ioport_constructor sa1403d_device::device_input_ports() const
110{
111   return INPUT_PORTS_NAME( sa1403d );
112}
113
114
115
116//**************************************************************************
117//  LIVE DEVICE
118//**************************************************************************
119
120//-------------------------------------------------
121//  sa1403d_device - constructor
122//-------------------------------------------------
123
124sa1403d_device::sa1403d_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
125    : scsihd_device(mconfig, SA1403D, "Shugart SA1403D", tag, owner, clock)
126{
127}
128
129void sa1403d_device::ExecCommand( int *transferLength )
130{
131   switch( command[ 0 ] )
132   {
133   default:
134      scsihd_device::ExecCommand( transferLength );
135      break;
136   }
137}
138
139void sa1403d_device::WriteData( UINT8 *data, int dataLength )
140{
141   switch( command[ 0 ] )
142   {
143   default:
144      scsihd_device::WriteData( data, dataLength );
145      break;
146   }
147}
trunk/src/mess/machine/sa1403d.h
r0r19154
1/**********************************************************************
2
3    Shugart SA1403D Winchester Disk Controller emulation
4
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7
8**********************************************************************/
9
10#pragma once
11
12#ifndef __SA1403D__
13#define __SA1403D__
14
15#include "emu.h"
16#include "imagedev/harddriv.h"
17#include "machine/scsihd.h"
18
19class sa1403d_device  : public scsihd_device
20{
21public:
22   // construction/destruction
23   sa1403d_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
24
25   // optional information overrides
26   virtual const rom_entry *device_rom_region() const;
27   virtual machine_config_constructor device_mconfig_additions() const;
28   virtual ioport_constructor device_input_ports() const;
29
30   virtual void ExecCommand( int *transferLength );
31   virtual void WriteData( UINT8 *data, int dataLength );
32
33protected:
34   // device-level overrides
35   virtual void device_config_complete() { m_shortname = "sa1403d"; }
36};
37
38
39// device type definition
40extern const device_type SA1403D;
41
42#endif
trunk/src/mess/mess.mak
r19153r19154
533533   $(MESS_MACHINE)/pc_lpt.o   \
534534   $(MESS_MACHINE)/cntr_covox.o \
535535   $(MESS_MACHINE)/pcf8593.o   \
536   $(MESS_MACHINE)/sa1403d.o   \
536537   $(MESS_MACHINE)/smartmed.o   \
537538   $(MESS_MACHINE)/smc92x4.o   \
538539   $(MESS_MACHINE)/sst39vfx.o   \

Previous 199869 Revisions Next


© 1997-2024 The MAME Team