--- nono/m680x0/m68030core.h 2026/04/29 17:04:38 1.1.1.3 +++ nono/m680x0/m68030core.h 2026/04/29 17:04:49 1.1.1.6 @@ -21,34 +21,28 @@ extern void m68030_set_sr(m68kcpu *, uin extern void m68030_exception(m68kcpu *, int); extern void m68030_exception_reset(m68kcpu *); extern void m68030_exception_buserr(m68kcpu *, int); -extern void m68030_exception_interrupt(m68kcpu *, int, int); +extern void m68030_exception_interrupt(m68kcpu *, int); extern void m68030_rte(m68kcpu *); -extern const char *m68030_get_exception_name(int); -static inline void cpulog(int lv, const char *fmt, ...) __printflike(2, 3); -static inline void -cpulog(int lv, const char *fmt, ...) -{ - if (__predict_false(gMPU->loglevel >= lv)) { - va_list ap; - va_start(ap, fmt); - gMPU->vputlog(fmt, ap); - va_end(ap); - } -} +// 文字列を作る前にレベルを評価するためマクロ +#define cpulog(lv, fmt...) do { \ + if (__predict_false(gMPU->loglevel >= (lv))) { \ + gMPU->putlogn(fmt); \ + } \ +} while (0) // ops 用のマクロとか static inline void m68k_add_cycle(m68kcpu *cpu, int cc) { - cpu->cycle_cache += cc; + cpu->used_cycle += cc; } static inline void m68k_add_cycle_nc(m68kcpu *cpu, int cc, int ncc) { - cpu->cycle_cache += cc; + cpu->used_cycle += cc; cpu->cycle_nocache += ncc - cc; } @@ -81,7 +75,7 @@ m68030_jump(m68kcpu *cpu, uint32 addr) RegPC = addr; // ブランチ履歴 - cpu->brhist.AddEntry(RegPPC, addr, cpu->ir << 16); + cpu->brhist.AddEntry(RegPPC | (cpu->reg.s ? 1 : 0), addr, cpu->ir << 16); } // -(An) 実行前にレジスタを保存する。