1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-07-03 11:30:02 +00:00

Stores expected bit length.

This commit is contained in:
Thomas Harte 2019-06-01 19:08:29 -04:00
parent 48d837c636
commit da2b190288
2 changed files with 10 additions and 0 deletions

View File

@ -175,7 +175,15 @@ void IWM::write(int address, uint8_t input) {
bit 6: 1 = MZ-reset.
bit 7: reserved for future expansion.
*/
mode_ = input;
switch(mode_ & 0x18) {
case 0x00: bit_length_ = Cycles(24); break; // slow mode, 7Mhz
case 0x08: bit_length_ = Cycles(12); break; // fast mode, 7Mhz
case 0x10: bit_length_ = Cycles(32); break; // slow mode, 8Mhz
case 0x18: bit_length_ = Cycles(16); break; // fast mode, 8Mhz
}
printf("IWM mode is now %02x\n", mode_);
break;

View File

@ -53,6 +53,8 @@ class IWM {
Cycles cycles_until_motor_off_;
void access(int address);
Cycles bit_length_;
};