|
|
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:
7: #include "areaset.h"
1.1.1.3 root 8: #include "mpu.h"
1.1 root 9:
1.1.1.4 root 10: std::unique_ptr<AreaSetDevice> gAreaSet;
11:
1.1 root 12: AreaSetDevice::AreaSetDevice()
1.1.1.5 ! root 13: : inherited("AreaSet")
1.1 root 14: {
15: devaddr = baseaddr;
16: devlen = 0x2000;
17: }
18:
19: AreaSetDevice::~AreaSetDevice()
20: {
21: }
22:
1.1.1.3 root 23: void
24: AreaSetDevice::ResetHard()
25: {
26: limit = 0;
27: }
28:
1.1 root 29: uint64
30: AreaSetDevice::Read8(uint32 addr)
31: {
32: switch (addr) {
33: case 0xe86001:
34: return limit;
35: }
36: return (uint64)-1;
37: }
38:
39: uint64
40: AreaSetDevice::Read16(uint32 addr)
41: {
42: return 0xff00 | Read8(addr + 1);
43: }
44:
45: uint64
46: AreaSetDevice::Write8(uint32 addr, uint32 data)
47: {
1.1.1.3 root 48: gMPU->AddCycle(7); // InsideOut p.135
49:
1.1 root 50: switch (addr) {
51: case 0xe86001:
52: putlog(0, "未実装エリアセット書き込み $%02x", data);
53: limit = data;
54: return 0;
55: default:
56: break;
57: }
58: return (uint64)-1;
59: }
60:
61: uint64
62: AreaSetDevice::Write16(uint32 addr, uint32 data)
63: {
64: return Write8(addr + 1, data);
65: }
66:
67: uint64
68: AreaSetDevice::Peek8(uint32 addr)
69: {
70: switch (addr) {
71: case 0xe86001:
72: return limit;
73: default:
74: return 0xff;
75: }
76: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.