Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if pixels_to_move > 1:
- bytes_to_move = pixels_to_move // 2 #integer division operator
- pixels_to_move -= 2 * bytes_to_move
- for y in range(16):
- pos = (0x80*y) + 0x40
- filedata[pos:pos+8] = filedata[pos + bytes_to_move:8-bytes_to_move] + b'\x00' * bytes_to_move #Easy, right?
- if pixels_to_move == 1:
- for y in range(16):
- pos = (0x80*y) + 0x40
- for x in range(7):
- filedata[pos] = filedata[pos] << 4 + filedata[pos+1] >> 4 #Easy, right?
- #If you're having trouble, it shifts the current byte left 4 and adds the most significant 4 bytes of the next byte
- pos += 1
- filedata[pos] = filedata[pos] << 4 #For the last byte
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement