Created
September 8, 2019 23:15
-
-
Save blondie7575/2cc7770bb42390cdd2e94c3997c961cc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/Library/Frameworks/Python.framework/Versions/3.6/bin/python3 | |
import sys,os,fileinput | |
def main(argv): | |
for line in fileinput.input(): | |
bytes = line.lstrip(".byte ").rstrip('\n').split(',') | |
print(".byte ", end="") | |
for i,byte in enumerate(bytes): | |
hexValue = int(byte.lstrip('$'),16) | |
hexFormat = "${:02x}" | |
print(hexFormat.format((hexValue<<2)&255), end="") | |
if i != len(bytes) - 1: | |
print(",",end="") | |
print(""); | |
if __name__ == "__main__": | |
main(sys.argv[1:]) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
run by
cat Apple2BootFont.txt | ./Apple2FontShift.py