1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-06-25 18:30:07 +00:00

Fix[/revert]: the fetch pointer should be _ahead_.

This commit is contained in:
Thomas Harte 2023-02-13 21:10:14 -05:00
parent 5143960970
commit 169d7a7418

View File

@ -42,12 +42,14 @@ Base<personality>::Base() :
mode_timing_.line_interrupt_position = Timing<personality>::StartOfSync;
}
// Establish that output is delayed after reading by `output_lag` cycles; start
// at a random position.
fetch_pointer_.row = rand() % 262;
fetch_pointer_.column = rand() % (Timing<personality>::CyclesPerLine - output_lag);
output_pointer_.row = fetch_pointer_.row;
output_pointer_.column = fetch_pointer_.column + output_lag;
// Establish that output is delayed after reading by `output_lag` cycles,
// i.e. the fetch pointer is currently _ahead_ of the output pointer.
//
// Start at a random position.
output_pointer_.row = rand() % 262;
output_pointer_.column = rand() % (Timing<personality>::CyclesPerLine - output_lag);
fetch_pointer_.row = fetch_pointer_.row;
fetch_pointer_.column = output_pointer_.column + output_lag;
}
template <Personality personality>