--- nono/m88xx0/m88100subr.cpp 2026/04/29 17:04:49 1.1.1.6 +++ nono/m88xx0/m88100subr.cpp 2026/04/29 17:05:05 1.1.1.9 @@ -7,10 +7,8 @@ #include "m88100.h" // コンストラクタ -m88kcpu::m88kcpu(uint32 reset_vector_) +m88kcpu::m88kcpu() { - reset_vector = reset_vector_; - cmmu[0].Ctor(this); cmmu[1].Ctor(this); @@ -22,9 +20,10 @@ m88kcpu::m88kcpu(uint32 reset_vector_) 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; @@ -37,7 +36,6 @@ m88kcpu::m88kcpu(uint32 reset_vector_) dmd0 = Undefined; dmd1 = Undefined; dmd2 = Undefined; - } // デストラクタ @@ -70,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) @@ -78,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", };