summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--src/emu/bus/adam/exp.c10
-rw-r--r--src/emu/bus/adam/exp.h4
-rw-r--r--src/emu/bus/iq151/grafik.c4
-rw-r--r--src/emu/bus/iq151/grafik.h2
-rw-r--r--src/emu/bus/nubus/nubus.c45
-rw-r--r--src/emu/bus/nubus/nubus.h1
-rw-r--r--src/emu/bus/nubus/nubus_48gc.c6
-rw-r--r--src/emu/bus/nubus/nubus_48gc.h2
-rw-r--r--src/emu/bus/nubus/nubus_cb264.c4
-rw-r--r--src/emu/bus/nubus/nubus_cb264.h2
-rw-r--r--src/emu/bus/nubus/nubus_m2hires.c4
-rw-r--r--src/emu/bus/nubus/nubus_m2hires.h2
-rw-r--r--src/emu/bus/nubus/nubus_m2video.c4
-rw-r--r--src/emu/bus/nubus/nubus_m2video.h2
-rw-r--r--src/emu/bus/nubus/nubus_radiustpd.c4
-rw-r--r--src/emu/bus/nubus/nubus_radiustpd.h2
-rw-r--r--src/emu/bus/nubus/nubus_spec8.c4
-rw-r--r--src/emu/bus/nubus/nubus_spec8.h2
-rw-r--r--src/emu/bus/nubus/nubus_specpdq.c4
-rw-r--r--src/emu/bus/nubus/nubus_specpdq.h2
-rw-r--r--src/emu/bus/nubus/nubus_vikbw.c2
-rw-r--r--src/emu/bus/nubus/nubus_vikbw.h2
-rw-r--r--src/emu/bus/nubus/nubus_wsportrait.c4
-rw-r--r--src/emu/bus/nubus/nubus_wsportrait.h2
-rw-r--r--src/emu/bus/nubus/pds30_30hr.c4
-rw-r--r--src/emu/bus/nubus/pds30_30hr.h2
-rw-r--r--src/emu/bus/nubus/pds30_cb264.c6
-rw-r--r--src/emu/bus/nubus/pds30_cb264.h2
-rw-r--r--src/emu/bus/nubus/pds30_mc30.c4
-rw-r--r--src/emu/bus/nubus/pds30_mc30.h2
-rw-r--r--src/emu/bus/nubus/pds30_procolor816.c6
-rw-r--r--src/emu/bus/nubus/pds30_procolor816.h2
-rw-r--r--src/emu/bus/nubus/pds30_sigmalview.c4
-rw-r--r--src/emu/bus/nubus/pds30_sigmalview.h2
-rw-r--r--src/emu/bus/vidbrain/exp.c8
-rw-r--r--src/emu/bus/vidbrain/exp.h4
-rw-r--r--src/emu/cpu/cubeqcpu/cubeqcpu.c13
-rw-r--r--src/emu/cpu/cubeqcpu/cubeqcpu.h14
-rw-r--r--src/emu/cpu/drcfe.c5
-rw-r--r--src/emu/cpu/drcfe.h2
-rw-r--r--src/emu/cpu/drcuml.c4
-rw-r--r--src/emu/cpu/drcuml.h2
-rw-r--r--src/emu/cpu/esrip/esrip.c4
-rw-r--r--src/emu/cpu/esrip/esrip.h2
-rw-r--r--src/emu/cpu/lc8670/lc8670.c6
-rw-r--r--src/emu/cpu/lc8670/lc8670.h8
-rw-r--r--src/emu/cpu/mc68hc11/mc68hc11.c4
-rw-r--r--src/emu/cpu/mc68hc11/mc68hc11.h2
-rw-r--r--src/emu/cpu/mips/r3000.c8
-rw-r--r--src/emu/cpu/mips/r3000.h4
-rw-r--r--src/emu/cpu/sh2/sh2.c11
-rw-r--r--src/emu/cpu/sh2/sh2comn.c3
-rw-r--r--src/emu/cpu/sh2/sh2comn.h2
-rw-r--r--src/emu/cpu/sh2/sh2drc.c11
-rw-r--r--src/emu/cpu/sh4/sh4.c3
-rw-r--r--src/emu/cpu/sh4/sh4comn.c2
-rw-r--r--src/emu/cpu/sh4/sh4comn.h10
-rw-r--r--src/emu/cpu/sharc/sharc.c1
-rw-r--r--src/emu/cpu/sharc/sharc.h3
-rw-r--r--src/emu/cpu/tms32082/tms32082.c2
-rw-r--r--src/emu/cpu/tms32082/tms32082.h2
-rw-r--r--src/emu/cpu/tms34010/34010ops.h3
-rw-r--r--src/emu/cpu/tms34010/tms34010.c14
-rw-r--r--src/emu/cpu/tms9900/tms9995.c3
-rw-r--r--src/emu/cpu/tms9900/tms9995.h2
-rw-r--r--src/emu/cpu/vtlb.c19
-rw-r--r--src/lib/util/coretmpl.h12
67 files changed, 141 insertions, 206 deletions
diff --git a/src/emu/bus/adam/exp.c b/src/emu/bus/adam/exp.c
index f079b5f3c96..38a4f183f20 100644
--- a/src/emu/bus/adam/exp.c
+++ b/src/emu/bus/adam/exp.c
@@ -39,8 +39,6 @@ const device_type ADAM_EXPANSION_SLOT = &device_creator<adam_expansion_slot_devi
device_adam_expansion_slot_card_interface::device_adam_expansion_slot_card_interface(const machine_config &mconfig, device_t &device)
: device_slot_card_interface(mconfig, device),
- m_rom(NULL),
- m_ram(NULL),
m_rom_mask(0),
m_ram_mask(0)
{
@@ -63,9 +61,9 @@ device_adam_expansion_slot_card_interface::~device_adam_expansion_slot_card_inte
UINT8* device_adam_expansion_slot_card_interface::adam_rom_pointer(running_machine &machine, size_t size)
{
- if (m_rom == NULL)
+ if (m_rom.count() == 0)
{
- m_rom = auto_alloc_array(machine, UINT8, size);
+ m_rom.resize(size);
m_rom_mask = size - 1;
}
@@ -80,9 +78,9 @@ UINT8* device_adam_expansion_slot_card_interface::adam_rom_pointer(running_machi
UINT8* device_adam_expansion_slot_card_interface::adam_ram_pointer(running_machine &machine, size_t size)
{
- if (m_ram == NULL)
+ if (m_ram.count() == 0)
{
- m_ram = auto_alloc_array(machine, UINT8, size);
+ m_ram.resize(size);
m_ram_mask = size - 1;
}
diff --git a/src/emu/bus/adam/exp.h b/src/emu/bus/adam/exp.h
index e3094c422c8..c2614a41856 100644
--- a/src/emu/bus/adam/exp.h
+++ b/src/emu/bus/adam/exp.h
@@ -128,8 +128,8 @@ protected:
adam_expansion_slot_device *m_slot;
- UINT8 *m_rom;
- UINT8 *m_ram;
+ dynamic_array<UINT8> m_rom;
+ dynamic_array<UINT8> m_ram;
size_t m_rom_mask;
size_t m_ram_mask;
diff --git a/src/emu/bus/iq151/grafik.c b/src/emu/bus/iq151/grafik.c
index 5fe384da8e3..80b39fcb790 100644
--- a/src/emu/bus/iq151/grafik.c
+++ b/src/emu/bus/iq151/grafik.c
@@ -57,8 +57,6 @@ iq151_grafik_device::iq151_grafik_device(const machine_config &mconfig, const ch
void iq151_grafik_device::device_start()
{
- // allocate the videoram
- m_videoram = (UINT8*)auto_alloc_array_clear(machine(), UINT8, 0x4000);
}
//-------------------------------------------------
@@ -73,7 +71,7 @@ void iq151_grafik_device::device_reset()
if (screen->visible_area().max_x < 64*8-1)
screen->set_visible_area(0, 64*8-1, 0, 32*8-1);
- memset(m_videoram, 0x00, 0x4000);
+ memset(m_videoram, 0x00, sizeof(m_videoram));
}
//-------------------------------------------------
diff --git a/src/emu/bus/iq151/grafik.h b/src/emu/bus/iq151/grafik.h
index ba38741d360..c93c534e72d 100644
--- a/src/emu/bus/iq151/grafik.h
+++ b/src/emu/bus/iq151/grafik.h
@@ -45,7 +45,6 @@ private:
required_device<i8255_device> m_ppi8255;
- UINT8 * m_videoram;
UINT8 m_posx; // horizontal position
UINT8 m_posy; // vertical position
UINT8 m_all; // 0: bit mode 1: byte mode
@@ -54,6 +53,7 @@ private:
UINT8 m_ev; // enable video out
UINT8 m_ex;
UINT8 m_sel; // enable vram access
+ UINT8 m_videoram[0x4000];
};
diff --git a/src/emu/bus/nubus/nubus.c b/src/emu/bus/nubus/nubus.c
index 580304b726e..f37238fafe8 100644
--- a/src/emu/bus/nubus/nubus.c
+++ b/src/emu/bus/nubus/nubus.c
@@ -344,7 +344,6 @@ void device_nubus_card_interface::install_bank(offs_t start, offs_t end, offs_t
void device_nubus_card_interface::install_declaration_rom(device_t *dev, const char *romregion, bool mirror_all_mb, bool reverse_rom)
{
bool inverted = false;
- UINT8 *newrom = NULL;
astring tempstring;
UINT8 *rom = device().machine().root_device().memregion(dev->subtag(tempstring, romregion))->base();
@@ -384,75 +383,75 @@ void device_nubus_card_interface::install_declaration_rom(device_t *dev, const c
switch (byteLanes)
{
case 0x0f: // easy case: all 4 lanes (still must scramble for 32-bit BE bus though)
- newrom = auto_alloc_array_clear(device().machine(), UINT8, romlen);
+ m_declaration_rom.resize(romlen);
for (int i = 0; i < romlen; i++)
{
- newrom[BYTE4_XOR_BE(i)] = rom[i];
+ m_declaration_rom[BYTE4_XOR_BE(i)] = rom[i];
}
break;
case 0xe1: // lane 0 only
- newrom = auto_alloc_array_clear(device().machine(), UINT8, romlen*4);
+ m_declaration_rom.resize_and_clear(romlen*4);
for (int i = 0; i < romlen; i++)
{
- newrom[BYTE4_XOR_BE(i*4)] = rom[i];
+ m_declaration_rom[BYTE4_XOR_BE(i*4)] = rom[i];
}
romlen *= 4;
break;
case 0xd2: // lane 1 only
- newrom = auto_alloc_array_clear(device().machine(), UINT8, romlen*4);
+ m_declaration_rom.resize_and_clear(romlen*4);
for (int i = 0; i < romlen; i++)
{
- newrom[BYTE4_XOR_BE((i*4)+1)] = rom[i];
+ m_declaration_rom[BYTE4_XOR_BE((i*4)+1)] = rom[i];
}
romlen *= 4;
break;
case 0xb4: // lane 2 only
- newrom = auto_alloc_array_clear(device().machine(), UINT8, romlen*4);
+ m_declaration_rom.resize_and_clear(romlen*4);
for (int i = 0; i < romlen; i++)
{
- newrom[BYTE4_XOR_BE((i*4)+2)] = rom[i];
+ m_declaration_rom[BYTE4_XOR_BE((i*4)+2)] = rom[i];
}
romlen *= 4;
break;
case 0x78: // lane 3 only
- newrom = auto_alloc_array_clear(device().machine(), UINT8, romlen*4);
+ m_declaration_rom.resize_and_clear(romlen*4);
for (int i = 0; i < romlen; i++)
{
- newrom[BYTE4_XOR_BE((i*4)+3)] = rom[i];
+ m_declaration_rom[BYTE4_XOR_BE((i*4)+3)] = rom[i];
}
romlen *= 4;
break;
case 0xc3: // lanes 0, 1
- newrom = auto_alloc_array_clear(device().machine(), UINT8, romlen*2);
+ m_declaration_rom.resize_and_clear(romlen*2);
for (int i = 0; i < romlen/2; i++)
{
- newrom[BYTE4_XOR_BE((i*4)+0)] = rom[(i*2)];
- newrom[BYTE4_XOR_BE((i*4)+1)] = rom[(i*2)+1];
+ m_declaration_rom[BYTE4_XOR_BE((i*4)+0)] = rom[(i*2)];
+ m_declaration_rom[BYTE4_XOR_BE((i*4)+1)] = rom[(i*2)+1];
}
romlen *= 2;
break;
case 0xa5: // lanes 0, 2
- newrom = auto_alloc_array_clear(device().machine(), UINT8, romlen*2);
+ m_declaration_rom.resize_and_clear(romlen*2);
for (int i = 0; i < romlen/2; i++)
{
- newrom[BYTE4_XOR_BE((i*4)+0)] = rom[(i*2)];
- newrom[BYTE4_XOR_BE((i*4)+2)] = rom[(i*2)+1];
+ m_declaration_rom[BYTE4_XOR_BE((i*4)+0)] = rom[(i*2)];
+ m_declaration_rom[BYTE4_XOR_BE((i*4)+2)] = rom[(i*2)+1];
}
romlen *= 2;
break;
case 0x3c: // lanes 2,3
- newrom = auto_alloc_array_clear(device().machine(), UINT8, romlen*2);
+ m_declaration_rom.resize_and_clear(romlen*2);
for (int i = 0; i < romlen/2; i++)
{
- newrom[BYTE4_XOR_BE((i*4)+2)] = rom[(i*2)];
- newrom[BYTE4_XOR_BE((i*4)+3)] = rom[(i*2)+1];
+ m_declaration_rom[BYTE4_XOR_BE((i*4)+2)] = rom[(i*2)];
+ m_declaration_rom[BYTE4_XOR_BE((i*4)+3)] = rom[(i*2)+1];
}
romlen *= 2;
break;
@@ -467,7 +466,7 @@ void device_nubus_card_interface::install_declaration_rom(device_t *dev, const c
{
for (int i = 0; i < romlen; i++)
{
- newrom[i] ^= 0xff;
+ m_declaration_rom[i] ^= 0xff;
}
}
@@ -480,10 +479,10 @@ void device_nubus_card_interface::install_declaration_rom(device_t *dev, const c
// printf("Installing ROM at %x, length %x\n", addr, romlen);
if (mirror_all_mb) // mirror the declaration ROM across all 16 megs of the slot space
{
- m_nubus->install_bank(addr, addr+romlen-1, 0, 0x00f00000, bankname, newrom);
+ m_nubus->install_bank(addr, addr+romlen-1, 0, 0x00f00000, bankname, m_declaration_rom);
}
else
{
- m_nubus->install_bank(addr, addr+romlen-1, 0, 0, bankname, newrom);
+ m_nubus->install_bank(addr, addr+romlen-1, 0, 0, bankname, m_declaration_rom);
}
}
diff --git a/src/emu/bus/nubus/nubus.h b/src/emu/bus/nubus/nubus.h
index d89eed80b79..5694048814b 100644
--- a/src/emu/bus/nubus/nubus.h
+++ b/src/emu/bus/nubus/nubus.h
@@ -160,6 +160,7 @@ public:
const char *m_nubus_tag, *m_nubus_slottag;
int m_slot;
device_nubus_card_interface *m_next;
+ dynamic_buffer m_declaration_rom;
};
#endif /* __NUBUS_H__ */
diff --git a/src/emu/bus/nubus/nubus_48gc.c b/src/emu/bus/nubus/nubus_48gc.c
index ac5819ee472..6ed43c99d1d 100644
--- a/src/emu/bus/nubus/nubus_48gc.c
+++ b/src/emu/bus/nubus/nubus_48gc.c
@@ -9,11 +9,11 @@
#include "emu.h"
#include "nubus_48gc.h"
+#define VRAM_SIZE (0x200000) // 2 megs, maxed out
+
#define GC48_SCREEN_NAME "48gc_screen"
#define GC48_ROM_REGION "48gc_rom"
-#define VRAM_SIZE (0x200000) // 2 megs, maxed out
-
MACHINE_CONFIG_FRAGMENT( macvideo_48gc )
MCFG_SCREEN_ADD( GC48_SCREEN_NAME, RASTER)
MCFG_SCREEN_UPDATE_DEVICE(DEVICE_SELF, jmfb_device, screen_update)
@@ -111,7 +111,7 @@ void jmfb_device::device_start()
// printf("[JMFB %p] slotspace = %x\n", this, slotspace);
- m_vram = auto_alloc_array(machine(), UINT8, VRAM_SIZE);
+ m_vram.resize(VRAM_SIZE);
install_bank(slotspace, slotspace+VRAM_SIZE-1, 0, 0, "bank_48gc", m_vram);
m_nubus->install_device(slotspace+0x200000, slotspace+0x2003ff, read32_delegate(FUNC(jmfb_device::mac_48gc_r), this), write32_delegate(FUNC(jmfb_device::mac_48gc_w), this));
diff --git a/src/emu/bus/nubus/nubus_48gc.h b/src/emu/bus/nubus/nubus_48gc.h
index dc2f6a19594..b22c79b98f4 100644
--- a/src/emu/bus/nubus/nubus_48gc.h
+++ b/src/emu/bus/nubus/nubus_48gc.h
@@ -39,7 +39,7 @@ protected:
DECLARE_WRITE32_MEMBER(mac_48gc_w);
public:
- UINT8 *m_vram;
+ dynamic_buffer m_vram;
UINT32 m_mode, m_vbl_disable, m_toggle, m_stride, m_base;
UINT32 m_palette[256], m_colors[3], m_count, m_clutoffs;
UINT32 m_registers[0x100];
diff --git a/src/emu/bus/nubus/nubus_cb264.c b/src/emu/bus/nubus/nubus_cb264.c
index 2128cc9b344..c07d90c43c3 100644
--- a/src/emu/bus/nubus/nubus_cb264.c
+++ b/src/emu/bus/nubus/nubus_cb264.c
@@ -95,7 +95,7 @@ void nubus_cb264_device::device_start()
// printf("[cb264 %p] slotspace = %x\n", this, slotspace);
- m_vram = auto_alloc_array(machine(), UINT8, VRAM_SIZE);
+ m_vram.resize(VRAM_SIZE);
install_bank(slotspace, slotspace+VRAM_SIZE-1, 0, 0, "bank_cb264", m_vram);
m_nubus->install_device(slotspace+0xff6000, slotspace+0xff60ff, read32_delegate(FUNC(nubus_cb264_device::cb264_r), this), write32_delegate(FUNC(nubus_cb264_device::cb264_w), this));
@@ -203,7 +203,7 @@ UINT32 nubus_cb264_device::screen_update(screen_device &screen, bitmap_rgb32 &bi
case 4: // 24 bpp
case 7: // ???
{
- UINT32 *vram32 = (UINT32 *)m_vram;
+ UINT32 *vram32 = (UINT32 *)&m_vram[0];
for (y = 0; y < 480; y++)
{
diff --git a/src/emu/bus/nubus/nubus_cb264.h b/src/emu/bus/nubus/nubus_cb264.h
index a2c306346ed..8964b6a104f 100644
--- a/src/emu/bus/nubus/nubus_cb264.h
+++ b/src/emu/bus/nubus/nubus_cb264.h
@@ -37,7 +37,7 @@ protected:
DECLARE_WRITE32_MEMBER(cb264_ramdac_w);
public:
- UINT8 *m_vram;
+ dynamic_buffer m_vram;
UINT32 m_cb264_mode, m_cb264_vbl_disable, m_cb264_toggle;
UINT32 m_palette[256], m_colors[3], m_count, m_clutoffs;
};
diff --git a/src/emu/bus/nubus/nubus_m2hires.c b/src/emu/bus/nubus/nubus_m2hires.c
index 284b878c109..d0cf172e5f0 100644
--- a/src/emu/bus/nubus/nubus_m2hires.c
+++ b/src/emu/bus/nubus/nubus_m2hires.c
@@ -97,8 +97,8 @@ void nubus_m2hires_device::device_start()
// printf("[m2hires %p] slotspace = %x\n", this, slotspace);
- m_vram = auto_alloc_array(machine(), UINT8, VRAM_SIZE);
- m_vram32 = (UINT32 *)m_vram;
+ m_vram.resize(VRAM_SIZE);
+ m_vram32 = (UINT32 *)&m_vram[0];
m_nubus->install_device(slotspace, slotspace+VRAM_SIZE-1, read32_delegate(FUNC(nubus_m2hires_device::vram_r), this), write32_delegate(FUNC(nubus_m2hires_device::vram_w), this));
m_nubus->install_device(slotspace+0x900000, slotspace+VRAM_SIZE-1+0x900000, read32_delegate(FUNC(nubus_m2hires_device::vram_r), this), write32_delegate(FUNC(nubus_m2hires_device::vram_w), this));
diff --git a/src/emu/bus/nubus/nubus_m2hires.h b/src/emu/bus/nubus/nubus_m2hires.h
index 03bac4569f6..ef389eff2b8 100644
--- a/src/emu/bus/nubus/nubus_m2hires.h
+++ b/src/emu/bus/nubus/nubus_m2hires.h
@@ -39,7 +39,7 @@ protected:
DECLARE_WRITE32_MEMBER(vram_w);
public:
- UINT8 *m_vram;
+ dynamic_buffer m_vram;
UINT32 *m_vram32;
UINT32 m_mode, m_vbl_disable, m_toggle;
UINT32 m_palette[256], m_colors[3], m_count, m_clutoffs;
diff --git a/src/emu/bus/nubus/nubus_m2video.c b/src/emu/bus/nubus/nubus_m2video.c
index 1b69cbac6e6..d911fb4fc1f 100644
--- a/src/emu/bus/nubus/nubus_m2video.c
+++ b/src/emu/bus/nubus/nubus_m2video.c
@@ -98,8 +98,8 @@ void nubus_m2video_device::device_start()
// printf("[m2video %p] slotspace = %x\n", this, slotspace);
- m_vram = auto_alloc_array(machine(), UINT8, VRAM_SIZE);
- m_vram32 = (UINT32 *)m_vram;
+ m_vram.resize(VRAM_SIZE);
+ m_vram32 = (UINT32 *)&m_vram[0];
m_nubus->install_device(slotspace, slotspace+VRAM_SIZE-1, read32_delegate(FUNC(nubus_m2video_device::vram_r), this), write32_delegate(FUNC(nubus_m2video_device::vram_w), this));
m_nubus->install_device(slotspace+0x900000, slotspace+VRAM_SIZE-1+0x900000, read32_delegate(FUNC(nubus_m2video_device::vram_r), this), write32_delegate(FUNC(nubus_m2video_device::vram_w), this));
diff --git a/src/emu/bus/nubus/nubus_m2video.h b/src/emu/bus/nubus/nubus_m2video.h
index eacb9440bd0..228e6e229c7 100644
--- a/src/emu/bus/nubus/nubus_m2video.h
+++ b/src/emu/bus/nubus/nubus_m2video.h
@@ -39,7 +39,7 @@ protected:
DECLARE_WRITE32_MEMBER(vram_w);
public:
- UINT8 *m_vram;
+ dynamic_buffer m_vram;
UINT32 *m_vram32;
UINT32 m_mode, m_vbl_disable, m_toggle;
UINT32 m_palette[256], m_colors[3], m_count, m_clutoffs;
diff --git a/src/emu/bus/nubus/nubus_radiustpd.c b/src/emu/bus/nubus/nubus_radiustpd.c
index 9ddf1242106..878e6dc095c 100644
--- a/src/emu/bus/nubus/nubus_radiustpd.c
+++ b/src/emu/bus/nubus/nubus_radiustpd.c
@@ -97,8 +97,8 @@ void nubus_radiustpd_device::device_start()
printf("[radiustpd %p] slotspace = %x\n", this, slotspace);
- m_vram = auto_alloc_array(machine(), UINT8, VRAM_SIZE);
- m_vram32 = (UINT32 *)m_vram;
+ m_vram.resize(VRAM_SIZE);
+ m_vram32 = (UINT32 *)&m_vram[0];
m_nubus->install_device(slotspace, slotspace+VRAM_SIZE-1, read32_delegate(FUNC(nubus_radiustpd_device::vram_r), this), write32_delegate(FUNC(nubus_radiustpd_device::vram_w), this));
m_nubus->install_device(slotspace+0x900000, slotspace+VRAM_SIZE-1+0x900000, read32_delegate(FUNC(nubus_radiustpd_device::vram_r), this), write32_delegate(FUNC(nubus_radiustpd_device::vram_w), this));
diff --git a/src/emu/bus/nubus/nubus_radiustpd.h b/src/emu/bus/nubus/nubus_radiustpd.h
index 4abf60b3809..d25b4798b06 100644
--- a/src/emu/bus/nubus/nubus_radiustpd.h
+++ b/src/emu/bus/nubus/nubus_radiustpd.h
@@ -39,7 +39,7 @@ protected:
DECLARE_WRITE32_MEMBER(vram_w);
public:
- UINT8 *m_vram;
+ dynamic_buffer m_vram;
UINT32 *m_vram32;
UINT32 m_mode, m_vbl_disable, m_toggle;
UINT32 m_palette[256], m_colors[3], m_count, m_clutoffs;
diff --git a/src/emu/bus/nubus/nubus_spec8.c b/src/emu/bus/nubus/nubus_spec8.c
index e3cba7987d0..f9833437b5a 100644
--- a/src/emu/bus/nubus/nubus_spec8.c
+++ b/src/emu/bus/nubus/nubus_spec8.c
@@ -99,8 +99,8 @@ void nubus_spec8s3_device::device_start()
// printf("[SPEC8S3 %p] slotspace = %x\n", this, slotspace);
- m_vram = auto_alloc_array(machine(), UINT8, VRAM_SIZE);
- m_vram32 = (UINT32 *)m_vram;
+ m_vram.resize(VRAM_SIZE);
+ m_vram32 = (UINT32 *)&m_vram[0];
m_nubus->install_device(slotspace, slotspace+VRAM_SIZE-1, read32_delegate(FUNC(nubus_spec8s3_device::vram_r), this), write32_delegate(FUNC(nubus_spec8s3_device::vram_w), this));
m_nubus->install_device(slotspace+0x900000, slotspace+VRAM_SIZE-1+0x900000, read32_delegate(FUNC(nubus_spec8s3_device::vram_r), this), write32_delegate(FUNC(nubus_spec8s3_device::vram_w), this));
m_nubus->install_device(slotspace+0xd0000, slotspace+0xfffff, read32_delegate(FUNC(nubus_spec8s3_device::spec8s3_r), this), write32_delegate(FUNC(nubus_spec8s3_device::spec8s3_w), this));
diff --git a/src/emu/bus/nubus/nubus_spec8.h b/src/emu/bus/nubus/nubus_spec8.h
index 689532b6b1b..9af67b9bdd4 100644
--- a/src/emu/bus/nubus/nubus_spec8.h
+++ b/src/emu/bus/nubus/nubus_spec8.h
@@ -39,7 +39,7 @@ protected:
DECLARE_WRITE32_MEMBER(vram_w);
public:
- UINT8 *m_vram;
+ dynamic_buffer m_vram;
UINT32 *m_vram32;
UINT32 m_mode, m_vbl_disable;
UINT32 m_palette[256], m_colors[3], m_count, m_clutoffs;
diff --git a/src/emu/bus/nubus/nubus_specpdq.c b/src/emu/bus/nubus/nubus_specpdq.c
index d154f3133fa..71afcfa463a 100644
--- a/src/emu/bus/nubus/nubus_specpdq.c
+++ b/src/emu/bus/nubus/nubus_specpdq.c
@@ -112,8 +112,8 @@ void nubus_specpdq_device::device_start()
// printf("[specpdq %p] slotspace = %x\n", this, slotspace);
- m_vram = auto_alloc_array(machine(), UINT8, VRAM_SIZE);
- m_vram32 = (UINT32 *)m_vram;
+ m_vram.resize(VRAM_SIZE);
+ m_vram32 = (UINT32 *)&m_vram[0];
m_nubus->install_device(slotspace, slotspace+VRAM_SIZE-1, read32_delegate(FUNC(nubus_specpdq_device::vram_r), this), write32_delegate(FUNC(nubus_specpdq_device::vram_w), this));
m_nubus->install_device(slotspace+0x400000, slotspace+0xfbffff, read32_delegate(FUNC(nubus_specpdq_device::specpdq_r), this), write32_delegate(FUNC(nubus_specpdq_device::specpdq_w), this));
diff --git a/src/emu/bus/nubus/nubus_specpdq.h b/src/emu/bus/nubus/nubus_specpdq.h
index b9c080890ae..ff771177087 100644
--- a/src/emu/bus/nubus/nubus_specpdq.h
+++ b/src/emu/bus/nubus/nubus_specpdq.h
@@ -39,7 +39,7 @@ protected:
DECLARE_WRITE32_MEMBER(vram_w);
public:
- UINT8 *m_vram;
+ dynamic_buffer m_vram;
UINT32 *m_vram32;
UINT32 m_mode, m_vbl_disable;
UINT32 m_palette[256], m_colors[3], m_count, m_clutoffs;
diff --git a/src/emu/bus/nubus/nubus_vikbw.c b/src/emu/bus/nubus/nubus_vikbw.c
index 3d60508158b..1b2170b1ba3 100644
--- a/src/emu/bus/nubus/nubus_vikbw.c
+++ b/src/emu/bus/nubus/nubus_vikbw.c
@@ -91,7 +91,7 @@ void nubus_vikbw_device::device_start()
// printf("[vikbw %p] slotspace = %x\n", this, slotspace);
- m_vram = auto_alloc_array(machine(), UINT8, VRAM_SIZE);
+ m_vram.resize(VRAM_SIZE);
install_bank(slotspace+0x40000, slotspace+0x40000+VRAM_SIZE-1, 0, 0, "bank_vikbw", m_vram);
install_bank(slotspace+0x940000, slotspace+0x940000+VRAM_SIZE-1, 0, 0, "bank_vikbw2", m_vram);
diff --git a/src/emu/bus/nubus/nubus_vikbw.h b/src/emu/bus/nubus/nubus_vikbw.h
index 222210a2bc2..5e236cf7582 100644
--- a/src/emu/bus/nubus/nubus_vikbw.h
+++ b/src/emu/bus/nubus/nubus_vikbw.h
@@ -37,7 +37,7 @@ protected:
DECLARE_WRITE32_MEMBER(viking_disable_w);
public:
- UINT8 *m_vram;
+ dynamic_buffer m_vram;
UINT32 m_vbl_disable, m_palette[2];
};
diff --git a/src/emu/bus/nubus/nubus_wsportrait.c b/src/emu/bus/nubus/nubus_wsportrait.c
index aa5b619a546..f508328444b 100644
--- a/src/emu/bus/nubus/nubus_wsportrait.c
+++ b/src/emu/bus/nubus/nubus_wsportrait.c
@@ -100,8 +100,8 @@ void nubus_wsportrait_device::device_start()
printf("[wsportrait %p] slotspace = %x\n", this, slotspace);
- m_vram = auto_alloc_array(machine(), UINT8, VRAM_SIZE);
- m_vram32 = (UINT32 *)m_vram;
+ m_vram.resize(VRAM_SIZE);
+ m_vram32 = (UINT32 *)&m_vram[0];
m_nubus->install_device(slotspace, slotspace+VRAM_SIZE-1, read32_delegate(FUNC(nubus_wsportrait_device::vram_r), this), write32_delegate(FUNC(nubus_wsportrait_device::vram_w), this));
m_nubus->install_device(slotspace+0x900000, slotspace+0x900000+VRAM_SIZE-1, read32_delegate(FUNC(nubus_wsportrait_device::vram_r), this), write32_delegate(FUNC(nubus_wsportrait_device::vram_w), this));
diff --git a/src/emu/bus/nubus/nubus_wsportrait.h b/src/emu/bus/nubus/nubus_wsportrait.h
index 5a101a72763..16a675fb4fe 100644
--- a/src/emu/bus/nubus/nubus_wsportrait.h
+++ b/src/emu/bus/nubus/nubus_wsportrait.h
@@ -39,7 +39,7 @@ protected:
DECLARE_WRITE32_MEMBER(vram_w);
public:
- UINT8 *m_vram;
+ dynamic_buffer m_vram;
UINT32 *m_vram32;
UINT32 m_mode, m_vbl_disable, m_toggle;
UINT32 m_palette[256], m_colors[3], m_count, m_clutoffs;
diff --git a/src/emu/bus/nubus/pds30_30hr.c b/src/emu/bus/nubus/pds30_30hr.c
index f4fa47441f2..901a1a16fb4 100644
--- a/src/emu/bus/nubus/pds30_30hr.c
+++ b/src/emu/bus/nubus/pds30_30hr.c
@@ -100,8 +100,8 @@ void nubus_xceed30hr_device::device_start()
// printf("[xceed30hr %p] slotspace = %x\n", this, slotspace);
- m_vram = auto_alloc_array(machine(), UINT8, VRAM_SIZE);
- m_vram32 = (UINT32 *)m_vram;
+ m_vram.resize(VRAM_SIZE);
+ m_vram32 = (UINT32 *)&m_vram[0];
m_nubus->install_device(slotspace, slotspace+VRAM_SIZE-1, read32_delegate(FUNC(nubus_xceed30hr_device::vram_r), this), write32_delegate(FUNC(nubus_xceed30hr_device::vram_w), this));
m_nubus->install_device(slotspace+0x800000, slotspace+0xefffff, read32_delegate(FUNC(nubus_xceed30hr_device::xceed30hr_r), this), write32_delegate(FUNC(nubus_xceed30hr_device::xceed30hr_w), this));
diff --git a/src/emu/bus/nubus/pds30_30hr.h b/src/emu/bus/nubus/pds30_30hr.h
index 7234026d9ca..430a8e1249a 100644
--- a/src/emu/bus/nubus/pds30_30hr.h
+++ b/src/emu/bus/nubus/pds30_30hr.h
@@ -39,7 +39,7 @@ protected:
DECLARE_WRITE32_MEMBER(vram_w);
public:
- UINT8 *m_vram;
+ dynamic_buffer m_vram;
UINT32 *m_vram32;
UINT32 m_mode, m_vbl_disable, m_toggle;
UINT32 m_palette[256], m_colors[3], m_count, m_clutoffs;
diff --git a/src/emu/bus/nubus/pds30_cb264.c b/src/emu/bus/nubus/pds30_cb264.c
index baf21814889..2a20d9611ec 100644
--- a/src/emu/bus/nubus/pds30_cb264.c
+++ b/src/emu/bus/nubus/pds30_cb264.c
@@ -93,8 +93,8 @@ void nubus_cb264se30_device::device_start()
// printf("[cb264se30 %p] slotspace = %x\n", this, slotspace);
- m_vram = auto_alloc_array(machine(), UINT8, VRAM_SIZE);
- m_vram32 = (UINT32 *)m_vram;
+ m_vram.resize(VRAM_SIZE);
+ m_vram32 = (UINT32 *)&m_vram[0];
m_nubus->install_device(slotspace, slotspace+VRAM_SIZE-1, read32_delegate(FUNC(nubus_cb264se30_device::vram_r), this), write32_delegate(FUNC(nubus_cb264se30_device::vram_w), this));
m_nubus->install_device(slotspace+0xf00000, slotspace+0xfeffff, read32_delegate(FUNC(nubus_cb264se30_device::cb264se30_r), this), write32_delegate(FUNC(nubus_cb264se30_device::cb264se30_w), this));
@@ -213,7 +213,7 @@ UINT32 nubus_cb264se30_device::screen_update(screen_device &screen, bitmap_rgb32
case 4: // 24 bpp
{
- UINT32 *vram32 = (UINT32 *)m_vram;
+ UINT32 *vram32 = (UINT32 *)&m_vram[0];
UINT32 *base;
for (y = 0; y < 480; y++)
diff --git a/src/emu/bus/nubus/pds30_cb264.h b/src/emu/bus/nubus/pds30_cb264.h
index 35372ac39a7..bb315c629a7 100644
--- a/src/emu/bus/nubus/pds30_cb264.h
+++ b/src/emu/bus/nubus/pds30_cb264.h
@@ -39,7 +39,7 @@ protected:
DECLARE_WRITE32_MEMBER(vram_w);
public:
- UINT8 *m_vram;
+ dynamic_buffer m_vram;
UINT32 *m_vram32;
UINT32 m_mode, m_vbl_disable, m_toggle;
UINT32 m_palette[256], m_colors[3], m_count, m_clutoffs;
diff --git a/src/emu/bus/nubus/pds30_mc30.c b/src/emu/bus/nubus/pds30_mc30.c
index d42ab80d7fc..7b988fe4b3a 100644
--- a/src/emu/bus/nubus/pds30_mc30.c
+++ b/src/emu/bus/nubus/pds30_mc30.c
@@ -96,8 +96,8 @@ void nubus_xceedmc30_device::device_start()
// printf("[xceedmc30 %p] slotspace = %x\n", this, slotspace);
- m_vram = auto_alloc_array(machine(), UINT8, VRAM_SIZE);
- m_vram32 = (UINT32 *)m_vram;
+ m_vram.resize(VRAM_SIZE);
+ m_vram32 = (UINT32 *)&m_vram[0];
m_nubus->install_device(slotspace, slotspace+VRAM_SIZE-1, read32_delegate(FUNC(nubus_xceedmc30_device::vram_r), this), write32_delegate(FUNC(nubus_xceedmc30_device::vram_w), this));
m_nubus->install_device(slotspace+0x800000, slotspace+0xefffff, read32_delegate(FUNC(nubus_xceedmc30_device::xceedmc30_r), this), write32_delegate(FUNC(nubus_xceedmc30_device::xceedmc30_w), this));
diff --git a/src/emu/bus/nubus/pds30_mc30.h b/src/emu/bus/nubus/pds30_mc30.h
index ad96bf88ee7..f5dd7999c3b 100644
--- a/src/emu/bus/nubus/pds30_mc30.h
+++ b/src/emu/bus/nubus/pds30_mc30.h
@@ -39,7 +39,7 @@ protected:
DECLARE_WRITE32_MEMBER(vram_w);
public:
- UINT8 *m_vram;
+ dynamic_buffer m_vram;
UINT32 *m_vram32;
UINT32 m_mode, m_vbl_disable, m_toggle;
UINT32 m_palette[256], m_colors[3], m_count, m_clutoffs;
diff --git a/src/emu/bus/nubus/pds30_procolor816.c b/src/emu/bus/nubus/pds30_procolor816.c
index 0e2238e8bcc..dc38154082f 100644
--- a/src/emu/bus/nubus/pds30_procolor816.c
+++ b/src/emu/bus/nubus/pds30_procolor816.c
@@ -99,8 +99,8 @@ void nubus_procolor816_device::device_start()
// printf("[procolor816 %p] slotspace = %x\n", this, slotspace);
- m_vram = auto_alloc_array(machine(), UINT8, VRAM_SIZE);
- m_vram32 = (UINT32 *)m_vram;
+ m_vram.resize(VRAM_SIZE);
+ m_vram32 = (UINT32 *)&m_vram[0];
m_nubus->install_device(slotspace, slotspace+VRAM_SIZE-1, read32_delegate(FUNC(nubus_procolor816_device::vram_r), this), write32_delegate(FUNC(nubus_procolor816_device::vram_w), this));
m_nubus->install_device(slotspace+0x900000, slotspace+VRAM_SIZE-1+0x900000, read32_delegate(FUNC(nubus_procolor816_device::vram_r), this), write32_delegate(FUNC(nubus_procolor816_device::vram_w), this));
@@ -220,7 +220,7 @@ UINT32 nubus_procolor816_device::screen_update(screen_device &screen, bitmap_rgb
case 4: // 15 bpp
{
- UINT16 *vram16 = (UINT16 *)m_vram;
+ UINT16 *vram16 = (UINT16 *)&m_vram[0];
UINT16 pixels;
for (y = 0; y < 480; y++)
diff --git a/src/emu/bus/nubus/pds30_procolor816.h b/src/emu/bus/nubus/pds30_procolor816.h
index a87fb637a5c..c8d39cf82fd 100644
--- a/src/emu/bus/nubus/pds30_procolor816.h
+++ b/src/emu/bus/nubus/pds30_procolor816.h
@@ -39,7 +39,7 @@ protected:
DECLARE_WRITE32_MEMBER(vram_w);
public:
- UINT8 *m_vram;
+ dynamic_buffer m_vram;
UINT32 *m_vram32;
UINT32 m_mode, m_vbl_disable, m_toggle;
UINT32 m_palette[256], m_colors[3], m_count, m_clutoffs;
diff --git a/src/emu/bus/nubus/pds30_sigmalview.c b/src/emu/bus/nubus/pds30_sigmalview.c
index 5939a5f11c6..838ee488e6d 100644
--- a/src/emu/bus/nubus/pds30_sigmalview.c
+++ b/src/emu/bus/nubus/pds30_sigmalview.c
@@ -93,8 +93,8 @@ void nubus_lview_device::device_start()
// printf("[lview %p] slotspace = %x\n", this, slotspace);
- m_vram = auto_alloc_array(machine(), UINT8, VRAM_SIZE);
- m_vram32 = (UINT32 *)m_vram;
+ m_vram.resize(VRAM_SIZE);
+ m_vram32 = (UINT32 *)&m_vram[0];
m_nubus->install_device(slotspace, slotspace+VRAM_SIZE-1, read32_delegate(FUNC(nubus_lview_device::vram_r), this), write32_delegate(FUNC(nubus_lview_device::vram_w), this));
m_nubus->install_device(slotspace+0x900000, slotspace+VRAM_SIZE-1+0x900000, read32_delegate(FUNC(nubus_lview_device::vram_r), this), write32_delegate(FUNC(nubus_lview_device::vram_w), this));
diff --git a/src/emu/bus/nubus/pds30_sigmalview.h b/src/emu/bus/nubus/pds30_sigmalview.h
index bdee695ad8c..13bc9b013f0 100644
--- a/src/emu/bus/nubus/pds30_sigmalview.h
+++ b/src/emu/bus/nubus/pds30_sigmalview.h
@@ -39,7 +39,7 @@ protected:
DECLARE_WRITE32_MEMBER(vram_w);
public:
- UINT8 *m_vram;
+ dynamic_buffer m_vram;
UINT32 *m_vram32;
UINT32 m_vbl_disable, m_toggle;
UINT32 m_palette[256];
diff --git a/src/emu/bus/vidbrain/exp.c b/src/emu/bus/vidbrain/exp.c
index 4334d23591b..43d98b4653c 100644
--- a/src/emu/bus/vidbrain/exp.c
+++ b/src/emu/bus/vidbrain/exp.c
@@ -63,9 +63,9 @@ device_videobrain_expansion_card_interface::~device_videobrain_expansion_card_in
UINT8* device_videobrain_expansion_card_interface::videobrain_rom_pointer(running_machine &machine, size_t size)
{
- if (m_rom == NULL)
+ if (m_rom.count() == 0)
{
- m_rom = auto_alloc_array(machine, UINT8, size);
+ m_rom.resize(size);
m_rom_mask = size - 1;
}
@@ -80,9 +80,9 @@ UINT8* device_videobrain_expansion_card_interface::videobrain_rom_pointer(runnin
UINT8* device_videobrain_expansion_card_interface::videobrain_ram_pointer(running_machine &machine, size_t size)
{
- if (m_ram == NULL)
+ if (m_ram.count() == 0)
{
- m_ram = auto_alloc_array(machine, UINT8, size);
+ m_ram.resize(size);
m_ram_mask = size - 1;
}
diff --git a/src/emu/bus/vidbrain/exp.h b/src/emu/bus/vidbrain/exp.h
index a80c3686438..018038350ec 100644
--- a/src/emu/bus/vidbrain/exp.h
+++ b/src/emu/bus/vidbrain/exp.h
@@ -161,8 +161,8 @@ protected:
videobrain_expansion_slot_device *m_slot;
- UINT8 *m_rom;
- UINT8 *m_ram;
+ dynamic_buffer m_rom;
+ dynamic_buffer m_ram;
size_t m_rom_mask;
size_t m_ram_mask;
diff --git a/src/emu/cpu/cubeqcpu/cubeqcpu.c b/src/emu/cpu/cubeqcpu/cubeqcpu.c
index 157a53218f3..d6344ee2ad2 100644
--- a/src/emu/cpu/cubeqcpu/cubeqcpu.c
+++ b/src/emu/cpu/cubeqcpu/cubeqcpu.c
@@ -172,9 +172,6 @@ void cquestsnd_cpu_device::device_start()
m_program = &space(AS_PROGRAM);
m_direct = &m_program->direct();
- /* Allocate RAM shared with 68000 */
- m_sram = auto_alloc_array(machine(), UINT16, 4096/2);
-
memset(m_ram, 0, sizeof(m_ram));
m_q = 0;
m_f = 0;
@@ -248,10 +245,6 @@ void cquestsnd_cpu_device::device_reset()
void cquestrot_cpu_device::device_start()
{
- /* Allocate RAM */
- m_dram = auto_alloc_array(machine(), UINT16, 16384); /* Shared with 68000 */
- m_sram = auto_alloc_array(machine(), UINT16, 2048); /* Private */
-
m_linedata_w.resolve_safe();
m_program = &space(AS_PROGRAM);
@@ -375,12 +368,6 @@ void cquestrot_cpu_device::state_string_export(const device_state_entry &entry,
void cquestlin_cpu_device::device_start()
{
- /* Allocate RAM */
- m_sram = auto_alloc_array(machine(), UINT16, 4096); /* Shared with rotate CPU */
- m_ptr_ram = auto_alloc_array(machine(), UINT8, 1024); /* Pointer RAM */
- m_e_stack = auto_alloc_array(machine(), UINT32, 32768); /* Stack DRAM: 32kx20 */
- m_o_stack = auto_alloc_array(machine(), UINT32, 32768); /* Stack DRAM: 32kx20 */
-
m_linedata_r.resolve_safe(0);
m_program = &space(AS_PROGRAM);
diff --git a/src/emu/cpu/cubeqcpu/cubeqcpu.h b/src/emu/cpu/cubeqcpu/cubeqcpu.h
index 2a2f46a4ff7..47bf5f00c87 100644
--- a/src/emu/cpu/cubeqcpu/cubeqcpu.h
+++ b/src/emu/cpu/cubeqcpu/cubeqcpu.h
@@ -185,7 +185,7 @@ private:
UINT16 m_dinlatch;
UINT16 m_ramwlatch;
- UINT16 *m_sram;
+ UINT16 m_sram[4096/2];
int m_prev_ipram;
int m_prev_ipwrt;
@@ -264,8 +264,8 @@ private:
UINT16 m_linedata;
UINT16 m_lineaddr;
- UINT16 *m_dram;
- UINT16 *m_sram;
+ UINT16 m_dram[16384]; /* Shared with 68000 */
+ UINT16 m_sram[2048]; /* Private */
UINT8 m_prev_dred;
UINT8 m_prev_dwrt;
@@ -357,10 +357,10 @@ private:
UINT32 m_clkcnt;
/* RAM */
- UINT16 *m_sram;
- UINT8 *m_ptr_ram;
- UINT32 *m_e_stack;
- UINT32 *m_o_stack;
+ UINT16 m_sram[4096]; /* Shared with rotate CPU */
+ UINT8 m_ptr_ram[1024]; /* Pointer RAM */
+ UINT32 m_e_stack[32768]; /* Stack DRAM: 32kx20 */
+ UINT32 m_o_stack[32768]; /* Stack DRAM: 32kx20 */
address_space *m_program;
direct_read_data *m_direct;
diff --git a/src/emu/cpu/drcfe.c b/src/emu/cpu/drcfe.c
index 2eaee820626..292c8212793 100644
--- a/src/emu/cpu/drcfe.c
+++ b/src/emu/cpu/drcfe.c
@@ -57,7 +57,7 @@ drc_frontend::drc_frontend(device_t &cpu, UINT32 window_start, UINT32 window_end
m_pageshift(m_cpudevice.space_config(AS_PROGRAM)->m_page_shift),
m_desc_live_list(cpu.machine().respool()),
m_desc_allocator(cpu.machine().respool()),
- m_desc_array(auto_alloc_array_clear(cpu.machine(), opcode_desc *, window_end + window_start + 2))
+ m_desc_array(window_end + window_start + 2, true)
{
}
@@ -70,9 +70,6 @@ drc_frontend::~drc_frontend()
{
// release any descriptions we've accumulated
release_descriptions();
-
- // free the description array
- auto_free(m_cpudevice.machine(), m_desc_array);
}
diff --git a/src/emu/cpu/drcfe.h b/src/emu/cpu/drcfe.h
index 08ecfc3fde2..24438ff4f61 100644
--- a/src/emu/cpu/drcfe.h
+++ b/src/emu/cpu/drcfe.h
@@ -157,7 +157,7 @@ private:
// opcode descriptor arrays
simple_list<opcode_desc> m_desc_live_list; // list of live descriptions
fixed_allocator<opcode_desc> m_desc_allocator; // fixed allocator for descriptions
- opcode_desc ** m_desc_array; // array of descriptions in PC order
+ dynamic_array<opcode_desc *> m_desc_array; // array of descriptions in PC order
};
diff --git a/src/emu/cpu/drcuml.c b/src/emu/cpu/drcuml.c
index 55235c6ef1d..42519ccd368 100644
--- a/src/emu/cpu/drcuml.c
+++ b/src/emu/cpu/drcuml.c
@@ -294,7 +294,7 @@ drcuml_block::drcuml_block(drcuml_state &drcuml, UINT32 maxinst)
m_next(NULL),
m_nextinst(0),
m_maxinst(maxinst * 3/2),
- m_inst(auto_alloc_array(drcuml.device().machine(), instruction, m_maxinst)),
+ m_inst(m_maxinst),
m_inuse(false)
{
}
@@ -306,8 +306,6 @@ drcuml_block::drcuml_block(drcuml_state &drcuml, UINT32 maxinst)
drcuml_block::~drcuml_block()
{
- // free the instruction list
- auto_free(m_drcuml.device().machine(), m_inst);
}
diff --git a/src/emu/cpu/drcuml.h b/src/emu/cpu/drcuml.h
index 1b366faa1d6..4699e6ab4f2 100644
--- a/src/emu/cpu/drcuml.h
+++ b/src/emu/cpu/drcuml.h
@@ -130,7 +130,7 @@ private:
drcuml_block * m_next; // pointer to next block
UINT32 m_nextinst; // next instruction to fill in the cache
UINT32 m_maxinst; // maximum number of instructions
- uml::instruction * m_inst; // pointer to the instruction list
+ dynamic_array<uml::instruction> m_inst; // pointer to the instruction list
bool m_inuse; // this block is in use
};
diff --git a/src/emu/cpu/esrip/esrip.c b/src/emu/cpu/esrip/esrip.c
index 87b670680ce..7653df56956 100644
--- a/src/emu/cpu/esrip/esrip.c
+++ b/src/emu/cpu/esrip/esrip.c
@@ -187,7 +187,7 @@ void esrip_device::device_start()
m_draw = _config->draw;
/* Allocate image pointer table RAM */
- m_ipt_ram = auto_alloc_array(machine(), UINT16, IPT_RAM_SIZE/2);
+ m_ipt_ram.resize(IPT_RAM_SIZE/2);
m_program = &space(AS_PROGRAM);
m_direct = &m_program->direct();
@@ -291,7 +291,7 @@ void esrip_device::device_start()
save_item(NAME(m_ipt_cnt));
save_item(NAME(m_fig));
save_item(NAME(m_fig_cycles));
- save_pointer(NAME(m_ipt_ram), IPT_RAM_SIZE / sizeof(UINT16));
+ save_item(NAME(m_ipt_ram));
// set our instruction counter
m_icountptr = &m_icount;
diff --git a/src/emu/cpu/esrip/esrip.h b/src/emu/cpu/esrip/esrip.h
index 296ccf7f803..591bf56708f 100644
--- a/src/emu/cpu/esrip/esrip.h
+++ b/src/emu/cpu/esrip/esrip.h
@@ -195,7 +195,7 @@ protected:
UINT8 m_optable[65536];
- UINT16 *m_ipt_ram;
+ dynamic_array<UINT16> m_ipt_ram;
UINT8 *m_lbrm;
address_space *m_program;
diff --git a/src/emu/cpu/lc8670/lc8670.c b/src/emu/cpu/lc8670/lc8670.c
index fda45f1f6b6..c12fbed0eac 100644
--- a/src/emu/cpu/lc8670/lc8670.c
+++ b/src/emu/cpu/lc8670/lc8670.c
@@ -204,12 +204,6 @@ void lc8670_cpu_device::device_start()
m_basetimer->adjust(attotime::from_hz(m_clocks[LC8670_SUB_CLOCK]), 0, attotime::from_hz(m_clocks[LC8670_SUB_CLOCK]));
m_clocktimer = timer_alloc(CLOCK_TIMER);
- // alloc internal RAM
- m_sfr = auto_alloc_array(machine(), UINT8, 0x80);
- m_mram = auto_alloc_array(machine(), UINT8, 0x200);
- m_xram = auto_alloc_array(machine(), UINT8, 0xc6);
- m_vtrbf = auto_alloc_array(machine(), UINT8, 0x200);
-
// register state for debugger
state_add(LC8670_PC , "PC" , m_pc).callimport().callexport().formatstr("%04X");
state_add(LC8670_SFR + 0x00, "A" , REG_A ).callimport().callexport().formatstr("%02X");
diff --git a/src/emu/cpu/lc8670/lc8670.h b/src/emu/cpu/lc8670/lc8670.h
index 8a2f40787a0..5c67c8853ec 100644
--- a/src/emu/cpu/lc8670/lc8670.h
+++ b/src/emu/cpu/lc8670/lc8670.h
@@ -215,10 +215,10 @@ private:
UINT16 m_pc;
UINT16 m_ppc;
UINT8 m_op;
- UINT8 * m_sfr; // special function registers
- UINT8 * m_mram; // main RAM
- UINT8 * m_xram; // XRAM
- UINT8 * m_vtrbf; // work RAM
+ UINT8 m_sfr[0x80]; // special function registers
+ UINT8 m_mram[0x200]; // main RAM
+ UINT8 m_xram[0xc6]; // XRAM
+ UINT8 m_vtrbf[0x200]; // work RAM
UINT16 m_irq_flag;
UINT8 m_irq_lev;
bool m_after_reti;
diff --git a/src/emu/cpu/mc68hc11/mc68hc11.c b/src/emu/cpu/mc68hc11/mc68hc11.c
index abb3ebc1bc4..00ea42f7f73 100644
--- a/src/emu/cpu/mc68hc11/mc68hc11.c
+++ b/src/emu/cpu/mc68hc11/mc68hc11.c
@@ -387,7 +387,7 @@ void mc68hc11_cpu_device::device_start()
}
}
- m_internal_ram = auto_alloc_array(machine(), UINT8, m_internal_ram_size);
+ m_internal_ram.resize(m_internal_ram_size);
m_program = &space(AS_PROGRAM);
m_direct = &m_program->direct();
@@ -410,7 +410,7 @@ void mc68hc11_cpu_device::device_start()
save_item(NAME(m_has_extended_io));
save_item(NAME(m_internal_ram_size));
save_item(NAME(m_init_value));
- save_pointer(NAME(m_internal_ram),m_internal_ram_size);
+ save_item(NAME(m_internal_ram));
save_item(NAME(m_wait_state));
save_item(NAME(m_stop_state));
save_item(NAME(m_tflg1));
diff --git a/src/emu/cpu/mc68hc11/mc68hc11.h b/src/emu/cpu/mc68hc11/mc68hc11.h
index b2a377b17e1..bf220a0262b 100644
--- a/src/emu/cpu/mc68hc11/mc68hc11.h
+++ b/src/emu/cpu/mc68hc11/mc68hc11.h
@@ -110,7 +110,7 @@ private:
int m_ram_position;
int m_reg_position;
- UINT8 *m_internal_ram;
+ dynamic_buffer m_internal_ram;
int m_has_extended_io; // extended I/O enable flag
int m_internal_ram_size;
diff --git a/src/emu/cpu/mips/r3000.c b/src/emu/cpu/mips/r3000.c
index 726bbca60f9..486e29fd0a6 100644
--- a/src/emu/cpu/mips/r3000.c
+++ b/src/emu/cpu/mips/r3000.c
@@ -254,8 +254,8 @@ void r3000_device::device_start()
}
// allocate cache memory
- m_icache = auto_alloc_array(machine(), UINT32, m_icache_size/4);
- m_dcache = auto_alloc_array(machine(), UINT32, m_dcache_size/4);
+ m_icache.resize(m_icache_size/4);
+ m_dcache.resize(m_dcache_size/4);
m_cache = m_dcache;
m_cache_size = m_dcache_size;
@@ -354,8 +354,8 @@ void r3000_device::device_start()
save_item(NAME(m_ppc));
save_item(NAME(m_op));
save_item(NAME(m_interrupt_cycles));
- save_pointer(NAME(m_icache), m_icache_size/4);
- save_pointer(NAME(m_dcache), m_dcache_size/4);
+ save_item(NAME(m_icache));
+ save_item(NAME(m_dcache));
}
diff --git a/src/emu/cpu/mips/r3000.h b/src/emu/cpu/mips/r3000.h
index 5bdce4dcaf9..83819ace935 100644
--- a/src/emu/cpu/mips/r3000.h
+++ b/src/emu/cpu/mips/r3000.h
@@ -249,8 +249,8 @@ protected:
// cache memory
UINT32 * m_cache;
- UINT32 * m_icache;
- UINT32 * m_dcache;
+ dynamic_array<UINT32> m_icache;
+ dynamic_array<UINT32> m_dcache;
size_t m_cache_size;
size_t m_icache_size;
size_t m_dcache_size;
diff --git a/src/emu/cpu/sh2/sh2.c b/src/emu/cpu/sh2/sh2.c
index 05894a53c4c..c1b61d22c09 100644
--- a/src/emu/cpu/sh2/sh2.c
+++ b/src/emu/cpu/sh2/sh2.c
@@ -2170,8 +2170,6 @@ INLINE void op1111(sh2_state *sh2, UINT16 opcode)
static CPU_RESET( sh2 )
{
sh2_state *sh2 = get_safe_token(device);
- emu_timer *tsave, *tsaved0, *tsaved1;
- UINT32 *m;
int (*dma_callback_kludge)(device_t *device, UINT32 src, UINT32 dst, UINT32 data, int size);
int (*dma_callback_fifo_data_available)(device_t *device, UINT32 src, UINT32 dst, UINT32 data, int size);
int save_is_slave;
@@ -2179,11 +2177,6 @@ static CPU_RESET( sh2 )
void (*f)(UINT32 data);
device_irq_acknowledge_callback save_irqcallback;
- m = sh2->m;
- tsave = sh2->timer;
- tsaved0 = sh2->dma_current_active_timer[0];
- tsaved1 = sh2->dma_current_active_timer[1];
-
f = sh2->ftcsr_read_callback;
save_irqcallback = sh2->irq_callback;
save_is_slave = sh2->is_slave;
@@ -2210,10 +2203,6 @@ static CPU_RESET( sh2 )
sh2->irq_callback = save_irqcallback;
sh2->device = device;
- sh2->timer = tsave;
- sh2->dma_current_active_timer[0] = tsaved0;
- sh2->dma_current_active_timer[1] = tsaved1;
- sh2->m = m;
memset(sh2->m, 0, 0x200);
sh2->pc = RL(sh2, 0);
diff --git a/src/emu/cpu/sh2/sh2comn.c b/src/emu/cpu/sh2/sh2comn.c
index 8f66e5d78b0..661b163543c 100644
--- a/src/emu/cpu/sh2/sh2comn.c
+++ b/src/emu/cpu/sh2/sh2comn.c
@@ -1007,9 +1007,6 @@ void sh2_common_init(sh2_state *sh2, legacy_cpu_device *device, device_irq_ackno
sh2->dma_current_active_timer[1] = device->machine().scheduler().timer_alloc(FUNC(sh2_dma_current_active_callback), sh2);
sh2->dma_current_active_timer[1]->adjust(attotime::never);
-
- sh2->m = auto_alloc_array(device->machine(), UINT32, 0x200/4);
-
if(conf)
{
sh2->is_slave = conf->is_slave;
diff --git a/src/emu/cpu/sh2/sh2comn.h b/src/emu/cpu/sh2/sh2comn.h
index 6a1218ae2b5..813b5685abf 100644
--- a/src/emu/cpu/sh2/sh2comn.h
+++ b/src/emu/cpu/sh2/sh2comn.h
@@ -130,7 +130,7 @@ struct sh2_state
address_space *program;
direct_read_data *direct;
address_space *internal;
- UINT32 *m;
+ UINT32 m[0x200/4];
INT8 nmi_line_state;
UINT16 frc;
diff --git a/src/emu/cpu/sh2/sh2drc.c b/src/emu/cpu/sh2/sh2drc.c
index b5f6092f624..d4a6c5b577b 100644
--- a/src/emu/cpu/sh2/sh2drc.c
+++ b/src/emu/cpu/sh2/sh2drc.c
@@ -748,17 +748,10 @@ static CPU_EXIT( sh2 )
static CPU_RESET( sh2 )
{
sh2_state *sh2 = get_safe_token(device);
- emu_timer *tsave, *tsaved0, *tsaved1;
- UINT32 *m;
void (*f)(UINT32 data);
device_irq_acknowledge_callback save_irqcallback;
- m = sh2->m;
- tsave = sh2->timer;
- tsaved0 = sh2->dma_current_active_timer[0];
- tsaved1 = sh2->dma_current_active_timer[1];
-
f = sh2->ftcsr_read_callback;
save_irqcallback = sh2->irq_callback;
@@ -779,10 +772,6 @@ static CPU_RESET( sh2 )
sh2->irq_callback = save_irqcallback;
sh2->device = device;
- sh2->timer = tsave;
- sh2->dma_current_active_timer[0] = tsaved0;
- sh2->dma_current_active_timer[1] = tsaved1;
- sh2->m = m;
memset(sh2->m, 0, 0x200);
sh2->pc = sh2->program->read_dword(0);
diff --git a/src/emu/cpu/sh4/sh4.c b/src/emu/cpu/sh4/sh4.c
index 8526dd23c9f..0aa6438d9f5 100644
--- a/src/emu/cpu/sh4/sh4.c
+++ b/src/emu/cpu/sh4/sh4.c
@@ -2842,14 +2842,12 @@ static CPU_RESET( common_sh4_reset )
sh4_state *sh4 = get_safe_token(device);
emu_timer *tsaved[4];
emu_timer *tsave[5];
- UINT32 *m;
int save_is_slave;
int savecpu_clock, savebus_clock, savepm_clock;
void (*f)(UINT32 data);
device_irq_acknowledge_callback save_irqcallback;
- m = sh4->m;
tsaved[0] = sh4->dma_timer[0];
tsaved[1] = sh4->dma_timer[1];
tsaved[2] = sh4->dma_timer[2];
@@ -2888,7 +2886,6 @@ static CPU_RESET( common_sh4_reset )
sh4->timer[0] = tsave[2];
sh4->timer[1] = tsave[3];
sh4->timer[2] = tsave[4];
- sh4->m = m;
memset(sh4->m, 0, 16384*4);
sh4_default_exception_priorities(sh4);
memset(sh4->exception_requesting, 0, sizeof(sh4->exception_requesting));
diff --git a/src/emu/cpu/sh4/sh4comn.c b/src/emu/cpu/sh4/sh4comn.c
index 27570afd351..9dcbad7fc76 100644
--- a/src/emu/cpu/sh4/sh4comn.c
+++ b/src/emu/cpu/sh4/sh4comn.c
@@ -1218,8 +1218,6 @@ void sh4_common_init(device_t *device)
sh4->rtc_timer = device->machine().scheduler().timer_alloc(FUNC(sh4_rtc_timer_callback), sh4);
sh4->rtc_timer->adjust(attotime::never);
-
- sh4->m = auto_alloc_array(device->machine(), UINT32, 16384);
}
UINT32 sh4_getsqremap(sh4_state *sh4, UINT32 address)
diff --git a/src/emu/cpu/sh4/sh4comn.h b/src/emu/cpu/sh4/sh4comn.h
index a0f76f38239..30eb54448fd 100644
--- a/src/emu/cpu/sh4/sh4comn.h
+++ b/src/emu/cpu/sh4/sh4comn.h
@@ -80,7 +80,7 @@ struct sh4_state
address_space *io;
// sh4 internal
- UINT32 *m;
+ UINT32 m[16384];
// timer regs handled manually for reuse
UINT32 SH4_TSTR;
@@ -125,10 +125,6 @@ struct sh4_state
UINT32 SH4_DMAOR;
- // sh3 internal
- UINT32 m_sh3internal_upper[0x3000/4];
- UINT32 m_sh3internal_lower[0x1000];
-
INT8 nmi_line_state;
UINT8 sleep_mode;
@@ -169,6 +165,10 @@ struct sh4_state
int cpu_type;
+ // sh3 internal
+ UINT32 m_sh3internal_upper[0x3000/4];
+ UINT32 m_sh3internal_lower[0x1000];
+
#ifdef USE_SH4DRC
int icount;
diff --git a/src/emu/cpu/sharc/sharc.c b/src/emu/cpu/sharc/sharc.c
index 3e68d1ce186..c290fba7d4a 100644
--- a/src/emu/cpu/sharc/sharc.c
+++ b/src/emu/cpu/sharc/sharc.c
@@ -287,7 +287,6 @@ void adsp21062_device::device_start()
build_opcode_table();
- m_internal_ram = auto_alloc_array(machine(), UINT16, 2 * 0x10000); // 2x 128KB
m_internal_ram_block0 = &m_internal_ram[0];
m_internal_ram_block1 = &m_internal_ram[0x20000/2];
diff --git a/src/emu/cpu/sharc/sharc.h b/src/emu/cpu/sharc/sharc.h
index c33b29e3bf5..058fe9289c8 100644
--- a/src/emu/cpu/sharc/sharc.h
+++ b/src/emu/cpu/sharc/sharc.h
@@ -176,7 +176,6 @@ private:
UINT64 m_px;
- UINT16 *m_internal_ram;
UINT16 *m_internal_ram_block0, *m_internal_ram_block1;
address_space *m_program;
@@ -213,6 +212,8 @@ private:
UINT32 m_astat_old_old;
UINT32 m_astat_old_old_old;
+ UINT16 m_internal_ram[2 * 0x10000]; // 2x 128KB
+
inline void CHANGE_PC(UINT32 newpc);
inline void CHANGE_PC_DELAYED(UINT32 newpc);
void sharc_iop_delayed_w(UINT32 reg, UINT32 data, int cycles);
diff --git a/src/emu/cpu/tms32082/tms32082.c b/src/emu/cpu/tms32082/tms32082.c
index b591f3fc6ac..3f19cc1465e 100644
--- a/src/emu/cpu/tms32082/tms32082.c
+++ b/src/emu/cpu/tms32082/tms32082.c
@@ -197,8 +197,6 @@ void tms32082_mp_device::device_start()
state_add(STATE_GENPC, "curpc", m_pc).noshow();
- m_param_ram = auto_alloc_array(machine(), UINT32, 0x800);
-
m_program = &space(AS_PROGRAM);
m_direct = &m_program->direct();
diff --git a/src/emu/cpu/tms32082/tms32082.h b/src/emu/cpu/tms32082/tms32082.h
index f791e52e157..633388c5573 100644
--- a/src/emu/cpu/tms32082/tms32082.h
+++ b/src/emu/cpu/tms32082/tms32082.h
@@ -125,7 +125,7 @@ protected:
UINT32 m_epc;
UINT32 m_eip;
- UINT32 *m_param_ram;
+ UINT32 m_param_ram[0x800];
int m_icount;
diff --git a/src/emu/cpu/tms34010/34010ops.h b/src/emu/cpu/tms34010/34010ops.h
index f7a32c320e0..a2453000588 100644
--- a/src/emu/cpu/tms34010/34010ops.h
+++ b/src/emu/cpu/tms34010/34010ops.h
@@ -13,9 +13,6 @@
#define __34010OPS_H__
-/* Size of the memory buffer allocated for the shiftr register */
-#define SHIFTREG_SIZE (8 * 512 * sizeof(UINT16))
-
/***************************************************************************
diff --git a/src/emu/cpu/tms34010/tms34010.c b/src/emu/cpu/tms34010/tms34010.c
index 06aa593bebb..81077435393 100644
--- a/src/emu/cpu/tms34010/tms34010.c
+++ b/src/emu/cpu/tms34010/tms34010.c
@@ -28,6 +28,9 @@
CORE STATE
***************************************************************************/
+/* Size of the memory buffer allocated for the shiftr register */
+#define SHIFTREG_SIZE (8 * 512 * sizeof(UINT16))
+
/* TMS34010 State */
struct XY
{
@@ -51,7 +54,6 @@ struct tms34010_state
UINT32 convsp;
UINT32 convdp;
UINT32 convmp;
- UINT16 * shiftreg;
INT32 gfxcycles;
UINT8 pixelshift;
UINT8 is_34020;
@@ -77,6 +79,7 @@ struct tms34010_state
} regs[31];
UINT16 IOregs[64];
+ UINT16 shiftreg[SHIFTREG_SIZE/2];
};
INLINE tms34010_state *get_safe_token(device_t *device)
@@ -649,13 +652,10 @@ static CPU_INIT( tms34010 )
tms->scantimer = device->machine().scheduler().timer_alloc(FUNC(scanline_callback), tms);
tms->scantimer->adjust(attotime::zero);
- /* allocate the shiftreg */
- tms->shiftreg = auto_alloc_array(device->machine(), UINT16, SHIFTREG_SIZE/2);
-
device->save_item(NAME(tms->pc));
device->save_item(NAME(tms->st));
device->save_item(NAME(tms->reset_deferred));
- device->save_pointer(NAME(tms->shiftreg), SHIFTREG_SIZE / 2);
+ device->save_item(NAME(tms->shiftreg));
device->save_item(NAME(tms->IOregs));
device->save_item(NAME(tms->convsp));
device->save_item(NAME(tms->convdp));
@@ -672,7 +672,6 @@ static CPU_RESET( tms34010 )
tms34010_state *tms = get_safe_token(device);
const tms34010_config *config = tms->config;
screen_device *screen = tms->screen;
- UINT16 *shiftreg = tms->shiftreg;
device_irq_acknowledge_callback save_irqcallback = tms->irq_callback;
emu_timer *save_scantimer = tms->scantimer;
@@ -680,7 +679,6 @@ static CPU_RESET( tms34010 )
tms->config = config;
tms->screen = screen;
- tms->shiftreg = shiftreg;
tms->irq_callback = save_irqcallback;
tms->scantimer = save_scantimer;
tms->device = device;
@@ -714,8 +712,6 @@ static CPU_RESET( tms34020 )
static CPU_EXIT( tms34010 )
{
- tms34010_state *tms = get_safe_token(device);
- tms->shiftreg = NULL;
}
diff --git a/src/emu/cpu/tms9900/tms9995.c b/src/emu/cpu/tms9900/tms9995.c
index 60e61cd7338..7cb8d7ed9c4 100644
--- a/src/emu/cpu/tms9900/tms9995.c
+++ b/src/emu/cpu/tms9900/tms9995.c
@@ -163,9 +163,6 @@ void tms9995_device::device_start()
assert (conf != NULL);
- // Allocate onchip memory
- m_onchip_memory = auto_alloc_array(machine(), UINT8, 256);
-
// TODO: Restore save state suport
m_prgspace = &space(AS_PROGRAM); // dimemory.h
diff --git a/src/emu/cpu/tms9900/tms9995.h b/src/emu/cpu/tms9900/tms9995.h
index 7b799df2e9b..bfb26cfb619 100644
--- a/src/emu/cpu/tms9900/tms9995.h
+++ b/src/emu/cpu/tms9900/tms9995.h
@@ -110,7 +110,7 @@ private:
UINT16 PC_debug;
// 256 bytes of onchip memory
- UINT8* m_onchip_memory;
+ UINT8 m_onchip_memory[256];
const address_space_config m_program_config;
const address_space_config m_io_config;
diff --git a/src/emu/cpu/vtlb.c b/src/emu/cpu/vtlb.c
index 7afc1de91ec..151d0b054ae 100644
--- a/src/emu/cpu/vtlb.c
+++ b/src/emu/cpu/vtlb.c
@@ -35,10 +35,9 @@ struct vtlb_state
int dynindex; /* index of next dynamic entry */
int pageshift; /* bits to shift to get page index */
int addrwidth; /* logical address bus width */
- offs_t * live; /* array of live entries by table index */
- int * fixedpages; /* number of pages each fixed entry covers */
- vtlb_entry * table; /* table of entries by address */
- vtlb_entry * save; /* cache of live table entries for saving */
+ dynamic_array<offs_t> live; /* array of live entries by table index */
+ dynamic_array<int> fixedpages; /* number of pages each fixed entry covers */
+ dynamic_array<vtlb_entry> table; /* table of entries by address */
};
@@ -74,18 +73,18 @@ vtlb_state *vtlb_alloc(device_t *cpu, address_spacenum space, int fixed_entries,
assert(vtlb->addrwidth > vtlb->pageshift);
/* allocate the entry array */
- vtlb->live = auto_alloc_array_clear(cpu->machine(), offs_t, fixed_entries + dynamic_entries);
- cpu->save_pointer(NAME(vtlb->live), fixed_entries + dynamic_entries, space);
+ vtlb->live.resize_and_clear(fixed_entries + dynamic_entries);
+ cpu->save_item(NAME(vtlb->live));
/* allocate the lookup table */
- vtlb->table = auto_alloc_array_clear(cpu->machine(), vtlb_entry, (size_t) 1 << (vtlb->addrwidth - vtlb->pageshift));
- cpu->save_pointer(NAME(vtlb->table), 1 << (vtlb->addrwidth - vtlb->pageshift), space);
+ vtlb->table.resize_and_clear((size_t) 1 << (vtlb->addrwidth - vtlb->pageshift));
+ cpu->save_item(NAME(vtlb->table));
/* allocate the fixed page count array */
if (fixed_entries > 0)
{
- vtlb->fixedpages = auto_alloc_array_clear(cpu->machine(), int, fixed_entries);
- cpu->save_pointer(NAME(vtlb->fixedpages), fixed_entries, space);
+ vtlb->fixedpages.resize_and_clear(fixed_entries);
+ cpu->save_item(NAME(vtlb->fixedpages));
}
return vtlb;
}
diff --git a/src/lib/util/coretmpl.h b/src/lib/util/coretmpl.h
index 89a62d41adf..db8442c0e8d 100644
--- a/src/lib/util/coretmpl.h
+++ b/src/lib/util/coretmpl.h
@@ -30,10 +30,10 @@ private:
public:
// construction/destruction
- dynamic_array(int initial = 0)
+ dynamic_array(int initial = 0, bool clearit = false)
: m_array(NULL),
m_count(0),
- m_allocated(0) { if (initial != 0) expand_internal(initial); m_count = initial; }
+ m_allocated(0) { if (initial != 0) expand_internal(initial); m_count = initial; if (clearit) clear(); }
virtual ~dynamic_array() { reset(); }
// operators
@@ -46,9 +46,15 @@ public:
int count() const { return m_count; }
// helpers
- void append(const _ElementType &element) { if (m_count == m_allocated) expand_internal((m_allocated == 0) ? 16 : (m_allocated << 1), true); m_array[m_count++] = element; }
+ const _ElementType &append(const _ElementType &element) { if (m_count == m_allocated) expand_internal((m_allocated == 0) ? 16 : (m_allocated << 1), true); m_array[m_count++] = element; return element; }
void reset() { delete[] m_array; m_array = NULL; m_count = m_allocated = 0; }
void resize(int count, bool keepdata = false) { if (count > m_allocated) expand_internal(count, keepdata); m_count = count; }
+#ifdef __GNUC__
+ void clear() { assert(__is_pod(_ElementType)); memset(m_array, 0, m_count * sizeof(*m_array)); }
+#else
+ void clear() { memset(m_array, 0, m_count * sizeof(*m_array)); }
+#endif
+ void resize_and_clear(int count) { resize(count); clear(); }
private:
// internal helpers