|
|
1.1 root 1: //
2: // nono
3: // Copyright (C) 2020 nono project
4: // Licensed under nono-license.txt
5: //
6:
7: //
8: // メインバス (X68030)
9: //
10:
11: #pragma once
12:
13: #include "mainbus.h"
14:
15: class BankRAMDevice;
16: class ExtRAMDevice;
17: class X68kIODevice;
18:
19: class X68kMainbus final : public MainbusDevice
20: {
21: using inherited = MainbusDevice;
22: public:
23: X68kMainbus();
24: ~X68kMainbus() override;
25:
26: bool Init() override;
27: bool InitMainbus() override;
28: void ResetByMPU() override;
29: void ResetHard(bool poweron) override;
30:
31: busdata Peek8(uint32 addr) override;
32: bool Poke8(uint32 addr, uint32 data) override;
33:
34: busdata Read8(busaddr addr) override;
35: busdata Read16(busaddr addr) override;
36: busdata Read32(busaddr addr) override;
37: busdata Write8(busaddr addr, uint32 data) override;
38: busdata Write16(busaddr addr, uint32 data) override;
39: busdata Write32(busaddr addr, uint32 data) override;
40:
41: private:
42: DECLARE_MONITOR_CALLBACK(MonitorUpdate);
43: DECLARE_MONITOR_CALLBACK(MonitorUpdateAccStat);
44:
45: inline bool IsIntio(uint32) const;
46:
47: // ブートページを切り替える。
48: void SwitchBootPage(bool isrom) override;
49:
50: std::unique_ptr<ExtRAMDevice> pExtRAM /*{}*/;
51: std::unique_ptr<X68kIODevice> pX68kIO /*{}*/;
52: // どこに置く?
53: std::unique_ptr<IODevice> pInterrupt {};
54:
55: std::array<bool, 256> is_intio {};
56: // 拡張メモリの開始位置 [MB]
57: int extstart {};
58: // 拡張メモリのサイズ [MB]
59: int extsize {};
60:
61: // アクセス状況はとりあえず 1GB 分を 1048 * 1MB ずつ。
62: std::array<uint8, 1024> accstat_read {};
63: std::array<uint8, 1024> accstat_write {};
64:
65: Monitor monitor { this };
66: Monitor monitor_accstat { this };
67:
68: std::array<BankRAMDevice*, 2> bankram /*{}*/;
69: };
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.