mirror of
https://github.com/elliotnunn/tbxi.git
synced 2024-06-13 11:29:39 +00:00
Fix NewWorld 1.x image generation
This commit is contained in:
parent
7fbbea569d
commit
f9ef4e1a35
|
@ -22,6 +22,8 @@ def build(src):
|
||||||
except (NotADirectoryError, FileNotFoundError):
|
except (NotADirectoryError, FileNotFoundError):
|
||||||
raise dispatcher.WrongFormat
|
raise dispatcher.WrongFormat
|
||||||
|
|
||||||
|
has_checksum = (b'adler32' in booter)
|
||||||
|
|
||||||
constants = dict()
|
constants = dict()
|
||||||
constant_spans = dict()
|
constant_spans = dict()
|
||||||
for m in re.finditer(rb'h#\s+([A-Fa-f0-9]+)\s+constant\s+([-\w]+)', booter):
|
for m in re.finditer(rb'h#\s+([A-Fa-f0-9]+)\s+constant\s+([-\w]+)', booter):
|
||||||
|
@ -72,6 +74,6 @@ def build(src):
|
||||||
assert start + len(insert) == stop
|
assert start + len(insert) == stop
|
||||||
booter[start:stop] = insert
|
booter[start:stop] = insert
|
||||||
|
|
||||||
append_checksum(booter)
|
if has_checksum: append_checksum(booter)
|
||||||
|
|
||||||
return bytes(booter)
|
return bytes(booter)
|
||||||
|
|
|
@ -2,6 +2,8 @@ import os
|
||||||
from os import path
|
from os import path
|
||||||
import re
|
import re
|
||||||
|
|
||||||
|
from .slow_lzss import decompress
|
||||||
|
|
||||||
from . import dispatcher
|
from . import dispatcher
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user