From 9ca57b80a76c700b86727ba5ef46f7d1edeb3da9 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Thu, 13 Aug 2015 08:43:10 +0100 Subject: [PATCH] Minor steps to help with diagnostics; all commented out or merely to benefit with breakpoint placement. --- Machines/Atari2600.cpp | 6 ++++-- Processors/6502/CPU6502.hpp | 12 ++++++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Machines/Atari2600.cpp b/Machines/Atari2600.cpp index b16d1c68d..347bd8685 100644 --- a/Machines/Atari2600.cpp +++ b/Machines/Atari2600.cpp @@ -169,8 +169,10 @@ void Machine::output_pixels(int count) // update hmove if (!(_horizontalTimer&3) && _hMoveFlags) { for(int c = 0; c < 5; c++) { - if ((_hMoveCounter^8^(_objectMotion[c] >> 4)) == 0xf) _hMoveFlags &= ~(1 << c); - if (_hMoveFlags&(1 << c)) _objectCounter[c] = (_objectCounter[c]+1)%160; + if ((_hMoveCounter^8^(_objectMotion[c] >> 4)) == 0xf) + _hMoveFlags &= ~(1 << c); + if (_hMoveFlags&(1 << c)) + _objectCounter[c] = (_objectCounter[c]+1)%160; } _hMoveCounter = (_hMoveCounter-1)&0xf; diff --git a/Processors/6502/CPU6502.hpp b/Processors/6502/CPU6502.hpp index 72b72a608..baec6aba3 100644 --- a/Processors/6502/CPU6502.hpp +++ b/Processors/6502/CPU6502.hpp @@ -466,10 +466,14 @@ template class Processor { read_op(_operation, _lastOperationPC.full); // static int last_cycles_left_to_run = 0; -// if(last_cycles_left_to_run > _cycles_left_to_run) -// printf("%02x %d\n", _operation, last_cycles_left_to_run - _cycles_left_to_run); -// else -// printf("%02x\n", _operation); +// static bool printed_map[256] = {false}; +// if(!printed_map[_operation]) { +// printed_map[_operation] = true; +// if(last_cycles_left_to_run > _cycles_left_to_run) +// printf("%02x %d\n", _operation, last_cycles_left_to_run - _cycles_left_to_run); +// else +// printf("%02x\n", _operation); +// } // last_cycles_left_to_run = _cycles_left_to_run; } break;