|
|
1.1 root 1: //
2: // nono
3: // Copyright (C) 2020 nono project
4: // Licensed under nono-license.txt
5: //
6:
1.1.1.6 root 7: //
8: // PEDEC
9: //
10:
1.1 root 11: #pragma once
12:
13: #include "interrupt.h"
14:
1.1.1.4 root 15: class PEDECDevice : public InterruptDevice
1.1 root 16: {
17: using inherited = InterruptDevice;
1.1.1.6 root 18:
1.1.1.10! root 19: static const uint32 baseaddr = 0xe9c000;
1.1 root 20:
21: public:
1.1.1.9 root 22: // SPC からの割り込みはここでマスク制御しないので intmap_enable には
1.1.1.2 root 23: // IntmapSPC を常に立てておくこと。
1.1.1.9 root 24: static const uint32 IntmapSPC = 0x1000;
25: static const uint32 IntmapFDC = 0x0080;
26: static const uint32 IntmapFDD0 = 0x0800;
27: static const uint32 IntmapFDD1 = 0x0400;
28: static const uint32 IntmapFDD2 = 0x0200;
29: static const uint32 IntmapFDD3 = 0x0100;
30: static const uint32 IntmapFDD = 0x0f00; // FDD(0|1|2|3)
31: static const uint32 IntmapHDD = 0x0020;
32: static const uint32 IntmapPRT = 0x0010;
1.1.1.2 root 33:
34: public:
1.1 root 35: PEDECDevice();
1.1.1.9 root 36: ~PEDECDevice() override;
1.1 root 37:
1.1.1.7 root 38: bool Init() override;
1.1.1.6 root 39: void ResetHard(bool poweron) override;
1.1 root 40:
41: // InterruptDevice インタフェース
1.1.1.9 root 42: busdata InterruptAcknowledge(int lv) override;
1.1 root 43:
1.1.1.5 root 44: // 割り込みコントローラからのモニタ表示
45: void MonitorUpdate(TextScreen& screen, uint intr_level, int y);
1.1.1.2 root 46:
1.1 root 47: protected:
48: // BusIO インタフェース
49: static const uint32 NPORT = 8;
1.1.1.10! root 50: busdata ReadPort(uint32 offset);
! 51: busdata WritePort(uint32 offset, uint32 data);
! 52: busdata PeekPort(uint32 offset);
! 53: bool PokePort(uint32 offset, uint32 data);
1.1 root 54:
55: private:
56: // 割り込みステータスレジスタの値を取得
57: uint32 GetStat() const;
58:
59: // 割り込み信号線の状態を変える
1.1.1.5 root 60: void ChangeInterrupt() override;
1.1 root 61:
62: uint8 vector {};
1.1.1.7 root 63:
64: InterruptDevice *interrupt {};
1.1 root 65: };
66:
1.1.1.7 root 67: static inline PEDECDevice *GetPEDECDevice() {
68: return Object::GetObject<PEDECDevice>(OBJ_PEDEC);
69: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.