summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/emu/machine/smc92x4.c14
-rw-r--r--src/emu/sound/discrete.h1
-rw-r--r--src/mess/machine/ti99/datamux.c3
3 files changed, 7 insertions, 11 deletions
diff --git a/src/emu/machine/smc92x4.c b/src/emu/machine/smc92x4.c
index 7de574d68b7..c5e4698d6c0 100644
--- a/src/emu/machine/smc92x4.c
+++ b/src/emu/machine/smc92x4.c
@@ -1602,7 +1602,7 @@ void smc92x4_device::read_floppy_track(bool transfer_only_ids)
/* Determine the track size. We cannot allow different sizes in this design. */
int data_count = 0;
int i;
- UINT8 *buffer;
+ dynamic_buffer buffer;
sync_latches_out();
@@ -1620,9 +1620,9 @@ void smc92x4_device::read_floppy_track(bool transfer_only_ids)
data_count = TRKSIZE_DD;
}
- buffer = global_alloc_array(UINT8, data_count);
+ buffer.resize(data_count);
- m_drive->floppy_drive_read_track_data_info_buffer(m_register_w[DESIRED_HEAD]&0x0f, (char *)buffer, &data_count);
+ m_drive->floppy_drive_read_track_data_info_buffer(m_register_w[DESIRED_HEAD]&0x0f, (char *)(UINT8 *)buffer, &data_count);
sync_status_in();
// Transfer the buffer to the external memory. We assume the memory
@@ -1640,20 +1640,18 @@ void smc92x4_device::read_floppy_track(bool transfer_only_ids)
m_out_dma((offs_t)0, buffer[i]);
}
m_out_dip(CLEAR_LINE);
-
- global_free_array(buffer);
}
void smc92x4_device::read_harddisk_track(bool transfer_only_ids)
{
/* Determine the track size. We cannot allow different sizes in this design. */
int i;
- UINT8 *buffer;
+ dynamic_buffer buffer;
int data_count=0;
sync_latches_out();
data_count = m_harddisk->get_track_length();
- buffer = global_alloc_array(UINT8, data_count);
+ buffer.resize(data_count);
/* buffer and data_count are allocated and set by the function. */
m_harddisk->read_track(m_register_w[DESIRED_HEAD]&0x0f, buffer);
@@ -1679,8 +1677,6 @@ void smc92x4_device::read_harddisk_track(bool transfer_only_ids)
m_out_dma((offs_t)0, buffer[i]);
}
m_out_dip(CLEAR_LINE);
-
- global_free_array(buffer);
}
diff --git a/src/emu/sound/discrete.h b/src/emu/sound/discrete.h
index 5585fade2cb..427a91e4a5e 100644
--- a/src/emu/sound/discrete.h
+++ b/src/emu/sound/discrete.h
@@ -3751,6 +3751,7 @@ enum
* add and delete may be slow - the focus is on access!
*/
+ // TODO: replace with dynamic_array from utils
template<class _ElementType> struct dynamic_array_t
{
public:
diff --git a/src/mess/machine/ti99/datamux.c b/src/mess/machine/ti99/datamux.c
index 5985a537156..88f48871392 100644
--- a/src/mess/machine/ti99/datamux.c
+++ b/src/mess/machine/ti99/datamux.c
@@ -410,8 +410,7 @@ void ti99_datamux_device::device_reset(void)
// better use a region?
if (m_ram16b==NULL)
{
- m_ram16b = global_alloc_array(UINT16, 32768/2);
- memset(m_ram16b, 0, 32768);
+ m_ram16b = global_alloc_array_clear(UINT16, 32768/2);
}
// Now building the list of active devices at this databus multiplex.