Skip to content

Commit

Permalink
Merge pull request #218 from RadWolfie/enhance-manual-scan-system
Browse files Browse the repository at this point in the history
Partial enhance manual scan system
  • Loading branch information
RadWolfie authored Dec 13, 2024
2 parents 7b9e2d4 + 3bd2fe0 commit c59a1fa
Show file tree
Hide file tree
Showing 28 changed files with 522 additions and 660 deletions.
1 change: 1 addition & 0 deletions include/xref/d3d8.def
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ XREF_SYMBOL(D3D_g_ComplexRenderState)
XREF_SYMBOL(D3D_g_DeferredTextureState)
XREF_SYMBOL(D3D_g_pDevice)
XREF_SYMBOL(D3D_g_Stream)
XREF_SYMBOL(D3D_g_Stream_i_pVertexBuffer)
XREF_SYMBOL(D3DRS_BackFillMode)
XREF_SYMBOL(D3DRS_CullMode)
XREF_SYMBOL(D3DRS_Dxt1NoiseEnable)
Expand Down
4 changes: 3 additions & 1 deletion projects/libXbSymbolDatabase/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,14 @@ file(GLOB HEADERS
"${XBSDB_ROOT_DIR}/src/lib/manual_jvs.h"
"${XBSDB_ROOT_DIR}/src/lib/manual_xapilib.h"
"${XBSDB_ROOT_DIR}/src/OOVPADatabase/OOVPA.h"
"${XBSDB_ROOT_DIR}/src/OOVPADatabase/OOVPA_databases.h"
)
source_group(TREE ${XBSDB_ROOT_DIR}/src PREFIX header FILES ${HEADERS})

file(GLOB_RECURSE SOURCES
"${XBSDB_ROOT_DIR}/src/libXbSymbolDatabase.c"
"${XBSDB_ROOT_DIR}/src/OOVPADatabase/*.inl"
"${XBSDB_ROOT_DIR}/src/OOVPADatabase/*/*.inl"
"${XBSDB_ROOT_DIR}/src/OOVPADatabase/*.c"
)
source_group(TREE ${XBSDB_ROOT_DIR} FILES ${SOURCES})

Expand Down
5 changes: 3 additions & 2 deletions src/OOVPADatabase/D3D8/3911.inl
Original file line number Diff line number Diff line change
Expand Up @@ -1742,10 +1742,11 @@ OOVPA_SIG_MATCH(
// ******************************************************************
OOVPA_SIG_HEADER_XREF(D3DDevice_SetStreamSource,
3911,
XRefOne)
XRefTwo)
OOVPA_SIG_MATCH(

XREF_ENTRY(0x23, XREF_D3D_g_Stream), // Derived
XREF_ENTRY(0x23, XREF_D3D_g_Stream_i_pVertexBuffer), // Derived
XREF_ENTRY(0x53, XREF_D3D_g_Stream), // Derived

// D3DDevice_SetStreamSource+0x00 : push ebx
{ 0x00, 0x53 },
Expand Down
5 changes: 3 additions & 2 deletions src/OOVPADatabase/D3D8/4034.inl
Original file line number Diff line number Diff line change
Expand Up @@ -303,10 +303,11 @@ OOVPA_SIG_MATCH(
// * D3DDevice_SetStreamSource
// ******************************************************************
OOVPA_XREF(D3DDevice_SetStreamSource, 4034, 1 + 14, // 1+28
XRefOne)
XRefTwo)
{

XREF_ENTRY(0x22, XREF_D3D_g_Stream), // Derived
XREF_ENTRY(0x22, XREF_D3D_g_Stream_i_pVertexBuffer), // Derived
XREF_ENTRY(0x52, XREF_D3D_g_Stream), // Derived

#if 0
{ 0x00, 0x8B },
Expand Down
5 changes: 3 additions & 2 deletions src/OOVPADatabase/D3D8LTCG/3911.inl
Original file line number Diff line number Diff line change
Expand Up @@ -1165,10 +1165,11 @@ OOVPA_SIG_MATCH(
//7406810300000800
OOVPA_SIG_HEADER_XREF(D3DDevice_SetStreamSource_8__LTCG_edx1,
2039,
XRefOne)
XRefTwo)
OOVPA_SIG_MATCH(

XREF_ENTRY(0x47, XREF_D3D_g_Stream), // Derived
XREF_ENTRY(0x47, XREF_D3D_g_Stream_i_pVertexBuffer), // Derived
XREF_ENTRY(0x77, XREF_D3D_g_Stream), // Derived

{ 0x00, 0x53 },
{ 0x01, 0x8B },
Expand Down
5 changes: 3 additions & 2 deletions src/OOVPADatabase/D3D8LTCG/4039.inl
Original file line number Diff line number Diff line change
Expand Up @@ -1119,10 +1119,11 @@ OOVPA_SIG_MATCH(
//7406810300000800 ...C20800
OOVPA_SIG_HEADER_XREF(D3DDevice_SetStreamSource_8__LTCG_eax1,
2040,
XRefOne)
XRefTwo)
OOVPA_SIG_MATCH(

XREF_ENTRY(0x23, XREF_D3D_g_Stream), // Derived
XREF_ENTRY(0x23, XREF_D3D_g_Stream_i_pVertexBuffer), // Derived
XREF_ENTRY(0x53, XREF_D3D_g_Stream), // Derived

{ 0x00, 0x8B },
{ 0x01, 0x0D },
Expand Down
5 changes: 3 additions & 2 deletions src/OOVPADatabase/D3D8LTCG/4432.inl
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,11 @@ OOVPA_SIG_MATCH(
//7406810300000800
OOVPA_SIG_HEADER_XREF(D3DDevice_SetStreamSource,
1044,
XRefOne)
XRefTwo)
OOVPA_SIG_MATCH(

XREF_ENTRY(0x22, XREF_D3D_g_Stream), // Derived
XREF_ENTRY(0x22, XREF_D3D_g_Stream_i_pVertexBuffer), // Derived
XREF_ENTRY(0x52, XREF_D3D_g_Stream), // Derived

{ 0x00, 0x8B },
{ 0x01, 0x0D },
Expand Down
1 change: 1 addition & 0 deletions src/OOVPADatabase/D3D8LTCG/5233.inl
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ OOVPA_SIG_MATCH(
// * D3DDevice_SetTextureState_TexCoordIndex
// ******************************************************************
//81E30000FFFFB901 ...C20400
// verified for World Series Baseball 2K3
OOVPA_SIG_HEADER_XREF(D3DDevice_SetTextureState_TexCoordIndex_4__LTCG_esi1,
2052,
XRefOne)
Expand Down
11 changes: 7 additions & 4 deletions src/OOVPADatabase/D3D8LTCG/5849.inl
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ OOVPA_SIG_MATCH(
// * D3DDevice_SetTextureState_TexCoordIndex
// ******************************************************************
//81E30000FFFFB901 ...C3
// verified for Ski Racing 2006
OOVPA_SIG_HEADER_XREF(D3DDevice_SetTextureState_TexCoordIndex_0__LTCG_edi1_eax2,
2058,
XRefOne)
Expand Down Expand Up @@ -706,10 +707,11 @@ OOVPA_SIG_MATCH(
// ******************************************************************
OOVPA_SIG_HEADER_XREF(D3DDevice_SetStreamSource_0__LTCG_eax1_edi2_ebx3,
2058,
XRefOne)
XRefTwo)
OOVPA_SIG_MATCH(

XREF_ENTRY(0x19, XREF_D3D_g_Stream), // Derived
XREF_ENTRY(0x19, XREF_D3D_g_Stream_i_pVertexBuffer), // Derived
XREF_ENTRY(0x49, XREF_D3D_g_Stream), // Derived

// test edi, edi; mov ecx, [...]
OV_MATCH(0x00, 0x85, 0xFF, 0x8B, 0x0D),
Expand All @@ -725,10 +727,11 @@ OOVPA_SIG_MATCH(
//7406810300000800 ...C20400
OOVPA_SIG_HEADER_XREF(D3DDevice_SetStreamSource_4__LTCG_eax1_ebx2,
2058,
XRefOne)
XRefTwo)
OOVPA_SIG_MATCH(

XREF_ENTRY(0x1E, XREF_D3D_g_Stream), // Derived
XREF_ENTRY(0x1E, XREF_D3D_g_Stream_i_pVertexBuffer), // Derived
XREF_ENTRY(0x4E, XREF_D3D_g_Stream), // Derived

{ 0x00, 0x85 },
{ 0x01, 0xDB },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,7 @@
// * D3DDevice_Reset_0__LTCG_edi1 (4034 ... < 4039) // NOTE: Unknown if 4039 signature needs to be lower.
// * D3DDevice_Reset_0__LTCG_ebx1 (... < 5344) // NOTE: Unknown if signature needs to be lower, and may have appeared at the same time when CDevice_InitializeFrameBuffers_4__LTCG_edi1 was introduced.

#ifndef D3D8LTCG_OOVPA_INL
#define D3D8LTCG_OOVPA_INL

#include "OOVPA.h"
#include "OOVPA_databases.h"

#include "D3D8LTCG/3911.inl"
#include "D3D8LTCG/4034.inl"
Expand All @@ -50,10 +47,13 @@
#include "D3D8LTCG/5788.inl"
#include "D3D8LTCG/5849.inl"

#define REGISTER_OOVPAS_D3D(Symbol, ...) REGISTER_OOVPAS_PREFIX(D3D, Symbol, __VA_ARGS__)
#define REGISTER_OOVPAS_D3D8(Symbol, ...) REGISTER_OOVPAS_PREFIX(D3D8, Symbol, __VA_ARGS__)

// ******************************************************************
// * D3D8LTCG_OOVPA
// * D3D8LTCG_OOVPA_Table
// ******************************************************************
OOVPATable D3D8LTCG_OOVPA[] = {
static OOVPATable D3D8LTCG_OOVPA_Table[] = {

REGISTER_OOVPAS(SYM_FUN_LTCG(D3D_CreateTexture, CALL(unk), STACK(28), PARAMS(PARAM(psh, Width), PARAM(psh, Height), PARAM(psh, Depth), PARAM(psh, Levels), PARAM(psh, Usage), PARAM(psh, Format), PARAM(psh, isCube), PARAM(_dl, isVolume), PARAM(edi, ppTexture))),
SYM_SIG(4039)), // Final generic OOVPA: 4039; Removed: 4627 // See note for details.
Expand Down Expand Up @@ -303,16 +303,16 @@ OOVPATable D3D8LTCG_OOVPA[] = {
SYM_SIG(4039, 4040)),
REGISTER_OOVPAS_D3D(SYM_FUN(CDevice_SetStateVB, CALL(std), STACK(8), PARAMS(PARAM(psh, this), PARAM(psh, unknown2))),
SYM_SIG(3911, 4039)), // TODO: Update unknown parameter name(s) if able.
REGISTER_OOVPAS(SYM_FUN(D3DDevice_SetStreamSource, CALL(std), STACK(/*default*/), PARAMS(PARAM(psh, StreamNumber), PARAM(psh, pStreamData), PARAM(psh, Stride))),
SYM_SIG(1044)),
REGISTER_OOVPAS(SYM_FUN_LTCG(D3DDevice_SetStreamSource, CALL(unk), STACK(0), PARAMS(PARAM(eax, StreamNumber), PARAM(edi, pStreamData), PARAM(ebx, Stride))),
SYM_SIG(2058)),
REGISTER_OOVPAS(SYM_FUN_LTCG(D3DDevice_SetStreamSource, CALL(unk), STACK(8), PARAMS(PARAM(edx, StreamNumber), PARAM(psh, pStreamData), PARAM(psh, Stride))),
SYM_SIG(2039)),
REGISTER_OOVPAS(SYM_FUN_LTCG(D3DDevice_SetStreamSource, CALL(unk), STACK(4), PARAMS(PARAM(eax, StreamNumber), PARAM(ebx, pStreamData), PARAM(psh, Stride))),
SYM_SIG(2058)),
REGISTER_OOVPAS(SYM_FUN_LTCG(D3DDevice_SetStreamSource, CALL(unk), STACK(8), PARAMS(PARAM(eax, StreamNumber), PARAM(psh, pStreamData), PARAM(psh, Stride))),
SYM_SIG(2040)),
REGISTER_OOVPAS_M(SYM_FUN(D3DDevice_SetStreamSource, CALL(std), STACK(/*default*/), PARAMS(PARAM(psh, StreamNumber), PARAM(psh, pStreamData), PARAM(psh, Stride))),
SYM_SIG(1044)),
REGISTER_OOVPAS_M(SYM_FUN_LTCG(D3DDevice_SetStreamSource, CALL(unk), STACK(0), PARAMS(PARAM(eax, StreamNumber), PARAM(edi, pStreamData), PARAM(ebx, Stride))),
SYM_SIG(2058)),
REGISTER_OOVPAS_M(SYM_FUN_LTCG(D3DDevice_SetStreamSource, CALL(unk), STACK(8), PARAMS(PARAM(edx, StreamNumber), PARAM(psh, pStreamData), PARAM(psh, Stride))),
SYM_SIG(2039)),
REGISTER_OOVPAS_M(SYM_FUN_LTCG(D3DDevice_SetStreamSource, CALL(unk), STACK(4), PARAMS(PARAM(eax, StreamNumber), PARAM(ebx, pStreamData), PARAM(psh, Stride))),
SYM_SIG(2058)),
REGISTER_OOVPAS_M(SYM_FUN_LTCG(D3DDevice_SetStreamSource, CALL(unk), STACK(8), PARAMS(PARAM(eax, StreamNumber), PARAM(psh, pStreamData), PARAM(psh, Stride))),
SYM_SIG(2040)),
REGISTER_OOVPAS(SYM_FUN(D3DDevice_SetTexture, CALL(std), STACK(/*default*/), PARAMS(PARAM(psh, Stage), PARAM(psh, pTexture))),
SYM_SIG(1024)),
REGISTER_OOVPAS(SYM_FUN_LTCG(D3DDevice_SetTextureStageStateNotInline, CALL(unk), STACK(0), PARAMS(PARAM(ecx, Stage), PARAM(edx, Type), PARAM(eax, Value))),
Expand Down Expand Up @@ -343,11 +343,11 @@ OOVPATable D3D8LTCG_OOVPA[] = {
SYM_SIG(2024, 2036, 2048)),
REGISTER_OOVPAS(SYM_FUN_LTCG(D3DDevice_SetTextureState_ColorKeyColor, CALL(unk), STACK(4), PARAMS(PARAM(eax, Stage), PARAM(psh, Value))),
SYM_SIG(2048, 2060)),
REGISTER_OOVPAS_C(SYM_FUN(D3DDevice_SetTextureState_TexCoordIndex, CALL(std), STACK(/*default*/), PARAMS(PARAM(psh, Stage), PARAM(psh, Value))),
REGISTER_OOVPAS_M(SYM_FUN(D3DDevice_SetTextureState_TexCoordIndex, CALL(std), STACK(/*default*/), PARAMS(PARAM(psh, Stage), PARAM(psh, Value))),
SYM_SIG(1944, 1958)),
REGISTER_OOVPAS_C(SYM_FUN_LTCG(D3DDevice_SetTextureState_TexCoordIndex, CALL(unk), STACK(0), PARAMS(PARAM(edi, Stage), PARAM(eax, Value))),
REGISTER_OOVPAS_M(SYM_FUN_LTCG(D3DDevice_SetTextureState_TexCoordIndex, CALL(unk), STACK(0), PARAMS(PARAM(edi, Stage), PARAM(eax, Value))),
SYM_SIG(2039, 2058)),
REGISTER_OOVPAS_C(SYM_FUN_LTCG(D3DDevice_SetTextureState_TexCoordIndex, CALL(unk), STACK(4), PARAMS(PARAM(esi, Stage), PARAM(psh, Value))),
REGISTER_OOVPAS_M(SYM_FUN_LTCG(D3DDevice_SetTextureState_TexCoordIndex, CALL(unk), STACK(4), PARAMS(PARAM(esi, Stage), PARAM(psh, Value))),
SYM_SIG(2040, 2045, 2052, 2058)),
REGISTER_OOVPAS(SYM_FUN_LTCG(D3DDevice_SetTexture, CALL(unk), STACK(4), PARAMS(PARAM(psh, Stage), PARAM(eax, pTexture))),
SYM_SIG(2024)),
Expand Down Expand Up @@ -458,8 +458,6 @@ OOVPATable D3D8LTCG_OOVPA[] = {
};

// ******************************************************************
// * D3D8LTCG_OOVPA_COUNT
// * D3D8LTCG_OOVPA
// ******************************************************************
#define D3D8LTCG_OOVPA_COUNT XBSDB_ARRAY_SIZE(D3D8LTCG_OOVPA)

#endif
OOVPATableList D3D8LTCG_OOVPA = { XBSDB_ARRAY_SIZE(D3D8LTCG_OOVPA_Table), D3D8LTCG_OOVPA_Table };
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,7 @@
// * D3D_KickOffAndWaitForIdle2 (4627)
// * D3D_CommonSetRenderTargetB (4627)

#ifndef D3D8_OOVPA_INL
#define D3D8_OOVPA_INL

#include "OOVPA.h"
#include "OOVPA_databases.h"

#include "D3D8/3911.inl"
#include "D3D8/3925.inl"
Expand Down Expand Up @@ -159,9 +156,9 @@
#define REGISTER_OOVPAS_D3D8(Symbol, ...) REGISTER_OOVPAS_PREFIX(D3D8, Symbol, __VA_ARGS__)

// ******************************************************************
// * D3D8_OOVPA
// * D3D8_OOVPA_Table
// ******************************************************************
OOVPATable D3D8_OOVPA[] = {
static OOVPATable D3D8_OOVPA_Table[] = {
// Custom manual search by reverse engineering team (which will not be public to the user)
REGISTER_OOVPAS_M(SYM_INT(D3DDevice__m_VerticalBlankEvent__GenericFragment),
SYM_SIG(3911)), // This OOVPA signature is not a symbol. Read its note for more details.
Expand Down Expand Up @@ -537,8 +534,8 @@ OOVPATable D3D8_OOVPA[] = {
SYM_SIG(3911, 4034, 4134)),
REGISTER_OOVPAS(SYM_FUN(D3DDevice_SetStipple, CALL(std), STACK(/*default*/), PARAMS(PARAM(psh, pPattern))),
SYM_SIG(4627)),
REGISTER_OOVPAS(SYM_FUN(D3DDevice_SetStreamSource, CALL(std), STACK(/*default*/), PARAMS(PARAM(psh, StreamNumber), PARAM(psh, pStreamData), PARAM(psh, Stride))),
SYM_SIG(3911, 4034)),
REGISTER_OOVPAS_M(SYM_FUN(D3DDevice_SetStreamSource, CALL(std), STACK(/*default*/), PARAMS(PARAM(psh, StreamNumber), PARAM(psh, pStreamData), PARAM(psh, Stride))),
SYM_SIG(3911, 4034)),
REGISTER_OOVPAS(SYM_FUN(D3DDevice_SetSwapCallback, CALL(std), STACK(/*default*/), PARAMS(PARAM(psh, pCallback))),
SYM_SIG(4039)), // Final generic OOVPA: 4039; Removed: 0
REGISTER_OOVPAS(SYM_FUN(D3DDevice_SetTexture, CALL(std), STACK(/*default*/), PARAMS(PARAM(psh, Stage), PARAM(psh, pTexture))),
Expand All @@ -551,7 +548,7 @@ OOVPATable D3D8_OOVPA[] = {
SYM_SIG(3911, 4034)),
REGISTER_OOVPAS(SYM_FUN(D3DDevice_SetTextureState_ColorKeyColor, CALL(std), STACK(/*default*/), PARAMS(PARAM(psh, Stage), PARAM(psh, Value))),
SYM_SIG(3911, 4034)),
REGISTER_OOVPAS_C(SYM_FUN(D3DDevice_SetTextureState_TexCoordIndex, CALL(std), STACK(/*default*/), PARAMS(PARAM(psh, Stage), PARAM(psh, Value))),
REGISTER_OOVPAS_M(SYM_FUN(D3DDevice_SetTextureState_TexCoordIndex, CALL(std), STACK(/*default*/), PARAMS(PARAM(psh, Stage), PARAM(psh, Value))),
SYM_SIG(3911, 4034, 4242, 4627)),
REGISTER_OOVPAS(SYM_FUN(D3DDevice_SetTile, CALL(std), STACK(/*default*/), PARAMS(PARAM(psh, Index), PARAM(psh, pTile))),
SYM_SIG(3911, 4034, 4627)), // Then it has changed calls ?SetTileNoWait@D3D@@YGXKPBU_D3DTILE@@@Z in XDK 4627 and higher.
Expand Down Expand Up @@ -699,10 +696,7 @@ OOVPATable D3D8_OOVPA[] = {
SYM_SIG(4627)),
};


// ******************************************************************
// * D3D8_OOVPA_COUNT
// * D3D8_OOVPA
// ******************************************************************
#define D3D8_OOVPA_COUNT XBSDB_ARRAY_SIZE(D3D8_OOVPA)

#endif
OOVPATableList D3D8_OOVPA = { XBSDB_ARRAY_SIZE(D3D8_OOVPA_Table), D3D8_OOVPA_Table };
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@
#ifndef DSOUND_OOVPA_INL
#define DSOUND_OOVPA_INL

#include "OOVPA.h"
#include "OOVPA_databases.h"
#include <xref/list_xref.h>

#include "DSound/3911.inl"
#include "DSound/3936.inl"
Expand All @@ -140,9 +141,9 @@
#include "DSound/5558.inl"

// ******************************************************************
// * DSOUND_OOVPA_manual
// * DSound_OOVPA_manual_Table
// ******************************************************************
OOVPATable DSound_OOVPA_manual[] = {
static OOVPATable DSound_OOVPA_manual_Table[] = {

// Without xrefs dependency
REGISTER_OOVPAS_M(SYM_FUN(CDirectSoundStream_AddRef, CALL(std), STACK(/*default*/), PARAMS(PARAM(psh, pThis))),
Expand All @@ -162,12 +163,12 @@ OOVPATable DSound_OOVPA_manual[] = {
REGISTER_OOVPAS_M(SYM_FUN(CDirectSoundStream_Constructor, CALL(thi), STACK(/*default*/), PARAMS(PARAM(ecx, this), PARAM(psh, pdssd))),
SYM_SIG(3911)), // NOTE: Does not need to be register in db. Using manual work instead, like D3D8 did.
};
#define DSound_OOVPA_manual_COUNT XBSDB_ARRAY_SIZE(DSound_OOVPA_manual)
OOVPATableList DSound_OOVPA_manual = { XBSDB_ARRAY_SIZE(DSound_OOVPA_manual_Table), DSound_OOVPA_manual_Table };

// ******************************************************************
// * DSOUND_OOVPA
// * DSound_OOVPA_Table
// ******************************************************************
OOVPATable DSound_OOVPA[] = {
static OOVPATable DSound_OOVPA_Table[] = {

REGISTER_OOVPAS(SYM_FUN(XAudioCalculatePitch, CALL(std), STACK(/*default*/), PARAMS(PARAM(psh, dwFrequency))),
SYM_SIG(3911, 4039, 5455)), // Final generic OOVPA: 5455; Removed: 0
Expand Down Expand Up @@ -884,8 +885,8 @@ OOVPATable DSound_OOVPA[] = {
};

// ******************************************************************
// * DSound_OOVPA_COUNT
// * DSound_OOVPA
// ******************************************************************
#define DSound_OOVPA_COUNT XBSDB_ARRAY_SIZE(DSound_OOVPA)
OOVPATableList DSound_OOVPA = { XBSDB_ARRAY_SIZE(DSound_OOVPA_Table), DSound_OOVPA_Table };

#endif
15 changes: 5 additions & 10 deletions src/OOVPADatabase/JVS_OOVPA.inl → src/OOVPADatabase/JVS_OOVPA.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,14 @@
// is the same except the functions are quite different in layout, etc
// and some offsets are different within them too.

#ifndef JVS_OOVPA_INL
#define JVS_OOVPA_INL

#include "OOVPA.h"
#include "OOVPA_databases.h"

#include "JVS/4831.inl"

// ******************************************************************
// * JVSLIB_OOVPA
// * JVSLIB_OOVPA_Table
// ******************************************************************
OOVPATable JVSLIB_OOVPA[] = {
static OOVPATable JVSLIB_OOVPA_Table[] = {

// Variables
REGISTER_OOVPAS_M(SYM_VAR(JVS_g_pPINSA),
Expand Down Expand Up @@ -168,8 +165,6 @@ OOVPATable JVSLIB_OOVPA[] = {
};

// ******************************************************************
// * JVSLIB_OOVPA_COUNT
// * JVSLIB_OOVPA
// ******************************************************************
#define JVSLIB_OOVPA_COUNT XBSDB_ARRAY_SIZE(JVSLIB_OOVPA)

#endif
OOVPATableList JVSLIB_OOVPA = { XBSDB_ARRAY_SIZE(JVSLIB_OOVPA_Table), JVSLIB_OOVPA_Table };
12 changes: 8 additions & 4 deletions src/OOVPADatabase/OOVPA.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
// SPDX-FileCopyrightText: 2017 PatrickvL
// SPDX-FileCopyrightText: 2017 RadWolfie

#ifndef OOVPA_H
#define OOVPA_H
#pragma once

#include "libXbSymbolDatabase.h"

// http://stackoverflow.com/questions/5134523/msvc-doesnt-expand-va-args-correctly
// MSVC_EXPAND works around a Visual C++ problem, expanding __VA_ARGS__ incorrectly:
Expand Down Expand Up @@ -220,6 +221,11 @@ typedef struct _OOVPATable {
const unsigned count;
OOVPARevision* const revisions;
} OOVPATable;

typedef struct _OOVPATableList {
unsigned int Count;
OOVPATable* Table;
} OOVPATableList;
#pragma pack(1)

// http://en.cppreference.com/w/cpp/iterator/size
Expand Down Expand Up @@ -440,5 +446,3 @@ typedef struct _OOVPATable {
OV_BYTES_3, OV_BYTES_2, OV_BYTES_1, OV_BYTES_0)(Offset, __VA_ARGS__))

#pragma pack()

#endif
Loading

0 comments on commit c59a1fa

Please sign in to comment.