Merge of BluRosie code to add compat for HG-Engine

This commit is contained in:
Miguel Terol Espino 2023-06-15 17:27:29 +02:00 committed by AdAstra-LD
parent 7fbeda7a7e
commit 7b9d9ac8ce
2 changed files with 13 additions and 4 deletions

View File

@ -8782,7 +8782,10 @@ namespace DSPRE {
int iconPalTableOffsetFromFileStart = (int)(RomInfo.monIconPalTableAddress - RomInfo.synthOverlayLoadAddress);
if (iconPalTableOffsetFromFileStart >= 0) { // if iconPalTableAddress >= RomInfo.synthOverlayLoadAddress
//In other words, if the pointer shows the table was moved to the synthetic overlay
iconTablePath = gameDirs[DirNames.synthOverlay].unpackedDir + "\\" + ROMToolboxDialog.expandedARMfileID.ToString("D4");
if (File.Exists(DSUtils.GetOverlayPath(129)))
iconTablePath = DSUtils.GetOverlayPath(129); // HG-engine new overlay for icons
else
iconTablePath = gameDirs[DirNames.synthOverlay].unpackedDir + "\\" + ROMToolboxDialog.expandedARMfileID.ToString("D4");
} else {
iconPalTableOffsetFromFileStart = (int)(RomInfo.monIconPalTableAddress - DSUtils.ARM9.address);
iconTablePath = RomInfo.arm9Path;

View File

@ -531,9 +531,15 @@ namespace DSPRE {
"displayed incorrectly or not displayed at all.", "Decompression error", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
if (ramAddressOfTable >= RomInfo.synthOverlayLoadAddress) { // if the pointer shows the table was moved to the synthetic overlay
OWTableOffset = ramAddressOfTable - RomInfo.synthOverlayLoadAddress;
OWtablePath = gameDirs[DirNames.synthOverlay].unpackedDir + "\\" + ROMToolboxDialog.expandedARMfileID.ToString("D4");
if (ramAddressOfTable >= RomInfo.synthOverlayLoadAddress) {
// if the pointer shows the table was moved to the synthetic overlay
if (File.Exists(DSUtils.GetOverlayPath(131))) {
OWTableOffset = ramAddressOfTable - DSUtils.GetOverlayRAMAddress(131);
OWtablePath = DSUtils.GetOverlayPath(131); // HG-Engine new OW overlay
} else {
OWTableOffset = ramAddressOfTable - RomInfo.synthOverlayLoadAddress;
OWtablePath = gameDirs[DirNames.synthOverlay].unpackedDir + "\\" + ROMToolboxDialog.expandedARMfileID.ToString("D4");
}
} else {
OWTableOffset = ramAddressOfTable - ov1Address;
OWtablePath = ov1Path;