diff options
author | 2018-08-01 22:57:33 -0400 | |
---|---|---|
committer | 2018-08-01 22:58:20 -0400 | |
commit | 86b497d9fb266a9e23f8ecff3177ec8dc41194af (patch) | |
tree | 640f2d8d785f0ebe1281569ea2d3332f10396244 | |
parent | c3b24e73b75e294aaeae70d0b959a36ff64935f2 (diff) |
bus/isa: Eliminate some region_alloc abuse (nw)
-rw-r--r-- | src/devices/bus/isa/ega.cpp | 10 | ||||
-rw-r--r-- | src/devices/bus/isa/ega.h | 2 | ||||
-rw-r--r-- | src/devices/bus/isa/pc1640_iga.cpp | 8 |
3 files changed, 6 insertions, 14 deletions
diff --git a/src/devices/bus/isa/ega.cpp b/src/devices/bus/isa/ega.cpp index bc8251ddb66..01c73066088 100644 --- a/src/devices/bus/isa/ega.cpp +++ b/src/devices/bus/isa/ega.cpp @@ -576,7 +576,7 @@ isa8_ega_device::isa8_ega_device(const machine_config &mconfig, const char *tag, isa8_ega_device::isa8_ega_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, type, tag, owner, clock), device_isa8_card_interface(mconfig, *this), - m_crtc_ega(nullptr), m_vram(nullptr), m_videoram(nullptr), m_charA(nullptr), m_charB(nullptr), + m_crtc_ega(nullptr), m_videoram(nullptr), m_charA(nullptr), m_charB(nullptr), m_misc_output(0), m_feature_control(0), m_frame_cnt(0), m_hsync(0), m_vsync(0), m_vblank(0), m_display_enable(0), m_video_mode(0), m_palette(*this, "palette") { @@ -618,17 +618,13 @@ void isa8_ega_device::device_start() memcpy(memregion(subtag("user2").c_str())->base(), memregion(subtag("user1").c_str())->base(), 0x4000); /* Install 256KB Video ram on our EGA card */ - m_vram = machine().memory().region_alloc(subtag("vram").c_str(), 256 * 1024, 1, ENDIANNESS_LITTLE); + m_vram = make_unique_clear<uint8_t[]>(256 * 1024); - m_videoram = m_vram->base(); + m_videoram = m_vram.get(); m_plane[0] = m_videoram + 0x00000; - memset(m_plane[0], 0, sizeof(uint8_t) * 0x10000); m_plane[1] = m_videoram + 0x10000; - memset(m_plane[1], 0, sizeof(uint8_t) * 0x10000); m_plane[2] = m_videoram + 0x20000; - memset(m_plane[2], 0, sizeof(uint8_t) * 0x10000); m_plane[3] = m_videoram + 0x30000; - memset(m_plane[3], 0, sizeof(uint8_t) * 0x10000); m_crtc_ega = subdevice<crtc_ega_device>(EGA_CRTC_NAME); diff --git a/src/devices/bus/isa/ega.h b/src/devices/bus/isa/ega.h index ef7db51c407..4e7bc4394a3 100644 --- a/src/devices/bus/isa/ega.h +++ b/src/devices/bus/isa/ega.h @@ -66,7 +66,7 @@ public: DECLARE_READ8_MEMBER(pc_ega8_3X0_r); /* Video memory and related variables */ - memory_region *m_vram; + std::unique_ptr<uint8_t[]> m_vram; uint8_t *m_plane[4]; uint8_t m_read_latch[4]; uint8_t *m_videoram; diff --git a/src/devices/bus/isa/pc1640_iga.cpp b/src/devices/bus/isa/pc1640_iga.cpp index 83accf6794c..04ef54c2d42 100644 --- a/src/devices/bus/isa/pc1640_iga.cpp +++ b/src/devices/bus/isa/pc1640_iga.cpp @@ -95,17 +95,13 @@ void isa8_pc1640_iga_device::device_start() } /* Install 256KB Video ram on our EGA card */ - m_vram = machine().memory().region_alloc(subtag("vram").c_str(), 256 * 1024, 1, ENDIANNESS_LITTLE); + m_vram = make_unique_clear<uint8_t[]>(256 * 1024); - m_videoram = m_vram->base(); + m_videoram = m_vram.get(); m_plane[0] = m_videoram + 0x00000; - memset(m_plane[0], 0, sizeof(uint8_t) * 0x10000); m_plane[1] = m_videoram + 0x10000; - memset(m_plane[1], 0, sizeof(uint8_t) * 0x10000); m_plane[2] = m_videoram + 0x20000; - memset(m_plane[2], 0, sizeof(uint8_t) * 0x10000); m_plane[3] = m_videoram + 0x30000; - memset(m_plane[3], 0, sizeof(uint8_t) * 0x10000); m_crtc_ega = subdevice<crtc_ega_device>(EGA_CRTC_NAME); |