|
|
1.1 root 1: //
2: // nono
3: // Copyright (C) 2020 nono project
4: // Licensed under nono-license.txt
5: //
6:
1.1.1.6 ! root 7: //
1.1 root 8: // TAS ポート
1.1.1.6 ! root 9: //
1.1 root 10:
11: #include "tas.h"
12:
1.1.1.6 ! root 13: // グローバル参照用
! 14: TASDevice *gTAS;
1.1 root 15:
16: // コンストラクタ
17: TASDevice::TASDevice()
1.1.1.5 root 18: : inherited("TAS")
1.1 root 19: {
20: }
21:
22: // デストラクタ
23: TASDevice::~TASDevice()
24: {
1.1.1.6 ! root 25: gTAS = NULL;
1.1 root 26: }
27:
1.1.1.4 root 28: // リセット
29: void
1.1.1.6 ! root 30: TASDevice::ResetHard(bool poweron)
1.1.1.4 root 31: {
32: // 初期値は 0 らしい (LUNA88K PROM 1.20 がそう期待している)。
33: // いつリセットされるかは分からないけど、さすがにリセットされるだろう。
34: tas = 0;
35: }
36:
1.1.1.3 root 37: // XXX: RMW サイクルが発行される前提のレジスタだが
38: // まだ CPU から RMW サイクルを示す信号線が出ていない。
1.1 root 39:
40: uint64
1.1.1.3 root 41: TASDevice::Read(uint32 offset)
1.1 root 42: {
1.1.1.2 root 43: putlog(2, "読み込み 0x%02x", (uint8)tas);
1.1 root 44: return tas;
45: }
46:
47: uint64
1.1.1.3 root 48: TASDevice::Write(uint32 offset, uint32 data)
1.1 root 49: {
1.1.1.3 root 50: // data は bit7 のみ有効。data の bit7 は
51: // LUNA-I では B 接続なので、各バイトの bit7 に相当、
1.1 root 52: // LUNA88K では BFFF 接続なので bit31 に相当。
53: // 最上位ビット以外のビットは「不定」。
54: tas = data;
1.1.1.2 root 55: putlog(1, "書き込み 0x%02x", data);
1.1 root 56: return 0;
57: }
58:
59: uint64
1.1.1.3 root 60: TASDevice::Peek(uint32 offset)
1.1 root 61: {
62: return tas;
63: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.