mirror of
https://github.com/TomHarte/CLK.git
synced 2024-12-27 16:31:31 +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) {
|
||||
shift_register_ = (shift_register_ << 1) | value;
|
||||
shift_register_ = (shift_register_ << 1) | static_cast<unsigned int>(value);
|
||||
bits_since_token_++;
|
||||
|
||||
token_ = Token::None;
|
||||
|
@ -40,10 +40,10 @@ class Shifter {
|
||||
private:
|
||||
// Bit stream input state
|
||||
int bits_since_token_ = 0;
|
||||
int shift_register_ = 0;
|
||||
unsigned int shift_register_ = 0;
|
||||
bool is_awaiting_marker_value_ = false;
|
||||
bool should_obey_syncs_;
|
||||
Token token_;
|
||||
bool should_obey_syncs_ = true;
|
||||
Token token_ = None;
|
||||
|
||||
// input configuration
|
||||
bool is_double_density_ = false;
|
||||
|
Loading…
Reference in New Issue
Block a user