├── PDTools.Utils.Tests
└── MSTestSettings.cs
├── PDTools.GTPatcher
├── libdebug.dll
├── Properties
│ └── launchSettings.json
├── MemoryPatches
│ └── IMemoryPatch.cs
├── Breakpoint.cs
├── BreakLoggers
│ └── IBreakLogger.cs
└── PDTools.GTPatcher.csproj
├── .gitmodules
├── PDTools.SimulatorInterfaceTestTool
├── README.md
└── PDTools.SimulatorInterfaceTestTool.csproj
├── PDTools.SaveFile
├── README.md
├── GT4
│ ├── ISerializableGT4Entity.cs
│ ├── UserProfile
│ │ ├── DayEvents
│ │ │ ├── DayEvent.cs
│ │ │ └── NoEvent.cs
│ │ └── ChampionshipContext.cs
│ └── Option
│ │ ├── OptionEvent.cs
│ │ ├── GameZone.cs
│ │ └── OptionNetConfig.cs
└── PDTools.SaveFile.csproj
├── PDTools.ScapesDataHelper
├── README.md
└── PDTools.ScapesDataHelper.csproj
├── PDTools.Enums
└── PDTools.Enums.csproj
├── PDTools.Hashing
├── README.md
└── PDTools.Hashing.csproj
├── PDTools.PDIWheelCryptor
├── README.md
└── PDTools.PDIWheelCryptor.csproj
├── PDTools.Compression
├── README.md
└── PDTools.Compression.csproj
├── PDTools.GT4ElfBuilderTool
├── Properties
│ └── launchSettings.json
├── README.md
├── ElfSegment.cs
├── PDTools.GT4ElfBuilderTool.csproj
└── Program.cs
├── PDTools.SpecDB
├── SpecDBQueryResult.cs
├── Core
│ ├── Mapping
│ │ ├── Types
│ │ │ └── IDBType.cs
│ │ └── Tables
│ │ │ ├── Maker.cs
│ │ │ ├── Tuner.cs
│ │ │ ├── GenericCarInfo.cs
│ │ │ ├── IndepThrottle.cs
│ │ │ ├── CourseName.cs
│ │ │ ├── CarVariation.cs
│ │ │ ├── Wing.cs
│ │ │ ├── EnemyCars.cs
│ │ │ ├── TunedCars.cs
│ │ │ ├── TireSize.cs
│ │ │ ├── RiderEquipment.cs
│ │ │ ├── Lightweight.cs
│ │ │ ├── PortPolish.cs
│ │ │ ├── AirCleaner.cs
│ │ │ ├── ExhaustManifold.cs
│ │ │ ├── RiderSetAssign.cs
│ │ │ ├── CarName.cs
│ │ │ ├── CarCustomInfo.cs
│ │ │ ├── RiderSet.cs
│ │ │ ├── Flywheel.cs
│ │ │ ├── EngineBalance.cs
│ │ │ ├── Supercharger.cs
│ │ │ ├── Displacement.cs
│ │ │ └── Intercooler.cs
│ └── RowKey.cs
├── PDTools.SpecDB.csproj
└── ISpecDB.cs
├── STStruct
├── Nodes
│ ├── STObjectNull.cs
│ ├── STObject.cs
│ ├── STString.cs
│ ├── STArray.cs
│ ├── STMap.cs
│ ├── MBlob.cs
│ ├── STUShort.cs
│ ├── STByte.cs
│ ├── STLong.cs
│ ├── STUInt.cs
│ ├── STFloat.cs
│ ├── STSByte.cs
│ ├── STShort.cs
│ ├── STULong.cs
│ └── STInt.cs
├── NodeBase.cs
└── PDTools.STStruct.csproj
├── PDTools.Files
├── Fonts
│ ├── IGlyphShapeData.cs
│ ├── GlyphPoint.cs
│ ├── GlyphLine.cs
│ ├── GlyphStartPoint.cs
│ └── GlyphQuadraticBezierCurve.cs
├── Models
│ ├── PS3
│ │ ├── ModelSet3
│ │ │ ├── FVF
│ │ │ │ └── MDL3FVFDefinitionCollection.cs
│ │ │ ├── PackedMesh
│ │ │ │ └── Commands
│ │ │ │ │ ├── SmoothMeshTessellationCommand6.cs
│ │ │ │ │ ├── SmoothMeshTessellationCommand8.cs
│ │ │ │ │ ├── SmoothMeshTessellationCommand0.cs
│ │ │ │ │ ├── SmoothMeshTessellationCommand16.cs
│ │ │ │ │ ├── SmoothMeshTessellationCommand2.cs
│ │ │ │ │ ├── SmoothMeshTessellationCommand17.cs
│ │ │ │ │ ├── SmoothMeshTessellationCommand1.cs
│ │ │ │ │ ├── SmoothMeshTessellationCommand12.cs
│ │ │ │ │ ├── SmoothMeshTessellationCommand11.cs
│ │ │ │ │ ├── SmoothMeshTessellationCommand14.cs
│ │ │ │ │ ├── SmoothMeshTessellationCommand13.cs
│ │ │ │ │ └── SmoothMeshTessellationCommand23.cs
│ │ │ ├── Wing
│ │ │ │ └── MDL3WingData.cs
│ │ │ ├── Materials
│ │ │ │ ├── CellGcmParams.cs
│ │ │ │ ├── MDL3MaterialData_0x1C.cs
│ │ │ │ └── MDL3MaterialData_0x18.cs
│ │ │ ├── Shapes
│ │ │ │ └── MDL3ShapePackedMeshRef.cs
│ │ │ ├── ShapeStream
│ │ │ │ └── MDL3ShapeStreamingInfoShapeEntry.cs
│ │ │ ├── MDL3ModelVMUnk.cs
│ │ │ └── MDL3ModelVMContext.cs
│ │ └── PGLCommands
│ │ │ ├── Command_0_End.cs
│ │ │ ├── Command_44_CallVM_Ptr2.cs
│ │ │ ├── Command_40_SetCullFaceBack.cs
│ │ │ ├── Command_41_SetCullFaceFront.cs
│ │ │ ├── Command_42_SetCullFaceSwitch.cs
│ │ │ ├── Command_38_SetCullFaceDisable.cs
│ │ │ ├── Command_39_SetCullFaceDisable.cs
│ │ │ ├── Command_24_SetDepthTestEnabled.cs
│ │ │ ├── Command_25_SetDepthTestDisabled.cs
│ │ │ ├── Command_27_SetAlphaTestEnabled.cs
│ │ │ ├── Command_28_SetAlphaTestDisabled.cs
│ │ │ ├── Command_70_Unk.cs
│ │ │ ├── Command_71_Unk.cs
│ │ │ ├── Command_72_Unk.cs
│ │ │ ├── Command_15_Unk.cs
│ │ │ ├── Command_35_SetDepthMaskEnabled.cs
│ │ │ ├── Command_45_Unk.cs
│ │ │ ├── Command_46_Unk.cs
│ │ │ ├── Command_47_Unk.cs
│ │ │ ├── Command_49_Unk.cs
│ │ │ ├── Command_50_Unk.cs
│ │ │ ├── Command_62_Unk.cs
│ │ │ ├── Command_66_Unk.cs
│ │ │ ├── Command_14_Unk.cs
│ │ │ ├── Command_53_Unk.cs
│ │ │ ├── Command_6_Unk.cs
│ │ │ ├── Command_43_SetVMUnk.cs
│ │ │ ├── Command_7_Unk.cs
│ │ │ ├── Command_2_Unk.cs
│ │ │ ├── Command_23_Unk.cs
│ │ │ ├── Command_51_Unk.cs
│ │ │ ├── Command_52_Unk.cs
│ │ │ ├── Command_61_Semaphore_InvalidateL2.cs
│ │ │ ├── Command_26_SetDepthFunc.cs
│ │ │ ├── Command_21_Unk.cs
│ │ │ ├── Command_22_Unk.cs
│ │ │ ├── Command_4_PGLUCallShapeUShort.cs
│ │ │ ├── Command_67_Unk.cs
│ │ │ ├── Command_69_Unk.cs
│ │ │ ├── Command_65_Unk.cs
│ │ │ ├── Command_3_PGLUCallShapeByte.cs
│ │ │ ├── Command_11_PSP_Unk.cs
│ │ │ ├── Command_13_PSP_Unk.cs
│ │ │ ├── Command_34_SetColorMask.cs
│ │ │ ├── Command_18_Unk.cs
│ │ │ ├── Command_19_Unk.cs
│ │ │ ├── Command_20_Unk.cs
│ │ │ ├── Command_36_SetDepthMaskDisabled.cs
│ │ │ ├── Command_CallShape2Byte.cs
│ │ │ └── Command_56_PSP_Unk.cs
│ ├── VM
│ │ ├── RegisterValue.cs
│ │ └── Instructions
│ │ │ ├── VM0xC2.cs
│ │ │ ├── VMUnaryMinus.cs
│ │ │ ├── VMUnaryMinusF.cs
│ │ │ ├── VMUnaryBitwiseNot.cs
│ │ │ ├── VMAdd.cs
│ │ │ ├── VMCosF.cs
│ │ │ ├── VMSinF.cs
│ │ │ ├── VMTanF.cs
│ │ │ ├── VMMaxF.cs
│ │ │ ├── VMMinF.cs
│ │ │ ├── VMPowF.cs
│ │ │ ├── VMSqrtF.cs
│ │ │ ├── VMAtan2F.cs
│ │ │ ├── VMEquals.cs
│ │ │ ├── VMModulo.cs
│ │ │ ├── VMRandF.cs
│ │ │ ├── VMSignF.cs
│ │ │ ├── VMAddF.cs
│ │ │ ├── VMDivide.cs
│ │ │ ├── VMMultiply.cs
│ │ │ ├── VMSubtract.cs
│ │ │ ├── VMBinaryAnd.cs
│ │ │ ├── VMBinaryOr.cs
│ │ │ ├── VMBinaryXor.cs
│ │ │ ├── VMEqualsF.cs
│ │ │ ├── VMFloatToInt.cs
│ │ │ ├── VMIntToFloat.cs
│ │ │ ├── VMModuloF.cs
│ │ │ ├── VMNotEquals.cs
│ │ │ ├── VMLesserThan.cs
│ │ │ ├── VMDivideF.cs
│ │ │ ├── VMGreaterThan.cs
│ │ │ ├── VMMultiplyF.cs
│ │ │ ├── VMSubtractF.cs
│ │ │ ├── VMNotEqualsF.cs
│ │ │ ├── VMGreaterThanF.cs
│ │ │ ├── VMLesserEqualTo.cs
│ │ │ ├── VMLesserThanF.cs
│ │ │ ├── VMGreatherEqualTo.cs
│ │ │ ├── VMBinaryLeftShift.cs
│ │ │ ├── VMBinaryRightShift.cs
│ │ │ ├── VMLesserEqualToF.cs
│ │ │ ├── VMGreatherEqualToF.cs
│ │ │ ├── VM0x10.cs
│ │ │ ├── VMReturn.cs
│ │ │ ├── VMJump.cs
│ │ │ ├── VMIntConst.cs
│ │ │ └── VMJumpIfFalse.cs
│ ├── PS2
│ │ ├── ModelSet
│ │ │ ├── ModelPS2Base.cs
│ │ │ └── ModelSet1Bounding.cs
│ │ ├── RenderCommands
│ │ │ ├── Cmd_CallVM.cs
│ │ │ ├── Cmd_pglCopyFogColor.cs
│ │ │ ├── Cmd_pglStoreFogColor.cs
│ │ │ ├── Cmd_pglEnable19_14.cs
│ │ │ ├── Cmd_pglEnable17.cs
│ │ │ ├── Cmd_pglEnableDepthMask.cs
│ │ │ ├── Cmd_pglEnableAlphaTest.cs
│ │ │ ├── Cmd_pglEnableDepthTest.cs
│ │ │ ├── Cmd_pglDisableAlphaTest.cs
│ │ │ ├── Cmd_pglDisableDepthMask.cs
│ │ │ ├── Cmd_pglDisableDepthTest.cs
│ │ │ ├── Cmd_pglEnableDestinationAlphaTest.cs
│ │ │ ├── Cmd_pglDisableDestinationAlphaTest.cs
│ │ │ ├── Cmd_JumpByte.cs
│ │ │ ├── Cmd_pglEnableCullFace.cs
│ │ │ ├── Cmd_JumpShort.cs
│ │ │ ├── Cmd_pglTexGenf_Default.cs
│ │ │ ├── Cmd_pgluCallShape_Byte.cs
│ │ │ ├── Cmd_VMCallbackByte.cs
│ │ │ ├── Cmd_pglPushMatrix.cs
│ │ │ ├── Cmd_pgluSetExternalMatIndex.cs
│ │ │ ├── Cmd_VMCallbackUShort.cs
│ │ │ ├── Cmd_pglDisableCullFace.cs
│ │ │ ├── Cmd_pgluCallShape_UShort.cs
│ │ │ └── Cmd_pglPopMatrix.cs
│ │ └── CarModel1
│ │ │ ├── ExhaustData.cs
│ │ │ └── CollisionParticle.cs
│ ├── ShapeStream
│ │ └── ShapeStreamShape.cs
│ └── Shaders
│ │ └── ShaderProgram_0x40.cs
├── Textures
│ ├── TextureSet3ClutInfoBase.cs
│ ├── PGLUTextureInfo.cs
│ └── Texture.cs
├── Sound
│ ├── Se
│ │ └── Meta
│ │ │ └── ISeMeta.cs
│ ├── Ssqt
│ │ └── Meta
│ │ │ ├── ISqMeta.cs
│ │ │ └── SqSetTempoEvent.cs
│ └── PS2
│ │ └── MusicInf
│ │ ├── Track.cs
│ │ └── Playlist.cs
├── Courses
│ ├── Minimap
│ │ └── CourseMapPoint.cs
│ ├── Runway
│ │ ├── RunwayRoadVert.cs
│ │ └── RunwayStartingGridPosition.cs
│ └── PS2
│ │ └── Runway
│ │ └── RunwayRoadVert.cs
├── Tri.cs
├── Color4f.cs
└── Vec3R.cs
├── PDTools.LiveTimingApi
├── README.md
├── Entities
│ └── LiveTimingBestLapEntry.cs
└── PDTools.LiveTimingApi.csproj
├── PDTools.RText
├── RTextConstants.cs
├── README.md
├── RTextPairUnit.cs
├── PDTools.RText.csproj
└── RTextBase.cs
├── PDTools.GrimSonyDLSBuilder
├── PaceFileInfoPiece.cs
└── PDTools.GrimSonyDLSBuilder.csproj
├── PDTools.Crypto
├── SimulationInterface
│ └── ISimulationInterfaceCryptor.cs
├── PDTools.Crypto.csproj
└── README.md
├── PDTools.SimulatorInterface
├── README.md
├── PDTools.SimulatorInterface.csproj
└── SimulatorInterfaceGameType.cs
├── PDTools.LiveTimingApiTestTool
└── PDTools.LiveTimingApiTestTool.csproj
├── PDTools.GrimPFS
├── PDTools.GrimPFS.csproj
└── GrimPatchFile.cs
├── PDTools.Files.Fonts.NVecBuilder
├── README.md
└── PDTools.Files.Fonts.NVecBuilder.csproj
├── PDTools.Utils
├── PDTools.Utils.csproj
├── README.md
├── MathUtils.cs
└── ByteBufferComparer.cs
└── PDTools.Structures
├── PDTools.Structures.csproj
├── DbCode.cs
└── MGameParameter
└── BoostParams.cs
/PDTools.Utils.Tests/MSTestSettings.cs:
--------------------------------------------------------------------------------
1 | [assembly: Parallelize(Scope = ExecutionScope.MethodLevel)]
2 |
--------------------------------------------------------------------------------
/PDTools.GTPatcher/libdebug.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nenkai/PDTools/HEAD/PDTools.GTPatcher/libdebug.dll
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "Typography"]
2 | path = Typography
3 | url = https://github.com/LayoutFarm/Typography.git
4 |
--------------------------------------------------------------------------------
/PDTools.SimulatorInterfaceTestTool/README.md:
--------------------------------------------------------------------------------
1 | # PDTools.SimulatorInterfaceTestTool
2 |
3 | Test client for the SimulatorInterface implementation.
4 |
--------------------------------------------------------------------------------
/PDTools.SaveFile/README.md:
--------------------------------------------------------------------------------
1 | # PDTools.SaveFiles
2 |
3 | Mainly for GT4. Used by [GT4SaveEditor](https://github.com/Nenkai/GT4SaveEditor). This library is just about finished.
4 |
--------------------------------------------------------------------------------
/PDTools.ScapesDataHelper/README.md:
--------------------------------------------------------------------------------
1 | # PDTools.ScapesDataHelper
2 |
3 | Extracts and decrypts scapes setups from certain JPEG XL (.jxl) files, present within exif data as a custom tag.
--------------------------------------------------------------------------------
/PDTools.Enums/PDTools.Enums.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net9.0
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/PDTools.Hashing/README.md:
--------------------------------------------------------------------------------
1 | # PDTools.Hashing
2 |
3 | A few variants of CRC32 & their poly numbers. Used in various places in the games. SHA-512 is unfinished, tried to reverse it from GT4's CORE.GT4 RSA hashing.
4 |
--------------------------------------------------------------------------------
/PDTools.PDIWheelCryptor/README.md:
--------------------------------------------------------------------------------
1 | # PDIWheelCryptor
2 |
3 | Intended for Gran Turismo 7.
4 |
5 | Decrypts and encrypts `pdiWheel.prx` from , which is a `PARAM.SFO` file disguised as a dynamic module (prx) file.
6 |
--------------------------------------------------------------------------------
/PDTools.Compression/README.md:
--------------------------------------------------------------------------------
1 | # PDTools.Compression
2 | Handles all compression needs.
3 | * PS2ZIP - GT3 to GT7 - Inflate, starts with `0xC5EEF7FF` magic. Used very frequently.
4 | * PDIZIP - GTS - Inflate fragments
5 | * ZSTD - GT7, used by main volume
6 |
--------------------------------------------------------------------------------
/PDTools.GT4ElfBuilderTool/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "profiles": {
3 | "PDTools.GT4ElfBuilderTool": {
4 | "commandName": "Project",
5 | "commandLineArgs": "\"D:\\Modding_Research\\Gran_Turismo\\GT4PreProd\\CORE.GT4\" test.elf"
6 | }
7 | }
8 | }
--------------------------------------------------------------------------------
/PDTools.SpecDB/SpecDBQueryResult.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace PDTools.SpecDB;
8 |
9 | public class SpecDBQueryResult
10 | {
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/STStruct/Nodes/STObjectNull.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using System.Diagnostics;
5 |
6 | namespace PDTools.STStruct.Nodes;
7 |
8 | [DebuggerDisplay("Nil")]
9 | class STObjectNull : NodeBase
10 | {
11 | }
12 |
--------------------------------------------------------------------------------
/PDTools.Files/Fonts/IGlyphShapeData.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace PDTools.Files.Fonts;
8 |
9 | public interface IGlyphShapeData
10 | {
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/PDTools.GTPatcher/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "profiles": {
3 | "PS4Dbg": {
4 | "commandName": "Project",
5 | "commandLineArgs": "-i 192.168.137.148 -a demo_preset_car=ambulance_himedic_21,gr_corolla_morizo_22,corvette_c1_58 --build debug"
6 | }
7 | }
8 | }
--------------------------------------------------------------------------------
/PDTools.LiveTimingApi/README.md:
--------------------------------------------------------------------------------
1 | # PDTools.LiveTimingApi
2 |
3 | For GT7. Requires user whitelist flag or game modded to enable features.
4 |
5 | This is essentially a websocket client with far more information than the SimulatorInterface (which, is NOT a source of telemetry to begin with)
6 |
--------------------------------------------------------------------------------
/STStruct/Nodes/STObject.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using System.Diagnostics;
5 |
6 | namespace PDTools.STStruct.Nodes;
7 |
8 | [DebuggerDisplay("Object")]
9 | public class STObject : NodeBase
10 | {
11 | public NodeBase Child;
12 | }
13 |
--------------------------------------------------------------------------------
/PDTools.Hashing/PDTools.Hashing.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net9.0
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/STStruct/Nodes/STString.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using System.Diagnostics;
5 |
6 | namespace PDTools.STStruct.Nodes;
7 |
8 | [DebuggerDisplay("{Name} (String)")]
9 | public class STString : NodeBase
10 | {
11 | public string Name { get; set; }
12 | }
13 |
--------------------------------------------------------------------------------
/PDTools.RText/RTextConstants.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace PDTools.RText;
8 |
9 | public class RTextConstants
10 | {
11 | public const string CRYPTO_KEY = "majimenihataraiteimasu";
12 | }
13 |
--------------------------------------------------------------------------------
/PDTools.GrimSonyDLSBuilder/PaceFileInfoPiece.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace PDTools.GrimSonyDLSBuilder;
8 |
9 | public class PaceFileInfoPiece
10 | {
11 | public byte[] Hash { get; set; }
12 | }
13 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS3/ModelSet3/FVF/MDL3FVFDefinitionCollection.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace PDTools.Files.Models.PS3.ModelSet3.FVF;
8 |
9 | internal class MDL3FVFDefinitionCollection
10 | {
11 | }
12 |
--------------------------------------------------------------------------------
/PDTools.RText/README.md:
--------------------------------------------------------------------------------
1 | # PDTools.RText
2 |
3 | Localization file handlers.
4 |
5 | GT5 duplicates categories across projects, which is annoying. GT6 has just one singular file, which is nice.
6 |
7 | The decryption key for rtexts >= GT6 is normally in the executable, not in a adhoc script.
8 |
9 | GTS/GT7 uses 64-bit pointers.
10 |
--------------------------------------------------------------------------------
/STStruct/Nodes/STArray.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using System.Diagnostics;
5 |
6 | namespace PDTools.STStruct.Nodes;
7 |
8 | [DebuggerDisplay("Array[{Elements.Count}]")]
9 | public class STArray : NodeBase
10 | {
11 | public List Elements { get; set; }
12 | }
13 |
--------------------------------------------------------------------------------
/PDTools.Files/Textures/TextureSet3ClutInfoBase.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace PDTools.Files.Textures;
8 |
9 | public abstract class TextureSet3ClutInfoBase
10 | {
11 | public byte[] ClutData { get; set; }
12 | }
13 |
--------------------------------------------------------------------------------
/PDTools.Files/Sound/Se/Meta/ISeMeta.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData;
8 |
9 | namespace PDTools.Files.Sound.Se.Meta;
10 |
11 | public interface ISeMeta
12 | {
13 | public void Read(BinaryStream bs);
14 | }
15 |
--------------------------------------------------------------------------------
/PDTools.Files/Sound/Ssqt/Meta/ISqMeta.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData;
8 |
9 | namespace PDTools.Files.Sound.Ssqt.Meta;
10 |
11 | public interface ISqMeta
12 | {
13 | public void Read(BinaryStream bs);
14 | }
15 |
--------------------------------------------------------------------------------
/STStruct/Nodes/STMap.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using System.Diagnostics;
5 |
6 | namespace PDTools.STStruct.Nodes;
7 |
8 | [DebuggerDisplay("Map: {Elements.Count} Elements")]
9 | public class STMap : NodeBase
10 | {
11 | public Dictionary Elements { get; set; } = [];
12 | }
13 |
--------------------------------------------------------------------------------
/PDTools.LiveTimingApi/Entities/LiveTimingBestLapEntry.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace PDTools.LiveTimingApi.Entities;
8 |
9 | public class LiveTimingBestLapEntry
10 | {
11 | public LiveTimingEntry BestlapEntry { get; set; }
12 | }
13 |
--------------------------------------------------------------------------------
/PDTools.SpecDB/Core/Mapping/Types/IDBType.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData;
8 |
9 | namespace PDTools.SpecDB.Core.Mapping.Types;
10 |
11 | public interface IDBType
12 | {
13 | void Serialize(BinaryStream bs);
14 | }
15 |
--------------------------------------------------------------------------------
/PDTools.Crypto/SimulationInterface/ISimulationInterfaceCryptor.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace PDTools.Crypto.SimulationInterface;
8 |
9 | public interface ISimulationInterfaceCryptor
10 | {
11 | void Decrypt(Span bytes);
12 | }
13 |
--------------------------------------------------------------------------------
/PDTools.SpecDB/Core/RowKey.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.ComponentModel;
7 | using System.Diagnostics;
8 |
9 | namespace PDTools.SpecDB.Core;
10 |
11 | public class RowKey
12 | {
13 | public int Id { get; set; }
14 | public string Label { get; set; }
15 | }
16 |
--------------------------------------------------------------------------------
/PDTools.SaveFile/GT4/ISerializableGT4Entity.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using Syroot.BinaryData.Memory;
5 |
6 | namespace PDTools.SaveFile.GT4;
7 |
8 | public interface IGameSerializeBase
9 | {
10 | void CopyTo(T obj);
11 |
12 | void Unpack(GT4Save save, ref SpanReader sr);
13 | void Pack(GT4Save save, ref SpanWriter sw);
14 | }
15 |
--------------------------------------------------------------------------------
/PDTools.SimulatorInterface/README.md:
--------------------------------------------------------------------------------
1 | # PDTools.SimulatorInterface
2 |
3 | SimulatorInterface originally meant to be used by motion rig. This is the first ever open-source implementation.
4 |
5 | This works for GT6/GTS/GT7.
6 |
7 | This is **NOT** a telemetry source, quite some stuff is missing in general so you have to make do. Normally you would want to use the LiveTiming API instead, but PDI closes that down.
8 |
--------------------------------------------------------------------------------
/STStruct/Nodes/MBlob.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using System.Diagnostics;
5 |
6 | namespace PDTools.STStruct.Nodes;
7 |
8 | [DebuggerDisplay("byte[{Data.Length}]")]
9 | public class MBlob : NodeBase
10 | {
11 | public MBlob(Memory data)
12 | {
13 | Data = data;
14 | }
15 | public Memory Data { get; set; }
16 | }
17 |
--------------------------------------------------------------------------------
/STStruct/Nodes/STUShort.cs:
--------------------------------------------------------------------------------
1 | using System.Diagnostics;
2 |
3 | namespace PDTools.STStruct.Nodes;
4 |
5 | [DebuggerDisplay("{Value} (UShort)")]
6 | public class STUShort : NodeBase
7 | {
8 | public STUShort(ushort val)
9 | {
10 | Value = val;
11 | }
12 |
13 | public ushort Value { get; set; }
14 |
15 | public override string ToString()
16 | => Value.ToString();
17 | }
18 |
--------------------------------------------------------------------------------
/PDTools.PDIWheelCryptor/PDTools.PDIWheelCryptor.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net9.0
6 | enable
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/PDTools.SaveFile/GT4/UserProfile/DayEvents/DayEvent.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using Syroot.BinaryData.Memory;
5 |
6 | using PDTools.Enums.PS2;
7 |
8 | using PDTools.Structures;
9 |
10 | namespace PDTools.SaveFile.GT4.UserProfile.DayEvents;
11 |
12 | public interface IDayEvent : IGameSerializeBase
13 | {
14 | DayEventType EventType { get; }
15 | }
16 |
--------------------------------------------------------------------------------
/PDTools.Crypto/PDTools.Crypto.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net9.0
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/PDTools.GT4ElfBuilderTool/README.md:
--------------------------------------------------------------------------------
1 | ## PDTools.GT4ElfBuilderTool
2 | Builds elf executables based on compressed/encrypted CORE.GT4 files for reverse-engineering (GT4)
3 |
4 | Presumably CORE executables were made to allow 'updating' the game, or at least its executable, based on evidence from GT4O adhoc scripts.
5 |
6 | Refer to [this page on the modding hub](https://nenkai.github.io/gt-modding-hub/ps2/executables/) for more info.
7 |
--------------------------------------------------------------------------------
/PDTools.Files/Courses/Minimap/CourseMapPoint.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace PDTools.Files.Courses.Minimap;
8 |
9 | public class CourseMapPoint
10 | {
11 | public short X { get; set; }
12 | public short Y { get; set; }
13 | public short Z { get; set; }
14 | public short Unk { get; set; }
15 | }
16 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS3/ModelSet3/PackedMesh/Commands/SmoothMeshTessellationCommand6.cs:
--------------------------------------------------------------------------------
1 | using PDTools.Utils;
2 |
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 |
9 | namespace PDTools.Files.Models.PS3.ModelSet3.PackedMesh.Commands;
10 |
11 | public class SmoothMeshTessellationCommand6 : SmoothMeshTessellationCommandBase
12 | {
13 |
14 | }
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS3/ModelSet3/PackedMesh/Commands/SmoothMeshTessellationCommand8.cs:
--------------------------------------------------------------------------------
1 | using PDTools.Utils;
2 |
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 |
9 | namespace PDTools.Files.Models.PS3.ModelSet3.PackedMesh.Commands;
10 |
11 | public class SmoothMeshTessellationCommand8 : SmoothMeshTessellationCommandBase
12 | {
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/VM/RegisterValue.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace PDTools.Files.Models.VM
8 | {
9 | public struct RegisterVal
10 | {
11 | public int Value { get; set; }
12 |
13 | public RegisterVal(int value)
14 | {
15 | Value = value;
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/PDTools.LiveTimingApiTestTool/PDTools.LiveTimingApiTestTool.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | net9.0
4 | disable
5 | Exe
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/PDTools.Files/Courses/Runway/RunwayRoadVert.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Numerics;
7 |
8 | namespace PDTools.Files.Courses.Runway
9 | {
10 | public class RunwayRoadVert
11 | {
12 | public Vector3 Vertex { get; set; }
13 | public ushort Unk1;
14 | public ushort Unk2;
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/PDTools.Files/Tri.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace PDTools.Files;
8 |
9 | public struct Tri
10 | {
11 | public ushort A;
12 | public ushort B;
13 | public ushort C;
14 |
15 | public Tri(ushort a, ushort b, ushort c)
16 | {
17 | A = a;
18 | B = b;
19 | C = c;
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/PDTools.GrimSonyDLSBuilder/PDTools.GrimSonyDLSBuilder.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net9.0
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/PDTools.GTPatcher/MemoryPatches/IMemoryPatch.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using libdebug;
8 |
9 | namespace PDTools.GTPatcher.MemoryPatches;
10 |
11 | public interface IMemoryPatch
12 | {
13 | void Init(GTPatcher dbg);
14 |
15 | void OnAttach(GTPatcher dbg);
16 |
17 | void Patch(GTPatcher dbg, GeneralRegisters regs);
18 | }
19 |
--------------------------------------------------------------------------------
/PDTools.GTPatcher/Breakpoint.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace PDTools.GTPatcher;
8 |
9 | public class Breakpoint
10 | {
11 | public int Index { get; }
12 | public ulong Offset { get; set; }
13 |
14 | public Breakpoint(int index, ulong offset)
15 | {
16 | Index = index;
17 | Offset = offset;
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/PDTools.GrimPFS/PDTools.GrimPFS.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | net9.0
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/PDTools.LiveTimingApi/PDTools.LiveTimingApi.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | net9.0
4 | true
5 | Library
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/STStruct/Nodes/STByte.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using System.Diagnostics;
5 |
6 | namespace PDTools.STStruct.Nodes;
7 |
8 | [DebuggerDisplay("{Value} (Byte)")]
9 | public class STByte : NodeBase
10 | {
11 | public STByte(byte val)
12 | {
13 | Value = val;
14 | }
15 |
16 | public byte Value { get; set; }
17 |
18 | public override string ToString()
19 | => Value.ToString();
20 | }
21 |
--------------------------------------------------------------------------------
/STStruct/Nodes/STLong.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using System.Diagnostics;
5 |
6 | namespace PDTools.STStruct.Nodes;
7 |
8 | [DebuggerDisplay("{Value} (Long)")]
9 | public class STLong : NodeBase
10 | {
11 | public STLong(long val)
12 | {
13 | Value = val;
14 | }
15 |
16 | public long Value { get; set; }
17 |
18 | public override string ToString()
19 | => Value.ToString();
20 | }
21 |
--------------------------------------------------------------------------------
/STStruct/Nodes/STUInt.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using System.Diagnostics;
5 |
6 | namespace PDTools.STStruct.Nodes;
7 |
8 | [DebuggerDisplay("{Value} (UInt)")]
9 | public class STUInt : NodeBase
10 | {
11 | public STUInt(uint val)
12 | {
13 | Value = val;
14 | }
15 |
16 | public uint Value { get; set; }
17 |
18 | public override string ToString()
19 | => Value.ToString();
20 | }
21 |
--------------------------------------------------------------------------------
/PDTools.RText/RTextPairUnit.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace PDTools.RText;
6 |
7 | public class RTextPairUnit
8 | {
9 | public int ID { get; set; }
10 | public string Label { get; set; }
11 | public string Value { get; set; }
12 |
13 | public RTextPairUnit(int id, string label, string value)
14 | {
15 | ID = id;
16 | Label = label;
17 | Value = value;
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/STStruct/Nodes/STFloat.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using System.Diagnostics;
5 |
6 | namespace PDTools.STStruct.Nodes;
7 |
8 | [DebuggerDisplay("{Value} (Float)")]
9 | public class STFloat : NodeBase
10 | {
11 | public STFloat(float val)
12 | {
13 | Value = val;
14 | }
15 |
16 | public float Value { get; set; }
17 |
18 | public override string ToString()
19 | => Value.ToString();
20 | }
21 |
--------------------------------------------------------------------------------
/STStruct/Nodes/STSByte.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using System.Diagnostics;
5 |
6 | namespace PDTools.STStruct.Nodes;
7 |
8 | [DebuggerDisplay("{Value} (SByte)")]
9 | public class STSByte : NodeBase
10 | {
11 | public STSByte(sbyte val)
12 | {
13 | Value = val;
14 | }
15 |
16 | public sbyte Value { get; set; }
17 |
18 | public override string ToString()
19 | => Value.ToString();
20 | }
21 |
--------------------------------------------------------------------------------
/STStruct/Nodes/STShort.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using System.Diagnostics;
5 |
6 | namespace PDTools.STStruct.Nodes;
7 |
8 | [DebuggerDisplay("{Value} (Short)")]
9 | public class STShort : NodeBase
10 | {
11 | public STShort(short val)
12 | {
13 | Value = val;
14 | }
15 |
16 | public short Value { get; set; }
17 |
18 | public override string ToString()
19 | => Value.ToString();
20 | }
21 |
--------------------------------------------------------------------------------
/STStruct/Nodes/STULong.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using System.Diagnostics;
5 |
6 | namespace PDTools.STStruct.Nodes;
7 |
8 | [DebuggerDisplay("{Value} (ULong)")]
9 | public class STULong : NodeBase
10 | {
11 | public STULong(ulong val)
12 | {
13 | Value = val;
14 | }
15 |
16 | public ulong Value { get; set; }
17 |
18 | public override string ToString()
19 | => Value.ToString();
20 | }
21 |
--------------------------------------------------------------------------------
/PDTools.GTPatcher/BreakLoggers/IBreakLogger.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using libdebug;
8 |
9 | namespace PDTools.GTPatcher.BreakLoggers;
10 |
11 | public interface IBreakLogger
12 | {
13 | void Init(GTPatcher PS4);
14 |
15 | bool CheckHit(GTPatcher dbg, GeneralRegisters registers);
16 |
17 | void OnBreak(GTPatcher dbg, GeneralRegisters registers);
18 | }
19 |
--------------------------------------------------------------------------------
/PDTools.RText/PDTools.RText.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net9.0
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/STStruct/Nodes/STInt.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using System.Diagnostics;
5 |
6 | namespace PDTools.STStruct.Nodes;
7 |
8 | [DebuggerDisplay("{Value} (Int)")]
9 | public class STInt : NodeBase
10 | {
11 | public STInt(int val)
12 | {
13 | Value = val;
14 | }
15 |
16 | public int Value { get; set; }
17 | public NodeBase KeyConfigNode { get; set; }
18 | public override string ToString()
19 | => Value.ToString();
20 | }
21 |
--------------------------------------------------------------------------------
/PDTools.GT4ElfBuilderTool/ElfSegment.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace PDTools.GT4ElfBuilderTool;
6 |
7 | public class ElfSegment
8 | {
9 | public string Name { get; set; }
10 |
11 | public int TargetOffset { get; set; }
12 | public int Size { get; set; }
13 |
14 | public byte[] Data { get; set; }
15 |
16 | ///
17 | /// Used for serializing
18 | ///
19 | public long OffsetInElf { get; set; }
20 | }
21 |
--------------------------------------------------------------------------------
/PDTools.SpecDB/Core/Mapping/Tables/Maker.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData.Core;
8 | using Syroot.BinaryData.Memory;
9 |
10 | namespace PDTools.SpecDB.Core.Mapping.Tables;
11 |
12 | public class Maker : TableMetadata
13 | {
14 | public Maker(SpecDBFolder folderType)
15 | {
16 | Columns.Add(new ColumnMetadata("Maker", DBColumnType.String, "UnistrDB.sdb"));
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/PDTools.SpecDB/Core/Mapping/Tables/Tuner.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData.Core;
8 | using Syroot.BinaryData.Memory;
9 |
10 | namespace PDTools.SpecDB.Core.Mapping.Tables;
11 |
12 | public class Tuner : TableMetadata
13 | {
14 | public Tuner(SpecDBFolder folderType)
15 | {
16 | Columns.Add(new ColumnMetadata("Name", DBColumnType.String, "UnistrDB.sdb"));
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/PDTools.SpecDB/Core/Mapping/Tables/GenericCarInfo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData.Core;
8 | using Syroot.BinaryData.Memory;
9 |
10 | namespace PDTools.SpecDB.Core.Mapping.Tables;
11 |
12 | public class GenericCarInfo : TableMetadata
13 | {
14 | public GenericCarInfo(SpecDBFolder folderType)
15 | {
16 | Columns.Add(new ColumnMetadata("?", DBColumnType.Byte));
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/PDTools.SpecDB/Core/Mapping/Tables/IndepThrottle.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData.Core;
8 | using Syroot.BinaryData.Memory;
9 |
10 | namespace PDTools.SpecDB.Core.Mapping.Tables;
11 |
12 | public class IndepThrottle : TableMetadata
13 | {
14 | public IndepThrottle(SpecDBFolder folderType)
15 | {
16 | Columns.Add(new ColumnMetadata("category", DBColumnType.Byte));
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/PDTools.Files.Fonts.NVecBuilder/README.md:
--------------------------------------------------------------------------------
1 | ## PDTools.Files.Fonts.NVecBuilder
2 | TTF to NVEC Font file converter for GT5/GT6
3 |
4 | > [!NOTE]
5 | > Not fully finished, some spacing between characters is off, due to my lack of TTF knowledge and how it maps to VEC.
6 | >
7 | > 010 Editor template is available [here](https://github.com/Nenkai/GT-File-Specifications-Documentation/blob/master/Formats/PS3/Fonts/NVec_VectorFont.bt).
8 | >
9 | > [FontDrop](https://fontdrop.info/?darkmode=true) is an excellent website for previewing TTF data.
10 |
--------------------------------------------------------------------------------
/PDTools.SpecDB/Core/Mapping/Tables/CourseName.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData.Core;
8 | using Syroot.BinaryData.Memory;
9 |
10 | namespace PDTools.SpecDB.Core.Mapping.Tables;
11 |
12 | public class CourseName : TableMetadata
13 | {
14 | public CourseName(SpecDBFolder folderType, string locale)
15 | {
16 | Columns.Add(new ColumnMetadata("Name", DBColumnType.String, locale));
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/STStruct/NodeBase.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace PDTools.STStruct;
6 |
7 | public abstract class NodeBase
8 | {
9 | public NodeType Type { get; set; }
10 | }
11 |
12 | public enum NodeType
13 | {
14 | Null,
15 | SByte,
16 | Short,
17 | Int,
18 | Long,
19 | Float,
20 | MBlob,
21 | String,
22 | Array,
23 | Map,
24 | Object,
25 | Bool,
26 | UByte,
27 | UShort,
28 | UInt = 0x0E,
29 | Double = 0x0F,
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS3/ModelSet3/PackedMesh/Commands/SmoothMeshTessellationCommand0.cs:
--------------------------------------------------------------------------------
1 | using PDTools.Utils;
2 |
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 |
9 | namespace PDTools.Files.Models.PS3.ModelSet3.PackedMesh.Commands;
10 |
11 | public class SmoothMeshTessellationCommand0 : SmoothMeshTessellationCommandBase
12 | {
13 | public override void Read(SmoothMeshTessellationCommandContext ctx, ref BitStream bs)
14 | {
15 |
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/PDTools.GTPatcher/PDTools.GTPatcher.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net9.0
6 | disable
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | libdebug.dll
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/PDTools.Files/Sound/Ssqt/Meta/SqSetTempoEvent.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData;
8 |
9 | namespace PDTools.Files.Sound.Ssqt.Meta;
10 |
11 | public class SqSetTempoEvent : ISqMeta
12 | {
13 | public uint UsecPerQuarterNote { get; set; }
14 |
15 | public void Read(BinaryStream bs)
16 | {
17 | UsecPerQuarterNote = (uint)(bs.ReadByte() << 16 | bs.Read1Byte() << 8 | bs.Read1Byte());
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/PDTools.Files/Fonts/GlyphPoint.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace PDTools.Files.Fonts;
8 |
9 | public struct GlyphPoint : IGlyphShapeData
10 | {
11 | public float X { get; set; }
12 | public float Y { get; set; }
13 |
14 | public GlyphPoint(float x, float y)
15 | {
16 | X = x;
17 | Y = y;
18 | }
19 |
20 | public override readonly string ToString()
21 | {
22 | return $"Point - X: {X}, Y: {Y}";
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/PDTools.Files/Sound/PS2/MusicInf/Track.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace PDTools.Files.Sound.PS2.MusicInf;
8 |
9 | public class Track
10 | {
11 | public Playlist ParentPlaylist { get; set; }
12 |
13 | public int Index { get; set; }
14 |
15 | public string Code { get; set; }
16 | public string File { get; set; }
17 | public string Title { get; set; }
18 | public string Artist { get; set; }
19 | public string Genre { get; set; }
20 | }
21 |
--------------------------------------------------------------------------------
/PDTools.SpecDB/PDTools.SpecDB.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net9.0
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/PDTools.SimulatorInterface/PDTools.SimulatorInterface.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net9.0
5 | true
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS2/ModelSet/ModelPS2Base.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using PDTools.Files.Models.PS2.RenderCommands;
8 | using PDTools.Files.Textures.PS2;
9 |
10 | namespace PDTools.Files.Models.PS2.ModelSet;
11 |
12 | public abstract class ModelPS2Base
13 | {
14 | ///
15 | /// Commands interpreted on every tick to figure how and what shape should be rendered.
16 | ///
17 | public List Commands { get; set; } = [];
18 | }
19 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS3/ModelSet3/PackedMesh/Commands/SmoothMeshTessellationCommand16.cs:
--------------------------------------------------------------------------------
1 | using PDTools.Utils;
2 |
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Diagnostics;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 |
10 | namespace PDTools.Files.Models.PS3.ModelSet3.PackedMesh.Commands;
11 |
12 | public class SmoothMeshTessellationCommand16 : SmoothMeshTessellationCommandBase
13 | {
14 | public override void Read(SmoothMeshTessellationCommandContext ctx, ref BitStream bs)
15 | {
16 | base.Read(ctx, ref bs);
17 | }
18 | }
--------------------------------------------------------------------------------
/PDTools.Files/Models/VM/Instructions/VM0xC2.cs:
--------------------------------------------------------------------------------
1 | using Syroot.BinaryData;
2 |
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 |
9 | namespace PDTools.Files.Models.VM.Instructions;
10 |
11 | public class VM0xC2 : VMInstruction
12 | {
13 | public override VMInstructionOpcode Opcode => VMInstructionOpcode.Unk0xC2;
14 |
15 | public override void Read(BinaryStream bs, int commandsBaseOffset)
16 | {
17 |
18 | }
19 |
20 | public override void Write(BinaryStream bs)
21 | {
22 |
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/PDTools.SpecDB/Core/Mapping/Tables/CarVariation.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData.Core;
8 | using Syroot.BinaryData.Memory;
9 |
10 | namespace PDTools.SpecDB.Core.Mapping.Tables;
11 |
12 | public class CarVariation : TableMetadata
13 | {
14 | public override string LabelPrefix { get; } = "";
15 |
16 | public CarVariation(SpecDBFolder folderType, string localeName)
17 | {
18 | Columns.Add(new ColumnMetadata("VariationID", DBColumnType.Key));
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/PDTools.Files.Fonts.NVecBuilder/PDTools.Files.Fonts.NVecBuilder.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net9.0
6 | nvec_builder
7 | True
8 | nvec_builder
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/VM/Instructions/VMUnaryMinus.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData;
8 |
9 | namespace PDTools.Files.Models.VM.Instructions;
10 |
11 | public class VMUnaryMinus : VMInstruction
12 | {
13 | public override VMInstructionOpcode Opcode => VMInstructionOpcode.UnaryMinusOperator;
14 |
15 | public override void Read(BinaryStream bs, int commandsBaseOffset)
16 | {
17 |
18 | }
19 |
20 | public override void Write(BinaryStream bs)
21 | {
22 |
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/PDTools.Files/Fonts/GlyphLine.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace PDTools.Files.Fonts;
8 |
9 | public struct GlyphLine : IGlyphShapeData
10 | {
11 | public float Distance { get; set; }
12 | public GlyphAxis Axis { get; set; }
13 |
14 | public GlyphLine(float distance, GlyphAxis axis)
15 | {
16 | Distance = distance;
17 | Axis = axis;
18 | }
19 |
20 | public override readonly string ToString()
21 | {
22 | return $"Line - {Axis}: {Distance}";
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS3/ModelSet3/PackedMesh/Commands/SmoothMeshTessellationCommand2.cs:
--------------------------------------------------------------------------------
1 | using PDTools.Utils;
2 |
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 |
9 | namespace PDTools.Files.Models.PS3.ModelSet3.PackedMesh.Commands;
10 |
11 | public class SmoothMeshTessellationCommand2 : SmoothMeshTessellationCommandBase
12 | {
13 | public ushort Unk { get; set; }
14 |
15 | public override void Read(SmoothMeshTessellationCommandContext ctx, ref BitStream bs)
16 | {
17 | Unk = (ushort)bs.ReadBits(12);
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/PDTools.Crypto/README.md:
--------------------------------------------------------------------------------
1 | ## PDTools.Crypto
2 | Library for dealing with crypto. Contains:
3 | * `GT4ReplayCrypto` - Used for decrypting GT4 Replays, but unfinished due to weird PS2 floats involved.
4 | * `MCipher` class - Generic encryption class, also used for saves (GT5/6/7)
5 | * `MTRandom` class - Used for pseudo-randomness generation
6 | * `Salsa20` class - Used in movie, database encryption in GT5/6 & more
7 | * `Chacha20` class - Used in GT7 volume & more
8 | * `PDIPFSDownloaderCrypto` class - Used for GT5/6 online patch update encryption
9 | * `SimulationInterface` folder - Sim Interface encryption handling for GT6, GTS, GT7
10 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/VM/Instructions/VMUnaryMinusF.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData;
8 |
9 | namespace PDTools.Files.Models.VM.Instructions;
10 |
11 | public class VMUnaryMinusF : VMInstruction
12 | {
13 | public override VMInstructionOpcode Opcode => VMInstructionOpcode.FloatUnaryMinusOperator;
14 |
15 | public override void Read(BinaryStream bs, int commandsBaseOffset)
16 | {
17 |
18 | }
19 |
20 | public override void Write(BinaryStream bs)
21 | {
22 |
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/VM/Instructions/VMUnaryBitwiseNot.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData;
8 |
9 | namespace PDTools.Files.Models.VM.Instructions;
10 |
11 | public class VMUnaryBitwiseNot : VMInstruction
12 | {
13 | public override VMInstructionOpcode Opcode => VMInstructionOpcode.UnaryBitwiseNotOperator;
14 |
15 | public override void Read(BinaryStream bs, int commandsBaseOffset)
16 | {
17 |
18 | }
19 |
20 | public override void Write(BinaryStream bs)
21 | {
22 |
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/PDTools.SpecDB/Core/Mapping/Tables/Wing.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData.Core;
8 | using Syroot.BinaryData.Memory;
9 |
10 | namespace PDTools.SpecDB.Core.Mapping.Tables;
11 |
12 | public class Wing : TableMetadata
13 | {
14 | public Wing(SpecDBFolder folderType)
15 | {
16 | Columns.Add(new ColumnMetadata("?", DBColumnType.Short));
17 | Columns.Add(new ColumnMetadata("?", DBColumnType.Short));
18 | Columns.Add(new ColumnMetadata("?", DBColumnType.Short));
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS3/ModelSet3/PackedMesh/Commands/SmoothMeshTessellationCommand17.cs:
--------------------------------------------------------------------------------
1 | using PDTools.Utils;
2 |
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Diagnostics;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 |
10 | namespace PDTools.Files.Models.PS3.ModelSet3.PackedMesh.Commands;
11 |
12 | public class SmoothMeshTessellationCommand17 : SmoothMeshTessellationCommandBase
13 | {
14 | public byte Unk { get; set; }
15 | public override void Read(SmoothMeshTessellationCommandContext ctx, ref BitStream bs)
16 | {
17 | Unk = (byte)bs.ReadBits(2);
18 | }
19 | }
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS3/ModelSet3/PackedMesh/Commands/SmoothMeshTessellationCommand1.cs:
--------------------------------------------------------------------------------
1 | using PDTools.Utils;
2 |
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 |
9 | namespace PDTools.Files.Models.PS3.ModelSet3.PackedMesh.Commands;
10 |
11 | public class SmoothMeshTessellationCommand1 : SmoothMeshTessellationCommandBase
12 | {
13 | public ushort NumTrianglesMaybe { get; set; }
14 |
15 | public override void Read(SmoothMeshTessellationCommandContext ctx, ref BitStream bs)
16 | {
17 | NumTrianglesMaybe = (ushort)bs.ReadBits(12);
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/PDTools.SimulatorInterface/SimulatorInterfaceGameType.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace PDTools.SimulatorInterface;
8 |
9 | ///
10 | /// Games supporting a Simulation Interface.
11 | ///
12 | public enum SimulatorInterfaceGameType
13 | {
14 | ///
15 | /// Gran Turismo 6
16 | ///
17 | GT6,
18 |
19 | ///
20 | /// Gran Turismo Sport
21 | ///
22 | GTSport,
23 |
24 | ///
25 | /// Gran Turismo 7
26 | ///
27 | GT7
28 | }
29 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS3/ModelSet3/Wing/MDL3WingData.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData;
8 |
9 | namespace PDTools.Files.Models.PS3.ModelSet3.Wing;
10 |
11 | public class MDL3WingData
12 | {
13 | public string Name { get; set; }
14 |
15 | public static MDL3WingData FromStream(BinaryStream bs, long mdlBasePos, ushort mdl3VersionMajor)
16 | {
17 | MDL3WingData entry = new();
18 |
19 |
20 | return entry;
21 | }
22 |
23 | public static int GetSize()
24 | {
25 | return 0x80;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/PDTools.Files/Textures/PGLUTextureInfo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using SixLabors.ImageSharp;
8 |
9 | using Syroot.BinaryData;
10 |
11 | namespace PDTools.Files.Textures;
12 |
13 | public abstract class PGLUTextureInfo
14 | {
15 | public string Name { get; set; }
16 |
17 | public TextureSet3Buffer BufferInfo { get; set; }
18 | public uint BufferId { get; set; }
19 |
20 | public abstract Image GetAsImage();
21 |
22 | public abstract void Write(BinaryStream bs);
23 |
24 | public abstract void Read(BinaryStream bs, long basePos);
25 | }
26 |
--------------------------------------------------------------------------------
/PDTools.ScapesDataHelper/PDTools.ScapesDataHelper.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Library
5 | net9.0
6 | enable
7 | true
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/PDTools.SpecDB/Core/Mapping/Tables/EnemyCars.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData.Core;
8 | using Syroot.BinaryData.Memory;
9 |
10 | namespace PDTools.SpecDB.Core.Mapping.Tables;
11 |
12 | public class EnemyCars : TableMetadata
13 | {
14 | public EnemyCars(SpecDBFolder folderType)
15 | {
16 | Columns.Add(new ColumnMetadata("GenericCar", DBColumnType.Key));
17 | Columns.Add(new ColumnMetadata("DefaultParts", DBColumnType.Key));
18 | Columns.Add(new ColumnMetadata("DefaultParam", DBColumnType.Key));
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/PDTools.SpecDB/Core/Mapping/Tables/TunedCars.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData.Core;
8 | using Syroot.BinaryData.Memory;
9 |
10 | namespace PDTools.SpecDB.Core.Mapping.Tables;
11 |
12 | public class TunedCars : TableMetadata
13 | {
14 | public TunedCars(SpecDBFolder folderType)
15 | {
16 | Columns.Add(new ColumnMetadata("CarCode", DBColumnType.Key));
17 | Columns.Add(new ColumnMetadata("DefaultParts", DBColumnType.Key));
18 | Columns.Add(new ColumnMetadata("DefaultParam", DBColumnType.Key));
19 |
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/PDTools.SimulatorInterfaceTestTool/PDTools.SimulatorInterfaceTestTool.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net9.0
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS3/ModelSet3/PackedMesh/Commands/SmoothMeshTessellationCommand12.cs:
--------------------------------------------------------------------------------
1 | using PDTools.Utils;
2 |
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 |
9 | namespace PDTools.Files.Models.PS3.ModelSet3.PackedMesh.Commands;
10 |
11 | public class SmoothMeshTessellationCommand12 : SmoothMeshTessellationCommandBase
12 | {
13 | public uint Unk { get; set; }
14 | public ushort Unk2 { get; set; }
15 | public override void Read(SmoothMeshTessellationCommandContext ctx, ref BitStream bs)
16 | {
17 | Unk = (uint)bs.ReadBits(20);
18 | Unk2 = (ushort)bs.ReadBits(9);
19 | }
20 | }
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS3/PGLCommands/Command_0_End.cs:
--------------------------------------------------------------------------------
1 | using Syroot.BinaryData;
2 |
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 |
9 | namespace PDTools.Files.Models.PS3.PGLCommands
10 | {
11 | public class Command_0_End : ModelSetupCommand
12 | {
13 | public override void Read(BinaryStream bs, int commandsBaseOffset)
14 | {
15 |
16 | }
17 |
18 | public override void Write(BinaryStream bs)
19 | {
20 |
21 | }
22 |
23 | public override string ToString()
24 | {
25 | return nameof(Command_0_End);
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/PDTools.SpecDB/ISpecDB.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using System.Threading.Tasks;
5 | using System.Threading;
6 |
7 | namespace PDTools.SpecDB;
8 |
9 | public interface ISpecDB
10 | {
11 | Task InitializeAsync(string path, CancellationTokenSource cancellationTokenSrc);
12 |
13 | Task GetCarRowByCodeAsync(int code, CancellationTokenSource cancellationTokenSrc);
14 | Task GetCarRowByLabelAsync(string label, CancellationTokenSource cancellationTokenSrc);
15 |
16 | Task GetRowAsync(string table, int code, CancellationTokenSource cancellationTokenSrc);
17 | }
18 |
19 | public enum SpecDBKind
20 | {
21 | Old,
22 | SQLite
23 | }
24 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS3/ModelSet3/PackedMesh/Commands/SmoothMeshTessellationCommand11.cs:
--------------------------------------------------------------------------------
1 | using PDTools.Utils;
2 |
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 |
9 | namespace PDTools.Files.Models.PS3.ModelSet3.PackedMesh.Commands;
10 |
11 | public class SmoothMeshTessellationCommand11 : SmoothMeshTessellationCommandBase
12 | {
13 | public ushort Unk { get; set; }
14 | public ushort Unk2 { get; set; }
15 | public override void Read(SmoothMeshTessellationCommandContext ctx, ref BitStream bs)
16 | {
17 | Unk = (ushort)bs.ReadBits(10);
18 | Unk2 = (ushort)bs.ReadBits(12);
19 | }
20 | }
--------------------------------------------------------------------------------
/PDTools.GrimPFS/GrimPatchFile.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace PDTools.GrimPFS;
8 |
9 | public class GrimPatchFile
10 | {
11 | public GrimPatchFileType FileType { get; set; }
12 |
13 | public uint FileIndex { get; set; }
14 |
15 | public string GamePath { get; set; }
16 |
17 | public string PFSPath { get; set; }
18 |
19 | public uint ChunkId { get; set; }
20 |
21 | public string DownloadPath { get; set; }
22 | }
23 |
24 | public enum GrimPatchFileType
25 | {
26 | PatchSequence,
27 | UpdateNodeInfo,
28 | Header,
29 | TOC,
30 | GameFile,
31 | }
32 |
--------------------------------------------------------------------------------
/PDTools.SpecDB/Core/Mapping/Tables/TireSize.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData.Core;
8 | using Syroot.BinaryData.Memory;
9 |
10 | namespace PDTools.SpecDB.Core.Mapping.Tables;
11 |
12 | public class TireSize : TableMetadata
13 | {
14 | public TireSize(SpecDBFolder folderType)
15 | {
16 | Columns.Add(new ColumnMetadata("flatness", DBColumnType.Byte));
17 | Columns.Add(new ColumnMetadata("category", DBColumnType.Byte));
18 | Columns.Add(new ColumnMetadata("diameter", DBColumnType.Byte));
19 | Columns.Add(new ColumnMetadata("width", DBColumnType.Byte));
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS3/ModelSet3/Materials/CellGcmParams.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData;
8 |
9 | namespace PDTools.Files.Models.PS3.ModelSet3.Materials;
10 |
11 | public class CellGcmParams
12 | {
13 | public int[] Params { get; set; } = new int[40];
14 |
15 | public static CellGcmParams FromStream(BinaryStream bs, long mdlBasePos, ushort mdl3VersionMajor)
16 | {
17 | CellGcmParams entry = new();
18 | entry.Params = bs.ReadInt32s(40);
19 |
20 | return entry;
21 | }
22 |
23 | public static int GetSize()
24 | {
25 | return 0xA0;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS3/PGLCommands/Command_44_CallVM_Ptr2.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData;
8 |
9 | namespace PDTools.Files.Models.PS3.PGLCommands
10 | {
11 | public class Command_44_CallVM_Ptr2 : ModelSetupCommand
12 | {
13 |
14 | public override void Read(BinaryStream bs, int commandsBaseOffset)
15 | {
16 |
17 | }
18 |
19 | public override void Write(BinaryStream bs)
20 | {
21 |
22 | }
23 |
24 | public override string ToString()
25 | {
26 | return $"{nameof(Command_44_CallVM_Ptr2)}";
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/VM/Instructions/VMAdd.cs:
--------------------------------------------------------------------------------
1 | using Syroot.BinaryData;
2 |
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 |
9 | namespace PDTools.Files.Models.VM.Instructions;
10 |
11 | public class VMAdd : VMInstruction
12 | {
13 | public override VMInstructionOpcode Opcode => VMInstructionOpcode.Add;
14 |
15 | public override void Read(BinaryStream bs, int commandsBaseOffset)
16 | {
17 |
18 | }
19 |
20 | public override void Write(BinaryStream bs)
21 | {
22 |
23 | }
24 |
25 | public override string Disassemble(Dictionary values)
26 | {
27 | return $"ADD: +";
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/PDTools.Utils/PDTools.Utils.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net9.0
5 |
6 |
7 |
8 | false
9 | true
10 |
11 |
12 |
13 | true
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/VM/Instructions/VMCosF.cs:
--------------------------------------------------------------------------------
1 | using Syroot.BinaryData;
2 |
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 |
9 | namespace PDTools.Files.Models.VM.Instructions;
10 |
11 | public class VMCosF : VMInstruction
12 | {
13 | public override VMInstructionOpcode Opcode => VMInstructionOpcode.FloatCos;
14 |
15 | public override void Read(BinaryStream bs, int commandsBaseOffset)
16 | {
17 |
18 | }
19 |
20 | public override void Write(BinaryStream bs)
21 | {
22 |
23 | }
24 |
25 | public override string Disassemble(Dictionary values)
26 | {
27 | return $"COSF";
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/VM/Instructions/VMSinF.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData;
8 |
9 | namespace PDTools.Files.Models.VM.Instructions;
10 |
11 | public class VMSinF : VMInstruction
12 | {
13 | public override VMInstructionOpcode Opcode => VMInstructionOpcode.FloatSin;
14 |
15 | public override void Read(BinaryStream bs, int commandsBaseOffset)
16 | {
17 |
18 | }
19 |
20 | public override void Write(BinaryStream bs)
21 | {
22 |
23 | }
24 |
25 | public override string Disassemble(Dictionary values)
26 | {
27 | return $"SINF";
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/VM/Instructions/VMTanF.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData;
8 |
9 | namespace PDTools.Files.Models.VM.Instructions;
10 |
11 | public class VMTanF : VMInstruction
12 | {
13 | public override VMInstructionOpcode Opcode => VMInstructionOpcode.FloatTan;
14 |
15 | public override void Read(BinaryStream bs, int commandsBaseOffset)
16 | {
17 |
18 | }
19 |
20 | public override void Write(BinaryStream bs)
21 | {
22 |
23 | }
24 |
25 | public override string Disassemble(Dictionary values)
26 | {
27 | return $"TANF";
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/PDTools.SaveFile/PDTools.SaveFile.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net9.0
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS3/PGLCommands/Command_40_SetCullFaceBack.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData;
8 |
9 | namespace PDTools.Files.Models.PS3.PGLCommands
10 | {
11 | public class Command_40_SetCullFaceBack : ModelSetupCommand
12 | {
13 |
14 | public override void Read(BinaryStream bs, int commandsBaseOffset)
15 | {
16 |
17 | }
18 |
19 | public override void Write(BinaryStream bs)
20 | {
21 |
22 | }
23 |
24 | public override string ToString()
25 | {
26 | return $"{nameof(Command_40_SetCullFaceBack)}";
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/VM/Instructions/VMMaxF.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData;
8 |
9 | namespace PDTools.Files.Models.VM.Instructions;
10 |
11 | public class VMMaxF : VMInstruction
12 | {
13 | public override VMInstructionOpcode Opcode => VMInstructionOpcode.FloatMax;
14 |
15 | public override void Read(BinaryStream bs, int commandsBaseOffset)
16 | {
17 |
18 | }
19 |
20 | public override void Write(BinaryStream bs)
21 | {
22 |
23 | }
24 |
25 | public override string Disassemble(Dictionary values)
26 | {
27 | return $"MATH_MAX";
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/VM/Instructions/VMMinF.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData;
8 |
9 | namespace PDTools.Files.Models.VM.Instructions;
10 |
11 | public class VMMinF : VMInstruction
12 | {
13 | public override VMInstructionOpcode Opcode => VMInstructionOpcode.FloatMin;
14 |
15 | public override void Read(BinaryStream bs, int commandsBaseOffset)
16 | {
17 |
18 | }
19 |
20 | public override void Write(BinaryStream bs)
21 | {
22 |
23 | }
24 |
25 | public override string Disassemble(Dictionary values)
26 | {
27 | return $"MATH_MIN";
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/VM/Instructions/VMPowF.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData;
8 |
9 | namespace PDTools.Files.Models.VM.Instructions;
10 |
11 | public class VMPowF : VMInstruction
12 | {
13 | public override VMInstructionOpcode Opcode => VMInstructionOpcode.FloatPow;
14 |
15 | public override void Read(BinaryStream bs, int commandsBaseOffset)
16 | {
17 |
18 | }
19 |
20 | public override void Write(BinaryStream bs)
21 | {
22 |
23 | }
24 |
25 | public override string Disassemble(Dictionary values)
26 | {
27 | return $"POW_FLOAT";
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/VM/Instructions/VMSqrtF.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData;
8 |
9 | namespace PDTools.Files.Models.VM.Instructions;
10 |
11 | public class VMSqrtF : VMInstruction
12 | {
13 | public override VMInstructionOpcode Opcode => VMInstructionOpcode.FloatSquare;
14 |
15 | public override void Read(BinaryStream bs, int commandsBaseOffset)
16 | {
17 |
18 | }
19 |
20 | public override void Write(BinaryStream bs)
21 | {
22 |
23 | }
24 |
25 | public override string Disassemble(Dictionary values)
26 | {
27 | return $"SQRT";
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/STStruct/PDTools.STStruct.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | net9.0
4 | true
5 | 1.0.0.0
6 | 1.0.0.0
7 | 1.0.0
8 | true
9 | Library
10 | STStruct
11 | STStruct
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/PDTools.Files/Fonts/GlyphStartPoint.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace PDTools.Files.Fonts;
8 |
9 | public struct GlyphStartPoint : IGlyphShapeData
10 | {
11 | public float X { get; set; }
12 | public float Y { get; set; }
13 |
14 | public bool? Unk { get; set; }
15 | public bool? Unk2 { get; set; }
16 |
17 | public GlyphStartPoint(float x, float y)
18 | {
19 | X = x;
20 | Y = y;
21 |
22 | Unk = null;
23 | Unk2 = null;
24 | }
25 |
26 | public override readonly string ToString()
27 | {
28 | return $"Start Point - X: {X}, Y:{Y}, {Unk} {Unk2}";
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS3/PGLCommands/Command_41_SetCullFaceFront.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData;
8 |
9 | namespace PDTools.Files.Models.PS3.PGLCommands
10 | {
11 | public class Command_41_SetCullFaceFront : ModelSetupCommand
12 | {
13 |
14 | public override void Read(BinaryStream bs, int commandsBaseOffset)
15 | {
16 |
17 | }
18 |
19 | public override void Write(BinaryStream bs)
20 | {
21 |
22 | }
23 |
24 | public override string ToString()
25 | {
26 | return $"{nameof(Command_41_SetCullFaceFront)}";
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS3/PGLCommands/Command_42_SetCullFaceSwitch.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData;
8 |
9 | namespace PDTools.Files.Models.PS3.PGLCommands
10 | {
11 | public class Command_42_SetCullFaceSwitch : ModelSetupCommand
12 | {
13 |
14 | public override void Read(BinaryStream bs, int commandsBaseOffset)
15 | {
16 |
17 | }
18 |
19 | public override void Write(BinaryStream bs)
20 | {
21 |
22 | }
23 |
24 | public override string ToString()
25 | {
26 | return $"{nameof(Command_42_SetCullFaceSwitch)}";
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/VM/Instructions/VMAtan2F.cs:
--------------------------------------------------------------------------------
1 | using Syroot.BinaryData;
2 |
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 |
9 | namespace PDTools.Files.Models.VM.Instructions;
10 |
11 | public class VMAtan2F : VMInstruction
12 | {
13 | public override VMInstructionOpcode Opcode => VMInstructionOpcode.FloatAtan2;
14 |
15 | public override void Read(BinaryStream bs, int commandsBaseOffset)
16 | {
17 |
18 | }
19 |
20 | public override void Write(BinaryStream bs)
21 | {
22 |
23 | }
24 |
25 | public override string Disassemble(Dictionary values)
26 | {
27 | return $"ATAN2F";
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/VM/Instructions/VMEquals.cs:
--------------------------------------------------------------------------------
1 | using Syroot.BinaryData;
2 |
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 |
9 | namespace PDTools.Files.Models.VM.Instructions;
10 |
11 | public class VMEquals : VMInstruction
12 | {
13 | public override VMInstructionOpcode Opcode => VMInstructionOpcode.Equals;
14 |
15 | public override void Read(BinaryStream bs, int commandsBaseOffset)
16 | {
17 |
18 | }
19 |
20 | public override void Write(BinaryStream bs)
21 | {
22 |
23 | }
24 |
25 | public override string Disassemble(Dictionary values)
26 | {
27 | return $"EQUALS: ==";
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/VM/Instructions/VMModulo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData;
8 |
9 | namespace PDTools.Files.Models.VM.Instructions;
10 |
11 | public class VMModulo : VMInstruction
12 | {
13 | public override VMInstructionOpcode Opcode => VMInstructionOpcode.Modulo;
14 |
15 | public override void Read(BinaryStream bs, int commandsBaseOffset)
16 | {
17 |
18 | }
19 |
20 | public override void Write(BinaryStream bs)
21 | {
22 |
23 | }
24 |
25 | public override string Disassemble(Dictionary values)
26 | {
27 | return $"MODULO: %";
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/VM/Instructions/VMRandF.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData;
8 |
9 | namespace PDTools.Files.Models.VM.Instructions;
10 |
11 | public class VMRandF : VMInstruction
12 | {
13 | public override VMInstructionOpcode Opcode => VMInstructionOpcode.FloatRand;
14 |
15 | public override void Read(BinaryStream bs, int commandsBaseOffset)
16 | {
17 |
18 | }
19 |
20 | public override void Write(BinaryStream bs)
21 | {
22 |
23 | }
24 |
25 | public override string Disassemble(Dictionary values)
26 | {
27 | return $"RAND_FLOAT";
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/VM/Instructions/VMSignF.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData;
8 |
9 | namespace PDTools.Files.Models.VM.Instructions;
10 |
11 | public class VMSignF : VMInstruction
12 | {
13 | public override VMInstructionOpcode Opcode => VMInstructionOpcode.FloatSign;
14 |
15 | public override void Read(BinaryStream bs, int commandsBaseOffset)
16 | {
17 |
18 | }
19 |
20 | public override void Write(BinaryStream bs)
21 | {
22 |
23 | }
24 |
25 | public override string Disassemble(Dictionary values)
26 | {
27 | return $"SIGN_FLOAT";
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS3/ModelSet3/Materials/MDL3MaterialData_0x1C.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData;
8 |
9 | namespace PDTools.Files.Models.PS3.ModelSet3.Materials;
10 |
11 | public class MDL3MaterialData_0x1C
12 | {
13 | public int Unk { get; set; }
14 | public int Unk2 { get; set; }
15 |
16 | public static MDL3MaterialData_0x1C FromStream(BinaryStream bs, long mdlBasePos, ushort mdl3VersionMajor)
17 | {
18 | MDL3MaterialData_0x1C entry = new MDL3MaterialData_0x1C();
19 |
20 | entry.Unk = bs.ReadInt32();
21 | entry.Unk2 = bs.ReadInt32();
22 |
23 | return entry;
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS3/ModelSet3/PackedMesh/Commands/SmoothMeshTessellationCommand14.cs:
--------------------------------------------------------------------------------
1 | using PDTools.Utils;
2 |
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 |
9 | namespace PDTools.Files.Models.PS3.ModelSet3.PackedMesh.Commands;
10 |
11 | public class SmoothMeshTessellationCommand14 : SmoothMeshTessellationCommandBase
12 | {
13 | public ushort VertexIndexStart { get; set; }
14 | public ushort VertexIndexCount { get; set; }
15 |
16 | public override void Read(SmoothMeshTessellationCommandContext ctx, ref BitStream bs)
17 | {
18 | VertexIndexStart = (ushort)bs.ReadBits(12);
19 | VertexIndexCount = (ushort)bs.ReadBits(12);
20 | }
21 | }
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS3/PGLCommands/Command_38_SetCullFaceDisable.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData;
8 |
9 | namespace PDTools.Files.Models.PS3.PGLCommands
10 | {
11 | public class Command_38_SetCullFaceDisable : ModelSetupCommand
12 | {
13 |
14 | public override void Read(BinaryStream bs, int commandsBaseOffset)
15 | {
16 |
17 | }
18 |
19 | public override void Write(BinaryStream bs)
20 | {
21 |
22 | }
23 |
24 | public override string ToString()
25 | {
26 | return $"{nameof(Command_38_SetCullFaceDisable)}";
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS3/PGLCommands/Command_39_SetCullFaceDisable.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData;
8 |
9 | namespace PDTools.Files.Models.PS3.PGLCommands
10 | {
11 | public class Command_39_SetCullFaceDisable : ModelSetupCommand
12 | {
13 |
14 | public override void Read(BinaryStream bs, int commandsBaseOffset)
15 | {
16 |
17 | }
18 |
19 | public override void Write(BinaryStream bs)
20 | {
21 |
22 | }
23 |
24 | public override string ToString()
25 | {
26 | return $"{nameof(Command_39_SetCullFaceDisable)}";
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/ShapeStream/ShapeStreamShape.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Syroot.BinaryData.Memory;
3 | using System.IO;
4 | using PDTools.Files.Models.PS3.ModelSet3.ShapeStream;
5 |
6 | namespace PDTools.Files.Models.ShapeStream;
7 |
8 | public class ShapeStreamShape
9 | {
10 | public const int HeaderSize = 0x80;
11 |
12 | public ShapeStreamChunk ShapeStreamChunk { get; set; }
13 | public MDL3ShapeStreamingInfoShapeEntry InfoMeshEntry { get; set; }
14 |
15 | public Memory MeshData { get; set; }
16 | public uint ChunkSize { get; set; }
17 | public uint VerticesOffset { get; set; }
18 | public uint TriOffset { get; set; }
19 | public uint BBoxOffset { get; set; }
20 | public uint Unk0x1COffset { get; set; }
21 | }
22 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/VM/Instructions/VMAddF.cs:
--------------------------------------------------------------------------------
1 | using Syroot.BinaryData;
2 |
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 |
9 | namespace PDTools.Files.Models.VM.Instructions;
10 |
11 | public class VMAddF : VMInstruction
12 | {
13 | public override VMInstructionOpcode Opcode => VMInstructionOpcode.FloatAddition;
14 |
15 | public override void Read(BinaryStream bs, int commandsBaseOffset)
16 | {
17 |
18 | }
19 |
20 | public override void Write(BinaryStream bs)
21 | {
22 |
23 | }
24 |
25 | public override string Disassemble(Dictionary values)
26 | {
27 | return $"ADD_FLOAT: /";
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/VM/Instructions/VMDivide.cs:
--------------------------------------------------------------------------------
1 | using Syroot.BinaryData;
2 |
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 |
9 | namespace PDTools.Files.Models.VM.Instructions;
10 |
11 | public class VMDivide : VMInstruction
12 | {
13 | public override VMInstructionOpcode Opcode => VMInstructionOpcode.Divide;
14 |
15 | public override void Read(BinaryStream bs, int commandsBaseOffset)
16 | {
17 |
18 | }
19 |
20 | public override void Write(BinaryStream bs)
21 | {
22 |
23 | }
24 |
25 | public override string Disassemble(Dictionary values)
26 | {
27 | return $"BINARY_DIVIDE: /";
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/VM/Instructions/VMMultiply.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData;
8 |
9 | namespace PDTools.Files.Models.VM.Instructions;
10 |
11 | public class VMMultiply : VMInstruction
12 | {
13 | public override VMInstructionOpcode Opcode => VMInstructionOpcode.Multiply;
14 |
15 | public override void Read(BinaryStream bs, int commandsBaseOffset)
16 | {
17 |
18 | }
19 |
20 | public override void Write(BinaryStream bs)
21 | {
22 |
23 | }
24 |
25 | public override string Disassemble(Dictionary values)
26 | {
27 | return $"MULTIPLY: *";
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/VM/Instructions/VMSubtract.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData;
8 |
9 | namespace PDTools.Files.Models.VM.Instructions;
10 |
11 | public class VMSubtract : VMInstruction
12 | {
13 | public override VMInstructionOpcode Opcode => VMInstructionOpcode.Subtract;
14 |
15 | public override void Read(BinaryStream bs, int commandsBaseOffset)
16 | {
17 |
18 | }
19 |
20 | public override void Write(BinaryStream bs)
21 | {
22 |
23 | }
24 |
25 | public override string Disassemble(Dictionary values)
26 | {
27 | return $"SUBTRACT: -";
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS2/RenderCommands/Cmd_CallVM.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Numerics;
7 |
8 | using Syroot.BinaryData;
9 |
10 | namespace PDTools.Files.Models.PS2.RenderCommands;
11 |
12 | public class Cmd_CallVM : ModelSetupPS2Command
13 | {
14 | public override ModelSetupPS2Opcode Opcode => ModelSetupPS2Opcode.CallVM;
15 |
16 | public override void Read(BinaryStream bs, int commandsBaseOffset)
17 | {
18 |
19 | }
20 |
21 | public override void Write(BinaryStream bs)
22 | {
23 |
24 | }
25 |
26 | public override string ToString()
27 | {
28 | return $"{nameof(Cmd_CallVM)}";
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/VM/Instructions/VMBinaryAnd.cs:
--------------------------------------------------------------------------------
1 | using Syroot.BinaryData;
2 |
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 |
9 | namespace PDTools.Files.Models.VM.Instructions;
10 |
11 | public class VMBinaryAnd : VMInstruction
12 | {
13 | public override VMInstructionOpcode Opcode => VMInstructionOpcode.BinaryAndOperator;
14 |
15 | public override void Read(BinaryStream bs, int commandsBaseOffset)
16 | {
17 |
18 | }
19 |
20 | public override void Write(BinaryStream bs)
21 | {
22 |
23 | }
24 |
25 | public override string Disassemble(Dictionary values)
26 | {
27 | return $"AND: &";
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/VM/Instructions/VMBinaryOr.cs:
--------------------------------------------------------------------------------
1 | using Syroot.BinaryData;
2 |
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 |
9 | namespace PDTools.Files.Models.VM.Instructions;
10 |
11 | public class VMBinaryOr : VMInstruction
12 | {
13 | public override VMInstructionOpcode Opcode => VMInstructionOpcode.BinaryOrOperator;
14 |
15 | public override void Read(BinaryStream bs, int commandsBaseOffset)
16 | {
17 |
18 | }
19 |
20 | public override void Write(BinaryStream bs)
21 | {
22 |
23 | }
24 |
25 | public override string Disassemble(Dictionary values)
26 | {
27 | return $"OR: |";
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/VM/Instructions/VMBinaryXor.cs:
--------------------------------------------------------------------------------
1 | using Syroot.BinaryData;
2 |
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 |
9 | namespace PDTools.Files.Models.VM.Instructions;
10 |
11 | public class VMBinaryXor : VMInstruction
12 | {
13 | public override VMInstructionOpcode Opcode => VMInstructionOpcode.BinaryXorOperator;
14 |
15 | public override void Read(BinaryStream bs, int commandsBaseOffset)
16 | {
17 |
18 | }
19 |
20 | public override void Write(BinaryStream bs)
21 | {
22 |
23 | }
24 |
25 | public override string Disassemble(Dictionary values)
26 | {
27 | return $"XOR: ^";
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/VM/Instructions/VMEqualsF.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData;
8 |
9 | namespace PDTools.Files.Models.VM.Instructions;
10 |
11 | public class VMEqualsF : VMInstruction
12 | {
13 | public override VMInstructionOpcode Opcode => VMInstructionOpcode.FloatEquals;
14 |
15 | public override void Read(BinaryStream bs, int commandsBaseOffset)
16 | {
17 |
18 | }
19 |
20 | public override void Write(BinaryStream bs)
21 | {
22 |
23 | }
24 |
25 | public override string Disassemble(Dictionary values)
26 | {
27 | return $"EQUALS_FLOAT: ==";
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/VM/Instructions/VMFloatToInt.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData;
8 |
9 | namespace PDTools.Files.Models.VM.Instructions;
10 |
11 | public class VMFloatToInt : VMInstruction
12 | {
13 | public override VMInstructionOpcode Opcode => VMInstructionOpcode.ToInt;
14 |
15 | public override void Read(BinaryStream bs, int commandsBaseOffset)
16 | {
17 |
18 | }
19 |
20 | public override void Write(BinaryStream bs)
21 | {
22 |
23 | }
24 |
25 | public override string Disassemble(Dictionary values)
26 | {
27 | return $"FLOAT_TO_INT";
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/VM/Instructions/VMIntToFloat.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData;
8 |
9 | namespace PDTools.Files.Models.VM.Instructions;
10 |
11 | public class VMIntToFloat : VMInstruction
12 | {
13 | public override VMInstructionOpcode Opcode => VMInstructionOpcode.ToFloat;
14 |
15 | public override void Read(BinaryStream bs, int commandsBaseOffset)
16 | {
17 |
18 | }
19 |
20 | public override void Write(BinaryStream bs)
21 | {
22 |
23 | }
24 |
25 | public override string Disassemble(Dictionary values)
26 | {
27 | return $"INT_TO_CONST";
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/VM/Instructions/VMModuloF.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData;
8 |
9 | namespace PDTools.Files.Models.VM.Instructions;
10 |
11 | public class VMModuloF : VMInstruction
12 | {
13 | public override VMInstructionOpcode Opcode => VMInstructionOpcode.FloatModulus;
14 |
15 | public override void Read(BinaryStream bs, int commandsBaseOffset)
16 | {
17 |
18 | }
19 |
20 | public override void Write(BinaryStream bs)
21 | {
22 |
23 | }
24 |
25 | public override string Disassemble(Dictionary values)
26 | {
27 | return $"MODULO_FLOAT: %";
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/VM/Instructions/VMNotEquals.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData;
8 |
9 | namespace PDTools.Files.Models.VM.Instructions;
10 |
11 | public class VMNotEquals : VMInstruction
12 | {
13 | public override VMInstructionOpcode Opcode => VMInstructionOpcode.NotEqual;
14 |
15 | public override void Read(BinaryStream bs, int commandsBaseOffset)
16 | {
17 |
18 | }
19 |
20 | public override void Write(BinaryStream bs)
21 | {
22 |
23 | }
24 |
25 | public override string Disassemble(Dictionary values)
26 | {
27 | return $"NOT_EQUAL: !=";
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/PDTools.GT4ElfBuilderTool/PDTools.GT4ElfBuilderTool.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net9.0
6 | disable
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/VM/Instructions/VMLesserThan.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData;
8 |
9 | namespace PDTools.Files.Models.VM.Instructions;
10 |
11 | public class VMLesserThan : VMInstruction
12 | {
13 | public override VMInstructionOpcode Opcode => VMInstructionOpcode.LesserThan;
14 |
15 | public override void Read(BinaryStream bs, int commandsBaseOffset)
16 | {
17 |
18 | }
19 |
20 | public override void Write(BinaryStream bs)
21 | {
22 |
23 | }
24 |
25 | public override string Disassemble(Dictionary values)
26 | {
27 | return $"LESSER_THAN: <";
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/VM/Instructions/VMDivideF.cs:
--------------------------------------------------------------------------------
1 | using Syroot.BinaryData;
2 |
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 |
9 | namespace PDTools.Files.Models.VM.Instructions;
10 |
11 | public class VMDivideF : VMInstruction
12 | {
13 | public override VMInstructionOpcode Opcode => VMInstructionOpcode.FloatDivide;
14 |
15 | public override void Read(BinaryStream bs, int commandsBaseOffset)
16 | {
17 |
18 | }
19 |
20 | public override void Write(BinaryStream bs)
21 | {
22 |
23 | }
24 |
25 | public override string Disassemble(Dictionary values)
26 | {
27 | return $"BINARY_DIVIDE_FLOAT: /";
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/VM/Instructions/VMGreaterThan.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData;
8 |
9 | namespace PDTools.Files.Models.VM.Instructions;
10 |
11 | public class VMGreaterThan : VMInstruction
12 | {
13 | public override VMInstructionOpcode Opcode => VMInstructionOpcode.GreaterThen;
14 |
15 | public override void Read(BinaryStream bs, int commandsBaseOffset)
16 | {
17 |
18 | }
19 |
20 | public override void Write(BinaryStream bs)
21 | {
22 |
23 | }
24 |
25 | public override string Disassemble(Dictionary values)
26 | {
27 | return $"GREATER_THAN: >";
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/VM/Instructions/VMMultiplyF.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData;
8 |
9 | namespace PDTools.Files.Models.VM.Instructions;
10 |
11 | public class VMMultiplyF : VMInstruction
12 | {
13 | public override VMInstructionOpcode Opcode => VMInstructionOpcode.FloatMultiply;
14 |
15 | public override void Read(BinaryStream bs, int commandsBaseOffset)
16 | {
17 |
18 | }
19 |
20 | public override void Write(BinaryStream bs)
21 | {
22 |
23 | }
24 |
25 | public override string Disassemble(Dictionary values)
26 | {
27 | return $"MULTIPLY_FLOAT: *";
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/VM/Instructions/VMSubtractF.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData;
8 |
9 | namespace PDTools.Files.Models.VM.Instructions;
10 |
11 | public class VMSubtractF : VMInstruction
12 | {
13 | public override VMInstructionOpcode Opcode => VMInstructionOpcode.FloatSubtract;
14 |
15 | public override void Read(BinaryStream bs, int commandsBaseOffset)
16 | {
17 |
18 | }
19 |
20 | public override void Write(BinaryStream bs)
21 | {
22 |
23 | }
24 |
25 | public override string Disassemble(Dictionary values)
26 | {
27 | return $"SUBTRACT_FLOAT: -";
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/VM/Instructions/VMNotEqualsF.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData;
8 |
9 | namespace PDTools.Files.Models.VM.Instructions;
10 |
11 | public class VMNotEqualsF : VMInstruction
12 | {
13 | public override VMInstructionOpcode Opcode => VMInstructionOpcode.FloatNotEquals;
14 |
15 | public override void Read(BinaryStream bs, int commandsBaseOffset)
16 | {
17 |
18 | }
19 |
20 | public override void Write(BinaryStream bs)
21 | {
22 |
23 | }
24 |
25 | public override string Disassemble(Dictionary values)
26 | {
27 | return $"NOT_EQUAl_FLOAT: !=";
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS3/PGLCommands/Command_24_SetDepthTestEnabled.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Numerics;
7 |
8 | using Syroot.BinaryData;
9 |
10 | namespace PDTools.Files.Models.PS3.PGLCommands
11 | {
12 | public class Command_24_SetDepthTestEnabled : ModelSetupCommand
13 | {
14 | public override void Read(BinaryStream bs, int commandsBaseOffset)
15 | {
16 |
17 | }
18 |
19 | public override void Write(BinaryStream bs)
20 | {
21 |
22 | }
23 |
24 | public override string ToString()
25 | {
26 | return $"{nameof(Command_24_SetDepthTestEnabled)}";
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS3/PGLCommands/Command_25_SetDepthTestDisabled.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Numerics;
7 |
8 | using Syroot.BinaryData;
9 |
10 | namespace PDTools.Files.Models.PS3.PGLCommands
11 | {
12 | public class Command_25_SetDepthTestDisabled : ModelSetupCommand
13 | {
14 | public override void Read(BinaryStream bs, int commandsBaseOffset)
15 | {
16 |
17 | }
18 |
19 | public override void Write(BinaryStream bs)
20 | {
21 |
22 | }
23 |
24 | public override string ToString()
25 | {
26 | return $"{nameof(Command_25_SetDepthTestDisabled)}";
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS3/PGLCommands/Command_27_SetAlphaTestEnabled.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Numerics;
7 |
8 | using Syroot.BinaryData;
9 |
10 | namespace PDTools.Files.Models.PS3.PGLCommands
11 | {
12 | public class Command_27_SetAlphaTestEnabled : ModelSetupCommand
13 | {
14 | public override void Read(BinaryStream bs, int commandsBaseOffset)
15 | {
16 |
17 | }
18 |
19 | public override void Write(BinaryStream bs)
20 | {
21 |
22 | }
23 |
24 | public override string ToString()
25 | {
26 | return $"{nameof(Command_27_SetAlphaTestEnabled)}";
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS3/PGLCommands/Command_28_SetAlphaTestDisabled.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Numerics;
7 |
8 | using Syroot.BinaryData;
9 |
10 | namespace PDTools.Files.Models.PS3.PGLCommands
11 | {
12 | public class Command_28_SetAlphaTestDisabled : ModelSetupCommand
13 | {
14 | public override void Read(BinaryStream bs, int commandsBaseOffset)
15 | {
16 |
17 | }
18 |
19 | public override void Write(BinaryStream bs)
20 | {
21 |
22 | }
23 |
24 | public override string ToString()
25 | {
26 | return $"{nameof(Command_28_SetAlphaTestDisabled)}";
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/VM/Instructions/VMGreaterThanF.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData;
8 |
9 | namespace PDTools.Files.Models.VM.Instructions;
10 |
11 | public class VMGreaterThanF : VMInstruction
12 | {
13 | public override VMInstructionOpcode Opcode => VMInstructionOpcode.FloatGreaterThen;
14 |
15 | public override void Read(BinaryStream bs, int commandsBaseOffset)
16 | {
17 |
18 | }
19 |
20 | public override void Write(BinaryStream bs)
21 | {
22 |
23 | }
24 |
25 | public override string Disassemble(Dictionary values)
26 | {
27 | return $"GREATER_THAN_FLOAT: >";
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/VM/Instructions/VMLesserEqualTo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData;
8 |
9 | namespace PDTools.Files.Models.VM.Instructions;
10 |
11 | public class VMLesserEqualTo : VMInstruction
12 | {
13 | public override VMInstructionOpcode Opcode => VMInstructionOpcode.LesserOrEqualTo;
14 |
15 | public override void Read(BinaryStream bs, int commandsBaseOffset)
16 | {
17 |
18 | }
19 |
20 | public override void Write(BinaryStream bs)
21 | {
22 |
23 | }
24 |
25 | public override string Disassemble(Dictionary values)
26 | {
27 | return $"LESSER_EQUAL_TO: <=";
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/VM/Instructions/VMLesserThanF.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData;
8 |
9 | namespace PDTools.Files.Models.VM.Instructions;
10 |
11 | public class VMLesserThanF : VMInstruction
12 | {
13 | public override VMInstructionOpcode Opcode => VMInstructionOpcode.FloatLesserThan;
14 |
15 | public override void Read(BinaryStream bs, int commandsBaseOffset)
16 | {
17 |
18 | }
19 |
20 | public override void Write(BinaryStream bs)
21 | {
22 |
23 | }
24 |
25 | public override string Disassemble(Dictionary values)
26 | {
27 | return $"LESSER_EQUAL_TO_FLOAT: <";
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS3/PGLCommands/Command_70_Unk.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData;
8 |
9 | namespace PDTools.Files.Models.PS3.PGLCommands
10 | {
11 | ///
12 | /// Not present in GT PSP
13 | ///
14 | public class Command_70_Unk : ModelSetupCommand
15 | {
16 | public override void Read(BinaryStream bs, int commandsBaseOffset)
17 | {
18 |
19 | }
20 |
21 | public override void Write(BinaryStream bs)
22 | {
23 |
24 | }
25 |
26 | public override string ToString()
27 | {
28 | return $"{nameof(Command_70_Unk)}";
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS3/PGLCommands/Command_71_Unk.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData;
8 |
9 | namespace PDTools.Files.Models.PS3.PGLCommands
10 | {
11 | ///
12 | /// Not present in GT PSP
13 | ///
14 | public class Command_71_Unk : ModelSetupCommand
15 | {
16 | public override void Read(BinaryStream bs, int commandsBaseOffset)
17 | {
18 |
19 | }
20 |
21 | public override void Write(BinaryStream bs)
22 | {
23 |
24 | }
25 |
26 | public override string ToString()
27 | {
28 | return $"{nameof(Command_71_Unk)}";
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS3/PGLCommands/Command_72_Unk.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData;
8 |
9 | namespace PDTools.Files.Models.PS3.PGLCommands
10 | {
11 | public class Command_72_Unk : ModelSetupCommand
12 | {
13 | public override void Read(BinaryStream bs, int commandsBaseOffset)
14 | {
15 | throw new NotSupportedException("Implement command 72 if you see it");
16 | }
17 |
18 | public override void Write(BinaryStream bs)
19 | {
20 |
21 | }
22 |
23 | public override string ToString()
24 | {
25 | return $"{nameof(Command_72_Unk)}";
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/VM/Instructions/VMGreatherEqualTo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData;
8 |
9 | namespace PDTools.Files.Models.VM.Instructions;
10 |
11 | public class VMGreaterEqualTo : VMInstruction
12 | {
13 | public override VMInstructionOpcode Opcode => VMInstructionOpcode.GreaterOrEqualTo;
14 |
15 | public override void Read(BinaryStream bs, int commandsBaseOffset)
16 | {
17 |
18 | }
19 |
20 | public override void Write(BinaryStream bs)
21 | {
22 |
23 | }
24 |
25 | public override string Disassemble(Dictionary values)
26 | {
27 | return $"GREATER_EQUAL_TO: >=";
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS3/PGLCommands/Command_15_Unk.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData;
8 |
9 | namespace PDTools.Files.Models.PS3.PGLCommands
10 | {
11 | ///
12 | /// Some graphics command
13 | ///
14 | public class Command_15_Unk : ModelSetupCommand
15 | {
16 |
17 | public override void Read(BinaryStream bs, int commandsBaseOffset)
18 | {
19 |
20 | }
21 |
22 | public override void Write(BinaryStream bs)
23 | {
24 |
25 | }
26 |
27 | public override string ToString()
28 | {
29 | return $"{nameof(Command_15_Unk)}";
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/VM/Instructions/VMBinaryLeftShift.cs:
--------------------------------------------------------------------------------
1 | using Syroot.BinaryData;
2 |
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 |
9 | namespace PDTools.Files.Models.VM.Instructions;
10 |
11 | public class VMBinaryLeftShift : VMInstruction
12 | {
13 | public override VMInstructionOpcode Opcode => VMInstructionOpcode.BinaryLeftShiftOperator;
14 |
15 | public override void Read(BinaryStream bs, int commandsBaseOffset)
16 | {
17 |
18 | }
19 |
20 | public override void Write(BinaryStream bs)
21 | {
22 |
23 | }
24 |
25 | public override string Disassemble(Dictionary values)
26 | {
27 | return $"LEFT_SHIFT: <<";
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/VM/Instructions/VMBinaryRightShift.cs:
--------------------------------------------------------------------------------
1 | using Syroot.BinaryData;
2 |
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 |
9 | namespace PDTools.Files.Models.VM.Instructions;
10 |
11 | public class VMBinaryRightShift : VMInstruction
12 | {
13 | public override VMInstructionOpcode Opcode => VMInstructionOpcode.BinaryRightShiftOperator;
14 |
15 | public override void Read(BinaryStream bs, int commandsBaseOffset)
16 | {
17 |
18 | }
19 |
20 | public override void Write(BinaryStream bs)
21 | {
22 |
23 | }
24 |
25 | public override string Disassemble(Dictionary values)
26 | {
27 | return $"RIGHT_SHIFT: >>";
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/PDTools.SaveFile/GT4/Option/OptionEvent.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | using Syroot.BinaryData.Memory;
6 |
7 | using PDTools.Utils;
8 |
9 | namespace PDTools.SaveFile.GT4.Option;
10 |
11 | public class OptionEvent : IGameSerializeBase
12 | {
13 | public string? EventName { get; set; }
14 |
15 | public void CopyTo(OptionEvent dest)
16 | {
17 | dest.EventName = EventName;
18 | }
19 |
20 | public void Pack(GT4Save save, ref SpanWriter sw)
21 | {
22 | sw.WriteStringFix(EventName ?? string.Empty, 0x50);
23 | }
24 |
25 | public void Unpack(GT4Save save, ref SpanReader sr)
26 | {
27 | EventName = sr.ReadFixedString(0x50);
28 |
29 | // No align
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS2/RenderCommands/Cmd_pglCopyFogColor.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Numerics;
7 |
8 | using Syroot.BinaryData;
9 |
10 | namespace PDTools.Files.Models.PS2.RenderCommands;
11 |
12 | public class Cmd_pglCopyFogColor : ModelSetupPS2Command
13 | {
14 | public override ModelSetupPS2Opcode Opcode => ModelSetupPS2Opcode.pglCopyFogColor;
15 |
16 | public override void Read(BinaryStream bs, int commandsBaseOffset)
17 | {
18 |
19 | }
20 |
21 | public override void Write(BinaryStream bs)
22 | {
23 |
24 | }
25 |
26 | public override string ToString()
27 | {
28 | return $"{nameof(Cmd_pglCopyFogColor)}";
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/Shaders/ShaderProgram_0x40.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData;
8 |
9 | namespace PDTools.Files.Models.Shaders;
10 |
11 | public class ShadersProgram_0x40
12 | {
13 | public byte[] Program { get; set; }
14 | public static ShadersProgram_0x40 FromStream(BinaryStream bs, long basePos)
15 | {
16 | var prog = new ShadersProgram_0x40();
17 | int unkOffset = bs.ReadInt32();
18 | int programOffset = bs.ReadInt32();
19 | int programSize = bs.ReadInt32();
20 |
21 | bs.Position = basePos + programOffset;
22 | prog.Program = bs.ReadBytes(programSize);
23 |
24 | return prog;
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/VM/Instructions/VMLesserEqualToF.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData;
8 |
9 | namespace PDTools.Files.Models.VM.Instructions;
10 |
11 | public class VMLesserEqualToF : VMInstruction
12 | {
13 | public override VMInstructionOpcode Opcode => VMInstructionOpcode.FloatLesserOrEqualTo;
14 |
15 | public override void Read(BinaryStream bs, int commandsBaseOffset)
16 | {
17 |
18 | }
19 |
20 | public override void Write(BinaryStream bs)
21 | {
22 |
23 | }
24 |
25 | public override string Disassemble(Dictionary values)
26 | {
27 | return $"LESSER_EQUAL_TO_FLOAT: <=";
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS2/RenderCommands/Cmd_pglStoreFogColor.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Numerics;
7 |
8 | using Syroot.BinaryData;
9 |
10 | namespace PDTools.Files.Models.PS2.RenderCommands;
11 |
12 | public class Cmd_pglStoreFogColor : ModelSetupPS2Command
13 | {
14 | public override ModelSetupPS2Opcode Opcode => ModelSetupPS2Opcode.pglStoreFogColor;
15 |
16 | public override void Read(BinaryStream bs, int commandsBaseOffset)
17 | {
18 |
19 | }
20 |
21 | public override void Write(BinaryStream bs)
22 | {
23 |
24 | }
25 |
26 | public override string ToString()
27 | {
28 | return $"{nameof(Cmd_pglStoreFogColor)}";
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/VM/Instructions/VMGreatherEqualToF.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData;
8 |
9 | namespace PDTools.Files.Models.VM.Instructions;
10 |
11 | public class VMGreaterEqualToF : VMInstruction
12 | {
13 | public override VMInstructionOpcode Opcode => VMInstructionOpcode.FloatGreaterOrEqualTo;
14 |
15 | public override void Read(BinaryStream bs, int commandsBaseOffset)
16 | {
17 |
18 | }
19 |
20 | public override void Write(BinaryStream bs)
21 | {
22 |
23 | }
24 |
25 | public override string Disassemble(Dictionary values)
26 | {
27 | return $"GREATER_EQUAL_TO_FLOAT: >=";
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/PDTools.SpecDB/Core/Mapping/Tables/RiderEquipment.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData.Core;
8 | using Syroot.BinaryData.Memory;
9 |
10 | namespace PDTools.SpecDB.Core.Mapping.Tables;
11 |
12 | public class RiderEquipment : TableMetadata
13 | {
14 | public RiderEquipment(SpecDBFolder folderType, string localeName)
15 | {
16 | Columns.Add(new ColumnMetadata("Name", DBColumnType.String, localeName));
17 | Columns.Add(new ColumnMetadata("ModelCode", DBColumnType.String, localeName));
18 | Columns.Add(new ColumnMetadata("TypeID", DBColumnType.Int));
19 | Columns.Add(new ColumnMetadata("ManufacturerID", DBColumnType.Int));
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS2/RenderCommands/Cmd_pglEnable19_14.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Numerics;
7 |
8 | using Syroot.BinaryData;
9 |
10 | namespace PDTools.Files.Models.PS2.RenderCommands;
11 |
12 | public class Cmd_pglEnable19_14 : ModelSetupPS2Command
13 | {
14 | public override ModelSetupPS2Opcode Opcode => ModelSetupPS2Opcode.pglDisable19_14;
15 |
16 | public override void Read(BinaryStream bs, int commandsBaseOffset)
17 | {
18 |
19 | }
20 |
21 | public override void Write(BinaryStream bs)
22 | {
23 |
24 | }
25 |
26 | public override string ToString()
27 | {
28 | return $"{nameof(Cmd_pglEnable19_14)}";
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/PDTools.Files/Color4f.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace PDTools.Files;
8 |
9 | public struct Color4f
10 | {
11 | public float R { get; set; }
12 | public float G { get; set; }
13 | public float B { get; set; }
14 | public float A { get; set; }
15 |
16 | public Color4f(float r, float g, float b, float a)
17 | {
18 | R = r;
19 | G = g;
20 | B = b;
21 | A = a;
22 | }
23 |
24 | public static readonly Color4f Zero = new(0f, 0f, 0f, 0f);
25 | public static readonly Color4f One = new(1f, 1f, 1f, 1f);
26 |
27 | public override readonly int GetHashCode()
28 | {
29 | return HashCode.Combine(R, G, B, A);
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/PDTools.Files/Courses/Runway/RunwayStartingGridPosition.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData;
8 |
9 | namespace PDTools.Files.Courses.Runway;
10 |
11 | public class RunwayStartingGridPosition
12 | {
13 | public Vec3R Position { get; set; }
14 |
15 | public static RunwayStartingGridPosition FromStream(BinaryStream bs, ushort rwyVersionMajor, ushort rwyVersionMinor)
16 | {
17 | var pos = new RunwayStartingGridPosition();
18 | pos.Position = Vec3R.FromStream(bs);
19 | return pos;
20 | }
21 |
22 | public void ToStream(BinaryStream bs, ushort rwyVersionMajor, ushort rwyVersionMinor)
23 | {
24 | Position.ToStream(bs);
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS3/PGLCommands/Command_35_SetDepthMaskEnabled.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData;
8 |
9 | namespace PDTools.Files.Models.PS3.PGLCommands
10 | {
11 | // CELL_GCM_NV4097_SET_POLYGON_OFFSET_SCALE_FACTOR
12 | public class Command_35_SetDepthMaskEnabled : ModelSetupCommand
13 | {
14 | public override void Read(BinaryStream bs, int commandsBaseOffset)
15 | {
16 |
17 | }
18 |
19 | public override void Write(BinaryStream bs)
20 | {
21 |
22 | }
23 |
24 | public override string ToString()
25 | {
26 | return $"{nameof(Command_35_SetDepthMaskEnabled)}";
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS2/RenderCommands/Cmd_pglEnable17.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Numerics;
7 |
8 | using Syroot.BinaryData;
9 |
10 | namespace PDTools.Files.Models.PS2.RenderCommands;
11 |
12 | public class Cmd_pglEnableRendering : ModelSetupPS2Command
13 | {
14 | public override ModelSetupPS2Opcode Opcode => ModelSetupPS2Opcode.pglEnableRendering;
15 |
16 | public override void Read(BinaryStream bs, int commandsBaseOffset)
17 | {
18 |
19 | }
20 |
21 | public override void Write(BinaryStream bs)
22 | {
23 |
24 | }
25 |
26 | public override string ToString()
27 | {
28 | return $"{nameof(Cmd_pglEnableRendering)}";
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS2/RenderCommands/Cmd_pglEnableDepthMask.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Numerics;
7 |
8 | using Syroot.BinaryData;
9 |
10 | namespace PDTools.Files.Models.PS2.RenderCommands;
11 |
12 | public class Cmd_pglEnableDepthMask : ModelSetupPS2Command
13 | {
14 | public override ModelSetupPS2Opcode Opcode => ModelSetupPS2Opcode.pglEnableDepthMask;
15 |
16 | public override void Read(BinaryStream bs, int commandsBaseOffset)
17 | {
18 |
19 | }
20 |
21 | public override void Write(BinaryStream bs)
22 | {
23 |
24 | }
25 |
26 | public override string ToString()
27 | {
28 | return $"{nameof(Cmd_pglEnableDepthMask)}";
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/PDTools.SpecDB/Core/Mapping/Tables/Lightweight.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData.Core;
8 | using Syroot.BinaryData.Memory;
9 |
10 | namespace PDTools.SpecDB.Core.Mapping.Tables;
11 |
12 | public class Lightweight : TableMetadata
13 | {
14 | public override string LabelPrefix { get; } = "lw_";
15 |
16 | public Lightweight(SpecDBFolder folderType)
17 | {
18 | Columns.Add(new ColumnMetadata("weighteffect", DBColumnType.Short));
19 | Columns.Add(new ColumnMetadata("Price", DBColumnType.Short));
20 | Columns.Add(new ColumnMetadata("category", DBColumnType.Byte));
21 | Columns.Add(new ColumnMetadata("yaweffect", DBColumnType.Byte));
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS2/RenderCommands/Cmd_pglEnableAlphaTest.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Numerics;
7 |
8 | using Syroot.BinaryData;
9 |
10 | namespace PDTools.Files.Models.PS2.RenderCommands;
11 |
12 | public class Cmd_pglEnableAlphaTest : ModelSetupPS2Command
13 | {
14 | public override ModelSetupPS2Opcode Opcode => ModelSetupPS2Opcode.pglEnableAlphaTest;
15 |
16 | public override void Read(BinaryStream bs, int commandsBaseOffset)
17 | {
18 |
19 | }
20 |
21 | public override void Write(BinaryStream bs)
22 | {
23 |
24 | }
25 |
26 | public override string ToString()
27 | {
28 | return $"{nameof(Cmd_pglEnableAlphaTest)}";
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS2/RenderCommands/Cmd_pglEnableDepthTest.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Numerics;
7 |
8 | using Syroot.BinaryData;
9 |
10 | namespace PDTools.Files.Models.PS2.RenderCommands;
11 |
12 | public class Cmd_pglEnableDepthTest : ModelSetupPS2Command
13 | {
14 | public override ModelSetupPS2Opcode Opcode => ModelSetupPS2Opcode.pglEnableDepthTest;
15 |
16 | public override void Read(BinaryStream bs, int commandsBaseOffset)
17 | {
18 |
19 | }
20 |
21 | public override void Write(BinaryStream bs)
22 | {
23 |
24 | }
25 |
26 | public override string ToString()
27 | {
28 | return $"{nameof(Cmd_pglEnableDepthTest)}";
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS3/PGLCommands/Command_45_Unk.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData;
8 |
9 | namespace PDTools.Files.Models.PS3.PGLCommands
10 | {
11 | public class Command_45_Unk : ModelSetupCommand
12 | {
13 | public ushort Unk { get; set; }
14 | public override void Read(BinaryStream bs, int commandsBaseOffset)
15 | {
16 | Unk = bs.ReadUInt16();
17 | }
18 |
19 | public override void Write(BinaryStream bs)
20 | {
21 | bs.WriteUInt16(Unk);
22 | }
23 |
24 | public override string ToString()
25 | {
26 | return $"{nameof(Command_45_Unk)} - {Unk}";
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS3/PGLCommands/Command_46_Unk.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData;
8 |
9 | namespace PDTools.Files.Models.PS3.PGLCommands
10 | {
11 | public class Command_46_Unk : ModelSetupCommand
12 | {
13 | public ushort Unk { get; set; }
14 | public override void Read(BinaryStream bs, int commandsBaseOffset)
15 | {
16 | Unk = bs.ReadUInt16();
17 | }
18 |
19 | public override void Write(BinaryStream bs)
20 | {
21 | bs.WriteUInt16(Unk);
22 | }
23 |
24 | public override string ToString()
25 | {
26 | return $"{nameof(Command_46_Unk)} - {Unk}";
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS3/PGLCommands/Command_47_Unk.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData;
8 |
9 | namespace PDTools.Files.Models.PS3.PGLCommands
10 | {
11 | public class Command_47_Unk : ModelSetupCommand
12 | {
13 | public ushort Unk { get; set; }
14 | public override void Read(BinaryStream bs, int commandsBaseOffset)
15 | {
16 | Unk = bs.ReadUInt16();
17 | }
18 |
19 | public override void Write(BinaryStream bs)
20 | {
21 | bs.WriteUInt16(Unk);
22 | }
23 |
24 | public override string ToString()
25 | {
26 | return $"{nameof(Command_47_Unk)} - {Unk}";
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS3/PGLCommands/Command_49_Unk.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData;
8 |
9 | namespace PDTools.Files.Models.PS3.PGLCommands
10 | {
11 | public class Command_49_Unk : ModelSetupCommand
12 | {
13 | public ushort Unk { get; set; }
14 | public override void Read(BinaryStream bs, int commandsBaseOffset)
15 | {
16 | Unk = bs.ReadUInt16();
17 | }
18 |
19 | public override void Write(BinaryStream bs)
20 | {
21 | bs.WriteUInt16(Unk);
22 | }
23 |
24 | public override string ToString()
25 | {
26 | return $"{nameof(Command_49_Unk)} - {Unk}";
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS3/PGLCommands/Command_50_Unk.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData;
8 |
9 | namespace PDTools.Files.Models.PS3.PGLCommands
10 | {
11 | public class Command_50_Unk : ModelSetupCommand
12 | {
13 | public ushort Unk { get; set; }
14 | public override void Read(BinaryStream bs, int commandsBaseOffset)
15 | {
16 | Unk = bs.ReadUInt16();
17 | }
18 |
19 | public override void Write(BinaryStream bs)
20 | {
21 | bs.WriteUInt16(Unk);
22 | }
23 |
24 | public override string ToString()
25 | {
26 | return $"{nameof(Command_50_Unk)} - {Unk}";
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS3/PGLCommands/Command_62_Unk.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData;
8 |
9 | namespace PDTools.Files.Models.PS3.PGLCommands
10 | {
11 | public class Command_62_Unk : ModelSetupCommand
12 | {
13 | public ushort Unk { get; set; }
14 |
15 | public override void Read(BinaryStream bs, int commandsBaseOffset)
16 | {
17 | Unk = bs.ReadUInt16();
18 | }
19 |
20 | public override void Write(BinaryStream bs)
21 | {
22 | bs.WriteUInt16(Unk);
23 | }
24 |
25 | public override string ToString()
26 | {
27 | return $"{nameof(Command_62_Unk)}";
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS3/PGLCommands/Command_66_Unk.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData;
8 |
9 | namespace PDTools.Files.Models.PS3.PGLCommands
10 | {
11 | public class Command_66_Unk : ModelSetupCommand
12 | {
13 | public uint Unk { get; set; }
14 |
15 | public override void Read(BinaryStream bs, int commandsBaseOffset)
16 | {
17 | Unk = bs.ReadUInt32();
18 | }
19 |
20 | public override void Write(BinaryStream bs)
21 | {
22 | bs.WriteUInt32(Unk);
23 | }
24 |
25 | public override string ToString()
26 | {
27 | return $"{nameof(Command_66_Unk)}";
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/PDTools.SpecDB/Core/Mapping/Tables/PortPolish.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData.Core;
8 | using Syroot.BinaryData.Memory;
9 |
10 | namespace PDTools.SpecDB.Core.Mapping.Tables;
11 |
12 | public class PortPolish : TableMetadata
13 | {
14 | public override string LabelPrefix { get; } = "pp_";
15 |
16 | public PortPolish(SpecDBFolder folderType)
17 | {
18 | Columns.Add(new ColumnMetadata("torquemodifier", DBColumnType.Short));
19 | Columns.Add(new ColumnMetadata("torquemodifier2", DBColumnType.Short));
20 | Columns.Add(new ColumnMetadata("Price", DBColumnType.Short));
21 | Columns.Add(new ColumnMetadata("category", DBColumnType.Byte));
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS2/RenderCommands/Cmd_pglDisableAlphaTest.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Numerics;
7 |
8 | using Syroot.BinaryData;
9 |
10 | namespace PDTools.Files.Models.PS2.RenderCommands;
11 |
12 | public class Cmd_pglDisableAlphaTest : ModelSetupPS2Command
13 | {
14 | public override ModelSetupPS2Opcode Opcode => ModelSetupPS2Opcode.pglDisableAlphaTest;
15 |
16 | public override void Read(BinaryStream bs, int commandsBaseOffset)
17 | {
18 |
19 | }
20 |
21 | public override void Write(BinaryStream bs)
22 | {
23 |
24 | }
25 |
26 | public override string ToString()
27 | {
28 | return $"{nameof(Cmd_pglDisableAlphaTest)}";
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS2/RenderCommands/Cmd_pglDisableDepthMask.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Numerics;
7 |
8 | using Syroot.BinaryData;
9 |
10 | namespace PDTools.Files.Models.PS2.RenderCommands;
11 |
12 | public class Cmd_pglDisableDepthMask : ModelSetupPS2Command
13 | {
14 | public override ModelSetupPS2Opcode Opcode => ModelSetupPS2Opcode.pglDisableDepthMask;
15 |
16 | public override void Read(BinaryStream bs, int commandsBaseOffset)
17 | {
18 |
19 | }
20 |
21 | public override void Write(BinaryStream bs)
22 | {
23 |
24 | }
25 |
26 | public override string ToString()
27 | {
28 | return $"{nameof(Cmd_pglDisableDepthMask)}";
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS2/RenderCommands/Cmd_pglDisableDepthTest.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Numerics;
7 |
8 | using Syroot.BinaryData;
9 |
10 | namespace PDTools.Files.Models.PS2.RenderCommands;
11 |
12 | public class Cmd_pglDisableDepthTest : ModelSetupPS2Command
13 | {
14 | public override ModelSetupPS2Opcode Opcode => ModelSetupPS2Opcode.pglDisableDepthTest;
15 |
16 | public override void Read(BinaryStream bs, int commandsBaseOffset)
17 | {
18 |
19 | }
20 |
21 | public override void Write(BinaryStream bs)
22 | {
23 |
24 | }
25 |
26 | public override string ToString()
27 | {
28 | return $"{nameof(Cmd_pglDisableDepthTest)}";
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS3/PGLCommands/Command_14_Unk.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData;
8 |
9 | namespace PDTools.Files.Models.PS3.PGLCommands
10 | {
11 | ///
12 | /// Some graphics command - matrix related? Start render?
13 | ///
14 | public class Command_14_Unk : ModelSetupCommand
15 | {
16 |
17 | public override void Read(BinaryStream bs, int commandsBaseOffset)
18 | {
19 |
20 | }
21 |
22 | public override void Write(BinaryStream bs)
23 | {
24 |
25 | }
26 |
27 | public override string ToString()
28 | {
29 | return $"{nameof(Command_14_Unk)}";
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS3/PGLCommands/Command_53_Unk.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData;
8 |
9 | namespace PDTools.Files.Models.PS3.PGLCommands
10 | {
11 | public class Command_53_Unk : ModelSetupCommand
12 | {
13 | public ushort Unk { get; set; }
14 |
15 | public override void Read(BinaryStream bs, int commandsBaseOffset)
16 | {
17 | Unk = bs.ReadUInt16();
18 | }
19 |
20 | public override void Write(BinaryStream bs)
21 | {
22 | bs.WriteUInt16(Unk);
23 | }
24 |
25 | public override string ToString()
26 | {
27 | return $"{nameof(Command_53_Unk)}: {Unk}";
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS3/PGLCommands/Command_6_Unk.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData;
8 |
9 | namespace PDTools.Files.Models.PS3.PGLCommands
10 | {
11 | public class Command_6_Unk : ModelSetupCommand
12 | {
13 | public byte Value { get; set; }
14 |
15 | public override void Read(BinaryStream bs, int commandsBaseOffset)
16 | {
17 | Value = bs.Read1Byte();
18 | }
19 |
20 | public override void Write(BinaryStream bs)
21 | {
22 | bs.WriteByte(Value);
23 | }
24 |
25 | public override string ToString()
26 | {
27 | return $"{nameof(Command_6_Unk)}: {Value}";
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS3/PGLCommands/Command_43_SetVMUnk.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData;
8 |
9 | namespace PDTools.Files.Models.PS3.PGLCommands
10 | {
11 | public class Command_43_SetVMUnk : ModelSetupCommand
12 | {
13 | public int Unk { get; set; }
14 | public override void Read(BinaryStream bs, int commandsBaseOffset)
15 | {
16 | Unk = bs.ReadInt32();
17 | }
18 |
19 | public override void Write(BinaryStream bs)
20 | {
21 | bs.WriteInt32(Unk);
22 | }
23 |
24 | public override string ToString()
25 | {
26 | return $"{nameof(Command_43_SetVMUnk)} - {Unk}";
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS3/PGLCommands/Command_7_Unk.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData;
8 |
9 | namespace PDTools.Files.Models.PS3.PGLCommands
10 | {
11 | public class Command_7_Unk : ModelSetupCommand
12 | {
13 | public ushort Value { get; set; }
14 |
15 | public override void Read(BinaryStream bs, int commandsBaseOffset)
16 | {
17 | Value = bs.ReadUInt16();
18 | }
19 |
20 | public override void Write(BinaryStream bs)
21 | {
22 | bs.WriteUInt16(Value);
23 | }
24 |
25 | public override string ToString()
26 | {
27 | return $"{nameof(Command_7_Unk)}: {Value}";
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/PDTools.SpecDB/Core/Mapping/Tables/AirCleaner.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData.Core;
8 | using Syroot.BinaryData.Memory;
9 |
10 | namespace PDTools.SpecDB.Core.Mapping.Tables;
11 |
12 | public class AirCleaner : TableMetadata
13 | {
14 | public override string LabelPrefix { get; } = "ac_";
15 |
16 | public AirCleaner(SpecDBFolder folderType)
17 | {
18 | Columns.Add(new ColumnMetadata("torquemodifier", DBColumnType.Short));
19 | Columns.Add(new ColumnMetadata("torquemodifier2", DBColumnType.Short));
20 | Columns.Add(new ColumnMetadata("torquemodifier3", DBColumnType.Short));
21 | Columns.Add(new ColumnMetadata("category", DBColumnType.Byte));
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS3/PGLCommands/Command_2_Unk.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData;
8 |
9 | namespace PDTools.Files.Models.PS3.PGLCommands
10 | {
11 | public class Command_2_Unk : ModelSetupCommand
12 | {
13 | public short ModelIndex;
14 |
15 | public override void Read(BinaryStream bs, int commandsBaseOffset)
16 | {
17 | ModelIndex = bs.ReadInt16();
18 | }
19 |
20 | public override void Write(BinaryStream bs)
21 | {
22 | bs.WriteInt16(ModelIndex);
23 | }
24 |
25 | public override string ToString()
26 | {
27 | return $"{nameof(Command_2_Unk)}: {ModelIndex}";
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/PDTools.Structures/PDTools.Structures.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net9.0
5 |
6 |
7 |
8 | true
9 |
10 |
11 |
12 | true
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/PDTools.Utils/README.md:
--------------------------------------------------------------------------------
1 | # PDTools.Utils
2 |
3 | Various utils.
4 |
5 | * `AlphaNumStringComparer.cs` - Mostly used for file/volume builders, when ordering entries by mandatory bsearch. They use bsearch a lot.
6 | * `BitStream.cs` - a VERY useful class for reading bit streams. This is a `ref struct` so always pass it around functions with `ref`. Supports little/big endian (LSB/MSB).
7 | * `OptimizedStringTable.cs` a useful class for building string tables, when building files that have file offsets/pointers to recurring strings.
8 | * `PDIPFSPathScrambler.cs` - The scrambler for file paths, used in GT5's PDIPFS. See [here](https://nenkai.github.io/gt-modding-hub/formats/volume/ps3_volume/?h=pdipfs#pdipfs-path-scrambling).
9 | * `RegionUtil.cs` Reversed driver region generator from GT6. Intended to be combined with the driver name table/xml.
10 |
--------------------------------------------------------------------------------
/PDTools.SaveFile/GT4/UserProfile/ChampionshipContext.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | using Syroot.BinaryData.Memory;
6 |
7 | namespace PDTools.SaveFile.GT4.UserProfile;
8 |
9 | public class ChampionshipContext : IGameSerializeBase
10 | {
11 | public byte[] Data { get; set; } = new byte[0x88];
12 |
13 | public void CopyTo(ChampionshipContext dest)
14 | {
15 | Array.Copy(Data, dest.Data, Data.Length);
16 | }
17 | public void Pack(GT4Save save, ref SpanWriter sw)
18 | {
19 | sw.WriteBytes(Data);
20 |
21 | sw.Align(GT4Save.ALIGNMENT);
22 | }
23 |
24 | public void Unpack(GT4Save save, ref SpanReader sr)
25 | {
26 | Data = sr.ReadBytes(0x88);
27 |
28 | sr.Align(GT4Save.ALIGNMENT);
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/PDTools.SpecDB/Core/Mapping/Tables/ExhaustManifold.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData.Core;
8 | using Syroot.BinaryData.Memory;
9 |
10 | namespace PDTools.SpecDB.Core.Mapping.Tables;
11 |
12 | public class ExhaustManifold : TableMetadata
13 | {
14 | public override string LabelPrefix { get; } = "ex_";
15 |
16 | public ExhaustManifold(SpecDBFolder folderType)
17 | {
18 | Columns.Add(new ColumnMetadata("torquemodifier", DBColumnType.Short));
19 | Columns.Add(new ColumnMetadata("torquemodifier2", DBColumnType.Short));
20 | Columns.Add(new ColumnMetadata("torquemodifier3", DBColumnType.Short));
21 | Columns.Add(new ColumnMetadata("category", DBColumnType.Byte));
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/PDTools.SaveFile/GT4/Option/GameZone.cs:
--------------------------------------------------------------------------------
1 | using PDTools.Enums.PS2;
2 |
3 | using Syroot.BinaryData.Memory;
4 |
5 | using System;
6 | using System.Collections.Generic;
7 | using System.Text;
8 |
9 | namespace PDTools.SaveFile.GT4.Option;
10 |
11 | public class GameZone : IGameSerializeBase
12 | {
13 | public GameZoneType GameZoneType { get; set; }
14 |
15 | public void CopyTo(GameZone dest)
16 | {
17 | dest.GameZoneType = GameZoneType;
18 | }
19 |
20 | public void Pack(GT4Save save, ref SpanWriter sw)
21 | {
22 | sw.WriteInt32((int)GameZoneType);
23 |
24 | sw.Align(GT4Save.ALIGNMENT);
25 | }
26 |
27 | public void Unpack(GT4Save save, ref SpanReader sr)
28 | {
29 | GameZoneType = (GameZoneType)sr.ReadInt32();
30 |
31 | sr.Align(GT4Save.ALIGNMENT);
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS3/PGLCommands/Command_23_Unk.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Numerics;
7 |
8 | using Syroot.BinaryData;
9 |
10 | namespace PDTools.Files.Models.PS3.PGLCommands
11 | {
12 | public class Command_23_Unk : ModelSetupCommand
13 | {
14 | public float Value { get; set; }
15 | public override void Read(BinaryStream bs, int commandsBaseOffset)
16 | {
17 | Value = bs.ReadSingle();
18 | }
19 |
20 | public override void Write(BinaryStream bs)
21 | {
22 | bs.WriteSingle(Value);
23 | }
24 |
25 | public override string ToString()
26 | {
27 | return $"{nameof(Command_23_Unk)} - {Value}";
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS3/PGLCommands/Command_51_Unk.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData;
8 |
9 | namespace PDTools.Files.Models.PS3.PGLCommands
10 | {
11 | public class Command_51_Unk : ModelSetupCommand
12 | {
13 | public ushort UnkIndex { get; set; }
14 |
15 | public override void Read(BinaryStream bs, int commandsBaseOffset)
16 | {
17 | UnkIndex = bs.ReadUInt16();
18 | }
19 |
20 | public override void Write(BinaryStream bs)
21 | {
22 | bs.WriteUInt16(UnkIndex);
23 | }
24 |
25 | public override string ToString()
26 | {
27 | return $"{nameof(Command_51_Unk)} - Index: {UnkIndex}";
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS3/PGLCommands/Command_52_Unk.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData;
8 |
9 | namespace PDTools.Files.Models.PS3.PGLCommands
10 | {
11 | public class Command_52_Unk : ModelSetupCommand
12 | {
13 | public ushort UnkIndex { get; set; }
14 |
15 | public override void Read(BinaryStream bs, int commandsBaseOffset)
16 | {
17 | UnkIndex = bs.ReadUInt16();
18 | }
19 |
20 | public override void Write(BinaryStream bs)
21 | {
22 | bs.WriteUInt16(UnkIndex);
23 | }
24 |
25 | public override string ToString()
26 | {
27 | return $"{nameof(Command_52_Unk)} - Index: {UnkIndex}";
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/PDTools.Compression/PDTools.Compression.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net9.0
5 |
6 |
7 |
8 | true
9 |
10 |
11 |
12 | true
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS3/PGLCommands/Command_61_Semaphore_InvalidateL2.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData;
8 |
9 | namespace PDTools.Files.Models.PS3.PGLCommands
10 | {
11 | ///
12 | /// Invalidate texture cache maybe?
13 | ///
14 | public class Command_61_Semaphore_InvalidateL2 : ModelSetupCommand
15 | {
16 |
17 | public override void Read(BinaryStream bs, int commandsBaseOffset)
18 | {
19 |
20 | }
21 |
22 | public override void Write(BinaryStream bs)
23 | {
24 |
25 | }
26 |
27 | public override string ToString()
28 | {
29 | return $"{nameof(Command_61_Semaphore_InvalidateL2)}";
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS2/RenderCommands/Cmd_pglEnableDestinationAlphaTest.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Numerics;
7 |
8 | using Syroot.BinaryData;
9 |
10 | namespace PDTools.Files.Models.PS2.RenderCommands;
11 |
12 | public class Cmd_pglEnableDestinationAlphaTest : ModelSetupPS2Command
13 | {
14 | public override ModelSetupPS2Opcode Opcode => ModelSetupPS2Opcode.pglEnableDestinationAlphaTest;
15 |
16 | public override void Read(BinaryStream bs, int commandsBaseOffset)
17 | {
18 |
19 | }
20 |
21 | public override void Write(BinaryStream bs)
22 | {
23 |
24 | }
25 |
26 | public override string ToString()
27 | {
28 | return $"{nameof(Cmd_pglEnableDestinationAlphaTest)}";
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS3/ModelSet3/Shapes/MDL3ShapePackedMeshRef.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | using System.Numerics;
5 | using System.Windows.Markup;
6 |
7 | using Syroot.BinaryData;
8 |
9 |
10 | namespace PDTools.Files.Models.PS3.ModelSet3.Shapes;
11 |
12 | public class MDL3ShapePackedMeshRef
13 | {
14 | public float[] Values { get; set; } = new float[12];
15 | public int PackedMeshEntryIndex { get; set; }
16 | public static MDL3ShapePackedMeshRef FromStream(BinaryStream bs, long mdlBasePos, ushort mdl3VersionMajor)
17 | {
18 | long unkBasePos = bs.Position;
19 |
20 | var unk = new MDL3ShapePackedMeshRef();
21 | unk.Values = bs.ReadSingles(12);
22 | int unkOffset = bs.ReadInt32();
23 | unk.PackedMeshEntryIndex = bs.ReadInt32();
24 |
25 | return unk;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS3/PGLCommands/Command_26_SetDepthFunc.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Numerics;
7 |
8 | using Syroot.BinaryData;
9 |
10 | namespace PDTools.Files.Models.PS3.PGLCommands
11 | {
12 | public class Command_26_SetDepthFunc : ModelSetupCommand
13 | {
14 | public byte Func { get; set; }
15 | public override void Read(BinaryStream bs, int commandsBaseOffset)
16 | {
17 | Func = bs.Read1Byte();
18 | }
19 |
20 | public override void Write(BinaryStream bs)
21 | {
22 | bs.WriteByte(Func);
23 | }
24 |
25 | public override string ToString()
26 | {
27 | return $"{nameof(Command_26_SetDepthFunc)}";
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS2/RenderCommands/Cmd_pglDisableDestinationAlphaTest.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Numerics;
7 |
8 | using Syroot.BinaryData;
9 |
10 | namespace PDTools.Files.Models.PS2.RenderCommands;
11 |
12 | public class Cmd_pglDisableDestinationAlphaTest : ModelSetupPS2Command
13 | {
14 | public override ModelSetupPS2Opcode Opcode => ModelSetupPS2Opcode.pglDisableDestinationAlphaTest;
15 |
16 | public override void Read(BinaryStream bs, int commandsBaseOffset)
17 | {
18 |
19 | }
20 |
21 | public override void Write(BinaryStream bs)
22 | {
23 |
24 | }
25 |
26 | public override string ToString()
27 | {
28 | return $"{nameof(Cmd_pglDisableDestinationAlphaTest)}";
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS3/PGLCommands/Command_21_Unk.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Numerics;
7 |
8 | using Syroot.BinaryData;
9 |
10 | namespace PDTools.Files.Models.PS3.PGLCommands
11 | {
12 | public class Command_21_PGLRotateY : ModelSetupCommand
13 | {
14 | public float Value { get; set; }
15 | public override void Read(BinaryStream bs, int commandsBaseOffset)
16 | {
17 | Value = bs.ReadSingle();
18 | }
19 |
20 | public override void Write(BinaryStream bs)
21 | {
22 | bs.WriteSingle(Value);
23 | }
24 |
25 | public override string ToString()
26 | {
27 | return $"{nameof(Command_21_PGLRotateY)} - {Value}";
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS3/PGLCommands/Command_22_Unk.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Numerics;
7 |
8 | using Syroot.BinaryData;
9 |
10 | namespace PDTools.Files.Models.PS3.PGLCommands
11 | {
12 | public class Command_22_PGLRotateZ : ModelSetupCommand
13 | {
14 | public float Value { get; set; }
15 | public override void Read(BinaryStream bs, int commandsBaseOffset)
16 | {
17 | Value = bs.ReadSingle();
18 | }
19 |
20 | public override void Write(BinaryStream bs)
21 | {
22 | bs.WriteSingle(Value);
23 | }
24 |
25 | public override string ToString()
26 | {
27 | return $"{nameof(Command_22_PGLRotateZ)} - {Value}";
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS2/CarModel1/ExhaustData.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Numerics;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | using Syroot.BinaryData;
9 |
10 | namespace PDTools.Files.Models.PS2.CarModel1;
11 |
12 | public class ExhaustData
13 | {
14 | public Vector3 Position { get; set; }
15 |
16 | public void FromStream(BinaryStream bs)
17 | {
18 | Position = new Vector3(bs.ReadSingle(), bs.ReadSingle(), bs.ReadSingle());
19 | bs.Position += 0x14; // Empty
20 | }
21 |
22 | public void Write(BinaryStream bs)
23 | {
24 | bs.WriteSingle(Position.X); bs.WriteSingle(Position.Y); bs.WriteSingle(Position.Z);
25 | bs.Position += 0x14;
26 | }
27 |
28 | public static uint GetSize()
29 | {
30 | return 0x20;
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS3/PGLCommands/Command_4_PGLUCallShapeUShort.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData;
8 |
9 | namespace PDTools.Files.Models.PS3.PGLCommands
10 | {
11 | public class Command_4_PGLUCallShapeUShort : ModelSetupCommand
12 | {
13 | public short MeshIndex;
14 |
15 | public override void Read(BinaryStream bs, int commandsBaseOffset)
16 | {
17 | MeshIndex = bs.ReadInt16();
18 | }
19 |
20 | public override void Write(BinaryStream bs)
21 | {
22 | bs.WriteInt16(MeshIndex);
23 | }
24 |
25 | public override string ToString()
26 | {
27 | return $"{nameof(Command_4_PGLUCallShapeUShort)}: {MeshIndex}";
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/PDTools.Files/Fonts/GlyphQuadraticBezierCurve.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace PDTools.Files.Fonts;
8 |
9 | public struct GlyphQuadraticBezierCurve : IGlyphShapeData
10 | {
11 | public float P1_DistX { get; set; }
12 | public float P1_DistY { get; set; }
13 | public float P2_DistX { get; set; }
14 | public float P2_DistY { get; set; }
15 |
16 | public GlyphQuadraticBezierCurve(float p1_X, float p1_Y, float p2_X, float p2_Y)
17 | {
18 | P1_DistX = p1_X;
19 | P1_DistY = p1_Y;
20 | P2_DistX = p2_X;
21 | P2_DistY = p2_Y;
22 | }
23 |
24 | public override readonly string ToString()
25 | {
26 | return $"Curve - X1Dist:{P1_DistX} Y1Dist:{P1_DistY} X2Dist:{P2_DistX} Y2Dist:{P2_DistY}";
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/VM/Instructions/VM0x10.cs:
--------------------------------------------------------------------------------
1 | using Syroot.BinaryData;
2 |
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 |
9 | namespace PDTools.Files.Models.VM.Instructions;
10 |
11 | public class VM0x10 : VMInstruction
12 | {
13 | public override VMInstructionOpcode Opcode => VMInstructionOpcode.StackVariableEval;
14 |
15 | public short Value { get; set; }
16 |
17 | public override void Read(BinaryStream bs, int commandsBaseOffset)
18 | {
19 | Value = bs.ReadInt16();
20 | }
21 |
22 | public override void Write(BinaryStream bs)
23 | {
24 | bs.WriteInt16(Value);
25 | }
26 |
27 | public override string Disassemble(Dictionary values)
28 | {
29 | return $"{nameof(VM0x10)}: Index:{Value}";
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS2/CarModel1/CollisionParticle.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Numerics;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | using Syroot.BinaryData;
9 |
10 | namespace PDTools.Files.Models.PS2.CarModel1;
11 |
12 | public class CollisionParticle
13 | {
14 | public Vector3 Position { get; set; }
15 |
16 | public void FromStream(BinaryStream bs)
17 | {
18 | Position = new Vector3(bs.ReadSingle(), bs.ReadSingle(), bs.ReadSingle());
19 | bs.Position += 0x4; // Empty
20 | }
21 |
22 | public void Write(BinaryStream bs)
23 | {
24 | bs.WriteSingle(Position.X); bs.WriteSingle(Position.Y); bs.WriteSingle(Position.Z);
25 | bs.Position += 0x4;
26 | }
27 |
28 | public static uint GetSize()
29 | {
30 | return 0x10;
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS3/ModelSet3/PackedMesh/Commands/SmoothMeshTessellationCommand13.cs:
--------------------------------------------------------------------------------
1 | using PDTools.Utils;
2 |
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 |
9 | namespace PDTools.Files.Models.PS3.ModelSet3.PackedMesh.Commands;
10 |
11 | public class SmoothMeshTessellationCommand13 : SmoothMeshTessellationCommandBase
12 | {
13 | // 256 bits
14 | public float[] UnkBits { get; set; } = new float[8];
15 |
16 | public override void Read(SmoothMeshTessellationCommandContext ctx, ref BitStream bs)
17 | {
18 | // Accurate
19 | long newOffset = ((bs.GetBitPosition() - 5) + 13) & 0xfffffff8;
20 | bs.SeekToBit(newOffset);
21 |
22 | for (int i = 0; i < UnkBits.Length; i++)
23 | {
24 | UnkBits[i] = bs.ReadSingle();
25 | }
26 | }
27 | }
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS3/PGLCommands/Command_67_Unk.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData;
8 |
9 | namespace PDTools.Files.Models.PS3.PGLCommands
10 | {
11 | ///
12 | /// Same as 66
13 | ///
14 | public class Command_67_Unk : ModelSetupCommand
15 | {
16 | public uint Unk { get; set; }
17 |
18 | public override void Read(BinaryStream bs, int commandsBaseOffset)
19 | {
20 | Unk = bs.ReadUInt32();
21 | }
22 |
23 | public override void Write(BinaryStream bs)
24 | {
25 | bs.WriteUInt32(Unk);
26 | }
27 |
28 | public override string ToString()
29 | {
30 | return $"{nameof(Command_67_Unk)}";
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/VM/Instructions/VMReturn.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData;
8 |
9 | namespace PDTools.Files.Models.VM.Instructions;
10 |
11 | public class VMReturn : VMInstruction
12 | {
13 | public override VMInstructionOpcode Opcode => VMInstructionOpcode.Return;
14 |
15 | public byte RetOffset { get; set; }
16 |
17 | public override void Read(BinaryStream bs, int commandsBaseOffset)
18 | {
19 | RetOffset = bs.Read1Byte();
20 | }
21 |
22 | public override void Write(BinaryStream bs)
23 | {
24 | bs.WriteByte(RetOffset);
25 | }
26 |
27 | public override string Disassemble(Dictionary values)
28 | {
29 | return $"{nameof(VMReturn)}: {RetOffset}";
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/PDTools.SpecDB/Core/Mapping/Tables/RiderSetAssign.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData.Core;
8 | using Syroot.BinaryData.Memory;
9 |
10 | namespace PDTools.SpecDB.Core.Mapping.Tables;
11 |
12 | public class RiderSetAssign : TableMetadata
13 | {
14 | public RiderSetAssign(SpecDBFolder folderType)
15 | {
16 | Columns.Add(new ColumnMetadata("Helmet", DBColumnType.Int));
17 | Columns.Add(new ColumnMetadata("Suit", DBColumnType.Int));
18 | Columns.Add(new ColumnMetadata("Jacket", DBColumnType.Int));
19 | Columns.Add(new ColumnMetadata("Pants", DBColumnType.Int));
20 | Columns.Add(new ColumnMetadata("Gloves", DBColumnType.Int));
21 | Columns.Add(new ColumnMetadata("Boots", DBColumnType.Int));
22 |
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS2/RenderCommands/Cmd_JumpByte.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Numerics;
7 |
8 | using Syroot.BinaryData;
9 |
10 | namespace PDTools.Files.Models.PS2.RenderCommands;
11 |
12 | public class Cmd_JumpByte : ModelSetupPS2Command
13 | {
14 | public override ModelSetupPS2Opcode Opcode => ModelSetupPS2Opcode.Jump_Byte;
15 |
16 | public byte JumpOffset { get; set; }
17 |
18 | public override void Read(BinaryStream bs, int commandsBaseOffset)
19 | {
20 | JumpOffset = bs.Read1Byte();
21 | }
22 |
23 | public override void Write(BinaryStream bs)
24 | {
25 | bs.WriteByte(JumpOffset);
26 | }
27 |
28 | public override string ToString()
29 | {
30 | return $"{nameof(Cmd_JumpByte)}";
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/PDTools.Files/Textures/Texture.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData.Core;
8 | using Syroot.BinaryData;
9 | using System.IO;
10 |
11 | using SixLabors.ImageSharp;
12 | using SixLabors.ImageSharp.Formats.Png;
13 | using SixLabors.ImageSharp.PixelFormats;
14 | using SixLabors.ImageSharp.Processing;
15 | using SixLabors.ImageSharp.Formats;
16 |
17 | using Pfim;
18 | using Pfim.dds;
19 |
20 | namespace PDTools.Files.Textures;
21 |
22 | public abstract class TextureSet3Buffer
23 | {
24 | public ushort Width { get; set; }
25 | public ushort Height { get; set; }
26 | public long ImageOffset { get; set; }
27 | public long ImageSize { get; set; }
28 |
29 | public Memory ImageData { get; set; }
30 |
31 | public abstract void Read(BinaryStream bs);
32 | }
--------------------------------------------------------------------------------
/PDTools.Structures/DbCode.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | using Syroot.BinaryData.Memory;
6 |
7 | using PDTools.Enums;
8 |
9 | namespace PDTools.Structures;
10 |
11 | public class DbCode
12 | {
13 | public int Code { get; set; } = -1;
14 | public int TableId { get; set; } = -1;
15 |
16 | public DbCode(int code, int tableId)
17 | {
18 | Code = code;
19 | TableId = tableId;
20 | }
21 |
22 | public DbCode()
23 | {
24 |
25 | }
26 |
27 | public static DbCode Unpack(ref SpanReader sr)
28 | {
29 | var code = new DbCode();
30 | code.Code = sr.ReadInt32();
31 | code.TableId = sr.ReadInt32();
32 | return code;
33 | }
34 |
35 | public void Pack(ref SpanWriter sw)
36 | {
37 | sw.WriteInt32(Code);
38 | sw.WriteInt32(TableId);
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS2/RenderCommands/Cmd_pglEnableCullFace.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Numerics;
7 |
8 | using Syroot.BinaryData;
9 |
10 | namespace PDTools.Files.Models.PS2.RenderCommands;
11 |
12 | ///
13 | /// Calls glEnable(15). Enables face culling
14 | ///
15 | public class Cmd_pglEnableCullFace : ModelSetupPS2Command
16 | {
17 | public override ModelSetupPS2Opcode Opcode => ModelSetupPS2Opcode.pglEnableCullFace;
18 |
19 | public override void Read(BinaryStream bs, int commandsBaseOffset)
20 | {
21 |
22 | }
23 |
24 | public override void Write(BinaryStream bs)
25 | {
26 |
27 | }
28 |
29 | public override string ToString()
30 | {
31 | return $"{nameof(Cmd_pglEnableCullFace)}";
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS3/PGLCommands/Command_69_Unk.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData;
8 |
9 | namespace PDTools.Files.Models.PS3.PGLCommands
10 | {
11 | ///
12 | /// Doesn't do anything?
13 | ///
14 | public class Command_69_Unk : ModelSetupCommand
15 | {
16 | public byte Unk { get; set; }
17 |
18 | public override void Read(BinaryStream bs, int commandsBaseOffset)
19 | {
20 | Unk = bs.Read1Byte();
21 | }
22 |
23 | public override void Write(BinaryStream bs)
24 | {
25 | bs.WriteByte(Unk);
26 | }
27 |
28 | public override string ToString()
29 | {
30 | return $"{nameof(Command_69_Unk)} - {Unk}";
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/VM/Instructions/VMJump.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData;
8 |
9 | namespace PDTools.Files.Models.VM.Instructions;
10 |
11 | public class VMJump : VMInstruction
12 | {
13 | public override VMInstructionOpcode Opcode => VMInstructionOpcode.JumpRelative;
14 |
15 | public short JumpOffset { get; set; }
16 |
17 | public override void Read(BinaryStream bs, int commandsBaseOffset)
18 | {
19 | JumpOffset = bs.ReadInt16();
20 | }
21 |
22 | public override void Write(BinaryStream bs)
23 | {
24 | bs.WriteInt16(JumpOffset);
25 | }
26 |
27 | public override string Disassemble(Dictionary values)
28 | {
29 | return $"JUMP: Offset={Offset + JumpOffset + 3:X2}";
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS2/RenderCommands/Cmd_JumpShort.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Numerics;
7 |
8 | using Syroot.BinaryData;
9 |
10 | namespace PDTools.Files.Models.PS2.RenderCommands;
11 |
12 | public class Cmd_JumpUShort : ModelSetupPS2Command
13 | {
14 | public override ModelSetupPS2Opcode Opcode => ModelSetupPS2Opcode.Jump_UShort;
15 |
16 | public ushort JumpOffset { get; set; }
17 |
18 | public override void Read(BinaryStream bs, int commandsBaseOffset)
19 | {
20 | JumpOffset = bs.ReadUInt16();
21 | }
22 |
23 | public override void Write(BinaryStream bs)
24 | {
25 | bs.WriteUInt16(JumpOffset);
26 | }
27 |
28 | public override string ToString()
29 | {
30 | return $"{nameof(Cmd_JumpUShort)}";
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS3/PGLCommands/Command_65_Unk.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData;
8 |
9 | namespace PDTools.Files.Models.PS3.PGLCommands
10 | {
11 | ///
12 | /// Doesn't seem to do anything?
13 | ///
14 | public class Command_65_Unk : ModelSetupCommand
15 | {
16 | public ushort Unk { get; set; }
17 |
18 | public override void Read(BinaryStream bs, int commandsBaseOffset)
19 | {
20 | Unk = bs.ReadUInt16();
21 | }
22 |
23 | public override void Write(BinaryStream bs)
24 | {
25 | bs.WriteUInt16(Unk);
26 | }
27 |
28 | public override string ToString()
29 | {
30 | return $"{nameof(Command_65_Unk)}";
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/PDTools.Utils/MathUtils.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using System.Numerics;
5 |
6 | namespace PDTools.Utils;
7 |
8 | public static class MathUtils
9 | {
10 | public static float GetAxis(this Vector3 vec, int axis)
11 | {
12 | if (axis == 0)
13 | return vec.X;
14 | else if (axis == 1)
15 | return vec.Y;
16 | else
17 | return vec.Z;
18 | }
19 |
20 | public static void SetAxis(this ref Vector3 vec, int axis, float value)
21 | {
22 | if (axis == 0)
23 | vec.X = value;
24 | else if (axis == 1)
25 | vec.Y = value;
26 | else
27 | vec.Z = value;
28 | }
29 |
30 | public static float Lerp(float value1, float value2, float amount)
31 | {
32 | return (value1 * (1f - amount)) + (value2 * amount);
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS3/ModelSet3/PackedMesh/Commands/SmoothMeshTessellationCommand23.cs:
--------------------------------------------------------------------------------
1 | using PDTools.Utils;
2 |
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Diagnostics;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 |
10 | namespace PDTools.Files.Models.PS3.ModelSet3.PackedMesh.Commands;
11 |
12 | public class SmoothMeshTessellationCommand23 : SmoothMeshTessellationCommandBase
13 | {
14 | public byte EntryNum { get; set; }
15 | public ushort[] Unks { get; set; } = [];
16 |
17 | public override void Read(SmoothMeshTessellationCommandContext ctx, ref BitStream bs)
18 | {
19 | EntryNum = (byte)bs.ReadBits(6);
20 | Unks = new ushort[EntryNum + 1];
21 |
22 | for (int i = 0; i < EntryNum + 1; i++)
23 | {
24 | Unks[i] = (ushort)bs.ReadBits(ctx.Opcode21_Bit1 ? 16 : 12);
25 | }
26 | }
27 | }
--------------------------------------------------------------------------------
/PDTools.Files/Models/VM/Instructions/VMIntConst.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData;
8 |
9 | namespace PDTools.Files.Models.VM.Instructions;
10 |
11 | public class VMIntConst : VMInstruction
12 | {
13 | public override VMInstructionOpcode Opcode => VMInstructionOpcode.PushIntConst;
14 |
15 | public int Value { get; set; }
16 |
17 | public override void Read(BinaryStream bs, int commandsBaseOffset)
18 | {
19 | Value = bs.ReadInt32();
20 | }
21 |
22 | public override void Write(BinaryStream bs)
23 | {
24 | bs.WriteInt32(Value);
25 | }
26 |
27 | public override string Disassemble(Dictionary values)
28 | {
29 | return $"CONST_VALUE: {Value} ({BitConverter.Int32BitsToSingle(Value)})";
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS3/PGLCommands/Command_3_PGLUCallShapeByte.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Reflection.Metadata.Ecma335;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | using Syroot.BinaryData;
9 |
10 | namespace PDTools.Files.Models.PS3.PGLCommands
11 | {
12 | public class Command_3_PGLUCallShapeByte : ModelSetupCommand
13 | {
14 | public byte MeshIndex;
15 |
16 | public override void Read(BinaryStream bs, int commandsBaseOffset)
17 | {
18 | MeshIndex = bs.Read1Byte();
19 | }
20 |
21 | public override void Write(BinaryStream bs)
22 | {
23 | bs.WriteByte(MeshIndex);
24 | }
25 |
26 | public override string ToString()
27 | {
28 | return $"{nameof(Command_3_PGLUCallShapeByte)}: {MeshIndex}";
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS3/ModelSet3/Materials/MDL3MaterialData_0x18.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData;
8 |
9 | namespace PDTools.Files.Models.PS3.ModelSet3.Materials;
10 |
11 | public class MDL3MaterialData_0x18
12 | {
13 | public short[] Data { get; set; }
14 |
15 | public static MDL3MaterialData_0x18 FromStream(BinaryStream bs, long mdlBasePos, ushort mdl3VersionMajor)
16 | {
17 | MDL3MaterialData_0x18 entry = new MDL3MaterialData_0x18();
18 |
19 | int shortCount = bs.ReadInt32();
20 | int offset = bs.ReadInt32();
21 |
22 | bs.Position = mdlBasePos + offset;
23 | entry.Data = bs.ReadInt16s(shortCount);
24 |
25 | return entry;
26 | }
27 |
28 | public static int GetSize()
29 | {
30 | return 0x08;
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS3/ModelSet3/ShapeStream/MDL3ShapeStreamingInfoShapeEntry.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData;
8 |
9 | namespace PDTools.Files.Models.PS3.ModelSet3.ShapeStream;
10 |
11 | public class MDL3ShapeStreamingInfoShapeEntry
12 | {
13 | public uint OffsetInChunk { get; set; }
14 | public ushort ShapeIndex { get; set; }
15 | public ushort Unk { get; set; }
16 |
17 | public static MDL3ShapeStreamingInfoShapeEntry FromStream(BinaryStream bs, long baseMdlPos, uint mdl3Version)
18 | {
19 | MDL3ShapeStreamingInfoShapeEntry entry = new MDL3ShapeStreamingInfoShapeEntry();
20 | entry.OffsetInChunk = bs.ReadUInt32();
21 | entry.ShapeIndex = bs.ReadUInt16();
22 | entry.Unk = bs.ReadUInt16();
23 |
24 | return entry;
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/VM/Instructions/VMJumpIfFalse.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData;
8 |
9 | namespace PDTools.Files.Models.VM.Instructions;
10 |
11 | public class VMJumpIfFalse : VMInstruction
12 | {
13 | public override VMInstructionOpcode Opcode => VMInstructionOpcode.JumpNotZero;
14 |
15 | public short JumpOffset { get; set; }
16 |
17 | public override void Read(BinaryStream bs, int commandsBaseOffset)
18 | {
19 | JumpOffset = bs.ReadInt16();
20 | }
21 |
22 | public override void Write(BinaryStream bs)
23 | {
24 | bs.WriteInt16(JumpOffset);
25 | }
26 |
27 | public override string Disassemble(Dictionary values)
28 | {
29 | return $"JUMP_IF_FALSE: Offset={Offset + JumpOffset + 3:X2}";
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/PDTools.SpecDB/Core/Mapping/Tables/CarName.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Syroot.BinaryData.Core;
8 | using Syroot.BinaryData.Memory;
9 |
10 | namespace PDTools.SpecDB.Core.Mapping.Tables;
11 |
12 | public class CarName : TableMetadata
13 | {
14 | public override string LabelPrefix { get; } = "";
15 |
16 | public CarName(SpecDBFolder folderType, string localeName)
17 | {
18 | Columns.Add(new ColumnMetadata("Name", DBColumnType.String, localeName));
19 | Columns.Add(new ColumnMetadata("Grade", DBColumnType.String, localeName));
20 | Columns.Add(new ColumnMetadata("ShortName", DBColumnType.String, localeName));
21 |
22 | if (folderType <= SpecDBFolder.GT5_TRIAL_JP2704)
23 | Columns.Add(new ColumnMetadata("NarrationID", DBColumnType.Int));
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/PDTools.SaveFile/GT4/UserProfile/DayEvents/NoEvent.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using Syroot.BinaryData.Memory;
5 |
6 | using PDTools.Structures;
7 | using PDTools.Enums.PS2;
8 |
9 | namespace PDTools.SaveFile.GT4.UserProfile.DayEvents;
10 |
11 | public class NoEvent : IDayEvent
12 | {
13 | public DayEventType EventType => DayEventType.NO_EVENT;
14 |
15 | public byte[] Data { get; set; } = new byte[0x0F];
16 |
17 | public void CopyTo(IDayEvent dest)
18 | {
19 | ((NoEvent)dest).Data = new byte[Data.Length];
20 | Array.Copy(Data, ((NoEvent)dest).Data, Data.Length);
21 | }
22 |
23 | public void Pack(GT4Save save, ref SpanWriter sw)
24 | {
25 | sw.WriteBytes(Data); // TODO: Fix this
26 | }
27 |
28 | public void Unpack(GT4Save save, ref SpanReader sr)
29 | {
30 | Data = sr.ReadBytes(0x0F);
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS2/RenderCommands/Cmd_pglTexGenf_Default.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Numerics;
7 |
8 | using Syroot.BinaryData;
9 |
10 | namespace PDTools.Files.Models.PS2.RenderCommands;
11 |
12 | ///
13 | /// GT4 and above. Calls pglTexGenf(3, 0.0) and pglTexGenf(2, 1.0)
14 | ///
15 | public class Cmd_pglTexGenf_Default : ModelSetupPS2Command
16 | {
17 | public override ModelSetupPS2Opcode Opcode => ModelSetupPS2Opcode.pglTexGenf_Default;
18 |
19 | public override void Read(BinaryStream bs, int commandsBaseOffset)
20 | {
21 |
22 | }
23 |
24 | public override void Write(BinaryStream bs)
25 | {
26 |
27 | }
28 |
29 | public override string ToString()
30 | {
31 | return $"{nameof(Cmd_pglTexGenf_Default)}";
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/PDTools.Files/Models/PS3/ModelSet3/MDL3ModelVMUnk.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Numerics;
7 |
8 | using Syroot.BinaryData;
9 |
10 | namespace PDTools.Files.Models.PS3.ModelSet3;
11 |
12 | public class MDL3ModelVMUnk
13 | {
14 | public short[] UnkIndices { get; set; }
15 |
16 | public static MDL3ModelVMUnk FromStream(BinaryStream bs, long mdlBasePos, ushort mdl3VersionMajor)
17 | {
18 | MDL3ModelVMUnk unk = new();
19 |
20 | int indicesOffset = bs.ReadInt32();
21 |
22 | bs.Position += 0x2C;
23 | short indexCount = bs.ReadInt16();
24 |
25 | bs.Position = indicesOffset;
26 | unk.UnkIndices = bs.ReadInt16s(indexCount);
27 |
28 | return unk;
29 | }
30 |
31 | public static int GetSize()
32 | {
33 | return 0x40;
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/PDTools.GT4ElfBuilderTool/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using System.IO;
8 |
9 | namespace PDTools.GT4ElfBuilderTool;
10 |
11 | public class Program
12 | {
13 | static void Main(string[] args)
14 | {
15 | if (args.Length < 2)
16 | {
17 | Console.WriteLine("Input: