New summon script support

This commit is contained in:
sShemet
2026-01-20 12:53:32 +05:00
parent cbad01271c
commit e8f00fef4d
6 changed files with 36 additions and 110 deletions

View File

@@ -1210,9 +1210,9 @@ rleEnd:
' 'If binFile.Count <> 153 Then MsgBox("WRONG0004 FILE!!! (files count not 152)") : Exit Sub
' Update0004ScriptTable()
'Case 77
' If binFile.Count <> 150 Then MsgBox("WRONG 0077 FILE!!! (files count not 150)") : Exit Sub
' Update0073SummonScriptTable(addresses) 'summon scripts table in 0073
Case 35
If binFile.Count <> 164 Then MsgBox("WRONG 0035 FILE!!! (files count not 164)") : Exit Sub
Update0032SummonScriptTable(addresses) 'summon scripts table in 0032 & 33. Summon and mutation code
'Case 1075
@@ -1316,46 +1316,32 @@ rleEnd:
End Sub
Public Sub Update0073SummonScriptTable(ByRef addr As List(Of Integer))
Public Sub Update0032SummonScriptTable(ByRef addr As List(Of Integer))
Dim cd = New ISOTools
Dim fTable = cd.getCDfile(UserPath.Text, files1(73).Sector, files1(73).Sizw)
Dim fTable2 = cd.getCDfile(UserPath.Text, files1(74).Sector, files1(74).Sizw)
Dim fTable = cd.getCDfile(UserPath.Text, files1(32).Sector, files1(32).Sizw) 'Summon Code
Dim fTable2 = cd.getCDfile(UserPath.Text, files1(33).Sector, files1(33).Sizw) 'Mutation Code
Dim lastSize = 0
For a = 0 To 149
Dim curAddr = a * 8 + 16324
Dim curAddr2 = a * 8 + 15120
Dim cursect As Int16 = addr(a) \ 2048
Dim modSect As Int16 = addr(a) Mod 2048
fTable(curAddr) = BitConverter.GetBytes(modSect)(0)
fTable(curAddr + 1) = BitConverter.GetBytes(modSect)(1) 'BE or LE???
fTable(curAddr + 2) = BitConverter.GetBytes(cursect)(0)
fTable(curAddr + 3) = BitConverter.GetBytes(cursect)(1) 'BE or LE???
fTable2(curAddr2) = BitConverter.GetBytes(modSect)(0)
fTable2(curAddr2 + 1) = BitConverter.GetBytes(modSect)(1) 'BE or LE???
fTable2(curAddr2 + 2) = BitConverter.GetBytes(cursect)(0)
fTable2(curAddr2 + 3) = BitConverter.GetBytes(cursect)(1) 'BE or LE???
Dim sectorsToRead = 1
If modSect + binFile(a).Size > 2048 Then sectorsToRead = 2
fTable(curAddr + 4) = sectorsToRead
fTable(curAddr + 5) = 0
fTable(curAddr + 6) = 1
fTable(curAddr + 7) = 0
fTable2(curAddr2 + 4) = sectorsToRead
fTable2(curAddr2 + 5) = 0
fTable2(curAddr2 + 6) = 1
fTable2(curAddr2 + 7) = 0
For a = 0 To 163
Dim curAddr = a * 4 + &H35BC
Dim curAddr2 = a * 4 + &H2D8C
Dim offset = BitConverter.GetBytes(addr(a))
fTable(curAddr) = offset(0)
fTable(curAddr + 1) = offset(1)
fTable(curAddr + 2) = offset(2)
fTable(curAddr + 3) = 2
fTable2(curAddr2) = offset(0)
fTable2(curAddr2 + 1) = offset(1)
fTable2(curAddr2 + 2) = offset(2)
fTable2(curAddr2 + 3) = 2
Next
cd.saveCDfile(UserPath.Text, files1(73).Sector, files1(73).Sizw, fTable.ToArray)
cd.saveCDfile(UserPath.Text, files1(74).Sector, files1(74).Sizw, fTable2.ToArray)
cd.saveCDfile(UserPath.Text, files1(32).Sector, files1(32).Sizw, fTable.ToArray)
cd.saveCDfile(UserPath.Text, files1(33).Sector, files1(33).Sizw, fTable2.ToArray)
End Sub