From 8d4a96683a0cdd1877dea7eb28f0106748bd0881 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Wed, 18 Sep 2019 21:41:29 -0400 Subject: [PATCH] Reduces output noise. --- Components/5380/ncr5380.cpp | 32 +++++++++---------- .../MassStorage/SCSI/DirectAccessDevice.cpp | 4 +-- Storage/MassStorage/SCSI/Target.hpp | 1 + .../MassStorage/SCSI/TargetImplementation.hpp | 5 ++- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/Components/5380/ncr5380.cpp b/Components/5380/ncr5380.cpp index abdc4db68..6084b1e79 100644 --- a/Components/5380/ncr5380.cpp +++ b/Components/5380/ncr5380.cpp @@ -23,7 +23,7 @@ NCR5380::NCR5380(SCSI::Bus &bus, int clock_rate) : void NCR5380::write(int address, uint8_t value, bool dma_acknowledge) { switch(address & 7) { case 0: - LOG("[SCSI 0] Set current SCSI bus state to " << PADHEX(2) << int(value)); +// LOG("[SCSI 0] Set current SCSI bus state to " << PADHEX(2) << int(value)); data_bus_ = value; if(dma_request_ && dma_operation_ == DMAOperation::Send) { @@ -36,7 +36,7 @@ void NCR5380::write(int address, uint8_t value, bool dma_acknowledge) { break; case 1: { - LOG("[SCSI 1] Initiator command register set: " << PADHEX(2) << int(value)); +// LOG("[SCSI 1] Initiator command register set: " << PADHEX(2) << int(value)); initiator_command_ = value; bus_output_ &= ~(Line::Reset | Line::Acknowledge | Line::Busy | Line::SelectTarget | Line::Attention); @@ -52,7 +52,7 @@ void NCR5380::write(int address, uint8_t value, bool dma_acknowledge) { } break; case 2: - LOG("[SCSI 2] Set mode: " << PADHEX(2) << int(value)); +// LOG("[SCSI 2] Set mode: " << PADHEX(2) << int(value)); mode_ = value; // bit 7: 1 = use block mode DMA mode (if DMA mode is also enabled) @@ -87,27 +87,27 @@ void NCR5380::write(int address, uint8_t value, bool dma_acknowledge) { break; case 3: { - LOG("[SCSI 3] Set target command: " << PADHEX(2) << int(value)); +// LOG("[SCSI 3] Set target command: " << PADHEX(2) << int(value)); target_command_ = value; update_control_output(); } break; case 4: - LOG("[SCSI 4] Set select enabled: " << PADHEX(2) << int(value)); +// LOG("[SCSI 4] Set select enabled: " << PADHEX(2) << int(value)); break; case 5: - LOG("[SCSI 5] Start DMA send: " << PADHEX(2) << int(value)); +// LOG("[SCSI 5] Start DMA send: " << PADHEX(2) << int(value)); dma_operation_ = DMAOperation::Send; break; case 6: - LOG("[SCSI 6] Start DMA target receive: " << PADHEX(2) << int(value)); +// LOG("[SCSI 6] Start DMA target receive: " << PADHEX(2) << int(value)); dma_operation_ = DMAOperation::TargetReceive; break; case 7: - LOG("[SCSI 7] Start DMA initiator receive: " << PADHEX(2) << int(value)); +// LOG("[SCSI 7] Start DMA initiator receive: " << PADHEX(2) << int(value)); dma_operation_ = DMAOperation::InitiatorReceive; break; } @@ -131,7 +131,7 @@ void NCR5380::write(int address, uint8_t value, bool dma_acknowledge) { uint8_t NCR5380::read(int address, bool dma_acknowledge) { switch(address & 7) { case 0: - LOG("[SCSI 0] Get current SCSI bus state: " << PADHEX(2) << (bus_.get_state() & 0xff)); +// LOG("[SCSI 0] Get current SCSI bus state: " << PADHEX(2) << (bus_.get_state() & 0xff)); if(dma_request_ && dma_operation_ == DMAOperation::InitiatorReceive) { dma_acknowledge_ = true; @@ -142,7 +142,7 @@ uint8_t NCR5380::read(int address, bool dma_acknowledge) { return uint8_t(bus_.get_state()); case 1: - LOG("[SCSI 1] Initiator command register get: " << (arbitration_in_progress_ ? 'p' : '-') << (lost_arbitration_ ? 'l' : '-')); +// LOG("[SCSI 1] Initiator command register get: " << (arbitration_in_progress_ ? 'p' : '-') << (lost_arbitration_ ? 'l' : '-')); return // Bits repeated as they were set. (initiator_command_ & ~0x60) | @@ -154,11 +154,11 @@ uint8_t NCR5380::read(int address, bool dma_acknowledge) { (lost_arbitration_ ? 0x20 : 0x00); case 2: - LOG("[SCSI 2] Get mode"); +// LOG("[SCSI 2] Get mode"); return mode_; case 3: - LOG("[SCSI 3] Get target command"); +// LOG("[SCSI 3] Get target command"); return target_command_; case 4: { @@ -172,7 +172,7 @@ uint8_t NCR5380::read(int address, bool dma_acknowledge) { ((bus_state & Line::Input) ? 0x04 : 0x00) | ((bus_state & Line::SelectTarget) ? 0x02 : 0x00) | ((bus_state & Line::Parity) ? 0x01 : 0x00); - LOG("[SCSI 4] Get current bus state: " << PADHEX(2) << int(result)); +// LOG("[SCSI 4] Get current bus state: " << PADHEX(2) << int(result)); return result; } @@ -191,16 +191,16 @@ uint8_t NCR5380::read(int address, bool dma_acknowledge) { /* b2 = busy error */ ((bus_state & Line::Attention) ? 0x02 : 0x00) | ((bus_state & Line::Acknowledge) ? 0x01 : 0x00); - LOG("[SCSI 5] Get bus and status: " << PADHEX(2) << int(result)); +// LOG("[SCSI 5] Get bus and status: " << PADHEX(2) << int(result)); return result; } case 6: - LOG("[SCSI 6] Get input data"); +// LOG("[SCSI 6] Get input data"); return 0xff; case 7: - LOG("[SCSI 7] Reset parity/interrupt"); +// LOG("[SCSI 7] Reset parity/interrupt"); return 0xff; } return 0; diff --git a/Storage/MassStorage/SCSI/DirectAccessDevice.cpp b/Storage/MassStorage/SCSI/DirectAccessDevice.cpp index e21e214cd..58d0f21e8 100644 --- a/Storage/MassStorage/SCSI/DirectAccessDevice.cpp +++ b/Storage/MassStorage/SCSI/DirectAccessDevice.cpp @@ -7,10 +7,10 @@ // #include "DirectAccessDevice.hpp" +#include "../../../Outputs/Log.hpp" using namespace SCSI; - void DirectAccessDevice::set_storage(const std::shared_ptr &device) { device_ = device; } @@ -19,7 +19,7 @@ bool DirectAccessDevice::read(const Target::CommandState &state, Target::Respond if(!device_) return false; const auto specs = state.read_write_specs(); - printf("Read: %d from %d\n", specs.number_of_blocks, specs.address); + LOG("Read: " << specs.number_of_blocks << " from " << specs.address); std::vector output = device_->get_block(specs.address); for(uint32_t offset = 1; offset < specs.number_of_blocks; ++offset) { diff --git a/Storage/MassStorage/SCSI/Target.hpp b/Storage/MassStorage/SCSI/Target.hpp index 9401d61b4..371f13194 100644 --- a/Storage/MassStorage/SCSI/Target.hpp +++ b/Storage/MassStorage/SCSI/Target.hpp @@ -10,6 +10,7 @@ #define SCSI_Target_hpp #include "SCSI.hpp" +#include "../../../Outputs/Log.hpp" #include #include diff --git a/Storage/MassStorage/SCSI/TargetImplementation.hpp b/Storage/MassStorage/SCSI/TargetImplementation.hpp index f55680ccb..ff6ccb297 100644 --- a/Storage/MassStorage/SCSI/TargetImplementation.hpp +++ b/Storage/MassStorage/SCSI/TargetImplementation.hpp @@ -125,7 +125,6 @@ template void Target::scsi_bus_did_change(Bus *, B bus_state_ &= ~(Line::Request | 0xff); ++data_pointer_; -// printf("DP: %zu\n", data_pointer_); break; case 0: @@ -177,7 +176,7 @@ template bool Target::dispatch_command() { #define G1(x) (0x20|x) #define G5(x) (0xa0|x) - printf("---Command %02x---\n", command_[0]); + LOG("---Command " << PADHEX(2) << int(command_[0]) << "---"); switch(command_[0]) { default: return false; @@ -277,5 +276,5 @@ template void Target::end_command() { bus_state_ = DefaultBusState; set_device_output(bus_state_); - printf("---Done---\n"); + LOG("---Done---"); }