|
|
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 "printer.h"
1.1.1.3 root 8: #include "mpu.h"
1.1 root 9:
1.1.1.4 root 10: std::unique_ptr<PrinterDevice> gPrinter;
11:
1.1 root 12: PrinterDevice::PrinterDevice()
1.1.1.5 ! root 13: : inherited("Printer")
1.1 root 14: {
15: devaddr = baseaddr;
16: devlen = 0x2000;
17: }
18:
19: PrinterDevice::~PrinterDevice()
20: {
21: }
22:
23: uint64
24: PrinterDevice::Read8(uint32 addr)
25: {
26: // 書き込み専用
1.1.1.3 root 27: gMPU->AddCycle(7); // InsideOut p.135
1.1 root 28: return (uint64)-1;
29: }
30:
31: uint64
32: PrinterDevice::Read16(uint32 addr)
33: {
34: // 書き込み専用
1.1.1.3 root 35: gMPU->AddCycle(7); // InsideOut p.135
1.1 root 36: return (uint64)-1;
37: }
38:
39: uint64
40: PrinterDevice::Write8(uint32 addr, uint32 data)
41: {
1.1.1.3 root 42: gMPU->AddCycle(7); // InsideOut p.135
43:
1.1 root 44: uint32 offset = addr - baseaddr;
45: switch (offset) {
46: case 0:
47: putlog(0, "未実装データ書き込み");
48: break;
49: case 3:
50: putlog(0, "未実装ストローブ書き込み");
51: return 0;
52: default:
53: break;
54: }
55: return (uint64)-1;
56: }
57:
58: uint64
59: PrinterDevice::Write16(uint32 addr, uint32 data)
60: {
61: return Write8(addr + 1, data);
62: }
63:
64: uint64
65: PrinterDevice::Peek8(uint32 addr)
66: {
67: // XXX
68: return 0xff;
69: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.