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

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

unix.superglobalmegacorp.com

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