Mercurial > repos > blastem
comparison m68k_core.c @ 986:f680fe746a7d
Implement illegal instruction trap
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Tue, 26 Apr 2016 00:07:15 -0700 |
parents | 751280fb4494 |
children | 1f09994e92c5 |
comparison
equal
deleted
inserted
replaced
985:751280fb4494 | 986:f680fe746a7d |
---|---|
334 void translate_m68k_trap(m68k_options *opts, m68kinst *inst) | 334 void translate_m68k_trap(m68k_options *opts, m68kinst *inst) |
335 { | 335 { |
336 code_info *code = &opts->gen.code; | 336 code_info *code = &opts->gen.code; |
337 ldi_native(opts, inst->src.params.immed + VECTOR_TRAP_0, opts->gen.scratch2); | 337 ldi_native(opts, inst->src.params.immed + VECTOR_TRAP_0, opts->gen.scratch2); |
338 ldi_native(opts, inst->address+2, opts->gen.scratch1); | 338 ldi_native(opts, inst->address+2, opts->gen.scratch1); |
339 jmp(code, opts->trap); | |
340 } | |
341 | |
342 void translate_m68k_illegal(m68k_options *opts, m68kinst *inst) | |
343 { | |
344 code_info *code = &opts->gen.code; | |
345 cycles(&opts->gen, BUS); | |
346 ldi_native(opts, VECTOR_ILLEGAL_INST, opts->gen.scratch2); | |
347 ldi_native(opts, inst->address, opts->gen.scratch1); | |
339 jmp(code, opts->trap); | 348 jmp(code, opts->trap); |
340 } | 349 } |
341 | 350 |
342 void translate_m68k_move_usp(m68k_options *opts, m68kinst *inst) | 351 void translate_m68k_move_usp(m68k_options *opts, m68kinst *inst) |
343 { | 352 { |
798 //traps | 807 //traps |
799 OP_IMPL(M68K_CHK, translate_m68k_chk), | 808 OP_IMPL(M68K_CHK, translate_m68k_chk), |
800 RAW_IMPL(M68K_TRAP, translate_m68k_trap), | 809 RAW_IMPL(M68K_TRAP, translate_m68k_trap), |
801 RAW_IMPL(M68K_TRAPV, translate_m68k_trapv), | 810 RAW_IMPL(M68K_TRAPV, translate_m68k_trapv), |
802 RAW_IMPL(M68K_ILLEGAL, translate_m68k_illegal), | 811 RAW_IMPL(M68K_ILLEGAL, translate_m68k_illegal), |
803 RAW_IMPL(M68K_INVALID, translate_m68k_invalid), | 812 RAW_IMPL(M68K_INVALID, translate_m68k_illegal), |
804 | 813 |
805 //misc | 814 //misc |
806 RAW_IMPL(M68K_NOP, translate_m68k_nop), | 815 RAW_IMPL(M68K_NOP, translate_m68k_nop), |
807 RAW_IMPL(M68K_RESET, translate_m68k_reset), | 816 RAW_IMPL(M68K_RESET, translate_m68k_reset), |
808 RAW_IMPL(M68K_TAS, translate_m68k_tas), | 817 RAW_IMPL(M68K_TAS, translate_m68k_tas), |