--- nono/vm/mfp.h 2026/04/29 17:04:52 1.1.1.8 +++ nono/vm/mfp.h 2026/04/29 17:05:10 1.1.1.11 @@ -4,10 +4,16 @@ // Licensed under nono-license.txt // +// +// MFP (MC68901) +// + #pragma once #include "device.h" -#include "scheduler.h" +#include "event.h" +#include "monitor.h" +#include struct MFP { @@ -175,8 +181,7 @@ struct MFP uint16 udr; }; -class MFPDevice - : public IODevice +class MFPDevice : public IODevice { using inherited = IODevice; @@ -186,12 +191,14 @@ class MFPDevice MFPDevice(); virtual ~MFPDevice() override; - void ResetHard() override; - void MonitorUpdate(TextScreen&) override; + void ResetHard(bool poweron) override; // 割り込みアクノリッジ int InterruptAcknowledge(); + // HSync 入力 + void SetHSync(bool hsync); + // VDisp 入力 void SetVDisp(bool vdisp); @@ -239,9 +246,13 @@ class MFPDevice // 割り込み信号線の状態を変える void ChangeInterrupt(); + DECLARE_MONITOR_CALLBACK(MonitorUpdate); + struct MFP mfp {}; - Event event[4] {}; - Event key_event {}; + std::array event {}; + Event key_event { this }; + + Monitor monitor { this }; static const char *intrname[]; static const char *gpipname[]; @@ -250,4 +261,4 @@ class MFPDevice static const int timer_vector[4]; }; -extern std::unique_ptr gMFP; +extern MFPDevice *gMFP;