| 242 | } |
| 243 | |
| 244 | void ScsiController::Status() |
| 245 | { |
| 246 | if (!IsStatus()) { |
| 247 | // Minimum execution time |
| 248 | // TODO Why is a delay needed? Is this covered by the SCSI specification? |
| 249 | if (execstart > 0) { |
| 250 | Sleep(); |
| 251 | } else { |
| 252 | SysTimer::SleepUsec(5); |
| 253 | } |
| 254 | |
| 255 | stringstream s; |
| 256 | s << "Status phase, status is $" << setfill('0') << setw(2) << hex << static_cast<int>(GetStatus()); |
| 257 | LogTrace(s.str()); |
| 258 | SetPhase(phase_t::status); |
| 259 | |
| 260 | // Signal line operated by the target |
| 261 | GetBus().SetMSG(false); |
| 262 | GetBus().SetCD(true); |
| 263 | GetBus().SetIO(true); |
| 264 | |
| 265 | // Data transfer is 1 byte x 1 block |
| 266 | ResetOffset(); |
| 267 | SetLength(1); |
| 268 | SetBlocks(1); |
| 269 | GetBuffer()[0] = (uint8_t)GetStatus(); |
| 270 | |
| 271 | return; |
| 272 | } |
| 273 | |
| 274 | Send(); |
| 275 | } |
| 276 | |
| 277 | void ScsiController::MsgIn() |
| 278 | { |