From 04c9f1b6ebdb64329e08231b6cf760aee15a31e9 Mon Sep 17 00:00:00 2001 From: Seemann Date: Sat, 22 Apr 2017 14:52:20 +0300 Subject: [PATCH] update to v4.3.22 --- CHANGELOG.md | 79 +++++++++++ CLEO4.sln | 5 +- CCodeInjector.cpp => CLEO4/CCodeInjector.cpp | 0 CCodeInjector.h => CLEO4/CCodeInjector.h | 0 .../CCustomOpcodeSystem.cpp | 30 ++-- .../CCustomOpcodeSystem.h | 2 +- CDebug.cpp => CLEO4/CDebug.cpp | 0 CDebug.h => CLEO4/CDebug.h | 0 CDmaFix.cpp => CLEO4/CDmaFix.cpp | 0 CDmaFix.h => CLEO4/CDmaFix.h | 0 CGameMenu.cpp => CLEO4/CGameMenu.cpp | 0 CGameMenu.h => CLEO4/CGameMenu.h | 0 .../CGameVersionManager.cpp | 0 .../CGameVersionManager.h | 0 CLEO4/CLEO.APS | Bin 0 -> 34652 bytes CLEO.rc => CLEO4/CLEO.rc | Bin 4556 -> 4556 bytes CLEO4.vcxproj => CLEO4/CLEO4.vcxproj | 35 ++--- CLEO4/CLEO4.vcxproj.filters | 131 ++++++++++++++++++ CLegacy.cpp => CLEO4/CLegacy.cpp | 0 CLegacy.h => CLEO4/CLegacy.h | 0 CPluginSystem.h => CLEO4/CPluginSystem.h | 0 CScriptEngine.cpp => CLEO4/CScriptEngine.cpp | 22 +-- CScriptEngine.h => CLEO4/CScriptEngine.h | 3 +- CSoundSystem.cpp => CLEO4/CSoundSystem.cpp | 0 CSoundSystem.h => CLEO4/CSoundSystem.h | 0 CTextManager.cpp => CLEO4/CTextManager.cpp | 0 CTextManager.h => CLEO4/CTextManager.h | 0 FileEnumerator.h => CLEO4/FileEnumerator.h | 0 Mem.h => CLEO4/Mem.h | 0 {bass => CLEO4/bass}/bass.h | 29 +++- {bass => CLEO4/bass}/bass.lib | Bin cleo.cpp => CLEO4/cleo.cpp | 0 cleo.def => CLEO4/cleo.def | 11 +- cleo.h => CLEO4/cleo.h | 3 + crc32.cpp => CLEO4/crc32.cpp | 0 crc32.h => CLEO4/crc32.h | 0 dllmain.cpp => CLEO4/dllmain.cpp | 0 resource.h => CLEO4/resource.h | 0 stdafx.cpp => CLEO4/stdafx.cpp | 0 stdafx.h => CLEO4/stdafx.h | 2 +- 40 files changed, 297 insertions(+), 55 deletions(-) create mode 100644 CHANGELOG.md rename CCodeInjector.cpp => CLEO4/CCodeInjector.cpp (100%) rename CCodeInjector.h => CLEO4/CCodeInjector.h (100%) rename CCustomOpcodeSystem.cpp => CLEO4/CCustomOpcodeSystem.cpp (99%) rename CCustomOpcodeSystem.h => CLEO4/CCustomOpcodeSystem.h (100%) rename CDebug.cpp => CLEO4/CDebug.cpp (100%) rename CDebug.h => CLEO4/CDebug.h (100%) rename CDmaFix.cpp => CLEO4/CDmaFix.cpp (100%) rename CDmaFix.h => CLEO4/CDmaFix.h (100%) rename CGameMenu.cpp => CLEO4/CGameMenu.cpp (100%) rename CGameMenu.h => CLEO4/CGameMenu.h (100%) rename CGameVersionManager.cpp => CLEO4/CGameVersionManager.cpp (100%) rename CGameVersionManager.h => CLEO4/CGameVersionManager.h (100%) create mode 100644 CLEO4/CLEO.APS rename CLEO.rc => CLEO4/CLEO.rc (98%) rename CLEO4.vcxproj => CLEO4/CLEO4.vcxproj (90%) create mode 100644 CLEO4/CLEO4.vcxproj.filters rename CLegacy.cpp => CLEO4/CLegacy.cpp (100%) rename CLegacy.h => CLEO4/CLegacy.h (100%) rename CPluginSystem.h => CLEO4/CPluginSystem.h (100%) rename CScriptEngine.cpp => CLEO4/CScriptEngine.cpp (96%) rename CScriptEngine.h => CLEO4/CScriptEngine.h (98%) rename CSoundSystem.cpp => CLEO4/CSoundSystem.cpp (100%) rename CSoundSystem.h => CLEO4/CSoundSystem.h (100%) rename CTextManager.cpp => CLEO4/CTextManager.cpp (100%) rename CTextManager.h => CLEO4/CTextManager.h (100%) rename FileEnumerator.h => CLEO4/FileEnumerator.h (100%) rename Mem.h => CLEO4/Mem.h (100%) rename {bass => CLEO4/bass}/bass.h (97%) rename {bass => CLEO4/bass}/bass.lib (100%) rename cleo.cpp => CLEO4/cleo.cpp (100%) rename cleo.def => CLEO4/cleo.def (69%) rename cleo.h => CLEO4/cleo.h (92%) rename crc32.cpp => CLEO4/crc32.cpp (100%) rename crc32.h => CLEO4/crc32.h (100%) rename dllmain.cpp => CLEO4/dllmain.cpp (100%) rename resource.h => CLEO4/resource.h (100%) rename stdafx.cpp => CLEO4/stdafx.cpp (100%) rename stdafx.h => CLEO4/stdafx.h (96%) diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..ad3d8648 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,79 @@ +CLEO 4 Change Log + +4.3.22 +* Now creates cleo, cleo/cleo_saves and cleo/cleo_text folders on startup if they do not exist +* Fix to issue with 0AE9 not returning result + +4.3.21 +* Fix to issue with 0AB1 in missions not storing mission locals + +4.3.20 +* Fixed issue with 0AB1 passing incorrect variable scope in missions +* Updated SDK version + +4.3.17 +* Fixed potential future problem with 0AB0 which used methods with undefined behaviour +* Fixed incorrect method used for 0AB7 + +4.3.16 +* Fixed bugs with CLEO saves when saved scripts ended +* Prevented crashing when invalid audiostream handles are used + +4.3.15 +* Improvemed compatibility fix for opcodes 0AE1, 0AE2 and 0AE3 with incorrect find_next usage + +4.3.14 +* Fixed 0AAA only returning custom scripts +* Fixed many things which use the 'SCM Block' or 'Mission Local Storage' space +* Fixed parameters being passed to script local storage instead of mission local storage through 0A94 +* Fixed potential problems with iteration through the script queues (may cause rare and hard to trace bugs) + +4.3.13 +* Fixed crashing when starting a new game after a game has already started with CLEO scripts installed +* Possibly fixed other issues with starting a game with CLEO scripts installed + +4.3.12 +* Fixed string parameter skipping in 'SkipOpcodeParams' used by CLEO plugins +* 0AC8 now returns a NULL value to the output var if allocation failed (as it did before 4.3a) +* 0AC9 now checks the memory was allocated by 0AC8 before attempting to free it +* FXT references are now case insensitive (as they were before 4.3a) +* File operations now check the input handle isn't null (as it seems was the way before 4.3a) +* 'Loaded mission' status now reset on new/loaded game (as it was before 4.3a) +* Scripts no longer load prematurely (like before 4.3a) +* Resolved conflicts with other menu hooks such as 'HUME' +* Other minor tweaks + +4.3.11 +* Fixed crash with 0ADA in scripts beginning with an opcode ending in '00' + +4.3.10 +* Improvements to opcodes 0AE1, 0AE2 and 0AE3 - now loops around the pool even when the 'find_next' flag isn't used correctly +* Fixed 0AD2 not returning peds targetted with the mouse, while targetting with a pad worked + +4.3.09 +* Will now be able to start a CLEO mission after recently finishing a standard mission +* Will no longer error & terminate when scripts fail to open and instead simply log the error +* Will no longer terminate on warnings +* No longer includes paths in automatically generated script names (e.g. cleo\dir\demo.cs is now named 'demo.cs' and not 'dir\dem') +* Improved handling of script load errors + +4.3b +========= +* Added support for steam (gta_sa.exe v3) executables +* Added 'legacy' script modes. Scripts with the extension .cs3 will be treated as CLEO 3 scripts and opened in legacy mode. +0A99 CHANGE_DIRECTORY can now correctly change to the program directory +0A9A OPEN_FILE now uses legacy mode when using an integer mode parameter for compatibility of CLEO file handles and SA file handles + Note that you should really not pass CLEO file handles to game functions. However, this legacy mode now ensures that the handles are compatible. + Other file functions have also been updated ensuring that game file handles are passed to relevant game functions. + It is recommended to not rely on passing files to game functions and instead use CLEO's in-built file functions in future. +0AD1 CALL now accepts string input, which is passed as a string pointer following string convention + CALL now does not initialise local storage to 0 when in CLEO 3 legacy mode +0AD4 SCAN_STRING now returns a condition result +0AE6 FIND_FIRST_FILE now accepts string array output +0AE3 FIND_ALL_RANDOM_OBJECTS_IN_SPHERE now ensures no fading objects are returned and returns -1 instead of 0 on failure +0AE2 FIND_ALL_RANDOM_CARS_IN_SPHERE now ensures no script vehicles or fading vehicle are returned and returns -1 instead of 0 on failure +0AE1 FIND_ALL_RANDOM_CHARS_IN_SPHERE now ensures no script characters or fading characters are returned and returns -1 instead of 0 on failure +0ADF ADD_TEXT_LABEL now updates existing text labels if they already exist +0AD6 IS_END_OF_FILE_REACHED now returns true if a file error occured +0AD2 GET_CHAR_PLAYER_IS_TARGETING now returns -1 instead of 0 when no target is found +0AB5 STORE_CLOSEST_ENTITIES now ensures no script entities or fading entities are returned and ensures the player ped is not returned \ No newline at end of file diff --git a/CLEO4.sln b/CLEO4.sln index fff87803..b3fdf2cd 100644 --- a/CLEO4.sln +++ b/CLEO4.sln @@ -1,7 +1,10 @@  Microsoft Visual Studio Solution File, Format Version 11.00 # Visual Studio 2010 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CLEO", "CLEO4.vcxproj", "{8091E84C-E97A-4BC0-AC4C-9FFF6B8EB6D7}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CLEO", "CLEO4\CLEO4.vcxproj", "{8091E84C-E97A-4BC0-AC4C-9FFF6B8EB6D7}" + ProjectSection(ProjectDependencies) = postProject + {32FCF424-D919-4F50-A4FC-177CF89B4A6D} = {32FCF424-D919-4F50-A4FC-177CF89B4A6D} + EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GTASA", "..\GTASA\GTASA.vcxproj", "{32FCF424-D919-4F50-A4FC-177CF89B4A6D}" EndProject diff --git a/CCodeInjector.cpp b/CLEO4/CCodeInjector.cpp similarity index 100% rename from CCodeInjector.cpp rename to CLEO4/CCodeInjector.cpp diff --git a/CCodeInjector.h b/CLEO4/CCodeInjector.h similarity index 100% rename from CCodeInjector.h rename to CLEO4/CCodeInjector.h diff --git a/CCustomOpcodeSystem.cpp b/CLEO4/CCustomOpcodeSystem.cpp similarity index 99% rename from CCustomOpcodeSystem.cpp rename to CLEO4/CCustomOpcodeSystem.cpp index 376fe568..e89abd53 100644 --- a/CCustomOpcodeSystem.cpp +++ b/CLEO4/CCustomOpcodeSystem.cpp @@ -811,12 +811,13 @@ namespace CLEO prevScmFunctionId(reinterpret_cast(thread)->GetScmFunction()), retnAddress(thread->GetBytePointer()) { auto cs = reinterpret_cast(thread); - std::copy(cs->LocalVar, cs->LocalVar + 32, savedTls); + auto scope = cs->IsMission() ? missionLocals : cs->LocalVar; + std::copy(scope, scope + 32, savedTls); SCRIPT_VAR fill_val; fill_val.dwParam = 0; // CLEO 3 didnt initialise local storage, so dont do it if we're processing a CLEO 3 script in case the storage is used if(cs->IsCustom() && cs->GetCompatibility() >= CLEO_VER_4_MIN) - std::fill(cs->LocalVar, cs->LocalVar + 32, fill_val); // fill with zeros + std::fill(scope, scope + 32, fill_val); // fill with zeros cs->SetScmFunction(thisScmFunctionId = allocationPlace); } @@ -824,7 +825,7 @@ namespace CLEO void Return(CRunningScript *thread) { auto cs = reinterpret_cast(thread); - std::copy(savedTls, savedTls + 32, cs->LocalVar); + std::copy(savedTls, savedTls + 32, cs->IsMission() ? missionLocals : cs->LocalVar); cs->SetIp(retnAddress); cs->SetScmFunction(prevScmFunctionId); } @@ -1548,20 +1549,20 @@ namespace CLEO DWORD key; *thread >> key; SHORT state = GetKeyState(key); - SetScriptCondResult(thread, GetKeyState(key) & 0x8000); + SetScriptCondResult(thread, (GetKeyState(key) & 0x8000) != 0); return OR_CONTINUE; } //0AB1=-1,call_scm_func %1p% OpcodeResult __stdcall opcode_0AB1(CRunningScript *thread) { - DWORD label, - nParams; + int label; + DWORD nParams; *thread >> label >> nParams; static SCRIPT_VAR arguments[64]; - SCRIPT_VAR * arguments_end = arguments + nParams; + SCRIPT_VAR* arguments_end = &arguments[nParams]; if(nParams) { @@ -1597,7 +1598,8 @@ namespace CLEO new ScmFunction(thread); // pass arguments - if(nParams) std::copy(arguments, arguments_end, thread->IsMission() ? missionLocals : thread->GetVarPtr()); + if(nParams) + std::copy(arguments, arguments_end, thread->IsMission() ? missionLocals : thread->GetVarPtr()); // jump to label ThreadJump(thread, label); @@ -1698,7 +1700,7 @@ namespace CLEO { DWORD hVehicle; *thread >> hVehicle; - auto id = reinterpret_cast(Models[GetVehiclePool().GetAt(hVehicle)->GetModelIndex() - 400])->vehicleHandlingID; + auto id = reinterpret_cast(Models[GetVehiclePool().GetAt(hVehicle)->GetModelIndex()])->vehicleHandlingID; *thread << Handling->Automobile[id].m_Transmission.ucNumberOfGears; return OR_CONTINUE; } @@ -2446,7 +2448,9 @@ namespace CLEO //0AE9=0,pop_float OpcodeResult __stdcall opcode_0AE9(CRunningScript *thread) { - _asm fstp opcodeParams[0].fParam + float result; + _asm fstp result + opcodeParams[0].fParam = result; SetScriptParams(thread, 1); return OR_CONTINUE; } @@ -2486,8 +2490,10 @@ namespace CLEO char *format, *result; *thread >> val; format = readString(thread); - if (*thread->GetBytePointer() >= 1 && *thread->GetBytePointer() <= 8) *thread >> result; - else result = &GetScriptParamPointer(thread)->cParam; + if (*thread->GetBytePointer() >= 1 && *thread->GetBytePointer() <= 8) + *thread >> result; + else + result = &GetScriptParamPointer(thread)->cParam; sprintf(result, format, val); return OR_CONTINUE; } diff --git a/CCustomOpcodeSystem.h b/CLEO4/CCustomOpcodeSystem.h similarity index 100% rename from CCustomOpcodeSystem.h rename to CLEO4/CCustomOpcodeSystem.h index 7dd18205..4480bca9 100644 --- a/CCustomOpcodeSystem.h +++ b/CLEO4/CCustomOpcodeSystem.h @@ -28,12 +28,12 @@ namespace CLEO friend OpcodeResult __stdcall opcode_0AE6(CRunningScript *pScript); friend OpcodeResult __stdcall opcode_0AE8(CRunningScript *pScript); + public: std::set m_hFiles; std::set m_hNativeLibs; std::set m_hFileSearches; std::set m_pAllocations; - public: void FinalizeScriptObjects() { // clean up after opcode_0A99 diff --git a/CDebug.cpp b/CLEO4/CDebug.cpp similarity index 100% rename from CDebug.cpp rename to CLEO4/CDebug.cpp diff --git a/CDebug.h b/CLEO4/CDebug.h similarity index 100% rename from CDebug.h rename to CLEO4/CDebug.h diff --git a/CDmaFix.cpp b/CLEO4/CDmaFix.cpp similarity index 100% rename from CDmaFix.cpp rename to CLEO4/CDmaFix.cpp diff --git a/CDmaFix.h b/CLEO4/CDmaFix.h similarity index 100% rename from CDmaFix.h rename to CLEO4/CDmaFix.h diff --git a/CGameMenu.cpp b/CLEO4/CGameMenu.cpp similarity index 100% rename from CGameMenu.cpp rename to CLEO4/CGameMenu.cpp diff --git a/CGameMenu.h b/CLEO4/CGameMenu.h similarity index 100% rename from CGameMenu.h rename to CLEO4/CGameMenu.h diff --git a/CGameVersionManager.cpp b/CLEO4/CGameVersionManager.cpp similarity index 100% rename from CGameVersionManager.cpp rename to CLEO4/CGameVersionManager.cpp diff --git a/CGameVersionManager.h b/CLEO4/CGameVersionManager.h similarity index 100% rename from CGameVersionManager.h rename to CLEO4/CGameVersionManager.h diff --git a/CLEO4/CLEO.APS b/CLEO4/CLEO.APS new file mode 100644 index 0000000000000000000000000000000000000000..d91a5bc0433e00725d20b7a5e951c72332d67a93 GIT binary patch literal 34652 zcmd6Qd6Z;XS?5>Xjdrt%=&+4Kb%WA{(8hZakr~mV@FL69FqGQRd>{A-H)!A50 zcNJ61u!tid&KdVz=ZrIsf+&ri>L2Ay!-6d>B0Fkm+w71cj@Bky|WiD-*M0J#ih%4o;`m&Z)AgGp(lbLtN! zvSqsCuIHjyszk?br01MHr+>SKj_obhd*ysFs;2AFbXZYF52s_JL4Uni7RyneZhlI3 zf=&=(p*F|XlVN{79F5CqF+oMjIo*^s8aL5n=vcouU#yGqXlJ?}m%}ABo(rTgrl)$) zvYG+O74o$nG9T^iaxAX+n7+=#dew4SO#pTj_%shJrUyWV3VFIgdewYT&TT=^!$`8{ zW4a^_6lF|(AF@Shpe$n=_+VX@1`0E#(nob+8Ys<}h6Y+z)p$9YEl^7IDS%xA495pO zE_(x|7}KZ@t%~J(vO*k%wSYat&!ss~NC(JCgY1q5C3Z2=L9YNXx#2PGm*WHW&$|j6SOkX zit*SKeuzI~OeJ~%Pb)Qqb%jmEP8&=OYgr>#G&9~z*}mRH;2|dYbqg4}ZGvwwd_C@D z3>BiQA%^q`TALVVFv=)8$cuw~PtZ5=XN?gu81;)~HD6;&LM_YfMuYAOpg!g-jb-%A z0GqD(J4CdcFu!>zF8XtBRA5ay8(`HQ4;DZzx;ud8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--git a/CLEO.rc b/CLEO4/CLEO.rc similarity index 98% rename from CLEO.rc rename to CLEO4/CLEO.rc index 13fb89650aad4b4d98ad22231f4b5530b35e0210..689c8d9128d6f19a7ddc045d0cb9596ae37f73c7 100644 GIT binary patch delta 33 ocmX@3d`5Z06b@!12BXc>Io>j{0~ri@3j{0~ri@3 - + CRTDebug @@ -25,21 +25,18 @@ DynamicLibrary true MultiByte - v100 DynamicLibrary false true MultiByte - v100 DynamicLibrary false false MultiByte - v120 @@ -55,30 +52,20 @@ - false + true .asi - AllRules.ruleset - - .asi - AllRules.ruleset - - - false true .asi - AllRules.ruleset - - Use - TurnOffAllWarnings + Level3 Disabled _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_WINDOWS;_USRDLL;CLEO4_EXPORTS;%(PreprocessorDefinitions) ..\..\GTASA;..\..\GTASA\rwsdk;%(AdditionalIncludeDirectories) @@ -104,7 +91,7 @@ COPY "$(TargetPath)" "$(LocalDebuggerWorkingDirectory)\$(ProjectName).pdb" /Ytrue _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_WINDOWS;_USRDLL;CLEO4_EXPORTS;%(PreprocessorDefinitions) MultiThreaded - ..\GTASA;..\GTASA\rwsdk;%(AdditionalIncludeDirectories) + ..\..\GTASA;..\..\GTASA\rwsdk;%(AdditionalIncludeDirectories) Speed true @@ -116,7 +103,6 @@ COPY "$(TargetPath)" "$(LocalDebuggerWorkingDirectory)\$(ProjectName).pdb" /Ycleo.def 4.3 false - false COPY "$(TargetPath)" "$(LocalDebuggerWorkingDirectory)\$(TargetFileName)" /Y @@ -200,17 +186,20 @@ COPY "$(TargetPath)" "$(LocalDebuggerWorkingDirectory)\$(ProjectName).pdb" /YCreate + + + {32fcf424-d919-4f50-a4fc-177cf89b4a6d} + + - - + - - {32fcf424-d919-4f50-a4fc-177cf89b4a6d} - + + diff --git a/CLEO4/CLEO4.vcxproj.filters b/CLEO4/CLEO4.vcxproj.filters new file mode 100644 index 00000000..f03ea526 --- /dev/null +++ b/CLEO4/CLEO4.vcxproj.filters @@ -0,0 +1,131 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + + + + Resource Files + + + + + Resource Files + + + + \ No newline at end of file diff --git a/CLegacy.cpp b/CLEO4/CLegacy.cpp similarity index 100% rename from CLegacy.cpp rename to CLEO4/CLegacy.cpp diff --git a/CLegacy.h b/CLEO4/CLegacy.h similarity index 100% rename from CLegacy.h rename to CLEO4/CLegacy.h diff --git a/CPluginSystem.h b/CLEO4/CPluginSystem.h similarity index 100% rename from CPluginSystem.h rename to CLEO4/CPluginSystem.h diff --git a/CScriptEngine.cpp b/CLEO4/CScriptEngine.cpp similarity index 96% rename from CScriptEngine.cpp rename to CLEO4/CScriptEngine.cpp index 73edb9de..70874030 100644 --- a/CScriptEngine.cpp +++ b/CLEO4/CScriptEngine.cpp @@ -118,7 +118,7 @@ namespace CLEO call FUNC_GetScriptParamPointer1 mov result, eax } - return result; + return (SCRIPT_VAR*)((size_t)result + pScript->GetBasePointer()); } void __fastcall _GetScriptStringParam(CRunningScript *pScript, int dummy, char *buf, int len) @@ -602,24 +602,24 @@ namespace CLEO FUNC_RemoveScriptFromQueue = gvm.TranslateMemoryAddress(MA_REMOVE_SCRIPT_FROM_QUEUE_FUNCTION); FUNC_StopScript = gvm.TranslateMemoryAddress(MA_STOP_SCRIPT_FUNCTION); FUNC_ScriptOpcodeHandler00 = gvm.TranslateMemoryAddress(MA_SCRIPT_OPCODE_HANDLER0_FUNCTION); - FUNC_GetScriptParams = gvm.TranslateMemoryAddress(MA_GET_SCRIPT_PARAMS_FUNCTION); + FUNC_GetScriptParams = gvm.TranslateMemoryAddress(MA_GET_SCRIPT_PARAMS_FUNCTION); FUNC_TransmitScriptParams = gvm.TranslateMemoryAddress(MA_TRANSMIT_SCRIPT_PARAMS_FUNCTION); - FUNC_SetScriptParams = gvm.TranslateMemoryAddress(MA_SET_SCRIPT_PARAMS_FUNCTION); - FUNC_SetScriptCondResult = gvm.TranslateMemoryAddress(MA_SET_SCRIPT_COND_RESULT_FUNCTION); + FUNC_SetScriptParams = gvm.TranslateMemoryAddress(MA_SET_SCRIPT_PARAMS_FUNCTION); + FUNC_SetScriptCondResult = gvm.TranslateMemoryAddress(MA_SET_SCRIPT_COND_RESULT_FUNCTION); FUNC_GetScriptParamPointer1 = gvm.TranslateMemoryAddress(MA_GET_SCRIPT_PARAM_POINTER1_FUNCTION); FUNC_GetScriptStringParam = gvm.TranslateMemoryAddress(MA_GET_SCRIPT_STRING_PARAM_FUNCTION); FUNC_GetScriptParamPointer2 = gvm.TranslateMemoryAddress(MA_GET_SCRIPT_PARAM_POINTER2_FUNCTION); - AddScriptToQueue = reinterpret_cast(_AddScriptToQueue); + AddScriptToQueue = reinterpret_cast(_AddScriptToQueue); RemoveScriptFromQueue = reinterpret_cast(_RemoveScriptFromQueue); StopScript = reinterpret_cast(_StopScript); ScriptOpcodeHandler00 = reinterpret_cast(_ScriptOpcodeHandler00); GetScriptParams = reinterpret_cast(_GetScriptParams); - TransmitScriptParams = reinterpret_cast(_TransmitScriptParams); + TransmitScriptParams = reinterpret_cast(_TransmitScriptParams); SetScriptParams = reinterpret_cast(_SetScriptParams); SetScriptCondResult = reinterpret_cast(_SetScriptCondResult); GetScriptParamPointer1 = reinterpret_cast(_GetScriptParamPointer1); - GetScriptStringParam = reinterpret_cast(_GetScriptStringParam); + GetScriptStringParam = reinterpret_cast(_GetScriptStringParam); GetScriptParamPointer2 = reinterpret_cast(_GetScriptParamPointer2); InitScm = gvm.TranslateMemoryAddress(MA_INIT_SCM_FUNCTION); @@ -627,11 +627,11 @@ namespace CLEO LoadScmData = gvm.TranslateMemoryAddress(MA_LOAD_SCM_DATA_FUNCTION); GameTimer = gvm.TranslateMemoryAddress(MA_GAME_TIMER); - opcodeParams = gvm.TranslateMemoryAddress(MA_OPCODE_PARAMS); + opcodeParams = gvm.TranslateMemoryAddress(MA_OPCODE_PARAMS); missionLocals = gvm.TranslateMemoryAddress(MA_MISSION_LOCALS); - scmBlock = gvm.TranslateMemoryAddress(MA_SCM_BLOCK); + scmBlock = gvm.TranslateMemoryAddress(MA_SCM_BLOCK); MissionLoaded = gvm.TranslateMemoryAddress(MA_MISSION_LOADED); - missionBlock = gvm.TranslateMemoryAddress(MA_MISSION_BLOCK); + missionBlock = gvm.TranslateMemoryAddress(MA_MISSION_BLOCK); onMissionFlag = gvm.TranslateMemoryAddress(MA_ON_MISSION_FLAG); // Protect script dependencies @@ -811,6 +811,8 @@ namespace CLEO sprintf(safe_name, "./cleo/cleo_saves/cs%d.sav", nSlot); TRACE("Saving script engine state to the file %s", safe_name); + CreateDirectory("cleo", NULL); + CreateDirectory("cleo/cleo_saves", NULL); std::ofstream ss(safe_name, std::ios::binary); if(ss.is_open()) { diff --git a/CScriptEngine.h b/CLEO4/CScriptEngine.h similarity index 98% rename from CScriptEngine.h rename to CLEO4/CScriptEngine.h index e4242890..d9b0fe88 100644 --- a/CScriptEngine.h +++ b/CLEO4/CScriptEngine.h @@ -113,7 +113,8 @@ namespace CLEO inline SCRIPT_VAR * GetScriptParamPointer(CRunningScript *thread) { - return GetScriptParamPointer2(thread, 0); + SCRIPT_VAR* ptr = GetScriptParamPointer2(thread, 0); + return ptr; } extern "C" { diff --git a/CSoundSystem.cpp b/CLEO4/CSoundSystem.cpp similarity index 100% rename from CSoundSystem.cpp rename to CLEO4/CSoundSystem.cpp diff --git a/CSoundSystem.h b/CLEO4/CSoundSystem.h similarity index 100% rename from CSoundSystem.h rename to CLEO4/CSoundSystem.h diff --git a/CTextManager.cpp b/CLEO4/CTextManager.cpp similarity index 100% rename from CTextManager.cpp rename to CLEO4/CTextManager.cpp diff --git a/CTextManager.h b/CLEO4/CTextManager.h similarity index 100% rename from CTextManager.h rename to CLEO4/CTextManager.h diff --git a/FileEnumerator.h b/CLEO4/FileEnumerator.h similarity index 100% rename from FileEnumerator.h rename to CLEO4/FileEnumerator.h diff --git a/Mem.h b/CLEO4/Mem.h similarity index 100% rename from Mem.h rename to CLEO4/Mem.h diff --git a/bass/bass.h b/CLEO4/bass/bass.h similarity index 97% rename from bass/bass.h rename to CLEO4/bass/bass.h index 1aa97800..163664b1 100644 --- a/bass/bass.h +++ b/CLEO4/bass/bass.h @@ -82,7 +82,7 @@ typedef DWORD HPLUGIN; // Plugin handle #define BASS_ERROR_CREATE 33 // couldn't create the file #define BASS_ERROR_NOFX 34 // effects are not available #define BASS_ERROR_NOTAVAIL 37 // requested data is not available -#define BASS_ERROR_DECODE 38 // the channel is a "decoding channel" +#define BASS_ERROR_DECODE 38 // the channel is/isn't a "decoding channel" #define BASS_ERROR_DX 39 // a sufficient DirectX version is not installed #define BASS_ERROR_TIMEOUT 40 // connection timedout #define BASS_ERROR_FILEFORM 41 // unsupported file format @@ -958,6 +958,33 @@ BOOL BASSDEF(BASS_FXReset)(HFX handle); #ifdef __cplusplus } + +#ifdef _WIN32 +static inline HPLUGIN BASS_PluginLoad(const WCHAR *file, DWORD flags) +{ + return BASS_PluginLoad((const char*)file, flags|BASS_UNICODE); +} + +static inline HMUSIC BASS_MusicLoad(BOOL mem, const WCHAR *file, QWORD offset, DWORD length, DWORD flags, DWORD freq) +{ + return BASS_MusicLoad(mem, (const void*)file, offset, length, flags|BASS_UNICODE, freq); +} + +static inline HSAMPLE BASS_SampleLoad(BOOL mem, const WCHAR *file, QWORD offset, DWORD length, DWORD max, DWORD flags) +{ + return BASS_SampleLoad(mem, (const void*)file, offset, length, max, flags|BASS_UNICODE); +} + +static inline HSTREAM BASS_StreamCreateFile(BOOL mem, const WCHAR *file, QWORD offset, QWORD length, DWORD flags) +{ + return BASS_StreamCreateFile(mem, (const void*)file, offset, length, flags|BASS_UNICODE); +} + +static inline HSTREAM BASS_StreamCreateURL(const WCHAR *url, DWORD offset, DWORD flags, DOWNLOADPROC *proc, void *user) +{ + return BASS_StreamCreateURL((const char*)url, offset, flags|BASS_UNICODE, proc, user); +} +#endif #endif #endif diff --git a/bass/bass.lib b/CLEO4/bass/bass.lib similarity index 100% rename from bass/bass.lib rename to CLEO4/bass/bass.lib diff --git a/cleo.cpp b/CLEO4/cleo.cpp similarity index 100% rename from cleo.cpp rename to CLEO4/cleo.cpp diff --git a/cleo.def b/CLEO4/cleo.def similarity index 69% rename from cleo.def rename to CLEO4/cleo.def index 38f3d1a9..30c6be30 100644 --- a/cleo.def +++ b/CLEO4/cleo.def @@ -9,13 +9,14 @@ EXPORTS _CLEO_ReadStringOpcodeParam@12 @6 _CLEO_RecordOpcodeParams@8 @7 _CLEO_RegisterOpcode@8 @8 - _CLEO_RetrieveOpcodeParams@8 @9 + _CLEO_RetrieveOpcodeParams@8 @9 _CLEO_SetFloatOpcodeParam@8 @10 _CLEO_SetIntOpcodeParam@8 @11 _CLEO_SetThreadCondResult@8 @12 - _CLEO_SkipOpcodeParams@8 @13 - _CLEO_ThreadJumpAtLabelPtr@8 @14 + _CLEO_SkipOpcodeParams@8 @13 + _CLEO_ThreadJumpAtLabelPtr@8 @14 _CLEO_WriteStringOpcodeParam@8 @15 missionLocals @16 - opcodeParams @17 - staticThreads @18 \ No newline at end of file + opcodeParams @17 + staticThreads @18 + _CLEO_GetPointerToScriptVariable@4 @19 \ No newline at end of file diff --git a/cleo.h b/CLEO4/cleo.h similarity index 92% rename from cleo.h rename to CLEO4/cleo.h index 3723757d..18117a17 100644 --- a/cleo.h +++ b/CLEO4/cleo.h @@ -36,6 +36,9 @@ namespace CLEO void Start() { + CreateDirectory("cleo", NULL); + CreateDirectory("cleo/cleo_saves", NULL); + CreateDirectory("cleo/cleo_text", NULL); CodeInjector.OpenReadWriteAccess(); // must do this earlier to ensure plugins write access on init GameMenu.Inject(CodeInjector); DmaFix.Inject(CodeInjector); diff --git a/crc32.cpp b/CLEO4/crc32.cpp similarity index 100% rename from crc32.cpp rename to CLEO4/crc32.cpp diff --git a/crc32.h b/CLEO4/crc32.h similarity index 100% rename from crc32.h rename to CLEO4/crc32.h diff --git a/dllmain.cpp b/CLEO4/dllmain.cpp similarity index 100% rename from dllmain.cpp rename to CLEO4/dllmain.cpp diff --git a/resource.h b/CLEO4/resource.h similarity index 100% rename from resource.h rename to CLEO4/resource.h diff --git a/stdafx.cpp b/CLEO4/stdafx.cpp similarity index 100% rename from stdafx.cpp rename to CLEO4/stdafx.cpp diff --git a/stdafx.h b/CLEO4/stdafx.h similarity index 96% rename from stdafx.h rename to CLEO4/stdafx.h index 0e4e6e9a..03671e6b 100644 --- a/stdafx.h +++ b/CLEO4/stdafx.h @@ -29,7 +29,7 @@ enum CLEO_Version CLEO_VERSION = CLEO_VER_4, }; -#define VERSION_LONG 0x04030000 +#define VERSION_LONG 0x04031300 #define VERSION_STRING "4.3" #define OP_NOP 0x90