generated from loic/c-template
fix: Colleen_asm
This commit is contained in:
parent
4844f4be1b
commit
53b66c29ee
2 changed files with 73 additions and 38 deletions
25
gen_src.py
Normal file
25
gen_src.py
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
#!/usr/bin/env python3
|
||||
import sys
|
||||
import re
|
||||
|
||||
|
||||
def encode(data: bytes) -> str:
|
||||
parts = []
|
||||
for b in data:
|
||||
parts.append(str(b))
|
||||
return ', '.join(parts)
|
||||
|
||||
|
||||
def main():
|
||||
path = sys.argv[1] if len(sys.argv) > 1 else 'src/Colleen.s'
|
||||
|
||||
with open(path, 'rb') as f:
|
||||
content = f.read()
|
||||
|
||||
template = re.sub(rb'^src: db .*$', b'src: db ~', content, flags=re.MULTILINE)
|
||||
|
||||
print(f'src: db {encode(template)}')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
File diff suppressed because one or more lines are too long
Loading…
Add table
Reference in a new issue