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