Skip to content

Commit

Permalink
Fix offset for 1.05 reg 1.08
Browse files Browse the repository at this point in the history
  • Loading branch information
FrankvdStam committed Sep 10, 2023
1 parent 7c7b00b commit 9c091a1
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 14 deletions.
Binary file modified Components/SoulMemory.dll
Binary file not shown.
Binary file modified Components/SoulSplitter.dll
Binary file not shown.
11 changes: 11 additions & 0 deletions Components/Updates.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<updates>
<update version="1.5.1">
<files>
<file path="Components/SoulMemory.dll" status="changed"/>
<file path="Components/SoulSplitter.dll" status="changed"/>
<file path="Components/MaterialDesignThemes.Wpf.dll" status="changed"/>
<file path="Components/MaterialDesignThemes.Wpf.xml" status="changed"/>
</files>
<changelog>
<change>DS3 igt fix for 1.05 reg 1.08</change>
</changelog>
</update>
<update version="1.5.0">
<files>
<file path="Components/SoulMemory.dll" status="changed"/>
Expand Down
37 changes: 26 additions & 11 deletions src/SoulMemory/DarkSouls3/DarkSouls3.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ private ResultErr<RefreshError> InitPointers()
_igtOffset = 0xa4;
break;

case DarkSouls3Version.Earlier:
case DarkSouls3Version.V104:
case DarkSouls3Version.V105:
_igtOffset = 0x9c;
break;

Expand All @@ -105,12 +107,12 @@ private ResultErr<RefreshError> InitPointers()
var treeBuilder = GetTreeBuilder();
return MemoryScanner.TryResolvePointers(treeBuilder, _process);
}
catch(Exception e)
catch (Exception e)
{
return RefreshError.FromException(e);
}
}

private void ResetPointers()
{
_gameDataMan.Clear();
Expand All @@ -127,20 +129,33 @@ private void ResetPointers()

public enum DarkSouls3Version
{
Earlier,
V104,
V105,
Later,
};

public static DarkSouls3Version GetVersion(Version v)
{
if (v.Minor <= 4)
switch (v.Minor)
{
return DarkSouls3Version.V104;
}
case 0:
case 1:
case 2:
case 3:
return DarkSouls3Version.Earlier;

case 4:
return DarkSouls3Version.V104;

return DarkSouls3Version.Later;
case 5:
return DarkSouls3Version.V105;

default:
return DarkSouls3Version.Later;
}
}

public bool IsLoading()
{
if (_loading == null)
Expand Down Expand Up @@ -178,7 +193,7 @@ public int GetInGameTimeMilliseconds()

public Vector3f GetPosition()
{
if(_sprjChrPhysicsModule == null)
if (_sprjChrPhysicsModule == null)
{
return new Vector3f();
}
Expand Down Expand Up @@ -209,9 +224,9 @@ public int ReadAttribute(Attribute attribute)
public bool ReadEventFlag(uint eventFlagId)
{
var eventFlagIdDiv10000000 = (int)(eventFlagId / 10000000) % 10;
var eventFlagArea = (int)(eventFlagId / 100000 ) % 100;
var eventFlagIdDiv10000 = (int)(eventFlagId / 10000 ) % 10;
var eventFlagIdDiv1000 = (int)(eventFlagId / 1000 ) % 10;
var eventFlagArea = (int)(eventFlagId / 100000) % 100;
var eventFlagIdDiv10000 = (int)(eventFlagId / 10000) % 10;
var eventFlagIdDiv1000 = (int)(eventFlagId / 1000) % 10;

//14000002

Expand Down
2 changes: 1 addition & 1 deletion src/SoulMemory/SoulMemory.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<Platforms>x64</Platforms>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<Title>SoulMemory</Title>
<Version>1.5.0</Version>
<Version>1.5.1</Version>
<Authors>Frank v.d. Stam</Authors>
<PackageProjectUrl>https://github.com/FrankvdStam/SoulSplitter</PackageProjectUrl>
<RepositoryUrl>https://github.com/FrankvdStam/SoulSplitter</RepositoryUrl>
Expand Down
2 changes: 1 addition & 1 deletion src/SoulSplitter/SoulSplitter.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<UseWPF>true</UseWPF>
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
<Title>SoulSplitter</Title>
<Version>1.5.0</Version>
<Version>1.5.1</Version>
<Authors>Frank v.d. Stam</Authors>
<PackageProjectUrl>https://github.com/FrankvdStam/SoulSplitter</PackageProjectUrl>
<RepositoryUrl>https://github.com/FrankvdStam/SoulSplitter</RepositoryUrl>
Expand Down
3 changes: 2 additions & 1 deletion src/cli/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
using SoulMemory;
using SoulSplitter.UI.Generic;
using SoulMemory.ArmoredCore6;
using SoulMemory.DarkSouls3;
using SoulMemory.MemoryV2.Process;
using SoulMemory.Parameters;

Expand All @@ -43,7 +44,7 @@ internal class Program
static void Main(string[] args)
{

GameLoop<ArmoredCore6>((e) =>
GameLoop<DarkSouls3>((e) =>
{
Console.WriteLine(e.GetInGameTimeMilliseconds());
Expand Down

0 comments on commit 9c091a1

Please sign in to comment.