From d9ec11c62e8a802dbe796c992b5bbb51b999a4d6 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Thu, 15 Feb 2024 13:55:46 -0500 Subject: [PATCH] Use logger instead of printf. --- Machines/Apple/AppleII/SCSICard.cpp | 6 +++--- Machines/Apple/AppleII/SCSICard.hpp | 3 +++ Outputs/Log.hpp | 8 +++++++- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/Machines/Apple/AppleII/SCSICard.cpp b/Machines/Apple/AppleII/SCSICard.cpp index d84c575fe..674a4c7b6 100644 --- a/Machines/Apple/AppleII/SCSICard.cpp +++ b/Machines/Apple/AppleII/SCSICard.cpp @@ -125,13 +125,13 @@ void SCSICard::perform_bus_operation(Select select, bool is_read, uint16_t addre case 0xb: if(!is_read) { - printf("TODO: NCR reset\n"); + logger_.error().append("TODO: NCR reset"); } break; case 0xd: if(!is_read) { - printf("TODO: Enable PDMA\n"); + logger_.error().append("TODO: Enable PDMA"); } break; @@ -143,7 +143,7 @@ void SCSICard::perform_bus_operation(Select select, bool is_read, uint16_t addre break; default: - printf("Unhandled: %04x %c %02x\n", address, is_read ? 'r' : 'w', *value); + logger_.error().append("Unhandled: %04x %c %02x\n", address, is_read ? 'r' : 'w', *value); break; } break; diff --git a/Machines/Apple/AppleII/SCSICard.hpp b/Machines/Apple/AppleII/SCSICard.hpp index 40ce1a1b7..18f7182e4 100644 --- a/Machines/Apple/AppleII/SCSICard.hpp +++ b/Machines/Apple/AppleII/SCSICard.hpp @@ -17,6 +17,8 @@ #include "../../../Storage/MassStorage/SCSI/DirectAccessDevice.hpp" #include "../../../Storage/MassStorage/MassStorageDevice.hpp" +#include "../../../Outputs/Log.hpp" + #include #include @@ -47,6 +49,7 @@ class SCSICard: public Card { SCSI::Bus scsi_bus_; NCR::NCR5380::NCR5380 ncr5380_; SCSI::Target::Target storage_; + Log::Logger logger_; }; } diff --git a/Outputs/Log.hpp b/Outputs/Log.hpp index 4ce024e83..7ccef5756 100644 --- a/Outputs/Log.hpp +++ b/Outputs/Log.hpp @@ -23,6 +23,7 @@ enum class Source { AmigaCopper, AmigaChipset, AmigaBlitter, + AppleIISCSICard, AtariST, AtariSTDMAController, CommodoreStaticAnalyser, @@ -65,10 +66,13 @@ constexpr bool is_enabled(Source source) { case Source::AmigaChipset: case Source::AmigaCopper: case Source::AmigaDisk: + case Source::DirectAccessDevice: case Source::IWM: case Source::MFP68901: case Source::NCR5380: - case Source::SCC: return false; + case Source::SCC: + case Source::SCSI: + return false; } } @@ -82,9 +86,11 @@ constexpr const char *prefix(Source source) { case Source::AmigaChipset: return "Chipset"; case Source::AmigaCopper: return "Copper"; case Source::AmigaDisk: return "Disk"; + case Source::AppleIISCSICard: return "SCSI card"; case Source::AtariST: return "AtariST"; case Source::AtariSTDMAController: return "DMA"; case Source::CommodoreStaticAnalyser: return "Commodore Static Analyser"; + case Source::DirectAccessDevice: return "Direct Access Device"; case Source::Enterprise: return "Enterprise"; case Source::i8272: return "i8272"; case Source::IntelligentKeyboard: return "IKYB";