|
|
1.1 root 1: //
2: // nono
3: // Copyright (C) 2022 nono project
4: // Licensed under nono-license.txt
5: //
6:
7: //
8: // NEWS の I/O 空間担当
9: //
10:
11: #pragma once
12:
13: #include "device.h"
1.1.1.2 ! root 14: #include "monitor.h"
1.1 root 15: #include <array>
16:
1.1.1.2 ! root 17: class NewsCtlrDevice;
! 18:
! 19: class NewsIODevice : public IODevice
1.1 root 20: {
1.1.1.2 ! root 21: using inherited = IODevice;
1.1 root 22: public:
23: NewsIODevice();
24: ~NewsIODevice() override;
25:
26: bool Init() override;
27:
1.1.1.2 ! root 28: busdata Read8(uint32 addr) override;
! 29: busdata Read16(uint32 addr) override;
! 30: busdata Read32(uint32 addr) override;
! 31: busdata Write8(uint32 addr, uint32 data) override;
! 32: busdata Write16(uint32 addr, uint32 data) override;
! 33: busdata Write32(uint32 addr, uint32 data) override;
! 34: busdata Peek8(uint32 addr) override;
! 35: bool Poke8(uint32 addr, uint32 data) override;
1.1 root 36:
37: private:
38: inline IODevice *SearchDevice(uint32 addr) const;
39:
1.1.1.2 ! root 40: void InitMonitor();
! 41: DECLARE_MONITOR_CALLBACK(MonitorUpdate);
! 42:
1.1 root 43: std::unique_ptr<IODevice> pKBC {};
44: std::unique_ptr<IODevice> pLance {};
45: std::unique_ptr<IODevice> pRTC {};
46: std::unique_ptr<IODevice> pSCC {};
47: std::unique_ptr<IODevice> pSubRAM {};
48:
49: // デバイステーブル
50: std::array<IODevice *, 64> table {};
1.1.1.2 ! root 51:
! 52: NewsCtlrDevice *newsctlr {};
! 53:
! 54: Monitor monitor { this };
! 55:
! 56: // 裏バッファ
! 57: TextScreen src_screen {};
1.1 root 58: };
59:
60: static inline NewsIODevice *GetNewsIODevice() {
61: return Object::GetObject<NewsIODevice>(OBJ_NEWSIO);
62: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.