Skip to content

Commit

Permalink
KISS: Psycho Circus DEdit now supported.
Browse files Browse the repository at this point in the history
  • Loading branch information
burmaraider committed Jun 7, 2022
1 parent ca0dbbf commit 2367065
Show file tree
Hide file tree
Showing 4 changed files with 91 additions and 5 deletions.
6 changes: 6 additions & 0 deletions Dedit_ddraw7.sln
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ Global
AVP2 - Debug|x86 = AVP2 - Debug|x86
Blood2 - Debug|x64 = Blood2 - Debug|x64
Blood2 - Debug|x86 = Blood2 - Debug|x86
KISS - Debug|x64 = KISS - Debug|x64
KISS - Debug|x86 = KISS - Debug|x86
NOLF - Debug|x64 = NOLF - Debug|x64
NOLF - Debug|x86 = NOLF - Debug|x86
Release|x64 = Release|x64
Expand All @@ -25,6 +27,10 @@ Global
{C846D092-258B-408E-B802-2EE4643EACD8}.Blood2 - Debug|x64.Build.0 = Blood2 - Debug|x64
{C846D092-258B-408E-B802-2EE4643EACD8}.Blood2 - Debug|x86.ActiveCfg = Blood2 - Debug|Win32
{C846D092-258B-408E-B802-2EE4643EACD8}.Blood2 - Debug|x86.Build.0 = Blood2 - Debug|Win32
{C846D092-258B-408E-B802-2EE4643EACD8}.KISS - Debug|x64.ActiveCfg = KISS - Debug|x64
{C846D092-258B-408E-B802-2EE4643EACD8}.KISS - Debug|x64.Build.0 = KISS - Debug|x64
{C846D092-258B-408E-B802-2EE4643EACD8}.KISS - Debug|x86.ActiveCfg = KISS - Debug|Win32
{C846D092-258B-408E-B802-2EE4643EACD8}.KISS - Debug|x86.Build.0 = KISS - Debug|Win32
{C846D092-258B-408E-B802-2EE4643EACD8}.NOLF - Debug|x64.ActiveCfg = NOLF - Debug|x64
{C846D092-258B-408E-B802-2EE4643EACD8}.NOLF - Debug|x64.Build.0 = NOLF - Debug|x64
{C846D092-258B-408E-B802-2EE4643EACD8}.NOLF - Debug|x86.ActiveCfg = NOLF - Debug|Win32
Expand Down
68 changes: 68 additions & 0 deletions Dedit_ddraw7.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="KISS - Debug|Win32">
<Configuration>KISS - Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="KISS - Debug|x64">
<Configuration>KISS - Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="NOLF - Debug|Win32">
<Configuration>NOLF - Debug</Configuration>
<Platform>Win32</Platform>
Expand Down Expand Up @@ -72,6 +80,12 @@
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='KISS - Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Blood2 - Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
Expand Down Expand Up @@ -103,6 +117,12 @@
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='KISS - Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Blood2 - Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
Expand Down Expand Up @@ -133,6 +153,9 @@
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='NOLF - Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='KISS - Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Blood2 - Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
Expand All @@ -148,6 +171,9 @@
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='NOLF - Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='KISS - Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Blood2 - Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
Expand All @@ -166,6 +192,10 @@
<LinkIncremental>true</LinkIncremental>
<TargetName>ddraw</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='KISS - Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<TargetName>ddraw</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Blood2 - Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<TargetName>ddraw</TargetName>
Expand All @@ -184,6 +214,9 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='NOLF - Debug|x64'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='KISS - Debug|x64'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Blood2 - Debug|x64'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
Expand Down Expand Up @@ -233,6 +266,26 @@
<Command>copy "$(SolutionDir)$(Configuration)\ddraw.dll" "C:\Games\NOLF\Tools"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='KISS - Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_CRT_SECURE_NO_WARNINGS;_DEBUG;DEDITDDRAW7_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>
</PrecompiledHeaderFile>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
<ModuleDefinitionFile>ddraw.def</ModuleDefinitionFile>
</Link>
<PostBuildEvent>
<Command>copy "$(SolutionDir)$(Configuration)\ddraw.dll" "C:\Games\KPCTools\bin"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Blood2 - Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
Expand Down Expand Up @@ -324,6 +377,21 @@
<EnableUAC>false</EnableUAC>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='KISS - Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;DEDITDDRAW7_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Blood2 - Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
Expand Down
2 changes: 1 addition & 1 deletion ddraw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ int GetAddressOffset(int checksum)
{
for (size_t i = 0; i < gameCount; i++)
{
if (checksum == DEditVersions[i])
if (checksum == DEditChecksums[i])
{
return DEditAddresses[i];
}
Expand Down
20 changes: 16 additions & 4 deletions dedit.h
Original file line number Diff line number Diff line change
@@ -1,17 +1,29 @@
#pragma once
#include <string>

const int gameCount = 3;
const int gameCount = 4;

extern const int DEditAddresses[] = { 0x41F5EE, 0x42E889, 0x41FAB8 };
extern const int DEditVersions[] = { 1414032, 657521, 1361200 };
const int DEditAddresses[] =
{
0x41F5EE, //AVP2
0x42E889, //BLOOD2
0x41FAB8, //NOLF
0x41C3A7, //KISS
};
const int DEditChecksums[] =
{
1414032, //AVP2
657521, //BLOOD2
1361200, //NOLF
1551811 //KISS
};

//Define our functions
typedef signed int(__cdecl* _CheckTextureSize)(int a1);
_CheckTextureSize CheckTextureSize_Original;

//Valid sizes of textures to accept
extern const int g_ValidTextureSizes[10] = { 4096, 2048, 1024, 512, 256, 128, 64, 32, 16, 8 };
const int g_ValidTextureSizes[10] = { 4096, 2048, 1024, 512, 256, 128, 64, 32, 16, 8 };

//Functions
void HookFunctions();
Expand Down

0 comments on commit 2367065

Please sign in to comment.