mirror of
https://github.com/holub/mame
synced 2025-04-22 08:22:15 +03:00
Eliminate a few more uses of auto_alloc (nw)
This commit is contained in:
parent
67f30c1598
commit
3bc0aad093
@ -860,7 +860,8 @@ void dcs2_audio_device::device_start()
|
||||
if (m_dram_in_mb != 0)
|
||||
{
|
||||
m_sounddata_words = (m_dram_in_mb << 20) / 2;
|
||||
m_sounddata = auto_alloc_array(machine(), uint16_t, m_sounddata_words);
|
||||
m_sounddata_ptr = std::make_unique<uint16_t[]>(m_sounddata_words);
|
||||
m_sounddata = m_sounddata_ptr.get();
|
||||
save_pointer(NAME(m_sounddata), m_sounddata_words);
|
||||
}
|
||||
else
|
||||
@ -879,7 +880,7 @@ void dcs2_audio_device::device_start()
|
||||
|
||||
|
||||
/* allocate memory for the SRAM */
|
||||
m_sram = auto_alloc_array(machine(), uint16_t, 0x8000*4/2);
|
||||
m_sram = std::make_unique<uint16_t[]>(0x8000*4/2);
|
||||
|
||||
/* create the timers */
|
||||
m_internal_timer = subdevice<timer_device>("dcs_int_timer");
|
||||
@ -1022,23 +1023,23 @@ void dcs_audio_device::sdrc_remap_memory()
|
||||
else
|
||||
{
|
||||
/* first start with a clean program map */
|
||||
m_program->install_ram(0x0800, 0x3fff, m_sram + 0x4800);
|
||||
m_program->install_ram(0x0800, 0x3fff, &m_sram[0x4800]);
|
||||
|
||||
/* set up the data map based on the SRAM banking */
|
||||
/* map 0: ram from 0800-37ff */
|
||||
if (SDRC_SM_BK == 0)
|
||||
{
|
||||
m_data->install_ram(0x0800, 0x17ff, m_sram + 0x0000);
|
||||
m_data->install_ram(0x1800, 0x27ff, m_sram + 0x1000);
|
||||
m_data->install_ram(0x2800, 0x37ff, m_sram + 0x2000);
|
||||
m_data->install_ram(0x0800, 0x17ff, &m_sram[0x0000]);
|
||||
m_data->install_ram(0x1800, 0x27ff, &m_sram[0x1000]);
|
||||
m_data->install_ram(0x2800, 0x37ff, &m_sram[0x2000]);
|
||||
}
|
||||
|
||||
/* map 1: nothing from 0800-17ff, alternate RAM at 1800-27ff, same RAM at 2800-37ff */
|
||||
else
|
||||
{
|
||||
m_data->unmap_readwrite(0x0800, 0x17ff);
|
||||
m_data->install_ram(0x1800, 0x27ff, m_sram + 0x3000);
|
||||
m_data->install_ram(0x2800, 0x37ff, m_sram + 0x2000);
|
||||
m_data->install_ram(0x1800, 0x27ff, &m_sram[0x3000]);
|
||||
m_data->install_ram(0x2800, 0x37ff, &m_sram[0x2000]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -192,6 +192,7 @@ protected:
|
||||
uint16_t * m_bootrom;
|
||||
uint32_t m_bootrom_words;
|
||||
uint16_t * m_sounddata;
|
||||
std::unique_ptr<uint16_t[]> m_sounddata_ptr;
|
||||
uint32_t m_sounddata_words;
|
||||
uint32_t m_sounddata_banks;
|
||||
uint16_t m_sounddata_bank;
|
||||
@ -229,7 +230,7 @@ protected:
|
||||
uint32_t m_timer_period;
|
||||
uint32_t m_timers_fired;
|
||||
|
||||
uint16_t *m_sram;
|
||||
std::unique_ptr<uint16_t[]>(m_sram);
|
||||
uint16_t m_polling_value;
|
||||
uint32_t m_polling32_value;
|
||||
uint32_t *m_internal_program_ram;
|
||||
|
@ -223,7 +223,7 @@ private:
|
||||
std::unique_ptr<int32_t[]> m_zoom_table;
|
||||
std::unique_ptr<uint16_t[]> m_blitter_data;
|
||||
|
||||
scroll_info *m_scanlines;
|
||||
std::unique_ptr<scroll_info[]> m_scanlines;
|
||||
|
||||
int32_t m_direct_write_x0;
|
||||
int32_t m_direct_write_x1;
|
||||
@ -700,7 +700,7 @@ void wheelfir_state::machine_start()
|
||||
m_zoom_table = std::make_unique<int32_t[]>(ZOOM_TABLE_SIZE);
|
||||
m_blitter_data = std::make_unique<uint16_t[]>(16);
|
||||
|
||||
m_scanlines = reinterpret_cast<scroll_info*>(auto_alloc_array(machine(), uint8_t, sizeof(scroll_info)*(NUM_SCANLINES+NUM_VBLANK_LINES)));
|
||||
m_scanlines = std::make_unique<scroll_info[]>(NUM_SCANLINES+NUM_VBLANK_LINES);
|
||||
|
||||
|
||||
for(int i=0;i<(ZOOM_TABLE_SIZE);++i)
|
||||
|
@ -171,6 +171,7 @@ public:
|
||||
{}
|
||||
|
||||
uint16_t *m_buffer_spriteram;
|
||||
std::unique_ptr<uint16_t[]> m_allocated_spriteram;
|
||||
void wildplt_map(address_map &map);
|
||||
void wildplt(machine_config &config);
|
||||
DECLARE_WRITE16_MEMBER(sprite_dma_w);
|
||||
|
@ -102,7 +102,7 @@ private:
|
||||
uint8_t m_outx;
|
||||
uint8_t m_mpage;
|
||||
uint8_t *m_combase_mb;
|
||||
irmb_ops *m_mbops;
|
||||
std::unique_ptr<irmb_ops[]> m_mbops;
|
||||
const irmb_ops *m_irmb_stack[16];
|
||||
uint32_t m_irmb_regs[16];
|
||||
uint32_t m_irmb_latch;
|
||||
|
@ -319,7 +319,7 @@ void irobot_state::load_oproms()
|
||||
int i;
|
||||
|
||||
/* allocate RAM */
|
||||
m_mbops = auto_alloc_array(machine(), irmb_ops, 1024);
|
||||
m_mbops = std::make_unique<irmb_ops[]>(1024);
|
||||
|
||||
for (i = 0; i < 1024; i++)
|
||||
{
|
||||
|
@ -720,10 +720,10 @@ void m2_te_device::device_start()
|
||||
m_winclip_int_handler.resolve_safe();
|
||||
|
||||
// Allocate texture RAM
|
||||
m_tram = auto_alloc_array(machine(), uint32_t, TEXTURE_RAM_WORDS);
|
||||
m_tram = std::make_unique<uint32_t[]>(TEXTURE_RAM_WORDS);
|
||||
|
||||
// Allocate PIP RAM
|
||||
m_pipram = auto_alloc_array(machine(), uint32_t, PIP_RAM_WORDS);
|
||||
m_pipram = std::make_unique<uint32_t[]>(PIP_RAM_WORDS);
|
||||
|
||||
// TODO
|
||||
memset(&m_gc, 0, sizeof(m_gc));
|
||||
|
@ -35,7 +35,7 @@ public:
|
||||
DECLARE_READ32_MEMBER(read);
|
||||
DECLARE_WRITE32_MEMBER(write);
|
||||
|
||||
uint32_t *tram_ptr() const { return m_tram; }
|
||||
uint32_t *tram_ptr() const { return &m_tram[0]; }
|
||||
|
||||
enum te_reg_wmode
|
||||
{
|
||||
@ -408,8 +408,8 @@ private:
|
||||
|
||||
te_state m_state;
|
||||
|
||||
uint32_t *m_pipram;
|
||||
uint32_t *m_tram;
|
||||
std::unique_ptr<uint32_t[]> m_pipram;
|
||||
std::unique_ptr<uint32_t[]> m_tram;
|
||||
};
|
||||
|
||||
DECLARE_DEVICE_TYPE(M2_TE, m2_te_device)
|
||||
|
@ -377,8 +377,7 @@ void antic_device::device_start()
|
||||
LOG("atari prio_init\n");
|
||||
prio_init();
|
||||
|
||||
for (int i = 0; i < screen().height(); i++)
|
||||
m_video[i] = auto_alloc_clear(machine(), <VIDEO>());
|
||||
m_video = make_unique_clear<VIDEO[]>(screen().height());
|
||||
|
||||
/* save states */
|
||||
save_pointer(NAME((uint8_t *) &m_r), sizeof(m_r));
|
||||
@ -1572,7 +1571,7 @@ inline void antic_device::mode_gtia3(address_space &space, VIDEO *video, int byt
|
||||
|
||||
void antic_device::render(address_space &space, int param1, int param2, int param3)
|
||||
{
|
||||
VIDEO *video = m_video[m_scanline];
|
||||
VIDEO *video = &m_video[m_scanline];
|
||||
int add_bytes = 0, erase = 0;
|
||||
|
||||
if (param3 == 0 || param2 <= 1)
|
||||
|
@ -161,7 +161,7 @@ private:
|
||||
uint8_t m_cclock[256+32]; /* color clock buffer filled by ANTIC */
|
||||
uint8_t m_pmbits[256+32]; /* player missile buffer filled by GTIA */
|
||||
std::unique_ptr<uint8_t[]> m_prio_table[64]; /* player/missile priority tables */
|
||||
VIDEO *m_video[312]; /* video buffer */
|
||||
std::unique_ptr<VIDEO[]> m_video; /* video buffer */
|
||||
std::unique_ptr<uint32_t[]> m_cclk_expand; /* shared buffer for the following: */
|
||||
uint32_t *m_pf_21; /* 1cclk 2 color txt 2,3 */
|
||||
uint32_t *m_pf_x10b; /* 1cclk 4 color txt 4,5, gfx D,E */
|
||||
|
@ -94,7 +94,8 @@ void wildplt_state::video_start()
|
||||
{
|
||||
cischeat_state::video_start();
|
||||
m_buffer_spriteram = &m_ram[0x8000/2];
|
||||
m_spriteram = auto_alloc_array(machine(),uint16_t, 0x1000/2);
|
||||
m_allocated_spriteram = std::make_unique<uint16_t[]>(0x1000/2);
|
||||
m_spriteram = m_allocated_spriteram.get();
|
||||
}
|
||||
|
||||
WRITE16_MEMBER(wildplt_state::sprite_dma_w)
|
||||
|
@ -70,7 +70,7 @@ crt_device::crt_device(const machine_config &mconfig, const char *tag, device_t
|
||||
void crt_device::device_start()
|
||||
{
|
||||
/* alloc the arrays */
|
||||
m_list = auto_alloc_array(machine(), crt_point, m_window_width * m_window_height);
|
||||
m_list = std::make_unique<crt_point[]>(m_window_width * m_window_height);
|
||||
m_list_head = std::make_unique<int[]>(m_window_height);
|
||||
|
||||
/* fill with black and set up list as empty */
|
||||
|
@ -55,7 +55,7 @@ private:
|
||||
int next = 0; /* index of next pixel in list */
|
||||
};
|
||||
|
||||
crt_point *m_list; /* array of (crt_window_width*crt_window_height) point */
|
||||
std::unique_ptr<crt_point[]> m_list; /* array of (crt_window_width*crt_window_height) point */
|
||||
std::unique_ptr<int[]> m_list_head; /* head of the list of lit pixels (index in the array) */
|
||||
/* keep a separate list for each display line (makes the video code slightly faster) */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user