├── .gitattributes ├── .gitignore ├── .gitmodules ├── LICENSE ├── PDTools.Compression ├── PDIZIP.cs ├── PDTools.Compression.csproj ├── PS2ZIP.cs ├── README.md └── ZStdZIP.cs ├── PDTools.Crypto ├── ChaCha20.cs ├── ChaCha20Stream.cs ├── GT4ReplayCrypto.cs ├── MCipher.cs ├── MTRandom.cs ├── MiscCrypto.cs ├── PDIPFSDownloaderCrypto.cs ├── PDTools.Crypto.csproj ├── README.md ├── Salsa20.cs ├── Salsa20SymmetricAlgorithm.cs ├── SalsaUtils.cs ├── SharedCrypto.cs └── SimulationInterface │ ├── ISimulationInterfaceCryptor.cs │ ├── SimulatorInterfaceCryptorGT6.cs │ ├── SimulatorInterfaceCryptorGT7.cs │ └── SimulatorInterfaceCryptorGTSport.cs ├── PDTools.Enums ├── EngineEnums.cs ├── GameParameterEnums.cs ├── PDTools.Enums.csproj ├── PS2 │ └── Enums.cs └── PS3 │ └── Enums.cs ├── PDTools.Files.Fonts.NVecBuilder ├── PDTools.Files.Fonts.NVecBuilder.csproj ├── Program.cs ├── README.md └── TrueTypeToNVecConverter.cs ├── PDTools.Files ├── Color4f.cs ├── Courses │ ├── Autodrive │ │ ├── AttackInfo.cs │ │ ├── AutoDriveFile.cs │ │ ├── AutoDriveInfo.cs │ │ └── EnemyLine.cs │ ├── GT4ReplayData.cs │ ├── Minimap │ │ ├── CourseMapFace.cs │ │ ├── CourseMapFile.cs │ │ └── CourseMapPoint.cs │ ├── PS2 │ │ ├── CourseDataFileGT4.cs │ │ ├── CourseSound │ │ │ └── CourseSound.cs │ │ ├── DCourseEffect │ │ │ └── DCourseEffect.cs │ │ ├── MiniMapSet.cs │ │ ├── Runway │ │ │ ├── CourseVCalculator.cs │ │ │ ├── RunwayCheckpoint.cs │ │ │ ├── RunwayCluster.cs │ │ │ ├── RunwayData.cs │ │ │ ├── RunwayRoadTri.cs │ │ │ └── RunwayRoadVert.cs │ │ └── VisionList │ │ │ └── VisionList.cs │ ├── PS3 │ │ └── CourseDataFile.cs │ └── Runway │ │ ├── RunwayBoundaryVert.cs │ │ ├── RunwayCarLightSet.cs │ │ ├── RunwayCarLightSetCollection.cs │ │ ├── RunwayCheckpoint.cs │ │ ├── RunwayFile.cs │ │ ├── RunwayGadgetOld.cs │ │ ├── RunwayLightDefinition.cs │ │ ├── RunwayLightSet.cs │ │ ├── RunwayLightVFX.cs │ │ ├── RunwayRayCastData.cs │ │ ├── RunwayRayCastNode.cs │ │ ├── RunwayRoadTri.cs │ │ ├── RunwayRoadVert.cs │ │ ├── RunwayRoadVertMap.cs │ │ ├── RunwaySector.cs │ │ └── RunwayStartingGridPosition.cs ├── Fonts │ ├── Glyph.cs │ ├── GlyphLine.cs │ ├── GlyphPoint.cs │ ├── GlyphQuadraticBezierCurve.cs │ ├── GlyphShapes.cs │ ├── GlyphStartPoint.cs │ ├── IGlyphShapeData.cs │ └── NVectorFont.cs ├── Models │ ├── PS2 │ │ ├── CarModel0 │ │ │ └── CarModel0.cs │ │ ├── CarModel1 │ │ │ ├── CarInfo.cs │ │ │ ├── CarModel1.cs │ │ │ ├── CollisionParticle.cs │ │ │ ├── ExhaustData.cs │ │ │ ├── Light.cs │ │ │ ├── OnboardCameras.cs │ │ │ ├── TireFile.cs │ │ │ ├── TireIndices.cs │ │ │ └── WheelFile.cs │ │ ├── GIFTag.cs │ │ ├── GT2KCarData.cs │ │ ├── ModelSet │ │ │ ├── ModelCommandContext.cs │ │ │ ├── ModelPS2Base.cs │ │ │ ├── ModelSet0.cs │ │ │ ├── ModelSet0Model.cs │ │ │ ├── ModelSet1.cs │ │ │ ├── ModelSet1Bounding.cs │ │ │ ├── ModelSet1Model.cs │ │ │ ├── ModelSet1Serializer.cs │ │ │ ├── ModelSet2.cs │ │ │ ├── ModelSet2Model.cs │ │ │ ├── ModelSet2Serializer.cs │ │ │ └── ModelSetPS2Base.cs │ │ ├── PGLUmaterial.cs │ │ ├── PGLUshape.cs │ │ ├── RelocatorBase.cs │ │ ├── RenderCommandContext.cs │ │ ├── RenderCommands │ │ │ ├── Cmd_BBoxRender.cs │ │ │ ├── Cmd_CallModelCallback.cs │ │ │ ├── Cmd_CallVM.cs │ │ │ ├── Cmd_GT3_2_1ui.cs │ │ │ ├── Cmd_GT3_2_4f.cs │ │ │ ├── Cmd_GT3_3_1ui.cs │ │ │ ├── Cmd_GT3_3_4f.cs │ │ │ ├── Cmd_JumpByte.cs │ │ │ ├── Cmd_JumpShort.cs │ │ │ ├── Cmd_LODSelect.cs │ │ │ ├── Cmd_RenderModel_Byte.cs │ │ │ ├── Cmd_RenderModel_UShort.cs │ │ │ ├── Cmd_Unk53.cs │ │ │ ├── Cmd_VMCallbackByte.cs │ │ │ ├── Cmd_VMCallbackUShort.cs │ │ │ ├── Cmd_VM_Branch.cs │ │ │ ├── Cmd_VM_pglRotate.cs │ │ │ ├── Cmd_VM_pglVariableColorOffset.cs │ │ │ ├── Cmd_VM_pglVariableColorScale.cs │ │ │ ├── Cmd_VM_pgluShapeTweenRatio.cs │ │ │ ├── Cmd_pglAlphaFail.cs │ │ │ ├── Cmd_pglAlphaFunc.cs │ │ │ ├── Cmd_pglBlendFunc.cs │ │ │ ├── Cmd_pglColorMask1ui.cs │ │ │ ├── Cmd_pglCopyFogColor.cs │ │ │ ├── Cmd_pglCullFace_1.cs │ │ │ ├── Cmd_pglCullFace_2.cs │ │ │ ├── Cmd_pglDepthBias.cs │ │ │ ├── Cmd_pglDepthFunc.cs │ │ │ ├── Cmd_pglDestinationAlphaFunc.cs │ │ │ ├── Cmd_pglDisableAlphaTest.cs │ │ │ ├── Cmd_pglDisableCullFace.cs │ │ │ ├── Cmd_pglDisableDepthMask.cs │ │ │ ├── Cmd_pglDisableDepthTest.cs │ │ │ ├── Cmd_pglDisableDestinationAlphaTest.cs │ │ │ ├── Cmd_pglEnable17.cs │ │ │ ├── Cmd_pglEnable19_14.cs │ │ │ ├── Cmd_pglEnableAlphaTest.cs │ │ │ ├── Cmd_pglEnableCullFace.cs │ │ │ ├── Cmd_pglEnableDepthMask.cs │ │ │ ├── Cmd_pglEnableDepthTest.cs │ │ │ ├── Cmd_pglEnableDestinationAlphaTest.cs │ │ │ ├── Cmd_pglLoadMatrix.cs │ │ │ ├── Cmd_pglMatrixMode.cs │ │ │ ├── Cmd_pglMultMatrix.cs │ │ │ ├── Cmd_pglPopMatrix.cs │ │ │ ├── Cmd_pglPushMatrix.cs │ │ │ ├── Cmd_pglRotate.cs │ │ │ ├── Cmd_pglRotateX.cs │ │ │ ├── Cmd_pglRotateY.cs │ │ │ ├── Cmd_pglRotateZ.cs │ │ │ ├── Cmd_pglScale.cs │ │ │ ├── Cmd_pglSetFogColor.cs │ │ │ ├── Cmd_pglStoreFogColor.cs │ │ │ ├── Cmd_pglTexGenf_Default.cs │ │ │ ├── Cmd_pglTexGenf_WithCurrentFacingParameters.cs │ │ │ ├── Cmd_pglTranslate.cs │ │ │ ├── Cmd_pglVariableColorOffset.cs │ │ │ ├── Cmd_pglVariableColorScale.cs │ │ │ ├── Cmd_pgluCallShape_Byte.cs │ │ │ ├── Cmd_pgluCallShape_UShort.cs │ │ │ ├── Cmd_pgluSetExternalMatIndex.cs │ │ │ ├── Cmd_pgluSetExternalTexIndex.cs │ │ │ ├── Cmd_pgluSetTexTable_Byte.cs │ │ │ ├── Cmd_pgluSetTexTable_UShort.cs │ │ │ ├── Cmd_pgluTexTableFromExternalTexSetByte.cs │ │ │ ├── Cmd_pgluTexTableFromExternalTexSetUShort.cs │ │ │ ├── ModelSetupCommand.cs │ │ │ └── ModelSetupOpcode.cs │ │ ├── VIFCommand.cs │ │ ├── VIFDescriptor.cs │ │ └── VIFPacket.cs │ ├── PS3 │ │ ├── ModelSet3 │ │ │ ├── FVF │ │ │ │ ├── MDL3FVFDefinitionCollection.cs │ │ │ │ ├── MDL3FVFElementDefinition.cs │ │ │ │ ├── MDL3FVFFieldArrayDefinition.cs │ │ │ │ └── MDL3FlexibleVertexDefinition.cs │ │ │ ├── MDL3Bone.cs │ │ │ ├── MDL3Model.cs │ │ │ ├── MDL3ModelKey.cs │ │ │ ├── MDL3ModelKeyComparer.cs │ │ │ ├── MDL3ModelVMContext.cs │ │ │ ├── MDL3ModelVMUnk.cs │ │ │ ├── MDL3ModelVMUnk2.cs │ │ │ ├── MDL3ModelVMUnk2_0x04.cs │ │ │ ├── MDL3ModelVMUnk2_0x04_Data.cs │ │ │ ├── MDL3ModelVMUnk2_0x08.cs │ │ │ ├── MDL3TextureKey.cs │ │ │ ├── MDL3TextureKeyComparer.cs │ │ │ ├── Materials │ │ │ │ ├── CellGcmParams.cs │ │ │ │ ├── MDL3Material.cs │ │ │ │ ├── MDL3MaterialData.cs │ │ │ │ ├── MDL3MaterialData_0x14.cs │ │ │ │ ├── MDL3MaterialData_0x18.cs │ │ │ │ ├── MDL3MaterialData_0x1C.cs │ │ │ │ ├── MDL3MaterialShaderReferences.cs │ │ │ │ └── MDL3Materials.cs │ │ │ ├── Meshes │ │ │ │ ├── MDL3Mesh.cs │ │ │ │ ├── MDL3MeshKey.cs │ │ │ │ ├── MDL3MeshKeyComparer.cs │ │ │ │ └── MDL3MeshPackedMeshRef.cs │ │ │ ├── ModelSet3.cs │ │ │ ├── ModelSet3Serializer.cs │ │ │ ├── PackedMesh │ │ │ │ ├── PackedMeshElementBitLayout.cs │ │ │ │ ├── PackedMeshElementBitLayoutArray.cs │ │ │ │ ├── PackedMeshEntry.cs │ │ │ │ ├── PackedMeshEntryData.cs │ │ │ │ ├── PackedMeshFlexVertexDefinition.cs │ │ │ │ ├── PackedMeshFlexVertexElementDefinition.cs │ │ │ │ ├── PackedMeshHeader.cs │ │ │ │ └── PackedMeshKey.cs │ │ │ ├── ShapeStream │ │ │ │ ├── MDL3ShapeStreamingChunkInfo.cs │ │ │ │ ├── MDL3ShapeStreamingInfoMeshEntry.cs │ │ │ │ └── MDL3ShapeStreamingManager.cs │ │ │ └── Wing │ │ │ │ ├── MDL3WingData.cs │ │ │ │ ├── MDL3WingKey.cs │ │ │ │ └── MDL3WingKeyComparer.cs │ │ └── PGLCommands │ │ │ ├── Command_0_End.cs │ │ │ ├── Command_10_JumpToShort.cs │ │ │ ├── Command_11_PSP_Unk.cs │ │ │ ├── Command_13_PSP_Unk.cs │ │ │ ├── Command_14_Unk.cs │ │ │ ├── Command_15_Unk.cs │ │ │ ├── Command_16_PushMatrixMaybe.cs │ │ │ ├── Command_17_PushMatrix2Maybe.cs │ │ │ ├── Command_18_Unk.cs │ │ │ ├── Command_19_Unk.cs │ │ │ ├── Command_20_Unk.cs │ │ │ ├── Command_21_Unk.cs │ │ │ ├── Command_22_Unk.cs │ │ │ ├── Command_23_Unk.cs │ │ │ ├── Command_24_SetDepthTestEnabled.cs │ │ │ ├── Command_25_SetDepthTestDisabled.cs │ │ │ ├── Command_26_SetDepthFunc.cs │ │ │ ├── Command_27_SetAlphaTestEnabled.cs │ │ │ ├── Command_28_SetAlphaTestDisabled.cs │ │ │ ├── Command_29_SetAlphaFunc.cs │ │ │ ├── Command_2_Unk.cs │ │ │ ├── Command_34_SetColorMask.cs │ │ │ ├── Command_35_SetDepthMaskEnabled.cs │ │ │ ├── Command_36_SetDepthMaskDisabled.cs │ │ │ ├── Command_37_SetPolyOffsetScaleFactor.cs │ │ │ ├── Command_38_SetCullFaceDisable.cs │ │ │ ├── Command_39_SetCullFaceDisable.cs │ │ │ ├── Command_3_LoadMeshByteIndex.cs │ │ │ ├── Command_40_SetCullFaceBack.cs │ │ │ ├── Command_41_SetCullFaceFront.cs │ │ │ ├── Command_42_SetCullFaceSwitch.cs │ │ │ ├── Command_43_SetVMUnk.cs │ │ │ ├── Command_44_CallVM_Ptr2.cs │ │ │ ├── Command_45_Unk.cs │ │ │ ├── Command_46_Unk.cs │ │ │ ├── Command_47_Unk.cs │ │ │ ├── Command_49_Unk.cs │ │ │ ├── Command_4_LoadMeshUShortIndex.cs │ │ │ ├── Command_50_Unk.cs │ │ │ ├── Command_51_Unk.cs │ │ │ ├── Command_52_Unk.cs │ │ │ ├── Command_53_Unk.cs │ │ │ ├── Command_54_Unk.cs │ │ │ ├── Command_55_PSP_Unk.cs │ │ │ ├── Command_56_PSP_Unk.cs │ │ │ ├── Command_57_PSP_Unk.cs │ │ │ ├── Command_58_PSP_Unk.cs │ │ │ ├── Command_59_LoadMesh2_Byte.cs │ │ │ ├── Command_5_Switch.cs │ │ │ ├── Command_60_LoadMesh2_UShort.cs │ │ │ ├── Command_61_Semaphore_InvalidateL2.cs │ │ │ ├── Command_62_Unk.cs │ │ │ ├── Command_65_Unk.cs │ │ │ ├── Command_66_Unk.cs │ │ │ ├── Command_67_Unk.cs │ │ │ ├── Command_68_Unk.cs │ │ │ ├── Command_69_Unk.cs │ │ │ ├── Command_6_Unk.cs │ │ │ ├── Command_70_Unk.cs │ │ │ ├── Command_71_Unk.cs │ │ │ ├── Command_72_Unk.cs │ │ │ ├── Command_74_LoadMultipleMeshes.cs │ │ │ ├── Command_75_LoadMultipleMeshes2.cs │ │ │ ├── Command_77_Unk.cs │ │ │ ├── Command_7_Unk.cs │ │ │ ├── Command_8_Unk.cs │ │ │ ├── Command_9_JumpToByte.cs │ │ │ └── ModelSetupCommand.cs │ ├── Shaders │ │ ├── ShaderDefinition.cs │ │ ├── ShaderProgramEntry_0x20_0x14.cs │ │ ├── ShaderProgramEntry_0x20_0x18.cs │ │ ├── ShaderProgramEntry_0x2C_0x10.cs │ │ ├── ShaderProgramEntry_0x2C_0x14.cs │ │ ├── ShaderProgramEntry_0x2C_0x18.cs │ │ ├── ShaderProgramEntry_0x2C_0x38.cs │ │ ├── ShaderProgram_0x20.cs │ │ ├── ShaderProgram_0x2C.cs │ │ ├── ShaderProgram_0x40.cs │ │ ├── Shader_0x3C.cs │ │ └── ShadersHeader.cs │ ├── ShapeStream │ │ ├── ShapeStream.cs │ │ ├── ShapeStreamChunk.cs │ │ └── ShapeStreamMesh.cs │ └── VM │ │ ├── Instructions │ │ ├── VM0x10.cs │ │ ├── VM0xC2.cs │ │ ├── VMAdd.cs │ │ ├── VMAddF.cs │ │ ├── VMAtan2F.cs │ │ ├── VMBinaryAnd.cs │ │ ├── VMBinaryLeftShift.cs │ │ ├── VMBinaryOr.cs │ │ ├── VMBinaryRightShift.cs │ │ ├── VMBinaryXor.cs │ │ ├── VMCosF.cs │ │ ├── VMDivide.cs │ │ ├── VMDivideF.cs │ │ ├── VMEquals.cs │ │ ├── VMEqualsF.cs │ │ ├── VMFloatToInt.cs │ │ ├── VMGreaterThan.cs │ │ ├── VMGreaterThanF.cs │ │ ├── VMGreatherEqualTo.cs │ │ ├── VMGreatherEqualToF.cs │ │ ├── VMInstruction.cs │ │ ├── VMIntConst.cs │ │ ├── VMIntToFloat.cs │ │ ├── VMJump.cs │ │ ├── VMJumpIfFalse.cs │ │ ├── VMLesserEqualTo.cs │ │ ├── VMLesserEqualToF.cs │ │ ├── VMLesserThan.cs │ │ ├── VMLesserThanF.cs │ │ ├── VMMaxF.cs │ │ ├── VMMinF.cs │ │ ├── VMModulo.cs │ │ ├── VMModuloF.cs │ │ ├── VMMultiply.cs │ │ ├── VMMultiplyF.cs │ │ ├── VMNotEquals.cs │ │ ├── VMNotEqualsF.cs │ │ ├── VMPopAssignToLocal.cs │ │ ├── VMPowF.cs │ │ ├── VMRandF.cs │ │ ├── VMReturn.cs │ │ ├── VMSignF.cs │ │ ├── VMSinF.cs │ │ ├── VMSqrtF.cs │ │ ├── VMStackSeek.cs │ │ ├── VMSubtract.cs │ │ ├── VMSubtractF.cs │ │ ├── VMTanF.cs │ │ ├── VMUnaryBitwiseNot.cs │ │ ├── VMUnaryMinus.cs │ │ ├── VMUnaryMinusF.cs │ │ ├── VMVariableEval.cs │ │ └── VMVariablePush.cs │ │ ├── RegisterInfo.cs │ │ ├── RegisterValue.cs │ │ ├── VMBytecode.cs │ │ ├── VMContext.cs │ │ ├── VMHostMethodEntry.cs │ │ └── VMInstructionOpcodes.cs ├── PDTools.Files.csproj ├── README.md ├── Sound │ ├── EsHeader.cs │ ├── InsHeader.cs │ ├── Jam │ │ ├── JamHeader.cs │ │ └── JamProgChunk.cs │ ├── PS2 │ │ └── MusicInf │ │ │ ├── MusicInf.cs │ │ │ ├── Playlist.cs │ │ │ └── Track.cs │ ├── Se │ │ ├── Meta │ │ │ └── ISeMeta.cs │ │ └── SeSeq.cs │ └── Ssqt │ │ ├── Meta │ │ ├── ISqMeta.cs │ │ └── SqSetTempoEvent.cs │ │ ├── Ssqt.cs │ │ └── Sssq.cs ├── Textures │ ├── DDSEnums.cs │ ├── DdsHeader.cs │ ├── PDITexture.cs │ ├── PGLUTextureInfo.cs │ ├── PS2 │ │ ├── ClutPatch.cs │ │ ├── GSMemory.cs │ │ ├── GSPixelFormats │ │ │ ├── GSPixelFormat.cs │ │ │ ├── PSMT4.cs │ │ │ ├── PSMT8.cs │ │ │ └── PSM_CT32.cs │ │ ├── GSStructs.cs │ │ ├── PGLUTexture.cs │ │ ├── Tex1Utils.cs │ │ ├── TextureConfig.cs │ │ ├── TextureInfo.cs │ │ ├── TextureSet1.cs │ │ ├── TextureSetBuilder.cs │ │ ├── TextureSetPS2Base.cs │ │ └── UTextureSet.cs │ ├── PS3 │ │ ├── CellTexture.cs │ │ ├── CellTextureEnums.cs │ │ ├── PGLUCellTextureInfo.cs │ │ └── Swizzler.cs │ ├── PS4 │ │ ├── OrbisTextureBuffer.cs │ │ ├── OrbisTextureEnums.cs │ │ ├── PGLUOrbisTextureInfo.cs │ │ └── Swizzler.cs │ ├── PSP │ │ ├── GEClutBufferInfo.cs │ │ ├── GECommandList.cs │ │ ├── GETextureBuffer.cs │ │ ├── GETextureEnums.cs │ │ ├── GETextureStructs.cs │ │ ├── GEUtils.cs │ │ └── PGLUGETextureInfo.cs │ ├── Texture.cs │ ├── TextureSet3.cs │ └── TextureSet3ClutInfoBase.cs ├── Tri.cs └── Vec3R.cs ├── PDTools.GT4ElfBuilderTool ├── Elf.cs ├── ElfBuilder.cs ├── ElfSegment.cs ├── GTImageLoader.cs ├── PDTools.GT4ElfBuilderTool.csproj ├── Program.cs ├── Properties │ └── launchSettings.json ├── README.md └── RSAContext.cs ├── PDTools.GTPatcher ├── BreakLoggers │ ├── AdhocExceptionFixer.cs │ ├── AdhocExceptionLogger.cs │ ├── EvalExpressionCompilationTokenTypeLogger.cs │ ├── EvalExpressionStringLogger.cs │ ├── FileDeviceKernelAccessLogger.cs │ ├── FileDeviceMPHAccessLogger.cs │ ├── IBreakLogger.cs │ └── TinyWebAdhocModuleCacheDisabler.cs ├── Breakpoint.cs ├── CompilerEnums.cs ├── GT7AppOpt.txt ├── GTPatcher.cs ├── GTSAppOpt.txt ├── MemoryPatches │ ├── CommandLineInjector.cs │ ├── IMemoryPatch.cs │ ├── VersionBranchPatcher.cs │ ├── VersionBuildPatcher.cs │ └── VersionEnvironmentPatcher.cs ├── PDTools.GTPatcher.csproj ├── Program.cs ├── Properties │ └── launchSettings.json ├── README.md └── libdebug.dll ├── PDTools.GrimPFS ├── GrimPatch.cs ├── GrimPatchFile.cs └── PDTools.GrimPFS.csproj ├── PDTools.GrimSonyDLSBuilder ├── PDTools.GrimSonyDLSBuilder.csproj ├── PaceFileInfo.cs ├── PaceFileInfoParams.cs ├── PaceFileInfoPiece.cs └── Program.cs ├── PDTools.Hashing ├── CRC32.cs ├── CRC32C.cs ├── PDTools.Hashing.csproj ├── README.md └── SHA512.cs ├── PDTools.LiveTimingApi ├── Entities │ ├── LiveTimingBestLapEntry.cs │ ├── LiveTimingCondition.cs │ ├── LiveTimingConsumeState.cs │ ├── LiveTimingEntry.cs │ ├── LiveTimingRaceInfo.cs │ └── LiveTimingRaceState.cs ├── LiveTimingClient.cs ├── PDTools.LiveTimingApi.csproj └── README.md ├── PDTools.LiveTimingApiTestTool ├── PDTools.LiveTimingApiTestTool.csproj └── Program.cs ├── PDTools.RText ├── PDTools.RText.csproj ├── README.md ├── RT03.cs ├── RT03Page.cs ├── RT04.cs ├── RT04Page.cs ├── RT05.cs ├── RT05Page.cs ├── RTextBase.cs ├── RTextConstants.cs ├── RTextPageBase.cs ├── RTextPairUnit.cs ├── RTextParser.cs └── _50TR.cs ├── PDTools.SaveFile ├── GT4 │ ├── Context.cs │ ├── GT4GameData.cs │ ├── GT4Save.cs │ ├── GarageFileHeader.cs │ ├── ISerializableGT4Entity.cs │ ├── Option │ │ ├── BGMPlayData.cs │ │ ├── BGMPlaylist.cs │ │ ├── ColorCorrection.cs │ │ ├── GameZone.cs │ │ ├── OptionEvent.cs │ │ ├── OptionGT4.cs │ │ ├── OptionLanBattle.cs │ │ ├── OptionLogger.cs │ │ ├── OptionNetConfig.cs │ │ ├── OptionRaceControllerPS2.cs │ │ ├── OptionRaceInputPortPS2.cs │ │ └── PhysicalMonitorSize.cs │ └── UserProfile │ │ ├── Available.cs │ │ ├── Calendar.cs │ │ ├── ChampionshipContext.cs │ │ ├── CourseEntryUnit.cs │ │ ├── CourseRecordBase.cs │ │ ├── CourseRecordUnit.cs │ │ ├── DayEvents │ │ ├── BuyWheelEvent.cs │ │ ├── BuyWingEvent.cs │ │ ├── DayEvent.cs │ │ ├── GetCarEvent.cs │ │ ├── NoEvent.cs │ │ ├── RunCourseEvent.cs │ │ ├── RunLicenseEvent.cs │ │ ├── RunMissionEvent.cs │ │ ├── RunRaceEvent.cs │ │ └── SellCarEvent.cs │ │ ├── Favorite.cs │ │ ├── GarageCar.cs │ │ ├── GarageScratch.cs │ │ ├── LicenseEntryUnit.cs │ │ ├── LicenseRecord.cs │ │ ├── LicenseRecordUnit.cs │ │ ├── Present.cs │ │ ├── RaceRecord.cs │ │ ├── RaceRecordUnit.cs │ │ ├── UsedCar.cs │ │ └── UserProfileGT4.cs ├── PDTools.SaveFile.csproj └── README.md ├── PDTools.ScapesDataHelper ├── ExifInfo.cs ├── JxlBoxInfoMap.cs ├── PDTools.ScapesDataHelper.csproj ├── README.md └── ScapesExifDataExtractor.cs ├── PDTools.SimulatorInterface ├── PDTools.SimulatorInterface.csproj ├── README.md ├── SimulatorInterfaceClient.cs ├── SimulatorInterfaceGameType.cs └── SimulatorPacket.cs ├── PDTools.SimulatorInterfaceTestTool ├── PDTools.SimulatorInterfaceTestTool.csproj ├── Program.cs └── README.md ├── PDTools.SpecDB ├── Core │ ├── CompressedTableWriter.cs │ ├── DatabaseTableHuffmanTree.cs │ ├── Formats │ │ ├── DBT_DatabaseTable.cs │ │ ├── IDI_LabelInformation.cs │ │ ├── RaceSpec.cs │ │ ├── SDB_StringDatabase.cs │ │ └── TBI_PartsInfo.cs │ ├── Mapping │ │ ├── TableMetadata.cs │ │ ├── Tables │ │ │ ├── ASCC.cs │ │ │ ├── AirCleaner.cs │ │ │ ├── AllowEntry.cs │ │ │ ├── ArcadeInfo.cs │ │ │ ├── Brake.cs │ │ │ ├── BrakeController.cs │ │ │ ├── CarCustomInfo.cs │ │ │ ├── CarName.cs │ │ │ ├── CarVariation.cs │ │ │ ├── Catalyst.cs │ │ │ ├── Chassis.cs │ │ │ ├── Clutch.cs │ │ │ ├── Computer.cs │ │ │ ├── Course.cs │ │ │ ├── CourseName.cs │ │ │ ├── DefaultParam.cs │ │ │ ├── DefaultParts.cs │ │ │ ├── Displacement.cs │ │ │ ├── Drivetrain.cs │ │ │ ├── EnemyCars.cs │ │ │ ├── Engine.cs │ │ │ ├── EngineBalance.cs │ │ │ ├── ExhaustManifold.cs │ │ │ ├── Flywheel.cs │ │ │ ├── FrontTire.cs │ │ │ ├── Gear.cs │ │ │ ├── GenericCar.cs │ │ │ ├── GenericCarInfo.cs │ │ │ ├── GenericItems.cs │ │ │ ├── IndepThrottle.cs │ │ │ ├── IntakeManifold.cs │ │ │ ├── Intercooler.cs │ │ │ ├── Lightweight.cs │ │ │ ├── Lsd.cs │ │ │ ├── Maker.cs │ │ │ ├── ModelInfo.cs │ │ │ ├── Muffler.cs │ │ │ ├── NOS.cs │ │ │ ├── Natune.cs │ │ │ ├── PaintColorInfo.cs │ │ │ ├── PortPolish.cs │ │ │ ├── PropellerShaft.cs │ │ │ ├── Race.cs │ │ │ ├── RacingModify.cs │ │ │ ├── RearTire.cs │ │ │ ├── RiderEquipment.cs │ │ │ ├── RiderSet.cs │ │ │ ├── RiderSetAssign.cs │ │ │ ├── Steer.cs │ │ │ ├── Supercharger.cs │ │ │ ├── Suspension.cs │ │ │ ├── TCSC.cs │ │ │ ├── TireCompound.cs │ │ │ ├── TireForceVol.cs │ │ │ ├── TireSize.cs │ │ │ ├── TunedCars.cs │ │ │ ├── Tuner.cs │ │ │ ├── TunerList.cs │ │ │ ├── TurbineKit.cs │ │ │ ├── Variation.cs │ │ │ ├── Wheel.cs │ │ │ └── Wing.cs │ │ └── Types │ │ │ ├── DBBool.cs │ │ │ ├── DBByte.cs │ │ │ ├── DBFloat.cs │ │ │ ├── DBInt.cs │ │ │ ├── DBKey.cs │ │ │ ├── DBLong.cs │ │ │ ├── DBSByte.cs │ │ │ ├── DBShort.cs │ │ │ ├── DBString.cs │ │ │ ├── DBUInt.cs │ │ │ ├── DBUShort.cs │ │ │ └── IDBType.cs │ ├── PartsInfoBuilder.cs │ ├── RowData.cs │ ├── RowKey.cs │ ├── RowLabelComparer.cs │ ├── SpecDB.cs │ ├── SpecDBDebugPrinter.cs │ └── Table.cs ├── ISpecDB.cs ├── PDTools.SpecDB.csproj ├── README.md ├── SpecDBOldWrapper.cs ├── SpecDBQueryResult.cs └── SpecDBSQLiteWrapper.cs ├── PDTools.Structures ├── DbCode.cs ├── MCarThin.cs ├── MGameItem.cs ├── MGameParameter │ ├── AchieveCondition.cs │ ├── ArcadeStyleSetting.cs │ ├── BoostParams.cs │ ├── BoostTable.cs │ ├── Constraint.cs │ ├── CourseGeneratorParam.cs │ ├── CourseGeneratorParamSection.cs │ ├── DriftCondition.cs │ ├── DriftSection.cs │ ├── EditorInfo.cs │ ├── Entry.cs │ ├── EntryBase.cs │ ├── EntryGenerate.cs │ ├── EntrySet.cs │ ├── EvalCondition.cs │ ├── Event.cs │ ├── EventListFolder.cs │ ├── FailureCondition.cs │ ├── Gadget.cs │ ├── GameParameter.cs │ ├── GameParameterEventList.cs │ ├── Information.cs │ ├── LicenseCondition.cs │ ├── LocalizeText.cs │ ├── OnlineRoomParameter.cs │ ├── PenaltyParameter.cs │ ├── PlayStyle.cs │ ├── RaceParameter.cs │ ├── Ranking.cs │ ├── Regulation.cs │ ├── Replay.cs │ ├── Reward.cs │ ├── StageData.cs │ ├── StageResetData.cs │ ├── Track.cs │ └── WeatherData.cs ├── MPDINetworkUserId.cs ├── MReplayInfo.cs ├── PDIDATETIME.cs ├── PDIDATETIME32.cs ├── PDIDATETIME_Julian.cs ├── PDIDATE_Julian.cs ├── PDTools.Structures.csproj ├── PS2 │ ├── AutomobileAccumulatedStatus.cs │ ├── CarEquipments.cs │ └── CarGarage.cs ├── PS3 │ ├── MCarDriverParameter.cs │ ├── MCarParameter.cs │ ├── MCarThin.cs │ ├── MPDINetworkUserId.cs │ ├── MReplayInfo.cs │ ├── MatchingEventId.cs │ └── RankingStats.cs ├── README.md └── RankingStats.cs ├── PDTools.Utils ├── AlphaNumStringComparer.cs ├── BitStream.cs ├── ByteBufferComparer.cs ├── Extensions.cs ├── MathUtils.cs ├── MiscUtils.cs ├── OptimizedStringTable.cs ├── PDIPFSPathScrambler.cs ├── PDTools.Utils.csproj ├── README.md ├── RegionUtil.cs └── XmlUtils.cs ├── PDTools.sln ├── README.md └── STStruct ├── NodeBase.cs ├── Nodes ├── MBlob.cs ├── STArray.cs ├── STByte.cs ├── STFloat.cs ├── STInt.cs ├── STLong.cs ├── STMap.cs ├── STObject.cs ├── STObjectNull.cs ├── STSByte.cs ├── STShort.cs ├── STString.cs ├── STUInt.cs ├── STULong.cs └── STUShort.cs ├── PDTools.STStruct.csproj ├── STStruct.cs └── Utils.cs /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "Typography"] 2 | path = Typography 3 | url = https://github.com/LayoutFarm/Typography.git 4 | -------------------------------------------------------------------------------- /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.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.Crypto/PDTools.Crypto.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net9.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /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.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.Enums/PDTools.Enums.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net9.0 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /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.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.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/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/Courses/PS2/Runway/RunwayRoadVert.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.Courses.PS2.Runway; 11 | 12 | public class RunwayRoadVert 13 | { 14 | public Vector3 Vertex { get; set; } 15 | public short Unk { get; set; } 16 | public byte Unk2 { get; set; } 17 | public byte Unk3 { get; set; } 18 | public static RunwayRoadVert FromStream(BinaryStream bs) 19 | { 20 | RunwayRoadVert vert = new RunwayRoadVert(); 21 | vert.Vertex = new Vector3(bs.ReadSingle(), bs.ReadSingle(), bs.ReadSingle()); 22 | vert.Unk = bs.ReadInt16(); 23 | vert.Unk2 = bs.Read1Byte(); 24 | vert.Unk3 = bs.Read1Byte(); 25 | 26 | return vert; 27 | } 28 | 29 | public static int GetSize() 30 | { 31 | return 0x10; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /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/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/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/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/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/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/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.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/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/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/PS2/ModelSet/ModelSet1Bounding.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.ModelSet; 11 | 12 | /// 13 | /// Bounding (?) 14 | /// 15 | public class ModelSet1Bounding 16 | { 17 | public Vector4 Value { get; set; } // Only W is used, for computing LOD width? see: GT3 EU 0x225f08 (defaultLOD) 18 | 19 | public void FromStream(BinaryStream bs) 20 | { 21 | Value = new Vector4(bs.ReadSingle(), bs.ReadSingle(), bs.ReadSingle(), bs.ReadSingle()); 22 | } 23 | 24 | public void Write(BinaryStream bs) 25 | { 26 | bs.WriteSingle(Value.X); bs.WriteSingle(Value.Y); bs.WriteSingle(Value.Z); bs.WriteSingle(Value.W); 27 | } 28 | 29 | public static int GetSize() 30 | { 31 | return 0x10; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /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/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/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/PS2/RenderCommands/Cmd_RenderModel_Byte.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_RenderModel_Byte : ModelSetupPS2Command 13 | { 14 | public override ModelSetupPS2Opcode Opcode => ModelSetupPS2Opcode.RenderModel_Byte; 15 | 16 | public byte ModelIndex { get; set; } 17 | 18 | public Cmd_RenderModel_Byte() 19 | { 20 | 21 | } 22 | 23 | public override void Read(BinaryStream bs, int commandsBaseOffset) 24 | { 25 | ModelIndex = bs.Read1Byte(); 26 | } 27 | 28 | public override void Write(BinaryStream bs) 29 | { 30 | bs.WriteByte(ModelIndex); 31 | } 32 | 33 | public override string ToString() 34 | { 35 | return $"{nameof(Cmd_RenderModel_Byte)}"; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /PDTools.Files/Models/PS2/RenderCommands/Cmd_RenderModel_UShort.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_RenderModel_UShort : ModelSetupPS2Command 13 | { 14 | public override ModelSetupPS2Opcode Opcode => ModelSetupPS2Opcode.RenderModel_UShort; 15 | 16 | public ushort ModelIndex { get; set; } 17 | 18 | public Cmd_RenderModel_UShort() 19 | { 20 | 21 | } 22 | 23 | public override void Read(BinaryStream bs, int commandsBaseOffset) 24 | { 25 | ModelIndex = bs.ReadUInt16(); 26 | } 27 | 28 | public override void Write(BinaryStream bs) 29 | { 30 | bs.WriteUInt16(ModelIndex); 31 | } 32 | 33 | public override string ToString() 34 | { 35 | return $"{nameof(Cmd_RenderModel_UShort)}"; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /PDTools.Files/Models/PS2/RenderCommands/Cmd_VMCallbackByte.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 14 | /// 15 | public class Cmd_VMCallbackByte : ModelSetupPS2Command 16 | { 17 | public byte Param { get; set; } 18 | 19 | public override ModelSetupPS2Opcode Opcode => ModelSetupPS2Opcode.VMCallback_Byte; 20 | 21 | public override void Read(BinaryStream bs, int commandsBaseOffset) 22 | { 23 | Param = bs.Read1Byte(); 24 | } 25 | 26 | public override void Write(BinaryStream bs) 27 | { 28 | bs.WriteByte(Param); 29 | } 30 | 31 | public override string ToString() 32 | { 33 | return $"{nameof(Cmd_VMCallbackByte)}"; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /PDTools.Files/Models/PS2/RenderCommands/Cmd_VMCallbackUShort.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 14 | /// 15 | public class Cmd_VMCallbackUShort : ModelSetupPS2Command 16 | { 17 | public ushort Param { get; set; } 18 | 19 | public override ModelSetupPS2Opcode Opcode => ModelSetupPS2Opcode.VMCallback_UShort; 20 | 21 | public override void Read(BinaryStream bs, int commandsBaseOffset) 22 | { 23 | Param = bs.ReadUInt16(); 24 | } 25 | 26 | public override void Write(BinaryStream bs) 27 | { 28 | bs.WriteUInt16(Param); 29 | } 30 | 31 | public override string ToString() 32 | { 33 | return $"{nameof(Cmd_VMCallbackUShort)}"; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /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/PS2/RenderCommands/Cmd_pglCullFace_1.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 pglCullFace(1) 14 | /// 15 | public class Cmd_pglCullFace_1 : ModelSetupPS2Command 16 | { 17 | public override ModelSetupPS2Opcode Opcode => ModelSetupPS2Opcode.pglCullFace_1; 18 | 19 | public float Color { get; set; } 20 | 21 | public Cmd_pglCullFace_1() 22 | { 23 | 24 | } 25 | 26 | public override void Read(BinaryStream bs, int commandsBaseOffset) 27 | { 28 | 29 | } 30 | 31 | public override void Write(BinaryStream bs) 32 | { 33 | 34 | } 35 | 36 | public override string ToString() 37 | { 38 | return $"{nameof(Cmd_pglCullFace_1)}"; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /PDTools.Files/Models/PS2/RenderCommands/Cmd_pglCullFace_2.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 pglCullFace(2) 14 | /// 15 | public class Cmd_pglCullFace_2 : ModelSetupPS2Command 16 | { 17 | public override ModelSetupPS2Opcode Opcode => ModelSetupPS2Opcode.pglCullFace_2; 18 | 19 | public float Color { get; set; } 20 | 21 | public Cmd_pglCullFace_2() 22 | { 23 | 24 | } 25 | 26 | public override void Read(BinaryStream bs, int commandsBaseOffset) 27 | { 28 | 29 | } 30 | 31 | public override void Write(BinaryStream bs) 32 | { 33 | 34 | } 35 | 36 | public override string ToString() 37 | { 38 | return $"{nameof(Cmd_pglCullFace_2)}"; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /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_pglDisableCullFace.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 | using PDTools.Files.Models.PS2.RenderCommands; 10 | 11 | namespace PDTools.Files.Models.PS2.Commands; 12 | 13 | /// 14 | /// Calls glDisable(15). Disables face culling 15 | /// 16 | public class Cmd_pglDisableCullFace : ModelSetupPS2Command 17 | { 18 | public override ModelSetupPS2Opcode Opcode => ModelSetupPS2Opcode.pglDisableCullFace; 19 | 20 | public override void Read(BinaryStream bs, int commandsBaseOffset) 21 | { 22 | 23 | } 24 | 25 | public override void Write(BinaryStream bs) 26 | { 27 | 28 | } 29 | 30 | public override string ToString() 31 | { 32 | return $"{nameof(Cmd_pglDisableCullFace)}"; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /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/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/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_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/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_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/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.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/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/PS2/RenderCommands/Cmd_pglPopMatrix.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 | /// Pops the current matrix stack, replacing the current matrix with the one below it on the stack. Similar to glPopMatrix 14 | /// 15 | public class Cmd_pglPopMatrix : ModelSetupPS2Command 16 | { 17 | public override ModelSetupPS2Opcode Opcode => ModelSetupPS2Opcode.pglPopMatrix; 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_pglPopMatrix)}"; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /PDTools.Files/Models/PS2/RenderCommands/Cmd_pglPushMatrix.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 | /// Pushes the current matrix stack down by one, duplicating the current matrix. Similar to glPushMatrix 14 | /// 15 | public class Cmd_pglPushMatrix : ModelSetupPS2Command 16 | { 17 | public override ModelSetupPS2Opcode Opcode => ModelSetupPS2Opcode.pglPushMatrix; 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_pglPushMatrix)}"; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /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/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/PS2/RenderCommands/Cmd_pgluCallShape_Byte.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_pgluCallShapeByte : ModelSetupPS2Command 13 | { 14 | public override ModelSetupPS2Opcode Opcode => ModelSetupPS2Opcode.pgluCallShape_Byte; 15 | 16 | public byte ShapeIndex { get; set; } 17 | 18 | public override void Read(BinaryStream bs, int commandsBaseOffset) 19 | { 20 | ShapeIndex = bs.Read1Byte(); 21 | } 22 | 23 | public override void Write(BinaryStream bs) 24 | { 25 | bs.WriteByte(ShapeIndex); 26 | } 27 | 28 | public override string ToString() 29 | { 30 | return $"{nameof(Cmd_pgluCallShapeByte)} - Shape: {ShapeIndex}"; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /PDTools.Files/Models/PS2/RenderCommands/Cmd_pgluCallShape_UShort.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_pgluCallShape_UShort : ModelSetupPS2Command 13 | { 14 | public override ModelSetupPS2Opcode Opcode => ModelSetupPS2Opcode.pgluCallShape_UShort; 15 | 16 | public ushort ShapeIndex { get; set; } 17 | 18 | public override void Read(BinaryStream bs, int commandsBaseOffset) 19 | { 20 | ShapeIndex = bs.ReadUInt16(); 21 | } 22 | 23 | public override void Write(BinaryStream bs) 24 | { 25 | bs.WriteUInt16(ShapeIndex); 26 | } 27 | 28 | public override string ToString() 29 | { 30 | return $"{nameof(Cmd_pgluCallShape_UShort)} - Shape: {ShapeIndex}"; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /PDTools.Files/Models/PS2/RenderCommands/Cmd_pgluSetExternalMatIndex.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_pgluSetExternalMatIndex : ModelSetupPS2Command 13 | { 14 | public override ModelSetupPS2Opcode Opcode => ModelSetupPS2Opcode.pglExternalMatIndex; 15 | 16 | public byte MatIndex { get; set; } 17 | 18 | public override void Read(BinaryStream bs, int commandsBaseOffset) 19 | { 20 | MatIndex = bs.Read1Byte(); 21 | } 22 | 23 | public override void Write(BinaryStream bs) 24 | { 25 | bs.WriteByte(MatIndex); 26 | } 27 | 28 | public override string ToString() 29 | { 30 | return $"{nameof(Cmd_pgluSetExternalMatIndex)} - Mat: {MatIndex}"; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /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.Files/Models/PS3/ModelSet3/MDL3ModelVMContext.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 MDL3ModelVMContext 13 | { 14 | public int UnkVMInsPtr { get; set; } 15 | public int UnkVMInsPtr2 { get; set; } 16 | public int Unk { get; set; } 17 | public static MDL3ModelVMContext FromStream(BinaryStream bs, long mdlBasePos, ushort mdl3VersionMajor) 18 | { 19 | MDL3ModelVMContext ctx = new(); 20 | 21 | ctx.UnkVMInsPtr = bs.ReadInt32(); 22 | ctx.UnkVMInsPtr2 = bs.ReadInt32(); 23 | bs.ReadInt32(); 24 | ctx.Unk = bs.ReadInt32(); 25 | 26 | return ctx; 27 | } 28 | 29 | public static int GetSize() 30 | { 31 | return 0x20; 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.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/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/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/Meshes/MDL3MeshPackedMeshRef.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.Meshes; 11 | 12 | public class MDL3MeshPackedMeshRef 13 | { 14 | public float[] Values { get; set; } = new float[12]; 15 | public int PackedMeshEntryIndex { get; set; } 16 | public static MDL3MeshPackedMeshRef FromStream(BinaryStream bs, long mdlBasePos, ushort mdl3VersionMajor) 17 | { 18 | long unkBasePos = bs.Position; 19 | 20 | var unk = new MDL3MeshPackedMeshRef(); 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/ModelSet3/ShapeStream/MDL3ShapeStreamingInfoMeshEntry.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 MDL3ShapeStreamingInfoMeshEntry 12 | { 13 | public uint OffsetInChunk { get; set; } 14 | public ushort MeshIndex { get; set; } 15 | public ushort Unk { get; set; } 16 | 17 | public static MDL3ShapeStreamingInfoMeshEntry FromStream(BinaryStream bs, long baseMdlPos, uint mdl3Version) 18 | { 19 | MDL3ShapeStreamingInfoMeshEntry entry = new MDL3ShapeStreamingInfoMeshEntry(); 20 | entry.OffsetInChunk = bs.ReadUInt32(); 21 | entry.MeshIndex = bs.ReadUInt16(); 22 | entry.Unk = bs.ReadUInt16(); 23 | 24 | return entry; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /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/Models/PS3/ModelSet3/Wing/MDL3WingKey.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | using Syroot.BinaryData; 6 | 7 | namespace PDTools.Files.Models.PS3.ModelSet3.Wing; 8 | 9 | public class MDL3WingKey 10 | { 11 | public uint WingDataID { get; set; } 12 | public string Name { get; set; } 13 | 14 | public static MDL3WingKey FromStream(BinaryStream bs, long mdlBasePos, ushort mdl3Version) 15 | { 16 | MDL3WingKey modelKey = new(); 17 | int strOffset = bs.ReadInt32(); 18 | modelKey.WingDataID = bs.ReadUInt32(); 19 | 20 | bs.Position = mdlBasePos + strOffset; 21 | modelKey.Name = bs.ReadString(StringCoding.ZeroTerminated); 22 | 23 | return modelKey; 24 | } 25 | 26 | public static int GetSize() 27 | { 28 | return 0x08; 29 | } 30 | 31 | public override string ToString() 32 | { 33 | return $"{Name} (Wing Data ID: {WingDataID})"; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /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.Files/Models/PS3/PGLCommands/Command_11_PSP_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_11_PSP_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_11_PSP_Unk)} - {Unk}"; 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /PDTools.Files/Models/PS3/PGLCommands/Command_13_PSP_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_13_PSP_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_13_PSP_Unk)} - {Unk}"; 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /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_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/PS3/PGLCommands/Command_16_PushMatrixMaybe.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 sure 13 | /// 14 | public class Command_16_PGLInverse : ModelSetupCommand 15 | { 16 | public float[] Matrix { get; set; } 17 | public override void Read(BinaryStream bs, int commandsBaseOffset) 18 | { 19 | Matrix = bs.ReadSingles(16); 20 | } 21 | 22 | public override void Write(BinaryStream bs) 23 | { 24 | for (var i = 0; i < 16; i++) 25 | bs.WriteSingle(Matrix[i]); 26 | } 27 | 28 | public override string ToString() 29 | { 30 | return $"{nameof(Command_16_PGLInverse)} - {string.Join(", ", Matrix)}"; 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /PDTools.Files/Models/PS3/PGLCommands/Command_18_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 | /// 13 | /// Matrix related? 14 | /// 15 | public class Command_18_PGLScale : ModelSetupCommand 16 | { 17 | public Vector3 Vec { get; set; } 18 | public override void Read(BinaryStream bs, int commandsBaseOffset) 19 | { 20 | Vec = new Vector3(bs.ReadSingle(), bs.ReadSingle(), bs.ReadSingle()); 21 | 22 | } 23 | 24 | public override void Write(BinaryStream bs) 25 | { 26 | 27 | } 28 | 29 | public override string ToString() 30 | { 31 | return $"{nameof(Command_18_PGLScale)} - {Vec}"; 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /PDTools.Files/Models/PS3/PGLCommands/Command_19_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 | /// 13 | /// Matrix related? 14 | /// 15 | public class Command_19_PGLRotate : ModelSetupCommand 16 | { 17 | public Vector3 Vec { get; set; } 18 | public override void Read(BinaryStream bs, int commandsBaseOffset) 19 | { 20 | Vec = new Vector3(bs.ReadSingle(), bs.ReadSingle(), bs.ReadSingle()); 21 | 22 | } 23 | 24 | public override void Write(BinaryStream bs) 25 | { 26 | 27 | } 28 | 29 | public override string ToString() 30 | { 31 | return $"{nameof(Command_19_PGLRotate)} - {Vec}"; 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /PDTools.Files/Models/PS3/PGLCommands/Command_20_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 | /// 13 | /// Matrix related? 14 | /// 15 | public class Command_20_PGLRotateX : ModelSetupCommand 16 | { 17 | public float[] Values { get; set; } 18 | public override void Read(BinaryStream bs, int commandsBaseOffset) 19 | { 20 | Values = bs.ReadSingles(4); 21 | } 22 | 23 | public override void Write(BinaryStream bs) 24 | { 25 | bs.WriteSingles(Values); 26 | } 27 | 28 | public override string ToString() 29 | { 30 | return $"{nameof(Command_20_PGLRotateX)} - {string.Join(", ", Values)}"; 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /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/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_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_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/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/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.Files/Models/PS3/PGLCommands/Command_34_SetColorMask.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_34_SetColorMask : ModelSetupCommand 13 | { 14 | public byte MaskBoolBits { get; set; } 15 | 16 | public override void Read(BinaryStream bs, int commandsBaseOffset) 17 | { 18 | MaskBoolBits = bs.Read1Byte(); 19 | } 20 | 21 | public override void Write(BinaryStream bs) 22 | { 23 | bs.WriteByte(MaskBoolBits); 24 | } 25 | 26 | public override string ToString() 27 | { 28 | return $"{nameof(Command_34_SetColorMask)} - Mask:{MaskBoolBits}"; 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /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/PS3/PGLCommands/Command_36_SetDepthMaskDisabled.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_36_SetDepthMaskDisabled : ModelSetupCommand 13 | { 14 | public byte MaskBoolBits { get; set; } 15 | 16 | public override void Read(BinaryStream bs, int commandsBaseOffset) 17 | { 18 | MaskBoolBits = bs.Read1Byte(); 19 | } 20 | 21 | public override void Write(BinaryStream bs) 22 | { 23 | bs.WriteByte(MaskBoolBits); 24 | } 25 | 26 | public override string ToString() 27 | { 28 | return $"{nameof(Command_36_SetDepthMaskDisabled)} - Mask:{MaskBoolBits}"; 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /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/PS3/PGLCommands/Command_3_LoadMeshByteIndex.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_LoadMeshByteIndex : 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_LoadMeshByteIndex)}: {MeshIndex}"; 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /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/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/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_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/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_4_LoadMeshUShortIndex.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_LoadMeshUShortIndex : 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_LoadMeshUShortIndex)}: {MeshIndex}"; 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /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_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.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_56_PSP_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 | /// Seen in GT PSP, not present in GT6 - seemingly unused 13 | /// 14 | public class Command_56_PSP_Unk : ModelSetupCommand 15 | { 16 | public byte[] Values { get; set; } 17 | 18 | public override void Read(BinaryStream bs, int commandsBaseOffset) 19 | { 20 | Values = bs.ReadBytes(0x10); 21 | } 22 | 23 | public override void Write(BinaryStream bs) 24 | { 25 | bs.WriteBytes(Values); 26 | } 27 | 28 | public override string ToString() 29 | { 30 | return $"{nameof(Command_56_PSP_Unk)}: {string.Join(",", Values)}"; 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /PDTools.Files/Models/PS3/PGLCommands/Command_59_LoadMesh2_Byte.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_59_LoadMesh2_Byte : ModelSetupCommand 12 | { 13 | public byte MeshID { get; set; } 14 | public byte Unk { get; set; } 15 | 16 | public override void Read(BinaryStream bs, int commandsBaseOffset) 17 | { 18 | MeshID = bs.Read1Byte(); 19 | Unk = bs.Read1Byte(); 20 | } 21 | 22 | public override void Write(BinaryStream bs) 23 | { 24 | bs.WriteByte(MeshID); 25 | bs.WriteByte(Unk); 26 | } 27 | 28 | public override string ToString() 29 | { 30 | return $"{nameof(Command_59_LoadMesh2_Byte)}: {MeshID} {Unk}"; 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /PDTools.Files/Models/PS3/PGLCommands/Command_60_LoadMesh2_UShort.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_60_LoadMesh2_UShort : ModelSetupCommand 12 | { 13 | public short Unk { get; set; } 14 | public short Unk2 { get; set; } 15 | 16 | public override void Read(BinaryStream bs, int commandsBaseOffset) 17 | { 18 | Unk = bs.ReadInt16(); 19 | Unk2 = bs.ReadInt16(); 20 | } 21 | 22 | public override void Write(BinaryStream bs) 23 | { 24 | bs.WriteInt16(Unk); 25 | bs.WriteInt16(Unk2); 26 | } 27 | 28 | public override string ToString() 29 | { 30 | return $"{nameof(Command_60_LoadMesh2_UShort)} - {Unk} {Unk2}"; 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /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/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_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.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.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/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/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_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/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.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/ShapeStream/ShapeStreamMesh.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 ShapeStreamMesh 9 | { 10 | public const int HeaderSize = 0x80; 11 | 12 | public ShapeStreamChunk ShapeStreamChunk { get; set; } 13 | public MDL3ShapeStreamingInfoMeshEntry 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/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/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.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.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/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/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/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/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/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.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/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/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/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/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/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/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/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/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/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.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/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/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/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.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/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/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/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/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/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/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/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/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/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.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/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/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/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.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/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/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 | -------------------------------------------------------------------------------- /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/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/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.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.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/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/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.Files/Sound/PS2/MusicInf/Playlist.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 Playlist 10 | { 11 | public string Name { get; set; } 12 | public List Tracks { get; set; } = []; 13 | public string TrackIndexesNames 14 | { 15 | get 16 | { 17 | if (Tracks.Count == 0) 18 | return $" : No tracks in playlist!"; 19 | else if (Tracks.Count == 1) 20 | return "1 track"; 21 | else 22 | return $"{Tracks.Count} tracks"; 23 | 24 | } 25 | } 26 | 27 | public void AddTrack(Track track) 28 | => Tracks.Add(track); 29 | 30 | public void RemoveTrack(Track track) 31 | => Tracks.Remove(track); 32 | 33 | public override string ToString() 34 | => Name; 35 | } 36 | -------------------------------------------------------------------------------- /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.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 | -------------------------------------------------------------------------------- /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/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.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.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/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.Files/Vec3R.cs: -------------------------------------------------------------------------------- 1 | using Syroot.BinaryData; 2 | using System.Numerics; 3 | 4 | namespace PDTools.Files; 5 | 6 | public struct Vec3R 7 | { 8 | public Vector3 Position { get; set; } 9 | public float AngleRad { get; set; } 10 | 11 | public const uint Size = 0x10; 12 | 13 | public Vec3R(float x, float y, float z, float angleRadians) 14 | { 15 | Position = new Vector3(x, y, z); 16 | AngleRad = angleRadians; 17 | } 18 | 19 | public static Vec3R FromStream(BinaryStream bs) 20 | { 21 | float x = bs.ReadSingle(); 22 | float y = bs.ReadSingle(); 23 | float z = bs.ReadSingle(); 24 | float r = bs.ReadSingle(); 25 | return new(x, y, z, r); 26 | } 27 | 28 | public void ToStream(BinaryStream bs) 29 | { 30 | bs.WriteSingle(Position.X); 31 | bs.WriteSingle(Position.Y); 32 | bs.WriteSingle(Position.Z); 33 | bs.WriteSingle(AngleRad); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /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.GT4ElfBuilderTool/PDTools.GT4ElfBuilderTool.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net9.0 6 | disable 7 | disable 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /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: "); 18 | return; 19 | } 20 | 21 | if (!File.Exists(args[0])) 22 | { 23 | Console.WriteLine("Input file does not exist"); 24 | return; 25 | } 26 | 27 | var image = new GTImageLoader(); 28 | if (!image.Load(File.ReadAllBytes(args[0]))) 29 | { 30 | Console.WriteLine("Failed to load CORE file"); 31 | return; 32 | } 33 | 34 | image.BuildELF(args[1]); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /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.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.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.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.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/PDTools.GTPatcher.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net9.0 6 | disable 7 | disable 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | libdebug.dll 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /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.GTPatcher/libdebug.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nenkai/PDTools/d13ae1eff5a3735d0fdf49c6782105382bd92c96/PDTools.GTPatcher/libdebug.dll -------------------------------------------------------------------------------- /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.GrimPFS/PDTools.GrimPFS.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net9.0 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /PDTools.GrimSonyDLSBuilder/PDTools.GrimSonyDLSBuilder.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net9.0 6 | disable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /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.Hashing/PDTools.Hashing.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net9.0 5 | disable 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /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.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.LiveTimingApi/PDTools.LiveTimingApi.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | net9.0 4 | true 5 | Library 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /PDTools.LiveTimingApiTestTool/PDTools.LiveTimingApiTestTool.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net9.0 4 | disable 5 | disable 6 | Exe 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /PDTools.RText/PDTools.RText.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net9.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /PDTools.RText/RTextBase.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | 4 | using PDTools.Utils; 5 | 6 | namespace PDTools.RText; 7 | 8 | public abstract class RTextBase 9 | { 10 | protected SortedDictionary _pages { get; set; } 11 | = new SortedDictionary(AlphaNumStringComparer.Default); 12 | 13 | public SortedDictionary GetPages() 14 | { 15 | return _pages; 16 | } 17 | 18 | public abstract void Read(byte[] buffer); 19 | 20 | /* Note & possible minor TODO - use optimized string table: 21 | * While we are saving strings ordered, we still aren't storing the strings optimally 22 | * As in - different entry offsets may point to the same string offsets to save on size 23 | * Most specifically noticeable in car description rt2's 24 | */ 25 | public abstract void Save(string filePath); 26 | } 27 | -------------------------------------------------------------------------------- /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.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 | -------------------------------------------------------------------------------- /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.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.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, 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.SaveFile/GT4/Option/OptionLogger.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 OptionLogger : IGameSerializeBase 12 | { 13 | public byte[] Loggers { get; set; } 14 | 15 | public void CopyTo(OptionLogger dest) 16 | { 17 | dest.Loggers = new byte[Loggers.Length]; 18 | Array.Copy(Loggers, dest.Loggers, Loggers.Length); 19 | } 20 | 21 | public void Pack(GT4Save save, ref SpanWriter sw) 22 | { 23 | sw.WriteBytes(Loggers); 24 | 25 | sw.Align(GT4Save.ALIGNMENT); 26 | } 27 | 28 | public void Unpack(GT4Save save, ref SpanReader sr) 29 | { 30 | Loggers = sr.ReadBytes(5); 31 | 32 | sr.Align(GT4Save.ALIGNMENT); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /PDTools.SaveFile/GT4/Option/OptionNetConfig.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 OptionNetConfig : IGameSerializeBase 12 | { 13 | public byte[] Data { get; set; } 14 | 15 | public void CopyTo(OptionNetConfig dest) 16 | { 17 | dest.Data = new byte[Data.Length]; 18 | Array.Copy(Data, dest.Data, Data.Length); 19 | } 20 | 21 | public void Pack(GT4Save save, ref SpanWriter sw) 22 | { 23 | sw.WriteBytes(Data); 24 | sw.Position += 8; 25 | 26 | // No align 27 | } 28 | 29 | public void Unpack(GT4Save save, ref SpanReader sr) 30 | { 31 | Data = sr.ReadBytes(0x258); 32 | sr.Position += 0x08; 33 | 34 | // No align 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /PDTools.SaveFile/GT4/Option/OptionRaceInputPortPS2.cs: -------------------------------------------------------------------------------- 1 | using Syroot.BinaryData.Memory; 2 | 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Text; 6 | 7 | namespace PDTools.SaveFile.GT4.Option; 8 | 9 | public class OptionRaceInputPortPS2 : IGameSerializeBase 10 | { 11 | public byte[] Data { get; set; } 12 | 13 | public void CopyTo(OptionRaceInputPortPS2 dest) 14 | { 15 | dest.Data = new byte[Data.Length]; 16 | Array.Copy(Data, dest.Data, Data.Length); 17 | } 18 | 19 | public void Pack(GT4Save save, ref SpanWriter sw) 20 | { 21 | sw.WriteBytes(Data); 22 | } 23 | 24 | public void Unpack(GT4Save save, ref SpanReader sr) 25 | { 26 | Data = sr.ReadBytes(0xB8); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /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.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.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; } 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.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.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/PDTools.ScapesDataHelper.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Library 5 | net9.0 6 | enable 7 | enable 8 | true 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /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.SimulatorInterface/PDTools.SimulatorInterface.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net9.0 5 | disable 6 | true 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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.SimulatorInterfaceTestTool/PDTools.SimulatorInterfaceTestTool.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 | -------------------------------------------------------------------------------- /PDTools.SimulatorInterfaceTestTool/README.md: -------------------------------------------------------------------------------- 1 | # PDTools.SimulatorInterfaceTestTool 2 | 3 | Test client for the SimulatorInterface implementation. 4 | -------------------------------------------------------------------------------- /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.SpecDB/Core/Mapping/Tables/CarCustomInfo.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 CarCustomInfo : TableMetadata 13 | { 14 | public override string LabelPrefix { get; } = ""; 15 | public CarCustomInfo(SpecDBFolder folderType) 16 | { 17 | Columns.Add(new ColumnMetadata("BitsA", DBColumnType.Int)); 18 | Columns.Add(new ColumnMetadata("BitsB", DBColumnType.Int)); 19 | Columns.Add(new ColumnMetadata("BitsC", DBColumnType.Int)); 20 | Columns.Add(new ColumnMetadata("BitsD", DBColumnType.Int)); 21 | Columns.Add(new ColumnMetadata("BitsE", DBColumnType.Int)); 22 | Columns.Add(new ColumnMetadata("BitsF", DBColumnType.Int)); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /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.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.Int)); 19 | Columns.Add(new ColumnMetadata("Var_Tbl_Index", DBColumnType.Int)); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /PDTools.SpecDB/Core/Mapping/Tables/Displacement.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 Displacement : TableMetadata 13 | { 14 | public override string LabelPrefix { get; } = "ds_"; 15 | 16 | public Displacement(SpecDBFolder folderType) 17 | { 18 | Columns.Add(new ColumnMetadata("torquemodifier", DBColumnType.Short)); 19 | Columns.Add(new ColumnMetadata("torquemodifier2", DBColumnType.Short)); 20 | if (folderType >= SpecDBFolder.GT5_JP3009) 21 | Columns.Add(new ColumnMetadata("torquemodifier3", DBColumnType.Short)); 22 | 23 | Columns.Add(new ColumnMetadata("Price", DBColumnType.Short)); 24 | Columns.Add(new ColumnMetadata("category", DBColumnType.Byte)); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /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.Int)); 17 | Columns.Add(new ColumnMetadata("Gen_Tbl_Index", DBColumnType.Int)); 18 | Columns.Add(new ColumnMetadata("DefaultParts", DBColumnType.Int)); 19 | Columns.Add(new ColumnMetadata("DefPrs_Tbl_Index", DBColumnType.Int)); 20 | Columns.Add(new ColumnMetadata("DefaultParam", DBColumnType.Int)); 21 | Columns.Add(new ColumnMetadata("DefPrm_Tbl_Index", DBColumnType.Int)); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /PDTools.SpecDB/Core/Mapping/Tables/EngineBalance.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 EngineBalance : TableMetadata 13 | { 14 | public override string LabelPrefix => "eb_"; 15 | 16 | public EngineBalance(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 | Columns.Add(new ColumnMetadata("?", DBColumnType.Byte)); 23 | Columns.Add(new ColumnMetadata("?", DBColumnType.Byte)); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /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.SpecDB/Core/Mapping/Tables/Flywheel.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 Flywheel : TableMetadata 13 | { 14 | public override string LabelPrefix { get; } = "fw_"; 15 | 16 | public Flywheel(SpecDBFolder folderType) 17 | { 18 | Columns.Add(new ColumnMetadata("Price", DBColumnType.Short)); 19 | Columns.Add(new ColumnMetadata("category", DBColumnType.Byte)); 20 | Columns.Add(new ColumnMetadata("iflywheel", DBColumnType.Byte)); 21 | Columns.Add(new ColumnMetadata("enginebrake", DBColumnType.Byte)); 22 | Columns.Add(new ColumnMetadata("iwheelF", DBColumnType.Byte)); 23 | Columns.Add(new ColumnMetadata("iwheelR", DBColumnType.Byte)); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /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.SpecDB/Core/Mapping/Tables/Intercooler.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 Intercooler : TableMetadata 13 | { 14 | public override string LabelPrefix { get; } = "ic_"; 15 | 16 | public Intercooler(SpecDBFolder folderType) 17 | { 18 | Columns.Add(new ColumnMetadata("torquemodifier", DBColumnType.Short)); 19 | Columns.Add(new ColumnMetadata("torquemodifier2", DBColumnType.Short)); 20 | 21 | if (folderType >= SpecDBFolder.GT5_JP3009) 22 | Columns.Add(new ColumnMetadata("torquemodifier3", DBColumnType.Short)); 23 | 24 | Columns.Add(new ColumnMetadata("Price", DBColumnType.Short)); 25 | Columns.Add(new ColumnMetadata("category", DBColumnType.Byte)); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /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.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/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.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.SpecDB/Core/Mapping/Tables/RiderSet.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 RiderSet : TableMetadata 13 | { 14 | public RiderSet(SpecDBFolder folderType) 15 | { 16 | Columns.Add(new ColumnMetadata("?", DBColumnType.Int)); 17 | Columns.Add(new ColumnMetadata("Helmet", DBColumnType.Int)); 18 | Columns.Add(new ColumnMetadata("Suit", DBColumnType.Int)); 19 | Columns.Add(new ColumnMetadata("Jacket", DBColumnType.Int)); 20 | Columns.Add(new ColumnMetadata("Pants", DBColumnType.Int)); 21 | Columns.Add(new ColumnMetadata("Gloves", DBColumnType.Int)); 22 | Columns.Add(new ColumnMetadata("Boots", DBColumnType.Int)); 23 | 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /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.SpecDB/Core/Mapping/Tables/Supercharger.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 Supercharger : TableMetadata 13 | { 14 | public override string LabelPrefix { get; } = "sc_"; 15 | 16 | public Supercharger(SpecDBFolder folderType) 17 | { 18 | Columns.Add(new ColumnMetadata("torquemodifier", DBColumnType.Short)); 19 | Columns.Add(new ColumnMetadata("torquemodifier2", DBColumnType.Short)); 20 | if (folderType >= SpecDBFolder.GT5_JP3009) 21 | Columns.Add(new ColumnMetadata("torquemodifier3", DBColumnType.Short)); 22 | Columns.Add(new ColumnMetadata("Price", DBColumnType.Short)); 23 | Columns.Add(new ColumnMetadata("category", DBColumnType.Byte)); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /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.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("?", DBColumnType.Int)); 17 | Columns.Add(new ColumnMetadata("CarCode", DBColumnType.Int)); 18 | Columns.Add(new ColumnMetadata("DefParts_Tbl_Index", DBColumnType.Int)); 19 | Columns.Add(new ColumnMetadata("ID", DBColumnType.Int)); 20 | Columns.Add(new ColumnMetadata("DefParam_Tbl_Index", DBColumnType.Int)); 21 | Columns.Add(new ColumnMetadata("ID", DBColumnType.Int)); 22 | 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /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/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.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.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.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.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.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 | -------------------------------------------------------------------------------- /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; } 14 | public int TableId { get; set; } 15 | 16 | public DbCode(int code, int tableId) 17 | { 18 | Code = code; 19 | TableId = tableId; 20 | } 21 | 22 | private DbCode() { } 23 | 24 | public static DbCode Unpack(ref SpanReader sr) 25 | { 26 | var code = new DbCode(); 27 | code.Code = sr.ReadInt32(); 28 | code.TableId = sr.ReadInt32(); 29 | return code; 30 | } 31 | 32 | public void Pack(ref SpanWriter sw) 33 | { 34 | sw.WriteInt32(Code); 35 | sw.WriteInt32(TableId); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /PDTools.Structures/MGameParameter/BoostParams.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace PDTools.Structures.MGameParameter; 7 | 8 | /// 9 | /// For GT5 10 | /// 11 | public class BoostParams 12 | { 13 | public int BoostFront { get; set; } 14 | public int BoostRear { get; set; } 15 | public int BoostFrontMax { get; set; } 16 | public int BoostRearMax { get; set; } 17 | public int BoostFrontMin { get; set; } 18 | public int BoostRearMin { get; set; } 19 | 20 | public void CopyTo(BoostParams other) 21 | { 22 | other.BoostFront = other.BoostFront; 23 | other.BoostRear = other.BoostRear; 24 | other.BoostFrontMax = other.BoostFrontMax; 25 | other.BoostRearMax = other.BoostRearMax; 26 | other.BoostFrontMin = other.BoostFrontMin; 27 | other.BoostRearMin = other.BoostRearMin; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /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/ByteBufferComparer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace PDTools.Utils; 6 | 7 | public class ByteBufferComparer : IComparer 8 | { 9 | private static readonly ByteBufferComparer _default = new ByteBufferComparer(); 10 | public static ByteBufferComparer Default => _default; 11 | 12 | public int Compare(byte[] value1, byte[] value2) 13 | { 14 | byte[] v1 = value1; 15 | byte[] v2 = value2; 16 | 17 | if (v1.Length < v2.Length) 18 | return -1; 19 | else if (v1.Length > v2.Length) 20 | return 1; 21 | 22 | int min = v1.Length > v2.Length ? v2.Length : v1.Length; 23 | for (int i = 0; i < min; i++) 24 | { 25 | if (v1[i] < v2[i]) 26 | return -1; 27 | else if (v1[i] > v2[i]) 28 | return 1; 29 | } 30 | 31 | return 0; 32 | } 33 | } -------------------------------------------------------------------------------- /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.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.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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /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/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/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 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | --------------------------------------------------------------------------------