| 108 | } |
| 109 | |
| 110 | void ScsiController::Selection() |
| 111 | { |
| 112 | if (!IsSelection()) { |
| 113 | LogTrace("Selection phase"); |
| 114 | SetPhase(phase_t::selection); |
| 115 | |
| 116 | // Raise BSY and respond |
| 117 | GetBus().SetBSY(true); |
| 118 | return; |
| 119 | } |
| 120 | |
| 121 | // Selection completed |
| 122 | if (!GetBus().GetSEL() && GetBus().GetBSY()) { |
| 123 | LogTrace("Selection completed"); |
| 124 | |
| 125 | // Message out phase if ATN=1, otherwise command phase |
| 126 | if (GetBus().GetATN()) { |
| 127 | MsgOut(); |
| 128 | } else { |
| 129 | Command(); |
| 130 | } |
| 131 | } |
| 132 | } |
| 133 | |
| 134 | void ScsiController::Command() |
| 135 | { |