From 1bca9aa2bb9bab9755cc7b2763cf25475d6b220f Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Tue, 16 Aug 2016 21:41:09 -0400 Subject: [PATCH] Fixed parity: now calculated from the actual byte and works the other way around. The Vic now believes it is loading the actual program. So I guess bytes, headers and the lead-in is working. --- Storage/Tape/Formats/TapePRG.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Storage/Tape/Formats/TapePRG.cpp b/Storage/Tape/Formats/TapePRG.cpp index e684fc33c..e3bdf3297 100644 --- a/Storage/Tape/Formats/TapePRG.cpp +++ b/Storage/Tape/Formats/TapePRG.cpp @@ -146,7 +146,7 @@ void TapePRG::get_next_output_token() _check_digit ^= _output_byte; } - printf("%02x ", _output_byte); + printf(" %02x", _output_byte); } switch(bit_offset) @@ -159,11 +159,12 @@ void TapePRG::get_next_output_token() break; case 9: { - uint8_t parity = _outputToken; + uint8_t parity = _output_byte; parity ^= (parity >> 4); parity ^= (parity >> 2); parity ^= (parity >> 1); - _outputToken = (parity&1) ? One : Zero; + _outputToken = (parity&1) ? Zero : One; + printf("[%d]", parity&1); } break; }