diff options
author | Michael Pavone <pavone@retrodev.com> | 2017-08-27 18:15:00 -0700 |
---|---|---|
committer | Michael Pavone <pavone@retrodev.com> | 2017-08-27 18:15:00 -0700 |
commit | c96509a56b532eb7aff8e589b5e76a2b7c9e943f (patch) | |
tree | 160007e470da63c1d6c9761915840937c1c0476d /multi_game.c | |
parent | cae76760c6f9167b71b5035326c74d7cecd3c3e8 (diff) |
Save/restore mapper state in native save states
Diffstat (limited to 'multi_game.c')
-rw-r--r-- | multi_game.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/multi_game.c b/multi_game.c index c00aada..ccf77a0 100644 --- a/multi_game.c +++ b/multi_game.c @@ -4,6 +4,7 @@ void *write_multi_game_b(uint32_t address, void *vcontext, uint8_t value) { m68k_context *context = vcontext; genesis_context *gen = context->system; + gen->bank_regs[0] = address; uint32_t base = (address & 0x3F) << 16, start = 0, end = 0x400000; //find the memmap chunk, so we can properly mask the base value for (int i = 0; i < context->options->gen.memmap_chunks; i++) @@ -24,3 +25,13 @@ void *write_multi_game_w(uint32_t address, void *context, uint16_t value) { return write_multi_game_b(address, context, value); } + +void multi_game_serialize(genesis_context *gen, serialize_buffer *buf) +{ + save_int8(buf, gen->bank_regs[0]); +} + +void multi_game_deserialize(deserialize_buffer *buf, genesis_context *gen) +{ + write_multi_game_b(load_int8(buf), gen, 0); +} |