bloody auto-reformat
This commit is contained in:
parent
0fa896f8f6
commit
333a29ab47
9
Patch.py
9
Patch.py
|
@ -2,8 +2,11 @@ import bsdiff4
|
||||||
import yaml
|
import yaml
|
||||||
import os
|
import os
|
||||||
import lzma
|
import lzma
|
||||||
|
import hashlib
|
||||||
|
import logging
|
||||||
|
|
||||||
import Utils
|
import Utils
|
||||||
|
from Rom import JAP10HASH
|
||||||
|
|
||||||
base_rom_bytes = None
|
base_rom_bytes = None
|
||||||
|
|
||||||
|
@ -15,6 +18,12 @@ def get_base_rom_bytes() -> bytes:
|
||||||
options = Utils.parse_yaml(f.read())
|
options = Utils.parse_yaml(f.read())
|
||||||
file_name = options["general_options"]["rom_file"]
|
file_name = options["general_options"]["rom_file"]
|
||||||
base_rom_bytes = load_bytes(file_name)
|
base_rom_bytes = load_bytes(file_name)
|
||||||
|
|
||||||
|
basemd5 = hashlib.md5()
|
||||||
|
basemd5.update(base_rom_bytes)
|
||||||
|
if JAP10HASH != basemd5.hexdigest():
|
||||||
|
logging.getLogger('').warning('Supplied Base Rom does not match known MD5 for JAP(1.0) release.'
|
||||||
|
' Will try to patch anyway.')
|
||||||
return base_rom_bytes
|
return base_rom_bytes
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue