From 08dc0d8e354266d6b7796e437c55d3af81f76147 Mon Sep 17 00:00:00 2001 From: Luke Hubmayer-Werner Date: Wed, 6 Dec 2023 18:52:45 +1030 Subject: [PATCH] Naive SNES ROM header strip --- scripts/loaders/RomLoader.gd | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/loaders/RomLoader.gd b/scripts/loaders/RomLoader.gd index b6022f2..25d7528 100644 --- a/scripts/loaders/RomLoader.gd +++ b/scripts/loaders/RomLoader.gd @@ -64,6 +64,8 @@ func load_snes_audio_thread(data_and_buffer: Array): SoundLoader.parse_rom(data_and_buffer[0], data_and_buffer[1]) func load_snes_rom_from_bytes(bytes: PoolByteArray) -> void: + if (len(bytes) % 1024) == 512: # Naive header strip + bytes = bytes.subarray(512, -1) self.snes_bytes = bytes self.snes_buffer = StreamPeerBuffer.new() self.snes_buffer.data_array = bytes