From d25ab35d586a0a52d8f0a8848f845484657f669c Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Mon, 15 Apr 2019 12:41:56 -0400 Subject: [PATCH] Finally gets `setw` usage correct. --- Outputs/Log.hpp | 4 ++-- .../68000/Implementation/68000Implementation.hpp | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Outputs/Log.hpp b/Outputs/Log.hpp index d24d2262b..88beab326 100644 --- a/Outputs/Log.hpp +++ b/Outputs/Log.hpp @@ -23,8 +23,8 @@ #include #include -#define PADHEX(n) std::hex << std::setw(n) << std::right << std::setfill('0') -#define PADDEC(n) std::dec << std::setw(n) << std::right << std::setfill('0') +#define PADHEX(n) std::hex << std::setfill('0') << std::setw(n) +#define PADDEC(n) std::dec << std::setfill('0') << std::setw(n) #define LOG(x) std::cout << x << std::endl #define LOGNBR(x) std::cout << x diff --git a/Processors/68000/Implementation/68000Implementation.hpp b/Processors/68000/Implementation/68000Implementation.hpp index da195a916..4b425b8d6 100644 --- a/Processors/68000/Implementation/68000Implementation.hpp +++ b/Processors/68000/Implementation/68000Implementation.hpp @@ -52,12 +52,12 @@ template void Processor: // no instruction was ongoing. Either way, do a standard instruction operation. // TODO: unless an interrupt is pending, or the trap flag is set. -/* std::cout << std::setw(8) << std::right; + std::cout << std::setfill('0'); std::cout << (extend_flag_ ? 'x' : '-') << (negative_flag_ ? 'n' : '-') << (zero_result_ ? '-' : 'z'); std::cout << (overflow_flag_ ? 'v' : '-') << (carry_flag_ ? 'c' : '-') << '\t'; - for(int c = 0; c < 8; ++ c) std::cout << "d" << c << ":" << data_[c].full << " "; - for(int c = 0; c < 8; ++ c) std::cout << "a" << c << ":" << address_[c].full << " "; - std::cout << std::endl;*/ + for(int c = 0; c < 8; ++ c) std::cout << "d" << c << ":" << std::setw(8) << data_[c].full << " "; + for(int c = 0; c < 8; ++ c) std::cout << "a" << c << ":" << std::setw(8) << address_[c].full << " "; + std::cout << '\n'; decoded_instruction_ = prefetch_queue_.halves.high.full; if(!instructions[decoded_instruction_].micro_operations) { @@ -65,7 +65,7 @@ template void Processor: std::cerr << "68000 Abilities exhausted; can't manage instruction " << std::hex << decoded_instruction_ << " from " << (program_counter_.full - 4) << std::endl; return; } else { - std::cout << std::hex << (program_counter_.full - 4) << ": " << std::setw(4) << decoded_instruction_ << '\n'; + std::cout << std::hex << (program_counter_.full - 4) << ": " << std::setw(4) << decoded_instruction_ << '\t'; } active_program_ = &instructions[decoded_instruction_];