diff options
author | Vas Crabb <vas@vastheman.com> | 2017-12-01 05:34:53 +1100 |
---|---|---|
committer | Vas Crabb <vas@vastheman.com> | 2017-12-01 05:34:53 +1100 |
commit | 199f92a2b0fa29da5ce52fce8114a4331dd3466b (patch) | |
tree | 308c7f414d3410b0862a57b05c971724ce36b65a /src/mame/drivers/amusco.cpp | |
parent | 19addd3df55fd79735653c6894835c4ac5fce45c (diff) |
(nw) misc cleanup: start replacing auto_alloc_* with smart pointers, get
rid of reference constants in the debugger in favour of capturing the
value in the bind/lambda (less ugly casting)
Diffstat (limited to 'src/mame/drivers/amusco.cpp')
-rw-r--r-- | src/mame/drivers/amusco.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/mame/drivers/amusco.cpp b/src/mame/drivers/amusco.cpp index 21611946c46..af39e4757e3 100644 --- a/src/mame/drivers/amusco.cpp +++ b/src/mame/drivers/amusco.cpp @@ -131,7 +131,7 @@ protected: virtual void video_start() override; virtual void machine_start() override; private: - uint8_t *m_videoram; + std::unique_ptr<uint8_t []> m_videoram; tilemap_t *m_bg_tilemap; required_device<cpu_device> m_maincpu; @@ -180,9 +180,10 @@ void amusco_state::video_start() m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(amusco_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 10, 74, 24); m_blink_state = false; - m_videoram = auto_alloc_array_clear(machine(), uint8_t, videoram_size); + m_videoram = std::make_unique<uint8_t []>(videoram_size); + std::fill_n(m_videoram.get(), videoram_size, 0); - save_pointer(NAME(m_videoram), videoram_size); + save_pointer(NAME(m_videoram.get()), videoram_size); } void amusco_state::machine_start() |