Skip to content

Instantly share code, notes, and snippets.

View FransBouma's full-sized avatar

Frans Bouma FransBouma

View GitHub Profile
////----------//
///**Global**///
//----------////
#define RESHADE_PRESET Default
//>User<\\
#define RESHADE_START_ENABLED 1 //[0:1] //-Controls whether to start with effects on or off.
#define RESHADE_SCREENSHOT_KEY VK_SNAPSHOT //[undef] //-Sets the key for taking screenshots. Default is the PrintScreen key.
#define RESHADE_SCREENSHOT_FORMAT png //[undef] //-Sets the screenshot image format.
@FransBouma
FransBouma / gist:5eecb46cf36e19ab37c4655d5db67053
Created January 27, 2017 12:49
DOOM matrix / coord manipulation code.
DOOMx64.GetGameSystemInterface+80598E - F3 0F11 B7 C0000000 - movss [rdi+000000C0],xmm6 // X
DOOMx64.GetGameSystemInterface+805996 - F3 0F11 BF C4000000 - movss [rdi+000000C4],xmm7 // Y
DOOMx64.GetGameSystemInterface+80599E - F3 44 0F11 87 C8000000 - movss [rdi+000000C8],xmm8 // Z
DOOMx64.GetGameSystemInterface+8059A7 - F3 44 0F11 8F CC000000 - movss [rdi+000000CC],xmm9 // _11 this is OpenGL, so likely transposed.
DOOMx64.GetGameSystemInterface+8059B0 - F3 44 0F11 A7 D8000000 - movss [rdi+000000D8],xmm12 // _12
DOOMx64.GetGameSystemInterface+8059B9 - F3 44 0F11 97 D0000000 - movss [rdi+000000D0],xmm10 // _13
DOOMx64.GetGameSystemInterface+8059C2 - F3 44 0F11 9F D4000000 - movss [rdi+000000D4],xmm11 // _21
DOOMx64.GetGameSystemInterface+8059CB - F3 44 0F11 AF DC000000 - movss [rdi+000000DC],xmm13 // _22
DOOMx64.GetGameSystemInterface+8059D4 - F3 44 0F11 B7 E0000000 - movss [rdi+000000E0],xmm14 // _23
DOOMx64.GetGameSystemInterface+8059DD - F3 44 0F11 BF E4000000 - movss [rdi+0000
@FransBouma
FransBouma / DOOMx64_EnablePhotoMode.CT
Created January 10, 2017 18:19
Cheat Table for DOOM: enable photomode during normal gameplay. Press INS to enable. Shift-INS to disable photomode during gameplay (but why would you want to do that?!)
<?xml version="1.0" encoding="utf-8"?>
<CheatTable CheatEngineTableVersion="21">
<CheatEntries>
<CheatEntry>
<ID>9</ID>
<Description>"Enable PhotoMode"</Description>
<LastState Value="1" RealAddress="7FF65911F6A0"/>
<VariableType>Byte</VariableType>
<Address>DOOMx64.wglewIsSupported+3002080</Address>
<Hotkeys>
@FransBouma
FransBouma / gist:2eaa34b7f6e0ab7110e46cdeb0cb79c9
Created December 15, 2016 14:42
Correct way to rotate in NIXXES engine's quaternion system
// uses the current quaternion used by the game to calculate the new quaternion by first creating a new quaternion from the angle delta's and multiplying it with the
// current look quaternion like: angleQ * currentLookQ. This new quaternion is then used as the new game quaternion.
XMVECTOR Camera::CalculateLookQuaternion(XMVECTOR currentLookQ)
{
// Game has Y into the screen. roll is therefore used for Y. pitch / yaw have to be negative due to the alignment of the axis vs what the user expects.
// Game will create tilt when rotated, as Y is into the screen.
/*
// WORKS, but creates massive tilt.
XMVECTOR angleQ = XMQuaternionRotationRollPitchYaw(-m_pitchDelta, m_rollDelta, -m_yawDelta);
@FransBouma
FransBouma / Hitman_2016_Final_SmoothCamera_1.7.0.CT
Last active June 16, 2019 14:37
Hitman 2016 Final CT camera table, with smooth movement. For v1.7. By Jim2Point0 and myself.
<?xml version="1.0" encoding="utf-8"?>
<CheatTable CheatEngineTableVersion="21">
<CheatEntries>
<CheatEntry>
<ID>11022</ID>
<Description>"Camera system. Toggle: INS. Enable first"</Description>
<LastState/>
<VariableType>Auto Assembler Script</VariableType>
<AssemblerScript>//----------------------------------------------------------
// Reworked Hitman 2016 cheat table with free camera / timestop / FoV
Results per framework. Values are given as: 'mean (standard deviation)'
==============================================================================
Non-change tracking fetches, set fetches (25 runs), no caching
------------------------------------------------------------------------------
Handcoded materializer using DbDataReader : 127,21ms (5,73ms) Enum: 1,14ms (0,05ms)
LINQ to DB v1.0.7.4 (v1.0.7.4) (compiled) : 143,27ms (4,10ms) Enum: 1,14ms (0,22ms)
LINQ to DB v1.0.7.4 (v1.0.7.4) (normal) : 143,69ms (6,32ms) Enum: 1,26ms (0,20ms)
PetaPoco Fast v4.0.3 : 153,44ms (7,92ms) Enum: 1,21ms (0,20ms)
LLBLGen Pro v5.1.0.0 (v5.1.0), Poco with Raw SQL : 160,41ms (4,85ms) Enum: 1,08ms (0,22ms)
LLBLGen Pro v5.1.0.0 (v5.1.0), Poco typed view with QuerySpec : 166,08ms (5,28ms) Enum: 1,10ms (0,07ms)
@FransBouma
FransBouma / Mess.md
Last active October 19, 2016 13:31
Entity Framework Core isn't ready for prime time. (v1.0.1, running on .NET full). It performs left joins in memory and fetches sets in full. Because of that, the full entity select materialization happens in memory, which fails. Why? No idea! See issue: https://github.com/aspnet/EntityFramework/issues/6818

DB: AdventureWorks 2008, SQL Server. Query: (is generated)

/// <summary>Gets the query to fetch the typed list Soh2</summary>
public IQueryable<Soh2TypedListRow> GetSoh2TypedList()
{
	var current0 = this.SalesOrderHeaders;
	var current1 = from salesOrderHeader in current0
					join salesPerson in this.SalesPeople on salesOrderHeader.SalesPerson.SalesPersonId equals salesPerson.SalesPersonId
					join customer in this.Customers on salesOrderHeader.Customer.CustomerId equals customer.CustomerId
@FransBouma
FransBouma / Darksiders2 with timestop.CT
Last active December 1, 2016 15:35
Darksiders II CT. Thread-based camera movement based on look vector. Based on DET/Jim2Point0's table.
<?xml version="1.0" encoding="utf-8"?>
<CheatTable CheatEngineTableVersion="21">
<CheatEntries>
<CheatEntry>
<ID>10992</ID>
<Description>"Camera system. Toggle: INS. Enable first to use fov/freecam"</Description>
<LastState/>
<VariableType>Auto Assembler Script</VariableType>
<AssemblerScript>//----------------------------------------------------------
// Reworked Darksiders II cheat table with free camera / timestop / FoV
@FransBouma
FransBouma / SpecOpsTheLinePPDoF2.CT
Created September 20, 2016 18:38
Spec Ops: The Line CT with freecam / FOV / DoF / Post processing effects. By Jim2Point0 / One3rd / Erika T.
<?xml version="1.0" encoding="utf-8"?>
<CheatTable CheatEngineTableVersion="18">
<CheatEntries>
<CheatEntry>
<ID>11815</ID>
<Description>"Free Camera 2 [F1]"</Description>
<Options moHideChildren="1"/>
<LastState Activated="1"/>
<Color>80000008</Color>
<VariableType>Auto Assembler Script</VariableType>
@FransBouma
FransBouma / RawSQL.cs
Last active September 13, 2016 11:18
Raw SQL query execution example, coming in LLBLGen Pro v5.1. This is the action query part. There's also a fetch pipeline, coming soon :)
[Test]
public void ActionQuery_InsertRowTest5()
{
using(var adapter = new DataAccessAdapter())
{
var q =
@"CREATE TABLE #InsertTest (
ID uniqueidentifier NOT NULL,
Name nvarchar(50),
Val1 int,