Previous 15994 Revisions Next

r7581 Tuesday 16th March, 2010 at 08:17:40 UTC by Curt Coder
Added preliminary 64H156 gate array emulation (used in CBM 1541 class drives).
[src/mess]mess.mak
[src/mess/machine]64h156.c* 64h156.h*

src/mess/machine/64h156.c
r0r7581
1/**********************************************************************
2
3    Commodore 64H165 Gate Array 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 "64h156.h"
12#include "formats/g64_dsk.h"
13
14/***************************************************************************
15    PARAMETERS
16***************************************************************************/
17
18/***************************************************************************
19    TYPE DEFINITIONS
20***************************************************************************/
21
22typedef struct _c64h156_t c64h156_t;
23struct _c64h156_t
24{
25   /* motors */
26   int stp;                        /* stepper motor phase */
27   int mtr;                        /* spindle motor on */
28
29   /* track */
30   UINT8 track_buffer[G64_BUFFER_SIZE];   /* track data buffer */
31   int track_len;                     /* track length */
32   int buffer_pos;                     /* current byte position within track buffer */
33   int bit_pos;                     /* current bit position within track buffer byte */
34   int bit_count;                     /* current data byte bit counter */
35   UINT16 data;                     /* data shift register */
36   UINT8 yb;                        /* GCR data byte to write */
37
38   /* signals */
39   int ds;                           /* density select */
40   int soe;                        /* s? output enable */
41   int byte;                        /* byte ready */
42   int mode;                        /* mode (0 = write, 1 = read) */
43};
44
45/***************************************************************************
46    INLINE FUNCTIONS
47***************************************************************************/
48
49INLINE c64h156_t *get_safe_token(running_device *device)
50{
51   assert(device != NULL);
52   assert(device->token != NULL);
53   assert(device->type == C64H156);
54   return (c64h156_t *)device->token;
55}
56
57/***************************************************************************
58    IMPLEMENTATION
59***************************************************************************/
60
61READ8_DEVICE_HANDLER( c64h156_yb_r )
62{
63   return 0;
64}
65
66WRITE8_DEVICE_HANDLER( c64h156_yb_w )
67{
68}
69
70READ_LINE_DEVICE_HANDLER( c64h156_sync_r )
71{
72   return 0;
73}
74
75READ_LINE_DEVICE_HANDLER( c64h156_byte_r )
76{
77   return 0;
78}
79
80void c64h156_stp_w(running_device *device, int stp)
81{
82}
83
84WRITE_LINE_DEVICE_HANDLER( c64h156_stp1_w )
85{
86}
87
88WRITE_LINE_DEVICE_HANDLER( c64h156_mtr_w )
89{
90}
91
92void c64h156_ds_w(running_device *device, int data)
93{
94}
95
96WRITE_LINE_DEVICE_HANDLER( c64h156_ted_w )
97{
98}
99
100WRITE_LINE_DEVICE_HANDLER( c64h156_oe_w )
101{
102}
103
104WRITE_LINE_DEVICE_HANDLER( c64h156_soe_w )
105{
106}
107
108WRITE_LINE_DEVICE_HANDLER( c64h156_atni_w )
109{
110}
111
112WRITE_LINE_DEVICE_HANDLER( c64h156_atna_w )
113{
114}
115
116/*-------------------------------------------------
117    DEVICE_START( c64h156 )
118-------------------------------------------------*/
119
120static DEVICE_START( c64h156 )
121{
122//   c64h156_t *c64h156 = get_safe_token(device);
123
124   /* allocate data timer */
125//   c64h156->bit_timer = timer_alloc(device->machine, bit_tick, (void *)device);
126
127   /* register for state saving */
128//   state_save_register_device_item(device, 0, c64h156->);
129}
130
131/*-------------------------------------------------
132    DEVICE_GET_INFO( c64h156 )
133-------------------------------------------------*/
134
135DEVICE_GET_INFO( c64h156 )
136{
137   switch (state)
138   {
139      /* --- the following bits of info are returned as 64-bit signed integers --- */
140      case DEVINFO_INT_TOKEN_BYTES:               info->i = sizeof(c64h156_t);                        break;
141      case DEVINFO_INT_CLASS:                     info->i = DEVICE_CLASS_PERIPHERAL;                     break;
142
143      /* --- the following bits of info are returned as pointers to data or functions --- */
144      case DEVINFO_FCT_START:                     info->start = DEVICE_START_NAME(c64h156);               break;
145      case DEVINFO_FCT_STOP:                     /* Nothing */                                    break;
146      case DEVINFO_FCT_RESET:                     /* Nothing */                                    break;
147
148      /* --- the following bits of info are returned as NULL-terminated strings --- */
149      case DEVINFO_STR_NAME:                     strcpy(info->s, "Commodore 64H156");                  break;
150      case DEVINFO_STR_FAMILY:                  strcpy(info->s, "Commodore 1541");                     break;
151      case DEVINFO_STR_VERSION:                  strcpy(info->s, "1.0");                              break;
152      case DEVINFO_STR_SOURCE_FILE:               strcpy(info->s, __FILE__);                           break;
153      case DEVINFO_STR_CREDITS:                  strcpy(info->s, "Copyright the MESS Team");             break;
154   }
155}
src/mess/machine/64h156.h
r0r7581
1/**********************************************************************
2
3    Commodore 64H165 Gate Array emulation
4   
5   Used in 1541B/1541C/1541-II/1571
6
7    Copyright MESS Team.
8    Visit http://mamedev.org for licensing and usage restrictions.
9
10**********************************************************************
11                            _____   _____
12                  TEST   1 |*    \_/     | 40  _BYTE
13                   YB0   2 |             | 39  SOE
14                   YB1   3 |             | 38  B
15                   YB2   4 |             | 37  CK
16                   YB3   5 |             | 36  _QX
17                   YB4   6 |             | 35  Q
18                   YB5   7 |             | 34  R/_W
19                   YB6   8 |             | 33  LOCK
20                   YB7   9 |             | 32  PLL
21                   Vss  10 |  64H156-01  | 31  CLR
22                  STP1  11 |  251828-01  | 30  Vcc
23                  STP0  12 |             | 29  _XRW
24                   MTR  13 |             | 28  Y3
25                    _A  14 |             | 27  Y2
26                   DS0  15 |             | 26  Y1
27                   DS1  16 |             | 25  Y0
28                 _SYNC  17 |             | 24  ATN
29                   TED  18 |             | 23  ATNI
30                    OE  19 |             | 22  ATNA
31                 _ACCL  20 |_____________| 21  OSC
32
33                     _____   _____
34                  TEST   1 |*    \_/     | 42  _BYTE
35                   YB0   2 |             | 41  SOE
36                   YB1   3 |             | 40  B
37                   YB2   4 |             | 39  CK
38                   YB3   5 |             | 38  _QX
39                   YB4   6 |             | 37  Q
40                   YB5   7 |             | 36  R/_W
41                   YB6   8 |             | 35  LOCK
42                   YB7   9 |             | 34  PLL
43                   Vss  10 |  64H156-02  | 33  CLR
44                  STP1  11 |  251828-02  | 32  Vcc
45                  STP0  12 |             | 31  _XRW
46                   MTR  13 |             | 30  Y3
47                    _A  14 |             | 29  Y2
48                   DS0  15 |             | 28  Y1
49                   DS1  16 |             | 27  Y0
50                 _SYNC  17 |             | 26  ATN
51                   TED  18 |             | 25  ATNI
52                    OE  19 |             | 24  ATNA
53                 _ACCL  20 |             | 23  ATNA
54                   Vcc  21 |_____________| 22  Vss
55
56**********************************************************************/
57
58#ifndef __64H156__
59#define __64H156__
60
61#include "devcb.h"
62
63/***************************************************************************
64    MACROS / CONSTANTS
65***************************************************************************/
66
67#define C64H156      DEVICE_GET_INFO_NAME(c64h156)
68
69#define MDRV_64H156_ADD(_tag, _clock, _intrf) \
70   MDRV_DEVICE_ADD(_tag, C64H156, _clock) \
71   MDRV_DEVICE_CONFIG(_intrf)
72
73#define C64H156_INTERFACE(name) \
74   const c64h156_interface (name)=
75
76/***************************************************************************
77    TYPE DEFINITIONS
78***************************************************************************/
79
80typedef struct _c64h156_interface c64h156_interface;
81struct _c64h156_interface
82{
83   devcb_write_line   out_atn_func;
84   devcb_write_line   out_sync_func;
85   devcb_write_line   out_byte_func;
86};
87
88/***************************************************************************
89    PROTOTYPES
90***************************************************************************/
91
92/* device interface */
93DEVICE_GET_INFO( c64h156 );
94
95/* parallel data */
96READ8_DEVICE_HANDLER( c64h156_yb_r );
97WRITE8_DEVICE_HANDLER( c64h156_yb_w );
98
99/* sync mark detected */
100READ_LINE_DEVICE_HANDLER( c64h156_sync_r );
101
102/* byte ready */
103READ_LINE_DEVICE_HANDLER( c64h156_byte_r );
104
105/* stepper driver */
106void c64h156_stp_w(running_device *device, int data);
107
108/* stepper motor */
109WRITE_LINE_DEVICE_HANDLER( c64h156_mtr_w );
110
111/* density select */
112void c64h156_ds_w(running_device *device, int data);
113
114/* */
115WRITE_LINE_DEVICE_HANDLER( c64h156_ted_w );
116
117/* mode select */
118WRITE_LINE_DEVICE_HANDLER( c64h156_oe_w );
119
120/* byte input enable */
121WRITE_LINE_DEVICE_HANDLER( c64h156_soe_w );
122
123/* attention input */
124WRITE_LINE_DEVICE_HANDLER( c64h156_atni_w );
125
126/* attention acknowledge */
127WRITE_LINE_DEVICE_HANDLER( c64h156_atna_w );
128
129#endif
src/mess/mess.mak
r7580r7581
273273   $(MESSOBJ)/capcom.a \
274274   $(MESSOBJ)/casio.a \
275275   $(MESSOBJ)/cbm.a \
276   $(MESSOBJ)/cbmshare.a \
277276   $(MESSOBJ)/cccp.a \
278277   $(MESSOBJ)/cce.a \
279278   $(MESSOBJ)/coleco.a \
r7580r7581
724723   $(MESS_FORMATS)/g64_dsk.o   \
725724   $(MESS_FORMATS)/d81_dsk.o   \
726725   $(MESS_DRIVERS)/clcd.o      \
727
728$(MESSOBJ)/cbmshare.a:         \
729726   $(MESS_FORMATS)/cbm_tap.o   \
730727   $(MESS_MACHINE)/6525tpi.o   \
731728   $(MESS_MACHINE)/cbm.o      \
r7580r7581
733730   $(MESS_MACHINE)/c64.o      \
734731   $(MESS_MACHINE)/c65.o      \
735732   $(MESS_MACHINE)/c128.o      \
733   $(MESS_MACHINE)/64h156.o   \
736734   $(MESS_VIDEO)/vdc8563.o      \
737735   $(MESS_VIDEO)/vic6567.o      \
738736   $(MESS_VIDEO)/vic4567.o      \

Previous 15994 Revisions Next


© 1998-2018 The MESS Team