some gui checking

This commit is contained in:
Fabian Dill
2020-03-28 21:55:41 +01:00
parent e9669a59c8
commit 9f27a60d90
2 changed files with 10 additions and 3 deletions

View File

@@ -3,7 +3,7 @@ import yaml
import os
import lzma
import hashlib
from typing import Tuple
from typing import Tuple, Optional
import Utils
from Rom import JAP10HASH, read_rom
@@ -11,11 +11,12 @@ from Rom import JAP10HASH, read_rom
base_rom_bytes = None
def get_base_rom_bytes() -> bytes:
def get_base_rom_bytes(file_name: str = None) -> bytes:
global base_rom_bytes
if not base_rom_bytes:
options = Utils.get_options()
file_name = options["general_options"]["rom_file"]
if not file_name:
file_name = options["general_options"]["rom_file"]
if not os.path.exists(file_name):
file_name = Utils.local_path(file_name)
base_rom_bytes = bytes(read_rom(open(file_name, "rb")))