Skip to content

Commit

Permalink
Remove trailing spaces in _asm blocks and preprocessor definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
ccw808 committed Mar 13, 2018
1 parent 41ff5bd commit 9f16333
Show file tree
Hide file tree
Showing 62 changed files with 364 additions and 359 deletions.
12 changes: 6 additions & 6 deletions Client/core/CJoystickManager.cpp
Expand Up @@ -400,12 +400,12 @@ BOOL CJoystickManager::DoEnumObjectsCallback(const DIDEVICEOBJECTINSTANCE* pdido
CCore::GetSingleton ().GetConsole ()->Printf(
"%p dwHow:%d dwObj:%d guid:%x index:%d lMin:%d lMax:%d"
,m_DevInfo.pDevice
,range.diph.dwHow
,range.diph.dwObj
,pdidoi->guidType.Data1
,axisIndex
,range.lMin
,range.lMax
,range.diph.dwHow
,range.diph.dwObj
,pdidoi->guidType.Data1
,axisIndex
,range.lMin
,range.lMax
);

#endif
Expand Down
2 changes: 1 addition & 1 deletion Client/game_sa/CAnimBlendAssocGroupSA.cpp
Expand Up @@ -72,7 +72,7 @@ CAnimBlendStaticAssociation* CAnimBlendAssocGroupSA::GetAnimation(unsigned int I
DWORD dwThis = (DWORD)m_pInterface;
DWORD dwFunc = FUNC_CAnimBlendAssocGroup_GetAnimation;
_asm
{
{
mov ecx, dwThis
push ID
call dwFunc
Expand Down
42 changes: 22 additions & 20 deletions Client/game_sa/CAudioEngineSA.cpp
Expand Up @@ -54,7 +54,8 @@ VOID CAudioEngineSA::StopRadio()
// DWORD dwFunc = FUNC_StopRadio;
DWORD dwFunc = 0x4E9823; // Some function CAudio::StopRadio jumps to immediately

_asm {
_asm
{
// This doesn't work anymore because we've
// returned out the function.
/*
Expand All @@ -70,15 +71,15 @@ VOID CAudioEngineSA::StopRadio()
push 0
push retpoint

// Do what CAudio::StopRadio does. Mov the AERadioTrackManager class instance into 'ecx' (this)
// Do what CAudio::StopRadio does. Mov the AERadioTrackManager class instance into 'ecx' (this)
mov ecx, CLASS_AERadioTrackManager

// Do what this global func we've removed does in the beginning.
push ebx
push ebp
// Do what this global func we've removed does in the beginning.
push ebx
push ebp
push esi

// Jump to behind the return code we've replaced.
// Jump to behind the return code we've replaced.
jmp dwFunc

retpoint:
Expand All @@ -97,7 +98,8 @@ VOID CAudioEngineSA::StartRadio(unsigned int station)

DWORD dwFunc = 0x4DBEC3;
DWORD dwFunc2 = 0x4EB3C3;
_asm {
_asm
{
// We can't do this anymore as we've returned out StartRadio
/*
push 0
Expand All @@ -110,32 +112,32 @@ VOID CAudioEngineSA::StartRadio(unsigned int station)
push 0
push station

// Call something, skip 3 bytes that we have our return instruction on (no arguments)
mov ecx,CLASS_AECutsceneTrackManager
mov eax,dword ptr [ecx+8]
// Call something, skip 3 bytes that we have our return instruction on (no arguments)
mov ecx,CLASS_AECutsceneTrackManager
mov eax,dword ptr [ecx+8]
call dwFunc

// Check the return value, eventually skip
test al,al
// Check the return value, eventually skip
test al,al
jne skip

mov eax,dword ptr [esp+4]
mov eax,dword ptr [esp+4]
mov ecx,dword ptr [esp]

// Push arguments to some other function
push 0
push 0
push eax
push eax
push ecx

// Call it (emulate call instruction)
mov ecx,8CB6F8h
// Call it (emulate call instruction)
mov ecx,8CB6F8h
push done
push ebx
mov bl,byte ptr [esp+8]
push ebx
mov bl,byte ptr [esp+8]
jmp dwFunc2

// Pop our arguments back
// Pop our arguments back
done:
pop eax
pop eax
Expand Down Expand Up @@ -525,7 +527,7 @@ void _declspec(naked) HOOK_CAESoundManager_RequestNewSound()
push edi
xor esi, esi
jmp RETURN_CAESoundManager_RequestNewSound

skip: // Skip playing sound
popad
xor eax, eax
Expand Down
2 changes: 1 addition & 1 deletion Client/game_sa/CCameraSA.cpp
Expand Up @@ -590,7 +590,7 @@ void _declspec(naked) HOOK_Camera_CollisionDetection()
call DoCameraCollisionDetectionPokes
popad
sub esp,24h
push ebx
push ebx
push ebp
jmp RETURN_Camera_CollisionDetection
}
Expand Down
6 changes: 3 additions & 3 deletions Client/game_sa/CCameraSA.h
Expand Up @@ -40,7 +40,7 @@
#define VAR_CameraRotation 0xB6F178 // used for controling where the player faces
#define VAR_VehicleCameraView 0xB6F0DC

#define MAX_CAMS 3
#define MAX_CAMS 3

#define MAX_NUM_OF_NODES 800 // for trains

Expand Down Expand Up @@ -139,9 +139,9 @@ class CCameraSAInterface
bool m_bAllowShootingWith2PlayersInCar;
bool m_bDisableFirstPersonInCar;
static bool m_bUseMouse3rdPerson;
#ifndef FINALBUILD
#ifndef FINALBUILD
bool bStaticFrustum;
#endif
#endif

// for debug keyboard stuff
#ifndef MASTER
Expand Down
2 changes: 1 addition & 1 deletion Client/game_sa/CCarEnterExitSA.cpp
Expand Up @@ -61,7 +61,7 @@ bool CCarEnterExitSA::GetNearestCarPassengerDoor(CPed* pPed, CVehicle* pVehicle,
push ebx
mov bl, bUnknown
push ebx
push pDoor
push pDoor
push pVector
push pVehicleInterface
push pPedInterface
Expand Down
2 changes: 1 addition & 1 deletion Client/game_sa/CDamageManagerSA.cpp
Expand Up @@ -287,5 +287,5 @@ VOID CDamageManagerSA::FuckCarCompletely(BOOL bKeepWheels)
mov ecx, dwPointer
push bKeepWheels
call dwFunc
}
}
}
2 changes: 1 addition & 1 deletion Client/game_sa/CDamageManagerSA.h
Expand Up @@ -15,7 +15,7 @@
#include <game/CDamageManager.h>
#include "Common.h"

#define FUNC_GetEngineStatus 0x6c22c0
#define FUNC_GetEngineStatus 0x6c22c0
#define FUNC_SetEngineStatus 0x6c22a0
#define FUNC_GetDoorStatus 0x6c2230
#define FUNC_SetDoorStatus 0x6c21c0
Expand Down
2 changes: 1 addition & 1 deletion Client/game_sa/CExplosionManagerSA.cpp
Expand Up @@ -62,7 +62,7 @@ CExplosion *CExplosionManagerSA::AddExplosion(CEntity *pExplodingEntity, CEntity
mov ebx, dwFunc // Now jump in 6 bytes later (6 bytes might be used for our patch-jump in Multiplayer)
add ebx, 6
jmp ebx

returnhere:
add esp, 0x28
mov bReturn, al
Expand Down
2 changes: 1 addition & 1 deletion Client/game_sa/CFireManagerSA.h
Expand Up @@ -18,7 +18,7 @@

#define FUNC_ExtinguishPoint 0x48E520
#define FUNC_StartFire 0x48EC30
#define FUNC_StartFire_Vec 0x539F00 // ##SA##
#define FUNC_StartFire_Vec 0x539F00 // ##SA##

#define ARRAY_CFire VAR_CFireCount + 4

Expand Down
6 changes: 3 additions & 3 deletions Client/game_sa/CFxSystemSA.cpp
Expand Up @@ -175,9 +175,9 @@ void _declspec(naked) HOOK_FxSystem_c_Update_MidA()
retn 8

inner:
sub esp, 10h
push ebx
push ebp
sub esp, 10h
push ebx
push ebp
jmp RETURN_FxSystem_c_Update_MidA
}
}
Expand Down
2 changes: 1 addition & 1 deletion Client/game_sa/CGameSA.cpp
Expand Up @@ -480,7 +480,7 @@ void CGameSA::Terminate(void)
delete this;

// Dump any memory leaks if DETECT_LEAK is defined
#ifdef DETECT_LEAKS
#ifdef DETECT_LEAKS
DumpUnfreed();
#endif
}
Expand Down
12 changes: 6 additions & 6 deletions Client/game_sa/CModelInfoSA.cpp
Expand Up @@ -272,7 +272,7 @@ char* CModelInfoSA::GetNameIfVehicle()
DWORD dwReturn = 0;

_asm
{
{
push eax
push ebx
push ecx
Expand Down Expand Up @@ -1215,15 +1215,15 @@ void _declspec(naked) HOOK_CFileLoader_LoadCollisionFile_Mid()
jz skip

popad
sub edx,18h
add ebp,2
sub edx,18h
add ebp,2
jmp RETURN_CFileLoader_LoadCollisionFile_Mid

skip:
popad
sub edx,18h
add ebp,2
mov dword ptr [esp+4Ch],edx
sub edx,18h
add ebp,2
mov dword ptr [esp+4Ch],edx
jmp RETURN_CFileLoader_LoadCollisionFile_Mid_Skip
}
}
Expand Down
4 changes: 2 additions & 2 deletions Client/game_sa/CModelInfoSA.h
Expand Up @@ -47,8 +47,8 @@ class CPedModelInfoSAInterface;
#define FUNC_IsHeliModel 0x4c5b00
#define FUNC_IsPlaneModel 0x4c5b30
#define FUNC_IsBikeModel 0x4c5b60
#define FUNC_IsFakePlaneModel 0x4c5b90
#define FUNC_IsMonsterTruckModel 0x4c5bc0
#define FUNC_IsFakePlaneModel 0x4c5b90
#define FUNC_IsMonsterTruckModel 0x4c5bc0
#define FUNC_IsQuadBikeModel 0x4c5bf0
#define FUNC_IsBmxModel 0x4c5c20
#define FUNC_IsTrailerModel 0x4c5c50
Expand Down
16 changes: 8 additions & 8 deletions Client/game_sa/CPedSA.cpp
Expand Up @@ -153,7 +153,7 @@ void CPedSA::AttachPedToBike(CEntity* entity, CVector* vector, unsigned short sU
mov ecx, dwThis
push dwEntityInterface
call dwFunc
}
}
}

bool CPedSA::AddProjectile(eWeaponType eWeapon, CVector vecOrigin, float fForce, CVector* target, CEntity* targetEntity)
Expand Down Expand Up @@ -1771,14 +1771,14 @@ void _declspec(naked) HOOK_CPed_PreRenderAfterTest()
mov eax,[esp-32-4*1] // Get result temp

// Replaced code
sub esp,70h
push ebx
sub esp,70h
push ebx
push ebp
push esi
mov ebp,ecx
mov ecx,dword ptr [ebp+47Ch]
push edi
push esi
mov ebp,ecx
mov ecx,dword ptr [ebp+47Ch]
push edi

// Check what to do
cmp eax,0
jnz skip_rotation_update
Expand Down
4 changes: 2 additions & 2 deletions Client/game_sa/CPedSA.h
Expand Up @@ -36,7 +36,7 @@ class CPedIntelligenceSAInterface;
#define SIZEOF_CPLAYERPED 1956

#define FUNC_SetModelIndex 0x5E4880 // ##SA##
#define FUNC_AttachPedToBike 0x5E7E60
#define FUNC_AttachPedToBike 0x5E7E60
#define FUNC_AttachPedToEntity 0x5E7CB0
#define FUNC_CanSeeEntity 0x5E0730
#define FUNC_GiveObjectToPedToHold 0x5E4390
Expand Down Expand Up @@ -71,7 +71,7 @@ class CPedIntelligenceSAInterface;
#define FUNC_TakeOffGoggles 0x5E6010 // ##SA##
#define FUNC_PutOnGoggles 0x5E3AE0 // ##SA##
#define FUNC_RemoveWeaponModel 0x5E3990 // ##SA## (call with -1 to remove any model, I think)
#define FUNC_RemoveGogglesModel 0x5DF170 // ##SA##
#define FUNC_RemoveGogglesModel 0x5DF170 // ##SA##
#define FUNC_ClearWeapon 0x5E62B0 // ##SA##
#define FUNC_GetHealth 0x4ABC20
#define FUNC_SetCurrentWeaponFromID 0x4FF8E0
Expand Down
4 changes: 2 additions & 2 deletions Client/game_sa/CPhysicalSA.cpp
Expand Up @@ -283,7 +283,7 @@ void CPhysicalSA::DetachEntityFromEntity(float fUnkX, float fUnkY, float fUnkZ,
push fUnkY
push fUnkX
mov ecx, dwThis
call dwFunc
call dwFunc
}
}

Expand All @@ -306,7 +306,7 @@ bool CPhysicalSA::InternalAttachEntityToEntity(DWORD dwEntityInterface, const CV
push dwEntityInterface
mov ecx, dwThis
call dwFunc
mov dwReturn, eax
mov dwReturn, eax
}
return (dwReturn != NULL);
}
Expand Down
6 changes: 3 additions & 3 deletions Client/game_sa/CPoolsSA.cpp
Expand Up @@ -943,15 +943,15 @@ CVehicle* CPoolsSA::AddTrain(CVector* vecPosition, DWORD dwModels[], int iSize,
push iNodeId // node to start at (-1 for closest node)
lea ecx, pTrainEnd
push ecx // end of train
lea ecx, pTrainBeginning
lea ecx, pTrainBeginning
push ecx // begining of train
push 0 // train type (always use 0 as thats where we're writing to)
push bDirection // direction
push bDirection // direction
push fZ // z
push fY // y
push fX // x
call dwFunc
add esp, 0x28
add esp, 0x28
}

// Enable GetVehicle
Expand Down
2 changes: 1 addition & 1 deletion Client/game_sa/CProjectileInfoSA.cpp
Expand Up @@ -149,7 +149,7 @@ bool CProjectileInfoSA::AddProjectile(CEntity* creator, eWeaponType eWeapon, CVe
_asm
{
push eax

push targetVC
push target
push fForce
Expand Down
2 changes: 1 addition & 1 deletion Client/game_sa/CRenderWareSA.ShaderSupport.cpp
Expand Up @@ -93,7 +93,7 @@ void _declspec(naked) HOOK_CTxdStore_SetupTxdParent()
popad

// orig
mov esi, ds:00C8800Ch
mov esi, ds:00C8800Ch
jmp RETURN_CTxdStore_SetupTxdParent // 731D5B
}
}
Expand Down
4 changes: 2 additions & 2 deletions Client/game_sa/CSettingsSA.cpp
Expand Up @@ -372,7 +372,7 @@ void _declspec(naked) HOOK_GetFxQuality()
mov dwFxQualityValue, eax

mov eax, [esp+32] // Address GetFxQuality was called from
push eax
push eax
call MaybeAlterFxQualityValue
add esp, 4

Expand All @@ -391,7 +391,7 @@ void _declspec(naked) HOOK_StoreShadowForVehicle()
mov eax, [esp+4] // Get vehicle
mov ax, [eax+34] // pEntity->m_nModelIndex
mov usCallingForVehicleModel, ax
sub esp, 44h
sub esp, 44h
push ebx
mov eax, 0x70F9B0 // CVolumetricShadowMgr::IsAvailable
call eax
Expand Down
2 changes: 1 addition & 1 deletion Client/game_sa/CTaskManagerSA.cpp
Expand Up @@ -46,7 +46,7 @@ void CTaskManagerSA::SetTask(CTaskSA* pTaskPrimary, const int iTaskPriority, con
push taskInterface
mov ecx, dwInterface
call dwFunc
}
}
}

CTask* CTaskManagerSA::GetTask(const int iTaskPriority)
Expand Down

0 comments on commit 9f16333

Please sign in to comment.