--- nono/vm/mfp.h 2026/04/29 17:04:55 1.1.1.9 +++ nono/vm/mfp.h 2026/04/29 17:05:17 1.1.1.13 @@ -4,11 +4,19 @@ // Licensed under nono-license.txt // +// +// MFP (MC68901) +// + #pragma once #include "device.h" +#include "event.h" #include "monitor.h" -#include "scheduler.h" +#include + +class InterruptDevice; +class X68030Keyboard; struct MFP { @@ -186,14 +194,24 @@ class MFPDevice : public IODevice MFPDevice(); virtual ~MFPDevice() override; - void ResetHard() override; + bool Init() override; + void ResetHard(bool poweron) override; // 割り込みアクノリッジ int InterruptAcknowledge(); + // HSync 入力 + void SetHSync(bool hsync); + // VDisp 入力 void SetVDisp(bool vdisp); + // 電源ボタン状態入力 + void SetPowSW(bool powsw); + + // ALARM 信号入力 + void SetAlarmOut(bool alarm); + // KEY CTRL 状態を設定する void SetKeyCtrl(bool ctrl); @@ -241,11 +259,14 @@ class MFPDevice : public IODevice DECLARE_MONITOR_CALLBACK(MonitorUpdate); struct MFP mfp {}; - Event event[4] {}; + std::array event {}; Event key_event { this }; Monitor monitor { this }; + InterruptDevice *interrupt {}; + X68030Keyboard *keyboard {}; + static const char *intrname[]; static const char *gpipname[]; static const int prescale_ns[8]; @@ -253,4 +274,6 @@ class MFPDevice : public IODevice static const int timer_vector[4]; }; -extern std::unique_ptr gMFP; +static inline MFPDevice *GetMFPDevice() { + return Object::GetObject(OBJ_MFP); +}