diff options
author | Ivan Vangelista <mesgnet@yahoo.it> | 2018-05-26 08:05:40 +0200 |
---|---|---|
committer | Ivan Vangelista <mesgnet@yahoo.it> | 2018-05-26 08:05:40 +0200 |
commit | f24ac839ac171543aef3a4c1e7d547faf4838cb5 (patch) | |
tree | 75647af2b82c34c8bd17701a79000cc49c174627 /src | |
parent | 6890040b502514fe0335d328391886163bebdcea (diff) |
malzak.cpp: removed unused tag look-up (nw)
Diffstat (limited to 'src')
-rw-r--r-- | src/mame/drivers/malzak.cpp | 40 | ||||
-rw-r--r-- | src/mame/includes/malzak.h | 29 | ||||
-rw-r--r-- | src/mame/video/malzak.cpp | 25 |
3 files changed, 45 insertions, 49 deletions
diff --git a/src/mame/drivers/malzak.cpp b/src/mame/drivers/malzak.cpp index cf82cac7b81..a9994e627a5 100644 --- a/src/mame/drivers/malzak.cpp +++ b/src/mame/drivers/malzak.cpp @@ -70,13 +70,12 @@ #include "cpu/s2650/s2650.h" #include "machine/nvram.h" #include "sound/sn76477.h" -#include "video/saa5050.h" #include "speaker.h" READ8_MEMBER(malzak_state::fake_VRLE_r) { - return (m_s2636_0->read_data(space, 0xcb) & 0x3f) + (m_screen->vblank() ? 0x40 : 0x00); + return (m_s2636[0]->read_data(space, 0xcb) & 0x3f) + (m_screen->vblank() ? 0x40 : 0x00); } READ8_MEMBER(malzak_state::s2636_portA_r) @@ -103,14 +102,14 @@ void malzak_state::malzak_map(address_map &map) { map.global_mask(0x7fff); map(0x0000, 0x0bff).rom(); - map(0x0c00, 0x0fff).bankr("bank1"); + map(0x0c00, 0x0fff).bankr("mainbank"); map(0x1000, 0x10ff).mirror(0x6000).ram(); map(0x1100, 0x11ff).mirror(0x6000).ram(); map(0x1200, 0x12ff).mirror(0x6000).ram(); map(0x1300, 0x13ff).mirror(0x6000).ram(); - map(0x1400, 0x14ff).mirror(0x6000).rw(m_s2636_0, FUNC(s2636_device::read_data), FUNC(s2636_device::write_data)); + map(0x1400, 0x14ff).mirror(0x6000).rw(m_s2636[0], FUNC(s2636_device::read_data), FUNC(s2636_device::write_data)); map(0x14cb, 0x14cb).mirror(0x6000).r(this, FUNC(malzak_state::fake_VRLE_r)); - map(0x1500, 0x15ff).mirror(0x6000).rw(m_s2636_1, FUNC(s2636_device::read_data), FUNC(s2636_device::write_data)); + map(0x1500, 0x15ff).mirror(0x6000).rw(m_s2636[1], FUNC(s2636_device::read_data), FUNC(s2636_device::write_data)); map(0x1600, 0x16ff).mirror(0x6000).ram().w(this, FUNC(malzak_state::malzak_playfield_w)); map(0x1700, 0x17ff).mirror(0x6000).ram(); map(0x1800, 0x1fff).mirror(0x6000).ram().share("videoram"); @@ -124,15 +123,15 @@ void malzak_state::malzak2_map(address_map &map) { map.global_mask(0x7fff); map(0x0000, 0x0bff).rom(); - map(0x0c00, 0x0fff).bankr("bank1"); + map(0x0c00, 0x0fff).bankr("mainbank"); map(0x1000, 0x10ff).mirror(0x6000).ram(); map(0x1100, 0x11ff).mirror(0x6000).ram(); map(0x1200, 0x12ff).mirror(0x6000).ram(); map(0x1300, 0x13ff).mirror(0x6000).ram(); - map(0x1400, 0x14ff).mirror(0x6000).rw(m_s2636_0, FUNC(s2636_device::read_data), FUNC(s2636_device::write_data)); + map(0x1400, 0x14ff).mirror(0x6000).rw(m_s2636[0], FUNC(s2636_device::read_data), FUNC(s2636_device::write_data)); map(0x14cb, 0x14cb).mirror(0x6000).r(this, FUNC(malzak_state::fake_VRLE_r)); map(0x14cc, 0x14cc).mirror(0x6000).r(this, FUNC(malzak_state::s2636_portA_r)); - map(0x1500, 0x15ff).mirror(0x6000).rw(m_s2636_1, FUNC(s2636_device::read_data), FUNC(s2636_device::write_data)); + map(0x1500, 0x15ff).mirror(0x6000).rw(m_s2636[1], FUNC(s2636_device::read_data), FUNC(s2636_device::write_data)); map(0x1600, 0x16ff).mirror(0x6000).ram().w(this, FUNC(malzak_state::malzak_playfield_w)); map(0x1700, 0x17ff).mirror(0x6000).ram().share("nvram"); map(0x1800, 0x1fff).mirror(0x6000).ram().share("videoram"); @@ -157,7 +156,7 @@ WRITE8_MEMBER(malzak_state::port40_w) // Bit 6 is used only in Malzak II, and is set high after checking // the selected version // logerror("%s S2650: port 0x40 write: 0x%02x\n", machine().describe_context(), data); - membank("bank1")->set_entry((data & 0x40) >> 6); + m_mainbank->set_entry((data & 0x40) >> 6); } WRITE8_MEMBER(malzak_state::port60_w) @@ -282,13 +281,12 @@ READ8_MEMBER(malzak_state::videoram_r) void malzak_state::machine_start() { - membank("bank1")->configure_entries(0, 2, memregion("user2")->base(), 0x400); - - m_saa5050 = machine().device("saa5050"); + m_mainbank->configure_entries(0, 2, memregion("user2")->base(), 0x400); save_item(NAME(m_playfield_code)); save_item(NAME(m_malzak_x)); save_item(NAME(m_malzak_y)); + save_item(NAME(m_collision_counter)); } void malzak_state::machine_reset() @@ -302,33 +300,33 @@ void malzak_state::machine_reset() MACHINE_CONFIG_START(malzak_state::malzak) /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", S2650, 3800000/4) + MCFG_DEVICE_ADD(m_maincpu, S2650, 3800000/4) MCFG_DEVICE_PROGRAM_MAP(malzak_map) MCFG_DEVICE_IO_MAP(malzak_io_map) MCFG_DEVICE_DATA_MAP(malzak_data_map) - MCFG_S2650_SENSE_INPUT(READLINE("screen", screen_device, vblank)) + MCFG_S2650_SENSE_INPUT(READLINE(m_screen, screen_device, vblank)) /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) + MCFG_SCREEN_ADD(m_screen, RASTER) MCFG_SCREEN_REFRESH_RATE(50) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) MCFG_SCREEN_SIZE(480, 512) /* vert size is a guess */ MCFG_SCREEN_VISIBLE_AREA(0, 479, 0, 479) - MCFG_SCREEN_UPDATE_DRIVER(malzak_state, screen_update_malzak) + MCFG_SCREEN_UPDATE_DRIVER(malzak_state, screen_update) - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_malzak) - MCFG_PALETTE_ADD("palette", 128) + MCFG_DEVICE_ADD(m_gfxdecode, GFXDECODE, m_palette, gfx_malzak) + MCFG_PALETTE_ADD(m_palette, 128) MCFG_PALETTE_INIT_OWNER(malzak_state, malzak) - MCFG_DEVICE_ADD("s2636_0", S2636, 0) + MCFG_DEVICE_ADD(m_s2636[0], S2636, 0) MCFG_S2636_OFFSETS(0, -16) // -8, -16 MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) - MCFG_DEVICE_ADD("s2636_1", S2636, 0) + MCFG_DEVICE_ADD(m_s2636[1], S2636, 0) MCFG_S2636_OFFSETS(0, -16) // -9, -16 MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) - MCFG_DEVICE_ADD("saa5050", SAA5050, 6000000) + MCFG_DEVICE_ADD(m_trom, SAA5050, 6000000) MCFG_SAA5050_D_CALLBACK(READ8(*this, malzak_state, videoram_r)) MCFG_SAA5050_SCREEN_SIZE(42, 24, 64) diff --git a/src/mame/includes/malzak.h b/src/mame/includes/malzak.h index 8d2621c425b..d17005a8891 100644 --- a/src/mame/includes/malzak.h +++ b/src/mame/includes/malzak.h @@ -16,22 +16,31 @@ public: malzak_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), - m_s2636_0(*this, "s2636_0"), - m_s2636_1(*this, "s2636_1"), + m_s2636(*this, "s2636%u", 0U), m_trom(*this, "saa5050"), m_videoram(*this, "videoram"), m_gfxdecode(*this, "gfxdecode"), m_screen(*this, "screen"), - m_palette(*this, "palette") { } + m_palette(*this, "palette"), + m_mainbank(*this, "mainbank") { } + void malzak(machine_config &config); + void malzak2(machine_config &config); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + +private: + /* devices */ required_device<cpu_device> m_maincpu; - required_device<s2636_device> m_s2636_0; - required_device<s2636_device> m_s2636_1; + required_device_array<s2636_device, 2> m_s2636; required_device<saa5050_device> m_trom; required_shared_ptr<uint8_t> m_videoram; required_device<gfxdecode_device> m_gfxdecode; required_device<screen_device> m_screen; required_device<palette_device> m_palette; + required_memory_bank m_mainbank; /* misc */ // int playfield_x[256]; // int playfield_y[256]; @@ -40,8 +49,6 @@ public: int m_malzak_y; int m_collision_counter; - /* devices */ - device_t *m_saa5050; DECLARE_READ8_MEMBER(fake_VRLE_r); DECLARE_READ8_MEMBER(s2636_portA_r); DECLARE_READ8_MEMBER(s2650_data_r); @@ -51,12 +58,10 @@ public: DECLARE_READ8_MEMBER(collision_r); DECLARE_WRITE8_MEMBER(malzak_playfield_w); DECLARE_READ8_MEMBER(videoram_r); - virtual void machine_start() override; - virtual void machine_reset() override; + DECLARE_PALETTE_INIT(malzak); - uint32_t screen_update_malzak(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - void malzak(machine_config &config); - void malzak2(machine_config &config); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + void malzak2_map(address_map &map); void malzak_data_map(address_map &map); void malzak_io_map(address_map &map); diff --git a/src/mame/video/malzak.cpp b/src/mame/video/malzak.cpp index 54484ba49ff..88f406cc398 100644 --- a/src/mame/video/malzak.cpp +++ b/src/mame/video/malzak.cpp @@ -15,25 +15,22 @@ #include "emu.h" -#include "video/saa5050.h" #include "includes/malzak.h" -uint32_t malzak_state::screen_update_malzak(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t malzak_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { const rgb_t *palette = m_palette->palette()->entry_list_raw(); - int sx, sy; - int x,y; bitmap.fill(rgb_t::black(), cliprect); m_trom->screen_update(screen, bitmap, cliprect); // playfield - not sure exactly how this works... - for (x = 0; x < 16; x++) - for (y = 0; y < 16; y++) + for (int x = 0; x < 16; x++) + for (int y = 0; y < 16; y++) { - sx = ((x * 16 - 48) - m_malzak_x) * 2; - sy = ((y * 16) - m_malzak_y) * 2; + int sx = ((x * 16 - 48) - m_malzak_x) * 2; + int sy = ((y * 16) - m_malzak_y) * 2; if (sx < -271*2) sx += 512*2; @@ -44,18 +41,14 @@ uint32_t malzak_state::screen_update_malzak(screen_device &screen, bitmap_rgb32 } /* update the S2636 chips */ - bitmap_ind16 const &s2636_0_bitmap = m_s2636_0->update(cliprect); - bitmap_ind16 const &s2636_1_bitmap = m_s2636_1->update(cliprect); + bitmap_ind16 const &s2636_0_bitmap = m_s2636[0]->update(cliprect); + bitmap_ind16 const &s2636_1_bitmap = m_s2636[1]->update(cliprect); /* copy the S2636 images into the main bitmap */ { - int y; - - for (y = cliprect.min_y; y <= cliprect.max_y / 2; y++) + for (int y = cliprect.min_y; y <= cliprect.max_y / 2; y++) { - int x; - - for (x = cliprect.min_x; x <= cliprect.max_x / 2; x++) + for (int x = cliprect.min_x; x <= cliprect.max_x / 2; x++) { int pixel0 = s2636_0_bitmap.pix16(y, x); int pixel1 = s2636_1_bitmap.pix16(y, x); |