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

« back to all changes in this revision

Viewing changes to src/emu/video/h63484.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
  HD63484 ACRTC
 
4
  Advanced CRT Controller.
 
5
 
 
6
**************************************************************************/
 
7
 
 
8
#pragma once
 
9
 
 
10
#ifndef __H63484__
 
11
#define __H63484__
 
12
 
 
13
 
 
14
#include "emu.h"
 
15
 
 
16
 
 
17
/***************************************************************************
 
18
    DEVICE CONFIGURATION MACROS
 
19
***************************************************************************/
 
20
 
 
21
#define MCFG_H63484_ADD(_tag, _clock, _config, _map) \
 
22
        MCFG_DEVICE_ADD(_tag, H63484, _clock) \
 
23
        MCFG_DEVICE_CONFIG(_config) \
 
24
        MCFG_DEVICE_ADDRESS_MAP(AS_0, _map)
 
25
 
 
26
#define H63484_INTERFACE(name) \
 
27
        const h63484_interface (name) =
 
28
 
 
29
typedef void (*h63484_display_pixels_func)(device_t *device, bitmap_t *bitmap, int y, int x, UINT16 data);
 
30
#define H63484_DISPLAY_PIXELS(name) void name(device_t *device, bitmap_t *bitmap, int y, int x, UINT16 data)
 
31
 
 
32
// ======================> h63484_interface
 
33
 
 
34
struct h63484_interface
 
35
{
 
36
        const char *m_screen_tag;               /* screen we are acting on */
 
37
        h63484_display_pixels_func      m_display_cb;
 
38
};
 
39
 
 
40
// ======================> upd7220_device
 
41
 
 
42
class h63484_device :   public device_t,
 
43
                                                public device_memory_interface,
 
44
                        public h63484_interface
 
45
{
 
46
public:
 
47
    // construction/destruction
 
48
    h63484_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
 
49
 
 
50
    DECLARE_WRITE16_MEMBER( address_w );
 
51
    DECLARE_WRITE16_MEMBER( data_w );
 
52
 
 
53
    DECLARE_READ16_MEMBER( status_r );
 
54
    DECLARE_READ16_MEMBER( data_r );
 
55
 
 
56
    DECLARE_READ8_MEMBER( vram_r );
 
57
    DECLARE_WRITE8_MEMBER( vram_w );
 
58
 
 
59
        void update_screen(bitmap_t *bitmap, const rectangle *cliprect);
 
60
        virtual const rom_entry *device_rom_region() const;
 
61
        virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const;
 
62
 
 
63
protected:
 
64
    // device-level overrides
 
65
    virtual void device_start();
 
66
    virtual void device_reset();
 
67
        //virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
 
68
        virtual void device_config_complete();
 
69
 
 
70
        inline UINT8 readbyte(offs_t address);
 
71
        inline void writebyte(offs_t address, UINT8 data);
 
72
 
 
73
private:
 
74
        inline void fifo_w_clear();
 
75
        inline void queue_w(UINT8 data);
 
76
        inline void dequeue_w(UINT8 *data);
 
77
        inline void fifo_r_clear();
 
78
        inline void queue_r(UINT8 data);
 
79
        inline void dequeue_r(UINT8 *data);
 
80
        inline void recompute_parameters();
 
81
        inline void command_end_seq();
 
82
 
 
83
        void command_wpr_exec();
 
84
        void command_clr_exec();
 
85
        void command_cpy_exec();
 
86
        void command_rct_exec();
 
87
        void process_fifo();
 
88
        void exec_abort_sequence();
 
89
        UINT16 video_registers_r(int offset);
 
90
        void video_registers_w(int offset);
 
91
        int translate_command(UINT16 data);
 
92
        void draw_graphics_line(bitmap_t *bitmap, const rectangle *cliprect, int y, int layer_n);
 
93
 
 
94
 
 
95
        screen_device *m_screen;
 
96
 
 
97
        UINT8 *m_vram;
 
98
        UINT8 m_ar;
 
99
        UINT8 m_vreg[0x100];
 
100
        UINT8 m_sr;
 
101
 
 
102
        UINT8 m_fifo[16];                                       /* FIFO W data queue */
 
103
        int m_fifo_ptr;                                 /* FIFO W pointer */
 
104
 
 
105
        UINT8 m_fifo_r[16];                             /* FIFO R data queue */
 
106
        int m_fifo_r_ptr;                                       /* FIFO R pointer */
 
107
 
 
108
 
 
109
        UINT16 m_cr;
 
110
        UINT16 m_pr[0x10];                                      /* parameter byte register */
 
111
        int m_param_ptr;                                        /* parameter pointer */
 
112
 
 
113
        UINT32 m_rwp[4];
 
114
        UINT8 m_rwp_dn;
 
115
 
 
116
        UINT32 m_org_dpa;
 
117
        UINT8 m_org_dn;
 
118
        UINT8 m_org_dpd;
 
119
        UINT16 m_cl0;
 
120
        UINT16 m_cl1;
 
121
 
 
122
        INT16 m_cpx;
 
123
        INT16 m_cpy;
 
124
 
 
125
        UINT16 m_mwr[4];
 
126
        UINT8  m_mwr_chr[4];
 
127
 
 
128
        UINT32 m_sar[4];
 
129
        UINT8 m_sda[4];
 
130
 
 
131
        UINT16 m_pram[0x10];
 
132
        UINT8 m_dn;
 
133
 
 
134
        UINT16 m_ccr;
 
135
        UINT16 m_dcr;
 
136
 
 
137
        UINT16 m_hc, m_hds, m_hdw, m_hws, m_hww;
 
138
        UINT8 m_hsw;
 
139
 
 
140
        UINT16 m_vc, m_vws, m_vww, m_vds;
 
141
        UINT8 m_vsw;
 
142
 
 
143
        const address_space_config              m_space_config;
 
144
};
 
145
 
 
146
// device type definition
 
147
extern const device_type H63484;
 
148
 
 
149
#endif /* __H63484_H__ */
 
150
 
 
151