Previous 199869 Revisions Next

r18943 Tuesday 13th November, 2012 at 19:44:26 UTC by Curt Coder
(MESS) adam: Added preliminary IDE card emulation. (nw)
[src/mess]mess.mak
[src/mess/machine]adam_ide.c* adam_ide.h* adamexp.c adamexp.h c64_ide64.h

trunk/src/mess/machine/adamexp.c
r18942r18943
259259//-------------------------------------------------
260260
261261SLOT_INTERFACE_START( adam_slot2_devices )
262   SLOT_INTERFACE("ide", ADAM_IDE)
262263SLOT_INTERFACE_END
263264
264265
trunk/src/mess/machine/adam_ide.c
r0r18943
1/**********************************************************************
2
3    Micro Innovations Powermate IDE Hard Disk emulation
4
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7
8**********************************************************************/
9
10/*
11
12   TODO:
13
14   - parallel status port
15   - memory bank switching port
16   - boot ROM
17
18*/
19
20#include "adam_ide.h"
21
22
23
24//**************************************************************************
25//  MACROS/CONSTANTS
26//**************************************************************************
27
28#define IDE_TAG            "ide"
29#define CENTRONICS_TAG      "centronics"
30
31
32
33//**************************************************************************
34//  DEVICE DEFINITIONS
35//**************************************************************************
36
37const device_type ADAM_IDE = &device_creator<powermate_ide_device>;
38
39
40//-------------------------------------------------
41//  ROM( adam_ide )
42//-------------------------------------------------
43
44ROM_START( adam_ide )
45   ROM_REGION( 0x1000, "rom", 0 )
46   ROM_LOAD( "exp.rom", 0x0000, 0x1000, NO_DUMP )
47ROM_END
48
49
50//-------------------------------------------------
51//  rom_region - device-specific ROM region
52//-------------------------------------------------
53
54const rom_entry *powermate_ide_device::device_rom_region() const
55{
56   return ROM_NAME( adam_ide );
57}
58
59
60//-------------------------------------------------
61//  MACHINE_CONFIG_FRAGMENT( adam_ide )
62//-------------------------------------------------
63static MACHINE_CONFIG_FRAGMENT( adam_ide )
64   MCFG_IDE_CONTROLLER_ADD(IDE_TAG, ide_image_devices, "hdd", NULL, false)
65   MCFG_CENTRONICS_PRINTER_ADD(CENTRONICS_TAG, standard_centronics)
66MACHINE_CONFIG_END
67
68
69//-------------------------------------------------
70//  machine_config_additions - device-specific
71//  machine configurations
72//-------------------------------------------------
73
74machine_config_constructor powermate_ide_device::device_mconfig_additions() const
75{
76   return MACHINE_CONFIG_NAME( adam_ide );
77}
78
79
80
81//**************************************************************************
82//  LIVE DEVICE
83//**************************************************************************
84
85//-------------------------------------------------
86//  powermate_ide_device - constructor
87//-------------------------------------------------
88
89powermate_ide_device::powermate_ide_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
90   : device_t(mconfig, ADAM_IDE, "Powermate HP IDE", tag, owner, clock),
91     device_adam_expansion_slot_card_interface(mconfig, *this),
92     m_ide(*this, IDE_TAG),
93     m_centronics(*this, CENTRONICS_TAG)
94{
95}
96
97
98//-------------------------------------------------
99//  device_start - device-specific startup
100//-------------------------------------------------
101
102void powermate_ide_device::device_start()
103{
104}
105
106
107//-------------------------------------------------
108//  adam_bd_r - buffered data read
109//-------------------------------------------------
110
111UINT8 powermate_ide_device::adam_bd_r(address_space &space, offs_t offset, UINT8 data, int bmreq, int biorq, int aux_rom_cs, int cas1, int cas2)
112{
113   if (!biorq)
114   {
115      switch (offset & 0xff)
116      {
117      case 0x01:
118      case 0x02:
119      case 0x03:
120      case 0x04:
121      case 0x05:
122      case 0x06:
123      case 0x07:
124         data = ide_bus_r(m_ide, 0, offset & 0x07) & 0xff;
125         break;
126
127      case 0x40: // Printer status
128         /*
129         
130             bit     description
131         
132             0       
133             1       
134             2       
135             3       
136             4       
137             5       
138             6       
139             7       
140         
141         */
142         break;
143         
144      case 0x58:
145         m_ide_data = ide_bus_r(m_ide, 0, 0);
146
147         data = m_ide_data & 0xff;
148         break;
149         
150      case 0x59:
151         data = m_ide_data >> 8;
152         break;
153         
154      case 0x5a:
155         data = ide_bus_r(m_ide, 1, 6) & 0xff;
156         break;
157         
158      case 0x5b: // Digital Input Register
159         data = 0xff;
160         break;
161      }
162   }
163
164   return data;
165}
166
167
168//-------------------------------------------------
169//  adam_bd_w - buffered data write
170//-------------------------------------------------
171
172void powermate_ide_device::adam_bd_w(address_space &space, offs_t offset, UINT8 data, int bmreq, int biorq, int aux_rom_cs, int cas1, int cas2)
173{
174   if (!biorq)
175   {
176      switch (offset & 0xff)
177      {
178      case 0x02:
179      case 0x03:
180      case 0x04:
181      case 0x05:
182      case 0x06:
183      case 0x07:
184         ide_bus_w(m_ide, 0, offset & 0x07, data);
185         break;
186
187      case 0x40:
188         m_centronics->write(space, 0, data);
189         break;
190
191      case 0x42: // Bank Number
192         break;
193         
194      case 0x58:
195         m_ide_data |= data;
196         ide_bus_w(m_ide, 0, 0, m_ide_data);
197         break;
198         
199      case 0x59:
200         m_ide_data = data << 8;
201         break;
202         
203      case 0x5a: // Fixed Disk Control Register
204         break;
205      }
206   }
207}
trunk/src/mess/machine/adamexp.h
r18942r18943
140140
141141// slot devices
142142#include "machine/adamlink.h"
143#include "machine/adam_ide.h"
143144#include "machine/adam_ram.h"
144145
145146SLOT_INTERFACE_EXTERN( adam_slot1_devices );
trunk/src/mess/machine/adam_ide.h
r0r18943
1/**********************************************************************
2
3    Micro Innovations Powermate IDE Hard Disk 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 __ADAM_IDE__
13#define __ADAM_IDE__
14
15#include "emu.h"
16#include "machine/adamexp.h"
17#include "machine/ctronics.h"
18#include "machine/idectrl.h"
19
20
21
22//**************************************************************************
23//  TYPE DEFINITIONS
24//**************************************************************************
25
26// ======================> powermate_ide_device
27
28class powermate_ide_device :  public device_t,
29                       public device_adam_expansion_slot_card_interface
30{
31public:
32   // construction/destruction
33   powermate_ide_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
34
35   // optional information overrides
36   virtual const rom_entry *device_rom_region() const;
37   virtual machine_config_constructor device_mconfig_additions() const;
38
39protected:
40   // device-level overrides
41   virtual void device_config_complete() { m_shortname = "adam_ide"; }
42   virtual void device_start();
43
44   // device_adam_expansion_slot_card_interface overrides
45   virtual UINT8 adam_bd_r(address_space &space, offs_t offset, UINT8 data, int bmreq, int biorq, int aux_rom_cs, int cas1, int cas2);
46   virtual void adam_bd_w(address_space &space, offs_t offset, UINT8 data, int bmreq, int biorq, int aux_rom_cs, int cas1, int cas2);
47
48private:
49   required_device<ide_controller_device> m_ide;
50   required_device<centronics_device> m_centronics;
51
52   UINT16 m_ide_data;
53};
54
55
56// device type definition
57extern const device_type ADAM_IDE;
58
59
60
61#endif
trunk/src/mess/machine/c64_ide64.h
r18942r18943
5454private:
5555   required_device<atmel_29c010_device> m_flash_rom;
5656   required_device<ds1302_device> m_rtc;
57   required_device<device_t> m_ide;
57   required_device<ide_controller_device> m_ide;
5858
5959   UINT8 m_bank;
6060   UINT16 m_ide_data;
trunk/src/mess/mess.mak
r18942r18943
972972   $(MESS_DRIVERS)/adam.o      \
973973   $(MESS_MACHINE)/adamexp.o   \
974974   $(MESS_MACHINE)/adamlink.o   \
975   $(MESS_MACHINE)/adam_ide.o   \
975976   $(MESS_MACHINE)/adam_ram.o   \
976977   $(MESS_MACHINE)/adamnet.o   \
977978   $(MESS_MACHINE)/adam_ddp.o   \

Previous 199869 Revisions Next


© 1997-2024 The MAME Team