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