auto_alloc_array_clear -> make_unique_clear (nw)

This commit is contained in:
Miodrag Milanovic 2015-12-19 11:06:06 +01:00
parent 4facaf6c24
commit 42adde9fd5
264 changed files with 1108 additions and 1102 deletions

View File

@ -61,7 +61,7 @@ void cpc_transtape_device::device_start()
m_cpu = static_cast<cpu_device*>(machine().device("maincpu"));
m_space = &m_cpu->space(AS_IO);
m_ram = auto_alloc_array_clear(machine(), UINT8, 0x2000);
m_ram = make_unique_clear<UINT8[]>(0x2000);
m_space->install_write_handler(0xfbf0,0xfbf0,0,0,write8_delegate(FUNC(cpc_transtape_device::output_w),this));
m_space->install_read_handler(0xfbff,0xfbff,0,0,read8_delegate(FUNC(cpc_transtape_device::input_r),this));
@ -88,10 +88,10 @@ void cpc_transtape_device::map_enable()
}
if(m_output & 0x01) // RAM enable
{
membank(":bank7")->set_base(m_ram);
membank(":bank15")->set_base(m_ram);
membank(":bank8")->set_base(m_ram); // repeats in second 8kB
membank(":bank16")->set_base(m_ram);
membank(":bank7")->set_base(m_ram.get());
membank(":bank15")->set_base(m_ram.get());
membank(":bank8")->set_base(m_ram.get()); // repeats in second 8kB
membank(":bank16")->set_base(m_ram.get());
}
}

View File

@ -41,7 +41,7 @@ private:
cpc_expansion_slot_device *m_slot;
cpu_device* m_cpu;
address_space* m_space;
UINT8* m_ram; // 8kB internal RAM
std::unique_ptr<UINT8[]> m_ram; // 8kB internal RAM
bool m_rom_active;
bool m_romen;
UINT8 m_output;

View File

@ -58,7 +58,7 @@ public:
virtual void device_reset() override;
public:
UINT32 m_size;
UINT8 *m_data;
std::unique_ptr<UINT8[]> m_data;
bool m_ejected;
};
@ -86,7 +86,7 @@ void messimg_disk_image_device::device_config_complete()
void messimg_disk_image_device::device_start()
{
m_data = (UINT8 *)nullptr;
m_data = nullptr;
if (exists() && fseek(0, SEEK_END) == 0)
{
@ -105,9 +105,9 @@ bool messimg_disk_image_device::call_load()
return IMAGE_INIT_FAIL;
}
m_data = (UINT8 *)auto_alloc_array_clear(machine(), UINT32, m_size/sizeof(UINT32));
m_data = make_unique_clear<UINT8[]>(m_size);
fseek(0, SEEK_SET);
fread(m_data, m_size);
fread(m_data.get(), m_size);
m_ejected = false;
return IMAGE_INIT_PASS;
@ -117,7 +117,7 @@ void messimg_disk_image_device::call_unload()
{
// TODO: track dirty sectors and only write those
fseek(0, SEEK_SET);
fwrite(m_data, m_size);
fwrite(m_data.get(), m_size);
m_size = 0;
//free(m_data);
}
@ -255,7 +255,7 @@ READ32_MEMBER( nubus_image_device::image_r )
WRITE32_MEMBER( nubus_image_device::image_super_w )
{
UINT32 *image = (UINT32*)m_image->m_data;
UINT32 *image = (UINT32*)m_image->m_data.get();
data = ((data & 0xff) << 24) | ((data & 0xff00) << 8) | ((data & 0xff0000) >> 8) | ((data & 0xff000000) >> 24);
mem_mask = ((mem_mask & 0xff) << 24) | ((mem_mask & 0xff00) << 8) | ((mem_mask & 0xff0000) >> 8) | ((mem_mask & 0xff000000) >> 24);
@ -264,7 +264,7 @@ WRITE32_MEMBER( nubus_image_device::image_super_w )
READ32_MEMBER( nubus_image_device::image_super_r )
{
UINT32 *image = (UINT32*)m_image->m_data;
UINT32 *image = (UINT32*)m_image->m_data.get();
UINT32 data = image[offset];
return ((data & 0xff) << 24) | ((data & 0xff00) << 8) | ((data & 0xff0000) >> 8) | ((data & 0xff000000) >> 24);
}

View File

@ -838,11 +838,9 @@ void alto2_cpu_device::exit_memory()
void alto2_cpu_device::reset_memory()
{
if (m_mem.ram) {
auto_free(machine(), m_mem.ram);
m_mem.ram = nullptr;
}
if (m_mem.hpb) {
auto_free(machine(), m_mem.hpb);
m_mem.hpb = nullptr;
}
// allocate 64K or 128K words of main memory
@ -854,8 +852,8 @@ void alto2_cpu_device::reset_memory()
m_mem.size = ALTO2_RAM_SIZE;
logerror("Main memory %u KiB\n", static_cast<UINT32>(sizeof(UINT16) * m_mem.size / 1024));
m_mem.ram = auto_alloc_array_clear(machine(), UINT32, sizeof(UINT16) * m_mem.size);
m_mem.hpb = auto_alloc_array_clear(machine(), UINT8, sizeof(UINT16) * m_mem.size);
m_mem.ram = make_unique_clear<UINT32[]>(sizeof(UINT16) * m_mem.size);
m_mem.hpb = make_unique_clear<UINT8[]>( sizeof(UINT16) * m_mem.size);
#if USE_HAMMING_CHECK
// Initialize the hamming codes and parity bit

View File

@ -25,8 +25,8 @@ enum {
struct {
UINT32 size; //!< main memory size (64K or 128K)
UINT32* ram; //!< main memory organized as double-words
UINT8* hpb; //!< Hamming Code bits (6) and Parity bits (1) per double word
std::unique_ptr<UINT32[]> ram; //!< main memory organized as double-words
std::unique_ptr<UINT8[]> hpb; //!< Hamming Code bits (6) and Parity bits (1) per double word
UINT32 mar; //!< memory address register
UINT32 rmdd; //!< read memory data double-word
UINT32 wmdd; //!< write memory data double-word

View File

@ -219,10 +219,10 @@ void saturn_state::smpc_system_reset()
memset(m_sound_ram,0x00,0x080000);
memset(m_workram_h,0x00,0x100000);
memset(m_workram_l,0x00,0x100000);
memset(m_vdp2_regs,0x00,0x040000);
memset(m_vdp2_vram,0x00,0x100000);
memset(m_vdp2_cram,0x00,0x080000);
memset(m_vdp1_vram,0x00,0x100000);
memset(m_vdp2_regs.get(),0x00,0x040000);
memset(m_vdp2_vram.get(),0x00,0x100000);
memset(m_vdp2_cram.get(),0x00,0x080000);
memset(m_vdp1_vram.get(),0x00,0x100000);
//A-Bus
m_maincpu->set_input_line(INPUT_LINE_RESET, PULSE_LINE);

View File

@ -521,8 +521,8 @@ void aica_device::Init()
}
AICALFO_Init();
m_buffertmpl=auto_alloc_array_clear(machine(), signed int, 44100);
m_buffertmpr=auto_alloc_array_clear(machine(), signed int, 44100);
m_buffertmpl=make_unique_clear<INT32[]>(44100);
m_buffertmpr=make_unique_clear<INT32[]>(44100);
// no "pend"
m_udata.data[0xa0/2] = 0;

View File

@ -159,7 +159,8 @@ private:
UINT32 m_AICARAM_LENGTH, m_RAM_MASK, m_RAM_MASK16;
sound_stream * m_stream;
INT32 *m_buffertmpl, *m_buffertmpr;
std::unique_ptr<INT32[]> m_buffertmpl;
std::unique_ptr<INT32[]> m_buffertmpr;
UINT32 m_IrqTimA;
UINT32 m_IrqTimBC;

View File

@ -47,7 +47,7 @@
void dmadac_sound_device::device_start()
{
/* allocate a clear a buffer */
m_buffer = auto_alloc_array_clear(machine(), INT16, BUFFER_SIZE);
m_buffer = make_unique_clear<INT16[]>(BUFFER_SIZE);
/* reset the state */
m_volume = 0x100;
@ -61,7 +61,7 @@ void dmadac_sound_device::device_start()
save_item(NAME(m_volume));
save_item(NAME(m_enabled));
save_item(NAME(m_frequency));
save_pointer(NAME(m_buffer), BUFFER_SIZE);
save_pointer(NAME(m_buffer.get()), BUFFER_SIZE);
}
@ -217,7 +217,7 @@ dmadac_sound_device::dmadac_sound_device(const machine_config &mconfig, const ch
void dmadac_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
{
stream_sample_t *output = outputs[0];
INT16 *source = m_buffer;
INT16 *source = m_buffer.get();
UINT32 curout = m_bufout;
UINT32 curin = m_bufin;
int volume = m_volume;

View File

@ -35,7 +35,7 @@ private:
// internal state
/* sound stream and buffers */
sound_stream * m_channel;
INT16 * m_buffer;
std::unique_ptr<INT16[]> m_buffer;
UINT32 m_bufin;
UINT32 m_bufout;

View File

@ -228,7 +228,7 @@ void es5506_device::device_start()
}
/* allocate memory */
m_scratch = auto_alloc_array_clear(machine(), INT32, 2 * MAX_SAMPLE_CHUNK);
m_scratch = make_unique_clear<INT32[]>(2 * MAX_SAMPLE_CHUNK);
/* register save */
save_item(NAME(m_sample_rate));
@ -243,7 +243,7 @@ void es5506_device::device_start()
save_item(NAME(m_lrend));
save_item(NAME(m_irqv));
save_pointer(NAME(m_scratch), 2 * MAX_SAMPLE_CHUNK);
save_pointer(NAME(m_scratch.get()), 2 * MAX_SAMPLE_CHUNK);
for (j = 0; j < 32; j++)
{
@ -363,7 +363,7 @@ void es5505_device::device_start()
}
/* allocate memory */
m_scratch = auto_alloc_array_clear(machine(), INT32, 2 * MAX_SAMPLE_CHUNK);
m_scratch = make_unique_clear<INT32[]>(2 * MAX_SAMPLE_CHUNK);
/* register save */
save_item(NAME(m_sample_rate));
@ -378,7 +378,7 @@ void es5505_device::device_start()
save_item(NAME(m_lrend));
save_item(NAME(m_irqv));
save_pointer(NAME(m_scratch), 2 * MAX_SAMPLE_CHUNK);
save_pointer(NAME(m_scratch.get()), 2 * MAX_SAMPLE_CHUNK);
for (j = 0; j < 32; j++)
{
@ -452,7 +452,7 @@ void es550x_device::compute_tables()
int i;
/* allocate ulaw lookup table */
m_ulaw_lookup = auto_alloc_array_clear(machine(), INT16, 1 << ULAW_MAXBITS);
m_ulaw_lookup = make_unique_clear<INT16[]>(1 << ULAW_MAXBITS);
/* generate ulaw lookup table */
for (i = 0; i < (1 << ULAW_MAXBITS); i++)
@ -471,7 +471,7 @@ void es550x_device::compute_tables()
}
/* allocate volume lookup table */
m_volume_lookup = auto_alloc_array_clear(machine(), UINT16, 4096);
m_volume_lookup = make_unique_clear<UINT16[]>(4096);
/* generate volume lookup table */
for (i = 0; i < 4096; i++)

View File

@ -154,10 +154,10 @@ protected:
es550x_voice m_voice[32]; /* the 32 voices */
INT32 * m_scratch;
std::unique_ptr<INT32[]> m_scratch;
INT16 * m_ulaw_lookup;
UINT16 * m_volume_lookup;
std::unique_ptr<INT16[]> m_ulaw_lookup;
std::unique_ptr<UINT16[]> m_volume_lookup;
#if MAKE_WAVS
void * m_wavraw; /* raw waveform */

View File

@ -617,8 +617,8 @@ void scsp_device::init()
}
LFO_Init();
m_buffertmpl=auto_alloc_array_clear(machine(), signed int, 44100);
m_buffertmpr=auto_alloc_array_clear(machine(), signed int, 44100);
m_buffertmpl=make_unique_clear<INT32[]>(44100);
m_buffertmpr=make_unique_clear<INT32[]>(44100);
// no "pend"
m_udata.data[0x20/2] = 0;

View File

@ -123,7 +123,8 @@ private:
char m_Master;
sound_stream * m_stream;
INT32 *m_buffertmpl,*m_buffertmpr;
std::unique_ptr<INT32[]> m_buffertmpl;
std::unique_ptr<INT32[]> m_buffertmpr;
UINT32 m_IrqTimA;
UINT32 m_IrqTimBC;

View File

@ -88,12 +88,12 @@ void zsg2_device::device_start()
m_stream = stream_alloc(0, 2, clock() / 768);
m_mem_blocks = m_mem_base.length();
m_mem_copy = auto_alloc_array_clear(machine(), UINT32, m_mem_blocks);
m_full_samples = auto_alloc_array_clear(machine(), INT16, m_mem_blocks * 4 + 4); // +4 is for empty block
m_mem_copy = make_unique_clear<UINT32[]>(m_mem_blocks);
m_full_samples = make_unique_clear<INT16[]>(m_mem_blocks * 4 + 4); // +4 is for empty block
// register for savestates
save_pointer(NAME(m_mem_copy), m_mem_blocks / sizeof(UINT32));
save_pointer(NAME(m_full_samples), (m_mem_blocks * 4 + 4) / sizeof(INT16));
save_pointer(NAME(m_mem_copy.get()), m_mem_blocks / sizeof(UINT32));
save_pointer(NAME(m_full_samples.get()), (m_mem_blocks * 4 + 4) / sizeof(INT16));
save_item(NAME(m_read_address));
for (int ch = 0; ch < 48; ch++)

View File

@ -70,9 +70,9 @@ private:
required_region_ptr<UINT32> m_mem_base;
UINT32 m_read_address;
UINT32 *m_mem_copy;
std::unique_ptr<UINT32[]> m_mem_copy;
UINT32 m_mem_blocks;
INT16 *m_full_samples;
std::unique_ptr<INT16[]> m_full_samples;
sound_stream *m_stream;

View File

@ -57,9 +57,9 @@ void gf4500_device::device_config_complete()
void gf4500_device::device_start()
{
m_data = auto_alloc_array_clear(machine(), UINT32, 0x140000/4);
m_data = make_unique_clear<UINT32[]>(0x140000/4);
save_pointer(NAME(m_data), 0x140000/4);
save_pointer(NAME(m_data.get()), 0x140000/4);
save_item(NAME(m_screen_x));
save_item(NAME(m_screen_y));
save_item(NAME(m_screen_x_max));
@ -83,7 +83,7 @@ void gf4500_device::vram_write16( UINT16 data )
{
if ((m_screen_x < m_screen_x_max) && (m_screen_y < m_screen_y_max))
{
UINT16 *vram = (UINT16 *)((UINT8 *)m_data + GF4500_FRAMEBUF_OFFSET + (((m_screen_y_min + m_screen_y) * (320 + 1)) + (m_screen_x_min + m_screen_x)) * 2);
UINT16 *vram = (UINT16 *)((UINT8 *)m_data.get() + GF4500_FRAMEBUF_OFFSET + (((m_screen_y_min + m_screen_y) * (320 + 1)) + (m_screen_x_min + m_screen_x)) * 2);
*vram = data;
m_screen_x++;
}
@ -100,7 +100,7 @@ static rgb_t gf4500_get_color_16( UINT16 data )
UINT32 gf4500_device::screen_update(screen_device &device, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
UINT16 *vram = (UINT16 *)(m_data + GF4500_FRAMEBUF_OFFSET / 4);
UINT16 *vram = (UINT16 *)(m_data.get() + GF4500_FRAMEBUF_OFFSET / 4);
int x, y;
for (y = 0; y < 240; y++)
{

View File

@ -35,7 +35,7 @@ private:
void vram_write16(UINT16 data);
UINT32 *m_data;
std::unique_ptr<UINT32[]> m_data;
int m_screen_x;
int m_screen_y;
int m_screen_x_max;

View File

@ -70,9 +70,9 @@ hd63484_device::hd63484_device(const machine_config &mconfig, const char *tag, d
void hd63484_device::device_start()
{
m_ram = auto_alloc_array_clear(machine(), UINT16, HD63484_RAM_SIZE);
m_ram = make_unique_clear<UINT16[]>(HD63484_RAM_SIZE);
save_pointer(NAME(m_ram), HD63484_RAM_SIZE);
save_pointer(NAME(m_ram.get()), HD63484_RAM_SIZE);
save_item(NAME(m_reg));
save_item(NAME(m_fifo_counter));
save_item(NAME(m_fifo));

View File

@ -46,7 +46,7 @@ protected:
private:
// internal state
UINT16 * m_ram;
std::unique_ptr<UINT16[]> m_ram;
UINT16 m_reg[256/2];
int m_fifo_counter;

View File

@ -804,10 +804,10 @@ void huc6270_device::device_start()
/* Resolve callbacks */
m_irq_changed_cb.resolve_safe();
m_vram = auto_alloc_array_clear(machine(), UINT16, m_vram_size/sizeof(UINT16));
m_vram = make_unique_clear<UINT16[]>(m_vram_size/sizeof(UINT16));
m_vram_mask = (m_vram_size >> 1) - 1;
save_pointer(NAME(m_vram), m_vram_size/sizeof(UINT16));
save_pointer(NAME(m_vram.get()), m_vram_size/sizeof(UINT16));
save_item(NAME(m_register_index));
save_item(NAME(m_mawr));

View File

@ -128,7 +128,7 @@ private:
int m_sprites_this_line;
int m_sprite_row_index;
UINT16 m_sprite_row[1024];
UINT16 *m_vram;
std::unique_ptr<UINT16[]> m_vram;
UINT16 m_vram_mask;
const static UINT8 vram_increments[4];

View File

@ -205,7 +205,7 @@ void m50458_device::device_start()
/* Create an array for shadow gfx */
/* this will spread the source ROM into four directions (up-left, up-right, down-left, down-right) thus creating a working shadow copy */
m_shadow_gfx = auto_alloc_array_clear(machine(), UINT8, 0x1200);
m_shadow_gfx = make_unique_clear<UINT8[]>(0x1200);
for(tile=0;tile<0x80;tile++)
{

View File

@ -71,7 +71,7 @@ protected:
UINT16 m_current_cmd;
int m_cmd_stream_pos;
UINT16 m_osd_addr;
UINT8 *m_shadow_gfx;
std::unique_ptr<UINT8[]> m_shadow_gfx;
UINT8 m_bg_pen;
UINT8 m_phase;

View File

@ -178,8 +178,8 @@ void mb_vcu_device::device_validity_check(validity_checker &valid) const
void mb_vcu_device::device_start()
{
// TODO: m_screen_tag
m_ram = auto_alloc_array_clear(machine(), UINT8, 0x800);
m_palram = auto_alloc_array_clear(machine(), UINT8, 0x100);
m_ram = make_unique_clear<UINT8[]>(0x800);
m_palram = make_unique_clear<UINT8[]>(0x100);
{
static const int resistances_r[2] = { 4700, 2200 };
@ -193,8 +193,8 @@ void mb_vcu_device::device_start()
}
save_item(NAME(m_status));
save_pointer(NAME(m_ram), 0x800);
save_pointer(NAME(m_palram), 0x100);
save_pointer(NAME(m_ram.get()), 0x800);
save_pointer(NAME(m_palram.get()), 0x100);
save_item(NAME(m_param_offset_latch));
save_item(NAME(m_xpos));
save_item(NAME(m_ypos));

View File

@ -55,8 +55,8 @@ private:
const address_space_config m_videoram_space_config;
const address_space_config m_paletteram_space_config;
UINT8 m_status;
UINT8 *m_ram;
UINT8 *m_palram;
std::unique_ptr<UINT8[]> m_ram;
std::unique_ptr<UINT8[]> m_palram;
UINT16 m_param_offset_latch;
INT16 m_xpos, m_ypos;

View File

@ -186,16 +186,16 @@ private:
// construction
poly_array(running_machine &machine, poly_manager &manager)
: m_manager(manager),
m_base(auto_alloc_array_clear(machine, UINT8, k_itemsize * _Count)),
m_base(make_unique_clear<UINT8[]>(k_itemsize * _Count)),
m_next(0),
m_max(0),
m_waits(0) { }
// destruction
~poly_array() { auto_free(m_manager.machine(), m_base); }
~poly_array() { m_base = nullptr; }
// operators
_Type &operator[](int index) const { assert(index >= 0 && index < _Count); return *reinterpret_cast<_Type *>(m_base + index * k_itemsize); }
_Type &operator[](int index) const { assert(index >= 0 && index < _Count); return *reinterpret_cast<_Type *>(m_base.get() + index * k_itemsize); }
// getters
int count() const { return m_next; }
@ -203,18 +203,18 @@ private:
int waits() const { return m_waits; }
int itemsize() const { return k_itemsize; }
int allocated() const { return _Count; }
int indexof(_Type &item) const { int result = (reinterpret_cast<UINT8 *>(&item) - m_base) / k_itemsize; assert(result >= 0 && result < _Count); return result; }
int indexof(_Type &item) const { int result = (reinterpret_cast<UINT8 *>(&item) - m_base.get()) / k_itemsize; assert(result >= 0 && result < _Count); return result; }
// operations
void reset() { m_next = 0; }
_Type &next() { if (m_next > m_max) m_max = m_next; assert(m_next < _Count); return *new(m_base + m_next++ * k_itemsize) _Type; }
_Type &next() { if (m_next > m_max) m_max = m_next; assert(m_next < _Count); return *new(m_base.get() + m_next++ * k_itemsize) _Type; }
_Type &last() const { return (*this)[m_next - 1]; }
void wait_for_space(int count = 1) { while ((m_next + count) >= _Count) { m_waits++; m_manager.wait(""); } }
private:
// internal state
poly_manager & m_manager;
UINT8 * m_base;
std::unique_ptr<UINT8[]> m_base;
int m_next;
int m_max;
int m_waits;

View File

@ -469,7 +469,7 @@ void psxgpu_device::psx_gpu_init( int n_gputype )
n_lightgun_y = 0;
b_reverseflag = 0;
p_vram = auto_alloc_array_clear( machine(), UINT16, width * height );
p_vram = make_unique_clear<UINT16[]>(width * height );
for( n_line = 0; n_line < 1024; n_line++ )
{
@ -570,7 +570,7 @@ void psxgpu_device::psx_gpu_init( int n_gputype )
// icky!!!
machine().save().save_memory( this, "globals", nullptr, 0, "m_packet", (UINT8 *)&m_packet, 1, sizeof( m_packet ) );
save_pointer(NAME(p_vram), width * height );
save_pointer(NAME(p_vram.get()), width * height );
save_item(NAME(n_gpu_buffer_offset));
save_item(NAME(n_vramx));
save_item(NAME(n_vramy));

View File

@ -240,7 +240,7 @@ private:
INT32 n_iy;
INT32 n_ti;
UINT16 *p_vram;
std::unique_ptr<UINT16[]> p_vram;
UINT32 n_vramx;
UINT32 n_vramy;
UINT32 n_twy;

View File

@ -103,7 +103,7 @@ void ramdac_device::device_validity_check(validity_checker &valid) const
void ramdac_device::device_start()
{
m_palram = auto_alloc_array_clear(machine(), UINT8, 1 << 10);
m_palram = make_unique_clear<UINT8[]>(1 << 10);
}

View File

@ -71,7 +71,7 @@ private:
UINT8 m_pal_index[2];
UINT8 m_pal_mask;
UINT8 m_int_index[2];
UINT8 *m_palram;
std::unique_ptr<UINT8[]> m_palram;
const address_space_config m_space_config;
required_device<palette_device> m_palette;

View File

@ -2121,8 +2121,8 @@ void saturn_state::stv_vdp1_state_save_postload( void )
int saturn_state::stv_vdp1_start ( void )
{
m_vdp1_regs = auto_alloc_array_clear(machine(), UINT16, 0x020/2 );
m_vdp1_vram = auto_alloc_array_clear(machine(), UINT32, 0x100000/4 );
m_vdp1_regs = make_unique_clear<UINT16[]>(0x020/2 );
m_vdp1_vram = make_unique_clear<UINT32[]>(0x100000/4 );
m_vdp1.gfx_decode = std::make_unique<UINT8[]>(0x100000 );
stv_vdp1_shading_data = auto_alloc(machine(), struct stv_vdp1_poly_scanline_data);
@ -2147,8 +2147,8 @@ int saturn_state::stv_vdp1_start ( void )
m_vdp1.user_cliprect.set(0, 512, 0, 256);
// save state
save_pointer(NAME(m_vdp1_regs), 0x020/2);
save_pointer(NAME(m_vdp1_vram), 0x100000/4);
save_pointer(NAME(m_vdp1_regs.get()), 0x020/2);
save_pointer(NAME(m_vdp1_vram.get()), 0x100000/4);
save_item(NAME(m_vdp1.fbcr_accessed));
save_item(NAME(m_vdp1.framebuffer_current_display));
save_item(NAME(m_vdp1.framebuffer_current_draw));

View File

@ -4576,11 +4576,11 @@ void saturn_state::stv_vdp2_copy_roz_bitmap(bitmap_rgb32 &bitmap,
{
if ( STV_VDP2_CRKTE == 0 )
{
coeff_table_base = m_vdp2_vram;
coeff_table_base = m_vdp2_vram.get();
}
else
{
coeff_table_base = m_vdp2_cram;
coeff_table_base = m_vdp2_cram.get();
}
if ( coeff_table_size == 0 )
{
@ -6101,9 +6101,9 @@ int saturn_state::stv_vdp2_start ( void )
{
machine().add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(saturn_state::stv_vdp2_exit), this));
m_vdp2_regs = auto_alloc_array_clear(machine(), UINT16, 0x040000/2 );
m_vdp2_vram = auto_alloc_array_clear(machine(), UINT32, 0x100000/4 );
m_vdp2_cram = auto_alloc_array_clear(machine(), UINT32, 0x080000/4 );
m_vdp2_regs = make_unique_clear<UINT16[]>(0x040000/2 );
m_vdp2_vram = make_unique_clear<UINT32[]>(0x100000/4 );
m_vdp2_cram = make_unique_clear<UINT32[]>(0x080000/4 );
m_vdp2.gfx_decode = std::make_unique<UINT8[]>(0x100000 );
// m_gfxdecode->gfx(0)->granularity()=4;
@ -6113,9 +6113,9 @@ int saturn_state::stv_vdp2_start ( void )
stv_rbg_cache_data.is_cache_dirty = 3;
memset( &stv_vdp2_layer_data_placement, 0, sizeof(stv_vdp2_layer_data_placement));
save_pointer(NAME(m_vdp2_regs), 0x040000/2);
save_pointer(NAME(m_vdp2_vram), 0x100000/4);
save_pointer(NAME(m_vdp2_cram), 0x080000/4);
save_pointer(NAME(m_vdp2_regs.get()), 0x040000/2);
save_pointer(NAME(m_vdp2_vram.get()), 0x100000/4);
save_pointer(NAME(m_vdp2_cram.get()), 0x080000/4);
machine().save().register_postload(save_prepost_delegate(FUNC(saturn_state::stv_vdp2_state_save_postload), this));
return 0;

View File

@ -163,7 +163,7 @@ void vector_device::device_start()
m_vector_index = 0;
/* allocate memory for tables */
m_vector_list = auto_alloc_array_clear(machine(), point, MAX_POINTS);
m_vector_list = make_unique_clear<point[]>(MAX_POINTS);
}
void vector_device::set_flicker(float newval)
@ -306,7 +306,7 @@ UINT32 vector_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap,
int lastx = 0;
int lasty = 0;
curpoint = m_vector_list;
curpoint = m_vector_list.get();
screen.container().empty();
screen.container().add_rect(0.0f, 0.0f, 1.0f, 1.0f, rgb_t(0xff,0x00,0x00,0x00), PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_VECTORBUF(1));

View File

@ -65,7 +65,7 @@ private:
static float m_beam_width_min;
static float m_beam_width_max;
static float m_beam_intensity_weight;
point *m_vector_list;
std::unique_ptr<point[]> m_vector_list;
static int m_vector_index;
int m_min_intensity;
int m_max_intensity;

View File

@ -128,8 +128,8 @@ void exidy440_sound_device::device_start()
reset_sound_cache();
/* allocate the mixer buffer */
m_mixer_buffer_left = auto_alloc_array_clear(machine(), INT32, 2 * clock());
m_mixer_buffer_right = m_mixer_buffer_left + clock();
m_mixer_buffer_left = make_unique_clear<INT32[]>(clock());
m_mixer_buffer_right = make_unique_clear<INT32[]>(clock());
if (SOUND_LOG)
m_debuglog = fopen("sound.log", "w");
@ -197,8 +197,8 @@ void exidy440_sound_device::add_and_scale_samples(int ch, INT32 *dest, int sampl
void exidy440_sound_device::mix_to_16(int length, stream_sample_t *dest_left, stream_sample_t *dest_right)
{
INT32 *mixer_left = m_mixer_buffer_left;
INT32 *mixer_right = m_mixer_buffer_right;
INT32 *mixer_left = m_mixer_buffer_left.get();
INT32 *mixer_right = m_mixer_buffer_right.get();
int i, clippers = 0;
for (i = 0; i < length; i++)
@ -804,8 +804,8 @@ void exidy440_sound_device::sound_stream_update(sound_stream &stream, stream_sam
int ch;
/* reset the mixer buffers */
memset(m_mixer_buffer_left, 0, samples * sizeof(INT32));
memset(m_mixer_buffer_right, 0, samples * sizeof(INT32));
memset(m_mixer_buffer_left.get(), 0, samples * sizeof(INT32));
memset(m_mixer_buffer_right.get(), 0, samples * sizeof(INT32));
/* loop over channels */
for (ch = 0; ch < 4; ch++)
@ -824,12 +824,12 @@ void exidy440_sound_device::sound_stream_update(sound_stream &stream, stream_sam
/* get a pointer to the sample data and copy to the left */
volume = m_sound_volume[2 * ch + 0];
if (volume)
add_and_scale_samples(ch, m_mixer_buffer_left, length, volume);
add_and_scale_samples(ch, m_mixer_buffer_left.get(), length, volume);
/* get a pointer to the sample data and copy to the left */
volume = m_sound_volume[2 * ch + 1];
if (volume)
add_and_scale_samples(ch, m_mixer_buffer_right, length, volume);
add_and_scale_samples(ch, m_mixer_buffer_right.get(), length, volume);
/* update our counters */
channel->offset += length;

View File

@ -67,8 +67,8 @@ private:
UINT8 m_sound_banks[4];
//UINT8 m_m6844_data[0x20];
UINT8 m_sound_volume[0x10];
INT32 *m_mixer_buffer_left;
INT32 *m_mixer_buffer_right;
std::unique_ptr<INT32[]> m_mixer_buffer_left;
std::unique_ptr<INT32[]> m_mixer_buffer_right;
sound_cache_entry *m_sound_cache;
sound_cache_entry *m_sound_cache_end;
sound_cache_entry *m_sound_cache_max;

View File

@ -159,8 +159,8 @@ void lynx_sound_device::register_save()
void lynx_sound_device::init()
{
m_shift_mask = auto_alloc_array_clear(machine(), int, 512);
m_shift_xor = auto_alloc_array_clear(machine(), int, 4096);
m_shift_mask = make_unique_clear<int[]>(512);
m_shift_xor = make_unique_clear<int[]>(4096);
for (int i = 0; i < 512; i++)
{

View File

@ -57,8 +57,8 @@ protected:
lynx_sound_timer_delegate m_timer_delegate; // this calls lynx_timer_count_down from the driver state
float m_usec_per_sample;
int *m_shift_mask;
int *m_shift_xor;
std::unique_ptr<int[]> m_shift_mask;
std::unique_ptr<int[]> m_shift_xor;
UINT8 m_attenuation_enable;
UINT8 m_master_enable;
LYNX_AUDIO m_audio[4];

View File

@ -62,13 +62,13 @@ void mac_sound_device::device_start()
{
mac_state *mac = machine().driver_data<mac_state>();
m_snd_cache = auto_alloc_array_clear(machine(), UINT8, SND_CACHE_SIZE);
m_snd_cache = make_unique_clear<UINT8[]>(SND_CACHE_SIZE);
m_mac_stream = machine().sound().stream_alloc(*this, 0, 1, MAC_SAMPLE_RATE);
m_ram = machine().device<ram_device>(RAM_TAG);
m_mac_model = mac->m_model;
save_pointer(NAME(m_snd_cache), SND_CACHE_SIZE);
save_pointer(NAME(m_snd_cache.get()), SND_CACHE_SIZE);
save_item(NAME(m_sample_enable));
save_item(NAME(m_snd_cache_len));
save_item(NAME(m_snd_cache_head));

View File

@ -68,9 +68,9 @@ static void filter_init(running_machine &machine, lp_filter *iir, double fs)
iir->ProtoCoef[1].b1 = 1.847759;
iir->ProtoCoef[1].b2 = 1.0;
iir->coef = (float *)auto_alloc_array_clear(machine, float, 4 * 2 + 1);
iir->coef = make_unique_clear<float[]>(4 * 2 + 1);
iir->fs = fs;
iir->history = (float *)auto_alloc_array_clear(machine, float, 2 * 2);
iir->history = make_unique_clear<float[]>(2 * 2);
}
static void prewarp(double *a0, double *a1, double *a2,double fc, double fs)
@ -107,7 +107,7 @@ static void recompute_filter(lp_filter *iir, double k, double q, double fc)
int nInd;
double a0, a1, a2, b0, b1, b2;
float *coef = iir->coef + 1;
float *coef = iir->coef.get() + 1;
for (nInd = 0; nInd < 2; nInd++)
{
@ -270,9 +270,9 @@ void micro3d_sound_device::sound_stream_update(sound_stream &stream, stream_samp
input += white;
input *= 200.0f;
coef_ptr = iir->coef;
coef_ptr = iir->coef.get();
hist1_ptr = iir->history;
hist1_ptr = iir->history.get();
hist2_ptr = hist1_ptr + 1;
/* 1st number of coefficients array is overall input scale factor, * or filter gain */

View File

@ -653,7 +653,7 @@ void pleiads_sound_device::common_start()
m_tms = machine().device<tms36xx_device>("tms");
m_pc4.level = PC4_MIN;
m_poly18 = auto_alloc_array_clear(machine(), UINT32, 1ul << (18-5));
m_poly18 = make_unique_clear<UINT32[]>(1ul << (18-5));
shiftreg = 0;
for( i = 0; i < (1ul << (18-5)); i++ )
@ -715,7 +715,7 @@ void pleiads_sound_device::common_start()
save_item(NAME(m_noise.counter));
save_item(NAME(m_noise.polyoffs));
save_item(NAME(m_noise.freq));
save_pointer(NAME(m_poly18), (1ul << (18-5)));
save_pointer(NAME(m_poly18.get()), (1ul << (18-5)));
}
//-------------------------------------------------

View File

@ -79,7 +79,7 @@ protected:
int m_sound_latch_b;
int m_sound_latch_c; /* part of the videoreg_w latch */
UINT32 *m_poly18;
std::unique_ptr<UINT32[]> m_poly18;
int m_polybit;
pl_t_state m_tone1;

View File

@ -115,13 +115,13 @@ void seibu_sound_device::device_start()
case 1:
get_custom_decrypt();
memcpy(m_decrypted_opcodes, rom, length);
apply_decrypt(rom, m_decrypted_opcodes, 0x2000);
memcpy(m_decrypted_opcodes.get(), rom, length);
apply_decrypt(rom, m_decrypted_opcodes.get(), 0x2000);
break;
case 2:
get_custom_decrypt();
apply_decrypt(rom, m_decrypted_opcodes, length);
apply_decrypt(rom, m_decrypted_opcodes.get(), length);
break;
}
@ -182,18 +182,18 @@ static UINT8 decrypt_opcode(int a,int src)
UINT8 *seibu_sound_device::get_custom_decrypt()
{
if (m_decrypted_opcodes)
return m_decrypted_opcodes;
return m_decrypted_opcodes.get();
int size = memregion(":audiocpu")->bytes();
m_decrypted_opcodes = auto_alloc_array_clear(machine(), UINT8, size);
membank(":seibu_bank0d")->set_base(m_decrypted_opcodes);
m_decrypted_opcodes = make_unique_clear<UINT8[]>(size);
membank(":seibu_bank0d")->set_base(m_decrypted_opcodes.get());
if (size > 0x10000) {
membank(":seibu_bank1d")->configure_entries(0, (size - 0x10000) / 0x8000, m_decrypted_opcodes + 0x10000, 0x8000);
membank(":seibu_bank1d")->configure_entries(0, (size - 0x10000) / 0x8000, m_decrypted_opcodes.get() + 0x10000, 0x8000);
membank(":seibu_bank1d")->set_entry(0);
} else
membank(":seibu_bank1d")->set_base(m_decrypted_opcodes + 0x8000);
membank(":seibu_bank1d")->set_base(m_decrypted_opcodes.get() + 0x8000);
return m_decrypted_opcodes;
return m_decrypted_opcodes.get();
}
void seibu_sound_device::apply_decrypt(UINT8 *rom, UINT8 *opcodes, int length)

View File

@ -72,7 +72,7 @@ protected:
private:
int m_encryption_mode;
UINT8 *m_decrypted_opcodes;
std::unique_ptr<UINT8[]> m_decrypted_opcodes;
// internal state
device_t *m_sound_cpu;

View File

@ -179,7 +179,7 @@ void snes_sound_device::device_start()
{
m_channel = machine().sound().stream_alloc(*this, 0, 2, 32000);
m_ram = auto_alloc_array_clear(machine(), UINT8, SNES_SPCRAM_SIZE);
m_ram = make_unique_clear<UINT8[]>(SNES_SPCRAM_SIZE);
/* put IPL image at the top of RAM */
memcpy(m_ipl_region, machine().root_device().memregion("sound_ipl")->base(), 64);
@ -196,7 +196,7 @@ void snes_sound_device::device_start()
m_timer[2]->enable(false);
state_register();
save_pointer(NAME(m_ram), SNES_SPCRAM_SIZE);
save_pointer(NAME(m_ram.get()), SNES_SPCRAM_SIZE);
}
//-------------------------------------------------

View File

@ -97,7 +97,7 @@ private:
void state_register();
// internal state
UINT8 *m_ram;
std::unique_ptr<UINT8[]> m_ram;
sound_stream *m_channel;
UINT8 m_dsp_regs[256]; /* DSP registers */
UINT8 m_ipl_region[64]; /* SPC top 64 bytes */

View File

@ -52,12 +52,12 @@ taito_zoom_device::taito_zoom_device(const machine_config &mconfig, const char *
void taito_zoom_device::device_start()
{
m_snd_shared_ram = auto_alloc_array_clear(machine(), UINT8, 0x100);
m_snd_shared_ram = make_unique_clear<UINT8[]>(0x100);
// register for savestates
save_item(NAME(m_reg_address));
save_item(NAME(m_tms_ctrl));
save_pointer(NAME(m_snd_shared_ram), 0x100);
save_pointer(NAME(m_snd_shared_ram.get()), 0x100);
}
//-------------------------------------------------

View File

@ -42,7 +42,7 @@ private:
// internal state
UINT16 m_reg_address;
UINT8 m_tms_ctrl;
UINT8* m_snd_shared_ram;
std::unique_ptr<UINT8[]> m_snd_shared_ram;
};
extern const device_type TAITO_ZOOM;

View File

@ -47,8 +47,8 @@ void wiping_sound_device::device_start()
m_stream = machine().sound().stream_alloc(*this, 0, 1, samplerate);
/* allocate a pair of buffers to mix into - 1 second's worth should be more than enough */
m_mixer_buffer = auto_alloc_array_clear(machine(), short, 2 * samplerate);
m_mixer_buffer_2 = m_mixer_buffer + samplerate;
m_mixer_buffer = make_unique_clear<short[]>(samplerate);
m_mixer_buffer_2 = make_unique_clear<short[]>(samplerate);
/* build the mixer table */
make_mixer_table(8, defgain);
@ -91,10 +91,10 @@ void wiping_sound_device::make_mixer_table(int voices, int gain)
int i;
/* allocate memory */
m_mixer_table = auto_alloc_array_clear(machine(), INT16, 256 * voices);
m_mixer_table = make_unique_clear<INT16[]>(256 * voices);
/* find the middle of the table */
m_mixer_lookup = m_mixer_table + (128 * voices);
m_mixer_lookup = m_mixer_table.get() + (128 * voices);
/* fill in the table - 16 bit case */
for (i = 0; i < count; i++)
@ -174,7 +174,7 @@ void wiping_sound_device::sound_stream_update(sound_stream &stream, stream_sampl
}
/* zap the contents of the mixer buffer */
memset(m_mixer_buffer, 0, samples * sizeof(short));
memset(m_mixer_buffer.get(), 0, samples * sizeof(short));
/* loop over each voice and add its contribution */
for (voice = m_channel_list; voice < m_last_channel; voice++)
@ -188,7 +188,7 @@ void wiping_sound_device::sound_stream_update(sound_stream &stream, stream_sampl
const UINT8 *w = voice->wave;
int c = voice->counter;
mix = m_mixer_buffer;
mix = m_mixer_buffer.get();
/* add our contribution */
for (i = 0; i < samples; i++)
@ -235,7 +235,7 @@ void wiping_sound_device::sound_stream_update(sound_stream &stream, stream_sampl
}
/* mix it down */
mix = m_mixer_buffer;
mix = m_mixer_buffer.get();
for (i = 0; i < samples; i++)
*buffer++ = m_mixer_lookup[*mix++];
}

View File

@ -45,10 +45,10 @@ private:
sound_stream *m_stream;
/* mixer tables and internal buffers */
INT16 *m_mixer_table;
std::unique_ptr<INT16[]> m_mixer_table;
INT16 *m_mixer_lookup;
short *m_mixer_buffer;
short *m_mixer_buffer_2;
std::unique_ptr<short[]> m_mixer_buffer;
std::unique_ptr<short[]> m_mixer_buffer_2;
UINT8 m_soundregs[0x4000];

View File

@ -33,11 +33,11 @@ public:
UINT32* m_cpuregion;
int m_cpuregion_size;
UINT32* m_mainram;
std::unique_ptr<UINT32[]> m_mainram;
UINT32* m_slavecpuregion;
int m_slavecpuregion_size;
UINT32* m_slaveram;
std::unique_ptr<UINT32[]> m_slaveram;
@ -270,11 +270,11 @@ MACHINE_START_MEMBER(astrafr_state,astra_common)
{
m_cpuregion = (UINT32*)memregion( "maincpu" )->base();
m_cpuregion_size = memregion( "maincpu" )->bytes()/4;
m_mainram = (UINT32*)auto_alloc_array_clear(machine(), UINT32, 0x10000);
m_mainram = make_unique_clear<UINT32[]>(0x10000);
m_slavecpuregion = (UINT32*)memregion( "slavecpu" )->base();
m_slavecpuregion_size = memregion( "slavecpu" )->bytes()/4;
m_slaveram = (UINT32*)auto_alloc_array_clear(machine(), UINT32, 0x10000);
m_slaveram = make_unique_clear<UINT32[]>(0x10000);
}

View File

@ -76,7 +76,7 @@ public:
UINT8 m_b_color_table[256];
UINT16 m_dsp_bank[2];
UINT8 m_csr[2];
UINT16 *m_shared_ram[2];
std::unique_ptr<UINT16[]> m_shared_ram[2];
DECLARE_WRITE16_MEMBER(gpu_w);
DECLARE_READ16_MEMBER(gpu_r);
@ -997,14 +997,14 @@ DRIVER_INIT_MEMBER(atarisy4_state,laststar)
address_space &main = m_maincpu->space(AS_PROGRAM);
/* Allocate 16kB of shared RAM */
m_shared_ram[0] = auto_alloc_array_clear(machine(), UINT16, 0x2000);
m_shared_ram[0] = make_unique_clear<UINT16[]>(0x2000);
/* Populate the 68000 address space with data from the HEX files */
load_hexfile(main, memregion("code")->base());
load_hexfile(main, memregion("data")->base());
/* Set up the DSP */
membank("dsp0_bank0")->set_base(m_shared_ram[0]);
membank("dsp0_bank0")->set_base(m_shared_ram[0].get());
m_dsp0_bank1->set_base(&m_shared_ram[0][0x800]);
load_ldafile(m_dsp0->space(AS_PROGRAM), memregion("dsp")->base());
}
@ -1012,19 +1012,19 @@ DRIVER_INIT_MEMBER(atarisy4_state,laststar)
DRIVER_INIT_MEMBER(atarisy4_state,airrace)
{
/* Allocate two sets of 32kB shared RAM */
m_shared_ram[0] = auto_alloc_array_clear(machine(), UINT16, 0x4000);
m_shared_ram[1] = auto_alloc_array_clear(machine(), UINT16, 0x4000);
m_shared_ram[0] = make_unique_clear<UINT16[]>(0x4000);
m_shared_ram[1] = make_unique_clear<UINT16[]>(0x4000);
/* Populate RAM with data from the HEX files */
load_hexfile(m_maincpu->space(AS_PROGRAM), memregion("code")->base());
/* Set up the first DSP */
membank("dsp0_bank0")->set_base(m_shared_ram[0]);
membank("dsp0_bank0")->set_base(m_shared_ram[0].get());
m_dsp0_bank1->set_base(&m_shared_ram[0][0x800]);
load_ldafile(m_dsp0->space(AS_PROGRAM), memregion("dsp")->base());
/* Set up the second DSP */
membank("dsp1_bank0")->set_base(m_shared_ram[1]);
membank("dsp1_bank0")->set_base(m_shared_ram[1].get());
m_dsp1_bank1->set_base(&m_shared_ram[1][0x800]);
load_ldafile(m_dsp1->space(AS_PROGRAM), memregion("dsp")->base());
}

View File

@ -250,8 +250,8 @@ public:
}
UINT8 m_bank_data[4];
UINT8 *m_work_ram;
UINT8 *m_video_ram;
std::unique_ptr<UINT8[]> m_work_ram;
std::unique_ptr<UINT8[]> m_video_ram;
UINT8 m_h_scroll;
UINT8 m_v_scroll;
UINT8 m_flip_8;
@ -1615,10 +1615,10 @@ INPUT_PORTS_END
void bfcobra_state::init_ram()
{
/* 768kB work RAM */
m_work_ram = auto_alloc_array_clear(machine(), UINT8, 0xC0000);
m_work_ram = make_unique_clear<UINT8[]>(0xC0000);
/* 128kB video RAM */
m_video_ram = auto_alloc_array_clear(machine(), UINT8, 0x20000);
m_video_ram = make_unique_clear<UINT8[]>(0x20000);
}
@ -1708,8 +1708,8 @@ DRIVER_INIT_MEMBER(bfcobra_state,bfcobra)
save_item(NAME(m_z80_int));
save_item(NAME(m_z80_inten));
save_item(NAME(m_bank_data));
save_pointer(NAME(m_work_ram), 0xc0000);
save_pointer(NAME(m_video_ram), 0x20000);
save_pointer(NAME(m_work_ram.get()), 0xc0000);
save_pointer(NAME(m_video_ram.get()), 0x20000);
}
/* TODO */

View File

@ -1031,7 +1031,7 @@ MACHINE_CONFIG_END
MACHINE_START_MEMBER(sc4_adder4_state,adder4)
{
m_adder4cpuregion = (UINT32*)memregion( "adder4" )->base();
m_adder4ram = (UINT32*)auto_alloc_array_clear(machine(), UINT32, 0x10000);
m_adder4ram = make_unique_clear<UINT32[]>(0x10000);
MACHINE_START_CALL_MEMBER(sc4);
}

View File

@ -114,7 +114,7 @@ public:
{ }
UINT32* m_cpuregion;
UINT32* m_mainram;
std::unique_ptr<UINT32[]> m_mainram;
DECLARE_READ32_MEMBER(bfm_swp_mem_r);
DECLARE_WRITE32_MEMBER(bfm_swp_mem_w);
@ -191,7 +191,7 @@ INPUT_PORTS_END
void bfm_swp_state::machine_start()
{
m_cpuregion = (UINT32*)memregion( "maincpu" )->base();
m_mainram = (UINT32*)auto_alloc_array_clear(machine(), UINT32, 0x10000);
m_mainram = make_unique_clear<UINT32[]>(0x10000);
}

View File

@ -175,9 +175,9 @@ public:
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
UINT16 *m_paletteram;
UINT8 *m_vram;
UINT8 *m_bitmap_vram;
std::unique_ptr<UINT16[]> m_paletteram;
std::unique_ptr<UINT8[]> m_vram;
std::unique_ptr<UINT8[]> m_bitmap_vram;
UINT16 sh7021_regs[0x100];
int m_gfx_index;
DECLARE_DRIVER_INIT(casloopy);
@ -225,9 +225,9 @@ static const gfx_layout casloopy_8bpp_layout =
void casloopy_state::video_start()
{
/* TODO: proper sizes */
m_paletteram = auto_alloc_array_clear(machine(), UINT16, 0x1000);
m_vram = auto_alloc_array_clear(machine(), UINT8, 0x10000);
m_bitmap_vram = auto_alloc_array_clear(machine(), UINT8, 0x20000);
m_paletteram = make_unique_clear<UINT16[]>(0x1000);
m_vram = make_unique_clear<UINT8[]>(0x10000);
m_bitmap_vram = make_unique_clear<UINT8[]>(0x20000);
for (m_gfx_index = 0; m_gfx_index < MAX_GFX_ELEMENTS; m_gfx_index++)
if (m_gfxdecode->gfx(m_gfx_index) == nullptr)
@ -236,8 +236,8 @@ void casloopy_state::video_start()
for(int i=0;i<0x10000;i++)
m_vram[i] = i & 0xff;
m_gfxdecode->set_gfx(m_gfx_index, global_alloc(gfx_element(m_palette, casloopy_4bpp_layout, m_vram, 0, 0x10, 0)));
m_gfxdecode->set_gfx(m_gfx_index+1, global_alloc(gfx_element(m_palette, casloopy_8bpp_layout, m_vram, 0, 1, 0)));
m_gfxdecode->set_gfx(m_gfx_index, global_alloc(gfx_element(m_palette, casloopy_4bpp_layout, m_vram.get(), 0, 0x10, 0)));
m_gfxdecode->set_gfx(m_gfx_index+1, global_alloc(gfx_element(m_palette, casloopy_8bpp_layout, m_vram.get(), 0, 1, 0)));
}
UINT32 casloopy_state::screen_update_casloopy(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)

View File

@ -42,7 +42,7 @@ public:
int m_tilexor;
UINT8 m_blacklamp;
UINT8 m_redlamp;
UINT8 *m_vram;
std::unique_ptr<UINT8[]> m_vram;
required_device<z180_device> m_maincpu;
required_device<gfxdecode_device> m_gfxdecode;
@ -65,7 +65,7 @@ public:
void chsuper_state::video_start()
{
m_vram = auto_alloc_array_clear(machine(), UINT8, 1 << 14);
m_vram = make_unique_clear<UINT8[]>(1 << 14);
}
UINT32 chsuper_state::screen_update( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect )

View File

@ -451,9 +451,9 @@ public:
int debug_randompal;
UINT16 *m_h1_vram;
UINT8 *m_h1_pcg;
UINT16 *m_h1_pal;
std::unique_ptr<UINT16[]> m_h1_vram;
std::unique_ptr<UINT8[]> m_h1_pcg;
std::unique_ptr<UINT16[]> m_h1_pal;
int m_gfx_index;
int m_color_bank;
struct {
@ -573,7 +573,7 @@ void coolridr_state::video_start()
m_screen->register_screen_bitmap(m_screen1_bitmap);
m_screen->register_screen_bitmap(m_screen2_bitmap);
m_gfxdecode->set_gfx(m_gfx_index, global_alloc(gfx_element(m_palette, h1_tile_layout, m_h1_pcg, 0, 8, 0)));
m_gfxdecode->set_gfx(m_gfx_index, global_alloc(gfx_element(m_palette, h1_tile_layout, m_h1_pcg.get(), 0, 8, 0)));
}
/*
@ -3667,9 +3667,9 @@ void coolridr_state::machine_start()
}
}
m_h1_vram = auto_alloc_array_clear(machine(), UINT16, VRAM_SIZE);
m_h1_pcg = auto_alloc_array_clear(machine(), UINT8, VRAM_SIZE);
m_h1_pal = auto_alloc_array_clear(machine(), UINT16, VRAM_SIZE);
m_h1_vram = make_unique_clear<UINT16[]>(VRAM_SIZE);
m_h1_pcg = make_unique_clear<UINT8[]>(VRAM_SIZE);
m_h1_pal = make_unique_clear<UINT16[]>(VRAM_SIZE);
m_cool_render_object_list1 = auto_alloc_array_clear(machine(), struct cool_render_object*, 1000000);
m_listcount1 = 0;
@ -3683,9 +3683,9 @@ void coolridr_state::machine_start()
decode[1].current_object = 0;
debug_randompal = 9;
save_pointer(NAME(m_h1_vram), VRAM_SIZE);
save_pointer(NAME(m_h1_pcg), VRAM_SIZE);
save_pointer(NAME(m_h1_pal), VRAM_SIZE);
save_pointer(NAME(m_h1_vram.get()), VRAM_SIZE);
save_pointer(NAME(m_h1_pcg.get()), VRAM_SIZE);
save_pointer(NAME(m_h1_pal.get()), VRAM_SIZE);
}
void coolridr_state::machine_reset()

View File

@ -330,7 +330,7 @@ public:
UINT8 m_blitter_y_reg;
UINT8 m_blitter_aux_reg;
UINT8 m_blitter_unk_reg;
UINT8 *m_videobuf;
std::unique_ptr<UINT8[]> m_videobuf;
UINT8 m_lamp;
UINT8 m_lamp_old;
int m_input_selector;
@ -462,7 +462,7 @@ WRITE8_MEMBER(corona_state::blitter_trig_wdht_w)
void corona_state::video_start()
{
m_videobuf = auto_alloc_array_clear(machine(), UINT8, VIDEOBUF_SIZE);
m_videobuf = make_unique_clear<UINT8[]>(VIDEOBUF_SIZE);
}
UINT32 corona_state::screen_update_winner(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)

View File

@ -122,7 +122,7 @@ public:
required_shared_ptr<UINT32> m_vregs;
required_shared_ptr<UINT32> m_workram;
UINT16* m_lineram16;
std::unique_ptr<UINT16[]> m_lineram16;
DECLARE_READ16_MEMBER(lineram16_r) { return m_lineram16[offset]; }
DECLARE_WRITE16_MEMBER(lineram16_w) { COMBINE_DATA(&m_lineram16[offset]); }
@ -274,8 +274,8 @@ void dreamwld_state::video_start()
m_spritebuf1 = std::make_unique<UINT32[]>(0x2000 / 4);
m_spritebuf2 = std::make_unique<UINT32[]>(0x2000 / 4);
m_lineram16 = (UINT16*)auto_alloc_array_clear(this->machine(), UINT16, 0x400 / 2);
save_pointer(NAME(m_lineram16), 0x400/2);
m_lineram16 = make_unique_clear<UINT16[]>(0x400 / 2);
save_pointer(NAME(m_lineram16.get()), 0x400/2);
}

View File

@ -43,8 +43,8 @@ public:
UINT8 x;
UINT8 y;
UINT8 status;
UINT8 *vram;
UINT8 *attr;
std::unique_ptr<UINT8[]> vram;
std::unique_ptr<UINT8[]> attr;
}m_lcd;
UINT8 read_lcd_attr(UINT16 X, UINT16 Y);
UINT8 read_lcd_vram(UINT16 X, UINT16 Y);
@ -76,8 +76,8 @@ protected:
void fp200_state::video_start()
{
m_lcd.vram = auto_alloc_array_clear(machine(), UINT8, 20*64);
m_lcd.attr = auto_alloc_array_clear(machine(), UINT8, 20*64);
m_lcd.vram = make_unique_clear<UINT8[]>(20*64);
m_lcd.attr = make_unique_clear<UINT8[]>(20*64);
}
/* TODO: Very preliminary, I actually believe that the LCDC writes in a blitter fashion ... */

View File

@ -377,7 +377,7 @@ public:
emu_timer *m_sound_irq_timer;
UINT8 m_led_reg0;
UINT8 m_led_reg1;
UINT8 *m_jvs_sdata;
std::unique_ptr<UINT8[]> m_jvs_sdata;
UINT32 m_jvs_sdata_ptr;
UINT16 m_gn680_latch;
UINT16 m_gn680_ret0;
@ -928,7 +928,7 @@ INPUT_PORTS_END
void hornet_state::machine_start()
{
m_jvs_sdata_ptr = 0;
m_jvs_sdata = auto_alloc_array_clear(machine(), UINT8, 1024);
m_jvs_sdata = make_unique_clear<UINT8[]>(1024);
/* set conservative DRC options */
m_maincpu->ppcdrc_set_options(PPCDRC_COMPATIBLE_OPTIONS);
@ -938,7 +938,7 @@ void hornet_state::machine_start()
save_item(NAME(m_led_reg0));
save_item(NAME(m_led_reg1));
save_pointer(NAME(m_jvs_sdata), 1024);
save_pointer(NAME(m_jvs_sdata.get()), 1024);
save_item(NAME(m_jvs_sdata_ptr));
m_sound_irq_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(hornet_state::sound_irq), this));

View File

@ -372,8 +372,8 @@ TIMER_DEVICE_CALLBACK_MEMBER(model2_state::model2_timer_cb)
MACHINE_START_MEMBER(model2_state,model2)
{
m_copro_fifoin_data = auto_alloc_array_clear(machine(), UINT32, COPRO_FIFOIN_SIZE);
m_copro_fifoout_data = auto_alloc_array_clear(machine(), UINT32, COPRO_FIFOOUT_SIZE);
m_copro_fifoin_data = make_unique_clear<UINT32[]>(COPRO_FIFOIN_SIZE);
m_copro_fifoout_data = make_unique_clear<UINT32[]>(COPRO_FIFOOUT_SIZE);
}
MACHINE_RESET_MEMBER(model2_state,model2_common)

View File

@ -1670,7 +1670,7 @@ READ64_MEMBER(model3_state::network_r)
WRITE64_MEMBER(model3_state::network_w)
{
COMBINE_DATA(m_network_ram + offset);
COMBINE_DATA(m_network_ram.get() + offset);
osd_printf_debug("network_w: %02X, %08X%08X at %08X\n", offset, (UINT32)(data >> 32), (UINT32)(data), space.device().safe_pc());
}
@ -5820,7 +5820,7 @@ DRIVER_INIT_MEMBER(model3_state,harley)
{
DRIVER_INIT_CALL(model3_20);
m_network_ram = auto_alloc_array_clear(machine(), UINT64, 0x10000);
m_network_ram = make_unique_clear<UINT64[]>(0x10000);
m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0xc0000000, 0xc00fffff, read64_delegate(FUNC(model3_state::network_r),this), write64_delegate(FUNC(model3_state::network_w),this));
}
@ -5828,7 +5828,7 @@ DRIVER_INIT_MEMBER(model3_state,harleya)
{
DRIVER_INIT_CALL(model3_20);
m_network_ram = auto_alloc_array_clear(machine(), UINT64, 0x10000);
m_network_ram = make_unique_clear<UINT64[]>(0x10000);
m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0xc0000000, 0xc00fffff, read64_delegate(FUNC(model3_state::network_r),this), write64_delegate(FUNC(model3_state::network_w),this));
}

View File

@ -72,8 +72,8 @@ public:
UINT8 *m_file_rom;
UINT8 *m_app_rom;
UINT8 *m_file_ram;
UINT8 *m_app_ram;
std::unique_ptr<UINT8[]> m_file_ram;
std::unique_ptr<UINT8[]> m_app_ram;
DECLARE_READ8_MEMBER(file_r);
DECLARE_WRITE8_MEMBER(file_w);
@ -267,8 +267,8 @@ void molecula_state::machine_start()
m_file_rom = memregion("fileipl")->base();
m_app_rom = memregion("appipl")->base();
m_file_ram = auto_alloc_array_clear(machine(), UINT8, 0x10000);
m_app_ram = auto_alloc_array_clear(machine(), UINT8, 0x10000);
m_file_ram = make_unique_clear<UINT8[]>(0x10000);
m_app_ram = make_unique_clear<UINT8[]>(0x10000);
}
void molecula_state::machine_reset()

View File

@ -57,7 +57,7 @@ public:
m_maincpu(*this, "maincpu")
{ }
UINT32* m_cpuregion;
UINT32* m_mainram;
std::unique_ptr<UINT32[]> m_mainram;
SEC sec;
UINT8 m_led_strobe_temp;
@ -386,7 +386,7 @@ INPUT_PORTS_END
void mpu5_state::machine_start()
{
m_cpuregion = (UINT32*)memregion( "maincpu" )->base();
m_mainram = (UINT32*)auto_alloc_array_clear(machine(), UINT32, 0x10000);
m_mainram = make_unique_clear<UINT32[]>(0x10000);
m_pic_output_bit =0;
}

View File

@ -93,12 +93,12 @@ public:
floppy_image_device *m_floppy;
UINT8 *m_main_ram;
std::unique_ptr<UINT8[]> m_main_ram;
UINT8 *m_ipl_rom;
UINT8 *m_kanji_rom;
UINT8 *m_kanji2_rom;
UINT8 *m_pcg_ram;
UINT8 *m_emm_ram;
std::unique_ptr<UINT8[]> m_pcg_ram;
std::unique_ptr<UINT8[]> m_emm_ram;
UINT8 *m_dic_rom;
UINT8 *m_phone_rom;
UINT8 *m_iplpro_rom;
@ -292,7 +292,7 @@ void mz2500_state::mz2500_draw_pixel(bitmap_ind16 &bitmap,int x,int y,UINT16 pe
void mz2500_state::draw_80x25(bitmap_ind16 &bitmap,const rectangle &cliprect,UINT16 map_addr)
{
UINT8 *vram = m_main_ram; // TODO
UINT8 *vram = m_main_ram.get(); // TODO
int x,y,count,xi,yi;
UINT8 *gfx_data;
UINT8 y_step;
@ -317,7 +317,7 @@ void mz2500_state::draw_80x25(bitmap_ind16 &bitmap,const rectangle &cliprect,UIN
int inv_col = (attr & 0x40) >> 6;
if(gfx_sel & 8) // Xevious, PCG 8 colors have priority above kanji roms
gfx_data = m_pcg_ram;
gfx_data = m_pcg_ram.get();
else if(gfx_sel == 0x80)
{
gfx_data = m_kanji_rom;
@ -335,7 +335,7 @@ void mz2500_state::draw_80x25(bitmap_ind16 &bitmap,const rectangle &cliprect,UIN
}
else
{
gfx_data = m_pcg_ram;
gfx_data = m_pcg_ram.get();
}
for(yi=0;yi<8*y_step;yi++)
@ -381,7 +381,7 @@ void mz2500_state::draw_80x25(bitmap_ind16 &bitmap,const rectangle &cliprect,UIN
void mz2500_state::draw_40x25(bitmap_ind16 &bitmap,const rectangle &cliprect,int plane,UINT16 map_addr)
{
UINT8 *vram = m_main_ram; // TODO
UINT8 *vram = m_main_ram.get(); // TODO
int x,y,count,xi,yi;
UINT8 *gfx_data;
UINT8 y_step;
@ -407,7 +407,7 @@ void mz2500_state::draw_40x25(bitmap_ind16 &bitmap,const rectangle &cliprect,int
int inv_col = (attr & 0x40) >> 6;
if(gfx_sel & 8) // Xevious, PCG 8 colors have priority above kanji roms
gfx_data = m_pcg_ram;
gfx_data = m_pcg_ram.get();
else if(gfx_sel == 0x80)
{
gfx_data = m_kanji_rom;
@ -425,7 +425,7 @@ void mz2500_state::draw_40x25(bitmap_ind16 &bitmap,const rectangle &cliprect,int
}
else
{
gfx_data = m_pcg_ram;
gfx_data = m_pcg_ram.get();
}
for(yi=0;yi<8*y_step;yi++)
@ -472,7 +472,7 @@ void mz2500_state::draw_40x25(bitmap_ind16 &bitmap,const rectangle &cliprect,int
void mz2500_state::draw_cg4_screen(bitmap_ind16 &bitmap,const rectangle &cliprect,int pri)
{
UINT32 count;
UINT8 *vram = m_main_ram; // TODO
UINT8 *vram = m_main_ram.get(); // TODO
UINT8 pen,pen_bit[2];
int x,y,xi,pen_i;
int res_x,res_y;
@ -513,7 +513,7 @@ void mz2500_state::draw_cg4_screen(bitmap_ind16 &bitmap,const rectangle &cliprec
void mz2500_state::draw_cg16_screen(bitmap_ind16 &bitmap,const rectangle &cliprect,int plane,int x_size,int pri)
{
UINT32 count;
UINT8 *vram = m_main_ram; //TODO
UINT8 *vram = m_main_ram.get(); //TODO
UINT8 pen,pen_bit[4];
int x,y,xi,pen_i;
UINT32 wa_reg;
@ -570,7 +570,7 @@ void mz2500_state::draw_cg16_screen(bitmap_ind16 &bitmap,const rectangle &clipre
void mz2500_state::draw_cg256_screen(bitmap_ind16 &bitmap,const rectangle &cliprect,int plane,int pri)
{
UINT32 count;
UINT8 *vram = m_main_ram;
UINT8 *vram = m_main_ram.get();
UINT8 pen,pen_bit[8];
int x,y,xi,pen_i;
UINT32 wa_reg;
@ -801,7 +801,7 @@ UINT8 mz2500_state::mz2500_cg_latch_compare()
UINT8 mz2500_state::mz2500_ram_read(UINT16 offset, UINT8 bank_num)
{
UINT8 *ram = m_main_ram; // TODO
UINT8 *ram = m_main_ram.get(); // TODO
UINT8 cur_bank = m_bank_val[bank_num];
switch(cur_bank)
@ -859,7 +859,7 @@ UINT8 mz2500_state::mz2500_ram_read(UINT16 offset, UINT8 bank_num)
void mz2500_state::mz2500_ram_write(UINT16 offset, UINT8 data, UINT8 bank_num)
{
UINT8 *ram = m_main_ram; // TODO
UINT8 *ram = m_main_ram.get(); // TODO
UINT8 cur_bank = m_bank_val[bank_num];
// if(cur_bank >= 0x30 && cur_bank <= 0x33)
@ -1361,7 +1361,7 @@ WRITE8_MEMBER(mz2500_state::mz2500_cg_data_w)
if((m_cg_reg_index & 0x1f) == 0x05 && (m_cg_reg[0x05] & 0xc0) == 0x80) //clear bitmap buffer
{
UINT32 i;
UINT8 *vram = m_main_ram; // TODO
UINT8 *vram = m_main_ram.get(); // TODO
UINT32 layer_bank;
layer_bank = (m_cg_reg[0x0e] & 0x80) ? 0x10000 : 0x00000;
@ -1756,23 +1756,23 @@ static const gfx_layout mz2500_pcg_layout_3bpp =
void mz2500_state::machine_start()
{
/* TODO: main RAM actually needs to be splitted */
m_main_ram = auto_alloc_array_clear(machine(), UINT8, 0x80000);
m_pcg_ram = auto_alloc_array_clear(machine(), UINT8, 0x2000);
m_main_ram = make_unique_clear<UINT8[]>(0x80000);
m_pcg_ram = make_unique_clear<UINT8[]>(0x2000);
m_ipl_rom = memregion("ipl")->base();
m_kanji_rom = memregion("kanji")->base();
m_kanji2_rom = memregion("kanji2")->base();
m_emm_ram = auto_alloc_array_clear(machine(), UINT8, 0x100000);
m_emm_ram = make_unique_clear<UINT8[]>(0x100000);
m_dic_rom = memregion("dictionary")->base();
m_phone_rom = memregion("phone")->base();
m_iplpro_rom = memregion("iplpro")->base();
save_pointer(NAME(m_main_ram), 0x80000);
save_pointer(NAME(m_pcg_ram), 0x2000);
save_pointer(NAME(m_emm_ram), 0x100000);
save_pointer(NAME(m_main_ram.get()), 0x80000);
save_pointer(NAME(m_pcg_ram.get()), 0x2000);
save_pointer(NAME(m_emm_ram.get()), 0x100000);
/* TODO: gfx[4] crashes as per now */
m_gfxdecode->set_gfx(3, global_alloc(gfx_element(m_palette, mz2500_pcg_layout_1bpp, (UINT8 *)m_pcg_ram, 0, 0x10, 0)));
m_gfxdecode->set_gfx(4, global_alloc(gfx_element(m_palette, mz2500_pcg_layout_3bpp, (UINT8 *)m_pcg_ram, 0, 4, 0)));
m_gfxdecode->set_gfx(3, global_alloc(gfx_element(m_palette, mz2500_pcg_layout_1bpp, m_pcg_ram.get(), 0, 0x10, 0)));
m_gfxdecode->set_gfx(4, global_alloc(gfx_element(m_palette, mz2500_pcg_layout_3bpp, m_pcg_ram.get(), 0, 4, 0)));
}
void mz2500_state::machine_reset()

View File

@ -67,8 +67,8 @@ public:
UINT8 *m_ipl_rom;
UINT8 *m_basic_rom;
UINT8 *m_work_ram;
UINT8 *m_shared_ram;
std::unique_ptr<UINT8[]> m_work_ram;
std::unique_ptr<UINT8[]> m_shared_ram;
UINT8 *m_char_rom;
UINT8 m_ma,m_mo,m_ms,m_me2,m_me1;
@ -741,8 +741,8 @@ void mz3500_state::machine_start()
m_ipl_rom = memregion("ipl")->base();
m_basic_rom = memregion("basic")->base();
m_char_rom = memregion("gfx1")->base();
m_work_ram = auto_alloc_array_clear(machine(), UINT8, 0x40000);
m_shared_ram = auto_alloc_array_clear(machine(), UINT8, 0x800);
m_work_ram = make_unique_clear<UINT8[]>(0x40000);
m_shared_ram = make_unique_clear<UINT8[]>(0x800);
static const char *const m_fddnames[4] = { "upd765a:0", "upd765a:1", "upd765a:2", "upd765a:3"};

View File

@ -195,7 +195,7 @@ public:
IRQ_CALLBACK_MEMBER(neocd_int_callback);
UINT8 *m_meminternal_data;
std::unique_ptr<UINT8[]> m_meminternal_data;
protected:
required_ioport m_io_in2;
required_ioport m_io_in0;
@ -1055,9 +1055,9 @@ MACHINE_START_MEMBER(ng_aes_state,neocd)
/* initialize the memcard data structure */
/* NeoCD doesn't have memcard slots, rather, it has a larger internal memory which works the same */
m_meminternal_data = auto_alloc_array_clear(machine(), UINT8, 0x2000);
machine().device<nvram_device>("saveram")->set_base(m_meminternal_data, 0x2000);
save_pointer(NAME(m_meminternal_data), 0x2000);
m_meminternal_data = make_unique_clear<UINT8[]>(0x2000);
machine().device<nvram_device>("saveram")->set_base(m_meminternal_data.get(), 0x2000);
save_pointer(NAME(m_meminternal_data.get()), 0x2000);
//m_bank_vectors->set_entry(0); // default to the BIOS vectors
m_use_cart_vectors = 0;

View File

@ -567,7 +567,7 @@
void norautp_state::video_start()
{
m_np_vram = auto_alloc_array_clear(machine(), UINT16, 0x1000/2);
m_np_vram = make_unique_clear<UINT16[]>(0x1000/2);
}

View File

@ -315,7 +315,7 @@ public:
optional_device<palette_device> m_palette;
UINT8 m_wram_wp_flag;
UINT8 *m_wram;
std::unique_ptr<UINT8[]> m_wram;
UINT8 m_nmi_enable;
UINT8 m_cart_sel;
UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
@ -623,7 +623,7 @@ void nss_state::machine_start()
snes_state::machine_start();
m_is_nss = 1;
m_wram = auto_alloc_array_clear(machine(), UINT8, 0x1000);
m_wram = make_unique_clear<UINT8[]>(0x1000);
}

View File

@ -324,10 +324,10 @@ public:
required_device<ym2203_device> m_opn;
required_device<palette_device> m_palette;
UINT8 *m_work_ram;
UINT8 *m_hi_work_ram;
UINT8 *m_ext_work_ram;
UINT8 *m_gvram;
std::unique_ptr<UINT8[]> m_work_ram;
std::unique_ptr<UINT8[]> m_hi_work_ram;
std::unique_ptr<UINT8[]> m_ext_work_ram;
std::unique_ptr<UINT8[]> m_gvram;
UINT8 *m_n80rom;
UINT8 *m_n88rom;
UINT8 *m_kanji_rom;
@ -689,7 +689,7 @@ UINT8 pc8801_state::calc_cursor_pos(int x,int y,int yi)
UINT8 pc8801_state::extract_text_attribute(UINT32 address,int x, UINT8 width, UINT8 &non_special)
{
UINT8 *vram = m_work_ram;
UINT8 *vram = m_work_ram.get();
int i;
int fifo_size;
int offset;
@ -728,7 +728,7 @@ UINT8 pc8801_state::extract_text_attribute(UINT32 address,int x, UINT8 width, UI
void pc8801_state::pc8801_draw_char(bitmap_ind16 &bitmap,int x,int y,int pal,UINT8 gfx_mode,UINT8 reverse,UINT8 secret,UINT8 blink,UINT8 upper,UINT8 lower,int y_size,int width, UINT8 non_special)
{
int xi,yi;
UINT8 *vram = m_work_ram;
UINT8 *vram = m_work_ram.get();
UINT8 is_cursor;
UINT8 y_height, y_double;
UINT8 y_step;
@ -2400,19 +2400,19 @@ void pc8801_state::machine_start()
m_rtc->cs_w(1);
m_rtc->oe_w(1);
m_work_ram = auto_alloc_array_clear(machine(), UINT8, 0x10000);
m_hi_work_ram = auto_alloc_array_clear(machine(), UINT8, 0x1000);
m_ext_work_ram = auto_alloc_array_clear(machine(), UINT8, 0x8000*0x100);
m_gvram = auto_alloc_array_clear(machine(), UINT8, 0xc000);
m_work_ram = make_unique_clear<UINT8[]>(0x10000);
m_hi_work_ram = make_unique_clear<UINT8[]>(0x1000);
m_ext_work_ram = make_unique_clear<UINT8[]>(0x8000*0x100);
m_gvram = make_unique_clear<UINT8[]>(0xc000);
m_n80rom = memregion("n80rom")->base();
m_n88rom = memregion("n88rom")->base();
m_kanji_rom = memregion("kanji")->base();
m_cg_rom = memregion("cgrom")->base();
save_pointer(NAME(m_work_ram), 0x10000);
save_pointer(NAME(m_hi_work_ram), 0x1000);
save_pointer(NAME(m_ext_work_ram), 0x8000*0x100);
save_pointer(NAME(m_gvram), 0xc000);
save_pointer(NAME(m_work_ram.get()), 0x10000);
save_pointer(NAME(m_hi_work_ram.get()), 0x1000);
save_pointer(NAME(m_ext_work_ram.get()), 0x8000*0x100);
save_pointer(NAME(m_gvram.get()), 0xc000);
}
void pc8801_state::machine_reset()

View File

@ -189,7 +189,7 @@ public:
{ }
UINT32* m_cpuregion;
UINT32* m_mainram;
std::unique_ptr<UINT32[]> m_mainram;
DECLARE_READ32_MEMBER(pluto5_mem_r);
DECLARE_WRITE32_MEMBER(pluto5_mem_w);
@ -246,7 +246,7 @@ INPUT_PORTS_END
void pluto5_state::machine_start()
{
m_cpuregion = (UINT32*)memregion( "maincpu" )->base();
m_mainram = (UINT32*)auto_alloc_array_clear(machine(), UINT32, 0x10000);
m_mainram = make_unique_clear<UINT32[]>(0x10000);
}

View File

@ -91,7 +91,7 @@ public:
required_device<rs232_port_device> m_kbd;
UINT8 m_vram_bank;
//required_shared_ptr<UINT8> m_video_ram;
UINT16 *m_video_ram;
std::unique_ptr<UINT16[]> m_video_ram;
UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
@ -620,7 +620,7 @@ GFXDECODE_END
void qx10_state::video_start()
{
// allocate memory
m_video_ram = auto_alloc_array_clear(machine(), UINT16, 0x30000);
m_video_ram = make_unique_clear<UINT16[]>(0x30000);
// find memory regions
m_char_rom = memregion("chargen")->base();

View File

@ -131,7 +131,7 @@ public:
int m_vblirqlevel;
int m_bltirqlevel;
int m_banking;
UINT32 *m_tilemap_ram[4];
std::unique_ptr<UINT32[]> m_tilemap_ram[4];
tilemap_t *m_tilemap[4];
DECLARE_WRITE32_MEMBER(tilemap0_w);
@ -414,10 +414,10 @@ void rabbit_state::video_start()
{
/* the tilemaps are bigger than the regions the cpu can see, need to allocate the ram here */
/* or maybe not for this game/hw .... */
m_tilemap_ram[0] = auto_alloc_array_clear(machine(), UINT32, 0x20000/4);
m_tilemap_ram[1] = auto_alloc_array_clear(machine(), UINT32, 0x20000/4);
m_tilemap_ram[2] = auto_alloc_array_clear(machine(), UINT32, 0x20000/4);
m_tilemap_ram[3] = auto_alloc_array_clear(machine(), UINT32, 0x20000/4);
m_tilemap_ram[0] = make_unique_clear<UINT32[]>(0x20000/4);
m_tilemap_ram[1] = make_unique_clear<UINT32[]>(0x20000/4);
m_tilemap_ram[2] = make_unique_clear<UINT32[]>(0x20000/4);
m_tilemap_ram[3] = make_unique_clear<UINT32[]>(0x20000/4);
m_tilemap[0] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(rabbit_state::get_tilemap0_tile_info),this),TILEMAP_SCAN_ROWS,16, 16, 128,32);
m_tilemap[1] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(rabbit_state::get_tilemap1_tile_info),this),TILEMAP_SCAN_ROWS,16, 16, 128,32);
@ -437,10 +437,10 @@ void rabbit_state::video_start()
m_sprite_bitmap = std::make_unique<bitmap_ind16>(0x1000,0x1000);
m_sprite_clip.set(0, 0x1000-1, 0, 0x1000-1);
save_pointer(NAME(m_tilemap_ram[0]), 0x20000/4);
save_pointer(NAME(m_tilemap_ram[1]), 0x20000/4);
save_pointer(NAME(m_tilemap_ram[2]), 0x20000/4);
save_pointer(NAME(m_tilemap_ram[3]), 0x20000/4);
save_pointer(NAME(m_tilemap_ram[0].get()), 0x20000/4);
save_pointer(NAME(m_tilemap_ram[1].get()), 0x20000/4);
save_pointer(NAME(m_tilemap_ram[2].get()), 0x20000/4);
save_pointer(NAME(m_tilemap_ram[3].get()), 0x20000/4);
}
/*

View File

@ -479,15 +479,15 @@ TILE_GET_INFO_MEMBER(raiden2_state::get_text_tile_info)
VIDEO_START_MEMBER(raiden2_state,raiden2)
{
back_data = auto_alloc_array_clear(machine(), UINT16, 0x800/2);
fore_data = auto_alloc_array_clear(machine(), UINT16, 0x800/2);
mid_data = auto_alloc_array_clear(machine(), UINT16, 0x800/2);
text_data = auto_alloc_array_clear(machine(), UINT16, 0x1000/2);
back_data = make_unique_clear<UINT16[]>(0x800/2);
fore_data = make_unique_clear<UINT16[]>(0x800/2);
mid_data = make_unique_clear<UINT16[]>(0x800/2);
text_data = make_unique_clear<UINT16[]>(0x1000/2);
save_pointer(NAME(back_data), 0x800/2);
save_pointer(NAME(fore_data), 0x800/2);
save_pointer(NAME(mid_data), 0x800/2);
save_pointer(NAME(text_data), 0x1000/2);
save_pointer(NAME(back_data.get()), 0x800/2);
save_pointer(NAME(fore_data.get()), 0x800/2);
save_pointer(NAME(mid_data.get()), 0x800/2);
save_pointer(NAME(text_data.get()), 0x1000/2);
text_layer = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(raiden2_state::get_text_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64,32 );
background_layer = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(raiden2_state::get_back_tile_info),this), TILEMAP_SCAN_ROWS, 16,16, 32,32 );

View File

@ -81,7 +81,7 @@ public:
required_device<cpu_device> m_soundcpu;
UINT8 m_reg[0x10];
UINT8 *m_videobuf;
std::unique_ptr<UINT8[]> m_videobuf;
UINT8 m_lamp_old;
DECLARE_READ8_MEMBER(blitter_status_r);
@ -222,10 +222,10 @@ ADDRESS_MAP_END
void roul_state::video_start()
{
m_videobuf = auto_alloc_array_clear(machine(), UINT8, VIDEOBUF_SIZE);
m_videobuf = make_unique_clear<UINT8[]>(VIDEOBUF_SIZE);
save_item(NAME(m_reg));
save_pointer(NAME(m_videobuf), VIDEOBUF_SIZE);
save_pointer(NAME(m_videobuf.get()), VIDEOBUF_SIZE);
save_item(NAME(m_lamp_old));
}

View File

@ -388,7 +388,7 @@ void rungun_state::machine_start()
m_roz_rom = memregion("gfx1")->base();
membank("bank2")->configure_entries(0, 8, &ROM[0x10000], 0x4000);
m_banked_ram = auto_alloc_array_clear(machine(), UINT16, 0x2000);
m_banked_ram = make_unique_clear<UINT16[]>(0x2000);
m_pal_ram = make_unique_clear<UINT16[]>(0x800*2);
membank("spriteram_bank")->configure_entries(0,2,&m_banked_ram[0],0x2000);

View File

@ -285,7 +285,7 @@ void simpsons_state::simpsons_objdma( )
m_k053246->k053247_get_ram(&dst);
src = m_spriteram;
src = m_spriteram.get();
num_inactive = counter = 256;
do {

View File

@ -112,11 +112,11 @@ private:
required_device<palette_device> m_palette;
UINT8 *m_ipl_rom;
UINT8 *m_work_ram;
UINT8 *m_vram;
UINT8 *m_attr;
UINT8 *m_gvram;
UINT8 *m_pcg;
std::unique_ptr<UINT8[]> m_work_ram;
std::unique_ptr<UINT8[]> m_vram;
std::unique_ptr<UINT8[]> m_attr;
std::unique_ptr<UINT8[]> m_gvram;
std::unique_ptr<UINT8[]> m_pcg;
UINT8 m_keyb_press;
UINT8 m_keyb_press_flag;
@ -903,19 +903,19 @@ static const gfx_layout smc777_charlayout =
void smc777_state::machine_start()
{
m_ipl_rom = memregion("ipl")->base();
m_work_ram = auto_alloc_array_clear(machine(), UINT8, 0x10000);
m_vram = auto_alloc_array_clear(machine(), UINT8, 0x800);
m_attr = auto_alloc_array_clear(machine(), UINT8, 0x800);
m_gvram = auto_alloc_array_clear(machine(), UINT8, 0x8000);
m_pcg = auto_alloc_array_clear(machine(), UINT8, 0x800);
m_work_ram = make_unique_clear<UINT8[]>(0x10000);
m_vram = make_unique_clear<UINT8[]>(0x800);
m_attr = make_unique_clear<UINT8[]>(0x800);
m_gvram = make_unique_clear<UINT8[]>(0x8000);
m_pcg = make_unique_clear<UINT8[]>(0x800);
save_pointer(NAME(m_work_ram), 0x10000);
save_pointer(NAME(m_vram), 0x800);
save_pointer(NAME(m_attr), 0x800);
save_pointer(NAME(m_gvram), 0x8000);
save_pointer(NAME(m_pcg), 0x800);
save_pointer(NAME(m_work_ram.get()), 0x10000);
save_pointer(NAME(m_vram.get()), 0x800);
save_pointer(NAME(m_attr.get()), 0x800);
save_pointer(NAME(m_gvram.get()), 0x8000);
save_pointer(NAME(m_pcg.get()), 0x800);
m_gfxdecode->set_gfx(0, global_alloc(gfx_element(m_palette, smc777_charlayout, (UINT8 *)m_pcg, 0, 8, 0)));
m_gfxdecode->set_gfx(0, global_alloc(gfx_element(m_palette, smc777_charlayout, m_pcg.get(), 0, 8, 0)));
}
void smc777_state::machine_reset()

View File

@ -183,7 +183,7 @@ private:
UINT8 m_IPLK;
UINT8 m_GMODE;
UINT16 m_page;
UINT8 *m_work_ram;
std::unique_ptr<UINT8[]> m_work_ram;
attotime m_time;
bool m_centronics_busy;
virtual void machine_start() override;
@ -409,7 +409,7 @@ void spc1000_state::machine_start()
void spc1000_state::machine_reset()
{
m_work_ram = auto_alloc_array_clear(machine(), UINT8, 0x10000);
m_work_ram = make_unique_clear<UINT8[]>(0x10000);
m_IPLK = 1;
}

View File

@ -85,13 +85,13 @@ public:
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette") { }
UINT16* m_tileram;
std::unique_ptr<UINT16[]> m_tileram;
required_shared_ptr<UINT16> m_sprram;
required_shared_ptr<UINT16> m_chrram;
optional_shared_ptr<UINT16> m_dmaram;
required_shared_ptr<UINT16> m_video_regs;
UINT16 *m_sprram_old;
std::unique_ptr<UINT16[]> m_sprram_old;
int m_brightness;
UINT16 m_input_select;
@ -167,12 +167,12 @@ void srmp6_state::update_palette()
void srmp6_state::video_start()
{
m_tileram = auto_alloc_array_clear(machine(), UINT16, 0x100000*16/2);
m_tileram = make_unique_clear<UINT16[]>(0x100000*16/2);
m_dmaram.allocate(0x100/2);
m_sprram_old = auto_alloc_array_clear(machine(), UINT16, 0x80000/2);
m_sprram_old = make_unique_clear<UINT16[]>(0x80000/2);
/* create the char set (gfx will then be updated dynamically from RAM) */
m_gfxdecode->set_gfx(0, global_alloc(gfx_element(m_palette, tiles8x8_layout, (UINT8*)m_tileram, 0, m_palette->entries() / 256, 0)));
m_gfxdecode->set_gfx(0, global_alloc(gfx_element(m_palette, tiles8x8_layout, (UINT8*)m_tileram.get(), 0, m_palette->entries() / 256, 0)));
m_gfxdecode->gfx(0)->set_granularity(256);
m_brightness = 0x60;
@ -186,7 +186,7 @@ UINT32 srmp6_state::screen_update_srmp6(screen_device &screen, bitmap_rgb32 &bit
{
int alpha;
int x,y,tileno,height,width,xw,yw,sprite,xb,yb;
UINT16 *sprite_list = m_sprram_old;
UINT16 *sprite_list = m_sprram_old.get();
UINT16 mainlist_offset = 0;
union
@ -292,12 +292,12 @@ UINT32 srmp6_state::screen_update_srmp6(screen_device &screen, bitmap_rgb32 &bit
mainlist_offset+=8;
}
memcpy(m_sprram_old, m_sprram, 0x80000);
memcpy(m_sprram_old.get(), m_sprram, 0x80000);
if(machine().input().code_pressed_once(KEYCODE_Q))
{
FILE *p=fopen("tileram.bin","wb");
fwrite(m_tileram, 1, 0x100000*16, p);
fwrite(m_tileram.get(), 1, 0x100000*16, p);
fclose(p);
}
@ -386,7 +386,7 @@ UINT32 srmp6_state::process(UINT8 b,UINT32 dst_offset)
{
int l=0;
UINT8 *tram=(UINT8*)m_tileram;
UINT8 *tram=(UINT8*)m_tileram.get();
if (m_lastb == m_lastb2) //rle
{

View File

@ -66,7 +66,7 @@ public:
su2000_state(const machine_config &mconfig, device_type type, const char *tag)
: pcat_base_state(mconfig, type, tag){ }
UINT32 *m_pc_ram;
std::unique_ptr<UINT32[]> m_pc_ram;
virtual void machine_start() override;
virtual void machine_reset() override;
};
@ -127,16 +127,16 @@ void su2000_state::machine_start()
address_space &space = m_maincpu->space(AS_PROGRAM);
/* Configure RAM */
m_pc_ram = auto_alloc_array_clear(machine(), UINT32, PC_RAM_SIZE);
m_pc_ram = make_unique_clear<UINT32[]>(PC_RAM_SIZE);
/* Conventional memory */
membank("mem_bank")->set_base(m_pc_ram);
membank("mem_bank")->set_base(m_pc_ram.get());
/* HMA */
offs_t ram_limit = 0x100000 + PC_RAM_SIZE - 0x0a0000;
space.install_read_bank(0x100000, ram_limit - 1, "hma_bank");
space.install_write_bank(0x100000, ram_limit - 1, "hma_bank");
membank("hma_bank")->set_base(m_pc_ram + 0xa0000);
membank("hma_bank")->set_base(m_pc_ram.get() + 0xa0000);
}
void su2000_state::machine_reset()

View File

@ -58,7 +58,7 @@ public:
required_shared_ptr<UINT32> m_spriteregs;
required_shared_ptr<UINT32> m_spriteram;
UINT32 *m_tilemap_ram[4];
std::unique_ptr<UINT32[]> m_tilemap_ram[4];
UINT8 m_mux_data;
UINT8 m_system_in;
double m_old_brt1;
@ -319,9 +319,9 @@ UINT32 tmmjprd_state::screen_update_left(screen_device &screen, bitmap_ind16 &bi
bitmap.fill(m_palette->black_pen(), cliprect);
draw_tilemap(bitmap, cliprect, m_tilemap_ram[3], m_tilemap_regs[3], gfxroms );
draw_tilemap(bitmap, cliprect, m_tilemap_ram[3].get(), m_tilemap_regs[3], gfxroms );
draw_sprites(bitmap,cliprect, 1);
draw_tilemap(bitmap, cliprect, m_tilemap_ram[2], m_tilemap_regs[2], gfxroms );
draw_tilemap(bitmap, cliprect, m_tilemap_ram[2].get(), m_tilemap_regs[2], gfxroms );
/*
popmessage("%08x %08x %08x %08x %08x %08x",
@ -353,9 +353,9 @@ UINT32 tmmjprd_state::screen_update_right(screen_device &screen, bitmap_ind16 &b
bitmap.fill(m_palette->black_pen(), cliprect);
draw_tilemap(bitmap, cliprect, m_tilemap_ram[1], m_tilemap_regs[1], gfxroms );
draw_tilemap(bitmap, cliprect, m_tilemap_ram[1].get(), m_tilemap_regs[1], gfxroms );
draw_sprites(bitmap,cliprect, 0);
draw_tilemap(bitmap, cliprect, m_tilemap_ram[0], m_tilemap_regs[0], gfxroms );
draw_tilemap(bitmap, cliprect, m_tilemap_ram[0].get(), m_tilemap_regs[0], gfxroms );
return 0;
}
@ -364,16 +364,16 @@ void tmmjprd_state::video_start()
{
/* the tilemaps are bigger than the regions the cpu can see, need to allocate the ram here */
/* or maybe not for this game/hw .... */
m_tilemap_ram[0] = auto_alloc_array_clear(machine(), UINT32, 0x8000);
m_tilemap_ram[1] = auto_alloc_array_clear(machine(), UINT32, 0x8000);
m_tilemap_ram[2] = auto_alloc_array_clear(machine(), UINT32, 0x8000);
m_tilemap_ram[3] = auto_alloc_array_clear(machine(), UINT32, 0x8000);
m_tilemap_ram[0] = make_unique_clear<UINT32[]>(0x8000);
m_tilemap_ram[1] = make_unique_clear<UINT32[]>(0x8000);
m_tilemap_ram[2] = make_unique_clear<UINT32[]>(0x8000);
m_tilemap_ram[3] = make_unique_clear<UINT32[]>(0x8000);
save_pointer(NAME(m_tilemap_ram[0]), 0x8000);
save_pointer(NAME(m_tilemap_ram[1]), 0x8000);
save_pointer(NAME(m_tilemap_ram[2]), 0x8000);
save_pointer(NAME(m_tilemap_ram[3]), 0x8000);
save_pointer(NAME(m_tilemap_ram[0].get()), 0x8000);
save_pointer(NAME(m_tilemap_ram[1].get()), 0x8000);
save_pointer(NAME(m_tilemap_ram[2].get()), 0x8000);
save_pointer(NAME(m_tilemap_ram[3].get()), 0x8000);
save_item(NAME(m_old_brt1));
save_item(NAME(m_old_brt2));

View File

@ -182,16 +182,16 @@ public:
DECLARE_WRITE8_MEMBER(lfb1_w);
DECLARE_WRITE8_MEMBER(rfb0_w);
DECLARE_WRITE8_MEMBER(rfb1_w);
UINT16 *m_font;
std::unique_ptr<UINT16[]> m_font;
std::unique_ptr<UINT16[]> m_bgmap;
UINT8 *m_l_frame_0;
UINT8 *m_l_frame_1;
UINT8 *m_r_frame_0;
UINT8 *m_r_frame_1;
std::unique_ptr<UINT8[]> m_l_frame_0;
std::unique_ptr<UINT8[]> m_l_frame_1;
std::unique_ptr<UINT8[]> m_r_frame_0;
std::unique_ptr<UINT8[]> m_r_frame_1;
vboy_regs_t m_vboy_regs;
vip_regs_t m_vip_regs;
vboy_timer_t m_vboy_timer;
INT32 *m_ovr_tempdraw_map;
std::unique_ptr<INT32[]> m_ovr_tempdraw_map;
UINT16 m_frame_count;
UINT8 m_displayfb;
UINT8 m_drawfb;
@ -226,15 +226,15 @@ public:
void vboy_state::video_start()
{
// Allocate memory for temporary screens
m_ovr_tempdraw_map = auto_alloc_array_clear(machine(), INT32, 0x40);
m_ovr_tempdraw_map = make_unique_clear<INT32[]>(0x40);
// Allocate memory for framebuffers
m_l_frame_0 = auto_alloc_array_clear(machine(), UINT8, 0x6000);
m_l_frame_1 = auto_alloc_array_clear(machine(), UINT8, 0x6000);
m_r_frame_0 = auto_alloc_array_clear(machine(), UINT8, 0x6000);
m_r_frame_1 = auto_alloc_array_clear(machine(), UINT8, 0x6000);
m_l_frame_0 = make_unique_clear<UINT8[]>(0x6000);
m_l_frame_1 = make_unique_clear<UINT8[]>(0x6000);
m_r_frame_0 = make_unique_clear<UINT8[]>(0x6000);
m_r_frame_1 = make_unique_clear<UINT8[]>(0x6000);
m_font = auto_alloc_array_clear(machine(), UINT16, (0x8000 >> 1)*4 * 2);
m_font = make_unique_clear<UINT16[]>((0x8000 >> 1)*4 * 2);
m_bgmap = make_unique_clear<UINT16[]>(0x20000 >> 1);
}

View File

@ -224,11 +224,11 @@
VIDEO_START_MEMBER(x1_state,x1)
{
m_avram = auto_alloc_array_clear(machine(), UINT8, 0x800);
m_tvram = auto_alloc_array_clear(machine(), UINT8, 0x800);
m_kvram = auto_alloc_array_clear(machine(), UINT8, 0x800);
m_gfx_bitmap_ram = auto_alloc_array_clear(machine(), UINT8, 0xc000*2);
m_pal_4096 = auto_alloc_array_clear(machine(), UINT8, 0x1000*3);
m_avram = make_unique_clear<UINT8[]>(0x800);
m_tvram = make_unique_clear<UINT8[]>(0x800);
m_kvram = make_unique_clear<UINT8[]>(0x800);
m_gfx_bitmap_ram = make_unique_clear<UINT8[]>(0xc000*2);
m_pal_4096 = make_unique_clear<UINT8[]>(0x1000*3);
}
void x1_state::x1_draw_pixel(bitmap_rgb32 &bitmap,int y,int x,UINT16 pen,UINT8 width,UINT8 height)
@ -340,7 +340,7 @@ void x1_state::draw_fgtilemap(bitmap_rgb32 &bitmap,const rectangle &cliprect)
int width = BIT(m_avram[((x+y*x_size)+mc6845_start_addr) & 0x7ff], 7);
int height = BIT(m_avram[((x+y*x_size)+mc6845_start_addr) & 0x7ff], 6);
int pcg_bank = BIT(m_avram[((x+y*x_size)+mc6845_start_addr) & 0x7ff], 5);
UINT8 *gfx_data = pcg_bank ? m_pcg_ram : m_cg_rom; //machine.root_device().memregion(pcg_bank ? "pcg" : "cgrom")->base();
UINT8 *gfx_data = pcg_bank ? m_pcg_ram.get() : m_cg_rom; //machine.root_device().memregion(pcg_bank ? "pcg" : "cgrom")->base();
int knj_enable = 0;
int knj_side = 0;
int knj_bank = 0;
@ -1132,7 +1132,7 @@ READ8_MEMBER( x1_state::x1_pcg_r )
UINT8 y_char_size;
/* addr == 0 reads from the ANK rom */
gfx_data = addr == 0 ? m_cg_rom : m_pcg_ram;
gfx_data = addr == 0 ? m_cg_rom : m_pcg_ram.get();
y_char_size = ((m_crtc_vreg[9]+1) > 8) ? 8 : m_crtc_vreg[9]+1;
if(y_char_size == 0) { y_char_size = 1; }
pcg_offset = m_tvram[get_pcg_addr(m_crtc_vreg[1], y_char_size)]*8;
@ -2332,7 +2332,7 @@ MACHINE_RESET_MEMBER(x1_state,x1)
//UINT8 *ROM = memregion("x1_cpu")->base();
int i;
memset(m_gfx_bitmap_ram,0x00,0xc000*2);
memset(m_gfx_bitmap_ram.get(),0x00,0xc000*2);
for(i=0;i<0x1800;i++)
{
@ -2410,17 +2410,17 @@ MACHINE_START_MEMBER(x1_state,x1)
}
m_ipl_rom = memregion("ipl")->base();
m_work_ram = auto_alloc_array_clear(machine(), UINT8, 0x10000*0x10);
m_emm_ram = auto_alloc_array_clear(machine(), UINT8, 0x1000000);
m_pcg_ram = auto_alloc_array_clear(machine(), UINT8, 0x1800);
m_work_ram = make_unique_clear<UINT8[]>(0x10000*0x10);
m_emm_ram = make_unique_clear<UINT8[]>(0x1000000);
m_pcg_ram = make_unique_clear<UINT8[]>(0x1800);
m_cg_rom = memregion("cgrom")->base();
m_kanji_rom = memregion("kanji")->base();
save_pointer(NAME(m_work_ram), 0x10000*0x10);
save_pointer(NAME(m_emm_ram), 0x1000000);
save_pointer(NAME(m_pcg_ram), 0x1800);
save_pointer(NAME(m_work_ram.get()), 0x10000*0x10);
save_pointer(NAME(m_emm_ram.get()), 0x1000000);
save_pointer(NAME(m_pcg_ram.get()), 0x1800);
m_gfxdecode->set_gfx(3, global_alloc(gfx_element(m_palette, x1_pcg_8x8, (UINT8 *)m_pcg_ram, 0, 1, 0)));
m_gfxdecode->set_gfx(3, global_alloc(gfx_element(m_palette, x1_pcg_8x8, m_pcg_ram.get(), 0, 1, 0)));
}
PALETTE_INIT_MEMBER(x1_state,x1)

View File

@ -198,7 +198,7 @@ public:
DECLARE_WRITE8_MEMBER(video_pia_B_w);
DECLARE_WRITE_LINE_MEMBER(video_pia_CA2_w);
DECLARE_WRITE_LINE_MEMBER(video_pia_CB2_w);
UINT8 *m_gvram;
std::unique_ptr<UINT8[]> m_gvram;
UINT8 m_keyb_press,m_keyb_status;
UINT8 m_vram_enable;
UINT8 m_gbank;
@ -239,7 +239,7 @@ public:
void z100_state::video_start()
{
m_gvram = auto_alloc_array_clear(machine(), UINT8, 0x30000);
m_gvram = make_unique_clear<UINT8[]>(0x30000);
}
UINT32 z100_state::screen_update_z100(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)

View File

@ -37,8 +37,8 @@ public:
UINT8 m_flipscreen;
UINT8 m_pix_redraw;
UINT8 m_xoffset;
UINT8 *m_pixram1;
UINT8 *m_pixram2;
std::unique_ptr<UINT8[]> m_pixram1;
std::unique_ptr<UINT8[]> m_pixram2;
bitmap_ind16 *m_pixel_bitmap1;
bitmap_ind16 *m_pixel_bitmap2;
int m_pixram_sel;

View File

@ -113,7 +113,7 @@ public:
required_ioport m_adb_mousex, m_adb_mousey;
required_device<palette_device> m_palette;
UINT8 *m_slowmem;
std::unique_ptr<UINT8[]> m_slowmem;
UINT8 m_newvideo;
UINT16 m_bordercolor;
UINT8 m_vgcint;

View File

@ -629,7 +629,7 @@ public:
{ }
UINT32* m_adder4cpuregion;
UINT32* m_adder4ram;
std::unique_ptr<UINT32[]> m_adder4ram;
DECLARE_READ32_MEMBER(adder4_mem_r);
DECLARE_WRITE32_MEMBER(adder4_mem_w);

View File

@ -80,8 +80,8 @@ public:
int m_cdp1869_pcb;
UINT8 *m_pageram;
UINT8 *m_pcbram;
UINT8 *m_charram;
std::unique_ptr<UINT8[]> m_pcbram;
std::unique_ptr<UINT8[]> m_charram;
protected:
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;

View File

@ -27,7 +27,7 @@ public:
UINT8 * m_videoram;
UINT8 * m_scrollram;
UINT8 * m_io_ram;
UINT8 * m_spriteram[2];
std::unique_ptr<UINT8[]> m_spriteram[2];
/* video-related */
tilemap_t *m_bg_tilemap[2];

View File

@ -138,7 +138,7 @@ public:
UINT16 * m_scroll3;
UINT16 * m_obj;
UINT16 * m_other;
UINT16 * m_buffered_obj;
std::unique_ptr<UINT16[]> m_buffered_obj;
optional_shared_ptr<UINT8> m_qsound_sharedram1;
optional_shared_ptr<UINT8> m_qsound_sharedram2;
// cps2
@ -148,7 +148,7 @@ public:
optional_ioport m_io_in0;
optional_ioport m_io_in1;
UINT16 * m_cps2_buffered_obj;
std::unique_ptr<UINT16[]> m_cps2_buffered_obj;
// game-specific
std::unique_ptr<UINT16[]> m_gigaman2_dummyqsound_ram;
UINT16 sf2ceblp_prot;

View File

@ -86,7 +86,7 @@ public:
DECLARE_VIDEO_START(primella);
required_shared_ptr<UINT8> m_txvideoram;
UINT8* m_paletteram_flytiger;
std::unique_ptr<UINT8[]> m_paletteram_flytiger;
UINT8 m_sprites_disabled;
UINT8 m_flytiger_pri;
UINT8 m_tx_pri;

View File

@ -48,7 +48,7 @@ public:
emu_timer *m_firq_off;
emu_timer *m_firq_timer;
UINT8 m_cocktail_flip;
UINT8 *m_local_videoram;
std::unique_ptr<UINT8[]> m_local_videoram;
UINT8 m_palettebank_vis;
DECLARE_READ8_MEMBER(analog_port_r);

View File

@ -35,7 +35,7 @@ public:
int m_bg_raster;
int m_bg_palettebank;
int m_tx_palettebank;
UINT16* m_spriteram1_old;
std::unique_ptr<UINT16[]> m_spriteram1_old;
UINT32 inufuku_tile_callback( UINT32 code );
/* misc */

View File

@ -28,10 +28,10 @@ public:
}
required_shared_ptr<UINT16> m_spriteram;
UINT16* m_back_data;
UINT16* m_fore_data;
UINT16* m_mid_data;
UINT16* m_textram;
std::unique_ptr<UINT16[]> m_back_data;
std::unique_ptr<UINT16[]> m_fore_data;
std::unique_ptr<UINT16[]> m_mid_data;
std::unique_ptr<UINT16[]> m_textram;
std::unique_ptr<UINT16[]> m_scrollram16;
UINT16 m_layer_disable;
int m_sprite_xoffs;

View File

@ -49,7 +49,7 @@ public:
UINT8 m_dac_control;
UINT8 *m_alleymas_kludge_mem;
UINT8 *m_ataxx_qram;
std::unique_ptr<UINT8[]> m_ataxx_qram;
UINT8 m_gfx_control;
UINT8 m_wcol_enable;
emu_timer *m_master_int_timer;
@ -79,7 +79,7 @@ public:
UINT8 m_battery_ram_enable;
UINT8 *m_battery_ram;
std::unique_ptr<UINT8[]> m_extra_tram;
UINT8 *m_video_ram;
std::unique_ptr<UINT8[]> m_video_ram;
struct vram_state_data m_vram_state[2];
UINT16 m_xscroll;
UINT16 m_yscroll;

View File

@ -47,7 +47,7 @@ public:
UINT16 m_raster_irq_position;
pf_layer_info m_pf_layer[4];
UINT16 m_control[0x10];
UINT16 *m_buffered_spriteram;
std::unique_ptr<UINT16[]> m_buffered_spriteram;
DECLARE_WRITE16_MEMBER(coincounter_w);
DECLARE_WRITE16_MEMBER(bankswitch_w);

Some files were not shown because too many files have changed in this diff Show More