Fix NewWorld 1.x image generation

This commit is contained in:
Elliot Nunn 2019-05-25 15:03:32 +08:00
parent 7fbbea569d
commit f9ef4e1a35
2 changed files with 5 additions and 1 deletions

View File

@ -22,6 +22,8 @@ def build(src):
except (NotADirectoryError, FileNotFoundError):
raise dispatcher.WrongFormat
has_checksum = (b'adler32' in booter)
constants = dict()
constant_spans = dict()
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
booter[start:stop] = insert
append_checksum(booter)
if has_checksum: append_checksum(booter)
return bytes(booter)

View File

@ -2,6 +2,8 @@ import os
from os import path
import re
from .slow_lzss import decompress
from . import dispatcher