Skip to content

Commit e2327ef

Browse files
committed
williams: small cleanup, fix splat regression
1 parent c0f4bcb commit e2327ef

File tree

4 files changed

+69
-71
lines changed

4 files changed

+69
-71
lines changed

src/mame/midway/williams.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1654,8 +1654,10 @@ void williams_state::joust(machine_config &config)
16541654
void williams_state::splat(machine_config &config)
16551655
{
16561656
williams_base(config);
1657-
WILLIAMS_BLITTER_SC2(config, m_blitter, 0xc000, m_maincpu, m_videoram);
16581657
williams_muxed(config);
1658+
1659+
WILLIAMS_BLITTER_SC2(config, m_blitter, 0xc000, m_maincpu, m_videoram);
1660+
m_maincpu->set_addrmap(AS_PROGRAM, &williams_state::main_map_blitter);
16591661
}
16601662

16611663
void williams_state::alienar(machine_config &config)

src/mame/midway/williams_m.cpp

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(williams_state::va11_callback)
2424
if (scanline == 256)
2525
return;
2626

27-
/* the IRQ signal comes into CB1, and is set to VA11 */
27+
// the IRQ signal comes into CB1, and is set to VA11
2828
m_pia[1]->cb1_w(BIT(scanline, 5));
2929
}
3030

@@ -88,7 +88,7 @@ void williams2_state::machine_start()
8888
{
8989
williams_state::machine_start();
9090

91-
/* configure memory banks */
91+
// configure memory banks
9292
m_mainbank->configure_entries(0, 4, memregion("maincpu")->base() + 0x10000, 0x8000);
9393
}
9494

@@ -97,7 +97,7 @@ void williams2_state::machine_reset()
9797
{
9898
williams_state::machine_reset();
9999

100-
/* make sure our banking is reset */
100+
// make sure our banking is reset
101101
bank_select_w(0);
102102
}
103103

@@ -111,37 +111,37 @@ void williams2_state::machine_reset()
111111

112112
void williams_state::vram_select_w(u8 data)
113113
{
114-
/* VRAM/ROM banking from bit 0 */
114+
// VRAM/ROM banking from bit 0
115115
if (BIT(data, 0))
116116
m_rom_view.select(0);
117117
else
118118
m_rom_view.disable();
119119

120-
/* cocktail flip from bit 1 */
120+
// cocktail flip from bit 1
121121
m_cocktail = BIT(data, 1);
122122
}
123123

124124

125125
void williams2_state::bank_select_w(u8 data)
126126
{
127-
/* the low two bits control the paging */
127+
// the low two bits control the paging
128128
switch (data & 0x03)
129129
{
130-
/* page 0 is video ram */
130+
// page 0 is video ram
131131
case 0:
132132
m_rom_view.disable();
133133
m_palette_view.disable();
134134
break;
135135

136-
/* pages 1 and 2 are ROM */
136+
// pages 1 and 2 are ROM
137137
case 1:
138138
case 2:
139139
m_mainbank->set_entry((data & 6) >> 1);
140140
m_rom_view.select(0);
141141
m_palette_view.disable();
142142
break;
143143

144-
/* page 3 accesses palette RAM; the remaining areas are as if page 1 ROM was selected */
144+
// page 3 accesses palette RAM; the remaining areas are as if page 1 ROM was selected
145145
case 3:
146146
m_mainbank->set_entry((data & 4) >> 1);
147147
m_rom_view.select(0);
@@ -246,15 +246,15 @@ void williams_state::cmos_4bit_w(offs_t offset, u8 data)
246246

247247
void williams_state::watchdog_reset_w(u8 data)
248248
{
249-
/* yes, the data bits are checked for this specific value */
249+
// yes, the data bits are checked for this specific value
250250
if (data == 0x39)
251251
m_watchdog->watchdog_reset();
252252
}
253253

254254

255255
void williams2_state::watchdog_reset_w(u8 data)
256256
{
257-
/* yes, the data bits are checked for this specific value */
257+
// yes, the data bits are checked for this specific value
258258
if ((data & 0x3f) == 0x14)
259259
m_watchdog->watchdog_reset();
260260
}
@@ -353,11 +353,11 @@ void defender_state::bank_select_w(u8 data)
353353

354354
u8 mayday_state::protection_r(offs_t offset)
355355
{
356-
/* Mayday does some kind of protection check that is not currently understood */
357-
/* However, the results of that protection check are stored at $a190 and $a191 */
358-
/* These are compared against $a193 and $a194, respectively. Thus, to prevent */
359-
/* the protection from resetting the machine, we just return $a193 for $a190, */
360-
/* and $a194 for $a191. */
356+
// Mayday does some kind of protection check that is not currently understood
357+
// However, the results of that protection check are stored at $a190 and $a191
358+
// These are compared against $a193 and $a194, respectively. Thus, to prevent
359+
// the protection from resetting the machine, we just return $a193 for $a190,
360+
// and $a194 for $a191.
361361
return m_videoram[0xa193 + offset];
362362
}
363363

@@ -409,6 +409,12 @@ void blaster_state::machine_reset()
409409
}
410410

411411

412+
void blaster_state::video_control_w(u8 data)
413+
{
414+
m_video_control = data;
415+
}
416+
417+
412418
void blaster_state::blaster_vram_select_w(u8 data)
413419
{
414420
// VRAM/ROM banking from bit 0
@@ -495,20 +501,16 @@ void tshoot_state::machine_start()
495501

496502
void tshoot_state::maxvol_w(int state)
497503
{
498-
/* something to do with the sound volume */
504+
// something to do with the sound volume
499505
logerror("tshoot maxvol = %d (%s)\n", state, machine().describe_context());
500506
}
501507

502508

503509
void tshoot_state::lamp_w(u8 data)
504510
{
505-
/* set the grenade lamp */
506511
m_grenade_lamp = BIT(~data, 2);
507-
/* set the gun lamp */
508512
m_gun_lamp = BIT(~data, 3);
509-
/* gun coil */
510513
m_p1_gun_recoil = BIT(data, 4);
511-
/* feather coil */
512514
m_feather_blower = BIT(data, 5);
513515
}
514516

src/mame/midway/williams_v.cpp

Lines changed: 27 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ void williams_state::video_start()
169169
void blaster_state::video_start()
170170
{
171171
williams_state::video_start();
172+
172173
save_item(NAME(m_color0));
173174
save_item(NAME(m_video_control));
174175
}
@@ -178,7 +179,7 @@ void williams2_state::video_start()
178179
{
179180
williams_state::video_start();
180181

181-
/* create the tilemap */
182+
// create the tilemap
182183
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);
183184
m_bg_tilemap->set_scrolldx(2, 0);
184185

@@ -227,35 +228,35 @@ uint32_t blaster_state::screen_update(screen_device &screen, bitmap_rgb32 &bitma
227228
uint8_t const *const scanline_control = &m_videoram[0xbc00];
228229
rgb_t pens[16];
229230

230-
/* precompute the palette */
231+
// precompute the palette
231232
for (int x = 0; x < 16; x++)
232233
pens[x] = m_palette->pen_color(m_paletteram[x]);
233234

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
235236
if (cliprect.min_y == screen.visible_area().min_y || !(m_video_control & 1))
236237
m_color0 = m_palette->pen_color(palette_0[0] ^ 0xff);
237238

238-
/* loop over rows */
239+
// loop over rows
239240
for (int y = cliprect.min_y; y <= cliprect.max_y; y++)
240241
{
241242
int const erase_behind = m_video_control & scanline_control[y] & 2;
242243
uint8_t *const source = &m_videoram[y];
243244
uint32_t *const dest = &bitmap.pix(y);
244245

245-
/* latch a new color0 pen? */
246+
// latch a new color0 pen?
246247
if (m_video_control & scanline_control[y] & 1)
247248
m_color0 = m_palette->pen_color(palette_0[y] ^ 0xff);
248249

249-
/* loop over columns */
250+
// loop over columns
250251
for (int x = cliprect.min_x & ~1; x <= cliprect.max_x; x += 2)
251252
{
252253
uint8_t const pix = source[(x/2) * 256];
253254

254-
/* clear behind us if requested */
255+
// clear behind us if requested
255256
if (erase_behind)
256257
source[(x/2) * 256] = 0;
257258

258-
/* now draw */
259+
// now draw
259260
dest[x+0] = (pix & 0xf0) ? pens[pix >> 4] : rgb_t(m_color0 | pens[0]);
260261
dest[x+1] = (pix & 0x0f) ? pens[pix & 0x0f] : rgb_t(m_color0 | pens[0]);
261262
}
@@ -268,20 +269,20 @@ uint32_t williams2_state::screen_update(screen_device &screen, bitmap_rgb32 &bit
268269
{
269270
rgb_t pens[16];
270271

271-
/* draw the background */
272+
// draw the background
272273
m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0);
273274

274-
/* fetch the relevant pens */
275+
// fetch the relevant pens
275276
for (int x = 1; x < 16; x++)
276277
pens[x] = m_palette->pen_color(m_fg_color * 16 + x);
277278

278-
/* loop over rows */
279+
// loop over rows
279280
for (int y = cliprect.min_y; y <= cliprect.max_y; y++)
280281
{
281282
uint8_t const *const source = &m_videoram[y];
282283
uint32_t *const dest = &bitmap.pix(y);
283284

284-
/* loop over columns */
285+
// loop over columns
285286
for (int x = cliprect.min_x & ~1; x <= cliprect.max_x; x += 2)
286287
{
287288
uint8_t const pix = source[(x/2) * 256];
@@ -300,21 +301,21 @@ uint32_t mysticm_state::screen_update(screen_device &screen, bitmap_rgb32 &bitma
300301
{
301302
rgb_t pens[16];
302303

303-
/* draw the background */
304+
// draw the background
304305
m_bg_tilemap->mark_all_dirty();
305306
m_bg_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE | TILEMAP_DRAW_ALL_CATEGORIES, 0);
306307

307-
/* loop over rows */
308+
// loop over rows
308309
for (int y = cliprect.min_y; y <= cliprect.max_y; y++)
309310
{
310-
/* fetch the relevant pens */
311+
// fetch the relevant pens
311312
for (int x = 1; x < 16; x++)
312313
pens[x] = m_palette->pen_color(color_decode(m_fg_color, 1, y) * 16 + x);
313314

314315
uint8_t const *const source = &m_videoram[y];
315316
uint32_t *const dest = &bitmap.pix(y);
316317

317-
/* loop over columns */
318+
// loop over columns
318319
for (int x = cliprect.min_x & ~1; x <= cliprect.max_x; x += 2)
319320
{
320321
uint8_t const pix = source[(x/2) * 256];
@@ -422,7 +423,6 @@ rgb_t williams2_state::calc_col(uint16_t lo, uint16_t hi)
422423
};
423424

424425
// update the palette entry
425-
426426
const uint16_t i = (hi >> 4) & 15;
427427
const uint16_t ub = (hi >> 0) & 15;
428428
const uint16_t ug = (lo >> 4) & 15;
@@ -449,10 +449,10 @@ rgb_t williams2_state::calc_col(uint16_t lo, uint16_t hi)
449449

450450
void williams2_state::paletteram_w(offs_t offset, u8 data)
451451
{
452-
/* set the new value */
452+
// set the new value
453453
m_paletteram[offset] = data;
454454

455-
/* pull the associated low/high bytes */
455+
// pull the associated low/high bytes
456456
uint16_t entry_lo = m_paletteram[offset & ~1];
457457
uint16_t entry_hi = m_paletteram[offset | 1];
458458

@@ -510,7 +510,7 @@ TILE_GET_INFO_MEMBER(williams2_state::get_tile_info)
510510
int const data = m_tileram[tile_index];
511511
int const y = (tile_index >> 1) & 7;
512512

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
514514
int const color = y;
515515

516516
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)
539539

540540
// FIXME: Investigate further.
541541

542-
/* IC79 is a 74LS85 comparator that controls the low bit */
542+
// IC79 is a 74LS85 comparator that controls the low bit
543543
int const a = 1 | ((base_col & 1) << 2) | ((base_col & 1) << 3);
544544
int const b = (sig_W12 << 0) | (sig_W13 << 1) | (0 << 2) | (sig_J1 << 3);
545545
int const color = (a > b) || ((a == b) && !sig_W11);
@@ -575,31 +575,31 @@ TILE_GET_INFO_MEMBER(joust2_state::get_tile_info)
575575
int const mask = m_gfxdecode->gfx(0)->elements() - 1;
576576
int const data = m_tileram[tile_index];
577577

578-
/* IC79 is a 74LS157 selector jumpered to be disabled */
578+
// IC79 is a 74LS157 selector jumpered to be disabled
579579
int const color = 0;
580580

581581
tileinfo.set(0, data & mask, color, (data & ~mask) ? TILE_FLIPX : 0);
582582
}
583583

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
586586

587587
void williams2_state::bg_select_w(u8 data)
588588
{
589-
/* IC79 is a 74LS157 selector jumpered to be enabled */
589+
// IC79 is a 74LS157 selector jumpered to be enabled
590590
m_bg_tilemap->set_palette_offset((data & 0x38) << 4);
591591
}
592592

593593
void mysticm_state::bg_select_w(u8 data)
594594
{
595-
/* IC79 is a 74LS85 comparator that controls the low bit */
595+
// IC79 is a 74LS85 comparator that controls the low bit
596596
m_bg_color = data;
597597
m_bg_tilemap->mark_all_dirty();
598598
}
599599

600600
void joust2_state::bg_select_w(u8 data)
601601
{
602-
/* IC79 is a 74LS157 selector jumpered to be disabled */
602+
// IC79 is a 74LS157 selector jumpered to be disabled
603603
m_bg_tilemap->set_palette_offset((data & 0x3f) << 4);
604604
}
605605

@@ -622,16 +622,3 @@ void williams2_state::xscroll_high_w(u8 data)
622622
m_tilemap_xscroll = (m_tilemap_xscroll & 0x00f) | (data << 4);
623623
m_bg_tilemap->set_scrollx(0, (m_tilemap_xscroll & 7) + ((m_tilemap_xscroll >> 3) * 6));
624624
}
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

Comments
 (0)