static int opcode_nextcopy;
static int disable_noflags;
static int do_always_dynamic_cycles;
-
+static int func_noret;
#define GF_APDI 0x00001
#define GF_AD8R 0x00002
out("return 0;\n");
return;
}
- if (using_ce || using_ce020) {
+ if (func_noret) {
#if 0
if (tail_ce020 == 0)
out("regs.ce020memcycles -= 2 * cpucycleunit; /* T=0 */ \n");
static void write_return_cycles_none(void)
{
- if (using_ce || using_ce020) {
+ if (func_noret) {
out("return;\n");
} else {
out("return 0;\n");
char *name = ua (lookuptab[idx].name);
if (generate_stbl) {
#ifdef NOFLAGS_SUPPORT_GENCPU
- fprintf(stblfile, "{ %sop_%04x_%d%s_ff, %sop_%04x_%d%s_%s, 0x%04x, %d, { %d, %d }, %d }, /* %s */\n",
- (using_ce || using_ce020) ? "(cpuop_func*)" : "", opcode, opcode_last_postfix[rp], extra,
- (using_ce || using_ce020) ? "(cpuop_func*)" : "", opcode, opcode_last_postfix[rp], extra, cputbltmp[opcode].nf ? "nf" : "ff",
- opcode,
- cputbltmp[opcode].length, cputbltmp[opcode].disp020[0], cputbltmp[opcode].disp020[1], cputbltmp[opcode].branch, name);
+ if (func_noret) {
+ fprintf(stblfile, "{ NULL, NULL, op_%04x_%d%s_ff, op_%04x_%d%s_%s, 0x%04x, %d, { %d, %d }, %d }, /* %s */\n",
+ opcode, opcode_last_postfix[rp], extra,
+ opcode, opcode_last_postfix[rp], extra, cputbltmp[opcode].nf ? "nf" : "ff",
+ opcode,
+ cputbltmp[opcode].length, cputbltmp[opcode].disp020[0], cputbltmp[opcode].disp020[1], cputbltmp[opcode].branch, name);
+ } else {
+ fprintf(stblfile, "{ op_%04x_%d%s_ff, op_%04x_%d%s_%s, NULL, NULL, 0x%04x, %d, { %d, %d }, %d }, /* %s */\n",
+ opcode, opcode_last_postfix[rp], extra,
+ opcode, opcode_last_postfix[rp], extra, cputbltmp[opcode].nf ? "nf" : "ff",
+ opcode,
+ cputbltmp[opcode].length, cputbltmp[opcode].disp020[0], cputbltmp[opcode].disp020[1], cputbltmp[opcode].branch, name);
+ }
#else
- fprintf(stblfile, "{ %sop_%04x_%d%s_ff, 0x%04x, %d, { %d, %d }, %d }, /* %s */\n",
- (using_ce || using_ce020) ? "(cpuop_func*)" : "", opcode, opcode_last_postfix[rp], extra,
- opcode,
- cputbltmp[opcode].length, cputbltmp[opcode].disp020[0], cputbltmp[opcode].disp020[1], cputbltmp[opcode].branch, name);
+ if (func_noret) {
+ fprintf(stblfile, "{ NULL, op_%04x_%d%s_ff, 0x%04x, %d, { %d, %d }, %d }, /* %s */\n",
+ opcode, opcode_last_postfix[rp], extra, opcode,
+ cputbltmp[opcode].length, cputbltmp[opcode].disp020[0], cputbltmp[opcode].disp020[1], cputbltmp[opcode].branch, name);
+ } else {
+ fprintf(stblfile, "{ op_%04x_%d%s_ff, NULL, 0x%04x, %d, { %d, %d }, %d }, /* %s */\n",
+ opcode, opcode_last_postfix[rp], extra, opcode,
+ cputbltmp[opcode].length, cputbltmp[opcode].disp020[0], cputbltmp[opcode].disp020[1], cputbltmp[opcode].branch, name);
+ }
#endif
}
xfree (name);
return;
}
fprintf(headerfile, "extern %s op_%04x_%d%s_nf;\n",
- (using_ce || using_ce020) ? "cpuop_func_ce" : "cpuop_func", opcode, postfix, extra);
+ func_noret ? "cpuop_func_noret" : "cpuop_func", opcode, postfix, extra);
+
fprintf(headerfile, "extern %s op_%04x_%d%s_ff;\n",
- (using_ce || using_ce020) ? "cpuop_func_ce" : "cpuop_func", opcode, postfix, extra);
+ func_noret ? "cpuop_func_noret" : "cpuop_func", opcode, postfix, extra);
out("/* %s */\n", outopcode (opcode));
if (i68000)
out("#ifndef CPUEMU_68000_ONLY\n");
- out("%s REGPARAM2 op_%04x_%d%s_ff(uae_u32 opcode)\n{\n", (using_ce || using_ce020) ? "void" : "uae_u32", opcode, postfix, extra);
+ out("%s REGPARAM2 op_%04x_%d%s_ff(uae_u32 opcode)\n{\n", func_noret ? "void" : "uae_u32", opcode, postfix, extra);
if ((using_simple_cycles || do_always_dynamic_cycles) && !using_nocycles)
out("int count_cycles = 0;\n");
if (i68000)
fprintf(stblfile, "#ifndef CPUEMU_68000_ONLY\n");
#ifdef NOFLAGS_SUPPORT_GENCPU
- fprintf(stblfile, "{ %sop_%04x_%d%s_ff, %sop_%04x_%d%s_%s, 0x%04x, %d, { %d, %d }, %d }, /* %s */\n",
- (using_ce || using_ce020) ? "(cpuop_func*)" : "", opcode, postfix, extra,
- (using_ce || using_ce020) ? "(cpuop_func*)" : "", opcode, postfix, extra, nfgenerated ? "nf" : "ff",
- opcode,
- cputbltmp[opcode].length, cputbltmp[opcode].disp020[0], cputbltmp[opcode].disp020[1], cputbltmp[opcode].branch, name);
+ if (func_noret) {
+ fprintf(stblfile, "{ NULL, NULL, op_%04x_%d%s_ff, op_%04x_%d%s_%s, 0x%04x, %d, { %d, %d }, %d }, /* %s */\n",
+ opcode, postfix, extra,
+ opcode, postfix, extra, nfgenerated ? "nf" : "ff",
+ opcode,
+ cputbltmp[opcode].length, cputbltmp[opcode].disp020[0], cputbltmp[opcode].disp020[1], cputbltmp[opcode].branch, name);
+ } else {
+ fprintf(stblfile, "{ op_%04x_%d%s_ff, op_%04x_%d%s_%s, NULL, NULL, 0x%04x, %d, { %d, %d }, %d }, /* %s */\n",
+ opcode, postfix, extra,
+ opcode, postfix, extra, nfgenerated ? "nf" : "ff",
+ opcode,
+ cputbltmp[opcode].length, cputbltmp[opcode].disp020[0], cputbltmp[opcode].disp020[1], cputbltmp[opcode].branch, name);
+ }
#else
- fprintf(stblfile, "{ %sop_%04x_%d%s_ff, 0x%04x, %d, { %d, %d }, %d }, /* %s */\n",
- (using_ce || using_ce020) ? "(cpuop_func*)" : "", opcode, postfix, extra,
- opcode,
- cputbltmp[opcode].length, cputbltmp[opcode].disp020[0], cputbltmp[opcode].disp020[1], cputbltmp[opcode].branch, name);
+ if (func_noret) {
+ fprintf(stblfile, "{ NULL, op_%04x_%d%s_ff, 0x%04x, %d, { %d, %d }, %d }, /* %s */\n",
+ opcode, postfix, extra, opcode,
+ cputbltmp[opcode].length, cputbltmp[opcode].disp020[0], cputbltmp[opcode].disp020[1], cputbltmp[opcode].branch, name);
+ } else {
+ fprintf(stblfile, "{ op_%04x_%d%s_ff, NULL, 0x%04x, %d, { %d, %d }, %d }, /* %s */\n",
+ opcode, postfix, extra, opcode,
+ cputbltmp[opcode].length, cputbltmp[opcode].disp020[0], cputbltmp[opcode].disp020[1], cputbltmp[opcode].branch, name);
+ }
#endif
if (i68000)
fprintf(stblfile, "#endif\n");
}
do_always_dynamic_cycles = !using_simple_cycles && !using_prefetch && using_always_dynamic_cycles;
+ func_noret = using_ce || using_ce020;
if (!using_indirect)
using_indirect = using_ce || using_ce020 || using_prefetch_020 || id >= 50;
int movem_next[256];
cpuop_func *cpufunctbl[65536];
+cpuop_func_noret *cpufunctbl_noret[65536];
cpuop_func *loop_mode_table[65536];
struct cputbl_data
return do_byteswap_16(opcode);
}
-uae_u32 REGPARAM2 op_illg_1 (uae_u32 opcode)
+uae_u32 REGPARAM2 op_illg_1(uae_u32 opcode)
{
opcode = opcode_swap(opcode);
op_illg(opcode);
return 4;
}
+void REGPARAM2 op_illg_1_noret(uae_u32 opcode)
+{
+ op_illg_1(opcode);
+}
uae_u32 REGPARAM2 op_unimpl_1 (uae_u32 opcode)
{
opcode = opcode_swap(opcode);
op_unimpl(opcode);
return 4;
}
+void REGPARAM2 op_unimpl_1_noret(uae_u32 opcode)
+{
+ op_unimpl_1(opcode);
+}
+
// generic+direct, generic+direct+jit, generic+indirect, more compatible, cycle-exact, mmu, mmu+more compatible, mmu+mc+ce
static const struct cputbl *cputbls[6][8] =
abort ();
}
- for (opcode = 0; opcode < 65536; opcode++)
+ for (opcode = 0; opcode < 65536; opcode++) {
cpufunctbl[opcode] = op_illg_1;
- for (i = 0; tbl[i].handler_ff != NULL; i++) {
+ cpufunctbl_noret[opcode] = op_illg_1_noret;
+ }
+ for (i = 0; tbl[i].handler_ff != NULL || tbl[i].handler_ff_noret != NULL; i++) {
opcode = tbl[i].opcode;
cpufunctbl[opcode] = tbl[i].handler_ff;
+ cpufunctbl_noret[opcode] = tbl[i].handler_ff_noret;
cpudatatbl[opcode].length = tbl[i].length;
cpudatatbl[opcode].disp020[0] = tbl[i].disp020[0];
cpudatatbl[opcode].disp020[1] = tbl[i].disp020[1];
/* hack fpu to 68000/68010 mode */
if (currprefs.fpu_model && currprefs.cpu_model < 68020) {
tbl = op_smalltbl_3;
- for (i = 0; tbl[i].handler_ff != NULL; i++) {
+ for (i = 0; tbl[i].handler_ff != NULL || tbl[i].handler_ff_noret != NULL; i++) {
if ((tbl[i].opcode & 0xfe00) == 0xf200) {
cpufunctbl[tbl[i].opcode] = tbl[i].handler_ff;
+ cpufunctbl_noret[tbl[i].opcode] = tbl[i].handler_ff_noret;
cpudatatbl[tbl[i].opcode].length = tbl[i].length;
cpudatatbl[tbl[i].opcode].disp020[0] = tbl[i].disp020[0];
cpudatatbl[tbl[i].opcode].disp020[1] = tbl[i].disp020[1];
opcnt = 0;
for (opcode = 0; opcode < 65536; opcode++) {
- cpuop_func *f;
struct instr *table = &table68k[opcode];
if (table->mnemo == i_ILLG)
// generates unimplemented instruction exception.
if (currprefs.int_no_unimplemented && table->unimpclev == 5) {
cpufunctbl[opcode] = op_unimpl_1;
+ cpufunctbl_noret[opcode] = op_unimpl_1_noret;
continue;
}
// remove unimplemented instruction that were removed in previous models,
// clev=4: implemented in 68040 or later. unimpclev=5: not in 68060
if (table->unimpclev < 5 || (table->clev == 4 && table->unimpclev == 5)) {
cpufunctbl[opcode] = op_illg_1;
+ cpufunctbl_noret[opcode] = op_illg_1_noret;
continue;
}
} else {
cpufunctbl[opcode] = op_illg_1;
+ cpufunctbl_noret[opcode] = op_illg_1_noret;
continue;
}
}
if (table->handler != -1) {
int idx = table->handler;
- f = cpufunctbl[idx];
- if (f == op_illg_1)
+ if (cpufunctbl[idx] == op_illg_1 || cpufunctbl_noret[idx] == op_illg_1_noret)
abort ();
- cpufunctbl[opcode] = f;
+ cpufunctbl[opcode] = cpufunctbl[idx];
+ cpufunctbl_noret[opcode] = cpufunctbl_noret[idx];
memcpy(&cpudatatbl[opcode], &cpudatatbl[idx], sizeof(struct cputbl_data));
opcnt++;
}
Exception (cputrace.state);
} else if (cputrace.state == 1) {
write_log (_T("CPU TRACE: %04X\n"), cputrace.opcode);
- (*cpufunctbl[cputrace.opcode])(cputrace.opcode);
+ (*cpufunctbl_noret[cputrace.opcode])(cputrace.opcode);
}
} else {
write_log (_T("CPU TRACE: STOPPED\n"));
record_dma_event_data(DMA_EVENT_CPUINS, current_hpos(), vpos, r->opcode);
}
- (*cpufunctbl[r->opcode])(r->opcode);
+ (*cpufunctbl_noret[r->opcode])(r->opcode);
if (!regs.loop_mode)
regs.ird = regs.opcode;
regs.instruction_cnt++;
} else {
- (*cpufunctbl[regs.opcode])(regs.opcode);
+ (*cpufunctbl_noret[regs.opcode])(regs.opcode);
wait_memory_cycles();
}
debug_trainer_match();
}
- (*cpufunctbl[r->opcode])(r->opcode);
+ (*cpufunctbl_noret[r->opcode])(r->opcode);
if (r->spcflags) {
if (do_specialties (0))
debug_trainer_match();
}
- (*cpufunctbl[r->opcode])(r->opcode);
+ (*cpufunctbl_noret[r->opcode])(r->opcode);
cpu_cycles = 1 * CYCLE_UNIT;
cycles = adjust_cycles(cpu_cycles);
if (cputrace.state > 1)
Exception (cputrace.state);
else if (cputrace.state == 1)
- (*cpufunctbl[cputrace.opcode])(cputrace.opcode);
+ (*cpufunctbl_noret[cputrace.opcode])(cputrace.opcode);
}
set_cpu_tracer (false);
goto cont;
debug_trainer_match();
}
- (*cpufunctbl[r->opcode])(r->opcode);
+ (*cpufunctbl_noret[r->opcode])(r->opcode);
wait_memory_cycles();
regs.instruction_cnt++;