From f0b5ad2d53849fe7000ca0f5c91e1e71f37a1a4f Mon Sep 17 00:00:00 2001 From: AdAstra-LD <76622070+AdAstra-LD@users.noreply.github.com> Date: Wed, 23 Mar 2022 23:42:24 +0100 Subject: [PATCH] Ov1 decompression attempt before reading --- DS_Map/RomInfo.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/DS_Map/RomInfo.cs b/DS_Map/RomInfo.cs index a799aed..c4d2b51 100644 --- a/DS_Map/RomInfo.cs +++ b/DS_Map/RomInfo.cs @@ -485,6 +485,15 @@ namespace DSPRE { } break; case gFamEnum.HGSS: + if (DSUtils.CheckOverlayHasCompressionFlag(1)) { + if (DSUtils.OverlayIsCompressed(1)) { + if (DSUtils.DecompressOverlay(1) < 0) { + MessageBox.Show("Overlay 1 couldn't be decompressed.\nOverworld sprites in the Event Editor will be " + + "displayed incorrectly or not displayed at all.", "Decompression error", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + } + string ov1Path = DSUtils.GetOverlayPath(1); uint ov1Address = DSUtils.GetOverlayRAMAddress(1);