diff --git a/.github/workflows/msbuild.yml b/.github/workflows/msbuild.yml index 61b88b9..f2de283 100644 --- a/.github/workflows/msbuild.yml +++ b/.github/workflows/msbuild.yml @@ -25,7 +25,7 @@ env: # You can convert this to a build matrix if you need coverage of multiple configuration types. # https://docs.github.com/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix BUILD_CONFIGURATION: Release - BUILD_VERSION: 4.2.6.12 # Version + BUILD_VERSION: 4.2.7.3 # Version # permissions: actions: write diff --git a/Analyze/Analyze.rc b/Analyze/Analyze.rc index 08f26fd..69d7aa5 100644 --- a/Analyze/Analyze.rc +++ b/Analyze/Analyze.rc @@ -51,8 +51,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,2,06,012 - PRODUCTVERSION 4,2,06,012 + FILEVERSION 4,2,07,003 + PRODUCTVERSION 4,2,07,003 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -70,15 +70,15 @@ BEGIN VALUE "Comments", "mailto:ian.macallan@gmail.com\0" VALUE "CompanyName", "Macallan (c)\0" VALUE "FileDescription", "Analyze - (MSVC)\0" - VALUE "FileVersion", "4.2.06.012\0" + VALUE "FileVersion", "4.2.07.003\0" VALUE "InternalName", "https://www.macallan.org/\0" - VALUE "LegalCopyright", "Copyright (C) Thu Jul 11 11:23, 2024\0" + VALUE "LegalCopyright", "Copyright (C) Thu Jul 11 16:02, 2024\0" VALUE "LegalTrademarks", "Author: Ian Macallan\0" VALUE "OriginalFilename", ORIGINAL_FILENAME - VALUE "PrivateBuild", "765\0" + VALUE "PrivateBuild", "768\0" VALUE "ProductName", PRODUCT_NAME - VALUE "ProductVersion", "4.2.06.012\0" - VALUE "SpecialBuild", "765\0" + VALUE "ProductVersion", "4.2.07.003\0" + VALUE "SpecialBuild", "768\0" END END BLOCK "VarFileInfo" diff --git a/Analyze/AutomaticProductName.h b/Analyze/AutomaticProductName.h index 863f9c5..8745fd4 100644 --- a/Analyze/AutomaticProductName.h +++ b/Analyze/AutomaticProductName.h @@ -6,22 +6,22 @@ #ifdef _WIN64 #ifdef UNICODE #define ORIGINAL_FILENAME L"Analyze (x64 Unicode) (MSVC)\0" -#define PRODUCT_NAME L"Analyze - Version 4.2.06.012\r\n(Build 765) - (x64 Unicode) (MSVC)\0" +#define PRODUCT_NAME L"Analyze - Version 4.2.07.003\r\n(Build 768) - (x64 Unicode) (MSVC)\0" #else #define ORIGINAL_FILENAME "Analyze (x64 MBCS) (MSVC)\0" -#define PRODUCT_NAME "Analyze - Version 4.2.06.012\r\n(Build 765) - (x64 MBCS) (MSVC)\0" +#define PRODUCT_NAME "Analyze - Version 4.2.07.003\r\n(Build 768) - (x64 MBCS) (MSVC)\0" #endif #elif _WIN32 #ifdef UNICODE #define ORIGINAL_FILENAME L"Analyze (x86 Unicode) (MSVC)\0" -#define PRODUCT_NAME L"Analyze - Version 4.2.06.012\r\n(Build 765) - (x86 Unicode) (MSVC)\0" +#define PRODUCT_NAME L"Analyze - Version 4.2.07.003\r\n(Build 768) - (x86 Unicode) (MSVC)\0" #else #define ORIGINAL_FILENAME "Analyze (x86 MBCS) (MSVC)\0" -#define PRODUCT_NAME "Analyze - Version 4.2.06.012\r\n(Build 765) - (x86 MBCS) (MSVC)\0" +#define PRODUCT_NAME "Analyze - Version 4.2.07.003\r\n(Build 768) - (x86 MBCS) (MSVC)\0" #endif #else #define ORIGINAL_FILENAME "Analyze (MSVC)\0" -#define PRODUCT_NAME "Analyze - Version 4.2.06.012\r\n(Build 765) - (MSVC)\0" +#define PRODUCT_NAME "Analyze - Version 4.2.07.003\r\n(Build 768) - (MSVC)\0" #endif #endif diff --git a/Analyze/AutomaticVersionHeader.h b/Analyze/AutomaticVersionHeader.h index 2a1fc39..e63e6e6 100644 --- a/Analyze/AutomaticVersionHeader.h +++ b/Analyze/AutomaticVersionHeader.h @@ -5,7 +5,7 @@ // // (c) 2003 - 2024 Macallan - mailto:ian.macallan@gmail.com // -// Generated : 11/07/2024 11:23:20 +// Generated : 11/07/2024 16:02:50 // //=========================================================================================== // @@ -57,22 +57,22 @@ #endif #ifdef UNICODE -#define PROGRAM_DATE L"Thu Jul 11 11:23" -#define PROGRAM_DATE_F L"Thu Jul 11 11:23 2024" +#define PROGRAM_DATE L"Thu Jul 11 16:02" +#define PROGRAM_DATE_F L"Thu Jul 11 16:02 2024" #define PROGRAM_YEAR L"2024" -#define PROGRAM_TIME L"2024/07/11 11:23:20" +#define PROGRAM_TIME L"2024/07/11 16:02:50" #else -#define PROGRAM_DATE "Thu Jul 11 11:23" -#define PROGRAM_DATE_F "Thu Jul 11 11:23 2024" +#define PROGRAM_DATE "Thu Jul 11 16:02" +#define PROGRAM_DATE_F "Thu Jul 11 16:02 2024" #define PROGRAM_YEAR "2024" -#define PROGRAM_TIME "2024/07/11 11:23:20" +#define PROGRAM_TIME "2024/07/11 16:02:50" #endif #ifdef UNICODE -#define PROGRAM_VERSION L"4.2.06.012" -#define PROGRAM_INSTALL L"4.2.06012" -#define PROGRAM_VER_NUM 40206012 -#define PROGRAM_BUILD L"765" +#define PROGRAM_VERSION L"4.2.07.003" +#define PROGRAM_INSTALL L"4.2.07003" +#define PROGRAM_VER_NUM 40207003 +#define PROGRAM_BUILD L"768" #define PROGRAM_TITLE L"Analyze" #ifdef _WIN64 #define PROGRAM_TITLE_P L"Analyze (x64 Unicode)" @@ -80,10 +80,10 @@ #define PROGRAM_TITLE_P L"Analyze (x86 Unicode)" #endif #else -#define PROGRAM_VERSION "4.2.06.012" -#define PROGRAM_INSTALL "4.2.06012" -#define PROGRAM_VER_NUM 40206012 -#define PROGRAM_BUILD "765" +#define PROGRAM_VERSION "4.2.07.003" +#define PROGRAM_INSTALL "4.2.07003" +#define PROGRAM_VER_NUM 40207003 +#define PROGRAM_BUILD "768" #define PROGRAM_TITLE "Analyze" #ifdef _WIN64 #define PROGRAM_TITLE_P "Analyze (x64 MBCS)" diff --git a/AutomaticProductName.h b/AutomaticProductName.h index 70444c3..75f0ac3 100644 --- a/AutomaticProductName.h +++ b/AutomaticProductName.h @@ -6,22 +6,22 @@ #ifdef _WIN64 #ifdef UNICODE #define ORIGINAL_FILENAME L"TRCheatWin (x64 Unicode) (MSVC)\0" -#define PRODUCT_NAME L"TRCheatWin - Version 4.2.06.012\r\n(Build 900) - (x64 Unicode) (MSVC)\0" +#define PRODUCT_NAME L"TRCheatWin - Version 4.2.07.003\r\n(Build 903) - (x64 Unicode) (MSVC)\0" #else #define ORIGINAL_FILENAME "TRCheatWin (x64 MBCS) (MSVC)\0" -#define PRODUCT_NAME "TRCheatWin - Version 4.2.06.012\r\n(Build 900) - (x64 MBCS) (MSVC)\0" +#define PRODUCT_NAME "TRCheatWin - Version 4.2.07.003\r\n(Build 903) - (x64 MBCS) (MSVC)\0" #endif #elif _WIN32 #ifdef UNICODE #define ORIGINAL_FILENAME L"TRCheatWin (x86 Unicode) (MSVC)\0" -#define PRODUCT_NAME L"TRCheatWin - Version 4.2.06.012\r\n(Build 900) - (x86 Unicode) (MSVC)\0" +#define PRODUCT_NAME L"TRCheatWin - Version 4.2.07.003\r\n(Build 903) - (x86 Unicode) (MSVC)\0" #else #define ORIGINAL_FILENAME "TRCheatWin (x86 MBCS) (MSVC)\0" -#define PRODUCT_NAME "TRCheatWin - Version 4.2.06.012\r\n(Build 900) - (x86 MBCS) (MSVC)\0" +#define PRODUCT_NAME "TRCheatWin - Version 4.2.07.003\r\n(Build 903) - (x86 MBCS) (MSVC)\0" #endif #else #define ORIGINAL_FILENAME "TRCheatWin (MSVC)\0" -#define PRODUCT_NAME "TRCheatWin - Version 4.2.06.012\r\n(Build 900) - (MSVC)\0" +#define PRODUCT_NAME "TRCheatWin - Version 4.2.07.003\r\n(Build 903) - (MSVC)\0" #endif #endif diff --git a/AutomaticVersionHeader.h b/AutomaticVersionHeader.h index 30f7277..06a73ad 100644 --- a/AutomaticVersionHeader.h +++ b/AutomaticVersionHeader.h @@ -5,7 +5,7 @@ // // (c) 2003 - 2024 Macallan - mailto:ian.macallan@gmail.com // -// Generated : 11/07/2024 11:23:20 +// Generated : 11/07/2024 16:02:50 // //=========================================================================================== // @@ -57,22 +57,22 @@ #endif #ifdef UNICODE -#define PROGRAM_DATE L"Thu Jul 11 11:23" -#define PROGRAM_DATE_F L"Thu Jul 11 11:23 2024" +#define PROGRAM_DATE L"Thu Jul 11 16:02" +#define PROGRAM_DATE_F L"Thu Jul 11 16:02 2024" #define PROGRAM_YEAR L"2024" -#define PROGRAM_TIME L"2024/07/11 11:23:20" +#define PROGRAM_TIME L"2024/07/11 16:02:50" #else -#define PROGRAM_DATE "Thu Jul 11 11:23" -#define PROGRAM_DATE_F "Thu Jul 11 11:23 2024" +#define PROGRAM_DATE "Thu Jul 11 16:02" +#define PROGRAM_DATE_F "Thu Jul 11 16:02 2024" #define PROGRAM_YEAR "2024" -#define PROGRAM_TIME "2024/07/11 11:23:20" +#define PROGRAM_TIME "2024/07/11 16:02:50" #endif #ifdef UNICODE -#define PROGRAM_VERSION L"4.2.06.012" -#define PROGRAM_INSTALL L"4.2.06012" -#define PROGRAM_VER_NUM 40206012 -#define PROGRAM_BUILD L"900" +#define PROGRAM_VERSION L"4.2.07.003" +#define PROGRAM_INSTALL L"4.2.07003" +#define PROGRAM_VER_NUM 40207003 +#define PROGRAM_BUILD L"903" #define PROGRAM_TITLE L"TRCheat Win" #ifdef _WIN64 #define PROGRAM_TITLE_P L"TRCheat Win (x64 Unicode)" @@ -80,10 +80,10 @@ #define PROGRAM_TITLE_P L"TRCheat Win (x86 Unicode)" #endif #else -#define PROGRAM_VERSION "4.2.06.012" -#define PROGRAM_INSTALL "4.2.06012" -#define PROGRAM_VER_NUM 40206012 -#define PROGRAM_BUILD "900" +#define PROGRAM_VERSION "4.2.07.003" +#define PROGRAM_INSTALL "4.2.07003" +#define PROGRAM_VER_NUM 40207003 +#define PROGRAM_BUILD "903" #define PROGRAM_TITLE "TRCheat Win" #ifdef _WIN64 #define PROGRAM_TITLE_P "TRCheat Win (x64 MBCS)" diff --git a/ProductVersionInfo.cmd b/ProductVersionInfo.cmd index ada760e..18e35e1 100644 --- a/ProductVersionInfo.cmd +++ b/ProductVersionInfo.cmd @@ -3,6 +3,6 @@ rem cd %~dp0 rem %~d0 -set PRODUCT_VERSION_VERS=4.2.6.12 +set PRODUCT_VERSION_VERS=4.2.7.3 @exit /b diff --git a/ProductVersionInfo.txt b/ProductVersionInfo.txt index 278777a..436e874 100644 --- a/ProductVersionInfo.txt +++ b/ProductVersionInfo.txt @@ -1,4 +1,4 @@ -4.2.6.12 +4.2.7.3 TRCheatWin -TRCheatWin (x86) : Thu Jul 11 11:23 4.2.6.12 -TRCheatWin (x64) : Thu Jul 11 11:23 4.2.6.12 +TRCheatWin (x86) : Thu Jul 11 16:02 4.2.7.3 +TRCheatWin (x64) : Thu Jul 11 16:02 4.2.7.3 diff --git a/ProductVersionSize.txt b/ProductVersionSize.txt index 6b2dd9f..8cd3793 100644 --- a/ProductVersionSize.txt +++ b/ProductVersionSize.txt @@ -1 +1 @@ -4.2.06.012 +4.2.07.003 diff --git a/ReadTR2/AutomaticProductName.h b/ReadTR2/AutomaticProductName.h index 23e0068..17165cf 100644 --- a/ReadTR2/AutomaticProductName.h +++ b/ReadTR2/AutomaticProductName.h @@ -6,22 +6,22 @@ #ifdef _WIN64 #ifdef UNICODE #define ORIGINAL_FILENAME L"ReadTR2 (x64 Unicode) (MSVC)\0" -#define PRODUCT_NAME L"ReadTR2 - Version 4.2.06.012\r\n(Build 489) - (x64 Unicode) (MSVC)\0" +#define PRODUCT_NAME L"ReadTR2 - Version 4.2.07.003\r\n(Build 492) - (x64 Unicode) (MSVC)\0" #else #define ORIGINAL_FILENAME "ReadTR2 (x64 MBCS) (MSVC)\0" -#define PRODUCT_NAME "ReadTR2 - Version 4.2.06.012\r\n(Build 489) - (x64 MBCS) (MSVC)\0" +#define PRODUCT_NAME "ReadTR2 - Version 4.2.07.003\r\n(Build 492) - (x64 MBCS) (MSVC)\0" #endif #elif _WIN32 #ifdef UNICODE #define ORIGINAL_FILENAME L"ReadTR2 (x86 Unicode) (MSVC)\0" -#define PRODUCT_NAME L"ReadTR2 - Version 4.2.06.012\r\n(Build 489) - (x86 Unicode) (MSVC)\0" +#define PRODUCT_NAME L"ReadTR2 - Version 4.2.07.003\r\n(Build 492) - (x86 Unicode) (MSVC)\0" #else #define ORIGINAL_FILENAME "ReadTR2 (x86 MBCS) (MSVC)\0" -#define PRODUCT_NAME "ReadTR2 - Version 4.2.06.012\r\n(Build 489) - (x86 MBCS) (MSVC)\0" +#define PRODUCT_NAME "ReadTR2 - Version 4.2.07.003\r\n(Build 492) - (x86 MBCS) (MSVC)\0" #endif #else #define ORIGINAL_FILENAME "ReadTR2 (MSVC)\0" -#define PRODUCT_NAME "ReadTR2 - Version 4.2.06.012\r\n(Build 489) - (MSVC)\0" +#define PRODUCT_NAME "ReadTR2 - Version 4.2.07.003\r\n(Build 492) - (MSVC)\0" #endif #endif diff --git a/ReadTR2/AutomaticVersionHeader.h b/ReadTR2/AutomaticVersionHeader.h index 5961a78..d3759c4 100644 --- a/ReadTR2/AutomaticVersionHeader.h +++ b/ReadTR2/AutomaticVersionHeader.h @@ -5,7 +5,7 @@ // // (c) 2003 - 2024 Macallan - mailto:ian.macallan@gmail.com // -// Generated : 11/07/2024 11:23:20 +// Generated : 11/07/2024 16:02:50 // //=========================================================================================== // @@ -57,22 +57,22 @@ #endif #ifdef UNICODE -#define PROGRAM_DATE L"Thu Jul 11 11:23" -#define PROGRAM_DATE_F L"Thu Jul 11 11:23 2024" +#define PROGRAM_DATE L"Thu Jul 11 16:02" +#define PROGRAM_DATE_F L"Thu Jul 11 16:02 2024" #define PROGRAM_YEAR L"2024" -#define PROGRAM_TIME L"2024/07/11 11:23:20" +#define PROGRAM_TIME L"2024/07/11 16:02:50" #else -#define PROGRAM_DATE "Thu Jul 11 11:23" -#define PROGRAM_DATE_F "Thu Jul 11 11:23 2024" +#define PROGRAM_DATE "Thu Jul 11 16:02" +#define PROGRAM_DATE_F "Thu Jul 11 16:02 2024" #define PROGRAM_YEAR "2024" -#define PROGRAM_TIME "2024/07/11 11:23:20" +#define PROGRAM_TIME "2024/07/11 16:02:50" #endif #ifdef UNICODE -#define PROGRAM_VERSION L"4.2.06.012" -#define PROGRAM_INSTALL L"4.2.06012" -#define PROGRAM_VER_NUM 40206012 -#define PROGRAM_BUILD L"489" +#define PROGRAM_VERSION L"4.2.07.003" +#define PROGRAM_INSTALL L"4.2.07003" +#define PROGRAM_VER_NUM 40207003 +#define PROGRAM_BUILD L"492" #define PROGRAM_TITLE L"Read TR2" #ifdef _WIN64 #define PROGRAM_TITLE_P L"Read TR2 (x64 Unicode)" @@ -80,10 +80,10 @@ #define PROGRAM_TITLE_P L"Read TR2 (x86 Unicode)" #endif #else -#define PROGRAM_VERSION "4.2.06.012" -#define PROGRAM_INSTALL "4.2.06012" -#define PROGRAM_VER_NUM 40206012 -#define PROGRAM_BUILD "489" +#define PROGRAM_VERSION "4.2.07.003" +#define PROGRAM_INSTALL "4.2.07003" +#define PROGRAM_VER_NUM 40207003 +#define PROGRAM_BUILD "492" #define PROGRAM_TITLE "Read TR2" #ifdef _WIN64 #define PROGRAM_TITLE_P "Read TR2 (x64 MBCS)" diff --git a/ReadTR2/ReadTR2.rc b/ReadTR2/ReadTR2.rc index 23200dd..fd8e669 100644 --- a/ReadTR2/ReadTR2.rc +++ b/ReadTR2/ReadTR2.rc @@ -51,8 +51,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,2,06,012 - PRODUCTVERSION 4,2,06,012 + FILEVERSION 4,2,07,003 + PRODUCTVERSION 4,2,07,003 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -70,15 +70,15 @@ BEGIN VALUE "Comments", "mailto:ian.macallan@gmail.com\0" VALUE "CompanyName", "Macallan (c)\0" VALUE "FileDescription", "ReadTR2 - (MSVC)\0" - VALUE "FileVersion", "4.2.06.012\0" + VALUE "FileVersion", "4.2.07.003\0" VALUE "InternalName", "https://www.macallan.org/\0" - VALUE "LegalCopyright", "Copyright (C) Thu Jul 11 11:23, 2024\0" + VALUE "LegalCopyright", "Copyright (C) Thu Jul 11 16:02, 2024\0" VALUE "LegalTrademarks", "Author: Ian Macallan\0" VALUE "OriginalFilename", ORIGINAL_FILENAME - VALUE "PrivateBuild", "489\0" + VALUE "PrivateBuild", "492\0" VALUE "ProductName", PRODUCT_NAME - VALUE "ProductVersion", "4.2.06.012\0" - VALUE "SpecialBuild", "489\0" + VALUE "ProductVersion", "4.2.07.003\0" + VALUE "SpecialBuild", "492\0" END END BLOCK "VarFileInfo" diff --git a/TR4NGSaveGame.cpp b/TR4NGSaveGame.cpp index adf742e..2755201 100644 --- a/TR4NGSaveGame.cpp +++ b/TR4NGSaveGame.cpp @@ -75,25 +75,24 @@ static char TR4NBSecrets [ ] = ///////////////////////////////////////////////////////////////////////////// static TR45_INDICATORS IndicatorsTR4NGTable [ MAX_INDICATORS ] = { - { FALSE, 0x02, 0x02, 0x00, 0x67, FALSE }, + { FALSE, 0x02, 0x02, 0x00, 0x67, TRUE }, + { FALSE, 0x02, 0x02, 0x47, 0x67, TRUE }, { FALSE, 0x02, 0x02, 0x00, 0x28, FALSE }, { FALSE, 0x02, 0x02, 0x00, 0x0b, FALSE }, { FALSE, 0x02, 0x02, 0x00, 0x0c, FALSE }, { FALSE, 0x02, 0x02, 0x00, 0x1f, FALSE }, { FALSE, 0x02, 0x02, 0x00, 0xbd, FALSE }, { FALSE, 0x02, 0x02, 0x00, 0xdd, FALSE }, - { FALSE, 0x03, 0x00, 0x00, 0x02, FALSE }, { FALSE, 0x0d, 0x0d, 0x00, 0x6c, FALSE }, - { FALSE, 0x0e, 0x00, 0x00, 0x02, FALSE }, { FALSE, 0x12, 0x00, 0x00, 0x02, FALSE }, // Flare { FALSE, 0xfd, 0xff, 0x00, 0x00, FALSE }, // Jeep -#ifdef _DEBUG - { FALSE, 0x47, 0x47, 0x47, 0xde, TRUE }, // Kneel + + { FALSE, 0x47, 0x47, 0x47, 0xde, TRUE }, // Kneeling + { FALSE, 0x10, 0x00, 0x51, 0x51, TRUE }, // Crawlling { FALSE, 0x00, 0x02, 0x00, 0x02, TRUE }, { FALSE, 0x00, 0x02, 0x00, 0x03, TRUE }, { FALSE, 0x0c, 0x00, 0x00, 0x02, TRUE }, { FALSE, 0x21, 0x21, 0x00, 0x6e, TRUE }, // In Water -#endif { TRUE, 0xff, 0xff, 0xff, 0xff, TRUE }, // End }; @@ -1643,8 +1642,14 @@ void *CTR4NGSaveGame::GetIndicatorAddress (int index) continue; } - // Life is not there - WORD life = * (WORD * ) ( pBuffer + i + TR4NG_LIFE_OFFSET ); + // In TR4 Life is between 0 and 999 (0 means 1000) + short life = * (short * ) ( pBuffer + i + TR4NG_LIFE_OFFSET ); + + // Life Is valid between 0 and 1000 + if ( life < 0 || life > 1000 ) + { + continue; + } // count++; @@ -1694,7 +1699,7 @@ int CTR4NGSaveGame::GetLife () char *pBuffer = ( char * ) GetIndicatorAddress(); if ( pBuffer != NULL ) { - WORD *pLife = ( WORD * ) ( &pBuffer [ TR4NG_LIFE_OFFSET ] ); + short *pLife = ( short * ) ( &pBuffer [ TR4NG_LIFE_OFFSET ] ); return *pLife; } @@ -1844,6 +1849,10 @@ TR4NG_POSITION *CTR4NGSaveGame::GetTR4Position ( ) ZeroMemory ( positionTable, sizeof(positionTable) ); positionCount = 0; +#ifdef _DEBUG + OutputDebugString ( "\n" ); +#endif + // We Search n times // The Goal is to see if there is a =atch with position for an index // For example we could have an indicator but no position @@ -1904,11 +1913,15 @@ TR4NG_POSITION *CTR4NGSaveGame::GetTR4Position ( ) if ( bCheck ) { #ifdef _DEBUG + // Life is not there + short life = * (short * ) ( pBuffer + TR4NG_LIFE_OFFSET ); + DWORD dwRelativeAddress = CTRXTools::RelativeAddress ( pBuffer + i, m_pBuffer ); static char szDebugString [ MAX_PATH ]; - sprintf_s ( szDebugString, sizeof(szDebugString), "Indicators 0x%08x : 0x%02x 0x%02x 0x%02x 0x%02x %3u %5d %5d %5d %3u\n", + sprintf_s ( szDebugString, sizeof(szDebugString), "Indicators 0x%08x : 0x%02x 0x%02x 0x%02x 0x%02x %3u %5d %5d %5d %3u %4d\n", dwRelativeAddress, pTR4Position->indicator1, pTR4Position->indicator2, pTR4Position->indicator3, pTR4Position->indicator4, - pTR4Position->cRoom, pTR4Position->wVertical, pTR4Position->wSouthToNorth, pTR4Position->wWestToEast, pTR4Position->cOrientation ); + pTR4Position->cRoom, pTR4Position->wVertical, pTR4Position->wSouthToNorth, pTR4Position->wWestToEast, pTR4Position->cOrientation, + life ); OutputDebugString ( szDebugString ); #endif positionTable [ 0 ] = pTR4Position; @@ -1971,21 +1984,27 @@ TR4NG_POSITION *CTR4NGSaveGame::GetTR4Position ( ) BOOL bCheck = CheckAreaForCoordinates ( GetFullVersion(), GetLevelIndex(), wRoom, dwWestToEast, dwVertical, dwSouthToNorth, true, dwExtraVertical ); if ( bCheck ) { + // Life between 0 and 1000 + short life = * (short * ) ( pBuffer + i + TR4NG_LIFE_OFFSET ); + positionTable [ positionCount ] = pCurrent; - if ( pTR4Position == NULL ) + if ( life >= 0 && life <= 1000 ) { - pTR4Position = pCurrent; + if ( pTR4Position == NULL ) + { + pTR4Position = pCurrent; + } + positionCount++; } - positionCount++; - #ifdef _DEBUG DWORD dwRelativeAddress = CTRXTools::RelativeAddress ( pBuffer + i, m_pBuffer ); static char szDebugString [ MAX_PATH ]; - sprintf_s ( szDebugString, sizeof(szDebugString), "Indicators 0x%08x : 0x%02x 0x%02x 0x%02x 0x%02x %3u %5d %5d %5d %3u\n", + sprintf_s ( szDebugString, sizeof(szDebugString), "indicators 0x%08x : 0x%02x 0x%02x 0x%02x 0x%02x %3u %5d %5d %5d %3u %4d\n", dwRelativeAddress, pCurrent->indicator1, pCurrent->indicator2, pCurrent->indicator3, pCurrent->indicator4, - pCurrent->cRoom, pCurrent->wVertical, pCurrent->wSouthToNorth, pCurrent->wWestToEast, pCurrent->cOrientation ); + pCurrent->cRoom, pCurrent->wVertical, pCurrent->wSouthToNorth, pCurrent->wWestToEast, pCurrent->cOrientation, + life ); OutputDebugString ( szDebugString ); if ( CTRXGlobal::m_iUnchecked == FALSE ) diff --git a/TR4SaveGame.cpp b/TR4SaveGame.cpp index 8984636..22f604d 100644 --- a/TR4SaveGame.cpp +++ b/TR4SaveGame.cpp @@ -75,23 +75,37 @@ static char TR4NBSecrets [ ] = ///////////////////////////////////////////////////////////////////////////// static TR45_INDICATORS IndicatorsTR4Table [ MAX_INDICATORS ] = { - { FALSE, 0x02, 0x02, 0x00, 0x67, FALSE }, - { FALSE, 0x02, 0x02, 0x00, 0x28, FALSE }, + { FALSE, 0x02, 0x02, 0x00, 0x67, TRUE }, + { FALSE, 0x02, 0x02, 0x47, 0x67, TRUE }, { FALSE, 0x02, 0x02, 0x00, 0x0b, FALSE }, { FALSE, 0x02, 0x02, 0x00, 0x0c, FALSE }, { FALSE, 0x02, 0x02, 0x00, 0x1f, FALSE }, { FALSE, 0x02, 0x02, 0x00, 0xbd, FALSE }, { FALSE, 0x02, 0x02, 0x00, 0xdd, FALSE }, - { FALSE, 0x03, 0x00, 0x00, 0x02, FALSE }, { FALSE, 0x0d, 0x0d, 0x00, 0x6c, FALSE }, - { FALSE, 0x0e, 0x00, 0x00, 0x02, FALSE }, { FALSE, 0x12, 0x00, 0x00, 0x02, FALSE }, // Flare { FALSE, 0xfd, 0xff, 0x00, 0x00, FALSE }, // Jeep + + { FALSE, 0x47, 0x47, 0x47, 0xde, TRUE }, // Kneeling + { FALSE, 0x10, 0x00, 0x51, 0x51, TRUE }, // Crawlling + { FALSE, 0x21, 0x21, 0x00, 0x6e, TRUE }, // In Water + #ifdef _DEBUG - { FALSE, 0x47, 0x47, 0x47, 0xde, TRUE }, // Kneel { FALSE, 0x00, 0x02, 0x00, 0x02, TRUE }, { FALSE, 0x00, 0x02, 0x00, 0x03, TRUE }, { FALSE, 0x0c, 0x00, 0x00, 0x02, TRUE }, + { FALSE, 0x13, 0x13, 0x00, 0x61, TRUE }, + { FALSE, 0x47, 0x47, 0x00, 0xde, TRUE }, + { FALSE, 0x57, 0x57, 0x47, 0x1f, TRUE }, + { FALSE, 0x61, 0x61, 0x00, 0x44, TRUE }, + { FALSE, 0x01, 0x02, 0x47, 0x08, TRUE }, + { FALSE, 0x50, 0x50, 0x00, 0x07, TRUE }, + { FALSE, 0x21, 0x21, 0x47, 0x6e, TRUE }, + { FALSE, 0x24, 0x24, 0x00, 0x7b, TRUE }, + { FALSE, 0x24, 0x24, 0x47, 0x7b, TRUE }, + { FALSE, 0x43, 0x10, 0x47, 0xcc, TRUE }, + { FALSE, 0x05, 0x05, 0x00, 0x05, TRUE }, + // { FALSE, 0xfd, 0xff, 0xf1, 0xff, TRUE }, #endif { TRUE, 0xff, 0xff, 0xff, 0xff, TRUE }, // End @@ -1641,8 +1655,13 @@ void *CTR4SaveGame::GetIndicatorAddress (int index) continue; } - // Life is not there - WORD life = * (WORD * ) ( pBuffer + i + TR4_LIFE_OFFSET ); + // In TR4 Life is between 0 and 999 (0 means 1000) + short life = * (short * ) ( pBuffer + i + TR4_LIFE_OFFSET ); + // Life Is valid between 0 and 1000 + if ( life < 0 || life > 1000 ) + { + continue; + } count++; if ( count > index ) @@ -1691,7 +1710,7 @@ int CTR4SaveGame::GetLife () char *pBuffer = ( char * ) GetIndicatorAddress(); if ( pBuffer != NULL ) { - WORD *pLife = ( WORD * ) ( &pBuffer [ TR4_LIFE_OFFSET ] ); + short *pLife = ( short * ) ( &pBuffer [ TR4_LIFE_OFFSET ] ); return *pLife; } @@ -1832,6 +1851,10 @@ TR4_POSITION *CTR4SaveGame::GetTR4Position ( ) ZeroMemory ( positionTable, sizeof(positionTable) ); positionCount = 0; +#ifdef _DEBUG + OutputDebugString ( "\n" ); +#endif + // We Search n times // The Goal is to see if there is a =atch with position for an index // For example we could have an indicator but no position @@ -1892,11 +1915,15 @@ TR4_POSITION *CTR4SaveGame::GetTR4Position ( ) if ( bCheck ) { #ifdef _DEBUG + // In TR4 Life is between 0 and 999 (0 means 1000) + short life = * (short * ) ( pBuffer + TR4_LIFE_OFFSET ); + DWORD dwRelativeAddress = CTRXTools::RelativeAddress ( pBuffer + i, m_pBuffer ); static char szDebugString [ MAX_PATH ]; - sprintf_s ( szDebugString, sizeof(szDebugString), "Indicators 0x%08x : 0x%02x 0x%02x 0x%02x 0x%02x %3u %5d %5d %5d %3u\n", + sprintf_s ( szDebugString, sizeof(szDebugString), "Indicators 0x%08x : 0x%02x 0x%02x 0x%02x 0x%02x %3u %5d %5d %5d %3u %4d\n", dwRelativeAddress, pTR4Position->indicator1, pTR4Position->indicator2, pTR4Position->indicator3, pTR4Position->indicator4, - pTR4Position->cRoom, pTR4Position->wVertical, pTR4Position->wSouthToNorth, pTR4Position->wWestToEast, pTR4Position->cOrientation ); + pTR4Position->cRoom, pTR4Position->wVertical, pTR4Position->wSouthToNorth, pTR4Position->wWestToEast, pTR4Position->cOrientation, + life ); OutputDebugString ( szDebugString ); #endif positionTable [ 0 ] = pTR4Position; @@ -1958,21 +1985,27 @@ TR4_POSITION *CTR4SaveGame::GetTR4Position ( ) BOOL bCheck = CheckAreaForCoordinates ( GetFullVersion(), GetLevelIndex(), wRoom, dwWestToEast, dwVertical, dwSouthToNorth, false, dwExtraVertical ); if ( bCheck ) { + // Life between 0 and 1000 + short life = * (short * ) ( pBuffer + i + TR4_LIFE_OFFSET ); + positionTable [ positionCount ] = pCurrent; - if ( pTR4Position == NULL ) + if ( life >= 0 && life <= 1000 ) { - pTR4Position = pCurrent; + if ( pTR4Position == NULL ) + { + pTR4Position = pCurrent; + } + positionCount++; } - positionCount++; - #ifdef _DEBUG DWORD dwRelativeAddress = CTRXTools::RelativeAddress ( pBuffer + i, m_pBuffer ); static char szDebugString [ MAX_PATH ]; - sprintf_s ( szDebugString, sizeof(szDebugString), "Indicators 0x%08x : 0x%02x 0x%02x 0x%02x 0x%02x %3u %5d %5d %5d %3u\n", + sprintf_s ( szDebugString, sizeof(szDebugString), "indicators 0x%08x : 0x%02x 0x%02x 0x%02x 0x%02x %3u %5d %5d %5d %3u %4d\n", dwRelativeAddress, pCurrent->indicator1, pCurrent->indicator2, pCurrent->indicator3, pCurrent->indicator4, - pCurrent->cRoom, pCurrent->wVertical, pCurrent->wSouthToNorth, pCurrent->wWestToEast, pCurrent->cOrientation ); + pCurrent->cRoom, pCurrent->wVertical, pCurrent->wSouthToNorth, pCurrent->wWestToEast, pCurrent->cOrientation, + life ); OutputDebugString ( szDebugString ); if ( CTRXGlobal::m_iUnchecked == FALSE ) diff --git a/TR5SaveGame.cpp b/TR5SaveGame.cpp index 758b5da..4f97af9 100644 --- a/TR5SaveGame.cpp +++ b/TR5SaveGame.cpp @@ -24,7 +24,8 @@ extern CTRXCHEATWINApp theApp; ///////////////////////////////////////////////////////////////////////////// static TR45_INDICATORS IndicatorsTR5Table [ MAX_INDICATORS ] = { - { FALSE, 0x02, 0x02, 0x00, 0x67, FALSE }, + { FALSE, 0x02, 0x02, 0x00, 0x67, TRUE }, + { FALSE, 0x02, 0x02, 0x47, 0x67, TRUE }, { FALSE, 0x02, 0x02, 0x00, 0x0b, FALSE }, { FALSE, 0x02, 0x02, 0x00, 0x1f, FALSE }, { FALSE, 0x0d, 0x0d, 0x00, 0x6c, FALSE }, @@ -36,7 +37,17 @@ static TR45_INDICATORS IndicatorsTR5Table [ MAX_INDICATORS ] = { FALSE, 0x47, 0x57, 0x00, 0xde, FALSE }, // Crawling { FALSE, 0x02, 0x02, 0x00, 0x0b, FALSE }, // Jumping { FALSE, 0x09, 0x09, 0x00, 0x17, FALSE }, // Falling - { FALSE, 0x01, 0x02, 0x00, 0x0a, FALSE }, // Running + { FALSE, 0x01, 0x02, 0x00, 0x0a, TRUE }, // Running +#ifdef _DEBUG + { FALSE, 0x27, 0x10, 0x47, 0xa9, TRUE }, + { FALSE, 0x59, 0x16, 0x00, 0xd2, TRUE }, + { FALSE, 0x03, 0x00, 0x01, 0x02, TRUE }, + { FALSE, 0x59, 0x10, 0x47, 0xd8, TRUE }, + { FALSE, 0x59, 0x15, 0x47, 0xd1, TRUE }, + { FALSE, 0x27, 0x10, 0x47, 0x87, TRUE }, + { FALSE, 0x28, 0x0b, 0x47, 0x9e, TRUE }, + { FALSE, 0x59, 0x10, 0x47, 0xd2, TRUE }, +#endif { TRUE, 0xff, 0xff, 0xff, 0xff, TRUE }, // End @@ -1598,6 +1609,12 @@ void *CTR5SaveGame::GetIndicatorAddress (int index) continue; } + short life = * ( short * ) ( pBuffer + i + TR5_LIFE_OFFSET ); + if ( life < 0 || life > 1000 ) + { + continue; + } + count++; if ( count > index ) { @@ -1780,6 +1797,10 @@ TR5_POSITION *CTR5SaveGame::GetTR5Position ( ) ZeroMemory ( positionTable, sizeof(positionTable) ); positionCount = 0; +#ifdef _DEBUG + OutputDebugString ( "\n" ); +#endif + // We Search n times // The Goal is to see if there is a =atch with position for an index // For example we could have an indicator but no position @@ -1832,12 +1853,15 @@ TR5_POSITION *CTR5SaveGame::GetTR5Position ( ) if ( bCheck ) { #ifdef _DEBUG + short life = * ( short * ) ( pBuffer + TR5_LIFE_OFFSET ); + DWORD dwRelativeAddress = CTRXTools::RelativeAddress ( pBuffer + i, m_pBuffer ); static char szDebugString [ MAX_PATH ]; - sprintf_s ( szDebugString, sizeof(szDebugString), "Indicators 0x%08x : 0x%02x 0x%02x 0x%02x 0x%02x %3u %5d %5d %5d %3u\n", + sprintf_s ( szDebugString, sizeof(szDebugString), "Indicators 0x%08x : 0x%02x 0x%02x 0x%02x 0x%02x %3u %5d %5d %5d %3u %4d\n", dwRelativeAddress, pTR5Position->indicator1, pTR5Position->indicator2, pTR5Position->indicator3, pTR5Position->indicator4, - pTR5Position->cRoom, pTR5Position->wVertical, pTR5Position->wSouthToNorth, pTR5Position->wWestToEast, pTR5Position->cOrientation ); + pTR5Position->cRoom, pTR5Position->wVertical, pTR5Position->wSouthToNorth, pTR5Position->wWestToEast, pTR5Position->cOrientation, + life ); OutputDebugString ( szDebugString ); #endif positionTable [ 0 ] = pTR5Position; @@ -1893,21 +1917,27 @@ TR5_POSITION *CTR5SaveGame::GetTR5Position ( ) BOOL bCheck = CheckAreaForCoordinates ( GetFullVersion(), GetLevelIndex(), wRoom, dwWestToEast, dwVertical, dwSouthToNorth, true ); if ( bCheck ) { + short life = * ( short * ) ( pBuffer + i + TR5_LIFE_OFFSET ); + positionTable [ positionCount ] = pCurrent; - if ( pTR5Position == NULL ) + if ( life >= 0 && life <= 1000 ) { - pTR5Position = pCurrent; - } + if ( pTR5Position == NULL ) + { + pTR5Position = pCurrent; + } - positionCount++; + positionCount++; + } #ifdef _DEBUG DWORD dwRelativeAddress = CTRXTools::RelativeAddress ( pBuffer + i, m_pBuffer ); static char szDebugString [ MAX_PATH ]; - sprintf_s ( szDebugString, sizeof(szDebugString), "Indicators 0x%08x : 0x%02x 0x%02x 0x%02x 0x%02x %3u %5d %5d %5d %3u\n", + sprintf_s ( szDebugString, sizeof(szDebugString), "indicators 0x%08x : 0x%02x 0x%02x 0x%02x 0x%02x %3u %5d %5d %5d %3u %4d\n", dwRelativeAddress, pCurrent->indicator1, pCurrent->indicator2, pCurrent->indicator3, pCurrent->indicator4, - pCurrent->cRoom, pCurrent->wVertical, pCurrent->wSouthToNorth, pCurrent->wWestToEast, pCurrent->cOrientation ); + pCurrent->cRoom, pCurrent->wVertical, pCurrent->wSouthToNorth, pCurrent->wWestToEast, pCurrent->cOrientation, + life ); OutputDebugString ( szDebugString ); if ( CTRXGlobal::m_iUnchecked == FALSE ) diff --git a/TRCheatWin.rc b/TRCheatWin.rc index 2bba55e..79412c7 100644 --- a/TRCheatWin.rc +++ b/TRCheatWin.rc @@ -703,8 +703,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,2,06,012 - PRODUCTVERSION 4,2,06,012 + FILEVERSION 4,2,07,003 + PRODUCTVERSION 4,2,07,003 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x29L @@ -722,15 +722,15 @@ BEGIN VALUE "Comments", "mailto:ian.macallan@gmail.com\0" VALUE "CompanyName", "Macallan (c)\0" VALUE "FileDescription", "TRCheatWin - (MSVC)\0" - VALUE "FileVersion", "4.2.06.012\0" + VALUE "FileVersion", "4.2.07.003\0" VALUE "InternalName", "https://www.macallan.org/\0" - VALUE "LegalCopyright", "Copyright (C) Thu Jul 11 11:23, 2024\0" + VALUE "LegalCopyright", "Copyright (C) Thu Jul 11 16:02, 2024\0" VALUE "LegalTrademarks", "Author: Ian Macallan\0" VALUE "OriginalFilename", ORIGINAL_FILENAME - VALUE "PrivateBuild", "900\0" + VALUE "PrivateBuild", "903\0" VALUE "ProductName", PRODUCT_NAME - VALUE "ProductVersion", "4.2.06.012\0" - VALUE "SpecialBuild", "900\0" + VALUE "ProductVersion", "4.2.07.003\0" + VALUE "SpecialBuild", "903\0" END END BLOCK "VarFileInfo" diff --git a/TRXInfoPage.cpp b/TRXInfoPage.cpp index 976b34c..0940128 100644 --- a/TRXInfoPage.cpp +++ b/TRXInfoPage.cpp @@ -216,8 +216,17 @@ static void AddToItemsLabels ( int what, int level, int button, const char *pTex ///////////////////////////////////////////////////////////////////////////// // ///////////////////////////////////////////////////////////////////////////// -int SearchDataFileIndex ( const char *pSavename ) +int SearchDataFileIndex ( const char *pSavename, int levelNumber ) { + if ( levelNumber >= 0 && levelNumber < TR4NGMAXLEVEL ) + { + if ( _strcmpi ( pSavename, CustomDataFiles [ levelNumber ].title ) == 0 ) + { + return levelNumber; + } + } + + // for ( int i = 0; i < TR4NGMAXLEVEL; i++ ) { if ( _strcmpi ( pSavename, CustomDataFiles [ i ].title ) == 0 ) @@ -2976,7 +2985,7 @@ BOOL CTRXInfoPage::ExtractAfterScript ( int tombraider, TR_MODE trMode, STRUCTLO // Search The CustomDataFiles the best match for the Savegame name // This will give a DATA/level - int datafileIndex = SearchDataFileIndex ( CTRSaveGame::I()->GetSaveName() ); + int datafileIndex = SearchDataFileIndex ( CTRSaveGame::I()->GetSaveName(), CTRSaveGame::I()->GetLevel() ); if ( datafileIndex >= 0 ) { strcpy_s ( szTRPathname, sizeof(szTRPathname), pScriptDirectory ); diff --git a/TRXPropertyPage.cpp b/TRXPropertyPage.cpp index 974ecfc..732bd5c 100644 --- a/TRXPropertyPage.cpp +++ b/TRXPropertyPage.cpp @@ -297,6 +297,7 @@ void CTRXPropertyPage::SetGUIModified( BOOL bChanged, const char *pWhere ) return; } +#if 0 #ifdef _DEBUG if (bChanged ) { @@ -308,6 +309,7 @@ void CTRXPropertyPage::SetGUIModified( BOOL bChanged, const char *pWhere ) OutputDebugString ( pWhere ); OutputDebugString ( " - SetGUIModified Changed to FALSE\n" ); } +#endif #endif m_bModified = bChanged;