diff --git a/src/x68k/RASCTL/RASCTL.TXT b/src/x68k/RASCTL/RASCTL.TXT deleted file mode 100644 index fa45a9bf..00000000 --- a/src/x68k/RASCTL/RASCTL.TXT +++ /dev/null @@ -1,11 +0,0 @@ -X68000 commands for the management tool (rasctl) - -Overview - -This is a program for using the RaSCSI management tool (rasctl) to interface with -a real X68000 computer running Human68k over the RaSCSI bridge device. - -Description - -It has the exact same functionality as the management tool (rasctl) running on -the Raspberry Pi, so please refer to the RaSCSI documentation for instructions. diff --git a/src/x68k/RASDRV/BRIDGE.C b/src/x68k/RASDRV/BRIDGE.C index 1ecce912..c9c85e71 100644 --- a/src/x68k/RASDRV/BRIDGE.C +++ b/src/x68k/RASDRV/BRIDGE.C @@ -3,9 +3,9 @@ // SCSI Target Emulator RaSCSI (*^..^*) // for Raspberry Pi // -// Powered by XM6 TypeG Technorogy. +// Powered by XM6 TypeG Technology. // Copyright (C) 2016-2017 GIMONS -// [ ホストファイルシステム ブリッジドライバ ] +// [ Host Filesystem Bridge Driver ] // //--------------------------------------------------------------------------- @@ -18,16 +18,16 @@ //--------------------------------------------------------------------------- // -// 変数宣言 +// Variable definitions // //--------------------------------------------------------------------------- -volatile BYTE *request; // リクエストヘッダアドレス -DWORD command; // コマンド番号 -DWORD unit; // ユニット番号 +volatile BYTE *request; // Request header address +DWORD command; // Command number +DWORD unit; // Unit number //=========================================================================== // -/// ファイルシステム(SCSI連携) +/// File system (SCSI integration) // //=========================================================================== typedef struct @@ -49,7 +49,7 @@ int scsiid; // SCSI ID //--------------------------------------------------------------------------- // -// 初期化 +// Initialize // //--------------------------------------------------------------------------- BOOL SCSI_Init(void) @@ -57,7 +57,7 @@ BOOL SCSI_Init(void) int i; INQUIRY_T inq; - // SCSI ID未定 + // SCSI ID not set scsiid = -1; for (i = 0; i <= 7; i++) { @@ -69,7 +69,7 @@ BOOL SCSI_Init(void) continue; } - // SCSI ID確定 + // SCSI ID set scsiid = i; return TRUE; } @@ -79,7 +79,7 @@ BOOL SCSI_Init(void) //--------------------------------------------------------------------------- // -// コマンド送信 +// Send commands // //--------------------------------------------------------------------------- int SCSI_SendCmd(BYTE *buf, int len) @@ -103,7 +103,7 @@ int SCSI_SendCmd(BYTE *buf, int len) cmdbuf[8] = (BYTE)len; cmdbuf[9] = 0; - // セレクトがタイムアウトする時には再試行 + // Retry when select times out if (S_SELECT(scsiid) != 0) { S_RESET(); if (S_SELECT(scsiid) != 0) { @@ -138,7 +138,7 @@ int SCSI_SendCmd(BYTE *buf, int len) cmdbuf[8] = 4; cmdbuf[9] = 0; - // セレクトがタイムアウトする時には再試行 + // Retry when select times out if (S_SELECT(scsiid) != 0) { S_RESET(); if (S_SELECT(scsiid) != 0) { @@ -168,7 +168,7 @@ int SCSI_SendCmd(BYTE *buf, int len) //--------------------------------------------------------------------------- // -// コマンド呼び出し +// Call commands // //--------------------------------------------------------------------------- int SCSI_CalCmd(BYTE *buf, int len, BYTE *outbuf, int outlen) @@ -192,7 +192,7 @@ int SCSI_CalCmd(BYTE *buf, int len, BYTE *outbuf, int outlen) cmdbuf[8] = (BYTE)len; cmdbuf[9] = 0; - // セレクトがタイムアウトする時には再試行 + // Retry when select times out if (S_SELECT(scsiid) != 0) { S_RESET(); if (S_SELECT(scsiid) != 0) { @@ -227,7 +227,7 @@ int SCSI_CalCmd(BYTE *buf, int len, BYTE *outbuf, int outlen) cmdbuf[8] = 4; cmdbuf[9] = 0; - // セレクトがタイムアウトする時には再試行 + // Retry when select times out if (S_SELECT(scsiid) != 0) { S_RESET(); if (S_SELECT(scsiid) != 0) { @@ -251,7 +251,7 @@ int SCSI_CalCmd(BYTE *buf, int len, BYTE *outbuf, int outlen) return ret; } - // エラーなら返却データの受信を止める + // Stop receiving return data on error ret = *(int*)retbuf; if (ret < 0) { return ret; @@ -268,7 +268,7 @@ int SCSI_CalCmd(BYTE *buf, int len, BYTE *outbuf, int outlen) cmdbuf[8] = (BYTE)outlen; cmdbuf[9] = 1; - // セレクトがタイムアウトする時には再試行 + // Retry when select times out if (S_SELECT(scsiid) != 0) { S_RESET(); if (S_SELECT(scsiid) != 0) { @@ -298,7 +298,7 @@ int SCSI_CalCmd(BYTE *buf, int len, BYTE *outbuf, int outlen) //--------------------------------------------------------------------------- // -// オプションデータ取得 +// Get option data // //--------------------------------------------------------------------------- BOOL SCSI_ReadOpt(BYTE *buf, int len) @@ -318,7 +318,7 @@ BOOL SCSI_ReadOpt(BYTE *buf, int len) cmdbuf[8] = (BYTE)len; cmdbuf[9] = 2; - // セレクトがタイムアウトする時には再試行 + // Retry when select times out if (S_SELECT(scsiid) != 0) { S_RESET(); if (S_SELECT(scsiid) != 0) { @@ -347,7 +347,7 @@ BOOL SCSI_ReadOpt(BYTE *buf, int len) //--------------------------------------------------------------------------- // -// オプションデータ書き込み +// Write option data // //--------------------------------------------------------------------------- BOOL SCSI_WriteOpt(BYTE *buf, int len) @@ -367,7 +367,7 @@ BOOL SCSI_WriteOpt(BYTE *buf, int len) cmdbuf[8] = (BYTE)len; cmdbuf[9] = 1; - // セレクトがタイムアウトする時には再試行 + // Retry when select times out if (S_SELECT(scsiid) != 0) { S_RESET(); if (S_SELECT(scsiid) != 0) { @@ -396,13 +396,13 @@ BOOL SCSI_WriteOpt(BYTE *buf, int len) //=========================================================================== // -/// ファイルシステム +/// File System // //=========================================================================== //--------------------------------------------------------------------------- // -// $40 - デバイス起動 +// $40 - Device startup // //--------------------------------------------------------------------------- DWORD FS_InitDevice(const argument_t* pArgument) @@ -412,7 +412,7 @@ DWORD FS_InitDevice(const argument_t* pArgument) //--------------------------------------------------------------------------- // -// $41 - ディレクトリチェック +// $41 - Directory check // //--------------------------------------------------------------------------- int FS_CheckDir(const namests_t* pNamests) @@ -434,7 +434,7 @@ int FS_CheckDir(const namests_t* pNamests) //--------------------------------------------------------------------------- // -// $42 - ディレクトリ作成 +// $42 - Create directory // //--------------------------------------------------------------------------- int FS_MakeDir(const namests_t* pNamests) @@ -456,7 +456,7 @@ int FS_MakeDir(const namests_t* pNamests) //--------------------------------------------------------------------------- // -// $43 - ディレクトリ削除 +// $43 - Delete directory // //--------------------------------------------------------------------------- int FS_RemoveDir(const namests_t* pNamests) @@ -478,7 +478,7 @@ int FS_RemoveDir(const namests_t* pNamests) //--------------------------------------------------------------------------- // -// $44 - ファイル名変更 +// $44 - Change file name // //--------------------------------------------------------------------------- int FS_Rename(const namests_t* pNamests, const namests_t* pNamestsNew) @@ -503,7 +503,7 @@ int FS_Rename(const namests_t* pNamests, const namests_t* pNamestsNew) //--------------------------------------------------------------------------- // -// $45 - ファイル削除 +// $45 - Delete file // //--------------------------------------------------------------------------- int FS_Delete(const namests_t* pNamests) @@ -525,7 +525,7 @@ int FS_Delete(const namests_t* pNamests) //--------------------------------------------------------------------------- // -// $46 - ファイル属性取得/設定 +// $46 - Get/set file attribute // //--------------------------------------------------------------------------- int FS_Attribute(const namests_t* pNamests, DWORD nHumanAttribute) @@ -551,7 +551,7 @@ int FS_Attribute(const namests_t* pNamests, DWORD nHumanAttribute) //--------------------------------------------------------------------------- // -// $47 - ファイル検索 +// $47 - File search // //--------------------------------------------------------------------------- int FS_Files(DWORD nKey, @@ -581,7 +581,7 @@ int FS_Files(DWORD nKey, //--------------------------------------------------------------------------- // -// $48 - ファイル次検索 +// $48 - Search next file // //--------------------------------------------------------------------------- int FS_NFiles(DWORD nKey, files_t* info) @@ -607,7 +607,7 @@ int FS_NFiles(DWORD nKey, files_t* info) //--------------------------------------------------------------------------- // -// $49 - ファイル作成 +// $49 - Create new file // //--------------------------------------------------------------------------- int FS_Create(DWORD nKey, @@ -646,7 +646,7 @@ int FS_Create(DWORD nKey, //--------------------------------------------------------------------------- // -// $4A - ファイルオープン +// $4A - File open // //--------------------------------------------------------------------------- int FS_Open(DWORD nKey, @@ -676,7 +676,7 @@ int FS_Open(DWORD nKey, //--------------------------------------------------------------------------- // -// $4B - ファイルクローズ +// $4B - File close // //--------------------------------------------------------------------------- int FS_Close(DWORD nKey, fcb_t* pFcb) @@ -702,7 +702,7 @@ int FS_Close(DWORD nKey, fcb_t* pFcb) //--------------------------------------------------------------------------- // -// $4C - ファイル読み込み +// $4C - Read file // //--------------------------------------------------------------------------- int FS_Read(DWORD nKey, fcb_t* pFcb, BYTE* pAddress, DWORD nSize) @@ -735,7 +735,7 @@ int FS_Read(DWORD nKey, fcb_t* pFcb, BYTE* pAddress, DWORD nSize) //--------------------------------------------------------------------------- // -// $4D - ファイル書き込み +// $4D - Write file // //--------------------------------------------------------------------------- int FS_Write(DWORD nKey, fcb_t* pFcb, BYTE* pAddress, DWORD nSize) @@ -767,7 +767,7 @@ int FS_Write(DWORD nKey, fcb_t* pFcb, BYTE* pAddress, DWORD nSize) //--------------------------------------------------------------------------- // -// $4E - ファイルシーク +// $4E - File seek // //--------------------------------------------------------------------------- int FS_Seek(DWORD nKey, fcb_t* pFcb, DWORD nMode, int nOffset) @@ -797,7 +797,7 @@ int FS_Seek(DWORD nKey, fcb_t* pFcb, DWORD nMode, int nOffset) //--------------------------------------------------------------------------- // -// $4F - ファイル時刻取得/設定 +// $4F - Get/set file time stamp // //--------------------------------------------------------------------------- DWORD FS_TimeStamp(DWORD nKey, @@ -828,7 +828,7 @@ DWORD FS_TimeStamp(DWORD nKey, //--------------------------------------------------------------------------- // -// $50 - 容量取得 +// $50 - Get capacity // //--------------------------------------------------------------------------- int FS_GetCapacity(capacity_t* cap) @@ -847,28 +847,28 @@ int FS_GetCapacity(capacity_t* cap) //--------------------------------------------------------------------------- // -// $51 - ドライブ状態検査/制御 +// $51 - Inspect/control drive status // //--------------------------------------------------------------------------- int FS_CtrlDrive(ctrldrive_t* pCtrlDrive) { #if 1 - // 負荷が高いのでここで暫定処理 + // Do tentative processing here due to high load switch (pCtrlDrive->status) { - case 0: // 状態検査 - case 9: // 状態検査2 + case 0: // Inspect status + case 9: // Inspect status 2 pCtrlDrive->status = 0x42; return pCtrlDrive->status; - case 1: // イジェクト - case 2: // イジェクト禁止1 (未実装) - case 3: // イジェクト許可1 (未実装) - case 4: // メディア未挿入時にLED点滅 (未実装) - case 5: // メディア未挿入時にLED消灯 (未実装) - case 6: // イジェクト禁止2 (未実装) - case 7: // イジェクト許可2 (未実装) + case 1: // Eject + case 2: // Eject forbidden 1 (not implemented) + case 3: // Eject allowed 1 (not implemented) + case 4: // Flash LED when media is not inserted (not implemented) + case 5: // Turn off LED when media is not inserted (not implemented) + case 6: // Eject forbidden 2 (not implemented) + case 7: // Eject allowed 2 (not implemented) return 0; - case 8: // イジェクト検査 + case 8: // Eject inspection return 1; } @@ -892,7 +892,7 @@ int FS_CtrlDrive(ctrldrive_t* pCtrlDrive) //--------------------------------------------------------------------------- // -// $52 - DPB取得 +// $52 - Get DPB // //--------------------------------------------------------------------------- int FS_GetDPB(dpb_t* pDpb) @@ -911,7 +911,7 @@ int FS_GetDPB(dpb_t* pDpb) //--------------------------------------------------------------------------- // -// $53 - セクタ読み込み +// $53 - Read sector // //--------------------------------------------------------------------------- int FS_DiskRead(BYTE* pBuffer, DWORD nSector, DWORD nSize) @@ -938,7 +938,7 @@ int FS_DiskRead(BYTE* pBuffer, DWORD nSector, DWORD nSize) //--------------------------------------------------------------------------- // -// $54 - セクタ書き込み +// $54 - Write sector // //--------------------------------------------------------------------------- int FS_DiskWrite() @@ -980,13 +980,13 @@ int FS_Ioctrl(DWORD nFunction, ioctrl_t* pIoctrl) //--------------------------------------------------------------------------- // -// $56 - フラッシュ +// $56 - Flush // //--------------------------------------------------------------------------- int FS_Flush() { #if 1 - // 未サポート + // Not supported return 0; #else BYTE buf[256]; @@ -1001,13 +1001,13 @@ int FS_Flush() //--------------------------------------------------------------------------- // -// $57 - メディア交換チェック +// $57 - Media change check // //--------------------------------------------------------------------------- int FS_CheckMedia() { #if 1 - // 負荷が高いので暫定処理 + // Do tentative processing due to high load return 0; #else BYTE buf[256]; @@ -1022,13 +1022,13 @@ int FS_CheckMedia() //--------------------------------------------------------------------------- // -// $58 - 排他制御 +// $58 - Lock // //--------------------------------------------------------------------------- int FS_Lock() { #if 1 - // 未サポート + // Not supported return 0; #else BYTE buf[256]; @@ -1043,7 +1043,7 @@ int FS_Lock() //=========================================================================== // -// コマンドハンドラ +// Command handlers // //=========================================================================== #define GetReqByte(a) (request[a]) @@ -1056,7 +1056,7 @@ int FS_Lock() //--------------------------------------------------------------------------- // -// NAMESTS読み込み +// Read NAMESTS // //--------------------------------------------------------------------------- void GetNameStsPath(BYTE *addr, namests_t* pNamests) @@ -1066,30 +1066,30 @@ void GetNameStsPath(BYTE *addr, namests_t* pNamests) ASSERT(this); ASSERT(pNamests); - // ワイルドカード情報 + // Wildcard data pNamests->wildcard = *addr; - // ドライブ番号 + // Drive number pNamests->drive = addr[1]; - // パス名 + // Pathname for (i = 0; i < sizeof(pNamests->path); i++) { pNamests->path[i] = addr[2 + i]; } - // ファイル名1 + // Filename 1 memset(pNamests->name, 0x20, sizeof(pNamests->name)); - // 拡張子 + // File ending memset(pNamests->ext, 0x20, sizeof(pNamests->ext)); - // ファイル名2 + // Filename 2 memset(pNamests->add, 0, sizeof(pNamests->add)); } //--------------------------------------------------------------------------- // -// NAMESTS読み込み +// Read NAMESTS // //--------------------------------------------------------------------------- void GetNameSts(BYTE *addr, namests_t* pNamests) @@ -1100,28 +1100,28 @@ void GetNameSts(BYTE *addr, namests_t* pNamests) ASSERT(pNamests); ASSERT(addr <= 0xFFFFFF); - // ワイルドカード情報 + // Wildcard data pNamests->wildcard = *addr; - // ドライブ番号 + // Drive number pNamests->drive = addr[1]; - // パス名 + // Pathname for (i = 0; i < sizeof(pNamests->path); i++) { pNamests->path[i] = addr[2 + i]; } - // ファイル名1 + // Filename 1 for (i = 0; i < sizeof(pNamests->name); i++) { pNamests->name[i] = addr[67 + i]; } - // 拡張子 + // File ending for (i = 0; i < sizeof(pNamests->ext); i++) { pNamests->ext[i] = addr[75 + i]; } - // ファイル名2 + // Filename 2 for (i = 0; i < sizeof(pNamests->add); i++) { pNamests->add[i] = addr[78 + i]; } @@ -1129,7 +1129,7 @@ void GetNameSts(BYTE *addr, namests_t* pNamests) //--------------------------------------------------------------------------- // -// FILES読み込み +// Read FILES // //--------------------------------------------------------------------------- void GetFiles(BYTE *addr, files_t* pFiles) @@ -1138,7 +1138,7 @@ void GetFiles(BYTE *addr, files_t* pFiles) ASSERT(pFiles); ASSERT(addr <= 0xFFFFFF); - // 検索情報 + // Search data pFiles->fatr = *addr; pFiles->sector = *((DWORD*)&addr[2]); pFiles->offset = *((WORD*)&addr[8]);; @@ -1152,7 +1152,7 @@ void GetFiles(BYTE *addr, files_t* pFiles) //--------------------------------------------------------------------------- // -// FILES書き込み +// Write FILES // //--------------------------------------------------------------------------- void SetFiles(BYTE *addr, const files_t* pFiles) @@ -1165,13 +1165,13 @@ void SetFiles(BYTE *addr, const files_t* pFiles) *((DWORD*)&addr[2]) = pFiles->sector; *((WORD*)&addr[8]) = pFiles->offset; - // ファイル情報 + // File data addr[21] = pFiles->attr; *((WORD*)&addr[22]) = pFiles->time; *((WORD*)&addr[24]) = pFiles->date; *((DWORD*)&addr[26]) = pFiles->size; - // フルファイル名 + // Full filename addr += 30; for (i = 0; i < sizeof(pFiles->full); i++) { *addr = pFiles->full[i]; @@ -1181,7 +1181,7 @@ void SetFiles(BYTE *addr, const files_t* pFiles) //--------------------------------------------------------------------------- // -// FCB読み込み +// Read FCB // //--------------------------------------------------------------------------- void GetFcb(BYTE *addr, fcb_t* pFcb) @@ -1189,14 +1189,14 @@ void GetFcb(BYTE *addr, fcb_t* pFcb) ASSERT(this); ASSERT(pFcb); - // FCB情報 + // FCB data pFcb->fileptr = *((DWORD*)&addr[6]); pFcb->mode = *((WORD*)&addr[14]); - // 属性 + // Attribute pFcb->attr = addr[47]; - // FCB情報 + // FCB data pFcb->time = *((WORD*)&addr[58]); pFcb->date = *((WORD*)&addr[60]); pFcb->size = *((DWORD*)&addr[64]); @@ -1204,7 +1204,7 @@ void GetFcb(BYTE *addr, fcb_t* pFcb) //--------------------------------------------------------------------------- // -// FCB書き込み +// Write FCB // //--------------------------------------------------------------------------- void SetFcb(BYTE *addr, const fcb_t* pFcb) @@ -1212,14 +1212,14 @@ void SetFcb(BYTE *addr, const fcb_t* pFcb) ASSERT(this); ASSERT(pFcb); - // FCB情報 + // FCB data *((DWORD*)&addr[6]) = pFcb->fileptr; *((WORD*)&addr[14]) = pFcb->mode; - // 属性 + // Attribute addr[47] = pFcb->attr; - // FCB情報 + // FCB data *((WORD*)&addr[58]) = pFcb->time; *((WORD*)&addr[60]) = pFcb->date; *((DWORD*)&addr[64]) = pFcb->size; @@ -1227,7 +1227,7 @@ void SetFcb(BYTE *addr, const fcb_t* pFcb) //--------------------------------------------------------------------------- // -// CAPACITY書き込み +// Write CAPACITY // //--------------------------------------------------------------------------- void SetCapacity(BYTE *addr, const capacity_t* pCapacity) @@ -1243,7 +1243,7 @@ void SetCapacity(BYTE *addr, const capacity_t* pCapacity) //--------------------------------------------------------------------------- // -// DPB書き込み +// Write DPB // //--------------------------------------------------------------------------- void SetDpb(BYTE *addr, const dpb_t* pDpb) @@ -1251,7 +1251,7 @@ void SetDpb(BYTE *addr, const dpb_t* pDpb) ASSERT(this); ASSERT(pDpb); - // DPB情報 + // DPB data *((WORD*)&addr[0]) = pDpb->sector_size; addr[2] = pDpb->cluster_size; addr[3] = pDpb->shift; @@ -1267,7 +1267,7 @@ void SetDpb(BYTE *addr, const dpb_t* pDpb) //--------------------------------------------------------------------------- // -// IOCTRL読み込み +// Read IOCTRL // //--------------------------------------------------------------------------- void GetIoctrl(DWORD param, DWORD func, ioctrl_t* pIoctrl) @@ -1279,12 +1279,12 @@ void GetIoctrl(DWORD param, DWORD func, ioctrl_t* pIoctrl) switch (func) { case 2: - // メディア再認識 + // Re-identify media pIoctrl->param = param; return; case -2: - // オプション設定 + // Configure options lp = (DWORD*)param; pIoctrl->param = *lp; return; @@ -1293,7 +1293,7 @@ void GetIoctrl(DWORD param, DWORD func, ioctrl_t* pIoctrl) //--------------------------------------------------------------------------- // -// IOCTRL書き込み +// Write IOCTRL // //--------------------------------------------------------------------------- void SetIoctrl(DWORD param, DWORD func, ioctrl_t* pIoctrl) @@ -1308,19 +1308,19 @@ void SetIoctrl(DWORD param, DWORD func, ioctrl_t* pIoctrl) switch (func) { case 0: - // メディアIDの獲得 + // Acquire media ID wp = (WORD*)param; *wp = pIoctrl->media; return; case 1: - // Human68k互換のためのダミー + // Dummy for Human68k compatibility lp = (DWORD*)param; *lp = pIoctrl->param; return; case -1: - // 常駐判定 + // Resident evaluation bp = (BYTE*)param; for (i = 0; i < 8; i++) { *bp = pIoctrl->buffer[i]; @@ -1329,7 +1329,7 @@ void SetIoctrl(DWORD param, DWORD func, ioctrl_t* pIoctrl) return; case -3: - // オプション獲得 + // Acquire options lp = (DWORD*)param; *lp = pIoctrl->param; return; @@ -1338,9 +1338,9 @@ void SetIoctrl(DWORD param, DWORD func, ioctrl_t* pIoctrl) //--------------------------------------------------------------------------- // -// ARGUMENT読み込み +// Read ARGUMENT // -// バッファサイズよりも長い場合は転送を打ち切って必ず終端する。 +// When this exceeds the buffer size, interrupt transfer and exit. // //--------------------------------------------------------------------------- void GetArgument(BYTE *addr, argument_t* pArgument) @@ -1374,7 +1374,7 @@ void GetArgument(BYTE *addr, argument_t* pArgument) //--------------------------------------------------------------------------- // -// 終了値書き込み +// Write return value // //--------------------------------------------------------------------------- void SetResult(DWORD nResult) @@ -1383,7 +1383,7 @@ void SetResult(DWORD nResult) ASSERT(this); - // 致命的エラー判定 + // Handle fatal errors switch (nResult) { case FS_FATAL_INVALIDUNIT: code = 0x5001; @@ -1399,8 +1399,8 @@ void SetResult(DWORD nResult) fatal: SetReqByte(3, (BYTE)code); SetReqByte(4, code >> 8); - // @note リトライ可能を返すときは、(a5 + 18)を書き換えてはいけない。 - // その後白帯で Retry を選択した場合、書き換えた値を読み込んで誤動作してしまう。 + // @note When returning retryability, never overwrite with (a5 + 18). + // If you do that, the system will start behaving erratically if you hit Retry at the system error screen. if (code & 0x2000) break; nResult = FS_INVALIDFUNC; @@ -1412,23 +1412,23 @@ void SetResult(DWORD nResult) //--------------------------------------------------------------------------- // -// $40 - デバイス起動 +// $40 - Device startup // // in (offset size) -// 0 1.b 定数(22) -// 2 1.b コマンド($40/$c0) -// 18 1.l パラメータアドレス -// 22 1.b ドライブ番号 +// 0 1.b constant (22) +// 2 1.b command ($40/$c0) +// 18 1.l parameter address +// 22 1.b drive number // out (offset size) -// 3 1.b エラーコード(下位) -// 4 1.b 〃 (上位) -// 13 1.b ユニット数 -// 14 1.l デバイスドライバの終了アドレス + 1 +// 3 1.b error code (lower) +// 4 1.b '' (upper) +// 13 1.b number of units +// 14 1.l device driver exit address + 1 // -// ローカルドライブのコマンド 0 と同様に組み込み時に呼ばれるが、BPB 及 -// びそのポインタの配列を用意する必要はない. -// 他のコマンドと違い、このコマンドだけa5 + 1には有効な値が入っていない -// (0初期化なども期待してはいけない)ので注意すること。 +// This is called command 0 when the driver is loaded similarly to a local drive, +// but there is no need to prepare BPB or its pointer array. +// Unlike other commands, only this command does not include a valid a5 + 1, +// since it doesn't expect 0 initialization etc., so be careful. // //--------------------------------------------------------------------------- DWORD InitDevice(void) @@ -1439,13 +1439,13 @@ DWORD InitDevice(void) ASSERT(this); ASSERT(fs); - // オプション内容を獲得 + // Get option contents GetArgument(GetReqAddr(18), &arg); - // Human68k側で利用可能なドライブ数の範囲で、ファイルシステムを構築 + // Contstruct the filesystem to the extent Human68k can support number of drivers etc. units = FS_InitDevice(&arg); - // ドライブ数を返信 + // Return number of drives SetReqByte(13, units); return 0; @@ -1453,10 +1453,10 @@ DWORD InitDevice(void) //--------------------------------------------------------------------------- // -// $41 - ディレクトリチェック +// $41 - Directory check // // in (offset size) -// 14 1.L NAMESTS構造体アドレス +// 14 1.L NAMESTS struct address // //--------------------------------------------------------------------------- DWORD CheckDir(void) @@ -1467,10 +1467,10 @@ DWORD CheckDir(void) ASSERT(this); ASSERT(fs); - // 検索対象ファイル名獲得 + // Get filename to search GetNameStsPath(GetReqAddr(14), &ns); - // ファイルシステム呼び出し + // Call filesystem nResult = FS_CheckDir(&ns); return nResult; @@ -1478,10 +1478,10 @@ DWORD CheckDir(void) //--------------------------------------------------------------------------- // -// $42 - ディレクトリ作成 +// $42 - Create directory // // in (offset size) -// 14 1.L NAMESTS構造体アドレス +// 14 1.L NAMESTS struct address // //--------------------------------------------------------------------------- DWORD MakeDir(void) @@ -1492,10 +1492,10 @@ DWORD MakeDir(void) ASSERT(this); ASSERT(fs); - // 検索対象ファイル名獲得 + // Get filename to search GetNameSts(GetReqAddr(14), &ns); - // ファイルシステム呼び出し + // Call filesystem nResult = FS_MakeDir(&ns); return nResult; @@ -1503,10 +1503,10 @@ DWORD MakeDir(void) //--------------------------------------------------------------------------- // -// $43 - ディレクトリ削除 +// $43 - Delete directory // // in (offset size) -// 14 1.L NAMESTS構造体アドレス +// 14 1.L NAMESTS struct address // //--------------------------------------------------------------------------- DWORD RemoveDir(void) @@ -1517,10 +1517,10 @@ DWORD RemoveDir(void) ASSERT(this); ASSERT(fs); - // 検索対象ファイル名獲得 + // Get filename to search GetNameSts(GetReqAddr(14), &ns); - // ファイルシステム呼び出し + // Call filesystem nResult = FS_RemoveDir(&ns); return nResult; @@ -1528,11 +1528,11 @@ DWORD RemoveDir(void) //--------------------------------------------------------------------------- // -// $44 - ファイル名変更 +// $44 - Change filename // // in (offset size) -// 14 1.L NAMESTS構造体アドレス 旧ファイル名 -// 18 1.L NAMESTS構造体アドレス 新ファイル名 +// 14 1.L NAMESTS struct address old filename +// 18 1.L NAMESTS struct address new filename // //--------------------------------------------------------------------------- DWORD Rename(void) @@ -1544,11 +1544,11 @@ DWORD Rename(void) ASSERT(this); ASSERT(fs); - // 検索対象ファイル名獲得 + // Get filename to search GetNameSts(GetReqAddr(14), &ns); GetNameSts(GetReqAddr(18), &ns_new); - // ファイルシステム呼び出し + // Call filesystem nResult = FS_Rename(&ns, &ns_new); return nResult; @@ -1556,10 +1556,10 @@ DWORD Rename(void) //--------------------------------------------------------------------------- // -// $45 - ファイル削除 +// $45 - Delete file // // in (offset size) -// 14 1.L NAMESTS構造体アドレス +// 14 1.L NAMESTS struct address // //--------------------------------------------------------------------------- DWORD Delete(void) @@ -1570,10 +1570,10 @@ DWORD Delete(void) ASSERT(this); ASSERT(fs); - // 検索対象ファイル名獲得 + // Get filename to search GetNameSts(GetReqAddr(14), &ns); - // ファイルシステム呼び出し + // Call filesystem nResult = FS_Delete(&ns); return nResult; @@ -1581,12 +1581,12 @@ DWORD Delete(void) //--------------------------------------------------------------------------- // -// $46 - ファイル属性取得/設定 +// $46 - Get/set file attribute // // in (offset size) -// 12 1.B 読み出し時に0x01になるので注意 -// 13 1.B 属性 $FFだと読み出し -// 14 1.L NAMESTS構造体アドレス +// 12 1.B Note that this becomes 0x01 when read from memory +// 13 1.B attribute; read from memory when $FF +// 14 1.L NAMESTS struct address // //--------------------------------------------------------------------------- DWORD Attribute(void) @@ -1598,13 +1598,13 @@ DWORD Attribute(void) ASSERT(this); ASSERT(fs); - // 検索対象ファイル名獲得 + // Get filename to search GetNameSts(GetReqAddr(14), &ns); - // 対象属性 + // Target attribute attr = GetReqByte(13); - // ファイルシステム呼び出し + // Call filesystem nResult = FS_Attribute(&ns, attr); return nResult; @@ -1612,39 +1612,39 @@ DWORD Attribute(void) //--------------------------------------------------------------------------- // -// $47 - ファイル検索 +// $47 - File search // // in (offset size) -// 0 1.b 定数(26) -// 1 1.b ユニット番号 -// 2 1.b コマンド($47/$c7) -// 13 1.b 検索属性 (WindrvXMでは未使用。検索バッファに値が書かれている) -// 14 1.l ファイル名バッファ(namests 形式) -// 18 1.l 検索バッファ(files 形式) このバッファに検索途中情報と検索結果を書き込む +// 0 1.b constant (26) +// 1 1.b unit number +// 2 1.b command ($47/$c7) +// 13 1.b search attribute (Unused in WindrvXM. Written directly to search buffer.) +// 14 1.l Filename buffer (namests format) +// 18 1.l Search buffer (files format) Search data in progress and search results are written to this buffer. // out (offset size) -// 3 1.b エラーコード(下位) -// 4 1.b 〃 (上位) -// 18 1.l リザルトステータス +// 3 1.b error code (lower) +// 4 1.b '' (upper) +// 18 1.l result status // -// ディレクトリから指定ファイルを検索する. DOS _FILES から呼び出される. -// 検索に失敗した場合、若しくは検索に成功してもワイルドカードが使われて -// いない場合は、次回検索時に必ず失敗させる為に検索バッファのオフセットに -// -1 を書き込む. 検索が成功した場合は見つかったファイルの情報を設定する -// と共に、次検索用の情報のセクタ番号、オフセット、ルートディレクトリの場 -// 合は更に残りセクタ数を設定する. 検索ドライブ・属性、パス名は DOS コー -// ル処理内で設定されるので書き込む必要はない. +// Search files from specified directory. Called from DOS _FILES. +// When a search fails, or succeeds but not using wildcards, +// we write -1 to the search buffer offset to make the next search fail. +// When a file is found, we set its data as well as the following data +// for the next search: sector number, offset, and in the case of the +// root directory, also the remaining sectors. The search drive, attribute, +// and path name are set in the DOS call processing, so writing is not needed. // -// +// // (offset size) -// 0 1.b NAMWLD 0:ワイルドカードなし -1:ファイル指定なし -// (ワイルドカードの文字数) -// 1 1.b NAMDRV ドライブ番号(A=0,B=1,…,Z=25) -// 2 65.b NAMPTH パス('\'+あればサブディレクトリ名+'\') -// 67 8.b NAMNM1 ファイル名(先頭 8 文字) -// 75 3.b NAMEXT 拡張子 -// 78 10.b NAMNM2 ファイル名(残りの 10 文字) +// 0 1.b NAMWLD 0: no wildcard -1:no specified file +// (number of chars of wildcard) +// 1 1.b NAMDRV drive number (A=0,B=1,...,Z=25) +// 2 65.b NAMPTH path ('\' + optional subdirectory + '\') +// 67 8.b NAMNM1 filename (first 8 chars) +// 75 3.b NAMEXT file ending +// 78 10.b NAMNM2 filename (remaining 10 chars) // -// パス区切り文字は0x2F(/)や0x5C(\)ではなく0x09(TAB)を使っているので注意。 +// Note that 0x09 (TAB) is used for path separator, rather than 0x2F (/) or 0x5C (\) // //--------------------------------------------------------------------------- DWORD Files(void) @@ -1657,17 +1657,17 @@ DWORD Files(void) ASSERT(this); ASSERT(fs); - // 検索途中経過格納領域 + // Memory for storing search in progress files = GetReqAddr(18); GetFiles(files, &info); - // 検索対象ファイル名獲得 + // Get filename to search GetNameSts(GetReqAddr(14), &ns); - // ファイルシステム呼び出し + // Call filesystem nResult = FS_Files((DWORD)files, &ns, &info); - // 検索結果の反映 + // Apply search results if (nResult >= 0) { SetFiles(files, &info); } @@ -1677,10 +1677,10 @@ DWORD Files(void) //--------------------------------------------------------------------------- // -// $48 - ファイル次検索 +// $48 - Search next file // // in (offset size) -// 18 1.L FILES構造体アドレス +// 18 1.L FILES struct address // //--------------------------------------------------------------------------- DWORD NFiles(void) @@ -1692,14 +1692,14 @@ DWORD NFiles(void) ASSERT(this); ASSERT(fs); - // ワーク領域の読み込み + // Read work memory files = GetReqAddr(18); GetFiles(files, &info); - // ファイルシステム呼び出し + // Call filesystem nResult = FS_NFiles((DWORD)files, &info); - // 検索結果の反映 + // Apply search results if (nResult >= 0) { SetFiles(files, &info); } @@ -1709,14 +1709,14 @@ DWORD NFiles(void) //--------------------------------------------------------------------------- // -// $49 - ファイル作成(Create) +// $49 - Create file (Create) // // in (offset size) -// 1 1.B ユニット番号 -// 13 1.B 属性 -// 14 1.L NAMESTS構造体アドレス -// 18 1.L モード (0:_NEWFILE 1:_CREATE) -// 22 1.L FCB構造体アドレス +// 1 1.B unit number +// 13 1.B attribute +// 14 1.L NAMESTS struct address +// 18 1.L mode (0:_NEWFILE 1:_CREATE) +// 22 1.L FCB struct address // //--------------------------------------------------------------------------- DWORD Create(void) @@ -1731,23 +1731,23 @@ DWORD Create(void) ASSERT(this); ASSERT(fs); - // 対象ファイル名獲得 + // Get target filename GetNameSts(GetReqAddr(14), &ns); - // FCB獲得 + // Get FCB pFcb = GetReqAddr(22); GetFcb(pFcb, &fcb); - // 属性 + // Attribute attr = GetReqByte(13); - // 強制上書きモード + // Forced overwrite mode force = (BOOL)GetReqLong(18); - // ファイルシステム呼び出し + // Call filesystem nResult = FS_Create((DWORD)pFcb, &ns, &fcb, attr, force); - // 結果の反映 + // Apply results if (nResult >= 0) { SetFcb(pFcb, &fcb); } @@ -1757,15 +1757,15 @@ DWORD Create(void) //--------------------------------------------------------------------------- // -// $4A - ファイルオープン +// $4A - File open // // in (offset size) -// 1 1.B ユニット番号 -// 14 1.L NAMESTS構造体アドレス -// 22 1.L FCB構造体アドレス -// 既にFCBにはほとんどのパラメータが設定済み -// 時刻・日付はオープンした瞬間のものになってるので上書き -// サイズは0になっているので上書き +// 1 1.B unit number +// 14 1.L NAMESTS struct address +// 22 1.L FCB struct address +// Most parameters are already set in FCB. +// Overwrite time and date at the moment of opening. +// Overwrite if size is 0. // //--------------------------------------------------------------------------- DWORD Open(void) @@ -1778,17 +1778,17 @@ DWORD Open(void) ASSERT(this); ASSERT(fs); - // 対象ファイル名獲得 + // Get target filename GetNameSts(GetReqAddr(14), &ns); - // FCB獲得 + // Get FCB pFcb = GetReqAddr(22); GetFcb(pFcb, &fcb); - // ファイルシステム呼び出し + // Call filesystem nResult = FS_Open((DWORD)pFcb, &ns, &fcb); - // 結果の反映 + // Apply results if (nResult >= 0) { SetFcb(pFcb, &fcb); } @@ -1798,10 +1798,10 @@ DWORD Open(void) //--------------------------------------------------------------------------- // -// $4B - ファイルクローズ +// $4B - File close // // in (offset size) -// 22 1.L FCB構造体アドレス +// 22 1.L FCB struct address // //--------------------------------------------------------------------------- DWORD Close(void) @@ -1813,14 +1813,14 @@ DWORD Close(void) ASSERT(this); ASSERT(fs); - // FCB獲得 + // Get FCB pFcb = GetReqAddr(22); GetFcb(pFcb, &fcb); - // ファイルシステム呼び出し + // Call filesystem nResult = FS_Close((DWORD)pFcb, &fcb); - // 結果の反映 + // Apply results if (nResult >= 0) { SetFcb(pFcb, &fcb); } @@ -1830,21 +1830,21 @@ DWORD Close(void) //--------------------------------------------------------------------------- // -// $4C - ファイル読み込み +// $4C - Read file // // in (offset size) -// 14 1.L 読み込みバッファ ここにファイル内容を読み込む -// 18 1.L サイズ 16MBを超える値が指定される可能性もあり -// 22 1.L FCB構造体アドレス +// 14 1.L Reading buffer; Read the file contents here. +// 18 1.L Size; It may be set to values exceeding 16MB +// 22 1.L FCB struct address // -// バスエラーが発生するアドレスを指定した場合の動作は保証しない。 +// No guarantee for behavior when passing address where bus error occurs. // -// 20世紀のアプリは「負の数だとファイルを全部読む」という作法で書かれている -// 可能性が微レ存。あれれー?このファイル16MB超えてるよー?(CV.高山みなみ) +// In the 20th century, a small number of apps used a trick where reading a +// negative value meant "read all the files!" Wh, what? This file is over 16MB! // -// むしろ4〜12MBくらいの当時のプログラマーから見た実質的な「∞」の値で -// クリップするような配慮こそが現代では必要なのではなかろうか。 -// または、末尾が12MBと16MB位置を超えたらサイズをクリップすると良いかも。 +// Back then, anything over 4~12MB was treated as "inifity" and often truncated +// out of helpfulness, which is not needed in this day and age. +// On the other hand, it might be a good idea to truncate at 12MB or 16MB. // //--------------------------------------------------------------------------- DWORD Read(void) @@ -1858,25 +1858,25 @@ DWORD Read(void) ASSERT(this); ASSERT(fs); - // FCB獲得 + // Get FCB pFcb = GetReqAddr(22); GetFcb(pFcb, &fcb); - // 読み込みバッファ + // Read buffer pAddress = GetReqAddr(14); - // 読み込みサイズ + // Read size nSize = GetReqLong(18); - // クリッピング + // Clipping if (nSize >= WINDRV_CLIPSIZE_MAX) { nSize = WINDRV_CLIPSIZE_MAX; } - // ファイルシステム呼び出し + // Call filesystem nResult = FS_Read((DWORD)pFcb, &fcb, pAddress, nSize); - // 結果の反映 + // Apply results if (nResult >= 0) { SetFcb(pFcb, &fcb); } @@ -1886,14 +1886,14 @@ DWORD Read(void) //--------------------------------------------------------------------------- // -// $4D - ファイル書き込み +// $4D - Write file // // in (offset size) -// 14 1.L 書き込みバッファ ここにファイル内容を書き込む -// 18 1.L サイズ 負の数ならファイルサイズを指定したのと同じ -// 22 1.L FCB構造体アドレス +// 14 1.L Write buffer; Write file contents here +// 18 1.L Size; If a negative number, treated the same as specifying file size +// 22 1.L FCB struct address // -// バスエラーが発生するアドレスを指定した場合の動作は保証しない。 +// No guarantee for behavior when passing address where bus error occurs. // //--------------------------------------------------------------------------- DWORD Write(void) @@ -1907,25 +1907,25 @@ DWORD Write(void) ASSERT(this); ASSERT(fs); - // FCB獲得 + // Get FCB pFcb = GetReqAddr(22); GetFcb(pFcb, &fcb); - // 書き込みバッファ + // Write buffer pAddress = GetReqAddr(14); - // 書き込みサイズ + // Write size nSize = GetReqLong(18); - // クリッピング + // Clipping if (nSize >= WINDRV_CLIPSIZE_MAX) { nSize = WINDRV_CLIPSIZE_MAX; } - // ファイルシステム呼び出し + // Call filesystem nResult = FS_Write((DWORD)pFcb, &fcb, pAddress, nSize); - // 結果の反映 + // Apply results if (nResult >= 0) { SetFcb(pFcb, &fcb); } @@ -1935,13 +1935,13 @@ DWORD Write(void) //--------------------------------------------------------------------------- // -// $4E - ファイルシーク +// $4E - File seek // // in (offset size) -// 12 1.B 0x2B になってるときがある 0のときもある -// 13 1.B モード -// 18 1.L オフセット -// 22 1.L FCB構造体アドレス +// 12 1.B This becomes 0x2B sometimes, and 0 other times +// 13 1.B mode +// 18 1.L offset +// 22 1.L FCB struct address // //--------------------------------------------------------------------------- DWORD Seek(void) @@ -1955,20 +1955,20 @@ DWORD Seek(void) ASSERT(this); ASSERT(fs); - // FCB獲得 + // Get FCB pFcb = GetReqAddr(22); GetFcb(pFcb, &fcb); - // シークモード + // Seek mode nMode = GetReqByte(13); - // シークオフセット + // Seek offset nOffset = GetReqLong(18); - // ファイルシステム呼び出し + // Call filesystem nResult = FS_Seek((DWORD)pFcb, &fcb, nMode, nOffset); - // 結果の反映 + // Apply results if (nResult >= 0) { SetFcb(pFcb, &fcb); } @@ -1978,15 +1978,15 @@ DWORD Seek(void) //--------------------------------------------------------------------------- // -// $4F - ファイル時刻取得/設定 +// $4F - Get/set file timestamp // // in (offset size) // 18 1.W DATE // 20 1.W TIME -// 22 1.L FCB構造体アドレス +// 22 1.L FCB struct address // -// FCBが読み込みモードで開かれた状態でも設定変更が可能。 -// FCBだけでは書き込み禁止の判定ができないので注意。 +// Possible to change settings when FCB is opened in read mode too. +// Note: Cannot make the judgement of read-only with only FCB // //--------------------------------------------------------------------------- DWORD TimeStamp(void) @@ -1999,17 +1999,17 @@ DWORD TimeStamp(void) ASSERT(this); ASSERT(fs); - // FCB獲得 + // Get FCB pFcb = GetReqAddr(22); GetFcb(pFcb, &fcb); - // 時刻獲得 + // Get timestamp nTime = GetReqLong(18); - // ファイルシステム呼び出し + // Call filesystem nResult = FS_TimeStamp((DWORD)pFcb, &fcb, nTime); - // 結果の反映 + // Apply results if (nResult < 0xFFFF0000) { SetFcb(pFcb, &fcb); } @@ -2019,27 +2019,27 @@ DWORD TimeStamp(void) //--------------------------------------------------------------------------- // -// $50 - 容量取得 +// $50 - Get capacity // // in (offset size) -// 0 1.b 定数(26) -// 1 1.b ユニット番号 -// 2 1.b コマンド($50/$d0) -// 14 1.l バッファアドレス +// 0 1.b constant (26) +// 1 1.b unit number +// 2 1.b command ($50/$d0) +// 14 1.l buffer address // out (offset size) -// 3 1.b エラーコード(下位) -// 4 1.b 〃 (上位) -// 18 1.l リザルトステータス +// 3 1.b error code (lower) +// 4 1.b '' (upper) +// 18 1.l result status // -// メディアの総容量/空き容量、クラスタ/セクタサイズを収得する. バッファ -// に書き込む内容は以下の通り. リザルトステータスとして使用可能なバイト数 -// を返すこと. +// Get the total and available media capacity, as well as cluster / sector size. +// The contents to write to buffer follows. Returns number of bytes that can be +// used for result status. // // (offset size) -// 0 1.w 使用可能なクラスタ数 -// 2 1.w 総クラスタ数 -// 4 1.w 1 クラスタ当りのセクタ数 -// 6 1.w 1 セクタ当りのバイト数 +// 0 1.w available number of clusters +// 2 1.w total number of clusters +// 4 1.w number of sectors per 1 cluster +// 6 1.w number of bytes per 1 sector // //--------------------------------------------------------------------------- DWORD GetCapacity(void) @@ -2051,14 +2051,14 @@ DWORD GetCapacity(void) ASSERT(this); ASSERT(fs); - // バッファ取得 + // Get buffer pCapacity = GetReqAddr(14); #if 0 - // ファイルシステム呼び出し + // Call filesystem nResult = FS_GetCapacity(&cap); #else - // いつも同じ内容が返ってくるのでスキップしてみる + // Try skipping since the contents are always returned cap.freearea = 0xFFFF; cap.clusters = 0xFFFF; cap.sectors = 64; @@ -2066,7 +2066,7 @@ DWORD GetCapacity(void) nResult = 0x7FFF8000; #endif - // 結果の反映 + // Apply results if (nResult >= 0) { SetCapacity(pCapacity, &cap); } @@ -2076,11 +2076,11 @@ DWORD GetCapacity(void) //--------------------------------------------------------------------------- // -// $51 - ドライブ状態検査/制御 +// $51 - Inspect/control drive status // // in (offset size) -// 1 1.B ユニット番号 -// 13 1.B 状態 0: 状態検査 1: イジェクト +// 1 1.B unit number +// 13 1.B status 0: status inspection 1: eject // //--------------------------------------------------------------------------- DWORD CtrlDrive(void) @@ -2091,13 +2091,13 @@ DWORD CtrlDrive(void) ASSERT(this); ASSERT(fs); - // ドライブ状態取得 + // Get drive status ctrl.status = GetReqByte(13); - // ファイルシステム呼び出し + // Call filesystem nResult = FS_CtrlDrive(&ctrl); - // 結果の反映 + // Apply results if (nResult >= 0) { SetReqByte(13, ctrl.status); } @@ -2107,42 +2107,42 @@ DWORD CtrlDrive(void) //--------------------------------------------------------------------------- // -// $52 - DPB取得 +// $52 - Get DPB // // in (offset size) -// 0 1.b 定数(26) -// 1 1.b ユニット番号 -// 2 1.b コマンド($52/$d2) -// 14 1.l バッファアドレス(先頭アドレス + 2 を指す) +// 0 1.b constant (26) +// 1 1.b unit number +// 2 1.b command ($52/$d2) +// 14 1.l buffer address (points at starting address + 2) // out (offset size) -// 3 1.b エラーコード(下位) -// 4 1.b 〃 (上位) -// 18 1.l リザルトステータス +// 3 1.b error code (lower) +// 4 1.b '' (upper) +// 18 1.l result status // -// 指定メディアの情報を v1 形式 DPB で返す. このコマンドで設定する必要 -// がある情報は以下の通り(括弧内は DOS コールが設定する). ただし、バッフ -// ァアドレスはオフセット 2 を指したアドレスが渡されるので注意すること. +// Specified media data is returned as DPB v1. Data needed to be set +// for this command are as follows (parantheses indicate what's set by DOS calls.) +// Note that the buffer adress is what's pointed at by offset 2. // // (offset size) -// 0 1.b (ドライブ番号) -// 1 1.b (ユニット番号) -// 2 1.w 1 セクタ当りのバイト数 -// 4 1.b 1 クラスタ当りのセクタ数 - 1 -// 5 1.b クラスタ→セクタのシフト数 -// bit 7 = 1 で MS-DOS 形式 FAT(16bit Intel 配列) -// 6 1.w FAT の先頭セクタ番号 -// 8 1.b FAT 領域の個数 -// 9 1.b FAT の占めるセクタ数(複写分を除く) -// 10 1.w ルートディレクトリに入るファイルの個数 -// 12 1.w データ領域の先頭セクタ番号 -// 14 1.w 総クラスタ数 + 1 -// 16 1.w ルートディレクトリの先頭セクタ番号 -// 18 1.l (ドライバヘッダのアドレス) -// 22 1.b (小文字の物理ドライブ名) -// 23 1.b (DPB 使用フラグ:常に 0) -// 24 1.l (次の DPB のアドレス) -// 28 1.w (カレントディレクトリのクラスタ番号:常に 0) -// 30 64.b (カレントディレクトリ名) +// 0 1.b (drive number) +// 1 1.b (unit number) +// 2 1.w number of bytes per 1 sector +// 4 1.b number of sectors - 1 per 1 cluster +// 5 1.b Number of cluster -> sector +// bit 7 = 1 in MS-DOS format FAT (16bit Intel array) +// 6 1.w FAT first sector number +// 8 1.b Number of FAT allocations +// 9 1.b Number of FAT controlled sectors (excluding duplicates) +// 10 1.w Number of files in the root directory +// 12 1.w First sector number of data memory +// 14 1.w Total number of clusters + 1 +// 16 1.w First sector number of root directory +// 18 1.l (Driver head address) +// 22 1.b (Physical drive name in lower-case) +// 23 1.b (DPB usage flag: normally 0) +// 24 1.l (Next DPB address) +// 28 1.w (Cluster number of current directory: normally 0) +// 30 64.b (Current directory name) // //--------------------------------------------------------------------------- DWORD GetDPB(void) @@ -2154,13 +2154,13 @@ DWORD GetDPB(void) ASSERT(this); ASSERT(fs); - // DPB取得 + // Get DPB pDpb = GetReqAddr(14); - // ファイルシステム呼び出し + // Call filesystem nResult = FS_GetDPB(&dpb); - // 結果の反映 + // Apply results if (nResult >= 0) { SetDpb(pDpb, &dpb); } @@ -2170,13 +2170,13 @@ DWORD GetDPB(void) //--------------------------------------------------------------------------- // -// $53 - セクタ読み込み +// $53 - Read sector // // in (offset size) -// 1 1.B ユニット番号 -// 14 1.L バッファアドレス -// 18 1.L セクタ数 -// 22 1.L セクタ番号 +// 1 1.B unit number +// 14 1.L buffer address +// 18 1.L number of sectors +// 22 1.L sector number // //--------------------------------------------------------------------------- DWORD DiskRead(void) @@ -2191,14 +2191,14 @@ DWORD DiskRead(void) ASSERT(this); ASSERT(fs); - pAddress = GetReqAddr(14); // アドレス (上位ビットが拡張フラグ) - nSize = GetReqLong(18); // セクタ数 - nSector = GetReqLong(22); // セクタ番号 + pAddress = GetReqAddr(14); // Address (upper bit is extension flag) + nSize = GetReqLong(18); // Number of sectors + nSector = GetReqLong(22); // Sector number - // ファイルシステム呼び出し + // Call filesystem nResult = FS_DiskRead(buffer, nSector, nSize); - // 結果の反映 + // Apply results if (nResult >= 0) { for (i = 0; i < sizeof(buffer); i++) { *pAddress = buffer[i]; @@ -2211,13 +2211,13 @@ DWORD DiskRead(void) //--------------------------------------------------------------------------- // -// $54 - セクタ書き込み +// $54 - Write sector // // in (offset size) -// 1 1.B ユニット番号 -// 14 1.L バッファアドレス -// 18 1.L セクタ数 -// 22 1.L セクタ番号 +// 1 1.B unit number +// 14 1.L buffer address +// 18 1.L number of sectors +// 22 1.L sector number // //--------------------------------------------------------------------------- DWORD DiskWrite(void) @@ -2230,11 +2230,11 @@ DWORD DiskWrite(void) ASSERT(this); ASSERT(fs); - pAddress = GetReqAddr(14); // アドレス(上位ビットが拡張フラグ) - nSize = GetReqLong(18); // セクタ数 - nSector = GetReqLong(22); // セクタ番号 + pAddress = GetReqAddr(14); // Address (upper bit is extension flag) + nSize = GetReqLong(18); // Number of sectors + nSector = GetReqLong(22); // Sector number - // ファイルシステム呼び出し + // Call filesystem nResult = FS_DiskWrite(); return nResult; @@ -2245,9 +2245,9 @@ DWORD DiskWrite(void) // $55 - IOCTRL // // in (offset size) -// 1 1.B ユニット番号 -// 14 1.L パラメータ -// 18 1.W 機能番号 +// 1 1.B unit number +// 14 1.L parameter +// 18 1.W feature number // //--------------------------------------------------------------------------- DWORD Ioctrl(void) @@ -2260,15 +2260,15 @@ DWORD Ioctrl(void) ASSERT(this); ASSERT(fs); - // IOCTRL取得 - param = GetReqLong(14); // パラメータ - func = GetReqWord(18); // 機能番号 + // Get IOCTRL + param = GetReqLong(14); // Parameter + func = GetReqWord(18); // Feature number GetIoctrl(param, func, &ioctrl); - // ファイルシステム呼び出し + // Call filesystem nResult = FS_Ioctrl(func, &ioctrl); - // 結果の反映 + // Apply results if (nResult >= 0) SetIoctrl(param, func, &ioctrl); @@ -2277,10 +2277,10 @@ DWORD Ioctrl(void) //--------------------------------------------------------------------------- // -// $56 - フラッシュ +// $56 - Flush // // in (offset size) -// 1 1.B ユニット番号 +// 1 1.b unit number // //--------------------------------------------------------------------------- DWORD Flush(void) @@ -2290,7 +2290,7 @@ DWORD Flush(void) ASSERT(this); ASSERT(fs); - // ファイルシステム呼び出し + // Call filesystem nResult = FS_Flush(); return nResult; @@ -2298,19 +2298,19 @@ DWORD Flush(void) //--------------------------------------------------------------------------- // -// $57 - メディア交換チェック +// $57 - Media change check // // in (offset size) -// 0 1.b 定数(26) -// 1 1.b ユニット番号 -// 2 1.b コマンド($57/$d7) +// 0 1.b constant (26) +// 1 1.b unit number +// 2 1.b Command ($57/$d7) // out (offset size) -// 3 1.b エラーコード(下位) -// 4 1.b 〃 (上位) -// 18 1.l リザルトステータス +// 3 1.b error code (lower) +// 4 1.b '' (upper) +// 18 1.l result status // -// メディアが交換されたか否かを調べる. 交換されていた場合のフォーマット -// 確認はこのコマンド内で行うこと. +// Checks if the media has been changed or not. Format if it has changed. +// The verification is done within this command. // //--------------------------------------------------------------------------- DWORD CheckMedia(void) @@ -2320,7 +2320,7 @@ DWORD CheckMedia(void) ASSERT(this); ASSERT(fs); - // ファイルシステム呼び出し + // Call filesystem nResult = FS_CheckMedia(); return nResult; @@ -2328,10 +2328,10 @@ DWORD CheckMedia(void) //--------------------------------------------------------------------------- // -// $58 - 排他制御 +// $58 - Lock // // in (offset size) -// 1 1.B ユニット番号 +// 1 1.b unit number // //--------------------------------------------------------------------------- DWORD Lock(void) @@ -2341,7 +2341,7 @@ DWORD Lock(void) ASSERT(this); ASSERT(fs); - // ファイルシステム呼び出し + // Call filesystem nResult = FS_Lock(); return nResult; @@ -2349,50 +2349,50 @@ DWORD Lock(void) //--------------------------------------------------------------------------- // -// コマンド実行 +// Execute command // //--------------------------------------------------------------------------- DWORD ExecuteCommand() { ASSERT(this); - // エラー情報クリア + // Clear error data SetReqByte(3, 0); SetReqByte(4, 0); - // コマンド番号 - command = (DWORD)GetReqByte(2); // ビット7はベリファイフラグ + // Command number + command = (DWORD)GetReqByte(2); // Bit 7 is verify flag - // ユニット番号 + // Unit number unit = GetReqByte(1); - // コマンド分岐 + // Command branching switch (command & 0x7F) { - case 0x40: return InitDevice(); // $40 - デバイス起動 - case 0x41: return CheckDir(); // $41 - ディレクトリチェック - case 0x42: return MakeDir(); // $42 - ディレクトリ作成 - case 0x43: return RemoveDir(); // $43 - ディレクトリ削除 - case 0x44: return Rename(); // $44 - ファイル名変更 - case 0x45: return Delete(); // $45 - ファイル削除 - case 0x46: return Attribute(); // $46 - ファイル属性取得/設定 - case 0x47: return Files(); // $47 - ファイル検索 - case 0x48: return NFiles(); // $48 - ファイル次検索 - case 0x49: return Create(); // $49 - ファイル作成 - case 0x4A: return Open(); // $4A - ファイルオープン - case 0x4B: return Close(); // $4B - ファイルクローズ - case 0x4C: return Read(); // $4C - ファイル読み込み - case 0x4D: return Write(); // $4D - ファイル書き込み - case 0x4E: return Seek(); // $4E - ファイルシーク - case 0x4F: return TimeStamp(); // $4F - ファイル更新時刻の取得/設定 - case 0x50: return GetCapacity();// $50 - 容量取得 - case 0x51: return CtrlDrive(); // $51 - ドライブ制御/状態検査 - case 0x52: return GetDPB(); // $52 - DPB取得 - case 0x53: return DiskRead(); // $53 - セクタ読み込み - case 0x54: return DiskWrite(); // $54 - セクタ書き込み + case 0x40: return InitDevice(); // $40 - Device startup + case 0x41: return CheckDir(); // $41 - Directory check + case 0x42: return MakeDir(); // $42 - Create directory + case 0x43: return RemoveDir(); // $43 - Delete directory + case 0x44: return Rename(); // $44 - Change file name + case 0x45: return Delete(); // $45 - Delete file + case 0x46: return Attribute(); // $46 - Get / set file attribute + case 0x47: return Files(); // $47 - Find file + case 0x48: return NFiles(); // $48 - Find next file + case 0x49: return Create(); // $49 - Create file + case 0x4A: return Open(); // $4A - Open file + case 0x4B: return Close(); // $4B - Close file + case 0x4C: return Read(); // $4C - Read file + case 0x4D: return Write(); // $4D - Write file + case 0x4E: return Seek(); // $4E - Seek file + case 0x4F: return TimeStamp(); // $4F - Get / set file timestamp + case 0x50: return GetCapacity();// $50 - Get capacity + case 0x51: return CtrlDrive(); // $51 - Inspect / control drive status + case 0x52: return GetDPB(); // $52 - Get DPB + case 0x53: return DiskRead(); // $53 - Read sectors + case 0x54: return DiskWrite(); // $54 - Write sectors case 0x55: return Ioctrl(); // $55 - IOCTRL - case 0x56: return Flush(); // $56 - フラッシュ - case 0x57: return CheckMedia(); // $57 - メディア交換チェック - case 0x58: return Lock(); // $58 - 排他制御 + case 0x56: return Flush(); // $56 - Flush + case 0x57: return CheckMedia(); // $57 - Media change check + case 0x58: return Lock(); // $58 - Lock } return FS_FATAL_INVALIDCOMMAND; @@ -2400,7 +2400,7 @@ DWORD ExecuteCommand() //--------------------------------------------------------------------------- // -// 初期化 +// Initialization // //--------------------------------------------------------------------------- BOOL Init() @@ -2412,7 +2412,7 @@ BOOL Init() //--------------------------------------------------------------------------- // -// 実行 +// Execution // //--------------------------------------------------------------------------- void Process(DWORD nA5) @@ -2422,9 +2422,9 @@ void Process(DWORD nA5) ASSERT(m_bAlloc); ASSERT(m_bFree); - // リクエストヘッダのアドレス + // Request header address request = (BYTE*)nA5; - // コマンド実行 + // Command execution SetResult(ExecuteCommand()); } diff --git a/src/x68k/RASDRV/BRIDGE.H b/src/x68k/RASDRV/BRIDGE.H index b59c642d..1d531583 100644 --- a/src/x68k/RASDRV/BRIDGE.H +++ b/src/x68k/RASDRV/BRIDGE.H @@ -3,9 +3,9 @@ // SCSI Target Emulator RaSCSI (*^..^*) // for Raspberry Pi // -// Powered by XM6 TypeG Technorogy. +// Powered by XM6 TypeG Technology. // Copyright (C) 2016-2017 GIMONS -// [ ホストファイルシステム ブリッジドライバ ] +// [ Host Filesystem Bridge Driver ] // //--------------------------------------------------------------------------- @@ -30,7 +30,7 @@ typedef int BOOL; //--------------------------------------------------------------------------- // -// 定数定義 +// Constant definitions // //--------------------------------------------------------------------------- #define FILEPATH_MAX _MAX_PATH @@ -38,219 +38,218 @@ typedef int BOOL; //--------------------------------------------------------------------------- // -// ステータスコード定義 +// Status code definitions // //--------------------------------------------------------------------------- -#define FS_INVALIDFUNC 0xFFFFFFFF // 無効なファンクションコードを実行した -#define FS_FILENOTFND 0xFFFFFFFE // 指定したファイルが見つからない -#define FS_DIRNOTFND 0xFFFFFFFD // 指定したディレクトリが見つからない -#define FS_OVEROPENED 0xFFFFFFFC // オープンしているファイルが多すぎる -#define FS_CANTACCESS 0xFFFFFFFB // ディレクトリやボリュームラベルはアクセス不可 -#define FS_NOTOPENED 0xFFFFFFFA // 指定したハンドルはオープンされていない -#define FS_INVALIDMEM 0xFFFFFFF9 // メモリ管理領域が破壊された -#define FS_OUTOFMEM 0xFFFFFFF8 // 実行に必要なメモリがない -#define FS_INVALIDPTR 0xFFFFFFF7 // 無効なメモリ管理ポインタを指定した -#define FS_INVALIDENV 0xFFFFFFF6 // 不正な環境を指定した -#define FS_ILLEGALFMT 0xFFFFFFF5 // 実行ファイルのフォーマットが異常 -#define FS_ILLEGALMOD 0xFFFFFFF4 // オープンのアクセスモードが異常 -#define FS_INVALIDPATH 0xFFFFFFF3 // ファイル名の指定に誤りがある -#define FS_INVALIDPRM 0xFFFFFFF2 // 無効なパラメータでコールした -#define FS_INVALIDDRV 0xFFFFFFF1 // ドライブ指定に誤りがある -#define FS_DELCURDIR 0xFFFFFFF0 // カレントディレクトリは削除できない -#define FS_NOTIOCTRL 0xFFFFFFEF // IOCTRLできないデバイス -#define FS_LASTFILE 0xFFFFFFEE // これ以上ファイルが見つからない -#define FS_CANTWRITE 0xFFFFFFED // 指定のファイルは書き込みできない -#define FS_DIRALREADY 0xFFFFFFEC // 指定のディレクトリは既に登録されている -#define FS_CANTDELETE 0xFFFFFFEB // ファイルがあるので削除できない -#define FS_CANTRENAME 0xFFFFFFEA // ファイルがあるのでリネームできない -#define FS_DISKFULL 0xFFFFFFE9 // ディスクが一杯でファイルが作れない -#define FS_DIRFULL 0xFFFFFFE8 // ディレクトリが一杯でファイルが作れない -#define FS_CANTSEEK 0xFFFFFFE7 // 指定の位置にはシークできない -#define FS_SUPERVISOR 0xFFFFFFE6 // スーパーバイザ状態でスーパバイザ指定した -#define FS_THREADNAME 0xFFFFFFE5 // 同じスレッド名が存在する -#define FS_BUFWRITE 0xFFFFFFE4 // プロセス間通信のバッファが書込み禁止 -#define FS_BACKGROUND 0xFFFFFFE3 // バックグラウンドプロセスを起動できない -#define FS_OUTOFLOCK 0xFFFFFFE0 // ロック領域が足りない -#define FS_LOCKED 0xFFFFFFDF // ロックされていてアクセスできない -#define FS_DRIVEOPENED 0xFFFFFFDE // 指定のドライブはハンドラがオープンされている -#define FS_LINKOVER 0xFFFFFFDD // シンボリックリンクネストが16回を超えた -#define FS_FILEEXIST 0xFFFFFFB0 // ファイルが存在する +#define FS_INVALIDFUNC 0xFFFFFFFF // Executed an invalid function +#define FS_FILENOTFND 0xFFFFFFFE // The selected file can not be found +#define FS_DIRNOTFND 0xFFFFFFFD // The selected directory can not be found +#define FS_OVEROPENED 0xFFFFFFFC // There are too many files open +#define FS_CANTACCESS 0xFFFFFFFB // Can not access the direcory or volume +#define FS_NOTOPENED 0xFFFFFFFA // The selected handle is not opened +#define FS_INVALIDMEM 0xFFFFFFF9 // Memory management has been destroyed +#define FS_OUTOFMEM 0xFFFFFFF8 // Insufficient memory for execution +#define FS_INVALIDPTR 0xFFFFFFF7 // Selected an invalid memory management pointer +#define FS_INVALIDENV 0xFFFFFFF6 // Selected an invalid environment +#define FS_ILLEGALFMT 0xFFFFFFF5 // The exeucted file is in an invalid format +#define FS_ILLEGALMOD 0xFFFFFFF4 // Invalid open access mode +#define FS_INVALIDPATH 0xFFFFFFF3 // Mistake in selected file name +#define FS_INVALIDPRM 0xFFFFFFF2 // Called with an invalid parameter +#define FS_INVALIDDRV 0xFFFFFFF1 // Mistake in selected drive +#define FS_DELCURDIR 0xFFFFFFF0 // Unable to delete the current directory +#define FS_NOTIOCTRL 0xFFFFFFEF // Unable to use IOCTRL with the device +#define FS_LASTFILE 0xFFFFFFEE // Can not find any more files +#define FS_CANTWRITE 0xFFFFFFED // Selected file can not be written +#define FS_DIRALREADY 0xFFFFFFEC // Selected directory is already registered +#define FS_CANTDELETE 0xFFFFFFEB // Can not delete because of a file +#define FS_CANTRENAME 0xFFFFFFEA // Can not rename because of a file +#define FS_DISKFULL 0xFFFFFFE9 // Can not create a file because the disk is full +#define FS_DIRFULL 0xFFFFFFE8 // Can not create a file because the directory is full +#define FS_CANTSEEK 0xFFFFFFE7 // Can not seek in the selected location +#define FS_SUPERVISOR 0xFFFFFFE6 // Selected supervisor in supervisor mode +#define FS_THREADNAME 0xFFFFFFE5 // A thread with this name already exists +#define FS_BUFWRITE 0xFFFFFFE4 // Writing to inter-process communication buffers is disallowed +#define FS_BACKGROUND 0xFFFFFFE3 // Unable to start a background process +#define FS_OUTOFLOCK 0xFFFFFFE0 // Insufficient lock space +#define FS_LOCKED 0xFFFFFFDF // Can not access because it is locked +#define FS_DRIVEOPENED 0xFFFFFFDE // Selected drive has an open handler +#define FS_LINKOVER 0xFFFFFFDD // The symbolic link is nested over 16 times +#define FS_FILEEXIST 0xFFFFFFB0 // The file exists -#define FS_FATAL_MEDIAOFFLINE 0xFFFFFFA3 // メディアが入っていない -#define FS_FATAL_WRITEPROTECT 0xFFFFFFA2 // 書き込み禁止違反 -#define FS_FATAL_INVALIDCOMMAND 0xFFFFFFA1 // 不正なコマンド番号 -#define FS_FATAL_INVALIDUNIT 0xFFFFFFA0 // 不正なユニット番号 +#define FS_FATAL_MEDIAOFFLINE 0xFFFFFFA3 // No media inserted +#define FS_FATAL_WRITEPROTECT 0xFFFFFFA2 // Write protected +#define FS_FATAL_INVALIDCOMMAND 0xFFFFFFA1 // Invalid command number +#define FS_FATAL_INVALIDUNIT 0xFFFFFFA0 // Invalid unit number -#define HUMAN68K_PATH_MAX 96 // Human68kのパス最大長 +#define HUMAN68K_PATH_MAX 96 // Longest path allowed in Human68k //=========================================================================== // -/// Human68k 名前空間 +/// Human68k name space // //=========================================================================== -/// ファイル属性ビット +/// File attribute bit enum attribute_t { - AT_READONLY = 0x01, // 読み込み専用属性 - AT_HIDDEN = 0x02, // 隠し属性 - AT_SYSTEM = 0x04, // システム属性 - AT_VOLUME = 0x08, // ボリュームラベル属性 - AT_DIRECTORY= 0x10, // ディレクトリ属性 - AT_ARCHIVE = 0x20, // アーカイブ属性 - AT_ALL = 0xFF, // 全ての属性ビットが1 + AT_READONLY = 0x01, // Read only attribute + AT_HIDDEN = 0x02, // Hidden attribute + AT_SYSTEM = 0x04, // System attribute + AT_VOLUME = 0x08, // Volume label attribute + AT_DIRECTORY = 0x10, // Directory attribute + AT_ARCHIVE = 0x20, // Archive attribute + AT_ALL = 0xFF, // All attribute bits are 1 }; -/// ファイルオープンモード +/// File open modes enum open_t { - OP_READ = 0, // 読み込み - OP_WRITE = 1, // 書き込み - OP_FULL = 2, // 読み書き - OP_MASK = 0x0F, // 判定用マスク - OP_SHARE_NONE = 0x10, // 共有禁止 - OP_SHARE_READ = 0x20, // 読み込み共有 - OP_SHARE_WRITE = 0x30, // 書き込み共有 - OP_SHARE_FULL = 0x40, // 読み書き共有 - OP_SHARE_MASK = 0x70, // 共有判定用マスク - OP_SPECIAL = 0x100,// 辞書アクセス + OP_READ = 0, // Read + OP_WRITE = 1, // Write + OP_FULL = 2, // Read/Write + OP_MASK = 0x0F, // Decision mask + OP_SHARE_NONE = 0x10, // Sharing forbidden + OP_SHARE_READ = 0x20, // Read sharing + OP_SHARE_WRITE = 0x30, // Write sharing + OP_SHARE_FULL = 0x40, // Read/Write sharing + OP_SHARE_MASK = 0x70, // Sharing decision mask + OP_SPECIAL = 0x100, // Dictionary access }; -/// シーク種類 +/// Seek types enum seek_t { - SK_BEGIN = 0, // ファイル先頭から - SK_CURRENT = 1, // 現在位置から - SK_END = 2, // ファイル末尾から + SK_BEGIN = 0, // From the beginning of a file + SK_CURRENT = 1, // From the current location + SK_END = 2, // From the end of the file }; -/// メディアバイト +/// Media byte enum media_t { - MEDIA_2DD_10 = 0xE0, // 2DD/10セクタ - MEDIA_1D_9 = 0xE5, // 1D/9セクタ - MEDIA_2D_9 = 0xE6, // 2D/9セクタ - MEDIA_1D_8 = 0xE7, // 1D/8セクタ - MEDIA_2D_8 = 0xE8, // 2D/8セクタ - MEDIA_2HT = 0xEA, // 2HT - MEDIA_2HS = 0xEB, // 2HS - MEDIA_2HDE = 0xEC, // 2DDE - MEDIA_1DD_9 = 0xEE, // 1DD/9セクタ - MEDIA_1DD_8 = 0xEF, // 1DD/8セクタ - MEDIA_MANUAL = 0xF1, // リモートドライブ (手動イジェクト) - MEDIA_REMOVABLE = 0xF2, // リモートドライブ (リムーバブル) - MEDIA_REMOTE = 0xF3, // リモートドライブ - MEDIA_DAT = 0xF4, // SCSI-DAT - MEDIA_CDROM = 0xF5, // SCSI-CDROM - MEDIA_MO = 0xF6, // SCSI-MO - MEDIA_SCSI_HD = 0xF7, // SCSI-HD - MEDIA_SASI_HD = 0xF8, // SASI-HD - MEDIA_RAMDISK = 0xF9, // RAMディスク - MEDIA_2HQ = 0xFA, // 2HQ - MEDIA_2DD_8 = 0xFB, // 2DD/8セクタ - MEDIA_2DD_9 = 0xFC, // 2DD/9セクタ - MEDIA_2HC = 0xFD, // 2HC - MEDIA_2HD = 0xFE, // 2HD + MEDIA_2DD_10 = 0xE0, // 2DD/10 sector + MEDIA_1D_9 = 0xE5, // 1D/9 sector + MEDIA_2D_9 = 0xE6, // 2D/9 sector + MEDIA_1D_8 = 0xE7, // 1D/8 sector + MEDIA_2D_8 = 0xE8, // 2D/8 sector + MEDIA_2HT = 0xEA, // 2HT + MEDIA_2HS = 0xEB, // 2HS + MEDIA_2HDE = 0xEC, // 2DDE + MEDIA_1DD_9 = 0xEE, // 1DD/9 sector + MEDIA_1DD_8 = 0xEF, // 1DD/8 sector + MEDIA_MANUAL = 0xF1, // Remote drive (manual eject) + MEDIA_REMOVABLE = 0xF2, // Remote drive (removable) + MEDIA_REMOTE = 0xF3, // Remote drive + MEDIA_DAT = 0xF4, // SCSI-DAT + MEDIA_CDROM = 0xF5, // SCSI-CDROM + MEDIA_MO = 0xF6, // SCSI-MO + MEDIA_SCSI_HD = 0xF7, // SCSI-HD + MEDIA_SASI_HD = 0xF8, // SASI-HD + MEDIA_RAMDISK = 0xF9, // RAM disk + MEDIA_2HQ = 0xFA, // 2HQ + MEDIA_2DD_8 = 0xFB, // 2DD/8 sector + MEDIA_2DD_9 = 0xFC, // 2DD/9 sector + MEDIA_2HC = 0xFD, // 2HC + MEDIA_2HD = 0xFE, // 2HD }; -/// namests構造体 +/// namests struct typedef struct { - BYTE wildcard; // ワイルドカード文字数 - BYTE drive; // ドライブ番号 - BYTE path[65]; // パス(サブディレクトリ+/) - BYTE name[8]; // ファイル名 (PADDING 0x20) - BYTE ext[3]; // 拡張子 (PADDING 0x20) - BYTE add[10]; // ファイル名追加 (PADDING 0x00) + BYTE wildcard; // Wildcard character length + BYTE drive; // Drive number + BYTE path[65]; // Path (subdirectory +/) + BYTE name[8]; // File name (PADDING 0x20) + BYTE ext[3]; // Extension (PADDING 0x20) + BYTE add[10]; // File name addition (PADDING 0x00) } namests_t; -/// files構造体 +/// files struct typedef struct { - BYTE fatr; // + 0 検索する属性 読込専用 + BYTE fatr; // + 0 search attribute; read-only BYTE pad1[3]; // padding -// BYTE drive; // + 1 ドライブ番号 読込専用 - DWORD sector; // + 2 ディレクトリのセクタ DOS _FILES先頭アドレスで代用 -// WORD cluster; // + 6 ディレクトリのクラスタ 詳細不明 (未使用) - WORD offset; // + 8 ディレクトリエントリ 書込専用 -// BYTE name[8]; // +10 作業用ファイル名 読込専用 (未使用) -// BYTE ext[3]; // +18 作業用拡張子 読込専用 (未使用) - BYTE attr; // +21 ファイル属性 書込専用 +// BYTE drive; // + 1 drive number; read-only + DWORD sector; // + 2 directory sector; DOS _FILES first address substitute +// WORD cluster; // + 6 directory cluster; details unknown (unused) + WORD offset; // + 8 directory entry; write-only +// BYTE name[8]; // +10 working file name; write-only (unused) +// BYTE ext[3]; // +18 working extension; write-only (unused) + BYTE attr; // +21 file attribute; write-only BYTE pad2; // padding - WORD time; // +22 最終変更時刻 書込専用 - WORD date; // +24 最終変更月日 書込専用 - DWORD size; // +26 ファイルサイズ 書込専用 - BYTE full[23]; // +30 フルファイル名 書込専用 + WORD time; // +22 last change time of day; write-only + WORD date; // +24 last change date; write-only + DWORD size; // +26 file size; write-only + BYTE full[23]; // +30 full name; write-only BYTE pad3; // padding } files_t; /// FCB構造体 typedef struct { -// BYTE pad00[6]; // + 0〜+ 5 (未使用) - DWORD fileptr; // + 6〜+ 9 ファイルポインタ -// BYTE pad01[4]; // +10〜+13 (未使用) - WORD mode; // +14〜+15 オープンモード -// BYTE pad02[16]; // +16〜+31 (未使用) -// DWORD zero; // +32〜+35 オープンのとき0が書き込まれている (未使用) -// BYTE name[8]; // +36〜+43 ファイル名 (PADDING 0x20) (未使用) -// BYTE ext[3]; // +44〜+46 拡張子 (PADDING 0x20) (未使用) - BYTE attr; // +47 ファイル属性 - BYTE pad; // padding -// BYTE add[10]; // +48〜+57 ファイル名追加 (PADDING 0x00) (未使用) - WORD time; // +58〜+59 最終変更時刻 - WORD date; // +60〜+61 最終変更月日 -// WORD cluster; // +62〜+63 クラスタ番号 (未使用) - DWORD size; // +64〜+67 ファイルサイズ -// BYTE pad03[28]; // +68〜+95 FATキャッシュ (未使用) +// BYTE pad00[6]; // + 0~+ 5 (unused) + DWORD fileptr; // + 6~+ 9 file pointer +// BYTE pad01[4]; // +10~+13 (unused) + WORD mode; // +14~+15 open mode +// BYTE pad02[16]; // +16~+31 (unused) +// DWORD zero; // +32~+35 zeros are written when opened (unused) +// BYTE name[8]; // +36~+43 file name (PADDING 0x20) (unused) +// BYTE ext[3]; // +44~+46 extension (PADDING 0x20) (unused) + BYTE attr; // +47 file attribute +// BYTE add[10]; // +48~+57 file name addition (PADDING 0x00) (unused) + WORD time; // +58~+59 last change time of day + WORD date; // +60~+61 last change date +// WORD cluster; // +62~+63 cluster number (unused) + DWORD size; // +64~+67 file size +// BYTE pad03[28]; // +68~+95 FAT cache (unused) } fcb_t; -/// capacity構造体 +/// capacity struct typedef struct { - WORD freearea; // + 0 使用可能なクラスタ数 - WORD clusters; // + 2 総クラスタ数 - WORD sectors; // + 4 クラスタあたりのセクタ数 - WORD bytes; // + 6 セクタ当たりのバイト数 + WORD freearea; // + 0 Number of available clusters + WORD clusters; // + 2 Total number of clusters + WORD sectors; // + 4 Number of sectors per cluster + WORD bytes; // + 6 Number of bytes per sector } capacity_t; -/// ctrldrive構造体 +/// ctrldrive struct typedef struct { - BYTE status; // +13 状態 + BYTE status; // +13 status BYTE pad[3]; // padding } ctrldrive_t; -/// DPB構造体 +/// DPB struct typedef struct { - WORD sector_size; // + 0 1セクタ当りのバイト数 - BYTE cluster_size; // + 2 1クラスタ当りのセクタ数-1 - BYTE shift; // + 3 クラスタ→セクタのシフト数 - WORD fat_sector; // + 4 FATの先頭セクタ番号 - BYTE fat_max; // + 6 FAT領域の個数 - BYTE fat_size; // + 7 FATの占めるセクタ数(複写分を除く) - WORD file_max; // + 8 ルートディレクトリに入るファイルの個数 - WORD data_sector; // +10 データ領域の先頭セクタ番号 - WORD cluster_max; // +12 総クラスタ数+1 - WORD root_sector; // +14 ルートディレクトリの先頭セクタ番号 -// DWORD driverentry; // +16 デバイスドライバへのポインタ (未使用) - BYTE media; // +20 メディア識別子 -// BYTE flag; // +21 DPB使用フラグ (未使用) - BYTE pad; // padding + WORD sector_size; // + 0 Number of bytes in one sector + BYTE cluster_size; // + 2 Number sectors in one cluster -1 + BYTE shift; // + 3 Number of cluster→sector shifts + WORD fat_sector; // + 4 FAT first sector number + BYTE fat_max; // + 6 FAT storage quantity + BYTE fat_size; // + 7 FAT controlled sector number (excluding duplicates) + WORD file_max; // + 8 Number of files in the root directory + WORD data_sector; // +10 First sector number of data storage + WORD cluster_max; // +12 Total number of clusters +1 + WORD root_sector; // +14 First sector number of root directory +// DWORD driverentry; // +16 Device driver pointer (unused) + BYTE media; // +20 Media identifier +// BYTE flag; // +21 Flag used by DPB (unused) + BYTE pad; // padding } dpb_t; -/// ディレクトリエントリ構造体 +/// Directory entry struct typedef struct { - BYTE name[8]; // + 0 ファイル名 (PADDING 0x20) - BYTE ext[3]; // + 8 拡張子 (PADDING 0x20) - BYTE attr; // +11 ファイル属性 - BYTE add[10]; // +12 ファイル名追加 (PADDING 0x00) - WORD time; // +22 最終変更時刻 - WORD date; // +24 最終変更月日 - WORD cluster; // +26 クラスタ番号 - DWORD size; // +28 ファイルサイズ + BYTE name[8]; // + 0 File name (PADDING 0x20) + BYTE ext[3]; // + 8 Extension (PADDING 0x20) + BYTE attr; // +11 File attribute + BYTE add[10]; // +12 File name addition (PADDING 0x00) + WORD time; // +22 Last change time of day + WORD date; // +24 Last change date + WORD cluster; // +26 Cluster number + DWORD size; // +28 File size } dirent_t; -/// IOCTRLパラメータ共用体 +/// IOCTRL parameter union typedef union { - BYTE buffer[8]; // バイト単位でのアクセス - DWORD param; // パラメータ(先頭4バイト) - WORD media; // メディアバイト(先頭2バイト) + BYTE buffer[8]; // Access in byte units + DWORD param; // Parameter (First 4 bytes) + WORD media; // Media byte (First 2 bytes) } ioctrl_t; -/// コマンドライン引数構造体 +/// Command line parameter struct typedef struct { - BYTE buf[256]; // コマンドライン引数 + BYTE buf[256]; // Command line argument } argument_t; #endif // bridge_h diff --git a/src/x68k/RASDRV/RASDRV.S b/src/x68k/RASDRV/RASDRV.S index 6cb28b1e..6eb0a848 100644 --- a/src/x68k/RASDRV/RASDRV.S +++ b/src/x68k/RASDRV/RASDRV.S @@ -3,9 +3,9 @@ * SCSI Target Emulator RaSCSI (*^..^*) * for Raspberry Pi * -* Powered by XM6 TypeG Technorogy. +* Powered by XM6 TypeG Technology. * Copyright (C) 2016-2019 GIMONS -* [ ホストファイルシステム ブリッジドライバ ] +* [ Host Filesystem Bridge Driver ] * * Based on * X68k Emulator Host Filesystem Driver version 0.27 @@ -20,19 +20,19 @@ .XREF _Init, _Process ;bridge.c -COMMAND EQU 2 コマンド番号 -ERRLOW EQU 3 エラーコード下位8ビット -ERRHIGH EQU 4 エラーコード上位8ビット -MXUNIT EQU 13 ユニット数 -DEVEND EQU 14 ドライバ終了アドレス -BDEVNO EQU 22 ベースドライブ番号 +COMMAND EQU 2 Command number +ERRLOW EQU 3 Error code lower 8 bits +ERRHIGH EQU 4 Error code upper 8 bits +MXUNIT EQU 13 Number of units +DEVEND EQU 14 Driver exit address +BDEVNO EQU 22 Base drive number DDHEADER: - DC.L -1 +$00 リンクポインタ - DC.W $2040 +$04 デバイス属性 + DC.L -1 +$00 Link pointer + DC.W $2040 +$04 Device attribute DC.L DDSTRATEGY +$06 DC.L DDENTRY_FIRST +$0A - DC.B '*EMUHOST' +$0E デバイス名 + DC.B '*EMUHOST' +$0E Device name DDREQUEST: DC.L 0 @@ -41,12 +41,12 @@ DDSTRATEGY: MOVE.L A5,DDREQUEST RTS -*デバイスドライバエントリ +*Device driver entry DDENTRY: MOVE.L SP,(STACK_BUFF) LEA (DEF_STACK),SP MOVEM.L D1-D3/A0-A2,-(SP) - MOVEM.L DDREQUEST(PC),D0 D0.L: リクエストヘッダアドレス + MOVEM.L DDREQUEST(PC),D0 D0.L: Request header address MOVE.L D0,-(SP) BSR _Process ADDQ.L #4,SP @@ -56,67 +56,67 @@ DDENTRY: KEEP_HERE: -*初回のみのデバイスドライバエントリ +*First time only device driver entry DDENTRY_FIRST: MOVEM.L D1-D3/A0-A2/A5,-(SP) - MOVEA.L DDREQUEST(PC),A5 A5.L: リクエストヘッダアドレス -* CMPI.B #$40,COMMAND(A5) 現行のHuman68kではチェック不要 -* BNE UNSUPPORTED エラー: 未対応 + MOVEA.L DDREQUEST(PC),A5 A5.L: Request header address +* CMPI.B #$40,COMMAND(A5) No need to check when Human68k is running +* BNE UNSUPPORTED Error: Not supported -*タイトル表示 +*Show title PEA MESSAGE_TITLE(PC) DOS _PRINT ADDQ.L #4,SP -*デバイスチェック +*Device check DEVICE_CHECK: BSR _Init TST.L D0 - BEQ NOTFOUND エラー: デバイスが存在しません + BEQ NOTFOUND Error: Device not found -*常駐開始 +*Resident program start LEA DDENTRY(PC),A1 LEA DDHEADER+$0A(PC),A0 - MOVE.L A1,(A0) ドライバエントリを設定 - MOVE.L #PROG_END,DEVEND(A5) 常駐終了アドレスを設定 + MOVE.L A1,(A0) Configure driver entry + MOVE.L #PROG_END,DEVEND(A5) Configure resident exit address - ST.B MXUNIT(A5) ポート未実装の判定のため負の値を設定しておく - JSR (A1) ドライバエントリを実行 + ST.B MXUNIT(A5) Set negative number since port is considered unimplemented + JSR (A1) Execute driver entry - TST.B MXUNIT(A5) ユニット数確認 - BLE NODRIVE エラー: ドライブがありません + TST.B MXUNIT(A5) Verify number of units + BLE NODRIVE Error: No drive MOVE.B BDEVNO(A5),D0 MOVE.B MXUNIT(A5),D1 LEA FIRSTDRIVE(PC),A0 - ADD.B D0,(A0) 開始ドライブ名書き換え - ADD.B D1,D0 終了ドライブ名書き換え + ADD.B D0,(A0) Overwrite start drive name + ADD.B D1,D0 Overwrite stop drive name ADD.B D0,LASTDRIVE-FIRSTDRIVE(A0) - PEA MESSAGE_DRIVENAME(PC) 正常: ドライブA: + PEA MESSAGE_DRIVENAME(PC) Normal: Drive A: DOS _PRINT - PEA MESSAGE_DRIVENAME2(PC) 正常: からZ: + PEA MESSAGE_DRIVENAME2(PC) Normal: to Z: SUBQ.B #2,D1 BCS @F DOS _PRINT @@ ADDQ.L #8,SP - PEA MESSAGE_DRIVENAME3(PC) 正常: を登録しました + PEA MESSAGE_DRIVENAME3(PC) Normal: was registered BRA QUIT NOTFOUND: - PEA MESSAGE_NOTFOUND(PC) エラー: デバイスが存在しません + PEA MESSAGE_NOTFOUND(PC) Error: Device not found BRA ABORT UNSUPPORTED: - PEA MESSAGE_UNSUPPORTED(PC) エラー: 未対応 + PEA MESSAGE_UNSUPPORTED(PC) Error: Not supported BRA ABORT NODRIVE: - PEA MESSAGE_NODRIVE(PC) エラー: ドライブがありません + PEA MESSAGE_NODRIVE(PC) Error: No drive ABORT: MOVE.B #$0D,ERRLOW(A5) @@ -139,41 +139,41 @@ SECRET: DATA -*エラーメッセージ +*Error messages MESSAGE_NOTFOUND: - DC.B 'デバイスが存在しません',$0D,$0A,0 + DC.B 'Device not found',$0D,$0A,0 MESSAGE_UNSUPPORTED: - DC.B '未対応',$0D,$0A,0 + DC.B 'Not supported',$0D,$0A,0 MESSAGE_NODRIVE: - DC.B 'ドライブがありません',$0D,$0A,0 + DC.B 'No drive',$0D,$0A,0 -*登録メッセージ +*Registration messages MESSAGE_DRIVENAME: - DC.B 'ドライブ' + DC.B 'Drive' FIRSTDRIVE: DC.B 'A:',0 MESSAGE_DRIVENAME2: - DC.B 'から' + DC.B ' to ' LASTDRIVE: DC.B '@:',0 MESSAGE_DRIVENAME3: - DC.B 'を登録しました',$0D,$0A,0 + DC.B ' was registered',$0D,$0A,0 -*タイトル +*Title MESSAGE_TITLE: DC.B $0D,$0A MESSAGE_TITLE2: DC.B 'RaSCSI FileSystem Driver version 1.42',$0D,$0A,0 -*ありがとう! +*Thanks! CREDIT: DC.B 'Coded by GIMONS',$0D,$0A DC.B 'Special thanks to',$0D,$0A DC.B 9,'co',$0D,$0A - DC.B 9,'PI.',$0D,$0A - DC.B 9,'立花@桑島技研',$0D,$0A + DC.B 9,'PI.',$0D,$0A + DC.B 9,'Tachibana@Kuwashima Giken',$0D,$0A DC.B 0 BSS diff --git a/src/x68k/RASDRV/RASDRV.TXT b/src/x68k/RASDRV/RASDRV.TXT deleted file mode 100644 index f3404ca2..00000000 --- a/src/x68k/RASDRV/RASDRV.TXT +++ /dev/null @@ -1,29 +0,0 @@ -RaSCSI ファイルシステムドライバ -RASDRV version 1.42 - -■概要 - - 本プログラムはX68000実機で動作しているHuman68kからRaSCSIのブリッジデバイスを - 通してRaspberry Pi側のファイルシステムを直接操作するためのデバイスドライバです。 - X68000エミュレータであるXM6及びXM6改ならびにTypeGのWindrvXMと同等の機能を提供 - します。 - -■解説 - - 利用するにはRaspberry PiのRaSCSIでブリッジデバイスを有効にする必要があります。 - 例えばSCSI ID6にブリッジデバイスを有効にする場合はrascsi -ID6 BRIDGEといった - 指定が必要です。 - - 次にデバイスドライバRASCSI.SYSを実機の環境にコピーします。あとはCONFIG.SYSの - 後半部分に以下のように記述してください。 - - DEVICE = \SYS\RASDRV.SYS - - 起動オプションを指定しない場合はRaspberry Piのルートディレクトリ配下をマウント - します。引数にディレクトリ名を指定することでそのディレクトリをマウントできます。 - 例えば/home/pi/appと/home/pi/dataというディレクトリをマウントする場合は - - DEVICE = \SYS\RASDRV.SYS /home/pi/app /home/pi/data - - と記述することで二つのディレクトリを別々のドライブとしてマウント可能です。 - その他のオプションとしてWindrvXMのものが指定可能です。 diff --git a/src/x68k/RASETHER/RASETHER.DOC b/src/x68k/RASETHER/RASETHER.DOC deleted file mode 100644 index 5e37f13c..00000000 --- a/src/x68k/RASETHER/RASETHER.DOC +++ /dev/null @@ -1,42 +0,0 @@ -RaSCSI用 Ethernetドライバ -RASETHER version 1.20 - -Based on - Neptune-X board driver for Human-68k(ESP-X) version 0.03 - Programed 1996-7 by Shi-MAD. - Special thanks to Niggle, FIRST, yamapu ... - -● このプログラムは - - Shi-MAD さんの作られた Ethernet 用 ISA バスブリッジ "Neptune-X" 用デバ - イスドライバ ether_ne.sys を改造した ether_ne.sys ver0.03 +M01 +1 +L12を - 参考にして開発したRaSCSI用のイーサーネット通信ドライバです。 - -● 使い方 - - 基本的にはオリジナルのドライバと同じようにデバイスドライバとしてCONFIG.SYS - で組み込んで下さい。 - - 例) - DEVICE = \SYS\RASETHER.SYS - - 以下のオプションが指定可能です。 - -tx [xは数字] : 使用するtrapを指定します。xは0から6が指定可能です。 - ただし、指定したtrapが使用中である場合は、trap #0から - 空いている所を自動探索し、見つかった空きtrapを利用し - ます。 - -n : APIにtrapを使用しません。 - - RASETHERで拡張したオプションは以下のとおりです。 - -px [xは数字] : パケット受信のポーリング間隔を指定します1がデフォルトです。 - 1の場合は約16ms毎にポーリングします。2,3・・・8まで指定が可能 - です。数字が一つ増えるごとに16ms間隔が大きくなります。 - - -ix [xは数字] : ポーリングに使用する割り込みのタイプを指定します。 - デフォルトは0でMFPのGPIP割り込み(V-DISP)を利用します。 - 1を指定するとTimer-A割り込みを使用します。 - - -● このドライバについて - オリジナルのether_ne.sys及び改造版のether_ne.sys ver0.03 +M01 +1 +L12の - 利用規定に従います。 diff --git a/src/x68k/RASETHER/main.c b/src/x68k/RASETHER/main.c index a6b6bb4a..17cf4bce 100644 --- a/src/x68k/RASETHER/main.c +++ b/src/x68k/RASETHER/main.c @@ -3,9 +3,9 @@ // SCSI Target Emulator RaSCSI (*^..^*) // for Raspberry Pi // -// Powered by XM6 TypeG Technorogy. +// Powered by XM6 TypeG Technology. // Copyright (C) 2016-2017 GIMONS -// [ RaSCSI イーサーネット メイン ] +// [ RaSCSI Ethernet Main ] // // Based on // Neptune-X board driver for Human-68k(ESP-X) version 0.03 @@ -25,7 +25,7 @@ int trap_no; int num_of_prt; struct prt PRT_LIST[NPRT]; -// マルチキャスト(未対応) +// Multicast (not supported) #ifdef MULTICAST int num_of_multicast; struct eaddr multicast_array[NMULTICAST]; @@ -45,7 +45,7 @@ static int sprint_eaddr(unsigned char* dst, void* e) } /************************************************ - * TRAP nが使用可能か調べる * + * Check if TRAP n can be used * ************************************************/ static int is_valid_trap(int trap_no) { @@ -55,10 +55,10 @@ static int is_valid_trap(int trap_no) return 0; } - // 使用中かどうかチェック + // Check if in use addr = (unsigned int)_dos_intvcg(TRAP_VECNO(trap_no)); - // 処理アドレスの最上位バイトにベクタ番号が入っていれば未使用 + // Unused if the uppermost byte of the process address contains the vector number if (addr & 0xff000000) { return -1; } @@ -67,13 +67,13 @@ static int is_valid_trap(int trap_no) } /************************************************ - * 未使用のTRAP nを検索 * + * Search for unused TRAP n * ************************************************/ static int search_trap_no(int def) { int i; - // もしdefが使用可能ならそれに決定 + // If def is usable, choose that if (is_valid_trap(def)) { return def; } @@ -96,8 +96,8 @@ static void* trap_vector(int trap_no, void *func) } /************************************************ - 初期化関数(ne.sイニシャライズで呼びます) * - ************************************************/ + * Init Function (call with ne.s initialize) * + ************************************************/ int Initialize(void) { unsigned char buff[128]; @@ -106,27 +106,27 @@ int Initialize(void) if (SearchRaSCSI()) { - Print("RaSCSI Ether Adapter の存在を確認できませんでした\r\n"); + Print("Could not locate the RaSCSI Ethernet Adapter\r\n"); return -1; } if (InitList(NPRT) || InitRaSCSI()) { - Print("RaSCSI Ether Adapter Driver の初期化に失敗しました\r\n"); + Print("Failed to initialize the RaSCSI Ethernet Adapter Driver\r\n"); return -1; } memset(ðer_addr, 0x00, sizeof(ether_addr)); GetMacAddr(ðer_addr); - // 未使用trap番号を調べる(指定番号優先) + // Inspect unused trap number (prioritize specified number) if (trap_no >= 0) { trap_no = search_trap_no(trap_no); } if (trap_no >= 0) { - // trapをフックする + // Hook the trap trap_vector(trap_no, (void*)trap_entry); sprintf(buff, " API trap number:%d ", trap_no); } else { @@ -141,14 +141,14 @@ int Initialize(void) sprintf(buff, "MAC Addr:%s\r\n", buff2); Print(buff); - // ポーリング開始 + // Start polling RegisterIntProcess(poll_interval); return 0; } /************************************************ - * プロトコルリスト初期化 * + * Initialize Protocol List * ************************************************/ int InitList(int n) { @@ -171,7 +171,7 @@ int InitList(int n) } /************************************************ - * 受信ハンドラ(プロトコル)追加 * + * Add Receive Handler (protocol) * ************************************************/ int AddList(int type, int_handler handler) { @@ -184,7 +184,7 @@ int AddList(int type, int_handler handler) result = -1; - // overwrite if alreay exist + // overwrite if already exist p = &PRT_LIST[0]; for (i = 0; i < NPRT; i++, p++) { if ((p->type == type && p->malloc != (malloc_func)-1) @@ -214,7 +214,7 @@ int AddList(int type, int_handler handler) } /************************************************ - * 受信ハンドラ(プロトコル)削除 * + * Delete Receive Handler (protocol) * ************************************************/ int DeleteList(int type) { @@ -238,7 +238,7 @@ int DeleteList(int type) } /************************************************ - * 受信ハンドラ(プロトコル)サーチ * + * Search Receive Handler (protocol) * ************************************************/ int_handler SearchList(int type) { @@ -260,7 +260,7 @@ int_handler SearchList(int type) /************************************************ - * 受信ハンドラ(プロトコル)サーチ * + * Search Receive Handler (protocol) * ************************************************/ int_handler SearchList2(int type, int n) { diff --git a/src/x68k/RASETHER/main.h b/src/x68k/RASETHER/main.h index fa481a06..68a41cee 100644 --- a/src/x68k/RASETHER/main.h +++ b/src/x68k/RASETHER/main.h @@ -3,9 +3,9 @@ // SCSI Target Emulator RaSCSI (*^..^*) // for Raspberry Pi // -// Powered by XM6 TypeG Technorogy. +// Powered by XM6 TypeG Technology. // Copyright (C) 2016-2017 GIMONS -// [ RaSCSI イーサーネット メイン ] +// [ RaSCSI Ethernet Main ] // // Based on // Neptune-X board driver for Human-68k(ESP-X) version 0.03 @@ -25,7 +25,7 @@ // number of multicast address we can handle **EDIT this** #define NMULTICAST (64) -/* ただし、まだマルチキャストには対応していない */ +/* However, multicast is not yet supported */ struct eaddr { unsigned char eaddr [6]; @@ -41,7 +41,7 @@ struct prt { }; -// グローバル変数 +// Global variables extern unsigned int scsiid; extern int trap_no; extern int num_of_prt; @@ -53,7 +53,7 @@ extern struct eaddr multicast_array [NMULTICAST]; #endif -// プロトタイプ宣言 +// Prototype declarations extern int Initialize (void); extern int InitList (int); extern int AddList (int, int_handler); @@ -69,7 +69,7 @@ extern void MakeMulticastTable (unsigned char*); #endif -// ne.s 内関数 +// Function within ne.s extern void trap_entry (void); diff --git a/src/x68k/RASETHER/re.s b/src/x68k/RASETHER/re.s index 2eba98a8..1ff0c65b 100644 --- a/src/x68k/RASETHER/re.s +++ b/src/x68k/RASETHER/re.s @@ -3,9 +3,9 @@ ** SCSI Target Emulator RaSCSI (*^..^*) ** for Raspberry Pi ** -** Powered by XM6 TypeG Technorogy. +** Powered by XM6 TypeG Technology. ** Copyright (C) 2016-2017 GIMONS -** [ RaSCSI イーサーネット ドライバ ] +** [ RaSCSI Ethernet Driver ] ** ** Based on ** Neptune-X board driver for Human-68k(ESP-X) version 0.03 @@ -23,21 +23,21 @@ * Global Symbols ---------------------- * * -* C言語用 外部宣言 +* For C language: external declarations * .xref _Initialize, _AddList, _SearchList, _DeleteList ;main.c .xref _GetMacAddr, _SetMacAddr ;scsictl.c .xref _SendPacket, _SetPacketReception ;scsictl.c -* .xref _AddMulticastAddr, _DelMulticastAddr ;未実装 +* .xref _AddMulticastAddr, _DelMulticastAddr ;not implemented * -* C言語用 外部変数 +* For C language: external functions * - .xref _num_of_prt ;main.c 登録プロトコル数 - .xref _trap_no ;使用trapナンバー - .xref _trans_counter ;scsictl.c 送信/受信バイト数 - .xref _intr_type ;scsictl.c 割り込み種別 - .xref _poll_interval ;scsictl.c ポーリング間隔 + .xref _num_of_prt ;main.c Number of registered protocols + .xref _trap_no ;Used trap number + .xref _trans_counter ;scsictl.c Number of send/receive bytes + .xref _intr_type ;scsictl.c Type of interrupt + .xref _poll_interval ;scsictl.c Polling interval * Text Section -------------------------------- * @@ -47,21 +47,21 @@ * -* デバイスヘッダー +* Device Header * device_header: - .dc.l -1 ;リンクポインター + .dc.l -1 ;link pointer .dc $8000 ;device att. - .dc.l strategy_entry ;stategy entry - .dc.l interupt_entry ;interupt entry + .dc.l strategy_entry ;strategy entry + .dc.l interupt_entry ;interrupt entry .dc.b '/dev/en0' ;device name .dc.b 'EthD' ;for etherlib.a - .dc.b 'RASC' ;driver name (この後にエントリーを置く) + .dc.b 'RASC' ;driver name (put in entry later) -* 'RASC' から superjsr_entry の間には何も置かないこと +* Don not put anything between 'RASC' and superjsr_entry * -* イーサドライバ 関数 エントリー ( for DOS _SUPERJSR ) +* Ether Driver Function Entry ( for DOS _SUPERJSR ) * in: d0: command number * a0: args * @@ -79,11 +79,11 @@ superjsr_entry: bsr do_command movem.l (sp)+,d1-d7/a1-a7 - rts ;普通のリターン + rts ;normal return * -* イーサドライバ 関数 エントリー ( for trap #n ) +* Ether Driver Function Entry ( for trap #n ) * in: d0: command number * a0: args * @@ -101,51 +101,51 @@ _trap_entry:: bsr do_command movem.l (sp)+,d1-d7/a1-a7 - rte ;割り込みリターン + rte ;interrupt return * -* 各処理ふりわけ +* Assign each command * do_command: moveq #FUNC_MIN,d1 cmp.l d0,d1 - bgt error ;d0<-2 なら未対応コマンド番号 + bgt error ;d0<-2 is an unsupported command number moveq #FUNC_MAX,d1 cmp.l d1,d0 - bgt error ;9) + .dc get_statistics-jumptable ;09 ... (Read out statistics ) FUNC_MAX: .equ ($-jumptable)/2-1 * -* コマンド -2: 送受信カウンタのアドレスを返す +* Command -2: Return transfer counter address * return: address * get_cnt_addr: @@ -155,7 +155,7 @@ get_cnt_addr: * -* コマンド -1: 使用trap番号を返す +* Command -1: Return used trap number * return: trap number to use (-1:use SUPERJSR) * driver_entry: @@ -166,13 +166,13 @@ driver_entry: *mesff: .dc.b 'DriverEntry',13,10,0 * .text - move.l (_trap_no,pc),d0 ;trap_no ... main.c 変数 + move.l (_trap_no,pc),d0 ;trap_no ... main.c variable rts * -* コマンド 00: ドライバーのバージョンを返す -* return: version number (例... ver1.00 なら 100 を返す) +* Command 00: Return driver version +* return: version number (Ex... for ver1.00 return 100) * get_driver_version: * pea (mes00,pc) @@ -187,7 +187,7 @@ get_driver_version: * -* コマンド 01: 現在の MAC アドレスの取得 +* Command 01: Get current MAC address * return: same as *dst * get_mac_addr: @@ -200,13 +200,13 @@ get_mac_addr: pea (a0) pea (a0) - bsr _GetMacAddr ;scsictl.c 関数 + bsr _GetMacAddr ;scsictl.c function addq.l #4,sp - move.l (sp)+,d0 ;引数の a0 を d0 にそのまま返す + move.l (sp)+,d0 ;Return d0 for parameter a0 rts * -* コマンド 02: EEPROM に書かれた MAC アドレスの取得 +* Command 02: Get MAC address written to EEPROM * return: same as *dst * get_prom_addr: @@ -219,13 +219,13 @@ get_prom_addr: pea (a0) pea (a0) - bsr _GetMacAddr ;scsictl.c 関数 + bsr _GetMacAddr ;scsictl.c function addq.l #4,sp - move.l (sp)+,d0 ;引数の a0 を d0 にそのまま返す + move.l (sp)+,d0 ;Return d0 for parameter a0 rts * -* コマンド 03: MACアドレスの設定 +* Command 03: Set MAC address * return: 0 (if no errors) * set_mac_addr: @@ -237,13 +237,13 @@ set_mac_addr: * .text pea (a0) - bsr _SetMacAddr ;scsictl.c 関数 + bsr _SetMacAddr ;scsictl.c function addq.l #4,sp rts * -* コマンド 04: パケット送信 +* Command 04: Send packet * packet contents: * Distination MAC: 6 bytes * Source(own) MAC: 6 bytes @@ -256,10 +256,10 @@ send_packet: * DOS _PRINT * addq.l #4,sp - move.l (a0)+,d0 ;パケットサイズ - move.l (a0),-(sp) ;パケットアドレス + move.l (a0)+,d0 ;packet size + move.l (a0),-(sp) ;packet address move.l d0,-(sp) - bsr _SendPacket ;scsictl.c 関数 + bsr _SendPacket ;scsictl.c function addq.l #8,sp * move.l d0,-(sp) @@ -269,14 +269,14 @@ send_packet: * move.l (sp)+,d0 * .data *mes04: .dc.b 13,10,'SendPacket,13,10',0 -*mes04e:.dc.b 13,10,'SendPacketおわり',13,10,0 +*mes04e:.dc.b 13,10,'SendPacket finished',13,10,0 * .text rts * -* コマンド 05: 受信割り込みハンドラ追加・設定 +* Command 05: Set / add receive interrupt handler * type: 0x00000800 IP packet * 0x00000806 ARP packet * return: 0 (if no errors) @@ -289,28 +289,28 @@ set_int_addr: *mes05: .dc.b 'SetIntAddr',13,10,0 * .text - move.l (a0)+,d0 ;プロトコル番号 - move.l (a0),-(sp) ;ハンドラ関数のアドレス + move.l (a0)+,d0 ;protocol number + move.l (a0),-(sp) ;address to handler function move.l d0,-(sp) - bsr _AddList ;main.c 関数 + bsr _AddList ;main.c function addq.l #8,sp tst.l d0 - bmi set_int_addr_rts ;登録失敗 + bmi set_int_addr_rts ;Registration failed - cmpi.l #1,(_num_of_prt) ;ハンドラ数が1なら割り込み許可へ + cmpi.l #1,(_num_of_prt) ;Permit interrupt if number of handlers is 1 bne set_int_addr_rts - pea (1) ;1=<許可> - bsr _SetPacketReception ;割り込み許可 ... scsictl.c + pea (1) ;1= + bsr _SetPacketReception ;interrupt permitted ... scsictl.c addq.l #4,sp -* moveq #0,d0 ;SetPacketReception() で常に 0 が返るので省略 +* moveq #0,d0 ;SetPacketReception() always returns 0 so bypass set_int_addr_rts: rts * -* コマンド 06: 割り込みハンドラのアドレス取得 +* Command 06: Get interrupt handler and address * return: interupt address * get_int_addr: @@ -328,7 +328,7 @@ get_int_addr: * -* コマンド 07: 割り込みハンドラの削除 +* Command 07: Delete interrupt handler * return: 0 (if no errors) * del_int_addr: @@ -340,24 +340,24 @@ del_int_addr: * .text pea (a0) - bsr _DeleteList ;main.c 関数 + bsr _DeleteList ;main.c function move.l d0,(sp)+ - bmi del_int_addr_ret ;削除失敗 + bmi del_int_addr_ret ;Delete failed - tst.l (_num_of_prt) ;ハンドラが一つもなくなれば割り込みを禁止する + tst.l (_num_of_prt) ;Forbid interrupts if handlers are gone bne del_int_addr_ret - clr.l -(sp) ;0=<禁止> - bsr _SetPacketReception ;割り込み禁止 ... scsictl.c + clr.l -(sp) ;0= + bsr _SetPacketReception ;Interrupt forbitten ... scsictl.c addq.l #4,sp -* moveq #0,d0 ;SetPacketReception() で常に 0 が返るので省略 +* moveq #0,d0 ;SetPacketReception() always returns 0 so bypass del_int_addr_ret: rts * -* コマンド 08: マルチキャストアドレスの設定 +* Command 08: Set multicast address * set_multicast_addr: * pea (mes08,pc) @@ -372,7 +372,7 @@ set_multicast_addr: * -* コマンド 09: 統計読み出し +* Command 09: Read out statistics * get_statistics: * pea (mes09,pc) @@ -386,7 +386,7 @@ get_statistics: rts * -* デバイスドライバエントリー +* Device Driver Entry * strategy_entry: move.l a5,(request_buffer) @@ -394,7 +394,7 @@ strategy_entry: interupt_entry: - move.l sp,(stack_buff) ;自前のスタックエリアを使う + move.l sp,(stack_buff) ;Use own stack area lea (def_stack),sp ; movem.l d1-d7/a0-a5,-(sp) @@ -481,13 +481,13 @@ opt_i: bra opt_loop arg_end: - bsr _Initialize ;main.c 関数 - ;I/Oアドレス設定 - ;MACアドレス取得 - ;プロトコルリスト初期化 - ;SCSICTL初期化 - ;割り込みハンドラ(ベクタ設定) - ;trapサービス(ベクタ設定) + bsr _Initialize ;main.c function + ;Set I/O address + ;Get MAC address + ;Init protocol list + ;Init SCSICTL + ;Interrupt handler (set vector) + ;trap service (set vector) tst.l d0 bne errorret @@ -508,7 +508,7 @@ intret: move.b d0,(3,a5) movem.l (sp)+,d1-d7/a0-a5 - movea.l (stack_buff,pc),sp ;スタックポインタを元にもどす + movea.l (stack_buff,pc),sp ;Restore stack pointer rts get_num: @@ -539,7 +539,7 @@ mestitle: .dc.b 'RaSCSI Ethernet Driver version 1.20 / Based on ether_ne.sys+M01L12',13,10 .dc.b 0 mesparam_err: - .dc.b 'パラメータが異常です',13,10,0 + .dc.b 'Invalid parameter',13,10,0 .even @@ -562,7 +562,7 @@ stack_buff_i: .quad * -* スタックエリア +* Stack area * .ds.b 1024*8 def_stack: diff --git a/src/x68k/RASETHER/scsictl.c b/src/x68k/RASETHER/scsictl.c index 8d30dc6d..9051710b 100644 --- a/src/x68k/RASETHER/scsictl.c +++ b/src/x68k/RASETHER/scsictl.c @@ -3,9 +3,9 @@ // SCSI Target Emulator RaSCSI (*^..^*) // for Raspberry Pi // -// Powered by XM6 TypeG Technorogy. +// Powered by XM6 TypeG Technology. // Copyright (C) 2016-2017 GIMONS -// [ RaSCSI イーサーネット SCSI制御部 ] +// [ RaSCSI Ethernet SCSI Control Department ] // // Based on // Neptune-X board driver for Human-68k(ESP-X) version 0.03 @@ -47,24 +47,24 @@ typedef struct #define MFP_IERB 0xe88009 #define MFP_IMRB 0xe88015 -// asmsub.s 内のサブルーチン +// Subroutine in asmsub.s extern void DI(); extern void EI(); -volatile short* iocsexec = (short*)0xa0e; // IOCS実行中ワーク -struct trans_counter trans_counter; // 送受信カウンタ -unsigned char rx_buff[2048]; // 受信バッファ -int imr; // 割り込み許可フラグ -int scsistop; // SCSI停止中フラグ -int intr_type; // 割り込み種別(0:V-DISP 1:TimerA) -int poll_interval; // ポーリング間隔(設定) -int poll_current; // ポーリング間隔(現在) -int idle; // アイドルカウンタ +volatile short* iocsexec = (short*)0xa0e; // Work when executin IOCS +struct trans_counter trans_counter; // Transfer counter +unsigned char rx_buff[2048]; // Receive buffer +int imr; // Interrupt permission flag +int scsistop; // SCSI stopped flag +int intr_type; // Interrupt type (0:V-DISP 1:TimerA) +int poll_interval; // Polling interval (configure) +int poll_current; // Polling interval (current) +int idle; // Idle counter #define POLLING_SLEEP 255 // 4-5s /************************************************ - * MACアドレス取得命令発行 * + * Execute command to get MAC address * ************************************************/ int SCSI_GETMACADDR(unsigned char *mac) { @@ -105,7 +105,7 @@ int SCSI_GETMACADDR(unsigned char *mac) } /************************************************ - * MACアドレス設定命令発行 * + * Execute command to configure MAC address * ************************************************/ int SCSI_SETMACADDR(const unsigned char *mac) { @@ -144,7 +144,7 @@ int SCSI_SETMACADDR(const unsigned char *mac) } /************************************************ - * パケット受信サイズ取得命令発行 * + * Execute command to get received packet size* ************************************************/ int SCSI_GETPACKETLEN(int *len) { @@ -188,7 +188,7 @@ int SCSI_GETPACKETLEN(int *len) } /************************************************ - * パケット受信命令発行 * + * Execute receive packet command * ************************************************/ int SCSI_GETPACKETBUF(unsigned char *buf, int len) { @@ -229,7 +229,7 @@ int SCSI_GETPACKETBUF(unsigned char *buf, int len) } /************************************************ - * パケット送信命令発行 * + * Execute packet send command * ************************************************/ int SCSI_SENDPACKET(const unsigned char *buf, int len) { @@ -267,7 +267,7 @@ int SCSI_SENDPACKET(const unsigned char *buf, int len) } /************************************************ - * MACアドレス取得 * + * Get MAC address * ************************************************/ int GetMacAddr(struct eaddr* buf) { @@ -279,7 +279,7 @@ int GetMacAddr(struct eaddr* buf) } /************************************************ - * MACアドレス設定 * + * Set MAC address * ************************************************/ int SetMacAddr(const struct eaddr* data) { @@ -291,7 +291,7 @@ int SetMacAddr(const struct eaddr* data) } /************************************************ - * RaSCSI検索 * + * Search RaSCSI * ************************************************/ int SearchRaSCSI() { @@ -299,7 +299,7 @@ int SearchRaSCSI() INQUIRYOPT_T inq; for (i = 0; i <= 7; i++) { - // BRIDGEデバイス検索 + // Search for BRIDGE device if (S_INQUIRY(sizeof(INQUIRY_T) , i, (struct INQUIRY*)&inq) < 0) { continue; } @@ -308,7 +308,7 @@ int SearchRaSCSI() continue; } - // TAP初期化状態を取得 + // Get TAP initialization status if (S_INQUIRY(sizeof(INQUIRYOPT_T) , i, (struct INQUIRY*)&inq) < 0) { continue; } @@ -317,7 +317,7 @@ int SearchRaSCSI() continue; } - // SCSI ID確定 + // Configure SCSI ID scsiid = i; return 0; } @@ -326,7 +326,7 @@ int SearchRaSCSI() } /************************************************ - * RaSCSI初期化 関数 * + * Init RaSCSI method * ************************************************/ int InitRaSCSI(void) { @@ -343,7 +343,7 @@ int InitRaSCSI(void) } /************************************************ - * RaSCSI 割り込み処理 関数(ポーリング) * + * RaSCSI interrupt handler function (polling) * ************************************************/ void interrupt IntProcess(void) { @@ -353,78 +353,78 @@ void interrupt IntProcess(void) int_handler func; int i; - // V-DISP GPIP割り込みはアイドルカウンタで制御 + // V-DISP GPIP interrupt idle count control if (intr_type == 0) { - // アイドル加算 + // Increment idle idle++; - // 次回の処理予定に到達していないならスキップ + // Skip if not yet next scheduled processing if (idle < poll_current) { return; } - // アイドルカウンタをクリア + // Clear idle counter idle = 0; } - // 割り込み開始 + // Start interrupt - // 割り込み許可の時だけ + // Only when interrupt is permitted if (imr == 0) { return; } - // IOCS実行中ならばスキップ + // Skip if executing IOCS if (*iocsexec != -1) { return; } - // 受信処理中は割り込み禁止 + // Interrupt forbidden if receiving data DI (); - // バスフリーの時だけ + // Only in bus free phase phase = S_PHASE(); if (phase != 0) { - // 終了 + // Exit goto ei_exit; } - // 受信処理 + // Receive data if (SCSI_GETPACKETLEN(&len) == 0) { - // RaSCSI停止中 + // RaSCSI is stopped scsistop = 1; - // ポーリング間隔の再設定(寝る) + // Reset polling interval (sleep) UpdateIntProcess(POLLING_SLEEP); - // 終了 + // Exit goto ei_exit; } - // RaSCSIは動作中 + // RaSCSI is stopped if (scsistop) { scsistop = 0; - // ポーリング間隔の再設定(急ぐ) + // Reset polling interval (hurry) UpdateIntProcess(poll_interval); } - // パケットは到着してなかった + // Packets did not arrive if (len == 0) { - // 終了 + // Exit goto ei_exit; } - // 受信バッファメモリへパケット転送 + // Tranfer packets to receive buffer memory if (SCSI_GETPACKETBUF(rx_buff, len) == 0) { - // 失敗 + // Fail goto ei_exit; } - // 割り込み許可 + // Interrupt permitted EI (); - // パケットタイプでデータ分別 + // Split data by packet type type = rx_buff[12] * 256 + rx_buff[13]; i = 0; while ((func = SearchList2(type, i))) { @@ -435,12 +435,12 @@ void interrupt IntProcess(void) return; ei_exit: - // 割り込み許可 + // Interrupt permitted EI (); } /************************************************ - * RaSCSI パケット送信 関数 (ne.sから) * + * RaSCSI Send Packets Function (from ne.s) * ************************************************/ int SendPacket(int len, const unsigned char* data) { @@ -449,35 +449,35 @@ int SendPacket(int len, const unsigned char* data) } if (len > 1514) { // 6 + 6 + 2 + 1500 - return -1; // エラー + return -1; // Error } - // RaSCSI停止中のようならエラー + // If RaSCSI seems to be stopped, throw an error if (scsistop) { return -1; } - // 送信処理中は割り込み禁止 + // Interrupt is not permitted during sending DI (); - // 送信処理と送信フラグアップ + // Send processing and raise send flag if (SCSI_SENDPACKET(data, len) == 0) { - // 割り込み許可 + // Interrupt permitted EI (); return -1; } - // 割り込み許可 + // Interrupt permitted EI (); - // 送信依頼済み + // Finished requesting send trans_counter.send_byte += len; return 0; } /************************************************ - * RaSCSI 割り込み許可、不許可設定 関数 * + * RaSCSI Interrupt Permission Setting Function* ************************************************/ int SetPacketReception(int i) { @@ -486,19 +486,19 @@ int SetPacketReception(int i) } /************************************************ - * RaSCSI 割り込み処理登録 * + * RaSCSI Interrupt Processing Registration * ************************************************/ void RegisterIntProcess(int n) { volatile unsigned char *p; - // ポーリング間隔(現在)の更新とアイドルカウンタクリア + // Update polling interval (current) and clear idle counter poll_current = n; idle = 0; if (intr_type == 0) { - // V-DISP GPIP割り込みベクタを書き換えて - // 割り込みを有効にする + // Overwrite V-DISP GPIP interrupt vectors + // and enable interrupt B_INTVCS(0x46, (int)IntProcess); p = (unsigned char *)MFP_AEB; *p = *p | 0x10; @@ -507,28 +507,28 @@ void RegisterIntProcess(int n) p = (unsigned char *)MFP_IMRB; *p = *p | 0x40; } else if (intr_type == 1) { - // TimerAはカウントモードを設定 + // Set TimerA counter mode VDISPST(NULL, 0, 0); VDISPST(IntProcess, 0, poll_current); } } /************************************************ - * RaSCSI 割り込み処理変更 * + * RaSCSI Interrupt Processing Update * ************************************************/ void UpdateIntProcess(int n) { - // ポーリング間隔(現在)と同じなら更新しない + // Do not update if polling interval (current) is the same if (n == poll_current) { return; } - // ポーリング間隔(現在)の更新とアイドルカウンタクリア + // Update polling interval (current) and clear idle counter poll_current = n; idle = 0; if (intr_type == 1) { - // TimerAは再登録必要 + // TimerA requires re-registering VDISPST(NULL, 0, 0); VDISPST(IntProcess, 0, poll_current); } diff --git a/src/x68k/RASETHER/scsictl.h b/src/x68k/RASETHER/scsictl.h index ae6bf477..a13ea178 100644 --- a/src/x68k/RASETHER/scsictl.h +++ b/src/x68k/RASETHER/scsictl.h @@ -3,9 +3,9 @@ // SCSI Target Emulator RaSCSI (*^..^*) // for Raspberry Pi // -// Powered by XM6 TypeG Technorogy. +// Powered by XM6 TypeG Technology. // Copyright (C) 2016-2017 GIMONS -// [ RaSCSI イーサーネット SCSI制御部 ] +// [ RaSCSI Ethernet SCSI Control Department ] // // Based on // Neptune-X board driver for Human-68k(ESP-X) version 0.03 @@ -17,11 +17,11 @@ #ifndef scsictl_h #define scsictl_h -// グローバル変数 +// Global variables extern int intr_type; extern int poll_interval; -// 送受信カウンタ +// Transfer counter struct trans_counter { unsigned int send_byte; unsigned int recv_byte;