@@ -169,6 +169,7 @@ void williams_state::video_start()
169
169
void blaster_state::video_start ()
170
170
{
171
171
williams_state::video_start ();
172
+
172
173
save_item (NAME (m_color0));
173
174
save_item (NAME (m_video_control));
174
175
}
@@ -178,7 +179,7 @@ void williams2_state::video_start()
178
179
{
179
180
williams_state::video_start ();
180
181
181
- /* create the tilemap */
182
+ // create the tilemap
182
183
m_bg_tilemap = &machine ().tilemap ().create (*m_gfxdecode, tilemap_get_info_delegate (*this , FUNC (williams2_state::get_tile_info)), TILEMAP_SCAN_COLS, 24 ,16 , 128 ,16 );
183
184
m_bg_tilemap->set_scrolldx (2 , 0 );
184
185
@@ -227,35 +228,35 @@ uint32_t blaster_state::screen_update(screen_device &screen, bitmap_rgb32 &bitma
227
228
uint8_t const *const scanline_control = &m_videoram[0xbc00 ];
228
229
rgb_t pens[16 ];
229
230
230
- /* precompute the palette */
231
+ // precompute the palette
231
232
for (int x = 0 ; x < 16 ; x++)
232
233
pens[x] = m_palette->pen_color (m_paletteram[x]);
233
234
234
- /* if we're blitting from the top, start with a 0 for color 0 */
235
+ // if we're blitting from the top, start with a 0 for color 0
235
236
if (cliprect.min_y == screen.visible_area ().min_y || !(m_video_control & 1 ))
236
237
m_color0 = m_palette->pen_color (palette_0[0 ] ^ 0xff );
237
238
238
- /* loop over rows */
239
+ // loop over rows
239
240
for (int y = cliprect.min_y ; y <= cliprect.max_y ; y++)
240
241
{
241
242
int const erase_behind = m_video_control & scanline_control[y] & 2 ;
242
243
uint8_t *const source = &m_videoram[y];
243
244
uint32_t *const dest = &bitmap.pix (y);
244
245
245
- /* latch a new color0 pen? */
246
+ // latch a new color0 pen?
246
247
if (m_video_control & scanline_control[y] & 1 )
247
248
m_color0 = m_palette->pen_color (palette_0[y] ^ 0xff );
248
249
249
- /* loop over columns */
250
+ // loop over columns
250
251
for (int x = cliprect.min_x & ~1 ; x <= cliprect.max_x ; x += 2 )
251
252
{
252
253
uint8_t const pix = source[(x/2 ) * 256 ];
253
254
254
- /* clear behind us if requested */
255
+ // clear behind us if requested
255
256
if (erase_behind)
256
257
source[(x/2 ) * 256 ] = 0 ;
257
258
258
- /* now draw */
259
+ // now draw
259
260
dest[x+0 ] = (pix & 0xf0 ) ? pens[pix >> 4 ] : rgb_t (m_color0 | pens[0 ]);
260
261
dest[x+1 ] = (pix & 0x0f ) ? pens[pix & 0x0f ] : rgb_t (m_color0 | pens[0 ]);
261
262
}
@@ -268,20 +269,20 @@ uint32_t williams2_state::screen_update(screen_device &screen, bitmap_rgb32 &bit
268
269
{
269
270
rgb_t pens[16 ];
270
271
271
- /* draw the background */
272
+ // draw the background
272
273
m_bg_tilemap->draw (screen, bitmap, cliprect, 0 , 0 );
273
274
274
- /* fetch the relevant pens */
275
+ // fetch the relevant pens
275
276
for (int x = 1 ; x < 16 ; x++)
276
277
pens[x] = m_palette->pen_color (m_fg_color * 16 + x);
277
278
278
- /* loop over rows */
279
+ // loop over rows
279
280
for (int y = cliprect.min_y ; y <= cliprect.max_y ; y++)
280
281
{
281
282
uint8_t const *const source = &m_videoram[y];
282
283
uint32_t *const dest = &bitmap.pix (y);
283
284
284
- /* loop over columns */
285
+ // loop over columns
285
286
for (int x = cliprect.min_x & ~1 ; x <= cliprect.max_x ; x += 2 )
286
287
{
287
288
uint8_t const pix = source[(x/2 ) * 256 ];
@@ -300,21 +301,21 @@ uint32_t mysticm_state::screen_update(screen_device &screen, bitmap_rgb32 &bitma
300
301
{
301
302
rgb_t pens[16 ];
302
303
303
- /* draw the background */
304
+ // draw the background
304
305
m_bg_tilemap->mark_all_dirty ();
305
306
m_bg_tilemap->draw (screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE | TILEMAP_DRAW_ALL_CATEGORIES, 0 );
306
307
307
- /* loop over rows */
308
+ // loop over rows
308
309
for (int y = cliprect.min_y ; y <= cliprect.max_y ; y++)
309
310
{
310
- /* fetch the relevant pens */
311
+ // fetch the relevant pens
311
312
for (int x = 1 ; x < 16 ; x++)
312
313
pens[x] = m_palette->pen_color (color_decode (m_fg_color, 1 , y) * 16 + x);
313
314
314
315
uint8_t const *const source = &m_videoram[y];
315
316
uint32_t *const dest = &bitmap.pix (y);
316
317
317
- /* loop over columns */
318
+ // loop over columns
318
319
for (int x = cliprect.min_x & ~1 ; x <= cliprect.max_x ; x += 2 )
319
320
{
320
321
uint8_t const pix = source[(x/2 ) * 256 ];
@@ -422,7 +423,6 @@ rgb_t williams2_state::calc_col(uint16_t lo, uint16_t hi)
422
423
};
423
424
424
425
// update the palette entry
425
-
426
426
const uint16_t i = (hi >> 4 ) & 15 ;
427
427
const uint16_t ub = (hi >> 0 ) & 15 ;
428
428
const uint16_t ug = (lo >> 4 ) & 15 ;
@@ -449,10 +449,10 @@ rgb_t williams2_state::calc_col(uint16_t lo, uint16_t hi)
449
449
450
450
void williams2_state::paletteram_w (offs_t offset, u8 data)
451
451
{
452
- /* set the new value */
452
+ // set the new value
453
453
m_paletteram[offset] = data;
454
454
455
- /* pull the associated low/high bytes */
455
+ // pull the associated low/high bytes
456
456
uint16_t entry_lo = m_paletteram[offset & ~1 ];
457
457
uint16_t entry_hi = m_paletteram[offset | 1 ];
458
458
@@ -510,7 +510,7 @@ TILE_GET_INFO_MEMBER(williams2_state::get_tile_info)
510
510
int const data = m_tileram[tile_index];
511
511
int const y = (tile_index >> 1 ) & 7 ;
512
512
513
- /* On tshoot and inferno, IC79 is a 74LS157 selector jumpered to be enabled */
513
+ // On tshoot and inferno, IC79 is a 74LS157 selector jumpered to be enabled
514
514
int const color = y;
515
515
516
516
tileinfo.set (0 , data & mask, color, (data & ~mask) ? TILE_FLIPX : 0 );
@@ -539,7 +539,7 @@ int mysticm_state::color_decode(uint8_t base_col, int sig_J1, int y)
539
539
540
540
// FIXME: Investigate further.
541
541
542
- /* IC79 is a 74LS85 comparator that controls the low bit */
542
+ // IC79 is a 74LS85 comparator that controls the low bit
543
543
int const a = 1 | ((base_col & 1 ) << 2 ) | ((base_col & 1 ) << 3 );
544
544
int const b = (sig_W12 << 0 ) | (sig_W13 << 1 ) | (0 << 2 ) | (sig_J1 << 3 );
545
545
int const color = (a > b) || ((a == b) && !sig_W11);
@@ -575,31 +575,31 @@ TILE_GET_INFO_MEMBER(joust2_state::get_tile_info)
575
575
int const mask = m_gfxdecode->gfx (0 )->elements () - 1 ;
576
576
int const data = m_tileram[tile_index];
577
577
578
- /* IC79 is a 74LS157 selector jumpered to be disabled */
578
+ // IC79 is a 74LS157 selector jumpered to be disabled
579
579
int const color = 0 ;
580
580
581
581
tileinfo.set (0 , data & mask, color, (data & ~mask) ? TILE_FLIPX : 0 );
582
582
}
583
583
584
- /* based on the board type, only certain bits are used */
585
- /* the rest are determined by other factors */
584
+ // based on the board type, only certain bits are used
585
+ // the rest are determined by other factors
586
586
587
587
void williams2_state::bg_select_w (u8 data)
588
588
{
589
- /* IC79 is a 74LS157 selector jumpered to be enabled */
589
+ // IC79 is a 74LS157 selector jumpered to be enabled
590
590
m_bg_tilemap->set_palette_offset ((data & 0x38 ) << 4 );
591
591
}
592
592
593
593
void mysticm_state::bg_select_w (u8 data)
594
594
{
595
- /* IC79 is a 74LS85 comparator that controls the low bit */
595
+ // IC79 is a 74LS85 comparator that controls the low bit
596
596
m_bg_color = data;
597
597
m_bg_tilemap->mark_all_dirty ();
598
598
}
599
599
600
600
void joust2_state::bg_select_w (u8 data)
601
601
{
602
- /* IC79 is a 74LS157 selector jumpered to be disabled */
602
+ // IC79 is a 74LS157 selector jumpered to be disabled
603
603
m_bg_tilemap->set_palette_offset ((data & 0x3f ) << 4 );
604
604
}
605
605
@@ -622,16 +622,3 @@ void williams2_state::xscroll_high_w(u8 data)
622
622
m_tilemap_xscroll = (m_tilemap_xscroll & 0x00f ) | (data << 4 );
623
623
m_bg_tilemap->set_scrollx (0 , (m_tilemap_xscroll & 7 ) + ((m_tilemap_xscroll >> 3 ) * 6 ));
624
624
}
625
-
626
-
627
-
628
- /* ************************************
629
- *
630
- * Blaster-specific enhancements
631
- *
632
- *************************************/
633
-
634
- void blaster_state::video_control_w (u8 data)
635
- {
636
- m_video_control = data;
637
- }
0 commit comments