|
|
1.1 ! root 1: // ! 2: // nono ! 3: // Copyright (C) 2017 [email protected] ! 4: // ! 5: ! 6: #include "printer.h" ! 7: ! 8: PrinterDevice::PrinterDevice() ! 9: { ! 10: logname = "printer"; ! 11: devname = "Printer"; ! 12: devaddr = baseaddr; ! 13: devlen = 0x2000; ! 14: } ! 15: ! 16: PrinterDevice::~PrinterDevice() ! 17: { ! 18: } ! 19: ! 20: uint64 ! 21: PrinterDevice::Read8(uint32 addr) ! 22: { ! 23: // 書き込み専用 ! 24: return (uint64)-1; ! 25: } ! 26: ! 27: uint64 ! 28: PrinterDevice::Read16(uint32 addr) ! 29: { ! 30: // 書き込み専用 ! 31: return (uint64)-1; ! 32: } ! 33: ! 34: uint64 ! 35: PrinterDevice::Write8(uint32 addr, uint32 data) ! 36: { ! 37: uint32 offset = addr - baseaddr; ! 38: switch (offset) { ! 39: case 0: ! 40: putlog(0, "未実装データ書き込み"); ! 41: break; ! 42: case 3: ! 43: putlog(0, "未実装ストローブ書き込み"); ! 44: return 0; ! 45: default: ! 46: break; ! 47: } ! 48: return (uint64)-1; ! 49: } ! 50: ! 51: uint64 ! 52: PrinterDevice::Write16(uint32 addr, uint32 data) ! 53: { ! 54: return Write8(addr + 1, data); ! 55: } ! 56: ! 57: uint64 ! 58: PrinterDevice::Peek8(uint32 addr) ! 59: { ! 60: // XXX ! 61: return 0xff; ! 62: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.