Naive SNES ROM header strip

This commit is contained in:
Luke Hubmayer-Werner 2023-12-06 18:52:45 +10:30
parent ced909bae4
commit 08dc0d8e35
1 changed files with 2 additions and 0 deletions

View File

@ -64,6 +64,8 @@ func load_snes_audio_thread(data_and_buffer: Array):
SoundLoader.parse_rom(data_and_buffer[0], data_and_buffer[1]) SoundLoader.parse_rom(data_and_buffer[0], data_and_buffer[1])
func load_snes_rom_from_bytes(bytes: PoolByteArray) -> void: 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_bytes = bytes
self.snes_buffer = StreamPeerBuffer.new() self.snes_buffer = StreamPeerBuffer.new()
self.snes_buffer.data_array = bytes self.snes_buffer.data_array = bytes