~ubuntu-branches/debian/wheezy/mame/wheezy

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Jordi Mallach, Emmanuel Kasper, Félix Arreola Rodríguez, Jordi Mallach
  • Date: 2011-05-11 21:06:50 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20110511210650-jizvh8a6x117y9hr
Tags: 0.142-1
[ Emmanuel Kasper ]
* New upstream release
* Set NOWERROR=1 to allow compiling with gcc-4.6
* Remove fix_powerpc_build.patch, as upstream has taken it in this release
* Add gnome-video-arcade front end as a suggested package

[ Félix Arreola Rodríguez ]
* Add kfreebsd-build.patch to quilt series, to fix build on kfreebsd

[ Jordi Mallach ]
* Remove unneeded and bogus addition of --with-quilt to the dh invocation.
* Add Cesare Falco (long time Ubuntu maintainer) to Uploaders, and wrap
  them into multiple lines.

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
#include "includes/wiping.h"
12
12
 
13
13
 
14
 
static int flipscreen;
15
 
UINT8 *wiping_videoram;
16
 
UINT8 *wiping_colorram;
17
 
 
18
 
 
19
14
/***************************************************************************
20
15
 
21
16
  Convert the color PROMs into a more useable format.
36
31
                        2, &resistances_b[0],  bweights, 470, 0);
37
32
 
38
33
        /* allocate the colortable */
39
 
        machine->colortable = colortable_alloc(machine, 0x20);
 
34
        machine.colortable = colortable_alloc(machine, 0x20);
40
35
 
41
36
        /* create a lookup table for the palette */
42
37
        for (i = 0; i < 0x20; i++)
61
56
                bit1 = (color_prom[i] >> 7) & 0x01;
62
57
                b = combine_2_weights(bweights, bit0, bit1);
63
58
 
64
 
                colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
 
59
                colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
65
60
        }
66
61
 
67
62
        /* color_prom now points to the beginning of the lookup table */
71
66
        for (i = 0; i < 0x100; i++)
72
67
        {
73
68
                UINT8 ctabentry = color_prom[i ^ 0x03] & 0x0f;
74
 
                colortable_entry_set_value(machine->colortable, i, ctabentry);
 
69
                colortable_entry_set_value(machine.colortable, i, ctabentry);
75
70
        }
76
71
 
77
72
        /* sprites use colors 16-31 */
78
73
        for (i = 0x100; i < 0x200; i++)
79
74
        {
80
75
                UINT8 ctabentry = (color_prom[i ^ 0x03] & 0x0f) | 0x10;
81
 
                colortable_entry_set_value(machine->colortable, i, ctabentry);
 
76
                colortable_entry_set_value(machine.colortable, i, ctabentry);
82
77
        }
83
78
}
84
79
 
86
81
 
87
82
WRITE8_HANDLER( wiping_flipscreen_w )
88
83
{
89
 
        flipscreen = (data & 1);
 
84
        wiping_state *state = space->machine().driver_data<wiping_state>();
 
85
        state->m_flipscreen = (data & 1);
90
86
}
91
87
 
92
88
 
93
 
VIDEO_UPDATE( wiping )
 
89
SCREEN_UPDATE( wiping )
94
90
{
95
 
        UINT8 *spriteram = screen->machine->generic.spriteram.u8;
 
91
        wiping_state *state = screen->machine().driver_data<wiping_state>();
 
92
        UINT8 *spriteram = state->m_spriteram;
96
93
        int offs;
97
94
 
98
95
        for (offs = 0x3ff; offs > 0; offs--)
118
115
                        sy = my - 2;
119
116
                }
120
117
 
121
 
                if (flipscreen)
 
118
                if (state->m_flipscreen)
122
119
                {
123
120
                        sx = 35 - sx;
124
121
                        sy = 27 - sy;
125
122
                }
126
123
 
127
 
                drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[0],
128
 
                                wiping_videoram[offs],
129
 
                                wiping_colorram[offs] & 0x3f,
130
 
                                flipscreen,flipscreen,
 
124
                drawgfx_opaque(bitmap,cliprect,screen->machine().gfx[0],
 
125
                                state->m_videoram[offs],
 
126
                                state->m_colorram[offs] & 0x3f,
 
127
                                state->m_flipscreen,state->m_flipscreen,
131
128
                                sx*8,sy*8);
132
129
        }
133
130
 
145
142
                flipy = spriteram[offs] & 0x40;
146
143
                flipx = spriteram[offs] & 0x80;
147
144
 
148
 
                if (flipscreen)
 
145
                if (state->m_flipscreen)
149
146
                {
150
147
                        sy = 208 - sy;
151
148
                        flipx = !flipx;
152
149
                        flipy = !flipy;
153
150
                }
154
151
 
155
 
                drawgfx_transmask(bitmap,cliprect,screen->machine->gfx[1],
 
152
                drawgfx_transmask(bitmap,cliprect,screen->machine().gfx[1],
156
153
                        (spriteram[offs] & 0x3f) + 64 * otherbank,
157
154
                        color,
158
155
                        flipx,flipy,
159
156
                        sx,sy,
160
 
                        colortable_get_transpen_mask(screen->machine->colortable, screen->machine->gfx[1], color, 0x1f));
 
157
                        colortable_get_transpen_mask(screen->machine().colortable, screen->machine().gfx[1], color, 0x1f));
161
158
        }
162
159
 
163
160
        /* redraw high priority chars */
164
161
        for (offs = 0x3ff; offs > 0; offs--)
165
162
        {
166
 
                if (wiping_colorram[offs] & 0x80)
 
163
                if (state->m_colorram[offs] & 0x80)
167
164
                {
168
165
                        int mx,my,sx,sy;
169
166
 
186
183
                                sy = my - 2;
187
184
                        }
188
185
 
189
 
                        if (flipscreen)
 
186
                        if (state->m_flipscreen)
190
187
                        {
191
188
                                sx = 35 - sx;
192
189
                                sy = 27 - sy;
193
190
                        }
194
191
 
195
 
                        drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[0],
196
 
                                        wiping_videoram[offs],
197
 
                                        wiping_colorram[offs] & 0x3f,
198
 
                                        flipscreen,flipscreen,
 
192
                        drawgfx_opaque(bitmap,cliprect,screen->machine().gfx[0],
 
193
                                        state->m_videoram[offs],
 
194
                                        state->m_colorram[offs] & 0x3f,
 
195
                                        state->m_flipscreen,state->m_flipscreen,
199
196
                                        sx*8,sy*8);
200
197
                }
201
198
        }
204
201
#if 0
205
202
{
206
203
        int i,j;
207
 
        extern UINT8 *wiping_soundregs;
208
204
 
209
205
        for (i = 0;i < 8;i++)
210
206
        {
211
207
                for (j = 0;j < 8;j++)
212
208
                {
213
209
                        char buf[40];
214
 
                        sprintf(buf,"%01x",wiping_soundregs[i*8+j]&0xf);
 
210
                        sprintf(buf,"%01x",state->m_soundregs[i*8+j]&0xf);
215
211
                        ui_draw_text(buf,j*10,i*8);
216
212
                }
217
213
        }
221
217
                for (j = 0;j < 8;j++)
222
218
                {
223
219
                        char buf[40];
224
 
                        sprintf(buf,"%01x",wiping_soundregs[0x2000+i*8+j]>>4);
 
220
                        sprintf(buf,"%01x",state->m_soundregs[0x2000+i*8+j]>>4);
225
221
                        ui_draw_text(buf,j*10,80+i*8);
226
222
                }
227
223
        }