Skip to content

Commit

Permalink
Added opcode 0DD5 (get_platform). (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
MiranDMC authored Sep 16, 2023
1 parent d8ebf62 commit 01684d7
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 2 deletions.
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 1 addition & 1 deletion Readme_III.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion Readme_VC.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
10 changes: 10 additions & 0 deletions source/III.VC.CLEO/CustomOpcodes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions source/III.VC.CLEO/CustomOpcodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
15 changes: 15 additions & 0 deletions source/III.VC.CLEO/Game.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 01684d7

Please sign in to comment.