summaryrefslogtreecommitdiff
path: root/emu/device.c
diff options
context:
space:
mode:
Diffstat (limited to 'emu/device.c')
-rw-r--r--emu/device.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/emu/device.c b/emu/device.c
index 7ad2741..60d54a1 100644
--- a/emu/device.c
+++ b/emu/device.c
@@ -20,6 +20,13 @@ void device_init( device_t *device, const char *name )
device->vtable = &device_vtable;
}
+void device_copy( device_t *to, device_t *from )
+{
+ memcpy( to, from, sizeof( device_t ) );
+
+ to->name = strdup( from->name );
+}
+
uint8_t device_read( void *obj, uint16_t addr )
{
device_t *device = (device_t *)obj;