From 01684d76355fe28ccf33c7e1b77582d595d262a9 Mon Sep 17 00:00:00 2001 From: MiranDMC Date: Sun, 17 Sep 2023 01:05:27 +0200 Subject: [PATCH] Added opcode 0DD5 (get_platform). (#28) --- Changelog.md | 1 + Readme_III.md | 2 +- Readme_VC.md | 2 +- source/III.VC.CLEO/CustomOpcodes.cpp | 10 ++++++++++ source/III.VC.CLEO/CustomOpcodes.h | 1 + source/III.VC.CLEO/Game.h | 15 +++++++++++++++ 6 files changed, 29 insertions(+), 2 deletions(-) diff --git a/Changelog.md b/Changelog.md index 18ecbb5..2de7546 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,5 +1,6 @@ ## 2.1.0 +- Added opcode 0DD5 (get_platform). - Partially fixed 0ADD (spawn car like a cheat) for GTA3. Now opcode can spawn not only the tank. Still no support for models with id greater than 127. - Fixed 0ADB to return GXT label instead of car name (same as in Cleo SA). - Crash fix in 0AF4 read_string_from_ini_file. Fixed some internal data-type sizes. diff --git a/Readme_III.md b/Readme_III.md index 61f31d6..ffc6837 100644 --- a/Readme_III.md +++ b/Readme_III.md @@ -1,4 +1,4 @@ -# CLEO Library for GTA III +# CLEO Library for GTA III (Windows PC) CLEO is a hugely popular extensible library plugin which brings new possibilities in scripting for the game Grand Theft Auto: III by Rockstar Games, allowing the use of thousands of unique mods which change or expand the gameplay. You may find more information about CLEO on the official website https://cleo.li diff --git a/Readme_VC.md b/Readme_VC.md index 64feda0..8a30752 100644 --- a/Readme_VC.md +++ b/Readme_VC.md @@ -1,4 +1,4 @@ -# CLEO Library for GTA Vice City +# CLEO Library for GTA Vice City (Windows PC) CLEO is a hugely popular extensible library plugin which brings new possibilities in scripting for the game Grand Theft Auto: Vice City by Rockstar Games, allowing the use of thousands of unique mods which change or expand the gameplay. You may find more information about CLEO on the official website https://cleo.li diff --git a/source/III.VC.CLEO/CustomOpcodes.cpp b/source/III.VC.CLEO/CustomOpcodes.cpp index 06db2e2..3be265f 100644 --- a/source/III.VC.CLEO/CustomOpcodes.cpp +++ b/source/III.VC.CLEO/CustomOpcodes.cpp @@ -216,6 +216,8 @@ void CustomOpcodes::Register() Opcodes::RegisterOpcode(0x0485, IS_PC_VERSION); Opcodes::RegisterOpcode(0x059A, IS_AUSTRALIAN_GAME); #endif + + Opcodes::RegisterOpcode(0x0DD5, GET_PLATFORM); } eOpcodeResult CustomOpcodes::DUMMY(CScript *script) @@ -2180,6 +2182,14 @@ eOpcodeResult CustomOpcodes::OPCODE_0AE0(CScript *script) return OR_CONTINUE; } +//0DD5=1,%1d% = get_platform +eOpcodeResult __stdcall CustomOpcodes::GET_PLATFORM(CScript* script) +{ + game.Scripts.Params[0].nVar = PLATFORM_WINDOWS; + script->Store(1); + return OR_CONTINUE; +} + //0AE1=7,%7d% = random_actor_near_point %1d% %2d% %3d% in_radius %4d% find_next %5h% pass_deads %6h% //IF and SET //dup //0AE2=7,%7d% = random_vehicle_near_point %1d% %2d% %3d% in_radius %4d% find_next %5h% pass_wrecked %6h% //IF and SET //dup //0AE3=6,%6d% = random_object_near_point %1d% %2d% %3d% in_radius %4d% find_next %5h% //IF and SET //dup diff --git a/source/III.VC.CLEO/CustomOpcodes.h b/source/III.VC.CLEO/CustomOpcodes.h index aaee2b6..ae2dd0d 100644 --- a/source/III.VC.CLEO/CustomOpcodes.h +++ b/source/III.VC.CLEO/CustomOpcodes.h @@ -113,6 +113,7 @@ class CustomOpcodes static eOpcodeResult WINAPI OPCODE_0ADE(CScript *script); static eOpcodeResult WINAPI OPCODE_0ADF(CScript *script); static eOpcodeResult WINAPI OPCODE_0AE0(CScript *script); + static eOpcodeResult WINAPI GET_PLATFORM(CScript* script); public: static void Register(); static tScriptVar SHARED_VAR[0xFFFF]; diff --git a/source/III.VC.CLEO/Game.h b/source/III.VC.CLEO/Game.h index 9190483..6a6797a 100644 --- a/source/III.VC.CLEO/Game.h +++ b/source/III.VC.CLEO/Game.h @@ -13,6 +13,21 @@ enum eGameVersion GAME_VSTEAMENC }; +// returned by 0DD5: get_platform opcode +enum ePlatform +{ + PLATFORM_NONE, + PLATFORM_ANDROID, + PLATFORM_PSP, + PLATFORM_IOS, + PLATFORM_FOS, + PLATFORM_XBOX, + PLATFORM_PS2, + PLATFORM_PS3, + PLATFORM_MAC, + PLATFORM_WINDOWS +}; + enum OldVirtualKeys { OVK_F1 = 1001,