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