commit 571b9550cc1f5090992aceb4b45ac68190c2890b Author: sShemet Date: Fri May 10 14:06:43 2024 +0500 init commit diff --git a/.vs/p2epPSX_CDToolkit/FileContentIndex/e783bc7d-ab25-43b5-9b26-5c3a213adcd5.vsidx b/.vs/p2epPSX_CDToolkit/FileContentIndex/e783bc7d-ab25-43b5-9b26-5c3a213adcd5.vsidx new file mode 100644 index 0000000..a0623d7 Binary files /dev/null and b/.vs/p2epPSX_CDToolkit/FileContentIndex/e783bc7d-ab25-43b5-9b26-5c3a213adcd5.vsidx differ diff --git a/.vs/p2epPSX_CDToolkit/v15/.suo b/.vs/p2epPSX_CDToolkit/v15/.suo new file mode 100644 index 0000000..2b1e2fb Binary files /dev/null and b/.vs/p2epPSX_CDToolkit/v15/.suo differ diff --git a/.vs/p2epPSX_CDToolkit/v15/Server/sqlite3/db.lock b/.vs/p2epPSX_CDToolkit/v15/Server/sqlite3/db.lock new file mode 100644 index 0000000..e69de29 diff --git a/.vs/p2epPSX_CDToolkit/v15/Server/sqlite3/storage.ide b/.vs/p2epPSX_CDToolkit/v15/Server/sqlite3/storage.ide new file mode 100644 index 0000000..d805ed9 Binary files /dev/null and b/.vs/p2epPSX_CDToolkit/v15/Server/sqlite3/storage.ide differ diff --git a/.vs/p2epPSX_CDToolkit/v17/.suo b/.vs/p2epPSX_CDToolkit/v17/.suo new file mode 100644 index 0000000..276cab4 Binary files /dev/null and b/.vs/p2epPSX_CDToolkit/v17/.suo differ diff --git a/.vs/p2epPSX_CDToolkit/v17/DocumentLayout.json b/.vs/p2epPSX_CDToolkit/v17/DocumentLayout.json new file mode 100644 index 0000000..aa68d02 --- /dev/null +++ b/.vs/p2epPSX_CDToolkit/v17/DocumentLayout.json @@ -0,0 +1,41 @@ +{ + "Version": 1, + "WorkspaceRootPath": "C:\\Users\\Sergey\\source\\repos\\p2epPSX_CDToolkit\\", + "Documents": [ + { + "AbsoluteMoniker": "D:0:0:{E92973F5-DC31-4C53-B473-A203A0E6AA29}|p2isPSX_CDToolkit\\p2epPSX_CDToolkit.vbproj|c:\\users\\sergey\\source\\repos\\p2eppsx_cdtoolkit\\p2ispsx_cdtoolkit\\scripttools.vb||{2C015C70-C72C-11D0-88C3-00A0C9110049}", + "RelativeMoniker": "D:0:0:{E92973F5-DC31-4C53-B473-A203A0E6AA29}|p2isPSX_CDToolkit\\p2epPSX_CDToolkit.vbproj|solutionrelative:p2ispsx_cdtoolkit\\scripttools.vb||{2C015C70-C72C-11D0-88C3-00A0C9110049}" + } + ], + "DocumentGroupContainers": [ + { + "Orientation": 0, + "VerticalTabListWidth": 256, + "DocumentGroups": [ + { + "DockedWidth": 200, + "SelectedChildIndex": 1, + "Children": [ + { + "$type": "Bookmark", + "Name": "ST:0:0:{cce594b6-0c39-4442-ba28-10c64ac7e89f}" + }, + { + "$type": "Document", + "DocumentIndex": 0, + "Title": "ScriptTools.vb", + "DocumentMoniker": "C:\\Users\\Sergey\\source\\repos\\p2epPSX_CDToolkit\\p2isPSX_CDToolkit\\ScriptTools.vb", + "RelativeDocumentMoniker": "p2isPSX_CDToolkit\\ScriptTools.vb", + "ToolTip": "C:\\Users\\Sergey\\source\\repos\\p2epPSX_CDToolkit\\p2isPSX_CDToolkit\\ScriptTools.vb", + "RelativeToolTip": "p2isPSX_CDToolkit\\ScriptTools.vb", + "ViewState": "AQIAAFoFAAAAAAAAAAAAAHgFAAAAAAAA", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003361|", + "WhenOpened": "2024-05-06T18:10:40.088Z", + "EditorCaption": "" + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/.vs/p2isPSX_CDToolkit/v14/.suo b/.vs/p2isPSX_CDToolkit/v14/.suo new file mode 100644 index 0000000..c02f3be Binary files /dev/null and b/.vs/p2isPSX_CDToolkit/v14/.suo differ diff --git a/.vs/p2isPSX_CDToolkit/v15/.suo b/.vs/p2isPSX_CDToolkit/v15/.suo new file mode 100644 index 0000000..4ae8a32 Binary files /dev/null and b/.vs/p2isPSX_CDToolkit/v15/.suo differ diff --git a/.vs/p2isPSX_CDToolkit/v15/Server/sqlite3/db.lock b/.vs/p2isPSX_CDToolkit/v15/Server/sqlite3/db.lock new file mode 100644 index 0000000..e69de29 diff --git a/.vs/p2isPSX_CDToolkit/v15/Server/sqlite3/storage.ide b/.vs/p2isPSX_CDToolkit/v15/Server/sqlite3/storage.ide new file mode 100644 index 0000000..b19bbbf Binary files /dev/null and b/.vs/p2isPSX_CDToolkit/v15/Server/sqlite3/storage.ide differ diff --git a/.vs/p2isPSX_CDToolkit/v15/Server/sqlite3/storage.ide-shm b/.vs/p2isPSX_CDToolkit/v15/Server/sqlite3/storage.ide-shm new file mode 100644 index 0000000..c309822 Binary files /dev/null and b/.vs/p2isPSX_CDToolkit/v15/Server/sqlite3/storage.ide-shm differ diff --git a/.vs/p2isPSX_CDToolkit/v15/Server/sqlite3/storage.ide-wal b/.vs/p2isPSX_CDToolkit/v15/Server/sqlite3/storage.ide-wal new file mode 100644 index 0000000..2b4fe29 Binary files /dev/null and b/.vs/p2isPSX_CDToolkit/v15/Server/sqlite3/storage.ide-wal differ diff --git a/p2epPSX_CDToolkit.sln b/p2epPSX_CDToolkit.sln new file mode 100644 index 0000000..d6d3c71 --- /dev/null +++ b/p2epPSX_CDToolkit.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.28307.902 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "p2epPSX_CDToolkit", "p2isPSX_CDToolkit\p2epPSX_CDToolkit.vbproj", "{E92973F5-DC31-4C53-B473-A203A0E6AA29}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {E92973F5-DC31-4C53-B473-A203A0E6AA29}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E92973F5-DC31-4C53-B473-A203A0E6AA29}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E92973F5-DC31-4C53-B473-A203A0E6AA29}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E92973F5-DC31-4C53-B473-A203A0E6AA29}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {9C1C757D-614E-4AEC-A43E-AB1FB7AC5BB7} + EndGlobalSection +EndGlobal diff --git a/p2isPSX_CDToolkit/Additions.vb b/p2isPSX_CDToolkit/Additions.vb new file mode 100644 index 0000000..bd726b9 --- /dev/null +++ b/p2isPSX_CDToolkit/Additions.vb @@ -0,0 +1,625 @@ +Imports System.IO +Imports System.Text +Imports System.IO.Compression + +Partial Class Form1 + + Private Sub ImportCode_Click(sender As Object, e As EventArgs) Handles ImportCode.Click + + If Not UserRadio.Checked Then MsgBox("YOU CAN IMPORT ONLY IN USER ISO!!!") : Exit Sub + + Dim cd = New ISOTools + + 'OpensFile + + OpenFileDialog1.Multiselect = True + If OpenFileDialog1.ShowDialog <> DialogResult.OK Then Exit Sub + OpenFileDialog1.Multiselect = False + + For Each filee In OpenFileDialog1.FileNames + + Dim fileInfo = Path.GetFileName(filee) + + Dim f = File.ReadAllBytes(filee) + + If fileInfo.Contains("SLPS_028.25") Then + cd.saveCDfile(UserPath.Text, 27, UBound(f) + 1, f) + End If + + + Next + + + MsgBox(String.Format("Imported {0} files ", UBound(OpenFileDialog1.FileNames) + 1), MsgBoxStyle.Exclamation) + + End Sub + + + Private Sub ExpMainExe_Click(sender As Object, e As EventArgs) Handles ExpMainExe.Click + Dim iso = New ISOTools + Dim fil = iso.getCDfile(getFilnam, 27, 1812408) + SaveFileDialog1.FileName = WorkDir.Text & "SLPS_028.25" + If SaveFileDialog1.ShowDialog <> DialogResult.OK Then Exit Sub + + My.Computer.FileSystem.WriteAllBytes(SaveFileDialog1.FileName, fil.ToArray, False) + End Sub + + Private Sub Export181RUS_Click(sender As Object, e As EventArgs) Handles Export181RUS.Click + + Dim files As New List(Of String) + files = IO.Directory.GetFiles("D:\Games\PSX\Persona 2 - Batsu (NTSC-J) [SLPS-02825]\Export\UnRLE\0057_ALL_SCENERY\", "*.TRNSL").ToList + Dim OutPut_Dir = "D:\Games\PSX\Persona 2 - Batsu (NTSC-J) [SLPS-02825]\Export\UnRLE\0057_ALL_SCENERY\TRANSLATED_RAW\" + Dim iso = New ISOTools + Dim filnam = getFilnam() + Dim r = New rleTools + + For a = 57 To 397 + + Dim fil = iso.getCDfile(filnam, files1(a).Sector, files1(a).Sizw) + + If a = 397 Then + fil = iso.getCDfile(filnam, files1(390).Sector, files1(390).Sizw) 'заменяем последний файл... + My.Computer.FileSystem.WriteAllBytes(OutPut_Dir & a.ToString("D4") & "_orig.bin", fil.ToArray, False) : Continue For + End If + + Dim ind = files.FindIndex(Function(x) x.Contains(a.ToString("D4"))) + + 'If file withoout translation + If ind = -1 Then + My.Computer.FileSystem.WriteAllBytes(OutPut_Dir & a.ToString("D4") & "_orig.bin", fil.ToArray, False) : Continue For + End If + + Debug.WriteLine("Working On......" & a.ToString("D4")) + DeconstructFile(fil.ToArray) 'here is separated binfile + + Dim curfile As rleFile = binFile.Last + Dim RusFile = My.Computer.FileSystem.ReadAllBytes(files(ind)) + + binFile.Last.Bytes = r.decodeRLEnew(RusFile, curfile).ToArray 'Pack and replace 8th file + + 'АРХИВИРУЕМ МАССИВ ФАЙЛОВ ДЛЯ ЗАПИСИ В ОДИН ФАЙЛ + Dim lastSectorID As Integer = 0 + Dim finalPack = New List(Of Byte) + + For Each bin In binFile + + 'filling sector to end (making sectorgap) in the middle of the file + If bin.SectorID <> lastSectorID Then + Dim gap = 2048 - (finalPack.Count Mod 2048) + For g = 0 To gap - 1 + finalPack.Add(0) + Next + End If + + 'Adding currentfile Sector Size (for at least 0004) + bin.SectorSize = bin.Bytes.Count \ 2048 + If bin.Bytes.Count Mod 2048 > 0 Then bin.SectorSize += 1 + + 'adding currentfile and address for 0x0090 + finalPack.AddRange(bin.Bytes) + + 'AddingBytesAfter + For g = 0 To bin.BytesAfter - 1 + finalPack.Add(0) + Next + + lastSectorID = bin.SectorID + Next + + 'Fill file to END of Sector + If finalPack.Count Mod 2048 > 0 Then + For g = 1 To (2048 - (finalPack.Count Mod 2048)) + finalPack.Add(0) + Next g + End If + My.Computer.FileSystem.WriteAllBytes(OutPut_Dir & a.ToString("D4") & "_rus.bin", finalPack.ToArray, False) + Next + MsgBox("Export Done") + End Sub + + + + Private Sub SceneryImport_Click(sender As Object, e As EventArgs) Handles SceneryImport.Click + + + If Not UserRadio.Checked Then MsgBox("YOU CAN IMPORT ONLY IN USER ISO!!!") : Exit Sub + If IsNothing(files1) Then MsgBox("PLEASE READ CD FILES FIRST!") : Exit Sub + + Dim files = IO.Directory.GetFiles("D:\Games\PSX\Persona 2 - Batsu (NTSC-J) [SLPS-02825]\Export\UnRLE\0057_ALL_SCENERY\TRANSLATED_RAW\", "*.bin").ToList + Dim filesSize = 0 + 'For Each f In files + ' filesSize += My.Computer.FileSystem.GetFileInfo(f).Length + 'Next + Dim curSector = files1(57).Sector + Dim max = files1(398).Sector + + 'MsgBox($"Sectors have - {max - curSector}" & vbCrLf & $"Sectors in files - {filesSize / 2048}") : Exit Sub + Dim iso = New ISOTools + Dim filnam = getFilnam() + + + + For a = 57 To 397 + 'reading files + Debug.WriteLine("Working On......" & a.ToString("D4")) + Dim ind = files.FindIndex(Function(x) x.Contains(a.ToString("D4"))) + If ind = -1 Then Debug.WriteLine("NOT FOUND") : Continue For + Dim impFile = My.Computer.FileSystem.ReadAllBytes(files(ind)) + + Dim SectorSizw As Integer = (UBound(impFile) + 1) / 2048 + + 'Overload check + If curSector + SectorSizw >= max Then MsgBox("!!!OVERLOAD at file " & a) : Exit For + + + + 'debugfile move to end of disk + ' If a = 570 Then curSector = 278100 + + + + iso.saveCDfile(filnam, curSector, UBound(impFile) + 1, impFile) + + 'Update SectorNumber and FileSize In FileArray + files1(a).Sizw = UBound(impFile) + 1 + files1(a).Sector = curSector + + + + curSector += SectorSizw + + + Next + + 'Update FileTable In ISO + iso.UpdateFileListTable(filnam, files1) + + MsgBox("Files Imported") + + End Sub + + + Private Sub Export1112RUS_Click(sender As Object, e As EventArgs) Handles Export1112RUS.Click + + Dim files As New List(Of String) + files = IO.Directory.GetFiles("D:\Games\PSX\Persona.2.Innocent.Sin\Export\UnRLE\1112_ALL_CITIES_SCRIPTS", "*.TRNSL").ToList + Dim OutPut_Dir = "D:\Games\PSX\Persona.2.Innocent.Sin\Export\UnRLE\1112_ALL_CITIES_SCRIPTS\TRANSLATED_RAW\" + Dim iso = New ISOTools + Dim filnam = getFilnam() + Dim r = New rleTools + + For a = 1112 To 1117 + + Dim fil = iso.getCDfile(filnam, files1(a).Sector, files1(a).Sizw) + + Dim ind = files.FindIndex(Function(x) x.Contains(a.ToString("D4"))) + 'If file withoout translation + If ind = -1 Then + My.Computer.FileSystem.WriteAllBytes(OutPut_Dir & a.ToString("D4") & "_orig.bin", fil.ToArray, False) : Continue For + End If + + + Debug.WriteLine("Working On......" & a.ToString("D4")) + DeconstructFile(fil.ToArray) 'here is separated binfile + + Dim curfile As rleFile = binFile(binFile.Count - 1) + Dim RusFile = My.Computer.FileSystem.ReadAllBytes(files(ind)) + + binFile(binFile.Count - 1).Bytes = r.decodeRLEnew(RusFile, curfile).ToArray 'Pack and replace 8th file + + + 'АРХИВИРУЕМ МАССИВ ФАЙЛОВ ДЛЯ ЗАПИСИ В ОДИН ФАЙЛ + Dim lastSectorID As Integer = 0 + Dim finalPack = New List(Of Byte) + Dim addresses = New List(Of Integer) 'Start Addr for all files + + For Each bin In binFile + + 'filling sector to end (making sectorgap) in the middle of the file + If bin.SectorID <> lastSectorID Then + Dim gap = 2048 - (finalPack.Count Mod 2048) + For g = 0 To gap - 1 + finalPack.Add(0) + Next + End If + + 'Adding currentfile Sector Size (for at least 0004) + bin.SectorSize = bin.Bytes.Count \ 2048 + If bin.Bytes.Count Mod 2048 > 0 Then bin.SectorSize += 1 + + + 'adding currentfile and address for 0x0090 + addresses.Add(finalPack.Count) + finalPack.AddRange(bin.Bytes) + + 'AddingBytesAfter + For g = 0 To bin.BytesAfter - 1 + finalPack.Add(0) + Next + + lastSectorID = bin.SectorID + + + Next + + 'Fill file to END of Sector + + If finalPack.Count Mod 2048 > 0 Then + For g = 1 To (2048 - (finalPack.Count Mod 2048)) + finalPack.Add(0) + Next g + End If + + 'SAVING POINTERS TABLE + SavePointersTableToFile(addresses, OutPut_Dir & a.ToString("D4") & ".pointers", binFile) + + + + My.Computer.FileSystem.WriteAllBytes(OutPut_Dir & a.ToString("D4") & "_rus.bin", finalPack.ToArray, False) + + + Next + + + MsgBox("Export Done") + + + + End Sub + + Private Sub ConvertEventsForEditing_Click(sender As Object, e As EventArgs) Handles ConvertEventsForEditing.Click + Dim srcDir = "D:\Games\PSX\Persona 2 - Batsu (NTSC-J) [SLPS-02825]\Export\UnRLE\0057_ALL_SCENERY" + Dim destDir = "D:\Games\PSX\Persona 2 - Batsu (NTSC-J) [SLPS-02825]\Export\P2EP_Editing\" + Dim files As New List(Of String) + files = IO.Directory.GetFiles(srcDir, "*.txt").ToList + Dim s = New ScriptTools + For Each f In files + Dim a = Path.GetFileName(f) + s.ConvertForEdit(f, destDir & Path.GetFileName(f)) + Next + + MsgBox("Done!") + End Sub + + Private Sub MakePointers_Click(sender As Object, e As EventArgs) Handles MakePointers.Click + + If binFile.Count = 0 Or CDFileList.SelectedIndex = -1 Then Exit Sub + Dim fil = MakePointersArray() + If CreateBinDirCheck.Checked And CDFileList.SelectedIndex > -1 Then + Dim cat = WorkDir.Text & Strings.Left(FilnamLabel.Text, 4) & "_" & files1(CDFileList.SelectedIndex).Descript + If Not Directory.Exists(cat) Then + Directory.CreateDirectory(cat) + + End If + ExportBinPath.Text = cat & "\" + End If + Dim filename = ExportBinPath.Text & Strings.Left(FilnamLabel.Text, 4) + If japRadio.Checked Then filename &= "_J" + If EngRadio.Checked Then filename &= "_E" + If UserRadio.Checked Then filename &= "_U" + + 'SAVING POINTERS TABLE + My.Computer.FileSystem.WriteAllBytes(filename & ".pointers", fil.ToArray, False) + 'SavePointersTableToFile(addresses, filename & ".pointers", binFile) + 'My.Computer.FileSystem.WriteAllBytes(filename & ".TEMPPACK", finalPack.ToArray, False) + Savedlbl.Text = "SAVED TO " & filename + + + End Sub + + Private Sub SearchPointers_Click(sender As Object, e As EventArgs) Handles SearchPointers.Click + If CDFileList.Items.Count = 0 Or CDFileList.SelectedIndex = -1 Then Exit Sub + If Not IsNumeric(CompareBTS.Text) Then Exit Sub + Dim xxx = Convert.ToInt16(CompareBTS.Text) + + Dim fil As List(Of Byte) = MakePointersArray() + Dim finfil = New List(Of Byte) + + + + For a = 0 To xxx + If a > fil.Count - 1 Then Exit For + finfil.Add(fil(a)) + Next + + + Dim cd = New ISOTools + Dim exeFile = cd.getCDfile(getFilnam, 27, 1812408) + + 'search in exe + Dim res = ByteSearch(exeFile.ToArray, finfil.ToArray) + If res > -1 Then MsgBox("FOUND! IN SLPS!" & vbCrLf & "Offset: " & res) : Exit Sub + + + 'all files to video + For a = 0 To 864 + Dim curFile = cd.getCDfile(getFilnam, files1(a).Sector, files1(a).Sizw) + 'If curFile(0) = 1 Or curFile(0) = 2 Then Continue For 'IF ARCHIVE + 'If curFile(1) = 1 Or curFile(1) = 2 Then Continue For + Debug.WriteLine("Searching... " & a) + res = ByteSearch(curFile.ToArray, finfil.ToArray) + If res > -1 Then MsgBox("FOUND! IN file #" & a & vbCrLf & "Offset: " & res) : Exit For + Next + + + + End Sub + + + + Public Function MakePointersArray() + + 'АРХИВИРУЕМ МАССИВ ФАЙЛОВ ДЛЯ ЗАПИСИ В ОДИН ФАЙЛ + Dim lastSectorID As Integer = 0 + Dim finalPack = New List(Of Byte) + Dim addresses = New List(Of Integer) 'Start Addr for all files + + For Each bin In binFile + 'filling sector to end (making sectorgap) in the middle of the file + If bin.SectorID <> lastSectorID Then + Dim gap = 2048 - (finalPack.Count Mod 2048) + For g = 0 To gap - 1 + finalPack.Add(0) + Next + End If + 'Adding currentfile Sector Size (for at least 0004) + bin.SectorSize = bin.Bytes.Count \ 2048 + If bin.Bytes.Count Mod 2048 > 0 Then bin.SectorSize += 1 + + addresses.Add(finalPack.Count) + finalPack.AddRange(bin.Bytes) + 'AddingBytesAfter + For g = 0 To bin.BytesAfter - 1 + finalPack.Add(0) + Next + lastSectorID = bin.SectorID + Next + 'Fill file to END of Sector + + If finalPack.Count Mod 2048 > 0 Then + For g = 1 To (2048 - (finalPack.Count Mod 2048)) + finalPack.Add(0) + Next g + End If + + 'Making POINTERS TABLE + Dim fil = New List(Of Byte) + + For a = 0 To binFile.Count - 1 + 'Dim curAddr = a * 8 + offset + Dim cursect As Int16 = addresses(a) \ 2048 + Dim modSect As Int16 = addresses(a) Mod 2048 + fil.Add(BitConverter.GetBytes(modSect)(0)) + fil.Add(BitConverter.GetBytes(modSect)(1)) 'BE or LE??? + fil.Add(BitConverter.GetBytes(cursect)(0)) + fil.Add(BitConverter.GetBytes(cursect)(1)) 'BE or LE??? + + Dim bts As Integer = binFile(a).Bytes.Count + If Tim8Shift.Checked And binFile(a).Compr = 0 Then bts -= 8 'Its Uncompressed TIM?? + + fil.Add(BitConverter.GetBytes(bts)(0)) 'Saving Size of file + fil.Add(BitConverter.GetBytes(bts)(1)) 'BE or LE??? + fil.Add(BitConverter.GetBytes(bts)(2)) + fil.Add(BitConverter.GetBytes(bts)(3)) + Next + Return fil + End Function + + Private Sub RelpaceTextExecs_Click(sender As Object, e As EventArgs) Handles RelpaceTextExecs.Click + + If CDFileList.Items.Count = 0 Or CDFileList.SelectedIndex = -1 Then Exit Sub + + Dim sb = New List(Of Byte) From {&HEA, &H68, 0, &HC} + Dim cd = New ISOTools + Dim curFile = cd.getCDfile(getFilnam, files1(CDFileList.SelectedIndex).Sector, files1(CDFileList.SelectedIndex).Sizw) + Dim replaceCount As Integer = 0 + + For a = 0 To curFile.Count - 1 Step 4 + If curFile(a) = sb(0) And curFile(a + 1) = sb(1) And curFile(a + 2) = sb(2) And curFile(a + 3) = sb(3) Then + replaceCount += 1 + curFile(a) = 0 : curFile(a + 1) = &H40 : curFile(a + 2) = &H2 : curFile(a + 3) = &HC + End If + Next + + cd.saveCDfile(getFilnam, files1(CDFileList.SelectedIndex).Sector, files1(CDFileList.SelectedIndex).Sizw, curFile.ToArray) + + + MsgBox("Found and replaced " & replaceCount & " text calls.") + + End Sub + + Private Sub ExportDUNGScripts_Click(sender As Object, e As EventArgs) Handles ExportDUNGScripts.Click + + Dim lengths = New List(Of Integer) + lengths.AddRange({232, 228, 328, 336, 328, 336, 328, 336, 316, 332}) + Dim DungScr = New List(Of PointerAndSize) + Dim initaddr = 114232 + For Each l In lengths + DungScr.Add(New PointerAndSize With {.Addr = initaddr, .Sizw = l}) + initaddr += l + Next + + + + DungScr.Add(New PointerAndSize With {.Addr = 119336, .Sizw = 240}) + DungScr.Add(New PointerAndSize With {.Addr = 119576, .Sizw = 240}) + + Dim cd = New ISOTools + Dim txt = New ScriptTools + + 'Reading filetable and make array + files1 = cd.makeFileList(UserPath.Text) + 'files2 = cd.makeFileList(EngISOPath.Text) + Dim CurFile() As Byte = cd.getCDfile(UserPath.Text, files1(736).Sector, files1(736).Sizw).ToArray + 'Dim EngFile() As Byte = cd.getCDfile(EngISOPath.Text, files2(736).Sector, files2(736).Sizw).ToArray 'loading files + Dim JRes = New ScriptFile + Dim ERes = New ScriptFile + + For Each scr In DungScr + + Dim JapBytes(scr.Sizw - 1) As Byte : Dim EngBytes(scr.Sizw - 1) As Byte + Array.Copy(CurFile, scr.Addr, JapBytes, 0, scr.Sizw) 'Array.Copy(EngFile, scr.Addr, EngBytes, 0, scr.Sizw) 'Copying Arrays + + txt.ParseResource(JapBytes, JRes) : txt.ParseText(JRes, False) + 'txt.ParseResource(EngBytes, ERes) : txt.ParseText(ERes, True) + Dim combText = txt.CombineParsedText(ERes, JRes) + Dim combResData = txt.compileData(JRes) + + Dim fil = "D:\Games\PSX\Persona 2 - Batsu (NTSC-J) [SLPS-02825]\Export\0736_DUNG_SCRIPTS\" & DungScr.IndexOf(scr).ToString("D4") & ".txt" + + My.Computer.FileSystem.WriteAllText(fil, combResData & combText, False) + Next + + End Sub + + Private Sub ConvertContact_Click(sender As Object, e As EventArgs) Handles ExportContact.Click + + + Dim Japfiles = IO.Directory.GetFiles("D:\Games\PSX\Persona.2.Innocent.Sin\Export\1075_Battle_Contacts", "*_J").ToList + Dim Engfiles = IO.Directory.GetFiles("D:\Games\PSX\Persona.2.Innocent.Sin\Export\1075_Battle_Contacts", "*_E*").ToList + Dim OutPut_Dir = "D:\Games\PSX\Persona.2.Innocent.Sin\Export\1075_Battle_Contacts\Processing\Back\" + + Dim scr = New ScriptTools + Dim cnt = 0 + + For Each fil In Japfiles + + Dim contact As String = scr.MakeExportFile(My.Computer.FileSystem.ReadAllBytes(fil), My.Computer.FileSystem.ReadAllBytes(Engfiles(Japfiles.IndexOf(fil))), cnt) + + Dim filename = OutPut_Dir & Path.GetFileName(fil) & "_exp.txt" + + My.Computer.FileSystem.WriteAllText(filename, contact, False, Encoding.GetEncoding(1251)) + Next + + + MsgBox("Converted " & cnt & " dialogs!", MsgBoxStyle.Information) + + End Sub + + Private Sub Summon_Export_Click(sender As Object, e As EventArgs) Handles Summon_Export.Click + + Dim Japfiles = IO.Directory.GetFiles("D:\Games\PSX\Persona.2.Innocent.Sin\Export\0077_Summon_Text", "*_U").ToList + Dim Engfiles = IO.Directory.GetFiles("D:\Games\PSX\Persona.2.Innocent.Sin\Export\0077_Summon_Text", "*_E*").ToList + Dim OutPut_Dir = "D:\Games\PSX\Persona.2.Innocent.Sin\Export\0077_Summon_Text\Processing\Back\" + + Dim scr = New ScriptTools + Dim cnt = 0 + + For Each fil In Japfiles + + Dim contact As String = scr.MakeSummonExport(My.Computer.FileSystem.ReadAllBytes(fil), My.Computer.FileSystem.ReadAllBytes(Engfiles(Japfiles.IndexOf(fil))), cnt) + + Dim filename = OutPut_Dir & Path.GetFileName(fil) & "_exp.txt" + + My.Computer.FileSystem.WriteAllText(filename, contact, False, Encoding.GetEncoding(1251)) + Next + + + MsgBox("Converted " & cnt & " dialogs!", MsgBoxStyle.Information) + + + + End Sub + + Private Sub Convert_Summon_Click(sender As Object, e As EventArgs) Handles Convert_Summon.Click + + Dim Japfiles = IO.Directory.GetFiles("D:\Games\PSX\Persona.2.Innocent.Sin\Export\0077_Summon_Text\Processing\", "*.txt").ToList + + DialogCounter = 0 + + + Dim txt = New ScriptTools + + + For Each JFile In Japfiles + Debug.WriteLine("Converting " & JFile) + txt.convertSummonScript(JFile, DialogCounter) + Next + + MsgBox("Success! Converted " & UBound(OpenFileDialog1.FileNames) + 1 & " file(s)" & vbCrLf & "Overall Dialogs Count: " & DialogCounter) + + + + End Sub + + Private Sub PSP_UNPACK_EVENT_BIN_Click(sender As Object, e As EventArgs) Handles PSP_UNPACK_EVENT_BIN.Click + Dim zips = New List(Of Byte()) + + Dim fil = My.Computer.FileSystem.ReadAllBytes("D:\Games\PSX\Persona 2 - Innocent Sin USA\PSP_GAME\USRDIR\pack\unpack\event.bin") + Dim filenames = New List(Of String) + + For a = 0 To 396 + Dim a1 = BitConverter.ToInt32(fil, a * 8) + Dim a2 = BitConverter.ToInt32(fil, a * 8 + 4) + Dim zzz(a2 - a1) As Byte + Array.Copy(fil, a1, zzz, 0, a2 - a1) + Dim fn = "" + For bbb = 0 To 8 + fn &= Chr(zzz(bbb + 10)) + Next + filenames.Add(fn) + Dim Decomp = DecompressGZip(zzz) + zips.Add(Decomp) + 'My.Computer.FileSystem.WriteAllBytes("D:\Games\PSX\Persona 2 - Innocent Sin USA\PSP_GAME\USRDIR\pack\unpack\Event\" & a.ToString("D4") & "_" & (a + 181).ToString("D3") & "_" & fn, Decomp, False) + + Next + + Dim scr = New ScriptTools + + For Each zip In zips + Dim filePack = New List(Of Byte()) + Dim startRead As Integer = 48 + + For a = 0 To 8 + Dim a1 = BitConverter.ToInt32(zip, a * 4 + 4) + Dim curFil(a1 - 1) As Byte + Array.Copy(zip, startRead, curFil, 0, a1) + + startRead += a1 + Dim BA = startRead Mod 16 + If BA > 0 Then startRead += 16 - BA + + filePack.Add(curFil) + + Next + Dim b = zips.IndexOf(zip) + Dim fn = "D:\Games\PSX\Persona 2 - Innocent Sin USA\PSP_GAME\USRDIR\pack\unpack\Event\" & b.ToString("D4") & "_" & (b + 181).ToString("D3") & "_" & filenames(b) + 'SAVING 8th LAST FILE!!! + Dim txt = scr.ConvertPSPTextFile(filePack.Last) + ' My.Computer.FileSystem.WriteAllBytes(fn & ".txt", filePack.Last, False) + My.Computer.FileSystem.WriteAllText(fn & ".txt", txt, False, Encoding.GetEncoding(1251)) + + Next + + + 'For Each z In + + + MsgBox("EXPORTED") + End Sub + + Public Function DecompressGZip(bytesToDecompress As Byte()) As Byte() + Using stream As New GZipStream(New MemoryStream(bytesToDecompress), CompressionMode.Decompress) + Const size As Integer = 4096 + Dim buffer As Byte() = New Byte(size - 1) {} + Using memoryStream As New MemoryStream() + Dim count As Integer + Do + count = stream.Read(buffer, 0, size) + If count > 0 Then + memoryStream.Write(buffer, 0, count) + End If + Loop While count > 0 + Return memoryStream.ToArray() + End Using + End Using + End Function + + +End Class + +Public Class PointerAndSize + Public Addr As Integer + Public Sizw As Integer +End Class + diff --git a/p2isPSX_CDToolkit/App.config b/p2isPSX_CDToolkit/App.config new file mode 100644 index 0000000..bd27edc --- /dev/null +++ b/p2isPSX_CDToolkit/App.config @@ -0,0 +1,6 @@ + + + + + + diff --git a/p2isPSX_CDToolkit/CityEditor.Designer.vb b/p2isPSX_CDToolkit/CityEditor.Designer.vb new file mode 100644 index 0000000..b553175 --- /dev/null +++ b/p2isPSX_CDToolkit/CityEditor.Designer.vb @@ -0,0 +1,227 @@ + +Partial Class CityEditor + Inherits System.Windows.Forms.Form + + 'Форма переопределяет dispose для очистки списка компонентов. + + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Является обязательной для конструктора форм Windows Forms + Private components As System.ComponentModel.IContainer + + 'Примечание: следующая процедура является обязательной для конструктора форм Windows Forms + 'Для ее изменения используйте конструктор форм Windows Form. + 'Не изменяйте ее в редакторе исходного кода. + + Private Sub InitializeComponent() + Dim DataGridViewCellStyle1 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() + Dim DataGridViewCellStyle2 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() + Me.ID = New System.Windows.Forms.TextBox() + Me.Label1 = New System.Windows.Forms.Label() + Me.UserTitle = New System.Windows.Forms.TextBox() + Me.Button1 = New System.Windows.Forms.Button() + Me.Button2 = New System.Windows.Forms.Button() + Me.DataGridView1 = New System.Windows.Forms.DataGridView() + Me.EngTitle = New System.Windows.Forms.TextBox() + Me.SaveToISO = New System.Windows.Forms.Button() + Me.Button4 = New System.Windows.Forms.Button() + Me.ChrCount = New System.Windows.Forms.Label() + Me.AreaCount = New System.Windows.Forms.Label() + Me.Column1 = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.Column2 = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.Column3 = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.STAT_E = New System.Windows.Forms.DataGridViewTextBoxColumn() + CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SuspendLayout() + ' + 'ID + ' + Me.ID.Location = New System.Drawing.Point(467, 7) + Me.ID.Name = "ID" + Me.ID.Size = New System.Drawing.Size(138, 20) + Me.ID.TabIndex = 0 + Me.ID.Text = "713" + ' + 'Label1 + ' + Me.Label1.AutoSize = True + Me.Label1.Location = New System.Drawing.Point(351, 10) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(99, 13) + Me.Label1.TabIndex = 1 + Me.Label1.Text = "DictrictID (713-719)" + ' + 'UserTitle + ' + Me.UserTitle.Location = New System.Drawing.Point(12, 59) + Me.UserTitle.Name = "UserTitle" + Me.UserTitle.Size = New System.Drawing.Size(196, 20) + Me.UserTitle.TabIndex = 2 + ' + 'Button1 + ' + Me.Button1.Location = New System.Drawing.Point(467, 31) + Me.Button1.Name = "Button1" + Me.Button1.Size = New System.Drawing.Size(69, 22) + Me.Button1.TabIndex = 3 + Me.Button1.Text = "<<<" + Me.Button1.UseVisualStyleBackColor = True + ' + 'Button2 + ' + Me.Button2.Location = New System.Drawing.Point(542, 31) + Me.Button2.Name = "Button2" + Me.Button2.Size = New System.Drawing.Size(63, 22) + Me.Button2.TabIndex = 3 + Me.Button2.Text = ">>>" + Me.Button2.UseVisualStyleBackColor = True + ' + 'DataGridView1 + ' + Me.DataGridView1.AllowUserToAddRows = False + Me.DataGridView1.AllowUserToDeleteRows = False + Me.DataGridView1.AllowUserToResizeRows = False + Me.DataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize + Me.DataGridView1.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.Column1, Me.Column2, Me.Column3, Me.STAT_E}) + DataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft + DataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Window + DataGridViewCellStyle1.Font = New System.Drawing.Font("Consolas", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(204, Byte)) + DataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.ControlText + DataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight + DataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText + DataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.[False] + Me.DataGridView1.DefaultCellStyle = DataGridViewCellStyle1 + Me.DataGridView1.Location = New System.Drawing.Point(12, 85) + Me.DataGridView1.MultiSelect = False + Me.DataGridView1.Name = "DataGridView1" + Me.DataGridView1.RowHeadersVisible = False + Me.DataGridView1.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.DisableResizing + DataGridViewCellStyle2.Font = New System.Drawing.Font("Lucida Sans Typewriter", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.DataGridView1.RowsDefaultCellStyle = DataGridViewCellStyle2 + Me.DataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.CellSelect + Me.DataGridView1.Size = New System.Drawing.Size(593, 675) + Me.DataGridView1.TabIndex = 4 + ' + 'EngTitle + ' + Me.EngTitle.Location = New System.Drawing.Point(409, 59) + Me.EngTitle.Name = "EngTitle" + Me.EngTitle.Size = New System.Drawing.Size(196, 20) + Me.EngTitle.TabIndex = 2 + ' + 'SaveToISO + ' + Me.SaveToISO.Location = New System.Drawing.Point(329, 766) + Me.SaveToISO.Name = "SaveToISO" + Me.SaveToISO.Size = New System.Drawing.Size(166, 40) + Me.SaveToISO.TabIndex = 5 + Me.SaveToISO.Text = "SaveToUSERISO" + Me.SaveToISO.UseVisualStyleBackColor = True + ' + 'Button4 + ' + Me.Button4.Location = New System.Drawing.Point(208, 783) + Me.Button4.Name = "Button4" + Me.Button4.Size = New System.Drawing.Size(115, 23) + Me.Button4.TabIndex = 6 + Me.Button4.Text = "UpdateFileTable??" + Me.Button4.UseVisualStyleBackColor = True + ' + 'ChrCount + ' + Me.ChrCount.AutoSize = True + Me.ChrCount.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(204, Byte)) + Me.ChrCount.Location = New System.Drawing.Point(189, 36) + Me.ChrCount.Name = "ChrCount" + Me.ChrCount.Size = New System.Drawing.Size(19, 20) + Me.ChrCount.TabIndex = 7 + Me.ChrCount.Text = "0" + ' + 'AreaCount + ' + Me.AreaCount.AutoSize = True + Me.AreaCount.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(204, Byte)) + Me.AreaCount.Location = New System.Drawing.Point(247, 59) + Me.AreaCount.Name = "AreaCount" + Me.AreaCount.Size = New System.Drawing.Size(19, 20) + Me.AreaCount.TabIndex = 8 + Me.AreaCount.Text = "0" + ' + 'Column1 + ' + Me.Column1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill + Me.Column1.FillWeight = 35.0! + Me.Column1.HeaderText = "COORDS" + Me.Column1.Name = "Column1" + ' + 'Column2 + ' + Me.Column2.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill + Me.Column2.HeaderText = "USER_TEXT" + Me.Column2.Name = "Column2" + ' + 'Column3 + ' + Me.Column3.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill + Me.Column3.HeaderText = "ENG_TEXT" + Me.Column3.Name = "Column3" + ' + 'STAT_E + ' + Me.STAT_E.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill + Me.STAT_E.FillWeight = 35.0! + Me.STAT_E.HeaderText = "COORDS_E" + Me.STAT_E.Name = "STAT_E" + ' + 'CityEditor + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(608, 818) + Me.Controls.Add(Me.AreaCount) + Me.Controls.Add(Me.ChrCount) + Me.Controls.Add(Me.Button4) + Me.Controls.Add(Me.SaveToISO) + Me.Controls.Add(Me.DataGridView1) + Me.Controls.Add(Me.Button2) + Me.Controls.Add(Me.Button1) + Me.Controls.Add(Me.EngTitle) + Me.Controls.Add(Me.UserTitle) + Me.Controls.Add(Me.Label1) + Me.Controls.Add(Me.ID) + Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog + Me.MaximizeBox = False + Me.MinimizeBox = False + Me.Name = "CityEditor" + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen + Me.Text = "CityEditor" + CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).EndInit() + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + + Friend WithEvents ID As TextBox + Friend WithEvents Label1 As Label + Friend WithEvents UserTitle As TextBox + Friend WithEvents Button1 As Button + Friend WithEvents Button2 As Button + Friend WithEvents DataGridView1 As DataGridView + Friend WithEvents EngTitle As TextBox + Friend WithEvents SaveToISO As Button + Friend WithEvents Button4 As Button + Friend WithEvents ChrCount As Label + Friend WithEvents AreaCount As Label + Friend WithEvents Column1 As DataGridViewTextBoxColumn + Friend WithEvents Column2 As DataGridViewTextBoxColumn + Friend WithEvents Column3 As DataGridViewTextBoxColumn + Friend WithEvents STAT_E As DataGridViewTextBoxColumn +End Class diff --git a/p2isPSX_CDToolkit/CityEditor.resx b/p2isPSX_CDToolkit/CityEditor.resx new file mode 100644 index 0000000..df5746a --- /dev/null +++ b/p2isPSX_CDToolkit/CityEditor.resx @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + True + + + True + + + True + + + True + + \ No newline at end of file diff --git a/p2isPSX_CDToolkit/CityEditor.vb b/p2isPSX_CDToolkit/CityEditor.vb new file mode 100644 index 0000000..21323a0 --- /dev/null +++ b/p2isPSX_CDToolkit/CityEditor.vb @@ -0,0 +1,268 @@ +Public Class CityEditor + + Public files1 As List(Of fileInfo) + Public files2 As List(Of fileInfo) + Public CurFile As rleFile + Public CurFileUnrle As Byte() + Public EngFile As rleFile + Public EngFileUnrle As Byte() + + + Private Sub DungeonEditor_Load(sender As Object, e As EventArgs) Handles MyBase.Load + + Dim cd = New ISOTools + + 'Reading filetable and make array + files1 = cd.makeFileList(Form1.UserPath.Text) + files2 = cd.makeFileList(Form1.EngISOPath.Text) + + + LoadDistrict() + End Sub + + Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click + If ID.Text = 713 Then + ID.Text = 719 + Else + ID.Text -= 1 + End If + + + LoadDistrict() + End Sub + + Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click + If ID.Text = 719 Then + ID.Text = 713 + Else + ID.Text += 1 + End If + + + LoadDistrict() + End Sub + + + Public Sub LoadDistrict() + + Dim cd = New ISOTools + Dim rle = New rleTools + + + + Form1.DeconstructFile(cd.getCDfile(Form1.UserPath.Text, files1(ID.Text).Sector, files1(ID.Text).Sizw).ToArray) 'here is separated binfile + CurFile = Form1.binFile(Form1.binFile.Count - 2) 'Get Before Last File + CurFileUnrle = CurFile.Bytes.ToArray + Form1.DeconstructFile(cd.getCDfile(Form1.EngISOPath.Text, files2(ID.Text).Sector, files2(ID.Text).Sizw).ToArray) 'here is separated binfile + EngFile = Form1.binFile(Form1.binFile.Count - 2) 'Get Before Last File + EngFileUnrle = EngFile.Bytes.ToArray + 'Dim curfile As rleFile = binFile(8) + + + Dim JapBlock1Len = CurFileUnrle(8) + Dim JapBlock2Len = CurFileUnrle(9) + Dim JapBlockLines = CurFileUnrle(10) + Dim EnBlock1Len = EngFileUnrle(8) + Dim EnBlock2Len = EngFileUnrle(9) + Dim EnBlockLines = EngFileUnrle(10) + + Dim JapTextStart = JapBlock1Len * 16 + JapBlock2Len * 8 + 8 + 4 'header 8 + head 4 block + Dim EngTextStart = EnBlock1Len * 16 + EnBlock2Len * 8 + 8 + 4 + + + EngTitle.Text = readEngText(EngTextStart + 4) 'after coords... + UserTitle.Text = readRusText(JapTextStart + 4) 'after coords... + DataGridView1.Rows.Clear() + + + For a = 1 To JapBlockLines - 1 + JapTextStart += 40 + EngTextStart += 40 'Move to Next Block... + Dim jap_coords As String = BitConverter.ToInt16(CurFileUnrle, JapTextStart) & " x " & BitConverter.ToInt16(CurFileUnrle, JapTextStart + 2) + Dim japLoc = readRusText(JapTextStart + 4 + 14) ' aftercoords + + Dim en_coords As String = BitConverter.ToInt16(CurFileUnrle, EngTextStart) & " x " & BitConverter.ToInt16(CurFileUnrle, EngTextStart + 2) + Dim enLoc = readEngText(JapTextStart + 4 + 14) ' aftercoords + DataGridView1.Rows.Add(jap_coords, japLoc, enLoc, en_coords) + + Next + + 'Do + ' If pointer >= endByte Then Exit Do + + ' Dim status = BitConverter.ToInt16(CurFileUnrle, pointer) + ' Dim statusE = EngFileUnrle(pointer) + + ' pointer += 2 + ' Dim engString = readEngText(pointer - 1) + ' Dim rustext = readRusText(pointer) + + ' DataGridView1.Rows.Add(status, rustext, engString, statusE) + ' pointer += 30 + 'Loop + + + + End Sub + + Public Function readEngText(ByVal Curbt As Integer) + Dim a = "" + Do + If EngFileUnrle(Curbt) = 3 Or EngFileUnrle(Curbt) = 0 Then Exit Do + If EngFileUnrle(Curbt) > 128 Then EngFileUnrle(Curbt) = Asc("-") + a &= Chr(EngFileUnrle(Curbt)) + Curbt += 1 + Loop + Return a + End Function + + + Public Function readRusText(ByVal Curbt As Integer) + Dim a = "" + If BitConverter.ToInt16(CurFileUnrle, Curbt) And &H2000 Then + Dim len = BitConverter.ToInt16(CurFileUnrle, Curbt) And &HFF + Curbt += 2 + For b = 0 To len - 1 + a &= Chr(CurFileUnrle(Curbt)) + Curbt += 1 + Next + Else + Dim b = BitConverter.ToInt16(CurFileUnrle, Curbt) + + Do + Dim curChar = BitConverter.ToInt16(CurFileUnrle, Curbt) + If (curChar < &H1000) Then a &= Form1.chars(curChar) + 'a &= CurFileUnrle(Curbt).ToString("X2") & CurFileUnrle(Curbt + 1).ToString("X2") + Curbt += 2 + If Curbt >= CurFileUnrle.Count Then Exit Do + b = BitConverter.ToInt16(CurFileUnrle, Curbt) + Loop Until (b And &H1000) + End If + Return a + End Function + + Private Sub UserTitle_TextChanged(sender As Object, e As EventArgs) Handles UserTitle.TextChanged + ChrCount.Text = UserTitle.Text.Length + If UserTitle.Text.Length > 14 Then + ChrCount.ForeColor = Color.Red + Else + ChrCount.ForeColor = Color.DarkGreen + End If + End Sub + Private Sub DataGridView1_CurrentCellChanged(sender As Object, e As EventArgs) Handles DataGridView1.CurrentCellChanged + If IsNothing(DataGridView1.CurrentCell) Then Exit Sub + Dim a = DataGridView1.CurrentCell.Value.ToString.Length + AreaCount.Text = a + If a > 20 Then + AreaCount.ForeColor = Color.Red + Else + AreaCount.ForeColor = Color.DarkGreen + End If + End Sub + + Private Sub Button3_Click(sender As Object, e As EventArgs) Handles SaveToISO.Click + 'CHANGING FILE! + + Dim cd = New ISOTools + Dim rle = New rleTools + + 'Making title bytes + MakeSaveRussianString(UserTitle.Text, 24, 0) + + Dim off As Int32 = BitConverter.ToInt32(CurFileUnrle, 104) + 'Dim pointer As Int32 = BitConverter.ToInt32(CurFileUnrle, 104) + Dim endByte As Int32 = BitConverter.ToInt32(CurFileUnrle, 60) + + + For Each row In DataGridView1.Rows + + CurFileUnrle(off) = row.Cells(0).Value + CurFileUnrle(off + 1) = 0 + + MakeSaveRussianString(Trim(row.Cells(1).Value), 30, off + 2) + + off += 32 + Next + + + Form1.DeconstructFile(cd.getCDfile(Form1.UserPath.Text, files1(ID.Text).Sector, files1(ID.Text).Sizw).ToArray) 'here is separated binfile + Dim curfile = Form1.binFile(0) + + Dim before = curfile.Bytes.Count + Form1.binFile(0).Bytes = rle.decodeRLEnew(CurFileUnrle, curfile).ToArray + Form1.binFile(0).BytesAfter = 0 + Dim after = Form1.binFile(0).Bytes.Count + + 'Packing + Dim finalPack = New List(Of Byte) + For Each bin In Form1.binFile + finalPack.AddRange(bin.Bytes) + + 'AddingBytesAfter + For g = 0 To bin.BytesAfter - 1 + finalPack.Add(0) + Next + + Next + + + If finalPack.Count Mod 2048 > 0 Then + For g = 1 To (2048 - (finalPack.Count Mod 2048)) + finalPack.Add(0) + Next g + End If + + Dim beforeSize As Integer = files1(ID.Text).Sizw + + If finalPack.Count <= files1(ID.Text).Sizw Then + 'If sizw matched + + cd.saveCDfile(Form1.UserPath.Text, files1(ID.Text).Sector, finalPack.Count, finalPack.ToArray) + MsgBox("Succesfully Saved!" & vbCrLf & "Bofore: " & before & vbCrLf & "Afta: " & after & vbCrLf & after - before & "b.") + + Exit Sub + End If + + + If MsgBox("finalPack is Bigger than source :(" & + vbCrLf & "Bofore: " & before & vbCrLf & "Afta: " & after & vbCrLf & after - before & "b." & + vbCrLf & "Do you wanna save it to file?", MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then + + If Form1.SaveFileDialog1.ShowDialog <> DialogResult.OK Then Exit Sub + + My.Computer.FileSystem.WriteAllBytes(Form1.SaveFileDialog1.FileName, finalPack.ToArray, False) + End If + + + + 'My.Computer.FileSystem.WriteAllBytes("D:\Games\PSX\Persona.2.Innocent.Sin\Export\UnRLE\0097\EDITOR_TEST", CurFileUnrle, False) + + + End Sub + + Public Sub MakeSaveRussianString(ByVal str As String, ByVal maxBytes As Integer, ByVal offs As String) + Dim a = New List(Of Byte) + If str = "0010" Then + For x = 0 To maxBytes - 1 Step 2 + CurFileUnrle(offs + x) = 0 + CurFileUnrle(offs + x + 1) = &H10 + Next + Exit Sub + + End If + + + a.Add(str.Length) + a.Add(&H20) + For x = 0 To str.Length - 1 + a.Add(Asc(str(x))) + Next + For x = 0 To maxBytes - str.Length - 3 + a.Add(0) + Next + For x = 0 To maxBytes - 1 + CurFileUnrle(x + offs) = a(x) + Next + End Sub + +End Class \ No newline at end of file diff --git a/p2isPSX_CDToolkit/DungeonEditor.Designer.vb b/p2isPSX_CDToolkit/DungeonEditor.Designer.vb new file mode 100644 index 0000000..7030fe4 --- /dev/null +++ b/p2isPSX_CDToolkit/DungeonEditor.Designer.vb @@ -0,0 +1,227 @@ + _ +Partial Class DungeonEditor + Inherits System.Windows.Forms.Form + + 'Форма переопределяет dispose для очистки списка компонентов. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Является обязательной для конструктора форм Windows Forms + Private components As System.ComponentModel.IContainer + + 'Примечание: следующая процедура является обязательной для конструктора форм Windows Forms + 'Для ее изменения используйте конструктор форм Windows Form. + 'Не изменяйте ее в редакторе исходного кода. + _ + Private Sub InitializeComponent() + Dim DataGridViewCellStyle1 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() + Dim DataGridViewCellStyle2 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() + Me.ID = New System.Windows.Forms.TextBox() + Me.Label1 = New System.Windows.Forms.Label() + Me.UserTitle = New System.Windows.Forms.TextBox() + Me.Button1 = New System.Windows.Forms.Button() + Me.Button2 = New System.Windows.Forms.Button() + Me.DataGridView1 = New System.Windows.Forms.DataGridView() + Me.Column1 = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.Column2 = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.Column3 = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.STAT_E = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.EngTitle = New System.Windows.Forms.TextBox() + Me.SaveToISO = New System.Windows.Forms.Button() + Me.Button4 = New System.Windows.Forms.Button() + Me.ChrCount = New System.Windows.Forms.Label() + Me.AreaCount = New System.Windows.Forms.Label() + CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SuspendLayout() + ' + 'ID + ' + Me.ID.Location = New System.Drawing.Point(358, 5) + Me.ID.Name = "ID" + Me.ID.Size = New System.Drawing.Size(138, 20) + Me.ID.TabIndex = 0 + Me.ID.Text = "741" + ' + 'Label1 + ' + Me.Label1.AutoSize = True + Me.Label1.Location = New System.Drawing.Point(242, 8) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(110, 13) + Me.Label1.TabIndex = 1 + Me.Label1.Text = "DungeonID (741-788)" + ' + 'UserTitle + ' + Me.UserTitle.Location = New System.Drawing.Point(12, 59) + Me.UserTitle.Name = "UserTitle" + Me.UserTitle.Size = New System.Drawing.Size(196, 20) + Me.UserTitle.TabIndex = 2 + ' + 'Button1 + ' + Me.Button1.Location = New System.Drawing.Point(358, 29) + Me.Button1.Name = "Button1" + Me.Button1.Size = New System.Drawing.Size(69, 22) + Me.Button1.TabIndex = 3 + Me.Button1.Text = "<<<" + Me.Button1.UseVisualStyleBackColor = True + ' + 'Button2 + ' + Me.Button2.Location = New System.Drawing.Point(433, 29) + Me.Button2.Name = "Button2" + Me.Button2.Size = New System.Drawing.Size(63, 22) + Me.Button2.TabIndex = 3 + Me.Button2.Text = ">>>" + Me.Button2.UseVisualStyleBackColor = True + ' + 'DataGridView1 + ' + Me.DataGridView1.AllowUserToAddRows = False + Me.DataGridView1.AllowUserToDeleteRows = False + Me.DataGridView1.AllowUserToResizeRows = False + Me.DataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize + Me.DataGridView1.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.Column1, Me.Column2, Me.Column3, Me.STAT_E}) + DataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft + DataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Window + DataGridViewCellStyle1.Font = New System.Drawing.Font("Consolas", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(204, Byte)) + DataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.ControlText + DataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight + DataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText + DataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.[False] + Me.DataGridView1.DefaultCellStyle = DataGridViewCellStyle1 + Me.DataGridView1.Location = New System.Drawing.Point(12, 85) + Me.DataGridView1.MultiSelect = False + Me.DataGridView1.Name = "DataGridView1" + Me.DataGridView1.RowHeadersVisible = False + Me.DataGridView1.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.DisableResizing + DataGridViewCellStyle2.Font = New System.Drawing.Font("Lucida Sans Typewriter", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.DataGridView1.RowsDefaultCellStyle = DataGridViewCellStyle2 + Me.DataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.CellSelect + Me.DataGridView1.Size = New System.Drawing.Size(484, 675) + Me.DataGridView1.TabIndex = 4 + ' + 'Column1 + ' + Me.Column1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill + Me.Column1.FillWeight = 10.0! + Me.Column1.HeaderText = "STATUS" + Me.Column1.Name = "Column1" + ' + 'Column2 + ' + Me.Column2.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill + Me.Column2.HeaderText = "USER_TEXT" + Me.Column2.Name = "Column2" + ' + 'Column3 + ' + Me.Column3.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill + Me.Column3.HeaderText = "ENG_TEXT" + Me.Column3.Name = "Column3" + ' + 'STAT_E + ' + Me.STAT_E.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill + Me.STAT_E.FillWeight = 15.0! + Me.STAT_E.HeaderText = "STAT_E" + Me.STAT_E.Name = "STAT_E" + ' + 'EngTitle + ' + Me.EngTitle.Location = New System.Drawing.Point(300, 59) + Me.EngTitle.Name = "EngTitle" + Me.EngTitle.Size = New System.Drawing.Size(196, 20) + Me.EngTitle.TabIndex = 2 + ' + 'SaveToISO + ' + Me.SaveToISO.Location = New System.Drawing.Point(329, 766) + Me.SaveToISO.Name = "SaveToISO" + Me.SaveToISO.Size = New System.Drawing.Size(166, 40) + Me.SaveToISO.TabIndex = 5 + Me.SaveToISO.Text = "SaveToUSERISO" + Me.SaveToISO.UseVisualStyleBackColor = True + ' + 'Button4 + ' + Me.Button4.Location = New System.Drawing.Point(208, 783) + Me.Button4.Name = "Button4" + Me.Button4.Size = New System.Drawing.Size(115, 23) + Me.Button4.TabIndex = 6 + Me.Button4.Text = "UpdateFileTable??" + Me.Button4.UseVisualStyleBackColor = True + ' + 'ChrCount + ' + Me.ChrCount.AutoSize = True + Me.ChrCount.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(204, Byte)) + Me.ChrCount.Location = New System.Drawing.Point(189, 36) + Me.ChrCount.Name = "ChrCount" + Me.ChrCount.Size = New System.Drawing.Size(19, 20) + Me.ChrCount.TabIndex = 7 + Me.ChrCount.Text = "0" + ' + 'AreaCount + ' + Me.AreaCount.AutoSize = True + Me.AreaCount.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(204, Byte)) + Me.AreaCount.Location = New System.Drawing.Point(247, 59) + Me.AreaCount.Name = "AreaCount" + Me.AreaCount.Size = New System.Drawing.Size(19, 20) + Me.AreaCount.TabIndex = 8 + Me.AreaCount.Text = "0" + ' + 'DungeonEditor + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(507, 818) + Me.Controls.Add(Me.AreaCount) + Me.Controls.Add(Me.ChrCount) + Me.Controls.Add(Me.Button4) + Me.Controls.Add(Me.SaveToISO) + Me.Controls.Add(Me.DataGridView1) + Me.Controls.Add(Me.Button2) + Me.Controls.Add(Me.Button1) + Me.Controls.Add(Me.EngTitle) + Me.Controls.Add(Me.UserTitle) + Me.Controls.Add(Me.Label1) + Me.Controls.Add(Me.ID) + Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog + Me.MaximizeBox = False + Me.MinimizeBox = False + Me.Name = "DungeonEditor" + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen + Me.Text = "DungeonEditor" + CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).EndInit() + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + + Friend WithEvents ID As TextBox + Friend WithEvents Label1 As Label + Friend WithEvents UserTitle As TextBox + Friend WithEvents Button1 As Button + Friend WithEvents Button2 As Button + Friend WithEvents DataGridView1 As DataGridView + Friend WithEvents EngTitle As TextBox + Friend WithEvents SaveToISO As Button + Friend WithEvents Button4 As Button + Friend WithEvents Column1 As DataGridViewTextBoxColumn + Friend WithEvents Column2 As DataGridViewTextBoxColumn + Friend WithEvents Column3 As DataGridViewTextBoxColumn + Friend WithEvents STAT_E As DataGridViewTextBoxColumn + Friend WithEvents ChrCount As Label + Friend WithEvents AreaCount As Label +End Class diff --git a/p2isPSX_CDToolkit/DungeonEditor.resx b/p2isPSX_CDToolkit/DungeonEditor.resx new file mode 100644 index 0000000..df5746a --- /dev/null +++ b/p2isPSX_CDToolkit/DungeonEditor.resx @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + True + + + True + + + True + + + True + + \ No newline at end of file diff --git a/p2isPSX_CDToolkit/DungeonEditor.vb b/p2isPSX_CDToolkit/DungeonEditor.vb new file mode 100644 index 0000000..04b4f84 --- /dev/null +++ b/p2isPSX_CDToolkit/DungeonEditor.vb @@ -0,0 +1,247 @@ +Public Class DungeonEditor + + Public files1 As List(Of fileInfo) + Public files2 As List(Of fileInfo) + Public CurFile As rleFile + Public CurFileUnrle As Byte() + Public EngFile As rleFile + Public EngFileUnrle As Byte() + + + Private Sub DungeonEditor_Load(sender As Object, e As EventArgs) Handles MyBase.Load + + Dim cd = New ISOTools + + 'Reading filetable and make array + files1 = cd.makeFileList(form1.UserPath.Text) + files2 = cd.makeFileList(Form1.EngISOPath.Text) + + + LoadDungeon() + End Sub + + Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click + If ID.Text = 741 Then + ID.Text = 788 + Else + ID.Text -= 1 + End If + + + LoadDungeon() + End Sub + + Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click + If ID.Text = 788 Then + ID.Text = 741 + Else + ID.Text += 1 + End If + + + LoadDungeon() + End Sub + + + Public Sub LoadDungeon() + + Dim cd = New ISOTools + Dim rle = New rleTools + + + + Form1.DeconstructFile(cd.getCDfile(Form1.UserPath.Text, files1(ID.Text).Sector, files1(ID.Text).Sizw).ToArray) 'here is separated binfile + CurFile = Form1.binFile(0) + CurFileUnrle = rle.Unrle(CurFile.Bytes).ToArray + Form1.DeconstructFile(cd.getCDfile(Form1.EngISOPath.Text, files2(ID.Text).Sector, files2(ID.Text).Sizw).ToArray) 'here is separated binfile + EngFile = Form1.binFile(0) + EngFileUnrle = rle.Unrle(EngFile.Bytes).ToArray + 'Dim curfile As rleFile = binFile(8) + + EngTitle.Text = readEngText(0) + UserTitle.Text = readRusText(0) + + + Dim pointer As Int32 = BitConverter.ToInt32(CurFileUnrle, 104) + Dim endByte As Int32 = BitConverter.ToInt32(CurFileUnrle, 60) + DataGridView1.Rows.Clear() + + Do + + If pointer >= endByte Then Exit Do + + Dim status = BitConverter.ToInt16(CurFileUnrle, pointer) + Dim statusE = EngFileUnrle(pointer) + + pointer += 2 + Dim engString = readEngText(pointer - 1) + Dim rustext = readRusText(pointer) + + DataGridView1.Rows.Add(status, rustext, engString, statusE) + pointer += 30 + Loop + + + + End Sub + + Public Function readEngText(ByVal Curbt As Integer) + Dim a = "" + Do + If EngFileUnrle(Curbt) = 3 Or EngFileUnrle(Curbt) = 0 Then Exit Do + If EngFileUnrle(Curbt) > 128 Then EngFileUnrle(Curbt) = Asc("-") + a &= Chr(EngFileUnrle(Curbt)) + Curbt += 1 + Loop + Return a + End Function + + + Public Function readRusText(ByVal Curbt As Integer) + Dim a = "" + If BitConverter.ToInt16(CurFileUnrle, Curbt) And &H2000 Then + Dim len = BitConverter.ToInt16(CurFileUnrle, Curbt) And &HFF + Curbt += 2 + For b = 0 To len - 1 + a &= Chr(CurFileUnrle(Curbt)) + Curbt += 1 + Next + Else + Dim b = BitConverter.ToInt16(CurFileUnrle, Curbt) + + Do + Dim curChar = BitConverter.ToInt16(CurFileUnrle, Curbt) + If (curChar < &H1000) Then a &= Form1.chars(curChar) + 'a &= CurFileUnrle(Curbt).ToString("X2") & CurFileUnrle(Curbt + 1).ToString("X2") + Curbt += 2 + If Curbt >= CurFileUnrle.Count Then Exit Do + b = BitConverter.ToInt16(CurFileUnrle, Curbt) + Loop Until (b And &H1000) + End If + Return a + End Function + + Private Sub UserTitle_TextChanged(sender As Object, e As EventArgs) Handles UserTitle.TextChanged + ChrCount.Text = UserTitle.Text.Length + If UserTitle.Text.Length > 14 Then + ChrCount.ForeColor = Color.Red + Else + ChrCount.ForeColor = Color.DarkGreen + End If + End Sub + Private Sub DataGridView1_CurrentCellChanged(sender As Object, e As EventArgs) Handles DataGridView1.CurrentCellChanged + If IsNothing(DataGridView1.CurrentCell) Then Exit Sub + Dim a = DataGridView1.CurrentCell.Value.ToString.Length + AreaCount.Text = a + If a > 20 Then + AreaCount.ForeColor = Color.Red + Else + AreaCount.ForeColor = Color.DarkGreen + End If + End Sub + + Private Sub Button3_Click(sender As Object, e As EventArgs) Handles SaveToISO.Click + 'CHANGING FILE! + + Dim cd = New ISOTools + Dim rle = New rleTools + + 'Making title bytes + MakeSaveRussianString(UserTitle.Text, 24, 0) + + Dim off As Int32 = BitConverter.ToInt32(CurFileUnrle, 104) + 'Dim pointer As Int32 = BitConverter.ToInt32(CurFileUnrle, 104) + Dim endByte As Int32 = BitConverter.ToInt32(CurFileUnrle, 60) + + + For Each row In DataGridView1.Rows + + CurFileUnrle(off) = row.Cells(0).Value + CurFileUnrle(off + 1) = 0 + + MakeSaveRussianString(Trim(row.Cells(1).Value), 30, off + 2) + + off += 32 + Next + + + Form1.DeconstructFile(cd.getCDfile(Form1.UserPath.Text, files1(ID.Text).Sector, files1(ID.Text).Sizw).ToArray) 'here is separated binfile + Dim curfile = Form1.binFile(0) + + Dim before = curfile.Bytes.Count + Form1.binFile(0).Bytes = rle.decodeRLEnew(CurFileUnrle, curfile).ToArray + Form1.binFile(0).BytesAfter = 0 + Dim after = Form1.binFile(0).Bytes.Count + + 'Packing + Dim finalPack = New List(Of Byte) + For Each bin In Form1.binFile + finalPack.AddRange(bin.Bytes) + + 'AddingBytesAfter + For g = 0 To bin.BytesAfter - 1 + finalPack.Add(0) + Next + + Next + + + If finalPack.Count Mod 2048 > 0 Then + For g = 1 To (2048 - (finalPack.Count Mod 2048)) + finalPack.Add(0) + Next g + End If + + Dim beforeSize As Integer = files1(ID.Text).Sizw + + If finalPack.Count <= files1(ID.Text).Sizw Then + 'If sizw matched + + cd.saveCDfile(Form1.UserPath.Text, files1(ID.Text).Sector, finalPack.Count, finalPack.ToArray) + MsgBox("Succesfully Saved!" & vbCrLf & "Bofore: " & before & vbCrLf & "Afta: " & after & vbCrLf & after - before & "b.") + + Exit Sub + End If + + + If MsgBox("finalPack is Bigger than source :(" & + vbCrLf & "Bofore: " & before & vbCrLf & "Afta: " & after & vbCrLf & after - before & "b." & + vbCrLf & "Do you wanna save it to file?", MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then + + If Form1.SaveFileDialog1.ShowDialog <> DialogResult.OK Then Exit Sub + + My.Computer.FileSystem.WriteAllBytes(Form1.SaveFileDialog1.FileName, finalPack.ToArray, False) + End If + + + + 'My.Computer.FileSystem.WriteAllBytes("D:\Games\PSX\Persona.2.Innocent.Sin\Export\UnRLE\0097\EDITOR_TEST", CurFileUnrle, False) + + + End Sub + + Public Sub MakeSaveRussianString(ByVal str As String, ByVal maxBytes As Integer, ByVal offs As String) + Dim a = New List(Of Byte) + If str = "0010" Then + For x = 0 To maxBytes - 1 Step 2 + CurFileUnrle(offs + x) = 0 + CurFileUnrle(offs + x + 1) = &H10 + Next + Exit Sub + + End If + + + a.Add(str.Length) + a.Add(&H20) + For x = 0 To str.Length - 1 + a.Add(Asc(str(x))) + Next + For x = 0 To maxBytes - str.Length - 3 + a.Add(0) + Next + For x = 0 To maxBytes - 1 + CurFileUnrle(x + offs) = a(x) + Next + End Sub +End Class \ No newline at end of file diff --git a/p2isPSX_CDToolkit/FontTools.vb b/p2isPSX_CDToolkit/FontTools.vb new file mode 100644 index 0000000..b5b744e --- /dev/null +++ b/p2isPSX_CDToolkit/FontTools.vb @@ -0,0 +1,262 @@ +Public Class FontTools + + Dim drawSurface As Bitmap + Public Colors = New List(Of Color) + + Public Function GetColors() + Colors.Add(Color.Black) + Colors.Add(Color.FromArgb(238, 238, 238)) + Colors.Add(Color.FromArgb(24, 24, 24)) + Colors.Add(Color.FromArgb(156, 156, 156)) + Colors.Add(Color.FromArgb(49, 49, 49)) + Colors.Add(Color.FromArgb(246, 82, 131)) + Colors.Add(Color.FromArgb(24, 24, 24)) + Colors.Add(Color.FromArgb(148, 213, 255)) 'Persona2 TEXT PALETTE + Colors.Add(Color.FromArgb(24, 24, 49)) + Colors.Add(Color.FromArgb(131, 230, 131)) + Colors.Add(Color.FromArgb(24, 24, 24)) + Colors.Add(Color.FromArgb(230, 230, 74)) + Colors.Add(Color.FromArgb(49, 49, 24)) + Colors.Add(Color.FromArgb(255, 131, 49)) + Colors.Add(Color.FromArgb(49, 24, 24)) + + + + End Function + + Public Sub convertTo16() + + 'DONE + + Dim CurByte As Byte + + Dim tempByte As Byte + Dim tempByte2 As Byte + Dim tempByte3 As Byte + Dim tempByte4 As Byte + Dim vertCounter As Integer + Dim newFont = New List(Of Byte) + + Dim fontRawData = My.Computer.FileSystem.ReadAllBytes("D:\Games\PSX\Persona 2 - Batsu (NTSC-J) [SLPS-02825]\Export/JapFont.bin") + + Dim ReadCounter = 64919 + Dim readAddr = 1152 + + Do + + If readAddr >= ReadCounter Then Exit Do + + newFont.Add(ReverseBits(fontRawData(readAddr))) + + tempByte2 = ReverseBits(fontRawData(readAddr + 1)) + newFont.Add(tempByte2 And &HF0) + + + + tempByte3 = ReverseBits(fontRawData(readAddr + 2)) + + + + Dim collby3 As Byte = (tempByte3 >> 4) + + newFont.Add(tempByte2 << 4 Or collby3) 'Need last 4 bits + + tempByte4 = tempByte3 << 4 + newFont.Add(tempByte4) + + readAddr += 3 + + vertCounter += 1 + If vertCounter = 6 Then + vertCounter = 0 + newFont.Add(0) + newFont.Add(0) + newFont.Add(0) + newFont.Add(0) + newFont.Add(0) + newFont.Add(0) + newFont.Add(0) + newFont.Add(0) + End If + Loop + + My.Computer.FileSystem.WriteAllBytes("D:\Games\PSX\Persona 2 - Batsu (NTSC-J) [SLPS-02825]/Export/WatchMyFont.bin.bak", newFont.ToArray, False) + + + End Sub + + 'DONE + + Public Sub ConvertTo12() + + Dim CurByte As Byte + Dim newFont = New List(Of Byte) + + Dim tempByte2 As Byte + Dim tempByte3 As Byte + Dim tempByte4 As Byte + + If Not My.Computer.FileSystem.FileExists(Form1.WorkDir.Text & "/JapFont.bin") Then MsgBox(Form1.WorkDir.Text & "/JapFont.bin not found. Check Export path!") : Exit Sub + Dim fontHeader As Byte() = My.Computer.FileSystem.ReadAllBytes(Form1.WorkDir.Text & "/JapFont.bin") + ReDim Preserve fontHeader(1151) 'Loading font header (1152 bytes of normal first font) + newFont.AddRange(fontHeader.ToList) + + + Dim vertCounter As Integer + Dim fontRawData = My.Computer.FileSystem.ReadAllBytes(Form1.WorkDir.Text & "/WatchMyFont.bin") + Dim ReadCounter = 82572 + Dim readAddr = 0 + + Do + + If readAddr >= ReadCounter Then Exit Do + newFont.Add(ReverseBits(fontRawData(readAddr))) + + tempByte2 = fontRawData(readAddr + 1) And &HF0 + tempByte3 = fontRawData(readAddr + 2) >> 4 + newFont.Add(ReverseBits(tempByte2 Or tempByte3)) + + tempByte3 = fontRawData(readAddr + 2) << 4 + tempByte4 = fontRawData(readAddr + 3) >> 4 + newFont.Add(ReverseBits(tempByte3 Or tempByte4)) + + readAddr += 4 + vertCounter += 1 + If vertCounter = 6 Then + readAddr += 8 + vertCounter = 0 + + End If + + + Loop + + + 'Creating Rus 8x12 Font @ BA00 (47616) + For aaa = 1 To 47616 - newFont.Count + newFont.Add(0) + Next + + readAddr = 32 * 32 ' Starting with CHR32 (space) + + Do + For a = 0 To 11 '12 rows loop + newFont.Add(ReverseBits(fontRawData(readAddr))) + readAddr += 2 'skip 2 bytes + Next + readAddr += 8 'skip empty 12*4 bytes + Loop While readAddr < 256 * 32 'All symbols readed - exit + + + + + For aaa = 1 To 65520 - newFont.Count + newFont.Add(0) + Next + + + My.Computer.FileSystem.WriteAllBytes(Form1.WorkDir.Text & "/0059_00_0_0_U", newFont.ToArray, False) + + MsgBox("OK to /Export/0059_00_0_0_U", MsgBoxStyle.Information) + + + End Sub + + + + + Public Function ReverseBits(x As Byte) As Byte + x = (((x And &HAA) >> 1) Or ((x And &H55) << 1)) + x = (((x And &HCC) >> 2) Or ((x And &H33) << 2)) + x = (((x And &HF0) >> 4) Or ((x And &HF) << 4)) + Return ((x)) + + End Function + + + + Public Sub DrawChars(ByRef byt As List(Of Byte), ByRef df As Bitmap, ByVal y As Integer, ByRef CurColor As Integer) + + Dim curX = 10 + Dim curY = 10 + y + 'Load Font Here + Dim font = New List(Of List(Of Byte)) + Dim fil = My.Computer.FileSystem.ReadAllBytes("D:\Games\PSX\Persona 2 - Batsu (NTSC-J) [SLPS-02825]\Export\WatchMyFont.bin.bak").ToList + Dim charCount As Integer = fil.Count / 32 + For x = 0 To fil.Count - 32 Step 32 + Dim curChar = New List(Of Byte) + curChar.AddRange(fil.GetRange(x, 32)) + font.Add(curChar) + Next + + + For a = 0 To byt.Count - 2 Step 2 + + Dim c = byt(a) + byt(a + 1) * 256 + + If c = &H1120 Or c = &H1131 Then + curX = curX + 12 + Continue For + End If + + If c = &H122E Then + CurColor = byt(a + 2) + a = a + 2 + Continue For + End If + + If c = &H1103 Then + y = y + 12 + Continue For + End If + + 'DrawChar(font(c), curX, curY, df, CurColor) + DrawChar(font(c), curX, curY, df, 0) + curX = curX + 12 +notDraw: + + + Next + + + + + + End Sub + + + Public Sub DrawChar(ByRef ch As List(Of Byte), ByVal tx As Integer, ByVal ty As Integer, ByRef df As Bitmap, ByRef CurColor As Integer) + + Dim ch2 = New List(Of Byte) + For Each C In ch + ch2.Add(ReverseBits(C)) + Next + Dim curSize = Form1.PictureBox1.Size + + Dim bits = New BitArray(ch2.ToArray) + + For x = 0 To 15 + For y = 0 To 15 + If x + tx >= curSize.Width Or y + ty >= curSize.Height Then Continue For + + If Not bits(x + 16 * y) Then Continue For + DrawX2(x + tx, y + ty, df, Colors(CurColor)) + Next + Next + + Form1.PictureBox1.Invalidate() + + End Sub + + + Public Sub DrawX2(ByRef x As Integer, ByRef y As Integer, ByRef df As Bitmap, ByVal col As Color) + + + df.SetPixel(x * 2, y * 2, col) + df.SetPixel(x * 2 + 1, y * 2, col) + df.SetPixel(x * 2, y * 2 + 1, col) + df.SetPixel(x * 2 + 1, y * 2 + 1, col) + + + End Sub +End Class diff --git a/p2isPSX_CDToolkit/Form1.Designer.vb b/p2isPSX_CDToolkit/Form1.Designer.vb new file mode 100644 index 0000000..3601dd4 --- /dev/null +++ b/p2isPSX_CDToolkit/Form1.Designer.vb @@ -0,0 +1,2212 @@ + +Partial Class Form1 + Inherits System.Windows.Forms.Form + + 'Форма переопределяет dispose для очистки списка компонентов. + + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Является обязательной для конструктора форм Windows Forms + Private components As System.ComponentModel.IContainer + + 'Примечание: следующая процедура является обязательной для конструктора форм Windows Forms + 'Для ее изменения используйте конструктор форм Windows Form. + 'Не изменяйте ее в редакторе исходного кода. + + Private Sub InitializeComponent() + Dim DataGridViewCellStyle1 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() + Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(Form1)) + Me.JapISOPath = New System.Windows.Forms.TextBox() + Me.EngISOPath = New System.Windows.Forms.TextBox() + Me.Label1 = New System.Windows.Forms.Label() + Me.Label2 = New System.Windows.Forms.Label() + Me.UserPath = New System.Windows.Forms.TextBox() + Me.Label3 = New System.Windows.Forms.Label() + Me.KUDOSpath = New System.Windows.Forms.TextBox() + Me.Label4 = New System.Windows.Forms.Label() + Me.TabControl1 = New System.Windows.Forms.TabControl() + Me.ReplaceTextExecutes = New System.Windows.Forms.TabPage() + Me.RelpaceTextExecs = New System.Windows.Forms.Button() + Me.Label23 = New System.Windows.Forms.Label() + Me.GroupBox11 = New System.Windows.Forms.GroupBox() + Me.UpperCLUT = New System.Windows.Forms.CheckBox() + Me.LowerCLUT = New System.Windows.Forms.CheckBox() + Me.Force4bit = New System.Windows.Forms.CheckBox() + Me.ImgShow = New System.Windows.Forms.Button() + Me.Show16bit = New System.Windows.Forms.Button() + Me.ClutShift = New System.Windows.Forms.NumericUpDown() + Me.CLUTid = New System.Windows.Forms.NumericUpDown() + Me.Label21 = New System.Windows.Forms.Label() + Me.CLUTs = New System.Windows.Forms.Label() + Me.SortedFileList = New System.Windows.Forms.ListBox() + Me.ShowSorted = New System.Windows.Forms.Button() + Me.SearchHexPattern = New System.Windows.Forms.Button() + Me.HexPatternBox = New System.Windows.Forms.TextBox() + Me.GroupBox3 = New System.Windows.Forms.GroupBox() + Me.GroupBox10 = New System.Windows.Forms.GroupBox() + Me.imp16bit = New System.Windows.Forms.RadioButton() + Me.Imp8bit = New System.Windows.Forms.RadioButton() + Me.imp4bit = New System.Windows.Forms.RadioButton() + Me.PNGimport = New System.Windows.Forms.Button() + Me.IgnoreGaps = New System.Windows.Forms.CheckBox() + Me.ForceRle = New System.Windows.Forms.CheckBox() + Me.getFreeSector = New System.Windows.Forms.Button() + Me.importToBin = New System.Windows.Forms.Button() + Me.notEncodeTorle = New System.Windows.Forms.RadioButton() + Me.encodeTOrle = New System.Windows.Forms.RadioButton() + Me.Label6 = New System.Windows.Forms.Label() + Me.importSector = New System.Windows.Forms.TextBox() + Me.SelBinFiles = New System.Windows.Forms.ListBox() + Me.GroupBox2 = New System.Windows.Forms.GroupBox() + Me.Tim8Shift = New System.Windows.Forms.CheckBox() + Me.CompareBTS = New System.Windows.Forms.TextBox() + Me.Label24 = New System.Windows.Forms.Label() + Me.SearchPointers = New System.Windows.Forms.Button() + Me.alpha0 = New System.Windows.Forms.CheckBox() + Me.PngExport = New System.Windows.Forms.Button() + Me.MakePointers = New System.Windows.Forms.Button() + Me.CreateBinDirCheck = New System.Windows.Forms.CheckBox() + Me.ExportUnrleFile = New System.Windows.Forms.Button() + Me.ExportRaw = New System.Windows.Forms.RadioButton() + Me.ExportRLEDec = New System.Windows.Forms.RadioButton() + Me.Label8 = New System.Windows.Forms.Label() + Me.Savedlbl = New System.Windows.Forms.Label() + Me.ExportBinPath = New System.Windows.Forms.TextBox() + Me.Panel1 = New System.Windows.Forms.Panel() + Me.FilnamLabel = New System.Windows.Forms.Label() + Me.GroupBox1 = New System.Windows.Forms.GroupBox() + Me.FileDescr = New System.Windows.Forms.TextBox() + Me.NotDeconstr = New System.Windows.Forms.CheckBox() + Me.Mode2352 = New System.Windows.Forms.CheckBox() + Me.UpdateSizeTable = New System.Windows.Forms.CheckBox() + Me.ExpMainExe = New System.Windows.Forms.Button() + Me.ImportCode = New System.Windows.Forms.Button() + Me.importRAWtoSel = New System.Windows.Forms.Button() + Me.exportBinfiletoBIN = New System.Windows.Forms.Button() + Me.OPenBinBtn = New System.Windows.Forms.Button() + Me.CDFileList = New System.Windows.Forms.ListBox() + Me.ReadCDFileTable = New System.Windows.Forms.Button() + Me.Label22 = New System.Windows.Forms.Label() + Me.Label10 = New System.Windows.Forms.Label() + Me.japRadio = New System.Windows.Forms.RadioButton() + Me.KudosBtn = New System.Windows.Forms.RadioButton() + Me.EngRadio = New System.Windows.Forms.RadioButton() + Me.UserRadio = New System.Windows.Forms.RadioButton() + Me.TabPage2 = New System.Windows.Forms.TabPage() + Me.makeTreeTest = New System.Windows.Forms.Button() + Me.Label14 = New System.Windows.Forms.Label() + Me.encodeID = New System.Windows.Forms.TextBox() + Me.RLEdecode = New System.Windows.Forms.Button() + Me.Unrle_Btn = New System.Windows.Forms.Button() + Me.unRLEfileOpen = New System.Windows.Forms.Button() + Me.Label7 = New System.Windows.Forms.Label() + Me.unRLEfile = New System.Windows.Forms.TextBox() + Me.TabPage3 = New System.Windows.Forms.TabPage() + Me.PatchCytyTextCoords = New System.Windows.Forms.Button() + Me.GroupBox7 = New System.Windows.Forms.GroupBox() + Me.TextBox5 = New System.Windows.Forms.TextBox() + Me.Label16 = New System.Windows.Forms.Label() + Me.DialLeftSpaceWr = New System.Windows.Forms.Button() + Me.coordMultiAsmWr = New System.Windows.Forms.Button() + Me.WriteFontWide1 = New System.Windows.Forms.Button() + Me.DialLeftSpaceRd = New System.Windows.Forms.Button() + Me.coordMultiAsmRd = New System.Windows.Forms.Button() + Me.ReadFontWide1 = New System.Windows.Forms.Button() + Me.DialLeftSpaceText = New System.Windows.Forms.TextBox() + Me.TextCharSpacer = New System.Windows.Forms.TextBox() + Me.FontWide1 = New System.Windows.Forms.TextBox() + Me.ConvertTo12x12 = New System.Windows.Forms.Button() + Me.ModifyFont = New System.Windows.Forms.Button() + Me.Label19 = New System.Windows.Forms.Label() + Me.Label18 = New System.Windows.Forms.Label() + Me.Label11 = New System.Windows.Forms.Label() + Me.Label15 = New System.Windows.Forms.Label() + Me.Label9 = New System.Windows.Forms.Label() + Me.TextBox3 = New System.Windows.Forms.TextBox() + Me.TabPage6 = New System.Windows.Forms.TabPage() + Me.ParseEvent = New System.Windows.Forms.Button() + Me.GroupBox6 = New System.Windows.Forms.GroupBox() + Me.Export518_675 = New System.Windows.Forms.Button() + Me.Export181577 = New System.Windows.Forms.Button() + Me.Export181RUS = New System.Windows.Forms.Button() + Me.Export1112RUS = New System.Windows.Forms.Button() + Me.SceneryImport = New System.Windows.Forms.Button() + Me.ConvertEventsForEditing = New System.Windows.Forms.Button() + Me.DistrEditor = New System.Windows.Forms.Button() + Me.CharCodeGenerator = New System.Windows.Forms.Button() + Me.GenChars = New System.Windows.Forms.Button() + Me.Label20 = New System.Windows.Forms.Label() + Me.GroupBox9 = New System.Windows.Forms.GroupBox() + Me.Convert_Summon = New System.Windows.Forms.Button() + Me.Summon_Export = New System.Windows.Forms.Button() + Me.GroupBox8 = New System.Windows.Forms.GroupBox() + Me.ConvertContactScript = New System.Windows.Forms.Button() + Me.ExportContact = New System.Windows.Forms.Button() + Me.ExportDUNGScripts = New System.Windows.Forms.Button() + Me.Button1 = New System.Windows.Forms.Button() + Me.OffsetEditorBtn = New System.Windows.Forms.Button() + Me.ScriptView = New System.Windows.Forms.Button() + Me.GroupBox5 = New System.Windows.Forms.GroupBox() + Me.NewTextMODE = New System.Windows.Forms.CheckBox() + Me.ImportTXT = New System.Windows.Forms.Button() + Me.GroupBox4 = New System.Windows.Forms.GroupBox() + Me.UnKudosScript = New System.Windows.Forms.CheckBox() + Me.SelExportCript = New System.Windows.Forms.Button() + Me.TabPage4 = New System.Windows.Forms.TabPage() + Me.SaveTit = New System.Windows.Forms.Button() + Me.LoadTitles = New System.Windows.Forms.Button() + Me.TGrid = New System.Windows.Forms.DataGridView() + Me.ID = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.SaveTitles = New System.Windows.Forms.Button() + Me.TitlesLoad = New System.Windows.Forms.Button() + Me.TabPage5 = New System.Windows.Forms.TabPage() + Me.RadioSort1 = New System.Windows.Forms.RadioButton() + Me.SortCDFiles = New System.Windows.Forms.Button() + Me.CDLoadSortedFiles = New System.Windows.Forms.Button() + Me.CDGrid = New System.Windows.Forms.DataGridView() + Me.DataGridViewTextBoxColumn1 = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.JAP = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.SizeB = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.Eng = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.EndSec = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.Gap = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.TabPage7 = New System.Windows.Forms.TabPage() + Me.PSP_UNPACK_EVENT_BIN = New System.Windows.Forms.Button() + Me.PictureBox1 = New System.Windows.Forms.PictureBox() + Me.RawSectorImport = New System.Windows.Forms.TextBox() + Me.RawToSectorImport = New System.Windows.Forms.Button() + Me.Label13 = New System.Windows.Forms.Label() + Me.Label12 = New System.Windows.Forms.Label() + Me.WorkDir = New System.Windows.Forms.TextBox() + Me.Label5 = New System.Windows.Forms.Label() + Me.OpenFileDialog1 = New System.Windows.Forms.OpenFileDialog() + Me.SaveFileDialog1 = New System.Windows.Forms.SaveFileDialog() + Me.tstBtn = New System.Windows.Forms.Button() + Me.Label17 = New System.Windows.Forms.Label() + Me.CDFreeSpaceLabel = New System.Windows.Forms.Label() + Me.SaveShadowDisc = New System.Windows.Forms.Button() + Me.LastSectorLbl = New System.Windows.Forms.Label() + Me.ProgressBar1 = New System.Windows.Forms.ProgressBar() + Me.BackgroundWorker1 = New System.ComponentModel.BackgroundWorker() + Me.conv3D = New System.Windows.Forms.Button() + Me.TabControl1.SuspendLayout() + Me.ReplaceTextExecutes.SuspendLayout() + Me.GroupBox11.SuspendLayout() + CType(Me.ClutShift, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.CLUTid, System.ComponentModel.ISupportInitialize).BeginInit() + Me.GroupBox3.SuspendLayout() + Me.GroupBox10.SuspendLayout() + Me.GroupBox2.SuspendLayout() + Me.GroupBox1.SuspendLayout() + Me.TabPage2.SuspendLayout() + Me.TabPage3.SuspendLayout() + Me.GroupBox7.SuspendLayout() + Me.TabPage6.SuspendLayout() + Me.GroupBox6.SuspendLayout() + Me.GroupBox9.SuspendLayout() + Me.GroupBox8.SuspendLayout() + Me.GroupBox5.SuspendLayout() + Me.GroupBox4.SuspendLayout() + Me.TabPage4.SuspendLayout() + CType(Me.TGrid, System.ComponentModel.ISupportInitialize).BeginInit() + Me.TabPage5.SuspendLayout() + CType(Me.CDGrid, System.ComponentModel.ISupportInitialize).BeginInit() + Me.TabPage7.SuspendLayout() + CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SuspendLayout() + ' + 'JapISOPath + ' + Me.JapISOPath.Location = New System.Drawing.Point(12, 22) + Me.JapISOPath.Name = "JapISOPath" + Me.JapISOPath.Size = New System.Drawing.Size(300, 20) + Me.JapISOPath.TabIndex = 0 + Me.JapISOPath.Text = "D:\Games\PSX\Persona 2 - Batsu (NTSC-J) [SLPS-02825]\Persona 2 - Batsu (NTSC-J) [" & + "SLPS-02825].bin" + ' + 'EngISOPath + ' + Me.EngISOPath.Location = New System.Drawing.Point(12, 60) + Me.EngISOPath.Name = "EngISOPath" + Me.EngISOPath.Size = New System.Drawing.Size(300, 20) + Me.EngISOPath.TabIndex = 0 + Me.EngISOPath.Text = "D:\Games\PSX\Persona 2 - Batsu (NTSC-J) [SLPS-02825]\Persona 2 - EP (USA) [Locali" & + "zed - Undub].bin" + ' + 'Label1 + ' + Me.Label1.AutoSize = True + Me.Label1.Location = New System.Drawing.Point(12, 6) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(127, 13) + Me.Label1.TabIndex = 1 + Me.Label1.Text = "Japan EP CD Image .BIN" + ' + 'Label2 + ' + Me.Label2.AutoSize = True + Me.Label2.Location = New System.Drawing.Point(12, 45) + Me.Label2.Name = "Label2" + Me.Label2.Size = New System.Drawing.Size(120, 13) + Me.Label2.TabIndex = 1 + Me.Label2.Text = "USA EP CD Image .BIN" + ' + 'UserPath + ' + Me.UserPath.Location = New System.Drawing.Point(334, 21) + Me.UserPath.Name = "UserPath" + Me.UserPath.Size = New System.Drawing.Size(300, 20) + Me.UserPath.TabIndex = 0 + Me.UserPath.Text = "D:\Games\PSX\Persona 2 - Batsu (NTSC-J) [SLPS-02825]\Persona 2 - Batsu USER.bin" + ' + 'Label3 + ' + Me.Label3.AutoSize = True + Me.Label3.Location = New System.Drawing.Point(334, 6) + Me.Label3.Name = "Label3" + Me.Label3.Size = New System.Drawing.Size(102, 13) + Me.Label3.TabIndex = 1 + Me.Label3.Text = "User (Modified) .BIN" + ' + 'KUDOSpath + ' + Me.KUDOSpath.Location = New System.Drawing.Point(334, 60) + Me.KUDOSpath.Name = "KUDOSpath" + Me.KUDOSpath.Size = New System.Drawing.Size(300, 20) + Me.KUDOSpath.TabIndex = 0 + Me.KUDOSpath.Text = "D:\Games\PSX\Persona 2 - Batsu (NTSC-J) [SLPS-02825]\P2_KUDOS.bin" + ' + 'Label4 + ' + Me.Label4.AutoSize = True + Me.Label4.Location = New System.Drawing.Point(334, 45) + Me.Label4.Name = "Label4" + Me.Label4.Size = New System.Drawing.Size(69, 13) + Me.Label4.TabIndex = 1 + Me.Label4.Text = "KUDOS .BIN" + ' + 'TabControl1 + ' + Me.TabControl1.Controls.Add(Me.ReplaceTextExecutes) + Me.TabControl1.Controls.Add(Me.TabPage2) + Me.TabControl1.Controls.Add(Me.TabPage3) + Me.TabControl1.Controls.Add(Me.TabPage6) + Me.TabControl1.Controls.Add(Me.TabPage4) + Me.TabControl1.Controls.Add(Me.TabPage5) + Me.TabControl1.Controls.Add(Me.TabPage7) + Me.TabControl1.Location = New System.Drawing.Point(12, 98) + Me.TabControl1.Name = "TabControl1" + Me.TabControl1.SelectedIndex = 0 + Me.TabControl1.Size = New System.Drawing.Size(1147, 647) + Me.TabControl1.TabIndex = 2 + ' + 'ReplaceTextExecutes + ' + Me.ReplaceTextExecutes.BackColor = System.Drawing.Color.Silver + Me.ReplaceTextExecutes.Controls.Add(Me.RelpaceTextExecs) + Me.ReplaceTextExecutes.Controls.Add(Me.Label23) + Me.ReplaceTextExecutes.Controls.Add(Me.GroupBox11) + Me.ReplaceTextExecutes.Controls.Add(Me.SortedFileList) + Me.ReplaceTextExecutes.Controls.Add(Me.ShowSorted) + Me.ReplaceTextExecutes.Controls.Add(Me.SearchHexPattern) + Me.ReplaceTextExecutes.Controls.Add(Me.HexPatternBox) + Me.ReplaceTextExecutes.Controls.Add(Me.GroupBox3) + Me.ReplaceTextExecutes.Controls.Add(Me.SelBinFiles) + Me.ReplaceTextExecutes.Controls.Add(Me.GroupBox2) + Me.ReplaceTextExecutes.Controls.Add(Me.FilnamLabel) + Me.ReplaceTextExecutes.Controls.Add(Me.GroupBox1) + Me.ReplaceTextExecutes.Location = New System.Drawing.Point(4, 22) + Me.ReplaceTextExecutes.Name = "ReplaceTextExecutes" + Me.ReplaceTextExecutes.Padding = New System.Windows.Forms.Padding(3) + Me.ReplaceTextExecutes.Size = New System.Drawing.Size(1139, 621) + Me.ReplaceTextExecutes.TabIndex = 0 + Me.ReplaceTextExecutes.Text = "ISO < > files" + ' + 'RelpaceTextExecs + ' + Me.RelpaceTextExecs.Location = New System.Drawing.Point(22, 592) + Me.RelpaceTextExecs.Name = "RelpaceTextExecs" + Me.RelpaceTextExecs.Size = New System.Drawing.Size(283, 23) + Me.RelpaceTextExecs.TabIndex = 18 + Me.RelpaceTextExecs.Text = "Replace All Text Calls (8001a3a8) in Selected" + Me.RelpaceTextExecs.UseVisualStyleBackColor = True + ' + 'Label23 + ' + Me.Label23.AutoSize = True + Me.Label23.Location = New System.Drawing.Point(323, 541) + Me.Label23.Name = "Label23" + Me.Label23.Size = New System.Drawing.Size(31, 13) + Me.Label23.TabIndex = 17 + Me.Label23.Text = "<<<<" + ' + 'GroupBox11 + ' + Me.GroupBox11.BackColor = System.Drawing.Color.PaleGreen + Me.GroupBox11.Controls.Add(Me.UpperCLUT) + Me.GroupBox11.Controls.Add(Me.LowerCLUT) + Me.GroupBox11.Controls.Add(Me.Force4bit) + Me.GroupBox11.Controls.Add(Me.ImgShow) + Me.GroupBox11.Controls.Add(Me.Show16bit) + Me.GroupBox11.Controls.Add(Me.ClutShift) + Me.GroupBox11.Controls.Add(Me.CLUTid) + Me.GroupBox11.Controls.Add(Me.Label21) + Me.GroupBox11.Controls.Add(Me.CLUTs) + Me.GroupBox11.Location = New System.Drawing.Point(922, 11) + Me.GroupBox11.Name = "GroupBox11" + Me.GroupBox11.Size = New System.Drawing.Size(204, 161) + Me.GroupBox11.TabIndex = 16 + Me.GroupBox11.TabStop = False + Me.GroupBox11.Text = "Show Image --->" + ' + 'UpperCLUT + ' + Me.UpperCLUT.AutoSize = True + Me.UpperCLUT.Location = New System.Drawing.Point(5, 82) + Me.UpperCLUT.Name = "UpperCLUT" + Me.UpperCLUT.Size = New System.Drawing.Size(83, 17) + Me.UpperCLUT.TabIndex = 17 + Me.UpperCLUT.Text = "UpperCLUT" + Me.UpperCLUT.UseVisualStyleBackColor = True + ' + 'LowerCLUT + ' + Me.LowerCLUT.AutoSize = True + Me.LowerCLUT.Location = New System.Drawing.Point(5, 99) + Me.LowerCLUT.Name = "LowerCLUT" + Me.LowerCLUT.Size = New System.Drawing.Size(86, 17) + Me.LowerCLUT.TabIndex = 16 + Me.LowerCLUT.Text = "Lower CLUT" + Me.LowerCLUT.UseVisualStyleBackColor = True + ' + 'Force4bit + ' + Me.Force4bit.AutoSize = True + Me.Force4bit.Location = New System.Drawing.Point(5, 38) + Me.Force4bit.Name = "Force4bit" + Me.Force4bit.Size = New System.Drawing.Size(70, 17) + Me.Force4bit.TabIndex = 15 + Me.Force4bit.Text = "Force4bit" + Me.Force4bit.UseVisualStyleBackColor = True + ' + 'ImgShow + ' + Me.ImgShow.Location = New System.Drawing.Point(94, 34) + Me.ImgShow.Name = "ImgShow" + Me.ImgShow.Size = New System.Drawing.Size(103, 23) + Me.ImgShow.TabIndex = 13 + Me.ImgShow.Text = "Show Image --->" + Me.ImgShow.UseVisualStyleBackColor = True + ' + 'Show16bit + ' + Me.Show16bit.Location = New System.Drawing.Point(49, 132) + Me.Show16bit.Name = "Show16bit" + Me.Show16bit.Size = New System.Drawing.Size(148, 23) + Me.Show16bit.TabIndex = 14 + Me.Show16bit.Text = "Show16Bit img / CLUT -->" + Me.Show16bit.UseVisualStyleBackColor = True + ' + 'ClutShift + ' + Me.ClutShift.Location = New System.Drawing.Point(162, 84) + Me.ClutShift.Name = "ClutShift" + Me.ClutShift.Size = New System.Drawing.Size(35, 20) + Me.ClutShift.TabIndex = 11 + ' + 'CLUTid + ' + Me.CLUTid.Location = New System.Drawing.Point(163, 60) + Me.CLUTid.Name = "CLUTid" + Me.CLUTid.Size = New System.Drawing.Size(35, 20) + Me.CLUTid.TabIndex = 11 + ' + 'Label21 + ' + Me.Label21.Location = New System.Drawing.Point(96, 87) + Me.Label21.Name = "Label21" + Me.Label21.Size = New System.Drawing.Size(86, 14) + Me.Label21.TabIndex = 12 + Me.Label21.Text = "CLUT shift" + ' + 'CLUTs + ' + Me.CLUTs.Location = New System.Drawing.Point(92, 62) + Me.CLUTs.Name = "CLUTs" + Me.CLUTs.Size = New System.Drawing.Size(86, 14) + Me.CLUTs.TabIndex = 12 + Me.CLUTs.Text = "CLUTs Num:" + ' + 'SortedFileList + ' + Me.SortedFileList.FormattingEnabled = True + Me.SortedFileList.HorizontalScrollbar = True + Me.SortedFileList.Location = New System.Drawing.Point(923, 241) + Me.SortedFileList.Name = "SortedFileList" + Me.SortedFileList.Size = New System.Drawing.Size(197, 368) + Me.SortedFileList.TabIndex = 10 + ' + 'ShowSorted + ' + Me.ShowSorted.Location = New System.Drawing.Point(922, 212) + Me.ShowSorted.Name = "ShowSorted" + Me.ShowSorted.Size = New System.Drawing.Size(197, 23) + Me.ShowSorted.TabIndex = 9 + Me.ShowSorted.Text = "Show SectorSortedFileList" + Me.ShowSorted.UseVisualStyleBackColor = True + ' + 'SearchHexPattern + ' + Me.SearchHexPattern.Location = New System.Drawing.Point(360, 560) + Me.SearchHexPattern.Name = "SearchHexPattern" + Me.SearchHexPattern.Size = New System.Drawing.Size(289, 22) + Me.SearchHexPattern.TabIndex = 8 + Me.SearchHexPattern.Text = "Search HEX Offset in all CD" + Me.SearchHexPattern.UseVisualStyleBackColor = True + ' + 'HexPatternBox + ' + Me.HexPatternBox.Location = New System.Drawing.Point(360, 539) + Me.HexPatternBox.Name = "HexPatternBox" + Me.HexPatternBox.Size = New System.Drawing.Size(289, 20) + Me.HexPatternBox.TabIndex = 7 + ' + 'GroupBox3 + ' + Me.GroupBox3.BackColor = System.Drawing.Color.SkyBlue + Me.GroupBox3.Controls.Add(Me.GroupBox10) + Me.GroupBox3.Controls.Add(Me.IgnoreGaps) + Me.GroupBox3.Controls.Add(Me.ForceRle) + Me.GroupBox3.Controls.Add(Me.getFreeSector) + Me.GroupBox3.Controls.Add(Me.importToBin) + Me.GroupBox3.Controls.Add(Me.notEncodeTorle) + Me.GroupBox3.Controls.Add(Me.encodeTOrle) + Me.GroupBox3.Controls.Add(Me.Label6) + Me.GroupBox3.Controls.Add(Me.importSector) + Me.GroupBox3.Location = New System.Drawing.Point(658, 297) + Me.GroupBox3.Name = "GroupBox3" + Me.GroupBox3.Size = New System.Drawing.Size(259, 300) + Me.GroupBox3.TabIndex = 3 + Me.GroupBox3.TabStop = False + Me.GroupBox3.Text = "Import" + ' + 'GroupBox10 + ' + Me.GroupBox10.BackColor = System.Drawing.Color.LightGreen + Me.GroupBox10.Controls.Add(Me.imp16bit) + Me.GroupBox10.Controls.Add(Me.Imp8bit) + Me.GroupBox10.Controls.Add(Me.imp4bit) + Me.GroupBox10.Controls.Add(Me.PNGimport) + Me.GroupBox10.Location = New System.Drawing.Point(7, 200) + Me.GroupBox10.Name = "GroupBox10" + Me.GroupBox10.Size = New System.Drawing.Size(247, 100) + Me.GroupBox10.TabIndex = 12 + Me.GroupBox10.TabStop = False + Me.GroupBox10.Text = "IMG IMPORT" + ' + 'imp16bit + ' + Me.imp16bit.AutoSize = True + Me.imp16bit.Location = New System.Drawing.Point(57, 42) + Me.imp16bit.Name = "imp16bit" + Me.imp16bit.Size = New System.Drawing.Size(125, 17) + Me.imp16bit.TabIndex = 11 + Me.imp16bit.Text = "16bit mode(TrueCols)" + Me.imp16bit.UseVisualStyleBackColor = True + ' + 'Imp8bit + ' + Me.Imp8bit.AutoSize = True + Me.Imp8bit.Location = New System.Drawing.Point(121, 19) + Me.Imp8bit.Name = "Imp8bit" + Me.Imp8bit.Size = New System.Drawing.Size(114, 17) + Me.Imp8bit.TabIndex = 10 + Me.Imp8bit.Text = "8bit mode(256cols)" + Me.Imp8bit.UseVisualStyleBackColor = True + ' + 'imp4bit + ' + Me.imp4bit.AutoSize = True + Me.imp4bit.Checked = True + Me.imp4bit.Location = New System.Drawing.Point(7, 19) + Me.imp4bit.Name = "imp4bit" + Me.imp4bit.Size = New System.Drawing.Size(108, 17) + Me.imp4bit.TabIndex = 0 + Me.imp4bit.TabStop = True + Me.imp4bit.Text = "4bit mode(16cols)" + Me.imp4bit.UseVisualStyleBackColor = True + ' + 'PNGimport + ' + Me.PNGimport.Location = New System.Drawing.Point(5, 71) + Me.PNGimport.Name = "PNGimport" + Me.PNGimport.Size = New System.Drawing.Size(236, 23) + Me.PNGimport.TabIndex = 9 + Me.PNGimport.Text = "Import PNG to selected w/ source compr." + Me.PNGimport.UseVisualStyleBackColor = True + ' + 'IgnoreGaps + ' + Me.IgnoreGaps.AutoSize = True + Me.IgnoreGaps.Location = New System.Drawing.Point(10, 62) + Me.IgnoreGaps.Name = "IgnoreGaps" + Me.IgnoreGaps.Size = New System.Drawing.Size(112, 17) + Me.IgnoreGaps.TabIndex = 11 + Me.IgnoreGaps.Text = "IgnoreSectorGaps" + Me.IgnoreGaps.UseVisualStyleBackColor = True + ' + 'ForceRle + ' + Me.ForceRle.AutoSize = True + Me.ForceRle.CheckAlign = System.Drawing.ContentAlignment.MiddleRight + Me.ForceRle.Location = New System.Drawing.Point(150, 19) + Me.ForceRle.Name = "ForceRle" + Me.ForceRle.Size = New System.Drawing.Size(104, 17) + Me.ForceRle.TabIndex = 10 + Me.ForceRle.Text = "<<< ForceRLE(!)" + Me.ForceRle.UseVisualStyleBackColor = True + ' + 'getFreeSector + ' + Me.getFreeSector.Location = New System.Drawing.Point(122, 73) + Me.getFreeSector.Name = "getFreeSector" + Me.getFreeSector.Size = New System.Drawing.Size(131, 39) + Me.getFreeSector.TabIndex = 8 + Me.getFreeSector.Text = "Get New Free Sector" + Me.getFreeSector.UseVisualStyleBackColor = True + ' + 'importToBin + ' + Me.importToBin.Location = New System.Drawing.Point(6, 145) + Me.importToBin.Name = "importToBin" + Me.importToBin.Size = New System.Drawing.Size(247, 49) + Me.importToBin.TabIndex = 1 + Me.importToBin.Text = "Select File and import To Selected Bin" + Me.importToBin.UseVisualStyleBackColor = True + ' + 'notEncodeTorle + ' + Me.notEncodeTorle.AutoSize = True + Me.notEncodeTorle.Location = New System.Drawing.Point(10, 39) + Me.notEncodeTorle.Name = "notEncodeTorle" + Me.notEncodeTorle.Size = New System.Drawing.Size(139, 17) + Me.notEncodeTorle.TabIndex = 0 + Me.notEncodeTorle.Text = "RAW Import (Tim, etc...)" + Me.notEncodeTorle.UseVisualStyleBackColor = True + ' + 'encodeTOrle + ' + Me.encodeTOrle.AutoSize = True + Me.encodeTOrle.Checked = True + Me.encodeTOrle.Location = New System.Drawing.Point(11, 17) + Me.encodeTOrle.Name = "encodeTOrle" + Me.encodeTOrle.Size = New System.Drawing.Size(122, 17) + Me.encodeTOrle.TabIndex = 0 + Me.encodeTOrle.TabStop = True + Me.encodeTOrle.Text = "Source Compression" + Me.encodeTOrle.UseVisualStyleBackColor = True + ' + 'Label6 + ' + Me.Label6.Location = New System.Drawing.Point(3, 90) + Me.Label6.Name = "Label6" + Me.Label6.Size = New System.Drawing.Size(99, 26) + Me.Label6.TabIndex = 1 + Me.Label6.Text = "Import Sector Address" + Me.Label6.TextAlign = System.Drawing.ContentAlignment.MiddleCenter + ' + 'importSector + ' + Me.importSector.Location = New System.Drawing.Point(6, 119) + Me.importSector.Name = "importSector" + Me.importSector.Size = New System.Drawing.Size(247, 20) + Me.importSector.TabIndex = 6 + Me.importSector.Text = "280000" + ' + 'SelBinFiles + ' + Me.SelBinFiles.FormattingEnabled = True + Me.SelBinFiles.HorizontalScrollbar = True + Me.SelBinFiles.Location = New System.Drawing.Point(318, 54) + Me.SelBinFiles.Name = "SelBinFiles" + Me.SelBinFiles.Size = New System.Drawing.Size(331, 485) + Me.SelBinFiles.TabIndex = 2 + ' + 'GroupBox2 + ' + Me.GroupBox2.BackColor = System.Drawing.Color.Thistle + Me.GroupBox2.Controls.Add(Me.Tim8Shift) + Me.GroupBox2.Controls.Add(Me.CompareBTS) + Me.GroupBox2.Controls.Add(Me.Label24) + Me.GroupBox2.Controls.Add(Me.SearchPointers) + Me.GroupBox2.Controls.Add(Me.alpha0) + Me.GroupBox2.Controls.Add(Me.PngExport) + Me.GroupBox2.Controls.Add(Me.MakePointers) + Me.GroupBox2.Controls.Add(Me.CreateBinDirCheck) + Me.GroupBox2.Controls.Add(Me.ExportUnrleFile) + Me.GroupBox2.Controls.Add(Me.ExportRaw) + Me.GroupBox2.Controls.Add(Me.ExportRLEDec) + Me.GroupBox2.Controls.Add(Me.Label8) + Me.GroupBox2.Controls.Add(Me.Savedlbl) + Me.GroupBox2.Controls.Add(Me.ExportBinPath) + Me.GroupBox2.Controls.Add(Me.Panel1) + Me.GroupBox2.Location = New System.Drawing.Point(658, 52) + Me.GroupBox2.Name = "GroupBox2" + Me.GroupBox2.Size = New System.Drawing.Size(259, 239) + Me.GroupBox2.TabIndex = 3 + Me.GroupBox2.TabStop = False + Me.GroupBox2.Text = "Export" + ' + 'Tim8Shift + ' + Me.Tim8Shift.AutoSize = True + Me.Tim8Shift.BackColor = System.Drawing.Color.Transparent + Me.Tim8Shift.Location = New System.Drawing.Point(178, 218) + Me.Tim8Shift.Name = "Tim8Shift" + Me.Tim8Shift.Size = New System.Drawing.Size(70, 17) + Me.Tim8Shift.TabIndex = 11 + Me.Tim8Shift.Text = "Tim8Shift" + Me.Tim8Shift.UseVisualStyleBackColor = False + ' + 'CompareBTS + ' + Me.CompareBTS.Location = New System.Drawing.Point(78, 201) + Me.CompareBTS.Name = "CompareBTS" + Me.CompareBTS.Size = New System.Drawing.Size(35, 20) + Me.CompareBTS.TabIndex = 10 + Me.CompareBTS.Text = "2048" + ' + 'Label24 + ' + Me.Label24.AutoSize = True + Me.Label24.BackColor = System.Drawing.Color.Transparent + Me.Label24.Location = New System.Drawing.Point(8, 204) + Me.Label24.Name = "Label24" + Me.Label24.Size = New System.Drawing.Size(70, 13) + Me.Label24.TabIndex = 9 + Me.Label24.Text = "CompareBTS" + ' + 'SearchPointers + ' + Me.SearchPointers.Location = New System.Drawing.Point(117, 200) + Me.SearchPointers.Name = "SearchPointers" + Me.SearchPointers.Size = New System.Drawing.Size(132, 20) + Me.SearchPointers.TabIndex = 8 + Me.SearchPointers.Text = "Search FileTable in ISO" + Me.SearchPointers.UseVisualStyleBackColor = True + ' + 'alpha0 + ' + Me.alpha0.AutoSize = True + Me.alpha0.Checked = True + Me.alpha0.CheckState = System.Windows.Forms.CheckState.Checked + Me.alpha0.Location = New System.Drawing.Point(178, 41) + Me.alpha0.Name = "alpha0" + Me.alpha0.Size = New System.Drawing.Size(75, 17) + Me.alpha0.TabIndex = 7 + Me.alpha0.Text = "0 as alpha" + Me.alpha0.UseVisualStyleBackColor = True + ' + 'PngExport + ' + Me.PngExport.Location = New System.Drawing.Point(178, 13) + Me.PngExport.Name = "PngExport" + Me.PngExport.Size = New System.Drawing.Size(75, 23) + Me.PngExport.TabIndex = 6 + Me.PngExport.Text = "ExportPng" + Me.PngExport.UseVisualStyleBackColor = True + ' + 'MakePointers + ' + Me.MakePointers.Location = New System.Drawing.Point(177, 171) + Me.MakePointers.Name = "MakePointers" + Me.MakePointers.Size = New System.Drawing.Size(72, 23) + Me.MakePointers.TabIndex = 5 + Me.MakePointers.Text = "ExpPointers" + Me.MakePointers.UseVisualStyleBackColor = True + ' + 'CreateBinDirCheck + ' + Me.CreateBinDirCheck.AutoSize = True + Me.CreateBinDirCheck.Checked = True + Me.CreateBinDirCheck.CheckState = System.Windows.Forms.CheckState.Checked + Me.CreateBinDirCheck.Location = New System.Drawing.Point(6, 52) + Me.CreateBinDirCheck.Name = "CreateBinDirCheck" + Me.CreateBinDirCheck.Size = New System.Drawing.Size(96, 17) + Me.CreateBinDirCheck.TabIndex = 2 + Me.CreateBinDirCheck.Text = "Create bin DIR" + Me.CreateBinDirCheck.UseVisualStyleBackColor = True + ' + 'ExportUnrleFile + ' + Me.ExportUnrleFile.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(204, Byte)) + Me.ExportUnrleFile.Location = New System.Drawing.Point(7, 171) + Me.ExportUnrleFile.Name = "ExportUnrleFile" + Me.ExportUnrleFile.Size = New System.Drawing.Size(143, 23) + Me.ExportUnrleFile.TabIndex = 1 + Me.ExportUnrleFile.Text = "Export selected (E)" + Me.ExportUnrleFile.UseVisualStyleBackColor = True + ' + 'ExportRaw + ' + Me.ExportRaw.AutoSize = True + Me.ExportRaw.Location = New System.Drawing.Point(6, 35) + Me.ExportRaw.Name = "ExportRaw" + Me.ExportRaw.Size = New System.Drawing.Size(63, 17) + Me.ExportRaw.TabIndex = 0 + Me.ExportRaw.Text = "Raw file" + Me.ExportRaw.UseVisualStyleBackColor = True + ' + 'ExportRLEDec + ' + Me.ExportRLEDec.AutoSize = True + Me.ExportRLEDec.Checked = True + Me.ExportRLEDec.Location = New System.Drawing.Point(6, 19) + Me.ExportRLEDec.Name = "ExportRLEDec" + Me.ExportRLEDec.Size = New System.Drawing.Size(85, 17) + Me.ExportRLEDec.TabIndex = 0 + Me.ExportRLEDec.TabStop = True + Me.ExportRLEDec.Text = "RLE decode" + Me.ExportRLEDec.UseVisualStyleBackColor = True + ' + 'Label8 + ' + Me.Label8.Location = New System.Drawing.Point(137, 52) + Me.Label8.Name = "Label8" + Me.Label8.Size = New System.Drawing.Size(69, 20) + Me.Label8.TabIndex = 1 + Me.Label8.Text = "path" + Me.Label8.TextAlign = System.Drawing.ContentAlignment.MiddleCenter + ' + 'Savedlbl + ' + Me.Savedlbl.ForeColor = System.Drawing.Color.Lime + Me.Savedlbl.Location = New System.Drawing.Point(6, 127) + Me.Savedlbl.Name = "Savedlbl" + Me.Savedlbl.Size = New System.Drawing.Size(247, 67) + Me.Savedlbl.TabIndex = 4 + Me.Savedlbl.Text = "---" + Me.Savedlbl.TextAlign = System.Drawing.ContentAlignment.TopCenter + ' + 'ExportBinPath + ' + Me.ExportBinPath.Location = New System.Drawing.Point(6, 72) + Me.ExportBinPath.Multiline = True + Me.ExportBinPath.Name = "ExportBinPath" + Me.ExportBinPath.Size = New System.Drawing.Size(247, 52) + Me.ExportBinPath.TabIndex = 0 + ' + 'Panel1 + ' + Me.Panel1.BackColor = System.Drawing.Color.LightSteelBlue + Me.Panel1.Location = New System.Drawing.Point(6, 193) + Me.Panel1.Name = "Panel1" + Me.Panel1.Size = New System.Drawing.Size(248, 42) + Me.Panel1.TabIndex = 13 + ' + 'FilnamLabel + ' + Me.FilnamLabel.Font = New System.Drawing.Font("Microsoft Sans Serif", 15.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(204, Byte)) + Me.FilnamLabel.ForeColor = System.Drawing.Color.DarkCyan + Me.FilnamLabel.Location = New System.Drawing.Point(318, 18) + Me.FilnamLabel.Name = "FilnamLabel" + Me.FilnamLabel.Size = New System.Drawing.Size(598, 27) + Me.FilnamLabel.TabIndex = 1 + Me.FilnamLabel.Text = "What's inside file???" + Me.FilnamLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter + ' + 'GroupBox1 + ' + Me.GroupBox1.Controls.Add(Me.FileDescr) + Me.GroupBox1.Controls.Add(Me.NotDeconstr) + Me.GroupBox1.Controls.Add(Me.Mode2352) + Me.GroupBox1.Controls.Add(Me.UpdateSizeTable) + Me.GroupBox1.Controls.Add(Me.ExpMainExe) + Me.GroupBox1.Controls.Add(Me.ImportCode) + Me.GroupBox1.Controls.Add(Me.importRAWtoSel) + Me.GroupBox1.Controls.Add(Me.exportBinfiletoBIN) + Me.GroupBox1.Controls.Add(Me.OPenBinBtn) + Me.GroupBox1.Controls.Add(Me.CDFileList) + Me.GroupBox1.Controls.Add(Me.ReadCDFileTable) + Me.GroupBox1.Controls.Add(Me.Label22) + Me.GroupBox1.Controls.Add(Me.Label10) + Me.GroupBox1.Controls.Add(Me.japRadio) + Me.GroupBox1.Controls.Add(Me.KudosBtn) + Me.GroupBox1.Controls.Add(Me.EngRadio) + Me.GroupBox1.Controls.Add(Me.UserRadio) + Me.GroupBox1.Location = New System.Drawing.Point(15, 6) + Me.GroupBox1.Name = "GroupBox1" + Me.GroupBox1.Size = New System.Drawing.Size(297, 585) + Me.GroupBox1.TabIndex = 2 + Me.GroupBox1.TabStop = False + Me.GroupBox1.Text = "filetableRead" + ' + 'FileDescr + ' + Me.FileDescr.Location = New System.Drawing.Point(163, 96) + Me.FileDescr.Name = "FileDescr" + Me.FileDescr.Size = New System.Drawing.Size(128, 20) + Me.FileDescr.TabIndex = 10 + ' + 'NotDeconstr + ' + Me.NotDeconstr.AutoSize = True + Me.NotDeconstr.Location = New System.Drawing.Point(6, 90) + Me.NotDeconstr.Name = "NotDeconstr" + Me.NotDeconstr.Size = New System.Drawing.Size(112, 17) + Me.NotDeconstr.TabIndex = 9 + Me.NotDeconstr.Text = "Don't Deconstruct" + Me.NotDeconstr.UseVisualStyleBackColor = True + ' + 'Mode2352 + ' + Me.Mode2352.AutoSize = True + Me.Mode2352.Location = New System.Drawing.Point(163, 544) + Me.Mode2352.Name = "Mode2352" + Me.Mode2352.Size = New System.Drawing.Size(113, 17) + Me.Mode2352.TabIndex = 8 + Me.Mode2352.Text = "2352Mode (Video)" + Me.Mode2352.UseVisualStyleBackColor = True + ' + 'UpdateSizeTable + ' + Me.UpdateSizeTable.AutoSize = True + Me.UpdateSizeTable.Location = New System.Drawing.Point(7, 545) + Me.UpdateSizeTable.Name = "UpdateSizeTable" + Me.UpdateSizeTable.Size = New System.Drawing.Size(108, 17) + Me.UpdateSizeTable.TabIndex = 7 + Me.UpdateSizeTable.Text = "UpdateSizeTable" + Me.UpdateSizeTable.UseVisualStyleBackColor = True + ' + 'ExpMainExe + ' + Me.ExpMainExe.Location = New System.Drawing.Point(163, 560) + Me.ExpMainExe.Name = "ExpMainExe" + Me.ExpMainExe.Size = New System.Drawing.Size(128, 23) + Me.ExpMainExe.TabIndex = 6 + Me.ExpMainExe.Text = "Export SLPS_028.25" + Me.ExpMainExe.UseVisualStyleBackColor = True + ' + 'ImportCode + ' + Me.ImportCode.Location = New System.Drawing.Point(6, 560) + Me.ImportCode.Name = "ImportCode" + Me.ImportCode.Size = New System.Drawing.Size(120, 23) + Me.ImportCode.TabIndex = 5 + Me.ImportCode.Text = "IMPORT MAIN EXE" + Me.ImportCode.UseVisualStyleBackColor = True + ' + 'importRAWtoSel + ' + Me.importRAWtoSel.Location = New System.Drawing.Point(6, 519) + Me.importRAWtoSel.Name = "importRAWtoSel" + Me.importRAWtoSel.Size = New System.Drawing.Size(120, 23) + Me.importRAWtoSel.TabIndex = 4 + Me.importRAWtoSel.Text = "Import RAW to sel." + Me.importRAWtoSel.UseVisualStyleBackColor = True + ' + 'exportBinfiletoBIN + ' + Me.exportBinfiletoBIN.Location = New System.Drawing.Point(163, 519) + Me.exportBinfiletoBIN.Name = "exportBinfiletoBIN" + Me.exportBinfiletoBIN.Size = New System.Drawing.Size(128, 23) + Me.exportBinfiletoBIN.TabIndex = 3 + Me.exportBinfiletoBIN.Text = "Export Selected To bin" + Me.exportBinfiletoBIN.UseVisualStyleBackColor = True + ' + 'OPenBinBtn + ' + Me.OPenBinBtn.Location = New System.Drawing.Point(163, 42) + Me.OPenBinBtn.Name = "OPenBinBtn" + Me.OPenBinBtn.Size = New System.Drawing.Size(128, 23) + Me.OPenBinBtn.TabIndex = 1 + Me.OPenBinBtn.Text = "Select .bin File" + Me.OPenBinBtn.UseVisualStyleBackColor = True + ' + 'CDFileList + ' + Me.CDFileList.Font = New System.Drawing.Font("Lucida Sans Typewriter", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.CDFileList.FormattingEnabled = True + Me.CDFileList.ItemHeight = 12 + Me.CDFileList.Location = New System.Drawing.Point(6, 118) + Me.CDFileList.Name = "CDFileList" + Me.CDFileList.Size = New System.Drawing.Size(285, 400) + Me.CDFileList.TabIndex = 2 + ' + 'ReadCDFileTable + ' + Me.ReadCDFileTable.Location = New System.Drawing.Point(4, 67) + Me.ReadCDFileTable.Name = "ReadCDFileTable" + Me.ReadCDFileTable.Size = New System.Drawing.Size(110, 23) + Me.ReadCDFileTable.TabIndex = 1 + Me.ReadCDFileTable.Text = "Read EP Filetable" + Me.ReadCDFileTable.UseVisualStyleBackColor = True + ' + 'Label22 + ' + Me.Label22.Location = New System.Drawing.Point(163, 78) + Me.Label22.Name = "Label22" + Me.Label22.Size = New System.Drawing.Size(128, 22) + Me.Label22.TabIndex = 1 + Me.Label22.Text = "File Description" + Me.Label22.TextAlign = System.Drawing.ContentAlignment.MiddleCenter + ' + 'Label10 + ' + Me.Label10.Location = New System.Drawing.Point(163, 24) + Me.Label10.Name = "Label10" + Me.Label10.Size = New System.Drawing.Size(128, 20) + Me.Label10.TabIndex = 1 + Me.Label10.Text = "OR user Fxxx.Bin file" + Me.Label10.TextAlign = System.Drawing.ContentAlignment.MiddleCenter + ' + 'japRadio + ' + Me.japRadio.AutoSize = True + Me.japRadio.Location = New System.Drawing.Point(6, 19) + Me.japRadio.Name = "japRadio" + Me.japRadio.Size = New System.Drawing.Size(65, 17) + Me.japRadio.TabIndex = 0 + Me.japRadio.Text = "JAP ISO" + Me.japRadio.UseVisualStyleBackColor = True + ' + 'KudosBtn + ' + Me.KudosBtn.AutoSize = True + Me.KudosBtn.Location = New System.Drawing.Point(206, 9) + Me.KudosBtn.Name = "KudosBtn" + Me.KudosBtn.Size = New System.Drawing.Size(84, 17) + Me.KudosBtn.TabIndex = 0 + Me.KudosBtn.Text = "KUDOS ISO" + Me.KudosBtn.UseVisualStyleBackColor = True + ' + 'EngRadio + ' + Me.EngRadio.AutoSize = True + Me.EngRadio.Location = New System.Drawing.Point(6, 36) + Me.EngRadio.Name = "EngRadio" + Me.EngRadio.Size = New System.Drawing.Size(69, 17) + Me.EngRadio.TabIndex = 0 + Me.EngRadio.Text = "ENG ISO" + Me.EngRadio.UseVisualStyleBackColor = True + ' + 'UserRadio + ' + Me.UserRadio.AutoSize = True + Me.UserRadio.Checked = True + Me.UserRadio.Location = New System.Drawing.Point(6, 52) + Me.UserRadio.Name = "UserRadio" + Me.UserRadio.Size = New System.Drawing.Size(76, 17) + Me.UserRadio.TabIndex = 0 + Me.UserRadio.TabStop = True + Me.UserRadio.Text = "USER ISO" + Me.UserRadio.UseVisualStyleBackColor = True + ' + 'TabPage2 + ' + Me.TabPage2.Controls.Add(Me.makeTreeTest) + Me.TabPage2.Controls.Add(Me.Label14) + Me.TabPage2.Controls.Add(Me.encodeID) + Me.TabPage2.Controls.Add(Me.RLEdecode) + Me.TabPage2.Controls.Add(Me.Unrle_Btn) + Me.TabPage2.Controls.Add(Me.unRLEfileOpen) + Me.TabPage2.Controls.Add(Me.Label7) + Me.TabPage2.Controls.Add(Me.unRLEfile) + Me.TabPage2.Location = New System.Drawing.Point(4, 22) + Me.TabPage2.Name = "TabPage2" + Me.TabPage2.Padding = New System.Windows.Forms.Padding(3) + Me.TabPage2.Size = New System.Drawing.Size(1139, 621) + Me.TabPage2.TabIndex = 1 + Me.TabPage2.Text = "RLE file decode / encode" + Me.TabPage2.UseVisualStyleBackColor = True + ' + 'makeTreeTest + ' + Me.makeTreeTest.Location = New System.Drawing.Point(869, 54) + Me.makeTreeTest.Name = "makeTreeTest" + Me.makeTreeTest.Size = New System.Drawing.Size(138, 32) + Me.makeTreeTest.TabIndex = 5 + Me.makeTreeTest.Text = "MakeTreeTest" + Me.makeTreeTest.UseVisualStyleBackColor = True + ' + 'Label14 + ' + Me.Label14.AutoSize = True + Me.Label14.Location = New System.Drawing.Point(315, 87) + Me.Label14.Name = "Label14" + Me.Label14.Size = New System.Drawing.Size(65, 13) + Me.Label14.TabIndex = 4 + Me.Label14.Text = "ID in packet" + ' + 'encodeID + ' + Me.encodeID.Location = New System.Drawing.Point(416, 84) + Me.encodeID.Name = "encodeID" + Me.encodeID.Size = New System.Drawing.Size(30, 20) + Me.encodeID.TabIndex = 3 + Me.encodeID.Text = "8" + ' + 'RLEdecode + ' + Me.RLEdecode.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(204, Byte)) + Me.RLEdecode.Location = New System.Drawing.Point(318, 110) + Me.RLEdecode.Name = "RLEdecode" + Me.RLEdecode.Size = New System.Drawing.Size(128, 45) + Me.RLEdecode.TabIndex = 2 + Me.RLEdecode.Text = "encodeRLE and save" + Me.RLEdecode.UseVisualStyleBackColor = True + ' + 'Unrle_Btn + ' + Me.Unrle_Btn.Location = New System.Drawing.Point(128, 80) + Me.Unrle_Btn.Name = "Unrle_Btn" + Me.Unrle_Btn.Size = New System.Drawing.Size(128, 20) + Me.Unrle_Btn.TabIndex = 2 + Me.Unrle_Btn.Text = "UNRLE and save" + Me.Unrle_Btn.UseVisualStyleBackColor = True + ' + 'unRLEfileOpen + ' + Me.unRLEfileOpen.Location = New System.Drawing.Point(318, 54) + Me.unRLEfileOpen.Name = "unRLEfileOpen" + Me.unRLEfileOpen.Size = New System.Drawing.Size(128, 20) + Me.unRLEfileOpen.TabIndex = 2 + Me.unRLEfileOpen.Text = "Select" + Me.unRLEfileOpen.UseVisualStyleBackColor = True + ' + 'Label7 + ' + Me.Label7.AutoSize = True + Me.Label7.Location = New System.Drawing.Point(6, 39) + Me.Label7.Name = "Label7" + Me.Label7.Size = New System.Drawing.Size(63, 13) + Me.Label7.TabIndex = 1 + Me.Label7.Text = "Working file" + ' + 'unRLEfile + ' + Me.unRLEfile.Location = New System.Drawing.Point(6, 54) + Me.unRLEfile.Name = "unRLEfile" + Me.unRLEfile.Size = New System.Drawing.Size(300, 20) + Me.unRLEfile.TabIndex = 0 + Me.unRLEfile.Text = "D:\Games\PSX\Persona.2.Innocent.Sin\Export\JapFont_Converted_Full_64k.bin" + ' + 'TabPage3 + ' + Me.TabPage3.Controls.Add(Me.PatchCytyTextCoords) + Me.TabPage3.Controls.Add(Me.GroupBox7) + Me.TabPage3.Controls.Add(Me.DialLeftSpaceWr) + Me.TabPage3.Controls.Add(Me.coordMultiAsmWr) + Me.TabPage3.Controls.Add(Me.WriteFontWide1) + Me.TabPage3.Controls.Add(Me.DialLeftSpaceRd) + Me.TabPage3.Controls.Add(Me.coordMultiAsmRd) + Me.TabPage3.Controls.Add(Me.ReadFontWide1) + Me.TabPage3.Controls.Add(Me.DialLeftSpaceText) + Me.TabPage3.Controls.Add(Me.TextCharSpacer) + Me.TabPage3.Controls.Add(Me.FontWide1) + Me.TabPage3.Controls.Add(Me.ConvertTo12x12) + Me.TabPage3.Controls.Add(Me.ModifyFont) + Me.TabPage3.Controls.Add(Me.Label19) + Me.TabPage3.Controls.Add(Me.Label18) + Me.TabPage3.Controls.Add(Me.Label11) + Me.TabPage3.Controls.Add(Me.Label15) + Me.TabPage3.Controls.Add(Me.Label9) + Me.TabPage3.Controls.Add(Me.TextBox3) + Me.TabPage3.Location = New System.Drawing.Point(4, 22) + Me.TabPage3.Name = "TabPage3" + Me.TabPage3.Padding = New System.Windows.Forms.Padding(3) + Me.TabPage3.Size = New System.Drawing.Size(1139, 621) + Me.TabPage3.TabIndex = 2 + Me.TabPage3.Text = "Font Conv/textView" + Me.TabPage3.UseVisualStyleBackColor = True + ' + 'PatchCytyTextCoords + ' + Me.PatchCytyTextCoords.Location = New System.Drawing.Point(801, 268) + Me.PatchCytyTextCoords.Name = "PatchCytyTextCoords" + Me.PatchCytyTextCoords.Size = New System.Drawing.Size(162, 23) + Me.PatchCytyTextCoords.TabIndex = 8 + Me.PatchCytyTextCoords.Text = "Patch City Text Coords (6x12)" + Me.PatchCytyTextCoords.UseVisualStyleBackColor = True + ' + 'GroupBox7 + ' + Me.GroupBox7.Controls.Add(Me.TextBox5) + Me.GroupBox7.Controls.Add(Me.Label16) + Me.GroupBox7.Location = New System.Drawing.Point(18, 351) + Me.GroupBox7.Name = "GroupBox7" + Me.GroupBox7.Size = New System.Drawing.Size(957, 258) + Me.GroupBox7.TabIndex = 7 + Me.GroupBox7.TabStop = False + Me.GroupBox7.Text = "Persona2 JapTextViewer" + ' + 'TextBox5 + ' + Me.TextBox5.Font = New System.Drawing.Font("Lucida Console", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(204, Byte)) + Me.TextBox5.Location = New System.Drawing.Point(3, 32) + Me.TextBox5.Multiline = True + Me.TextBox5.Name = "TextBox5" + Me.TextBox5.Size = New System.Drawing.Size(949, 220) + Me.TextBox5.TabIndex = 0 + ' + 'Label16 + ' + Me.Label16.AutoSize = True + Me.Label16.Location = New System.Drawing.Point(835, 16) + Me.Label16.Name = "Label16" + Me.Label16.Size = New System.Drawing.Size(116, 13) + Me.Label16.TabIndex = 1 + Me.Label16.Text = "Enter HEX Codes Here" + ' + 'DialLeftSpaceWr + ' + Me.DialLeftSpaceWr.Location = New System.Drawing.Point(888, 198) + Me.DialLeftSpaceWr.Name = "DialLeftSpaceWr" + Me.DialLeftSpaceWr.Size = New System.Drawing.Size(75, 23) + Me.DialLeftSpaceWr.TabIndex = 6 + Me.DialLeftSpaceWr.Text = "WRITE" + Me.DialLeftSpaceWr.UseVisualStyleBackColor = True + ' + 'coordMultiAsmWr + ' + Me.coordMultiAsmWr.Location = New System.Drawing.Point(882, 122) + Me.coordMultiAsmWr.Name = "coordMultiAsmWr" + Me.coordMultiAsmWr.Size = New System.Drawing.Size(75, 23) + Me.coordMultiAsmWr.TabIndex = 6 + Me.coordMultiAsmWr.Text = "WRITE" + Me.coordMultiAsmWr.UseVisualStyleBackColor = True + ' + 'WriteFontWide1 + ' + Me.WriteFontWide1.Location = New System.Drawing.Point(888, 53) + Me.WriteFontWide1.Name = "WriteFontWide1" + Me.WriteFontWide1.Size = New System.Drawing.Size(75, 23) + Me.WriteFontWide1.TabIndex = 6 + Me.WriteFontWide1.Text = "WRITE" + Me.WriteFontWide1.UseVisualStyleBackColor = True + ' + 'DialLeftSpaceRd + ' + Me.DialLeftSpaceRd.Location = New System.Drawing.Point(807, 198) + Me.DialLeftSpaceRd.Name = "DialLeftSpaceRd" + Me.DialLeftSpaceRd.Size = New System.Drawing.Size(75, 23) + Me.DialLeftSpaceRd.TabIndex = 6 + Me.DialLeftSpaceRd.Text = "READ" + Me.DialLeftSpaceRd.UseVisualStyleBackColor = True + ' + 'coordMultiAsmRd + ' + Me.coordMultiAsmRd.Location = New System.Drawing.Point(801, 122) + Me.coordMultiAsmRd.Name = "coordMultiAsmRd" + Me.coordMultiAsmRd.Size = New System.Drawing.Size(75, 23) + Me.coordMultiAsmRd.TabIndex = 6 + Me.coordMultiAsmRd.Text = "READ" + Me.coordMultiAsmRd.UseVisualStyleBackColor = True + ' + 'ReadFontWide1 + ' + Me.ReadFontWide1.Location = New System.Drawing.Point(807, 53) + Me.ReadFontWide1.Name = "ReadFontWide1" + Me.ReadFontWide1.Size = New System.Drawing.Size(75, 23) + Me.ReadFontWide1.TabIndex = 6 + Me.ReadFontWide1.Text = "READ" + Me.ReadFontWide1.UseVisualStyleBackColor = True + ' + 'DialLeftSpaceText + ' + Me.DialLeftSpaceText.Location = New System.Drawing.Point(807, 172) + Me.DialLeftSpaceText.Name = "DialLeftSpaceText" + Me.DialLeftSpaceText.Size = New System.Drawing.Size(156, 20) + Me.DialLeftSpaceText.TabIndex = 5 + ' + 'TextCharSpacer + ' + Me.TextCharSpacer.Location = New System.Drawing.Point(801, 96) + Me.TextCharSpacer.Name = "TextCharSpacer" + Me.TextCharSpacer.Size = New System.Drawing.Size(156, 20) + Me.TextCharSpacer.TabIndex = 5 + ' + 'FontWide1 + ' + Me.FontWide1.Location = New System.Drawing.Point(806, 27) + Me.FontWide1.Name = "FontWide1" + Me.FontWide1.Size = New System.Drawing.Size(156, 20) + Me.FontWide1.TabIndex = 5 + ' + 'ConvertTo12x12 + ' + Me.ConvertTo12x12.Location = New System.Drawing.Point(58, 96) + Me.ConvertTo12x12.Name = "ConvertTo12x12" + Me.ConvertTo12x12.Size = New System.Drawing.Size(347, 20) + Me.ConvertTo12x12.TabIndex = 4 + Me.ConvertTo12x12.Text = "Save 16x16 from WatchMyFont to 12x12 JapFont.bin (from byte 480h)" + Me.ConvertTo12x12.TextAlign = System.Drawing.ContentAlignment.TopLeft + Me.ConvertTo12x12.UseVisualStyleBackColor = True + ' + 'ModifyFont + ' + Me.ModifyFont.Location = New System.Drawing.Point(102, 70) + Me.ModifyFont.Name = "ModifyFont" + Me.ModifyFont.Size = New System.Drawing.Size(303, 20) + Me.ModifyFont.TabIndex = 4 + Me.ModifyFont.Text = "Save 16x16 For pattern edit (outputfile - WhatchMyFont.bin)" + Me.ModifyFont.TextAlign = System.Drawing.ContentAlignment.TopLeft + Me.ModifyFont.UseVisualStyleBackColor = True + ' + 'Label19 + ' + Me.Label19.AutoSize = True + Me.Label19.Location = New System.Drawing.Point(768, 156) + Me.Label19.Name = "Label19" + Me.Label19.Size = New System.Drawing.Size(184, 13) + Me.Label19.TabIndex = 1 + Me.Label19.Text = "Dialog Space in Left (Pixels) (571965)" + ' + 'Label18 + ' + Me.Label18.AutoSize = True + Me.Label18.Location = New System.Drawing.Point(733, 80) + Me.Label18.Name = "Label18" + Me.Label18.Size = New System.Drawing.Size(243, 13) + Me.Label18.TabIndex = 1 + Me.Label18.Text = "Complex Lines Coords Multiplier asm(Byte 119472)" + ' + 'Label11 + ' + Me.Label11.AutoSize = True + Me.Label11.Location = New System.Drawing.Point(763, 11) + Me.Label11.Name = "Label11" + Me.Label11.Size = New System.Drawing.Size(195, 13) + Me.Label11.TabIndex = 1 + Me.Label11.Text = "Patch font wide ingame 1 (byte 111972)" + ' + 'Label15 + ' + Me.Label15.AutoSize = True + Me.Label15.Location = New System.Drawing.Point(231, 122) + Me.Label15.Name = "Label15" + Me.Label15.Size = New System.Drawing.Size(174, 13) + Me.Label15.TabIndex = 1 + Me.Label15.Text = "Font 2?? from 0059 (Convert Need)" + ' + 'Label9 + ' + Me.Label9.AutoSize = True + Me.Label9.Location = New System.Drawing.Point(318, 28) + Me.Label9.Name = "Label9" + Me.Label9.Size = New System.Drawing.Size(87, 13) + Me.Label9.TabIndex = 1 + Me.Label9.Text = "Font 1 from 0059" + ' + 'TextBox3 + ' + Me.TextBox3.Location = New System.Drawing.Point(3, 44) + Me.TextBox3.Name = "TextBox3" + Me.TextBox3.Size = New System.Drawing.Size(402, 20) + Me.TextBox3.TabIndex = 3 + Me.TextBox3.Text = "D:\Games\PSX\Persona.2.Innocent.Sin\Export\JapFont.bin" + ' + 'TabPage6 + ' + Me.TabPage6.Controls.Add(Me.ParseEvent) + Me.TabPage6.Controls.Add(Me.GroupBox6) + Me.TabPage6.Controls.Add(Me.DistrEditor) + Me.TabPage6.Controls.Add(Me.CharCodeGenerator) + Me.TabPage6.Controls.Add(Me.GenChars) + Me.TabPage6.Controls.Add(Me.Label20) + Me.TabPage6.Controls.Add(Me.GroupBox9) + Me.TabPage6.Controls.Add(Me.GroupBox8) + Me.TabPage6.Controls.Add(Me.ExportDUNGScripts) + Me.TabPage6.Controls.Add(Me.Button1) + Me.TabPage6.Controls.Add(Me.OffsetEditorBtn) + Me.TabPage6.Controls.Add(Me.ScriptView) + Me.TabPage6.Controls.Add(Me.GroupBox5) + Me.TabPage6.Controls.Add(Me.GroupBox4) + Me.TabPage6.Location = New System.Drawing.Point(4, 22) + Me.TabPage6.Name = "TabPage6" + Me.TabPage6.Size = New System.Drawing.Size(1139, 621) + Me.TabPage6.TabIndex = 5 + Me.TabPage6.Text = "ScriptExport<>Import (+TEXT)" + Me.TabPage6.UseVisualStyleBackColor = True + ' + 'ParseEvent + ' + Me.ParseEvent.Location = New System.Drawing.Point(15, 487) + Me.ParseEvent.Name = "ParseEvent" + Me.ParseEvent.Size = New System.Drawing.Size(280, 125) + Me.ParseEvent.TabIndex = 6 + Me.ParseEvent.Text = "Parse Event Script" + Me.ParseEvent.UseVisualStyleBackColor = True + ' + 'GroupBox6 + ' + Me.GroupBox6.Controls.Add(Me.Export518_675) + Me.GroupBox6.Controls.Add(Me.Export181577) + Me.GroupBox6.Controls.Add(Me.Export181RUS) + Me.GroupBox6.Controls.Add(Me.Export1112RUS) + Me.GroupBox6.Controls.Add(Me.SceneryImport) + Me.GroupBox6.Controls.Add(Me.ConvertEventsForEditing) + Me.GroupBox6.Location = New System.Drawing.Point(440, 22) + Me.GroupBox6.Name = "GroupBox6" + Me.GroupBox6.Size = New System.Drawing.Size(441, 280) + Me.GroupBox6.TabIndex = 22 + Me.GroupBox6.TabStop = False + Me.GroupBox6.Text = "MassFilesActions" + ' + 'Export518_675 + ' + Me.Export518_675.Location = New System.Drawing.Point(224, 19) + Me.Export518_675.Name = "Export518_675" + Me.Export518_675.Size = New System.Drawing.Size(180, 23) + Me.Export518_675.TabIndex = 20 + Me.Export518_675.Text = "Export Extra Scenery 518-675" + Me.Export518_675.UseVisualStyleBackColor = True + ' + 'Export181577 + ' + Me.Export181577.Location = New System.Drawing.Point(31, 19) + Me.Export181577.Name = "Export181577" + Me.Export181577.Size = New System.Drawing.Size(149, 23) + Me.Export181577.TabIndex = 9 + Me.Export181577.Text = "Export All Scenery 57-397" + Me.Export181577.UseVisualStyleBackColor = True + ' + 'Export181RUS + ' + Me.Export181RUS.Location = New System.Drawing.Point(31, 43) + Me.Export181RUS.Name = "Export181RUS" + Me.Export181RUS.Size = New System.Drawing.Size(149, 34) + Me.Export181RUS.TabIndex = 11 + Me.Export181RUS.Text = "make Packs 57-397 with new scenery" + Me.Export181RUS.UseVisualStyleBackColor = True + ' + 'Export1112RUS + ' + Me.Export1112RUS.Location = New System.Drawing.Point(31, 148) + Me.Export1112RUS.Name = "Export1112RUS" + Me.Export1112RUS.Size = New System.Drawing.Size(149, 34) + Me.Export1112RUS.TabIndex = 11 + Me.Export1112RUS.Text = "make Packs 1112-1117 with new scenery" + Me.Export1112RUS.UseVisualStyleBackColor = True + ' + 'SceneryImport + ' + Me.SceneryImport.Location = New System.Drawing.Point(31, 81) + Me.SceneryImport.Name = "SceneryImport" + Me.SceneryImport.Size = New System.Drawing.Size(149, 35) + Me.SceneryImport.TabIndex = 12 + Me.SceneryImport.Text = "Mass RAW import for scenery" + Me.SceneryImport.UseVisualStyleBackColor = True + ' + 'ConvertEventsForEditing + ' + Me.ConvertEventsForEditing.Location = New System.Drawing.Point(31, 197) + Me.ConvertEventsForEditing.Name = "ConvertEventsForEditing" + Me.ConvertEventsForEditing.Size = New System.Drawing.Size(149, 46) + Me.ConvertEventsForEditing.TabIndex = 19 + Me.ConvertEventsForEditing.Text = "Convert All txt Scenery for Editing" + Me.ConvertEventsForEditing.UseVisualStyleBackColor = True + ' + 'DistrEditor + ' + Me.DistrEditor.Location = New System.Drawing.Point(890, 452) + Me.DistrEditor.Name = "DistrEditor" + Me.DistrEditor.Size = New System.Drawing.Size(242, 47) + Me.DistrEditor.TabIndex = 21 + Me.DistrEditor.Text = "Districts Editor" + Me.DistrEditor.UseVisualStyleBackColor = True + ' + 'CharCodeGenerator + ' + Me.CharCodeGenerator.Location = New System.Drawing.Point(1011, 574) + Me.CharCodeGenerator.Name = "CharCodeGenerator" + Me.CharCodeGenerator.Size = New System.Drawing.Size(118, 38) + Me.CharCodeGenerator.TabIndex = 20 + Me.CharCodeGenerator.Text = "Char Code Generator" + Me.CharCodeGenerator.UseVisualStyleBackColor = True + ' + 'GenChars + ' + Me.GenChars.Location = New System.Drawing.Point(1011, 534) + Me.GenChars.Name = "GenChars" + Me.GenChars.Size = New System.Drawing.Size(118, 38) + Me.GenChars.TabIndex = 20 + Me.GenChars.Text = "GenerateCharCodes" + Me.GenChars.UseVisualStyleBackColor = True + ' + 'Label20 + ' + Me.Label20.BackColor = System.Drawing.Color.Thistle + Me.Label20.Font = New System.Drawing.Font("Lucida Console", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.Label20.Location = New System.Drawing.Point(887, 22) + Me.Label20.Name = "Label20" + Me.Label20.Size = New System.Drawing.Size(248, 251) + Me.Label20.TabIndex = 18 + Me.Label20.Text = "" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & " Text Reimport Memo:" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "???? - Battle Talk" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "???? - Summons" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "0735 - Dungeon Tal" & + "ks" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "0057-0397 - SCENARIO" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "???? - Battle Contacts" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "0713-0719 - City" + ' + 'GroupBox9 + ' + Me.GroupBox9.Controls.Add(Me.Convert_Summon) + Me.GroupBox9.Controls.Add(Me.Summon_Export) + Me.GroupBox9.Location = New System.Drawing.Point(446, 452) + Me.GroupBox9.Name = "GroupBox9" + Me.GroupBox9.Size = New System.Drawing.Size(200, 100) + Me.GroupBox9.TabIndex = 17 + Me.GroupBox9.TabStop = False + Me.GroupBox9.Text = "Personas Summon Texts" + ' + 'Convert_Summon + ' + Me.Convert_Summon.Location = New System.Drawing.Point(7, 62) + Me.Convert_Summon.Name = "Convert_Summon" + Me.Convert_Summon.Size = New System.Drawing.Size(181, 23) + Me.Convert_Summon.TabIndex = 1 + Me.Convert_Summon.Text = "Convert All Summon Scripts" + Me.Convert_Summon.UseVisualStyleBackColor = True + ' + 'Summon_Export + ' + Me.Summon_Export.Location = New System.Drawing.Point(7, 20) + Me.Summon_Export.Name = "Summon_Export" + Me.Summon_Export.Size = New System.Drawing.Size(181, 23) + Me.Summon_Export.TabIndex = 0 + Me.Summon_Export.Text = "Export All Summon" + Me.Summon_Export.UseVisualStyleBackColor = True + ' + 'GroupBox8 + ' + Me.GroupBox8.Controls.Add(Me.ConvertContactScript) + Me.GroupBox8.Controls.Add(Me.ExportContact) + Me.GroupBox8.Location = New System.Drawing.Point(440, 313) + Me.GroupBox8.Name = "GroupBox8" + Me.GroupBox8.Size = New System.Drawing.Size(217, 133) + Me.GroupBox8.TabIndex = 16 + Me.GroupBox8.TabStop = False + Me.GroupBox8.Text = "Contact Scripts" + ' + 'ConvertContactScript + ' + Me.ConvertContactScript.Location = New System.Drawing.Point(6, 74) + Me.ConvertContactScript.Name = "ConvertContactScript" + Me.ConvertContactScript.Size = New System.Drawing.Size(188, 49) + Me.ConvertContactScript.TabIndex = 16 + Me.ConvertContactScript.Text = "Select and convert!" + Me.ConvertContactScript.UseVisualStyleBackColor = True + ' + 'ExportContact + ' + Me.ExportContact.Location = New System.Drawing.Point(6, 20) + Me.ExportContact.Name = "ExportContact" + Me.ExportContact.Size = New System.Drawing.Size(188, 33) + Me.ExportContact.TabIndex = 15 + Me.ExportContact.Text = "Convert All Contact Scrtipts" + Me.ExportContact.UseVisualStyleBackColor = True + ' + 'ExportDUNGScripts + ' + Me.ExportDUNGScripts.Location = New System.Drawing.Point(884, 534) + Me.ExportDUNGScripts.Name = "ExportDUNGScripts" + Me.ExportDUNGScripts.Size = New System.Drawing.Size(113, 38) + Me.ExportDUNGScripts.TabIndex = 14 + Me.ExportDUNGScripts.Text = "Export DUNG Scripts in 0736" + Me.ExportDUNGScripts.UseVisualStyleBackColor = True + ' + 'Button1 + ' + Me.Button1.Location = New System.Drawing.Point(890, 399) + Me.Button1.Name = "Button1" + Me.Button1.Size = New System.Drawing.Size(242, 47) + Me.Button1.TabIndex = 13 + Me.Button1.Text = "Dungeons Editor" + Me.Button1.UseVisualStyleBackColor = True + ' + 'OffsetEditorBtn + ' + Me.OffsetEditorBtn.Location = New System.Drawing.Point(890, 359) + Me.OffsetEditorBtn.Name = "OffsetEditorBtn" + Me.OffsetEditorBtn.Size = New System.Drawing.Size(242, 34) + Me.OffsetEditorBtn.TabIndex = 7 + Me.OffsetEditorBtn.Text = "Offset Text/Lines Editor" + Me.OffsetEditorBtn.UseVisualStyleBackColor = True + ' + 'ScriptView + ' + Me.ScriptView.Location = New System.Drawing.Point(890, 294) + Me.ScriptView.Name = "ScriptView" + Me.ScriptView.Size = New System.Drawing.Size(242, 33) + Me.ScriptView.TabIndex = 6 + Me.ScriptView.Text = "Show Script Viewer" + Me.ScriptView.UseVisualStyleBackColor = True + ' + 'GroupBox5 + ' + Me.GroupBox5.Controls.Add(Me.NewTextMODE) + Me.GroupBox5.Controls.Add(Me.ImportTXT) + Me.GroupBox5.Location = New System.Drawing.Point(216, 22) + Me.GroupBox5.Name = "GroupBox5" + Me.GroupBox5.Size = New System.Drawing.Size(204, 100) + Me.GroupBox5.TabIndex = 3 + Me.GroupBox5.TabStop = False + Me.GroupBox5.Text = "Covert TXT to script" + ' + 'NewTextMODE + ' + Me.NewTextMODE.AutoSize = True + Me.NewTextMODE.Checked = True + Me.NewTextMODE.CheckState = System.Windows.Forms.CheckState.Checked + Me.NewTextMODE.Location = New System.Drawing.Point(6, 74) + Me.NewTextMODE.Name = "NewTextMODE" + Me.NewTextMODE.Size = New System.Drawing.Size(181, 17) + Me.NewTextMODE.TabIndex = 4 + Me.NewTextMODE.Text = "new 2CODE+1ByteMode Export!" + Me.NewTextMODE.UseVisualStyleBackColor = True + ' + 'ImportTXT + ' + Me.ImportTXT.Location = New System.Drawing.Point(17, 21) + Me.ImportTXT.Name = "ImportTXT" + Me.ImportTXT.Size = New System.Drawing.Size(181, 49) + Me.ImportTXT.TabIndex = 2 + Me.ImportTXT.Text = "Select and convert!" + Me.ImportTXT.UseVisualStyleBackColor = True + ' + 'GroupBox4 + ' + Me.GroupBox4.Controls.Add(Me.UnKudosScript) + Me.GroupBox4.Controls.Add(Me.SelExportCript) + Me.GroupBox4.Location = New System.Drawing.Point(3, 22) + Me.GroupBox4.Name = "GroupBox4" + Me.GroupBox4.Size = New System.Drawing.Size(207, 328) + Me.GroupBox4.TabIndex = 2 + Me.GroupBox4.TabStop = False + Me.GroupBox4.Text = "Converting resource script file to TXT" + ' + 'UnKudosScript + ' + Me.UnKudosScript.AutoSize = True + Me.UnKudosScript.Location = New System.Drawing.Point(23, 63) + Me.UnKudosScript.Name = "UnKudosScript" + Me.UnKudosScript.Size = New System.Drawing.Size(97, 17) + Me.UnKudosScript.TabIndex = 5 + Me.UnKudosScript.Text = "UnKudosScript" + Me.UnKudosScript.UseVisualStyleBackColor = True + ' + 'SelExportCript + ' + Me.SelExportCript.Location = New System.Drawing.Point(15, 19) + Me.SelExportCript.Name = "SelExportCript" + Me.SelExportCript.Size = New System.Drawing.Size(156, 38) + Me.SelExportCript.TabIndex = 3 + Me.SelExportCript.Text = "Select Text Export Script" + Me.SelExportCript.UseVisualStyleBackColor = True + ' + 'TabPage4 + ' + Me.TabPage4.Controls.Add(Me.SaveTit) + Me.TabPage4.Controls.Add(Me.LoadTitles) + Me.TabPage4.Controls.Add(Me.TGrid) + Me.TabPage4.Controls.Add(Me.SaveTitles) + Me.TabPage4.Controls.Add(Me.TitlesLoad) + Me.TabPage4.Location = New System.Drawing.Point(4, 22) + Me.TabPage4.Name = "TabPage4" + Me.TabPage4.Padding = New System.Windows.Forms.Padding(3) + Me.TabPage4.Size = New System.Drawing.Size(1139, 621) + Me.TabPage4.TabIndex = 3 + Me.TabPage4.Text = "Titles Editor" + Me.TabPage4.UseVisualStyleBackColor = True + ' + 'SaveTit + ' + Me.SaveTit.Location = New System.Drawing.Point(913, 6) + Me.SaveTit.Name = "SaveTit" + Me.SaveTit.Size = New System.Drawing.Size(212, 23) + Me.SaveTit.TabIndex = 13 + Me.SaveTit.Text = "Save To File" + Me.SaveTit.UseVisualStyleBackColor = True + ' + 'LoadTitles + ' + Me.LoadTitles.Location = New System.Drawing.Point(677, 6) + Me.LoadTitles.Name = "LoadTitles" + Me.LoadTitles.Size = New System.Drawing.Size(212, 23) + Me.LoadTitles.TabIndex = 13 + Me.LoadTitles.Text = "Load from File" + Me.LoadTitles.UseVisualStyleBackColor = True + ' + 'TGrid + ' + Me.TGrid.AllowUserToAddRows = False + Me.TGrid.AllowUserToDeleteRows = False + Me.TGrid.AllowUserToResizeRows = False + Me.TGrid.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllCells + Me.TGrid.BackgroundColor = System.Drawing.Color.Gray + Me.TGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize + Me.TGrid.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.ID}) + Me.TGrid.EditMode = System.Windows.Forms.DataGridViewEditMode.EditOnEnter + Me.TGrid.Location = New System.Drawing.Point(170, 35) + Me.TGrid.Name = "TGrid" + Me.TGrid.RowHeadersVisible = False + Me.TGrid.RowTemplate.DefaultCellStyle.BackColor = System.Drawing.Color.Black + Me.TGrid.RowTemplate.DefaultCellStyle.ForeColor = System.Drawing.Color.FromArgb(CType(CType(224, Byte), Integer), CType(CType(224, Byte), Integer), CType(CType(224, Byte), Integer)) + Me.TGrid.ScrollBars = System.Windows.Forms.ScrollBars.Vertical + Me.TGrid.Size = New System.Drawing.Size(517, 565) + Me.TGrid.TabIndex = 12 + ' + 'ID + ' + Me.ID.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill + DataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter + DataGridViewCellStyle1.BackColor = System.Drawing.Color.Black + DataGridViewCellStyle1.Font = New System.Drawing.Font("Montserrat", 8.249999!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.ID.DefaultCellStyle = DataGridViewCellStyle1 + Me.ID.FillWeight = 20.0! + Me.ID.HeaderText = "TXT" + Me.ID.Name = "ID" + ' + 'SaveTitles + ' + Me.SaveTitles.Location = New System.Drawing.Point(332, 6) + Me.SaveTitles.Name = "SaveTitles" + Me.SaveTitles.Size = New System.Drawing.Size(286, 23) + Me.SaveTitles.TabIndex = 0 + Me.SaveTitles.Text = "Save Titles" + Me.SaveTitles.UseVisualStyleBackColor = True + ' + 'TitlesLoad + ' + Me.TitlesLoad.Location = New System.Drawing.Point(54, 6) + Me.TitlesLoad.Name = "TitlesLoad" + Me.TitlesLoad.Size = New System.Drawing.Size(228, 23) + Me.TitlesLoad.TabIndex = 0 + Me.TitlesLoad.Text = "Load Titles" + Me.TitlesLoad.UseVisualStyleBackColor = True + ' + 'TabPage5 + ' + Me.TabPage5.Controls.Add(Me.RadioSort1) + Me.TabPage5.Controls.Add(Me.SortCDFiles) + Me.TabPage5.Controls.Add(Me.CDLoadSortedFiles) + Me.TabPage5.Controls.Add(Me.CDGrid) + Me.TabPage5.Location = New System.Drawing.Point(4, 22) + Me.TabPage5.Name = "TabPage5" + Me.TabPage5.Padding = New System.Windows.Forms.Padding(3) + Me.TabPage5.Size = New System.Drawing.Size(1139, 621) + Me.TabPage5.TabIndex = 4 + Me.TabPage5.Text = "CD File Manage / Sort" + Me.TabPage5.UseVisualStyleBackColor = True + ' + 'RadioSort1 + ' + Me.RadioSort1.AutoSize = True + Me.RadioSort1.Checked = True + Me.RadioSort1.Location = New System.Drawing.Point(763, 110) + Me.RadioSort1.Name = "RadioSort1" + Me.RadioSort1.Size = New System.Drawing.Size(207, 17) + Me.RadioSort1.TabIndex = 15 + Me.RadioSort1.TabStop = True + Me.RadioSort1.Text = "0000-0864 (UNTIL VIDEO SECTORS)" + Me.RadioSort1.UseVisualStyleBackColor = True + ' + 'SortCDFiles + ' + Me.SortCDFiles.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(204, Byte)) + Me.SortCDFiles.Location = New System.Drawing.Point(763, 156) + Me.SortCDFiles.Name = "SortCDFiles" + Me.SortCDFiles.Size = New System.Drawing.Size(205, 23) + Me.SortCDFiles.TabIndex = 14 + Me.SortCDFiles.Text = "SORT (BACKUP IT FIRST!)" + Me.SortCDFiles.UseVisualStyleBackColor = True + ' + 'CDLoadSortedFiles + ' + Me.CDLoadSortedFiles.Location = New System.Drawing.Point(763, 53) + Me.CDLoadSortedFiles.Name = "CDLoadSortedFiles" + Me.CDLoadSortedFiles.Size = New System.Drawing.Size(205, 23) + Me.CDLoadSortedFiles.TabIndex = 13 + Me.CDLoadSortedFiles.Text = "Load Sorted Files" + Me.CDLoadSortedFiles.UseVisualStyleBackColor = True + ' + 'CDGrid + ' + Me.CDGrid.AllowUserToAddRows = False + Me.CDGrid.AllowUserToDeleteRows = False + Me.CDGrid.AllowUserToResizeRows = False + Me.CDGrid.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllCells + Me.CDGrid.BackgroundColor = System.Drawing.Color.Gray + Me.CDGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize + Me.CDGrid.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.DataGridViewTextBoxColumn1, Me.JAP, Me.SizeB, Me.Eng, Me.EndSec, Me.Gap}) + Me.CDGrid.EditMode = System.Windows.Forms.DataGridViewEditMode.EditOnEnter + Me.CDGrid.Location = New System.Drawing.Point(117, 35) + Me.CDGrid.Name = "CDGrid" + Me.CDGrid.RowHeadersVisible = False + Me.CDGrid.RowTemplate.DefaultCellStyle.BackColor = System.Drawing.Color.FromArgb(CType(CType(64, Byte), Integer), CType(CType(64, Byte), Integer), CType(CType(64, Byte), Integer)) + Me.CDGrid.RowTemplate.DefaultCellStyle.ForeColor = System.Drawing.Color.FromArgb(CType(CType(224, Byte), Integer), CType(CType(224, Byte), Integer), CType(CType(224, Byte), Integer)) + Me.CDGrid.ScrollBars = System.Windows.Forms.ScrollBars.Vertical + Me.CDGrid.Size = New System.Drawing.Size(586, 580) + Me.CDGrid.TabIndex = 12 + ' + 'DataGridViewTextBoxColumn1 + ' + Me.DataGridViewTextBoxColumn1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill + Me.DataGridViewTextBoxColumn1.FillWeight = 30.0! + Me.DataGridViewTextBoxColumn1.HeaderText = "ID" + Me.DataGridViewTextBoxColumn1.Name = "DataGridViewTextBoxColumn1" + Me.DataGridViewTextBoxColumn1.ReadOnly = True + ' + 'JAP + ' + Me.JAP.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill + Me.JAP.FillWeight = 50.0! + Me.JAP.HeaderText = "Start Sector" + Me.JAP.Name = "JAP" + Me.JAP.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable + ' + 'SizeB + ' + Me.SizeB.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill + Me.SizeB.FillWeight = 50.0! + Me.SizeB.HeaderText = "Size (bytes)" + Me.SizeB.Name = "SizeB" + ' + 'Eng + ' + Me.Eng.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill + Me.Eng.FillWeight = 50.0! + Me.Eng.HeaderText = "Size (Sectors)" + Me.Eng.Name = "Eng" + Me.Eng.ReadOnly = True + ' + 'EndSec + ' + Me.EndSec.HeaderText = "End Sector" + Me.EndSec.Name = "EndSec" + ' + 'Gap + ' + Me.Gap.HeaderText = "Gap (Sectors)" + Me.Gap.Name = "Gap" + ' + 'TabPage7 + ' + Me.TabPage7.Controls.Add(Me.PSP_UNPACK_EVENT_BIN) + Me.TabPage7.Location = New System.Drawing.Point(4, 22) + Me.TabPage7.Name = "TabPage7" + Me.TabPage7.Size = New System.Drawing.Size(1139, 621) + Me.TabPage7.TabIndex = 6 + Me.TabPage7.Text = "PSP_Unpack" + Me.TabPage7.UseVisualStyleBackColor = True + ' + 'PSP_UNPACK_EVENT_BIN + ' + Me.PSP_UNPACK_EVENT_BIN.Location = New System.Drawing.Point(259, 61) + Me.PSP_UNPACK_EVENT_BIN.Name = "PSP_UNPACK_EVENT_BIN" + Me.PSP_UNPACK_EVENT_BIN.Size = New System.Drawing.Size(200, 38) + Me.PSP_UNPACK_EVENT_BIN.TabIndex = 0 + Me.PSP_UNPACK_EVENT_BIN.Text = "Unpack event.bin" + Me.PSP_UNPACK_EVENT_BIN.UseVisualStyleBackColor = True + ' + 'PictureBox1 + ' + Me.PictureBox1.BackColor = System.Drawing.Color.Transparent + Me.PictureBox1.ErrorImage = Nothing + Me.PictureBox1.InitialImage = Nothing + Me.PictureBox1.Location = New System.Drawing.Point(1165, 120) + Me.PictureBox1.Name = "PictureBox1" + Me.PictureBox1.Size = New System.Drawing.Size(713, 657) + Me.PictureBox1.TabIndex = 2 + Me.PictureBox1.TabStop = False + ' + 'RawSectorImport + ' + Me.RawSectorImport.Enabled = False + Me.RawSectorImport.Location = New System.Drawing.Point(1032, 21) + Me.RawSectorImport.Name = "RawSectorImport" + Me.RawSectorImport.Size = New System.Drawing.Size(113, 20) + Me.RawSectorImport.TabIndex = 6 + Me.RawSectorImport.Visible = False + ' + 'RawToSectorImport + ' + Me.RawToSectorImport.Enabled = False + Me.RawToSectorImport.Location = New System.Drawing.Point(1077, 69) + Me.RawToSectorImport.Name = "RawToSectorImport" + Me.RawToSectorImport.Size = New System.Drawing.Size(71, 23) + Me.RawToSectorImport.TabIndex = 5 + Me.RawToSectorImport.Text = "RealocateDown!" + Me.RawToSectorImport.UseVisualStyleBackColor = True + Me.RawToSectorImport.Visible = False + ' + 'Label13 + ' + Me.Label13.Enabled = False + Me.Label13.Location = New System.Drawing.Point(1044, 38) + Me.Label13.Name = "Label13" + Me.Label13.Size = New System.Drawing.Size(76, 20) + Me.Label13.TabIndex = 1 + Me.Label13.Text = "SectorsCount" + Me.Label13.TextAlign = System.Drawing.ContentAlignment.MiddleCenter + Me.Label13.Visible = False + ' + 'Label12 + ' + Me.Label12.Enabled = False + Me.Label12.ForeColor = System.Drawing.Color.DarkRed + Me.Label12.Location = New System.Drawing.Point(1047, 27) + Me.Label12.Name = "Label12" + Me.Label12.Size = New System.Drawing.Size(104, 53) + Me.Label12.TabIndex = 1 + Me.Label12.Text = "REALLOCATE FILES TEST! (From selected +1)" + Me.Label12.TextAlign = System.Drawing.ContentAlignment.MiddleCenter + Me.Label12.Visible = False + ' + 'WorkDir + ' + Me.WorkDir.Location = New System.Drawing.Point(650, 22) + Me.WorkDir.Name = "WorkDir" + Me.WorkDir.Size = New System.Drawing.Size(363, 20) + Me.WorkDir.TabIndex = 0 + Me.WorkDir.Text = "D:\Games\PSX\Persona 2 - Batsu (NTSC-J) [SLPS-02825]\Export\UnRLE\" + ' + 'Label5 + ' + Me.Label5.AutoSize = True + Me.Label5.Location = New System.Drawing.Point(650, 7) + Me.Label5.Name = "Label5" + Me.Label5.Size = New System.Drawing.Size(69, 13) + Me.Label5.TabIndex = 1 + Me.Label5.Text = "Working DIR" + ' + 'OpenFileDialog1 + ' + Me.OpenFileDialog1.FileName = "OpenFileDialog1" + Me.OpenFileDialog1.Filter = "File to unRLE | *.*" + ' + 'SaveFileDialog1 + ' + Me.SaveFileDialog1.DefaultExt = "bin" + Me.SaveFileDialog1.FileName = "unrle_.bin" + ' + 'tstBtn + ' + Me.tstBtn.Enabled = False + Me.tstBtn.Location = New System.Drawing.Point(938, 48) + Me.tstBtn.Name = "tstBtn" + Me.tstBtn.Size = New System.Drawing.Size(75, 23) + Me.tstBtn.TabIndex = 3 + Me.tstBtn.Text = "TEst" + Me.tstBtn.UseVisualStyleBackColor = True + ' + 'Label17 + ' + Me.Label17.AutoSize = True + Me.Label17.Location = New System.Drawing.Point(31, 746) + Me.Label17.Name = "Label17" + Me.Label17.Size = New System.Drawing.Size(83, 13) + Me.Label17.TabIndex = 4 + Me.Label17.Text = "CD Free Space:" + ' + 'CDFreeSpaceLabel + ' + Me.CDFreeSpaceLabel.AutoSize = True + Me.CDFreeSpaceLabel.Location = New System.Drawing.Point(129, 746) + Me.CDFreeSpaceLabel.Name = "CDFreeSpaceLabel" + Me.CDFreeSpaceLabel.Size = New System.Drawing.Size(16, 13) + Me.CDFreeSpaceLabel.TabIndex = 5 + Me.CDFreeSpaceLabel.Text = "---" + ' + 'SaveShadowDisc + ' + Me.SaveShadowDisc.Location = New System.Drawing.Point(31, 780) + Me.SaveShadowDisc.Name = "SaveShadowDisc" + Me.SaveShadowDisc.Size = New System.Drawing.Size(146, 23) + Me.SaveShadowDisc.TabIndex = 9 + Me.SaveShadowDisc.Text = "ExportShadowDiscEnd" + Me.SaveShadowDisc.UseVisualStyleBackColor = True + ' + 'LastSectorLbl + ' + Me.LastSectorLbl.AutoSize = True + Me.LastSectorLbl.Location = New System.Drawing.Point(31, 764) + Me.LastSectorLbl.Name = "LastSectorLbl" + Me.LastSectorLbl.Size = New System.Drawing.Size(93, 13) + Me.LastSectorLbl.TabIndex = 10 + Me.LastSectorLbl.Text = "Last Sector Label:" + ' + 'ProgressBar1 + ' + Me.ProgressBar1.Location = New System.Drawing.Point(303, 754) + Me.ProgressBar1.Name = "ProgressBar1" + Me.ProgressBar1.Size = New System.Drawing.Size(856, 23) + Me.ProgressBar1.TabIndex = 11 + ' + 'BackgroundWorker1 + ' + ' + 'conv3D + ' + Me.conv3D.Location = New System.Drawing.Point(777, 48) + Me.conv3D.Name = "conv3D" + Me.conv3D.Size = New System.Drawing.Size(142, 23) + Me.conv3D.TabIndex = 12 + Me.conv3D.Text = "Open 3d converter" + Me.conv3D.UseVisualStyleBackColor = True + ' + 'Form1 + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.BackColor = System.Drawing.SystemColors.ControlDarkDark + Me.ClientSize = New System.Drawing.Size(1923, 796) + Me.Controls.Add(Me.conv3D) + Me.Controls.Add(Me.ProgressBar1) + Me.Controls.Add(Me.PictureBox1) + Me.Controls.Add(Me.LastSectorLbl) + Me.Controls.Add(Me.SaveShadowDisc) + Me.Controls.Add(Me.CDFreeSpaceLabel) + Me.Controls.Add(Me.Label17) + Me.Controls.Add(Me.RawToSectorImport) + Me.Controls.Add(Me.RawSectorImport) + Me.Controls.Add(Me.Label13) + Me.Controls.Add(Me.Label12) + Me.Controls.Add(Me.tstBtn) + Me.Controls.Add(Me.TabControl1) + Me.Controls.Add(Me.Label5) + Me.Controls.Add(Me.Label4) + Me.Controls.Add(Me.Label3) + Me.Controls.Add(Me.Label2) + Me.Controls.Add(Me.WorkDir) + Me.Controls.Add(Me.Label1) + Me.Controls.Add(Me.KUDOSpath) + Me.Controls.Add(Me.UserPath) + Me.Controls.Add(Me.EngISOPath) + Me.Controls.Add(Me.JapISOPath) + Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle + Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) + Me.MaximizeBox = False + Me.Name = "Form1" + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen + Me.Text = "EternalPunishmentPSX Toolkit" + Me.TabControl1.ResumeLayout(False) + Me.ReplaceTextExecutes.ResumeLayout(False) + Me.ReplaceTextExecutes.PerformLayout() + Me.GroupBox11.ResumeLayout(False) + Me.GroupBox11.PerformLayout() + CType(Me.ClutShift, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.CLUTid, System.ComponentModel.ISupportInitialize).EndInit() + Me.GroupBox3.ResumeLayout(False) + Me.GroupBox3.PerformLayout() + Me.GroupBox10.ResumeLayout(False) + Me.GroupBox10.PerformLayout() + Me.GroupBox2.ResumeLayout(False) + Me.GroupBox2.PerformLayout() + Me.GroupBox1.ResumeLayout(False) + Me.GroupBox1.PerformLayout() + Me.TabPage2.ResumeLayout(False) + Me.TabPage2.PerformLayout() + Me.TabPage3.ResumeLayout(False) + Me.TabPage3.PerformLayout() + Me.GroupBox7.ResumeLayout(False) + Me.GroupBox7.PerformLayout() + Me.TabPage6.ResumeLayout(False) + Me.GroupBox6.ResumeLayout(False) + Me.GroupBox9.ResumeLayout(False) + Me.GroupBox8.ResumeLayout(False) + Me.GroupBox5.ResumeLayout(False) + Me.GroupBox5.PerformLayout() + Me.GroupBox4.ResumeLayout(False) + Me.GroupBox4.PerformLayout() + Me.TabPage4.ResumeLayout(False) + CType(Me.TGrid, System.ComponentModel.ISupportInitialize).EndInit() + Me.TabPage5.ResumeLayout(False) + Me.TabPage5.PerformLayout() + CType(Me.CDGrid, System.ComponentModel.ISupportInitialize).EndInit() + Me.TabPage7.ResumeLayout(False) + CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).EndInit() + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + + Friend WithEvents JapISOPath As TextBox + Friend WithEvents EngISOPath As TextBox + Friend WithEvents Label1 As Label + Friend WithEvents Label2 As Label + Friend WithEvents UserPath As TextBox + Friend WithEvents Label3 As Label + Friend WithEvents KUDOSpath As TextBox + Friend WithEvents Label4 As Label + Friend WithEvents TabControl1 As TabControl + Friend WithEvents ReplaceTextExecutes As TabPage + Friend WithEvents TabPage2 As TabPage + Friend WithEvents GroupBox3 As GroupBox + Friend WithEvents importToBin As Button + Friend WithEvents notEncodeTorle As RadioButton + Friend WithEvents encodeTOrle As RadioButton + Friend WithEvents Label6 As Label + Friend WithEvents GroupBox2 As GroupBox + Friend WithEvents ExportUnrleFile As Button + Friend WithEvents ExportRaw As RadioButton + Friend WithEvents ExportRLEDec As RadioButton + Friend WithEvents GroupBox1 As GroupBox + Friend WithEvents CDFileList As ListBox + Friend WithEvents ReadCDFileTable As Button + Friend WithEvents EngRadio As RadioButton + Friend WithEvents UserRadio As RadioButton + Friend WithEvents japRadio As RadioButton + Friend WithEvents TabPage3 As TabPage + Friend WithEvents TabPage4 As TabPage + Friend WithEvents TabPage6 As TabPage + Friend WithEvents TabPage5 As TabPage + Friend WithEvents WorkDir As TextBox + Friend WithEvents Label5 As Label + Friend WithEvents OpenFileDialog1 As OpenFileDialog + Friend WithEvents SaveFileDialog1 As SaveFileDialog + Friend WithEvents Label7 As Label + Friend WithEvents unRLEfile As TextBox + Friend WithEvents unRLEfileOpen As Button + Friend WithEvents Unrle_Btn As Button + Friend WithEvents ModifyFont As Button + Friend WithEvents TextBox3 As TextBox + Friend WithEvents SelBinFiles As ListBox + Friend WithEvents Label8 As Label + Friend WithEvents ExportBinPath As TextBox + Friend WithEvents OPenBinBtn As Button + Friend WithEvents FilnamLabel As Label + Friend WithEvents Label10 As Label + Friend WithEvents Savedlbl As Label + Friend WithEvents ConvertTo12x12 As Button + Friend WithEvents Label9 As Label + Friend WithEvents WriteFontWide1 As Button + Friend WithEvents ReadFontWide1 As Button + Friend WithEvents FontWide1 As TextBox + Friend WithEvents Label11 As Label + Friend WithEvents RLEdecode As Button + Friend WithEvents tstBtn As Button + Friend WithEvents RawSectorImport As TextBox + Friend WithEvents RawToSectorImport As Button + Friend WithEvents Label12 As Label + Friend WithEvents GroupBox5 As GroupBox + Friend WithEvents ImportTXT As Button + Friend WithEvents GroupBox4 As GroupBox + Friend WithEvents Label13 As Label + Friend WithEvents exportBinfiletoBIN As Button + Friend WithEvents CreateBinDirCheck As CheckBox + Friend WithEvents Label14 As Label + Friend WithEvents encodeID As TextBox + Friend WithEvents SelExportCript As Button + Friend WithEvents GroupBox7 As GroupBox + Friend WithEvents Label15 As Label + Friend WithEvents TextBox5 As TextBox + Friend WithEvents Label16 As Label + Friend WithEvents PictureBox1 As PictureBox + Friend WithEvents importRAWtoSel As Button + Friend WithEvents SearchHexPattern As Button + Friend WithEvents HexPatternBox As TextBox + Friend WithEvents Label17 As Label + Friend WithEvents CDFreeSpaceLabel As Label + Friend WithEvents SaveShadowDisc As Button + Friend WithEvents importSector As TextBox + Friend WithEvents LastSectorLbl As Label + Friend WithEvents getFreeSector As Button + Friend WithEvents DialLeftSpaceWr As Button + Friend WithEvents coordMultiAsmWr As Button + Friend WithEvents DialLeftSpaceRd As Button + Friend WithEvents coordMultiAsmRd As Button + Friend WithEvents DialLeftSpaceText As TextBox + Friend WithEvents TextCharSpacer As TextBox + Friend WithEvents Label19 As Label + Friend WithEvents Label18 As Label + Friend WithEvents Export181577 As Button + Friend WithEvents PatchCytyTextCoords As Button + Friend WithEvents NewTextMODE As CheckBox + Friend WithEvents ImportCode As Button + Friend WithEvents ExpMainExe As Button + Friend WithEvents SortedFileList As ListBox + Friend WithEvents ShowSorted As Button + Friend WithEvents ScriptView As Button + Friend WithEvents makeTreeTest As Button + Friend WithEvents Export181RUS As Button + Friend WithEvents SceneryImport As Button + Friend WithEvents UpdateSizeTable As CheckBox + Friend WithEvents OffsetEditorBtn As Button + Friend WithEvents Mode2352 As CheckBox + Friend WithEvents Export1112RUS As Button + Friend WithEvents MakePointers As Button + Friend WithEvents Button1 As Button + Friend WithEvents PngExport As Button + Friend WithEvents CLUTs As Label + Friend WithEvents CLUTid As NumericUpDown + Friend WithEvents ImgShow As Button + Friend WithEvents alpha0 As CheckBox + Friend WithEvents PNGimport As Button + Friend WithEvents ExportDUNGScripts As Button + Friend WithEvents NotDeconstr As CheckBox + Friend WithEvents ExportContact As Button + Friend WithEvents Show16bit As Button + Friend WithEvents GroupBox8 As GroupBox + Friend WithEvents ConvertContactScript As Button + Friend WithEvents ForceRle As CheckBox + Friend WithEvents GroupBox9 As GroupBox + Friend WithEvents Convert_Summon As Button + Friend WithEvents Summon_Export As Button + Friend WithEvents Force4bit As CheckBox + Friend WithEvents IgnoreGaps As CheckBox + Friend WithEvents GroupBox10 As GroupBox + Friend WithEvents imp16bit As RadioButton + Friend WithEvents Imp8bit As RadioButton + Friend WithEvents imp4bit As RadioButton + Friend WithEvents GroupBox11 As GroupBox + Friend WithEvents ProgressBar1 As ProgressBar + Friend WithEvents BackgroundWorker1 As System.ComponentModel.BackgroundWorker + Friend WithEvents Label20 As Label + Friend WithEvents SaveTitles As Button + Friend WithEvents TitlesLoad As Button + Friend WithEvents TGrid As DataGridView + Friend WithEvents ID As DataGridViewTextBoxColumn + Friend WithEvents LoadTitles As Button + Friend WithEvents SaveTit As Button + Friend WithEvents LowerCLUT As CheckBox + Friend WithEvents ClutShift As NumericUpDown + Friend WithEvents Label21 As Label + Friend WithEvents CDGrid As DataGridView + Friend WithEvents CDLoadSortedFiles As Button + Friend WithEvents DataGridViewTextBoxColumn1 As DataGridViewTextBoxColumn + Friend WithEvents JAP As DataGridViewTextBoxColumn + Friend WithEvents SizeB As DataGridViewTextBoxColumn + Friend WithEvents Eng As DataGridViewTextBoxColumn + Friend WithEvents EndSec As DataGridViewTextBoxColumn + Friend WithEvents Gap As DataGridViewTextBoxColumn + Friend WithEvents RadioSort1 As RadioButton + Friend WithEvents SortCDFiles As Button + Friend WithEvents TabPage7 As TabPage + Friend WithEvents PSP_UNPACK_EVENT_BIN As Button + Friend WithEvents conv3D As Button + Friend WithEvents UpperCLUT As CheckBox + Friend WithEvents KudosBtn As RadioButton + Friend WithEvents FileDescr As TextBox + Friend WithEvents Label22 As Label + Friend WithEvents Label23 As Label + Friend WithEvents SearchPointers As Button + Friend WithEvents CompareBTS As TextBox + Friend WithEvents Label24 As Label + Friend WithEvents Tim8Shift As CheckBox + Friend WithEvents Panel1 As Panel + Friend WithEvents RelpaceTextExecs As Button + Friend WithEvents UnKudosScript As CheckBox + Friend WithEvents ConvertEventsForEditing As Button + Friend WithEvents GenChars As Button + Friend WithEvents CharCodeGenerator As Button + Friend WithEvents ParseEvent As Button + Friend WithEvents DistrEditor As Button + Friend WithEvents GroupBox6 As GroupBox + Friend WithEvents Export518_675 As Button +End Class diff --git a/p2isPSX_CDToolkit/Form1.resx b/p2isPSX_CDToolkit/Form1.resx new file mode 100644 index 0000000..fdc03a6 --- /dev/null +++ b/p2isPSX_CDToolkit/Form1.resx @@ -0,0 +1,227 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + 17, 17 + + + 159, 17 + + + 296, 17 + + + + + AAABAAEAICAAAAEAIACoEAAAFgAAACgAAAAgAAAAQAAAAAEAIAAAAAAAABAAAMMOAADDDgAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABSQkr+UkJK/ikh + If4pISH+KSEh/ikhIf5SQkr+UkJK/joxMf5RQUn/UUFJ/2pZYv/EvLT/UkJK/joxMf4AAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFJC + Sv5SQkr+KSEh/ikhIf4pISH+KSEh/lJCSv5SQkr+UkJK/lJCSv5qWWL/alli/2pZYv/FvbX+UkJK/jox + Mf4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAUkJK/lJCSv4pISH+KSEh/ikhIf4pISH+UkJK/lJCSv5SQkr+UkJK/joxMf5qWWL/a1pj/mta + Y/7FvbX+OjEx/joxMf4AAAAAAAAAAAAAAAAAAAAAAAA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AAAAAAAAAUmOl/kpCWv5KQlr+SkJa/kpCWv5SY6X+UmOl/lJj + pf5KQlr+OjFC/gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUmOl/kpCWv5KQlr+SkJa/kpC + Wv5SY6X+SkJa/joxQv4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUmOl/lJj + pf5KQlr+SkJa/kpCWv46MUL+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAA//AAH//wAA//8AAH//gAB//4AAf/+AEH//gBB//4AQf/+AAP4fgAD8B4 + AA/AGAAfwAAAH8AAAD/jAAA//4AAf//AAP//wAH//+AD///wB///8AP///wB///8A////AH///gB///4 + Af//+AH///gB///8A////gf///////////8= + + + \ No newline at end of file diff --git a/p2isPSX_CDToolkit/Form1.vb b/p2isPSX_CDToolkit/Form1.vb new file mode 100644 index 0000000..7353ed8 --- /dev/null +++ b/p2isPSX_CDToolkit/Form1.vb @@ -0,0 +1,2049 @@ +Imports System.IO + +Imports System +Imports System.Text +Imports System.Runtime.Remoting.Metadata.W3cXsd2001 +Imports System.ComponentModel + +Public Class Form1 + + Public readerror As Boolean + Public binFile As List(Of rleFile) + Public files1 As List(Of fileInfo) + Public files2 As List(Of fileInfo) + Public CurrentImgMode As Byte + Dim drawSurface As Bitmap + Public chars As List(Of Char) + + + + Public DialogCounter As Integer + + + 'Private Sub PictureBox1_Paint(sender As Object, e As PaintEventArgs) Handles PictureBox1.Paint + ' e.Graphics.InterpolationMode = Drawing2D.InterpolationMode.NearestNeighbor + ' e.Graphics.ScaleTransform(2, 2) + ' e.Graphics.DrawImage(drawSurface, 0, 0) + 'End Sub + + Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load + 'WorkDir.Text &= "export\" + SaveFileDialog1.InitialDirectory = WorkDir.Text & "export\" + OpenFileDialog1.InitialDirectory = WorkDir.Text + + ExportBinPath.Text = WorkDir.Text + LoadChars() 'Load Atlus font + + drawSurface = New Bitmap(PictureBox1.ClientSize.Width, PictureBox1.ClientSize.Height) + PictureBox1.Image = drawSurface + + ReadCDFileTable.PerformClick() + + End Sub + + + Private Sub unRLEfileOpen_Click(sender As Object, e As EventArgs) Handles unRLEfileOpen.Click + + If OpenFileDialog1.ShowDialog <> DialogResult.OK Then Exit Sub + + unRLEfile.Text = OpenFileDialog1.FileName + + + End Sub + + + Private Sub Unrle_Btn_Click(sender As Object, e As EventArgs) Handles Unrle_Btn.Click + Dim r = New rleTools + Dim unrleFileData = My.Computer.FileSystem.ReadAllBytes(unRLEfile.Text) + Dim newFArray = r.Unrle(unrleFileData).ToArray + If SaveFileDialog1.ShowDialog <> DialogResult.OK Then Exit Sub + + My.Computer.FileSystem.WriteAllBytes(SaveFileDialog1.FileName, newFArray, False) + + End Sub + + + Private Sub RLEdecode_Click(sender As Object, e As EventArgs) Handles RLEdecode.Click + 'Dim r = New rleTools() + + 'Dim DecodedFile = r.decodeRLE(My.Computer.FileSystem.ReadAllBytes(unRLEfile.Text), encodeID.Text).ToArray + + 'My.Computer.FileSystem.WriteAllBytes(unRLEfile.Text & "ENCODED", DecodedFile, False) + + 'MsgBox("ENCODED!", MsgBoxStyle.Exclamation) + + + End Sub + Public Function Read32bitNum(ByRef f As Byte(), ByVal bytenum As Integer) + If f(bytenum + 3) = 255 And f(bytenum + 2) = 255 And f(bytenum + 1) = 255 And f(bytenum) = 255 Then Return -1 + Return f(bytenum) + f(bytenum + 1) * 256 + f(bytenum + 2) * 65536 + f(bytenum + 3) * 16777216 + End Function + + Public Function Read16bitNum(ByRef f As Byte(), ByVal bytenum As Integer) + Return f(bytenum) + f(bytenum + 1) * 256 + End Function + Private Sub ModifyFont_Click(sender As Object, e As EventArgs) Handles ModifyFont.Click + Dim f = New FontTools + f.convertTo16() + End Sub + Private Sub ConvertTo12x12_Click(sender As Object, e As EventArgs) Handles ConvertTo12x12.Click + Dim f = New FontTools + f.ConvertTo12() + End Sub + 'select bin file + Private Sub OPenBinBtn_Click(sender As Object, e As EventArgs) Handles OPenBinBtn.Click + + If OpenFileDialog1.ShowDialog <> DialogResult.OK Then Exit Sub + + FilnamLabel.Text = Path.GetFileNameWithoutExtension(OpenFileDialog1.FileName) + CDFileList.Items.Clear() + + DeconstructFile(My.Computer.FileSystem.ReadAllBytes(OpenFileDialog1.FileName)) + ShowFileSectors(binFile) + + End Sub + + 'Deconstruct bin - can deconstruct inputted bin from CD + + Public Sub DeconstructFile(ByRef Bytes() As Byte) + + If NotDeconstr.Checked Then Exit Sub + SelBinFiles.Items.Clear() + binFile = New List(Of rleFile) + If UBound(Bytes) > -1 Then + + If Bytes(0) > 3 Or Bytes(1) > 2 Then FilnamLabel.Text &= " NOT ARCHIVE!" : Exit Sub + + End If + + Dim cursector = 0 + Dim curid = 0 + Dim readByte = 0 + + 'DEBUG + 'My.Computer.FileSystem.WriteAllBytes(ExportBinPath.Text & "DEBUG", Bytes, False) + + Do + Dim r = New rleFile With {.SectorID = cursector, + .Type = Bytes(readByte + 0), + .Compr = Bytes(readByte + 1), + .Size = BitConverter.ToInt32(Bytes, readByte + 4), + .UnpackSize = BitConverter.ToInt32(Bytes, readByte + 8), + .Mode = Bytes(readByte + 1), + .ID = BitConverter.ToInt16(Bytes, readByte + 2), + .BytesAfter = 0, .SectorGap = 0 + } + + + Dim BA = r.Size Mod 4 + If BA > 0 Then r.BytesAfter = 4 - BA + + If r.Mode = 0 Then r.UnpackSize = r.Size 'wi + + If r.Type = 2 Then + r.x = BitConverter.ToInt16(Bytes, readByte + 8) + r.y = BitConverter.ToInt16(Bytes, readByte + 10) + r.w = BitConverter.ToInt16(Bytes, readByte + 12) + r.h = BitConverter.ToInt16(Bytes, readByte + 14) + r.UnpackSize = 0 ' r.w * r.h 'А ГДЕ БИТНОСТЬ ИЗОБРАЖЕНИЯ-ТО, ПЛЯТЬ???? + End If + + + Try + ReDim r.Bytes(r.Size - 1) + Array.Copy(Bytes, readByte, r.Bytes, 0, r.Size) + Catch ex As Exception + MsgBox("Exception! :" & ex.Message, MsgBoxStyle.Critical) + Exit Sub + End Try + + + binFile.Add(r) + + readByte += r.Size + r.BytesAfter + + + If readByte > UBound(Bytes) Then Exit Do + + If Bytes(readByte) = 0 Then + Do + binFile.Last.SectorGap += 1 + If Bytes(readByte) > 0 Then Exit Do + readByte += 1 + Loop While readByte <= UBound(Bytes) + cursector += 1 + + End If + + Loop While (readByte <= UBound(Bytes)) + + + End Sub + + + 'NEED FOR FILE REPLACE + Public Sub ReconstructFile() + + + + End Sub + + 'Show files in list + Public Sub ShowFileSectors(ByRef BinFile As List(Of rleFile)) + SelBinFiles.Items.Clear() + Dim compr = New List(Of String) + compr.Add("None") + compr.Add("RLE2") + compr.Add("RLE") + + Dim type = New List(Of String) + type.Add("eof") + type.Add("DATA") + type.Add("IMAGE") + type.Add("SCR?") + If IsNothing(BinFile) Then Exit Sub + + For Each r In BinFile + + Dim xy = "" + + If r.Type = 2 Then xy = ", x" & r.x & "y" & r.y & "w" & r.w & "h" & r.h + + + Select Case r.Compr + Case 0 + SelBinFiles.Items.Add(r.SectorID & ":" & r.ID & " : " & type(r.Type) & xy & " : " & compr(r.Compr) & ", Sz: " & r.Size & " Gap: " & r.SectorGap) + Case 1 + SelBinFiles.Items.Add(r.SectorID & ":" & r.ID & " : " & type(r.Type) & xy & " : " & compr(r.Compr) & ", Sz: " & r.Size & " unp:" & r.UnpackSize & " Gap: " & r.SectorGap) + Case 2 + SelBinFiles.Items.Add(r.SectorID & ":" & r.ID & " : " & type(r.Type) & xy & " : " & compr(r.Compr) & ", Sz: " & r.Size & " unp:" & r.UnpackSize & " Gap: " & r.SectorGap) + Case Else + SelBinFiles.Items.Add(r.SectorID & ":" & r.ID & " : " & type(r.Type) & xy & " : UNKNOWN COMPR, Sz: " & r.Size & " unp:" & r.UnpackSize & " Gap: " & r.SectorGap) + + End Select + + + Next + + End Sub + + Private Sub SelBinFiles_SelectedIndexChanged(sender As Object, e As EventArgs) Handles SelBinFiles.SelectedIndexChanged + Savedlbl.Text = "-----" + + If SelBinFiles.SelectedIndex = -1 Then Exit Sub + CurrentImgMode = 0 + + 'Image working + Dim r As rleFile = binFile(SelBinFiles.SelectedIndex) + If r.Type <> 2 Then PngExport.Enabled = False : Exit Sub Else PngExport.Enabled = True + If SelBinFiles.SelectedIndex = SelBinFiles.Items.Count - 1 Then Exit Sub + Dim nx = binFile(SelBinFiles.SelectedIndex + 1) + If (nx.w <> 16) And (nx.w <> 256 Or nx.h <> 1) Then + CLUTid.Value = 0 + CLUTid.Enabled = False + ImgShow.Enabled = False + + Exit Sub + End If + + + CLUTid.Value = 0 + CLUTid.Enabled = True + ImgShow.Enabled = True + CLUTs.Text = "CLUTs Num: " & nx.h + ' CLUTid.Maximum = nx.h - 1 + CLUTid.Minimum = 0 + DrawImage() + + End Sub + + Public Sub DrawImage() + ' PictureBox1.BackColor = Color.Transparent + PictureBox1.Invalidate() + drawSurface = New Bitmap(PictureBox1.ClientSize.Width * 3, PictureBox1.ClientSize.Height * 3) + PictureBox1.Image = drawSurface + Dim rle = New rleTools + Dim curF As rleFile = binFile(SelBinFiles.SelectedIndex) + Dim pic + If curF.Compr = 0 Then pic = rle.UnrleNocompr(curF.Bytes) + If curF.Compr = 1 Then pic = rle.Unrle2(curF.Bytes) + Dim nx = binFile(SelBinFiles.SelectedIndex + 1) + If LowerCLUT.Checked Then nx = binFile(SelBinFiles.SelectedIndex + 2) + If UpperCLUT.Checked Then nx = binFile(SelBinFiles.SelectedIndex - 1) + If nx.w = 256 Then Imp8bit.Checked = True Else imp4bit.Checked = True + If Force4bit.Checked Then imp4bit.Checked = True + Dim cluts As New List(Of Color) + cluts = MakeCLUTList(nx) + Dim x = 0, y = 0, reader = 0 + Do + If nx.w = 16 Or Force4bit.Checked Then + If x = curF.w * 2 Then x = 0 : y += 1 + '4bit mode + Dim fs = pic(reader) + Dim lp = fs And &HF 'get left byte + Dim rp = (fs And &HF0) >> 4 'get right byte + drawpixel(x * 2, y, cluts(lp)) + drawpixel(x * 2 + 1, y, cluts(rp)) + 'End If + Else + + ''8bit mode + 'If nx.w = 256 Then + If x = curF.w Then x = 0 : y += 1 + If reader + 1 > pic.Count - 1 Then Exit Do + Dim fs = pic(reader) + Dim fs2 = pic(reader + 1) + drawpixel(x * 2, y, cluts(fs)) + drawpixel(x * 2 + 1, y, cluts(fs2)) + reader += 1 + End If + reader += 1 + x += 1 + If reader >= pic.Count Then Exit Do + Loop + PictureBox1.Invalidate() + + End Sub + + + Private Sub Show16bit_Click(sender As Object, e As EventArgs) Handles Show16bit.Click + If SelBinFiles.SelectedIndex = -1 Then Exit Sub + PictureBox1.Invalidate() + imp16bit.Checked = True + CurrentImgMode = 16 + drawSurface = New Bitmap(PictureBox1.ClientSize.Width * 3, PictureBox1.ClientSize.Height * 3) + PictureBox1.Image = drawSurface + Dim rle = New rleTools + Dim curF = binFile(SelBinFiles.SelectedIndex) + Dim pic As List(Of Byte) + Dim reader = 0 + + If curF.Compr <> 0 Then + pic = rle.Unrle2(curF.Bytes) + Else + pic = curF.Bytes.ToList + pic.RemoveRange(0, 16) + End If + Dim x = 0, y = 0 + Dim fs = pic.ToArray + Do + If x = curF.w Then x = 0 : y += 1 + drawpixel(x, y, GetColFrom1555(fs, reader)) + reader += 2 + x += 1 + If reader >= pic.Count Then Exit Do + Loop + PictureBox1.Invalidate() + + End Sub + + Public Sub drawpixel(ByVal x As Integer, ByVal y As Integer, ByVal col As Color) + For a = 0 To 1 + For b = 0 To 1 + drawSurface.SetPixel(x * 2 + a, y * 2 + b, col) + Next + Next + End Sub + + + Public Function MakeCLUTList(ByRef nx As rleFile) + + Dim a = New List(Of Color) + '4bit mode + Dim rle As New rleTools + Dim unrl() As Byte + + Select Case nx.Compr + Case 0 + unrl = rle.UnrleNocompr(nx.Bytes).ToArray + Case 1 + unrl = rle.Unrle2(nx.Bytes).ToArray 'Image + Case Else + unrl = rle.Unrle(nx.Bytes).ToArray 'data + End Select + + If nx.w = 16 Or Force4bit.Checked Then + For x = 0 To 15 + a.Add(GetColFrom1555(unrl, CLUTid.Value * 32 + x * 2)) + Next + End If + If nx.w = 256 Then + For x = 0 To 255 + 'a.Add(GetColFrom1555(nx.Bytes, 16 + CLUTid.Value * 256 + x * 2)) + a.Add(GetColFrom1555(unrl, x * 2)) + Next + End If + Return a + End Function + Private Sub PngExport_Click(sender As Object, e As EventArgs) Handles PngExport.Click + Dim png = New pngImage + Dim fil As List(Of Byte) + If SelBinFiles.SelectedIndex < SelBinFiles.Items.Count - 1 Then + Dim nx = binFile(SelBinFiles.SelectedIndex + 1) + If LowerCLUT.Checked Then nx = binFile(SelBinFiles.SelectedIndex + 2) + If UpperCLUT.Checked Then nx = binFile(SelBinFiles.SelectedIndex - 1) + + fil = png.NewPng(binFile(SelBinFiles.SelectedIndex), nx) + Else + fil = png.NewPng(binFile(SelBinFiles.SelectedIndex), Nothing) + End If + + Dim r As rleFile = binFile(SelBinFiles.SelectedIndex) + If CreateBinDirCheck.Checked And CDFileList.SelectedIndex > -1 Then + Dim cat = WorkDir.Text & Strings.Left(FilnamLabel.Text, 4) & "_" & files1(CDFileList.SelectedIndex).Descript + If Not Directory.Exists(cat) Then + Directory.CreateDirectory(cat) + End If + ExportBinPath.Text = cat & "\" + End If + Dim filename = ExportBinPath.Text & Strings.Left(FilnamLabel.Text, 4) & "_" & SelBinFiles.SelectedIndex.ToString("D2") & "_" & r.SectorID & "_" & r.ID & "_clut" & CLUTid.Value + If japRadio.Checked Then filename &= "_J" + If EngRadio.Checked Then filename &= "_E" + If UserRadio.Checked Then filename &= "_U" + If Not ExportRLEDec.Checked Then filename &= "_RAW" + filename &= ".png" + My.Computer.FileSystem.WriteAllBytes(filename, fil.ToArray, False) + Savedlbl.Text = "png SAVED TO " & filename + + End Sub + + + Public Function GetColFrom1555(ByRef bytes As Byte(), ByVal ind As Integer) + If ind > UBound(bytes) - 1 Then Return Color.Black + Dim col As Int16 = BitConverter.ToInt16(bytes, ind) + Dim a = col And &H8000 >> 15, b = ((col And &H7C00) >> 10) * 8, g = ((col And &H3E0) >> 5) * 8, r = (col And &H1F) * 8 + 'Dim rgb = (r << 9) Or (g << 6) Or (b << 3) + If a <> 0 And r = 0 And g = 0 And b = 0 Then Return Color.FromArgb(0, 0, 0, 0) + Return Color.FromArgb(255, r, g, b) + + + End Function + + Private Sub Form1_KeyDown(sender As Object, e As KeyEventArgs) Handles Me.KeyDown, SelBinFiles.KeyDown + If e.KeyCode = Keys.E Then ExportUnrleFile.PerformClick() + End Sub + + + Private Sub ExportUnrleFile_Click(sender As Object, e As EventArgs) Handles ExportUnrleFile.Click + + + If SelBinFiles.SelectedIndex = -1 Then Exit Sub + Dim filename As String + Dim unrl As List(Of Byte) + + Dim r As rleFile = binFile(SelBinFiles.SelectedIndex) + + If ExportRLEDec.Checked Then + Dim rle = New rleTools + + filename = ExportBinPath.Text & FilnamLabel.Text & "_" & r.SectorID & "_" & r.ID + + Select Case r.Compr + Case 0 + unrl = rle.UnrleNocompr(r.Bytes) + Case 1 + unrl = rle.Unrle2(r.Bytes) 'Image + Case 2 + unrl = rle.Unrle(r.Bytes) 'data + End Select + + + Else + + filename = ExportBinPath.Text & FilnamLabel.Text & "_" & r.SectorID & "_" & r.ID + unrl = r.Bytes.ToList + End If + + + If CDFileList.Items.Count > 0 Then + + If CreateBinDirCheck.Checked And CDFileList.SelectedIndex > -1 Then + Dim cat = WorkDir.Text & Strings.Left(FilnamLabel.Text, 4) & "_" & files1(CDFileList.SelectedIndex).Descript + If Not Directory.Exists(cat) Then + Directory.CreateDirectory(cat) + + End If + ExportBinPath.Text = cat & "\" + End If + + + + filename = ExportBinPath.Text & Strings.Left(FilnamLabel.Text, 4) & "_" & SelBinFiles.SelectedIndex.ToString("D2") & "_" & r.SectorID & "_" & r.ID + + If japRadio.Checked Then filename &= "_J" + If EngRadio.Checked Or KudosBtn.Checked Then filename &= "_E" + If UserRadio.Checked Then filename &= "_U" + End If + + If Not ExportRLEDec.Checked Then filename &= "_RAW" + + My.Computer.FileSystem.WriteAllBytes(filename, unrl.ToArray, False) + Savedlbl.Text = "SAVED TO " & filename + + End Sub + + Private Sub ReadCDFileTable_Click(sender As Object, e As EventArgs) Handles ReadCDFileTable.Click + + Dim cd = New ISOTools + + Dim filnam = getFilnam() + + CDFileList.Items.Clear() + If Not File.Exists(filnam) Then MsgBox("File not found! Please select proper BIN file and check path!", MsgBoxStyle.Critical) : Exit Sub + If FileLen(filnam) < 621900000 Then MsgBox("File is not proper PERSONA2 IS bin image! Check it!", MsgBoxStyle.Critical) : Exit Sub + + 'Reading Files Descriptions + + Dim descipts = Split(My.Computer.FileSystem.ReadAllText("FileDesc.txt", Encoding.GetEncoding(1251)), vbCrLf) + + + + + 'Reading filetable and make array + files1 = cd.makeFileList(filnam) + + For Each f In files1 + + Dim curInd = files1.IndexOf(f) + If curInd < descipts.Count Then f.Descript = descipts(curInd) + + + CDFileList.Items.Add(curInd.ToString("D4") & " " & String.Format("{0,-9}", f.Descript) & " Sec: " & f.Sector & " Size: " & f.Sizw & "b.") + + Next + + Dim ls As fileInfo = GetLastSector() + + Dim freespace = FileLen(filnam) - (ls.Sector * &H930 + ls.Sizw) + + LastSectorLbl.Text = "Last Sector: " & ls.Sector + ls.Sizw / 2048 + + CDFreeSpaceLabel.Text = Math.Round(freespace / 1024) & " Kbytes / " & Math.Round(freespace / &H930) & " sectors" + + End Sub + + Private Sub CDFileList_SelectedIndexChanged(sender As Object, e As EventArgs) Handles CDFileList.SelectedIndexChanged + + If CDFileList.SelectedIndex = -1 Then Exit Sub + + Dim filnam = getFilnam() + + 'Exit Sub + + FilnamLabel.Text = CDFileList.SelectedItem.ToString + + FileDescr.Text = files1(CDFileList.SelectedIndex).Descript + + Dim a = New ISOTools + Dim fil = a.getCDfile(filnam, files1(CDFileList.SelectedIndex).Sector, files1(CDFileList.SelectedIndex).Sizw) + importSector.Text = files1(CDFileList.SelectedIndex).Sector + ' Exit Sub + + DeconstructFile(fil.ToArray) + ShowFileSectors(binFile) + End Sub + + Private Sub FileDescr_TextChanged(sender As Object, e As EventArgs) Handles FileDescr.TextChanged + + Dim curInd = CDFileList.SelectedIndex + + If curInd = -1 Then Exit Sub + + Dim f = files1(curInd) + f.Descript = FileDescr.Text + + CDFileList.Items(curInd) = curInd.ToString("D4") & " " & String.Format("{0,-9}", f.Descript) & " Sec: " & f.Sector & " Size: " & f.Sizw & "b." + + Dim txt = "" + + For Each ee In files1 + txt &= ee.Descript & vbCrLf + Next + + My.Computer.FileSystem.WriteAllText("FileDesc.txt", txt, False) + + + End Sub + + + + Public Function getFilnam() + Dim filnam = "" + + If japRadio.Checked Then + filnam = JapISOPath.Text + ElseIf EngRadio.Checked Then + filnam = EngISOPath.Text + ElseIf UserRadio.Checked Then + filnam = UserPath.Text + ElseIf KUDOSbtn.Checked Then + filnam = KUDOSpath.Text + End If + Return filnam + End Function + Private Sub exportBinfiletoBIN_Click(sender As Object, e As EventArgs) Handles exportBinfiletoBIN.Click + If CDFileList.SelectedIndex = -1 Then Exit Sub + + Dim a = New ISOTools + Dim fil = a.getCDfile(getFilnam, files1(CDFileList.SelectedIndex).Sector, files1(CDFileList.SelectedIndex).Sizw) + + If SaveFileDialog1.ShowDialog <> DialogResult.OK Then Exit Sub + + My.Computer.FileSystem.WriteAllBytes(SaveFileDialog1.FileName, fil.ToArray, False) + + End Sub + + + + + + Private Sub EngRadio_CheckedChanged(sender As Object, e As EventArgs) Handles EngRadio.CheckedChanged, japRadio.CheckedChanged, UserRadio.CheckedChanged, KudosBtn.CheckedChanged + CDFileList.Items.Clear() + SelBinFiles.Items.Clear() + + End Sub + + Private Sub ReadFontWide1_Click(sender As Object, e As EventArgs) Handles ReadFontWide1.Click + PatchBytes(FontWide1, 111972, False) + + End Sub + + Private Sub WriteFontWide3_Click(sender As Object, e As EventArgs) Handles WriteFontWide1.Click + PatchBytes(FontWide1, 111972, True) + End Sub + + Private Sub ReadFontWide22_Click(sender As Object, e As EventArgs) Handles coordMultiAsmRd.Click + PatchBytes(TextCharSpacer, 119472, False) + + End Sub + + Private Sub WriteFontWide2_Click(sender As Object, e As EventArgs) Handles coordMultiAsmWr.Click + PatchBytes(TextCharSpacer, 119472, True) + End Sub + + + Private Sub ReadFontWide33_Click(sender As Object, e As EventArgs) Handles DialLeftSpaceRd.Click + PatchBytes(DialLeftSpaceText, 571965, False) + + End Sub + + Private Sub WriteFontWide1_Click(sender As Object, e As EventArgs) Handles DialLeftSpaceWr.Click + PatchBytes(DialLeftSpaceText, 571965, True) + End Sub + + + Private Sub PatchBytes(ByRef textbox As TextBox, ByVal address As Integer, ByVal Write As Boolean) + + 'this is for mainCodePatches + + + If Not File.Exists(UserPath.Text) Then MsgBox("USER BIN NOT FOUND!", MsgBoxStyle.Critical) : Exit Sub + If Write Then + If Not IsNumeric(textbox.Text) Then MsgBox("Not Numeric textBox!", MsgBoxStyle.Critical) : Exit Sub + End If + + + + + If Not Write Then + + Dim fs As New FileStream(UserPath.Text, FileMode.Open, FileAccess.Read) + Dim br As New BinaryReader(fs) + + br.BaseStream.Position = address + + textbox.Text = br.ReadBytes(1)(0) + + br.Dispose() + fs.Dispose() + + Else + + + Dim fs As New FileStream(UserPath.Text, FileMode.Open, FileAccess.Write) + Dim bw As New BinaryWriter(fs) + + bw.BaseStream.Position = address + Dim b() = {Convert.ToByte(textbox.Text)} + bw.Write(b, 0, 1) + + bw.Dispose() + fs.Dispose() + + End If + + + End Sub + + Private Sub PatchCytyTextCoords_Click(sender As Object, e As EventArgs) Handles PatchCytyTextCoords.Click + + 'IN 1119 - 800AD320 (offs 8992) - need to 0,0,0,0 (its shift left 0x1) x3 instead x6 - Text and rect coord + '800AD328 need to 64 instead 128 (text pixels wide x2 instead x4) - rect X WIDE + '800AD360 (offs 9056)- need 5 instead 6 - pixels for X-offset text from start of rect + + Dim ofs = New List(Of Integer) + Dim bts = New List(Of Byte) + ofs.AddRange({8992, 8993, 8994, 8995, 9000, 9056}) + bts.AddRange({0, 0, 0, 0, 64, 5}) + + PatchFile(ofs, bts, files1(1119).Sector, files1(1119).Sizw) + + End Sub + + 'Patching List of bytes :) + + Private Sub PatchFile(ByVal offsets As List(Of Integer), ByRef bytes As List(Of Byte), ByVal Sector As Integer, ByVal Sizw As Integer) + Dim a = New ISOTools + Dim fil = a.getCDfile(getFilnam, Sector, Sizw) + For z = 0 To offsets.Count - 1 + fil(offsets(z)) = bytes(z) + Next + a.saveCDfile(getFilnam, Sector, Sizw, fil.ToArray) + MsgBox("Patched! " & bytes.Count & " bytes!") + End Sub + + + Private Sub tstBtn_Click(sender As Object, e As EventArgs) Handles tstBtn.Click + For a = 100 To 0 Step -1 + + Debug.WriteLine(a) + + Next + End Sub + + Private Sub RawToSectorImport_Click(sender As Object, e As EventArgs) Handles RawToSectorImport.Click + If Not IsNumeric(RawSectorImport.Text) Then MsgBox("Enter sector count") + + If CDFileList.SelectedIndex = -1 Then Exit Sub + If Not UserRadio.Checked Then MsgBox("YOU CAN REALLOCATE ONLY USER ISO!!!") : Exit Sub + + + Dim cd = New ISOTools + + cd.ReallocateDown(UserPath.Text, files1, CDFileList.SelectedIndex + 1, RawSectorImport.Text) + + MsgBox("REALLOCATE COMPLETE 8-O SUCCESSFULLY") + + End Sub + + + + + + Private Sub ImportTXT_Click(sender As Object, e As EventArgs) Handles ImportTXT.Click + + DialogCounter = 0 + Dim LineCounter = 0 + + OpenFileDialog1.Multiselect = True + If OpenFileDialog1.ShowDialog <> DialogResult.OK Then Exit Sub + Dim txt = New ScriptTools + OpenFileDialog1.Multiselect = False + + For Each JFile In OpenFileDialog1.FileNames + Debug.WriteLine("Converting " & JFile) + txt.importTextFile(JFile, DialogCounter, LineCounter) + Next + + MsgBox("Success! Converted " & UBound(OpenFileDialog1.FileNames) + 1 & " file(s)" & vbCrLf & "Overall Dialogs Count: " & DialogCounter & + vbCrLf & "Overall Lines Count: " & LineCounter) + + End Sub + + + Private Sub ConvertContactScript_Click(sender As Object, e As EventArgs) Handles ConvertContactScript.Click + + DialogCounter = 0 + Dim LineCounter = 0 + + OpenFileDialog1.Multiselect = True + If OpenFileDialog1.ShowDialog <> DialogResult.OK Then Exit Sub + Dim txt = New ScriptTools + OpenFileDialog1.Multiselect = False + + For Each JFile In OpenFileDialog1.FileNames + Debug.WriteLine("Converting " & JFile) + txt.importContactFile(JFile, DialogCounter, LineCounter) + Next + + MsgBox("Success! Converted " & UBound(OpenFileDialog1.FileNames) + 1 & " file(s)" & vbCrLf & "Overall Dialogs Count: " & DialogCounter & + vbCrLf & "Overall Lines Count: " & LineCounter) + + + End Sub + + + + Private Sub SelExportCript_Click(sender As Object, e As EventArgs) Handles SelExportCript.Click + OpenFileDialog1.Multiselect = True + If OpenFileDialog1.ShowDialog <> DialogResult.OK Then Exit Sub + OpenFileDialog1.Multiselect = False + Dim s = New ScriptTools + + For Each JFile In OpenFileDialog1.FileNames + 'Dim fileNamArr = Split(Path.GetFileName(JFile), "_") + Dim Efile = JFile.Substring(0, JFile.Length - 1) & "E" + If UnKudosScript.Checked Then Efile = JFile.Substring(0, JFile.Length - 1) & "K" + s.ExportTextFile(JFile, Efile) + Next + + MsgBox(String.Format("Success! Exported {0} file(s)", UBound(OpenFileDialog1.FileNames) + 1)) + End Sub + + + + + Private Sub TextBox5_TextChanged(sender As Object, e As EventArgs) Handles TextBox5.TextChanged + + Dim text = New FontTools + Dim Colors = New List(Of Color) + Dim curColor As Integer = 1 + text.GetColors() 'init colors array + + + drawSurface = New Bitmap(PictureBox1.ClientSize.Width, PictureBox1.ClientSize.Height) + + 'PictureBox1.BackColor = Color.DarkBlue + PictureBox1.BackColor = Color.White + PictureBox1.Image = drawSurface + + + 'TextBox5.Text = + Dim srcTxt1 = TextBox5.Text.Replace(" ", "") + + srcTxt1 = Replace(srcTxt1, Chr(9), "2011") + +newtest: + If IsNothing(srcTxt1) Then Exit Sub + + 'Need To delete Skobki + For a = 0 To srcTxt1.Length - 1 + Dim sss = srcTxt1(a) + ' If sss = Chr(9) Then srcTxt1.Remove(a, 1) : GoTo newtest + If sss = "[" Then + Dim code = srcTxt1.Substring(a + 1, 4) + If code = "0111" Or code = "0311" Then + srcTxt1 = srcTxt1.Insert(a, vbCrLf) + a = a + 2 + End If + deleteSkobki(srcTxt1, a) + GoTo newtest + End If + + + Next + + Dim srcTxt2() = Split(srcTxt1, vbCrLf) + + + Dim y = 0 + + For Each line In srcTxt2 + If line.Length Mod 4 > 0 Then Exit Sub + + 'Try + Dim bytes() = SoapHexBinary.Parse(line).Value + If bytes.Length = 0 Then Exit Sub + + text.DrawChars(bytes.ToList, drawSurface, y, curColor) + 'Catch ex As Exception + 'MsgBox("Error in codes!") + 'End Try + + + y += 15 + Next + + End Sub + + Public Sub deleteSkobki(ByRef str As String, ByRef ind As Integer) + + 'searching end of skobki + For a = 0 To str.Length - 1 + If str(a + ind) = "]" Then str = str.Remove(ind, a + 1) : Exit Sub + Next + + End Sub + + Private Function ByteSearch(ByVal searchIn As Byte(), ByVal searchBytes As Byte()) As Integer + Dim f As Integer + For i As Integer = 0 To searchIn.Length - searchBytes.Length + If Not searchIn(i) = searchBytes(0) Then Continue For + f = searchBytes.Length - 1 + While f >= 1 AndAlso searchIn(i + f) = searchBytes(f) + f -= 1 + End While + If f = 0 Then Return i + Next + Return -1 + End Function + + Private Sub SearchHexPattern_Click(sender As Object, e As EventArgs) Handles SearchHexPattern.Click + If HexPatternBox.Text.Length Mod 2 > 0 Then Exit Sub + + Dim searchBytes = SoapHexBinary.Parse(HexPatternBox.Text).Value + + Dim cd = New ISOTools + Dim exeFile = cd.getCDfile(getFilnam, 27, 1812408) + + 'search in exe + Dim res = ByteSearch(exeFile.ToArray, searchBytes) + If res > -1 Then MsgBox("FOUND! IN SLPS!" & vbCrLf & "Offset: " & res) : Exit Sub + + 'Dim found = ByteSearch(fil, searchBytes) + 'If found > -1 Then MsgBox("FOUND! " & vbCrLf & "OFFSET = " & found) + + Dim searchRes = New List(Of String) + + 'all files to video + For a = 0 To 864 + Dim curFile = cd.getCDfile(getFilnam, files1(a).Sector, files1(a).Sizw) + 'If curFile(0) = 1 Or curFile(0) = 2 Then Continue For 'IF ARCHIVE + 'If curFile(1) = 1 Or curFile(1) = 2 Then Continue For + Debug.WriteLine("Searching... " & a) + Res = ByteSearch(curFile.ToArray, searchBytes) + If res > -1 Then searchRes.Add("#" & a & "Offset: " & res) + Next + + If searchRes.Count Then + MsgBox("FOUND: " & vbCrLf & (Join(searchRes.ToArray, vbCrLf))) + Else + MsgBox("NOT FOUND") + End If + + '5374617475733A2048756D616E + + End Sub + + Private Sub SaveShadowDisc_Click(sender As Object, e As EventArgs) Handles SaveShadowDisc.Click + Dim cd = New ISOTools + + 'My.Computer.FileSystem.WriteAllBytes(WorkDir.Text & "SHADOW.BIN", cd.getCDfile(UserPath.Text, 278075, 35000000).ToArray, False) + Dim f() = My.Computer.FileSystem.ReadAllBytes(WorkDir.Text & "SHADOW.BIN") + cd.saveCDfile(UserPath.Text, 278075, 35000000, f) + + + End Sub + + Private Sub importToBin_Click(sender As Object, e As EventArgs) Handles importToBin.Click + + + If Not UserRadio.Checked Then MsgBox("YOU CAN IMPORT ONLY IN USER ISO!!!") : Exit Sub + + 'OpensFile + + OpenFileDialog1.Multiselect = True + If OpenFileDialog1.ShowDialog <> DialogResult.OK Then Exit Sub + OpenFileDialog1.Multiselect = False + + + 'Dim fil = My.Computer.FileSystem.ReadAllBytes(OpenFileDialog1.FileName) + + + Dim s = New ScriptTools + Dim endfil = New List(Of Byte) + + For Each filee In OpenFileDialog1.FileNames + + + '///////////////////MULTIFILES LOOP START + '////////////FOR EACH FILE + + + Dim fileInfo = Split(Path.GetFileNameWithoutExtension(filee), "_") + Dim curFilePack As Integer = fileInfo(0) + Dim curFileIndexInPack As Integer = fileInfo(1) + Dim curFileSector As Integer = fileInfo(2) + Dim curFileRleID As Integer = fileInfo(3) + Debug.WriteLine("Importing... " & Path.GetFileNameWithoutExtension(filee)) + If curFilePack <> CDFileList.SelectedIndex Then MsgBox("Select File From CD and Proper file to import! IDs not equal!" & vbCrLf & filee, MsgBoxStyle.Critical) : Exit Sub + Dim fil = My.Computer.FileSystem.ReadAllBytes(filee) + + + Dim curfile As rleFile = binFile(curFileIndexInPack) + 'Need To RLE? + If encodeTOrle.Checked Then + + If curfile.Compr = 0 Then + If ForceRle.Checked Then + If MsgBox("Warning! Source File Is not Compressed! Continue??", MsgBoxStyle.YesNo) <> MsgBoxResult.Yes Then Exit Sub + Dim r = New rleTools + endfil = r.decodeRLEnew(fil, curfile) + GoTo rleEnd + End If + 'making fileHeaderForNonCompressed + endfil.Add(curfile.Type) + endfil.Add(0) 'No compression + endfil.Add(BitConverter.GetBytes(curfile.ID)(0)) 'Convert ID + endfil.Add(BitConverter.GetBytes(curfile.ID)(1)) + endfil.Add(BitConverter.GetBytes(fil.Count + 8)(0)) 'FileSize + endfil.Add(BitConverter.GetBytes(fil.Count + 8)(1)) 'FileSize + endfil.Add(BitConverter.GetBytes(fil.Count + 8)(2)) 'FileSize + endfil.Add(BitConverter.GetBytes(fil.Count + 8)(3)) 'FileSize + + endfil.AddRange(fil.ToList) +rleEnd: + + 'adding bytes to read MOD4 + Dim addedBytes = endfil.Count Mod 4 + If addedBytes > 0 Then addedBytes = 4 - addedBytes + For a = 0 To addedBytes - 1 + endfil.Add(0) + Next + + Else + Dim r = New rleTools + + + endfil = r.decodeRLEnew(fil, curfile) + + + End If + + + Else + endfil = fil.ToList + End If + + If endfil.Count = 0 Then MsgBox("Import Error in file #" & curFileIndexInPack) : Exit Sub + + '/Dim lastfileSectors As Integer = binFile(curFileIndexInPack).Bytes.Count Mod 2048 + + 'Insert to selected File Array (Calc With BytesAfter) + binFile(curFileIndexInPack).Bytes = endfil.ToArray + + binFile(curFileIndexInPack).BytesAfter = 0 + + + Next + '///////////////////MULTIFILES LOOP END + + + + + + 'АРХИВИРУЕМ МАССИВ ФАЙЛОВ ДЛЯ ЗАПИСИ В ОДИН ФАЙЛ + Dim lastSectorID As Integer = 0 + Dim finalPack = New List(Of Byte) + Dim addresses = New List(Of Integer) 'Start Addr for all files + + For Each bin In binFile + + If Not IgnoreGaps.Checked Then + 'filling sector to end (making sectorgap) in the middle of the file + If bin.SectorID <> lastSectorID Then + Dim gap = 2048 - (finalPack.Count Mod 2048) + For g = 0 To gap - 1 + finalPack.Add(0) + Next + End If + End If + + 'Adding currentfile Sector Size (for at least 0004) + bin.SectorSize = bin.Bytes.Count \ 2048 + If bin.Bytes.Count Mod 2048 > 0 Then bin.SectorSize += 1 + + + 'adding currentfile and address for filetables + addresses.Add(finalPack.Count) + finalPack.AddRange(bin.Bytes) + + 'AddingBytesAfter + For g = 0 To bin.BytesAfter - 1 + finalPack.Add(0) + Next + + + If CDFileList.SelectedIndex = 735 Or CDFileList.SelectedIndex = 90 Or CDFileList.SelectedIndex = 1075 Then + 'checking crazy last 20 bytes on sector for file IN SUUMON AND DUNGEON TEXTS + Dim ffff = 2048 - (finalPack.Count Mod 2048) + If ffff <= 20 And ffff > 0 Then + For g = 1 To ffff + finalPack.Add(0) + Next + End If + End If + + + lastSectorID = bin.SectorID + Next + + Dim finalPackClean As Integer = finalPack.Count + + 'Fill file to END of Sector + + If finalPack.Count Mod 2048 > 0 Then + For g = 1 To (2048 - (finalPack.Count Mod 2048)) + finalPack.Add(0) + Next g + End If + + 'checking filesize if inserting into ORIGINAL place + If Not TestImportSize(finalPack, finalPackClean) Then Exit Sub + + + 'UPDATE INSIDE ARCHIVES POINTERS + Select Case CDFileList.SelectedIndex + + + 'EP pointers + + Case 735 + 'Updating fileTable in externalCode for DUNGEON DIALOGS in 0736 + MakePointersTable(addresses, files1(736).Sector, files1(736).Sizw, 110548) + + + + 'IS old pointers + 'Case 4 + ' 'Updating fileTable in BattleCode for DIALOGS in 0004 + ' '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 + + + ' 'city import + 'Case 1112 + ' 'Updating fileTable in mainEXE for DIALOGS in 1112 + ' MakePointersTable(addresses, 225, 4096, 1148) 'if 1112 + 'Case 1113 + ' MakePointersTable(addresses, 225, 4096, 1148 + 136) 'if 1113 + 'Case 1114 + ' MakePointersTable(addresses, 225, 4096, 1148 + 352) + 'Case 1115 + ' MakePointersTable(addresses, 225, 4096, 1148 + 544) + 'Case 1116 + ' MakePointersTable(addresses, 225, 4096, 1148 + 720) + 'Case 1117 + ' MakePointersTable(addresses, 225, 4096, 1148 + 888) + 'Case 1075 + ' UpdateBattleContactFileTable(addresses) 'Updating BattleContacts + End Select + + + + + + 'SaveFile To Sector + Dim cd = New ISOTools + + + + 'Dim savFile = OpenFileDialog1.FileName & ".bin" '//////////////////////////////////DEBUG SAVE + + + 'My.Computer.FileSystem.WriteAllBytes(savFile, finalPack.ToArray, False) + cd.saveCDfile(UserPath.Text, importSector.Text, finalPack.Count, finalPack.ToArray) + + + + + 'Update SectorNumber and FileSize In FileArray + files1(CDFileList.SelectedIndex).Sizw = finalPack.Count + files1(CDFileList.SelectedIndex).Sector = importSector.Text + + 'Update FileTable In ISO + cd.UpdateFileListTable(UserPath.Text, files1) + + + + + + 'Done + MsgBox(String.Format("Imported {0} files in {1} - {2} bytes", UBound(OpenFileDialog1.FileNames) + 1, CDFileList.SelectedIndex, finalPack.Count), MsgBoxStyle.Exclamation) + End Sub + + Public Sub UpdateBattleContactFileTable(ByRef addr As List(Of Integer)) + + Dim cd = New ISOTools + Dim fTable = cd.getCDfile(UserPath.Text, files1(1).Sector, files1(1).Sizw) + Dim TableOffset = 403232 + + For a = 0 To addr.Count - 1 + Dim curAddr = a * 8 + TableOffset - 8 + + Dim cursect As Int16 = addr(a) \ 2048 + Dim modSect As Int16 = addr(a) Mod 2048 + + If a = 0 Then + fTable(curAddr + 8) = addr(2) \ 2048 'First 2 files + fTable(curAddr + 8) = 0 + a += 1 + Continue For + Else + + 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??? + + Dim sz = binFile(a).Bytes.Count \ 2048 + 3 + + 'If binFile(a).Bytes.Count Mod 2048 > 0 Then sz += 1 + + fTable(curAddr + 4) = sz 'Another Files + fTable(curAddr + 5) = 0 + + End If + Next + + cd.saveCDfile(UserPath.Text, files1(1).Sector, files1(1).Sizw, fTable.ToArray) + + End Sub + + Public Sub Update0004ScriptTable() + + Dim cd = New ISOTools + + Dim fTable = cd.getCDfile(UserPath.Text, files1(1).Sector, files1(1).Sizw) + Dim lastSize = 0 + For a = 0 To 50 + Dim curAddr = a * 8 + 396444 + Dim curBlockSects As Integer = binFile(a * 3).SectorSize + binFile(a * 3 + 1).SectorSize + binFile(a * 3 + 2).SectorSize + + fTable(curAddr) = 0 + fTable(curAddr + 1) = 0 + fTable(curAddr + 2) = BitConverter.GetBytes(lastSize)(0) + fTable(curAddr + 3) = BitConverter.GetBytes(lastSize)(1) + fTable(curAddr + 4) = BitConverter.GetBytes(curBlockSects)(0) + fTable(curAddr + 5) = BitConverter.GetBytes(curBlockSects)(1) + fTable(curAddr + 6) = 3 + fTable(curAddr + 7) = 0 + + lastSize += curBlockSects + + Next + + cd.saveCDfile(UserPath.Text, files1(1).Sector, files1(1).Sizw, fTable.ToArray) + + End Sub + + Public Sub Update0073SummonScriptTable(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 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 + + + 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) + + End Sub + + + + + 'Start with 104592 for 0090 in 0092 - 160files * 8bytes + 'PointersTableFor BigFileLoad + '00 00 - Sector Addr + '00 00 - Sectors from filestart + '00 00 00 00 + + + Public Sub MakePointersTable(ByRef addr As List(Of Integer), ByVal Sector As Integer, ByVal Sizw As Integer, ByVal offset As Integer) + + Dim cd = New ISOTools + + Dim fTable = cd.getCDfile(UserPath.Text, Sector, Sizw) + + For a = 0 To binFile.Count - 1 + Dim curAddr = a * 8 + offset + + 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??? + + Dim bts As Integer = binFile(a).Bytes.Count + If binFile(a).Compr = 0 Then bts -= 8 'Its Uncompressed TIM?? + + + fTable(curAddr + 4) = BitConverter.GetBytes(bts)(0) 'Saving Size of file + fTable(curAddr + 5) = BitConverter.GetBytes(bts)(1) 'BE or LE??? + + fTable(curAddr + 6) = BitConverter.GetBytes(bts)(2) + fTable(curAddr + 7) = BitConverter.GetBytes(bts)(3) + + + + Next + + cd.saveCDfile(UserPath.Text, Sector, Sizw, fTable.ToArray) + + End Sub + + Public Sub SavePointersTableToFile(ByRef addr As List(Of Integer), ByVal Filname As String, ByRef binf As List(Of rleFile)) + + Dim fil = New List(Of Byte) + + For a = 0 To binFile.Count - 1 + 'Dim curAddr = a * 8 + offset + Dim cursect As Int16 = addr(a) \ 2048 + Dim modSect As Int16 = addr(a) Mod 2048 + fil.Add(BitConverter.GetBytes(modSect)(0)) + fil.Add(BitConverter.GetBytes(modSect)(1)) 'BE or LE??? + + fil.Add(BitConverter.GetBytes(cursect)(0)) + fil.Add(BitConverter.GetBytes(cursect)(1)) 'BE or LE??? + + Dim bts As Integer = binFile(a).Bytes.Count + 'If binFile(a).Compr = 0 Then bts -= 8 'Its Uncompressed TIM?? + + + fil.Add(BitConverter.GetBytes(bts)(0)) 'Saving Size of file + fil.Add(BitConverter.GetBytes(bts)(1)) 'BE or LE??? + + fil.Add(BitConverter.GetBytes(bts)(2)) + fil.Add(BitConverter.GetBytes(bts)(3)) + + + + Next + + My.Computer.FileSystem.WriteAllBytes(Filname, fil.ToArray, False) + + End Sub + + Public Function TestImportSize(ByRef finalPack As List(Of Byte), ByVal packsize As Integer) + + Dim filesSorted = New List(Of fileInfo) + + For Each fl In files1 + filesSorted.Add(fl) + Next + + filesSorted.Sort(Function(x, y) x.Sector.CompareTo(y.Sector)) + + + Dim currentIndex = filesSorted.FindIndex(Function(x) x.FileID = CDFileList.SelectedIndex) + + 'checking filesize if inserting into ORIGINAL place + If importSector.Text < 278000 Then + + Dim f1s As Integer = finalPack.Count \ 2048 : If finalPack.Count Mod 2048 > 0 Then f1s += 1 + ' Dim f2s As Integer = files1(CDFileList.SelectedIndex).Sizw \ 2048 : If files1(CDFileList.SelectedIndex).Sizw Mod 2048 > 0 Then f2s += 1 + Dim CurSect As Integer = importSector.Text + Dim fNextSect As Integer = filesSorted(currentIndex + 1).Sector + + If f1s + CurSect > fNextSect Then + If MsgBox("File is Overriding Next FILE sectors in ISO! " & vbCrLf & f1s & "sects > " & fNextSect - CurSect & " Free sectors" & vbCrLf & "Pack sz diff: " & packsize & " > " & filesSorted(currentIndex).Sizw & vbCrLf & "Want to save to .bin?", MsgBoxStyle.YesNo) = MsgBoxResult.No Then + Return False + Else + If SaveFileDialog1.ShowDialog <> DialogResult.OK Then Return False + + My.Computer.FileSystem.WriteAllBytes(SaveFileDialog1.FileName, finalPack.ToArray, False) + Return False + End If + End If + ' If f1s > f2s Then MsgBox("File has MORE sectors than in ISO! " & vbCrLf & f1s & "sec > " & f2s & "sec" & vbCrLf & "USE FREE SECTORS!", MsgBoxStyle.Information) : Return False + + End If + Return True + End Function + + Private Sub importRAWtoSel_Click(sender As Object, e As EventArgs) Handles importRAWtoSel.Click + If OpenFileDialog1.ShowDialog <> DialogResult.OK Then Exit Sub + + If Not UserRadio.Checked Then MsgBox("YOU CAN IMPORT ONLY IN USER ISO!!!") : Exit Sub + + + Dim fil = My.Computer.FileSystem.ReadAllBytes(OpenFileDialog1.FileName).ToList + + If Not Mode2352.Checked Then + + + If fil.Count Mod 2048 > 0 Then + For g = 1 To (2048 - (fil.Count Mod 2048)) + fil.Add(0) + Next g + End If + + 'CheckingSize + 'If Not TestImportSize(fil) Then Exit Sub + + End If + + + + + + + Dim cd = New ISOTools + cd.saveCDfile(UserPath.Text, importSector.Text, fil.Count, fil.ToArray) + + If UpdateSizeTable.Checked Then + files1(CDFileList.SelectedIndex).Sizw = fil.Count + files1(CDFileList.SelectedIndex).Sector = importSector.Text + cd.UpdateFileListTable(UserPath.Text, files1) + + End If + + + MsgBox("RawFileImported :-X") + + End Sub + + Private Sub getFreeSector_Click(sender As Object, e As EventArgs) Handles getFreeSector.Click + + Dim a As fileInfo = GetLastSector() + + importSector.Text = a.Sector + a.Sizw \ 2048 + 10 + + End Sub + + Public Function GetLastSector() + + Return files1.OrderByDescending(Function(x) x.Sector).FirstOrDefault + + End Function + + Private Sub Export181577_Click(sender As Object, e As EventArgs) Handles Export181577.Click + + + Dim ver = "" + + If CDFileList.Items.Count > 0 Then + + + Dim cat = WorkDir.Text & "0057_ALL_SCENERY" + If Not Directory.Exists(cat) Then + Directory.CreateDirectory(cat) + + End If + ExportBinPath.Text = cat & "\" + + + If japRadio.Checked Then ver = "_J" + If EngRadio.Checked Then ver = "_E" + If UserRadio.Checked Then ver = "_U" + + Else + MsgBox("Please,Select And Load ISO") : Exit Sub + End If + + Dim iso = New ISOTools + Dim rle = New rleTools + Dim filnam = getFilnam() + + + + For a = 57 To 397 + + Dim b(0) As Byte + + Dim fil = iso.getCDfile(filnam, files1(a).Sector, files1(a).Sizw) + + DeconstructFile(fil.ToArray) 'here is separated binfile + + + Dim r As rleFile = binFile.Last 'get scenery script + + Dim filename = ExportBinPath.Text & "0" & a & "_" & binFile.Count - 1 & "_0_" & binFile.Count - 1 & ver + + Dim unrl = New List(Of Byte) + If r.Compr = 2 Then + unrl = rle.Unrle(r.Bytes) 'unpacking + Else + unrl = rle.Unrle2(r.Bytes) + End If + + + 'saving! + My.Computer.FileSystem.WriteAllBytes(filename, unrl.ToArray, False) + + Next + + MsgBox("EXPORTED TO " & ExportBinPath.Text) + End Sub + + + Private Sub Export518_675_Click(sender As Object, e As EventArgs) Handles Export518_675.Click + + + Dim ver = "" + + If CDFileList.Items.Count > 0 Then + + + Dim cat = WorkDir.Text & "0518_EXTRA_SCENERY" + If Not Directory.Exists(cat) Then + Directory.CreateDirectory(cat) + + End If + ExportBinPath.Text = cat & "\" + + + If japRadio.Checked Then ver = "_J" + If EngRadio.Checked Then ver = "_E" + If UserRadio.Checked Then ver = "_U" + + Else + MsgBox("Please,Select And Load ISO") : Exit Sub + End If + + Dim iso = New ISOTools + Dim rle = New rleTools + Dim filnam = getFilnam() + + + + For a = 518 To 675 + + Dim b(0) As Byte + + Dim fil = iso.getCDfile(filnam, files1(a).Sector, files1(a).Sizw) + + DeconstructFile(fil.ToArray) 'here is separated binfile + + + Dim r As rleFile = binFile.Last 'get scenery script + + Dim filename = ExportBinPath.Text & "0" & a & "_" & binFile.Count - 1 & "_0_" & binFile.Count - 1 & ver + + Dim unrl = New List(Of Byte) + If r.Compr = 2 Then + unrl = rle.Unrle(r.Bytes) 'unpacking + Else + unrl = rle.Unrle2(r.Bytes) + End If + + + 'saving! + My.Computer.FileSystem.WriteAllBytes(filename, unrl.ToArray, False) + + Next + + MsgBox("EXPORTED TO " & ExportBinPath.Text) + End Sub + + + Private Sub ShowSorted_Click(sender As Object, e As EventArgs) Handles ShowSorted.Click + SortedFileList.Items.Clear() + + Dim filesSorted = New List(Of fileInfo) + + For Each fl In files1 + filesSorted.Add(fl) + Next + + filesSorted.Sort(Function(x, y) x.Sector.CompareTo(y.Sector)) + + For Each f In filesSorted + Dim sectSize As Integer = f.Sizw / 2048 + If f.Sizw Mod 2048 > 0 Then sectSize += 1 + + SortedFileList.Items.Add(f.FileID.ToString("D4") & " Sec: " & f.Sector & " - " & f.Sector + sectSize & " (" & sectSize & ")") + + Next + + End Sub + + + + Private Sub ScriptView_Click(sender As Object, e As EventArgs) Handles ScriptView.Click + Dim s = New ScriptCheck + + s.Show() + + End Sub + + Private Sub makeTreeTest_Click(sender As Object, e As EventArgs) Handles makeTreeTest.Click + + Dim rle = New rleTools + Dim fil = My.Computer.FileSystem.ReadAllBytes("D:\Games\PSX\Persona.2.Innocent.Sin\Export\UnRLE\0181_ALL_SCENERY\1112").ToList + + ' rle.decodeRLEnew(fil) + + End Sub + + Private Sub OffsetEditorBtn_Click(sender As Object, e As EventArgs) Handles OffsetEditorBtn.Click + Dim o = New StringsOffsetEditorvb + o.Show() + End Sub + + Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click + Dim o = New DungeonEditor + o.Show() + End Sub + + + Private Sub DistrEditor_Click(sender As Object, e As EventArgs) Handles DistrEditor.Click + Dim o = New CityEditor + o.Show() + End Sub + + Private Sub ImgShow_Click(sender As Object, e As EventArgs) Handles ImgShow.Click + + + DrawImage() + End Sub + + Private Sub ClutShift_ValueChanged(sender As Object, e As EventArgs) Handles ClutShift.ValueChanged + DrawImage() + End Sub + + + Private Sub PNGimport_Click(sender As Object, e As EventArgs) Handles PNGimport.Click + OpenFileDialog1.Multiselect = True + If OpenFileDialog1.ShowDialog <> DialogResult.OK Then Exit Sub + OpenFileDialog1.Multiselect = False + If Not UserRadio.Checked Then MsgBox("YOU CAN IMPORT ONLY IN USER ISO!!!") : Exit Sub + + Dim s = New ScriptTools + Dim endfil = New List(Of Byte) + + For Each filee In OpenFileDialog1.FileNames + + Dim fileInfo = Split(Path.GetFileNameWithoutExtension(filee), "_") + Dim curFilePack As Integer = fileInfo(0) + Dim curFileIndexInPack As Integer = fileInfo(1) + Dim curFileSector As Integer = fileInfo(2) + Dim curFileRleID As Integer = fileInfo(3) + Debug.WriteLine("Importing... " & Path.GetFileNameWithoutExtension(filee)) + If curFilePack <> CDFileList.SelectedIndex Then MsgBox("Select File From CD and Proper file to import! IDs not equal!" & vbCrLf & filee, MsgBoxStyle.Critical) : Exit Sub + + + Dim fil = My.Computer.FileSystem.ReadAllBytes(OpenFileDialog1.FileName).ToList + + + + Dim curfile As rleFile = binFile(curFileIndexInPack) + + + + + Dim png = New pngImage + png.InitBitMap(filee) + Dim data = png.ParsePNGgetData(fil, curfile) + If data.Count = 0 Then MsgBox("ERROR! Returned EmptyData???") : Exit Sub + Dim rle = New rleTools + + + If curfile.Compr = 0 Then + endfil = rle.MakeUncompressedImage(data.ToArray, curfile) + Else + endfil = rle.decodeRLE2images(data.ToArray, curfile) + End If + If endfil.Count = 0 Then MsgBox("Import Error in file #" & curFileIndexInPack) : Exit Sub + binFile(curFileIndexInPack).Bytes = endfil.ToArray + + binFile(curFileIndexInPack).BytesAfter = 0 + + Next + + + 'АРХИВИРУЕМ МАССИВ ФАЙЛОВ ДЛЯ ЗАПИСИ В ОДИН ФАЙЛ + Dim lastSectorID As Integer = 0 + Dim finalPack = New List(Of Byte) + Dim addresses = New List(Of Integer) 'Start Addr for all files + + + For Each bin In binFile + + If Not IgnoreGaps.Checked Then + 'filling sector to end (making sectorgap) in the middle of the file + If bin.SectorID <> lastSectorID Then + Dim gap = 2048 - (finalPack.Count Mod 2048) + For g = 0 To gap - 1 + finalPack.Add(0) + Next + End If + End If + + + + + + 'adding currentfile and address for filetables + addresses.Add(finalPack.Count) + finalPack.AddRange(bin.Bytes) + + 'AddingBytesAfter + For g = 0 To bin.BytesAfter - 1 + finalPack.Add(0) + Next + + + 'checking crazy last 20 bytes on sector for file IN SUUMON AND DUNGEON TEXTS + Dim ffff = 2048 - (finalPack.Count Mod 2048) + If ffff <= 20 And ffff > 0 Then + For g = 1 To ffff + finalPack.Add(0) + Next + End If + + + lastSectorID = bin.SectorID + Next + + Dim packsize = finalPack.Count + + 'Fill file to END of Sector + If finalPack.Count Mod 2048 > 0 Then + For g = 1 To (2048 - (finalPack.Count Mod 2048)) + finalPack.Add(0) + Next g + End If + + 'checking filesize if inserting into ORIGINAL place + If Not TestImportSize(finalPack, packsize) Then Exit Sub + + 'UPDATING FILES TABLES + Select Case CDFileList.SelectedIndex + Case 682 + 'TITLE SCREENS IMPORT + MakePointersTable(addresses, files1(681).Sector, files1(681).Sizw, 50392) + + + + End Select + + + ' Exit Sub + + 'SaveFile To Sector + Dim cd = New ISOTools + cd.saveCDfile(UserPath.Text, importSector.Text, finalPack.Count, finalPack.ToArray) + + 'Update SectorNumber and FileSize In FileArray + files1(CDFileList.SelectedIndex).Sizw = finalPack.Count + files1(CDFileList.SelectedIndex).Sector = importSector.Text + + 'Update FileTable In ISO + cd.UpdateFileListTable(UserPath.Text, files1) + + + 'Done + MsgBox(String.Format("Imported {0} images in {1} - {2} bytes", UBound(OpenFileDialog1.FileNames) + 1, CDFileList.SelectedIndex, finalPack.Count), MsgBoxStyle.Exclamation) + + + End Sub + + Private Sub BackgroundWorker1_ProgressChanged(sender As Object, e As ProgressChangedEventArgs) Handles BackgroundWorker1.ProgressChanged + + End Sub + + Private Sub TitlesLoad_Click(sender As Object, e As EventArgs) Handles TitlesLoad.Click + Dim iso = New ISOTools + Dim fil = iso.getCDfile(UserPath.Text, files1(1126).Sector, files1(1126).Sizw) + Dim reader As Integer = 13804 + Dim lastByte = 16253 + + TGrid.Rows.Clear() + Dim accum = "" + Do + + Select Case fil(reader) + Case 128 + TGrid.Rows.Add(accum) + accum = "" + GoTo Endd + Case 129 + accum &= " " + GoTo Endd + Case > 127 + accum &= "[C=" & fil(reader) - 128 & "]" + GoTo Endd + Case <= 26 + accum &= Chr(fil(reader) + 64) + GoTo Endd + Case <= 52 + accum &= Chr(fil(reader) + 70) + Case 59 + + TGrid.Rows.Add("------") + Case Else + accum &= "[B=" & fil(reader) & "]" + End Select + +Endd: + + + reader += 1 + Loop While TGrid.Rows.Count < 172 + 'TGrid.Rows.Add(accum) + + + End Sub + + Private Sub SaveTitles_Click(sender As Object, e As EventArgs) Handles SaveTitles.Click + Dim iso = New ISOTools + Dim fil = iso.getCDfile(UserPath.Text, files1(1126).Sector, files1(1126).Sizw) + Dim scr = New ScriptTools + Dim writer As Integer = 13804 + Dim lastByte = 16253 + Dim adresses = New List(Of Integer) + Dim bytes = New List(Of Byte) + + For Each row In TGrid.Rows + + If row.Cells(0).Value = "------" Then bytes.Add(59) : Continue For + adresses.Add(bytes.Count + 668) + Dim cur As String = row.Cells(0).Value + + For a = 0 To cur.Length - 1 + If cur(a) = "[" Then + Dim str() = Split(scr.getFromSkobki(cur, a), "=") + If str(0) = "B" Then bytes.Add(Convert.ToByte(str(1))) + If str(0) = "C" Then bytes.Add(Convert.ToByte(str(1) + 128)) + 'If a = cur.Length Then Continue For + a = a - 1 + Continue For + End If + If cur(a) = " " Then bytes.Add(129) + If Asc(cur(a)) >= 97 And Asc(cur(a)) <= 122 Then bytes.Add(Asc(cur(a)) - 70) + If Asc(cur(a)) >= 65 And Asc(cur(a)) <= 90 Then bytes.Add(Asc(cur(a)) - 64) + Next + bytes.Add(128) + Next + If (lastByte - writer - bytes.Count) < 0 Then + MsgBox("Error. Not enought bytes = " & (lastByte - 13804 - bytes.Count)) + Exit Sub + End If + + For a = 0 To bytes.Count - 1 + fil(a + writer) = bytes(a) + Next + + 'RefTable + For a = 0 To 163 + fil(13148 + a * 4) = BitConverter.GetBytes(adresses(a))(0) + fil(13149 + a * 4) = BitConverter.GetBytes(adresses(a))(1) + Next + + + iso.saveCDfile(UserPath.Text, files1(1126).Sector, files1(1126).Sizw, fil.Toarray) + + 'Dim filnam As String = "D:\Games\PSX\Persona.2.Innocent.Sin\Export\1126_TITLES\Titles.bin" + 'My.Computer.FileSystem.WriteAllBytes(filnam, bytes.ToArray, False) + End Sub + + Private Sub LoadTitles_Click(sender As Object, e As EventArgs) Handles LoadTitles.Click + Dim filnam As String = "D:\Games\PSX\Persona.2.Innocent.Sin\Export\1126_TITLES\Titles.txt" + + Dim txt = Split(My.Computer.FileSystem.ReadAllText(filnam), vbCrLf) + ReDim Preserve txt(TGrid.Rows.Count - 1) + + + + For Each row In TGrid.Rows + + row.Cells(0).Value = txt(TGrid.Rows.IndexOf(row)) + Next + End Sub + + Private Sub SaveTit_Click(sender As Object, e As EventArgs) Handles SaveTit.Click + Dim filnam As String = "D:\Games\PSX\Persona.2.Innocent.Sin\Export\1126_TITLES\Titles.txt" + + Dim txt As String = "" + + For Each row In TGrid.Rows + Dim aaa = TGrid.CurrentCell + If IsNothing(row.Cells(0).Value) Then MsgBox("Error reading tgable! Pleasem, resave!") : Exit Sub + txt += row.Cells(0).Value.ToString & vbCrLf + Next + + + My.Computer.FileSystem.WriteAllText(filnam, txt, False) + End Sub + + Private Sub CDLoadSortedFiles_Click(sender As Object, e As EventArgs) Handles CDLoadSortedFiles.Click + CDGrid.Rows.Clear() + + Dim filesSorted = New List(Of fileInfo) + Dim SectorType = 2048 + If IsNothing(files1) Then ReadCDFileTable.PerformClick() + + For Each fl In files1 + filesSorted.Add(fl) + Next + + filesSorted.Sort(Function(x, y) x.Sector.CompareTo(y.Sector)) + + For Each f In filesSorted + + If f.FileID >= 865 And f.FileID <= 879 Then SectorType = 2352 Else SectorType = 2048 + + Dim sectSize As Integer = f.Sizw \ SectorType + Dim sizeadd = "" + If f.Sizw Mod SectorType > 0 Then sectSize += 1 : If sectSize > 1 Then sizeadd = " + " & f.Sizw Mod SectorType + + Dim curFil = CDGrid.Rows.Count + + Dim secGap = 0 + If curFil < 880 Then 'calculating sectors gap between files + secGap = filesSorted(curFil + 1).Sector - f.Sector - sectSize + End If + Dim printsize = f.Sizw + If sectSize > 1 Then printsize = sectSize * SectorType : If sizeadd <> "" Then printsize -= SectorType + CDGrid.Rows.Add(f.FileID.ToString("D4"), f.Sector, printsize & sizeadd & "b", sectSize, f.Sector + sectSize - 1, secGap) + If secGap > 0 Then CDGrid.Rows(curFil).Cells(5).Style.BackColor = Color.DarkGreen + If SectorType > 2048 Then + For Each col In CDGrid.Rows(curFil).Cells + col.Style.BackColor = Color.DarkRed + Next + End If + + Next + + End Sub + + Private Sub SortCDFiles_Click(sender As Object, e As EventArgs) Handles SortCDFiles.Click + + If MsgBox("TOCHNO???? Continue??", MsgBoxStyle.YesNo) <> MsgBoxResult.Yes Then Exit Sub + + + Dim a1 = 0, a2 = 0 + Dim iso = New ISOTools + If RadioSort1.Checked Then a1 = 0 : a2 = 864 + + + For a = a1 To a2 + files1(a).Data = iso.getCDfile(UserPath.Text, files1(a).Sector, files1(a).Sizw) + Next + + 'init + Dim curSector = 939 + Dim max = 166072 + + Dim filnam = UserPath.Text + + For a = a1 To a2 + + Debug.WriteLine("Working On......" & a.ToString("D4")) + Dim SectorSizw As Integer = (files1(a).Data.Count) \ 2048 + + Select Case a + Case a > 269, a < 285 + files1(a).Sector = files1(268).Sector + + End Select + + + + If files1(a).Data.Count Mod 2048 > 0 Then SectorSizw += 1 + If curSector + SectorSizw > max Then MsgBox("NE LEZET!!! OVERLOAD at file " & a) : Exit For + iso.saveCDfile(filnam, curSector, files1(a).Data.Count, files1(a).Data.ToArray) + 'Update SectorNumber In FileArray + 'files1(a).Sizw = files1(a).Sizw + files1(a).Sector = curSector + + 'If a = 577 Then curSector += 5 + + curSector += SectorSizw + + Next + + iso.UpdateFileListTable(filnam, files1) + + MsgBox("Files Sorted") + + End Sub + + Private Sub conv3D_Click(sender As Object, e As EventArgs) Handles conv3D.Click + Dim o = New convEventToObj + + o.Show() + End Sub + + Private Sub GenChars_Click(sender As Object, e As EventArgs) Handles GenChars.Click + Dim maxcols = 12 + Dim txt = "" + Dim blockId = 0 + Dim blockline = 0 + Dim lineChar = 0 + For a = 0 To 3000 + Dim x As Integer = a Mod 256 + Dim y As Integer = Math.Floor(a / 256) + txt &= x.ToString("X2") & y.ToString("X2") + If lineChar > maxcols Then + If blockline = 21 Then blockline = 0 : blockId += 1 + If blockline = 0 Then Debug.WriteLine(blockId & " ===========================================") + blockline += 1 + lineChar = 0 + Debug.WriteLine(txt) + txt = "" + Continue For + End If + lineChar += 1 + Next + End Sub + + Private Sub CharCodeGenerator_Click(sender As Object, e As EventArgs) Handles CharCodeGenerator.Click + Dim w = New JapCharCodeGenerator + w.Show() + End Sub + + Private Sub ParseEvent_Click(sender As Object, e As EventArgs) Handles ParseEvent.Click + If OpenFileDialog1.ShowDialog <> DialogResult.OK Then Exit Sub + Dim s = New ScriptTools + s.ParseScript(OpenFileDialog1.FileName) + End Sub + + +End Class + + +Public Class fileInfo + + Public FileID As Integer + Public Sector As Integer + Public Sizw As Integer + Public Data As List(Of Byte) + Public Descript As String +End Class + + +Public Class rleFile + Public SectorID As Integer + Public ID As Integer + Public Type As Byte '/* 0=eof, 1=data, 2=image */ + Public Compr As Byte '/* 0=none, 1=rle, 2=lzss */ + Public w, h, x, y As Int16 + Public Size As Integer + Public UnpackSize As Integer + Public Mode As Byte + Public Bytes() As Byte + Public BytesAfter As Integer + Public SectorGap As Integer + Public SectorSize As Integer +End Class \ No newline at end of file diff --git a/p2isPSX_CDToolkit/Form2.Designer.vb b/p2isPSX_CDToolkit/Form2.Designer.vb new file mode 100644 index 0000000..489df61 --- /dev/null +++ b/p2isPSX_CDToolkit/Form2.Designer.vb @@ -0,0 +1,94 @@ + _ +Partial Class ScriptParserWin + Inherits System.Windows.Forms.Form + + 'Форма переопределяет dispose для очистки списка компонентов. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Является обязательной для конструктора форм Windows Forms + Private components As System.ComponentModel.IContainer + + 'Примечание: следующая процедура является обязательной для конструктора форм Windows Forms + 'Для ее изменения используйте конструктор форм Windows Form. + 'Не изменяйте ее в редакторе исходного кода. + _ + Private Sub InitializeComponent() + Me.TextBox1 = New System.Windows.Forms.TextBox() + Me.ScriptVarCalculated = New System.Windows.Forms.TextBox() + Me.ScriptVarAddr = New System.Windows.Forms.TextBox() + Me.Button2 = New System.Windows.Forms.Button() + Me.SuspendLayout() + ' + 'TextBox1 + ' + Me.TextBox1.BackColor = System.Drawing.Color.Black + Me.TextBox1.Font = New System.Drawing.Font("Courier New", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.TextBox1.ForeColor = System.Drawing.Color.FromArgb(CType(CType(192, Byte), Integer), CType(CType(192, Byte), Integer), CType(CType(255, Byte), Integer)) + Me.TextBox1.Location = New System.Drawing.Point(13, 12) + Me.TextBox1.Multiline = True + Me.TextBox1.Name = "TextBox1" + Me.TextBox1.ScrollBars = System.Windows.Forms.ScrollBars.Both + Me.TextBox1.Size = New System.Drawing.Size(1291, 1312) + Me.TextBox1.TabIndex = 0 + Me.TextBox1.WordWrap = False + ' + 'ScriptVarCalculated + ' + Me.ScriptVarCalculated.Location = New System.Drawing.Point(1036, 1330) + Me.ScriptVarCalculated.Name = "ScriptVarCalculated" + Me.ScriptVarCalculated.Size = New System.Drawing.Size(268, 20) + Me.ScriptVarCalculated.TabIndex = 27 + ' + 'ScriptVarAddr + ' + Me.ScriptVarAddr.Location = New System.Drawing.Point(545, 1330) + Me.ScriptVarAddr.Name = "ScriptVarAddr" + Me.ScriptVarAddr.Size = New System.Drawing.Size(204, 20) + Me.ScriptVarAddr.TabIndex = 26 + ' + 'Button2 + ' + Me.Button2.ForeColor = System.Drawing.Color.Black + Me.Button2.Location = New System.Drawing.Point(755, 1330) + Me.Button2.Name = "Button2" + Me.Button2.Size = New System.Drawing.Size(276, 22) + Me.Button2.TabIndex = 25 + Me.Button2.Text = "Calculate Script Var Addr" + Me.Button2.UseVisualStyleBackColor = True + ' + 'ScriptParserWin + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.BackColor = System.Drawing.Color.Gray + Me.ClientSize = New System.Drawing.Size(1316, 1362) + Me.Controls.Add(Me.ScriptVarCalculated) + Me.Controls.Add(Me.ScriptVarAddr) + Me.Controls.Add(Me.Button2) + Me.Controls.Add(Me.TextBox1) + Me.ForeColor = System.Drawing.Color.FromArgb(CType(CType(224, Byte), Integer), CType(CType(224, Byte), Integer), CType(CType(224, Byte), Integer)) + Me.MaximizeBox = False + Me.MinimizeBox = False + Me.Name = "ScriptParserWin" + Me.ShowIcon = False + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen + Me.Text = "ScriptParser" + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + + Friend WithEvents TextBox1 As TextBox + Friend WithEvents ScriptVarCalculated As TextBox + Friend WithEvents ScriptVarAddr As TextBox + Friend WithEvents Button2 As Button +End Class diff --git a/p2isPSX_CDToolkit/Form2.resx b/p2isPSX_CDToolkit/Form2.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/p2isPSX_CDToolkit/Form2.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/p2isPSX_CDToolkit/Form2.vb b/p2isPSX_CDToolkit/Form2.vb new file mode 100644 index 0000000..5382200 --- /dev/null +++ b/p2isPSX_CDToolkit/Form2.vb @@ -0,0 +1,23 @@ + +Imports System.Runtime.Remoting.Metadata.W3cXsd2001 + +Public Class ScriptParserWin + Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click + Dim addr As Integer + + 'ScriptVarAddr.Text = ScriptVarAddr.Text.ToString("X4") + + + Try + Dim addrArr = SoapHexBinary.Parse(ScriptVarAddr.Text).Value + addr = addrArr(0) * 256 + addrArr(1) + Catch ex As Exception + MsgBox("error") : Exit Sub + End Try + + Dim blockNum = addr >> 5 + Dim bits As String = (1 << (addr And &H1F)).ToString("X8") + Dim revBits = bits.Substring(6, 2) & bits.Substring(4, 2) & bits.Substring(2, 2) & bits.Substring(0, 2) + ScriptVarCalculated.Text = "Blk Addr: " & (&H800820E0 + blockNum * 4).ToString("X8") & " | Onbyt: " & revBits + End Sub +End Class \ No newline at end of file diff --git a/p2isPSX_CDToolkit/ISOTools.vb b/p2isPSX_CDToolkit/ISOTools.vb new file mode 100644 index 0000000..f0662d5 --- /dev/null +++ b/p2isPSX_CDToolkit/ISOTools.vb @@ -0,0 +1,157 @@ +Imports System +Imports System.IO + +Public Class ISOTools + + Public Function getCDfile(ByVal ISOname As String, ByVal StartSector As Integer, ByVal FileSize As Integer) + + + Dim fileArr = New List(Of Byte) + Dim fs As New FileStream(ISOname, FileMode.Open, FileAccess.Read) + Dim br As New BinaryReader(fs) + + + If Not Form1.Mode2352.Checked Then + + + Dim SectorsToRead As Integer = FileSize \ 2048 + If FileSize Mod 2048 > 0 Then SectorsToRead += 1 + + Dim bytesToread = 2048 + + For a = StartSector To SectorsToRead + StartSector - 1 + + Dim bytepos = a * &H930 + 24 + br.BaseStream.Position = bytepos + fileArr.AddRange(br.ReadBytes(2048)) + + Next + + + + Else + + ''''''''''READ RAW FILE WITH 2352 MODE! + + br.BaseStream.Position = StartSector * &H930 + fileArr.AddRange(br.ReadBytes(FileSize)) + + + End If + + br.Dispose() + fs.Dispose() + + Return fileArr + + End Function + + + Public Function saveCDfile(ByVal ISOname As String, ByVal StartSector As Integer, ByVal FileSize As Integer, ByRef bytes As Byte()) + Try + + + Dim fs As New FileStream(ISOname, FileMode.Open, FileAccess.Write) + Dim br As New BinaryWriter(fs) + + If Not Form1.Mode2352.Checked Then + + + + Dim SectorsToWrite As Integer = FileSize \ 2048 + If FileSize Mod 2048 > 0 Then + SectorsToWrite += 1 + ReDim Preserve bytes(FileSize + (2048 - (FileSize Mod 2048))) + End If + + Dim bytecounter = 0 + + For a = StartSector To SectorsToWrite + StartSector - 1 + + Dim bytepos = a * &H930 + 24 + + br.BaseStream.Position = bytepos + + br.Write(bytes, bytecounter, 2048) + bytecounter += 2048 + + Next + + + + Else ''''''''''READ RAW FILE WITH 2352 MODE! + + + + + br.BaseStream.Position = StartSector * &H930 + br.Write(bytes, 0, FileSize) + + + End If + + + + br.Dispose() + fs.Dispose() + + + Catch ex As Exception + MsgBox("Error! Exception: " & vbCrLf & ex.ToString, MsgBoxStyle.Critical) + End Try + End Function + + Public Sub UpdateFileListTable(ByVal ISOname As String, ByRef fileInf As List(Of fileInfo)) + + Dim tab = New List(Of Byte) + + For Each fil In fileInf + tab.AddRange(BitConverter.GetBytes(fil.Sector).ToList) + tab.AddRange(BitConverter.GetBytes(fil.Sizw).ToList) + Next + saveCDfile(ISOname, &H17, &H1B88, tab.ToArray) + + + End Sub + + Public Function makeFileList(ByVal ISOname As String) + Dim a = New List(Of fileInfo) + + Dim FilesSectors = getCDfile(ISOname, &H17, &H1B88).ToArray + If ISOname.Contains("KUDOS") Then FilesSectors = getCDfile(ISOname, &H31, &H1B88).ToArray + + For x = 0 To 880 + a.Add(New fileInfo With {.FileID = x, .Sector = Form1.Read32bitNum(FilesSectors, x * 8), .Sizw = Form1.Read32bitNum(FilesSectors, x * 8 + 4)}) + Next + + Return a + End Function + + + Public Sub ReallocateDown(ByVal ISOname As String, ByRef fileInf As List(Of fileInfo), ByVal StartFile As Integer, ByVal BySectors As Integer) + + + + + 'Dim lastSector = fileInf.Last.Sector + (fileInf.Last.Sizw \ 2048) + 'If fileInf.Last.Sizw Mod 2048 > 0 Then lastSector += 1 + + + 'For a = lastSector To fileInf(StartFile).Sector Step -1 + + + + + 'Next + + + ''Reading eachFile from end and Save it +Bysectors + 'For a = 1143 To StartFile Step -1 + ' fileInf(a).Sector += BySectors + 'Next + ''UpdateFileListTable(ISOname, fileInf) + + End Sub + + +End Class diff --git a/p2isPSX_CDToolkit/JapCharCodeGenerator.Designer.vb b/p2isPSX_CDToolkit/JapCharCodeGenerator.Designer.vb new file mode 100644 index 0000000..a25bd12 --- /dev/null +++ b/p2isPSX_CDToolkit/JapCharCodeGenerator.Designer.vb @@ -0,0 +1,92 @@ + _ +Partial Class JapCharCodeGenerator + Inherits System.Windows.Forms.Form + + 'Форма переопределяет dispose для очистки списка компонентов. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Является обязательной для конструктора форм Windows Forms + Private components As System.ComponentModel.IContainer + + 'Примечание: следующая процедура является обязательной для конструктора форм Windows Forms + 'Для ее изменения используйте конструктор форм Windows Form. + 'Не изменяйте ее в редакторе исходного кода. + _ + Private Sub InitializeComponent() + Me.TextBox1 = New System.Windows.Forms.TextBox() + Me.TextBox2 = New System.Windows.Forms.TextBox() + Me.Button1 = New System.Windows.Forms.Button() + Me.Button2 = New System.Windows.Forms.Button() + Me.SuspendLayout() + ' + 'TextBox1 + ' + Me.TextBox1.Font = New System.Drawing.Font("Lucida Sans Typewriter", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.TextBox1.Location = New System.Drawing.Point(1216, 12) + Me.TextBox1.Multiline = True + Me.TextBox1.Name = "TextBox1" + Me.TextBox1.ScrollBars = System.Windows.Forms.ScrollBars.Vertical + Me.TextBox1.Size = New System.Drawing.Size(275, 663) + Me.TextBox1.TabIndex = 0 + ' + 'TextBox2 + ' + Me.TextBox2.Font = New System.Drawing.Font("Lucida Sans Typewriter", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.TextBox2.Location = New System.Drawing.Point(12, 12) + Me.TextBox2.Multiline = True + Me.TextBox2.Name = "TextBox2" + Me.TextBox2.ScrollBars = System.Windows.Forms.ScrollBars.Vertical + Me.TextBox2.Size = New System.Drawing.Size(1198, 663) + Me.TextBox2.TabIndex = 0 + ' + 'Button1 + ' + Me.Button1.Location = New System.Drawing.Point(382, 694) + Me.Button1.Name = "Button1" + Me.Button1.Size = New System.Drawing.Size(121, 23) + Me.Button1.TabIndex = 1 + Me.Button1.Text = "Generate >>>>" + Me.Button1.UseVisualStyleBackColor = True + ' + 'Button2 + ' + Me.Button2.Location = New System.Drawing.Point(569, 694) + Me.Button2.Name = "Button2" + Me.Button2.Size = New System.Drawing.Size(75, 23) + Me.Button2.TabIndex = 2 + Me.Button2.Text = "Save!" + Me.Button2.UseVisualStyleBackColor = True + ' + 'JapCharCodeGenerator + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(1503, 729) + Me.Controls.Add(Me.Button2) + Me.Controls.Add(Me.Button1) + Me.Controls.Add(Me.TextBox2) + Me.Controls.Add(Me.TextBox1) + Me.MaximizeBox = False + Me.MinimizeBox = False + Me.Name = "JapCharCodeGenerator" + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen + Me.Text = "JapCharCodeGenerator" + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + + Friend WithEvents TextBox1 As TextBox + Friend WithEvents TextBox2 As TextBox + Friend WithEvents Button1 As Button + Friend WithEvents Button2 As Button +End Class diff --git a/p2isPSX_CDToolkit/JapCharCodeGenerator.resx b/p2isPSX_CDToolkit/JapCharCodeGenerator.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/p2isPSX_CDToolkit/JapCharCodeGenerator.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/p2isPSX_CDToolkit/JapCharCodeGenerator.vb b/p2isPSX_CDToolkit/JapCharCodeGenerator.vb new file mode 100644 index 0000000..1f6d081 --- /dev/null +++ b/p2isPSX_CDToolkit/JapCharCodeGenerator.vb @@ -0,0 +1,54 @@ +Public Class JapCharCodeGenerator + + Public allText As String + Public curBlock As Integer + Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click + allText = "" + TextBox2.Text = "Dim chars = New List(Of String)" & vbCrLf + 'TextBox2.Text = "d.AddRange({""a"", ""b"", ""c"", ""d""})" + + curBlock = 0 + + Dim accum = "" + Dim t = TextBox1.Text + Dim x = 0 + Do + If (t(x) = vbCr And t(x + 1) = vbLf) Or x = t.Length - 1 Then + generateline(accum) + accum = "" + x += 2 + Continue Do + End If + + accum &= t(x) + x += 1 + + Loop While x < t.Length - 2 + + + TextBox2.Text = allText + End Sub + + Public Sub generateline(accum) + + If accum = "---" Then allText &= " 'Block " & curBlock & vbCrLf : curBlock += 1 : Exit Sub + + + allText &= "chars.AddRange({" + For a = 0 To accum.Length - 1 + + allText &= """" & accum(a) & """" + If a <> accum.Length - 1 Then allText &= ", " + Next + allText &= "}) '" & accum.Length & vbCrLf + + End Sub + + Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click + Dim f = "D:\Games\PSX\Persona 2 - Batsu (NTSC-J) [SLPS-02825]\Export\FontCode\AtlusFontAppend.vb" + Dim f2 = "D:\Games\PSX\Persona 2 - Batsu (NTSC-J) [SLPS-02825]\Export\FontCode\codes_source.txt" + My.Computer.FileSystem.WriteAllText(f2, TextBox1.Text, False) + My.Computer.FileSystem.WriteAllText(f, TextBox2.Text, False) + + End Sub +End Class \ No newline at end of file diff --git a/p2isPSX_CDToolkit/JapChars.vb b/p2isPSX_CDToolkit/JapChars.vb new file mode 100644 index 0000000..c955579 --- /dev/null +++ b/p2isPSX_CDToolkit/JapChars.vb @@ -0,0 +1,230 @@ +Partial Class Form1 + + Public Sub LoadChars() + + chars = New List(Of Char) + 'Block 0 + chars.AddRange({"「", "」", "、", "・", "零", "一", "二", "三", "四", "五", "六", "七", "八", "九"}) '14 + chars.AddRange({"十", "あ", "い", "う", "え", "お", "か", "き", "く", "け", "こ", "さ", "し", "す"}) '14 + chars.AddRange({"せ", "そ", "た", "ち", " ", "!", """", "#", "$", "%", "&", "'", "(", ")"}) '14 + chars.AddRange({"*", "+", ",", "-", ".", "/", "0", "1", "2", "3", "4", "5", "6", "7"}) '14 + chars.AddRange({"8", "9", ":", ";", "<", "=", ">", "?", "@", "A", "B", "C", "D", "E"}) '14 + chars.AddRange({"F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S"}) '14 + chars.AddRange({"T", "U", "V", "W", "X", "Y", "Z", "[", "¥", "]", " ", "_", "'", "a"}) '14 + chars.AddRange({"b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o"}) '14 + chars.AddRange({"p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "{", "|", "}"}) '14 + chars.AddRange({"_", "。", "覧", "酒", "ケ", "ン", "回", "を", "見", "る", "~", "ん", "課", "長"}) '14 + chars.AddRange({"代", "理", "以", "上", "は", "タ", "イ", "ム", "カ", "ー", "ド", "廃", "止", "接"}) '14 + chars.AddRange({"待", "で", "飲", "翌", "日", "つ", "ら", "前", "死", "ね", "デ", "バ", "ッ", "グ"}) '14 + chars.AddRange({"テ", "ス", "ト", "に", "て", "と", "仕", "置", "れ", "げ", "主", "人", "公", "じ"}) '14 + chars.AddRange({"ゃ", "が", "ラ", "メ", "食", "過", "ぎ", "腹", "わ", "よ", "ゲ", "リ", "ピ", "マ"}) '14 + chars.AddRange({"ク", "口", "な", "の", "早", "朝", "フ", "レ", "退", "社", "蛇", "苺", "紅", "茶"}) '14 + chars.AddRange({"キ", "サ", "本", "当", "嬉", "·", "モ", "ナ", "共", "生", "だ", "ア", "ど", "探"}) '14 + chars.AddRange({"み", "エ", "ル", "存", "道", "出", "来", "ば", "手", "伝", "無", "っ", "水", "都"}) '14 + chars.AddRange({"ろ", "自", "分", "何", "り", "も", "素", "晴", "俺", "遠", "恵", "ぜ", "私", "ま"}) '14 + chars.AddRange({"時", "老", "緒", "へ", "行", "兄", "彼", "女", "守", "ょ", "術", "世", "界", "身"}) '14 + chars.AddRange({"他", "方", "法", "異", "端", "者", "や", "血", "争", "ひ", "大", "丈", "夫", "戦"}) '14 + chars.AddRange({"闘", "開", "始", "動", "設", "定", "コ", "ズ", "ィ", "却", "工", "事", "中", "攻"}) '14 + 'Block 1 + chars.AddRange({"撃", "魔", "ペ", "ソ", "防", "御", "舞", "耶", "淳", "ミ", "シ", "ェ", "ギ", "ユ"}) '14 + chars.AddRange({"ブ", "オ", "ダ", "ハ", "軣", "編", "僕", "買", "今", "半", "下", "め", "言", "損"}) '14 + chars.AddRange({"ず", "利", "用", "ぁ", "警", "団", "少", "铪", "料", "木", "夢", "ぇ", "取", "未"}) '14 + chars.AddRange({"精", "神", "持", "安", "心", "坂", "君", "文", "句", "間", "慟", "ぐ", "ふ", "怒"}) '14 + chars.AddRange({"触", "正", "直", "真", "傷", "藥", "次", "元", "消", "ゴ", "ガ", "仙", "桃", "宝"}) '14 + chars.AddRange({"玉", "チ", "ュ", "ウ", "卵", "ヒ", "ヤ", "地", "返", "反", "魂", "香", "崖", "縁"}) '14 + chars.AddRange({"粉", "末", "陣", "背", "解", "毒", "剤", "镇", "静", "パ", "幣", "升", "麻", "ジ"}) '14 + chars.AddRange({"セ", "封", "節", "逃", "銀", "二", "ャ", "懸", "肖", "鐘", "効", "果", "味", "量"}) '14 + chars.AddRange({"復", "使", "可", "能", "全", "最", "值", "亡", "猛", "狂", "暴", "幻", "影", "睡"}) '14 + chars.AddRange({"眠", "憑", "依", "的", "有", "読", "字", "ご", "移", "物", "射", "吸", "収", "避"}) '14 + chars.AddRange({"聖", "暗", "黒", "化", "応", "蒜", "音", "楽", "箱", "敵", "現", "率", "抑", "個"}) '14 + chars.AddRange({"X", "数", "哉", "漢", "枣", "叱", "举", "芝", "逹", "悪", "名", "表", "示", "説"}) '14 + chars.AddRange({"得", "語", "目", "殺", "ビ", "相", "談", "親", "子", "踊", "恋", "愛", "悩", "酔"}) '14 + chars.AddRange({"場", "切", "歌", "諭", "撮", "甘", "星", "占", "花", "ボ", "燃", "男", "ツ", "プ"}) '14 + chars.AddRange({"詰", "合", "視", "線", "ザ", "笑", "良", "居", "激", "写", "様", "議", "惑", "調"}) '14 + chars.AddRange({"べ", "誕", "光", "失", "畋", "性", "へ", "対", "象", "選", "択", "掛", "契", "約"}) '14 + chars.AddRange({"破", "栾", "戻", "ネ", "機", "诬", "熱", "送", "気", "急", "异", "ァ", "顥", "姉"}) '14 + chars.AddRange({"聞", "配", "ぞ", "絆", "強", "父", "母", "孝", "凄", "ワ", "ゅ", "ヨ", "家", "族"}) '14 + chars.AddRange({"林", "寺", "污", "好", "振", "向", "帝", "初", "覚", "会", "忘", "ぶ", "胸", "苦"}) '14 + chars.AddRange({"お", "う", "美", "罪", "オ", "許", "ウ", "ノ", "故", "ベ", "腰", "指", "瞳", "抱"}) '14 + chars.AddRange({"欲", "奴", "体", "驅", "訳", "話", "風", "情", "粋", "昔", "ヴ", "感", "贈", "受"}) '14 + 'Block 2 + chars.AddRange({"曲", "ゆ", "価", "意", "志", "決", "違", "考", "位", "寝", "多", "思", "黙", "入"}) '14 + chars.AddRange({"ぱ", "歯", "落", "番", "不", "器", "顔", "須", "牡", "羊", "座", "義", "勇", "猪"}) '14 + chars.AddRange({"突", "進", "型", "牛", "堅", "実", "派", "忍", "耐", "双", "頭", "転", "速", "交"}) '14 + chars.AddRange({"奇", "旺", "盛", "面", "飽", "ぼ", "天", "屋", "費", "む", "獅", "流", "嗜", "労"}) '14 + chars.AddRange({"厭", "寂", "乙", "繊", "細", "完", "璧", "潔", "癖", "症", "批", "判", "厳", "秤"}) '14 + chars.AddRange({"庸", "柔", "断", "蠍", "秘", "密", "鋭", "洞", "察", "力", "倍", "慎", "重", "屈"}) '14 + chars.AddRange({"絶", "成", "功", "山", "第", "標", "努", "積", "瓶", "論", "科", "学", "客", "観"}) '14 + chars.AddRange({"独", "比", "類", "博", "左", "右", "同", "想", "必", "叶", "信", "ぬ", "赤", "似"}) '14 + chars.AddRange({"髙", "ポ", "込", "付", "恐", "確", "及", "恥", "度", "雑", "詰", "特", "集", "足"}) '14 + chars.AddRange({"記", "校", "答", "色", "總", "臣", "賣", "問", "周", "饒", "舌", "所", "知", "準"}) '14 + chars.AddRange({"備", "倒", "喋", "期", "枚", "甕", "永", "残", "ほ", "疇", "誰", "離", "加", "揮"}) '14 + chars.AddRange({"声", "聴", "皆", "歳", "若", "粧", "教", "室", "講", "師", "瞭", "綺", "露", "負"}) '14 + chars.AddRange({"週", "春", "超", "球", "口", "先", "士", "栄", "吉", "審", "頃", "邪", "仮", "党"}) '14 + chars.AddRange({"供", "包", "小", "悲", "ゼ", "訴", "任", "垚", "白", "々", "誤", "貴", "愉", "快"}) '14 + chars.AddRange({"変", "礼", "差", "関", "宜", "帚", "後", "悔", "惮", "千", "万", "円", "我", "慢"}) '14 + chars.AddRange({"癒", "葉", "巨", "蟹", "宮", "徴", "保", "護", "去", "順", "産", "排", "臆", "病"}) '14 + chars.AddRange({"題", "明", "活", "健", "康", "雰", "囲", "然", "噂", "武", "具", "飛", "曰", "野"}) '14 + chars.AddRange({"裕", "郎", "照", "電", "輝", "南", "澄", "騙", "限", "O", "池", "髑", "髏", "晶"}) '14 + chars.AddRange({"火", "属", "躊", "路", "尊", "散", "憐", "追", "憧", "書", "歓", "び", "喜", "厚"}) '14 + chars.AddRange({"謎", "注", "炎", "予", "告", "通", "焦", "塩", "期", "案", "運", "幅", "富", "潮"}) '14 + chars.AddRange({"外", "腕", "計", "煙", "草", "壞", "雇", "缶", "札", "駄", "桐", "ヨ", "件", "首"}) '14 + 'Block 3 + chars.AddRange({"金", "曜", "部", "普", "太", "連", "支", "扎", "掃", "除", "ぼ", "満", "ヂ", "寸"}) '14 + chars.AddRange({"疑", "状", "渡", "姓", "書", "企", "い", "架", "宿", "命", "艦", "囚", "鳥", "嵐"}) '14 + chars.AddRange({"荒", "波", "浮", "拐", "ぎ", "招", "級", "朋", "続", "呼", "塗", "店", "並", "劣"}) '14 + chars.AddRange({"孤", "鎖", "哀", "堕", "杯", "息", "薏", "簡", "单", "仲", "脅", "迫", "弜", "難"}) '14 + chars.AddRange({"章", "呪", "材", "算", "由", "づ", "立", "幕", "助", "泣", "溶", "偶", "戒", "緊"}) '14 + chars.AddRange({"般", "禁", "宙", "監", "督", "ぴ", "群", "埋", "識", "放", "貌", "困", "内", "頼"}) '14 + chars.AddRange({"扱", "念", "新", "辱", "組", "罠", "佐", "木", "申", "渉", "権", "勝", "増", "迢"}) '14 + chars.AddRange({"鷙", "作", "壁", "徒", "垚", "憧", "蓮", "華", "台", "平", "区", "崎", "港", "蝸"}) '14 + chars.AddRange({"带", "園", "祭", "狙", "年", "休", "乓", "脱", "起", "冝", "補", "欠", "妹", "珠"}) '14 + chars.AddRange({"阯", "市", "打", "経", "抜", "納", "練", "習", "改", "造", "務", "魬", "淯", "怪"}) '14 + chars.AddRange({"路", "奪", "資", "格", "磁", "常", "月", "乗", "冴", "鳴", "羅", "門", "石", "近"}) '14 + chars.AddRange({"響", "勒", "妙", "著", "像", "婔", "発", "別", "毛", "災", "谷", "議", "験", "階"}) '14 + chars.AddRange({"職", "氿", "編", "赴", "譲", "横", "割", "壳", "卒", "業", "式", "降", "態", "険"}) '14 + chars.AddRange({"痴", "黛", "臨", "紀", "救", "忠", "寡", "訣", "己", "紹", "介", "覆", "辺", "広"}) '14 + chars.AddRange({"係", "危", "引", "街", "涙", "布", "密", "例", "証", "役", "ペ", "遊", "町", "勘"}) '14 + chars.AddRange({"原", "因", "究", "劇", "留", "驱", "深", "疲", "銃", "痛", "狭", "携", "儀", "臭"}) '14 + chars.AddRange({"固", "品", "ゾ", "要", "詳", "則", "村", "試", "罰", "步", "洋", "汝", "述", "掟"}) '14 + chars.AddRange({"形", "源", "貰", "終", "了", "劫", "冗", "馬", "鹿", "謇", "望", "与", "車", "輪"}) '14 + chars.AddRange({"導", "謝", "怨", "肉", "殻", "朽", "虫", "震", "哭", "寛", "容", "霜", "讐", "ヌ"}) '14 + chars.AddRange({"兵", "錵", "英", "称", "嘲", " ", "霊", "呆", "戚", "杏", "奈", "藤", "槍", "騎"}) '14 + chars.AddRange({"微", "攝", "痩", "制", "服", "盗", "住", "東", "亜", " ", "倫", "敦", "柊", "季"}) '14 + 'Block 4 + chars.AddRange({"絵", "条", "装", "曝", "弾", "種", "駐", "段", "汎", "押", "土", "庭", "衝", "扉"}) '14 + chars.AddRange({"画", "処", "駅", "角", "空", "壕", "育", "館", "紫", "徐", "登", "刑", "陸", "点"}) '14 + chars.AddRange({"減", "洋", "堂", "袖", "控", "報", "吹", "船", "伴", "各", "崩", ">", "揺", "搭"}) '14 + chars.AddRange({"海", "岸", "砂", "浜", "基", "鏡", "泉", "砲", "雪", "岩", "橋", "環", "瓦", "礫"}) '14 + chars.AddRange({"殿", "炸", "裂", "川", "停", "泊", "走", "航", "滝", "壷", "床", "冷", "城", "跡"}) '14 + chars.AddRange({"商", "湯", "葛", "偵", "寿", "司", "参", "牧", "霧", "宙", "邸", "玄", "版", "局"}) '14 + chars.AddRange({"署", "庫", "閲", "箇", "従", "某", "鍵", "穂", "推", "緑", "管", "提", "嬢", "号"}) '14 + chars.AddRange({"拾", "挺", "膳", "摘", "柱", "躍", "丸", "距", "曹", "祖", "研", "漕", "在", "更"}) '14 + chars.AddRange({"仁", "浦", "賀", "汗", "認", "否", "拒", "刻", "逆", "為", "児", "獄", "将", "雷"}) '14 + chars.AddRange({"鉄", "津", "竜", "裁", "隕", "淀", "闇", "審", "乱", "投", "雄", "叫", "厔", "楼"}) '14 + chars.AddRange({"召", "喚", "祈", "扮", "竹", "梅", "雲", "隅", "幸", "妖", "烈", "咲", "百", "繚"}) '14 + chars.AddRange({"枢", "斬", "氷", "結", "疾", "稲", "妻", "孔", "針", "痺", "滴", "掻", "閃", "伽"}) '14 + chars.AddRange({"瑠", "圧", "瀑", "布", "魅", "蒸", "焔", "渦", "噴", "洪", "穴", "獣", "福", "剣"}) '14 + chars.AddRange({"王", "散", "整", "頓", "友", "碁", "嫁", "途", "唄", "被", "害", "卑", "嘘", "含"}) '14 + chars.AddRange({"辞", "粗", "匹", "狼", "珍", "迷", "姫", "詐", "欺", "逞", "随", "槙", "旅", "喫"}) '14 + chars.AddRange({"骸", "臓", "餓", "程", "揚", "詮", "眼", "看", "婦", "丁", "束", "民", "毎", "沢"}) '14 + chars.AddRange({"厄", "漕", "越", "減", "久", "捨", "墜", "壇", "操", "縦", "襲", "徹", "底", "勢"}) '14 + chars.AddRange({"恵", "井", "等", "挑", "軍", "鞭", "専", "印", "唱", "誠", "紳", "国", "雅", "肝"}) '14 + chars.AddRange({"稀", "極", "描", "踪", "扮", "如", "讃", "誇", "芸", "才", "届", "忽", "織", "根"}) '14 + chars.AddRange({"況", "犯", "軽", "尾", "鰭", "捏", "猥", "黒", "喧", "煤", "偽", "暮", "瞞", "替"}) '14 + chars.AddRange({"凍", "鬼", "忙", "混", "継", "巷", "拝", "拙", "擦", "勿", "幹", "隆", "皮", "ケ"}) '14 + 'Block 5 + chars.AddRange({"酷", "省", "頓", "令", "様", "荒", "滝", "営", "悌", "額", "競", "是", "非", "短"}) '14 + chars.AddRange({"慌", "弥", "無", "託", "宝", "就", "謬", "到", "臓", "貫", "規", "賞", "迎", "範"}) '14 + chars.AddRange({"桁", "希", "悠", "儘", "訣", "昨", "幾", "歪", "再", "姓", "奥", "洗", "鼻", "載"}) '14 + chars.AddRange({"既", "繰", "暖", "昧", "修", "遅", "結", "洛", "醜", "紙", "候", "辛", "策", "尽"}) '14 + chars.AddRange({"耳", "挟", "刊", "委", "銀", "氣", "往", "應", "碑", "芝", "乏", "授", "医", "糖"}) '14 + chars.AddRange({"捕", "杉", "巧", "純", "睨", "思", "励", "書", "和", "茹", "派", "要", "戸", "汲"}) '14 + chars.AddRange({"慰", "肌", "井", "酒", "続", "領", "査", "掌", "革", "輌", "図", "暇", "坊", "猫"}) '14 + chars.AddRange({"沙", "法", "愛", "旗", "祖", "遺", "垂", "漢", "換", "餐", "防", "阻", "節", "胆"}) '14 + chars.AddRange({"倍", "製", "儲", "矛", "盾", "答", "繁", "姫", "象", "田", "舎", "古", "索", "麺"}) '14 + chars.AddRange({"餌", "常", "皿", "胃", "頑", "刀", "△", "折", "席", "捜", "測", "造", "齢", "俊"}) '14 + chars.AddRange({"匠", "犠", "性", "些", "悦", "凌", "惜", "片", "預", "焼", "析", "堪", "映", "棟"}) '14 + chars.AddRange({"渋", "油", "哮", "嚼", "髪", "伸", "揃", "秀", "彦", "凡", "趣", "勾", "建", "夜"}) '14 + chars.AddRange({"境", "鮮", "虐", "凶", "虚", "【", "】", "献", "患", "植", "君", "蜜", "維", "詳"}) '14 + chars.AddRange({"勉", "評", "清", "楚", "仔", "騎", "関", "両", "間", "刺", "❤", "哎", "貫", "墅"}) '14 + chars.AddRange({"ヅ", "籃", "喂", "嗎", "丹", "購", "纂", "低", "列", "討", "抵", "拠", "赫", "担"}) '14 + chars.AddRange({"肩", "凝", "揉", "喰", "療", "縮", "脚", "拠", "体", "遂", "覇", "闇", "脳", "洗"}) '14 + chars.AddRange({"壮", "冒", "側", "仏", "陀", "娘", "陸", "只", "易", "偲", "懲", "蹄", "荷", "検"}) '14 + chars.AddRange({"愚", "相", "概", "弁", "西", "剥", "戸", "吊", "漫", "閉", "仰", "湧", "腔", "康"}) '14 + chars.AddRange({"紡", "崎", "塞", "求", "雛", "獲", "伯", "爵", "桁", "総", "泌", "菌", "惨", "菊"}) '14 + chars.AddRange({"瘾", "冇", "哪", "間", "貯", "腫", "袋", "至", "何", "魚", "骨", "喉", "煮", "羽"}) '14 + chars.AddRange({"嘆", "昼", "抑", "旨", "靴", "蔦", "旦", "那", "釈", "迦", "適", "漁", "潤", "賑"}) '14 + 'Block 6 + chars.AddRange({"催", "符", "鹸", "和", "濃", "捌", "綾", "委", "融", "繁", "晒", "握", "蘇", "尚"}) '14 + chars.AddRange({"矢", "播", "Ⓞ", "完", "捨", "淑", "稽", "裁", "暑", "蔡", "盆", "栽", "軸", "築"}) '14 + chars.AddRange({"衰", "煩", "締", "喜", "恩", "技", "泥", "貸", "吐", "冠", "陸", "狗", "敷", "倉"}) '14 + chars.AddRange({"協", "♪", "濁", "濫", "堤", "殊", "咆", "哮", "●", "▲", "灸", "据", "利", "嫉"}) '14 + chars.AddRange({"掴", "曇", "克", "昂", "睡", "悟", "竜", "伏", "請", "磨", "豆", "免", "詩", "肥"}) '14 + chars.AddRange({"盤", "阡", "釘", "婆", "翻", "叩", "慭", "想", "域", "播", "傾", "嚟", "嘞", "痣"}) '14 + chars.AddRange({"唯", "恨", "砕", "板", "星", "柄", "諸", "鉢", "詞", "歴", "史", "禍", "拘", "輸"}) '14 + chars.AddRange({"辿", "官", "噴", "冬", "輮", "稿", "採", "瞳", "鈍", "河", "童", "溺", "逮", "核"}) '14 + chars.AddRange({" ", " ", " ", " ", "窓", "覗", "軒", "項", "胞", "粱", "膨", "漂", "通", "僧"}) '14 + chars.AddRange({"致", "懇", "秒", "北", "没", "援", "陳", "宛", "濯", "漢", "拜", "慈", "紐", "宗"}) '14 + chars.AddRange({" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "}) '14 + chars.AddRange({"狩", "狐", "詠", "犬", "澹", "妾", "俗", "尋", "阿", "弥", "扇", "芽", "疎", "滑"}) '14 + chars.AddRange({"穏", "溥", "政", "程", "泰", "旧", "尻", "拭", "律", "爽", "沸", "呟", "這", "沌"}) '14 + chars.AddRange({"弄", "苗", "弟", "伊", "鍛", "陽", "夏", "幼", "胡", "蝶", "炉", "瑠", "陶", "嚇"}) '14 + chars.AddRange({"江", "殴", "側", "溶", "院", "委", "惚", "里", "跳", "刃", "浩", "樹", "奮", "隙"}) '14 + chars.AddRange({"充", "羨", "黄", "睨", "糞", "剩", "濆", "謀", "執", "穫", "州", "碁", "爺", "隣"}) '14 + chars.AddRange({"鎌", "兜", "灼", "系", "瀕", "瀕", "即", "牙", "爪", "晩", "域", "楼", "絢", "爛"}) '14 + chars.AddRange({"釜", "翼", "創", "朱", "雀", "龍", "虎", "干", "挨", "拶", "誅", "淵", "壱", "恰"}) '14 + chars.AddRange({"幅", "駣", "衣", "弐", "畑", "賛", "甲", "斐", "鵜", "掘", "☆", "碑", "駒", "貝"}) '14 + chars.AddRange({"櫂", "祝", "庶", "脇", "蛍", "前", "鶴", "浄", "鋼", "侯", "揶", "撥", "楯", "斉"}) '14 + chars.AddRange({"基", "繩", "耗", "鞄", "償", "敢", "娯", "略", "濡", "妨", "悉", "峠", "暫", "穰"}) '14 + 'Block 7 + chars.AddRange({"質", "彫", "醒", "温", "戯", "董", "巡", "潤", "稚", "蓋", "貼", "唱", "粘", "丘"}) '14 + chars.AddRange({"枝", "履", "旋", "錯", "雨", "粒", "塵", "翔", "喆", "兆", "膝", "盲", "軌", "逸"}) '14 + chars.AddRange({"策", "均", "衡", "揮", "冥", "府", "染", "蛰", "岡", "齊", "筆", "浅", "妥", "拉"}) '14 + chars.AddRange({"序", "攫", "炊", "滞", "棚", "路", "財", "廊", "展", "輔", "隷", "妄", "慨", "喩"}) '14 + chars.AddRange({"露", "宇", "宙", "副", "島", "宵", "钔", "媽", "掲", "瓢", "碧", "抹", "煌", "麓"}) '14 + chars.AddRange({"褪", "倉", "昏", "蒼", "穹", "相", "罵", "貌", "悶", "礎", "唐", "傑", "嚙", "囮"}) '14 + chars.AddRange({"臺", "透", "沼", "衤", "塵", "杖", "帝", "菩", "后", "鑰", "欧", "誓", "孫", "股"}) '14 + chars.AddRange({"兼", "侯", "祥", "秩", "問", "憲", "徳", "摂", "蔗", "殖", "忿", "竺", "治", "逐"}) '14 + chars.AddRange({"痒", "還", "『", "』", "厘", "涯", "棘", "類", "餅", "咥", "舵", "乃", "挿", "唇"}) '14 + chars.AddRange({"鞭", "銥", "堰", "梃", "摺", "庇", "暁", "遮", "塊", "倉", "慄", "發", "锋", "灯"}) '14 + chars.AddRange({"持", "汀", "措", "葬", "票", "戴", "遥", "ヵ", "迣", "掌", "宴", "帳", "燈", "享"}) '14 + chars.AddRange({"荻", "嶋", "柴", "俊", "辰", "弄", "噂", "也", "刷", "輝", "欄", "鉾", "涌", "岬"}) '14 + chars.AddRange({"矯", "承", "焚", "舟", "削", "玩", "尖", "把", "畝", "晶", "屓", "躯", "菪", "溯"}) '14 + chars.AddRange({"漏", "媒", "夕", "闊", "哲", "捲", "梁", "佇", "撼", "苛", "忌", "ヲ", "蝿", "詫"}) '14 + chars.AddRange({"悴", "怠", "枷", "妊", "蹴", "猿", "又", "v", "瀧", "机", " ", "蓋", "添", "乳"}) '14 + chars.AddRange({"拡", "臼", "勾", "褐", "剛", "紺", "淡", "迅", "鞘", "鳥", "狗", "粕", "濤", "涛"}) '14 + chars.AddRange({"鉤", "雁", "鍋", "鉱", "卦", "鶏", "圏", "乾", "坤", "亀", "咥", "髭", "柳", "智"}) '14 + chars.AddRange({"嶺", "絹", "錬", "屑", "謙", "弘", "糸", "棲", "慶", "漆", "熟", "衆", "ぢ", "訓"}) '14 + chars.AddRange({"肯", "俯", "埒", "但", "顕", "冊", "胎", "摩", "挫", "県", "沿", "泡", "妃", "戮"}) '14 + chars.AddRange({"刎", "无", "虹", "儂", "闢", "卵", "朕", "梵", "馴", "擁", "洲", "叢", "薙", "舐"}) '14 + chars.AddRange({"鼹", "蓬", "帥", "跡", "兼", "弑", "趨", "伶", "刹", "灰", "毘", "菜", "貧", "咎"}) '14 + 'Block 8 + chars.AddRange({"廻", "碑", "竟", "潟", "憤", "帆", "酌", "衛", "綣", "簾", "惹", "朧", "淫", "曼"}) '14 + chars.AddRange({"森", "艱", "鬣", "屠", "働", "飢", "貞", "虚", "蒔", "叡", "卓", "征", "迂", "謳"}) '14 + chars.AddRange({"渾", "尺", "巾", "需", "芳", "桂", "顧", "吃", "猶", "傀", "儡", "譜", "拍", "隔"}) '14 + chars.AddRange({"浴", "云", "啓", "麦", "瀬", "咀", "螺", "遇", "喝", "伍", "膳", "禅", "惰", "殉"}) '14 + chars.AddRange({"蔑", "循", "約", "芹", "槌", "菩", "♂", "♀", "醬", "噌", "菜", "蘭", "米", "虚"}) '14 + chars.AddRange({"代", "籍", "培", "縋", "漬", "淆", "淵", "訂", " ", " ", " ", " ", "ヶ", "懺"}) '14 + chars.AddRange({"弓", "炭", "蝕", "窟", "披", "癇", "蛮", "彷", "徨", "鋳", "藉", "薰", "壞", "岐"}) '14 + chars.AddRange({"脆", "些", "脂", "肪", "辟", "窮", "抽", "◯", "獎", "遼", "过", "褄", "玲", "玲"}) '14 + chars.AddRange({"央", "揣", "餌", "巣", "朗", "隅", "併", "暗", "跨", "餌", "庁", "腸", "↺", "↻"}) '14 + chars.AddRange({" ", "穢", "畏", "眭", "奉", "聡", "益", "遜", "媚", "乞", "浸", "鞋", "涼", "坦"}) '14 + chars.AddRange({"舅", "撲", "沁", "哦", "緑", "茂", "惧", "囗", "煉", "崇", "促", "弐", "串", "枯"}) '14 + chars.AddRange({"騎", "舗", "耕", "陥", "呂", "施", "蔓", "延", "懊", "圭", "裸", "葵", "枕", "誹"}) '14 + chars.AddRange({"搬", "疼", "霜", "貸", "晹", "弊", "蔽", "沫", "班", "籠", "其", "棋", "湖", "綿"}) '14 + chars.AddRange({"豚", "熊", "韋", "臂", "農", "鍔", "嘴", "蔗", "猟", "棍", "侵", "飼", "轄", "宰"}) '14 + chars.AddRange({"屍", "蛙", "憩", "捷", "靡", "艷", "鳶", "伎", "茹", "馴", "働", "-", "盟", "採"}) '14 + chars.AddRange({"偲", "釣", "漸", "睦", "毅", "奢", "彗", "昆", "脈", "侍", "頻", "禄", "鬆", "墊"}) '14 + chars.AddRange({"艦", "湾", "适", "愕", "錠", "午", "泳", "顎", "媧", "←", "ゐ", "ゑ", "菓", "興"}) '14 + chars.AddRange({"廉", "緋", "侠", "謂", "↑", "↓", "吾", "捉", "ヰ", "ヱ", "D", "椎", "撤", "騰"}) '14 + chars.AddRange({"践", "該", "荘", "搾", "寮", "一", "眉", "栓", "叔", "秋", "峰", "義", "皺", "嬲"}) '14 + chars.AddRange({"畴", "閑", "発", "剌", "鳩", "傘", "洩", "接", "之", "撓", "緑", "閥", "曹", "斎"}) '14 + chars.AddRange({"勲", "匿", "弛", "叙", "諜", "硝", "什", "繕", "唸", "緩", "邁", "棊", "撰", "艦"}) '14 + 'Block 9 + chars.AddRange({"隻", "療", "墟", "梧", "冤", "呉", "株", "哨", "嵯", "峨", "碱", "賽", "肖", "酬"}) '14 + chars.AddRange({"棟", "堀", "毟", "肃", "塔", "謡", "句", "暦", "毀", "錮", "凸", "凹", "瓜", "戚"}) '14 + chars.AddRange({"斡", "筒", "嵌", "甚", "慒", "管", "疫", "俳", "逝", "沖", "亭", "塀", "掠", "吧"}) '14 + chars.AddRange({"气", "么", "曾", "脊", "斜", "啊", "氓", "※", "猞", "猪", "菅", "莫", "慇", "懃"}) '14 + chars.AddRange({"窃", "癪", "斥", "呢", "啦", "①", "②", "③", "④", "⑤", "⑥", "⑦", "⑧", "痕"}) '14 + chars.AddRange({"桑", "愴", "祠", "擲", "筮", "榖", "酵", "ン", "縞", "吼", "飴", "棺", "此", "貢"}) '14 + chars.AddRange({"頷", "寵", "駕", "恵", "貪", "褻", "芯", "鞆", "喘", "肘", "氾", "濫", "屁", "曝"}) '14 + chars.AddRange({"疚", "娑", "膏", "唾", "薀", "滴", "姑", "酉", "齧", "誑", "暢", "諾", "呈", "軟"}) '14 + chars.AddRange({"蟠", "且", "鋼", "狙", "京", "邦", "蟻", "糖", "尿", "糧", "趾", "卜", "篤", "吏"}) '14 + chars.AddRange({"巳", "墊", "括", "於", "楊", "綻", "世", "侶", "鶯", "嬉", "訟", "天", "更", "塞"}) '14 + chars.AddRange({"兌", "邂", "夬", "綬", "訝", "琥", "珀", "孕", "吠", "菱", "腿", "寞", "惟", "策"}) '14 + chars.AddRange({"篭", "燻", "券", "楠", "恒", "弔", "臢", "蠢", "駿", "阪", "倦", "壺", "斗", "攪"}) '14 + chars.AddRange({"拌", "旱", "魅", "蒙", "蝙", "蝠", "淙", "套", "蟲", "牢", "脹", "匍", "匋", "閇"}) '14 + chars.AddRange({"煤", "剖", "煤", "森", "径", "牌", "郣", "襟", "溪", "畦", "璃", "執", "雹", "徘"}) '14 + chars.AddRange({"徊", "★", "瞑", "窺", "擬", "薩", "乱", "畳", "涅", "槃", "曙", "胤", "裔", "咋"}) '14 + chars.AddRange({"峻", "橧", "麝", "拘", "櫞", "膜", "郵", "匋", "芙", "蓉", "祀", "礁", "響", "累"}) '14 + chars.AddRange({"糾", "呵", "祷", "竿", "諍", "胴", "巴", "磔", "唸", "嘗", "腱", "峰", "萎", "吉"}) '14 + chars.AddRange({"糾", "呵", "祷", "竿", "諍", "胴", "巴", "磔", "唸", "嘗", "腱", "峰", "萎", "嗚"}) '14 + chars.AddRange({"\"}) '1 + chars.AddRange({"\"}) '1 + chars.AddRange({"\"}) '1 + chars.AddRange({"\"}) '1 + + End Sub + +End Class diff --git a/p2isPSX_CDToolkit/My Project/Application.Designer.vb b/p2isPSX_CDToolkit/My Project/Application.Designer.vb new file mode 100644 index 0000000..523d46e --- /dev/null +++ b/p2isPSX_CDToolkit/My Project/Application.Designer.vb @@ -0,0 +1,38 @@ +'------------------------------------------------------------------------------ +' +' Этот код создан программой. +' Исполняемая версия:4.0.30319.42000 +' +' Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае +' повторной генерации кода. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + 'ПРИМЕЧАНИЕ. Этот файл создан автоматически; не изменяйте его самостоятельно. Для внесения изменений + ' или, если в ходе сборки обнаружены ошибки в этом файле, перейдите в конструктор проектов + ' (перейдите к свойствам проекта или дважды щелкните узел "Мой проект" в + ' обозревателе решений), и внесите изменения на вкладке "Приложение". + ' + Partial Friend Class MyApplication + + _ + Public Sub New() + MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) + Me.IsSingleInstance = false + Me.EnableVisualStyles = true + Me.SaveMySettingsOnExit = true + Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses + End Sub + + _ + Protected Overrides Sub OnCreateMainForm() + Me.MainForm = Global.p2isPSX_CDView.Form1 + End Sub + End Class +End Namespace diff --git a/p2isPSX_CDToolkit/My Project/Application.myapp b/p2isPSX_CDToolkit/My Project/Application.myapp new file mode 100644 index 0000000..1243847 --- /dev/null +++ b/p2isPSX_CDToolkit/My Project/Application.myapp @@ -0,0 +1,11 @@ + + + true + Form1 + false + 0 + true + 0 + 0 + true + diff --git a/p2isPSX_CDToolkit/My Project/AssemblyInfo.vb b/p2isPSX_CDToolkit/My Project/AssemblyInfo.vb new file mode 100644 index 0000000..adae24f --- /dev/null +++ b/p2isPSX_CDToolkit/My Project/AssemblyInfo.vb @@ -0,0 +1,35 @@ +Imports System +Imports System.Reflection +Imports System.Runtime.InteropServices + +' Общие сведения об этой сборке предоставляются следующим набором +' атрибутов. Отредактируйте значения этих атрибутов, чтобы изменить +' общие сведения об этой сборке. + +' Проверьте значения атрибутов сборки + + + + + + + + + + +'Следующий GUID служит для идентификации библиотеки типов, если этот проект будет видимым для COM + + +' Сведения о версии сборки состоят из следующих четырех значений: +' +' Основной номер версии +' Дополнительный номер версии +' Номер сборки +' Редакция +' +' Можно задать все значения или принять номера сборки и редакции по умолчанию +' используя "*", как показано ниже: +' + + + diff --git a/p2isPSX_CDToolkit/My Project/Resources.Designer.vb b/p2isPSX_CDToolkit/My Project/Resources.Designer.vb new file mode 100644 index 0000000..fea05db --- /dev/null +++ b/p2isPSX_CDToolkit/My Project/Resources.Designer.vb @@ -0,0 +1,63 @@ +'------------------------------------------------------------------------------ +' +' Этот код создан программой. +' Исполняемая версия:4.0.30319.42000 +' +' Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае +' повторной генерации кода. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + +Imports System + +Namespace My.Resources + + 'Этот класс создан автоматически классом StronglyTypedResourceBuilder + 'с помощью такого средства, как ResGen или Visual Studio. + 'Чтобы добавить или удалить член, измените файл .ResX и снова запустите ResGen + 'с параметром /str или перестройте свой проект VS. + ''' + ''' Класс ресурса со строгой типизацией для поиска локализованных строк и т.д. + ''' + _ + Friend Module Resources + + Private resourceMan As Global.System.Resources.ResourceManager + + Private resourceCulture As Global.System.Globalization.CultureInfo + + ''' + ''' Возвращает кэшированный экземпляр ResourceManager, использованный этим классом. + ''' + _ + Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager + Get + If Object.ReferenceEquals(resourceMan, Nothing) Then + Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("p2isPSX_CDView.Resources", GetType(Resources).Assembly) + resourceMan = temp + End If + Return resourceMan + End Get + End Property + + ''' + ''' Перезаписывает свойство CurrentUICulture текущего потока для всех + ''' обращений к ресурсу с помощью этого класса ресурса со строгой типизацией. + ''' + _ + Friend Property Culture() As Global.System.Globalization.CultureInfo + Get + Return resourceCulture + End Get + Set + resourceCulture = value + End Set + End Property + End Module +End Namespace diff --git a/p2isPSX_CDToolkit/My Project/Resources.resx b/p2isPSX_CDToolkit/My Project/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/p2isPSX_CDToolkit/My Project/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/p2isPSX_CDToolkit/My Project/Settings.Designer.vb b/p2isPSX_CDToolkit/My Project/Settings.Designer.vb new file mode 100644 index 0000000..1a278d6 --- /dev/null +++ b/p2isPSX_CDToolkit/My Project/Settings.Designer.vb @@ -0,0 +1,73 @@ +'------------------------------------------------------------------------------ +' +' Этот код создан программой. +' Исполняемая версия:4.0.30319.42000 +' +' Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае +' повторной генерации кода. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + _ + Partial Friend NotInheritable Class MySettings + Inherits Global.System.Configuration.ApplicationSettingsBase + + Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings) + +#Region "Функция автоматического сохранения My.Settings" +#If _MyType = "WindowsForms" Then + Private Shared addedHandler As Boolean + + Private Shared addedHandlerLockObject As New Object + + _ + Private Shared Sub AutoSaveSettings(sender As Global.System.Object, e As Global.System.EventArgs) + If My.Application.SaveMySettingsOnExit Then + My.Settings.Save() + End If + End Sub +#End If +#End Region + + Public Shared ReadOnly Property [Default]() As MySettings + Get + +#If _MyType = "WindowsForms" Then + If Not addedHandler Then + SyncLock addedHandlerLockObject + If Not addedHandler Then + AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings + addedHandler = True + End If + End SyncLock + End If +#End If + Return defaultInstance + End Get + End Property + End Class +End Namespace + +Namespace My + + _ + Friend Module MySettingsProperty + + _ + Friend ReadOnly Property Settings() As Global.p2isPSX_CDView.My.MySettings + Get + Return Global.p2isPSX_CDView.My.MySettings.Default + End Get + End Property + End Module +End Namespace diff --git a/p2isPSX_CDToolkit/My Project/Settings.settings b/p2isPSX_CDToolkit/My Project/Settings.settings new file mode 100644 index 0000000..85b890b --- /dev/null +++ b/p2isPSX_CDToolkit/My Project/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/p2isPSX_CDToolkit/ScriptCheck.Designer.vb b/p2isPSX_CDToolkit/ScriptCheck.Designer.vb new file mode 100644 index 0000000..320c410 --- /dev/null +++ b/p2isPSX_CDToolkit/ScriptCheck.Designer.vb @@ -0,0 +1,265 @@ + _ +Partial Class ScriptCheck + Inherits System.Windows.Forms.Form + + 'Форма переопределяет dispose для очистки списка компонентов. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Является обязательной для конструктора форм Windows Forms + Private components As System.ComponentModel.IContainer + + 'Примечание: следующая процедура является обязательной для конструктора форм Windows Forms + 'Для ее изменения используйте конструктор форм Windows Form. + 'Не изменяйте ее в редакторе исходного кода. + _ + Private Sub InitializeComponent() + Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(ScriptCheck)) + Me.PictureBox1 = New System.Windows.Forms.PictureBox() + Me.Dir = New System.Windows.Forms.TextBox() + Me.ProgressBar1 = New System.Windows.Forms.ProgressBar() + Me.FilesLoad = New System.Windows.Forms.Button() + Me.CurFileText = New System.Windows.Forms.Label() + Me.CurFileName = New System.Windows.Forms.Label() + Me.CurrentDial = New System.Windows.Forms.Label() + Me.DemoText = New System.Windows.Forms.Label() + Me.NxDial = New System.Windows.Forms.Button() + Me.prevDial = New System.Windows.Forms.Button() + Me.NxFile = New System.Windows.Forms.Button() + Me.PrevFile = New System.Windows.Forms.Button() + Me.Panel1 = New System.Windows.Forms.Panel() + Me.IDsrch = New System.Windows.Forms.TextBox() + Me.srch = New System.Windows.Forms.Button() + Me.Label1 = New System.Windows.Forms.Label() + Me.Editor = New System.Windows.Forms.Button() + CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).BeginInit() + Me.Panel1.SuspendLayout() + Me.SuspendLayout() + ' + 'PictureBox1 + ' + Me.PictureBox1.BackColor = System.Drawing.Color.Transparent + Me.PictureBox1.ErrorImage = Nothing + Me.PictureBox1.InitialImage = Nothing + Me.PictureBox1.Location = New System.Drawing.Point(0, 0) + Me.PictureBox1.Name = "PictureBox1" + Me.PictureBox1.Size = New System.Drawing.Size(940, 188) + Me.PictureBox1.TabIndex = 0 + Me.PictureBox1.TabStop = False + ' + 'Dir + ' + Me.Dir.BackColor = System.Drawing.Color.Black + Me.Dir.BorderStyle = System.Windows.Forms.BorderStyle.None + Me.Dir.ForeColor = System.Drawing.SystemColors.InactiveCaption + Me.Dir.Location = New System.Drawing.Point(183, 26) + Me.Dir.Name = "Dir" + Me.Dir.Size = New System.Drawing.Size(643, 13) + Me.Dir.TabIndex = 1 + Me.Dir.Text = "D:\Games\PSX\Persona 2 - Batsu (NTSC-J) [SLPS-02825]\Export\UnRLE\0057_ALL_SCENER" & + "Y" + ' + 'ProgressBar1 + ' + Me.ProgressBar1.Location = New System.Drawing.Point(0, 475) + Me.ProgressBar1.Name = "ProgressBar1" + Me.ProgressBar1.Size = New System.Drawing.Size(940, 10) + Me.ProgressBar1.TabIndex = 2 + ' + 'FilesLoad + ' + Me.FilesLoad.Location = New System.Drawing.Point(661, 45) + Me.FilesLoad.Name = "FilesLoad" + Me.FilesLoad.Size = New System.Drawing.Size(165, 23) + Me.FilesLoad.TabIndex = 3 + Me.FilesLoad.Text = "Load TRNSL Files" + Me.FilesLoad.UseVisualStyleBackColor = True + ' + 'CurFileText + ' + Me.CurFileText.Font = New System.Drawing.Font("Montserrat", 27.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.CurFileText.ForeColor = System.Drawing.Color.DarkGray + Me.CurFileText.Location = New System.Drawing.Point(492, 106) + Me.CurFileText.Name = "CurFileText" + Me.CurFileText.Size = New System.Drawing.Size(334, 52) + Me.CurFileText.TabIndex = 4 + Me.CurFileText.Text = "0 / 0" + Me.CurFileText.TextAlign = System.Drawing.ContentAlignment.MiddleRight + ' + 'CurFileName + ' + Me.CurFileName.Font = New System.Drawing.Font("Montserrat", 11.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.CurFileName.ForeColor = System.Drawing.Color.DarkGray + Me.CurFileName.Location = New System.Drawing.Point(292, 158) + Me.CurFileName.Name = "CurFileName" + Me.CurFileName.Size = New System.Drawing.Size(534, 29) + Me.CurFileName.TabIndex = 4 + Me.CurFileName.Text = "Current File" + Me.CurFileName.TextAlign = System.Drawing.ContentAlignment.MiddleRight + ' + 'CurrentDial + ' + Me.CurrentDial.Font = New System.Drawing.Font("Montserrat", 20.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.CurrentDial.ForeColor = System.Drawing.Color.DarkGray + Me.CurrentDial.Location = New System.Drawing.Point(596, 195) + Me.CurrentDial.Name = "CurrentDial" + Me.CurrentDial.Size = New System.Drawing.Size(230, 37) + Me.CurrentDial.TabIndex = 4 + Me.CurrentDial.Text = "0 / 0" + Me.CurrentDial.TextAlign = System.Drawing.ContentAlignment.MiddleRight + ' + 'DemoText + ' + Me.DemoText.BackColor = System.Drawing.Color.FromArgb(CType(CType(128, Byte), Integer), CType(CType(64, Byte), Integer), CType(CType(0, Byte), Integer)) + Me.DemoText.Font = New System.Drawing.Font("Courier New", 15.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(204, Byte)) + Me.DemoText.ForeColor = System.Drawing.Color.White + Me.DemoText.Location = New System.Drawing.Point(12, 92) + Me.DemoText.Name = "DemoText" + Me.DemoText.Size = New System.Drawing.Size(206, 155) + Me.DemoText.TabIndex = 5 + Me.DemoText.Visible = False + ' + 'NxDial + ' + Me.NxDial.Location = New System.Drawing.Point(646, 241) + Me.NxDial.Name = "NxDial" + Me.NxDial.Size = New System.Drawing.Size(180, 38) + Me.NxDial.TabIndex = 6 + Me.NxDial.Text = ">>" + Me.NxDial.UseVisualStyleBackColor = True + ' + 'prevDial + ' + Me.prevDial.Location = New System.Drawing.Point(556, 257) + Me.prevDial.Name = "prevDial" + Me.prevDial.Size = New System.Drawing.Size(75, 23) + Me.prevDial.TabIndex = 7 + Me.prevDial.Text = "<<" + Me.prevDial.UseVisualStyleBackColor = True + ' + 'NxFile + ' + Me.NxFile.Location = New System.Drawing.Point(751, 80) + Me.NxFile.Name = "NxFile" + Me.NxFile.Size = New System.Drawing.Size(75, 23) + Me.NxFile.TabIndex = 6 + Me.NxFile.Text = ">>" + Me.NxFile.UseVisualStyleBackColor = True + ' + 'PrevFile + ' + Me.PrevFile.Location = New System.Drawing.Point(661, 81) + Me.PrevFile.Name = "PrevFile" + Me.PrevFile.Size = New System.Drawing.Size(75, 23) + Me.PrevFile.TabIndex = 7 + Me.PrevFile.Text = "<<" + Me.PrevFile.UseVisualStyleBackColor = True + ' + 'Panel1 + ' + Me.Panel1.BackgroundImage = CType(resources.GetObject("Panel1.BackgroundImage"), System.Drawing.Image) + Me.Panel1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch + Me.Panel1.Controls.Add(Me.PictureBox1) + Me.Panel1.Location = New System.Drawing.Point(0, 285) + Me.Panel1.Name = "Panel1" + Me.Panel1.Size = New System.Drawing.Size(931, 188) + Me.Panel1.TabIndex = 9 + ' + 'IDsrch + ' + Me.IDsrch.Location = New System.Drawing.Point(492, 80) + Me.IDsrch.Name = "IDsrch" + Me.IDsrch.Size = New System.Drawing.Size(48, 20) + Me.IDsrch.TabIndex = 10 + Me.IDsrch.Text = "0181" + ' + 'srch + ' + Me.srch.Location = New System.Drawing.Point(547, 80) + Me.srch.Name = "srch" + Me.srch.Size = New System.Drawing.Size(75, 23) + Me.srch.TabIndex = 11 + Me.srch.Text = "GO" + Me.srch.UseVisualStyleBackColor = True + ' + 'Label1 + ' + Me.Label1.Font = New System.Drawing.Font("Montserrat", 11.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.Label1.ForeColor = System.Drawing.Color.DarkGray + Me.Label1.Location = New System.Drawing.Point(315, 75) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(171, 29) + Me.Label1.TabIndex = 4 + Me.Label1.Text = "SearchFileID -->" + Me.Label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight + ' + 'Editor + ' + Me.Editor.Location = New System.Drawing.Point(219, 250) + Me.Editor.Name = "Editor" + Me.Editor.Size = New System.Drawing.Size(130, 23) + Me.Editor.TabIndex = 12 + Me.Editor.Text = "Open Editor" + Me.Editor.UseVisualStyleBackColor = True + ' + 'ScriptCheck + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.BackColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(0, Byte), Integer), CType(CType(64, Byte), Integer)) + Me.ClientSize = New System.Drawing.Size(941, 485) + Me.Controls.Add(Me.Editor) + Me.Controls.Add(Me.srch) + Me.Controls.Add(Me.IDsrch) + Me.Controls.Add(Me.PrevFile) + Me.Controls.Add(Me.prevDial) + Me.Controls.Add(Me.NxFile) + Me.Controls.Add(Me.NxDial) + Me.Controls.Add(Me.DemoText) + Me.Controls.Add(Me.Label1) + Me.Controls.Add(Me.CurFileName) + Me.Controls.Add(Me.CurrentDial) + Me.Controls.Add(Me.CurFileText) + Me.Controls.Add(Me.FilesLoad) + Me.Controls.Add(Me.ProgressBar1) + Me.Controls.Add(Me.Dir) + Me.Controls.Add(Me.Panel1) + Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog + Me.MaximizeBox = False + Me.MinimizeBox = False + Me.Name = "ScriptCheck" + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen + Me.Text = "ScriptCheck" + CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).EndInit() + Me.Panel1.ResumeLayout(False) + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + + Friend WithEvents PictureBox1 As PictureBox + Friend WithEvents Dir As TextBox + Friend WithEvents ProgressBar1 As ProgressBar + Friend WithEvents FilesLoad As Button + Friend WithEvents CurFileText As Label + Friend WithEvents CurFileName As Label + Friend WithEvents CurrentDial As Label + Friend WithEvents DemoText As Label + Friend WithEvents NxDial As Button + Friend WithEvents prevDial As Button + Friend WithEvents NxFile As Button + Friend WithEvents PrevFile As Button + Friend WithEvents Panel1 As Panel + Friend WithEvents IDsrch As TextBox + Friend WithEvents srch As Button + Friend WithEvents Label1 As Label + Friend WithEvents Editor As Button +End Class diff --git a/p2isPSX_CDToolkit/ScriptCheck.resx b/p2isPSX_CDToolkit/ScriptCheck.resx new file mode 100644 index 0000000..3a3f096 --- /dev/null +++ b/p2isPSX_CDToolkit/ScriptCheck.resx @@ -0,0 +1,613 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + + iVBORw0KGgoAAAANSUhEUgAAA1EAAAC6CAIAAADAjFAhAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + wwAADsMBx2+oZAAAcc1JREFUeF7tvelzY8eR7k0SBEmQLY9kqSXbWltSa993y9tIlu0ZW/Jc79v1vo49 + c9///9tbQFX+sphZzK4DoElQXRHPB0fms9TJSiFOuI/Ue9/74e8yfvXHf2X89Ld/z/jlH/6Z8bPf/iPj + F7//Z8bPf/ffgn9k/PL3/8z42W//noEcw1/94V8ZVODg84vf/7fBz373jwzIPRFwfvGHf2ZEEfKA3rBV + +VeGRohPNZYCWpCRV4YXhvLs+AB9HHlAIhhCw1CPUSr4/Dx5rkAE6ZAx7IqQldAIAYsUTD6MKCp8qpmX + CNL1PFMi8GEawI+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edfpne/B + B29mfPGLD2Y8/MiXMh588KGMhx9+JOOhh24W3Hw446bgwYduZkD+4oMPZTzyyJcyvvjggxk+4ubDj2Ro + hIAWZOQYVhEllGM8+NBDGRyVw3dFuLG0IsqzEwFoQVb5xREcg4NxVA6vEZzZRTTG8sgjGajSyTLS8Qum + jKURIcfg2Tkqh6cFWeUugooeQ1QcFWeygojqzGMhx0IuQQuyyl0EFT2GqDgqzmQFEdWZx0KOhVyCFmSV + uwgqegxRcVScyQoiqjOPhZw4edmf07MvZuzv32dQfWwXfH5HxXP8Z3zAk6nIy99457tDhBtLK6I8OxGA + FmSVXxzBMTgYR+XwGsGZXURjLOMXbSzkBWNRw4snz8E4KofXCM7sIhpjGQs5FvKCsajhxZPnYByVw2sE + Z3YRjbGMhRwLecFY1DCYvOzPeOcbC1TIKr84gmNwMI7K4TWCM7uIxljGL9pYyAvGooYXT56DcVQOrxGc + 2UU0xjIWcizkBWNRw4snz8E4KofXCM7sIhpjGQs5FvKCsahhMHnZnx1959tb/P+SyCDfrTyxJQAAAABJ + RU5ErkJggg== + + + \ No newline at end of file diff --git a/p2isPSX_CDToolkit/ScriptCheck.vb b/p2isPSX_CDToolkit/ScriptCheck.vb new file mode 100644 index 0000000..a2bb486 --- /dev/null +++ b/p2isPSX_CDToolkit/ScriptCheck.vb @@ -0,0 +1,413 @@ +Imports IO +Imports IO.Directory + +Public Class ScriptCheck + + Public files As New List(Of String) + Public CurFilenum As Integer + Public RRes As ScriptFile + Public OverallDial As Integer + Public CurDial As Integer + + Public CurX, CurY + Public CurColor As Color + Public CurShadColor As Color + Public IsNewWin As Boolean + Public FontData As List(Of Byte) + + Public Colors = New List(Of Color) + + 'Public CurEow As Integer + Public NextEowPointer As Integer + + Public SelectionCount As Integer + Public Cursel As Integer + + + Dim drawSurface As Bitmap + + + Private Sub ScriptCheck_Load(sender As Object, e As EventArgs) Handles MyBase.Load + FontData = My.Computer.FileSystem.ReadAllBytes("D:\Games\PSX\Persona.2.Innocent.Sin\Export\0059_00_0_0_U").ToList + Colors.Add(Color.Black) + Colors.Add(Color.FromArgb(238, 238, 238)) + Colors.Add(Color.FromArgb(24, 24, 24)) + Colors.Add(Color.FromArgb(156, 156, 156)) + Colors.Add(Color.FromArgb(49, 49, 49)) + Colors.Add(Color.FromArgb(246, 82, 131)) + Colors.Add(Color.FromArgb(24, 24, 24)) + Colors.Add(Color.FromArgb(148, 213, 255)) 'Persona2 TEXT PALETTE + Colors.Add(Color.FromArgb(24, 24, 49)) + Colors.Add(Color.FromArgb(131, 230, 131)) + Colors.Add(Color.FromArgb(24, 24, 24)) + Colors.Add(Color.FromArgb(230, 230, 74)) + Colors.Add(Color.FromArgb(49, 49, 24)) + Colors.Add(Color.FromArgb(255, 131, 49)) + Colors.Add(Color.FromArgb(49, 24, 24)) + + drawSurface = New Bitmap(PictureBox1.ClientSize.Width * 5, PictureBox1.ClientSize.Height * 5) + PictureBox1.Image = drawSurface + + + FilesLoad.PerformClick() + + End Sub + 'Private Sub PictureBox1_Paint(sender As Object, e As PaintEventArgs) Handles PictureBox1.Paint + ' e.Graphics.InterpolationMode = Drawing2D.InterpolationMode.NearestNeighbor + ' e.Graphics.ScaleTransform(3, 3) + ' e.Graphics.DrawImage(drawSurface, 0, 0) + 'End Sub + + + Private Sub FilesLoad_Click(sender As Object, e As EventArgs) Handles FilesLoad.Click + + files = IO.Directory.GetFiles(Dir.Text, "*.TRNSL").ToList + + CurFilenum = 0 + CurDial = 0 + If files.Count = 0 Then MsgBox("No TRNSL files in init directory!") : Exit Sub + InitFile(0) + + + End Sub + + Public Sub InitFile(ByVal id As Integer) + + Dim a = New ScriptTools + + RRes = New ScriptFile + a.ParseResource(My.Computer.FileSystem.ReadAllBytes(files(id)), RRes) + ' PictureBox2.Parent = PictureBox1 + + NextEowPointer = 0 + OverallDial = RRes.textPointers.Count + CurDial = 0 + + PrintText() + + + + + End Sub + + Public Sub PrintText() + + If IsNewWin Then ClearWinAndReset() + + UpdateCurFileDial() + + ShowDialodID(CurDial) + + + End Sub + + Public Sub ClearWinAndReset() + + PictureBox1.BackColor = Color.Transparent + PictureBox1.Invalidate() + drawSurface = New Bitmap(PictureBox1.ClientSize.Width * 5, PictureBox1.ClientSize.Height * 5) + PictureBox1.Image = drawSurface + + CurX = 4 + CurY = 4 + + IsNewWin = False + + End Sub + + + + Public Sub UpdateCurFileDial() + + CurFileText.Text = "f: " & CurFilenum + 1 & " / " & files.Count + CurFileName.Text = Split(files(CurFilenum), "\").ToList.Last + CurrentDial.Text = "w: " & CurDial + 1 & " / " & OverallDial + + ProgressBar1.Value = CurDial / OverallDial * 100 + + End Sub + + + Public Sub ShowDialodID(ByVal id As Integer) + + Dim m As List(Of Byte) = RRes.Text + + + Dim a = RRes.textPointers(id) 'counter + DemoText.Text = "" + + If NextEowPointer <> 0 Then a = NextEowPointer + + Do + Dim c = get2(m, a) + If c = &H122E Then 'Парсим код цвета текста + CurColor = Colors(get2(m, a + 2)) + CurShadColor = Colors(get2(m, a + 2) + 1) + a += 4 + GoTo endlineTest + End If + + + If c = &H1101 Then DemoText.Text &= vbCrLf : CurX = 3 : CurY += 14 : a += 2 : GoTo endlineTest ' Перенос строки + If c = &H1131 Then DemoText.Text &= " " : CurX += 4 : a += 2 : GoTo endlineTest ' Табуляция (+12 пикс) + + If c = &H1208 Then DemoText.Text &= "[SelectionMenu][" & get2(m, a + 2) & "]" : SelectionCount = get2(m, a + 2) : Cursel = 0 : a += 4 : GoTo endlineTest ' Пауза 1с при воспроизведении диалога + + If c = &H1121 Then + For vv = 0 To 3 : DrawChar(Asc("Суоу"(vv))) : Next + a += 2 : GoTo endlineTest + End If + 'Имя игрока + If c = &H1120 Then + For vv = 0 To 4 : DrawChar(Asc("Тацуя"(vv))) : Next + a += 2 + GoTo endlineTest 'Фамилия игрока + End If + + 'Кликуха + If c = 4372 Then + For vv = 0 To 3 : DrawChar(Asc("Тацу"(vv))) : Next + a += 2 + GoTo endlineTest 'Кликуха + End If + + If c = &H1106 Then + If get2(m, a + 2) = &H1102 Then + If get2(m, a + 4) = &H1103 Then 'Закрыть окна диалога! + IsNewWin = True + NextEowPointer = 0 + Exit Do + Else + NextEowPointer = a + 4 'След диалог без закрытия окна + Exit Do + End If + End If + End If + If c = &H1109 Then + If get2(m, a + 2) = &H1102 Then + If get2(m, a + 4) = &H1103 Then 'Выбор варианта ответа! + IsNewWin = True + SelectionCount = 0 : Cursel = 0 + a += 6 : GoTo endlineTest + End If + End If + End If + + + + If c = &H1103 Then Exit Do + + If c And &H1000 Then 'COMMAND PARSE + + Dim comLen = c >> 8 + comLen = comLen And &HF 'command length check + 'Dim comCode = c And &HFF + + a += comLen * 2 'Jump command + GoTo endlineTest + + + + ElseIf c And &H2000 Then 'Если строка в моём однобайтном формате + + Dim charNum = c And &HFF + a += 2 + For x = 1 To charNum + DemoText.Text &= Chr(m(a)) + DrawChar(m(a)) + a += 1 + Next + If charNum And 1 Then a += 1 'if AND1 - +1 + GoTo endlineTest + + End If + + 'draw any char from font! + DrawChar(c) + a += 2 + + +endlineTest: + + 'Читаем до следующего текст-поинтера или конца массива + If id < RRes.textPointers.Count - 1 Then + If a >= RRes.textPointers(id + 1) Then Exit Do + Else + If a >= m.Count - 1 Then Exit Do + + End If + + + + Loop + + + + End Sub + + Public Sub DrawChar(ByVal chr As Integer) + + Dim f = New FontTools + Dim readAddr = 1152 + 18 * chr '18 bytes per char + + 'making shadow + + For a = 0 To 5 + Dim b1 As Byte = FontData(readAddr + (a * 3)) + Dim b2 As Byte = FontData(readAddr + (a * 3) + 1) + Dim b3 As Byte = FontData(readAddr + (a * 3) + 2) + Dim b1bits = New BitArray(BitConverter.GetBytes(b1)) + Dim b2bits = New BitArray(BitConverter.GetBytes(b2)) + Dim b3bits = New BitArray(BitConverter.GetBytes(b3)) + For x = 0 To 7 + If b1bits(x) Then drawpixel(x + CurX + 1, CurY + 1, True) + Next + + Dim addX = CurX + 9 + For x = 0 To 7 + If b2bits(x) Then drawpixel(x + addX, CurY + 1, True) + If x = 3 Then addX -= 12 : CurY += 1 + Next + + For x = 0 To 7 + If b3bits(x) Then drawpixel(x + CurX + 5, CurY + 1, True) + Next + CurY += 1 + Next + + CurY -= 12 + + 'making char + + For a = 0 To 5 + Dim b1 As Byte = FontData(readAddr + (a * 3)) + Dim b2 As Byte = FontData(readAddr + (a * 3) + 1) + Dim b3 As Byte = FontData(readAddr + (a * 3) + 2) + Dim b1bits = New BitArray(BitConverter.GetBytes(b1)) + Dim b2bits = New BitArray(BitConverter.GetBytes(b2)) + Dim b3bits = New BitArray(BitConverter.GetBytes(b3)) + For x = 0 To 7 + If b1bits(x) Then drawpixel(x + CurX, CurY, False) + Next + + Dim addX = CurX + 8 + For x = 0 To 7 + If b2bits(x) Then drawpixel(x + addX, CurY, False) + If x = 3 Then addX -= 12 : CurY += 1 + Next + + For x = 0 To 7 + If b3bits(x) Then drawpixel(x + CurX + 4, CurY, False) + Next + CurY += 1 + Next + + + + PictureBox1.Invalidate() + CurY -= 12 + CurX += 6 + End Sub + + + + Public Sub drawpixel(ByVal x As Integer, ByVal y As Integer, ByVal isShadow As Boolean) + + For a = 0 To 2 + For b = 0 To 2 + If isShadow Then + drawSurface.SetPixel(x * 3 + a, y * 3 + b, CurShadColor) + Else + drawSurface.SetPixel(x * 3 + a, y * 3 + b, CurColor) + End If + Next + Next + + + End Sub + + Public Function get2(ByRef f As List(Of Byte), ByVal Index As Integer) + Return f(Index) + f(Index + 1) * 256 + End Function + + Private Sub NxFile_Click(sender As Object, e As EventArgs) Handles NxFile.Click + If CurFilenum = files.Count - 1 Then + + CurFilenum = 0 + Else + CurFilenum += 1 + End If + + + + InitFile(CurFilenum) + UpdateCurFileDial() + + + End Sub + + Private Sub PrevFile_Click(sender As Object, e As EventArgs) Handles PrevFile.Click + If CurFilenum = 0 Then CurFilenum = files.Count + + + CurFilenum -= 1 + + InitFile(CurFilenum) + UpdateCurFileDial() + + End Sub + + + + Private Sub NxDial_Click(sender As Object, e As EventArgs) Handles NxDial.Click + If NextEowPointer <> 0 Then PrintText() : Exit Sub + + If CurDial = OverallDial - 1 Then + CurDial = 0 + If CurFilenum <> files.Count - 1 Then + CurFilenum += 1 + InitFile(CurFilenum) + UpdateCurFileDial() + End If + Else + CurDial += 1 + End If + + + + PrintText() + + End Sub + + Private Sub srch_Click(sender As Object, e As EventArgs) Handles srch.Click + Dim a = files.FindIndex(Function(x) x.Contains(IDsrch.Text)) + + If a = -1 Then + MsgBox("File not found :(") + Exit Sub + Else + InitFile(a) + CurFilenum = a + UpdateCurFileDial() + End If + + + End Sub + + Private Sub prevDial_Click(sender As Object, e As EventArgs) Handles prevDial.Click + If CurDial = 0 Then CurDial = OverallDial + NextEowPointer = 0 + CurDial -= 1 + PrintText() + End Sub + + Private Sub Editor_Click(sender As Object, e As EventArgs) Handles Editor.Click + Dim fil = Replace("""C:\Program Files (x86)\Notepad++\Notepad++.exe"" """ & files(CurFilenum) & """", ".TRNSL", "") + + Shell(fil) + End Sub + + Private Sub ScriptCheck_KeyDown(sender As Object, e As KeyEventArgs) Handles Me.KeyDown + If e.KeyCode = Keys.Add Then NxDial.PerformClick() + End Sub +End Class \ No newline at end of file diff --git a/p2isPSX_CDToolkit/ScriptTools.vb b/p2isPSX_CDToolkit/ScriptTools.vb new file mode 100644 index 0000000..00abc00 --- /dev/null +++ b/p2isPSX_CDToolkit/ScriptTools.vb @@ -0,0 +1,1853 @@ +Imports System.IO +Imports System.Text +Imports System.Runtime.Remoting.Metadata.W3cXsd2001 + +Public Class ScriptTools + + Public Eng As Boolean + Public JapTextCounter As Integer + Public ColorCodes As List(Of CodeObject) + Public SpecialCodes As List(Of CodeObject) + Public Names As List(Of NameElement) + + Public ScriptCodes As List(Of CodeObject) + + Public Sub New() + + 'Dim e = New Ionic.Zlib.DeflateStream(,) + + + + ColorCodes = New List(Of CodeObject) + + ColorCodes.Add(New CodeObject With {.code = 11, .value = "yellow"}) + ColorCodes.Add(New CodeObject With {.code = 1, .value = "white"}) + ColorCodes.Add(New CodeObject With {.code = 3, .value = "gray"}) + ColorCodes.Add(New CodeObject With {.code = 5, .value = "pink"}) + ColorCodes.Add(New CodeObject With {.code = 7, .value = "blue"}) + ColorCodes.Add(New CodeObject With {.code = 9, .value = "green"}) + ColorCodes.Add(New CodeObject With {.code = 13, .value = "orange"}) + ColorCodes.Add(New CodeObject With {.code = 4, .value = "gray4"}) + ColorCodes.Add(New CodeObject With {.code = 18, .value = "color18"}) + + + + + SpecialCodes = New List(Of CodeObject) + SpecialCodes.Add(New CodeObject With {.code = &H1C0, .value = "Jkrestik"}) + 'SpecialCodes.Add(New CodeObject With {.code = &H2F8, .value = "Jkvadrat"}) + SpecialCodes.Add(New CodeObject With {.code = &H343, .value = "Jcircle"}) + SpecialCodes.Add(New CodeObject With {.code = &H642, .value = "Jtreug"}) + SpecialCodes.Add(New CodeObject With {.code = &H66B, .value = "JskobkL"}) + SpecialCodes.Add(New CodeObject With {.code = &H66C, .value = "JskobkR"}) + SpecialCodes.Add(New CodeObject With {.code = &H67E, .value = "Jheart"}) + SpecialCodes.Add(New CodeObject With {.code = &H6F4, .value = "Jdoublekrug"}) + SpecialCodes.Add(New CodeObject With {.code = &H70F, .value = "Jmelody"}) + SpecialCodes.Add(New CodeObject With {.code = &H716, .value = "Jfilledkrug"}) + SpecialCodes.Add(New CodeObject With {.code = &H717, .value = "Jfilledtriag"}) + SpecialCodes.Add(New CodeObject With {.code = &H7EA, .value = "Jstar"}) + SpecialCodes.Add(New CodeObject With {.code = &H96E, .value = "Jmale"}) + SpecialCodes.Add(New CodeObject With {.code = &H96F, .value = "Jfemale"}) + SpecialCodes.Add(New CodeObject With {.code = &H999, .value = "Jcircle2"}) + SpecialCodes.Add(New CodeObject With {.code = &H9AC, .value = "JrotateL"}) + SpecialCodes.Add(New CodeObject With {.code = &H9AD, .value = "JrotateR"}) + SpecialCodes.Add(New CodeObject With {.code = &H9C3, .value = "Jsquare2"}) + + + + Names = New List(Of NameElement) + Names.Add(New NameElement With {.Codes = "2C012D01", .Dehash = "Майя"}) + Names.Add(New NameElement With {.Codes = "ыь", .Dehash = "Эйкичи"}) + Names.Add(New NameElement With {.Codes = "2ѓ>", .Dehash = "Гинко"}) + Names.Add(New NameElement With {.Codes = "БУ", .Dehash = "Лиза"}) + Names.Add(New NameElement With {.Codes = "2E01", .Dehash = "Дзюн"}) + Names.Add(New NameElement With {.Codes = "87048705", .Dehash = "Фудзи"}) + Names.Add(New NameElement With {.Codes = "4D021500C700", .Dehash = "Юкино"}) + Names.Add(New NameElement With {.Codes = "1E07C201", .Dehash = "Кацуя"}) + Names.Add(New NameElement With {.Codes = "1100A000A000", .Dehash = "Улала"}) + Names.Add(New NameElement With {.Codes = "46081705F6048D004707", .Dehash = "Капитан Симадзу"}) + Names.Add(New NameElement With {.Codes = "0604D601F902DB00", .Dehash = "Саеко"}) + Names.Add(New NameElement With {.Codes = "83013501CA003602", .Dehash = "Баофу"}) + Names.Add(New NameElement With {.Codes = "0604D601F902DB00", .Dehash = "Саеко"}) + Names.Add(New NameElement With {.Codes = "0604D601F902DB00", .Dehash = "Саеко"}) + Names.Add(New NameElement With {.Codes = "0604D601F902DB00", .Dehash = "Саеко"}) + Names.Add(New NameElement With {.Codes = "0604D601F902DB00", .Dehash = "Саеко"}) + + + 'Script codes + ScriptCodes = New List(Of CodeObject) + ScriptCodes.Add(New CodeObject With {.code = &H60, .value = "__GetVar"}) + ScriptCodes.Add(New CodeObject With {.code = &H1, .value = "_if1Go>>"}) + ScriptCodes.Add(New CodeObject With {.code = &H2, .value = "_if0Go>>"}) + ScriptCodes.Add(New CodeObject With {.code = &H4, .value = "_if!=Go>"}) + 'ScriptCodes.Add(New CodeObject With {.code = &H1, .value = "_DialEnd"}) + ScriptCodes.Add(New CodeObject With {.code = &H6, .value = "if>!= "-----INIT SECTION" Then MsgBox("File not valid (no init section)") : Exit Sub + If t(2) <> "-----CHARACTER DATA SECTION" Then MsgBox("File not valid (no chardata section)") : Exit Sub + If t(4) <> "-----POINTERS DATA SECTION" Then MsgBox("File not valid (no pointers section)") : Exit Sub + If t(6) <> "-----SCRIPT DATA SECTION" Then MsgBox("File not valid (no script section)") : Exit Sub + If t(8) <> "-----TEXT SECTION" Then MsgBox("File not valid (no TEXT section)") : Exit Sub + + 'Recompiling scripts + + 'Init + Dim t1 = Split(t(1), ",").ToList + If t1.Count <> 6 Then MsgBox("Not valid init section!") : Exit Sub + + For Each ii In t1 + If Not IsNumeric(ii) Then MsgBox("Not numeric in INIT sect") : Exit Sub + f.AddRange(BitConverter.GetBytes(Convert.ToInt32(ii)).ToList) + Next + + 'CharData + Dim t3 = Split(t(3), ",").ToList + If t3.Count <> BitConverter.ToInt32(f.ToArray, 8) * 72 / 4 Then MsgBox("Not valid CHAR section!") : Exit Sub + + For Each ii In t3 + If Not IsNumeric(ii) Then MsgBox("Not numeric in CHAR sect") : Exit Sub + f.AddRange(BitConverter.GetBytes(Convert.ToInt32(ii)).ToList) + Next + + + 'PointersData + Dim t5 = Split(t(5), ",").ToList + If t5.Count <> (BitConverter.ToInt32(f.ToArray, 16) - BitConverter.ToInt32(f.ToArray, 12)) / 4 Then MsgBox("Not valid REFS section!") : Exit Sub + + For ii = 0 To t5.Count - 1 + + If Not IsNumeric(t5(ii)) Then MsgBox("Not numeric in REFS sect") : Exit Sub + If ii Mod 2 = 0 Then 'Если это параметр 13h (с чётным номером байта) - добавляем адрес в таблицу поинтеров текста + Dim bts() = BitConverter.GetBytes(Convert.ToInt32(t5(ii))) + If bts(0) = &H13 And bts(1) = 0 And bts(2) = 0 Then + TextPointers.Add(t5(ii + 1)) + End If + + If bts(0) = &HF And bts(1) = 1 And bts(2) = 0 Then + TextInputComparePointers.Add(t5(ii + 1)) + End If + + End If + + + + + f.AddRange(BitConverter.GetBytes(Convert.ToInt32(t5(ii))).ToList) + Next + + 'ScriptsData + Dim t7 = Split(t(7), ",").ToList + If t7.Count <> (BitConverter.ToInt32(f.ToArray, 20) - BitConverter.ToInt32(f.ToArray, 16)) / 4 Then MsgBox("Not valid SCRIPT section!") : Exit Sub + + For Each ii In t7 + If Not IsNumeric(ii) Then MsgBox("Not numeric in SCRIPT sect") : Exit Sub + f.AddRange(BitConverter.GetBytes(Convert.ToInt32(ii)).ToList) + Next + + + Dim idsection As Boolean = True + + 'Разбор текста и запихивание его в файл + Dim tx = Split(txt, "-----TEXT SECTION" & vbCrLf)(1) + Dim x = 0 + Dim accum = New List(Of Byte) + Dim currentDialog As Integer + Dim currentInputCompare As Integer + Do + + 'Comments to end of line! + If tx(x) = "\" And tx(x + 1) = "\" Then + getEndOfLine(tx, x) + Continue Do + End If + + + If tx(x) = "[" Then + Dim skRes = getFromSkobki(tx, x) + + If skRes = "input" Then 'Формирование данных для сравнения введённого текста. Нужно переписать поинтер последующего текста + + f(TextInputComparePointers(currentInputCompare)) = BitConverter.GetBytes(accum.Count)(0) + f(TextInputComparePointers(currentInputCompare) + 1) = BitConverter.GetBytes(accum.Count)(1) 'Установка поинтера для сравнения введённого в игре текста + f(TextInputComparePointers(currentInputCompare) + 2) = BitConverter.GetBytes(accum.Count)(2) + currentInputCompare += 1 + + 'Здесь заносим данные для сравнения посимвольно + Do While tx(x) <> "[" + If tx(x) & tx(x + 1) = vbCrLf Then accum.AddRange({&H1, &H11}) : LineCount += 1 : x += 2 : Continue Do + accum.AddRange({Asc(tx(x)), 0}) 'simple char + x += 1 + Loop + + skRes = getFromSkobki(tx, x) + If skRes = "EOD3" Then + accum.AddRange({&H3, &H11}) + f(TextPointers(currentDialog)) = BitConverter.GetBytes(accum.Count)(0) + f(TextPointers(currentDialog) + 1) = BitConverter.GetBytes(accum.Count)(1) 'Обновляем последний поинтер на текст + f(TextPointers(currentDialog) + 2) = BitConverter.GetBytes(accum.Count)(2) : x += 2 : idsection = True : Continue Do + 'Полной конец всех строк для проверки + включаем секцию ID для проверки. + Else + MsgBox("Invalid exit from input test! " & inputJfile) : Exit Sub + End If + End If + + + If IsNumeric(skRes) And idsection Then + idsection = False + If currentDialog <> skRes Then + MsgBox("Error in IDs!" & vbCrLf & " id: " & currentDialog & vbCrLf & "SkRes: " & skRes & vbCrLf & "F: " & inputJfile, MsgBoxStyle.Critical) + Exit Sub + End If + DialCount += 1 + x = x + 2 + Continue Do 'its simple ID + End If + + If skRes = "EOD" Then + accum.AddRange({&H6, &H11, &H2, &H11, &H3, &H11}) : currentDialog += 1 + If currentDialog > TextPointers.Count - 1 Then Exit Do 'Last DIAL in file, but not EOF + f(TextPointers(currentDialog)) = BitConverter.GetBytes(accum.Count)(0) + f(TextPointers(currentDialog) + 1) = BitConverter.GetBytes(accum.Count)(1) 'Its NEW LINE + f(TextPointers(currentDialog) + 2) = BitConverter.GetBytes(accum.Count)(2) + If tx(x) & tx(x + 1) = vbCrLf Then x += 2 : idsection = True : Continue Do + End If + + If skRes = "EOD723" Then + accum.AddRange({&H7, &H11, &H2, &H11, &H3, &H11}) : currentDialog += 1 + If currentDialog > TextPointers.Count - 1 Then Exit Do 'Last DIAL in file, but not EOF + f(TextPointers(currentDialog)) = BitConverter.GetBytes(accum.Count)(0) + f(TextPointers(currentDialog) + 1) = BitConverter.GetBytes(accum.Count)(1) 'Its NEW LINE + f(TextPointers(currentDialog) + 2) = BitConverter.GetBytes(accum.Count)(2) : x += 2 : idsection = True : Continue Do + End If + + If skRes = "EOD3" Then + accum.AddRange({&H3, &H11}) : currentDialog += 1 + f(TextPointers(currentDialog)) = BitConverter.GetBytes(accum.Count)(0) + f(TextPointers(currentDialog) + 1) = BitConverter.GetBytes(accum.Count)(1) 'Its NEW LINE + f(TextPointers(currentDialog) + 2) = BitConverter.GetBytes(accum.Count)(2) : x += 2 : idsection = True : Continue Do + End If + + + + If skRes = "EOw" Then + accum.AddRange({&H6, &H11, &H2, &H11}) 'Its END OF WINDOW + Continue Do + End If + + If skRes = "EndSelection" Then + accum.AddRange({&H9, &H11, &H2, &H11, &H3, &H11}) : currentDialog += 1 + If currentDialog > TextPointers.Count - 1 Then currentDialog -= 1 : Exit Do 'Last DIAL in file + f(TextPointers(currentDialog)) = BitConverter.GetBytes(accum.Count)(0) + f(TextPointers(currentDialog) + 1) = BitConverter.GetBytes(accum.Count)(1) 'Its NEW LINE + f(TextPointers(currentDialog) + 2) = BitConverter.GetBytes(accum.Count)(2) + If tx(x) & tx(x + 1) = vbCrLf Then x += 2 : idsection = True : Continue Do + End If + + If skRes = "EOF" Then accum.AddRange({&H6, &H11, &H2, &H11, &H3, &H11}) : Exit Do 'END OF FILE! + If skRes = "EOF3" Then accum.AddRange({&H3, &H11}) : Exit Do 'END OF FILE! + If skRes = "EOF723" Then accum.AddRange({&H7, &H11, &H2, &H11, &H3, &H11}) : Exit Do 'END OF FILE! + + + If skRes = "surname" Then accum.AddRange({&H20, &H11}) : Continue Do '2011 - surname!!! + If skRes = "name" Then accum.AddRange({&H21, &H11}) : Continue Do + '2211 - Nick + + If skRes = "pause" Then + accum.AddRange({&H5, &H12}) + If tx(x) <> vbCr And tx(x) <> "[" Then 'NEED TO CONVERT BACK! + accum.AddRange({Math.Abs(Asc(tx(x)) - 32), 0}) : x += 1 : Continue Do 'Pause + 2 byte length (30 ~ 1 sec) + Else + If tx(x) = "[" Then + + accum.Add(getFromSkobki(tx, x)) + accum.Add(0) : Continue Do + Else + accum.AddRange({15, 0}) : Continue Do + End If + + End If + Continue Do + End If + If skRes = "SelectionMenu" Then accum.AddRange({&H8, &H12}) : Continue Do + + If skRes = "EOw0000" Then accum.AddRange({0, 0}) : Continue Do + + If skRes.Length = 4 Then 'Try to parse other hex codes + accum.AddRange(SoapHexBinary.Parse(skRes).Value.ToList) + 'x += 2 + Continue Do + + End If + + If IsNumeric(skRes) Then + accum.AddRange(BitConverter.GetBytes(Convert.ToInt16(skRes)).ToList) + Continue Do + 'Simply Code + Else + If skRes.Length > 4 Then + Dim d As String = skRes + If d.Substring(0, 4) = "col=" Then + Dim a As Byte = ColorCodes.Find(Function(q) q.value = d.Substring(4)).code 'color command + accum.AddRange({&H2E, &H12}) + accum.AddRange({a, &H0}) + Continue Do + End If + + Dim spec As CodeObject = SpecialCodes.Find(Function(q) q.value = skRes) 'Special code convert IF + If Not IsNothing(spec) Then + accum.AddRange(BitConverter.GetBytes(Convert.ToInt16(spec.code)).ToList) + Continue Do + End If + + End If + + End If + + + End If + + If tx(x) = vbTab Then accum.AddRange({&H31, &H11}) : x += 1 : Continue Do 'Tab and enter + + If tx(x) & tx(x + 1) = vbCrLf Then accum.AddRange({&H1, &H11}) : LineCount += 1 : x += 2 : Continue Do + If tx(x) = vbLf Then accum.AddRange({&H1, &H11}) : LineCount += 1 : x += 1 : Continue Do + + If Form1.NewTextMODE.Checked Then 'Новый режим вывода текста!!! + Dim SimpleTextAccum = New List(Of Byte) + Dim readCounter As Byte = 1 + + Do + If Asc(tx(x)) < 32 Or Asc(tx(x)) = 91 Then x -= 1 : Exit Do + SimpleTextAccum.Add(Asc(tx(x))) + x += 1 + Loop + + 'if 1 or 2 bytes + If SimpleTextAccum.Count = 1 Then accum.AddRange({SimpleTextAccum(0), 0}) : GoTo Exitif + If SimpleTextAccum.Count = 2 Then accum.AddRange({SimpleTextAccum(0), 0, SimpleTextAccum(1), 0}) : GoTo Exitif + If SimpleTextAccum.Count = 0 Then GoTo Exitif + + accum.Add(SimpleTextAccum.Count) + If SimpleTextAccum.Count > 47 Then Debug.WriteLine("W: text > 47(" & SimpleTextAccum.Count & ") Dial: " & currentDialog & " File: " & inputJfile & " ---" & String.Join("", SimpleTextAccum.ToArray)) + accum.Add(&H20) 'command & length + accum.AddRange(SimpleTextAccum) 'attach textline + If SimpleTextAccum.Count And 1 Then accum.Add(0) ' if and 1 - add empty byte + Else + accum.AddRange({Asc(tx(x)), 0}) 'Finally - simple char + End If +Exitif: + + x += 1 + Loop While x < tx.Length - 1 + + If currentDialog <> TextPointers.Count - 1 Then + MsgBox("Pointers dont match text!" & vbCrLf & inputJfile & vbCrLf & "EODs: " & currentDialog + 1 & " <> pointers: " & TextPointers.Count) + + End If + + f.AddRange(accum) + Dim fArr = f.ToArray + + + 'Сохраняем выходной файл + My.Computer.FileSystem.WriteAllBytes(inputJfile & ".TRNSL", f.ToArray, False) + 'MsgBox("Imported. Saved to " & inputJfile & ".TRNSL") + + End Sub + + 'Scobki encoding + Public Function getFromSkobki(ByRef tx As String, ByRef x As Integer) + x = x + 1 + Dim accum = "" + Do While tx(x) <> "]" + accum &= tx(x) + x += 1 + Loop + x += 1 + Return accum + + End Function + + Public Sub getEndOfLine(ByRef tx As String, ByRef x As Integer) + + Do + x += 1 + Loop While tx(x) <> vbCr And tx(x + 1) <> vbLf + x += 2 + + End Sub + + Public Sub ExportTextFile(ByVal inputJfile As String, ByVal inputEfile As String) + + If Not File.Exists(inputJfile) Then MsgBox("Japanese resource file not found!!", MsgBoxStyle.Critical) : Exit Sub + Dim JRes = New ScriptFile + Dim ERes = New ScriptFile + + Dim JapBytes = My.Computer.FileSystem.ReadAllBytes(inputJfile) + + JRes.filename = Path.GetFileNameWithoutExtension(inputJfile) + + If File.Exists(inputEfile) Then + Eng = True + ERes.filename = Path.GetFileNameWithoutExtension(inputEfile) + ParseResource(My.Computer.FileSystem.ReadAllBytes(inputEfile), ERes) + ParseText(ERes, True) + End If + + ParseResource(JapBytes, JRes) + ParseText(JRes, False) + + + Dim combText = CombineParsedText(ERes, JRes) + If IsNothing(combText) Then Exit Sub + + Dim combResData = compileData(JRes) + + If JRes.Text.Count = 0 Then Exit Sub + My.Computer.FileSystem.WriteAllText(inputJfile & ".txt", combResData & combText, False) + + End Sub + + Public Function ConvertPSPTextFile(ByVal JapBytes As Byte()) + + + Dim JRes = New ScriptFile + Dim ERes = New ScriptFile + + ParseResource(JapBytes, JRes) + ParseText(JRes, False) + + Dim combText = CombineParsedText(ERes, JRes) + If IsNothing(combText) Then Return "" + + Dim combResData = compileData(JRes) + + If JRes.Text.Count = 0 Then Return "" + 'My.Computer.FileSystem.WriteAllText(inputJfile & ".txt", combResData & combText, False, Encoding.GetEncoding(1251)) + + Return combResData & combText + + + End Function + + + Public Function compileData(ByRef JRes As ScriptFile) + + Dim txt As String = "-----INIT SECTION" & vbCrLf + txt &= $"{JRes.hz1},{JRes.hz2},{JRes.CharsCount},{JRes.RefsTablePointer},{JRes.ScriptTablePointer},{JRes.StartTextPointer}" & vbCrLf + + txt &= "-----CHARACTER DATA SECTION" & vbCrLf + Dim cdata = JRes.CharsArr.ToArray + For a = 0 To JRes.CharsCount * 72 - 1 Step 4 + txt &= BitConverter.ToInt32(cdata, a) & "," + Next + + txt = txt.Substring(0, txt.Length - 1) 'Отрезаем последнюю запятую + + txt &= vbCrLf & "-----POINTERS DATA SECTION" & vbCrLf + For a = 0 To JRes.refstable.Count - 1 + txt &= JRes.refstable(a) & "," + Next + + txt = txt.Substring(0, txt.Length - 1) 'Отрезаем последнюю запятую + + txt &= vbCrLf & "-----SCRIPT DATA SECTION" & vbCrLf + For a = 0 To JRes.ScriptsTable.Count - 1 + txt &= JRes.ScriptsTable(a) & "," + Next + txt = txt.Substring(0, txt.Length - 1) 'Отрезаем последнюю запятую + + Return txt & vbCrLf + + End Function + + + Public Function CombineParsedText(ByRef ERes As ScriptFile, ByRef JRes As ScriptFile) + Dim txt As String = "-----TEXT SECTION" & vbCrLf + + If Not IsNothing(ERes.ParsedText) Then 'if englist is loaded + If ERes.ParsedText.Count <> JRes.ParsedText.Count Then + MsgBox(String.Format("Error parsing text! Eng and jap dialogs doesnt have same count!!! {0} vs {1}" & vbCrLf & "{2}", ERes.ParsedText.Count, JRes.ParsedText.Count, JRes.filename)) + Return Nothing + End If + + End If + + For p = 0 To JRes.ParsedText.Count - 1 + + If Not IsNothing(ERes.ParsedText) Then 'load english version in comment + Dim etxt = Split(ERes.ParsedText(p), vbCrLf) + txt &= "\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\" & vbCrLf + For Each t In etxt + If Form1.UnKudosScript.Checked Then t = StringsOffsetEditorvb.Unkudos(t) + txt &= "\\ " & t & vbCrLf + Next + End If + txt &= "[" & p & "]" & vbCrLf + txt &= JRes.ParsedText(p) & vbCrLf + + Next + + Return txt + + + End Function + + 'specialCodesParse + 'c001 f802 4303 4206 6b06 6c06 7e06 f406 0f07 1607 1707 ea07 6e09 6f09 9909 ac09 ad09 c309 + + + + Public Sub ParseText(ByRef Res As ScriptFile, ByVal isEnglish As Boolean) + + Res.ParsedText = New List(Of String) + Dim a = 0 'counter + Dim txt As String = "" + + If Res.Text.Count = 0 Then Exit Sub + + Dim m As List(Of Byte) = Res.Text + + If Not isEnglish Then GoTo isJapanese + + + ' BitConverter.IsLittleEndian = False + + + Do + Dim c = get2(m, a) + 'Dim c = Res.Text(a) + + If c = &H122E Then Dim c2 = get2(m, a + 2) : txt &= "[" & ColorCodes.Find(Function(q) q.code = c2).value & "]" : a += 4 : Continue Do ' код цвета + If c = &H1101 Then + txt &= vbCrLf + a += 2 + Continue Do ' Перенос строки + End If + If c = &H1208 Then txt &= "[Sel=" & get2(m, a + 2) & "]" : a += 4 : Continue Do + + If c = &H1121 Then txt &= "[name]" : a += 2 : Continue Do 'Имя игрока из IS + If c = &H1120 Then txt &= "[surname]" : a += 2 : Continue Do 'Фамилия игрока из IS + 'If c = &H1122 Then txt &= "[surname]" : a += 2 : Continue Do 'Фамилия игрока из IS + + + + 'If c = 5 Then + + ' If Res.Text(a + 1) = &H1E Then + ' txt &= "[p]" : a += 2 : Continue Do 'Пауза + + ' End If + 'End If + + 'ЧИТАЕМ ТЕКСТ + If c = &H1136 Then + + a += 2 + Dim curChr As Byte + Do + curChr = m(a) + If curChr = 0 Then a += 1 : Exit Do + txt &= Chr(curChr) + a += 1 + Loop + + If a And 1 Then a += 1 + + Continue Do + + End If + + 'SIMPLE CHAR WITHOUT COMMAND + + Dim aaa = SpecialCodes.Find(Function(q) q.code = c) + If IsNothing(aaa) Then + 'Dim curCode0 = BitConverter.GetBytes(c)(0) 'Обрабатываем первый байт иероглифа и заменяем печатным текстом + 'If curCode0 < 32 Then curCode0 += 32 + txt &= m(a).ToString("X2") & m(a + 1).ToString("X2") + Else + txt &= "[" & aaa.value & "]" 'Если есть специальный код + End If + + + a += 2 + Dim PointIndex As Integer = Res.textPointers.FindIndex(Function(x) x = a) + + 'Если дошли до след строки в поинтерах или это байт вне файла, то добавляем последнюю строку и выходим + If PointIndex > 0 Or a = Res.Text.Count Then + Res.ParsedText.Add(txt) : txt = "" + End If + + + Loop While a < Res.Text.Count + + + Exit Sub +isJapanese: + + + Do + Dim c = get2(m, a) + If c = &H122E Then 'Парсим код цвета текста + txt &= "[col=" & ColorCodes.Find(Function(q) q.code = get2(m, a + 2)).value & "]" + a += 4 + GoTo endlineTest + End If + + + + If c = &H1101 Then txt &= vbCrLf : a += 2 : GoTo endlineTest ' Перенос строки + If c = &H1120 Then txt &= " " : a += 2 : GoTo endlineTest ' PSP Space!!! + If c = &H1131 Then txt &= vbTab : a += 2 : GoTo endlineTest ' Табуляция (+12 пикс) + If c = &H1205 Then txt &= "[pause][" & get2(m, a + 2) & "]" : a += 4 : GoTo endlineTest ' Пауза при воспроизведении диалога + If c = &H1208 Then txt &= "[SelectionMenu][" & get2(m, a + 2) & "]" : a += 4 : GoTo endlineTest ' Пауза 1с при воспроизведении диалога + + + If c = &H1121 Then txt &= "[name]" : a += 2 : GoTo endlineTest 'Имя игрока + If c = &H1122 Then txt &= "[surname]" : a += 2 : GoTo endlineTest 'Фамилия игрока + + + If c = &H1109 Then + If get2(m, a + 2) = &H1102 Then + If get2(m, a + 4) = &H1103 Then 'Выбор варианта ответа! + txt &= "[EndSelection]" + 'Res.ParsedText.Add(txt) : txt = "" + a += 6 : GoTo endlineTest + End If + End If + End If + + + If c = &H1106 Then + If get2(m, a + 2) = &H1102 Then + If get2(m, a + 4) = &H1103 Then 'Закрыть окна диалога! + If a + 6 > m.Count - 1 Then txt &= "[EOF]" Else txt &= "[EOD]" 'End of Dialog or End of File + 'Res.ParsedText.Add(txt) : txt = "" + a += 6 : GoTo endlineTest + Else + If a + 6 > m.Count - 1 Then txt &= "[EOF]" Else txt &= "[EOw]" 'End of WINDOW without close! + 'Res.ParsedText.Add(txt) : txt = "" : + a += 4 : GoTo endlineTest + End If + End If + End If + + + If c = &H1103 Then + If a + 4 > m.Count - 1 Then txt &= "[EOF3]" Else txt &= "[EOD3]" 'End of Dialog or End of File + a += 2 : GoTo endlineTest + End If + + + + If c And &H1000 Then 'COMMAND PARSE + + Dim comLen = c >> 8 'command length check + Dim comCode = c And &HFF + + + Dim c1 = m(a) : Dim c2 = m(a + 1) + + Dim gg = c2 And 15 + + 'Dim gg = comLen + + For byteskip = 1 To gg + txt &= "[" & c1.ToString("X2") & c2.ToString("X2") & "]" + a += 2 + c1 = m(a) : c2 = m(a + 1) + Next + + + + ElseIf c And &H2000 Then 'Если строка в моём однобайтном формате + + Dim charNum = c And &HFF + a += 2 + For x = 1 To charNum + txt &= Chr(m(a)) + a += 1 + Next + If charNum And 1 Then a += 1 'if AND1 - +1 + GoTo endlineTest + + Else + + 'SIMPLE CHAR WITHOUT COMMAND + + Dim aaa = SpecialCodes.Find(Function(q) q.code = c) + If IsNothing(aaa) Then + 'Dim curCode0 = BitConverter.GetBytes(c)(0) 'Обрабатываем первый байт иероглифа и заменяем печатным текстом + 'If curCode0 < 32 Then curCode0 += 32 + + 'txt &= m(a).ToString("X2") & m(a + 1).ToString("X2") + txt &= Form1.chars(m(a) + m(a + 1) * 256) + + 'txt &= Chr(m(a)) & Chr(m(a + 1)) + Else + txt &= "[" & aaa.value & "]" 'Если есть специальный код + End If + + 'отправляем в файл + + a += 2 'Двигаем на 2 байта вперёд + + End If + + +endlineTest: + + + Dim PointIndex As Integer = Res.textPointers.FindIndex(Function(x) x = a) + 'Если дошли до след строки в поинтерах или это байт вне файла, то добавляем последнюю строку и выходим + If PointIndex > 0 Or a = Res.Text.Count Then + Res.ParsedText.Add(txt) : txt = "" + End If + + + + Loop While a < m.Count - 1 + + For l = 0 To Res.ParsedText.Count - 1 + + For Each nm In Names + + Res.ParsedText(l) = Res.ParsedText(l).Replace(nm.Codes, nm.Dehash) + + Next + + Next + + + + End Sub + + + Public Sub ParseResource(ByRef bytes As Byte(), ByRef Res As ScriptFile) + + 'Making big script object from file + + JapTextCounter = 0 + + Res.hz1 = BitConverter.ToInt32(bytes, 0) : Res.hz2 = BitConverter.ToInt32(bytes, 4) + + 'If Res.hz1 <> Res.hz2 Then 'Fixing Japanese Battle Text Script, Adding Header Int32 + ' Dim bL = New List(Of Byte) + ' bL.AddRange(BitConverter.GetBytes(Res.hz1)) + ' bL.AddRange(bytes) + ' Res.hz2 = Res.hz1 + ' bytes = bL.ToArray + 'End If + + Res.CharsCount = BitConverter.ToInt32(bytes, 8) + Res.RefsTablePointer = BitConverter.ToInt32(bytes, 12) + Res.ScriptTablePointer = BitConverter.ToInt32(bytes, 16) + Res.StartTextPointer = BitConverter.ToInt32(bytes, 20) + + Res.textPointers = New List(Of Integer) + Res.CharsArr = New List(Of Byte) + Res.refstable = New List(Of Int32) + Res.ScriptsTable = New List(Of Int32) + Res.Text = New List(Of Byte) + + Dim TextPointersToScript = New List(Of Integer) + + 'Copy chars data + + + For x = Res.hz2 To Res.CharsCount * 72 + Res.hz2 - 1 'reading char data after header + Res.CharsArr.Add(bytes(x)) + Next + + Dim refstableIndexes = Res.ScriptTablePointer - Res.RefsTablePointer / 8 + + For x = Res.RefsTablePointer To Res.ScriptTablePointer - 1 Step 8 + Dim yy As UInt32 = BitConverter.ToInt32(bytes, x) + Dim zz As UInt32 = BitConverter.ToInt32(bytes, x + 4) + If bytes(x) = &H13 And bytes(x + 1) = 0 And bytes(x + 2) = 0 Then TextPointersToScript.Add(zz) : JapTextCounter += 1 'Reading text commands from main offset table + Res.refstable.Add(yy) ' + Res.refstable.Add(zz) + + + Next + + + For Each x In TextPointersToScript + Res.textPointers.Add(BitConverter.ToInt32(bytes, x)) 'Reading text offsets from scripts table + Next + + For x = Res.ScriptTablePointer To Res.StartTextPointer - 1 Step 4 + Dim yy As Int32 = BitConverter.ToInt32(bytes, x) 'Storing script Bytes + Res.ScriptsTable.Add(yy) + Next + + For x = Res.StartTextPointer To UBound(bytes) + Res.Text.Add(bytes(x)) + Next + + End Sub + + Public Function get2(ByRef f As List(Of Byte), ByVal Index As Integer) + If IsNothing(f) Then Return 0 + Return f(Index) + f(Index + 1) * 256 + + End Function + + Public Function Read32bitNum(ByRef f As Byte(), ByVal bytenum As Integer) + + Dim i As Long + i = f(bytenum) + f(bytenum + 1) * 256 + f(bytenum + 2) * 65536 + f(bytenum + 3) * 16777216 + 'If f(bytenum + 3) = 255 And f(bytenum + 2) = 255 And f(bytenum + 1) = 255 And f(bytenum) = 255 Then Return -1 + Return i + End Function + + + + Public Function MakeExportFile(ByRef JFile As Byte(), ByRef EFile As Byte(), ByRef cnt As Integer) + + Dim retString = "" + Dim japPointers = New List(Of Integer) + Dim engPointers = New List(Of Integer) + Dim JPointersPointer = BitConverter.ToUInt16(JFile, 4) + Dim EPointersPointer = BitConverter.ToUInt16(EFile, 4) + Dim JTextPointer = BitConverter.ToUInt16(JFile, 6) + Dim ETextPointer = BitConverter.ToUInt16(EFile, 6) + Dim fileHeader = New List(Of Byte) + Dim engText = New List(Of String) + Dim japText = New List(Of String) + 'Dim StrCount = (JTextPointer - JPointersPointer) / 2 + + 'reading pointers + Dim pointersReader As Integer = JPointersPointer + For a = JPointersPointer To JTextPointer - 1 Step 2 : japPointers.Add(BitConverter.ToUInt16(JFile, a)) : Next a + For a = EPointersPointer To ETextPointer - 1 Step 2 : engPointers.Add(BitConverter.ToUInt16(EFile, a)) : Next a + 'FormFileHeader + For a = 0 To ETextPointer - 1 : fileHeader.Add(JFile(a)) : Next + + 'reading eng String + For a = 0 To engPointers.Count - 1 + Dim accum = "\\" + 'Pointer2PointerReading System + + Dim reader As Integer = ETextPointer + engPointers(a) + + Do + 'If reader >= lastbyte Then Exit Do + Dim s = EFile(reader) + + 'If reader + 3 < EFile.Count - 1 Then + 'If s = 6 And EFile(reader + 1) = 2 And EFile(reader + 2) = 3 Then Exit Do + If s = 8 Then accum &= "[sel=" & EFile(reader + 1) & "]" : reader += 2 : Continue Do + + If s = 3 Then Exit Do + 'End If + If s = 29 Then accum &= "[c=" & EFile(reader + 1) & "]" : reader += 2 : Continue Do + If s = 14 Then accum &= "[0e=" & EFile(reader + 1) & "]" : reader += 2 : Continue Do + If s = 30 Then accum &= "[1e=" & EFile(reader + 1) & "]" : reader += 2 : Continue Do + If s = 1 Then accum &= vbCrLf & "\\" : reader += 1 : Continue Do + If s < 32 Then + accum &= "[" & s & "]" + Else + accum &= Chr(s) + End If + reader += 1 + + Loop While reader < UBound(EFile) + engText.Add(accum) + Next + + 'reading jap String + For a = 0 To japPointers.Count - 1 + Dim accum = "" + 'Pointer2PointerReading System + Dim lastbyte As Integer = 0 + 'If a = japPointers.Count - 1 Then + ' lastbyte = JFile.ToList.Count - 1 + 'Else + ' lastbyte = japPointers(a + 1) + JTextPointer + 'End If + Dim reader As Integer = JTextPointer + japPointers(a) + + Do + 'Dim s = JFile(reader) + Dim chrr = BitConverter.ToUInt16(JFile, reader) 'Reading 2 Bytes! + + If chrr = &H96E Then accum &= "[man]" : reader += 2 : Continue Do + If chrr = &H96F Then accum &= "[woman]" : reader += 2 : Continue Do + + + If chrr And &H1000 Then + 'If reader + 7 <= UBound(JFile) - 1 Then + ' If chrr = &H1101 And BitConverter.ToUInt16(JFile, reader + 2) = &H1106 And + ' BitConverter.ToUInt16(JFile, reader + 4) = &H1101 And + ' BitConverter.ToUInt16(JFile, reader + 6) = &H1103 Then accum &= "[END]" : Exit Do + 'End If + + 'If reader + 5 <= lastbyte Then + ' If chrr = &H1106 And BitConverter.ToUInt16(JFile, reader + 2) = &H1102 And + ' BitConverter.ToUInt16(JFile, reader + 4) = &H1103 Then accum &= "[END623]" : Exit Do + 'End If + + If chrr = &H1103 Then accum &= "[0311]" : reader += 2 : Exit Do + + If chrr = &H1205 Then accum &= "[p=" & BitConverter.ToUInt16(JFile, reader + 2) & "]" : reader += 4 : Continue Do + If chrr = &H120E Then accum &= "[0e=" & BitConverter.ToUInt16(JFile, reader + 2) & "]" : reader += 4 : Continue Do + If chrr = &H121E Then accum &= "[1e=" & BitConverter.ToUInt16(JFile, reader + 2) & "]" : reader += 4 : Continue Do + If chrr = &H121D Then accum &= "[c=" & BitConverter.ToUInt16(JFile, reader + 2) & "]" : reader += 4 : Continue Do + + + If chrr = &H1101 Then accum &= vbCrLf : reader += 2 : Continue Do + + If chrr = &H1120 Then accum &= vbTab : reader += 2 : Continue Do + If chrr = &H1121 Then accum &= vbTab : reader += 2 : Continue Do + + Dim c1 = JFile(reader) : Dim c2 = JFile(reader + 1) + + Dim gg = c2 And 15 + + For byteskip = 1 To gg + accum &= "[" & c1.ToString("X2") & c2.ToString("X2") & "]" + reader += 2 + c1 = JFile(reader) : c2 = JFile(reader + 1) + Next + Continue Do + + + End If + + + Dim aaa = SpecialCodes.Find(Function(q) q.code = chrr) + If IsNothing(aaa) Then + chrr = chrr And 255 : If chrr < 32 Then chrr += 32 + accum &= Chr(chrr) + + Else + accum &= "[" & aaa.value & "]" 'Если есть специальный код + End If + + reader += 2 + Loop While reader < UBound(JFile) + For Each nm In Names + accum = accum.Replace(nm.Codes, nm.Dehash) + Next + + japText.Add(accum) + Next + + + For Each b In fileHeader + retString &= b & "," + Next + retString = retString.Substring(0, retString.Length - 1) & vbCrLf + + For a = 0 To japPointers.Count - 1 + retString &= "\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\" & vbCrLf + retString &= engText(a) & vbCrLf + retString &= "[" & a & "]" & vbCrLf + retString &= japText(a) & vbCrLf + cnt += 1 + Next + + + Return retString + End Function + + + Public Sub importContactFile(ByVal inputJfile As String, ByRef DialCount As Integer, ByRef LineCount As Integer) + + Dim f = New List(Of Byte) + Dim TextPointers = New List(Of Integer) + Dim RepeatPointers = New List(Of Integer) + + Dim txt = My.Computer.FileSystem.ReadAllText(inputJfile, Encoding.GetEncoding(1251)) + Dim t As List(Of String) = Split(txt, vbCrLf).ToList + + 'Recompiling scripts + + 'Init + Dim t1 = Split(t(0), ",").ToList + For Each ii In t1 + If Not IsNumeric(ii) Then MsgBox("Not numeric in INIT sect!!") : Exit Sub + f.Add(Convert.ToByte(ii)) + Next + + Dim JPointersPointer = f(4) + f(5) * 256 + Dim JTextPointer = f(6) + f(7) * 256 + Dim StrCount = (JTextPointer - JPointersPointer) / 2 + + Dim tx As String = txt.Replace(t(0) & vbCrLf, "") 'Replace first line + + Dim idsection As Boolean = True + + Dim x = 0 + Dim accum = New List(Of Byte) + + Dim linesAccum = New List(Of String) + Dim TempLinesAccum = New List(Of Byte) + Dim currentDialog As Integer + + Do + + 'Comments to end of line! + If tx(x) = "\" And tx(x + 1) = "\" Then + getEndOfLine(tx, x) + idsection = True + Continue Do + End If + + If tx(x) = "#" Then TextPointers.Add(accum.Count) : x += 3 : currentDialog += 1 : Continue Do 'SimpleClose + + 'SPEC_CODES + If tx(x) = "[" Then + Dim skRes = getFromSkobki(tx, x) + + If IsNumeric(skRes) And idsection Then + If skRes <> TextPointers.Count Then MsgBox("Error in pointers! ID " & skRes) : Exit Sub + idsection = False + DialCount += 1 + x = x + 2 + Continue Do 'its simple ID + End If + + + If skRes = "END623" Or skRes = "END" Or skRes = "311" Then + Dim curCount = accum.Count + currentDialog += 1 + x += 2 + Select Case skRes + Case "END623" + TempLinesAccum.AddRange({&H6, &H11, &H2, &H11, &H3, &H11}) + Case "END" + TempLinesAccum.AddRange({&H6, &H11, &H3, &H11}) + Case "311" + TempLinesAccum.AddRange({&H3, &H11}) + End Select + + 'if thislineis Exist or not + Dim CRCstr = makeCRCString(TempLinesAccum) + Dim srcLine = linesAccum.FindIndex(Function(yy) yy = CRCstr) + If srcLine = -1 Then + linesAccum.Add(CRCstr) : accum.AddRange(TempLinesAccum) : TempLinesAccum.Clear() : TextPointers.Add(curCount) : RepeatPointers.Add(curCount) : Continue Do + Else + TextPointers.Add(RepeatPointers(srcLine)) : TempLinesAccum.Clear() : Continue Do + End If + End If + + + Dim spl = Split(skRes, "=") + + If UBound(spl) = 1 Then 'Code = parsing + + Select Case spl(0) + Case "0e" + TempLinesAccum.AddRange({&HE, &H12, spl(1), 0}) + Case "1e" + TempLinesAccum.AddRange({&H1E, &H12, spl(1), 0}) + Case "p" + TempLinesAccum.AddRange({&H5, &H12, spl(1), 0}) + Case "c" + TempLinesAccum.AddRange({&H1D, &H12, spl(1), 0}) + Case "col" + Dim ind = ColorCodes.Find(Function(q) q.value = spl(1)).code 'old style color + TempLinesAccum.AddRange({&H1D, &H12, ind, 0}) + End Select + + 'x += 2 + Continue Do + + Else '2 hex codes parsing + + 'test specCodes + Dim spec As CodeObject = SpecialCodes.Find(Function(q) q.value = skRes) 'Special code convert IF + If Not IsNothing(spec) Then + TempLinesAccum.AddRange(BitConverter.GetBytes(Convert.ToInt16(spec.code)).ToList) + Continue Do + End If + + If skRes.Length = 4 Then 'Try to parse other hex codes + TempLinesAccum.AddRange(SoapHexBinary.Parse(skRes).Value.ToList) + 'x += 2 + Continue Do + + End If + + End If + + End If + + + If tx(x) = vbTab Then TempLinesAccum.AddRange({&H1, &H11}) : x += 1 : Continue Do 'Tab and enter + If tx(x) & tx(x + 1) = vbCrLf Then TempLinesAccum.AddRange({&H1, &H11}) : LineCount += 1 : x += 2 : Continue Do + If tx(x) = vbLf Then TempLinesAccum.AddRange({&H1, &H11}) : LineCount += 1 : x += 1 : Continue Do + + Dim isSimple = False + If tx(x) = "^" Then x += 1 : isSimple = True 'SimpleLine Check + + + 'SIMPLE TEXT ADDING + + Dim SimpleTextAccum = New List(Of Byte) + Dim readCounter As Byte = 1 + + Do + If Asc(tx(x)) < 32 Or Asc(tx(x)) = 91 Then x -= 1 : Exit Do + SimpleTextAccum.Add(Asc(tx(x))) + x += 1 + Loop + + 'if 1 or 2 bytes + If SimpleTextAccum.Count = 1 Then TempLinesAccum.AddRange({SimpleTextAccum(0), 0}) : x += 1 : Continue Do + + + TempLinesAccum.Add(SimpleTextAccum.Count) + TempLinesAccum.Add(&H20) 'command & length + TempLinesAccum.AddRange(SimpleTextAccum) 'attach textline + If SimpleTextAccum.Count And 1 Then TempLinesAccum.Add(0) ' if and 1 - add empty byte + + If isSimple Then + Dim CRCstr = makeCRCString(TempLinesAccum) + linesAccum.Add(CRCstr) : TextPointers.Add(accum.Count) : accum.AddRange(TempLinesAccum) : TempLinesAccum.Clear() : RepeatPointers.Add(accum.Count) + ' TextPointers.Add(accum.Count) + x += 3 + Continue Do 'This is Simple Line + End If + + + x += 1 + Loop While x < tx.Length - 1 + + + 'TextPointers.RemoveAt(TextPointers.Count - 1) 'Remove Last Pointer + + 'updateing text pointers + If TextPointers.Count <> StrCount Then + MsgBox(inputJfile & vbCrLf & "Pointers dsn't Match :( " & vbCrLf & StrCount & " <> " & TextPointers.Count) + End If + + + For a = 0 To StrCount - 1 + f(JPointersPointer + a * 2) = BitConverter.GetBytes(TextPointers(a))(0) + f(JPointersPointer + a * 2 + 1) = BitConverter.GetBytes(TextPointers(a))(1) + Next + + + f.AddRange(accum) + + + 'Сохраняем выходной файл + My.Computer.FileSystem.WriteAllBytes(inputJfile & ".ContTRNSL", f.ToArray, False) + + + End Sub + + + Public Function MakeSummonExport(ByRef JFile As Byte(), ByRef EFile As Byte(), ByRef cnt As Integer) + + + Dim retString = "" + + Dim engText = New List(Of String) + Dim japText = New List(Of String) + 'Dim StrCount = (JTextPointer - JPointersPointer) / 2 + + 'reading pointers + + Dim accum = "\\" + 'Pointer2PointerReading System + + Dim reader As Integer = 0 + + Do + 'If reader >= lastbyte Then Exit Do + Dim s = EFile(reader) + + 'If reader + 3 < EFile.Count - 1 Then + 'If s = 6 And EFile(reader + 1) = 2 And EFile(reader + 2) = 3 Then Exit Do + If s = 8 Then accum &= "[sel=" & EFile(reader + 1) & "]" : reader += 2 : Continue Do + + If s = 3 Then Exit Do + 'End If + If s = 29 Then accum &= "[c=" & EFile(reader + 1) & "]" : reader += 2 : Continue Do + If s = 14 Then accum &= "[0e=" & EFile(reader + 1) & "]" : reader += 2 : Continue Do + If s = 30 Then accum &= "[1e=" & EFile(reader + 1) & "]" : reader += 2 : Continue Do + If s = 1 Then accum &= vbCrLf & "\\" : reader += 1 : Continue Do + If s < 32 Then + accum &= "[" & s & "]" + Else + accum &= Chr(s) + End If + reader += 1 + + Loop While reader < UBound(EFile) + engText.Add(accum) + + + 'reading jap String + + accum = "" + 'Pointer2PointerReading System + Dim lastbyte As Integer = 0 + 'If a = japPointers.Count - 1 Then + ' lastbyte = JFile.ToList.Count - 1 + 'Else + ' lastbyte = japPointers(a + 1) + JTextPointer + 'End If + reader = 0 + + Do + 'Dim s = JFile(reader) + Dim chrr = BitConverter.ToUInt16(JFile, reader) 'Reading 2 Bytes! + + If chrr = &H96E Then accum &= "[man]" : reader += 2 : Continue Do + If chrr = &H96F Then accum &= "[woman]" : reader += 2 : Continue Do + + + If chrr And &H1000 Then + + + If chrr = &H1103 Then accum &= "[311]" : reader += 2 : Exit Do + + If chrr = &H1205 Then accum &= "[p=" & BitConverter.ToUInt16(JFile, reader + 2) & "]" : reader += 4 : Continue Do + If chrr = &H120E Then accum &= "[0e=" & BitConverter.ToUInt16(JFile, reader + 2) & "]" : reader += 4 : Continue Do + If chrr = &H121E Then accum &= "[1e=" & BitConverter.ToUInt16(JFile, reader + 2) & "]" : reader += 4 : Continue Do + If chrr = &H121D Then accum &= "[c=" & BitConverter.ToUInt16(JFile, reader + 2) & "]" : reader += 4 : Continue Do + + + If chrr = &H1101 Then accum &= vbCrLf : reader += 2 : Continue Do + + If chrr = &H1120 Then accum &= vbTab : reader += 2 : Continue Do + If chrr = &H1121 Then accum &= vbTab : reader += 2 : Continue Do + + Dim c1 = JFile(reader) : Dim c2 = JFile(reader + 1) + + Dim gg = c2 And 15 + + For byteskip = 1 To gg + accum &= "[" & c1.ToString("X2") & c2.ToString("X2") & "]" + reader += 2 + c1 = JFile(reader) : c2 = JFile(reader + 1) + Next + Continue Do + + + + End If + + + + Dim aaa = SpecialCodes.Find(Function(q) q.code = chrr) + If IsNothing(aaa) Then + chrr = chrr And 255 : If chrr < 32 Then chrr += 32 + accum &= Chr(chrr) + + Else + accum &= "[" & aaa.value & "]" 'Если есть специальный код + End If + + reader += 2 + Loop While reader < UBound(JFile) + For Each nm In Names + accum = accum.Replace(nm.Codes, nm.Dehash) + Next + + japText.Add(accum) + + + + + ' retString = retString.Substring(0, retString.Length - 1) & vbCrLf + + + retString &= "\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\" & vbCrLf + retString &= engText(0) & vbCrLf + retString &= "[0]" & vbCrLf + retString &= japText(0) & vbCrLf + cnt += 1 + + Replace(retString, "[0611][0211][311]", "[END623]") + + Return retString + + + + End Function + + Public Sub convertSummonScript(ByVal inputJfile As String, ByRef DialCount As Integer) + + Dim TextPointers = New List(Of Integer) + Dim RepeatPointers = New List(Of Integer) + + Dim txt = My.Computer.FileSystem.ReadAllText(inputJfile, Encoding.GetEncoding(1251)) + Dim t As List(Of String) = Split(txt, vbCrLf).ToList + + 'Recompiling scripts + 'Init + Dim tx As String = txt 'Replace first line + Dim idsection As Boolean = True + Dim x = 0 + Dim accum = New List(Of Byte) + Dim linesAccum = New List(Of String) + Dim currentDialog As Integer + + Do + + 'Comments to end of line! + If tx(x) = "\" And tx(x + 1) = "\" Then + getEndOfLine(tx, x) + idsection = True + Continue Do + End If + If tx(x) = "#" Then TextPointers.Add(accum.Count) : x += 3 : currentDialog += 1 : Continue Do 'SimpleClose + 'SPEC_CODES + If tx(x) = "[" Then + Dim skRes = getFromSkobki(tx, x) + If IsNumeric(skRes) And idsection Then + idsection = False + DialCount += 1 + x = x + 2 + Continue Do 'its simple ID + End If + + If skRes = "END623" Or skRes = "END" Or skRes = "311" Then + Dim curCount = accum.Count + currentDialog += 1 + x += 2 + Select Case skRes + Case "END623" + accum.AddRange({&H6, &H11, &H2, &H11, &H3, &H11}) + Case "END" + accum.AddRange({&H6, &H11, &H3, &H11}) + Case "311" + accum.AddRange({&H3, &H11}) + End Select + Exit Do + End If + + Dim spl = Split(skRes, "=") + + If UBound(spl) = 1 Then 'Code = parsing + + Select Case spl(0) + Case "0e" + accum.AddRange({&HE, &H12, spl(1), 0}) + Case "1e" + accum.AddRange({&H1E, &H12, spl(1), 0}) + Case "p" + accum.AddRange({&H5, &H12, spl(1), 0}) + Case "c" + accum.AddRange({&H1D, &H12, spl(1), 0}) + Case "col" + Dim ind = ColorCodes.Find(Function(q) q.value = spl(1)).code 'old style color + accum.AddRange({&H1D, &H12, ind, 0}) + End Select + + + Continue Do + + Else '2 hex codes parsing + + 'test specCodes + Dim spec As CodeObject = SpecialCodes.Find(Function(q) q.value = skRes) 'Special code convert IF + If Not IsNothing(spec) Then + accum.AddRange(BitConverter.GetBytes(Convert.ToInt16(spec.code)).ToList) + Continue Do + End If + + If skRes.Length = 4 Then 'Try to parse other hex codes + accum.AddRange(SoapHexBinary.Parse(skRes).Value.ToList) + 'x += 2 + Continue Do + End If + + End If + + End If + + + If tx(x) = vbTab Then accum.AddRange({&H20, &H11}) : x += 1 : Continue Do 'Tab and enter + If tx(x) & tx(x + 1) = vbCrLf Then accum.AddRange({&H1, &H11}) : x += 2 : Continue Do + If tx(x) = vbLf Then accum.AddRange({&H1, &H11}) : x += 1 : Continue Do + + + + + + 'SIMPLE TEXT ADDING + + Dim SimpleTextAccum = New List(Of Byte) + Dim readCounter As Byte = 1 + + Do + If Asc(tx(x)) < 32 Or Asc(tx(x)) = 91 Then x -= 1 : Exit Do + SimpleTextAccum.Add(Asc(tx(x))) + x += 1 + Loop + + 'if 1 or 2 bytes + If SimpleTextAccum.Count = 1 Then accum.AddRange({SimpleTextAccum(0), 0}) : x += 1 : Continue Do + + + accum.Add(SimpleTextAccum.Count) + accum.Add(&H20) 'command & length + accum.AddRange(SimpleTextAccum) 'attach textline + If SimpleTextAccum.Count And 1 Then accum.Add(0) ' if and 1 - add empty byte + + + + x += 1 + Loop While x < tx.Length - 1 + + + 'TextPointers.RemoveAt(TextPointers.Count - 1) 'Remove Last Pointer + + 'updateing text pointers + 'Сохраняем выходной файл + My.Computer.FileSystem.WriteAllBytes(inputJfile & ".SummonTRNSL", accum.ToArray, False) + + + End Sub + Public Sub ConvertForEdit(srcFile As String, destFile As String) + + Dim txt = My.Computer.FileSystem.ReadAllText(srcFile, Encoding.GetEncoding(1251)) + Dim destText = "" + Dim accum = "" + Dim x = 0 + + Dim t As List(Of String) = Split(Split(txt, "-----TEXT SECTION" & vbCrLf)(1), vbCrLf).ToList + Dim idsection As Boolean = True + + For Each tx In t + x = 0 + If tx.Length < 2 Then Continue For + If tx(x) = "\" And tx(x + 1) = "\" Then + idsection = True + Continue For + End If + + Do + + If tx(x) = "[" Then + Dim skRes = getFromSkobki(tx, x) + If IsNumeric(skRes) And idsection Then + idsection = False + destText &= "[" & skRes & "]" & vbCrLf + Continue For 'its simple ID + End If + + If skRes = "END623" Or skRes = "END" Or skRes = "311" Or skRes = "EOF" Or skRes = "EOD3" Or skRes = "EndSelection" Then + + destText &= accum & vbCrLf + accum = "" + idsection = True + Continue For + End If + + If skRes = "EOw" Then accum &= vbCrLf + + If skRes = "SelectionMenu" Then accum &= " --[выбор]" & vbCrLf + + If skRes = "name" Then destText &= "Тацуя" + If skRes = "surname" Then destText &= "Суоу" + + + Continue Do + + End If + If tx(x) = vbTab Then accum &= " " : x += 1 : Continue Do + If tx(x) = "~" Then accum &= "..." : x += 1 : Continue Do + + accum &= tx(x) + x = x + 1 + Loop While x < tx.Length + + destText &= accum & vbCrLf + accum = "" + + Next + + My.Computer.FileSystem.WriteAllText(destFile, destText, False) + + End Sub + Public Function makeCRCString(ByRef bts As List(Of Byte)) + Dim a = "" + For Each b In bts + a &= Chr(b) + Next + Return a + End Function + + + Public Sub ParseScript(ByVal inputJfile As String) + + If Mid(StrReverse(inputJfile), 1, 4) = "txt." Then MsgBox("ARE YOU AN IDIOT? ITS TXT!") : Exit Sub + + Dim bytes = My.Computer.FileSystem.ReadAllBytes(inputJfile) + + JapTextCounter = 0 + Dim JapCompareCounter = 0 + Dim res = New ScriptFile + res.hz1 = BitConverter.ToInt32(bytes, 0) : res.hz2 = BitConverter.ToInt32(bytes, 4) + + res.CharsCount = BitConverter.ToInt32(bytes, 8) + res.RefsTablePointer = BitConverter.ToInt32(bytes, 12) + res.ScriptTablePointer = BitConverter.ToInt32(bytes, 16) + res.StartTextPointer = BitConverter.ToInt32(bytes, 20) + + res.textPointers = New List(Of Integer) + res.CharsArr = New List(Of Byte) + res.refstable = New List(Of Int32) + res.ScriptsTable = New List(Of Int32) + res.Text = New List(Of Byte) + res.Chars = New List(Of String) + res.CharsCodes1 = New List(Of Integer) + res.CharsCodes2 = New List(Of Integer) + + Dim TextPointersToScript = New List(Of Integer) + Dim ComparePointersToScript = New List(Of Integer) + + Dim ScriptLength As Integer + + For a = 0 To res.CharsCount - 1 + Dim readingByte = res.hz2 + a * 72 + Dim curchar = "" + For b = 0 To 68 + If bytes(readingByte + b) < 32 Then res.Chars.Add(curchar) : curchar = "" : Exit For + curchar &= Chr(bytes(readingByte + b)) + Next + res.CharsCodes1.Add(BitConverter.ToInt32(bytes, readingByte + 64)) + res.CharsCodes2.Add(BitConverter.ToInt32(bytes, readingByte + 68)) + Next + + Dim refstableIndexes = res.ScriptTablePointer - res.RefsTablePointer / 8 + + Dim scrprgline As Integer + + For x = res.RefsTablePointer To res.ScriptTablePointer - 1 Step 8 + Dim isText = False + Dim isCompareText = False + Dim yy As UInt32 = BitConverter.ToInt16(bytes, x) + Dim zz As UInt32 = BitConverter.ToInt32(bytes, x + 4) + If bytes(x) = &H13 And bytes(x + 1) = 0 And bytes(x + 2) = 0 Then isText = True : TextPointersToScript.Add(zz) : JapTextCounter += 1 'Reading text commands from main offset table + + If bytes(x) = &HF And bytes(x + 1) = 1 Then isCompareText = True : ComparePointersToScript.Add(zz) : JapCompareCounter += 1 'Reading compare commands from main offset table + res.refstable.Add(yy) ' + res.refstable.Add(zz) + + 'Print BlockChar Subroutine + Dim charIndex = res.CharsCodes1.FindIndex(Function(q) q = scrprgline) + If charIndex > -1 Then res.ParsedScript &= res.Chars(charIndex) & ":" & vbCrLf + + 'Parsing script Command + Dim parsedComm = ScriptCodes.Find(Function(w) w.code = yy) + res.ParsedScript &= scrprgline.ToString("X4") & ": " + Dim descr = "" + If IsNothing(parsedComm) Then + res.ParsedScript &= yy.ToString("X8") & " " + Else + res.ParsedScript &= parsedComm.value & " " + If Not IsNothing(parsedComm.descr) Then descr = parsedComm.descr + End If + + If x <> res.ScriptTablePointer - 1 Then + ScriptLength = BitConverter.ToInt32(bytes, x + 12) - BitConverter.ToInt32(bytes, x + 4) + Else + ScriptLength = 4 + End If + + 'ScriptLength = ScriptLength / 4 + For scr = zz To zz + ScriptLength - 1 Step 4 + res.ParsedScript &= " " & BitConverter.ToInt32(bytes, scr).ToString("X8") + If yy = &HD Then res.ParsedScript &= " " & res.Chars(BitConverter.ToInt32(bytes, scr)) + Next + + If descr <> "" Then res.ParsedScript &= " (" & descr & ")" + + If isText Then + Dim curTextAddr = BitConverter.ToInt32(bytes, zz) + res.StartTextPointer + Dim c = 0 + Dim TextLine = readText(bytes, curTextAddr) + res.ParsedScript &= " id:" & TextPointersToScript.Count - 1 & TextLine + End If + + If isCompareText Then + Dim curTextAddr = BitConverter.ToInt32(bytes, zz) + res.StartTextPointer + Dim c = 0 + Dim TextLine = readText(bytes, curTextAddr) + res.ParsedScript &= " compareId:" & ComparePointersToScript.Count - 1 & " " & TextLine + End If + + If yy = &HE Then res.ParsedScript &= vbCrLf + If yy = &H12 Then res.ParsedScript &= vbCrLf + If yy = &H7 Then res.ParsedScript &= vbCrLf + If yy = &H4 Then res.ParsedScript &= vbCrLf + If yy = &H2 Then res.ParsedScript &= vbCrLf + If yy = &H1 Then res.ParsedScript &= vbCrLf + + res.ParsedScript &= vbCrLf + scrprgline += 1 + + + Next + + Dim ExportText = "" + + For ch = 0 To res.Chars.Count - 1 + ExportText &= ch.ToString("X2") & " " & res.CharsCodes1(ch).ToString("X8") & " " & res.CharsCodes2(ch).ToString("X8") & " " & res.Chars(ch) & vbCrLf + Next + + ExportText &= vbCrLf & vbCrLf & res.ParsedScript + + Dim d = New ScriptParserWin + d.Text = Path.GetFileNameWithoutExtension(inputJfile) + d.TextBox1.Text = ExportText + d.ShowDialog() + + + End Sub + + Public Function readText(ByRef bytes As Byte(), ByRef curTextAddr As Integer) + Dim TextLine = " / " + + Dim c = 0 + If curTextAddr >= bytes.Length Then Return " --- WRON POINTER!" + Do + c = BitConverter.ToInt16(bytes, curTextAddr) + If c = &H1103 Then Exit Do + + If c = &H1136 Then 'ENGLISH TEXT + curTextAddr += 2 + Dim curCode = bytes(curTextAddr) + Do + If curCode > 31 Then TextLine &= Chr(curCode) + curTextAddr += 1 + curCode = bytes(curTextAddr) + If curCode = 0 Then Exit Do + Loop + curTextAddr += 1 'jump 0 + End If + + If curTextAddr And 1 Then curTextAddr += 1 'if AND1 - +1 + + + If c And &H2000 Then 'Если строка в моём однобайтном формате + + Dim charNum = c And &HFF + curTextAddr += 2 + For q = 1 To charNum + If curTextAddr >= bytes.Length Then Return " --- WRON TEXT!" + TextLine &= Chr(bytes(curTextAddr)) + curTextAddr += 1 + Next + If charNum And 1 Then curTextAddr += 1 'if AND1 - +1 + Continue Do + End If + If c And &H1000 Then + + If c = &H1101 Then TextLine &= " / " + curTextAddr += (c >> 8 And &HF) * 2 : Continue Do 'BitShift / And / Jump command length + Else + 'TextLine &= Chr(c And &HFF) + End If + + curTextAddr += 2 + Loop While c <> &H1103 + + Return TextLine + End Function + +End Class + + +Public Class ScriptFile + + Public hz1 As Integer + Public hz2 As Integer + Public CharsCount As Integer + Public RefsTablePointer As Integer + Public ScriptTablePointer As Integer + Public ParsedScript As String + Public StartTextPointer As Integer + + + + Public filename As String + + Public textPointers As List(Of Integer) + + Public CharsArr As List(Of Byte) + + + Public Chars As List(Of String) + Public CharsCodes1 As List(Of Integer) + Public CharsCodes2 As List(Of Integer) + + + Public refstable As List(Of Int32) + Public ScriptsTable As List(Of Int32) + + + + Public Text As List(Of Byte) + + Public ParsedText As List(Of String) + + +End Class + +Public Class CodeObject + + Public code As Integer + Public value As String + Public descr As String + +End Class + +Public Class TableElement + Public Addr As Integer + Public Code As Integer + Public Value As Integer + + + + +End Class + + +Public Class NameElement + Public Codes As String + Public Dehash As String + +End Class \ No newline at end of file diff --git a/p2isPSX_CDToolkit/StringsOffsetEditorvb.Designer.vb b/p2isPSX_CDToolkit/StringsOffsetEditorvb.Designer.vb new file mode 100644 index 0000000..5e84ed5 --- /dev/null +++ b/p2isPSX_CDToolkit/StringsOffsetEditorvb.Designer.vb @@ -0,0 +1,687 @@ + _ +Partial Class StringsOffsetEditorvb + Inherits System.Windows.Forms.Form + + 'Форма переопределяет dispose для очистки списка компонентов. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Является обязательной для конструктора форм Windows Forms + Private components As System.ComponentModel.IContainer + + 'Примечание: следующая процедура является обязательной для конструктора форм Windows Forms + 'Для ее изменения используйте конструктор форм Windows Form. + 'Не изменяйте ее в редакторе исходного кода. + _ + Private Sub InitializeComponent() + Dim DataGridViewCellStyle1 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() + Me.FileID = New System.Windows.Forms.TextBox() + Me.Offset = New System.Windows.Forms.TextBox() + Me.Label1 = New System.Windows.Forms.Label() + Me.Label2 = New System.Windows.Forms.Label() + Me.Label3 = New System.Windows.Forms.Label() + Me.Label4 = New System.Windows.Forms.Label() + Me.Label5 = New System.Windows.Forms.Label() + Me.UserPath = New System.Windows.Forms.TextBox() + Me.EngISOPath = New System.Windows.Forms.TextBox() + Me.JapISOPath = New System.Windows.Forms.TextBox() + Me.LoadBtn = New System.Windows.Forms.Button() + Me.SaveBtn = New System.Windows.Forms.Button() + Me.DataGridView1 = New System.Windows.Forms.DataGridView() + Me.ID = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.JAP = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.Eng = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.Column1 = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.RadioFile = New System.Windows.Forms.RadioButton() + Me.RadioSector = New System.Windows.Forms.RadioButton() + Me.SetName = New System.Windows.Forms.TextBox() + Me.Label6 = New System.Windows.Forms.Label() + Me.Button1 = New System.Windows.Forms.Button() + Me.tempSave = New System.Windows.Forms.Button() + Me.tempLoad = New System.Windows.Forms.Button() + Me.SaveSettings = New System.Windows.Forms.Button() + Me.LoadSettings = New System.Windows.Forms.Button() + Me.OffSz = New System.Windows.Forms.Label() + Me.TxtSz = New System.Windows.Forms.Label() + Me.Allsz = New System.Windows.Forms.Label() + Me.YourTxtSz = New System.Windows.Forms.Label() + Me.CurLen = New System.Windows.Forms.Label() + Me.patchFileID = New System.Windows.Forms.TextBox() + Me.PatchFileBtn = New System.Windows.Forms.Button() + Me.GroupBox1 = New System.Windows.Forms.GroupBox() + Me.ReplaceAll = New System.Windows.Forms.Button() + Me.PatchFileRadio = New System.Windows.Forms.RadioButton() + Me.PatchExeRadio = New System.Windows.Forms.RadioButton() + Me.patchOffset = New System.Windows.Forms.TextBox() + Me.Label7 = New System.Windows.Forms.Label() + Me.LineModeSimple = New System.Windows.Forms.RadioButton() + Me.GroupBox2 = New System.Windows.Forms.GroupBox() + Me.DontEnglish = New System.Windows.Forms.CheckBox() + Me.OnlyCodes_Mode = New System.Windows.Forms.CheckBox() + Me.LineModeComplex = New System.Windows.Forms.RadioButton() + Me.EngSave = New System.Windows.Forms.Button() + Me.EngOffset = New System.Windows.Forms.TextBox() + Me.Label8 = New System.Windows.Forms.Label() + Me.ListBox1 = New System.Windows.Forms.ListBox() + Me.KudosLoad = New System.Windows.Forms.CheckBox() + Me.Label9 = New System.Windows.Forms.Label() + Me.KUDOSpath = New System.Windows.Forms.TextBox() + Me.FindOffsetInJP = New System.Windows.Forms.Button() + CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).BeginInit() + Me.GroupBox1.SuspendLayout() + Me.GroupBox2.SuspendLayout() + Me.SuspendLayout() + ' + 'FileID + ' + Me.FileID.Location = New System.Drawing.Point(54, 125) + Me.FileID.Name = "FileID" + Me.FileID.Size = New System.Drawing.Size(100, 20) + Me.FileID.TabIndex = 0 + Me.FileID.Text = "0681" + ' + 'Offset + ' + Me.Offset.Location = New System.Drawing.Point(218, 125) + Me.Offset.Name = "Offset" + Me.Offset.Size = New System.Drawing.Size(52, 20) + Me.Offset.TabIndex = 1 + Me.Offset.Text = "49376" + ' + 'Label1 + ' + Me.Label1.AutoSize = True + Me.Label1.Location = New System.Drawing.Point(4, 128) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(44, 13) + Me.Label1.TabIndex = 2 + Me.Label1.Text = "Number" + ' + 'Label2 + ' + Me.Label2.AutoSize = True + Me.Label2.Location = New System.Drawing.Point(164, 128) + Me.Label2.Name = "Label2" + Me.Label2.Size = New System.Drawing.Size(54, 13) + Me.Label2.TabIndex = 2 + Me.Label2.Text = "JAPOffset" + ' + 'Label3 + ' + Me.Label3.AutoSize = True + Me.Label3.Location = New System.Drawing.Point(376, 23) + Me.Label3.Name = "Label3" + Me.Label3.Size = New System.Drawing.Size(102, 13) + Me.Label3.TabIndex = 6 + Me.Label3.Text = "User (Modified) .BIN" + ' + 'Label4 + ' + Me.Label4.AutoSize = True + Me.Label4.Location = New System.Drawing.Point(54, 62) + Me.Label4.Name = "Label4" + Me.Label4.Size = New System.Drawing.Size(120, 13) + Me.Label4.TabIndex = 7 + Me.Label4.Text = "USA EP CD Image .BIN" + ' + 'Label5 + ' + Me.Label5.AutoSize = True + Me.Label5.Location = New System.Drawing.Point(54, 23) + Me.Label5.Name = "Label5" + Me.Label5.Size = New System.Drawing.Size(127, 13) + Me.Label5.TabIndex = 8 + Me.Label5.Text = "Japan EP CD Image .BIN" + ' + 'UserPath + ' + Me.UserPath.Location = New System.Drawing.Point(376, 38) + Me.UserPath.Name = "UserPath" + Me.UserPath.Size = New System.Drawing.Size(300, 20) + Me.UserPath.TabIndex = 3 + Me.UserPath.Text = "D:\Games\PSX\Persona 2 - Batsu (NTSC-J) [SLPS-02825]\Persona 2 - Batsu USER.bin" + ' + 'EngISOPath + ' + Me.EngISOPath.Location = New System.Drawing.Point(54, 77) + Me.EngISOPath.Name = "EngISOPath" + Me.EngISOPath.Size = New System.Drawing.Size(300, 20) + Me.EngISOPath.TabIndex = 4 + Me.EngISOPath.Text = "D:\Games\PSX\Persona 2 - Batsu (NTSC-J) [SLPS-02825]\Persona 2 - EP (USA) [Locali" & + "zed - Undub].bin" + ' + 'JapISOPath + ' + Me.JapISOPath.Location = New System.Drawing.Point(54, 39) + Me.JapISOPath.Name = "JapISOPath" + Me.JapISOPath.Size = New System.Drawing.Size(300, 20) + Me.JapISOPath.TabIndex = 5 + Me.JapISOPath.Text = "D:\Games\PSX\Persona 2 - Batsu (NTSC-J) [SLPS-02825]\Persona 2 - Batsu (NTSC-J) [" & + "SLPS-02825].bin" + ' + 'LoadBtn + ' + Me.LoadBtn.Location = New System.Drawing.Point(54, 172) + Me.LoadBtn.Name = "LoadBtn" + Me.LoadBtn.Size = New System.Drawing.Size(328, 23) + Me.LoadBtn.TabIndex = 9 + Me.LoadBtn.Text = "READ" + Me.LoadBtn.UseVisualStyleBackColor = True + ' + 'SaveBtn + ' + Me.SaveBtn.Location = New System.Drawing.Point(1023, 1095) + Me.SaveBtn.Name = "SaveBtn" + Me.SaveBtn.Size = New System.Drawing.Size(148, 38) + Me.SaveBtn.TabIndex = 9 + Me.SaveBtn.Text = "SAVE" + Me.SaveBtn.UseVisualStyleBackColor = True + ' + 'DataGridView1 + ' + Me.DataGridView1.AllowUserToAddRows = False + Me.DataGridView1.AllowUserToDeleteRows = False + Me.DataGridView1.AllowUserToResizeRows = False + Me.DataGridView1.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllCells + Me.DataGridView1.BackgroundColor = System.Drawing.Color.Gray + Me.DataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize + Me.DataGridView1.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.ID, Me.JAP, Me.Eng, Me.Column1}) + Me.DataGridView1.EditMode = System.Windows.Forms.DataGridViewEditMode.EditOnEnter + Me.DataGridView1.Location = New System.Drawing.Point(12, 221) + Me.DataGridView1.Name = "DataGridView1" + Me.DataGridView1.RowHeadersVisible = False + DataGridViewCellStyle1.Font = New System.Drawing.Font("Consolas", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(204, Byte)) + Me.DataGridView1.RowsDefaultCellStyle = DataGridViewCellStyle1 + Me.DataGridView1.RowTemplate.DefaultCellStyle.BackColor = System.Drawing.Color.FromArgb(CType(CType(64, Byte), Integer), CType(CType(64, Byte), Integer), CType(CType(64, Byte), Integer)) + Me.DataGridView1.RowTemplate.DefaultCellStyle.ForeColor = System.Drawing.Color.FromArgb(CType(CType(224, Byte), Integer), CType(CType(224, Byte), Integer), CType(CType(224, Byte), Integer)) + Me.DataGridView1.ScrollBars = System.Windows.Forms.ScrollBars.Vertical + Me.DataGridView1.Size = New System.Drawing.Size(1433, 863) + Me.DataGridView1.TabIndex = 11 + ' + 'ID + ' + Me.ID.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill + Me.ID.FillWeight = 20.0! + Me.ID.HeaderText = "ID" + Me.ID.Name = "ID" + Me.ID.ReadOnly = True + ' + 'JAP + ' + Me.JAP.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill + Me.JAP.HeaderText = "JAP_Str" + Me.JAP.Name = "JAP" + Me.JAP.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable + ' + 'Eng + ' + Me.Eng.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill + Me.Eng.HeaderText = "Eng_Str" + Me.Eng.Name = "Eng" + Me.Eng.ReadOnly = True + ' + 'Column1 + ' + Me.Column1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill + Me.Column1.FillWeight = 50.0! + Me.Column1.HeaderText = "Kudos" + Me.Column1.Name = "Column1" + ' + 'RadioFile + ' + Me.RadioFile.AutoSize = True + Me.RadioFile.Checked = True + Me.RadioFile.Location = New System.Drawing.Point(67, 105) + Me.RadioFile.Name = "RadioFile" + Me.RadioFile.Size = New System.Drawing.Size(68, 17) + Me.RadioFile.TabIndex = 12 + Me.RadioFile.TabStop = True + Me.RadioFile.Text = "FILE or" + Me.RadioFile.UseVisualStyleBackColor = True + ' + 'RadioSector + ' + Me.RadioSector.AutoSize = True + Me.RadioSector.Location = New System.Drawing.Point(142, 105) + Me.RadioSector.Name = "RadioSector" + Me.RadioSector.Size = New System.Drawing.Size(88, 17) + Me.RadioSector.TabIndex = 13 + Me.RadioSector.Text = "SLPS002825" + Me.RadioSector.UseVisualStyleBackColor = True + ' + 'SetName + ' + Me.SetName.Location = New System.Drawing.Point(472, 64) + Me.SetName.Name = "SetName" + Me.SetName.Size = New System.Drawing.Size(204, 20) + Me.SetName.TabIndex = 16 + ' + 'Label6 + ' + Me.Label6.AutoSize = True + Me.Label6.Location = New System.Drawing.Point(376, 67) + Me.Label6.Name = "Label6" + Me.Label6.Size = New System.Drawing.Size(73, 13) + Me.Label6.TabIndex = 2 + Me.Label6.Text = "SettingsName" + ' + 'Button1 + ' + Me.Button1.Location = New System.Drawing.Point(42, 1095) + Me.Button1.Name = "Button1" + Me.Button1.Size = New System.Drawing.Size(112, 38) + Me.Button1.TabIndex = 17 + Me.Button1.Text = "ClearJapText" + Me.Button1.UseVisualStyleBackColor = True + ' + 'tempSave + ' + Me.tempSave.Location = New System.Drawing.Point(309, 1095) + Me.tempSave.Name = "tempSave" + Me.tempSave.Size = New System.Drawing.Size(112, 38) + Me.tempSave.TabIndex = 17 + Me.tempSave.Text = "TempSave" + Me.tempSave.UseVisualStyleBackColor = True + ' + 'tempLoad + ' + Me.tempLoad.Location = New System.Drawing.Point(181, 1094) + Me.tempLoad.Name = "tempLoad" + Me.tempLoad.Size = New System.Drawing.Size(112, 38) + Me.tempLoad.TabIndex = 17 + Me.tempLoad.Text = "TempLoad" + Me.tempLoad.UseVisualStyleBackColor = True + ' + 'SaveSettings + ' + Me.SaveSettings.Location = New System.Drawing.Point(576, 92) + Me.SaveSettings.Name = "SaveSettings" + Me.SaveSettings.Size = New System.Drawing.Size(100, 23) + Me.SaveSettings.TabIndex = 9 + Me.SaveSettings.Text = "SAVE" + Me.SaveSettings.UseVisualStyleBackColor = True + ' + 'LoadSettings + ' + Me.LoadSettings.Location = New System.Drawing.Point(472, 92) + Me.LoadSettings.Name = "LoadSettings" + Me.LoadSettings.Size = New System.Drawing.Size(100, 23) + Me.LoadSettings.TabIndex = 9 + Me.LoadSettings.Text = "LOAD" + Me.LoadSettings.UseVisualStyleBackColor = True + ' + 'OffSz + ' + Me.OffSz.BackColor = System.Drawing.Color.LightGray + Me.OffSz.Location = New System.Drawing.Point(732, 10) + Me.OffSz.Name = "OffSz" + Me.OffSz.Size = New System.Drawing.Size(128, 13) + Me.OffSz.TabIndex = 2 + Me.OffSz.TextAlign = System.Drawing.ContentAlignment.MiddleRight + ' + 'TxtSz + ' + Me.TxtSz.BackColor = System.Drawing.Color.LightGray + Me.TxtSz.Location = New System.Drawing.Point(732, 23) + Me.TxtSz.Name = "TxtSz" + Me.TxtSz.Size = New System.Drawing.Size(128, 13) + Me.TxtSz.TabIndex = 2 + Me.TxtSz.TextAlign = System.Drawing.ContentAlignment.MiddleRight + ' + 'Allsz + ' + Me.Allsz.BackColor = System.Drawing.Color.LightGray + Me.Allsz.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(204, Byte)) + Me.Allsz.Location = New System.Drawing.Point(732, 36) + Me.Allsz.Name = "Allsz" + Me.Allsz.Size = New System.Drawing.Size(128, 13) + Me.Allsz.TabIndex = 2 + Me.Allsz.TextAlign = System.Drawing.ContentAlignment.MiddleRight + ' + 'YourTxtSz + ' + Me.YourTxtSz.BackColor = System.Drawing.Color.LightGray + Me.YourTxtSz.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(204, Byte)) + Me.YourTxtSz.Location = New System.Drawing.Point(709, 61) + Me.YourTxtSz.Name = "YourTxtSz" + Me.YourTxtSz.Size = New System.Drawing.Size(151, 13) + Me.YourTxtSz.TabIndex = 2 + Me.YourTxtSz.Text = " " + Me.YourTxtSz.TextAlign = System.Drawing.ContentAlignment.MiddleRight + ' + 'CurLen + ' + Me.CurLen.AutoSize = True + Me.CurLen.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(204, Byte)) + Me.CurLen.Location = New System.Drawing.Point(253, 198) + Me.CurLen.Name = "CurLen" + Me.CurLen.Size = New System.Drawing.Size(17, 20) + Me.CurLen.TabIndex = 18 + Me.CurLen.Text = "''" + ' + 'patchFileID + ' + Me.patchFileID.Location = New System.Drawing.Point(29, 40) + Me.patchFileID.Name = "patchFileID" + Me.patchFileID.Size = New System.Drawing.Size(100, 20) + Me.patchFileID.TabIndex = 19 + Me.patchFileID.Text = "0001" + ' + 'PatchFileBtn + ' + Me.PatchFileBtn.Location = New System.Drawing.Point(29, 63) + Me.PatchFileBtn.Name = "PatchFileBtn" + Me.PatchFileBtn.Size = New System.Drawing.Size(246, 23) + Me.PatchFileBtn.TabIndex = 21 + Me.PatchFileBtn.Text = "Patch" + Me.PatchFileBtn.UseVisualStyleBackColor = True + ' + 'GroupBox1 + ' + Me.GroupBox1.Controls.Add(Me.PatchFileBtn) + Me.GroupBox1.Controls.Add(Me.patchFileID) + Me.GroupBox1.Controls.Add(Me.PatchFileRadio) + Me.GroupBox1.Controls.Add(Me.PatchExeRadio) + Me.GroupBox1.Controls.Add(Me.patchOffset) + Me.GroupBox1.Controls.Add(Me.Label7) + Me.GroupBox1.Enabled = False + Me.GroupBox1.Location = New System.Drawing.Point(883, 12) + Me.GroupBox1.Name = "GroupBox1" + Me.GroupBox1.Size = New System.Drawing.Size(300, 103) + Me.GroupBox1.TabIndex = 22 + Me.GroupBox1.TabStop = False + Me.GroupBox1.Text = "Patch Text Routine Call" + ' + 'ReplaceAll + ' + Me.ReplaceAll.Location = New System.Drawing.Point(912, 128) + Me.ReplaceAll.Name = "ReplaceAll" + Me.ReplaceAll.Size = New System.Drawing.Size(246, 42) + Me.ReplaceAll.TabIndex = 22 + Me.ReplaceAll.Text = "Search And Replace All Text Calls" + Me.ReplaceAll.UseVisualStyleBackColor = True + ' + 'PatchFileRadio + ' + Me.PatchFileRadio.AutoSize = True + Me.PatchFileRadio.Checked = True + Me.PatchFileRadio.Location = New System.Drawing.Point(61, 19) + Me.PatchFileRadio.Name = "PatchFileRadio" + Me.PatchFileRadio.Size = New System.Drawing.Size(68, 17) + Me.PatchFileRadio.TabIndex = 12 + Me.PatchFileRadio.TabStop = True + Me.PatchFileRadio.Text = "FILE or" + Me.PatchFileRadio.UseVisualStyleBackColor = True + ' + 'PatchExeRadio + ' + Me.PatchExeRadio.AutoSize = True + Me.PatchExeRadio.Location = New System.Drawing.Point(152, 19) + Me.PatchExeRadio.Name = "PatchExeRadio" + Me.PatchExeRadio.Size = New System.Drawing.Size(76, 17) + Me.PatchExeRadio.TabIndex = 13 + Me.PatchExeRadio.Text = "SLPS0021" + Me.PatchExeRadio.UseVisualStyleBackColor = True + ' + 'patchOffset + ' + Me.patchOffset.Location = New System.Drawing.Point(175, 40) + Me.patchOffset.Name = "patchOffset" + Me.patchOffset.Size = New System.Drawing.Size(100, 20) + Me.patchOffset.TabIndex = 1 + Me.patchOffset.Text = "361460" + ' + 'Label7 + ' + Me.Label7.AutoSize = True + Me.Label7.Location = New System.Drawing.Point(240, 26) + Me.Label7.Name = "Label7" + Me.Label7.Size = New System.Drawing.Size(35, 13) + Me.Label7.TabIndex = 2 + Me.Label7.Text = "Offset" + ' + 'LineModeSimple + ' + Me.LineModeSimple.AutoSize = True + Me.LineModeSimple.Checked = True + Me.LineModeSimple.Location = New System.Drawing.Point(40, 19) + Me.LineModeSimple.Name = "LineModeSimple" + Me.LineModeSimple.Size = New System.Drawing.Size(56, 17) + Me.LineModeSimple.TabIndex = 23 + Me.LineModeSimple.TabStop = True + Me.LineModeSimple.Text = "Simple" + Me.LineModeSimple.UseVisualStyleBackColor = True + ' + 'GroupBox2 + ' + Me.GroupBox2.Controls.Add(Me.DontEnglish) + Me.GroupBox2.Controls.Add(Me.OnlyCodes_Mode) + Me.GroupBox2.Controls.Add(Me.LineModeComplex) + Me.GroupBox2.Controls.Add(Me.LineModeSimple) + Me.GroupBox2.Location = New System.Drawing.Point(391, 121) + Me.GroupBox2.Name = "GroupBox2" + Me.GroupBox2.Size = New System.Drawing.Size(234, 68) + Me.GroupBox2.TabIndex = 24 + Me.GroupBox2.TabStop = False + Me.GroupBox2.Text = "LinesMode" + ' + 'DontEnglish + ' + Me.DontEnglish.AutoSize = True + Me.DontEnglish.Location = New System.Drawing.Point(114, 19) + Me.DontEnglish.Name = "DontEnglish" + Me.DontEnglish.Size = New System.Drawing.Size(115, 17) + Me.DontEnglish.TabIndex = 25 + Me.DontEnglish.Text = "Dont Read English" + Me.DontEnglish.UseVisualStyleBackColor = True + ' + 'OnlyCodes_Mode + ' + Me.OnlyCodes_Mode.AutoSize = True + Me.OnlyCodes_Mode.Location = New System.Drawing.Point(114, 42) + Me.OnlyCodes_Mode.Name = "OnlyCodes_Mode" + Me.OnlyCodes_Mode.Size = New System.Drawing.Size(67, 17) + Me.OnlyCodes_Mode.TabIndex = 24 + Me.OnlyCodes_Mode.Text = "FullCode" + Me.OnlyCodes_Mode.UseVisualStyleBackColor = True + ' + 'LineModeComplex + ' + Me.LineModeComplex.AutoSize = True + Me.LineModeComplex.Location = New System.Drawing.Point(40, 42) + Me.LineModeComplex.Name = "LineModeComplex" + Me.LineModeComplex.Size = New System.Drawing.Size(65, 17) + Me.LineModeComplex.TabIndex = 23 + Me.LineModeComplex.Text = "Complex" + Me.LineModeComplex.UseVisualStyleBackColor = True + ' + 'EngSave + ' + Me.EngSave.Location = New System.Drawing.Point(529, 1094) + Me.EngSave.Name = "EngSave" + Me.EngSave.Size = New System.Drawing.Size(135, 38) + Me.EngSave.TabIndex = 25 + Me.EngSave.Text = "ENG SAVE" + Me.EngSave.UseVisualStyleBackColor = True + ' + 'EngOffset + ' + Me.EngOffset.Location = New System.Drawing.Point(333, 125) + Me.EngOffset.Name = "EngOffset" + Me.EngOffset.Size = New System.Drawing.Size(49, 20) + Me.EngOffset.TabIndex = 1 + Me.EngOffset.Text = "20332" + ' + 'Label8 + ' + Me.Label8.AutoSize = True + Me.Label8.Location = New System.Drawing.Point(276, 128) + Me.Label8.Name = "Label8" + Me.Label8.Size = New System.Drawing.Size(58, 13) + Me.Label8.TabIndex = 2 + Me.Label8.Text = "ENGOffset" + ' + 'ListBox1 + ' + Me.ListBox1.FormattingEnabled = True + Me.ListBox1.Location = New System.Drawing.Point(698, 92) + Me.ListBox1.Name = "ListBox1" + Me.ListBox1.Size = New System.Drawing.Size(179, 82) + Me.ListBox1.TabIndex = 26 + ' + 'KudosLoad + ' + Me.KudosLoad.AutoSize = True + Me.KudosLoad.Location = New System.Drawing.Point(1258, 80) + Me.KudosLoad.Name = "KudosLoad" + Me.KudosLoad.Size = New System.Drawing.Size(113, 17) + Me.KudosLoad.TabIndex = 27 + Me.KudosLoad.Text = "Load Kudos Text?" + Me.KudosLoad.UseVisualStyleBackColor = True + ' + 'Label9 + ' + Me.Label9.AutoSize = True + Me.Label9.Location = New System.Drawing.Point(1189, 23) + Me.Label9.Name = "Label9" + Me.Label9.Size = New System.Drawing.Size(69, 13) + Me.Label9.TabIndex = 29 + Me.Label9.Text = "KUDOS .BIN" + ' + 'KUDOSpath + ' + Me.KUDOSpath.Location = New System.Drawing.Point(1189, 39) + Me.KUDOSpath.Name = "KUDOSpath" + Me.KUDOSpath.Size = New System.Drawing.Size(262, 20) + Me.KUDOSpath.TabIndex = 28 + Me.KUDOSpath.Text = "D:\Games\PSX\Persona 2 - Batsu (NTSC-J) [SLPS-02825]\P2_KUDOS.bin" + ' + 'FindOffsetInJP + ' + Me.FindOffsetInJP.Location = New System.Drawing.Point(307, 147) + Me.FindOffsetInJP.Name = "FindOffsetInJP" + Me.FindOffsetInJP.Size = New System.Drawing.Size(75, 23) + Me.FindOffsetInJP.TabIndex = 30 + Me.FindOffsetInJP.Text = "Find in JP" + Me.FindOffsetInJP.UseVisualStyleBackColor = True + ' + 'StringsOffsetEditorvb + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.BackColor = System.Drawing.Color.Gray + Me.ClientSize = New System.Drawing.Size(1470, 1140) + Me.Controls.Add(Me.FindOffsetInJP) + Me.Controls.Add(Me.ReplaceAll) + Me.Controls.Add(Me.Label9) + Me.Controls.Add(Me.KUDOSpath) + Me.Controls.Add(Me.KudosLoad) + Me.Controls.Add(Me.ListBox1) + Me.Controls.Add(Me.EngSave) + Me.Controls.Add(Me.GroupBox2) + Me.Controls.Add(Me.GroupBox1) + Me.Controls.Add(Me.CurLen) + Me.Controls.Add(Me.tempLoad) + Me.Controls.Add(Me.tempSave) + Me.Controls.Add(Me.Button1) + Me.Controls.Add(Me.SetName) + Me.Controls.Add(Me.RadioSector) + Me.Controls.Add(Me.RadioFile) + Me.Controls.Add(Me.DataGridView1) + Me.Controls.Add(Me.SaveBtn) + Me.Controls.Add(Me.SaveSettings) + Me.Controls.Add(Me.LoadSettings) + Me.Controls.Add(Me.LoadBtn) + Me.Controls.Add(Me.Label3) + Me.Controls.Add(Me.Label4) + Me.Controls.Add(Me.Label5) + Me.Controls.Add(Me.UserPath) + Me.Controls.Add(Me.EngISOPath) + Me.Controls.Add(Me.JapISOPath) + Me.Controls.Add(Me.YourTxtSz) + Me.Controls.Add(Me.Allsz) + Me.Controls.Add(Me.TxtSz) + Me.Controls.Add(Me.OffSz) + Me.Controls.Add(Me.Label6) + Me.Controls.Add(Me.Label8) + Me.Controls.Add(Me.Label2) + Me.Controls.Add(Me.EngOffset) + Me.Controls.Add(Me.Label1) + Me.Controls.Add(Me.Offset) + Me.Controls.Add(Me.FileID) + Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog + Me.MaximizeBox = False + Me.Name = "StringsOffsetEditorvb" + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen + Me.Text = "StringsOffsetEditorvb" + CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).EndInit() + Me.GroupBox1.ResumeLayout(False) + Me.GroupBox1.PerformLayout() + Me.GroupBox2.ResumeLayout(False) + Me.GroupBox2.PerformLayout() + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + + Friend WithEvents FileID As TextBox + Friend WithEvents Offset As TextBox + Friend WithEvents Label1 As Label + Friend WithEvents Label2 As Label + Friend WithEvents Label3 As Label + Friend WithEvents Label4 As Label + Friend WithEvents Label5 As Label + Friend WithEvents UserPath As TextBox + Friend WithEvents EngISOPath As TextBox + Friend WithEvents JapISOPath As TextBox + Friend WithEvents LoadBtn As Button + Friend WithEvents SaveBtn As Button + Friend WithEvents DataGridView1 As DataGridView + Friend WithEvents RadioFile As RadioButton + Friend WithEvents RadioSector As RadioButton + Friend WithEvents SetName As TextBox + Friend WithEvents Label6 As Label + Friend WithEvents Button1 As Button + Friend WithEvents tempSave As Button + Friend WithEvents tempLoad As Button + Friend WithEvents SaveSettings As Button + Friend WithEvents LoadSettings As Button + Friend WithEvents OffSz As Label + Friend WithEvents TxtSz As Label + Friend WithEvents Allsz As Label + Friend WithEvents YourTxtSz As Label + Friend WithEvents CurLen As Label + Friend WithEvents patchFileID As TextBox + Friend WithEvents PatchFileBtn As Button + Friend WithEvents GroupBox1 As GroupBox + Friend WithEvents PatchFileRadio As RadioButton + Friend WithEvents PatchExeRadio As RadioButton + Friend WithEvents patchOffset As TextBox + Friend WithEvents Label7 As Label + Friend WithEvents LineModeSimple As RadioButton + Friend WithEvents GroupBox2 As GroupBox + Friend WithEvents LineModeComplex As RadioButton + Friend WithEvents EngSave As Button + Friend WithEvents OnlyCodes_Mode As CheckBox + Friend WithEvents EngOffset As TextBox + Friend WithEvents Label8 As Label + Friend WithEvents ReplaceAll As Button + Friend WithEvents ListBox1 As ListBox + Friend WithEvents DontEnglish As CheckBox + Friend WithEvents ID As DataGridViewTextBoxColumn + Friend WithEvents JAP As DataGridViewTextBoxColumn + Friend WithEvents Eng As DataGridViewTextBoxColumn + Friend WithEvents Column1 As DataGridViewTextBoxColumn + Friend WithEvents KudosLoad As CheckBox + Friend WithEvents Label9 As Label + Friend WithEvents KUDOSpath As TextBox + Friend WithEvents FindOffsetInJP As Button +End Class diff --git a/p2isPSX_CDToolkit/StringsOffsetEditorvb.resx b/p2isPSX_CDToolkit/StringsOffsetEditorvb.resx new file mode 100644 index 0000000..6567cc0 --- /dev/null +++ b/p2isPSX_CDToolkit/StringsOffsetEditorvb.resx @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + True + + + True + + + True + + + True + + \ No newline at end of file diff --git a/p2isPSX_CDToolkit/StringsOffsetEditorvb.vb b/p2isPSX_CDToolkit/StringsOffsetEditorvb.vb new file mode 100644 index 0000000..eb277fc --- /dev/null +++ b/p2isPSX_CDToolkit/StringsOffsetEditorvb.vb @@ -0,0 +1,741 @@ +Imports System.IO +Imports System.Runtime.Remoting.Metadata.W3cXsd2001 + +Public Class StringsOffsetEditorvb + + Public files1 As List(Of fileInfo) + Public files2 As List(Of fileInfo) + Public files3 As List(Of fileInfo) + Public files4 As List(Of fileInfo) 'KUDOS + Public CurFile As Byte() + Public EngFile As Byte() + Public JapFile As Byte() + Public KudosFile As Byte() + + Public MaximusSize As Integer + Public OffsetsTableSize As Integer + Public TextSize As Integer + + + Private Sub StringsOffsetEditorvb_Load(sender As Object, e As EventArgs) Handles MyBase.Load + + Dim cd = New ISOTools + + 'Reading filetable and make array + files1 = cd.makeFileList(UserPath.Text) + files2 = cd.makeFileList(EngISOPath.Text) + files3 = cd.makeFileList(JapISOPath.Text) + files4 = cd.makeFileList(KUDOSpath.Text) + + End Sub + + Private Sub FindOffsetInJP_Click(sender As Object, e As EventArgs) Handles FindOffsetInJP.Click + + Dim cd = New ISOTools + If Not IsNumeric(FileID.Text) Then MsgBox("FILE ID IS NOT NUMERIC!", MsgBoxStyle.Critical) : Exit Sub + If Not IsNumeric(EngOffset.Text) Then MsgBox("ENG OFFSET IS NOT NUMERIC!", MsgBoxStyle.Critical) : Exit Sub + + If RadioFile.Checked Then + CurFile = cd.getCDfile(UserPath.Text, files1(FileID.Text).Sector, files1(FileID.Text).Sizw).ToArray + EngFile = cd.getCDfile(EngISOPath.Text, files2(FileID.Text).Sector, files2(FileID.Text).Sizw).ToArray + Else + CurFile = cd.getCDfile(UserPath.Text, 27, 1812408).ToArray + EngFile = cd.getCDfile(EngISOPath.Text, 27, 1812408).ToArray + End If + + Dim Off = BitConverter.ToInt32(EngFile, EngOffset.Text) + If Off > 1000 Then MsgBox("Error in EngOffset (Kakaya-to Hnya)!", MsgBoxStyle.Critical) : Exit Sub + + Dim offsets = New List(Of Integer) + + For a = 0 To CurFile.Length - 1 Step 4 + If BitConverter.ToInt32(CurFile, a) = Off Then + 'Validate table with offsets + If BitConverter.ToInt32(CurFile, a + 4) = Off * 4 + 4 Then offsets.Add(a) 'First_offset * 4 + 4 == must be address after offsets table + End If + Next + + If offsets.Count = 0 Then MsgBox("Offsets not found in JAP ISO!", MsgBoxStyle.Critical) : Exit Sub + If offsets.Count = 1 Then Offset.Text = offsets(0) : LoadBtn.PerformClick() : Exit Sub + + Dim txt = "Found " & offsets.Count & " offsets.Count" & vbCrLf + For a = 0 To offsets.Count - 1 + txt &= offsets(a) & " : " & BitConverter.ToInt32(CurFile, offsets(a)).ToString("X8") & " " + txt &= BitConverter.ToInt32(CurFile, offsets(a) + 4).ToString("X8") & " " + txt &= BitConverter.ToInt32(CurFile, offsets(a) + 8).ToString("X8") & " " + txt &= BitConverter.ToInt32(CurFile, offsets(a) + 12).ToString("X8") & vbCrLf + Next + + + + Dim Input = InputBox(txt & vbCrLf & "Enter offset ID:", "More than 1", "0") + If Not IsNumeric(Input) Then Exit Sub + If Int(Input) > offsets.Count - 1 Then Exit Sub + + 'Load offset and texts + Offset.Text = offsets(Input) : LoadBtn.PerformClick() + + + End Sub + + Private Sub LoadBtn_Click(sender As Object, e As EventArgs) Handles LoadBtn.Click + + Dim cd = New ISOTools + + + If Not IsNumeric(FileID.Text) Then MsgBox("FILE ID IS NOT NUMERIC!", MsgBoxStyle.Critical) : Exit Sub + If Not IsNumeric(Offset.Text) Then MsgBox("FILE OFFSET IS NOT NUMERIC!", MsgBoxStyle.Critical) : Exit Sub + If RadioFile.Checked Then + + CurFile = cd.getCDfile(UserPath.Text, files1(FileID.Text).Sector, files1(FileID.Text).Sizw).ToArray + EngFile = cd.getCDfile(EngISOPath.Text, files2(FileID.Text).Sector, files2(FileID.Text).Sizw).ToArray + JapFile = cd.getCDfile(JapISOPath.Text, files3(FileID.Text).Sector, files3(FileID.Text).Sizw).ToArray + + KudosFile = cd.getCDfile(KUDOSpath.Text, files4(FileID.Text).Sector, files2(FileID.Text).Sizw).ToArray + + + Else + CurFile = cd.getCDfile(UserPath.Text, 27, 1812408).ToArray + EngFile = cd.getCDfile(EngISOPath.Text, 27, 1812408).ToArray + JapFile = cd.getCDfile(JapISOPath.Text, 27, 1812408).ToArray + + KudosFile = cd.getCDfile(KUDOSpath.Text, 27 + 26, 1812408).ToArray + + End If + + + If BitConverter.ToInt32(CurFile, Offset.Text) > 1000 Then MsgBox("Error in MainfileOffset!", MsgBoxStyle.Critical) : Exit Sub + 'If BitConverter.ToInt32(EngFile, Offset.Text) > 1000 Then MsgBox("Error in ENGfileOffset!", MsgBoxStyle.Critical) : Exit Sub + Dim rws As Integer = BitConverter.ToInt32(CurFile, Offset.Text) + Dim reader = Offset.Text + 4 + Dim engReader = EngOffset.Text + 4 + Dim japRd = 0 + Dim engRd = 0 + Dim kudRd = 0 + Dim estr As String = "" + Dim kstr As String = "" + DataGridView1.Rows.Clear() + For a = 0 To rws - 1 + If DontEnglish.Checked Then GoTo dontEnglish + + 'READING ENG STRING + + Dim curAddr As Integer = BitConverter.ToInt32(EngFile, engReader) + EngOffset.Text + estr = "" + Do + Dim chrr = BitConverter.ToUInt16(EngFile, curAddr) 'Reading 2 Bytes! + If chrr = &H96E Then estr &= "[man]" : curAddr += 2 : Continue Do + If chrr = &H96F Then estr &= "[woman]" : curAddr += 2 : Continue Do + If (chrr And &H1000) Or OnlyCodes_Mode.Checked Then + If chrr = &H1101 And BitConverter.ToUInt16(EngFile, curAddr + 2) = &H1106 And + BitConverter.ToUInt16(EngFile, curAddr + 4) = &H1101 And + BitConverter.ToUInt16(EngFile, curAddr + 6) = &H1103 Then estr &= "[END]" : Exit Do + If chrr = &H1136 Then + curAddr += 2 + Dim aaa = EngFile(curAddr) + Do Until aaa = 0 + estr &= Chr(aaa) + curAddr += 1 + aaa = EngFile(curAddr) + Loop + If curAddr And 1 Then curAddr += 1 + Continue Do + End If + If chrr = &H1103 Then estr &= "[END311]" : Exit Do + If chrr = &H1101 And BitConverter.ToUInt16(EngFile, curAddr + 2) = &H1103 Then estr &= "[end]" : Exit Do + If chrr = &H1120 Then estr &= " " : curAddr += 2 : Continue Do + If chrr = &H1121 Then estr &= " " : curAddr += 2 : Continue Do + Dim c1 = EngFile(curAddr) : Dim c2 = EngFile(curAddr + 1) + Dim gg = c2 And 15 + If OnlyCodes_Mode.Checked Then + estr &= "[" & c1.ToString("X2") & c2.ToString("X2") & "]" + curAddr += 2 + Else + For byteskip = 1 To gg + estr &= "[" & c1.ToString("X2") & c2.ToString("X2") & "]" + curAddr += 2 + c1 = EngFile(curAddr) : c2 = EngFile(curAddr + 1) + Next + End If + Continue Do + End If + chrr = chrr And 255 : If chrr < 32 Then chrr += 32 + estr &= Chr(chrr) + curAddr += 2 + Loop + + + 'reading Kudos + If Not KudosLoad.Checked Then GoTo dontEnglish + kstr = "" + curAddr = BitConverter.ToInt32(KudosFile, engReader) + EngOffset.Text + Do + + Dim chrr = BitConverter.ToUInt16(KudosFile, curAddr) 'Reading 2 Bytes! + + If (chrr And &H1000) Or OnlyCodes_Mode.Checked Then + If chrr = &H1101 And BitConverter.ToUInt16(KudosFile, curAddr + 2) = &H1106 And + BitConverter.ToUInt16(KudosFile, curAddr + 4) = &H1101 And + BitConverter.ToUInt16(KudosFile, curAddr + 6) = &H1103 Then kstr &= "[END]" : Exit Do + If chrr = &H1136 Then + curAddr += 2 + Dim aaa = KudosFile(curAddr) + Do Until aaa = 0 + kstr &= Chr(aaa) + curAddr += 1 + aaa = KudosFile(curAddr) + Loop + If curAddr And 1 Then curAddr += 1 + Continue Do + End If + If chrr = &H1103 Then Exit Do + If chrr = &H1101 And BitConverter.ToUInt16(KudosFile, curAddr + 2) = &H1103 Then Exit Do + If chrr = &H1120 Then kstr &= " " : curAddr += 2 : Continue Do + If chrr = &H1121 Then kstr &= " " : curAddr += 2 : Continue Do + Dim c1 = KudosFile(curAddr) : Dim c2 = KudosFile(curAddr + 1) + Dim gg = c2 And 15 + If OnlyCodes_Mode.Checked Then + kstr &= "[" & c1.ToString("X2") & c2.ToString("X2") & "]" + curAddr += 2 + Else + For byteskip = 1 To gg + kstr &= "[" & c1.ToString("X2") & c2.ToString("X2") & "]" + curAddr += 2 + c1 = KudosFile(curAddr) : c2 = KudosFile(curAddr + 1) + Next + End If + Continue Do + End If + + + + + chrr = chrr And 255 : If chrr < 32 Then chrr += 32 + kstr &= Chr(chrr) + curAddr += 2 + Loop + + kstr = Unkudos(kstr) + + + +dontEnglish: + + 'READING JAP STRING + Dim jstr As String = "" + Dim curJAddr As Integer = BitConverter.ToInt32(CurFile, reader) + Offset.Text + + Do + + If BitConverter.ToInt16(CurFile, curJAddr) And &H2000 Then 'If its my rus text + curJAddr += 2 + For x = 0 To CurFile(curJAddr - 2) - 1 + jstr &= Chr(CurFile(curJAddr + x)) + Next + + curJAddr += CurFile(curJAddr - 2) + If curJAddr And 1 Then curJAddr += 1 + End If + + + + + If LineModeSimple.Checked Then Exit Do + If BitConverter.ToInt16(CurFile, curJAddr) And &H2000 Then Exit Do + + 'If jstr.Length > 500 Then Exit Do + + Dim chrr = BitConverter.ToUInt16(CurFile, curJAddr) 'Reading 2 Bytes! + + If chrr = &H96E Then jstr &= "[man]" : curJAddr += 2 : Continue Do + If chrr = &H96F Then jstr &= "[woman]" : curJAddr += 2 : Continue Do + + + If (chrr And &H1000) Or OnlyCodes_Mode.Checked Then + If chrr = &H1101 And BitConverter.ToUInt16(CurFile, curJAddr + 2) = &H1106 And + BitConverter.ToUInt16(CurFile, curJAddr + 4) = &H1101 And + BitConverter.ToUInt16(CurFile, curJAddr + 6) = &H1103 Then jstr &= "[END]" : Exit Do + + + If chrr = &H1103 Then jstr &= "[END311]" : Exit Do + + If chrr = &H1101 And BitConverter.ToUInt16(CurFile, curJAddr + 2) = &H1103 Then Exit Do 'jstr &= "[end]" : Exit Do + + If chrr = &H1120 Then jstr &= " " : curJAddr += 2 : Continue Do + If chrr = &H1121 Then jstr &= " " : curJAddr += 2 : Continue Do + + Dim c1 = CurFile(curJAddr) : Dim c2 = CurFile(curJAddr + 1) + + Dim gg = c2 And 15 + If OnlyCodes_Mode.Checked Then + + jstr &= "[" & c1.ToString("X2") & c2.ToString("X2") & "]" + curJAddr += 2 + + Else + For byteskip = 1 To gg + jstr &= "[" & c1.ToString("X2") & c2.ToString("X2") & "]" + curJAddr += 2 + c1 = CurFile(curJAddr) : c2 = CurFile(curJAddr + 1) + Next + End If + + Continue Do + + End If + + + + 'chrr = chrr And 255 : If chrr < 32 Then chrr += 32 + 'jstr &= CurFile(curJAddr).ToString("X2") & CurFile(curJAddr + 1).ToString("X2") + jstr &= Form1.chars(CurFile(curJAddr) + CurFile(curJAddr + 1) * 256) + curJAddr += 2 + + Loop +Myscr: + DataGridView1.Rows.Add(a, jstr, estr, kstr) + reader += 4 'shift offset addr + engReader += 4 + Next + OffsetsTableSize = BitConverter.ToInt32(JapFile, Offset.Text) * 4 + 4 + Dim lastJapStrOffs As Integer = BitConverter.ToInt32(JapFile, OffsetsTableSize + Offset.Text - 4) + Offset.Text + 'reading japan table limis + reader = lastJapStrOffs + Do + If JapFile(reader) = 3 And JapFile(reader + 1) = &H11 Then + TextSize = reader + 2 - Offset.Text - OffsetsTableSize + MaximusSize = reader + 2 - Offset.Text + Exit Do + End If + reader += 1 + Loop + OffSz.Text = "Offset Table: " & OffsetsTableSize + TxtSz.Text = "Text Size: " & TextSize + Allsz.Text = "OverAll: " & MaximusSize + End Sub + + Public Function CompileLine(ByRef str As String) + Dim bts = New List(Of Byte) + + Dim c As Integer 'counter + + If str.Length = 0 Then Return bts + + 'OLD JAP TEXT FORMAT + If str(0) = "#" Then + 'xx += 1 + For xx = 1 To str.Length - 1 + bts.Add(Asc(str(xx))) + bts.Add(0) + + Next + bts.Add(0) + bts.Add(16) 'Close string + Return bts + End If + + + + 'NEW FORMAT + For xx = 0 To str.Length - 1 + If str(xx) = "^" Then xx += 1 + + + + If str(xx) = "[" Then + Dim skRes As String = getFromSkobki(str, xx) + If skRes = "END" Then + bts.AddRange({1, 17, 6, 17, 1, 17, 3, 17}) : Exit For + End If + + If skRes = "end" Then + bts.AddRange({1, 17, 3, 17}) : Exit For + End If + + If skRes = "END311" Then + bts.AddRange({3, 17}) : Exit For + End If + + + If skRes = "man" Then bts.AddRange({110, 9}) : Continue For + If skRes = "woman" Then bts.AddRange({111, 9}) : Continue For + + If skRes.Length = 4 Then + bts.AddRange(SoapHexBinary.Parse(skRes).Value.ToList) + End If + Continue For + End If + + + Dim SimpleTextAccum = New List(Of Byte) + Dim readCounter As Byte = 1 + + Do + If xx = str.Length Then xx -= 1 : Exit Do + If Asc(str(xx)) < 32 Or Asc(str(xx)) = 91 Then xx -= 1 : Exit Do + SimpleTextAccum.Add(Asc(str(xx))) + xx += 1 + Loop + + 'if 1 or 2 bytes + If SimpleTextAccum.Count = 1 Then bts.AddRange({SimpleTextAccum(0), 0}) : Continue For + If SimpleTextAccum.Count = 2 Then bts.AddRange({SimpleTextAccum(0), 0, SimpleTextAccum(1), 0}) : Continue For + + + bts.Add(SimpleTextAccum.Count) + bts.Add(&H20) 'command & length + bts.AddRange(SimpleTextAccum) 'attach textline + If SimpleTextAccum.Count And 1 Then bts.Add(0) ' if and 1 - add empty byte + + + + Next + + Return bts + + End Function + + + Private Sub SaveBtn_Click(sender As Object, e As EventArgs) Handles SaveBtn.Click + Dim FinalArr = New List(Of Byte) + For a = 0 To OffsetsTableSize - 1 + FinalArr.Add(CurFile(a + Offset.Text)) + Next + + For Each row In DataGridView1.Rows + Dim isSimilar As Boolean = False + Dim curIndx = DataGridView1.Rows.IndexOf(row) + Dim curOffset As Integer = FinalArr.Count + + 'NEED TO SEARCH SIMILAR STRINGS!!! And MAKE INDEX without ADDING STRING! + For xxx = 0 To curIndx - 1 + If DataGridView1.Rows(xxx).Cells(1).Value = row.Cells(1).Value Then + isSimilar = True + curOffset = BitConverter.ToInt32(FinalArr.ToArray, xxx * 4 + 4) + Exit For + End If + + Next + + + Dim offsetAddr As Integer = curIndx * 4 + 4 + + FinalArr(offsetAddr) = BitConverter.GetBytes(curOffset)(0) + FinalArr(offsetAddr + 1) = BitConverter.GetBytes(curOffset)(1) + FinalArr(offsetAddr + 2) = BitConverter.GetBytes(curOffset)(2) + + If isSimilar Then Continue For 'Similar String + + Dim curStr = row.Cells(1).Value.ToString + + + 'TEXT ADDING PART + + If curStr = "" Then Continue For + + If LineModeSimple.Checked And curStr(0) <> "^" And curStr(0) <> "#" Then + + FinalArr.AddRange({curStr.Length, &H20}) 'Length Of string + For a = 0 To curStr.Length - 1 + FinalArr.Add(Asc(curStr(a))) + Next + If FinalArr.Count And 1 Then FinalArr.Add(0) + Else + FinalArr.AddRange(CompileLine(curStr)) + End If + + Next + + 'Saving & importing FIle + If FinalArr.Count > MaximusSize Then MsgBox("SIZE EXCEED! " & FinalArr.Count) : Exit Sub + For a = 0 To FinalArr.Count - 1 + CurFile(a + Offset.Text) = FinalArr(a) + Next + Dim cd = New ISOTools + If RadioFile.Checked Then + cd.saveCDfile(UserPath.Text, files1(FileID.Text).Sector, files1(FileID.Text).Sizw, CurFile) + Else + cd.saveCDfile(UserPath.Text, 27, 1812408, CurFile) + End If + + MsgBox("Succesfully Saved!", MsgBoxStyle.Information) + 'Dim filnam As String = "D:\Games\PSX\Persona.2.Innocent.Sin\Export\0063_SHOPS_CODE\EDITOR\TESTOUTPUT" + 'My.Computer.FileSystem.WriteAllBytes(filnam, FinalArr.ToArray, False) + + + End Sub + + + Private Sub SaveSettings_Click(sender As Object, e As EventArgs) Handles SaveSettings.Click + If SetName.Text.Count = 0 Then MsgBox("Enter name!") : Exit Sub + Dim filnam As String = "D:\Games\PSX\Persona 2 - Batsu (NTSC-J) [SLPS-02825]\Export\LINES_EDITOR\" + If RadioFile.Checked Then filnam &= FileID.Text & "_" Else filnam &= "0000_" + filnam &= Offset.Text & "_" & EngOffset.Text & "_" & SetName.Text & ".txt" + + My.Computer.FileSystem.WriteAllText(filnam, SetName.Text, False) + + End Sub + + Private Sub LoadSettings_Click(sender As Object, e As EventArgs) Handles LoadSettings.Click + + Form1.OpenFileDialog1.InitialDirectory = "D:\Games\PSX\Persona 2 - Batsu (NTSC-J) [SLPS-02825]\Export\LINES_EDITOR\" + If Form1.OpenFileDialog1.ShowDialog <> DialogResult.OK Then Exit Sub + Dim fileInfo = Split(Path.GetFileNameWithoutExtension(Form1.OpenFileDialog1.FileName), "_") + Dim Settings() = Split(My.Computer.FileSystem.ReadAllText(Form1.OpenFileDialog1.FileName), vbCrLf) + SetName.Text = Settings(0) + + If fileInfo(0) = "0000" Then + RadioFile.Checked = False : RadioSector.Checked = True + FileID.Text = fileInfo(0) + Offset.Text = fileInfo(1) + EngOffset.Text = fileInfo(2) + + LoadBtn.PerformClick() + Else + RadioFile.Checked = True : RadioSector.Checked = False + FileID.Text = fileInfo(0) + Offset.Text = fileInfo(1) + EngOffset.Text = fileInfo(2) + + LoadBtn.PerformClick() + + End If + + End Sub + + Public Sub CalcYourTextSize() + Dim byteCount = 0 + + If LineModeSimple.Checked Then + + For Each row In DataGridView1.Rows + + Dim rrr = row.Cells(1).Value + If Not IsNothing(rrr) Then + If rrr.ToString.Length = 0 Then Continue For + + 'if jap insert + + If rrr(0) = "#" Then + byteCount += (rrr.ToString.Length - 1) * 2 + 2 + Else + byteCount += 2 + rrr.ToString.Length + End If + End If + Next + + If byteCount > TextSize Then + YourTxtSz.ForeColor = Color.Red + Else + YourTxtSz.ForeColor = Color.Blue + End If + + If byteCount And 1 Then byteCount += 1 + + Else + For Each row In DataGridView1.Rows + Dim curIndx = DataGridView1.Rows.IndexOf(row) + For xxx = 0 To curIndx - 1 + If DataGridView1.Rows(xxx).Cells(1).Value = row.Cells(1).Value Then GoTo simil + Next + Dim line As List(Of Byte) = CompileLine(row.Cells(1).Value.ToString) 'Check similar strings + byteCount += line.Count + +simil: + Next + + End If + + YourTxtSz.Text = "Your text sz: " & byteCount + If byteCount > TextSize Then YourTxtSz.ForeColor = Color.Red Else YourTxtSz.ForeColor = Color.Blue + + End Sub + + Public Function getFromSkobki(ByRef tx As String, ByRef x As Integer) + + x = x + 1 + Dim accum = "" + Do While tx(x) <> "]" + accum &= tx(x) + x += 1 + Loop + Return accum + + End Function + + Private Sub DataGridView1_CellEndEdit(sender As Object, e As DataGridViewCellEventArgs) Handles DataGridView1.CellEndEdit + CalcYourTextSize() + End Sub + + Private Sub DataGridView1_SelectionChanged(sender As Object, e As EventArgs) Handles DataGridView1.SelectionChanged + If LineModeComplex.Checked Then Exit Sub + If DataGridView1.CurrentCell.ColumnIndex <> 1 Then Exit Sub + Dim aaa = DataGridView1.CurrentCell + If IsNothing(aaa.Value) Then Exit Sub + Dim ddd = aaa.Value.ToString.Length + CurLen.Text = "Cur. Len.: " & ddd + If ddd > 19 Then CurLen.ForeColor = Color.Red Else CurLen.ForeColor = Color.Blue + End Sub + + + Private Sub Button2_Click(sender As Object, e As EventArgs) Handles tempSave.Click + Dim filnam As String = "D:\Games\PSX\Persona 2 - Batsu (NTSC-J) [SLPS-02825]\Export\LINES_EDITOR\TEMP_TEXT\" + If RadioFile.Checked Then filnam &= FileID.Text & "_" Else filnam &= "0000_" + filnam &= Offset.Text & "_" & SetName.Text & "_TEMP_TEXT.txt" + + Dim txt As String = "" + + For Each row In DataGridView1.Rows + Dim aaa = DataGridView1.CurrentCell + If IsNothing(row.Cells(1).Value) Then MsgBox("Error reading tgable! Pleasem, resave!") : Exit Sub + txt += row.Cells(1).Value.ToString & vbCrLf + Next + + My.Computer.FileSystem.WriteAllText(filnam, txt, False) + End Sub + + Private Sub Button3_Click(sender As Object, e As EventArgs) Handles tempLoad.Click + Form1.OpenFileDialog1.InitialDirectory = "D:\Games\PSX\Persona 2 - Batsu (NTSC-J) [SLPS-02825]\Export\LINES_EDITOR\TEMP_TEXT\" + If Form1.OpenFileDialog1.ShowDialog <> DialogResult.OK Then Exit Sub + + Dim txt = Split(My.Computer.FileSystem.ReadAllText(Form1.OpenFileDialog1.FileName), vbCrLf) + ReDim Preserve txt(DataGridView1.Rows.Count - 1) + + For Each row In DataGridView1.Rows + + row.Cells(1).Value = txt(DataGridView1.Rows.IndexOf(row)) + Next + + End Sub + + Private Sub PatchFileBtn_Click(sender As Object, e As EventArgs) Handles PatchFileBtn.Click + + + Dim cd = New ISOTools + If Not IsNumeric(patchFileID.Text) Then MsgBox("FILE ID IS NOT NUMERIC!", MsgBoxStyle.Critical) : Exit Sub + If Not IsNumeric(patchOffset.Text) Then MsgBox("FILE OFFSET IS NOT NUMERIC!", MsgBoxStyle.Critical) : Exit Sub + + Dim patchFile() As Byte + If PatchFileRadio.Checked Then + patchFile = cd.getCDfile(UserPath.Text, files1(patchFileID.Text).Sector, files1(patchFileID.Text).Sizw).ToArray + Else + patchFile = cd.getCDfile(UserPath.Text, 27, 1812408).ToArray + End If + + Dim test = BitConverter.ToInt32(patchFile, patchOffset.Text) + + If test = 201474048 Then MsgBox("Already patched with 80090000! ;)", MsgBoxStyle.Information) : Exit Sub + If test <> 201352384 Then MsgBox("Wrong 80019300 call!", MsgBoxStyle.Critical) : Exit Sub + + patchFile(patchOffset.Text) = 0 + patchFile(patchOffset.Text + 1) = &H40 + patchFile(patchOffset.Text + 2) = 2 + patchFile(patchOffset.Text + 3) = &HC + + If PatchFileRadio.Checked Then + cd.saveCDfile(UserPath.Text, files1(patchFileID.Text).Sector, files1(patchFileID.Text).Sizw, patchFile) + Else + cd.saveCDfile(UserPath.Text, 27, 1812408, patchFile) + End If + MsgBox("Succesfull patched.", MsgBoxStyle.Information) + + End Sub + + + Private Sub ReplaceAll_Click(sender As Object, e As EventArgs) Handles ReplaceAll.Click + If Not IsNumeric(patchFileID.Text) Then MsgBox("FILE ID IS NOT NUMERIC!", MsgBoxStyle.Critical) : Exit Sub + If Not IsNumeric(patchOffset.Text) Then MsgBox("FILE OFFSET IS NOT NUMERIC!", MsgBoxStyle.Critical) : Exit Sub + Dim cd = New ISOTools + Dim patchFile() As Byte + If PatchFileRadio.Checked Then + patchFile = cd.getCDfile(UserPath.Text, files1(FileID.Text).Sector, files1(FileID.Text).Sizw).ToArray + Else + patchFile = cd.getCDfile(UserPath.Text, 27, 1812408).ToArray + End If + + Dim overall = 0 + + For a = 0 To patchFile.Length - 1 Step 4 + + If a > 500000 Then Exit For 'don't touch my code and jumps if in main EXE + + If BitConverter.ToInt32(patchFile, a) = 201353450 Then + patchFile(a) = 0 + patchFile(a + 1) = &H40 + patchFile(a + 2) = 2 + patchFile(a + 3) = &HC + overall += 1 + End If + Next + + If PatchFileRadio.Checked Then + cd.saveCDfile(UserPath.Text, files1(FileID.Text).Sector, files1(FileID.Text).Sizw, patchFile) + Else + cd.saveCDfile(UserPath.Text, 27, 1812408, patchFile) + End If + + MsgBox("Patched " & overall & " text calls!", MsgBoxStyle.Information) + + + + End Sub + + Private Sub EngSave_Click(sender As Object, e As EventArgs) Handles EngSave.Click + Dim filnam As String = "D:\Games\PSX\Persona 2 - Batsu (NTSC-J) [SLPS-02825]\Export\LINES_EDITOR\TEMP_TEXT\" + If RadioFile.Checked Then filnam &= FileID.Text & "_" Else filnam &= "0000_" + filnam &= Offset.Text & "_" & SetName.Text & "_ENG_TEXT.txt" + + Dim txt As String = "" + + For Each row In DataGridView1.Rows + txt += row.Cells(2).Value.ToString & vbCrLf + Next + + + My.Computer.FileSystem.WriteAllText(filnam, txt, False) + End Sub + + + Public Function Unkudos(ByRef Str As String) + Str = Str.Replace("V", "л") + Str = Str.Replace("v", "ф") + Str = Str.Replace("D", "Д") + Str = Str.Replace("h", "н") + Str = Str.Replace("j", "у") + Str = Str.Replace("w", "ж") + Str = Str.Replace("W", "Ж") + Str = Str.Replace("z", "ч") + Str = Str.Replace("O", "Ф") + Str = Str.Replace("t", "т") + Str = Str.Replace("Y", "У") + Str = Str.Replace("u", "ю") + Str = Str.Replace("Q", "Э") + Str = Str.Replace("q", "з") + Str = Str.Replace("x", "б") + Str = Str.Replace("m", "м") + Str = Str.Replace("f", "г") + Str = Str.Replace("y", "п") + Str = Str.Replace("n", "и") + Str = Str.Replace("N", "И") + Str = Str.Replace("J", "П") + Str = Str.Replace("Z", "Г") + Str = Str.Replace("g", "ш") + Str = Str.Replace("G", "Ш") + Str = Str.Replace("b", "в") + Str = Str.Replace("d", "д") + Str = Str.Replace("-", "ч") + Str = Str.Replace("S", "б") + Str = Str.Replace("r", "я") + Str = Str.Replace("s", "ы") + Str = Str.Replace("&", "О") + Str = Str.Replace("R", "Я") + Str = Str.Replace("L", "л") + Str = Str.Replace("l", "x") + + Return Str + + + End Function + + +End Class \ No newline at end of file diff --git a/p2isPSX_CDToolkit/bin/Debug/1 b/p2isPSX_CDToolkit/bin/Debug/1 new file mode 100644 index 0000000..b1e3ad3 Binary files /dev/null and b/p2isPSX_CDToolkit/bin/Debug/1 differ diff --git a/p2isPSX_CDToolkit/bin/Debug/FileDesc.txt b/p2isPSX_CDToolkit/bin/Debug/FileDesc.txt new file mode 100644 index 0000000..1923ebf --- /dev/null +++ b/p2isPSX_CDToolkit/bin/Debug/FileDesc.txt @@ -0,0 +1,881 @@ + + + + + + + + + +GRF_WILD9 +GRF_BJACK +GRF_AROUS +GRF_BINGO +FONTS + +TXTIN_COD + +GRF_TATSU + + + + + + + + + + + + + + + + + + + + + + + + +EVENTCODE + + + + + + +GR_BTLSPR +GRF_AVAS + + + + + +EVENT_SPR +EVENTPACK +... +... +... + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +. +.. +... +.... +LASTEVENT + +GRF_FX + +GRF_FX + +GRF_FX + +GRF_FX + +GRF_FX + +GRF_FX + +GRF_FX + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +GRF_FX + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +GRFLASTFX +GRFGAMOVR +LittleFnt + + +ExtraPack +...... +..... +.... +... +.. +. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +. +.. +... +.... +...... +LastExtra + + + + +IntrFcTIM +TitleCode +TitleScrn + + +BattlTxt? +Gfx_Avata + + + + + + + + + + + + +Gfx_Cards +Gfx_Crds2 +Gfx_BGs +Gfx_BGs2 + + + + + + + + + + +CityPack1 +CityPack2 +CityPack3 +CityPack4 +CityPack5 +CityPack6 +CityPack7 +CityBGs + + + + +City_HUD + + + +EndGamePk + + +R&DLogo +Dung_HUD + +Dung_TEXT +Dung_CODE + + + + +DungPack1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +DngPkLast +BattlMenu + + +TxtBattl2 +TextBattl + + + +GrfBattle +GrfDemons + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +PrsnSprts + + + + + + + +MenuAvata +PrsnaCard + + + + + + + + +PrtySprts +FX_SPR + + + + + + + + + + + + +Vid_Intro + + + + + + + + + + + + + + diff --git a/p2isPSX_CDToolkit/bin/Debug/Free.Ports.libpng.dll b/p2isPSX_CDToolkit/bin/Debug/Free.Ports.libpng.dll new file mode 100644 index 0000000..0039e7d Binary files /dev/null and b/p2isPSX_CDToolkit/bin/Debug/Free.Ports.libpng.dll differ diff --git a/p2isPSX_CDToolkit/bin/Debug/Free.Ports.libpng.xml b/p2isPSX_CDToolkit/bin/Debug/Free.Ports.libpng.xml new file mode 100644 index 0000000..f09521b --- /dev/null +++ b/p2isPSX_CDToolkit/bin/Debug/Free.Ports.libpng.xml @@ -0,0 +1,8 @@ + + + + Free.Ports.libpng + + + + diff --git a/p2isPSX_CDToolkit/bin/Debug/Free.Ports.zLib.dll b/p2isPSX_CDToolkit/bin/Debug/Free.Ports.zLib.dll new file mode 100644 index 0000000..6f9ea51 Binary files /dev/null and b/p2isPSX_CDToolkit/bin/Debug/Free.Ports.zLib.dll differ diff --git a/p2isPSX_CDToolkit/bin/Debug/Free.Ports.zLib.xml b/p2isPSX_CDToolkit/bin/Debug/Free.Ports.zLib.xml new file mode 100644 index 0000000..a56b7fc --- /dev/null +++ b/p2isPSX_CDToolkit/bin/Debug/Free.Ports.zLib.xml @@ -0,0 +1,8 @@ + + + + Free.Ports.zLib + + + + diff --git a/p2isPSX_CDToolkit/bin/Debug/Zlib.Portable.dll b/p2isPSX_CDToolkit/bin/Debug/Zlib.Portable.dll new file mode 100644 index 0000000..bb685c3 Binary files /dev/null and b/p2isPSX_CDToolkit/bin/Debug/Zlib.Portable.dll differ diff --git a/p2isPSX_CDToolkit/bin/Debug/Zlib.Portable.xml b/p2isPSX_CDToolkit/bin/Debug/Zlib.Portable.xml new file mode 100644 index 0000000..c833149 --- /dev/null +++ b/p2isPSX_CDToolkit/bin/Debug/Zlib.Portable.xml @@ -0,0 +1,3430 @@ + + + + Zlib.Portable + + + + + Computes a CRC-32. The CRC-32 algorithm is parameterized - you + can set the polynomial and enable or disable bit + reversal. This can be used for GZIP, BZip2, or ZIP. + + + This type is used internally by DotNetZip; it is generally not used + directly by applications wishing to create, read, or manipulate zip + archive files. + + + + + Indicates the total number of bytes applied to the CRC. + + + + + Indicates the current CRC for all blocks slurped in. + + + + + Returns the CRC32 for the specified stream. + + The stream over which to calculate the CRC32 + the CRC32 calculation + + + + Returns the CRC32 for the specified stream, and writes the input into the + output stream. + + The stream over which to calculate the CRC32 + The stream into which to deflate the input + the CRC32 calculation + + + + Get the CRC32 for the given (word,byte) combo. This is a + computation defined by PKzip for PKZIP 2.0 (weak) encryption. + + The word to start with. + The byte to combine it with. + The CRC-ized result. + + + + Update the value for the running CRC32 using the given block of bytes. + This is useful when using the CRC32() class in a Stream. + + block of bytes to slurp + starting point in the block + how many bytes within the block to slurp + + + + Process one byte in the CRC. + + the byte to include into the CRC . + + + + Process a run of N identical bytes into the CRC. + + + + This method serves as an optimization for updating the CRC when a + run of identical bytes is found. Rather than passing in a buffer of + length n, containing all identical bytes b, this method accepts the + byte value and the length of the (virtual) buffer - the length of + the run. + + + the byte to include into the CRC. + the number of times that byte should be repeated. + + + + Combines the given CRC32 value with the current running total. + + + This is useful when using a divide-and-conquer approach to + calculating a CRC. Multiple threads can each calculate a + CRC32 on a segment of the data, and then combine the + individual CRC32 values at the end. + + the crc value to be combined with this one + the length of data the CRC value was calculated on + + + + Create an instance of the CRC32 class using the default settings: no + bit reversal, and a polynomial of 0xEDB88320. + + + + + Create an instance of the CRC32 class, specifying whether to reverse + data bits or not. + + + specify true if the instance should reverse data bits. + + + + In the CRC-32 used by BZip2, the bits are reversed. Therefore if you + want a CRC32 with compatibility with BZip2, you should pass true + here. In the CRC-32 used by GZIP and PKZIP, the bits are not + reversed; Therefore if you want a CRC32 with compatibility with + those, you should pass false. + + + + + + Create an instance of the CRC32 class, specifying the polynomial and + whether to reverse data bits or not. + + + The polynomial to use for the CRC, expressed in the reversed (LSB) + format: the highest ordered bit in the polynomial value is the + coefficient of the 0th power; the second-highest order bit is the + coefficient of the 1 power, and so on. Expressed this way, the + polynomial for the CRC-32C used in IEEE 802.3, is 0xEDB88320. + + + specify true if the instance should reverse data bits. + + + + + In the CRC-32 used by BZip2, the bits are reversed. Therefore if you + want a CRC32 with compatibility with BZip2, you should pass true + here for the reverseBits parameter. In the CRC-32 used by + GZIP and PKZIP, the bits are not reversed; Therefore if you want a + CRC32 with compatibility with those, you should pass false for the + reverseBits parameter. + + + + + + Reset the CRC-32 class - clear the CRC "remainder register." + + + + Use this when employing a single instance of this class to compute + multiple, distinct CRCs on multiple, distinct data blocks. + + + + + + A Stream that calculates a CRC32 (a checksum) on all bytes read, + or on all bytes written. + + + + + This class can be used to verify the CRC of a ZipEntry when + reading from a stream, or to calculate a CRC when writing to a + stream. The stream should be used to either read, or write, but + not both. If you intermix reads and writes, the results are not + defined. + + + + This class is intended primarily for use internally by the + DotNetZip library. + + + + + + The default constructor. + + + + Instances returned from this constructor will leave the underlying + stream open upon Close(). The stream uses the default CRC32 + algorithm, which implies a polynomial of 0xEDB88320. + + + The underlying stream + + + + The constructor allows the caller to specify how to handle the + underlying stream at close. + + + + The stream uses the default CRC32 algorithm, which implies a + polynomial of 0xEDB88320. + + + The underlying stream + true to leave the underlying stream + open upon close of the CrcCalculatorStream; false otherwise. + + + + A constructor allowing the specification of the length of the stream + to read. + + + + The stream uses the default CRC32 algorithm, which implies a + polynomial of 0xEDB88320. + + + Instances returned from this constructor will leave the underlying + stream open upon Close(). + + + The underlying stream + The length of the stream to slurp + + + + A constructor allowing the specification of the length of the stream + to read, as well as whether to keep the underlying stream open upon + Close(). + + + + The stream uses the default CRC32 algorithm, which implies a + polynomial of 0xEDB88320. + + + The underlying stream + The length of the stream to slurp + true to leave the underlying stream + open upon close of the CrcCalculatorStream; false otherwise. + + + + A constructor allowing the specification of the length of the stream + to read, as well as whether to keep the underlying stream open upon + Close(), and the CRC32 instance to use. + + + + The stream uses the specified CRC32 instance, which allows the + application to specify how the CRC gets calculated. + + + The underlying stream + The length of the stream to slurp + true to leave the underlying stream + open upon close of the CrcCalculatorStream; false otherwise. + the CRC32 instance to use to calculate the CRC32 + + + + Gets the total number of bytes run through the CRC32 calculator. + + + + This is either the total number of bytes read, or the total number of + bytes written, depending on the direction of this stream. + + + + + Provides the current CRC for all blocks slurped in. + + + + The running total of the CRC is kept as data is written or read + through the stream. read this property after all reads or writes to + get an accurate CRC for the entire stream. + + + + + + Indicates whether the underlying stream will be left open when the + CrcCalculatorStream is Closed. + + + + Set this at any point before calling . + + + + + + Read from the stream + + the buffer to read + the offset at which to start + the number of bytes to read + the number of bytes actually read + + + + Write to the stream. + + the buffer from which to write + the offset at which to start writing + the number of bytes to write + + + + Indicates whether the stream supports reading. + + + + + Indicates whether the stream supports seeking. + + + + Always returns false. + + + + + + Indicates whether the stream supports writing. + + + + + Flush the stream. + + + + + Returns the length of the underlying stream. + + + + + The getter for this property returns the total bytes read. + If you use the setter, it will throw + . + + + + + Seeking is not supported on this stream. This method always throws + + + N/A + N/A + N/A + + + + This method always throws + + + N/A + + + + A class for compressing and decompressing streams using the Deflate algorithm. + + + + + + The DeflateStream is a Decorator on a . It adds DEFLATE compression or decompression to any + stream. + + + + Using this stream, applications can compress or decompress data via stream + Read and Write operations. Either compresssion or decompression + can occur through either reading or writing. The compression format used is + DEFLATE, which is documented in IETF RFC 1951, "DEFLATE + Compressed Data Format Specification version 1.3.". + + + + This class is similar to , except that + ZlibStream adds the RFC + 1950 - ZLIB framing bytes to a compressed stream when compressing, or + expects the RFC1950 framing bytes when decompressing. The DeflateStream + does not. + + + + + + + + + + Create a DeflateStream using the specified CompressionMode. + + + + When mode is CompressionMode.Compress, the DeflateStream will use + the default compression level. The "captive" stream will be closed when + the DeflateStream is closed. + + + + This example uses a DeflateStream to compress data from a file, and writes + the compressed data to another file. + + using (System.IO.Stream input = System.IO.File.OpenRead(fileToCompress)) + { + using (var raw = System.IO.File.Create(fileToCompress + ".deflated")) + { + using (Stream compressor = new DeflateStream(raw, CompressionMode.Compress)) + { + byte[] buffer = new byte[WORKING_BUFFER_SIZE]; + int n; + while ((n= input.Read(buffer, 0, buffer.Length)) != 0) + { + compressor.Write(buffer, 0, n); + } + } + } + } + + + + Using input As Stream = File.OpenRead(fileToCompress) + Using raw As FileStream = File.Create(fileToCompress & ".deflated") + Using compressor As Stream = New DeflateStream(raw, CompressionMode.Compress) + Dim buffer As Byte() = New Byte(4096) {} + Dim n As Integer = -1 + Do While (n <> 0) + If (n > 0) Then + compressor.Write(buffer, 0, n) + End If + n = input.Read(buffer, 0, buffer.Length) + Loop + End Using + End Using + End Using + + + The stream which will be read or written. + Indicates whether the DeflateStream will compress or decompress. + + + + Create a DeflateStream using the specified CompressionMode and the specified CompressionLevel. + + + + + + When mode is CompressionMode.Decompress, the level parameter is + ignored. The "captive" stream will be closed when the DeflateStream is + closed. + + + + + + + This example uses a DeflateStream to compress data from a file, and writes + the compressed data to another file. + + + using (System.IO.Stream input = System.IO.File.OpenRead(fileToCompress)) + { + using (var raw = System.IO.File.Create(fileToCompress + ".deflated")) + { + using (Stream compressor = new DeflateStream(raw, + CompressionMode.Compress, + CompressionLevel.BestCompression)) + { + byte[] buffer = new byte[WORKING_BUFFER_SIZE]; + int n= -1; + while (n != 0) + { + if (n > 0) + compressor.Write(buffer, 0, n); + n= input.Read(buffer, 0, buffer.Length); + } + } + } + } + + + + Using input As Stream = File.OpenRead(fileToCompress) + Using raw As FileStream = File.Create(fileToCompress & ".deflated") + Using compressor As Stream = New DeflateStream(raw, CompressionMode.Compress, CompressionLevel.BestCompression) + Dim buffer As Byte() = New Byte(4096) {} + Dim n As Integer = -1 + Do While (n <> 0) + If (n > 0) Then + compressor.Write(buffer, 0, n) + End If + n = input.Read(buffer, 0, buffer.Length) + Loop + End Using + End Using + End Using + + + The stream to be read or written while deflating or inflating. + Indicates whether the DeflateStream will compress or decompress. + A tuning knob to trade speed for effectiveness. + + + + Create a DeflateStream using the specified + CompressionMode, and explicitly specify whether the + stream should be left open after Deflation or Inflation. + + + + + + This constructor allows the application to request that the captive stream + remain open after the deflation or inflation occurs. By default, after + Close() is called on the stream, the captive stream is also + closed. In some cases this is not desired, for example if the stream is a + memory stream that will be re-read after compression. Specify true for + the parameter to leave the stream open. + + + + The DeflateStream will use the default compression level. + + + + See the other overloads of this constructor for example code. + + + + + The stream which will be read or written. This is called the + "captive" stream in other places in this documentation. + + + + Indicates whether the DeflateStream will compress or decompress. + + + true if the application would like the stream to + remain open after inflation/deflation. + + + + Create a DeflateStream using the specified CompressionMode + and the specified CompressionLevel, and explicitly specify whether + the stream should be left open after Deflation or Inflation. + + + + + + When mode is CompressionMode.Decompress, the level parameter is ignored. + + + + This constructor allows the application to request that the captive stream + remain open after the deflation or inflation occurs. By default, after + Close() is called on the stream, the captive stream is also + closed. In some cases this is not desired, for example if the stream is a + that will be re-read after + compression. Specify true for the parameter + to leave the stream open. + + + + + + + This example shows how to use a DeflateStream to compress data from + a file, and store the compressed data into another file. + + + using (var output = System.IO.File.Create(fileToCompress + ".deflated")) + { + using (System.IO.Stream input = System.IO.File.OpenRead(fileToCompress)) + { + using (Stream compressor = new DeflateStream(output, CompressionMode.Compress, CompressionLevel.BestCompression, true)) + { + byte[] buffer = new byte[WORKING_BUFFER_SIZE]; + int n= -1; + while (n != 0) + { + if (n > 0) + compressor.Write(buffer, 0, n); + n= input.Read(buffer, 0, buffer.Length); + } + } + } + // can write additional data to the output stream here + } + + + + Using output As FileStream = File.Create(fileToCompress & ".deflated") + Using input As Stream = File.OpenRead(fileToCompress) + Using compressor As Stream = New DeflateStream(output, CompressionMode.Compress, CompressionLevel.BestCompression, True) + Dim buffer As Byte() = New Byte(4096) {} + Dim n As Integer = -1 + Do While (n <> 0) + If (n > 0) Then + compressor.Write(buffer, 0, n) + End If + n = input.Read(buffer, 0, buffer.Length) + Loop + End Using + End Using + ' can write additional data to the output stream here. + End Using + + + The stream which will be read or written. + Indicates whether the DeflateStream will compress or decompress. + true if the application would like the stream to remain open after inflation/deflation. + A tuning knob to trade speed for effectiveness. + + + + This property sets the flush behavior on the stream. + + See the ZLIB documentation for the meaning of the flush behavior. + + + + + The size of the working buffer for the compression codec. + + + + + The working buffer is used for all stream operations. The default size is + 1024 bytes. The minimum size is 128 bytes. You may get better performance + with a larger buffer. Then again, you might not. You would have to test + it. + + + + Set this before the first call to Read() or Write() on the + stream. If you try to set it afterwards, it will throw. + + + + + + The ZLIB strategy to be used during compression. + + + + By tweaking this parameter, you may be able to optimize the compression for + data with particular characteristics. + + + + Returns the total number of bytes input so far. + + + Returns the total number of bytes output so far. + + + + Dispose the stream. + + + + This may or may not result in a Close() call on the captive + stream. See the constructors that have a leaveOpen parameter + for more information. + + + Application code won't call this code directly. This method may be + invoked in two distinct scenarios. If disposing == true, the method + has been called directly or indirectly by a user's code, for example + via the public Dispose() method. In this case, both managed and + unmanaged resources can be referenced and disposed. If disposing == + false, the method has been called by the runtime from inside the + object finalizer and this method should not reference other objects; + in that case only unmanaged resources must be referenced or + disposed. + + + + true if the Dispose method was invoked by user code. + + + + + Indicates whether the stream can be read. + + + The return value depends on whether the captive stream supports reading. + + + + + Indicates whether the stream supports Seek operations. + + + Always returns false. + + + + + Indicates whether the stream can be written. + + + The return value depends on whether the captive stream supports writing. + + + + + Flush the stream. + + + + + Reading this property always throws a . + + + + + The position of the stream pointer. + + + + Setting this property always throws a . Reading will return the total bytes + written out, if used in writing, or the total bytes read in, if used in + reading. The count may refer to compressed bytes or uncompressed bytes, + depending on how you've used the stream. + + + + + Read data from the stream. + + + + + If you wish to use the DeflateStream to compress data while + reading, you can create a DeflateStream with + CompressionMode.Compress, providing an uncompressed data stream. + Then call Read() on that DeflateStream, and the data read will be + compressed as you read. If you wish to use the DeflateStream to + decompress data while reading, you can create a DeflateStream with + CompressionMode.Decompress, providing a readable compressed data + stream. Then call Read() on that DeflateStream, and the data read + will be decompressed as you read. + + + + A DeflateStream can be used for Read() or Write(), but not both. + + + + The buffer into which the read data should be placed. + the offset within that data array to put the first byte read. + the number of bytes to read. + the number of bytes actually read + + + + Calling this method always throws a . + + this is irrelevant, since it will always throw! + this is irrelevant, since it will always throw! + irrelevant! + + + + Calling this method always throws a . + + this is irrelevant, since it will always throw! + + + + Write data to the stream. + + + + + If you wish to use the DeflateStream to compress data while + writing, you can create a DeflateStream with + CompressionMode.Compress, and a writable output stream. Then call + Write() on that DeflateStream, providing uncompressed data + as input. The data sent to the output stream will be the compressed form + of the data written. If you wish to use the DeflateStream to + decompress data while writing, you can create a DeflateStream with + CompressionMode.Decompress, and a writable output stream. Then + call Write() on that stream, providing previously compressed + data. The data sent to the output stream will be the decompressed form of + the data written. + + + + A DeflateStream can be used for Read() or Write(), + but not both. + + + + + The buffer holding data to write to the stream. + the offset within that data array to find the first byte to write. + the number of bytes to write. + + + + Compress a string into a byte array using DEFLATE (RFC 1951). + + + + Uncompress it with . + + + DeflateStream.UncompressString(byte[]) + DeflateStream.CompressBuffer(byte[]) + GZipStream.CompressString(string) + ZlibStream.CompressString(string) + + + A string to compress. The string will first be encoded + using UTF8, then compressed. + + + The string in compressed form + + + + Compress a byte array into a new byte array using DEFLATE. + + + + Uncompress it with . + + + DeflateStream.CompressString(string) + DeflateStream.UncompressBuffer(byte[]) + GZipStream.CompressBuffer(byte[]) + ZlibStream.CompressBuffer(byte[]) + + + A buffer to compress. + + + The data in compressed form + + + + Uncompress a DEFLATE'd byte array into a single string. + + + DeflateStream.CompressString(String) + DeflateStream.UncompressBuffer(byte[]) + GZipStream.UncompressString(byte[]) + ZlibStream.UncompressString(byte[]) + + + A buffer containing DEFLATE-compressed data. + + + The uncompressed string + + + + Uncompress a DEFLATE'd byte array into a byte array. + + + DeflateStream.CompressBuffer(byte[]) + DeflateStream.UncompressString(byte[]) + GZipStream.UncompressBuffer(byte[]) + ZlibStream.UncompressBuffer(byte[]) + + + A buffer containing data that has been compressed with DEFLATE. + + + The data in uncompressed form + + + + A class for compressing and decompressing GZIP streams. + + + + + The GZipStream is a Decorator on a + . It adds GZIP compression or decompression to any + stream. + + + + Like the System.IO.Compression.GZipStream in the .NET Base Class Library, the + Ionic.Zlib.GZipStream can compress while writing, or decompress while + reading, but not vice versa. The compression method used is GZIP, which is + documented in IETF RFC + 1952, "GZIP file format specification version 4.3". + + + A GZipStream can be used to decompress data (through Read()) or + to compress data (through Write()), but not both. + + + + If you wish to use the GZipStream to compress data, you must wrap it + around a write-able stream. As you call Write() on the GZipStream, the + data will be compressed into the GZIP format. If you want to decompress data, + you must wrap the GZipStream around a readable stream that contains an + IETF RFC 1952-compliant stream. The data will be decompressed as you call + Read() on the GZipStream. + + + + Though the GZIP format allows data from multiple files to be concatenated + together, this stream handles only a single segment of GZIP format, typically + representing a single file. + + + + This class is similar to and . + ZlibStream handles RFC1950-compliant streams. + handles RFC1951-compliant streams. This class handles RFC1952-compliant streams. + + + + + + + + + + The comment on the GZIP stream. + + + + + The GZIP format allows for each file to optionally have an associated + comment stored with the file. The comment is encoded with the ISO-8859-1 + code page. To include a comment in a GZIP stream you create, set this + property before calling Write() for the first time on the + GZipStream. + + + + When using GZipStream to decompress, you can retrieve this property + after the first call to Read(). If no comment has been set in the + GZIP bytestream, the Comment property will return null + (Nothing in VB). + + + + + + The FileName for the GZIP stream. + + + + + + The GZIP format optionally allows each file to have an associated + filename. When compressing data (through Write()), set this + FileName before calling Write() the first time on the GZipStream. + The actual filename is encoded into the GZIP bytestream with the + ISO-8859-1 code page, according to RFC 1952. It is the application's + responsibility to insure that the FileName can be encoded and decoded + correctly with this code page. + + + + When decompressing (through Read()), you can retrieve this value + any time after the first Read(). In the case where there was no filename + encoded into the GZIP bytestream, the property will return null (Nothing + in VB). + + + + + + The last modified time for the GZIP stream. + + + + GZIP allows the storage of a last modified time with each GZIP entry. + When compressing data, you can set this before the first call to + Write(). When decompressing, you can retrieve this value any time + after the first call to Read(). + + + + + The CRC on the GZIP stream. + + + This is used for internal error checking. You probably don't need to look at this property. + + + + + Create a GZipStream using the specified CompressionMode. + + + + + When mode is CompressionMode.Compress, the GZipStream will use the + default compression level. + + + + As noted in the class documentation, the CompressionMode (Compress + or Decompress) also establishes the "direction" of the stream. A + GZipStream with CompressionMode.Compress works only through + Write(). A GZipStream with + CompressionMode.Decompress works only through Read(). + + + + + + This example shows how to use a GZipStream to compress data. + + using (System.IO.Stream input = System.IO.File.OpenRead(fileToCompress)) + { + using (var raw = System.IO.File.Create(outputFile)) + { + using (Stream compressor = new GZipStream(raw, CompressionMode.Compress)) + { + byte[] buffer = new byte[WORKING_BUFFER_SIZE]; + int n; + while ((n= input.Read(buffer, 0, buffer.Length)) != 0) + { + compressor.Write(buffer, 0, n); + } + } + } + } + + + Dim outputFile As String = (fileToCompress & ".compressed") + Using input As Stream = File.OpenRead(fileToCompress) + Using raw As FileStream = File.Create(outputFile) + Using compressor As Stream = New GZipStream(raw, CompressionMode.Compress) + Dim buffer As Byte() = New Byte(4096) {} + Dim n As Integer = -1 + Do While (n <> 0) + If (n > 0) Then + compressor.Write(buffer, 0, n) + End If + n = input.Read(buffer, 0, buffer.Length) + Loop + End Using + End Using + End Using + + + + + This example shows how to use a GZipStream to uncompress a file. + + private void GunZipFile(string filename) + { + if (!filename.EndsWith(".gz)) + throw new ArgumentException("filename"); + var DecompressedFile = filename.Substring(0,filename.Length-3); + byte[] working = new byte[WORKING_BUFFER_SIZE]; + int n= 1; + using (System.IO.Stream input = System.IO.File.OpenRead(filename)) + { + using (Stream decompressor= new Ionic.Zlib.GZipStream(input, CompressionMode.Decompress, true)) + { + using (var output = System.IO.File.Create(DecompressedFile)) + { + while (n !=0) + { + n= decompressor.Read(working, 0, working.Length); + if (n > 0) + { + output.Write(working, 0, n); + } + } + } + } + } + } + + + + Private Sub GunZipFile(ByVal filename as String) + If Not (filename.EndsWith(".gz)) Then + Throw New ArgumentException("filename") + End If + Dim DecompressedFile as String = filename.Substring(0,filename.Length-3) + Dim working(WORKING_BUFFER_SIZE) as Byte + Dim n As Integer = 1 + Using input As Stream = File.OpenRead(filename) + Using decompressor As Stream = new Ionic.Zlib.GZipStream(input, CompressionMode.Decompress, True) + Using output As Stream = File.Create(UncompressedFile) + Do + n= decompressor.Read(working, 0, working.Length) + If n > 0 Then + output.Write(working, 0, n) + End IF + Loop While (n > 0) + End Using + End Using + End Using + End Sub + + + + The stream which will be read or written. + Indicates whether the GZipStream will compress or decompress. + + + + Create a GZipStream using the specified CompressionMode and + the specified CompressionLevel. + + + + + The CompressionMode (Compress or Decompress) also establishes the + "direction" of the stream. A GZipStream with + CompressionMode.Compress works only through Write(). A + GZipStream with CompressionMode.Decompress works only + through Read(). + + + + + + + This example shows how to use a GZipStream to compress a file into a .gz file. + + + using (System.IO.Stream input = System.IO.File.OpenRead(fileToCompress)) + { + using (var raw = System.IO.File.Create(fileToCompress + ".gz")) + { + using (Stream compressor = new GZipStream(raw, + CompressionMode.Compress, + CompressionLevel.BestCompression)) + { + byte[] buffer = new byte[WORKING_BUFFER_SIZE]; + int n; + while ((n= input.Read(buffer, 0, buffer.Length)) != 0) + { + compressor.Write(buffer, 0, n); + } + } + } + } + + + + Using input As Stream = File.OpenRead(fileToCompress) + Using raw As FileStream = File.Create(fileToCompress & ".gz") + Using compressor As Stream = New GZipStream(raw, CompressionMode.Compress, CompressionLevel.BestCompression) + Dim buffer As Byte() = New Byte(4096) {} + Dim n As Integer = -1 + Do While (n <> 0) + If (n > 0) Then + compressor.Write(buffer, 0, n) + End If + n = input.Read(buffer, 0, buffer.Length) + Loop + End Using + End Using + End Using + + + The stream to be read or written while deflating or inflating. + Indicates whether the GZipStream will compress or decompress. + A tuning knob to trade speed for effectiveness. + + + + Create a GZipStream using the specified CompressionMode, and + explicitly specify whether the stream should be left open after Deflation + or Inflation. + + + + + This constructor allows the application to request that the captive stream + remain open after the deflation or inflation occurs. By default, after + Close() is called on the stream, the captive stream is also + closed. In some cases this is not desired, for example if the stream is a + memory stream that will be re-read after compressed data has been written + to it. Specify true for the parameter to leave + the stream open. + + + + The (Compress or Decompress) also + establishes the "direction" of the stream. A GZipStream with + CompressionMode.Compress works only through Write(). A GZipStream + with CompressionMode.Decompress works only through Read(). + + + + The GZipStream will use the default compression level. If you want + to specify the compression level, see . + + + + See the other overloads of this constructor for example code. + + + + + + The stream which will be read or written. This is called the "captive" + stream in other places in this documentation. + + + Indicates whether the GZipStream will compress or decompress. + + + + true if the application would like the base stream to remain open after + inflation/deflation. + + + + + Create a GZipStream using the specified CompressionMode and the + specified CompressionLevel, and explicitly specify whether the + stream should be left open after Deflation or Inflation. + + + + + + This constructor allows the application to request that the captive stream + remain open after the deflation or inflation occurs. By default, after + Close() is called on the stream, the captive stream is also + closed. In some cases this is not desired, for example if the stream is a + memory stream that will be re-read after compressed data has been written + to it. Specify true for the parameter to + leave the stream open. + + + + As noted in the class documentation, the CompressionMode (Compress + or Decompress) also establishes the "direction" of the stream. A + GZipStream with CompressionMode.Compress works only through + Write(). A GZipStream with CompressionMode.Decompress works only + through Read(). + + + + + + This example shows how to use a GZipStream to compress data. + + using (System.IO.Stream input = System.IO.File.OpenRead(fileToCompress)) + { + using (var raw = System.IO.File.Create(outputFile)) + { + using (Stream compressor = new GZipStream(raw, CompressionMode.Compress, CompressionLevel.BestCompression, true)) + { + byte[] buffer = new byte[WORKING_BUFFER_SIZE]; + int n; + while ((n= input.Read(buffer, 0, buffer.Length)) != 0) + { + compressor.Write(buffer, 0, n); + } + } + } + } + + + Dim outputFile As String = (fileToCompress & ".compressed") + Using input As Stream = File.OpenRead(fileToCompress) + Using raw As FileStream = File.Create(outputFile) + Using compressor As Stream = New GZipStream(raw, CompressionMode.Compress, CompressionLevel.BestCompression, True) + Dim buffer As Byte() = New Byte(4096) {} + Dim n As Integer = -1 + Do While (n <> 0) + If (n > 0) Then + compressor.Write(buffer, 0, n) + End If + n = input.Read(buffer, 0, buffer.Length) + Loop + End Using + End Using + End Using + + + The stream which will be read or written. + Indicates whether the GZipStream will compress or decompress. + true if the application would like the stream to remain open after inflation/deflation. + A tuning knob to trade speed for effectiveness. + + + + This property sets the flush behavior on the stream. + + + + + The size of the working buffer for the compression codec. + + + + + The working buffer is used for all stream operations. The default size is + 1024 bytes. The minimum size is 128 bytes. You may get better performance + with a larger buffer. Then again, you might not. You would have to test + it. + + + + Set this before the first call to Read() or Write() on the + stream. If you try to set it afterwards, it will throw. + + + + + Returns the total number of bytes input so far. + + + Returns the total number of bytes output so far. + + + + Dispose the stream. + + + + This may or may not result in a Close() call on the captive + stream. See the constructors that have a leaveOpen parameter + for more information. + + + This method may be invoked in two distinct scenarios. If disposing + == true, the method has been called directly or indirectly by a + user's code, for example via the public Dispose() method. In this + case, both managed and unmanaged resources can be referenced and + disposed. If disposing == false, the method has been called by the + runtime from inside the object finalizer and this method should not + reference other objects; in that case only unmanaged resources must + be referenced or disposed. + + + + indicates whether the Dispose method was invoked by user code. + + + + + Indicates whether the stream can be read. + + + The return value depends on whether the captive stream supports reading. + + + + + Indicates whether the stream supports Seek operations. + + + Always returns false. + + + + + Indicates whether the stream can be written. + + + The return value depends on whether the captive stream supports writing. + + + + + Flush the stream. + + + + + Reading this property always throws a . + + + + + The position of the stream pointer. + + + + Setting this property always throws a . Reading will return the total bytes + written out, if used in writing, or the total bytes read in, if used in + reading. The count may refer to compressed bytes or uncompressed bytes, + depending on how you've used the stream. + + + + + Read and decompress data from the source stream. + + + + With a GZipStream, decompression is done through reading. + + + + + byte[] working = new byte[WORKING_BUFFER_SIZE]; + using (System.IO.Stream input = System.IO.File.OpenRead(_CompressedFile)) + { + using (Stream decompressor= new Ionic.Zlib.GZipStream(input, CompressionMode.Decompress, true)) + { + using (var output = System.IO.File.Create(_DecompressedFile)) + { + int n; + while ((n= decompressor.Read(working, 0, working.Length)) !=0) + { + output.Write(working, 0, n); + } + } + } + } + + + The buffer into which the decompressed data should be placed. + the offset within that data array to put the first byte read. + the number of bytes to read. + the number of bytes actually read + + + + Calling this method always throws a . + + irrelevant; it will always throw! + irrelevant; it will always throw! + irrelevant! + + + + Calling this method always throws a . + + irrelevant; this method will always throw! + + + + Write data to the stream. + + + + + If you wish to use the GZipStream to compress data while writing, + you can create a GZipStream with CompressionMode.Compress, and a + writable output stream. Then call Write() on that GZipStream, + providing uncompressed data as input. The data sent to the output stream + will be the compressed form of the data written. + + + + A GZipStream can be used for Read() or Write(), but not + both. Writing implies compression. Reading implies decompression. + + + + The buffer holding data to write to the stream. + the offset within that data array to find the first byte to write. + the number of bytes to write. + + + + Compress a string into a byte array using GZip. + + + + Uncompress it with . + + + + + + + A string to compress. The string will first be encoded + using UTF8, then compressed. + + + The string in compressed form + + + + Compress a byte array into a new byte array using GZip. + + + + Uncompress it with . + + + + + + + A buffer to compress. + + + The data in compressed form + + + + Uncompress a GZip'ed byte array into a single string. + + + + + + + A buffer containing GZIP-compressed data. + + + The uncompressed string + + + + Uncompress a GZip'ed byte array into a byte array. + + + + + + + A buffer containing data that has been compressed with GZip. + + + The data in uncompressed form + + + + A class for compressing streams using the + Deflate algorithm with multiple threads. + + + + + This class performs DEFLATE compression through writing. For + more information on the Deflate algorithm, see IETF RFC 1951, + "DEFLATE Compressed Data Format Specification version 1.3." + + + + This class is similar to , except + that this class is for compression only, and this implementation uses an + approach that employs multiple worker threads to perform the DEFLATE. On + a multi-cpu or multi-core computer, the performance of this class can be + significantly higher than the single-threaded DeflateStream, particularly + for larger streams. How large? Anything over 10mb is a good candidate + for parallel compression. + + + + The tradeoff is that this class uses more memory and more CPU than the + vanilla DeflateStream, and also is less efficient as a compressor. For + large files the size of the compressed data stream can be less than 1% + larger than the size of a compressed data stream from the vanialla + DeflateStream. For smaller files the difference can be larger. The + difference will also be larger if you set the BufferSize to be lower than + the default value. Your mileage may vary. Finally, for small files, the + ParallelDeflateOutputStream can be much slower than the vanilla + DeflateStream, because of the overhead associated to using the thread + pool. + + + + + + + + Create a ParallelDeflateOutputStream. + + + + + This stream compresses data written into it via the DEFLATE + algorithm (see RFC 1951), and writes out the compressed byte stream. + + + + The instance will use the default compression level, the default + buffer sizes and the default number of threads and buffers per + thread. + + + + This class is similar to , + except that this implementation uses an approach that employs + multiple worker threads to perform the DEFLATE. On a multi-cpu or + multi-core computer, the performance of this class can be + significantly higher than the single-threaded DeflateStream, + particularly for larger streams. How large? Anything over 10mb is + a good candidate for parallel compression. + + + + + + + This example shows how to use a ParallelDeflateOutputStream to compress + data. It reads a file, compresses it, and writes the compressed data to + a second, output file. + + + byte[] buffer = new byte[WORKING_BUFFER_SIZE]; + int n= -1; + String outputFile = fileToCompress + ".compressed"; + using (System.IO.Stream input = System.IO.File.OpenRead(fileToCompress)) + { + using (var raw = System.IO.File.Create(outputFile)) + { + using (Stream compressor = new ParallelDeflateOutputStream(raw)) + { + while ((n= input.Read(buffer, 0, buffer.Length)) != 0) + { + compressor.Write(buffer, 0, n); + } + } + } + } + + + Dim buffer As Byte() = New Byte(4096) {} + Dim n As Integer = -1 + Dim outputFile As String = (fileToCompress & ".compressed") + Using input As Stream = File.OpenRead(fileToCompress) + Using raw As FileStream = File.Create(outputFile) + Using compressor As Stream = New ParallelDeflateOutputStream(raw) + Do While (n <> 0) + If (n > 0) Then + compressor.Write(buffer, 0, n) + End If + n = input.Read(buffer, 0, buffer.Length) + Loop + End Using + End Using + End Using + + + The stream to which compressed data will be written. + + + + Create a ParallelDeflateOutputStream using the specified CompressionLevel. + + + See the + constructor for example code. + + The stream to which compressed data will be written. + A tuning knob to trade speed for effectiveness. + + + + Create a ParallelDeflateOutputStream and specify whether to leave the captive stream open + when the ParallelDeflateOutputStream is closed. + + + See the + constructor for example code. + + The stream to which compressed data will be written. + + true if the application would like the stream to remain open after inflation/deflation. + + + + + Create a ParallelDeflateOutputStream and specify whether to leave the captive stream open + when the ParallelDeflateOutputStream is closed. + + + See the + constructor for example code. + + The stream to which compressed data will be written. + A tuning knob to trade speed for effectiveness. + + true if the application would like the stream to remain open after inflation/deflation. + + + + + Create a ParallelDeflateOutputStream using the specified + CompressionLevel and CompressionStrategy, and specifying whether to + leave the captive stream open when the ParallelDeflateOutputStream is + closed. + + + See the + constructor for example code. + + The stream to which compressed data will be written. + A tuning knob to trade speed for effectiveness. + + By tweaking this parameter, you may be able to optimize the compression for + data with particular characteristics. + + + true if the application would like the stream to remain open after inflation/deflation. + + + + + The ZLIB strategy to be used during compression. + + + + + + The maximum number of buffer pairs to use. + + + + + This property sets an upper limit on the number of memory buffer + pairs to create. The implementation of this stream allocates + multiple buffers to facilitate parallel compression. As each buffer + fills up, this stream uses + ThreadPool.QueueUserWorkItem() + to compress those buffers in a background threadpool thread. After a + buffer is compressed, it is re-ordered and written to the output + stream. + + + + A higher number of buffer pairs enables a higher degree of + parallelism, which tends to increase the speed of compression on + multi-cpu computers. On the other hand, a higher number of buffer + pairs also implies a larger memory consumption, more active worker + threads, and a higher cpu utilization for any compression. This + property enables the application to limit its memory consumption and + CPU utilization behavior depending on requirements. + + + + For each compression "task" that occurs in parallel, there are 2 + buffers allocated: one for input and one for output. This property + sets a limit for the number of pairs. The total amount of storage + space allocated for buffering will then be (N*S*2), where N is the + number of buffer pairs, S is the size of each buffer (). By default, DotNetZip allocates 4 buffer + pairs per CPU core, so if your machine has 4 cores, and you retain + the default buffer size of 128k, then the + ParallelDeflateOutputStream will use 4 * 4 * 2 * 128kb of buffer + memory in total, or 4mb, in blocks of 128kb. If you then set this + property to 8, then the number will be 8 * 2 * 128kb of buffer + memory, or 2mb. + + + + CPU utilization will also go up with additional buffers, because a + larger number of buffer pairs allows a larger number of background + threads to compress in parallel. If you find that parallel + compression is consuming too much memory or CPU, you can adjust this + value downward. + + + + The default value is 16. Different values may deliver better or + worse results, depending on your priorities and the dynamic + performance characteristics of your storage and compute resources. + + + + This property is not the number of buffer pairs to use; it is an + upper limit. An illustration: Suppose you have an application that + uses the default value of this property (which is 16), and it runs + on a machine with 2 CPU cores. In that case, DotNetZip will allocate + 4 buffer pairs per CPU core, for a total of 8 pairs. The upper + limit specified by this property has no effect. + + + + The application can set this value at any time, but it is effective + only before the first call to Write(), which is when the buffers are + allocated. + + + + + + The size of the buffers used by the compressor threads. + + + + + The default buffer size is 128k. The application can set this value + at any time, but it is effective only before the first Write(). + + + + Larger buffer sizes implies larger memory consumption but allows + more efficient compression. Using smaller buffer sizes consumes less + memory but may result in less effective compression. For example, + using the default buffer size of 128k, the compression delivered is + within 1% of the compression delivered by the single-threaded . On the other hand, using a + BufferSize of 8k can result in a compressed data stream that is 5% + larger than that delivered by the single-threaded + DeflateStream. Excessively small buffer sizes can also cause + the speed of the ParallelDeflateOutputStream to drop, because of + larger thread scheduling overhead dealing with many many small + buffers. + + + + The total amount of storage space allocated for buffering will be + (N*S*2), where N is the number of buffer pairs, and S is the size of + each buffer (this property). There are 2 buffers used by the + compressor, one for input and one for output. By default, DotNetZip + allocates 4 buffer pairs per CPU core, so if your machine has 4 + cores, then the number of buffer pairs used will be 16. If you + accept the default value of this property, 128k, then the + ParallelDeflateOutputStream will use 16 * 2 * 128kb of buffer memory + in total, or 4mb, in blocks of 128kb. If you set this property to + 64kb, then the number will be 16 * 2 * 64kb of buffer memory, or + 2mb. + + + + + + + The CRC32 for the data that was written out, prior to compression. + + + This value is meaningful only after a call to Close(). + + + + + The total number of uncompressed bytes processed by the ParallelDeflateOutputStream. + + + This value is meaningful only after a call to Close(). + + + + + Write data to the stream. + + + + + + To use the ParallelDeflateOutputStream to compress data, create a + ParallelDeflateOutputStream with CompressionMode.Compress, passing a + writable output stream. Then call Write() on that + ParallelDeflateOutputStream, providing uncompressed data as input. The + data sent to the output stream will be the compressed form of the data + written. + + + + To decompress data, use the class. + + + + The buffer holding data to write to the stream. + the offset within that data array to find the first byte to write. + the number of bytes to write. + + + + Flush the stream. + + + + + Close the stream. + + + You must call Close on the stream to guarantee that all of the data written in has + been compressed, and the compressed data has been written out. + + + + Dispose the object + + + Because ParallelDeflateOutputStream is IDisposable, the + application must call this method when finished using the instance. + + + This method is generally called implicitly upon exit from + a using scope in C# (Using in VB). + + + + + + Resets the stream for use with another stream. + + + Because the ParallelDeflateOutputStream is expensive to create, it + has been designed so that it can be recycled and re-used. You have + to call Close() on the stream first, then you can call Reset() on + it, to use it again on another stream. + + + + The new output stream for this era. + + + + + ParallelDeflateOutputStream deflater = null; + foreach (var inputFile in listOfFiles) + { + string outputFile = inputFile + ".compressed"; + using (System.IO.Stream input = System.IO.File.OpenRead(inputFile)) + { + using (var outStream = System.IO.File.Create(outputFile)) + { + if (deflater == null) + deflater = new ParallelDeflateOutputStream(outStream, + CompressionLevel.Best, + CompressionStrategy.Default, + true); + deflater.Reset(outStream); + + while ((n= input.Read(buffer, 0, buffer.Length)) != 0) + { + deflater.Write(buffer, 0, n); + } + } + } + } + + + + + + Indicates whether the stream supports Seek operations. + + + Always returns false. + + + + + Indicates whether the stream supports Read operations. + + + Always returns false. + + + + + Indicates whether the stream supports Write operations. + + + Returns true if the provided stream is writable. + + + + + Reading this property always throws a NotSupportedException. + + + + + Returns the current position of the output stream. + + + + Because the output gets written by a background thread, + the value may change asynchronously. Setting this + property always throws a NotSupportedException. + + + + + + This method always throws a NotSupportedException. + + + The buffer into which data would be read, IF THIS METHOD + ACTUALLY DID ANYTHING. + + + The offset within that data array at which to insert the + data that is read, IF THIS METHOD ACTUALLY DID + ANYTHING. + + + The number of bytes to write, IF THIS METHOD ACTUALLY DID + ANYTHING. + + nothing. + + + + This method always throws a NotSupportedException. + + + The offset to seek to.... + IF THIS METHOD ACTUALLY DID ANYTHING. + + + The reference specifying how to apply the offset.... IF + THIS METHOD ACTUALLY DID ANYTHING. + + nothing. It always throws. + + + + This method always throws a NotSupportedException. + + + The new value for the stream length.... IF + THIS METHOD ACTUALLY DID ANYTHING. + + + + + Map from a distance to a distance code. + + + No side effects. _dist_code[256] and _dist_code[257] are never used. + + + + + Describes how to flush the current deflate operation. + + + The different FlushType values are useful when using a Deflate in a streaming application. + + + + No flush at all. + + + Closes the current block, but doesn't flush it to + the output. Used internally only in hypothetical + scenarios. This was supposed to be removed by Zlib, but it is + still in use in some edge cases. + + + + + Use this during compression to specify that all pending output should be + flushed to the output buffer and the output should be aligned on a byte + boundary. You might use this in a streaming communication scenario, so that + the decompressor can get all input data available so far. When using this + with a ZlibCodec, AvailableBytesIn will be zero after the call if + enough output space has been provided before the call. Flushing will + degrade compression and so it should be used only when necessary. + + + + + Use this during compression to specify that all output should be flushed, as + with FlushType.Sync, but also, the compression state should be reset + so that decompression can restart from this point if previous compressed + data has been damaged or if random access is desired. Using + FlushType.Full too often can significantly degrade the compression. + + + + Signals the end of the compression/decompression stream. + + + + The compression level to be used when using a DeflateStream or ZlibStream with CompressionMode.Compress. + + + + + None means that the data will be simply stored, with no change at all. + If you are producing ZIPs for use on Mac OSX, be aware that archives produced with CompressionLevel.None + cannot be opened with the default zip reader. Use a different CompressionLevel. + + + + + Same as None. + + + + + The fastest but least effective compression. + + + + + A synonym for BestSpeed. + + + + + A little slower, but better, than level 1. + + + + + A little slower, but better, than level 2. + + + + + A little slower, but better, than level 3. + + + + + A little slower than level 4, but with better compression. + + + + + The default compression level, with a good balance of speed and compression efficiency. + + + + + A synonym for Default. + + + + + Pretty good compression! + + + + + Better compression than Level7! + + + + + The "best" compression, where best means greatest reduction in size of the input data stream. + This is also the slowest compression. + + + + + A synonym for BestCompression. + + + + + Describes options for how the compression algorithm is executed. Different strategies + work better on different sorts of data. The strategy parameter can affect the compression + ratio and the speed of compression but not the correctness of the compresssion. + + + + + The default strategy is probably the best for normal data. + + + + + The Filtered strategy is intended to be used most effectively with data produced by a + filter or predictor. By this definition, filtered data consists mostly of small + values with a somewhat random distribution. In this case, the compression algorithm + is tuned to compress them better. The effect of Filtered is to force more Huffman + coding and less string matching; it is a half-step between Default and HuffmanOnly. + + + + + Using HuffmanOnly will force the compressor to do Huffman encoding only, with no + string matching. + + + + + An enum to specify the direction of transcoding - whether to compress or decompress. + + + + + Used to specify that the stream should compress the data. + + + + + Used to specify that the stream should decompress the data. + + + + + A general purpose exception class for exceptions in the Zlib library. + + + + + The ZlibException class captures exception information generated + by the Zlib library. + + + + + This ctor collects a message attached to the exception. + + the message for the exception. + + + + Performs an unsigned bitwise right shift with the specified number + + Number to operate on + Ammount of bits to shift + The resulting number from the shift operation + + + + Reads a number of characters from the current source TextReader and writes + the data to the target array at the specified index. + + + The source TextReader to read from + Contains the array of characteres read from the source TextReader. + The starting index of the target array. + The maximum number of characters to read from the source TextReader. + + + The number of characters read. The number will be less than or equal to + count depending on the data available in the source TextReader. Returns -1 + if the end of the stream is reached. + + + + + Computes an Adler-32 checksum. + + + The Adler checksum is similar to a CRC checksum, but faster to compute, though less + reliable. It is used in producing RFC1950 compressed streams. The Adler checksum + is a required part of the "ZLIB" standard. Applications will almost never need to + use this class directly. + + + + + + + Calculates the Adler32 checksum. + + + + This is used within ZLIB. You probably don't need to use this directly. + + + + To compute an Adler32 checksum on a byte array: + + var adler = Adler.Adler32(0, null, 0, 0); + adler = Adler.Adler32(adler, buffer, index, length); + + + + + + Encoder and Decoder for ZLIB and DEFLATE (IETF RFC1950 and RFC1951). + + + + This class compresses and decompresses data according to the Deflate algorithm + and optionally, the ZLIB format, as documented in RFC 1950 - ZLIB and RFC 1951 - DEFLATE. + + + + + The buffer from which data is taken. + + + + + An index into the InputBuffer array, indicating where to start reading. + + + + + The number of bytes available in the InputBuffer, starting at NextIn. + + + Generally you should set this to InputBuffer.Length before the first Inflate() or Deflate() call. + The class will update this number as calls to Inflate/Deflate are made. + + + + + Total number of bytes read so far, through all calls to Inflate()/Deflate(). + + + + + Buffer to store output data. + + + + + An index into the OutputBuffer array, indicating where to start writing. + + + + + The number of bytes available in the OutputBuffer, starting at NextOut. + + + Generally you should set this to OutputBuffer.Length before the first Inflate() or Deflate() call. + The class will update this number as calls to Inflate/Deflate are made. + + + + + Total number of bytes written to the output so far, through all calls to Inflate()/Deflate(). + + + + + used for diagnostics, when something goes wrong! + + + + + The compression level to use in this codec. Useful only in compression mode. + + + + + The number of Window Bits to use. + + + This gauges the size of the sliding window, and hence the + compression effectiveness as well as memory consumption. It's best to just leave this + setting alone if you don't know what it is. The maximum value is 15 bits, which implies + a 32k window. + + + + + The compression strategy to use. + + + This is only effective in compression. The theory offered by ZLIB is that different + strategies could potentially produce significant differences in compression behavior + for different data sets. Unfortunately I don't have any good recommendations for how + to set it differently. When I tested changing the strategy I got minimally different + compression performance. It's best to leave this property alone if you don't have a + good feel for it. Or, you may want to produce a test harness that runs through the + different strategy options and evaluates them on different file types. If you do that, + let me know your results. + + + + + The Adler32 checksum on the data transferred through the codec so far. You probably don't need to look at this. + + + + + Create a ZlibCodec. + + + If you use this default constructor, you will later have to explicitly call + InitializeInflate() or InitializeDeflate() before using the ZlibCodec to compress + or decompress. + + + + + Create a ZlibCodec that either compresses or decompresses. + + + Indicates whether the codec should compress (deflate) or decompress (inflate). + + + + + Initialize the inflation state. + + + It is not necessary to call this before using the ZlibCodec to inflate data; + It is implicitly called when you call the constructor. + + Z_OK if everything goes well. + + + + Initialize the inflation state with an explicit flag to + govern the handling of RFC1950 header bytes. + + + + By default, the ZLIB header defined in RFC 1950 is expected. If + you want to read a zlib stream you should specify true for + expectRfc1950Header. If you have a deflate stream, you will want to specify + false. It is only necessary to invoke this initializer explicitly if you + want to specify false. + + + whether to expect an RFC1950 header byte + pair when reading the stream of data to be inflated. + + Z_OK if everything goes well. + + + + Initialize the ZlibCodec for inflation, with the specified number of window bits. + + The number of window bits to use. If you need to ask what that is, + then you shouldn't be calling this initializer. + Z_OK if all goes well. + + + + Initialize the inflation state with an explicit flag to govern the handling of + RFC1950 header bytes. + + + + If you want to read a zlib stream you should specify true for + expectRfc1950Header. In this case, the library will expect to find a ZLIB + header, as defined in RFC + 1950, in the compressed stream. If you will be reading a DEFLATE or + GZIP stream, which does not have such a header, you will want to specify + false. + + + whether to expect an RFC1950 header byte pair when reading + the stream of data to be inflated. + The number of window bits to use. If you need to ask what that is, + then you shouldn't be calling this initializer. + Z_OK if everything goes well. + + + + Inflate the data in the InputBuffer, placing the result in the OutputBuffer. + + + You must have set InputBuffer and OutputBuffer, NextIn and NextOut, and AvailableBytesIn and + AvailableBytesOut before calling this method. + + + + private void InflateBuffer() + { + int bufferSize = 1024; + byte[] buffer = new byte[bufferSize]; + ZlibCodec decompressor = new ZlibCodec(); + + Console.WriteLine("\n============================================"); + Console.WriteLine("Size of Buffer to Inflate: {0} bytes.", CompressedBytes.Length); + MemoryStream ms = new MemoryStream(DecompressedBytes); + + int rc = decompressor.InitializeInflate(); + + decompressor.InputBuffer = CompressedBytes; + decompressor.NextIn = 0; + decompressor.AvailableBytesIn = CompressedBytes.Length; + + decompressor.OutputBuffer = buffer; + + // pass 1: inflate + do + { + decompressor.NextOut = 0; + decompressor.AvailableBytesOut = buffer.Length; + rc = decompressor.Inflate(FlushType.None); + + if (rc != ZlibConstants.Z_OK && rc != ZlibConstants.Z_STREAM_END) + throw new Exception("inflating: " + decompressor.Message); + + ms.Write(decompressor.OutputBuffer, 0, buffer.Length - decompressor.AvailableBytesOut); + } + while (decompressor.AvailableBytesIn > 0 || decompressor.AvailableBytesOut == 0); + + // pass 2: finish and flush + do + { + decompressor.NextOut = 0; + decompressor.AvailableBytesOut = buffer.Length; + rc = decompressor.Inflate(FlushType.Finish); + + if (rc != ZlibConstants.Z_STREAM_END && rc != ZlibConstants.Z_OK) + throw new Exception("inflating: " + decompressor.Message); + + if (buffer.Length - decompressor.AvailableBytesOut > 0) + ms.Write(buffer, 0, buffer.Length - decompressor.AvailableBytesOut); + } + while (decompressor.AvailableBytesIn > 0 || decompressor.AvailableBytesOut == 0); + + decompressor.EndInflate(); + } + + + + The flush to use when inflating. + Z_OK if everything goes well. + + + + Ends an inflation session. + + + Call this after successively calling Inflate(). This will cause all buffers to be flushed. + After calling this you cannot call Inflate() without a intervening call to one of the + InitializeInflate() overloads. + + Z_OK if everything goes well. + + + + I don't know what this does! + + Z_OK if everything goes well. + + + + Initialize the ZlibCodec for deflation operation. + + + The codec will use the MAX window bits and the default level of compression. + + + + int bufferSize = 40000; + byte[] CompressedBytes = new byte[bufferSize]; + byte[] DecompressedBytes = new byte[bufferSize]; + + ZlibCodec compressor = new ZlibCodec(); + + compressor.InitializeDeflate(CompressionLevel.Default); + + compressor.InputBuffer = System.Text.ASCIIEncoding.ASCII.GetBytes(TextToCompress); + compressor.NextIn = 0; + compressor.AvailableBytesIn = compressor.InputBuffer.Length; + + compressor.OutputBuffer = CompressedBytes; + compressor.NextOut = 0; + compressor.AvailableBytesOut = CompressedBytes.Length; + + while (compressor.TotalBytesIn != TextToCompress.Length && compressor.TotalBytesOut < bufferSize) + { + compressor.Deflate(FlushType.None); + } + + while (true) + { + int rc= compressor.Deflate(FlushType.Finish); + if (rc == ZlibConstants.Z_STREAM_END) break; + } + + compressor.EndDeflate(); + + + + Z_OK if all goes well. You generally don't need to check the return code. + + + + Initialize the ZlibCodec for deflation operation, using the specified CompressionLevel. + + + The codec will use the maximum window bits (15) and the specified + CompressionLevel. It will emit a ZLIB stream as it compresses. + + The compression level for the codec. + Z_OK if all goes well. + + + + Initialize the ZlibCodec for deflation operation, using the specified CompressionLevel, + and the explicit flag governing whether to emit an RFC1950 header byte pair. + + + The codec will use the maximum window bits (15) and the specified CompressionLevel. + If you want to generate a zlib stream, you should specify true for + wantRfc1950Header. In this case, the library will emit a ZLIB + header, as defined in RFC + 1950, in the compressed stream. + + The compression level for the codec. + whether to emit an initial RFC1950 byte pair in the compressed stream. + Z_OK if all goes well. + + + + Initialize the ZlibCodec for deflation operation, using the specified CompressionLevel, + and the specified number of window bits. + + + The codec will use the specified number of window bits and the specified CompressionLevel. + + The compression level for the codec. + the number of window bits to use. If you don't know what this means, don't use this method. + Z_OK if all goes well. + + + + Initialize the ZlibCodec for deflation operation, using the specified + CompressionLevel, the specified number of window bits, and the explicit flag + governing whether to emit an RFC1950 header byte pair. + + + The compression level for the codec. + whether to emit an initial RFC1950 byte pair in the compressed stream. + the number of window bits to use. If you don't know what this means, don't use this method. + Z_OK if all goes well. + + + + Deflate one batch of data. + + + You must have set InputBuffer and OutputBuffer before calling this method. + + + + private void DeflateBuffer(CompressionLevel level) + { + int bufferSize = 1024; + byte[] buffer = new byte[bufferSize]; + ZlibCodec compressor = new ZlibCodec(); + + Console.WriteLine("\n============================================"); + Console.WriteLine("Size of Buffer to Deflate: {0} bytes.", UncompressedBytes.Length); + MemoryStream ms = new MemoryStream(); + + int rc = compressor.InitializeDeflate(level); + + compressor.InputBuffer = UncompressedBytes; + compressor.NextIn = 0; + compressor.AvailableBytesIn = UncompressedBytes.Length; + + compressor.OutputBuffer = buffer; + + // pass 1: deflate + do + { + compressor.NextOut = 0; + compressor.AvailableBytesOut = buffer.Length; + rc = compressor.Deflate(FlushType.None); + + if (rc != ZlibConstants.Z_OK && rc != ZlibConstants.Z_STREAM_END) + throw new Exception("deflating: " + compressor.Message); + + ms.Write(compressor.OutputBuffer, 0, buffer.Length - compressor.AvailableBytesOut); + } + while (compressor.AvailableBytesIn > 0 || compressor.AvailableBytesOut == 0); + + // pass 2: finish and flush + do + { + compressor.NextOut = 0; + compressor.AvailableBytesOut = buffer.Length; + rc = compressor.Deflate(FlushType.Finish); + + if (rc != ZlibConstants.Z_STREAM_END && rc != ZlibConstants.Z_OK) + throw new Exception("deflating: " + compressor.Message); + + if (buffer.Length - compressor.AvailableBytesOut > 0) + ms.Write(buffer, 0, buffer.Length - compressor.AvailableBytesOut); + } + while (compressor.AvailableBytesIn > 0 || compressor.AvailableBytesOut == 0); + + compressor.EndDeflate(); + + ms.Seek(0, SeekOrigin.Begin); + CompressedBytes = new byte[compressor.TotalBytesOut]; + ms.Read(CompressedBytes, 0, CompressedBytes.Length); + } + + + whether to flush all data as you deflate. Generally you will want to + use Z_NO_FLUSH here, in a series of calls to Deflate(), and then call EndDeflate() to + flush everything. + + Z_OK if all goes well. + + + + End a deflation session. + + + Call this after making a series of one or more calls to Deflate(). All buffers are flushed. + + Z_OK if all goes well. + + + + Reset a codec for another deflation session. + + + Call this to reset the deflation state. For example if a thread is deflating + non-consecutive blocks, you can call Reset() after the Deflate(Sync) of the first + block and before the next Deflate(None) of the second block. + + Z_OK if all goes well. + + + + Set the CompressionStrategy and CompressionLevel for a deflation session. + + the level of compression to use. + the strategy to use for compression. + Z_OK if all goes well. + + + + Set the dictionary to be used for either Inflation or Deflation. + + The dictionary bytes to use. + Z_OK if all goes well. + + + + A bunch of constants used in the Zlib interface. + + + + + The maximum number of window bits for the Deflate algorithm. + + + + + The default number of window bits for the Deflate algorithm. + + + + + indicates everything is A-OK + + + + + Indicates that the last operation reached the end of the stream. + + + + + The operation ended in need of a dictionary. + + + + + There was an error with the stream - not enough data, not open and readable, etc. + + + + + There was an error with the data - not enough data, bad data, etc. + + + + + There was an error with the working buffer. + + + + + The size of the working buffer used in the ZlibCodec class. Defaults to 8192 bytes. + + + + + The minimum size of the working buffer used in the ZlibCodec class. Currently it is 128 bytes. + + + + + Represents a Zlib stream for compression or decompression. + + + + + The ZlibStream is a Decorator on a . It adds ZLIB compression or decompression to any + stream. + + + Using this stream, applications can compress or decompress data via + stream Read() and Write() operations. Either compresssion or + decompression can occur through either reading or writing. The compression + format used is ZLIB, which is documented in IETF RFC 1950, "ZLIB Compressed + Data Format Specification version 3.3". This implementation of ZLIB always uses + DEFLATE as the compression method. (see IETF RFC 1951, "DEFLATE + Compressed Data Format Specification version 1.3.") + + + The ZLIB format allows for varying compression methods, window sizes, and dictionaries. + This implementation always uses the DEFLATE compression method, a preset dictionary, + and 15 window bits by default. + + + + This class is similar to , except that it adds the + RFC1950 header and trailer bytes to a compressed stream when compressing, or expects + the RFC1950 header and trailer bytes when decompressing. It is also similar to the + . + + + + + + + + Create a ZlibStream using the specified CompressionMode. + + + + + When mode is CompressionMode.Compress, the ZlibStream + will use the default compression level. The "captive" stream will be + closed when the ZlibStream is closed. + + + + + + This example uses a ZlibStream to compress a file, and writes the + compressed data to another file. + + using (System.IO.Stream input = System.IO.File.OpenRead(fileToCompress)) + { + using (var raw = System.IO.File.Create(fileToCompress + ".zlib")) + { + using (Stream compressor = new ZlibStream(raw, CompressionMode.Compress)) + { + byte[] buffer = new byte[WORKING_BUFFER_SIZE]; + int n; + while ((n= input.Read(buffer, 0, buffer.Length)) != 0) + { + compressor.Write(buffer, 0, n); + } + } + } + } + + + Using input As Stream = File.OpenRead(fileToCompress) + Using raw As FileStream = File.Create(fileToCompress & ".zlib") + Using compressor As Stream = New ZlibStream(raw, CompressionMode.Compress) + Dim buffer As Byte() = New Byte(4096) {} + Dim n As Integer = -1 + Do While (n <> 0) + If (n > 0) Then + compressor.Write(buffer, 0, n) + End If + n = input.Read(buffer, 0, buffer.Length) + Loop + End Using + End Using + End Using + + + + The stream which will be read or written. + Indicates whether the ZlibStream will compress or decompress. + + + + Create a ZlibStream using the specified CompressionMode and + the specified CompressionLevel. + + + + + + When mode is CompressionMode.Decompress, the level parameter is ignored. + The "captive" stream will be closed when the ZlibStream is closed. + + + + + + This example uses a ZlibStream to compress data from a file, and writes the + compressed data to another file. + + + using (System.IO.Stream input = System.IO.File.OpenRead(fileToCompress)) + { + using (var raw = System.IO.File.Create(fileToCompress + ".zlib")) + { + using (Stream compressor = new ZlibStream(raw, + CompressionMode.Compress, + CompressionLevel.BestCompression)) + { + byte[] buffer = new byte[WORKING_BUFFER_SIZE]; + int n; + while ((n= input.Read(buffer, 0, buffer.Length)) != 0) + { + compressor.Write(buffer, 0, n); + } + } + } + } + + + + Using input As Stream = File.OpenRead(fileToCompress) + Using raw As FileStream = File.Create(fileToCompress & ".zlib") + Using compressor As Stream = New ZlibStream(raw, CompressionMode.Compress, CompressionLevel.BestCompression) + Dim buffer As Byte() = New Byte(4096) {} + Dim n As Integer = -1 + Do While (n <> 0) + If (n > 0) Then + compressor.Write(buffer, 0, n) + End If + n = input.Read(buffer, 0, buffer.Length) + Loop + End Using + End Using + End Using + + + + The stream to be read or written while deflating or inflating. + Indicates whether the ZlibStream will compress or decompress. + A tuning knob to trade speed for effectiveness. + + + + Create a ZlibStream using the specified CompressionMode, and + explicitly specify whether the captive stream should be left open after + Deflation or Inflation. + + + + + + When mode is CompressionMode.Compress, the ZlibStream will use + the default compression level. + + + + This constructor allows the application to request that the captive stream + remain open after the deflation or inflation occurs. By default, after + Close() is called on the stream, the captive stream is also + closed. In some cases this is not desired, for example if the stream is a + that will be re-read after + compression. Specify true for the parameter to leave the stream + open. + + + + See the other overloads of this constructor for example code. + + + + + The stream which will be read or written. This is called the + "captive" stream in other places in this documentation. + Indicates whether the ZlibStream will compress or decompress. + true if the application would like the stream to remain + open after inflation/deflation. + + + + Create a ZlibStream using the specified CompressionMode + and the specified CompressionLevel, and explicitly specify + whether the stream should be left open after Deflation or Inflation. + + + + + + This constructor allows the application to request that the captive + stream remain open after the deflation or inflation occurs. By + default, after Close() is called on the stream, the captive + stream is also closed. In some cases this is not desired, for example + if the stream is a that will be + re-read after compression. Specify true for the parameter to leave the stream open. + + + + When mode is CompressionMode.Decompress, the level parameter is + ignored. + + + + + + + This example shows how to use a ZlibStream to compress the data from a file, + and store the result into another file. The filestream remains open to allow + additional data to be written to it. + + + using (var output = System.IO.File.Create(fileToCompress + ".zlib")) + { + using (System.IO.Stream input = System.IO.File.OpenRead(fileToCompress)) + { + using (Stream compressor = new ZlibStream(output, CompressionMode.Compress, CompressionLevel.BestCompression, true)) + { + byte[] buffer = new byte[WORKING_BUFFER_SIZE]; + int n; + while ((n= input.Read(buffer, 0, buffer.Length)) != 0) + { + compressor.Write(buffer, 0, n); + } + } + } + // can write additional data to the output stream here + } + + + Using output As FileStream = File.Create(fileToCompress & ".zlib") + Using input As Stream = File.OpenRead(fileToCompress) + Using compressor As Stream = New ZlibStream(output, CompressionMode.Compress, CompressionLevel.BestCompression, True) + Dim buffer As Byte() = New Byte(4096) {} + Dim n As Integer = -1 + Do While (n <> 0) + If (n > 0) Then + compressor.Write(buffer, 0, n) + End If + n = input.Read(buffer, 0, buffer.Length) + Loop + End Using + End Using + ' can write additional data to the output stream here. + End Using + + + + The stream which will be read or written. + + Indicates whether the ZlibStream will compress or decompress. + + + true if the application would like the stream to remain open after + inflation/deflation. + + + + A tuning knob to trade speed for effectiveness. This parameter is + effective only when mode is CompressionMode.Compress. + + + + + This property sets the flush behavior on the stream. + Sorry, though, not sure exactly how to describe all the various settings. + + + + + The size of the working buffer for the compression codec. + + + + + The working buffer is used for all stream operations. The default size is + 1024 bytes. The minimum size is 128 bytes. You may get better performance + with a larger buffer. Then again, you might not. You would have to test + it. + + + + Set this before the first call to Read() or Write() on the + stream. If you try to set it afterwards, it will throw. + + + + + Returns the total number of bytes input so far. + + + Returns the total number of bytes output so far. + + + + Dispose the stream. + + + + This may or may not result in a Close() call on the captive + stream. See the constructors that have a leaveOpen parameter + for more information. + + + This method may be invoked in two distinct scenarios. If disposing + == true, the method has been called directly or indirectly by a + user's code, for example via the public Dispose() method. In this + case, both managed and unmanaged resources can be referenced and + disposed. If disposing == false, the method has been called by the + runtime from inside the object finalizer and this method should not + reference other objects; in that case only unmanaged resources must + be referenced or disposed. + + + + indicates whether the Dispose method was invoked by user code. + + + + + Indicates whether the stream can be read. + + + The return value depends on whether the captive stream supports reading. + + + + + Indicates whether the stream supports Seek operations. + + + Always returns false. + + + + + Indicates whether the stream can be written. + + + The return value depends on whether the captive stream supports writing. + + + + + Flush the stream. + + + + + Reading this property always throws a . + + + + + The position of the stream pointer. + + + + Setting this property always throws a . Reading will return the total bytes + written out, if used in writing, or the total bytes read in, if used in + reading. The count may refer to compressed bytes or uncompressed bytes, + depending on how you've used the stream. + + + + + Read data from the stream. + + + + + + If you wish to use the ZlibStream to compress data while reading, + you can create a ZlibStream with CompressionMode.Compress, + providing an uncompressed data stream. Then call Read() on that + ZlibStream, and the data read will be compressed. If you wish to + use the ZlibStream to decompress data while reading, you can create + a ZlibStream with CompressionMode.Decompress, providing a + readable compressed data stream. Then call Read() on that + ZlibStream, and the data will be decompressed as it is read. + + + + A ZlibStream can be used for Read() or Write(), but + not both. + + + + + + The buffer into which the read data should be placed. + + + the offset within that data array to put the first byte read. + + the number of bytes to read. + + the number of bytes read + + + + Calling this method always throws a . + + + The offset to seek to.... + IF THIS METHOD ACTUALLY DID ANYTHING. + + + The reference specifying how to apply the offset.... IF + THIS METHOD ACTUALLY DID ANYTHING. + + + nothing. This method always throws. + + + + Calling this method always throws a . + + + The new value for the stream length.... IF + THIS METHOD ACTUALLY DID ANYTHING. + + + + + Write data to the stream. + + + + + + If you wish to use the ZlibStream to compress data while writing, + you can create a ZlibStream with CompressionMode.Compress, + and a writable output stream. Then call Write() on that + ZlibStream, providing uncompressed data as input. The data sent to + the output stream will be the compressed form of the data written. If you + wish to use the ZlibStream to decompress data while writing, you + can create a ZlibStream with CompressionMode.Decompress, and a + writable output stream. Then call Write() on that stream, + providing previously compressed data. The data sent to the output stream + will be the decompressed form of the data written. + + + + A ZlibStream can be used for Read() or Write(), but not both. + + + The buffer holding data to write to the stream. + the offset within that data array to find the first byte to write. + the number of bytes to write. + + + + Compress a string into a byte array using ZLIB. + + + + Uncompress it with . + + + + + + + + A string to compress. The string will first be encoded + using UTF8, then compressed. + + + The string in compressed form + + + + Compress a byte array into a new byte array using ZLIB. + + + + Uncompress it with . + + + + + + + A buffer to compress. + + + The data in compressed form + + + + Uncompress a ZLIB-compressed byte array into a single string. + + + + + + + A buffer containing ZLIB-compressed data. + + + The uncompressed string + + + + Uncompress a ZLIB-compressed byte array into a byte array. + + + + + + + A buffer containing ZLIB-compressed data. + + + The data in uncompressed form + + + + Provides a text encoder for the iso-8859-1 encoding, aka Latin1 encoding, + for platforms that do not support it, for example on Silverlight or some + Compact Framework platforms. + + + + + Gets the name registered with the + Internet Assigned Numbers Authority (IANA) for the current encoding. + + + Always returns "iso-8859-1". + + + + + Encodes a set of characters from a character array into + a byte array. + + + The actual number of bytes written into . + + The character array containing the set of characters to encode. + The index of the first character to encode. + The number of characters to encode. + The byte array to contain the resulting sequence of bytes. + The index at which to start writing the resulting sequence of bytes. + + + + + Decodes a sequence of bytes from the specified byte array into the specified character array. + + + The actual number of characters written into . + + The byte array containing the sequence of bytes to decode. + The index of the first byte to decode. + The number of bytes to decode. + The character array to contain the resulting set of characters. + The index at which to start writing the resulting set of characters. + + + + + Calculates the number of bytes produced by encoding a set of characters + from the specified character array. + + + The number of bytes produced by encoding the specified characters. This class + alwas returns the value of . + + + + + Calculates the number of characters produced by decoding a sequence + of bytes from the specified byte array. + + + The number of characters produced by decoding the specified sequence of bytes. This class + alwas returns the value of . + + + + + Calculates the maximum number of bytes produced by encoding the specified number of characters. + + + The maximum number of bytes produced by encoding the specified number of characters. This + class alwas returns the value of . + + The number of characters to encode. + + + + + Calculates the maximum number of characters produced by decoding the specified number of bytes. + + + The maximum number of characters produced by decoding the specified number of bytes. This class + alwas returns the value of . + + The number of bytes to decode. + + + + Gets the number of characters that are supported by this encoding. + This property returns a maximum value of 256, as the encoding class + only supports single byte encodings (1 byte == 256 possible values). + + + + Provides a platform-specific character used to separate directory levels in a path string that reflects a hierarchical file system organization. + 1 + + + Provides a platform-specific alternate character used to separate directory levels in a path string that reflects a hierarchical file system organization. + 1 + + + Provides a platform-specific volume separator character. + 1 + + + Provides a platform-specific array of characters that cannot be specified in path string arguments passed to members of the class. + A character array of invalid path characters for the current platform. + 1 + + + A platform-specific separator character used to separate path strings in environment variables. + 1 + + + diff --git a/p2isPSX_CDToolkit/bin/Debug/p2epPSX_CDToolkit.exe b/p2isPSX_CDToolkit/bin/Debug/p2epPSX_CDToolkit.exe new file mode 100644 index 0000000..0a73db0 Binary files /dev/null and b/p2isPSX_CDToolkit/bin/Debug/p2epPSX_CDToolkit.exe differ diff --git a/p2isPSX_CDToolkit/bin/Debug/p2epPSX_CDToolkit.exe.config b/p2isPSX_CDToolkit/bin/Debug/p2epPSX_CDToolkit.exe.config new file mode 100644 index 0000000..bd27edc --- /dev/null +++ b/p2isPSX_CDToolkit/bin/Debug/p2epPSX_CDToolkit.exe.config @@ -0,0 +1,6 @@ + + + + + + diff --git a/p2isPSX_CDToolkit/bin/Debug/p2epPSX_CDToolkit.pdb b/p2isPSX_CDToolkit/bin/Debug/p2epPSX_CDToolkit.pdb new file mode 100644 index 0000000..ee5047a Binary files /dev/null and b/p2isPSX_CDToolkit/bin/Debug/p2epPSX_CDToolkit.pdb differ diff --git a/p2isPSX_CDToolkit/bin/Debug/p2epPSX_CDToolkit.xml b/p2isPSX_CDToolkit/bin/Debug/p2epPSX_CDToolkit.xml new file mode 100644 index 0000000..e0a56d4 --- /dev/null +++ b/p2isPSX_CDToolkit/bin/Debug/p2epPSX_CDToolkit.xml @@ -0,0 +1,26 @@ + + + + +p2epPSX_CDToolkit + + + + + + Класс ресурса со строгой типизацией для поиска локализованных строк и т.д. + + + + + Возвращает кэшированный экземпляр ResourceManager, использованный этим классом. + + + + + Перезаписывает свойство CurrentUICulture текущего потока для всех + обращений к ресурсу с помощью этого класса ресурса со строгой типизацией. + + + + diff --git a/p2isPSX_CDToolkit/bin/Debug/p2isPSX_CDToolkit.exe b/p2isPSX_CDToolkit/bin/Debug/p2isPSX_CDToolkit.exe new file mode 100644 index 0000000..79e2017 Binary files /dev/null and b/p2isPSX_CDToolkit/bin/Debug/p2isPSX_CDToolkit.exe differ diff --git a/p2isPSX_CDToolkit/bin/Debug/p2isPSX_CDToolkit.exe.config b/p2isPSX_CDToolkit/bin/Debug/p2isPSX_CDToolkit.exe.config new file mode 100644 index 0000000..bd27edc --- /dev/null +++ b/p2isPSX_CDToolkit/bin/Debug/p2isPSX_CDToolkit.exe.config @@ -0,0 +1,6 @@ + + + + + + diff --git a/p2isPSX_CDToolkit/bin/Debug/p2isPSX_CDToolkit.pdb b/p2isPSX_CDToolkit/bin/Debug/p2isPSX_CDToolkit.pdb new file mode 100644 index 0000000..56ee58b Binary files /dev/null and b/p2isPSX_CDToolkit/bin/Debug/p2isPSX_CDToolkit.pdb differ diff --git a/p2isPSX_CDToolkit/bin/Debug/p2isPSX_CDToolkit.vshost.exe b/p2isPSX_CDToolkit/bin/Debug/p2isPSX_CDToolkit.vshost.exe new file mode 100644 index 0000000..681ab77 Binary files /dev/null and b/p2isPSX_CDToolkit/bin/Debug/p2isPSX_CDToolkit.vshost.exe differ diff --git a/p2isPSX_CDToolkit/bin/Debug/p2isPSX_CDToolkit.vshost.exe.config b/p2isPSX_CDToolkit/bin/Debug/p2isPSX_CDToolkit.vshost.exe.config new file mode 100644 index 0000000..8ccef15 --- /dev/null +++ b/p2isPSX_CDToolkit/bin/Debug/p2isPSX_CDToolkit.vshost.exe.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/p2isPSX_CDToolkit/bin/Debug/p2isPSX_CDToolkit.xml b/p2isPSX_CDToolkit/bin/Debug/p2isPSX_CDToolkit.xml new file mode 100644 index 0000000..e737987 --- /dev/null +++ b/p2isPSX_CDToolkit/bin/Debug/p2isPSX_CDToolkit.xml @@ -0,0 +1,26 @@ + + + + +p2isPSX_CDToolkit + + + + + + Класс ресурса со строгой типизацией для поиска локализованных строк и т.д. + + + + + Возвращает кэшированный экземпляр ResourceManager, использованный этим классом. + + + + + Перезаписывает свойство CurrentUICulture текущего потока для всех + обращений к ресурсу с помощью этого класса ресурса со строгой типизацией. + + + + diff --git a/p2isPSX_CDToolkit/bin/Debug/p2isPSX_CDView.exe.config b/p2isPSX_CDToolkit/bin/Debug/p2isPSX_CDView.exe.config new file mode 100644 index 0000000..8ccef15 --- /dev/null +++ b/p2isPSX_CDToolkit/bin/Debug/p2isPSX_CDView.exe.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/p2isPSX_CDToolkit/bin/Debug/p2isPSX_CDView.vshost.exe b/p2isPSX_CDToolkit/bin/Debug/p2isPSX_CDView.vshost.exe new file mode 100644 index 0000000..681ab77 Binary files /dev/null and b/p2isPSX_CDToolkit/bin/Debug/p2isPSX_CDView.vshost.exe differ diff --git a/p2isPSX_CDToolkit/bin/Debug/p2isPSX_CDView.vshost.exe.config b/p2isPSX_CDToolkit/bin/Debug/p2isPSX_CDView.vshost.exe.config new file mode 100644 index 0000000..8ccef15 --- /dev/null +++ b/p2isPSX_CDToolkit/bin/Debug/p2isPSX_CDView.vshost.exe.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/p2isPSX_CDToolkit/bin/Debug/p2isPSX_CDView.vshost.exe.manifest b/p2isPSX_CDToolkit/bin/Debug/p2isPSX_CDView.vshost.exe.manifest new file mode 100644 index 0000000..061c9ca --- /dev/null +++ b/p2isPSX_CDToolkit/bin/Debug/p2isPSX_CDView.vshost.exe.manifest @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/p2isPSX_CDToolkit/bin/Debug/unrle_.bin b/p2isPSX_CDToolkit/bin/Debug/unrle_.bin new file mode 100644 index 0000000..b1e3ad3 Binary files /dev/null and b/p2isPSX_CDToolkit/bin/Debug/unrle_.bin differ diff --git a/p2isPSX_CDToolkit/bin/Debug/vs5988.tmp b/p2isPSX_CDToolkit/bin/Debug/vs5988.tmp new file mode 100644 index 0000000..e0a56d4 --- /dev/null +++ b/p2isPSX_CDToolkit/bin/Debug/vs5988.tmp @@ -0,0 +1,26 @@ + + + + +p2epPSX_CDToolkit + + + + + + Класс ресурса со строгой типизацией для поиска локализованных строк и т.д. + + + + + Возвращает кэшированный экземпляр ResourceManager, использованный этим классом. + + + + + Перезаписывает свойство CurrentUICulture текущего потока для всех + обращений к ресурсу с помощью этого класса ресурса со строгой типизацией. + + + + diff --git a/p2isPSX_CDToolkit/convEventToObj.Designer.vb b/p2isPSX_CDToolkit/convEventToObj.Designer.vb new file mode 100644 index 0000000..3864193 --- /dev/null +++ b/p2isPSX_CDToolkit/convEventToObj.Designer.vb @@ -0,0 +1,75 @@ + _ +Partial Class convEventToObj + Inherits System.Windows.Forms.Form + + 'Форма переопределяет dispose для очистки списка компонентов. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Является обязательной для конструктора форм Windows Forms + Private components As System.ComponentModel.IContainer + + 'Примечание: следующая процедура является обязательной для конструктора форм Windows Forms + 'Для ее изменения используйте конструктор форм Windows Form. + 'Не изменяйте ее в редакторе исходного кода. + _ + Private Sub InitializeComponent() + Me.Button1 = New System.Windows.Forms.Button() + Me.TextBox1 = New System.Windows.Forms.TextBox() + Me.TextBox2 = New System.Windows.Forms.TextBox() + Me.SuspendLayout() + ' + 'Button1 + ' + Me.Button1.Location = New System.Drawing.Point(164, 70) + Me.Button1.Name = "Button1" + Me.Button1.Size = New System.Drawing.Size(436, 232) + Me.Button1.TabIndex = 0 + Me.Button1.Text = "COVERT TO OBJ" + Me.Button1.UseVisualStyleBackColor = True + ' + 'TextBox1 + ' + Me.TextBox1.Location = New System.Drawing.Point(164, 44) + Me.TextBox1.Name = "TextBox1" + Me.TextBox1.Size = New System.Drawing.Size(100, 20) + Me.TextBox1.TabIndex = 1 + Me.TextBox1.Text = "100" + ' + 'TextBox2 + ' + Me.TextBox2.Location = New System.Drawing.Point(383, 44) + Me.TextBox2.Name = "TextBox2" + Me.TextBox2.Size = New System.Drawing.Size(100, 20) + Me.TextBox2.TabIndex = 1 + Me.TextBox2.Text = "110" + ' + 'convEventToObj + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(800, 450) + Me.Controls.Add(Me.TextBox2) + Me.Controls.Add(Me.TextBox1) + Me.Controls.Add(Me.Button1) + Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog + Me.MaximizeBox = False + Me.Name = "convEventToObj" + Me.Text = "convEventToObj" + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + + Friend WithEvents Button1 As Button + Friend WithEvents TextBox1 As TextBox + Friend WithEvents TextBox2 As TextBox +End Class diff --git a/p2isPSX_CDToolkit/convEventToObj.resx b/p2isPSX_CDToolkit/convEventToObj.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/p2isPSX_CDToolkit/convEventToObj.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/p2isPSX_CDToolkit/convEventToObj.vb b/p2isPSX_CDToolkit/convEventToObj.vb new file mode 100644 index 0000000..67e828a --- /dev/null +++ b/p2isPSX_CDToolkit/convEventToObj.vb @@ -0,0 +1,317 @@ +Imports System.IO + +Public Class convEventToObj + Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click + + If Form1.CDFileList.SelectedIndex < 181 Or Form1.CDFileList.SelectedIndex > 577 Then MsgBox("PLEASE, SELECT PROPER SCENE FILE (181-577)!") : Exit Sub + + Dim rle = New rleTools + Dim texWidth As Integer + + Dim fileName = "D:\Games\PSX\Persona.2.Innocent.Sin\Export3D\Scene" & Form1.CDFileList.SelectedIndex.ToString("D4") + Dim matName = "Scene" & Form1.CDFileList.SelectedIndex.ToString("D4") + 'MAKING TEXTURE + GenerateBigTexture(rle.Unrle(Form1.binFile(0).Bytes).ToArray, fileName, texWidth) + createMaterial(matName, fileName) + + 'MAKING 3D + Dim fil = rle.Unrle(Form1.binFile(1).Bytes).ToArray + + + Dim objectsnum = BitConverter.ToInt16(fil, 16) + Dim HZ = BitConverter.ToInt16(fil, 18) + Dim CoordsAddr = BitConverter.ToInt32(fil, 20) + Dim AdditionsAddr = BitConverter.ToInt32(fil, 24) + Dim objects = New List(Of Obj3d) + + + 'init objects + Dim ObjectsPointers = New List(Of Integer) + For a = 0 To objectsnum - 1 + ObjectsPointers.Add(BitConverter.ToInt32(fil, 28 + a * 4)) + Next + + 'get all coords + Dim coordsList = New List(Of Coord) + For a = CoordsAddr To AdditionsAddr Step 8 + coordsList.Add(New Coord With {.X = BitConverter.ToInt16(fil, a), .Y = BitConverter.ToInt16(fil, a + 2) * -1, .Z = BitConverter.ToInt16(fil, a + 4) * -1}) + Next + + + 'resolve objects + For a = 0 To objectsnum - 1 + Dim obj = New Obj3d + Dim readAddr = ObjectsPointers(a) + obj.commandNum = BitConverter.ToInt16(fil, readAddr) + obj.id = BitConverter.ToInt32(fil, readAddr + 4) + readAddr += 8 ' Moving to ChunkData + + For x = 0 To obj.commandNum - 1 'Creating chunks + obj.chunksAddr.Add(readAddr) + Dim chunkLength = fil(readAddr + 1) * 4 + Dim draftChunk(chunkLength - 1) As Byte + readAddr += 4 + Array.Copy(fil, readAddr, draftChunk, 0, chunkLength) + obj.chunks.Add(draftChunk) + readAddr += chunkLength + + 'Getting Coords + Dim poly As New Poly + poly.command = draftChunk(7) + poly.vertNum = 0 + poly.Shading = Color.FromArgb(draftChunk(4), draftChunk(5), draftChunk(6)) + + Select Case poly.command + Case &H20, &H22, &H24, &H25, &H26, &H27, &H30, &H32, &H34, &H36 + poly.vertNum = 3 + Case &H28, &H2A, &H2C, &H2D, &H2E, &H2F, &H38, &H3A, &H3C, &H3E + poly.vertNum = 4 + + Case Else + Debug.WriteLine("UNKNOWN COMMAND! " & poly.command & ". Object " & a & ". ChunkAddr " & obj.chunksAddr.Last & ". ") + End Select + + 'calc Texture Position + Select Case poly.command + Case &H2C, &H2D, &H2E, &H3C, &H3E + Dim TexPage = (draftChunk(22) And 127) - 26 + + Dim Cind1 = 12 : Dim Cind2 = 20 : Dim Cind3 = 28 : Dim Cind4 = 36 + + If poly.command = &H3C Or poly.command = &H3E Then + Cind2 = 24 : Cind3 = 36 : Cind4 = 48 : TexPage = (draftChunk(26) And 127) - 26 + End If + + poly.textureVertexs.add(New TexCoord With {.X = (draftChunk(Cind1) - 1 + TexPage * 128) / texWidth, .Y = 1 - draftChunk(Cind1 + 1) / 256}) + poly.textureVertexs.add(New TexCoord With {.X = (draftChunk(Cind2) - 1 + TexPage * 128) / texWidth, .Y = 1 - draftChunk(Cind2 + 1) / 256}) + + poly.textureVertexs.add(New TexCoord With {.X = (draftChunk(Cind3) - 1 + TexPage * 128) / texWidth, .Y = 1 - draftChunk(Cind3 + 1) / 256}) + poly.textureVertexs.add(New TexCoord With {.X = (draftChunk(Cind4) - 1 + TexPage * 128) / texWidth, .Y = 1 - draftChunk(Cind4 + 1) / 256}) + + + End Select + + + ' Dim bbb As Boolean = BitConverter.ToInt16(draftChunk, UBound(draftChunk) - 1) > coordsList.Count - 1 + + Dim coord1 As Coord = coordsList(BitConverter.ToInt16(draftChunk, UBound(draftChunk) - 7)) + Dim coord2 As Coord = coordsList(BitConverter.ToInt16(draftChunk, UBound(draftChunk) - 5)) + Dim coord3 As Coord = coordsList(BitConverter.ToInt16(draftChunk, UBound(draftChunk) - 3)) + Dim coord4 = New Coord + If poly.vertNum = 4 Then + coord4 = coordsList(BitConverter.ToInt16(draftChunk, UBound(draftChunk) - 1)) + poly.coords.AddRange({coord1, coord2, coord3, coord4}) + ElseIf poly.vertNum = 3 Then + poly.coords.AddRange({coord1, coord2, coord3}) + End If + + + + obj.Polys.Add(poly) + + Next + + + + objects.Add(obj) + Next + + Dim objfile As String + + objfile = "#PERSONA 2 IS SCENE EXPORT /// SERGEY SHEMET" & vbCrLf & "mtllib " & matName & ".mtl" & vbCrLf & vbCrLf + My.Computer.FileSystem.WriteAllText(fileName & ".obj", objfile, False) + Dim vertexcount = 1 + Dim texturvertexCount = 1 + + For zzz = 0 To objects.Count - 1 + + Debug.WriteLine("Current object " & zzz + 1 & "\" & objects.Count) + + Dim verts = "" + Dim surfs = "" + objfile = vbCrLf & vbCrLf & "o Huynya_" & zzz & vbCrLf & vbCrLf + + Dim vrtsStrList = New List(Of String) + Dim surfsStrList = New List(Of String) + Dim verTexturList = New List(Of String) + + 'verTexturList.AddRange({"vt 0.00 0.00", "vt 1.00 0.00", "vt 1.00 1.00", "vt 0.00 1.00"}) + + Dim curobj As Obj3d = objects(zzz) + + For a = 0 To curobj.Polys.Count - 1 + + For Each pol In curobj.Polys + + For Each crd In pol.coords + + + Dim X As Decimal = crd.X / 100 + Dim Y As Decimal = crd.Y / 100 + Dim Z As Decimal = crd.Z / 100 + + vrtsStrList.Add("v " & X.ToString("F5", Globalization.CultureInfo.InvariantCulture) & " " & + Y.ToString("F5", Globalization.CultureInfo.InvariantCulture) & " " & + Z.ToString("F5", Globalization.CultureInfo.InvariantCulture)) + Next + + For Each texCoord In pol.textureVertexs + Dim X As Decimal = texCoord.X + 'Dim X As Decimal = 1 - texCoord.X + Dim Y As Decimal = texCoord.Y + verTexturList.Add("vt " & X.ToString("F5", Globalization.CultureInfo.InvariantCulture) & + " " & Y.ToString("F5", Globalization.CultureInfo.InvariantCulture)) + + + Next + + + If pol.coords.Count = 4 Then + If pol.texturevertexs.Count = 4 Then + surfsStrList.Add("f " & vertexcount & "/" & texturvertexCount & " " & + vertexcount + 1 & "/" & texturvertexCount + 1 & " " & + vertexcount + 3 & "/" & texturvertexCount + 3 & " " & + vertexcount + 2 & "/" & texturvertexCount + 2) + Else + surfsStrList.Add("f " & vertexcount & " " & vertexcount + 1 & " " & vertexcount + 3 & " " & vertexcount + 2) + End If + + End If + If pol.coords.Count = 3 Then + surfsStrList.Add("f " & vertexcount & " " & vertexcount + 2 & " " & vertexcount +1) + End If + + vertexcount += pol.coords.Count + texturvertexCount += pol.texturevertexs.Count + + Next + + Next + + Dim file As System.IO.StreamWriter + file = My.Computer.FileSystem.OpenTextFileWriter(fileName & ".obj", True) + + + file.WriteLine(objfile, True) + + 'objfile &= verts & vbCrLf + For Each vvv In vrtsStrList + file.WriteLine(vvv, True) + Next + + For Each vt In verTexturList + file.WriteLine(vt, True) + Next + + objfile = vbCrLf & "usemtl " & matName & vbCrLf & "s off" & vbCrLf & vbCrLf + file.WriteLine(objfile, True) + + For Each sss In surfsStrList + file.WriteLine(sss, True) + Next + + file.Close() + + 'If zzz = 3 Then Exit For + Next + + + MsgBox("DINE") + End Sub + + + Public Sub GenerateBigTexture(ByRef fil As Byte(), ByVal filnam As String, ByRef texwidth As Integer) + + Dim textureCount = BitConverter.ToInt32(fil, 0) + Dim cluts = New List(Of List(Of Byte)) + Dim Pics = New List(Of List(Of Byte)) + + Dim clutsOffs = New List(Of Integer) + Dim picsOffs = New List(Of Integer) + + Dim TxOffsets = New List(Of Integer) + + For a = 0 To textureCount - 1 Step 2 + clutsOffs.Add(BitConverter.ToInt32(fil, a * 4 + 4)) + picsOffs.Add(BitConverter.ToInt32(fil, a * 4 + 8)) + Next + + For Each clut In clutsOffs + Dim cur = clutsOffs.IndexOf(clut) + + Dim cltData(539) As Byte + Dim picData(16391) As Byte + Array.Copy(fil, clut, cltData, 0, 540) + Array.Copy(fil, picsOffs(cur), picData, 0, 16392) + Dim cl = New List(Of Byte) : cl.AddRange(cltData.ToList) : cluts.Add(cl) + Dim pc = New List(Of Byte) : pc.AddRange(picData.ToList) : Pics.Add(pc) + + Next + + Dim png = New pngImage + + + My.Computer.FileSystem.WriteAllBytes(filnam & ".png", png.makeBigTexturePng(cluts, Pics).ToArray, False) + + texwidth = picsOffs.Count * 64 + + End Sub + + + Public Sub createMaterial(ByVal matName As String, ByVal filnam As String) + + + Dim mtl = "#Sergey Shemet Persona2 Material" & vbCrLf & vbCrLf + + mtl &= "newmtl " & matName & vbCrLf + mtl &= "Ns 250.000000" & vbCrLf + mtl &= "Ka 1.000000 1.000000 1.000000" & vbCrLf + mtl &= "Kd 0.100061 0.195986 0.082515" & vbCrLf + mtl &= "Ks 0.500000 0.500000 0.500000" & vbCrLf + mtl &= "Ke 0.000000 0.000000 0.000000" & vbCrLf + mtl &= "Ni 1.450000" & vbCrLf + mtl &= "d 1.000000" & vbCrLf + mtl &= "illum 0.5" & vbCrLf + mtl &= "map_Kd " & matName & ".png" & vbCrLf + + My.Computer.FileSystem.WriteAllText(filnam & ".mtl", mtl, False) + + + End Sub + + +End Class + + + + +Public Class Obj3d + + Public id As Integer + Public commandNum As Integer + Public chunks = New List(Of Byte()) + Public chunksAddr = New List(Of Integer) + Public Polys = New List(Of Poly) + +End Class + +Public Class Poly + Public coords = New List(Of Coord) + Public vertNum As Byte + Public Shading As Color + Public command As Byte + + Public textureVertexs = New List(Of TexCoord) + +End Class + +Public Class Coord + Public X As Integer + Public Y As Integer + Public Z As Integer +End Class + +Public Class TexCoord + Public X As Decimal + Public Y As Decimal +End Class diff --git a/p2isPSX_CDToolkit/obj/Debug/.NETFramework,Version=v4.6.1.AssemblyAttributes.vb b/p2isPSX_CDToolkit/obj/Debug/.NETFramework,Version=v4.6.1.AssemblyAttributes.vb new file mode 100644 index 0000000..0e292ac --- /dev/null +++ b/p2isPSX_CDToolkit/obj/Debug/.NETFramework,Version=v4.6.1.AssemblyAttributes.vb @@ -0,0 +1,7 @@ +' + Option Strict Off + Option Explicit On + + Imports System + Imports System.Reflection + diff --git a/p2isPSX_CDToolkit/obj/Debug/DesignTimeResolveAssemblyReferences.cache b/p2isPSX_CDToolkit/obj/Debug/DesignTimeResolveAssemblyReferences.cache new file mode 100644 index 0000000..ca4eb73 Binary files /dev/null and b/p2isPSX_CDToolkit/obj/Debug/DesignTimeResolveAssemblyReferences.cache differ diff --git a/p2isPSX_CDToolkit/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/p2isPSX_CDToolkit/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache new file mode 100644 index 0000000..1ff6210 Binary files /dev/null and b/p2isPSX_CDToolkit/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ diff --git a/p2isPSX_CDToolkit/obj/Debug/TempPE/My Project.Resources.Designer.vb.dll b/p2isPSX_CDToolkit/obj/Debug/TempPE/My Project.Resources.Designer.vb.dll new file mode 100644 index 0000000..6f40742 Binary files /dev/null and b/p2isPSX_CDToolkit/obj/Debug/TempPE/My Project.Resources.Designer.vb.dll differ diff --git a/p2isPSX_CDToolkit/obj/Debug/p2epPSX_CDToolkit.exe b/p2isPSX_CDToolkit/obj/Debug/p2epPSX_CDToolkit.exe new file mode 100644 index 0000000..0a73db0 Binary files /dev/null and b/p2isPSX_CDToolkit/obj/Debug/p2epPSX_CDToolkit.exe differ diff --git a/p2isPSX_CDToolkit/obj/Debug/p2epPSX_CDToolkit.pdb b/p2isPSX_CDToolkit/obj/Debug/p2epPSX_CDToolkit.pdb new file mode 100644 index 0000000..ee5047a Binary files /dev/null and b/p2isPSX_CDToolkit/obj/Debug/p2epPSX_CDToolkit.pdb differ diff --git a/p2isPSX_CDToolkit/obj/Debug/p2epPSX_CDToolkit.vbproj.AssemblyReference.cache b/p2isPSX_CDToolkit/obj/Debug/p2epPSX_CDToolkit.vbproj.AssemblyReference.cache new file mode 100644 index 0000000..772d34b Binary files /dev/null and b/p2isPSX_CDToolkit/obj/Debug/p2epPSX_CDToolkit.vbproj.AssemblyReference.cache differ diff --git a/p2isPSX_CDToolkit/obj/Debug/p2epPSX_CDToolkit.vbproj.CoreCompileInputs.cache b/p2isPSX_CDToolkit/obj/Debug/p2epPSX_CDToolkit.vbproj.CoreCompileInputs.cache new file mode 100644 index 0000000..f04c070 --- /dev/null +++ b/p2isPSX_CDToolkit/obj/Debug/p2epPSX_CDToolkit.vbproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +1ed733f7ef716e1628c8bd5501a6d0e2fc0850cebfdbf100c59affa0e885c14a diff --git a/p2isPSX_CDToolkit/obj/Debug/p2epPSX_CDToolkit.vbproj.FileListAbsolute.txt b/p2isPSX_CDToolkit/obj/Debug/p2epPSX_CDToolkit.vbproj.FileListAbsolute.txt new file mode 100644 index 0000000..63bc4b5 --- /dev/null +++ b/p2isPSX_CDToolkit/obj/Debug/p2epPSX_CDToolkit.vbproj.FileListAbsolute.txt @@ -0,0 +1,26 @@ +C:\Users\Sergey\source\repos\p2epPSX_CDToolkit\p2isPSX_CDToolkit\bin\Debug\p2epPSX_CDToolkit.exe.config +C:\Users\Sergey\source\repos\p2epPSX_CDToolkit\p2isPSX_CDToolkit\bin\Debug\p2epPSX_CDToolkit.exe +C:\Users\Sergey\source\repos\p2epPSX_CDToolkit\p2isPSX_CDToolkit\bin\Debug\p2epPSX_CDToolkit.pdb +C:\Users\Sergey\source\repos\p2epPSX_CDToolkit\p2isPSX_CDToolkit\bin\Debug\p2epPSX_CDToolkit.xml +C:\Users\Sergey\source\repos\p2epPSX_CDToolkit\p2isPSX_CDToolkit\bin\Debug\Free.Ports.libpng.dll +C:\Users\Sergey\source\repos\p2epPSX_CDToolkit\p2isPSX_CDToolkit\bin\Debug\Free.Ports.zLib.dll +C:\Users\Sergey\source\repos\p2epPSX_CDToolkit\p2isPSX_CDToolkit\bin\Debug\Zlib.Portable.dll +C:\Users\Sergey\source\repos\p2epPSX_CDToolkit\p2isPSX_CDToolkit\bin\Debug\Free.Ports.libpng.xml +C:\Users\Sergey\source\repos\p2epPSX_CDToolkit\p2isPSX_CDToolkit\bin\Debug\Free.Ports.zLib.xml +C:\Users\Sergey\source\repos\p2epPSX_CDToolkit\p2isPSX_CDToolkit\bin\Debug\Zlib.Portable.xml +C:\Users\Sergey\source\repos\p2epPSX_CDToolkit\p2isPSX_CDToolkit\obj\Debug\p2isPSX_CDView.convEventToObj.resources +C:\Users\Sergey\source\repos\p2epPSX_CDToolkit\p2isPSX_CDToolkit\obj\Debug\p2isPSX_CDView.DungeonEditor.resources +C:\Users\Sergey\source\repos\p2epPSX_CDToolkit\p2isPSX_CDToolkit\obj\Debug\p2isPSX_CDView.Form1.resources +C:\Users\Sergey\source\repos\p2epPSX_CDToolkit\p2isPSX_CDToolkit\obj\Debug\p2isPSX_CDView.Resources.resources +C:\Users\Sergey\source\repos\p2epPSX_CDToolkit\p2isPSX_CDToolkit\obj\Debug\p2isPSX_CDView.ScriptCheck.resources +C:\Users\Sergey\source\repos\p2epPSX_CDToolkit\p2isPSX_CDToolkit\obj\Debug\p2isPSX_CDView.StringsOffsetEditorvb.resources +C:\Users\Sergey\source\repos\p2epPSX_CDToolkit\p2isPSX_CDToolkit\obj\Debug\p2epPSX_CDToolkit.vbproj.GenerateResource.cache +C:\Users\Sergey\source\repos\p2epPSX_CDToolkit\p2isPSX_CDToolkit\obj\Debug\p2epPSX_CDToolkit.vbproj.CoreCompileInputs.cache +C:\Users\Sergey\source\repos\p2epPSX_CDToolkit\p2isPSX_CDToolkit\obj\Debug\p2epPSX_CDToolkit.exe +C:\Users\Sergey\source\repos\p2epPSX_CDToolkit\p2isPSX_CDToolkit\obj\Debug\p2epPSX_CDToolkit.xml +C:\Users\Sergey\source\repos\p2epPSX_CDToolkit\p2isPSX_CDToolkit\obj\Debug\p2epPSX_CDToolkit.pdb +C:\Users\Sergey\source\repos\p2epPSX_CDToolkit\p2isPSX_CDToolkit\obj\Debug\p2isPSX_CDView.JapCharCodeGenerator.resources +C:\Users\Sergey\source\repos\p2epPSX_CDToolkit\p2isPSX_CDToolkit\obj\Debug\p2isPSX_CDView.ScriptParserWin.resources +C:\Users\Sergey\source\repos\p2epPSX_CDToolkit\p2isPSX_CDToolkit\obj\Debug\p2isPSX_CDView.CityEditor.resources +C:\Users\Sergey\source\repos\p2epPSX_CDToolkit\p2isPSX_CDToolkit\obj\Debug\p2epPSX_CDToolkit.vbproj.AssemblyReference.cache +C:\Users\Sergey\source\repos\p2epPSX_CDToolkit\p2isPSX_CDToolkit\obj\Debug\p2epPSX_.D2426659.Up2Date diff --git a/p2isPSX_CDToolkit/obj/Debug/p2epPSX_CDToolkit.vbproj.GenerateResource.cache b/p2isPSX_CDToolkit/obj/Debug/p2epPSX_CDToolkit.vbproj.GenerateResource.cache new file mode 100644 index 0000000..cdb476a Binary files /dev/null and b/p2isPSX_CDToolkit/obj/Debug/p2epPSX_CDToolkit.vbproj.GenerateResource.cache differ diff --git a/p2isPSX_CDToolkit/obj/Debug/p2epPSX_CDToolkit.xml b/p2isPSX_CDToolkit/obj/Debug/p2epPSX_CDToolkit.xml new file mode 100644 index 0000000..e0a56d4 --- /dev/null +++ b/p2isPSX_CDToolkit/obj/Debug/p2epPSX_CDToolkit.xml @@ -0,0 +1,26 @@ + + + + +p2epPSX_CDToolkit + + + + + + Класс ресурса со строгой типизацией для поиска локализованных строк и т.д. + + + + + Возвращает кэшированный экземпляр ResourceManager, использованный этим классом. + + + + + Перезаписывает свойство CurrentUICulture текущего потока для всех + обращений к ресурсу с помощью этого класса ресурса со строгой типизацией. + + + + diff --git a/p2isPSX_CDToolkit/obj/Debug/p2isPSX_CDToolkit.exe b/p2isPSX_CDToolkit/obj/Debug/p2isPSX_CDToolkit.exe new file mode 100644 index 0000000..79e2017 Binary files /dev/null and b/p2isPSX_CDToolkit/obj/Debug/p2isPSX_CDToolkit.exe differ diff --git a/p2isPSX_CDToolkit/obj/Debug/p2isPSX_CDToolkit.pdb b/p2isPSX_CDToolkit/obj/Debug/p2isPSX_CDToolkit.pdb new file mode 100644 index 0000000..56ee58b Binary files /dev/null and b/p2isPSX_CDToolkit/obj/Debug/p2isPSX_CDToolkit.pdb differ diff --git a/p2isPSX_CDToolkit/obj/Debug/p2isPSX_CDToolkit.vbproj.CopyComplete b/p2isPSX_CDToolkit/obj/Debug/p2isPSX_CDToolkit.vbproj.CopyComplete new file mode 100644 index 0000000..e69de29 diff --git a/p2isPSX_CDToolkit/obj/Debug/p2isPSX_CDToolkit.vbproj.CoreCompileInputs.cache b/p2isPSX_CDToolkit/obj/Debug/p2isPSX_CDToolkit.vbproj.CoreCompileInputs.cache new file mode 100644 index 0000000..3495044 --- /dev/null +++ b/p2isPSX_CDToolkit/obj/Debug/p2isPSX_CDToolkit.vbproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +326aa845c4bb0ba74cb72caca3fa7317da39d30e diff --git a/p2isPSX_CDToolkit/obj/Debug/p2isPSX_CDToolkit.vbproj.FileListAbsolute.txt b/p2isPSX_CDToolkit/obj/Debug/p2isPSX_CDToolkit.vbproj.FileListAbsolute.txt new file mode 100644 index 0000000..ed9c348 --- /dev/null +++ b/p2isPSX_CDToolkit/obj/Debug/p2isPSX_CDToolkit.vbproj.FileListAbsolute.txt @@ -0,0 +1,24 @@ +C:\Users\ShemetSA.RADIO\Documents\Visual Studio 2015\Projects\p2isPSX_CDToolkit\p2isPSX_CDToolkit\bin\Debug\p2isPSX_CDToolkit.exe.config +C:\Users\Sergey\source\repos\p2isPSX_CDToolkit\p2isPSX_CDToolkit\bin\Debug\p2isPSX_CDToolkit.exe.config +C:\Users\Sergey\source\repos\p2isPSX_CDToolkit\p2isPSX_CDToolkit\bin\Debug\p2isPSX_CDToolkit.exe +C:\Users\Sergey\source\repos\p2isPSX_CDToolkit\p2isPSX_CDToolkit\bin\Debug\p2isPSX_CDToolkit.pdb +C:\Users\Sergey\source\repos\p2isPSX_CDToolkit\p2isPSX_CDToolkit\bin\Debug\p2isPSX_CDToolkit.xml +C:\Users\Sergey\source\repos\p2isPSX_CDToolkit\p2isPSX_CDToolkit\obj\Debug\p2isPSX_CDToolkit.vbprojAssemblyReference.cache +C:\Users\Sergey\source\repos\p2isPSX_CDToolkit\p2isPSX_CDToolkit\obj\Debug\p2isPSX_CDView.Form1.resources +C:\Users\Sergey\source\repos\p2isPSX_CDToolkit\p2isPSX_CDToolkit\obj\Debug\p2isPSX_CDView.Resources.resources +C:\Users\Sergey\source\repos\p2isPSX_CDToolkit\p2isPSX_CDToolkit\obj\Debug\p2isPSX_CDToolkit.vbproj.GenerateResource.cache +C:\Users\Sergey\source\repos\p2isPSX_CDToolkit\p2isPSX_CDToolkit\obj\Debug\p2isPSX_CDToolkit.vbproj.CoreCompileInputs.cache +C:\Users\Sergey\source\repos\p2isPSX_CDToolkit\p2isPSX_CDToolkit\obj\Debug\p2isPSX_CDToolkit.exe +C:\Users\Sergey\source\repos\p2isPSX_CDToolkit\p2isPSX_CDToolkit\obj\Debug\p2isPSX_CDToolkit.xml +C:\Users\Sergey\source\repos\p2isPSX_CDToolkit\p2isPSX_CDToolkit\obj\Debug\p2isPSX_CDToolkit.pdb +C:\Users\Sergey\source\repos\p2isPSX_CDToolkit\p2isPSX_CDToolkit\obj\Debug\p2isPSX_CDView.ScriptCheck.resources +C:\Users\Sergey\source\repos\p2isPSX_CDToolkit\p2isPSX_CDToolkit\bin\Debug\Zlib.Portable.dll +C:\Users\Sergey\source\repos\p2isPSX_CDToolkit\p2isPSX_CDToolkit\bin\Debug\Zlib.Portable.xml +C:\Users\Sergey\source\repos\p2isPSX_CDToolkit\p2isPSX_CDToolkit\obj\Debug\p2isPSX_CDToolkit.vbproj.CopyComplete +C:\Users\Sergey\source\repos\p2isPSX_CDToolkit\p2isPSX_CDToolkit\obj\Debug\p2isPSX_CDView.StringsOffsetEditorvb.resources +C:\Users\Sergey\source\repos\p2isPSX_CDToolkit\p2isPSX_CDToolkit\obj\Debug\p2isPSX_CDView.DungeonEditor.resources +C:\Users\Sergey\source\repos\p2isPSX_CDToolkit\p2isPSX_CDToolkit\bin\Debug\Free.Ports.libpng.dll +C:\Users\Sergey\source\repos\p2isPSX_CDToolkit\p2isPSX_CDToolkit\bin\Debug\Free.Ports.zLib.dll +C:\Users\Sergey\source\repos\p2isPSX_CDToolkit\p2isPSX_CDToolkit\bin\Debug\Free.Ports.libpng.xml +C:\Users\Sergey\source\repos\p2isPSX_CDToolkit\p2isPSX_CDToolkit\bin\Debug\Free.Ports.zLib.xml +C:\Users\Sergey\source\repos\p2isPSX_CDToolkit\p2isPSX_CDToolkit\obj\Debug\p2isPSX_CDView.convEventToObj.resources diff --git a/p2isPSX_CDToolkit/obj/Debug/p2isPSX_CDToolkit.vbproj.GenerateResource.cache b/p2isPSX_CDToolkit/obj/Debug/p2isPSX_CDToolkit.vbproj.GenerateResource.cache new file mode 100644 index 0000000..2cfb6d7 Binary files /dev/null and b/p2isPSX_CDToolkit/obj/Debug/p2isPSX_CDToolkit.vbproj.GenerateResource.cache differ diff --git a/p2isPSX_CDToolkit/obj/Debug/p2isPSX_CDToolkit.vbprojAssemblyReference.cache b/p2isPSX_CDToolkit/obj/Debug/p2isPSX_CDToolkit.vbprojAssemblyReference.cache new file mode 100644 index 0000000..60b7d5c Binary files /dev/null and b/p2isPSX_CDToolkit/obj/Debug/p2isPSX_CDToolkit.vbprojAssemblyReference.cache differ diff --git a/p2isPSX_CDToolkit/obj/Debug/p2isPSX_CDToolkit.xml b/p2isPSX_CDToolkit/obj/Debug/p2isPSX_CDToolkit.xml new file mode 100644 index 0000000..e737987 --- /dev/null +++ b/p2isPSX_CDToolkit/obj/Debug/p2isPSX_CDToolkit.xml @@ -0,0 +1,26 @@ + + + + +p2isPSX_CDToolkit + + + + + + Класс ресурса со строгой типизацией для поиска локализованных строк и т.д. + + + + + Возвращает кэшированный экземпляр ResourceManager, использованный этим классом. + + + + + Перезаписывает свойство CurrentUICulture текущего потока для всех + обращений к ресурсу с помощью этого класса ресурса со строгой типизацией. + + + + diff --git a/p2isPSX_CDToolkit/obj/Debug/p2isPSX_CDView.CityEditor.resources b/p2isPSX_CDToolkit/obj/Debug/p2isPSX_CDView.CityEditor.resources new file mode 100644 index 0000000..6c05a97 Binary files /dev/null and b/p2isPSX_CDToolkit/obj/Debug/p2isPSX_CDView.CityEditor.resources differ diff --git a/p2isPSX_CDToolkit/obj/Debug/p2isPSX_CDView.DungeonEditor.resources b/p2isPSX_CDToolkit/obj/Debug/p2isPSX_CDView.DungeonEditor.resources new file mode 100644 index 0000000..6c05a97 Binary files /dev/null and b/p2isPSX_CDToolkit/obj/Debug/p2isPSX_CDView.DungeonEditor.resources differ diff --git a/p2isPSX_CDToolkit/obj/Debug/p2isPSX_CDView.Form1.resources b/p2isPSX_CDToolkit/obj/Debug/p2isPSX_CDView.Form1.resources new file mode 100644 index 0000000..6a25894 Binary files /dev/null and b/p2isPSX_CDToolkit/obj/Debug/p2isPSX_CDView.Form1.resources differ diff --git a/p2isPSX_CDToolkit/obj/Debug/p2isPSX_CDView.JapCharCodeGenerator.resources b/p2isPSX_CDToolkit/obj/Debug/p2isPSX_CDView.JapCharCodeGenerator.resources new file mode 100644 index 0000000..6c05a97 Binary files /dev/null and b/p2isPSX_CDToolkit/obj/Debug/p2isPSX_CDView.JapCharCodeGenerator.resources differ diff --git a/p2isPSX_CDToolkit/obj/Debug/p2isPSX_CDView.Resources.resources b/p2isPSX_CDToolkit/obj/Debug/p2isPSX_CDView.Resources.resources new file mode 100644 index 0000000..6c05a97 Binary files /dev/null and b/p2isPSX_CDToolkit/obj/Debug/p2isPSX_CDView.Resources.resources differ diff --git a/p2isPSX_CDToolkit/obj/Debug/p2isPSX_CDView.ScriptCheck.resources b/p2isPSX_CDToolkit/obj/Debug/p2isPSX_CDView.ScriptCheck.resources new file mode 100644 index 0000000..09ca36a Binary files /dev/null and b/p2isPSX_CDToolkit/obj/Debug/p2isPSX_CDView.ScriptCheck.resources differ diff --git a/p2isPSX_CDToolkit/obj/Debug/p2isPSX_CDView.ScriptParserWin.resources b/p2isPSX_CDToolkit/obj/Debug/p2isPSX_CDView.ScriptParserWin.resources new file mode 100644 index 0000000..6c05a97 Binary files /dev/null and b/p2isPSX_CDToolkit/obj/Debug/p2isPSX_CDView.ScriptParserWin.resources differ diff --git a/p2isPSX_CDToolkit/obj/Debug/p2isPSX_CDView.StringsOffsetEditorvb.resources b/p2isPSX_CDToolkit/obj/Debug/p2isPSX_CDView.StringsOffsetEditorvb.resources new file mode 100644 index 0000000..6c05a97 Binary files /dev/null and b/p2isPSX_CDToolkit/obj/Debug/p2isPSX_CDView.StringsOffsetEditorvb.resources differ diff --git a/p2isPSX_CDToolkit/obj/Debug/p2isPSX_CDView.convEventToObj.resources b/p2isPSX_CDToolkit/obj/Debug/p2isPSX_CDView.convEventToObj.resources new file mode 100644 index 0000000..6c05a97 Binary files /dev/null and b/p2isPSX_CDToolkit/obj/Debug/p2isPSX_CDView.convEventToObj.resources differ diff --git a/p2isPSX_CDToolkit/obj/Debug/p2isPSX_CDView.vbproj.FileListAbsolute.txt b/p2isPSX_CDToolkit/obj/Debug/p2isPSX_CDView.vbproj.FileListAbsolute.txt new file mode 100644 index 0000000..7386f89 --- /dev/null +++ b/p2isPSX_CDToolkit/obj/Debug/p2isPSX_CDView.vbproj.FileListAbsolute.txt @@ -0,0 +1 @@ +C:\Users\ShemetSA.RADIO\AppData\Local\Temporary Projects\p2isPSX_CDView\bin\Debug\p2isPSX_CDView.exe.config diff --git a/p2isPSX_CDToolkit/p2epPSX_CDToolkit.vbproj b/p2isPSX_CDToolkit/p2epPSX_CDToolkit.vbproj new file mode 100644 index 0000000..c99c57d --- /dev/null +++ b/p2isPSX_CDToolkit/p2epPSX_CDToolkit.vbproj @@ -0,0 +1,214 @@ + + + + + Debug + AnyCPU + {E92973F5-DC31-4C53-B473-A203A0E6AA29} + WinExe + p2isPSX_CDView.My.MyApplication + p2isPSX_CDView + p2epPSX_CDToolkit + 512 + WindowsForms + v4.6.1 + true + + + + AnyCPU + true + full + true + true + bin\Debug\ + p2epPSX_CDToolkit.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + AnyCPU + pdbonly + false + true + true + bin\Release\ + p2epPSX_CDToolkit.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + On + + + Binary + + + Off + + + On + + + + ..\packages\LibPngPort.0.3.1\lib\net45\Free.Ports.libpng.dll + + + ..\packages\LibPngPort.0.3.1\lib\net45\Free.Ports.zLib.dll + + + + + + + + + + + + + ..\packages\Zlib.Portable.Signed.1.11.0\lib\portable-net4+sl5+wp8+win8+wpa81+MonoTouch+MonoAndroid\Zlib.Portable.dll + + + + + + + + + + + + + + + + + + Form + + + convEventToObj.vb + + + Form + + + CityEditor.vb + + + Form + + + DungeonEditor.vb + + + Form + + + + Form + + + Form1.vb + Form + + + Form2.vb + + + Form + + + + JapCharCodeGenerator.vb + + + Form + + + Form + + + + True + Application.myapp + + + True + True + Resources.resx + + + True + Settings.settings + True + + + + + ScriptCheck.vb + + + Form + + + + StringsOffsetEditorvb.vb + + + Form + + + + + convEventToObj.vb + + + CityEditor.vb + + + DungeonEditor.vb + + + Form1.vb + + + Form2.vb + + + JapCharCodeGenerator.vb + + + VbMyResourcesResXFileCodeGenerator + Resources.Designer.vb + My.Resources + Designer + + + ScriptCheck.vb + + + StringsOffsetEditorvb.vb + + + + + MyApplicationCodeGenerator + Application.Designer.vb + + + SettingsSingleFileGenerator + My + Settings.Designer.vb + + + + + + + \ No newline at end of file diff --git a/p2isPSX_CDToolkit/p2epPSX_CDToolkit.vbproj.user b/p2isPSX_CDToolkit/p2epPSX_CDToolkit.vbproj.user new file mode 100644 index 0000000..9fcb30c --- /dev/null +++ b/p2isPSX_CDToolkit/p2epPSX_CDToolkit.vbproj.user @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/p2isPSX_CDToolkit/packages.config b/p2isPSX_CDToolkit/packages.config new file mode 100644 index 0000000..0b0f772 --- /dev/null +++ b/p2isPSX_CDToolkit/packages.config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/p2isPSX_CDToolkit/pngImage.vb b/p2isPSX_CDToolkit/pngImage.vb new file mode 100644 index 0000000..9fdccc4 --- /dev/null +++ b/p2isPSX_CDToolkit/pngImage.vb @@ -0,0 +1,535 @@ +Imports Ionic +Imports Free.Ports.libpng +Imports System.IO +Imports System.IO.Compression +Imports Microsoft.VisualBasic.VBMath + +Public Class pngImage + Public MagicWord = {137, 80, 78, 71, 13, 10, 26, 10} + Public Width As Integer + Public Heigth As Integer + Public bit As Byte + Public colors As Integer + Public Palette = New List(Of Byte) + Public Transp = New List(Of Byte) + Public imageDATA = New List(Of Byte) + Public Chunks As List(Of Chunk) + Public IMG As Bitmap + + Public Sub New() + Chunks = New List(Of Chunk) + End Sub + + Public Sub InitBitMap(ByVal path As String) + + + + IMG = Image.FromFile(path) + + + End Sub + + Public Function makeBigTexturePng(ByRef cluts As List(Of List(Of Byte)), ByRef pics As List(Of List(Of Byte))) + + Dim bigWidth = 64 * pics.Count + + Dim ch = New Chunk With {.Type = "IHDR", .Size = 13} + 'Making header + ch.Data.AddRange(BitConverter.GetBytes(bigWidth).Reverse) + ch.Data.AddRange(BitConverter.GetBytes(256).Reverse) + ch.Data.Add(8) '8 Bit bits per channel + ch.Data.Add(2) 'Or 6 with alpha 'Color Type - RGB Mode (24bit) if 16bit + ch.Data.Add(0) 'Compression (zlib) + ch.Data.Add(0) 'Filter? + ch.Data.Add(0) 'Interlace? + Chunks.Add(ch) + ch = New Chunk With {.Type = "tRNS"} : ch.Data.Add(0) : Chunks.Add(ch) 'First Color is transparent + + + ch = New Chunk With {.Type = "IDAT"} + 'Adding Image data + + ''Image loop here + Dim img = New List(Of Byte) + + + + For x = 0 To 255 + img.Add(0) + For y = 0 To pics.Count - 1 + For z = 0 To 63 + Dim curPicIndex = x * 64 + z + 8 'PIC LINE * WIDTH + CURRENT PIX IN LINE + 8(INIT BYTES) + Dim curCol = GetColFrom1555List(cluts(y), pics(y)(curPicIndex)) + img.AddRange({curCol(0), curCol(1), curCol(2)}) + Next + Next + Next + + + Dim dstream = Zlib.ZlibStream.CompressBuffer(img.ToArray) + ch.Data = dstream.ToList + Chunks.Add(ch) + ch = New Chunk With {.Type = "IEND", .Size = 0} + Chunks.Add(ch) + + + Return (GenerateFile()) 'Return file to mainWindow + End Function + + Public Function GetColFrom1555List(ByRef bytes As List(Of Byte), ByVal ind As Integer) + ind = ind * 2 + 8 + If ind > bytes.Count - 1 Then Return {0, 0, 0} + + Dim col As Integer = (bytes(ind)) + CInt(bytes(ind + 1)) * 256 + Dim a = col And &H8000 >> 15, b = ((col And &H7C00) >> 10) * 8, g = ((col And &H3E0) >> 5) * 8, r = (col And &H1F) * 8 + Return {r, g, b} + End Function + + Public Function NewPng(ByRef pic As rleFile, ByRef clut As rleFile) + + 'Need to deconctruct and construct palettes and imagedata here + + 'need to set correct x&y + If Form1.CurrentImgMode = 16 Then + Width = pic.w + + ElseIf clut.w = 16 Or Form1.Force4bit.Checked Then + Width = pic.w * 4 + Else + If clut.w = 256 Then Width = pic.w * 2 Else Width = pic.w + End If + + Heigth = pic.h + + + GeneratePngChunks(pic, clut) + Return (GenerateFile()) 'Return file to mainWindow + End Function + + + Public Sub GeneratePngChunks(ByRef pic As rleFile, ByRef clut As rleFile) + + + + + Dim ch = New Chunk With {.Type = "IHDR", .Size = 13} + 'Making header + ch.Data.AddRange(BitConverter.GetBytes(Width).Reverse) + ch.Data.AddRange(BitConverter.GetBytes(Heigth).Reverse) + If Form1.CurrentImgMode <> 16 Then + ch.Data.Add(8) '8 Bit Depth in palette + ch.Data.Add(3) 'Color Type - Indexed Colors 'If CLUT exists first! + Else + ch.Data.Add(8) '8 Bit bits per channel + ch.Data.Add(2) 'Or 6 with alpha 'Color Type - RGB Mode (24bit) if 16bit + End If + + ch.Data.Add(0) 'Compression (zlib) + ch.Data.Add(0) 'Filter? + ch.Data.Add(0) 'Interlace? + + + 'not 16bit + If Form1.CurrentImgMode <> 16 Then + Chunks.Add(ch) + ch = New Chunk With {.Type = "PLTE"} + 'Making Palette + ch.Data.AddRange(MakeCLUTList(clut)) + + + Chunks.Add(ch) + ch = New Chunk With {.Type = "tRNS"} + 'Making Trans + If Form1.alpha0.Checked Then ch.Data.Add(0) 'First Color is transparent + End If + + + Chunks.Add(ch) + ch = New Chunk With {.Type = "IDAT"} + 'Adding Image data + + + + Dim rle = New rleTools + Dim picdata As Byte() + If pic.Compr > 0 Then + picdata = rle.Unrle2(pic.Bytes).ToArray + Else + Dim piclist = pic.Bytes.ToList + piclist.RemoveRange(0, 16) + picdata = piclist.ToArray + End If + + + + Dim img = New List(Of Byte) + + If Form1.Force4bit.Checked Then GoTo force4bit 'force 4 bit + + If Form1.CurrentImgMode = 16 Then 'True color + Dim piccc() = picdata.ToArray + Dim reader = 0, x = 0 + img.Add(0) 'Fucking filter byte + + '16bit_PNG_export + Do + If x = Width Then x = 0 : img.Add(0) 'Fucking filter byte + Dim curCol = GetColFrom1555(piccc, reader) + img.AddRange({curCol(0), curCol(1), curCol(2)}) + reader += 2 + x += 1 + If reader >= picdata.Count Then Exit Do + + Loop + + + + Else + 'other export + + + Select Case clut.w + Case 16 + '4bit mode +force4bit: + + For y = 0 To Heigth - 1 + img.Add(0) 'Fucking filter byte + For x = 0 To Width / 2 - 1 + Dim fs = picdata(y * Width / 2 + x) 'Width/2 = Bytes in pic line + Dim lp = fs And &HF 'get left byte + Dim rp = (fs And &HF0) >> 4 'get right byte + img.Add(lp) + img.Add(rp) + Next + Next + + Case 256 + '8bit mode + For y = 0 To Heigth - 1 + img.Add(0) 'Fucking filter byte + For x = 0 To Width - 1 + Dim fs = picdata(y * Width + x) + img.Add(fs) + Next + Next + End Select + + + End If + + + Dim dstream = Zlib.ZlibStream.CompressBuffer(img.ToArray) + + ch.Data = dstream.ToList + + + + Chunks.Add(ch) + ch = New Chunk With {.Type = "IEND", .Size = 0} + Chunks.Add(ch) + + + End Sub + + Public Function GenerateFile() + + Dim file = New List(Of Byte) + For Each a In MagicWord + file.Add(a) + Next + + + + For Each ch As Chunk In Chunks + Dim tempChunk = New List(Of Byte) + ch.Size = ch.Data.Count + file.AddRange(BitConverter.GetBytes(ch.Size).Reverse) 'Size of chunk Not Included in CRC + + For chChar = 0 To 3 : tempChunk.Add(Asc(ch.Type(chChar))) : Next 'AddingChunkName + tempChunk.AddRange(ch.Data) + + Dim CRC = New Ionic.Crc.CRC32() + CRC.SlurpBlock(tempChunk.ToArray, 0, tempChunk.Count) 'CRC CALCULATES HERE! + file.AddRange(tempChunk) + file.AddRange(BitConverter.GetBytes(CRC.Crc32Result).Reverse) + + Next + + + Return file + End Function + + Public Function MakeCLUTList(ByRef nx As rleFile) + + Dim a = New List(Of Byte) + Dim rle As New rleTools + Dim unrl() As Byte + + Select Case nx.Compr + Case 0 + unrl = rle.UnrleNocompr(nx.Bytes).ToArray + Case 1 + unrl = rle.Unrle2(nx.Bytes).ToArray 'Image + Case Else + unrl = rle.Unrle(nx.Bytes).ToArray 'data + End Select + + + + '4bit mode + If nx.w = 16 Or Form1.Force4bit.Checked Then + For x = 0 To 15 + Dim b As Integer() = GetColFrom1555(unrl, Form1.CLUTid.Value * 32 + x * 2) + a.Add(b(0)) : a.Add(b(1)) : a.Add(b(2)) + Next + Return a + End If + + + If nx.w = 256 Then + For x = 0 To 255 + 'a.Add(GetColFrom1555(nx.Bytes, 16 + CLUTid.Value * 256 + x * 2)) + Dim b As Integer() = GetColFrom1555(unrl, x * 2) + a.Add(b(0)) : a.Add(b(1)) : a.Add(b(2)) + Next + End If + + Return a + End Function + + Public Function GetColFrom1555(ByRef bytes As Byte(), ByVal ind As Integer) + If ind > UBound(bytes) - 1 Then Return {0, 0, 0} + Dim col As Int16 = BitConverter.ToInt16(bytes, ind) + Dim a = col And &H8000 >> 15, b = ((col And &H7C00) >> 10) * 8, g = ((col And &H3E0) >> 5) * 8, r = (col And &H1F) * 8 + Return {r, g, b} + End Function + + + + + Public Function Convert888To565(ByRef col As Color) + Dim r = col.R : Dim g = col.G : Dim b = col.B + + Dim res As Int32 + + res = ((b And &HF8) << 7) Or ((g And &HF8) << 2) Or ((r And &HF8) >> 3) + 'Dim x1 = (b And &HF8) Or (g >> 5) + 'Dim x2 = ((g And &H1C) << 3) Or (r >> 3) + + 'res = x2 Or (x1 << 8) + + Return res + End Function + + Public Function ParsePNGgetData(ByRef src As List(Of Byte), ByRef rle As rleFile) + Dim file = New List(Of Byte) + + + If src(0) <> 137 And src(1) <> 80 And src(2) <> 78 Then MsgBox("Это не PNG!!!", MsgBoxStyle.Critical) : Return file + + + 'Loading Chunks + Dim Reader As Integer = 8 + Do + GenerateChunk(src, Reader) + Loop Until Reader >= src.Count + + Dim header As List(Of Byte) = GetChunk("IHDR").Data + Width = Read32bitNumBE(header, 0) + Heigth = Read32bitNumBE(header, 4) + + + Dim plte As Chunk = GetChunk("PLTE") + If Form1.imp4bit.Checked Then + bit = 4 + Else + If Form1.Imp8bit.Checked Then + bit = 8 + Else + bit = 16 + End If + End If + + + Dim imgData = New List(Of Byte) + 'LoadingChunks + + Dim chunks = GetChunks("IDAT") 'CONCAT ALL IDATS.... + Dim buff = New List(Of Byte) + For Each ch In chunks + buff.AddRange(ch.Data) + Next + + Dim dstream = Zlib.ZlibStream.UncompressBuffer(buff.ToArray()) '....AND DECOMPRESS + + imgData.AddRange(dstream.ToList) + Dim filter As Integer + + Reader = 1 + + + Dim x, y As Integer + + If bit = 4 Or bit = 8 Then UnfilterNew(imgData, Width, Heigth) 'unfilter ALL scanlines + + + Do + Select Case bit + Case 4 + Dim lp = imgData(Reader) + Dim rp = imgData(Reader + 1) : Reader += 1 + file.Add(((rp And &HF) << 4) Or (lp And &HF)) + x += 2 + Case 8 + If y = Heigth Then Exit Do + file.Add(imgData(Reader)) + x += 1 + Case 16 + + Dim col As Color = IMG.GetPixel(x, y) + + + + Dim res As Int32 = Convert888To565(col) + file.AddRange({BitConverter.GetBytes(res)(0), BitConverter.GetBytes(res)(1)}) + + x += 1 + 'Reader += 2 + End Select + + If x >= Width Then + If Reader >= imgData.Count - 1 Then Exit Do + x = 0 + y += 1 + + Reader += 1 + + End If + + If y >= Heigth Then Exit Do + + + Reader += 1 + + + Loop + + + + Return file + End Function + + Public Sub UnfilterNew(ByRef imgData As List(Of Byte), ByVal Width As Integer, ByVal Heigth As Integer) + ''''''NEW UNFILTER FROM PNGLIB OFFICIAL LIBRARY (3rd version) + + Dim x = 0, y = 0, filter, reader As Integer + filter = imgData(reader) ': Debug.WriteLine("Y=" & y & "FLT=" & filter) 'INIT + reader += 1 + + Do + Select Case filter + Case 0 'none filter + + Case 1 'sub filter + For a = 1 To Width - 1 + Dim rp As Integer = imgData(reader + a) + Dim rpp As Integer = imgData(reader + a - 1) + imgData(reader + a) = (rp + rpp) And &HFF + Next + Case 2 'up filter + For a = 0 To Width - 1 + Dim rp As Integer = imgData(reader + a) + Dim pp As Integer = imgData(reader + a - Width - 1) + imgData(reader + a) = (rp + pp) And &HFF + Next + Case 3 'average filter + + Dim rp As Integer = imgData(reader) + Dim pp As Integer = imgData(reader - Width - 1) 'first pixel + imgData(reader) = (rp + (pp / 2)) And &HFF + + For a = 1 To Width - 1 + rp = imgData(reader + a) + pp = imgData(reader + a - Width - 1) + Dim rpp As Integer = imgData(reader + a - 1) + imgData(reader + a) = (rp + Math.Floor((pp + rpp) / 2)) And &HFF 'Other pixels + Next + + Case 4 'paeth 1-byte filter + + Dim rp_end As Integer = reader + Width + Dim a, c As Integer + x = 0 + c = imgData(reader - Width - 1) 'first pixel + a = imgData(reader) + c + imgData(reader) = a And &HFF : reader += 1 + + While (reader < rp_end) + Dim b, pa, pb, pc, p As Integer + x = x + 1 + a = a And &HFF 'cleaning byte + b = imgData(reader - Width - 1) + + p = b - c + pc = a - c + + pa = Math.Abs(p) + pb = Math.Abs(pc) + pc = Math.Abs(p + pc) + + If pb < pa Then pa = pb : a = b + If pc < pa Then a = c + + c = b + a += imgData(reader) + imgData(reader) = a And &HFF : reader += 1 + End While + End Select + If filter <> 4 Then reader += Width + + y = y + 1 + If reader >= imgData.Count - 1 Or y = Heigth Then Exit Do + + filter = imgData(reader) + reader += 1 + 'Debug.WriteLine("Y=" & y & "FLT=" & filter) + + Loop + + End Sub + + + Public Sub GenerateChunk(ByRef src As List(Of Byte), ByRef reader As Integer) + Dim cc = New Chunk + cc.Size = Read32bitNumBE(src, reader) : reader += 4 + For x = 0 To 3 : cc.Type &= Chr(src(x + reader)) : Next : reader += 4 + For x = 0 To cc.Size - 1 : cc.Data.Add(src(x + reader)) : Next : reader += cc.Size + reader += 4 'Nahuy CRC-check! + Chunks.add(cc) + End Sub + Public Function GetChunk(ByVal Tp As String) + For Each cc In Chunks + If cc.Type = Tp Then Return cc + Next + Return Nothing + End Function + + Public Function GetChunks(ByVal Tp As String) + + Dim a = New List(Of Chunk) + a = Chunks.FindAll(Function(x) x.Type = Tp) + + Return a + End Function + + Public Function Read32bitNumBE(ByRef f As List(Of Byte), ByVal bytenum As Integer) + Return f(bytenum + 3) + f(bytenum + 2) * 256 + f(bytenum + 1) * 65536 + f(bytenum) * 16777216 + End Function +End Class + +Public Class Chunk + Public Size As Integer + Public Type As String + Public Data = New List(Of Byte) +End Class \ No newline at end of file diff --git a/p2isPSX_CDToolkit/rleTools.vb b/p2isPSX_CDToolkit/rleTools.vb new file mode 100644 index 0000000..b2fbb48 --- /dev/null +++ b/p2isPSX_CDToolkit/rleTools.vb @@ -0,0 +1,666 @@ +Public Class rleTools + + + + 'This is implementation from ASM of ORIGINAL ATLUS GAME UNRLE PROCEDURE + + 'NEED TO FIX LAST BYTES!!! Fixed! + + Public Function Unrle(ByRef readFile As Byte()) + + Dim newF As List(Of Byte) + newF = New List(Of Byte) + + Dim Overallbytes = Form1.Read32bitNum(readFile, 4) 'Compressed size + Dim readCounter = Form1.Read32bitNum(readFile, 8) 'Uncompressed size + Dim readAddr = 12 + + If readFile(0) = 2 Then readAddr = 16 'if picture + + + Dim mode As Byte + Dim curByte As Byte + Dim params1readCounter As Byte + Dim readOffset As Integer + Dim writeIndex As Integer + Dim params2 As Integer + Dim params18 As Integer + + + Do + + If mode = 0 Then + curByte = readFile(readAddr) + readAddr += 1 + + If (curByte And &H80) = 0 Then + params1readCounter = curByte + 1 + mode = 3 'simple read mode + Else + params1readCounter = curByte - &H7D + mode = 1 'mode 1&2 - read pattern + End If + + Else + readCounter -= 1 + If readCounter = 0 Then Form1.readerror = True : Return newF + End If + + + If mode = 2 Then +LAB_80026700: + writeIndex = newF.Count - 1 + readOffset = writeIndex - params2 + Dim bytesCounter = params1readCounter + Do + If readOffset > newF.Count - 1 Or readOffset < 0 Then 'Can Read empty memory + curByte = 0 + Else + curByte = newF(readOffset) + End If + + readOffset += 1 + bytesCounter -= 1 + newF.Add(curByte) + Loop While bytesCounter <> 0 + + Else + If mode < 3 Then + If mode = 1 Then + mode = 2 + curByte = readFile(readAddr) + readAddr += 1 + readCounter -= 1 + params2 = curByte ' offset + GoTo LAB_80026700 + End If + Else + If mode = 3 Then + If readCounter < params1readCounter Then params1readCounter = readCounter + CopyBytes(readFile, newF, readAddr, params1readCounter) + readCounter -= params1readCounter + readAddr += params1readCounter + End If + End If + + End If + + curByte = params1readCounter + mode = 0 + + If readCounter <= 0 Then Return newF + If readAddr >= Overallbytes Then Return newF + + Loop + + Return newF + + End Function + + + Public Function Unrle2(ByRef readFile As Byte()) + + Dim newF As List(Of Byte) + newF = New List(Of Byte) + + Dim Overallbytes = Form1.Read32bitNum(readFile, 4) 'Compressed size + Dim readOverallCounter = Overallbytes + 'THERE IS NO Uncompressed size??? 'BitConverter.ToInt16(readFile, 12) * BitConverter.ToInt16(readFile, 14) + + Dim readAddr = 12 + If readFile(0) = 2 Then readAddr = 16 'if picture + + Dim mode As Byte + Dim curByte As Byte + Dim params1readRepeatCounter As Byte 'params[1] 80080dc8 - Bytecounter to read + Dim params2 + + + + Do + + If mode = 0 Then + curByte = readFile(readAddr) + readAddr += 1 + + If (curByte And &H80) = 0 Then + params1readRepeatCounter = curByte + 1 + mode = 3 'simple read mode + Else + params1readRepeatCounter = curByte - &H7D 'number of bytes to read + mode = 1 'mode 1 then 2 (and proc) - repeat pattern + End If + + Else + If readAddr >= Overallbytes Then Return newF + + readOverallCounter -= 1 + If readOverallCounter = 0 Then Form1.readerror = True : Return newF + End If + + 'Some Testing for overreading + 'If *params_addr+18h < params1 THEN params1 = params+18h + + 'Orig code: + 'param1 = param[1] + 'mode=param[0] + + If mode = 2 Then +LAB_80026510: + + '/////////////////////////////////////////// PUROCESS PACKET BYTE + '/////////////////////////////////////////// CPU 80022524 + + Dim counter = params1readRepeatCounter + Dim packetByte = params2 + Dim tempByte = packetByte + + Do + newF.Add(tempByte) + counter -= 1 + + Loop While counter <> 0 + + 'DELETED ROUTINE WHATS MAKE 32BIT INTEGER AND FILLS MEMORY BY 4 BYTES STEPS + '/////////////////////////////////////////// '/////////////////////////////////////////// + + + + Else + If mode < 3 Then + If mode = 1 Then + mode = 2 + curByte = readFile(readAddr) + readAddr += 1 + readOverallCounter -= 1 + params2 = curByte ' offset + GoTo LAB_80026510 + End If + Else + If mode = 3 Then + If readOverallCounter < params1readRepeatCounter Then params1readRepeatCounter = readOverallCounter + CopyBytes(readFile, newF, readAddr, params1readRepeatCounter) + readOverallCounter -= params1readRepeatCounter + readAddr += params1readRepeatCounter + End If + End If + + End If + + + mode = 0 + + 'If readOverallCounter <= 0 Then Return newF + If readAddr >= Overallbytes Then Return newF + + Loop + + Return newF + + End Function + + + Private Function ArrayCheck(ByRef bytes() As Byte, ByVal PastByteIndex As Integer, ByVal FutureByteIndex As Integer, ByVal Size As Byte) + For a = 0 To Size - 1 + If PastByteIndex < 0 Or FutureByteIndex + a > UBound(bytes) Then Return -1 + If bytes(PastByteIndex + a) <> bytes(FutureByteIndex + a) Then Return -1 + Next + Return Size + End Function + + + Private Function SaveAccum(ByRef rleFile As List(Of Byte), ByRef accum As List(Of Byte)) + + + If accum.Count > 0 Then 'если что-то есть в аккумуляторе + rleFile.Add(accum.Count - 1) + rleFile.AddRange(accum) + accum.Clear() + End If + + + End Function + + Public Sub CopyBytes(ByRef src As Byte(), ByRef destAddr As List(Of Byte), ByVal readAddr As Integer, ByVal BytesToCopy As Byte) + + Dim srcLen = UBound(src) + If 0 < BytesToCopy Then + Do + If readAddr > srcLen Then MsgBox("ERROR COPYING BYTES IN rleTools.CopyBytes." & vbCrLf & "readAddr: " & readAddr & " Len: " & srcLen) : Exit Do + Dim readedByte = src(readAddr) + + readAddr += 1 + BytesToCopy -= 1 + destAddr.Add(readedByte) + Loop While 0 < BytesToCopy + End If + + + End Sub + + Public Function decodeRLEnew(ByRef filetoRLE As Byte(), ByRef curFile As rleFile) + + Dim start = Microsoft.VisualBasic.DateAndTime.Timer + + + + Dim fil As List(Of Byte) = filetoRLE.ToList + + Dim rleFile = New List(Of Byte) + rleFile.Add(curFile.Type) : rleFile.Add(2) '////////////////TODO: MAKE SELECTABLE COMPRESSION ! + 'Init new RLE with source Type/Compression + rleFile.Add(BitConverter.GetBytes(curFile.ID)(0)) 'Convert ID + rleFile.Add(BitConverter.GetBytes(curFile.ID)(1)) + + Dim uncomprSize = UBound(filetoRLE) + 1 + + 'DEPENDS ON TYPE + Select Case curFile.Type + Case 1 'FOR Type1(Data) - This + rleFile.AddRange({12, 0, 0, 0}) 'Compressed size here! At least 12 (rle, mode, I, D, Comprsize, OverallSize) + Case Else + MsgBox("Unsupported type :( - " & curFile.Type) : Return New List(Of Byte) + End Select + + + + + '////////////////TODO: ADD FILE TYPE 2 - PICTURE WITH X,Y,W,H + '///////////////// THIS BYTES FOR TYPE 0 + rleFile.AddRange(BitConverter.GetBytes(uncomprSize).ToList) 'UNCOMPRESSED SIZE + + + + + Dim accum = New List(Of Byte) + + Dim dict = New List(Of DictElem) + Dim repeatPattern = New List(Of RepeatElem) + MakeDictTree(fil, dict, repeatPattern) 'making tree and pattern + Dim curlvl As Byte + Dim CurDickBranch As DictElem + + Dim indexes = New List(Of indexElem) + + For c = 0 To fil.Count - 1 + + 'If c = 25500 Then SaveAccum(rleFile, accum) : Exit For + + indexes = New List(Of indexElem) + + Dim readed = fil(c) + curlvl = 0 + + + Dim curlevel As List(Of DictElem) = dict + CurDickBranch = curlevel.Find(Function(x) x.Byt = readed) 'checking avialable indexes + + If c < 4 Then GoTo start4 + + + Do + If IsNothing(CurDickBranch) Then Exit Do + If CurDickBranch.Indexes.Count = 1 Then Exit Do + Dim lastIndexes As List(Of Integer) = CurDickBranch.Indexes + Dim filtered = (From s As Integer In lastIndexes 'FILTER INDEXES + Where s < c And s >= c - 256).ToList() + If filtered.Count < 1 Then Exit Do + + For Each i In filtered + indexes.Add(New indexElem With {.len = curlvl, .index = i}) 'making index table + Next + curlvl += 1 + If c + curlvl = fil.Count Then Exit Do + Dim rd = fil(c + curlvl) + + curlevel = CurDickBranch.elems + CurDickBranch = curlevel.Find(Function(x) x.Byt = rd) + Loop + + + + Dim repeat As Byte = 0 + Dim byt As Byte = 0 + + 'Testing Repeating Byte + For Each rep In repeatPattern + + If rep.index < c And c < rep.index + rep.Repeat Then + repeat = rep.index + rep.Repeat - c + + Exit For 'Filtering repeat pattern + End If + Next + + +start4: + + If curlvl < 4 And repeat < 4 Then + If accum.Count = 128 Then SaveAccum(rleFile, accum) + accum.Add(readed) + + + Else + 'repeat pattern is much better than char pattern + If repeat >= curlvl Then + SaveAccum(rleFile, accum) + + rleFile.Add(&H7D + repeat) 'Команда повтора и сколько раз + rleFile.Add(0) 'Повторять со смещением 0 (последний байт) + + c = c + repeat - 1 + + Else + + SaveAccum(rleFile, accum) + indexes.Sort(Function(x, y) x.len.CompareTo(y.len)) + + rleFile.Add(&H7E + indexes.Last.len) + rleFile.Add(c - indexes.Last.index - 1) + c = c + indexes.Last.len + + End If + End If + If c = fil.Count - 1 Then SaveAccum(rleFile, accum) : Exit For + Next + + + + 'My.Computer.FileSystem.WriteAllBytes("D:\Games\PSX\Persona.2.Innocent.Sin\Export\UnRLE\0181_ALL_SCENERY\1112.rle", rleFile.ToArray, False) + Debug.WriteLine(Microsoft.VisualBasic.DateAndTime.Timer - start) + + + + 'Set rle compressed size + rleFile(4) = BitConverter.GetBytes(rleFile.Count)(0) + rleFile(5) = BitConverter.GetBytes(rleFile.Count)(1) + rleFile(6) = BitConverter.GetBytes(rleFile.Count)(2) + rleFile(7) = BitConverter.GetBytes(rleFile.Count)(3) + + 'adding bytes to read MOD4 + Dim addedBytes = rleFile.Count Mod 4 + If addedBytes > 0 Then addedBytes = 4 - addedBytes + For a = 0 To addedBytes - 1 + rleFile.Add(0) + Next + + Return rleFile + + + End Function + + Public Function decodeRLE2images(ByRef filetoRLE As Byte(), ByRef curFile As rleFile) + + Dim start = Microsoft.VisualBasic.DateAndTime.Timer + + Dim fil As List(Of Byte) = filetoRLE.ToList + + Dim rleFile = New List(Of Byte) + rleFile.Add(curFile.Type) : rleFile.Add(1) '////////////////IMAGE COMPRESSION + 'Init new RLE with source Type/Compression + rleFile.Add(BitConverter.GetBytes(curFile.ID)(0)) 'Convert ID + rleFile.Add(BitConverter.GetBytes(curFile.ID)(1)) + + 'DEPENDS ON TYPE + Select Case curFile.Type + Case 2 'FOR Type2(Image) - This + rleFile.AddRange({12, 0, 0, 0}) 'Compressed size here! At least 12 (rle, mode, I, D, Comprsize, OverallSize) + Case Else + MsgBox("Unsupported type :( - " & curFile.Type) : Return New List(Of Byte) + End Select + For a = 8 To 15 : rleFile.Add(curFile.Bytes(a)) : Next a 'Copying image params x,y,h,w + + Dim repeatPattern = New List(Of RepeatElem) + MakeRepeatPattern(fil, repeatPattern) + Dim accum = New List(Of Byte) + For c = 0 To fil.Count - 1 + Dim readed = fil(c) + Dim repeat As Byte = 0 + Dim byt As Byte = 0 + + 'Testing Repeating Byte + For Each rep In repeatPattern + If rep.index = c Then + repeat = rep.Repeat + Exit For 'Filtering repeat pattern + End If + Next + If repeat < 2 Then + If accum.Count = 126 Then SaveAccum(rleFile, accum) + accum.Add(readed) + Else + SaveAccum(rleFile, accum) + + rleFile.Add(&H7D + repeat) 'Команда повтора и сколько раз + rleFile.Add(readed) 'Повторять байт + c = c + repeat - 1 'Shifting For + End If + + If c = fil.Count - 1 Then + SaveAccum(rleFile, accum) + End If + + Next + + Debug.WriteLine((Microsoft.VisualBasic.DateAndTime.Timer - start) & " - " & rleFile.Count & " bytes") + + 'Set rle compressed size + rleFile(4) = BitConverter.GetBytes(rleFile.Count)(0) + rleFile(5) = BitConverter.GetBytes(rleFile.Count)(1) + rleFile(6) = BitConverter.GetBytes(rleFile.Count)(2) + rleFile(7) = BitConverter.GetBytes(rleFile.Count)(3) + + 'adding bytes to read MOD4 + Dim addedBytes = rleFile.Count Mod 4 + If addedBytes > 0 Then addedBytes = 4 - addedBytes + For a = 0 To addedBytes - 1 + rleFile.Add(0) + Next + + Return rleFile + + + End Function + Public Function MakeUncompressedImage(ByRef filetoRLE As Byte(), ByRef curFile As rleFile) + + Dim fil As List(Of Byte) = filetoRLE.ToList + + Dim rleFile = New List(Of Byte) + rleFile.Add(2) : rleFile.Add(0) '////////////////TYPE: IMAGE / COMPRESSION - NONE + 'Init new image + rleFile.Add(BitConverter.GetBytes(curFile.ID)(0)) 'Convert ID + rleFile.Add(BitConverter.GetBytes(curFile.ID)(1)) + + 'DEPENDS ON TYPE + + rleFile.AddRange({12, 0, 0, 0}) 'Uncompressed Size here! At least 12 (rle, mode, I, D, Comprsize, OverallSize) + For a = 8 To 15 : rleFile.Add(curFile.Bytes(a)) : Next a 'Copying image params x,y,h,w + + rleFile.AddRange(fil) 'Add uncomressed Data + + 'Set file size in header + rleFile(4) = BitConverter.GetBytes(rleFile.Count)(0) + rleFile(5) = BitConverter.GetBytes(rleFile.Count)(1) + rleFile(6) = BitConverter.GetBytes(rleFile.Count)(2) + rleFile(7) = BitConverter.GetBytes(rleFile.Count)(3) + + 'adding bytes to read MOD4 + Dim addedBytes = rleFile.Count Mod 4 + If addedBytes > 0 Then addedBytes = 4 - addedBytes + For a = 0 To addedBytes - 1 + rleFile.Add(0) + Next + + Return rleFile + + End Function + + + Public Function GetBranch(ByRef CurDickBranch As DictElem, ByRef fil As List(Of Byte), ByRef c As Integer, ByRef curLevel As Integer) + + Dim rd = fil(c + curLevel) + Dim NextBranch As DictElem = CurDickBranch.elems.Find(Function(x) x.Byt = rd) + + Dim lastIndexes As List(Of Integer) = CurDickBranch.Indexes + + If NextBranch.Indexes > 1 Then + curLevel += 1 + GetBranch(NextBranch, fil, c, curLevel) + + Else + Return lastIndexes + + End If + + + End Function + + + Public Sub MakeDictTree(ByRef fil As List(Of Byte), ByRef dict As List(Of DictElem), ByRef repeatPattern As List(Of RepeatElem)) + + + + + Dim tempRepeatByte As Byte + Dim tempRepeatCounter As Integer + Dim tempIndex As Integer + Dim curByte As Integer + Dim chk As DictElem + 'MAKING BYTE TREE!!! + For b = 0 To fil.Count - 1 + Dim curlevel As List(Of DictElem) = dict + Dim LvlNum As Byte = 1 + Dim max = 130 'maximum window + If fil.Count - b < max Then max = fil.Count - b 'if end of file - decrease window to end of file + For wind = 0 To max - 1 + curByte = fil(b + wind) + chk = curlevel.Find(Function(x) x.Byt = curByte) + If IsNothing(chk) Then + Dim newElem = New DictElem With {.Byt = curByte, .Indexes = New List(Of Integer) From {b}} + curlevel.Add(newElem) + curlevel = curlevel.Last.elems + Else + chk.Indexes.add(b) + chk.lvl = LvlNum + curlevel = chk.elems + End If + Next + + 'REPEATPATTERN CHECK + If tempRepeatByte = fil(b) And tempRepeatCounter <= 130 Then + tempRepeatCounter += 1 + Else + If tempRepeatCounter > 3 Then repeatPattern.Add(New RepeatElem With {.Byt = tempRepeatByte, .index = tempIndex, .Repeat = tempRepeatCounter}) + tempIndex = b + tempRepeatCounter = 1 + tempRepeatByte = fil(b) + + End If + Next + dict.Sort(Function(x, y) x.Byt.CompareTo(y.Byt)) + repeatPattern.Sort(Function(x, y) x.Repeat.CompareTo(y.Repeat)) 'Need to check inbeetween + Dim curdict = dict + +refr: + + 'For Each a In curdict + ' If a.Indexes.count < 3 Then curdict.Remove(a) : GoTo refr + 'Next + + + + + + + End Sub + + + + + Public Sub MakeRepeatPattern(ByRef fil As List(Of Byte), ByRef repeatPattern As List(Of RepeatElem)) + Dim tempRepeatByte As Byte + Dim tempRepeatCounter As Integer + Dim curByte As Byte + Dim tempIndex As Integer + + For b = 0 To fil.Count - 1 + + + If tempRepeatByte = fil(b) And tempRepeatCounter < 130 Then + tempRepeatCounter += 1 + Else + + If tempRepeatCounter > 3 Then repeatPattern.Add(New RepeatElem With {.Byt = tempRepeatByte, .index = tempIndex, .Repeat = tempRepeatCounter}) + tempIndex = b + tempRepeatCounter = 1 + tempRepeatByte = fil(b) + + End If + + 'If its last byte + If tempRepeatByte = fil(b) And tempRepeatCounter < 130 And b = fil.Count - 1 Then + repeatPattern.Add(New RepeatElem With {.Byt = tempRepeatByte, .index = tempIndex, .Repeat = tempRepeatCounter}) + End If + + + + Next + repeatPattern.Sort(Function(x, y) x.index.CompareTo(y.index)) + End Sub + + + Public Function UnrleNocompr(ByRef readFile As Byte()) + + + Dim newF = New List(Of Byte) + + Dim Overallbytes = Form1.Read32bitNum(readFile, 4) 'Compressed size + If readFile(0) = 2 Then + For a = 16 To Overallbytes - 1 'If uncompressed image (CLUT etc.) + newF.Add(readFile(a)) + Next + Else + For a = 8 To Overallbytes - 1 + newF.Add(readFile(a)) + Next + End If + + + Return newF + End Function + + + + +End Class + +Public Class indexElem + + Public index As Integer + Public len As Byte + +End Class + +Public Class RepeatElem + + Public Byt As Byte + Public Repeat As Byte + Public index As Integer + +End Class + + +Public Class DictElem + Public Byt As Byte + Public lvl As Byte + Public Indexes = New List(Of Integer) + Public elems = New List(Of DictElem) +End Class + +Public Class RepeatObject + Public SrcIndex + Public Offset + Public DstIndex + Public Bytes As List(Of Byte) + Public NumOfRepeat +End Class \ No newline at end of file diff --git a/packages/LibPngPort.0.3.1/.signature.p7s b/packages/LibPngPort.0.3.1/.signature.p7s new file mode 100644 index 0000000..5e940e1 Binary files /dev/null and b/packages/LibPngPort.0.3.1/.signature.p7s differ diff --git a/packages/LibPngPort.0.3.1/LibPngPort.0.3.1.nupkg b/packages/LibPngPort.0.3.1/LibPngPort.0.3.1.nupkg new file mode 100644 index 0000000..c46c5c1 Binary files /dev/null and b/packages/LibPngPort.0.3.1/LibPngPort.0.3.1.nupkg differ diff --git a/packages/LibPngPort.0.3.1/lib/net45/Free.Ports.libpng.dll b/packages/LibPngPort.0.3.1/lib/net45/Free.Ports.libpng.dll new file mode 100644 index 0000000..0039e7d Binary files /dev/null and b/packages/LibPngPort.0.3.1/lib/net45/Free.Ports.libpng.dll differ diff --git a/packages/LibPngPort.0.3.1/lib/net45/Free.Ports.libpng.xml b/packages/LibPngPort.0.3.1/lib/net45/Free.Ports.libpng.xml new file mode 100644 index 0000000..f09521b --- /dev/null +++ b/packages/LibPngPort.0.3.1/lib/net45/Free.Ports.libpng.xml @@ -0,0 +1,8 @@ + + + + Free.Ports.libpng + + + + diff --git a/packages/LibPngPort.0.3.1/lib/net45/Free.Ports.zLib.dll b/packages/LibPngPort.0.3.1/lib/net45/Free.Ports.zLib.dll new file mode 100644 index 0000000..6f9ea51 Binary files /dev/null and b/packages/LibPngPort.0.3.1/lib/net45/Free.Ports.zLib.dll differ diff --git a/packages/LibPngPort.0.3.1/lib/net45/Free.Ports.zLib.xml b/packages/LibPngPort.0.3.1/lib/net45/Free.Ports.zLib.xml new file mode 100644 index 0000000..a56b7fc --- /dev/null +++ b/packages/LibPngPort.0.3.1/lib/net45/Free.Ports.zLib.xml @@ -0,0 +1,8 @@ + + + + Free.Ports.zLib + + + + diff --git a/packages/Zlib.Portable.Signed.1.11.0/.signature.p7s b/packages/Zlib.Portable.Signed.1.11.0/.signature.p7s new file mode 100644 index 0000000..6e147ed Binary files /dev/null and b/packages/Zlib.Portable.Signed.1.11.0/.signature.p7s differ diff --git a/packages/Zlib.Portable.Signed.1.11.0/Zlib.Portable.Signed.1.11.0.nupkg b/packages/Zlib.Portable.Signed.1.11.0/Zlib.Portable.Signed.1.11.0.nupkg new file mode 100644 index 0000000..3427754 Binary files /dev/null and b/packages/Zlib.Portable.Signed.1.11.0/Zlib.Portable.Signed.1.11.0.nupkg differ diff --git a/packages/Zlib.Portable.Signed.1.11.0/lib/portable-net4+sl5+wp8+win8+wpa81+MonoTouch+MonoAndroid/Zlib.Portable.dll b/packages/Zlib.Portable.Signed.1.11.0/lib/portable-net4+sl5+wp8+win8+wpa81+MonoTouch+MonoAndroid/Zlib.Portable.dll new file mode 100644 index 0000000..bb685c3 Binary files /dev/null and b/packages/Zlib.Portable.Signed.1.11.0/lib/portable-net4+sl5+wp8+win8+wpa81+MonoTouch+MonoAndroid/Zlib.Portable.dll differ diff --git a/packages/Zlib.Portable.Signed.1.11.0/lib/portable-net4+sl5+wp8+win8+wpa81+MonoTouch+MonoAndroid/Zlib.Portable.xml b/packages/Zlib.Portable.Signed.1.11.0/lib/portable-net4+sl5+wp8+win8+wpa81+MonoTouch+MonoAndroid/Zlib.Portable.xml new file mode 100644 index 0000000..c833149 --- /dev/null +++ b/packages/Zlib.Portable.Signed.1.11.0/lib/portable-net4+sl5+wp8+win8+wpa81+MonoTouch+MonoAndroid/Zlib.Portable.xml @@ -0,0 +1,3430 @@ + + + + Zlib.Portable + + + + + Computes a CRC-32. The CRC-32 algorithm is parameterized - you + can set the polynomial and enable or disable bit + reversal. This can be used for GZIP, BZip2, or ZIP. + + + This type is used internally by DotNetZip; it is generally not used + directly by applications wishing to create, read, or manipulate zip + archive files. + + + + + Indicates the total number of bytes applied to the CRC. + + + + + Indicates the current CRC for all blocks slurped in. + + + + + Returns the CRC32 for the specified stream. + + The stream over which to calculate the CRC32 + the CRC32 calculation + + + + Returns the CRC32 for the specified stream, and writes the input into the + output stream. + + The stream over which to calculate the CRC32 + The stream into which to deflate the input + the CRC32 calculation + + + + Get the CRC32 for the given (word,byte) combo. This is a + computation defined by PKzip for PKZIP 2.0 (weak) encryption. + + The word to start with. + The byte to combine it with. + The CRC-ized result. + + + + Update the value for the running CRC32 using the given block of bytes. + This is useful when using the CRC32() class in a Stream. + + block of bytes to slurp + starting point in the block + how many bytes within the block to slurp + + + + Process one byte in the CRC. + + the byte to include into the CRC . + + + + Process a run of N identical bytes into the CRC. + + + + This method serves as an optimization for updating the CRC when a + run of identical bytes is found. Rather than passing in a buffer of + length n, containing all identical bytes b, this method accepts the + byte value and the length of the (virtual) buffer - the length of + the run. + + + the byte to include into the CRC. + the number of times that byte should be repeated. + + + + Combines the given CRC32 value with the current running total. + + + This is useful when using a divide-and-conquer approach to + calculating a CRC. Multiple threads can each calculate a + CRC32 on a segment of the data, and then combine the + individual CRC32 values at the end. + + the crc value to be combined with this one + the length of data the CRC value was calculated on + + + + Create an instance of the CRC32 class using the default settings: no + bit reversal, and a polynomial of 0xEDB88320. + + + + + Create an instance of the CRC32 class, specifying whether to reverse + data bits or not. + + + specify true if the instance should reverse data bits. + + + + In the CRC-32 used by BZip2, the bits are reversed. Therefore if you + want a CRC32 with compatibility with BZip2, you should pass true + here. In the CRC-32 used by GZIP and PKZIP, the bits are not + reversed; Therefore if you want a CRC32 with compatibility with + those, you should pass false. + + + + + + Create an instance of the CRC32 class, specifying the polynomial and + whether to reverse data bits or not. + + + The polynomial to use for the CRC, expressed in the reversed (LSB) + format: the highest ordered bit in the polynomial value is the + coefficient of the 0th power; the second-highest order bit is the + coefficient of the 1 power, and so on. Expressed this way, the + polynomial for the CRC-32C used in IEEE 802.3, is 0xEDB88320. + + + specify true if the instance should reverse data bits. + + + + + In the CRC-32 used by BZip2, the bits are reversed. Therefore if you + want a CRC32 with compatibility with BZip2, you should pass true + here for the reverseBits parameter. In the CRC-32 used by + GZIP and PKZIP, the bits are not reversed; Therefore if you want a + CRC32 with compatibility with those, you should pass false for the + reverseBits parameter. + + + + + + Reset the CRC-32 class - clear the CRC "remainder register." + + + + Use this when employing a single instance of this class to compute + multiple, distinct CRCs on multiple, distinct data blocks. + + + + + + A Stream that calculates a CRC32 (a checksum) on all bytes read, + or on all bytes written. + + + + + This class can be used to verify the CRC of a ZipEntry when + reading from a stream, or to calculate a CRC when writing to a + stream. The stream should be used to either read, or write, but + not both. If you intermix reads and writes, the results are not + defined. + + + + This class is intended primarily for use internally by the + DotNetZip library. + + + + + + The default constructor. + + + + Instances returned from this constructor will leave the underlying + stream open upon Close(). The stream uses the default CRC32 + algorithm, which implies a polynomial of 0xEDB88320. + + + The underlying stream + + + + The constructor allows the caller to specify how to handle the + underlying stream at close. + + + + The stream uses the default CRC32 algorithm, which implies a + polynomial of 0xEDB88320. + + + The underlying stream + true to leave the underlying stream + open upon close of the CrcCalculatorStream; false otherwise. + + + + A constructor allowing the specification of the length of the stream + to read. + + + + The stream uses the default CRC32 algorithm, which implies a + polynomial of 0xEDB88320. + + + Instances returned from this constructor will leave the underlying + stream open upon Close(). + + + The underlying stream + The length of the stream to slurp + + + + A constructor allowing the specification of the length of the stream + to read, as well as whether to keep the underlying stream open upon + Close(). + + + + The stream uses the default CRC32 algorithm, which implies a + polynomial of 0xEDB88320. + + + The underlying stream + The length of the stream to slurp + true to leave the underlying stream + open upon close of the CrcCalculatorStream; false otherwise. + + + + A constructor allowing the specification of the length of the stream + to read, as well as whether to keep the underlying stream open upon + Close(), and the CRC32 instance to use. + + + + The stream uses the specified CRC32 instance, which allows the + application to specify how the CRC gets calculated. + + + The underlying stream + The length of the stream to slurp + true to leave the underlying stream + open upon close of the CrcCalculatorStream; false otherwise. + the CRC32 instance to use to calculate the CRC32 + + + + Gets the total number of bytes run through the CRC32 calculator. + + + + This is either the total number of bytes read, or the total number of + bytes written, depending on the direction of this stream. + + + + + Provides the current CRC for all blocks slurped in. + + + + The running total of the CRC is kept as data is written or read + through the stream. read this property after all reads or writes to + get an accurate CRC for the entire stream. + + + + + + Indicates whether the underlying stream will be left open when the + CrcCalculatorStream is Closed. + + + + Set this at any point before calling . + + + + + + Read from the stream + + the buffer to read + the offset at which to start + the number of bytes to read + the number of bytes actually read + + + + Write to the stream. + + the buffer from which to write + the offset at which to start writing + the number of bytes to write + + + + Indicates whether the stream supports reading. + + + + + Indicates whether the stream supports seeking. + + + + Always returns false. + + + + + + Indicates whether the stream supports writing. + + + + + Flush the stream. + + + + + Returns the length of the underlying stream. + + + + + The getter for this property returns the total bytes read. + If you use the setter, it will throw + . + + + + + Seeking is not supported on this stream. This method always throws + + + N/A + N/A + N/A + + + + This method always throws + + + N/A + + + + A class for compressing and decompressing streams using the Deflate algorithm. + + + + + + The DeflateStream is a Decorator on a . It adds DEFLATE compression or decompression to any + stream. + + + + Using this stream, applications can compress or decompress data via stream + Read and Write operations. Either compresssion or decompression + can occur through either reading or writing. The compression format used is + DEFLATE, which is documented in IETF RFC 1951, "DEFLATE + Compressed Data Format Specification version 1.3.". + + + + This class is similar to , except that + ZlibStream adds the RFC + 1950 - ZLIB framing bytes to a compressed stream when compressing, or + expects the RFC1950 framing bytes when decompressing. The DeflateStream + does not. + + + + + + + + + + Create a DeflateStream using the specified CompressionMode. + + + + When mode is CompressionMode.Compress, the DeflateStream will use + the default compression level. The "captive" stream will be closed when + the DeflateStream is closed. + + + + This example uses a DeflateStream to compress data from a file, and writes + the compressed data to another file. + + using (System.IO.Stream input = System.IO.File.OpenRead(fileToCompress)) + { + using (var raw = System.IO.File.Create(fileToCompress + ".deflated")) + { + using (Stream compressor = new DeflateStream(raw, CompressionMode.Compress)) + { + byte[] buffer = new byte[WORKING_BUFFER_SIZE]; + int n; + while ((n= input.Read(buffer, 0, buffer.Length)) != 0) + { + compressor.Write(buffer, 0, n); + } + } + } + } + + + + Using input As Stream = File.OpenRead(fileToCompress) + Using raw As FileStream = File.Create(fileToCompress & ".deflated") + Using compressor As Stream = New DeflateStream(raw, CompressionMode.Compress) + Dim buffer As Byte() = New Byte(4096) {} + Dim n As Integer = -1 + Do While (n <> 0) + If (n > 0) Then + compressor.Write(buffer, 0, n) + End If + n = input.Read(buffer, 0, buffer.Length) + Loop + End Using + End Using + End Using + + + The stream which will be read or written. + Indicates whether the DeflateStream will compress or decompress. + + + + Create a DeflateStream using the specified CompressionMode and the specified CompressionLevel. + + + + + + When mode is CompressionMode.Decompress, the level parameter is + ignored. The "captive" stream will be closed when the DeflateStream is + closed. + + + + + + + This example uses a DeflateStream to compress data from a file, and writes + the compressed data to another file. + + + using (System.IO.Stream input = System.IO.File.OpenRead(fileToCompress)) + { + using (var raw = System.IO.File.Create(fileToCompress + ".deflated")) + { + using (Stream compressor = new DeflateStream(raw, + CompressionMode.Compress, + CompressionLevel.BestCompression)) + { + byte[] buffer = new byte[WORKING_BUFFER_SIZE]; + int n= -1; + while (n != 0) + { + if (n > 0) + compressor.Write(buffer, 0, n); + n= input.Read(buffer, 0, buffer.Length); + } + } + } + } + + + + Using input As Stream = File.OpenRead(fileToCompress) + Using raw As FileStream = File.Create(fileToCompress & ".deflated") + Using compressor As Stream = New DeflateStream(raw, CompressionMode.Compress, CompressionLevel.BestCompression) + Dim buffer As Byte() = New Byte(4096) {} + Dim n As Integer = -1 + Do While (n <> 0) + If (n > 0) Then + compressor.Write(buffer, 0, n) + End If + n = input.Read(buffer, 0, buffer.Length) + Loop + End Using + End Using + End Using + + + The stream to be read or written while deflating or inflating. + Indicates whether the DeflateStream will compress or decompress. + A tuning knob to trade speed for effectiveness. + + + + Create a DeflateStream using the specified + CompressionMode, and explicitly specify whether the + stream should be left open after Deflation or Inflation. + + + + + + This constructor allows the application to request that the captive stream + remain open after the deflation or inflation occurs. By default, after + Close() is called on the stream, the captive stream is also + closed. In some cases this is not desired, for example if the stream is a + memory stream that will be re-read after compression. Specify true for + the parameter to leave the stream open. + + + + The DeflateStream will use the default compression level. + + + + See the other overloads of this constructor for example code. + + + + + The stream which will be read or written. This is called the + "captive" stream in other places in this documentation. + + + + Indicates whether the DeflateStream will compress or decompress. + + + true if the application would like the stream to + remain open after inflation/deflation. + + + + Create a DeflateStream using the specified CompressionMode + and the specified CompressionLevel, and explicitly specify whether + the stream should be left open after Deflation or Inflation. + + + + + + When mode is CompressionMode.Decompress, the level parameter is ignored. + + + + This constructor allows the application to request that the captive stream + remain open after the deflation or inflation occurs. By default, after + Close() is called on the stream, the captive stream is also + closed. In some cases this is not desired, for example if the stream is a + that will be re-read after + compression. Specify true for the parameter + to leave the stream open. + + + + + + + This example shows how to use a DeflateStream to compress data from + a file, and store the compressed data into another file. + + + using (var output = System.IO.File.Create(fileToCompress + ".deflated")) + { + using (System.IO.Stream input = System.IO.File.OpenRead(fileToCompress)) + { + using (Stream compressor = new DeflateStream(output, CompressionMode.Compress, CompressionLevel.BestCompression, true)) + { + byte[] buffer = new byte[WORKING_BUFFER_SIZE]; + int n= -1; + while (n != 0) + { + if (n > 0) + compressor.Write(buffer, 0, n); + n= input.Read(buffer, 0, buffer.Length); + } + } + } + // can write additional data to the output stream here + } + + + + Using output As FileStream = File.Create(fileToCompress & ".deflated") + Using input As Stream = File.OpenRead(fileToCompress) + Using compressor As Stream = New DeflateStream(output, CompressionMode.Compress, CompressionLevel.BestCompression, True) + Dim buffer As Byte() = New Byte(4096) {} + Dim n As Integer = -1 + Do While (n <> 0) + If (n > 0) Then + compressor.Write(buffer, 0, n) + End If + n = input.Read(buffer, 0, buffer.Length) + Loop + End Using + End Using + ' can write additional data to the output stream here. + End Using + + + The stream which will be read or written. + Indicates whether the DeflateStream will compress or decompress. + true if the application would like the stream to remain open after inflation/deflation. + A tuning knob to trade speed for effectiveness. + + + + This property sets the flush behavior on the stream. + + See the ZLIB documentation for the meaning of the flush behavior. + + + + + The size of the working buffer for the compression codec. + + + + + The working buffer is used for all stream operations. The default size is + 1024 bytes. The minimum size is 128 bytes. You may get better performance + with a larger buffer. Then again, you might not. You would have to test + it. + + + + Set this before the first call to Read() or Write() on the + stream. If you try to set it afterwards, it will throw. + + + + + + The ZLIB strategy to be used during compression. + + + + By tweaking this parameter, you may be able to optimize the compression for + data with particular characteristics. + + + + Returns the total number of bytes input so far. + + + Returns the total number of bytes output so far. + + + + Dispose the stream. + + + + This may or may not result in a Close() call on the captive + stream. See the constructors that have a leaveOpen parameter + for more information. + + + Application code won't call this code directly. This method may be + invoked in two distinct scenarios. If disposing == true, the method + has been called directly or indirectly by a user's code, for example + via the public Dispose() method. In this case, both managed and + unmanaged resources can be referenced and disposed. If disposing == + false, the method has been called by the runtime from inside the + object finalizer and this method should not reference other objects; + in that case only unmanaged resources must be referenced or + disposed. + + + + true if the Dispose method was invoked by user code. + + + + + Indicates whether the stream can be read. + + + The return value depends on whether the captive stream supports reading. + + + + + Indicates whether the stream supports Seek operations. + + + Always returns false. + + + + + Indicates whether the stream can be written. + + + The return value depends on whether the captive stream supports writing. + + + + + Flush the stream. + + + + + Reading this property always throws a . + + + + + The position of the stream pointer. + + + + Setting this property always throws a . Reading will return the total bytes + written out, if used in writing, or the total bytes read in, if used in + reading. The count may refer to compressed bytes or uncompressed bytes, + depending on how you've used the stream. + + + + + Read data from the stream. + + + + + If you wish to use the DeflateStream to compress data while + reading, you can create a DeflateStream with + CompressionMode.Compress, providing an uncompressed data stream. + Then call Read() on that DeflateStream, and the data read will be + compressed as you read. If you wish to use the DeflateStream to + decompress data while reading, you can create a DeflateStream with + CompressionMode.Decompress, providing a readable compressed data + stream. Then call Read() on that DeflateStream, and the data read + will be decompressed as you read. + + + + A DeflateStream can be used for Read() or Write(), but not both. + + + + The buffer into which the read data should be placed. + the offset within that data array to put the first byte read. + the number of bytes to read. + the number of bytes actually read + + + + Calling this method always throws a . + + this is irrelevant, since it will always throw! + this is irrelevant, since it will always throw! + irrelevant! + + + + Calling this method always throws a . + + this is irrelevant, since it will always throw! + + + + Write data to the stream. + + + + + If you wish to use the DeflateStream to compress data while + writing, you can create a DeflateStream with + CompressionMode.Compress, and a writable output stream. Then call + Write() on that DeflateStream, providing uncompressed data + as input. The data sent to the output stream will be the compressed form + of the data written. If you wish to use the DeflateStream to + decompress data while writing, you can create a DeflateStream with + CompressionMode.Decompress, and a writable output stream. Then + call Write() on that stream, providing previously compressed + data. The data sent to the output stream will be the decompressed form of + the data written. + + + + A DeflateStream can be used for Read() or Write(), + but not both. + + + + + The buffer holding data to write to the stream. + the offset within that data array to find the first byte to write. + the number of bytes to write. + + + + Compress a string into a byte array using DEFLATE (RFC 1951). + + + + Uncompress it with . + + + DeflateStream.UncompressString(byte[]) + DeflateStream.CompressBuffer(byte[]) + GZipStream.CompressString(string) + ZlibStream.CompressString(string) + + + A string to compress. The string will first be encoded + using UTF8, then compressed. + + + The string in compressed form + + + + Compress a byte array into a new byte array using DEFLATE. + + + + Uncompress it with . + + + DeflateStream.CompressString(string) + DeflateStream.UncompressBuffer(byte[]) + GZipStream.CompressBuffer(byte[]) + ZlibStream.CompressBuffer(byte[]) + + + A buffer to compress. + + + The data in compressed form + + + + Uncompress a DEFLATE'd byte array into a single string. + + + DeflateStream.CompressString(String) + DeflateStream.UncompressBuffer(byte[]) + GZipStream.UncompressString(byte[]) + ZlibStream.UncompressString(byte[]) + + + A buffer containing DEFLATE-compressed data. + + + The uncompressed string + + + + Uncompress a DEFLATE'd byte array into a byte array. + + + DeflateStream.CompressBuffer(byte[]) + DeflateStream.UncompressString(byte[]) + GZipStream.UncompressBuffer(byte[]) + ZlibStream.UncompressBuffer(byte[]) + + + A buffer containing data that has been compressed with DEFLATE. + + + The data in uncompressed form + + + + A class for compressing and decompressing GZIP streams. + + + + + The GZipStream is a Decorator on a + . It adds GZIP compression or decompression to any + stream. + + + + Like the System.IO.Compression.GZipStream in the .NET Base Class Library, the + Ionic.Zlib.GZipStream can compress while writing, or decompress while + reading, but not vice versa. The compression method used is GZIP, which is + documented in IETF RFC + 1952, "GZIP file format specification version 4.3". + + + A GZipStream can be used to decompress data (through Read()) or + to compress data (through Write()), but not both. + + + + If you wish to use the GZipStream to compress data, you must wrap it + around a write-able stream. As you call Write() on the GZipStream, the + data will be compressed into the GZIP format. If you want to decompress data, + you must wrap the GZipStream around a readable stream that contains an + IETF RFC 1952-compliant stream. The data will be decompressed as you call + Read() on the GZipStream. + + + + Though the GZIP format allows data from multiple files to be concatenated + together, this stream handles only a single segment of GZIP format, typically + representing a single file. + + + + This class is similar to and . + ZlibStream handles RFC1950-compliant streams. + handles RFC1951-compliant streams. This class handles RFC1952-compliant streams. + + + + + + + + + + The comment on the GZIP stream. + + + + + The GZIP format allows for each file to optionally have an associated + comment stored with the file. The comment is encoded with the ISO-8859-1 + code page. To include a comment in a GZIP stream you create, set this + property before calling Write() for the first time on the + GZipStream. + + + + When using GZipStream to decompress, you can retrieve this property + after the first call to Read(). If no comment has been set in the + GZIP bytestream, the Comment property will return null + (Nothing in VB). + + + + + + The FileName for the GZIP stream. + + + + + + The GZIP format optionally allows each file to have an associated + filename. When compressing data (through Write()), set this + FileName before calling Write() the first time on the GZipStream. + The actual filename is encoded into the GZIP bytestream with the + ISO-8859-1 code page, according to RFC 1952. It is the application's + responsibility to insure that the FileName can be encoded and decoded + correctly with this code page. + + + + When decompressing (through Read()), you can retrieve this value + any time after the first Read(). In the case where there was no filename + encoded into the GZIP bytestream, the property will return null (Nothing + in VB). + + + + + + The last modified time for the GZIP stream. + + + + GZIP allows the storage of a last modified time with each GZIP entry. + When compressing data, you can set this before the first call to + Write(). When decompressing, you can retrieve this value any time + after the first call to Read(). + + + + + The CRC on the GZIP stream. + + + This is used for internal error checking. You probably don't need to look at this property. + + + + + Create a GZipStream using the specified CompressionMode. + + + + + When mode is CompressionMode.Compress, the GZipStream will use the + default compression level. + + + + As noted in the class documentation, the CompressionMode (Compress + or Decompress) also establishes the "direction" of the stream. A + GZipStream with CompressionMode.Compress works only through + Write(). A GZipStream with + CompressionMode.Decompress works only through Read(). + + + + + + This example shows how to use a GZipStream to compress data. + + using (System.IO.Stream input = System.IO.File.OpenRead(fileToCompress)) + { + using (var raw = System.IO.File.Create(outputFile)) + { + using (Stream compressor = new GZipStream(raw, CompressionMode.Compress)) + { + byte[] buffer = new byte[WORKING_BUFFER_SIZE]; + int n; + while ((n= input.Read(buffer, 0, buffer.Length)) != 0) + { + compressor.Write(buffer, 0, n); + } + } + } + } + + + Dim outputFile As String = (fileToCompress & ".compressed") + Using input As Stream = File.OpenRead(fileToCompress) + Using raw As FileStream = File.Create(outputFile) + Using compressor As Stream = New GZipStream(raw, CompressionMode.Compress) + Dim buffer As Byte() = New Byte(4096) {} + Dim n As Integer = -1 + Do While (n <> 0) + If (n > 0) Then + compressor.Write(buffer, 0, n) + End If + n = input.Read(buffer, 0, buffer.Length) + Loop + End Using + End Using + End Using + + + + + This example shows how to use a GZipStream to uncompress a file. + + private void GunZipFile(string filename) + { + if (!filename.EndsWith(".gz)) + throw new ArgumentException("filename"); + var DecompressedFile = filename.Substring(0,filename.Length-3); + byte[] working = new byte[WORKING_BUFFER_SIZE]; + int n= 1; + using (System.IO.Stream input = System.IO.File.OpenRead(filename)) + { + using (Stream decompressor= new Ionic.Zlib.GZipStream(input, CompressionMode.Decompress, true)) + { + using (var output = System.IO.File.Create(DecompressedFile)) + { + while (n !=0) + { + n= decompressor.Read(working, 0, working.Length); + if (n > 0) + { + output.Write(working, 0, n); + } + } + } + } + } + } + + + + Private Sub GunZipFile(ByVal filename as String) + If Not (filename.EndsWith(".gz)) Then + Throw New ArgumentException("filename") + End If + Dim DecompressedFile as String = filename.Substring(0,filename.Length-3) + Dim working(WORKING_BUFFER_SIZE) as Byte + Dim n As Integer = 1 + Using input As Stream = File.OpenRead(filename) + Using decompressor As Stream = new Ionic.Zlib.GZipStream(input, CompressionMode.Decompress, True) + Using output As Stream = File.Create(UncompressedFile) + Do + n= decompressor.Read(working, 0, working.Length) + If n > 0 Then + output.Write(working, 0, n) + End IF + Loop While (n > 0) + End Using + End Using + End Using + End Sub + + + + The stream which will be read or written. + Indicates whether the GZipStream will compress or decompress. + + + + Create a GZipStream using the specified CompressionMode and + the specified CompressionLevel. + + + + + The CompressionMode (Compress or Decompress) also establishes the + "direction" of the stream. A GZipStream with + CompressionMode.Compress works only through Write(). A + GZipStream with CompressionMode.Decompress works only + through Read(). + + + + + + + This example shows how to use a GZipStream to compress a file into a .gz file. + + + using (System.IO.Stream input = System.IO.File.OpenRead(fileToCompress)) + { + using (var raw = System.IO.File.Create(fileToCompress + ".gz")) + { + using (Stream compressor = new GZipStream(raw, + CompressionMode.Compress, + CompressionLevel.BestCompression)) + { + byte[] buffer = new byte[WORKING_BUFFER_SIZE]; + int n; + while ((n= input.Read(buffer, 0, buffer.Length)) != 0) + { + compressor.Write(buffer, 0, n); + } + } + } + } + + + + Using input As Stream = File.OpenRead(fileToCompress) + Using raw As FileStream = File.Create(fileToCompress & ".gz") + Using compressor As Stream = New GZipStream(raw, CompressionMode.Compress, CompressionLevel.BestCompression) + Dim buffer As Byte() = New Byte(4096) {} + Dim n As Integer = -1 + Do While (n <> 0) + If (n > 0) Then + compressor.Write(buffer, 0, n) + End If + n = input.Read(buffer, 0, buffer.Length) + Loop + End Using + End Using + End Using + + + The stream to be read or written while deflating or inflating. + Indicates whether the GZipStream will compress or decompress. + A tuning knob to trade speed for effectiveness. + + + + Create a GZipStream using the specified CompressionMode, and + explicitly specify whether the stream should be left open after Deflation + or Inflation. + + + + + This constructor allows the application to request that the captive stream + remain open after the deflation or inflation occurs. By default, after + Close() is called on the stream, the captive stream is also + closed. In some cases this is not desired, for example if the stream is a + memory stream that will be re-read after compressed data has been written + to it. Specify true for the parameter to leave + the stream open. + + + + The (Compress or Decompress) also + establishes the "direction" of the stream. A GZipStream with + CompressionMode.Compress works only through Write(). A GZipStream + with CompressionMode.Decompress works only through Read(). + + + + The GZipStream will use the default compression level. If you want + to specify the compression level, see . + + + + See the other overloads of this constructor for example code. + + + + + + The stream which will be read or written. This is called the "captive" + stream in other places in this documentation. + + + Indicates whether the GZipStream will compress or decompress. + + + + true if the application would like the base stream to remain open after + inflation/deflation. + + + + + Create a GZipStream using the specified CompressionMode and the + specified CompressionLevel, and explicitly specify whether the + stream should be left open after Deflation or Inflation. + + + + + + This constructor allows the application to request that the captive stream + remain open after the deflation or inflation occurs. By default, after + Close() is called on the stream, the captive stream is also + closed. In some cases this is not desired, for example if the stream is a + memory stream that will be re-read after compressed data has been written + to it. Specify true for the parameter to + leave the stream open. + + + + As noted in the class documentation, the CompressionMode (Compress + or Decompress) also establishes the "direction" of the stream. A + GZipStream with CompressionMode.Compress works only through + Write(). A GZipStream with CompressionMode.Decompress works only + through Read(). + + + + + + This example shows how to use a GZipStream to compress data. + + using (System.IO.Stream input = System.IO.File.OpenRead(fileToCompress)) + { + using (var raw = System.IO.File.Create(outputFile)) + { + using (Stream compressor = new GZipStream(raw, CompressionMode.Compress, CompressionLevel.BestCompression, true)) + { + byte[] buffer = new byte[WORKING_BUFFER_SIZE]; + int n; + while ((n= input.Read(buffer, 0, buffer.Length)) != 0) + { + compressor.Write(buffer, 0, n); + } + } + } + } + + + Dim outputFile As String = (fileToCompress & ".compressed") + Using input As Stream = File.OpenRead(fileToCompress) + Using raw As FileStream = File.Create(outputFile) + Using compressor As Stream = New GZipStream(raw, CompressionMode.Compress, CompressionLevel.BestCompression, True) + Dim buffer As Byte() = New Byte(4096) {} + Dim n As Integer = -1 + Do While (n <> 0) + If (n > 0) Then + compressor.Write(buffer, 0, n) + End If + n = input.Read(buffer, 0, buffer.Length) + Loop + End Using + End Using + End Using + + + The stream which will be read or written. + Indicates whether the GZipStream will compress or decompress. + true if the application would like the stream to remain open after inflation/deflation. + A tuning knob to trade speed for effectiveness. + + + + This property sets the flush behavior on the stream. + + + + + The size of the working buffer for the compression codec. + + + + + The working buffer is used for all stream operations. The default size is + 1024 bytes. The minimum size is 128 bytes. You may get better performance + with a larger buffer. Then again, you might not. You would have to test + it. + + + + Set this before the first call to Read() or Write() on the + stream. If you try to set it afterwards, it will throw. + + + + + Returns the total number of bytes input so far. + + + Returns the total number of bytes output so far. + + + + Dispose the stream. + + + + This may or may not result in a Close() call on the captive + stream. See the constructors that have a leaveOpen parameter + for more information. + + + This method may be invoked in two distinct scenarios. If disposing + == true, the method has been called directly or indirectly by a + user's code, for example via the public Dispose() method. In this + case, both managed and unmanaged resources can be referenced and + disposed. If disposing == false, the method has been called by the + runtime from inside the object finalizer and this method should not + reference other objects; in that case only unmanaged resources must + be referenced or disposed. + + + + indicates whether the Dispose method was invoked by user code. + + + + + Indicates whether the stream can be read. + + + The return value depends on whether the captive stream supports reading. + + + + + Indicates whether the stream supports Seek operations. + + + Always returns false. + + + + + Indicates whether the stream can be written. + + + The return value depends on whether the captive stream supports writing. + + + + + Flush the stream. + + + + + Reading this property always throws a . + + + + + The position of the stream pointer. + + + + Setting this property always throws a . Reading will return the total bytes + written out, if used in writing, or the total bytes read in, if used in + reading. The count may refer to compressed bytes or uncompressed bytes, + depending on how you've used the stream. + + + + + Read and decompress data from the source stream. + + + + With a GZipStream, decompression is done through reading. + + + + + byte[] working = new byte[WORKING_BUFFER_SIZE]; + using (System.IO.Stream input = System.IO.File.OpenRead(_CompressedFile)) + { + using (Stream decompressor= new Ionic.Zlib.GZipStream(input, CompressionMode.Decompress, true)) + { + using (var output = System.IO.File.Create(_DecompressedFile)) + { + int n; + while ((n= decompressor.Read(working, 0, working.Length)) !=0) + { + output.Write(working, 0, n); + } + } + } + } + + + The buffer into which the decompressed data should be placed. + the offset within that data array to put the first byte read. + the number of bytes to read. + the number of bytes actually read + + + + Calling this method always throws a . + + irrelevant; it will always throw! + irrelevant; it will always throw! + irrelevant! + + + + Calling this method always throws a . + + irrelevant; this method will always throw! + + + + Write data to the stream. + + + + + If you wish to use the GZipStream to compress data while writing, + you can create a GZipStream with CompressionMode.Compress, and a + writable output stream. Then call Write() on that GZipStream, + providing uncompressed data as input. The data sent to the output stream + will be the compressed form of the data written. + + + + A GZipStream can be used for Read() or Write(), but not + both. Writing implies compression. Reading implies decompression. + + + + The buffer holding data to write to the stream. + the offset within that data array to find the first byte to write. + the number of bytes to write. + + + + Compress a string into a byte array using GZip. + + + + Uncompress it with . + + + + + + + A string to compress. The string will first be encoded + using UTF8, then compressed. + + + The string in compressed form + + + + Compress a byte array into a new byte array using GZip. + + + + Uncompress it with . + + + + + + + A buffer to compress. + + + The data in compressed form + + + + Uncompress a GZip'ed byte array into a single string. + + + + + + + A buffer containing GZIP-compressed data. + + + The uncompressed string + + + + Uncompress a GZip'ed byte array into a byte array. + + + + + + + A buffer containing data that has been compressed with GZip. + + + The data in uncompressed form + + + + A class for compressing streams using the + Deflate algorithm with multiple threads. + + + + + This class performs DEFLATE compression through writing. For + more information on the Deflate algorithm, see IETF RFC 1951, + "DEFLATE Compressed Data Format Specification version 1.3." + + + + This class is similar to , except + that this class is for compression only, and this implementation uses an + approach that employs multiple worker threads to perform the DEFLATE. On + a multi-cpu or multi-core computer, the performance of this class can be + significantly higher than the single-threaded DeflateStream, particularly + for larger streams. How large? Anything over 10mb is a good candidate + for parallel compression. + + + + The tradeoff is that this class uses more memory and more CPU than the + vanilla DeflateStream, and also is less efficient as a compressor. For + large files the size of the compressed data stream can be less than 1% + larger than the size of a compressed data stream from the vanialla + DeflateStream. For smaller files the difference can be larger. The + difference will also be larger if you set the BufferSize to be lower than + the default value. Your mileage may vary. Finally, for small files, the + ParallelDeflateOutputStream can be much slower than the vanilla + DeflateStream, because of the overhead associated to using the thread + pool. + + + + + + + + Create a ParallelDeflateOutputStream. + + + + + This stream compresses data written into it via the DEFLATE + algorithm (see RFC 1951), and writes out the compressed byte stream. + + + + The instance will use the default compression level, the default + buffer sizes and the default number of threads and buffers per + thread. + + + + This class is similar to , + except that this implementation uses an approach that employs + multiple worker threads to perform the DEFLATE. On a multi-cpu or + multi-core computer, the performance of this class can be + significantly higher than the single-threaded DeflateStream, + particularly for larger streams. How large? Anything over 10mb is + a good candidate for parallel compression. + + + + + + + This example shows how to use a ParallelDeflateOutputStream to compress + data. It reads a file, compresses it, and writes the compressed data to + a second, output file. + + + byte[] buffer = new byte[WORKING_BUFFER_SIZE]; + int n= -1; + String outputFile = fileToCompress + ".compressed"; + using (System.IO.Stream input = System.IO.File.OpenRead(fileToCompress)) + { + using (var raw = System.IO.File.Create(outputFile)) + { + using (Stream compressor = new ParallelDeflateOutputStream(raw)) + { + while ((n= input.Read(buffer, 0, buffer.Length)) != 0) + { + compressor.Write(buffer, 0, n); + } + } + } + } + + + Dim buffer As Byte() = New Byte(4096) {} + Dim n As Integer = -1 + Dim outputFile As String = (fileToCompress & ".compressed") + Using input As Stream = File.OpenRead(fileToCompress) + Using raw As FileStream = File.Create(outputFile) + Using compressor As Stream = New ParallelDeflateOutputStream(raw) + Do While (n <> 0) + If (n > 0) Then + compressor.Write(buffer, 0, n) + End If + n = input.Read(buffer, 0, buffer.Length) + Loop + End Using + End Using + End Using + + + The stream to which compressed data will be written. + + + + Create a ParallelDeflateOutputStream using the specified CompressionLevel. + + + See the + constructor for example code. + + The stream to which compressed data will be written. + A tuning knob to trade speed for effectiveness. + + + + Create a ParallelDeflateOutputStream and specify whether to leave the captive stream open + when the ParallelDeflateOutputStream is closed. + + + See the + constructor for example code. + + The stream to which compressed data will be written. + + true if the application would like the stream to remain open after inflation/deflation. + + + + + Create a ParallelDeflateOutputStream and specify whether to leave the captive stream open + when the ParallelDeflateOutputStream is closed. + + + See the + constructor for example code. + + The stream to which compressed data will be written. + A tuning knob to trade speed for effectiveness. + + true if the application would like the stream to remain open after inflation/deflation. + + + + + Create a ParallelDeflateOutputStream using the specified + CompressionLevel and CompressionStrategy, and specifying whether to + leave the captive stream open when the ParallelDeflateOutputStream is + closed. + + + See the + constructor for example code. + + The stream to which compressed data will be written. + A tuning knob to trade speed for effectiveness. + + By tweaking this parameter, you may be able to optimize the compression for + data with particular characteristics. + + + true if the application would like the stream to remain open after inflation/deflation. + + + + + The ZLIB strategy to be used during compression. + + + + + + The maximum number of buffer pairs to use. + + + + + This property sets an upper limit on the number of memory buffer + pairs to create. The implementation of this stream allocates + multiple buffers to facilitate parallel compression. As each buffer + fills up, this stream uses + ThreadPool.QueueUserWorkItem() + to compress those buffers in a background threadpool thread. After a + buffer is compressed, it is re-ordered and written to the output + stream. + + + + A higher number of buffer pairs enables a higher degree of + parallelism, which tends to increase the speed of compression on + multi-cpu computers. On the other hand, a higher number of buffer + pairs also implies a larger memory consumption, more active worker + threads, and a higher cpu utilization for any compression. This + property enables the application to limit its memory consumption and + CPU utilization behavior depending on requirements. + + + + For each compression "task" that occurs in parallel, there are 2 + buffers allocated: one for input and one for output. This property + sets a limit for the number of pairs. The total amount of storage + space allocated for buffering will then be (N*S*2), where N is the + number of buffer pairs, S is the size of each buffer (). By default, DotNetZip allocates 4 buffer + pairs per CPU core, so if your machine has 4 cores, and you retain + the default buffer size of 128k, then the + ParallelDeflateOutputStream will use 4 * 4 * 2 * 128kb of buffer + memory in total, or 4mb, in blocks of 128kb. If you then set this + property to 8, then the number will be 8 * 2 * 128kb of buffer + memory, or 2mb. + + + + CPU utilization will also go up with additional buffers, because a + larger number of buffer pairs allows a larger number of background + threads to compress in parallel. If you find that parallel + compression is consuming too much memory or CPU, you can adjust this + value downward. + + + + The default value is 16. Different values may deliver better or + worse results, depending on your priorities and the dynamic + performance characteristics of your storage and compute resources. + + + + This property is not the number of buffer pairs to use; it is an + upper limit. An illustration: Suppose you have an application that + uses the default value of this property (which is 16), and it runs + on a machine with 2 CPU cores. In that case, DotNetZip will allocate + 4 buffer pairs per CPU core, for a total of 8 pairs. The upper + limit specified by this property has no effect. + + + + The application can set this value at any time, but it is effective + only before the first call to Write(), which is when the buffers are + allocated. + + + + + + The size of the buffers used by the compressor threads. + + + + + The default buffer size is 128k. The application can set this value + at any time, but it is effective only before the first Write(). + + + + Larger buffer sizes implies larger memory consumption but allows + more efficient compression. Using smaller buffer sizes consumes less + memory but may result in less effective compression. For example, + using the default buffer size of 128k, the compression delivered is + within 1% of the compression delivered by the single-threaded . On the other hand, using a + BufferSize of 8k can result in a compressed data stream that is 5% + larger than that delivered by the single-threaded + DeflateStream. Excessively small buffer sizes can also cause + the speed of the ParallelDeflateOutputStream to drop, because of + larger thread scheduling overhead dealing with many many small + buffers. + + + + The total amount of storage space allocated for buffering will be + (N*S*2), where N is the number of buffer pairs, and S is the size of + each buffer (this property). There are 2 buffers used by the + compressor, one for input and one for output. By default, DotNetZip + allocates 4 buffer pairs per CPU core, so if your machine has 4 + cores, then the number of buffer pairs used will be 16. If you + accept the default value of this property, 128k, then the + ParallelDeflateOutputStream will use 16 * 2 * 128kb of buffer memory + in total, or 4mb, in blocks of 128kb. If you set this property to + 64kb, then the number will be 16 * 2 * 64kb of buffer memory, or + 2mb. + + + + + + + The CRC32 for the data that was written out, prior to compression. + + + This value is meaningful only after a call to Close(). + + + + + The total number of uncompressed bytes processed by the ParallelDeflateOutputStream. + + + This value is meaningful only after a call to Close(). + + + + + Write data to the stream. + + + + + + To use the ParallelDeflateOutputStream to compress data, create a + ParallelDeflateOutputStream with CompressionMode.Compress, passing a + writable output stream. Then call Write() on that + ParallelDeflateOutputStream, providing uncompressed data as input. The + data sent to the output stream will be the compressed form of the data + written. + + + + To decompress data, use the class. + + + + The buffer holding data to write to the stream. + the offset within that data array to find the first byte to write. + the number of bytes to write. + + + + Flush the stream. + + + + + Close the stream. + + + You must call Close on the stream to guarantee that all of the data written in has + been compressed, and the compressed data has been written out. + + + + Dispose the object + + + Because ParallelDeflateOutputStream is IDisposable, the + application must call this method when finished using the instance. + + + This method is generally called implicitly upon exit from + a using scope in C# (Using in VB). + + + + + + Resets the stream for use with another stream. + + + Because the ParallelDeflateOutputStream is expensive to create, it + has been designed so that it can be recycled and re-used. You have + to call Close() on the stream first, then you can call Reset() on + it, to use it again on another stream. + + + + The new output stream for this era. + + + + + ParallelDeflateOutputStream deflater = null; + foreach (var inputFile in listOfFiles) + { + string outputFile = inputFile + ".compressed"; + using (System.IO.Stream input = System.IO.File.OpenRead(inputFile)) + { + using (var outStream = System.IO.File.Create(outputFile)) + { + if (deflater == null) + deflater = new ParallelDeflateOutputStream(outStream, + CompressionLevel.Best, + CompressionStrategy.Default, + true); + deflater.Reset(outStream); + + while ((n= input.Read(buffer, 0, buffer.Length)) != 0) + { + deflater.Write(buffer, 0, n); + } + } + } + } + + + + + + Indicates whether the stream supports Seek operations. + + + Always returns false. + + + + + Indicates whether the stream supports Read operations. + + + Always returns false. + + + + + Indicates whether the stream supports Write operations. + + + Returns true if the provided stream is writable. + + + + + Reading this property always throws a NotSupportedException. + + + + + Returns the current position of the output stream. + + + + Because the output gets written by a background thread, + the value may change asynchronously. Setting this + property always throws a NotSupportedException. + + + + + + This method always throws a NotSupportedException. + + + The buffer into which data would be read, IF THIS METHOD + ACTUALLY DID ANYTHING. + + + The offset within that data array at which to insert the + data that is read, IF THIS METHOD ACTUALLY DID + ANYTHING. + + + The number of bytes to write, IF THIS METHOD ACTUALLY DID + ANYTHING. + + nothing. + + + + This method always throws a NotSupportedException. + + + The offset to seek to.... + IF THIS METHOD ACTUALLY DID ANYTHING. + + + The reference specifying how to apply the offset.... IF + THIS METHOD ACTUALLY DID ANYTHING. + + nothing. It always throws. + + + + This method always throws a NotSupportedException. + + + The new value for the stream length.... IF + THIS METHOD ACTUALLY DID ANYTHING. + + + + + Map from a distance to a distance code. + + + No side effects. _dist_code[256] and _dist_code[257] are never used. + + + + + Describes how to flush the current deflate operation. + + + The different FlushType values are useful when using a Deflate in a streaming application. + + + + No flush at all. + + + Closes the current block, but doesn't flush it to + the output. Used internally only in hypothetical + scenarios. This was supposed to be removed by Zlib, but it is + still in use in some edge cases. + + + + + Use this during compression to specify that all pending output should be + flushed to the output buffer and the output should be aligned on a byte + boundary. You might use this in a streaming communication scenario, so that + the decompressor can get all input data available so far. When using this + with a ZlibCodec, AvailableBytesIn will be zero after the call if + enough output space has been provided before the call. Flushing will + degrade compression and so it should be used only when necessary. + + + + + Use this during compression to specify that all output should be flushed, as + with FlushType.Sync, but also, the compression state should be reset + so that decompression can restart from this point if previous compressed + data has been damaged or if random access is desired. Using + FlushType.Full too often can significantly degrade the compression. + + + + Signals the end of the compression/decompression stream. + + + + The compression level to be used when using a DeflateStream or ZlibStream with CompressionMode.Compress. + + + + + None means that the data will be simply stored, with no change at all. + If you are producing ZIPs for use on Mac OSX, be aware that archives produced with CompressionLevel.None + cannot be opened with the default zip reader. Use a different CompressionLevel. + + + + + Same as None. + + + + + The fastest but least effective compression. + + + + + A synonym for BestSpeed. + + + + + A little slower, but better, than level 1. + + + + + A little slower, but better, than level 2. + + + + + A little slower, but better, than level 3. + + + + + A little slower than level 4, but with better compression. + + + + + The default compression level, with a good balance of speed and compression efficiency. + + + + + A synonym for Default. + + + + + Pretty good compression! + + + + + Better compression than Level7! + + + + + The "best" compression, where best means greatest reduction in size of the input data stream. + This is also the slowest compression. + + + + + A synonym for BestCompression. + + + + + Describes options for how the compression algorithm is executed. Different strategies + work better on different sorts of data. The strategy parameter can affect the compression + ratio and the speed of compression but not the correctness of the compresssion. + + + + + The default strategy is probably the best for normal data. + + + + + The Filtered strategy is intended to be used most effectively with data produced by a + filter or predictor. By this definition, filtered data consists mostly of small + values with a somewhat random distribution. In this case, the compression algorithm + is tuned to compress them better. The effect of Filtered is to force more Huffman + coding and less string matching; it is a half-step between Default and HuffmanOnly. + + + + + Using HuffmanOnly will force the compressor to do Huffman encoding only, with no + string matching. + + + + + An enum to specify the direction of transcoding - whether to compress or decompress. + + + + + Used to specify that the stream should compress the data. + + + + + Used to specify that the stream should decompress the data. + + + + + A general purpose exception class for exceptions in the Zlib library. + + + + + The ZlibException class captures exception information generated + by the Zlib library. + + + + + This ctor collects a message attached to the exception. + + the message for the exception. + + + + Performs an unsigned bitwise right shift with the specified number + + Number to operate on + Ammount of bits to shift + The resulting number from the shift operation + + + + Reads a number of characters from the current source TextReader and writes + the data to the target array at the specified index. + + + The source TextReader to read from + Contains the array of characteres read from the source TextReader. + The starting index of the target array. + The maximum number of characters to read from the source TextReader. + + + The number of characters read. The number will be less than or equal to + count depending on the data available in the source TextReader. Returns -1 + if the end of the stream is reached. + + + + + Computes an Adler-32 checksum. + + + The Adler checksum is similar to a CRC checksum, but faster to compute, though less + reliable. It is used in producing RFC1950 compressed streams. The Adler checksum + is a required part of the "ZLIB" standard. Applications will almost never need to + use this class directly. + + + + + + + Calculates the Adler32 checksum. + + + + This is used within ZLIB. You probably don't need to use this directly. + + + + To compute an Adler32 checksum on a byte array: + + var adler = Adler.Adler32(0, null, 0, 0); + adler = Adler.Adler32(adler, buffer, index, length); + + + + + + Encoder and Decoder for ZLIB and DEFLATE (IETF RFC1950 and RFC1951). + + + + This class compresses and decompresses data according to the Deflate algorithm + and optionally, the ZLIB format, as documented in RFC 1950 - ZLIB and RFC 1951 - DEFLATE. + + + + + The buffer from which data is taken. + + + + + An index into the InputBuffer array, indicating where to start reading. + + + + + The number of bytes available in the InputBuffer, starting at NextIn. + + + Generally you should set this to InputBuffer.Length before the first Inflate() or Deflate() call. + The class will update this number as calls to Inflate/Deflate are made. + + + + + Total number of bytes read so far, through all calls to Inflate()/Deflate(). + + + + + Buffer to store output data. + + + + + An index into the OutputBuffer array, indicating where to start writing. + + + + + The number of bytes available in the OutputBuffer, starting at NextOut. + + + Generally you should set this to OutputBuffer.Length before the first Inflate() or Deflate() call. + The class will update this number as calls to Inflate/Deflate are made. + + + + + Total number of bytes written to the output so far, through all calls to Inflate()/Deflate(). + + + + + used for diagnostics, when something goes wrong! + + + + + The compression level to use in this codec. Useful only in compression mode. + + + + + The number of Window Bits to use. + + + This gauges the size of the sliding window, and hence the + compression effectiveness as well as memory consumption. It's best to just leave this + setting alone if you don't know what it is. The maximum value is 15 bits, which implies + a 32k window. + + + + + The compression strategy to use. + + + This is only effective in compression. The theory offered by ZLIB is that different + strategies could potentially produce significant differences in compression behavior + for different data sets. Unfortunately I don't have any good recommendations for how + to set it differently. When I tested changing the strategy I got minimally different + compression performance. It's best to leave this property alone if you don't have a + good feel for it. Or, you may want to produce a test harness that runs through the + different strategy options and evaluates them on different file types. If you do that, + let me know your results. + + + + + The Adler32 checksum on the data transferred through the codec so far. You probably don't need to look at this. + + + + + Create a ZlibCodec. + + + If you use this default constructor, you will later have to explicitly call + InitializeInflate() or InitializeDeflate() before using the ZlibCodec to compress + or decompress. + + + + + Create a ZlibCodec that either compresses or decompresses. + + + Indicates whether the codec should compress (deflate) or decompress (inflate). + + + + + Initialize the inflation state. + + + It is not necessary to call this before using the ZlibCodec to inflate data; + It is implicitly called when you call the constructor. + + Z_OK if everything goes well. + + + + Initialize the inflation state with an explicit flag to + govern the handling of RFC1950 header bytes. + + + + By default, the ZLIB header defined in RFC 1950 is expected. If + you want to read a zlib stream you should specify true for + expectRfc1950Header. If you have a deflate stream, you will want to specify + false. It is only necessary to invoke this initializer explicitly if you + want to specify false. + + + whether to expect an RFC1950 header byte + pair when reading the stream of data to be inflated. + + Z_OK if everything goes well. + + + + Initialize the ZlibCodec for inflation, with the specified number of window bits. + + The number of window bits to use. If you need to ask what that is, + then you shouldn't be calling this initializer. + Z_OK if all goes well. + + + + Initialize the inflation state with an explicit flag to govern the handling of + RFC1950 header bytes. + + + + If you want to read a zlib stream you should specify true for + expectRfc1950Header. In this case, the library will expect to find a ZLIB + header, as defined in RFC + 1950, in the compressed stream. If you will be reading a DEFLATE or + GZIP stream, which does not have such a header, you will want to specify + false. + + + whether to expect an RFC1950 header byte pair when reading + the stream of data to be inflated. + The number of window bits to use. If you need to ask what that is, + then you shouldn't be calling this initializer. + Z_OK if everything goes well. + + + + Inflate the data in the InputBuffer, placing the result in the OutputBuffer. + + + You must have set InputBuffer and OutputBuffer, NextIn and NextOut, and AvailableBytesIn and + AvailableBytesOut before calling this method. + + + + private void InflateBuffer() + { + int bufferSize = 1024; + byte[] buffer = new byte[bufferSize]; + ZlibCodec decompressor = new ZlibCodec(); + + Console.WriteLine("\n============================================"); + Console.WriteLine("Size of Buffer to Inflate: {0} bytes.", CompressedBytes.Length); + MemoryStream ms = new MemoryStream(DecompressedBytes); + + int rc = decompressor.InitializeInflate(); + + decompressor.InputBuffer = CompressedBytes; + decompressor.NextIn = 0; + decompressor.AvailableBytesIn = CompressedBytes.Length; + + decompressor.OutputBuffer = buffer; + + // pass 1: inflate + do + { + decompressor.NextOut = 0; + decompressor.AvailableBytesOut = buffer.Length; + rc = decompressor.Inflate(FlushType.None); + + if (rc != ZlibConstants.Z_OK && rc != ZlibConstants.Z_STREAM_END) + throw new Exception("inflating: " + decompressor.Message); + + ms.Write(decompressor.OutputBuffer, 0, buffer.Length - decompressor.AvailableBytesOut); + } + while (decompressor.AvailableBytesIn > 0 || decompressor.AvailableBytesOut == 0); + + // pass 2: finish and flush + do + { + decompressor.NextOut = 0; + decompressor.AvailableBytesOut = buffer.Length; + rc = decompressor.Inflate(FlushType.Finish); + + if (rc != ZlibConstants.Z_STREAM_END && rc != ZlibConstants.Z_OK) + throw new Exception("inflating: " + decompressor.Message); + + if (buffer.Length - decompressor.AvailableBytesOut > 0) + ms.Write(buffer, 0, buffer.Length - decompressor.AvailableBytesOut); + } + while (decompressor.AvailableBytesIn > 0 || decompressor.AvailableBytesOut == 0); + + decompressor.EndInflate(); + } + + + + The flush to use when inflating. + Z_OK if everything goes well. + + + + Ends an inflation session. + + + Call this after successively calling Inflate(). This will cause all buffers to be flushed. + After calling this you cannot call Inflate() without a intervening call to one of the + InitializeInflate() overloads. + + Z_OK if everything goes well. + + + + I don't know what this does! + + Z_OK if everything goes well. + + + + Initialize the ZlibCodec for deflation operation. + + + The codec will use the MAX window bits and the default level of compression. + + + + int bufferSize = 40000; + byte[] CompressedBytes = new byte[bufferSize]; + byte[] DecompressedBytes = new byte[bufferSize]; + + ZlibCodec compressor = new ZlibCodec(); + + compressor.InitializeDeflate(CompressionLevel.Default); + + compressor.InputBuffer = System.Text.ASCIIEncoding.ASCII.GetBytes(TextToCompress); + compressor.NextIn = 0; + compressor.AvailableBytesIn = compressor.InputBuffer.Length; + + compressor.OutputBuffer = CompressedBytes; + compressor.NextOut = 0; + compressor.AvailableBytesOut = CompressedBytes.Length; + + while (compressor.TotalBytesIn != TextToCompress.Length && compressor.TotalBytesOut < bufferSize) + { + compressor.Deflate(FlushType.None); + } + + while (true) + { + int rc= compressor.Deflate(FlushType.Finish); + if (rc == ZlibConstants.Z_STREAM_END) break; + } + + compressor.EndDeflate(); + + + + Z_OK if all goes well. You generally don't need to check the return code. + + + + Initialize the ZlibCodec for deflation operation, using the specified CompressionLevel. + + + The codec will use the maximum window bits (15) and the specified + CompressionLevel. It will emit a ZLIB stream as it compresses. + + The compression level for the codec. + Z_OK if all goes well. + + + + Initialize the ZlibCodec for deflation operation, using the specified CompressionLevel, + and the explicit flag governing whether to emit an RFC1950 header byte pair. + + + The codec will use the maximum window bits (15) and the specified CompressionLevel. + If you want to generate a zlib stream, you should specify true for + wantRfc1950Header. In this case, the library will emit a ZLIB + header, as defined in RFC + 1950, in the compressed stream. + + The compression level for the codec. + whether to emit an initial RFC1950 byte pair in the compressed stream. + Z_OK if all goes well. + + + + Initialize the ZlibCodec for deflation operation, using the specified CompressionLevel, + and the specified number of window bits. + + + The codec will use the specified number of window bits and the specified CompressionLevel. + + The compression level for the codec. + the number of window bits to use. If you don't know what this means, don't use this method. + Z_OK if all goes well. + + + + Initialize the ZlibCodec for deflation operation, using the specified + CompressionLevel, the specified number of window bits, and the explicit flag + governing whether to emit an RFC1950 header byte pair. + + + The compression level for the codec. + whether to emit an initial RFC1950 byte pair in the compressed stream. + the number of window bits to use. If you don't know what this means, don't use this method. + Z_OK if all goes well. + + + + Deflate one batch of data. + + + You must have set InputBuffer and OutputBuffer before calling this method. + + + + private void DeflateBuffer(CompressionLevel level) + { + int bufferSize = 1024; + byte[] buffer = new byte[bufferSize]; + ZlibCodec compressor = new ZlibCodec(); + + Console.WriteLine("\n============================================"); + Console.WriteLine("Size of Buffer to Deflate: {0} bytes.", UncompressedBytes.Length); + MemoryStream ms = new MemoryStream(); + + int rc = compressor.InitializeDeflate(level); + + compressor.InputBuffer = UncompressedBytes; + compressor.NextIn = 0; + compressor.AvailableBytesIn = UncompressedBytes.Length; + + compressor.OutputBuffer = buffer; + + // pass 1: deflate + do + { + compressor.NextOut = 0; + compressor.AvailableBytesOut = buffer.Length; + rc = compressor.Deflate(FlushType.None); + + if (rc != ZlibConstants.Z_OK && rc != ZlibConstants.Z_STREAM_END) + throw new Exception("deflating: " + compressor.Message); + + ms.Write(compressor.OutputBuffer, 0, buffer.Length - compressor.AvailableBytesOut); + } + while (compressor.AvailableBytesIn > 0 || compressor.AvailableBytesOut == 0); + + // pass 2: finish and flush + do + { + compressor.NextOut = 0; + compressor.AvailableBytesOut = buffer.Length; + rc = compressor.Deflate(FlushType.Finish); + + if (rc != ZlibConstants.Z_STREAM_END && rc != ZlibConstants.Z_OK) + throw new Exception("deflating: " + compressor.Message); + + if (buffer.Length - compressor.AvailableBytesOut > 0) + ms.Write(buffer, 0, buffer.Length - compressor.AvailableBytesOut); + } + while (compressor.AvailableBytesIn > 0 || compressor.AvailableBytesOut == 0); + + compressor.EndDeflate(); + + ms.Seek(0, SeekOrigin.Begin); + CompressedBytes = new byte[compressor.TotalBytesOut]; + ms.Read(CompressedBytes, 0, CompressedBytes.Length); + } + + + whether to flush all data as you deflate. Generally you will want to + use Z_NO_FLUSH here, in a series of calls to Deflate(), and then call EndDeflate() to + flush everything. + + Z_OK if all goes well. + + + + End a deflation session. + + + Call this after making a series of one or more calls to Deflate(). All buffers are flushed. + + Z_OK if all goes well. + + + + Reset a codec for another deflation session. + + + Call this to reset the deflation state. For example if a thread is deflating + non-consecutive blocks, you can call Reset() after the Deflate(Sync) of the first + block and before the next Deflate(None) of the second block. + + Z_OK if all goes well. + + + + Set the CompressionStrategy and CompressionLevel for a deflation session. + + the level of compression to use. + the strategy to use for compression. + Z_OK if all goes well. + + + + Set the dictionary to be used for either Inflation or Deflation. + + The dictionary bytes to use. + Z_OK if all goes well. + + + + A bunch of constants used in the Zlib interface. + + + + + The maximum number of window bits for the Deflate algorithm. + + + + + The default number of window bits for the Deflate algorithm. + + + + + indicates everything is A-OK + + + + + Indicates that the last operation reached the end of the stream. + + + + + The operation ended in need of a dictionary. + + + + + There was an error with the stream - not enough data, not open and readable, etc. + + + + + There was an error with the data - not enough data, bad data, etc. + + + + + There was an error with the working buffer. + + + + + The size of the working buffer used in the ZlibCodec class. Defaults to 8192 bytes. + + + + + The minimum size of the working buffer used in the ZlibCodec class. Currently it is 128 bytes. + + + + + Represents a Zlib stream for compression or decompression. + + + + + The ZlibStream is a Decorator on a . It adds ZLIB compression or decompression to any + stream. + + + Using this stream, applications can compress or decompress data via + stream Read() and Write() operations. Either compresssion or + decompression can occur through either reading or writing. The compression + format used is ZLIB, which is documented in IETF RFC 1950, "ZLIB Compressed + Data Format Specification version 3.3". This implementation of ZLIB always uses + DEFLATE as the compression method. (see IETF RFC 1951, "DEFLATE + Compressed Data Format Specification version 1.3.") + + + The ZLIB format allows for varying compression methods, window sizes, and dictionaries. + This implementation always uses the DEFLATE compression method, a preset dictionary, + and 15 window bits by default. + + + + This class is similar to , except that it adds the + RFC1950 header and trailer bytes to a compressed stream when compressing, or expects + the RFC1950 header and trailer bytes when decompressing. It is also similar to the + . + + + + + + + + Create a ZlibStream using the specified CompressionMode. + + + + + When mode is CompressionMode.Compress, the ZlibStream + will use the default compression level. The "captive" stream will be + closed when the ZlibStream is closed. + + + + + + This example uses a ZlibStream to compress a file, and writes the + compressed data to another file. + + using (System.IO.Stream input = System.IO.File.OpenRead(fileToCompress)) + { + using (var raw = System.IO.File.Create(fileToCompress + ".zlib")) + { + using (Stream compressor = new ZlibStream(raw, CompressionMode.Compress)) + { + byte[] buffer = new byte[WORKING_BUFFER_SIZE]; + int n; + while ((n= input.Read(buffer, 0, buffer.Length)) != 0) + { + compressor.Write(buffer, 0, n); + } + } + } + } + + + Using input As Stream = File.OpenRead(fileToCompress) + Using raw As FileStream = File.Create(fileToCompress & ".zlib") + Using compressor As Stream = New ZlibStream(raw, CompressionMode.Compress) + Dim buffer As Byte() = New Byte(4096) {} + Dim n As Integer = -1 + Do While (n <> 0) + If (n > 0) Then + compressor.Write(buffer, 0, n) + End If + n = input.Read(buffer, 0, buffer.Length) + Loop + End Using + End Using + End Using + + + + The stream which will be read or written. + Indicates whether the ZlibStream will compress or decompress. + + + + Create a ZlibStream using the specified CompressionMode and + the specified CompressionLevel. + + + + + + When mode is CompressionMode.Decompress, the level parameter is ignored. + The "captive" stream will be closed when the ZlibStream is closed. + + + + + + This example uses a ZlibStream to compress data from a file, and writes the + compressed data to another file. + + + using (System.IO.Stream input = System.IO.File.OpenRead(fileToCompress)) + { + using (var raw = System.IO.File.Create(fileToCompress + ".zlib")) + { + using (Stream compressor = new ZlibStream(raw, + CompressionMode.Compress, + CompressionLevel.BestCompression)) + { + byte[] buffer = new byte[WORKING_BUFFER_SIZE]; + int n; + while ((n= input.Read(buffer, 0, buffer.Length)) != 0) + { + compressor.Write(buffer, 0, n); + } + } + } + } + + + + Using input As Stream = File.OpenRead(fileToCompress) + Using raw As FileStream = File.Create(fileToCompress & ".zlib") + Using compressor As Stream = New ZlibStream(raw, CompressionMode.Compress, CompressionLevel.BestCompression) + Dim buffer As Byte() = New Byte(4096) {} + Dim n As Integer = -1 + Do While (n <> 0) + If (n > 0) Then + compressor.Write(buffer, 0, n) + End If + n = input.Read(buffer, 0, buffer.Length) + Loop + End Using + End Using + End Using + + + + The stream to be read or written while deflating or inflating. + Indicates whether the ZlibStream will compress or decompress. + A tuning knob to trade speed for effectiveness. + + + + Create a ZlibStream using the specified CompressionMode, and + explicitly specify whether the captive stream should be left open after + Deflation or Inflation. + + + + + + When mode is CompressionMode.Compress, the ZlibStream will use + the default compression level. + + + + This constructor allows the application to request that the captive stream + remain open after the deflation or inflation occurs. By default, after + Close() is called on the stream, the captive stream is also + closed. In some cases this is not desired, for example if the stream is a + that will be re-read after + compression. Specify true for the parameter to leave the stream + open. + + + + See the other overloads of this constructor for example code. + + + + + The stream which will be read or written. This is called the + "captive" stream in other places in this documentation. + Indicates whether the ZlibStream will compress or decompress. + true if the application would like the stream to remain + open after inflation/deflation. + + + + Create a ZlibStream using the specified CompressionMode + and the specified CompressionLevel, and explicitly specify + whether the stream should be left open after Deflation or Inflation. + + + + + + This constructor allows the application to request that the captive + stream remain open after the deflation or inflation occurs. By + default, after Close() is called on the stream, the captive + stream is also closed. In some cases this is not desired, for example + if the stream is a that will be + re-read after compression. Specify true for the parameter to leave the stream open. + + + + When mode is CompressionMode.Decompress, the level parameter is + ignored. + + + + + + + This example shows how to use a ZlibStream to compress the data from a file, + and store the result into another file. The filestream remains open to allow + additional data to be written to it. + + + using (var output = System.IO.File.Create(fileToCompress + ".zlib")) + { + using (System.IO.Stream input = System.IO.File.OpenRead(fileToCompress)) + { + using (Stream compressor = new ZlibStream(output, CompressionMode.Compress, CompressionLevel.BestCompression, true)) + { + byte[] buffer = new byte[WORKING_BUFFER_SIZE]; + int n; + while ((n= input.Read(buffer, 0, buffer.Length)) != 0) + { + compressor.Write(buffer, 0, n); + } + } + } + // can write additional data to the output stream here + } + + + Using output As FileStream = File.Create(fileToCompress & ".zlib") + Using input As Stream = File.OpenRead(fileToCompress) + Using compressor As Stream = New ZlibStream(output, CompressionMode.Compress, CompressionLevel.BestCompression, True) + Dim buffer As Byte() = New Byte(4096) {} + Dim n As Integer = -1 + Do While (n <> 0) + If (n > 0) Then + compressor.Write(buffer, 0, n) + End If + n = input.Read(buffer, 0, buffer.Length) + Loop + End Using + End Using + ' can write additional data to the output stream here. + End Using + + + + The stream which will be read or written. + + Indicates whether the ZlibStream will compress or decompress. + + + true if the application would like the stream to remain open after + inflation/deflation. + + + + A tuning knob to trade speed for effectiveness. This parameter is + effective only when mode is CompressionMode.Compress. + + + + + This property sets the flush behavior on the stream. + Sorry, though, not sure exactly how to describe all the various settings. + + + + + The size of the working buffer for the compression codec. + + + + + The working buffer is used for all stream operations. The default size is + 1024 bytes. The minimum size is 128 bytes. You may get better performance + with a larger buffer. Then again, you might not. You would have to test + it. + + + + Set this before the first call to Read() or Write() on the + stream. If you try to set it afterwards, it will throw. + + + + + Returns the total number of bytes input so far. + + + Returns the total number of bytes output so far. + + + + Dispose the stream. + + + + This may or may not result in a Close() call on the captive + stream. See the constructors that have a leaveOpen parameter + for more information. + + + This method may be invoked in two distinct scenarios. If disposing + == true, the method has been called directly or indirectly by a + user's code, for example via the public Dispose() method. In this + case, both managed and unmanaged resources can be referenced and + disposed. If disposing == false, the method has been called by the + runtime from inside the object finalizer and this method should not + reference other objects; in that case only unmanaged resources must + be referenced or disposed. + + + + indicates whether the Dispose method was invoked by user code. + + + + + Indicates whether the stream can be read. + + + The return value depends on whether the captive stream supports reading. + + + + + Indicates whether the stream supports Seek operations. + + + Always returns false. + + + + + Indicates whether the stream can be written. + + + The return value depends on whether the captive stream supports writing. + + + + + Flush the stream. + + + + + Reading this property always throws a . + + + + + The position of the stream pointer. + + + + Setting this property always throws a . Reading will return the total bytes + written out, if used in writing, or the total bytes read in, if used in + reading. The count may refer to compressed bytes or uncompressed bytes, + depending on how you've used the stream. + + + + + Read data from the stream. + + + + + + If you wish to use the ZlibStream to compress data while reading, + you can create a ZlibStream with CompressionMode.Compress, + providing an uncompressed data stream. Then call Read() on that + ZlibStream, and the data read will be compressed. If you wish to + use the ZlibStream to decompress data while reading, you can create + a ZlibStream with CompressionMode.Decompress, providing a + readable compressed data stream. Then call Read() on that + ZlibStream, and the data will be decompressed as it is read. + + + + A ZlibStream can be used for Read() or Write(), but + not both. + + + + + + The buffer into which the read data should be placed. + + + the offset within that data array to put the first byte read. + + the number of bytes to read. + + the number of bytes read + + + + Calling this method always throws a . + + + The offset to seek to.... + IF THIS METHOD ACTUALLY DID ANYTHING. + + + The reference specifying how to apply the offset.... IF + THIS METHOD ACTUALLY DID ANYTHING. + + + nothing. This method always throws. + + + + Calling this method always throws a . + + + The new value for the stream length.... IF + THIS METHOD ACTUALLY DID ANYTHING. + + + + + Write data to the stream. + + + + + + If you wish to use the ZlibStream to compress data while writing, + you can create a ZlibStream with CompressionMode.Compress, + and a writable output stream. Then call Write() on that + ZlibStream, providing uncompressed data as input. The data sent to + the output stream will be the compressed form of the data written. If you + wish to use the ZlibStream to decompress data while writing, you + can create a ZlibStream with CompressionMode.Decompress, and a + writable output stream. Then call Write() on that stream, + providing previously compressed data. The data sent to the output stream + will be the decompressed form of the data written. + + + + A ZlibStream can be used for Read() or Write(), but not both. + + + The buffer holding data to write to the stream. + the offset within that data array to find the first byte to write. + the number of bytes to write. + + + + Compress a string into a byte array using ZLIB. + + + + Uncompress it with . + + + + + + + + A string to compress. The string will first be encoded + using UTF8, then compressed. + + + The string in compressed form + + + + Compress a byte array into a new byte array using ZLIB. + + + + Uncompress it with . + + + + + + + A buffer to compress. + + + The data in compressed form + + + + Uncompress a ZLIB-compressed byte array into a single string. + + + + + + + A buffer containing ZLIB-compressed data. + + + The uncompressed string + + + + Uncompress a ZLIB-compressed byte array into a byte array. + + + + + + + A buffer containing ZLIB-compressed data. + + + The data in uncompressed form + + + + Provides a text encoder for the iso-8859-1 encoding, aka Latin1 encoding, + for platforms that do not support it, for example on Silverlight or some + Compact Framework platforms. + + + + + Gets the name registered with the + Internet Assigned Numbers Authority (IANA) for the current encoding. + + + Always returns "iso-8859-1". + + + + + Encodes a set of characters from a character array into + a byte array. + + + The actual number of bytes written into . + + The character array containing the set of characters to encode. + The index of the first character to encode. + The number of characters to encode. + The byte array to contain the resulting sequence of bytes. + The index at which to start writing the resulting sequence of bytes. + + + + + Decodes a sequence of bytes from the specified byte array into the specified character array. + + + The actual number of characters written into . + + The byte array containing the sequence of bytes to decode. + The index of the first byte to decode. + The number of bytes to decode. + The character array to contain the resulting set of characters. + The index at which to start writing the resulting set of characters. + + + + + Calculates the number of bytes produced by encoding a set of characters + from the specified character array. + + + The number of bytes produced by encoding the specified characters. This class + alwas returns the value of . + + + + + Calculates the number of characters produced by decoding a sequence + of bytes from the specified byte array. + + + The number of characters produced by decoding the specified sequence of bytes. This class + alwas returns the value of . + + + + + Calculates the maximum number of bytes produced by encoding the specified number of characters. + + + The maximum number of bytes produced by encoding the specified number of characters. This + class alwas returns the value of . + + The number of characters to encode. + + + + + Calculates the maximum number of characters produced by decoding the specified number of bytes. + + + The maximum number of characters produced by decoding the specified number of bytes. This class + alwas returns the value of . + + The number of bytes to decode. + + + + Gets the number of characters that are supported by this encoding. + This property returns a maximum value of 256, as the encoding class + only supports single byte encodings (1 byte == 256 possible values). + + + + Provides a platform-specific character used to separate directory levels in a path string that reflects a hierarchical file system organization. + 1 + + + Provides a platform-specific alternate character used to separate directory levels in a path string that reflects a hierarchical file system organization. + 1 + + + Provides a platform-specific volume separator character. + 1 + + + Provides a platform-specific array of characters that cannot be specified in path string arguments passed to members of the class. + A character array of invalid path characters for the current platform. + 1 + + + A platform-specific separator character used to separate path strings in environment variables. + 1 + + +