mirror of
https://github.com/JHDev2006/Super-Mario-Bros.-Remastered-Public.git
synced 2025-10-22 07:28:14 +00:00
Updated RomVerifier.gd to add support for the European version (#97)
Co-authored-by: Joe H <97353363+JHDev2006@users.noreply.github.com>
This commit is contained in:
@@ -1,8 +1,8 @@
|
|||||||
class_name ROMVerifier
|
class_name ROMVerifier
|
||||||
extends Node
|
extends Node
|
||||||
|
|
||||||
# Array of valid ROM hashes
|
const VALID_HASHES := [
|
||||||
const VALID_HASH := [
|
"6a54024d5abe423b53338c9b418e0c2ffd86fed529556348e52ffca6f9b53b1a",
|
||||||
"c9b34443c0414f3b91ef496d8cfee9fdd72405d673985afa11fb56732c96152b"
|
"c9b34443c0414f3b91ef496d8cfee9fdd72405d673985afa11fb56732c96152b"
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -40,7 +40,7 @@ func find_local_rom() -> String:
|
|||||||
if file_name.to_lower().ends_with(".nes"):
|
if file_name.to_lower().ends_with(".nes"):
|
||||||
return exe_dir.path_join(file_name)
|
return exe_dir.path_join(file_name)
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
func on_file_dropped(files: PackedStringArray) -> void:
|
func on_file_dropped(files: PackedStringArray) -> void:
|
||||||
for file in files:
|
for file in files:
|
||||||
if file.ends_with(".zip"):
|
if file.ends_with(".zip"):
|
||||||
@@ -69,9 +69,9 @@ static func get_hash(file_path: String) -> String:
|
|||||||
var data := file_bytes.slice(16)
|
var data := file_bytes.slice(16)
|
||||||
return Marshalls.raw_to_base64(data).sha256_text()
|
return Marshalls.raw_to_base64(data).sha256_text()
|
||||||
|
|
||||||
static func is_valid_rom(rom_path: String) -> bool:
|
static func is_valid_rom(rom_path := "") -> bool:
|
||||||
var hash := get_hash(rom_path)
|
return get_hash(rom_path) in VALID_HASHES
|
||||||
return hash in VALID_HASH
|
|
||||||
|
|
||||||
func error() -> void:
|
func error() -> void:
|
||||||
%Error.show()
|
%Error.show()
|
||||||
|
Reference in New Issue
Block a user