Annotation of nono/vm/tas.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: // TAS ポート
                      8: 
                      9: #include "tas.h"
                     10: 
                     11: std::unique_ptr<TASDevice> gTAS;
                     12: 
                     13: // コンストラクタ
                     14: TASDevice::TASDevice()
                     15: {
                     16:        logname = "tas";
                     17:        devname = "TAS";
                     18: }
                     19: 
                     20: // デストラクタ
                     21: TASDevice::~TASDevice()
                     22: {
                     23: }
                     24: 
                     25: // XXX: RMW サイクルが発行される前提のレジスタなので、
                     26: // CPU / バス 側に RMW を実装しなければならない。
                     27: 
                     28: uint64
                     29: TASDevice::Read(uint32 addr)
                     30: {
                     31:        putlog(2, "TAS 読み込み 0x%02x", (uint8)tas);
                     32:        return tas;
                     33: }
                     34: 
                     35: uint64
                     36: TASDevice::Write(uint32 addr, uint32 data)
                     37: {
                     38:        // bit7 のみ有効
                     39:        // LUNA-I では B 接続なので、各バイトの bit7 に相当。
                     40:        // LUNA88K では BFFF 接続なので bit31 に相当。
                     41:        // 最上位ビット以外のビットは「不定」。
                     42:        tas = data;
                     43:        putlog(1, "TAS 書き込み 0x%02x", data);
                     44:        return 0;
                     45: }
                     46: 
                     47: #if 0
                     48: // RMW はこんな感じ?
                     49: uint64
                     50: TASDevice::ReadWrite(uint32 addr, uint32 data)
                     51: {
                     52:        uint8 rv;
                     53:        rv = tas.exchange(data);
                     54:        putlog(1, "TAS RMW 0x%02 to 0x%02", rv, data);
                     55:        return rv;
                     56: }
                     57: #endif
                     58: 
                     59: uint64
                     60: TASDevice::Peek(uint32 addr)
                     61: {
                     62:        return tas;
                     63: }

unix.superglobalmegacorp.com

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