Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: elishacloud/dxwrapper
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.0.6387.21
Choose a base ref
...
head repository: elishacloud/dxwrapper
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing 636 changed files with 62,303 additions and 22,205 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: CI

on:
push:
pull_request:
branches: [ "master" ]
workflow_dispatch:

permissions:
contents: read

env:
UseMultiToolTask: true

jobs:
build:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
config: [Debug, Release]
platform: [Win32]

steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: microsoft/setup-msbuild@v1
- uses: Trass3r/setup-cpp@master
- name: Build
run: msbuild /m /p:Configuration=${{ matrix.config }} /p:Platform=${{ matrix.platform }} dxwrapper.sln
- name: Upload DX7 Artifacts
if: ${{ matrix.config == 'Release' }}
uses: actions/upload-artifact@v4
with:
name: dx7 game binaries
path: bin/${{ matrix.config }}/dx7/*
- name: Upload DX8 Artifacts
if: ${{ matrix.config == 'Release' }}
uses: actions/upload-artifact@v4
with:
name: dx8 game binaries
path: bin/${{ matrix.config }}/dx8/*
- name: Upload DX9 Artifacts
if: ${{ matrix.config == 'Release' }}
uses: actions/upload-artifact@v4
with:
name: dx9 game binaries
path: bin/${{ matrix.config }}/dx9/*
- name: Upload Matrix Artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.config }} binaries
path: bin/${{ matrix.config }}/*
12 changes: 12 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -17,3 +17,15 @@
[submodule "External/dinputto8"]
path = External/dinputto8
url = https://github.com/elishacloud/dinputto8
[submodule "External/imgui"]
path = External/imgui
url = https://github.com/ocornut/imgui
[submodule "External/Hooking.Patterns"]
path = External/Hooking.Patterns
url = https://github.com/ThirteenAG/Hooking.Patterns
[submodule "External/DirectXMath"]
path = External/DirectXMath
url = https://github.com/microsoft/DirectXMath
[submodule "DirectX"]
path = DirectX
url = https://github.com/elishacloud/Legacy-DirectX-Documentation
74 changes: 53 additions & 21 deletions DDrawCompat/DDrawCompatExternal.cpp
Original file line number Diff line number Diff line change
@@ -2,23 +2,31 @@
#include "DDrawCompatExternal.h"

// DDrawCompat versions
#include "Experimental\Dll\DllMain.h"
#include "v0.2.0b\DllMain.h"
#include "v0.2.1\DllMain.h"
#include "v0.3.2\Dll\DllMain.h"

#define DDrawCompatDefault Compat32
#define DDrawCompatForDd7to9 Compat32

#define INITIALIZE_WRAPPED_PROC(procName) \
FARPROC procName ## _in = nullptr; \
FARPROC procName ## _out = nullptr;
volatile FARPROC procName ## _in = nullptr; \
volatile FARPROC procName ## _out = nullptr;

#define ASSIGN_WRAPPED_PROC(procName) \
procName ## _in = procName ## _proc;
procName ## _in = procName ## _proc; \
procName ## _out = ddraw::procName ## _var;

#define RUN_PREPARE_DDRAWCOMPAT(CompatVersion) \
using namespace CompatVersion; \
CompatVersion::Prepair_DDrawCompat(); \
VISIT_ALL_DDRAW_PROCS(ASSIGN_WRAPPED_PROC); \
return; \

#define PREPARE_DDRAWCOMPAT(CompatVersion) \
if (Config.DDraw ## CompatVersion) \
{ \
using namespace CompatVersion; \
VISIT_ALL_DDRAW_PROCS(ASSIGN_WRAPPED_PROC); \
return; \
RUN_PREPARE_DDRAWCOMPAT(CompatVersion) \
}

#define START_DDRAWCOMPAT(CompatVersion) \
@@ -33,6 +41,11 @@ namespace DDrawCompat

void Prepare()
{
// DDrawCompat v0.3.2
#ifdef DDRAWCOMPAT_32
PREPARE_DDRAWCOMPAT(Compat32);
#endif

// DDrawCompat v0.2.1
#ifdef DDRAWCOMPAT_21
PREPARE_DDRAWCOMPAT(Compat21);
@@ -43,19 +56,23 @@ namespace DDrawCompat
PREPARE_DDRAWCOMPAT(Compat20);
#endif

// DDrawCompat Eperimental
#ifdef DDRAWCOMPAT_EXP
PREPARE_DDRAWCOMPAT(CompatExperimental);
#endif

// Default DDrawCompat version
using namespace DDrawCompatDefault;
VISIT_ALL_DDRAW_PROCS(ASSIGN_WRAPPED_PROC);
return;
RUN_PREPARE_DDRAWCOMPAT(DDrawCompatDefault);
}

bool Start(HINSTANCE hinstDLL, DWORD fdwReason)
bool RunStart(HINSTANCE hinstDLL, DWORD fdwReason)
{
// Dd7to9 DDrawCompat version
if (Config.Dd7to9)
{
return (DDrawCompatForDd7to9::DllMain_DDrawCompat(hinstDLL, fdwReason, nullptr) == TRUE);
}

// DDrawCompat v0.3.2
#ifdef DDRAWCOMPAT_32
START_DDRAWCOMPAT(Compat32);
#endif

// DDrawCompat v0.2.1
#ifdef DDRAWCOMPAT_21
START_DDRAWCOMPAT(Compat21);
@@ -66,12 +83,27 @@ namespace DDrawCompat
START_DDRAWCOMPAT(Compat20);
#endif

// DDrawCompat Eperimental
#ifdef DDRAWCOMPAT_EXP
START_DDRAWCOMPAT(CompatExperimental);
#endif

// Default DDrawCompat version
return (DDrawCompatDefault::DllMain_DDrawCompat(hinstDLL, fdwReason, nullptr) == TRUE);
}

bool IsDDrawEnabled = false;

void Start(HINSTANCE hinstDLL, DWORD fdwReason)
{
bool ret = RunStart(hinstDLL, fdwReason);
IsDDrawEnabled = Config.Dd7to9 ? false : ret;
}

bool IsEnabled()
{
return IsDDrawEnabled;
}

// Used for hooking with dd7to9
void InstallDd7to9Hooks(HMODULE hModule)
{
// Dd7to9 DDrawCompat version
return DDrawCompatForDd7to9::InstallDd7to9Hooks(hModule);
}
}
11 changes: 8 additions & 3 deletions DDrawCompat/DDrawCompatExternal.h
Original file line number Diff line number Diff line change
@@ -2,17 +2,22 @@

#include "Settings\Settings.h"
#include "Wrappers\Wrapper.h"
#ifdef DDRAWCOMPAT
#include"v0.3.2/Win32/DisplayMode.h"
#endif

namespace DDrawCompat
{
#define INITIALIZE_WRAPPED_PROC(procName) \
extern FARPROC procName ## _in; \
extern FARPROC procName ## _out;
extern volatile FARPROC procName ## _in; \
extern volatile FARPROC procName ## _out;

VISIT_ALL_DDRAW_PROCS(INITIALIZE_WRAPPED_PROC);

#undef INITIALIZE_WRAPPED_PROC

void Prepare();
bool Start(HINSTANCE, DWORD);
void Start(HINSTANCE, DWORD);
bool IsEnabled();
void InstallDd7to9Hooks(HMODULE hModule);
}
5 changes: 5 additions & 0 deletions DDrawCompat/DDrawLog.h
Original file line number Diff line number Diff line change
@@ -59,3 +59,8 @@ namespace Compat21
using namespace Logging;
}
}

namespace Compat32
{
using namespace Logging;
}
Loading