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