11
11
#include "audio/pleiads.h"
12
12
#include "includes/naughtyb.h"
14
UINT8 *naughtyb_videoram2;
16
/* use these to draw charset B */
17
UINT8 *naughtyb_scrollreg;
19
/* use this to select palette */
22
/* used in Naughty Boy to select video bank */
25
// true if cabinet == cocktail -AND- handling player 2
26
int naughtyb_cocktail;
28
15
static const rectangle scrollvisiblearea =
99
86
2, resistances, weights, 0, 0,
102
for (i = 0;i < machine->total_colors(); i++)
89
for (i = 0;i < machine.total_colors(); i++)
131
118
***************************************************************************/
132
119
VIDEO_START( naughtyb )
134
palreg = bankreg = 0;
121
naughtyb_state *state = machine.driver_data<naughtyb_state>();
122
state->m_palreg = state->m_bankreg = 0;
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());
143
131
WRITE8_HANDLER( naughtyb_videoreg_w )
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);
149
( ( input_port_read(space->machine, "DSW0") & 0x80 ) && // cabinet == 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
155
144
WRITE8_HANDLER( popflame_videoreg_w )
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);
161
( ( input_port_read(space->machine, "DSW0") & 0x80 ) && // cabinet == 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
212
202
***************************************************************************/
213
VIDEO_UPDATE( naughtyb )
203
SCREEN_UPDATE( naughtyb )
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;
219
209
// for every character in the Video RAM
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,
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,
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);
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);