Mercurial > repos > blastem
comparison m68k_core.c @ 1896:c157a535ceeb
Reset 68K supervisor state and interrupt mask on soft reset
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Tue, 07 Jan 2020 22:52:27 -0800 |
parents | eda8df5bc74c |
children | 374a5ae694e8 8ee7ecbf3f21 |
comparison
equal
deleted
inserted
replaced
1895:33c0c4579c1f | 1896:c157a535ceeb |
---|---|
1186 | 1186 |
1187 void m68k_reset(m68k_context * context) | 1187 void m68k_reset(m68k_context * context) |
1188 { | 1188 { |
1189 //TODO: Actually execute the M68K reset vector rather than simulating some of its behavior | 1189 //TODO: Actually execute the M68K reset vector rather than simulating some of its behavior |
1190 uint16_t *reset_vec = get_native_pointer(0, (void **)context->mem_pointers, &context->options->gen); | 1190 uint16_t *reset_vec = get_native_pointer(0, (void **)context->mem_pointers, &context->options->gen); |
1191 if (!(context->status & 0x20)) { | |
1192 //switching from user to system mode so swap stack pointers | |
1193 context->aregs[8] = context->aregs[7]; | |
1194 } | |
1195 context->status = 0x27; | |
1191 context->aregs[7] = reset_vec[0] << 16 | reset_vec[1]; | 1196 context->aregs[7] = reset_vec[0] << 16 | reset_vec[1]; |
1192 uint32_t address = reset_vec[2] << 16 | reset_vec[3]; | 1197 uint32_t address = reset_vec[2] << 16 | reset_vec[3]; |
1198 //interrupt mask may have changed so force a sync | |
1199 sync_components(context, address); | |
1193 start_68k_context(context, address); | 1200 start_68k_context(context, address); |
1194 } | 1201 } |
1195 | 1202 |
1196 void m68k_options_free(m68k_options *opts) | 1203 void m68k_options_free(m68k_options *opts) |
1197 { | 1204 { |