summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/machine/naomim1.cpp
diff options
context:
space:
mode:
author Miodrag Milanovic <mmicko@gmail.com>2015-12-17 11:10:30 +0100
committer Miodrag Milanovic <mmicko@gmail.com>2015-12-17 11:10:30 +0100
commit174720a64ddeed98078139dc0e4dd7aed15f91d4 (patch)
treeb22e4fb4f1a210751cadc5aa01d73113b8e9857f /src/mame/machine/naomim1.cpp
parentbe38cd71bb958d651ba91db8db439edc9c31b21e (diff)
removed auto_bitmap_ind*_alloc and auto_bitmap_rgb32_alloc and replaced with std::unique_ptr (nw)
auto_alloc_array to unique_ptr Added make_unique_clear
Diffstat (limited to 'src/mame/machine/naomim1.cpp')
-rw-r--r--src/mame/machine/naomim1.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mame/machine/naomim1.cpp b/src/mame/machine/naomim1.cpp
index c9e5bc1c359..7e205ce1ee7 100644
--- a/src/mame/machine/naomim1.cpp
+++ b/src/mame/machine/naomim1.cpp
@@ -41,9 +41,9 @@ void naomi_m1_board::device_start()
key = 0;
}
- buffer = auto_alloc_array(machine(), UINT8, BUFFER_SIZE);
+ buffer = std::make_unique<UINT8[]>(BUFFER_SIZE);
- save_pointer(NAME(buffer), BUFFER_SIZE);
+ save_pointer(NAME(buffer.get()), BUFFER_SIZE);
save_item(NAME(dict));
save_item(NAME(hist));
save_item(NAME(rom_cur_address));
@@ -84,7 +84,7 @@ void naomi_m1_board::board_setup_address(UINT32 address, bool is_dma)
void naomi_m1_board::board_get_buffer(UINT8 *&base, UINT32 &limit)
{
if(encryption) {
- base = buffer;
+ base = buffer.get();
limit = BUFFER_SIZE;
} else {
@@ -97,7 +97,7 @@ void naomi_m1_board::board_advance(UINT32 size)
{
if(encryption) {
if(size < buffer_actual_size) {
- memmove(buffer, buffer + size, buffer_actual_size - size);
+ memmove(buffer.get(), buffer.get() + size, buffer_actual_size - size);
buffer_actual_size -= size;
} else {
hist[0] = buffer[buffer_actual_size-2];