comparison multi_game.c @ 1444:14a2834d010c

Save/restore mapper state in native save states
author Michael Pavone <pavone@retrodev.com>
date Sun, 27 Aug 2017 18:15:00 -0700
parents 11ac0b511cff
children adb62000d296
comparison
equal deleted inserted replaced
1443:93c1b056ccdd 1444:14a2834d010c
2 2
3 void *write_multi_game_b(uint32_t address, void *vcontext, uint8_t value) 3 void *write_multi_game_b(uint32_t address, void *vcontext, uint8_t value)
4 { 4 {
5 m68k_context *context = vcontext; 5 m68k_context *context = vcontext;
6 genesis_context *gen = context->system; 6 genesis_context *gen = context->system;
7 gen->bank_regs[0] = address;
7 uint32_t base = (address & 0x3F) << 16, start = 0, end = 0x400000; 8 uint32_t base = (address & 0x3F) << 16, start = 0, end = 0x400000;
8 //find the memmap chunk, so we can properly mask the base value 9 //find the memmap chunk, so we can properly mask the base value
9 for (int i = 0; i < context->options->gen.memmap_chunks; i++) 10 for (int i = 0; i < context->options->gen.memmap_chunks; i++)
10 { 11 {
11 if (context->options->gen.memmap[i].flags & MMAP_PTR_IDX) { 12 if (context->options->gen.memmap[i].flags & MMAP_PTR_IDX) {
22 23
23 void *write_multi_game_w(uint32_t address, void *context, uint16_t value) 24 void *write_multi_game_w(uint32_t address, void *context, uint16_t value)
24 { 25 {
25 return write_multi_game_b(address, context, value); 26 return write_multi_game_b(address, context, value);
26 } 27 }
28
29 void multi_game_serialize(genesis_context *gen, serialize_buffer *buf)
30 {
31 save_int8(buf, gen->bank_regs[0]);
32 }
33
34 void multi_game_deserialize(deserialize_buffer *buf, genesis_context *gen)
35 {
36 write_multi_game_b(load_int8(buf), gen, 0);
37 }