|
|
1.1 root 1: //
2: // nono
3: // Copyright (C) 2021 nono project
4: // Licensed under nono-license.txt
5: //
6:
7: //
8: // ABORT/INTERRUPT スイッチによる NMI 機構デバイス
9: //
10:
11: #pragma once
12:
13: #include "device.h"
14: #include "message.h"
15: #include "event.h"
16:
1.1.1.2 ! root 17: class InterruptDevice;
! 18:
1.1 root 19: class NMIDevice : public Device
20: {
21: using inherited = Device;
22: public:
23: NMIDevice();
24: ~NMIDevice() override;
25:
26: bool Init() override;
27:
28: // NMI ボタンを押す
29: void PressNMI();
30:
31: // NMI 信号線をアサートする
32: void AssertNMI();
33:
34: // NMI 信号線をネゲートする
35: void NegateNMI();
36:
37: private:
38: void AssertCallback(MessageID, uint32);
39: void NegateCallback(Event& ev);
40:
1.1.1.2 ! root 41: InterruptDevice *interrupt {};
! 42:
1.1 root 43: Event event { this };
44: };
45:
1.1.1.2 ! root 46: static inline NMIDevice *GetNMIDevice() {
! 47: return Object::GetObject<NMIDevice>(OBJ_NMI);
! 48: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.