Annotation of nono/vm/opm.h, revision 1.1.1.6

1.1       root        1: //
                      2: // nono
                      3: // Copyright (C) 2020 nono project
                      4: // Licensed under nono-license.txt
                      5: //
                      6: 
1.1.1.4   root        7: //
                      8: // OPM (YM2151)
                      9: //
                     10: 
1.1       root       11: #pragma once
                     12: 
                     13: #include "device.h"
1.1.1.5   root       14: #include "event.h"
1.1       root       15: 
1.1.1.6 ! root       16: class ADPCMDevice;
        !            17: class FDCDevice;
        !            18: 
1.1.1.3   root       19: class OPMDevice : public IODevice
1.1       root       20: {
                     21:        using inherited = IODevice;
1.1.1.4   root       22: 
1.1       root       23:        static const int baseaddr = 0xe90000;
1.1.1.5   root       24:        static const uint64 clk = 250_nsec;             // 4MHz
1.1       root       25: 
                     26:  public:
                     27:        OPMDevice();
                     28:        virtual ~OPMDevice() override;
                     29: 
1.1.1.6 ! root       30:        bool Init() override;
1.1.1.5   root       31:        void ResetHard(bool poweron) override;
                     32: 
1.1       root       33:  protected:
                     34:        // BusIO インタフェース
                     35:        static const uint32 NPORT = 2;
1.1.1.2   root       36:        uint64 Read(uint32 offset);
                     37:        uint64 Write(uint32 offset, uint32 data);
                     38:        uint64 Peek(uint32 offset);
1.1.1.4   root       39: 
                     40:  private:
1.1.1.5   root       41:        bool IsBusy() const;
                     42: 
1.1.1.4   root       43:        int reg {};             // アクセスレジスタ番号
1.1.1.5   root       44: 
                     45:        uint64 busy_origin;             // BUSY の起点時刻
                     46:        uint64 busy_start;              // BUSY のアサート開始時刻
                     47:        uint64 busy_end;                // BUSY のアサート終了時刻
1.1       root       48: 
1.1.1.6 ! root       49:        ADPCMDevice *adpcm {};
        !            50:        FDCDevice *fdc {};
        !            51: };

unix.superglobalmegacorp.com

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