(self, bit)
Write a bit to tape.
Write a bit to tape.
Write a bit to tape .
def write_bit(self, bit):
        """Write a bit to tape."""
        # note that CAS-files aren't necessarily byte aligned
        # the ones we make are, but PCE's ones aren't.
        self.mask >>= 1
        if self.mask <= 0:
            self.cas.write(self.current_byte)
            self.current_byte = b'\0'
            self.mask = 0x80
        self.current_byte = int2byte(ord(self.current_byte) | (bit*self.mask))
def write_bit ( self , bit ) : # note that CAS-files aren't necessarily byte aligned # the ones we make are, but PCE's ones aren't. self . mask >>= 1 if self . mask <= 0 : self . cas . write ( self . current_byte ) self . current_byte = b'\0' self . mask = 0x80 self . current_byte = int2byte ( ord ( self . current_byte ) | ( bit * self . mask ) )