|
|
1.1 root 1: //
2: // nono
3: // Copyright (C) 2020 nono project
4: // Licensed under nono-license.txt
5: //
6:
7: //
8: // X68030 のメイン空間 ($000000-$FFFFFF) 担当
9: //
10:
11: #pragma once
12:
1.1.1.3 ! root 13: #include "mainbus.h"
1.1 root 14:
1.1.1.3 ! root 15: class X68kIODevice : public MainbusBaseDevice
1.1 root 16: {
1.1.1.3 ! root 17: using inherited = MainbusBaseDevice;
1.1 root 18: public:
19: X68kIODevice();
1.1.1.3 ! root 20: ~X68kIODevice() override;
1.1 root 21:
1.1.1.3 ! root 22: bool InitMainbus() override;
1.1 root 23:
1.1.1.3 ! root 24: busdata Peek8(uint32 addr) override;
! 25: bool Poke8(uint32 addr, uint32 data) override;
1.1 root 26:
1.1.1.3 ! root 27: busdata Read8(busaddr addr) override;
! 28: busdata Read16(busaddr addr) override;
! 29: busdata Read32(busaddr addr) override;
! 30: busdata Write8(busaddr addr, uint32 data) override;
! 31: busdata Write16(busaddr addr, uint32 data) override;
! 32: busdata Write32(busaddr addr, uint32 data) override;
! 33:
! 34: // ブートページを切り替える。(X68kMainbus から呼ばれる)
! 35: void SwitchBootPage(bool isrom) override;
! 36:
! 37: // エリアセット。
! 38: uint8 GetAreaset() const { return arealimit; }
! 39: void SetAreaset(uint8 arealimit_);
! 40: // 拡張エリアセット。
! 41: uint8 GetExtarea(int offset) const;
! 42: void SetExtarea(int offset, uint8 data);
1.1 root 43:
1.1.1.3 ! root 44: private:
! 45: void SetUdevice(uint32 startaddr, uint32 endaddr, bool accessible);
1.1.1.2 root 46: void AddDevice(IODevice *dev, uint devaddr, uint devlen);
47:
1.1.1.3 ! root 48: inline IODevice *Decoder(bool super, uint32 addr) const;
! 49: inline void CheckCI(busaddr addr);
1.1 root 50:
1.1.1.2 root 51: DECLARE_MONITOR_CALLBACK(MonitorUpdate);
1.1.1.3 ! root 52: DECLARE_MONITOR_CALLBACK(MonitorUpdateAreaset);
1.1 root 53:
54: std::unique_ptr<IODevice> pADPCM {};
55: std::unique_ptr<IODevice> pAreaSet {};
1.1.1.3 ! root 56: std::unique_ptr<IODevice> pBusErr {};
1.1 root 57: std::unique_ptr<IODevice> pCGROM {};
58: std::unique_ptr<IODevice> pCRTC {};
59: std::unique_ptr<IODevice> pDMAC {};
1.1.1.3 ! root 60: std::unique_ptr<IODevice> pExtArea {};
1.1 root 61: std::unique_ptr<IODevice> pFDC {};
62: std::unique_ptr<IODevice> pGVRAM {};
63: std::unique_ptr<IODevice> pPEDEC {};
1.1.1.3 ! root 64: std::unique_ptr<IODevice> pIPLROM0 {};
1.1 root 65: std::unique_ptr<IODevice> pIPLROM1 {};
66: std::unique_ptr<IODevice> pIPLROM2 {};
1.1.1.3 ! root 67: std::unique_ptr<IODevice> pMainRAM {};
1.1 root 68: std::unique_ptr<IODevice> pMFP {};
1.1.1.2 root 69: std::unique_ptr<IODevice> pNereid {};
1.1 root 70: std::unique_ptr<IODevice> pOPM {};
71: std::unique_ptr<IODevice> pPlaneVRAM {};
72: std::unique_ptr<IODevice> pPluto {};
73: std::unique_ptr<IODevice> pPPI {};
74: std::unique_ptr<IODevice> pPrinter {};
75: std::unique_ptr<IODevice> pRTC {};
76: std::unique_ptr<IODevice> pSCC {};
77: std::unique_ptr<IODevice> pSRAM {};
78: std::unique_ptr<IODevice> pSPC {};
79: std::unique_ptr<IODevice> pSprite {};
80: std::unique_ptr<IODevice> pSysport {};
81: std::unique_ptr<IODevice> pVideoCtlr {};
1.1.1.3 ! root 82: std::unique_ptr<IODevice> pWindrv {};
! 83:
! 84: std::array<IODevice*, 2048> udevice {}; // ユーザ空間用
! 85: std::array<IODevice*, 2048> sdevice {}; // スーパーバイザ空間用
! 86:
! 87: uint8 arealimit {}; // エリアセット (設定値)
! 88: std::array<uint8, 5> extarea {}; // 拡張エリアセット (設定値)
1.1 root 89:
1.1.1.3 ! root 90: bool cut_fc2 {}; // FC2 ピンカットなら true
1.1.1.2 root 91:
92: Monitor monitor { this };
1.1.1.3 ! root 93: Monitor monitor_area { this };
1.1 root 94: };
1.1.1.2 root 95:
96: static inline X68kIODevice *GetX68kIODevice() {
97: return Object::GetObject<X68kIODevice>(OBJ_X68KIO);
98: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.