diff options
Diffstat (limited to 'emu/memory.c')
-rw-r--r-- | emu/memory.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/emu/memory.c b/emu/memory.c index c73c668..3ab0694 100644 --- a/emu/memory.c +++ b/emu/memory.c @@ -26,6 +26,15 @@ void memory_init( memory_t *memory, memory_type_t type, uint16_t addr, uint16_t memory->base.vtable = (device_vtable_t *)&memory_vtable; } +void memory_copy( memory_t *to, memory_t *from ) +{ + memcpy( to, from, sizeof( memory_t ) ); + device_copy( &to->base, &from->base ); + + to->cell = malloc( to->size ); + memcpy( to->cell, from->cell, to->size ); +} + void memory_load( memory_t *memory, const char *filename ) { if( memory->type == MEMORY_ROM ) { |