Previous 15994 Revisions Next

r7178 Tuesday 26th January, 2010 at 11:06:02 UTC by Curt Coder
Added Commodore 8280 floppy skeleton.
[src/mess]mess.mak
[src/mess/machine]c8280.c* c8280.h*

src/mess/machine/c8280.c
r0r7178
1/**********************************************************************
2
3    Commodore 8280 Dual 8" Disk Drive emulation
4
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7
8**********************************************************************/
9
10#include "emu.h"
11#include "c8280.h"
12#include "cpu/m6502/m6502.h"
13#include "devices/flopdrv.h"
14#include "machine/6532riot.h"
15#include "machine/ieee488.h"
16
17/***************************************************************************
18    PARAMETERS
19***************************************************************************/
20
21#define LOG 0
22
23#define M6502_DOS_TAG   "5c"
24#define M6502_FDC_TAG   "9e"
25#define M6532_0_TAG      "9f"
26#define M6532_1_TAG      "9g"
27
28/***************************************************************************
29    TYPE DEFINITIONS
30***************************************************************************/
31
32typedef struct _c8280_t c8280_t;
33struct _c8280_t
34{
35   /* abstractions */
36   int address;                  /* bus address - 8 */
37
38   /* devices */
39   const device_config *cpu_dos;
40   const device_config *cpu_fdc;
41   const device_config *riot0;
42   const device_config *riot1;
43   const device_config *bus;
44   const device_config *image[2];
45};
46
47/***************************************************************************
48    INLINE FUNCTIONS
49***************************************************************************/
50
51INLINE c8280_t *get_safe_token(const device_config *device)
52{
53   assert(device != NULL);
54   assert(device->token != NULL);
55   assert(device->type == C8280);
56   return (c8280_t *)device->token;
57}
58
59INLINE c8280_config *get_safe_config(const device_config *device)
60{
61   assert(device != NULL);
62   assert(device->type == C8280);
63   return (c8280_config *)device->inline_config;
64}
65
66/***************************************************************************
67    IMPLEMENTATION
68***************************************************************************/
69
70/*-------------------------------------------------
71    c8280_ieee488_atn_w - IEEE-488 bus attention
72-------------------------------------------------*/
73
74WRITE_LINE_DEVICE_HANDLER( c8280_ieee488_atn_w )
75{
76}
77
78/*-------------------------------------------------
79    c8280_ieee488_ifc_w - IEEE-488 bus reset
80-------------------------------------------------*/
81
82WRITE_LINE_DEVICE_HANDLER( c8280_ieee488_ifc_w )
83{
84   if (!state)
85   {
86      device_reset(device);
87   }
88}
89
90/*-------------------------------------------------
91    ADDRESS_MAP( c8280_dos_map )
92-------------------------------------------------*/
93
94static ADDRESS_MAP_START( c8280_dos_map, ADDRESS_SPACE_PROGRAM, 8 )
95   AM_RANGE(0xc000, 0xffff) AM_ROM AM_REGION("c8280", 0x0000)
96ADDRESS_MAP_END
97
98/*-------------------------------------------------
99    ADDRESS_MAP( c8280_fdc_map )
100-------------------------------------------------*/
101
102static ADDRESS_MAP_START( c8280_fdc_map, ADDRESS_SPACE_PROGRAM, 8 )
103ADDRESS_MAP_END
104
105/*-------------------------------------------------
106    riot6532_interface riot0_intf
107-------------------------------------------------*/
108
109static const riot6532_interface riot0_intf =
110{
111   DEVCB_NULL,
112   DEVCB_NULL,
113   DEVCB_NULL,
114   DEVCB_NULL,
115   DEVCB_NULL
116};
117
118/*-------------------------------------------------
119    riot6532_interface riot1_intf
120-------------------------------------------------*/
121
122static const riot6532_interface riot1_intf =
123{
124   DEVCB_NULL,
125   DEVCB_NULL,
126   DEVCB_NULL,
127   DEVCB_NULL,
128   DEVCB_NULL
129};
130
131/*-------------------------------------------------
132    FLOPPY_OPTIONS( c8280 )
133-------------------------------------------------*/
134
135static FLOPPY_OPTIONS_START( c8280 )
136FLOPPY_OPTIONS_END
137
138/*-------------------------------------------------
139    floppy_config c8280_floppy_config
140-------------------------------------------------*/
141
142static const floppy_config c8280_floppy_config =
143{
144   DEVCB_NULL,
145   DEVCB_NULL,
146   DEVCB_NULL,
147   DEVCB_NULL,
148   DEVCB_NULL,
149   FLOPPY_DRIVE_DS_80,
150   FLOPPY_OPTIONS_NAME(c8280),
151   DO_NOT_KEEP_GEOMETRY
152};
153
154/*-------------------------------------------------
155    MACHINE_DRIVER( c8280 )
156-------------------------------------------------*/
157
158static MACHINE_DRIVER_START( c8280 )
159   MDRV_CPU_ADD(M6502_DOS_TAG, M6502, 1000000)
160   MDRV_CPU_PROGRAM_MAP(c8280_dos_map)
161
162   MDRV_RIOT6532_ADD(M6532_0_TAG, 1000000, riot0_intf)
163   MDRV_RIOT6532_ADD(M6532_1_TAG, 1000000, riot1_intf)
164
165   MDRV_CPU_ADD(M6502_FDC_TAG, M6502, 1000000)
166   MDRV_CPU_PROGRAM_MAP(c8280_fdc_map)
167
168   MDRV_FLOPPY_2_DRIVES_ADD(c8280_floppy_config)
169MACHINE_DRIVER_END
170
171/*-------------------------------------------------
172    ROM( c8280 )
173-------------------------------------------------*/
174
175ROM_START( c8280 )
176   ROM_REGION( 0x4800, "c8280", ROMREGION_LOADBYNAME )
177   ROM_LOAD( "300542-001.10c", 0x0000, 0x2000, CRC(3c6eee1e) SHA1(0726f6ab4de4fc9c18707fe87780ffd9f5ed72ab) )
178   ROM_LOAD( "300543-001.10d", 0x2000, 0x2000, CRC(f58e665e) SHA1(9e58b47c686c91efc6ef1a27f72dbb5e26c485ec) )
179   ROM_LOAD( "300541-001.3c",  0x4000, 0x0800, CRC(cb07b2db) SHA1(a1f9c5a7bd3798f5a97dc0b465c3bf5e3513e148) )
180ROM_END
181
182/*-------------------------------------------------
183    DEVICE_START( c8280 )
184-------------------------------------------------*/
185
186static DEVICE_START( c8280 )
187{
188   c8280_t *c8280 = get_safe_token(device);
189   const c8280_config *config = get_safe_config(device);
190
191   /* set serial address */
192   assert((config->address > 7) && (config->address < 16));
193   c8280->address = config->address - 8;
194
195   /* find our CPU */
196   c8280->cpu_dos = device_find_child_by_tag(device, M6502_DOS_TAG);
197   c8280->cpu_fdc = device_find_child_by_tag(device, M6502_FDC_TAG);
198}
199
200/*-------------------------------------------------
201    DEVICE_RESET( c8280 )
202-------------------------------------------------*/
203
204static DEVICE_RESET( c8280 )
205{
206   c8280_t *c8280 = get_safe_token(device);
207
208   device_reset(c8280->cpu_dos);
209   device_reset(c8280->cpu_fdc);
210}
211
212/*-------------------------------------------------
213    DEVICE_GET_INFO( c8280 )
214-------------------------------------------------*/
215
216DEVICE_GET_INFO( c8280 )
217{
218   switch (state)
219   {
220      /* --- the following bits of info are returned as 64-bit signed integers --- */
221      case DEVINFO_INT_TOKEN_BYTES:               info->i = sizeof(c8280_t);                           break;
222      case DEVINFO_INT_INLINE_CONFIG_BYTES:         info->i = sizeof(c8280_config);                        break;
223      case DEVINFO_INT_CLASS:                     info->i = DEVICE_CLASS_PERIPHERAL;                     break;
224
225      /* --- the following bits of info are returned as pointers --- */
226      case DEVINFO_PTR_ROM_REGION:               info->romregion = ROM_NAME(c8280);                     break;
227      case DEVINFO_PTR_MACHINE_CONFIG:            info->machine_config = MACHINE_DRIVER_NAME(c8280);         break;
228
229      /* --- the following bits of info are returned as pointers to data or functions --- */
230      case DEVINFO_FCT_START:                     info->start = DEVICE_START_NAME(c8280);                  break;
231      case DEVINFO_FCT_STOP:                     /* Nothing */                                    break;
232      case DEVINFO_FCT_RESET:                     info->reset = DEVICE_RESET_NAME(c8280);                  break;
233
234      /* --- the following bits of info are returned as NULL-terminated strings --- */
235      case DEVINFO_STR_NAME:                     strcpy(info->s, "Commodore 8280");                     break;
236      case DEVINFO_STR_FAMILY:                  strcpy(info->s, "Commodore PET");                     break;
237      case DEVINFO_STR_VERSION:                  strcpy(info->s, "1.0");                              break;
238      case DEVINFO_STR_SOURCE_FILE:               strcpy(info->s, __FILE__);                           break;
239      case DEVINFO_STR_CREDITS:                  strcpy(info->s, "Copyright the MESS Team");             break;
240   }
241}
src/mess/machine/c8280.h
r0r7178
1/**********************************************************************
2
3    Commodore 8280 Dual 8" Disk Drive emulation
4
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7
8**********************************************************************/
9
10#ifndef __C8280__
11#define __C8280__
12
13#include "emu.h"
14
15/***************************************************************************
16    MACROS / CONSTANTS
17***************************************************************************/
18
19#define C8280   DEVICE_GET_INFO_NAME( c8280 )
20
21#define MDRV_C8280_ADD(_tag, _bus_tag, _address) \
22   MDRV_DEVICE_ADD(_tag, C8280, 0) \
23   MDRV_DEVICE_CONFIG_DATAPTR(c8280_config, bus_tag, _bus_tag) \
24   MDRV_DEVICE_CONFIG_DATA32(c8280_config, address, _address)
25
26#define C8280_IEEE488(_tag) \
27   _tag, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_DEVICE_LINE(_tag, c8280_ieee488_ifc_w), DEVCB_NULL, DEVCB_DEVICE_LINE(_tag, c8280_ieee488_atn_w), DEVCB_NULL
28
29/***************************************************************************
30    TYPE DEFINITIONS
31***************************************************************************/
32
33typedef struct _c8280_config c8280_config;
34struct _c8280_config
35{
36   const char *bus_tag;      /* bus device */
37   int address;            /* bus address */
38};
39
40/***************************************************************************
41    PROTOTYPES
42***************************************************************************/
43
44/* device interface */
45DEVICE_GET_INFO( c8280 );
46
47/* IEEE-488 interface */
48WRITE_LINE_DEVICE_HANDLER( c8280_ieee488_atn_w );
49WRITE_LINE_DEVICE_HANDLER( c8280_ieee488_ifc_w );
50
51#endif
src/mess/mess.mak
r7177r7178
708708   $(MESS_MACHINE)/c1571.o      \
709709   $(MESS_MACHINE)/c1581.o      \
710710   $(MESS_MACHINE)/c2040.o      \
711   $(MESS_MACHINE)/c8280.o      \
711712   $(MESS_FORMATS)/d64_dsk.o   \
712713   $(MESS_FORMATS)/g64_dsk.o   \
713714   $(MESS_DRIVERS)/clcd.o      \

Previous 15994 Revisions Next


© 1998-2018 The MESS Team