mirror of
https://github.com/TomHarte/CLK.git
synced 2025-01-29 20:31:46 +00:00
Switches the MFM shifter to unsigned accumulation.
Since left shifting signed numbers is undefined behaviour.
This commit is contained in:
parent
91b867a7b3
commit
2d7a4fe5f0
@ -24,7 +24,7 @@ void Shifter::set_should_obey_syncs(bool should_obey_syncs) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Shifter::add_input_bit(int value) {
|
void Shifter::add_input_bit(int value) {
|
||||||
shift_register_ = (shift_register_ << 1) | value;
|
shift_register_ = (shift_register_ << 1) | static_cast<unsigned int>(value);
|
||||||
bits_since_token_++;
|
bits_since_token_++;
|
||||||
|
|
||||||
token_ = Token::None;
|
token_ = Token::None;
|
||||||
|
@ -40,10 +40,10 @@ class Shifter {
|
|||||||
private:
|
private:
|
||||||
// Bit stream input state
|
// Bit stream input state
|
||||||
int bits_since_token_ = 0;
|
int bits_since_token_ = 0;
|
||||||
int shift_register_ = 0;
|
unsigned int shift_register_ = 0;
|
||||||
bool is_awaiting_marker_value_ = false;
|
bool is_awaiting_marker_value_ = false;
|
||||||
bool should_obey_syncs_;
|
bool should_obey_syncs_ = true;
|
||||||
Token token_;
|
Token token_ = None;
|
||||||
|
|
||||||
// input configuration
|
// input configuration
|
||||||
bool is_double_density_ = false;
|
bool is_double_density_ = false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user