diff --git a/scripts/stripgbc.py b/scripts/stripgbc.py index fcf24b2..fd193d0 100644 --- a/scripts/stripgbc.py +++ b/scripts/stripgbc.py @@ -13,9 +13,11 @@ with open(sys.argv[1], 'rb') as f: # the program shall end with $FF followed only by $00 bytes # for every $FF we hit, buffer until something that isn’t $00 - if (not buffering and ord(byte) == 0xFF) or (buffering and ord(byte) == 0x00): + if not buffering and ord(byte) == 0xFF: buf += byte buffering = True + elif buffering and ord(byte) == 0x00: + buf += byte elif buffering and ord(byte) == 0xFF: out.write(buf) buf = byte