mirror of
https://github.com/TomHarte/CLK.git
synced 2024-11-26 08:49:37 +00:00
Resolves signed comparison mismatches.
This commit is contained in:
parent
9b75287a52
commit
8af35bc6bb
@ -247,10 +247,10 @@ void TZX::get_data_block(const DataBlock &data_block) {
|
|||||||
|
|
||||||
void TZX::get_data(const Data &data) {
|
void TZX::get_data(const Data &data) {
|
||||||
// Output data.
|
// Output data.
|
||||||
for(unsigned int c = 0; c < data.data_length; c++) {
|
for(decltype(data.data_length) c = 0; c < data.data_length; c++) {
|
||||||
uint8_t next_byte = file_.get8();
|
uint8_t next_byte = file_.get8();
|
||||||
|
|
||||||
unsigned int bits = (c != data.data_length-1) ? 8 : data.number_of_bits_in_final_byte;
|
auto bits = (c != data.data_length-1) ? 8 : data.number_of_bits_in_final_byte;
|
||||||
while(bits--) {
|
while(bits--) {
|
||||||
unsigned int pulse_length = (next_byte & 0x80) ? data.length_of_one_bit_pulse : data.length_of_zero_bit_pulse;
|
unsigned int pulse_length = (next_byte & 0x80) ? data.length_of_one_bit_pulse : data.length_of_zero_bit_pulse;
|
||||||
next_byte <<= 1;
|
next_byte <<= 1;
|
||||||
|
@ -77,7 +77,7 @@ class TZX: public PulseQueuedTape {
|
|||||||
unsigned int length_of_one_bit_pulse;
|
unsigned int length_of_one_bit_pulse;
|
||||||
unsigned int number_of_bits_in_final_byte;
|
unsigned int number_of_bits_in_final_byte;
|
||||||
unsigned int pause_after_block;
|
unsigned int pause_after_block;
|
||||||
long data_length;
|
uint32_t data_length;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct DataBlock {
|
struct DataBlock {
|
||||||
|
Loading…
Reference in New Issue
Block a user