--- nono/vm/tas.cpp 2026/04/29 17:04:53 1.1.1.4 +++ nono/vm/tas.cpp 2026/04/29 17:05:25 1.1.1.9 @@ -4,17 +4,16 @@ // Licensed under nono-license.txt // +// // TAS ポート +// #include "tas.h" -std::unique_ptr gTAS; - // コンストラクタ TASDevice::TASDevice() + : inherited(OBJ_TAS) { - logname = "tas"; - devname = "TAS"; } // デストラクタ @@ -24,9 +23,9 @@ TASDevice::~TASDevice() // リセット void -TASDevice::ResetHard() +TASDevice::ResetHard(bool poweron) { - // 初期値は 0 らしい (LUNA88K PROM 1.20 がそう期待している)。 + // 初期値は 0 らしい (LUNA-88K PROM 1.20 がそう期待している)。 // いつリセットされるかは分からないけど、さすがにリセットされるだろう。 tas = 0; } @@ -34,27 +33,27 @@ TASDevice::ResetHard() // XXX: RMW サイクルが発行される前提のレジスタだが // まだ CPU から RMW サイクルを示す信号線が出ていない。 -uint64 +busdata TASDevice::Read(uint32 offset) { - putlog(2, "読み込み 0x%02x", (uint8)tas); - return tas; + putlog(2, "Read 0x%02x", (uint8)tas); + return (uint32)tas.load(); } -uint64 +busdata TASDevice::Write(uint32 offset, uint32 data) { // data は bit7 のみ有効。data の bit7 は // LUNA-I では B 接続なので、各バイトの bit7 に相当、 - // LUNA88K では BFFF 接続なので bit31 に相当。 + // LUNA-88K では BFFF 接続なので bit31 に相当。 // 最上位ビット以外のビットは「不定」。 tas = data; - putlog(1, "書き込み 0x%02x", data); + putlog(1, "Write 0x%02x", data); return 0; } -uint64 +busdata TASDevice::Peek(uint32 offset) { - return tas; + return (uint32)tas.load(); }