Annotation of nono/vm/pedec.h, revision 1.1.1.5

1.1       root        1: //
                      2: // nono
                      3: // Copyright (C) 2020 nono project
                      4: // Licensed under nono-license.txt
                      5: //
                      6: 
                      7: #pragma once
                      8: 
                      9: #include "device.h"
                     10: #include "interrupt.h"
                     11: 
1.1.1.4   root       12: class PEDECDevice : public InterruptDevice
1.1       root       13: {
                     14:        using inherited = InterruptDevice;
                     15:  private:
                     16:        static const int baseaddr = 0xe9c000;
                     17: 
                     18:  public:
1.1.1.5 ! root       19:        // intmap が下位デバイスからの割り込み信号線 (%1 でアサート)。
        !            20:        // intmap_enabled がマスク (%1 なら割り込み許可)。
1.1.1.2   root       21:        // よって二者を AND とれば上位に割り込みを上げるかどうかが求まる。
1.1.1.5 ! root       22:        // SPC からの割り込みはここでマスク制御しないので intmap_enabled には
1.1.1.2   root       23:        // IntmapSPC を常に立てておくこと。
1.1.1.5 ! root       24:        static const uint32 IntmapSPC = 0x0100;
        !            25:        static const uint32 IntmapFDC = 0x0080;
        !            26:        static const uint32 IntmapFDD = 0x0040;
        !            27:        static const uint32 IntmapHDD = 0x0020;
        !            28:        static const uint32 IntmapPRT = 0x0010;
1.1.1.2   root       29: 
                     30:  public:
1.1       root       31:        PEDECDevice();
                     32:        virtual ~PEDECDevice() override;
                     33: 
                     34:        void ResetHard() override;
                     35: 
                     36:        // InterruptDevice インタフェース
                     37:        int InterruptAcknowledge(int lv) override;
                     38: 
1.1.1.5 ! root       39:        // 割り込みコントローラからのモニタ表示
        !            40:        void MonitorUpdate(TextScreen& screen, uint intr_level, int y);
1.1.1.2   root       41: 
1.1       root       42:  protected:
                     43:        // BusIO インタフェース
                     44:        static const uint32 NPORT = 8;
1.1.1.3   root       45:        uint64 Read(uint32 offset);
                     46:        uint64 Write(uint32 offset, uint32 data);
                     47:        uint64 Peek(uint32 offset);
1.1       root       48: 
                     49:  private:
1.1.1.5 ! root       50:        uint32 GetIntmap(Device *source) const override;
        !            51: 
1.1       root       52:        // 割り込みステータスレジスタの値を取得
                     53:        uint32 GetStat() const;
                     54: 
                     55:        // 割り込み信号線の状態を変える
1.1.1.5 ! root       56:        void ChangeInterrupt() override;
1.1       root       57: 
1.1.1.5 ! root       58:        uint32 intmap_enabled {};
1.1       root       59:        uint8 vector {};
                     60: };
                     61: 
                     62: extern std::unique_ptr<PEDECDevice> gPEDEC;

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.