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

« back to all changes in this revision

Viewing changes to src/mame/video/naughtyb.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 "audio/pleiads.h"
12
12
#include "includes/naughtyb.h"
13
13
 
14
 
UINT8 *naughtyb_videoram2;
15
 
 
16
 
/* use these to draw charset B */
17
 
UINT8 *naughtyb_scrollreg;
18
 
 
19
 
/* use this to select palette */
20
 
static UINT8 palreg;
21
 
 
22
 
/* used in Naughty Boy to select video bank */
23
 
static int bankreg;
24
 
 
25
 
// true if cabinet == cocktail -AND- handling player 2
26
 
int naughtyb_cocktail;
27
14
 
28
15
static const rectangle scrollvisiblearea =
29
16
{
99
86
                        2, resistances, weights, 0, 0,
100
87
                        0, 0, 0, 0, 0);
101
88
 
102
 
        for (i = 0;i < machine->total_colors(); i++)
 
89
        for (i = 0;i < machine.total_colors(); i++)
103
90
        {
104
91
                int bit0, bit1;
105
92
                int r, g, b;
131
118
***************************************************************************/
132
119
VIDEO_START( naughtyb )
133
120
{
134
 
        palreg = bankreg = 0;
 
121
        naughtyb_state *state = machine.driver_data<naughtyb_state>();
 
122
        state->m_palreg = state->m_bankreg = 0;
135
123
 
136
124
        /* Naughty Boy has a virtual screen twice as large as the visible screen */
137
 
        machine->generic.tmpbitmap = auto_bitmap_alloc(machine,68*8,28*8,machine->primary_screen->format());
 
125
        machine.generic.tmpbitmap = auto_bitmap_alloc(machine,68*8,28*8,machine.primary_screen->format());
138
126
}
139
127
 
140
128
 
142
130
 
143
131
WRITE8_HANDLER( naughtyb_videoreg_w )
144
132
{
 
133
        naughtyb_state *state = space->machine().driver_data<naughtyb_state>();
145
134
        // bits 4+5 control the sound circuit
146
 
        pleiads_sound_control_c_w(space->machine->device("cust"),offset,data);
 
135
        pleiads_sound_control_c_w(space->machine().device("cust"),offset,data);
147
136
 
148
 
        naughtyb_cocktail =
149
 
                ( ( input_port_read(space->machine, "DSW0") & 0x80 ) && // cabinet == cocktail
 
137
        state->m_cocktail =
 
138
                ( ( input_port_read(space->machine(), "DSW0") & 0x80 ) &&       // cabinet == cocktail
150
139
                  ( data & 0x01 ) );                            // handling player 2
151
 
        palreg  = (data >> 1) & 0x03;                   // pallette sel is bit 1 & 2
152
 
        bankreg = (data >> 2) & 0x01;                   // banksel is just bit 2
 
140
        state->m_palreg  = (data >> 1) & 0x03;                  // pallette sel is bit 1 & 2
 
141
        state->m_bankreg = (data >> 2) & 0x01;                  // banksel is just bit 2
153
142
}
154
143
 
155
144
WRITE8_HANDLER( popflame_videoreg_w )
156
145
{
 
146
        naughtyb_state *state = space->machine().driver_data<naughtyb_state>();
157
147
        // bits 4+5 control the sound circuit
158
 
        pleiads_sound_control_c_w(space->machine->device("cust"),offset,data);
 
148
        pleiads_sound_control_c_w(space->machine().device("cust"),offset,data);
159
149
 
160
 
        naughtyb_cocktail =
161
 
                ( ( input_port_read(space->machine, "DSW0") & 0x80 ) && // cabinet == cocktail
 
150
        state->m_cocktail =
 
151
                ( ( input_port_read(space->machine(), "DSW0") & 0x80 ) &&       // cabinet == cocktail
162
152
                  ( data & 0x01 ) );                            // handling player 2
163
 
        palreg  = (data >> 1) & 0x03;                   // pallette sel is bit 1 & 2
164
 
        bankreg = (data >> 3) & 0x01;                   // banksel is just bit 3
 
153
        state->m_palreg  = (data >> 1) & 0x03;                  // pallette sel is bit 1 & 2
 
154
        state->m_bankreg = (data >> 3) & 0x01;                  // banksel is just bit 3
165
155
}
166
156
 
167
157
 
210
200
 
211
201
 
212
202
***************************************************************************/
213
 
VIDEO_UPDATE( naughtyb )
 
203
SCREEN_UPDATE( naughtyb )
214
204
{
215
 
        naughtyb_state *state = screen->machine->driver_data<naughtyb_state>();
216
 
        UINT8 *videoram = state->videoram;
 
205
        naughtyb_state *state = screen->machine().driver_data<naughtyb_state>();
 
206
        UINT8 *videoram = state->m_videoram;
217
207
        int offs;
218
208
 
219
209
        // for every character in the Video RAM
222
212
        {
223
213
                int sx,sy;
224
214
 
225
 
                if ( naughtyb_cocktail )
 
215
                if ( state->m_cocktail )
226
216
                {
227
217
                        if (offs < 0x700)
228
218
                        {
249
239
                        }
250
240
                }
251
241
 
252
 
                drawgfx_opaque(screen->machine->generic.tmpbitmap,0,screen->machine->gfx[0],
253
 
                                naughtyb_videoram2[offs] + 256 * bankreg,
254
 
                                (naughtyb_videoram2[offs] >> 5) + 8 * palreg,
255
 
                                naughtyb_cocktail,naughtyb_cocktail,
 
242
                drawgfx_opaque(screen->machine().generic.tmpbitmap,0,screen->machine().gfx[0],
 
243
                                state->m_videoram2[offs] + 256 * state->m_bankreg,
 
244
                                (state->m_videoram2[offs] >> 5) + 8 * state->m_palreg,
 
245
                                state->m_cocktail,state->m_cocktail,
256
246
                                8*sx,8*sy);
257
247
 
258
 
                drawgfx_transpen(screen->machine->generic.tmpbitmap,0,screen->machine->gfx[1],
259
 
                                videoram[offs] + 256*bankreg,
260
 
                                (videoram[offs] >> 5) + 8 * palreg,
261
 
                                naughtyb_cocktail,naughtyb_cocktail,
 
248
                drawgfx_transpen(screen->machine().generic.tmpbitmap,0,screen->machine().gfx[1],
 
249
                                videoram[offs] + 256*state->m_bankreg,
 
250
                                (videoram[offs] >> 5) + 8 * state->m_palreg,
 
251
                                state->m_cocktail,state->m_cocktail,
262
252
                                8*sx,8*sy,0);
263
253
        }
264
254
 
266
256
        {
267
257
                int scrollx;
268
258
 
269
 
                copybitmap(bitmap,screen->machine->generic.tmpbitmap,0,0,-66*8,0,&leftvisiblearea);
270
 
                copybitmap(bitmap,screen->machine->generic.tmpbitmap,0,0,-30*8,0,&rightvisiblearea);
 
259
                copybitmap(bitmap,screen->machine().generic.tmpbitmap,0,0,-66*8,0,&leftvisiblearea);
 
260
                copybitmap(bitmap,screen->machine().generic.tmpbitmap,0,0,-30*8,0,&rightvisiblearea);
271
261
 
272
 
                scrollx = ( naughtyb_cocktail ) ? *naughtyb_scrollreg - 239 : -*naughtyb_scrollreg + 16;
273
 
                copyscrollbitmap(bitmap,screen->machine->generic.tmpbitmap,1,&scrollx,0,0,&scrollvisiblearea);
 
262
                scrollx = ( state->m_cocktail ) ? *state->m_scrollreg - 239 : -*state->m_scrollreg + 16;
 
263
                copyscrollbitmap(bitmap,screen->machine().generic.tmpbitmap,1,&scrollx,0,0,&scrollvisiblearea);
274
264
        }
275
265
        return 0;
276
266
}