summaryrefslogtreecommitdiff
path: root/emu/memory.c
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2020-12-12 20:14:45 +0100
committerAndreas Baumann <mail@andreasbaumann.cc>2020-12-12 20:14:45 +0100
commit8dde478cfc2174f198290be40a633a4c9c9db833 (patch)
treef3ebae298dc285fd407093efbf774a684f520867 /emu/memory.c
parent1269d11d15f1014b7ac87fc2bb2c76367404e16c (diff)
download6502-8dde478cfc2174f198290be40a633a4c9c9db833.tar.gz
6502-8dde478cfc2174f198290be40a633a4c9c9db833.tar.bz2
some more testing
Diffstat (limited to 'emu/memory.c')
-rw-r--r--emu/memory.c9
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 ) {