~ubuntu-branches/ubuntu/lucid/sdlmame/lucid

« back to all changes in this revision

Viewing changes to src/emu/sound/cdp1864.h

  • Committer: Bazaar Package Importer
  • Author(s): Cesare Falco
  • Date: 2009-11-03 17:10:15 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20091103171015-6hop4ory5lxnumpn
Tags: 0.135-0ubuntu1
* New upstream release - Closes (LP: #403212)
* debian/watch: unstable releases are no longer detected
* mame.ini: added the cheat subdirectories to cheatpath so zipped
  cheatfiles will be searched too
* renamed crsshair subdirectory to crosshair to reflect upstream change
* mame.ini: renamed references to crosshair subdirectory (see above)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**********************************************************************
 
2
 
 
3
    RCA CDP1864C COS/MOS PAL Compatible Color TV Interface
 
4
 
 
5
    Copyright MESS Team.
 
6
    Visit http://mamedev.org for licensing and usage restrictions.
 
7
 
 
8
**********************************************************************
 
9
                            ________________
 
10
            INLACE   1  ---|       \/       |---  40  Vdd
 
11
           CLK IN_   2  ---|                |---  39  AUD
 
12
          CLR OUT_   3  ---|                |---  38  CLR IN_
 
13
               AOE   4  ---|                |---  37  DMA0_
 
14
               SC1   5  ---|                |---  36  INT_
 
15
               SC0   6  ---|                |---  35  TPA
 
16
              MRD_   7  ---|                |---  34  TPB
 
17
             BUS 7   8  ---|                |---  33  EVS
 
18
             BUS 6   9  ---|                |---  32  V SYNC
 
19
             BUS 5  10  ---|    CDP1864C    |---  31  H SYNC
 
20
             BUS 4  11  ---|    top view    |---  30  C SYNC_
 
21
             BUS 3  12  ---|                |---  29  RED
 
22
             BUS 2  13  ---|                |---  28  BLUE
 
23
             BUS 1  14  ---|                |---  27  GREEN
 
24
             BUS 0  15  ---|                |---  26  BCK GND_
 
25
              CON_  16  ---|                |---  25  BURST
 
26
                N2  17  ---|                |---  24  ALT
 
27
               EF_  18  ---|                |---  23  R DATA
 
28
                N0  19  ---|                |---  22  G DATA
 
29
               Vss  20  ---|________________|---  21  B DATA
 
30
 
 
31
 
 
32
           http://homepage.mac.com/ruske/cosmacelf/cdp1864.pdf
 
33
 
 
34
**********************************************************************/
 
35
 
 
36
#ifndef __CDP1864__
 
37
#define __CDP1864__
 
38
 
 
39
#include "devcb.h"
 
40
 
 
41
/***************************************************************************
 
42
    PARAMETERS
 
43
***************************************************************************/
 
44
 
 
45
#define CDP1864_CLOCK   XTAL_1_75MHz
 
46
 
 
47
#define CDP1864_VISIBLE_COLUMNS 64
 
48
#define CDP1864_VISIBLE_LINES   192
 
49
 
 
50
#define CDP1864_HBLANK_END               1 * 8
 
51
#define CDP1864_HBLANK_START    13 * 8
 
52
#define CDP1864_HSYNC_START              0 * 8
 
53
#define CDP1864_HSYNC_END                1 * 8
 
54
#define CDP1864_SCREEN_START     4 * 8
 
55
#define CDP1864_SCREEN_END              12 * 8
 
56
#define CDP1864_SCREEN_WIDTH    14 * 8
 
57
 
 
58
#define CDP1864_TOTAL_SCANLINES                         312
 
59
 
 
60
#define CDP1864_SCANLINE_VBLANK_START           CDP1864_TOTAL_SCANLINES - 4
 
61
#define CDP1864_SCANLINE_VBLANK_END                     20
 
62
#define CDP1864_SCANLINE_VSYNC_START            0
 
63
#define CDP1864_SCANLINE_VSYNC_END                      4
 
64
#define CDP1864_SCANLINE_DISPLAY_START          60 // ???
 
65
#define CDP1864_SCANLINE_DISPLAY_END            CDP1864_SCANLINE_DISPLAY_START + CDP1864_VISIBLE_LINES
 
66
#define CDP1864_SCANLINE_INT_START                      CDP1864_SCANLINE_DISPLAY_START - 2
 
67
#define CDP1864_SCANLINE_INT_END                        CDP1864_SCANLINE_DISPLAY_START
 
68
#define CDP1864_SCANLINE_EFX_TOP_START          CDP1864_SCANLINE_DISPLAY_START - 4
 
69
#define CDP1864_SCANLINE_EFX_TOP_END            CDP1864_SCANLINE_DISPLAY_START
 
70
#define CDP1864_SCANLINE_EFX_BOTTOM_START       CDP1864_SCANLINE_DISPLAY_END - 4
 
71
#define CDP1864_SCANLINE_EFX_BOTTOM_END         CDP1864_SCANLINE_DISPLAY_END
 
72
 
 
73
/***************************************************************************
 
74
    MACROS / CONSTANTS
 
75
***************************************************************************/
 
76
 
 
77
#define CDP1864         DEVICE_GET_INFO_NAME(cdp1864)
 
78
#define SOUND_CDP1864 CDP1864
 
79
 
 
80
#define MDRV_CDP1864_ADD(_tag, _clock, _config) \
 
81
        MDRV_DEVICE_ADD(_tag, SOUND, _clock) \
 
82
        MDRV_DEVICE_CONFIG_DATAPTR(sound_config, type, SOUND_CDP1864) \
 
83
        MDRV_DEVICE_CONFIG(_config)
 
84
 
 
85
#define MDRV_CDP1864_SCREEN_ADD(_tag, _clock) \
 
86
        MDRV_SCREEN_ADD(_tag, RASTER) \
 
87
        MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) \
 
88
        MDRV_SCREEN_RAW_PARAMS(_clock, CDP1864_SCREEN_WIDTH, CDP1864_HBLANK_END, CDP1864_HBLANK_START, CDP1864_TOTAL_SCANLINES, CDP1864_SCANLINE_VBLANK_END, CDP1864_SCANLINE_VBLANK_START)
 
89
 
 
90
#define CDP1864_INTERFACE(name) \
 
91
        const cdp1864_interface (name) =
 
92
 
 
93
/***************************************************************************
 
94
    TYPE DEFINITIONS
 
95
***************************************************************************/
 
96
 
 
97
enum _cdp1864_format {
 
98
        CDP1864_NON_INTERLACED = 0,
 
99
        CDP1864_INTERLACED
 
100
};
 
101
typedef enum _cdp1864_format cdp1864_format;
 
102
 
 
103
typedef struct _cdp1864_interface cdp1864_interface;
 
104
struct _cdp1864_interface
 
105
{
 
106
        const char *cpu_tag;            /* cpu we are working with */
 
107
        const char *screen_tag;         /* screen we are acting on */
 
108
 
 
109
        cdp1864_format interlace;       /* interlace */
 
110
 
 
111
        devcb_read_line                         in_rdata_func;
 
112
        devcb_read_line                         in_bdata_func;
 
113
        devcb_read_line                         in_gdata_func;
 
114
 
 
115
        /* this gets called for every change of the INT pin (pin 36) */
 
116
        devcb_write_line                        out_int_func;
 
117
 
 
118
        /* this gets called for every change of the DMAO pin (pin 37) */
 
119
        devcb_write_line                        out_dmao_func;
 
120
 
 
121
        /* this gets called for every change of the EFX pin (pin 18) */
 
122
        devcb_write_line                        out_efx_func;
 
123
 
 
124
        double res_r;                           /* red output resistor value */
 
125
        double res_g;                           /* green output resistor value */
 
126
        double res_b;                           /* blue output resistor value */
 
127
        double res_bkg;                         /* background output resistor value */
 
128
};
 
129
 
 
130
/***************************************************************************
 
131
    PROTOTYPES
 
132
***************************************************************************/
 
133
 
 
134
/* device interface */
 
135
DEVICE_GET_INFO( cdp1864 );
 
136
 
 
137
/* display on (0x69) */
 
138
READ8_DEVICE_HANDLER( cdp1864_dispon_r ) ATTR_NONNULL(1);
 
139
 
 
140
/* display off (0x6c) */
 
141
READ8_DEVICE_HANDLER( cdp1864_dispoff_r ) ATTR_NONNULL(1);
 
142
 
 
143
/* step background color (0x61) */
 
144
WRITE8_DEVICE_HANDLER( cdp1864_step_bgcolor_w ) ATTR_NONNULL(1);
 
145
 
 
146
/* color on */
 
147
WRITE_LINE_DEVICE_HANDLER( cdp1864_con_w ) ATTR_NONNULL(1);
 
148
 
 
149
/* load tone latch (0x64) */
 
150
WRITE8_DEVICE_HANDLER( cdp1864_tone_latch_w ) ATTR_NONNULL(1);
 
151
 
 
152
/* audio output enable */
 
153
WRITE_LINE_DEVICE_HANDLER( cdp1864_aoe_w ) ATTR_NONNULL(1);
 
154
 
 
155
/* DMA write */
 
156
WRITE8_DEVICE_HANDLER( cdp1864_dma_w ) ATTR_NONNULL(1);
 
157
 
 
158
/* screen update */
 
159
void cdp1864_update(const device_config *device, bitmap_t *bitmap, const rectangle *cliprect) ATTR_NONNULL(1) ATTR_NONNULL(2) ATTR_NONNULL(3);
 
160
 
 
161
#endif