~ubuntu-branches/ubuntu/raring/mame/raring-proposed

« back to all changes in this revision

Viewing changes to mess/src/emu/video/cdp1861.h

  • Committer: Package Import Robot
  • Author(s): Jordi Mallach, Jordi Mallach, Emmanuel Kasper
  • Date: 2011-12-19 22:56:27 UTC
  • mfrom: (0.1.2)
  • Revision ID: package-import@ubuntu.com-20111219225627-ub5oga1oys4ogqzm
Tags: 0.144-1
[ Jordi Mallach ]
* Fix syntax errors in DEP5 copyright file (lintian).
* Use a versioned copyright Format specification field.
* Update Vcs-* URLs.
* Move transitional packages to the new metapackages section, and make
  them priority extra.
* Remove references to GNU/Linux and MESS sources from copyright.
* Add build variables for s390x.
* Use .xz tarballs as it cuts 4MB for the upstream sources.
* Add nplayers.ini as a patch. Update copyright file to add CC-BY-SA-3.0.

[ Emmanuel Kasper ]
* New upstream release. Closes: #651538.
* Add Free Desktop compliant png icons of various sizes taken from
  the hydroxygen iconset
* Mess is now built from a new source package, to avoid possible source
  incompatibilities between mame and the mess overlay.
* Mame-tools are not built from the mame source package anymore, but
  from the mess source package

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/**********************************************************************
2
 
 
3
 
    RCA CDP1861 Video Display Controller emulation
4
 
 
5
 
    Copyright MESS Team.
6
 
    Visit http://mamedev.org for licensing and usage restrictions.
7
 
 
8
 
**********************************************************************
9
 
                            _____   _____
10
 
                  _CLK   1 |*    \_/     | 24  Vdd
11
 
                 _DMAO   2 |             | 23  _CLEAR
12
 
                  _INT   3 |             | 22  SC1
13
 
                   TPA   4 |             | 21  SC0
14
 
                   TPB   5 |             | 20  DI7
15
 
            _COMP SYNC   6 |   CDP1861   | 19  DI6
16
 
                 VIDEO   7 |             | 18  DI5
17
 
                _RESET   8 |             | 17  DI4
18
 
                  _EFX   9 |             | 16  DI3
19
 
               DISP ON  10 |             | 15  DI2
20
 
              DISP OFF  11 |             | 14  DI1
21
 
                   Vss  12 |_____________| 13  DI0
22
 
 
23
 
**********************************************************************/
24
 
 
25
 
#pragma once
26
 
 
27
 
#ifndef __CDP1861__
28
 
#define __CDP1861__
29
 
 
30
 
#include "emu.h"
31
 
 
32
 
 
33
 
 
34
 
//**************************************************************************
35
 
//  MACROS / CONSTANTS
36
 
//**************************************************************************
37
 
 
38
 
#define CDP1861_VISIBLE_COLUMNS 64
39
 
#define CDP1861_VISIBLE_LINES   128
40
 
 
41
 
#define CDP1861_HBLANK_START    14 * 8
42
 
#define CDP1861_HBLANK_END              12
43
 
#define CDP1861_HSYNC_START             0
44
 
#define CDP1861_HSYNC_END               12
45
 
#define CDP1861_SCREEN_WIDTH    14 * 8
46
 
 
47
 
#define CDP1861_TOTAL_SCANLINES                         262
48
 
 
49
 
#define CDP1861_SCANLINE_DISPLAY_START          80
50
 
#define CDP1861_SCANLINE_DISPLAY_END            208
51
 
#define CDP1861_SCANLINE_VBLANK_START           262
52
 
#define CDP1861_SCANLINE_VBLANK_END                     16
53
 
#define CDP1861_SCANLINE_VSYNC_START            16
54
 
#define CDP1861_SCANLINE_VSYNC_END                      0
55
 
#define CDP1861_SCANLINE_INT_START                      CDP1861_SCANLINE_DISPLAY_START - 2
56
 
#define CDP1861_SCANLINE_INT_END                        CDP1861_SCANLINE_DISPLAY_START
57
 
#define CDP1861_SCANLINE_EFX_TOP_START          CDP1861_SCANLINE_DISPLAY_START - 4
58
 
#define CDP1861_SCANLINE_EFX_TOP_END            CDP1861_SCANLINE_DISPLAY_START
59
 
#define CDP1861_SCANLINE_EFX_BOTTOM_START       CDP1861_SCANLINE_DISPLAY_END - 4
60
 
#define CDP1861_SCANLINE_EFX_BOTTOM_END         CDP1861_SCANLINE_DISPLAY_END
61
 
 
62
 
 
63
 
 
64
 
//**************************************************************************
65
 
//  INTERFACE CONFIGURATION MACROS
66
 
//**************************************************************************
67
 
 
68
 
#define MCFG_CDP1861_ADD(_tag, _clock, _config) \
69
 
        MCFG_DEVICE_ADD(_tag, CDP1861, _clock) \
70
 
        MCFG_DEVICE_CONFIG(_config)
71
 
 
72
 
 
73
 
#define MCFG_CDP1861_SCREEN_ADD(_tag, _clock) \
74
 
        MCFG_SCREEN_ADD(_tag, RASTER) \
75
 
        MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) \
76
 
        MCFG_SCREEN_RAW_PARAMS(_clock, CDP1861_SCREEN_WIDTH, CDP1861_HBLANK_END, CDP1861_HBLANK_START, CDP1861_TOTAL_SCANLINES, CDP1861_SCANLINE_VBLANK_END, CDP1861_SCANLINE_VBLANK_START)
77
 
 
78
 
 
79
 
#define CDP1861_INTERFACE(name) \
80
 
        const cdp1861_interface (name) =
81
 
 
82
 
 
83
 
 
84
 
//**************************************************************************
85
 
//  TYPE DEFINITIONS
86
 
//**************************************************************************
87
 
 
88
 
 
89
 
// ======================> cdp1861_interface
90
 
 
91
 
struct cdp1861_interface
92
 
{
93
 
        const char *m_cpu_tag;
94
 
        const char *m_screen_tag;
95
 
 
96
 
        devcb_write_line                m_out_int_cb;
97
 
        devcb_write_line                m_out_dmao_cb;
98
 
        devcb_write_line                m_out_efx_cb;
99
 
};
100
 
 
101
 
 
102
 
 
103
 
// ======================> cdp1861_device
104
 
 
105
 
class cdp1861_device :  public device_t,
106
 
                        public cdp1861_interface
107
 
{
108
 
public:
109
 
    // construction/destruction
110
 
    cdp1861_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
111
 
 
112
 
    DECLARE_WRITE8_MEMBER( dma_w );
113
 
        DECLARE_WRITE_LINE_MEMBER( disp_on_w );
114
 
        DECLARE_WRITE_LINE_MEMBER( disp_off_w );
115
 
 
116
 
        void update_screen(bitmap_t *bitmap, const rectangle *cliprect);
117
 
 
118
 
protected:
119
 
    // device-level overrides
120
 
        virtual void device_config_complete();
121
 
    virtual void device_start();
122
 
    virtual void device_reset();
123
 
        virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
124
 
 
125
 
private:
126
 
        static const device_timer_id TIMER_INT = 0;
127
 
        static const device_timer_id TIMER_EFX = 1;
128
 
        static const device_timer_id TIMER_DMA = 2;
129
 
 
130
 
        devcb_resolved_write_line       m_out_int_func;
131
 
        devcb_resolved_write_line       m_out_dmao_func;
132
 
        devcb_resolved_write_line       m_out_efx_func;
133
 
 
134
 
        screen_device *m_screen;                // screen
135
 
        bitmap_t *m_bitmap;                             // bitmap
136
 
 
137
 
        int m_disp;                                             // display enabled
138
 
        int m_dispon;                                   // display on latch
139
 
        int m_dispoff;                                  // display off latch
140
 
        int m_dmaout;                                   // DMA request active
141
 
 
142
 
        // timers
143
 
        emu_timer *m_int_timer;                 // interrupt timer
144
 
        emu_timer *m_efx_timer;                 // EFx timer
145
 
        emu_timer *m_dma_timer;                 // DMA timer
146
 
 
147
 
        cpu_device *m_cpu;
148
 
};
149
 
 
150
 
 
151
 
// device type definition
152
 
extern const device_type CDP1861;
153
 
 
154
 
 
155
 
 
156
 
#endif