mirror of
https://github.com/Artrios/pokecarde.git
synced 2026-04-03 23:34:52 -05:00
- Improvements to build, which should help find nevpk and rgbds a little easier. - Support for berry cards K007-K012 has been added (original Japanese) and they have received unofficial localizations. - Unofficial Localizations for cards B001 - B048 have now been included. - Cards P001-P004 have now been added (Official English and Japanese) - Cards P005-P008 have now been added (official Japanese) and have also received unofficial localizations. - Cards N001-N008 have now been added (official Japanese) and have also received unofficial localizations. - Unofficial localization for card O001 has been improved to be more in-line with official localizations of the time. tl;dr All Ruby/Sapphire e-Reader cards are now included and exist in their original English/Japanese, and have unofficial localizations if no official translation is available.
30 lines
677 B
Python
30 lines
677 B
Python
# -*- coding: utf-8 -*-
|
||
#!/usr/bin/env python2.7
|
||
import sys
|
||
|
||
out = open(sys.argv[2], 'w')
|
||
buffering = False
|
||
buf = ""
|
||
with open(sys.argv[1], 'rb') as f:
|
||
f.read(256) # skip to $0100
|
||
while True:
|
||
byte = f.read(1)
|
||
if not byte:
|
||
break
|
||
|
||
# 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):
|
||
buf += byte
|
||
buffering = True
|
||
elif buffering and ord(byte) == 0xFF:
|
||
out.write(buf)
|
||
buf = byte
|
||
elif buffering:
|
||
out.write(buf)
|
||
out.write(byte)
|
||
buf = ""
|
||
buffering = False
|
||
else:
|
||
out.write(byte)
|
||
f.closed |