mirror of
https://github.com/akuker/RASCSI.git
synced 2025-02-28 07:29:04 +00:00
Merge branch 'master' of https://github.com/akuker/RASCSI
This commit is contained in:
commit
a077a782d4
31
LICENSE
Normal file
31
LICENSE
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
BSD 3-Clause License
|
||||||
|
|
||||||
|
Copyright (C) 2001-2006 PI.(ytanaka@ipc-tokai.or.jp)
|
||||||
|
Copyright (C) 2014-2020 GIMONS
|
||||||
|
Copyright (c) 2020, akuker
|
||||||
|
All rights reserved.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted provided that the following conditions are met:
|
||||||
|
|
||||||
|
1. Redistributions of source code must retain the above copyright notice, this
|
||||||
|
list of conditions and the following disclaimer.
|
||||||
|
|
||||||
|
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||||
|
this list of conditions and the following disclaimer in the documentation
|
||||||
|
and/or other materials provided with the distribution.
|
||||||
|
|
||||||
|
3. Neither the name of the copyright holder nor the names of its
|
||||||
|
contributors may be used to endorse or promote products derived from
|
||||||
|
this software without specific prior written permission.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||||
|
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||||
|
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||||
|
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||||
|
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
@ -9,7 +9,12 @@
|
|||||||
// Imported NetBSD support and some optimisation patch by Rin Okuyama.
|
// Imported NetBSD support and some optimisation patch by Rin Okuyama.
|
||||||
// Imported sava's bugfix patch(in RASDRV DOS edition).
|
// Imported sava's bugfix patch(in RASDRV DOS edition).
|
||||||
//
|
//
|
||||||
// [ ホストファイルシステム ]
|
// [ Host File System for the X68000 ]
|
||||||
|
//
|
||||||
|
// Note: This functionality is specific to the X68000
|
||||||
|
// operating system.
|
||||||
|
// It is highly unlikely that this will work for other
|
||||||
|
// platforms.
|
||||||
//
|
//
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -5,8 +5,10 @@
|
|||||||
//
|
//
|
||||||
// Powered by XM6 TypeG Technology.
|
// Powered by XM6 TypeG Technology.
|
||||||
// Copyright (C) 2016-2020 GIMONS
|
// Copyright (C) 2016-2020 GIMONS
|
||||||
// [ ホストファイルシステム ]
|
// [ Host File System for the X68000 ]
|
||||||
//
|
//
|
||||||
|
// Note: This functionality is specific to the X68000 operating system.
|
||||||
|
// It is highly unlikely that this will work for other platforms.
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
#ifndef cfilesystem_h
|
#ifndef cfilesystem_h
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
//
|
//
|
||||||
// Imported NetBSD support and some optimisation patch by Rin Okuyama.
|
// Imported NetBSD support and some optimisation patch by Rin Okuyama.
|
||||||
//
|
//
|
||||||
// [ TAPドライバ ]
|
// [ TAP Driver ]
|
||||||
//
|
//
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
//
|
//
|
||||||
// Imported NetBSD support and some optimisation patch by Rin Okuyama.
|
// Imported NetBSD support and some optimisation patch by Rin Okuyama.
|
||||||
//
|
//
|
||||||
// [ TAPドライバ ]
|
// [ TAP Driver ]
|
||||||
//
|
//
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -5,7 +5,7 @@
|
|||||||
//
|
//
|
||||||
// Powered by XM6 TypeG Technology.
|
// Powered by XM6 TypeG Technology.
|
||||||
// Copyright (C) 2016-2020 GIMONS
|
// Copyright (C) 2016-2020 GIMONS
|
||||||
// [ GPIO-SCSIバス ]
|
// [ GPIO-SCSI bus ]
|
||||||
//
|
//
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
@ -16,121 +16,121 @@
|
|||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// 接続方法定義の選択
|
// Connection method definitions
|
||||||
//
|
//
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
//#define CONNECT_TYPE_STANDARD // 標準(SCSI論理,標準ピンアサイン)
|
//#define CONNECT_TYPE_STANDARD // Standard (SCSI logic, standard pin assignment)
|
||||||
//#define CONNECT_TYPE_FULLSPEC // フルスペック(SCSI論理,標準ピンアサイン)
|
//#define CONNECT_TYPE_FULLSPEC // Full spec (SCSI logic, standard pin assignment)
|
||||||
//#define CONNECT_TYPE_AIBOM // AIBOM版(正論理,固有ピンアサイン)
|
//#define CONNECT_TYPE_AIBOM // AIBOM version (positive logic, unique pin assignment)
|
||||||
//#define CONNECT_TYPE_GAMERNIUM // GAMERnium.com版(標準論理,固有ピンアサイン)
|
//#define CONNECT_TYPE_GAMERNIUM // GAMERnium.com version (standard logic, unique pin assignment)
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// 信号制御論理及びピンアサインカスタマイズ
|
// Signal control logic and pin assignment customization
|
||||||
//
|
//
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// SIGNAL_CONTROL_MODE:信号制御モード選択
|
// SIGNAL_CONTROL_MODE: Signal control mode selection
|
||||||
// Version1.22から信号制御の論理をカスタマイズできます。
|
// You can customize the signal control logic from Version 1.22
|
||||||
//
|
//
|
||||||
// 0:SCSI論理仕様
|
// 0:SCSI logical specification
|
||||||
// 直結またはHPに公開した74LS641-1等を使用する変換基板
|
// Conversion board using 74LS641-1 etc. directly connected or published on HP
|
||||||
// アーサート:0V
|
// True : 0V
|
||||||
// ネゲート :オープンコレクタ出力(バスから切り離す)
|
// False : Open collector output (disconnect from bus)
|
||||||
//
|
//
|
||||||
// 1:負論理仕様(負論理->SCSI論理への変換基板を使用する場合)
|
// 1:Negative logic specification (when using conversion board for negative logic -> SCSI logic)
|
||||||
// 現時点でこの仕様による変換基板は存在しません
|
// There is no conversion board with this specification at this time
|
||||||
// アーサート:0V -> (CONVERT) -> 0V
|
// True : 0V -> (CONVERT) -> 0V
|
||||||
// ネゲート :3.3V -> (CONVERT) -> オープンコレクタ出力
|
// False : 3.3V -> (CONVERT) -> Open collector output
|
||||||
//
|
//
|
||||||
// 2:正論理仕様(正論理->SCSI論理への変換基板を使用する場合)
|
// 2:Positive logic specification (when using the conversion board for positive logic -> SCSI logic)
|
||||||
// RaSCSI Adapter Rev.C @132sync等
|
// RaSCSI Adapter Rev.C @132sync etc.
|
||||||
//
|
//
|
||||||
// アーサート:3.3V -> (CONVERT) -> 0V
|
// True : 3.3V -> (CONVERT) -> 0V
|
||||||
// ネゲート :0V -> (CONVERT) -> オープンコレクタ出力
|
// False : 0V -> (CONVERT) -> Open collector output
|
||||||
//
|
//
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// 制御信号ピンアサイン設定
|
// Control signal pin assignment setting
|
||||||
// 制御信号に対するGPIOピンのマッピングテーブルです。
|
// GPIO pin mapping table for control signals.
|
||||||
//
|
//
|
||||||
// 制御信号
|
// Control signal:
|
||||||
// PIN_ACT
|
// PIN_ACT
|
||||||
// SCSIコマンドを処理中の状態を示す信号のピン番号。
|
// Signal that indicates the status of processing SCSI command.
|
||||||
// PIN_ENB
|
// PIN_ENB
|
||||||
// 起動から終了の間の有効信号を示す信号のピン番号。
|
// Signal that indicates the valid signal from start to finish.
|
||||||
// PIN_TAD
|
// PIN_TAD
|
||||||
// ターゲット信号(BSY,IO,CD,MSG,REG)の入出力方向を示す信号のピン番号。
|
// Signal that indicates the input/output direction of the target signal (BSY,IO,CD,MSG,REG).
|
||||||
// PIN_IND
|
// PIN_IND
|
||||||
// イニシーエータ信号(SEL,ATN,RST,ACK)の入出力方向を示す信号のピン番号。
|
// Signal that indicates the input/output direction of the initiator signal (SEL, ATN, RST, ACK).
|
||||||
// PIN_DTD
|
// PIN_DTD
|
||||||
// データ信号(DT0...DT7,DP)の入出力方向を示す信号のピン番号。
|
// Signal that indicates the input/output direction of the data lines (DT0...DT7,DP).
|
||||||
//
|
//
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// 制御信号出力論理
|
// Control signal output logic
|
||||||
// 0V:FALSE 3.3V:TRUEで指定します。
|
// 0V:FALSE 3.3V:TRUE
|
||||||
//
|
//
|
||||||
// ACT_ON
|
// ACT_ON
|
||||||
// PIN_ACT信号の論理です。
|
// PIN_ACT signal
|
||||||
// ENB_ON
|
// ENB_ON
|
||||||
// PIN_ENB信号の論理です。
|
// PIN_ENB signal
|
||||||
// TAD_IN
|
// TAD_IN
|
||||||
// PIN_TAD入力方向時の論理です。
|
// PIN_TAD This is the logic when inputting.
|
||||||
// IND_IN
|
// IND_IN
|
||||||
// PIN_ENB入力方向時の論理です。
|
// PIN_ENB This is the logic when inputting.
|
||||||
// DTD_IN
|
// DTD_IN
|
||||||
// PIN_ENB入力方向時の論理です。
|
// PIN_ENB This is the logic when inputting.
|
||||||
//
|
//
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// SCSI信号ピンアサイン設定
|
// SCSI signal pin assignment setting
|
||||||
// SCSIの信号に対するGPIOピンのマッピングテーブルです。
|
// GPIO pin mapping table for SCSI signals.
|
||||||
// PIN_DT0~PIN_SEL
|
// PIN_DT0~PIN_SEL
|
||||||
//
|
//
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
#ifdef CONNECT_TYPE_STANDARD
|
#ifdef CONNECT_TYPE_STANDARD
|
||||||
//
|
//
|
||||||
// RaSCSI 標準(SCSI論理,標準ピンアサイン)
|
// RaSCSI standard (SCSI logic, standard pin assignment)
|
||||||
//
|
//
|
||||||
#define CONNECT_DESC "STANDARD" // 起動時メッセージ
|
#define CONNECT_DESC "STANDARD" // Startup message
|
||||||
|
|
||||||
// 信号制御モード選択
|
// Select signal control mode
|
||||||
#define SIGNAL_CONTROL_MODE 0 // SCSI論理仕様
|
#define SIGNAL_CONTROL_MODE 0 // SCSI logical specification
|
||||||
|
|
||||||
// 制御信号ピンアサイン(-1の場合は制御無し)
|
// Control signal pin assignment (-1 means no control)
|
||||||
#define PIN_ACT 4 // ACTIVE
|
#define PIN_ACT 4 // ACTIVE
|
||||||
#define PIN_ENB 5 // ENABLE
|
#define PIN_ENB 5 // ENABLE
|
||||||
#define PIN_IND -1 // INITIATOR CTRL DIRECTION
|
#define PIN_IND -1 // INITIATOR CTRL DIRECTION
|
||||||
#define PIN_TAD -1 // TARGET CTRL DIRECTION
|
#define PIN_TAD -1 // TARGET CTRL DIRECTION
|
||||||
#define PIN_DTD -1 // DATA DIRECTION
|
#define PIN_DTD -1 // DATA DIRECTION
|
||||||
|
|
||||||
// 制御信号出力論理
|
// Control signal output logic
|
||||||
#define ACT_ON TRUE // ACTIVE SIGNAL ON
|
#define ACT_ON TRUE // ACTIVE SIGNAL ON
|
||||||
#define ENB_ON TRUE // ENABLE SIGNAL ON
|
#define ENB_ON TRUE // ENABLE SIGNAL ON
|
||||||
#define IND_IN FALSE // INITIATOR SIGNAL INPUT
|
#define IND_IN FALSE // INITIATOR SIGNAL INPUT
|
||||||
#define TAD_IN FALSE // TARGET SIGNAL INPUT
|
#define TAD_IN FALSE // TARGET SIGNAL INPUT
|
||||||
#define DTD_IN TRUE // DATA SIGNAL INPUT
|
#define DTD_IN TRUE // DATA SIGNAL INPUT
|
||||||
|
|
||||||
// SCSI信号ピンアサイン
|
// SCSI signal pin assignment
|
||||||
#define PIN_DT0 10 // データ0
|
#define PIN_DT0 10 // Data 0
|
||||||
#define PIN_DT1 11 // データ1
|
#define PIN_DT1 11 // Data 1
|
||||||
#define PIN_DT2 12 // データ2
|
#define PIN_DT2 12 // Data 2
|
||||||
#define PIN_DT3 13 // データ3
|
#define PIN_DT3 13 // Data 3
|
||||||
#define PIN_DT4 14 // データ4
|
#define PIN_DT4 14 // Data 4
|
||||||
#define PIN_DT5 15 // データ5
|
#define PIN_DT5 15 // Data 5
|
||||||
#define PIN_DT6 16 // データ6
|
#define PIN_DT6 16 // Data 6
|
||||||
#define PIN_DT7 17 // データ7
|
#define PIN_DT7 17 // Data 7
|
||||||
#define PIN_DP 18 // パリティ
|
#define PIN_DP 18 // Data parity
|
||||||
#define PIN_ATN 19 // ATN
|
#define PIN_ATN 19 // ATN
|
||||||
#define PIN_RST 20 // RST
|
#define PIN_RST 20 // RST
|
||||||
#define PIN_ACK 21 // ACK
|
#define PIN_ACK 21 // ACK
|
||||||
@ -144,37 +144,37 @@
|
|||||||
|
|
||||||
#ifdef CONNECT_TYPE_FULLSPEC
|
#ifdef CONNECT_TYPE_FULLSPEC
|
||||||
//
|
//
|
||||||
// RaSCSI 標準(SCSI論理,標準ピンアサイン)
|
// RaSCSI standard (SCSI logic, standard pin assignment)
|
||||||
//
|
//
|
||||||
#define CONNECT_DESC "FULLSPEC" // 起動時メッセージ
|
#define CONNECT_DESC "FULLSPEC" // Startup message
|
||||||
|
|
||||||
// 信号制御モード選択
|
// Select signal control mode
|
||||||
#define SIGNAL_CONTROL_MODE 0 // SCSI論理仕様
|
#define SIGNAL_CONTROL_MODE 0 // SCSI logical specification
|
||||||
|
|
||||||
// 制御信号ピンアサイン(-1の場合は制御無し)
|
// Control signal pin assignment (-1 means no control)
|
||||||
#define PIN_ACT 4 // ACTIVE
|
#define PIN_ACT 4 // ACTIVE
|
||||||
#define PIN_ENB 5 // ENABLE
|
#define PIN_ENB 5 // ENABLE
|
||||||
#define PIN_IND 6 // INITIATOR CTRL DIRECTION
|
#define PIN_IND 6 // INITIATOR CTRL DIRECTION
|
||||||
#define PIN_TAD 7 // TARGET CTRL DIRECTION
|
#define PIN_TAD 7 // TARGET CTRL DIRECTION
|
||||||
#define PIN_DTD 8 // DATA DIRECTION
|
#define PIN_DTD 8 // DATA DIRECTION
|
||||||
|
|
||||||
// 制御信号出力論理
|
// Control signal output logic
|
||||||
#define ACT_ON TRUE // ACTIVE SIGNAL ON
|
#define ACT_ON TRUE // ACTIVE SIGNAL ON
|
||||||
#define ENB_ON TRUE // ENABLE SIGNAL ON
|
#define ENB_ON TRUE // ENABLE SIGNAL ON
|
||||||
#define IND_IN FALSE // INITIATOR SIGNAL INPUT
|
#define IND_IN FALSE // INITIATOR SIGNAL INPUT
|
||||||
#define TAD_IN FALSE // TARGET SIGNAL INPUT
|
#define TAD_IN FALSE // TARGET SIGNAL INPUT
|
||||||
#define DTD_IN TRUE // DATA SIGNAL INPUT
|
#define DTD_IN TRUE // DATA SIGNAL INPUT
|
||||||
|
|
||||||
// SCSI信号ピンアサイン
|
// SCSI signal pin assignment
|
||||||
#define PIN_DT0 10 // データ0
|
#define PIN_DT0 10 // Data 0
|
||||||
#define PIN_DT1 11 // データ1
|
#define PIN_DT1 11 // Data 1
|
||||||
#define PIN_DT2 12 // データ2
|
#define PIN_DT2 12 // Data 2
|
||||||
#define PIN_DT3 13 // データ3
|
#define PIN_DT3 13 // Data 3
|
||||||
#define PIN_DT4 14 // データ4
|
#define PIN_DT4 14 // Data 4
|
||||||
#define PIN_DT5 15 // データ5
|
#define PIN_DT5 15 // Data 5
|
||||||
#define PIN_DT6 16 // データ6
|
#define PIN_DT6 16 // Data 6
|
||||||
#define PIN_DT7 17 // データ7
|
#define PIN_DT7 17 // Data 7
|
||||||
#define PIN_DP 18 // パリティ
|
#define PIN_DP 18 // Data parity
|
||||||
#define PIN_ATN 19 // ATN
|
#define PIN_ATN 19 // ATN
|
||||||
#define PIN_RST 20 // RST
|
#define PIN_RST 20 // RST
|
||||||
#define PIN_ACK 21 // ACK
|
#define PIN_ACK 21 // ACK
|
||||||
@ -188,38 +188,38 @@
|
|||||||
|
|
||||||
#ifdef CONNECT_TYPE_AIBOM
|
#ifdef CONNECT_TYPE_AIBOM
|
||||||
//
|
//
|
||||||
// RaSCSI Adapter あいぼむ版
|
// RaSCSI Adapter Aibomu version
|
||||||
//
|
//
|
||||||
|
|
||||||
#define CONNECT_DESC "AIBOM PRODUCTS version" // 起動時メッセージ
|
#define CONNECT_DESC "AIBOM PRODUCTS version" // Startup message
|
||||||
|
|
||||||
// 信号制御モード選択
|
// Select signal control mode
|
||||||
#define SIGNAL_CONTROL_MODE 2 // SCSI正論理仕様
|
#define SIGNAL_CONTROL_MODE 2 // SCSI positive logic specification
|
||||||
|
|
||||||
// 制御信号出力論理
|
// Control signal output logic
|
||||||
#define ACT_ON TRUE // ACTIVE SIGNAL ON
|
#define ACT_ON TRUE // ACTIVE SIGNAL ON
|
||||||
#define ENB_ON TRUE // ENABLE SIGNAL ON
|
#define ENB_ON TRUE // ENABLE SIGNAL ON
|
||||||
#define IND_IN FALSE // INITIATOR SIGNAL INPUT
|
#define IND_IN FALSE // INITIATOR SIGNAL INPUT
|
||||||
#define TAD_IN FALSE // TARGET SIGNAL INPUT
|
#define TAD_IN FALSE // TARGET SIGNAL INPUT
|
||||||
#define DTD_IN FALSE // DATA SIGNAL INPUT
|
#define DTD_IN FALSE // DATA SIGNAL INPUT
|
||||||
|
|
||||||
// 制御信号ピンアサイン(-1の場合は制御無し)
|
// Control signal pin assignment (-1 means no control)
|
||||||
#define PIN_ACT 4 // ACTIVE
|
#define PIN_ACT 4 // ACTIVE
|
||||||
#define PIN_ENB 17 // ENABLE
|
#define PIN_ENB 17 // ENABLE
|
||||||
#define PIN_IND 27 // INITIATOR CTRL DIRECTION
|
#define PIN_IND 27 // INITIATOR CTRL DIRECTION
|
||||||
#define PIN_TAD -1 // TARGET CTRL DIRECTION
|
#define PIN_TAD -1 // TARGET CTRL DIRECTION
|
||||||
#define PIN_DTD 18 // DATA DIRECTION
|
#define PIN_DTD 18 // DATA DIRECTION
|
||||||
|
|
||||||
// SCSI信号ピンアサイン
|
// SCSI signal pin assignment
|
||||||
#define PIN_DT0 6 // データ0
|
#define PIN_DT0 6 // Data 0
|
||||||
#define PIN_DT1 12 // データ1
|
#define PIN_DT1 12 // Data 1
|
||||||
#define PIN_DT2 13 // データ2
|
#define PIN_DT2 13 // Data 2
|
||||||
#define PIN_DT3 16 // データ3
|
#define PIN_DT3 16 // Data 3
|
||||||
#define PIN_DT4 19 // データ4
|
#define PIN_DT4 19 // Data 4
|
||||||
#define PIN_DT5 20 // データ5
|
#define PIN_DT5 20 // Data 5
|
||||||
#define PIN_DT6 26 // データ6
|
#define PIN_DT6 26 // Data 6
|
||||||
#define PIN_DT7 21 // データ7
|
#define PIN_DT7 21 // Data 7
|
||||||
#define PIN_DP 5 // パリティ
|
#define PIN_DP 5 // Data parity
|
||||||
#define PIN_ATN 22 // ATN
|
#define PIN_ATN 22 // ATN
|
||||||
#define PIN_RST 25 // RST
|
#define PIN_RST 25 // RST
|
||||||
#define PIN_ACK 10 // ACK
|
#define PIN_ACK 10 // ACK
|
||||||
@ -236,35 +236,35 @@
|
|||||||
// RaSCSI Adapter GAMERnium.com版
|
// RaSCSI Adapter GAMERnium.com版
|
||||||
//
|
//
|
||||||
|
|
||||||
#define CONNECT_DESC "GAMERnium.com version"// 起動時メッセージ
|
#define CONNECT_DESC "GAMERnium.com version"// Startup message
|
||||||
|
|
||||||
// 信号制御モード選択
|
// Select signal control mode
|
||||||
#define SIGNAL_CONTROL_MODE 0 // SCSI論理仕様
|
#define SIGNAL_CONTROL_MODE 0 // SCSI logical specification
|
||||||
|
|
||||||
// 制御信号出力論理
|
// Control signal output logic
|
||||||
#define ACT_ON TRUE // ACTIVE SIGNAL ON
|
#define ACT_ON TRUE // ACTIVE SIGNAL ON
|
||||||
#define ENB_ON TRUE // ENABLE SIGNAL ON
|
#define ENB_ON TRUE // ENABLE SIGNAL ON
|
||||||
#define IND_IN FALSE // INITIATOR SIGNAL INPUT
|
#define IND_IN FALSE // INITIATOR SIGNAL INPUT
|
||||||
#define TAD_IN FALSE // TARGET SIGNAL INPUT
|
#define TAD_IN FALSE // TARGET SIGNAL INPUT
|
||||||
#define DTD_IN TRUE // DATA SIGNAL INPUT
|
#define DTD_IN TRUE // DATA SIGNAL INPUT
|
||||||
|
|
||||||
// 制御信号ピンアサイン(-1の場合は制御無し)
|
// Control signal pin assignment (-1 means no control)
|
||||||
#define PIN_ACT 14 // ACTIVE
|
#define PIN_ACT 14 // ACTIVE
|
||||||
#define PIN_ENB 6 // ENABLE
|
#define PIN_ENB 6 // ENABLE
|
||||||
#define PIN_IND 7 // INITIATOR CTRL DIRECTION
|
#define PIN_IND 7 // INITIATOR CTRL DIRECTION
|
||||||
#define PIN_TAD 8 // TARGET CTRL DIRECTION
|
#define PIN_TAD 8 // TARGET CTRL DIRECTION
|
||||||
#define PIN_DTD 5 // DATA DIRECTION
|
#define PIN_DTD 5 // DATA DIRECTION
|
||||||
|
|
||||||
// SCSI信号ピンアサイン
|
// SCSI signal pin assignment
|
||||||
#define PIN_DT0 21 // データ0
|
#define PIN_DT0 21 // Data 0
|
||||||
#define PIN_DT1 26 // データ1
|
#define PIN_DT1 26 // Data 1
|
||||||
#define PIN_DT2 20 // データ2
|
#define PIN_DT2 20 // Data 2
|
||||||
#define PIN_DT3 19 // データ3
|
#define PIN_DT3 19 // Data 3
|
||||||
#define PIN_DT4 16 // データ4
|
#define PIN_DT4 16 // Data 4
|
||||||
#define PIN_DT5 13 // データ5
|
#define PIN_DT5 13 // Data 5
|
||||||
#define PIN_DT6 12 // データ6
|
#define PIN_DT6 12 // Data 6
|
||||||
#define PIN_DT7 11 // データ7
|
#define PIN_DT7 11 // Data 7
|
||||||
#define PIN_DP 25 // パリティ
|
#define PIN_DP 25 // Data parity
|
||||||
#define PIN_ATN 10 // ATN
|
#define PIN_ATN 10 // ATN
|
||||||
#define PIN_RST 22 // RST
|
#define PIN_RST 22 // RST
|
||||||
#define PIN_ACK 24 // ACK
|
#define PIN_ACK 24 // ACK
|
||||||
@ -278,7 +278,7 @@
|
|||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// 定数宣言(GPIO)
|
// Constant declarations(GPIO)
|
||||||
//
|
//
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
#define SYST_OFFSET 0x00003000
|
#define SYST_OFFSET 0x00003000
|
||||||
@ -355,7 +355,7 @@
|
|||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// 定数宣言(GIC)
|
// Constant declarations(GIC)
|
||||||
//
|
//
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
#define ARM_GICD_BASE 0xFF841000
|
#define ARM_GICD_BASE 0xFF841000
|
||||||
@ -380,7 +380,7 @@
|
|||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// 定数宣言(GIC IRQ)
|
// Constant declarations(GIC IRQ)
|
||||||
//
|
//
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
#define GIC_IRQLOCAL0 (16 + 14)
|
#define GIC_IRQLOCAL0 (16 + 14)
|
||||||
@ -388,7 +388,7 @@
|
|||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// 定数宣言(制御信号)
|
// Constant declarations (Control signals)
|
||||||
//
|
//
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
#define ACT_OFF !ACT_ON
|
#define ACT_OFF !ACT_ON
|
||||||
@ -399,7 +399,7 @@
|
|||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// 定数宣言(SCSI)
|
// Constant declarations(SCSI)
|
||||||
//
|
//
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
#define IN GPIO_INPUT
|
#define IN GPIO_INPUT
|
||||||
@ -409,214 +409,214 @@
|
|||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// 定数宣言(バス制御タイミング)
|
// Constant declarations (bus control timing)
|
||||||
//
|
//
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
#define GPIO_DATA_SETTLING 100 // データバスが安定する時間(ns)
|
#define GPIO_DATA_SETTLING 100 // Data bus stabilization time (ns)
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// クラス定義
|
// Class definition
|
||||||
//
|
//
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
class GPIOBUS : public BUS
|
class GPIOBUS : public BUS
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// 基本ファンクション
|
// Basic Functions
|
||||||
GPIOBUS();
|
GPIOBUS();
|
||||||
// コンストラクタ
|
// Constructor
|
||||||
virtual ~GPIOBUS();
|
virtual ~GPIOBUS();
|
||||||
// デストラクタ
|
// Destructor
|
||||||
BOOL FASTCALL Init(mode_e mode = TARGET);
|
BOOL FASTCALL Init(mode_e mode = TARGET);
|
||||||
// 初期化
|
// Initialization
|
||||||
void FASTCALL Reset();
|
void FASTCALL Reset();
|
||||||
// リセット
|
// Reset
|
||||||
void FASTCALL Cleanup();
|
void FASTCALL Cleanup();
|
||||||
// クリーンアップ
|
// Cleanup
|
||||||
|
|
||||||
DWORD FASTCALL Aquire();
|
DWORD FASTCALL Aquire();
|
||||||
// 信号取り込み
|
// Signal acquisition
|
||||||
|
|
||||||
void FASTCALL SetENB(BOOL ast);
|
void FASTCALL SetENB(BOOL ast);
|
||||||
// ENBシグナル設定
|
// Set ENB signal
|
||||||
|
|
||||||
BOOL FASTCALL GetBSY();
|
BOOL FASTCALL GetBSY();
|
||||||
// BSYシグナル取得
|
// Get BSY signal
|
||||||
void FASTCALL SetBSY(BOOL ast);
|
void FASTCALL SetBSY(BOOL ast);
|
||||||
// BSYシグナル設定
|
// Set BSY signal
|
||||||
|
|
||||||
BOOL FASTCALL GetSEL();
|
BOOL FASTCALL GetSEL();
|
||||||
// SELシグナル取得
|
// Get SEL signal
|
||||||
void FASTCALL SetSEL(BOOL ast);
|
void FASTCALL SetSEL(BOOL ast);
|
||||||
// SELシグナル設定
|
// Set SEL signal
|
||||||
|
|
||||||
BOOL FASTCALL GetATN();
|
BOOL FASTCALL GetATN();
|
||||||
// ATNシグナル取得
|
// Get ATN signal
|
||||||
void FASTCALL SetATN(BOOL ast);
|
void FASTCALL SetATN(BOOL ast);
|
||||||
// ATNシグナル設定
|
// Set ATN signal
|
||||||
|
|
||||||
BOOL FASTCALL GetACK();
|
BOOL FASTCALL GetACK();
|
||||||
// ACKシグナル取得
|
// Get ACK signal
|
||||||
void FASTCALL SetACK(BOOL ast);
|
void FASTCALL SetACK(BOOL ast);
|
||||||
// ACKシグナル設定
|
// Set ACK signal
|
||||||
|
|
||||||
BOOL FASTCALL GetRST();
|
BOOL FASTCALL GetRST();
|
||||||
// RSTシグナル取得
|
// Get RST signal
|
||||||
void FASTCALL SetRST(BOOL ast);
|
void FASTCALL SetRST(BOOL ast);
|
||||||
// RSTシグナル設定
|
// Set RST signal
|
||||||
|
|
||||||
BOOL FASTCALL GetMSG();
|
BOOL FASTCALL GetMSG();
|
||||||
// MSGシグナル取得
|
// Get MSG signal
|
||||||
void FASTCALL SetMSG(BOOL ast);
|
void FASTCALL SetMSG(BOOL ast);
|
||||||
// MSGシグナル設定
|
// Set MSG signal
|
||||||
|
|
||||||
BOOL FASTCALL GetCD();
|
BOOL FASTCALL GetCD();
|
||||||
// CDシグナル取得
|
// Get CD signal
|
||||||
void FASTCALL SetCD(BOOL ast);
|
void FASTCALL SetCD(BOOL ast);
|
||||||
// CDシグナル設定
|
// Set CD signal
|
||||||
|
|
||||||
BOOL FASTCALL GetIO();
|
BOOL FASTCALL GetIO();
|
||||||
// IOシグナル取得
|
// Get IO signal
|
||||||
void FASTCALL SetIO(BOOL ast);
|
void FASTCALL SetIO(BOOL ast);
|
||||||
// IOシグナル設定
|
// Set IO signal
|
||||||
|
|
||||||
BOOL FASTCALL GetREQ();
|
BOOL FASTCALL GetREQ();
|
||||||
// REQシグナル取得
|
// Get REQ signal
|
||||||
void FASTCALL SetREQ(BOOL ast);
|
void FASTCALL SetREQ(BOOL ast);
|
||||||
// REQシグナル設定
|
// Set REQ signal
|
||||||
|
|
||||||
BYTE FASTCALL GetDAT();
|
BYTE FASTCALL GetDAT();
|
||||||
// データシグナル取得
|
// Get DAT signal
|
||||||
void FASTCALL SetDAT(BYTE dat);
|
void FASTCALL SetDAT(BYTE dat);
|
||||||
// データシグナル設定
|
// Set DAT signal
|
||||||
BOOL FASTCALL GetDP();
|
BOOL FASTCALL GetDP();
|
||||||
// パリティシグナル取得
|
// Get Data parity signal
|
||||||
int FASTCALL CommandHandShake(BYTE *buf);
|
int FASTCALL CommandHandShake(BYTE *buf);
|
||||||
// コマンド受信ハンドシェイク
|
// Command receive handshake
|
||||||
int FASTCALL ReceiveHandShake(BYTE *buf, int count);
|
int FASTCALL ReceiveHandShake(BYTE *buf, int count);
|
||||||
// データ受信ハンドシェイク
|
// Data receive handshake
|
||||||
int FASTCALL SendHandShake(BYTE *buf, int count);
|
int FASTCALL SendHandShake(BYTE *buf, int count);
|
||||||
// データ送信ハンドシェイク
|
// Data transmission handshake
|
||||||
|
|
||||||
#ifdef USE_SEL_EVENT_ENABLE
|
#ifdef USE_SEL_EVENT_ENABLE
|
||||||
// SEL信号割り込み関係
|
// SEL signal interrupt
|
||||||
int FASTCALL PollSelectEvent();
|
int FASTCALL PollSelectEvent();
|
||||||
// SEL信号イベントポーリング
|
// SEL signal event polling
|
||||||
void FASTCALL ClearSelectEvent();
|
void FASTCALL ClearSelectEvent();
|
||||||
// SEL信号イベントクリア
|
// Clear SEL signal event
|
||||||
#endif // USE_SEL_EVENT_ENABLE
|
#endif // USE_SEL_EVENT_ENABLE
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// SCSI入出力信号制御
|
// SCSI I/O signal control
|
||||||
void FASTCALL MakeTable();
|
void FASTCALL MakeTable();
|
||||||
// ワークテーブル作成
|
// Create work data
|
||||||
void FASTCALL SetControl(int pin, BOOL ast);
|
void FASTCALL SetControl(int pin, BOOL ast);
|
||||||
// 制御信号設定
|
// Set Control Signal
|
||||||
void FASTCALL SetMode(int pin, int mode);
|
void FASTCALL SetMode(int pin, int mode);
|
||||||
// SCSI入出力モード設定
|
// Set SCSI I/O mode
|
||||||
BOOL FASTCALL GetSignal(int pin);
|
BOOL FASTCALL GetSignal(int pin);
|
||||||
// SCSI入力信号値取得
|
// Get SCSI input signal value
|
||||||
void FASTCALL SetSignal(int pin, BOOL ast);
|
void FASTCALL SetSignal(int pin, BOOL ast);
|
||||||
// SCSI出力信号値設定
|
// Set SCSI output signal value
|
||||||
BOOL FASTCALL WaitSignal(int pin, BOOL ast);
|
BOOL FASTCALL WaitSignal(int pin, BOOL ast);
|
||||||
// 信号変化待ち
|
// Wait for a signal to change
|
||||||
// 割り込み制御
|
// Interrupt control
|
||||||
void FASTCALL DisableIRQ();
|
void FASTCALL DisableIRQ();
|
||||||
// IRQ禁止
|
// IRQ Disabled
|
||||||
void FASTCALL EnableIRQ();
|
void FASTCALL EnableIRQ();
|
||||||
// IRQ有効
|
// IRQ Enabled
|
||||||
|
|
||||||
// GPIOピン機能設定
|
// GPIO pin functionality settings
|
||||||
void FASTCALL PinConfig(int pin, int mode);
|
void FASTCALL PinConfig(int pin, int mode);
|
||||||
// GPIOピン機能設定(入出力設定)
|
// GPIO pin direction setting
|
||||||
void FASTCALL PullConfig(int pin, int mode);
|
void FASTCALL PullConfig(int pin, int mode);
|
||||||
// GPIOピン機能設定(プルアップ/ダウン)
|
// GPIO pin pull up/down resistor setting
|
||||||
void FASTCALL PinSetSignal(int pin, BOOL ast);
|
void FASTCALL PinSetSignal(int pin, BOOL ast);
|
||||||
// GPIOピン出力信号設定
|
// Set GPIO output signal
|
||||||
void FASTCALL DrvConfig(DWORD drive);
|
void FASTCALL DrvConfig(DWORD drive);
|
||||||
// GPIOドライブ能力設定
|
// Set GPIO drive strength
|
||||||
|
|
||||||
|
|
||||||
mode_e actmode; // 動作モード
|
mode_e actmode; // Operation mode
|
||||||
|
|
||||||
DWORD baseaddr; // ベースアドレス
|
DWORD baseaddr; // Base address
|
||||||
|
|
||||||
int rpitype;
|
int rpitype;
|
||||||
// ラズパイ種別
|
// Type of Raspberry Pi
|
||||||
|
|
||||||
volatile DWORD *gpio; // GPIOレジスタ
|
volatile DWORD *gpio; // GPIO register
|
||||||
|
|
||||||
volatile DWORD *pads; // PADSレジスタ
|
volatile DWORD *pads; // PADS register
|
||||||
|
|
||||||
volatile DWORD *level; // GPIO入力レベル
|
volatile DWORD *level; // GPIO input level
|
||||||
|
|
||||||
volatile DWORD *irpctl; // 割り込み制御レジスタ
|
volatile DWORD *irpctl; // Interrupt control register
|
||||||
|
|
||||||
#ifndef BAREMETAL
|
#ifndef BAREMETAL
|
||||||
volatile DWORD irptenb; // 割り込み有効状態
|
volatile DWORD irptenb; // Interrupt enabled state
|
||||||
|
|
||||||
volatile DWORD *qa7regs; // QA7レジスタ
|
volatile DWORD *qa7regs; // QA7 register
|
||||||
|
|
||||||
volatile int tintcore; // 割り込み制御対象CPU
|
volatile int tintcore; // Interupt control target CPU.
|
||||||
|
|
||||||
volatile DWORD tintctl; // 割り込みコントロール
|
volatile DWORD tintctl; // Interupt control
|
||||||
|
|
||||||
volatile DWORD giccpmr; // GICC 優先度設定
|
volatile DWORD giccpmr; // GICC priority setting
|
||||||
#endif // BAREMETAL
|
#endif // BAREMETAL
|
||||||
|
|
||||||
volatile DWORD *gicd; // GIC 割り込み分配器レジスタ
|
volatile DWORD *gicd; // GIC Interrupt distributor register
|
||||||
|
|
||||||
volatile DWORD *gicc; // GIC CPUインターフェースレジスタ
|
volatile DWORD *gicc; // GIC CPU interface register
|
||||||
|
|
||||||
DWORD gpfsel[4]; // GPFSEL0-4バックアップ
|
DWORD gpfsel[4]; // GPFSEL0-4 backup values
|
||||||
|
|
||||||
DWORD signals; // バス全信号
|
DWORD signals; // All bus signals
|
||||||
|
|
||||||
#if defined(USE_SEL_EVENT_ENABLE) && !defined(BAREMETAL)
|
#if defined(USE_SEL_EVENT_ENABLE) && !defined(BAREMETAL)
|
||||||
struct gpioevent_request selevreq; // SEL信号イベント要求
|
struct gpioevent_request selevreq; // SEL signal event request
|
||||||
|
|
||||||
int epfd; // epollファイルディスクプリタ
|
int epfd; // epoll file descriptor
|
||||||
#endif // USE_SEL_EVENT_ENABLE && !BAREMETAL
|
#endif // USE_SEL_EVENT_ENABLE && !BAREMETAL
|
||||||
|
|
||||||
#if SIGNAL_CONTROL_MODE == 0
|
#if SIGNAL_CONTROL_MODE == 0
|
||||||
DWORD tblDatMsk[3][256]; // データマスク用テーブル
|
DWORD tblDatMsk[3][256]; // Data mask table
|
||||||
|
|
||||||
DWORD tblDatSet[3][256]; // データ設定用テーブル
|
DWORD tblDatSet[3][256]; // Data setting table
|
||||||
#else
|
#else
|
||||||
DWORD tblDatMsk[256]; // データマスク用テーブル
|
DWORD tblDatMsk[256]; // Data mask table
|
||||||
|
|
||||||
DWORD tblDatSet[256]; // データ設定用テーブル
|
DWORD tblDatSet[256]; // Table setting table
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static const int SignalTable[19]; // シグナルテーブル
|
static const int SignalTable[19]; // signal table
|
||||||
};
|
};
|
||||||
|
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
//
|
//
|
||||||
// システムタイマ
|
// System timer
|
||||||
//
|
//
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
class SysTimer
|
class SysTimer
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static void FASTCALL Init(DWORD *syst, DWORD *armt);
|
static void FASTCALL Init(DWORD *syst, DWORD *armt);
|
||||||
// 初期化
|
// Initialization
|
||||||
static DWORD FASTCALL GetTimerLow();
|
static DWORD FASTCALL GetTimerLow();
|
||||||
// システムタイマ(LO)取得
|
// Get system timer low byte
|
||||||
static DWORD FASTCALL GetTimerHigh();
|
static DWORD FASTCALL GetTimerHigh();
|
||||||
// システムタイマ(HI)取得
|
// Get system timer high byte
|
||||||
static void FASTCALL SleepNsec(DWORD nsec);
|
static void FASTCALL SleepNsec(DWORD nsec);
|
||||||
// ナノ秒単位のスリープ
|
// Sleep for N nanoseconds
|
||||||
static void FASTCALL SleepUsec(DWORD usec);
|
static void FASTCALL SleepUsec(DWORD usec);
|
||||||
// μ秒単位のスリープ
|
// Sleep for N microseconds
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static volatile DWORD *systaddr;
|
static volatile DWORD *systaddr;
|
||||||
// システムタイマアドレス
|
// System timer address
|
||||||
static volatile DWORD *armtaddr;
|
static volatile DWORD *armtaddr;
|
||||||
// ARMタイマアドレス
|
// ARM timer address
|
||||||
static volatile DWORD corefreq;
|
static volatile DWORD corefreq;
|
||||||
// コア周波数
|
// Core frequency
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // gpiobus_h
|
#endif // gpiobus_h
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -5,7 +5,7 @@
|
|||||||
//
|
//
|
||||||
// Powered by XM6 TypeG Technology.
|
// Powered by XM6 TypeG Technology.
|
||||||
// Copyright (C) 2016-2020 GIMONS
|
// Copyright (C) 2016-2020 GIMONS
|
||||||
// [ 制御コマンド送信 ]
|
// [ Send Control Command ]
|
||||||
//
|
//
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// コマンド送信
|
// Send Command
|
||||||
//
|
//
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
BOOL SendCommand(char *buf)
|
BOOL SendCommand(char *buf)
|
||||||
@ -22,26 +22,26 @@ BOOL SendCommand(char *buf)
|
|||||||
struct sockaddr_in server;
|
struct sockaddr_in server;
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
|
|
||||||
// コマンド用ソケット生成
|
// Create a socket to send the command
|
||||||
fd = socket(PF_INET, SOCK_STREAM, 0);
|
fd = socket(PF_INET, SOCK_STREAM, 0);
|
||||||
memset(&server, 0, sizeof(server));
|
memset(&server, 0, sizeof(server));
|
||||||
server.sin_family = PF_INET;
|
server.sin_family = PF_INET;
|
||||||
server.sin_port = htons(6868);
|
server.sin_port = htons(6868);
|
||||||
server.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
|
server.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
|
||||||
|
|
||||||
// 接続
|
// Connect
|
||||||
if (connect(fd, (struct sockaddr *)&server,
|
if (connect(fd, (struct sockaddr *)&server,
|
||||||
sizeof(struct sockaddr_in)) < 0) {
|
sizeof(struct sockaddr_in)) < 0) {
|
||||||
fprintf(stderr, "Error : Can't connect to rascsi process\n");
|
fprintf(stderr, "Error : Can't connect to rascsi process\n");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 送信
|
// Send the command
|
||||||
fp = fdopen(fd, "r+");
|
fp = fdopen(fd, "r+");
|
||||||
setvbuf(fp, NULL, _IONBF, 0);
|
setvbuf(fp, NULL, _IONBF, 0);
|
||||||
fprintf(fp, buf);
|
fprintf(fp, buf);
|
||||||
|
|
||||||
// メッセージ受信
|
// Receive the message
|
||||||
while (1) {
|
while (1) {
|
||||||
if (fgets((char *)buf, BUFSIZ, fp) == NULL) {
|
if (fgets((char *)buf, BUFSIZ, fp) == NULL) {
|
||||||
break;
|
break;
|
||||||
@ -49,7 +49,7 @@ BOOL SendCommand(char *buf)
|
|||||||
printf("%s", buf);
|
printf("%s", buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ソケットを閉じる
|
// Close the socket when we're done
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
close(fd);
|
close(fd);
|
||||||
|
|
||||||
@ -58,7 +58,7 @@ BOOL SendCommand(char *buf)
|
|||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// 主処理
|
// Main processing
|
||||||
//
|
//
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
int main(int argc, char* argv[])
|
int main(int argc, char* argv[])
|
||||||
@ -81,7 +81,7 @@ int main(int argc, char* argv[])
|
|||||||
file = NULL;
|
file = NULL;
|
||||||
list = FALSE;
|
list = FALSE;
|
||||||
|
|
||||||
// ヘルプの表示
|
// Display help
|
||||||
if (argc < 2) {
|
if (argc < 2) {
|
||||||
fprintf(stderr, "SCSI Target Emulator RaSCSI Controller\n");
|
fprintf(stderr, "SCSI Target Emulator RaSCSI Controller\n");
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
@ -98,7 +98,7 @@ int main(int argc, char* argv[])
|
|||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 引数解析
|
// Parse the arguments
|
||||||
opterr = 0;
|
opterr = 0;
|
||||||
while ((opt = getopt(argc, argv, "i:u:c:t:f:l")) != -1) {
|
while ((opt = getopt(argc, argv, "i:u:c:t:f:l")) != -1) {
|
||||||
switch (opt) {
|
switch (opt) {
|
||||||
@ -168,34 +168,34 @@ int main(int argc, char* argv[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// リスト表示のみ
|
// List display only
|
||||||
if (id < 0 && cmd < 0 && type < 0 && file == NULL && list) {
|
if (id < 0 && cmd < 0 && type < 0 && file == NULL && list) {
|
||||||
sprintf(buf, "list\n");
|
sprintf(buf, "list\n");
|
||||||
SendCommand(buf);
|
SendCommand(buf);
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// IDチェック
|
// Check the ID number
|
||||||
if (id < 0 || id > 7) {
|
if (id < 0 || id > 7) {
|
||||||
fprintf(stderr, "Error : Invalid ID\n");
|
fprintf(stderr, "Error : Invalid ID\n");
|
||||||
exit(EINVAL);
|
exit(EINVAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ユニットチェック
|
// Check the unit number
|
||||||
if (un < 0 || un > 1) {
|
if (un < 0 || un > 1) {
|
||||||
fprintf(stderr, "Error : Invalid UNIT\n");
|
fprintf(stderr, "Error : Invalid UNIT\n");
|
||||||
exit(EINVAL);
|
exit(EINVAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
// コマンドチェック
|
// Command check
|
||||||
if (cmd < 0) {
|
if (cmd < 0) {
|
||||||
cmd = 0; // デフォルトはATTATCHとする
|
cmd = 0; // Default command is ATTATCH
|
||||||
}
|
}
|
||||||
|
|
||||||
// タイプチェック
|
// Type Check
|
||||||
if (cmd == 0 && type < 0) {
|
if (cmd == 0 && type < 0) {
|
||||||
|
|
||||||
// 拡張子からタイプ判別を試みる
|
// Try to determine the file type from the extension
|
||||||
len = file ? strlen(file) : 0;
|
len = file ? strlen(file) : 0;
|
||||||
if (len > 4 && file[len - 4] == '.') {
|
if (len > 4 && file[len - 4] == '.') {
|
||||||
ext = &file[len - 3];
|
ext = &file[len - 3];
|
||||||
@ -222,7 +222,7 @@ int main(int argc, char* argv[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ファイルチェック(コマンドはATTACHでタイプはHD)
|
// File check (command is ATTACH and type is HD)
|
||||||
if (cmd == 0 && type >= 0 && type <= 1) {
|
if (cmd == 0 && type >= 0 && type <= 1) {
|
||||||
if (!file) {
|
if (!file) {
|
||||||
fprintf(stderr, "Error : Invalid file path\n");
|
fprintf(stderr, "Error : Invalid file path\n");
|
||||||
@ -230,7 +230,7 @@ int main(int argc, char* argv[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ファイルチェック(コマンドはINSERT)
|
// File check (command is INSERT)
|
||||||
if (cmd == 2) {
|
if (cmd == 2) {
|
||||||
if (!file) {
|
if (!file) {
|
||||||
fprintf(stderr, "Error : Invalid file path\n");
|
fprintf(stderr, "Error : Invalid file path\n");
|
||||||
@ -238,23 +238,23 @@ int main(int argc, char* argv[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 必要でないtypeは0としておく
|
// Set unnecessary type to 0
|
||||||
if (type < 0) {
|
if (type < 0) {
|
||||||
type = 0;
|
type = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 送信コマンド生成
|
// Generate the command and send it
|
||||||
sprintf(buf, "%d %d %d %d %s\n", id, un, cmd, type, file ? file : "-");
|
sprintf(buf, "%d %d %d %d %s\n", id, un, cmd, type, file ? file : "-");
|
||||||
if (!SendCommand(buf)) {
|
if (!SendCommand(buf)) {
|
||||||
exit(ENOTCONN);
|
exit(ENOTCONN);
|
||||||
}
|
}
|
||||||
|
|
||||||
// リスト表示
|
// Display the list
|
||||||
if (list) {
|
if (list) {
|
||||||
sprintf(buf, "list\n");
|
sprintf(buf, "list\n");
|
||||||
SendCommand(buf);
|
SendCommand(buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 終了
|
// All done!
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
// Copyright (C) 2001-2006 PI.(ytanaka@ipc-tokai.or.jp)
|
// Copyright (C) 2001-2006 PI.(ytanaka@ipc-tokai.or.jp)
|
||||||
// Copyright (C) 2014-2020 GIMONS
|
// Copyright (C) 2014-2020 GIMONS
|
||||||
//
|
//
|
||||||
// [ SCSI共通 ]
|
// [ SCSI Common Functionality ]
|
||||||
//
|
//
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// フェーズ取得
|
// Phase Acquisition
|
||||||
//
|
//
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
BUS::phase_t FASTCALL BUS::GetPhase()
|
BUS::phase_t FASTCALL BUS::GetPhase()
|
||||||
@ -24,17 +24,17 @@ BUS::phase_t FASTCALL BUS::GetPhase()
|
|||||||
|
|
||||||
ASSERT(this);
|
ASSERT(this);
|
||||||
|
|
||||||
// セレクションフェーズ
|
// Selection Phase
|
||||||
if (GetSEL()) {
|
if (GetSEL()) {
|
||||||
return selection;
|
return selection;
|
||||||
}
|
}
|
||||||
|
|
||||||
// バスフリーフェーズ
|
// Bus busy phase
|
||||||
if (!GetBSY()) {
|
if (!GetBSY()) {
|
||||||
return busfree;
|
return busfree;
|
||||||
}
|
}
|
||||||
|
|
||||||
// バスの信号線からターゲットのフェーズを取得
|
// Get target phase from bus signal line
|
||||||
mci = GetMSG() ? 0x04 : 0x00;
|
mci = GetMSG() ? 0x04 : 0x00;
|
||||||
mci |= GetCD() ? 0x02 : 0x00;
|
mci |= GetCD() ? 0x02 : 0x00;
|
||||||
mci |= GetIO() ? 0x01 : 0x00;
|
mci |= GetIO() ? 0x01 : 0x00;
|
||||||
@ -43,7 +43,7 @@ BUS::phase_t FASTCALL BUS::GetPhase()
|
|||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// フェーズテーブル
|
// Phase Table
|
||||||
//
|
//
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
const BUS::phase_t BUS::phase_table[8] = {
|
const BUS::phase_t BUS::phase_table[8] = {
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
// Copyright (C) 2001-2006 PI.(ytanaka@ipc-tokai.or.jp)
|
// Copyright (C) 2001-2006 PI.(ytanaka@ipc-tokai.or.jp)
|
||||||
// Copyright (C) 2014-2020 GIMONS
|
// Copyright (C) 2014-2020 GIMONS
|
||||||
//
|
//
|
||||||
// [ SCSI共通 ]
|
// [ SCSI Common Functionality ]
|
||||||
//
|
//
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
@ -14,20 +14,20 @@
|
|||||||
|
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
//
|
//
|
||||||
// SASI/SCSI バス
|
// SASI/SCSI Bus
|
||||||
//
|
//
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
class BUS
|
class BUS
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// 動作モード定義
|
// Operation modes definition
|
||||||
enum mode_e {
|
enum mode_e {
|
||||||
TARGET = 0,
|
TARGET = 0,
|
||||||
INITIATOR = 1,
|
INITIATOR = 1,
|
||||||
MONITOR = 2,
|
MONITOR = 2,
|
||||||
};
|
};
|
||||||
|
|
||||||
// フェーズ定義
|
// Phase definition
|
||||||
enum phase_t {
|
enum phase_t {
|
||||||
busfree, // バスフリーフェーズ
|
busfree, // バスフリーフェーズ
|
||||||
arbitration, // アービトレーションフェーズ
|
arbitration, // アービトレーションフェーズ
|
||||||
@ -43,6 +43,7 @@ public:
|
|||||||
reserved // 未使用/リザーブ
|
reserved // 未使用/リザーブ
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Basic Functions
|
||||||
// 基本ファンクション
|
// 基本ファンクション
|
||||||
virtual BOOL FASTCALL Init(mode_e mode) = 0;
|
virtual BOOL FASTCALL Init(mode_e mode) = 0;
|
||||||
// 初期化
|
// 初期化
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
// Powered by XM6 TypeG Technology.
|
// Powered by XM6 TypeG Technology.
|
||||||
// Copyright (C) 2016-2020 GIMONS
|
// Copyright (C) 2016-2020 GIMONS
|
||||||
//
|
//
|
||||||
// [ 共通定義 ]
|
// [ Common Definition ]
|
||||||
//
|
//
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
@ -29,30 +29,30 @@
|
|||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// IDマクロ
|
// ID Macro
|
||||||
//
|
//
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
#define MAKEID(a, b, c, d) ((DWORD)((a<<24) | (b<<16) | (c<<8) | d))
|
#define MAKEID(a, b, c, d) ((DWORD)((a<<24) | (b<<16) | (c<<8) | d))
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// 各種動作設定
|
// Various Operation Settings
|
||||||
//
|
//
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
#define USE_SEL_EVENT_ENABLE // SEL信号をイベントでチェックする
|
#define USE_SEL_EVENT_ENABLE // Check SEL signal by event
|
||||||
#define REMOVE_FIXED_SASIHD_SIZE // SASIHDのサイズ制限を解除する
|
#define REMOVE_FIXED_SASIHD_SIZE // remove the size limitation of SASIHD
|
||||||
#define USE_MZ1F23_1024_SUPPORT // MZ-1F23(SASI 20M/セクタサイズ1024)
|
#define USE_MZ1F23_1024_SUPPORT // MZ-1F23 (SASI 20M/sector size 1024)
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// クラス宣言
|
// Class Declaration
|
||||||
//
|
//
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
class Fileio;
|
class Fileio;
|
||||||
// ファイル入出力
|
// File I/O
|
||||||
class Disk;
|
class Disk;
|
||||||
// SASI/SCSIディスク
|
// SASI/SCSI Disk
|
||||||
class Filepath;
|
class Filepath;
|
||||||
// ファイルパス
|
// File Path
|
||||||
|
|
||||||
#endif // xm6_h
|
#endif // xm6_h
|
||||||
|
Loading…
x
Reference in New Issue
Block a user