Annotation of nono/vm/printer.cpp, revision 1.1.1.11

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

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.