From 76d5cdef72f369d31407c1c5b01cd004a95a77da Mon Sep 17 00:00:00 2001 From: cam900 Date: Mon, 29 Oct 2018 11:19:21 +0900 Subject: [PATCH] gottlieb.cpp : Minor cleanups, Reduce unnecessary arguments Fix namings, Spacings, Cleanup gfxdecodes sound/gottlieb.cpp : Reduce unnecessary arguments of handlers --- src/mame/audio/gottlieb.cpp | 4 +- src/mame/audio/gottlieb.h | 4 +- src/mame/drivers/gottlieb.cpp | 77 +++++++++++++++-------------------- src/mame/drivers/gts80.cpp | 2 +- src/mame/drivers/gts80a.cpp | 2 +- src/mame/drivers/gts80b.cpp | 2 +- src/mame/includes/gottlieb.h | 24 +++++------ src/mame/video/gottlieb.cpp | 76 +++++++++++++++------------------- 8 files changed, 84 insertions(+), 107 deletions(-) diff --git a/src/mame/audio/gottlieb.cpp b/src/mame/audio/gottlieb.cpp index 0dcc7796458..cac5e23588e 100644 --- a/src/mame/audio/gottlieb.cpp +++ b/src/mame/audio/gottlieb.cpp @@ -182,7 +182,7 @@ gottlieb_sound_r1_device::gottlieb_sound_r1_device( // write - handle an external command write //------------------------------------------------- -WRITE8_MEMBER( gottlieb_sound_r1_device::write ) +void gottlieb_sound_r1_device::write(u8 data) { // write the command data to the low 6 bits, and the trigger to the upper bit uint8_t pa7 = (data & 0x0f) != 0xf; @@ -416,7 +416,7 @@ gottlieb_sound_r2_device::gottlieb_sound_r2_device(const machine_config &mconfig // write - handle an external command write //------------------------------------------------- -WRITE8_MEMBER( gottlieb_sound_r2_device::write ) +void gottlieb_sound_r2_device::write(u8 data) { // when data is not 0xff, the transparent latch at A3 allows it to pass through unmolested if (data != 0xff) diff --git a/src/mame/audio/gottlieb.h b/src/mame/audio/gottlieb.h index e1efd0513ff..a671fef2960 100644 --- a/src/mame/audio/gottlieb.h +++ b/src/mame/audio/gottlieb.h @@ -80,7 +80,7 @@ public: gottlieb_sound_r1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); // read/write - DECLARE_WRITE8_MEMBER( write ); + void write(u8 data); protected: gottlieb_sound_r1_device( @@ -144,7 +144,7 @@ public: void enable_cobram3_mods() { m_cobram3_mod = true; } // read/write - DECLARE_WRITE8_MEMBER( write ); + void write(u8 data); // internal communications DECLARE_READ8_MEMBER( speech_data_r ); diff --git a/src/mame/drivers/gottlieb.cpp b/src/mame/drivers/gottlieb.cpp index 850166a8ae1..1599f87248e 100644 --- a/src/mame/drivers/gottlieb.cpp +++ b/src/mame/drivers/gottlieb.cpp @@ -285,7 +285,7 @@ CUSTOM_INPUT_MEMBER(gottlieb_state::analog_delta_r) } -WRITE8_MEMBER(gottlieb_state::gottlieb_analog_reset_w) +WRITE8_MEMBER(gottlieb_state::analog_reset_w) { /* reset the trackball counters */ m_track[0] = m_track_x.read_safe(0); @@ -307,13 +307,13 @@ CUSTOM_INPUT_MEMBER(gottlieb_state::stooges_joystick_r) * *************************************/ -WRITE8_MEMBER(gottlieb_state::general_output_w) +void gottlieb_state::general_output_w(u8 data) { /* bits 0-3 control video features, and are different for laserdisc games */ if (m_laserdisc == nullptr) - gottlieb_video_control_w(space, offset, data); + video_control_w(data); else - gottlieb_laserdisc_video_control_w(space, offset, data); + laserdisc_video_control_w(data); /* bit 4 normally controls the coin meter */ machine().bookkeeping().coin_counter_w(0, data & 0x10); @@ -326,7 +326,7 @@ WRITE8_MEMBER(gottlieb_state::general_output_w) // custom overrides WRITE8_MEMBER(gottlieb_state::reactor_output_w) { - general_output_w(space, offset, data & ~0xe0); + general_output_w(data & ~0xe0); m_leds[0] = BIT(data, 5); m_leds[1] = BIT(data, 6); @@ -335,7 +335,7 @@ WRITE8_MEMBER(gottlieb_state::reactor_output_w) WRITE8_MEMBER(gottlieb_state::qbert_output_w) { - general_output_w(space, offset, data & ~0x20); + general_output_w(data & ~0x20); // bit 5 controls the knocker qbert_knocker(data >> 5 & 1); @@ -344,7 +344,7 @@ WRITE8_MEMBER(gottlieb_state::qbert_output_w) WRITE8_MEMBER(gottlieb_state::qbertqub_output_w) { // coincounter is on bit 5 instead - general_output_w(space, offset, (data >> 1 & 0x10) | (data & ~0x30)); + general_output_w((data >> 1 & 0x10) | (data & ~0x30)); // bit 4 controls the sprite bank m_spritebank = (data & 0x10) >> 4; @@ -352,7 +352,7 @@ WRITE8_MEMBER(gottlieb_state::qbertqub_output_w) WRITE8_MEMBER(gottlieb_state::stooges_output_w) { - general_output_w(space, offset, data & ~0x60); + general_output_w(data & ~0x60); // bit 5,6: joystick input multiplexer m_joystick_select = (data >> 5) & 0x03; @@ -717,7 +717,7 @@ TIMER_CALLBACK_MEMBER(gottlieb_state::nmi_clear) } -INTERRUPT_GEN_MEMBER(gottlieb_state::gottlieb_interrupt) +INTERRUPT_GEN_MEMBER(gottlieb_state::interrupt) { /* assert the NMI and set a timer to clear it at the first visible line */ device.execute().set_input_line(INPUT_LINE_NMI, ASSERT_LINE); @@ -742,12 +742,12 @@ INTERRUPT_GEN_MEMBER(gottlieb_state::gottlieb_interrupt) * *************************************/ -WRITE8_MEMBER(gottlieb_state::gottlieb_sh_w) +void gottlieb_state::sound_w(u8 data) { if (m_r1_sound != nullptr) - m_r1_sound->write(space, offset, data); + m_r1_sound->write(data); if (m_r2_sound != nullptr) - m_r2_sound->write(space, offset, data); + m_r2_sound->write(data); } void gottlieb_state::reactor_map(address_map &map) @@ -755,13 +755,13 @@ void gottlieb_state::reactor_map(address_map &map) map.global_mask(0xffff); map(0x0000, 0x1fff).ram(); map(0x2000, 0x20ff).mirror(0x0f00).writeonly().share("spriteram"); /* FRSEL */ - map(0x3000, 0x33ff).mirror(0x0c00).ram().w(FUNC(gottlieb_state::gottlieb_videoram_w)).share("videoram"); /* BRSEL */ - map(0x4000, 0x4fff).ram().w(FUNC(gottlieb_state::gottlieb_charram_w)).share("charram"); /* BOJRSEL1 */ + map(0x3000, 0x33ff).mirror(0x0c00).ram().w(FUNC(gottlieb_state::videoram_w)).share("videoram"); /* BRSEL */ + map(0x4000, 0x4fff).ram().w(FUNC(gottlieb_state::charram_w)).share("charram"); /* BOJRSEL1 */ /* AM_RANGE(0x5000, 0x5fff) AM_WRITE() */ /* BOJRSEL2 */ - map(0x6000, 0x601f).mirror(0x0fe0).w(FUNC(gottlieb_state::gottlieb_paletteram_w)).share("paletteram"); /* COLSEL */ + map(0x6000, 0x601f).mirror(0x0fe0).w(FUNC(gottlieb_state::palette_w)).share("paletteram"); /* COLSEL */ map(0x7000, 0x7000).mirror(0x0ff8).w("watchdog", FUNC(watchdog_timer_device::reset_w)); - map(0x7001, 0x7001).mirror(0x0ff8).w(FUNC(gottlieb_state::gottlieb_analog_reset_w)); /* A1J2 interface */ - map(0x7002, 0x7002).mirror(0x0ff8).w(FUNC(gottlieb_state::gottlieb_sh_w)); /* trackball H */ + map(0x7001, 0x7001).mirror(0x0ff8).w(FUNC(gottlieb_state::analog_reset_w)); /* A1J2 interface */ + map(0x7002, 0x7002).mirror(0x0ff8).w(FUNC(gottlieb_state::sound_w)); /* trackball H */ map(0x7003, 0x7003).mirror(0x0ff8).w(FUNC(gottlieb_state::reactor_output_w)); /* trackball V */ map(0x7000, 0x7000).mirror(0x0ff8).portr("DSW"); map(0x7001, 0x7001).mirror(0x0ff8).portr("IN1"); /* buttons */ @@ -779,12 +779,12 @@ void gottlieb_state::gottlieb_map(address_map &map) map(0x1000, 0x1fff).ram().region("maincpu", 0x1000); /* or ROM */ map(0x2000, 0x2fff).ram().region("maincpu", 0x2000); /* or ROM */ map(0x3000, 0x30ff).mirror(0x0700).writeonly().share("spriteram"); /* FRSEL */ - map(0x3800, 0x3bff).mirror(0x0400).ram().w(FUNC(gottlieb_state::gottlieb_videoram_w)).share("videoram"); /* BRSEL */ - map(0x4000, 0x4fff).ram().w(FUNC(gottlieb_state::gottlieb_charram_w)).share("charram"); /* BOJRSEL1 */ - map(0x5000, 0x501f).mirror(0x07e0).w(FUNC(gottlieb_state::gottlieb_paletteram_w)).share("paletteram"); /* COLSEL */ + map(0x3800, 0x3bff).mirror(0x0400).ram().w(FUNC(gottlieb_state::videoram_w)).share("videoram"); /* BRSEL */ + map(0x4000, 0x4fff).ram().w(FUNC(gottlieb_state::charram_w)).share("charram"); /* BOJRSEL1 */ + map(0x5000, 0x501f).mirror(0x07e0).w(FUNC(gottlieb_state::palette_w)).share("paletteram"); /* COLSEL */ map(0x5800, 0x5800).mirror(0x07f8).w("watchdog", FUNC(watchdog_timer_device::reset_w)); - map(0x5801, 0x5801).mirror(0x07f8).w(FUNC(gottlieb_state::gottlieb_analog_reset_w)); /* A1J2 interface */ - map(0x5802, 0x5802).mirror(0x07f8).w(FUNC(gottlieb_state::gottlieb_sh_w)); /* OP20-27 */ + map(0x5801, 0x5801).mirror(0x07f8).w(FUNC(gottlieb_state::analog_reset_w)); /* A1J2 interface */ + map(0x5802, 0x5802).mirror(0x07f8).w(FUNC(gottlieb_state::sound_w)); /* OP20-27 */ map(0x5803, 0x5803).mirror(0x07f8).w(FUNC(gottlieb_state::general_output_w)); /* OP30-37 */ /* AM_RANGE(0x5804, 0x5804) AM_MIRROR(0x07f8) AM_WRITE()*/ /* OP40-47 */ map(0x5800, 0x5800).mirror(0x07f8).portr("DSW"); @@ -1720,21 +1720,10 @@ INPUT_PORTS_END /* the games can store char gfx data in either a 4k RAM area (128 chars), or */ /* a 8k ROM area (256 chars). */ -static const gfx_layout bg_ram_layout = +static const gfx_layout bg_layout = { 8,8, - 128, - 4, - { STEP4(0,1) }, - { STEP8(0,4) }, - { STEP8(0,32) }, - 32*8 -}; - -static const gfx_layout bg_rom_layout = -{ - 8,8, - 256, + RGN_FRAC(1,1), 4, { STEP4(0,1) }, { STEP8(0,4) }, @@ -1754,9 +1743,9 @@ static const gfx_layout fg_layout = }; static GFXDECODE_START( gfxdecode ) - GFXDECODE_ENTRY( nullptr, 0x4000, bg_ram_layout, 0, 1 ) /* the game dynamically modifies this */ - GFXDECODE_ENTRY( "bgtiles", 0x0000, bg_rom_layout, 0, 1 ) - GFXDECODE_ENTRY( "sprites", 0x0000, fg_layout, 0, 1 ) + GFXDECODE_RAM( "charram", 0, bg_layout, 0, 1 ) /* the game dynamically modifies this */ + GFXDECODE_ENTRY( "bgtiles", 0, bg_layout, 0, 1 ) + GFXDECODE_ENTRY( "sprites", 0, fg_layout, 0, 1 ) GFXDECODE_END @@ -1772,7 +1761,7 @@ MACHINE_CONFIG_START(gottlieb_state::gottlieb_core) /* basic machine hardware */ MCFG_DEVICE_ADD("maincpu", I8088, CPU_CLOCK/3) MCFG_DEVICE_PROGRAM_MAP(gottlieb_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", gottlieb_state, gottlieb_interrupt) + MCFG_DEVICE_VBLANK_INT_DRIVER("screen", gottlieb_state, interrupt) NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_1); @@ -1781,10 +1770,10 @@ MACHINE_CONFIG_START(gottlieb_state::gottlieb_core) /* video hardware */ MCFG_SCREEN_ADD(m_screen, RASTER) MCFG_SCREEN_RAW_PARAMS(SYSTEM_CLOCK/4, GOTTLIEB_VIDEO_HCOUNT, 0, GOTTLIEB_VIDEO_HBLANK, GOTTLIEB_VIDEO_VCOUNT, 0, GOTTLIEB_VIDEO_VBLANK) - MCFG_SCREEN_UPDATE_DRIVER(gottlieb_state, screen_update_gottlieb) + MCFG_SCREEN_UPDATE_DRIVER(gottlieb_state, screen_update) - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfxdecode) - MCFG_PALETTE_ADD("palette", 16) + GFXDECODE(config, m_gfxdecode, m_palette, gfxdecode); + PALETTE(config, m_palette, 16); // basic speaker configuration SPEAKER(config, "speaker").front_center(); @@ -1812,7 +1801,7 @@ MACHINE_CONFIG_START(gottlieb_state::g2laser) MCFG_LASERDISC_PR8210_ADD("laserdisc") MCFG_LASERDISC_AUDIO(laserdisc_device::audio_delegate(&gottlieb_state::laserdisc_audio_process, this)) - MCFG_LASERDISC_OVERLAY_DRIVER(GOTTLIEB_VIDEO_HCOUNT, GOTTLIEB_VIDEO_VCOUNT, gottlieb_state, screen_update_gottlieb) + MCFG_LASERDISC_OVERLAY_DRIVER(GOTTLIEB_VIDEO_HCOUNT, GOTTLIEB_VIDEO_VCOUNT, gottlieb_state, screen_update) MCFG_LASERDISC_OVERLAY_CLIP(0, GOTTLIEB_VIDEO_HBLANK-1, 0, GOTTLIEB_VIDEO_VBLANK-8) MCFG_LASERDISC_OVERLAY_PALETTE("palette") MCFG_SOUND_ROUTE(0, "speaker", 1.0) @@ -1876,7 +1865,7 @@ MACHINE_CONFIG_START(gottlieb_state::cobram3) MCFG_LASERDISC_PR8210_ADD("laserdisc") MCFG_LASERDISC_AUDIO(laserdisc_device::audio_delegate(&gottlieb_state::laserdisc_audio_process, this)) - MCFG_LASERDISC_OVERLAY_DRIVER(GOTTLIEB_VIDEO_HCOUNT, GOTTLIEB_VIDEO_VCOUNT, gottlieb_state, screen_update_gottlieb) + MCFG_LASERDISC_OVERLAY_DRIVER(GOTTLIEB_VIDEO_HCOUNT, GOTTLIEB_VIDEO_VCOUNT, gottlieb_state, screen_update) MCFG_LASERDISC_OVERLAY_CLIP(0, GOTTLIEB_VIDEO_HBLANK-1, 0, GOTTLIEB_VIDEO_VBLANK-8) MCFG_LASERDISC_OVERLAY_PALETTE("palette") MCFG_SOUND_ROUTE(0, "speaker", 1.0) diff --git a/src/mame/drivers/gts80.cpp b/src/mame/drivers/gts80.cpp index 7701f8e8c8b..7b0c703f21c 100644 --- a/src/mame/drivers/gts80.cpp +++ b/src/mame/drivers/gts80.cpp @@ -344,7 +344,7 @@ WRITE8_MEMBER( gts80_state::port3b_w ) if (m_r0_sound) m_r0_sound->write(space, offset, sndcmd); if (m_r1_sound) - m_r1_sound->write(space, offset, sndcmd); + m_r1_sound->write(sndcmd); } void gts80_state::machine_reset() diff --git a/src/mame/drivers/gts80a.cpp b/src/mame/drivers/gts80a.cpp index 593c538e940..4d33211026e 100644 --- a/src/mame/drivers/gts80a.cpp +++ b/src/mame/drivers/gts80a.cpp @@ -335,7 +335,7 @@ WRITE8_MEMBER( gts80a_state::port3b_w ) if (m_r0_sound) m_r0_sound->write(space, offset, sndcmd); if (m_r1_sound) - m_r1_sound->write(space, offset, sndcmd); + m_r1_sound->write(sndcmd); } void gts80a_state::machine_reset() diff --git a/src/mame/drivers/gts80b.cpp b/src/mame/drivers/gts80b.cpp index 0ddfbe0b734..7ffcf93a53d 100644 --- a/src/mame/drivers/gts80b.cpp +++ b/src/mame/drivers/gts80b.cpp @@ -374,7 +374,7 @@ WRITE8_MEMBER( gts80b_state::port3b_w ) if (m_r0_sound) m_r0_sound->write(space, offset, sndcmd); if (m_r1_sound) - m_r1_sound->write(space, offset, sndcmd); + m_r1_sound->write(sndcmd); } void gts80b_state::machine_reset() diff --git a/src/mame/includes/gottlieb.h b/src/mame/includes/gottlieb.h index b9484adf493..1012b095d3c 100644 --- a/src/mame/includes/gottlieb.h +++ b/src/mame/includes/gottlieb.h @@ -42,7 +42,7 @@ public: , m_gfxdecode(*this, "gfxdecode") , m_screen(*this, "screen") , m_palette(*this, "palette") - , m_generic_paletteram_8(*this, "paletteram") + , m_paletteram(*this, "paletteram") , m_track_x(*this, "TRACKX") , m_track_y(*this, "TRACKY") , m_leds(*this, "led%u", 0U) @@ -82,8 +82,8 @@ private: void qbert_knocker(uint8_t knock); - DECLARE_WRITE8_MEMBER(gottlieb_analog_reset_w); - DECLARE_WRITE8_MEMBER(general_output_w); + DECLARE_WRITE8_MEMBER(analog_reset_w); + void general_output_w(u8 data); DECLARE_WRITE8_MEMBER(reactor_output_w); DECLARE_WRITE8_MEMBER(stooges_output_w); DECLARE_WRITE8_MEMBER(qbertqub_output_w); @@ -91,17 +91,17 @@ private: DECLARE_READ8_MEMBER(laserdisc_status_r); DECLARE_WRITE8_MEMBER(laserdisc_select_w); DECLARE_WRITE8_MEMBER(laserdisc_command_w); - DECLARE_WRITE8_MEMBER(gottlieb_sh_w); - DECLARE_WRITE8_MEMBER(gottlieb_paletteram_w); - DECLARE_WRITE8_MEMBER(gottlieb_video_control_w); - DECLARE_WRITE8_MEMBER(gottlieb_laserdisc_video_control_w); - DECLARE_WRITE8_MEMBER(gottlieb_videoram_w); - DECLARE_WRITE8_MEMBER(gottlieb_charram_w); + void sound_w(u8 data); + void palette_w(offs_t offset, u8 data); + void video_control_w(u8 data); + void laserdisc_video_control_w(u8 data); + DECLARE_WRITE8_MEMBER(videoram_w); + DECLARE_WRITE8_MEMBER(charram_w); TILE_GET_INFO_MEMBER(get_bg_tile_info); TILE_GET_INFO_MEMBER(get_screwloo_bg_tile_info); DECLARE_VIDEO_START(screwloo); - uint32_t screen_update_gottlieb(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - INTERRUPT_GEN_MEMBER(gottlieb_interrupt); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + INTERRUPT_GEN_MEMBER(interrupt); TIMER_CALLBACK_MEMBER(laserdisc_philips_callback); TIMER_CALLBACK_MEMBER(laserdisc_bit_off_callback); TIMER_CALLBACK_MEMBER(laserdisc_bit_callback); @@ -134,7 +134,7 @@ private: required_device m_gfxdecode; required_device m_screen; required_device m_palette; - required_shared_ptr m_generic_paletteram_8; + required_shared_ptr m_paletteram; optional_ioport m_track_x; optional_ioport m_track_y; diff --git a/src/mame/video/gottlieb.cpp b/src/mame/video/gottlieb.cpp index 0186340942a..b92fb9ef792 100644 --- a/src/mame/video/gottlieb.cpp +++ b/src/mame/video/gottlieb.cpp @@ -17,56 +17,55 @@ * *************************************/ -WRITE8_MEMBER(gottlieb_state::gottlieb_paletteram_w) +void gottlieb_state::palette_w(offs_t offset, u8 data) { - int r, g, b, a, val; + int val; - m_generic_paletteram_8[offset] = data; + m_paletteram[offset] = data; /* blue & green are encoded in the even bytes */ - val = m_generic_paletteram_8[offset & ~1]; - g = combine_4_weights(m_weights, (val >> 4) & 1, (val >> 5) & 1, (val >> 6) & 1, (val >> 7) & 1); - b = combine_4_weights(m_weights, (val >> 0) & 1, (val >> 1) & 1, (val >> 2) & 1, (val >> 3) & 1); + val = m_paletteram[offset & ~1]; + int const g = combine_4_weights(m_weights, BIT(val, 4), BIT(val, 5), BIT(val, 6), BIT(val, 7)); + int const b = combine_4_weights(m_weights, BIT(val, 0), BIT(val, 1), BIT(val, 2), BIT(val, 3)); /* red is encoded in the odd bytes */ - val = m_generic_paletteram_8[offset | 1]; - r = combine_4_weights(m_weights, (val >> 0) & 1, (val >> 1) & 1, (val >> 2) & 1, (val >> 3) & 1); + val = m_paletteram[offset | 1]; + int const r = combine_4_weights(m_weights, BIT(val, 0), BIT(val, 1), BIT(val, 2), BIT(val, 3)); /* alpha is set to 0 if laserdisc video is enabled */ - a = (m_transparent0 && offset / 2 == 0) ? 0 : 255; + int const a = (m_transparent0 && offset / 2 == 0) ? 0 : 255; m_palette->set_pen_color(offset / 2, rgb_t(a, r, g, b)); } - /************************************* * * Video controls * *************************************/ -WRITE8_MEMBER(gottlieb_state::gottlieb_video_control_w) +void gottlieb_state::video_control_w(u8 data) { /* bit 0 controls foreground/background priority */ - if (m_background_priority != (data & 0x01)) + if (m_background_priority != (BIT(data, 0))) m_screen->update_partial(m_screen->vpos()); - m_background_priority = data & 0x01; + m_background_priority = BIT(data, 0); /* bit 1 controls horizontal flip screen */ - flip_screen_x_set(data & 0x02); + flip_screen_x_set(BIT(data, 1)); /* bit 2 controls vertical flip screen */ - flip_screen_y_set(data & 0x04); + flip_screen_y_set(BIT(data, 2)); } -WRITE8_MEMBER(gottlieb_state::gottlieb_laserdisc_video_control_w) +void gottlieb_state::laserdisc_video_control_w(u8 data) { /* bit 0 works like the other games */ - gottlieb_video_control_w(space, offset, data & 0x01); + video_control_w(BIT(data, 0)); /* bit 1 controls the sprite bank. */ - m_spritebank = (data & 0x02) >> 1; + m_spritebank = BIT(data, 1); /* bit 2 video enable (0 = black screen) */ /* bit 3 genlock control (1 = show laserdisc image) */ @@ -74,27 +73,25 @@ WRITE8_MEMBER(gottlieb_state::gottlieb_laserdisc_video_control_w) m_laserdisc->video_enable(((data & 0x0c) == 0x0c) ? true : false); /* configure the palette if the laserdisc is enabled */ - m_transparent0 = (data >> 3) & 1; - gottlieb_paletteram_w(space, 0, m_generic_paletteram_8[0]); + m_transparent0 = BIT(data, 3); + palette_w(0, m_paletteram[0]); } - /************************************* * * Video RAM and character RAM access * *************************************/ -WRITE8_MEMBER(gottlieb_state::gottlieb_videoram_w) +WRITE8_MEMBER(gottlieb_state::videoram_w) { - uint8_t *videoram = m_videoram; - videoram[offset] = data; + m_videoram[offset] = data; m_bg_tilemap->mark_tile_dirty(offset); } -WRITE8_MEMBER(gottlieb_state::gottlieb_charram_w) +WRITE8_MEMBER(gottlieb_state::charram_w) { if (m_charram[offset] != data) { @@ -104,7 +101,6 @@ WRITE8_MEMBER(gottlieb_state::gottlieb_charram_w) } - /************************************* * * Palette RAM writes @@ -113,8 +109,7 @@ WRITE8_MEMBER(gottlieb_state::gottlieb_charram_w) TILE_GET_INFO_MEMBER(gottlieb_state::get_bg_tile_info) { - uint8_t *videoram = m_videoram; - int code = videoram[tile_index]; + int code = m_videoram[tile_index]; if ((code & 0x80) == 0) SET_TILE_INFO_MEMBER(m_gfxcharlo, code, 0, 0); else @@ -123,8 +118,7 @@ TILE_GET_INFO_MEMBER(gottlieb_state::get_bg_tile_info) TILE_GET_INFO_MEMBER(gottlieb_state::get_screwloo_bg_tile_info) { - uint8_t *videoram = m_videoram; - int code = videoram[tile_index]; + int code = m_videoram[tile_index]; if ((code & 0xc0) == 0) SET_TILE_INFO_MEMBER(m_gfxcharlo, code, 0, 0); else @@ -149,8 +143,6 @@ void gottlieb_state::video_start() m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(gottlieb_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); m_bg_tilemap->set_transparent_pen(0); - m_gfxdecode->gfx(0)->set_source(m_charram); - /* save some state */ save_item(NAME(m_background_priority)); save_item(NAME(m_spritebank)); @@ -174,8 +166,6 @@ VIDEO_START_MEMBER(gottlieb_state,screwloo) m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(gottlieb_state::get_screwloo_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); m_bg_tilemap->set_transparent_pen(0); - m_gfxdecode->gfx(0)->set_source(m_charram); - /* save some state */ save_item(NAME(m_background_priority)); save_item(NAME(m_spritebank)); @@ -192,7 +182,6 @@ VIDEO_START_MEMBER(gottlieb_state,screwloo) void gottlieb_state::draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect) { - uint8_t *spriteram = m_spriteram; rectangle clip = cliprect; int offs; @@ -204,18 +193,17 @@ void gottlieb_state::draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprec { /* coordinates hand tuned to make the position correct in Q*Bert Qubes start */ /* of level animation. */ - int sx = (spriteram[offs + 1]) - 4; - int sy = (spriteram[offs]) - 13; - int code = (255 ^ spriteram[offs + 2]) + 256 * m_spritebank; + int sx = (m_spriteram[offs + 1]) - 4; + int sy = (m_spriteram[offs]) - 13; + int code = (255 ^ m_spriteram[offs + 2]) + 256 * m_spritebank; if (flip_screen_x()) sx = 233 - sx; if (flip_screen_y()) sy = 228 - sy; - - m_gfxdecode->gfx(2)->transpen(bitmap,clip, - code, 0, - flip_screen_x(), flip_screen_y(), - sx,sy, 0); + m_gfxdecode->gfx(2)->transpen(bitmap,clip, + code, 0, + flip_screen_x(), flip_screen_y(), + sx,sy, 0); } } @@ -227,7 +215,7 @@ void gottlieb_state::draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprec * *************************************/ -uint32_t gottlieb_state::screen_update_gottlieb(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t gottlieb_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { /* if the background has lower priority, render it first, else clear the screen */ if (!m_background_priority)