|
|
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: if (inherited::Init() == false) {
31: return false;
32: }
33:
34: x68kio = GetX68kIODevice();
35:
36: return true;
37: }
38:
1.1.1.6 root 39: // リセット
1.1.1.3 root 40: void
1.1.1.6 root 41: AreaSetDevice::ResetHard(bool poweron)
1.1.1.3 root 42: {
1.1.1.9 root 43: // リセットでどうなるかは分からないけど、
44: // さすがに不定ではないだろう。
45: x68kio->SetAreaset(0);
1.1.1.3 root 46: }
47:
1.1.1.9 root 48: busdata
1.1.1.10! root 49: AreaSetDevice::ReadPort(uint32 offset)
1.1 root 50: {
1.1.1.10! root 51: putlog(2, "Read $%06x (BusErr)", mpu->GetPaddr());
! 52: return BusData::BusErr;
1.1 root 53: }
54:
55:
1.1.1.9 root 56: busdata
1.1.1.10! root 57: AreaSetDevice::WritePort(uint32 offset, uint32 data)
1.1 root 58: {
1.1.1.10! root 59: putlog(1, "Write $%06x <- $%02x", mpu->GetPaddr(), data);
! 60: x68kio->SetAreaset(data);
1.1.1.9 root 61:
62: const busdata wait = busdata::Wait(7 * 40_nsec);
1.1.1.10! root 63: busdata r = wait;
! 64: r |= BusData::Size1;
1.1.1.9 root 65: return r;
1.1 root 66: }
67:
1.1.1.9 root 68: busdata
1.1.1.10! root 69: AreaSetDevice::PeekPort(uint32 offset)
1.1 root 70: {
1.1.1.10! root 71: return BusData::BusErr;
1.1 root 72: }
73:
1.1.1.10! root 74: bool
! 75: AreaSetDevice::PokePort(uint32 offset, uint32 data)
1.1 root 76: {
1.1.1.10! root 77: // とりあえず
! 78: return false;
1.1 root 79: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.