| 5447 | } |
| 5448 | |
| 5449 | static void gen_opcode (unsigned int opcode) |
| 5450 | { |
| 5451 | struct instr *curi = table68k + opcode; |
| 5452 | int ipl = 0; |
| 5453 | |
| 5454 | resetvars(); |
| 5455 | |
| 5456 | m68k_pc_offset = 2; |
| 5457 | g_instr = curi; |
| 5458 | g_srcname[0] = 0; |
| 5459 | bus_error_code[0] = 0; |
| 5460 | bus_error_code2[0] = 0; |
| 5461 | opcode_nextcopy = 0; |
| 5462 | last_access_offset_ipl = -1; |
| 5463 | last_access_offset_ipl_prev = -1; |
| 5464 | ipl_fetch_cycles = -1; |
| 5465 | ipl_fetch_cycles_prev = -1; |
| 5466 | |
| 5467 | loopmode = 0; |
| 5468 | // 68010 loop mode available if |
| 5469 | if (cpu_level == 1 && (using_ce || using_prefetch)) { |
| 5470 | loopmode = opcode_loop_mode(opcode); |
| 5471 | if (curi->mnemo == i_DBcc || loopmode) { |
| 5472 | next_level_000(); |
| 5473 | } |
| 5474 | loopmode_start(); |
| 5475 | } |
| 5476 | |
| 5477 | // do not unnecessarily create useless mmuop030 |
| 5478 | // functions when CPU is not 68030 |
| 5479 | if (curi->mnemo == i_MMUOP030 && cpu_level != 3 && !cpu_generic) { |
| 5480 | illg(); |
| 5481 | did_prefetch = -1; |
| 5482 | goto end; |
| 5483 | } |
| 5484 | |
| 5485 | switch (curi->plev) { |
| 5486 | case 0: /* not privileged */ |
| 5487 | break; |
| 5488 | case 1: /* unprivileged only on 68000 */ |
| 5489 | if (cpu_level == 0) |
| 5490 | break; |
| 5491 | if (next_cpu_level < 0) |
| 5492 | next_cpu_level = 0; |
| 5493 | |
| 5494 | /* fall through */ |
| 5495 | case 2: /* priviledged */ |
| 5496 | out( |
| 5497 | "if (!regs.s) {\n" |
| 5498 | "Exception(8);\n"); |
| 5499 | write_return_cycles(-1); |
| 5500 | out("}\n"); |
| 5501 | break; |
| 5502 | case 3: /* privileged if size == word */ |
| 5503 | if (curi->size == sz_byte) |
| 5504 | break; |
| 5505 | out( |
| 5506 | "if (!regs.s) {\n" |
no test coverage detected