|
|
1.1 root 1: //
2: // nono
1.1.1.2 root 3: // Copyright (C) 2020 nono project
4: // Licensed under nono-license.txt
1.1 root 5: //
6:
1.1.1.6 root 7: //
8: // エリアセット
9: //
10:
1.1 root 11: #include "areaset.h"
1.1.1.3 root 12: #include "mpu.h"
1.1.1.9 root 13: #include "x68kio.h"
1.1 root 14:
1.1.1.6 root 15: // コンストラクタ
1.1 root 16: AreaSetDevice::AreaSetDevice()
1.1.1.8 root 17: : inherited(OBJ_AREASET)
1.1 root 18: {
19: }
20:
1.1.1.6 root 21: // デストラクタ
1.1 root 22: AreaSetDevice::~AreaSetDevice()
23: {
24: }
25:
1.1.1.9 root 26: // 初期化
27: bool
28: AreaSetDevice::Init()
29: {
30: x68kio = GetX68kIODevice();
31:
32: return true;
33: }
34:
1.1.1.6 root 35: // リセット
1.1.1.3 root 36: void
1.1.1.6 root 37: AreaSetDevice::ResetHard(bool poweron)
1.1.1.3 root 38: {
1.1.1.9 root 39: // リセットでどうなるかは分からないけど、
40: // さすがに不定ではないだろう。
41: x68kio->SetAreaset(0);
1.1.1.3 root 42: }
43:
1.1.1.9 root 44: busdata
1.1.1.10 root 45: AreaSetDevice::ReadPort(uint32 offset)
1.1 root 46: {
1.1.1.10 root 47: putlog(2, "Read $%06x (BusErr)", mpu->GetPaddr());
48: return BusData::BusErr;
1.1 root 49: }
50:
51:
1.1.1.9 root 52: busdata
1.1.1.10 root 53: AreaSetDevice::WritePort(uint32 offset, uint32 data)
1.1 root 54: {
1.1.1.10 root 55: putlog(1, "Write $%06x <- $%02x", mpu->GetPaddr(), data);
56: x68kio->SetAreaset(data);
1.1.1.9 root 57:
58: const busdata wait = busdata::Wait(7 * 40_nsec);
1.1.1.10 root 59: busdata r = wait;
60: r |= BusData::Size1;
1.1.1.9 root 61: return r;
1.1 root 62: }
63:
1.1.1.9 root 64: busdata
1.1.1.10 root 65: AreaSetDevice::PeekPort(uint32 offset)
1.1 root 66: {
1.1.1.10 root 67: return BusData::BusErr;
1.1 root 68: }
69:
1.1.1.10 root 70: bool
71: AreaSetDevice::PokePort(uint32 offset, uint32 data)
1.1 root 72: {
1.1.1.10 root 73: // とりあえず
74: return false;
1.1 root 75: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.