~ubuntu-branches/debian/sid/mame/sid

« back to all changes in this revision

Viewing changes to src/mame/video/cop01.c

  • Committer: Package Import Robot
  • Author(s): Jordi Mallach, Emmanuel Kasper, Jordi Mallach
  • Date: 2012-06-05 20:02:23 UTC
  • mfrom: (0.3.1) (0.1.4)
  • Revision ID: package-import@ubuntu.com-20120605200223-gnlpogjrg6oqe9md
Tags: 0.146-1
[ Emmanuel Kasper ]
* New upstream release
* Drop patch to fix man pages section and patches to link with flac 
  and jpeg system lib: all this has been pushed upstream by Cesare Falco
* Add DM-Upload-Allowed: yes field.

[ Jordi Mallach ]
* Create a "gnu" TARGETOS stanza that defines NO_AFFINITY_NP.
* Stop setting TARGETOS to "unix" in d/rules. It should be autodetected,
  and set to the appropriate value.
* mame_manpage_section.patch: Change mame's manpage section to 6 (games),
  in the TH declaration.

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
 
13
13
PALETTE_INIT( cop01 )
14
14
{
 
15
        const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
15
16
        int i;
16
17
 
17
18
        /* allocate the colortable */
120
121
 
121
122
***************************************************************************/
122
123
 
123
 
WRITE8_HANDLER( cop01_background_w )
124
 
{
125
 
        cop01_state *state = space->machine().driver_data<cop01_state>();
126
 
        state->m_bgvideoram[offset] = data;
127
 
        state->m_bg_tilemap->mark_tile_dirty(offset & 0x7ff);
128
 
}
129
 
 
130
 
WRITE8_HANDLER( cop01_foreground_w )
131
 
{
132
 
        cop01_state *state = space->machine().driver_data<cop01_state>();
133
 
        state->m_fgvideoram[offset] = data;
134
 
        state->m_fg_tilemap->mark_tile_dirty(offset);
135
 
}
136
 
 
137
 
WRITE8_HANDLER( cop01_vreg_w )
 
124
WRITE8_MEMBER(cop01_state::cop01_background_w)
 
125
{
 
126
        m_bgvideoram[offset] = data;
 
127
        m_bg_tilemap->mark_tile_dirty(offset & 0x7ff);
 
128
}
 
129
 
 
130
WRITE8_MEMBER(cop01_state::cop01_foreground_w)
 
131
{
 
132
        m_fgvideoram[offset] = data;
 
133
        m_fg_tilemap->mark_tile_dirty(offset);
 
134
}
 
135
 
 
136
WRITE8_MEMBER(cop01_state::cop01_vreg_w)
138
137
{
139
138
        /*  0x40: --xx---- sprite bank, coin counters, flip screen
140
139
     *        -----x-- flip screen
147
146
     *        -------x msb xscroll
148
147
     *  0x43: xxxxxxxx yscroll
149
148
     */
150
 
        cop01_state *state = space->machine().driver_data<cop01_state>();
151
 
        state->m_vreg[offset] = data;
 
149
        m_vreg[offset] = data;
152
150
 
153
151
        if (offset == 0)
154
152
        {
155
 
                coin_counter_w(space->machine(), 0, data & 1);
156
 
                coin_counter_w(space->machine(), 1, data & 2);
157
 
                flip_screen_set(space->machine(), data & 4);
 
153
                coin_counter_w(machine(), 0, data & 1);
 
154
                coin_counter_w(machine(), 1, data & 2);
 
155
                flip_screen_set(data & 4);
158
156
        }
159
157
}
160
158
 
171
169
        cop01_state *state = machine.driver_data<cop01_state>();
172
170
        int offs, code, attr, sx, sy, flipx, flipy, color;
173
171
 
174
 
        for (offs = 0; offs < state->m_spriteram_size; offs += 4)
 
172
        for (offs = 0; offs < state->m_spriteram.bytes(); offs += 4)
175
173
        {
176
174
                code = state->m_spriteram[offs + 1];
177
175
                attr = state->m_spriteram[offs + 2];
186
184
                sx = (state->m_spriteram[offs + 3] - 0x80) + 256 * (attr & 0x01);
187
185
                sy = 240 - state->m_spriteram[offs];
188
186
 
189
 
                if (flip_screen_get(machine))
 
187
                if (state->flip_screen())
190
188
                {
191
189
                        sx = 240 - sx;
192
190
                        sy = 240 - sy;