|
|
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.3 root 16: class OPMDevice : public IODevice
1.1 root 17: {
18: using inherited = IODevice;
1.1.1.4 root 19:
1.1 root 20: static const int baseaddr = 0xe90000;
1.1.1.5 ! root 21: static const uint64 clk = 250_nsec; // 4MHz
1.1 root 22:
23: public:
24: OPMDevice();
25: virtual ~OPMDevice() override;
26:
1.1.1.5 ! root 27: void ResetHard(bool poweron) override;
! 28:
1.1 root 29: protected:
30: // BusIO インタフェース
31: static const uint32 NPORT = 2;
1.1.1.2 root 32: uint64 Read(uint32 offset);
33: uint64 Write(uint32 offset, uint32 data);
34: uint64 Peek(uint32 offset);
1.1.1.4 root 35:
36: private:
1.1.1.5 ! root 37: bool IsBusy() const;
! 38:
1.1.1.4 root 39: int reg {}; // アクセスレジスタ番号
1.1.1.5 ! root 40:
! 41: uint64 busy_origin; // BUSY の起点時刻
! 42: uint64 busy_start; // BUSY のアサート開始時刻
! 43: uint64 busy_end; // BUSY のアサート終了時刻
1.1 root 44: };
45:
1.1.1.4 root 46: extern OPMDevice *gOPM;
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.