extends Node static func load_json(filename: String) -> Dictionary: var file := File.new() var error := file.open(filename, File.READ) if error == OK: var result = JSON.parse(file.get_as_text()) if result.error == OK: return result.result else: print_debug(result.error_string) print_debug(result.error_line) return {} static func load_tsv(filename: String, delimiter: String = '\t') -> Dictionary: var file := File.new() var error := file.open(filename, File.READ) if error == OK: var headers := file.get_csv_line(delimiter) var n := headers.size() var output = {} while file.get_position() < file.get_len(): var line := file.get_csv_line(delimiter) var entry := {} for i in range(1, n): if line.size() > i: var token := line[i] entry[headers[i]] = token if token.begins_with('0x'): var hex := token.hex_to_int() if hex > 0: entry[headers[i]] = hex output[line[0]] = entry return output print_debug(error) return {} var SNES_PSX_addresses := load_tsv('res://data/SNES_PSX_addresses.tsv')