Cleanups
This commit is contained in:
parent
653f5fe96c
commit
2ecef082f8
|
@ -362,15 +362,17 @@ static unsigned content_allocate_save_blocks(struct sram_block *blocks)
|
||||||
if (blocks[i].data)
|
if (blocks[i].data)
|
||||||
{
|
{
|
||||||
retro_ctx_memory_info_t mem_info;
|
retro_ctx_memory_info_t mem_info;
|
||||||
const void *ptr = NULL;
|
void *dst = NULL;
|
||||||
|
const void *src = NULL;
|
||||||
|
|
||||||
mem_info.id = blocks[i].type;
|
mem_info.id = blocks[i].type;
|
||||||
|
|
||||||
core_get_memory(&mem_info);
|
core_get_memory(&mem_info);
|
||||||
|
|
||||||
ptr = mem_info.data;
|
src = mem_info.data;
|
||||||
if (ptr)
|
dst = blocks[i].data;
|
||||||
memcpy(blocks[i].data, ptr, blocks[i].size);
|
if (src)
|
||||||
|
memcpy(dst, src, blocks[i].size);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -388,15 +390,17 @@ static void content_flush_save_blocks(struct sram_block *blocks,
|
||||||
if (blocks[i].data)
|
if (blocks[i].data)
|
||||||
{
|
{
|
||||||
retro_ctx_memory_info_t mem_info;
|
retro_ctx_memory_info_t mem_info;
|
||||||
void *ptr = NULL;
|
const void *src = NULL;
|
||||||
|
void *dst = NULL;
|
||||||
|
|
||||||
mem_info.id = blocks[i].type;
|
mem_info.id = blocks[i].type;
|
||||||
|
|
||||||
core_get_memory(&mem_info);
|
core_get_memory(&mem_info);
|
||||||
|
|
||||||
ptr = mem_info.data;
|
src = blocks[i].data;
|
||||||
if (ptr)
|
dst = mem_info.data;
|
||||||
memcpy(ptr, blocks[i].data, blocks[i].size);
|
if (dst)
|
||||||
|
memcpy(dst, src, blocks[i].size);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue