1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-06-01 22:41:32 +00:00

Eliminate macro.

This commit is contained in:
Thomas Harte 2024-01-22 21:33:39 -05:00
parent cc165b65be
commit 030f49db83

View File

@ -19,8 +19,10 @@ static std::unique_ptr<File::Chunk> GetNextChunk(const std::shared_ptr<Storage::
auto new_chunk = std::make_unique<File::Chunk>();
int shift_register = 0;
// TODO: move this into the parser
#define shift() shift_register = (shift_register >> 1) | (parser.get_next_bit(tape) << 9)
// TODO: move this into the parser
const auto shift = [&] {
shift_register = (shift_register >> 1) | (parser.get_next_bit(tape) << 9);
};
// find next area of high tone
while(!tape->is_at_end() && (shift_register != 0x3ff)) {
@ -32,8 +34,6 @@ static std::unique_ptr<File::Chunk> GetNextChunk(const std::shared_ptr<Storage::
shift();
}
#undef shift
parser.reset_crc();
parser.reset_error_flag();