comparison m68k_core.c @ 1783:eda8df5bc74c

Minor cleanup
author Michael Pavone <pavone@retrodev.com>
date Mon, 11 Mar 2019 00:04:48 -0700
parents 24508cb54f87
children 0c6d07f91346 c157a535ceeb
comparison
equal deleted inserted replaced
1782:b2bffd98063d 1783:eda8df5bc74c
1214 } 1214 }
1215 1215
1216 1216
1217 m68k_context * init_68k_context(m68k_options * opts, m68k_reset_handler reset_handler) 1217 m68k_context * init_68k_context(m68k_options * opts, m68k_reset_handler reset_handler)
1218 { 1218 {
1219 size_t ctx_size = sizeof(m68k_context) + ram_size(&opts->gen) / (1 << opts->gen.ram_flags_shift) / 8; 1219 m68k_context * context = calloc(1, sizeof(m68k_context) + ram_size(&opts->gen) / (1 << opts->gen.ram_flags_shift) / 8);
1220 m68k_context * context = malloc(ctx_size);
1221 memset(context, 0, ctx_size);
1222 context->options = opts; 1220 context->options = opts;
1223 context->int_cycle = CYCLE_NEVER; 1221 context->int_cycle = CYCLE_NEVER;
1224 context->status = 0x27; 1222 context->status = 0x27;
1225 context->reset_handler = (code_ptr)reset_handler; 1223 context->reset_handler = (code_ptr)reset_handler;
1226 return context; 1224 return context;