|
|
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 "device.h"
14: #include "interrupt.h"
15:
1.1.1.4 root 16: class PEDECDevice : public InterruptDevice
1.1 root 17: {
18: using inherited = InterruptDevice;
1.1.1.6 ! root 19:
1.1 root 20: static const int baseaddr = 0xe9c000;
21:
22: public:
1.1.1.5 root 23: // intmap が下位デバイスからの割り込み信号線 (%1 でアサート)。
24: // intmap_enabled がマスク (%1 なら割り込み許可)。
1.1.1.2 root 25: // よって二者を AND とれば上位に割り込みを上げるかどうかが求まる。
1.1.1.5 root 26: // SPC からの割り込みはここでマスク制御しないので intmap_enabled には
1.1.1.2 root 27: // IntmapSPC を常に立てておくこと。
1.1.1.5 root 28: static const uint32 IntmapSPC = 0x0100;
29: static const uint32 IntmapFDC = 0x0080;
30: static const uint32 IntmapFDD = 0x0040;
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();
36: virtual ~PEDECDevice() override;
37:
1.1.1.6 ! root 38: void ResetHard(bool poweron) override;
1.1 root 39:
40: // InterruptDevice インタフェース
41: int InterruptAcknowledge(int lv) override;
42:
1.1.1.5 root 43: // 割り込みコントローラからのモニタ表示
44: void MonitorUpdate(TextScreen& screen, uint intr_level, int y);
1.1.1.2 root 45:
1.1 root 46: protected:
47: // BusIO インタフェース
48: static const uint32 NPORT = 8;
1.1.1.3 root 49: uint64 Read(uint32 offset);
50: uint64 Write(uint32 offset, uint32 data);
51: uint64 Peek(uint32 offset);
1.1 root 52:
53: private:
1.1.1.5 root 54: uint32 GetIntmap(Device *source) const override;
55:
1.1 root 56: // 割り込みステータスレジスタの値を取得
57: uint32 GetStat() const;
58:
59: // 割り込み信号線の状態を変える
1.1.1.5 root 60: void ChangeInterrupt() override;
1.1 root 61:
1.1.1.5 root 62: uint32 intmap_enabled {};
1.1 root 63: uint8 vector {};
64: };
65:
1.1.1.6 ! root 66: extern PEDECDevice *gPEDEC;
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.