Annotation of nono/vm/nop.cpp, revision 1.1.1.1

1.1       root        1: //
                      2: // nono
                      3: // Copyright (C) 2020 nono project
                      4: // Licensed under nono-license.txt
                      5: //
                      6: 
                      7: //
                      8: // 何もしないデバイス
                      9: //
                     10: 
                     11: #include "nop.h"
                     12: 
                     13: // コンストラクタ
                     14: NopIODevice::NopIODevice()
                     15:        : inherited(OBJ_NOPIO)
                     16: {
                     17:        ClearAlias();
                     18:        AddAlias("NopIO");
                     19: }
                     20: 
                     21: // デストラクタ
                     22: NopIODevice::~NopIODevice()
                     23: {
                     24: }
                     25: 
                     26: busdata
                     27: NopIODevice::Read(busaddr addr)
                     28: {
                     29:        uint32 datasize = addr.GetSize();
                     30: 
                     31:        putlog(1, "$%08x.%u", addr.Addr(), datasize);
                     32:        busdata data = (1ULL << (datasize * 8)) - 1;
                     33:        data |= busdata::Size(datasize);
                     34:        return data;
                     35: }
                     36: 
                     37: busdata
                     38: NopIODevice::Write(busaddr addr, uint32 data)
                     39: {
                     40:        uint32 datasize = addr.GetSize();
                     41: 
                     42:        putlog(1, "$%08x.%u <- $%0*x", addr.Addr(), datasize, datasize * 2, data);
                     43:        busdata r = busdata::Size(datasize);
                     44:        return r;
                     45: }
                     46: 
                     47: busdata
                     48: NopIODevice::Peek1(uint32 addr)
                     49: {
                     50:        return 0xff;
                     51: }
                     52: 
                     53: busdata
                     54: NopIODevice::Read1(uint32 addr)
                     55: {
                     56:        putlog(1, "XP $%05x", addr);
                     57:        busdata data = 0xff;
                     58:        return data;
                     59: }
                     60: 
                     61: busdata
                     62: NopIODevice::Write1(uint32 addr, uint32 data)
                     63: {
                     64:        putlog(1, "XP $%05x <- $%02x", addr, data);
                     65:        return 0;
                     66: }

unix.superglobalmegacorp.com

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