Previous 15994 Revisions Next

r11214 Sunday 17th April, 2011 at 10:20:31 UTC by Curt Coder
Removed unused files. (no whatsnew)
[src/mess/machine]mos6529.c mos6529.h

src/mess/machine/mos6529.c
r11213r11214
1/**********************************************************************
2
3    MOS Technology 6529 Single Port Interface Adapter emulation
4
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7
8**********************************************************************/
9
10#include "mos6529.h"
11
12/***************************************************************************
13    PARAMETERS
14***************************************************************************/
15
16#define LOG 0
17
18/***************************************************************************
19    TYPE DEFINITIONS
20***************************************************************************/
21
22typedef struct _mos6529_t mos6529_t;
23struct _mos6529_t
24{
25   devcb_resolved_read8      in_p_func;
26   devcb_resolved_write8      out_p_func;
27};
28
29/***************************************************************************
30    INLINE FUNCTIONS
31***************************************************************************/
32
33INLINE mos6529_t *get_safe_token(device_t *device)
34{
35   assert(device != NULL);
36   assert(device->type() == MOS6529);
37
38   return (mos6529_t *)downcast<legacy_device_base *>(device)->token();
39}
40
41INLINE const mos6529_interface *get_interface(device_t *device)
42{
43   assert(device != NULL);
44   assert(device->type() == MOS6529);
45
46   return (const mos6529_interface *) device->baseconfig().static_config();
47}
48
49/***************************************************************************
50    IMPLEMENTATION
51***************************************************************************/
52
53/*-------------------------------------------------
54    mos6529_r - port read
55-------------------------------------------------*/
56
57READ8_DEVICE_HANDLER( mos6529_r )
58{
59   mos6529_t *mos6529 = get_safe_token(device);
60
61   return devcb_call_read8(&mos6529->in_p_func, 0);
62}
63
64/*-------------------------------------------------
65    mos6529__w - port write
66-------------------------------------------------*/
67
68WRITE8_DEVICE_HANDLER( mos6529_w )
69{
70   mos6529_t *mos6529 = get_safe_token(device);
71
72   devcb_call_write8(&mos6529->out_p_func, 0, data);
73}
74
75/*-------------------------------------------------
76    DEVICE_START( mos6529 )
77-------------------------------------------------*/
78
79static DEVICE_START( mos6529 )
80{
81   mos6529_t *mos6529 = get_safe_token(device);
82   const mos6529_interface *intf = get_interface(device);
83
84   /* resolve callbacks */
85   devcb_resolve_read8(&mos6529->in_p_func, &intf->in_p_func, device);
86   devcb_resolve_write8(&mos6529->out_p_func, &intf->out_p_func, device);
87}
88
89/*-------------------------------------------------
90    DEVICE_GET_INFO( mos6529 )
91-------------------------------------------------*/
92
93DEVICE_GET_INFO( mos6529 )
94{
95   switch (state)
96   {
97      /* --- the following bits of info are returned as 64-bit signed integers --- */
98      case DEVINFO_INT_TOKEN_BYTES:               info->i = sizeof(mos6529_t);            break;
99      case DEVINFO_INT_INLINE_CONFIG_BYTES:         info->i = 0;                        break;
100
101      /* --- the following bits of info are returned as pointers to data or functions --- */
102      case DEVINFO_FCT_START:                     info->start = DEVICE_START_NAME(mos6529);   break;
103      case DEVINFO_FCT_STOP:                     /* Nothing */                        break;
104      case DEVINFO_FCT_RESET:                     /* Nothing */                        break;
105
106      /* --- the following bits of info are returned as NULL-terminated strings --- */
107      case DEVINFO_STR_NAME:                     strcpy(info->s, "MOS6529");               break;
108      case DEVINFO_STR_FAMILY:                  strcpy(info->s, "MOS6500");               break;
109      case DEVINFO_STR_VERSION:                  strcpy(info->s, "1.0");                  break;
110      case DEVINFO_STR_SOURCE_FILE:               strcpy(info->s, __FILE__);               break;
111      case DEVINFO_STR_CREDITS:                  strcpy(info->s, "Copyright the MESS Team");   break;
112   }
113}
114
115DEFINE_LEGACY_DEVICE(MOS6529, mos6529);
src/mess/machine/mos6529.h
r11213r11214
1/**********************************************************************
2
3    MOS Technology 6529 Single Port Interface Adapter emulation
4
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7
8**********************************************************************
9                            _____   _____
10                   R/W   1 |*    \_/     | 20  Vdd
11                    P0   2 |             | 19  _CS
12                    P1   3 |             | 18  D0
13                    P2   4 |             | 17  D1
14                    P3   5 |    6529     | 16  D2
15                    P4   6 |             | 15  D3
16                    P5   7 |             | 14  D4
17                    P6   8 |             | 13  D5
18                    P7   9 |             | 12  D6
19                   Vss  10 |_____________| 11  D7
20
21**********************************************************************/
22
23#ifndef __MOS6529__
24#define __MOS6529__
25
26#include "emu.h"
27#include "devcb.h"
28
29/***************************************************************************
30    MACROS / CONSTANTS
31***************************************************************************/
32
33DECLARE_LEGACY_DEVICE(MOS6529, mos6529);
34
35#define MCFG_MOS6529_ADD(_tag, _clock, _config) \
36   MCFG_DEVICE_ADD((_tag), MOS6529, _clock)   \
37   MCFG_DEVICE_CONFIG(_config)
38
39#define MOS6529_INTERFACE(name) \
40   const mos6529_interface (name) =
41
42/***************************************************************************
43    TYPE DEFINITIONS
44***************************************************************************/
45
46typedef struct _mos6529_interface mos6529_interface;
47struct _mos6529_interface
48{
49   devcb_read8            in_p_func;
50   devcb_write8         out_p_func;
51};
52
53/***************************************************************************
54    PROTOTYPES
55***************************************************************************/
56
57/* port access */
58READ8_DEVICE_HANDLER( mos6529_r );
59WRITE8_DEVICE_HANDLER( mos6529_w );
60
61#endif

Previous 15994 Revisions Next


© 1998-2018 The MESS Team