--- nono/m88xx0/m88100subr.cpp 2026/04/29 17:04:52 1.1.1.7 +++ nono/m88xx0/m88100subr.cpp 2026/04/29 17:05:05 1.1.1.9 @@ -20,9 +20,10 @@ m88kcpu::m88kcpu() for (int i = 1; i < 32; i++) { r[i] = Undefined; } - for (int i = 1; i < 9; i++) { - fcr[i] = Undefined; + for (int i = 0; i < countof(fcr); i++) { + fcr[i] = Undefined & fcr_mask[i]; } + epsr = Undefined; ssbr = Undefined; sfip = Undefined; @@ -35,7 +36,6 @@ m88kcpu::m88kcpu() dmd0 = Undefined; dmd1 = Undefined; dmd2 = Undefined; - } // デストラクタ @@ -68,6 +68,14 @@ m88kcpu::SetClockSpeed(uint32 clock_khz_ v2c_shift = rr; } +// DOS call エミュレーションのコールバックを設定 +void +m88kcpu::SetFLineCallback(bool (*callback)(m88kcpu *, void *), void *arg) +{ + fline_callback = callback; + fline_arg = arg; +} + // PID の VERSION フィールドをセットする。初期化時に呼ぶ。 void m88kcpu::SetVersion(uint32 version) @@ -76,6 +84,21 @@ m88kcpu::SetVersion(uint32 version) pid |= version << 1; } +// fcr のマスク +/*static*/ const uint32 m88100reg::fcr_mask[11] = { + FPECR_MASK, + 0xffffffff, // fphs1 + 0xffffffff, // fpls1 + 0xffffffff, // fphs2 + 0xffffffff, // fpls2 + FPPT_MASK, + FPRH_MASK, + 0xffffffff, // fprl + FPIT_MASK, + FPSR_MASK, + FPCR_MASK, +}; + /*static*/ const char * const m88100reg::sipname[3] = { "sxip", "snip", "sfip", };