18 #ifdef XEMU_SNAPSHOT_SUPPORT
34 #define C65_MEMORY_BLOCK_VERSION 0
36 static int snapcallback_memory_loader (
const struct xemu_snapshot_definition_st *def,
struct xemu_snapshot_block_st *
block )
38 if (
block->block_version != C65_MEMORY_BLOCK_VERSION ||
block->sub_counter != 0 ||
block->sub_size >
sizeof(
memory))
39 RETURN_XSNAPERR_USER(
"Bad memory block syntax ver=%d, subcount=%d, size=%d",
block->block_version,
block->sub_counter,
block->sub_size);
44 static int snapcallback_memory_saver (
const struct xemu_snapshot_definition_st *def )
46 int ret = xemusnap_write_block_header(def->idstr, C65_MEMORY_BLOCK_VERSION);
49 while (
memory[--ret] == 0xFF) ;
50 return xemusnap_write_sub_block(
memory, ret + 1);
65 const struct xemu_snapshot_definition_st c65_snapshot_definition[] = {
66 {
"CPU", NULL, cpu65_snapshot_load_state, cpu65_snapshot_save_state },
67 {
"CIA#1", &cia1, cia_snapshot_load_state, cia_snapshot_save_state },
68 {
"CIA#2", &
cia2, cia_snapshot_load_state, cia_snapshot_save_state },
69 {
"VIC-3", NULL, vic3_snapshot_load_state, vic3_snapshot_save_state },
70 {
"C65", NULL, c65emu_snapshot_load_state, c65emu_snapshot_save_state },
71 {
"SID#1", &
sids[0], sid_snapshot_load_state, sid_snapshot_save_state },
72 {
"SID#2", &
sids[1], sid_snapshot_load_state, sid_snapshot_save_state },
73 {
"DMA", NULL, dma_snapshot_load_state, dma_snapshot_save_state },
74 {
"FDC-F011", NULL, fdc_snapshot_load_state, fdc_snapshot_save_state },
75 {
"Memory", NULL, snapcallback_memory_loader, snapcallback_memory_saver },
76 { NULL, NULL, c65emu_snapshot_loading_finalize, NULL }