diff options
Diffstat (limited to '')
-rw-r--r-- | src/audio/AudioCollision.cpp | 13 | ||||
-rw-r--r-- | src/audio/AudioManager.cpp | 240 | ||||
-rw-r--r-- | src/audio/AudioScriptObject.cpp | 9 | ||||
-rw-r--r-- | src/audio/DMAudio.cpp | 58 | ||||
-rw-r--r-- | src/audio/DMAudio.h | 2 | ||||
-rw-r--r-- | src/audio/MusicManager.cpp | 33 | ||||
-rw-r--r-- | src/audio/PoliceRadio.cpp | 32 | ||||
-rw-r--r-- | src/audio/sampman.cpp | 65 |
8 files changed, 28 insertions, 424 deletions
diff --git a/src/audio/AudioCollision.cpp b/src/audio/AudioCollision.cpp index fecd079e..ac8e04c3 100644 --- a/src/audio/AudioCollision.cpp +++ b/src/audio/AudioCollision.cpp @@ -1,5 +1,5 @@ #include "common.h" -#include "patcher.h" + #include "DMAudio.h" #include "Entity.h" #include "AudioCollision.h" @@ -406,14 +406,3 @@ cAudioManager::ReportCollision(CEntity *entity1, CEntity *entity2, uint8 surface m_sCollisionManager.AddCollisionToRequestedQueue(); } } - -STARTPATCHES -InjectHook(0x5685E0, &cAudioCollisionManager::AddCollisionToRequestedQueue, PATCH_JUMP); -InjectHook(0x569060, &cAudioManager::GetCollisionOneShotRatio, PATCH_JUMP); -InjectHook(0x5693B0, &cAudioManager::GetCollisionRatio, PATCH_JUMP); -InjectHook(0x568410, &cAudioManager::ReportCollision, PATCH_JUMP); -InjectHook(0x5686D0, &cAudioManager::ServiceCollisions, PATCH_JUMP); -InjectHook(0x568E20, &cAudioManager::SetLoopingCollisionRequestedSfxFreqAndGetVol, PATCH_JUMP); -InjectHook(0x568D30, &cAudioManager::SetUpLoopingCollisionSound, PATCH_JUMP); -InjectHook(0x5689D0, &cAudioManager::SetUpOneShotCollisionSound, PATCH_JUMP); -ENDPATCHES diff --git a/src/audio/AudioManager.cpp b/src/audio/AudioManager.cpp index 8a9a81f9..4d5f8474 100644 --- a/src/audio/AudioManager.cpp +++ b/src/audio/AudioManager.cpp @@ -1,5 +1,5 @@ #include "common.h" -#include "patcher.h" + #include "audio_enums.h" #include "AudioManager.h" @@ -40,18 +40,18 @@ #include "sampman.h" cAudioManager AudioManager; -uint32 gPornNextTime; // = *(uint32*)0x6508A0; -uint32 gSawMillNextTime; // = *(uint32*)0x6508A4; -uint32 gShopNextTime; // = *(uint32*)0x6508A8; -uint32 gAirportNextTime; // = *(uint32*)0x6508AC; -uint32 gCinemaNextTime; //= *(uint32*)0x6508B0; -uint32 gDocksNextTime; // = *(uint32*)0x6508B4; -uint32 gHomeNextTime; // = *(uint32*)0x6508B8; -uint32 gCellNextTime; // = *(uint32*)0x6508BC; -uint32 gNextCryTime; // = *(uint32*)0x6508C0; -uint8 gJumboVolOffsetPercentage; // = *(uint8 *)0x6508ED; -bool bPlayerJustEnteredCar; // = *(bool *)0x6508C4; -bool g_bMissionAudioLoadFailed; // = *(bool *)0x95CD8E; +uint32 gPornNextTime; +uint32 gSawMillNextTime; +uint32 gShopNextTime; +uint32 gAirportNextTime; +uint32 gCinemaNextTime; +uint32 gDocksNextTime; +uint32 gHomeNextTime; +uint32 gCellNextTime; +uint32 gNextCryTime; +uint8 gJumboVolOffsetPercentage; +bool bPlayerJustEnteredCar; +bool g_bMissionAudioLoadFailed; const int channels = ARRAY_SIZE(cAudioManager::m_asActiveSamples); const int policeChannel = channels + 1; @@ -10147,217 +10147,3 @@ cAudioManager::ComputeEmittingVolume(uint8 emittingVolume, float intensity, floa quatIntensity; return emittingVolume; } - -// STARTPATCHES -// InjectHook(0x57B210, &cAudioManager::AddDetailsToRequestedOrderList, PATCH_JUMP); -// InjectHook(0x56AD30, &cAudioManager::AddPlayerCarSample, PATCH_JUMP); -// InjectHook(0x57B300, &cAudioManager::AddReflectionsToRequestedQueue, PATCH_JUMP); -// InjectHook(0x57B8D0, &cAudioManager::AddReleasingSounds, PATCH_JUMP); -// InjectHook(0x57B070, &cAudioManager::AddSampleToRequestedQueue, PATCH_JUMP); -// InjectHook(0x5697A0, &cAudioManager::CalculateDistance, PATCH_JUMP); -// InjectHook(0x57AA10, &cAudioManager::CheckForAnAudioFileOnCD, PATCH_JUMP); -// InjectHook(0x57C160, &cAudioManager::ClearActiveSamples, PATCH_JUMP); -// InjectHook(0x5796A0, &cAudioManager::ClearMissionAudio, PATCH_JUMP); -// InjectHook(0x57C120, &cAudioManager::ClearRequestedQueue, PATCH_JUMP); -// InjectHook(0x57AE00, &cAudioManager::ComputeDopplerEffectedFrequency, PATCH_JUMP); -// InjectHook(0x57AD20, &cAudioManager::ComputePan, PATCH_JUMP); -// InjectHook(0x57ABB0, &cAudioManager::ComputeVolume, PATCH_JUMP); -// InjectHook(0x57A310, &cAudioManager::CreateEntity, PATCH_JUMP); -// InjectHook(0x57A830, &cAudioManager::DestroyAllGameCreatedEntities, PATCH_JUMP); -// InjectHook(0x57A400, &cAudioManager::DestroyEntity, PATCH_JUMP); -// InjectHook(0x57C290, &cAudioManager::GenerateIntegerRandomNumberTable, PATCH_JUMP); -// InjectHook(0x57A8C0, &cAudioManager::Get3DProviderName, PATCH_JUMP); -// InjectHook(0x571110, &cAudioManager::GetArmyTalkSfx, PATCH_JUMP); -// InjectHook(0x573AB0, &cAudioManager::GetBlackBusinessFemaleTalkSfx, PATCH_JUMP); -// InjectHook(0x572050, &cAudioManager::GetBlackCasualFemaleTalkSfx, PATCH_JUMP); -// InjectHook(0x574380, &cAudioManager::GetBlackConstructionWorkerTalkSfx, PATCH_JUMP); -// InjectHook(0x571D80, &cAudioManager::GetBlackCriminalTalkSfx, PATCH_JUMP); -// InjectHook(0x5735E0, &cAudioManager::GetBlackDockerMaleTalkSfx, PATCH_JUMP); -// InjectHook(0x5724D0, &cAudioManager::GetBlackFatFemaleTalkSfx, PATCH_JUMP); -// InjectHook(0x5726C0, &cAudioManager::GetBlackFatMaleTalkSfx, PATCH_JUMP); -// InjectHook(0x5728B0, &cAudioManager::GetBlackFemaleProstituteTalkSfx, PATCH_JUMP); -// InjectHook(0x572C20, &cAudioManager::GetBlackProjectFemaleOldTalkSfx, PATCH_JUMP); -// InjectHook(0x572D20, &cAudioManager::GetBlackProjectFemaleYoungTalkSfx, PATCH_JUMP); -// InjectHook(0x572AF0, &cAudioManager::GetBlackProjectMaleTalkSfx, PATCH_JUMP); -// InjectHook(0x5739C0, &cAudioManager::GetBlackWorkerMaleTalkSfx, PATCH_JUMP); -// InjectHook(0x574FF0, &cAudioManager::GetBomberTalkSfx, PATCH_JUMP); -// InjectHook(0x5712C0, &cAudioManager::GetBusinessMaleOldTalkSfx, PATCH_JUMP); -// InjectHook(0x5713E0, &cAudioManager::GetBusinessMaleYoungTalkSfx, PATCH_JUMP); -// InjectHook(0x572040, &cAudioManager::GetCasualMaleOldTalkSfx, PATCH_JUMP); -// InjectHook(0x574FE0, &cAudioManager::GetCatatalinaTalkSfx, PATCH_JUMP); -// InjectHook(0x57AA30, &cAudioManager::GetCDAudioDriveLetter, PATCH_JUMP); -// InjectHook(0x573010, &cAudioManager::GetChinatownFemaleOldTalkSfx, PATCH_JUMP); -// InjectHook(0x5730F0, &cAudioManager::GetChinatownFemaleYoungTalkSfx, PATCH_JUMP); -// InjectHook(0x572E10, &cAudioManager::GetChinatownMaleOldTalkSfx, PATCH_JUMP); -// InjectHook(0x572F10, &cAudioManager::GetChinatownMaleYoungTalkSfx, PATCH_JUMP); -// InjectHook(0x575120, &cAudioManager::GetChunkyTalkSfx, PATCH_JUMP); -// InjectHook(0x571B00, &cAudioManager::GetColumbianTalkSfx, PATCH_JUMP); -// InjectHook(0x570EA0, &cAudioManager::GetCopTalkSfx, PATCH_JUMP); -// InjectHook(0x57A8F0, &cAudioManager::GetCurrent3DProviderIndex, PATCH_JUMP); -// InjectHook(0x571770, &cAudioManager::GetDiabloTalkSfx, PATCH_JUMP); -// InjectHook(0x569750, &cAudioManager::GetDistanceSquared, PATCH_JUMP); -// InjectHook(0x574DA0, &cAudioManager::GetEightTalkSfx, PATCH_JUMP); -// InjectHook(0x574040, &cAudioManager::GetFanFemaleTalkSfx, PATCH_JUMP); -// InjectHook(0x573F60, &cAudioManager::GetFanMaleTalkSfx, PATCH_JUMP); -// InjectHook(0x571040, &cAudioManager::GetFBITalkSfx, PATCH_JUMP); -// InjectHook(0x572280, &cAudioManager::GetFemaleNo3TalkSfx, PATCH_JUMP); -// InjectHook(0x5712B0, &cAudioManager::GetFiremanTalkSfx, PATCH_JUMP); -// InjectHook(0x574E50, &cAudioManager::GetFrankieTalkSfx, PATCH_JUMP); -// InjectHook(0x575510, &cAudioManager::GetGenericFemaleTalkSfx, PATCH_JUMP); -// InjectHook(0x575460, &cAudioManager::GetGenericMaleTalkSfx, PATCH_JUMP); -// InjectHook(0x571C30, &cAudioManager::GetHoodTalkSfx, PATCH_JUMP); -// InjectHook(0x5741F0, &cAudioManager::GetHospitalFemaleTalkSfx, PATCH_JUMP); -// InjectHook(0x574120, &cAudioManager::GetHospitalMaleTalkSfx, PATCH_JUMP); -// InjectHook(0x56F410, &cAudioManager::GetJumboTaxiFreq, PATCH_JUMP); -// InjectHook(0x573310, &cAudioManager::GetLittleItalyFemaleOldTalkSfx, PATCH_JUMP); -// InjectHook(0x573400, &cAudioManager::GetLittleItalyFemaleYoungTalkSfx, PATCH_JUMP); -// InjectHook(0x5731E0, &cAudioManager::GetLittleItalyMaleTalkSfx, PATCH_JUMP); -// InjectHook(0x571510, &cAudioManager::GetMafiaTalkSfx, PATCH_JUMP); -// InjectHook(0x571F40, &cAudioManager::GetMaleNo2TalkSfx, PATCH_JUMP); -// InjectHook(0x5711C0, &cAudioManager::GetMedicTalkSfx, PATCH_JUMP); -// InjectHook(0x5795D0, &cAudioManager::GetMissionAudioLoadingStatus, PATCH_JUMP); -// InjectHook(0x574F00, &cAudioManager::GetMistyTalkSfx, PATCH_JUMP); -// InjectHook(0x575340, &cAudioManager::GetNormalMaleTalkSfx, PATCH_JUMP); -// InjectHook(0x57A8A0, &cAudioManager::GetNum3DProvidersAvailable, PATCH_JUMP); -// InjectHook(0x574FD0, &cAudioManager::GetOJGTalkSfx, PATCH_JUMP); -// InjectHook(0x570960, &cAudioManager::GetPedCommentSfx, PATCH_JUMP); -// InjectHook(0x570DB0, &cAudioManager::GetPhrase, PATCH_JUMP); -// InjectHook(0x56BF80, &cAudioManager::GetVehicleDriveWheelSkidValue, PATCH_JUMP); -// InjectHook(0x56C120, &cAudioManager::GetVehicleNonDriveWheelSkidValue, PATCH_JUMP); -// InjectHook(0x575240, &cAudioManager::GetPimpTalkSfx, PATCH_JUMP); -// InjectHook(0x570E00, &cAudioManager::GetPlayerTalkSfx, PATCH_JUMP); -// InjectHook(0x5737E0, &cAudioManager::GetScumFemaleTalkSfx, PATCH_JUMP); -// InjectHook(0x5736D0, &cAudioManager::GetScumMaleTalkSfx, PATCH_JUMP); -// InjectHook(0x575060, &cAudioManager::GetSecurityGuardTalkSfx, PATCH_JUMP); -// InjectHook(0x574480, &cAudioManager::GetShopperFemaleTalkSfx, PATCH_JUMP); -// InjectHook(0x574790, &cAudioManager::GetSpecialCharacterTalkSfx, PATCH_JUMP); -// InjectHook(0x573E90, &cAudioManager::GetStewardFemaleTalkSfx, PATCH_JUMP); -// InjectHook(0x573DC0, &cAudioManager::GetStewardMaleTalkSfx, PATCH_JUMP); -// InjectHook(0x574690, &cAudioManager::GetStudentFemaleTalkSfx, PATCH_JUMP); -// InjectHook(0x574590, &cAudioManager::GetStudentMaleTalkSfx, PATCH_JUMP); -// InjectHook(0x573CD0, &cAudioManager::GetSupermodelFemaleTalkSfx, PATCH_JUMP); -// InjectHook(0x573BD0, &cAudioManager::GetSupermodelMaleTalkSfx, PATCH_JUMP); -// InjectHook(0x570F80, &cAudioManager::GetSwatTalkSfx, PATCH_JUMP); -// InjectHook(0x575190, &cAudioManager::GetTaxiDriverTalkSfx, PATCH_JUMP); -// InjectHook(0x571650, &cAudioManager::GetTriadTalkSfx, PATCH_JUMP); -// InjectHook(0x5723A0, &cAudioManager::GetWhiteBusinessFemaleTalkSfx, PATCH_JUMP); -// InjectHook(0x572170, &cAudioManager::GetWhiteCasualFemaleTalkSfx, PATCH_JUMP); -// InjectHook(0x574290, &cAudioManager::GetWhiteConstructionWorkerTalkSfx, PATCH_JUMP); -// InjectHook(0x571E60, &cAudioManager::GetWhiteCriminalTalkSfx, PATCH_JUMP); -// InjectHook(0x5734F0, &cAudioManager::GetWhiteDockerMaleTalkSfx, PATCH_JUMP); -// InjectHook(0x5727B0, &cAudioManager::GetWhiteFatFemaleTalkSfx, PATCH_JUMP); -// InjectHook(0x5725D0, &cAudioManager::GetWhiteFatMaleTalkSfx, PATCH_JUMP); -// InjectHook(0x5729D0, &cAudioManager::GetWhiteFemaleProstituteTalkSfx, PATCH_JUMP); -// InjectHook(0x5738D0, &cAudioManager::GetWhiteWorkerMaleTalkSfx, PATCH_JUMP); -// InjectHook(0x5718D0, &cAudioManager::GetYakuzaTalkSfx, PATCH_JUMP); -// InjectHook(0x5719E0, &cAudioManager::GetYardieTalkSfx, PATCH_JUMP); -// InjectHook(0x56CAB0, &cAudioManager::HasAirBrakes, PATCH_JUMP); -// InjectHook(0x57A0E0, &cAudioManager::Initialise, PATCH_JUMP); -// InjectHook(0x57B030, &cAudioManager::InterrogateAudioEntities, PATCH_JUMP); -// InjectHook(0x57AA50, &cAudioManager::IsAudioInitialised, PATCH_JUMP); -// InjectHook(0x579650, &cAudioManager::IsMissionAudioSampleFinished, PATCH_JUMP); -// InjectHook(0x57A9C0, &cAudioManager::IsMP3RadioChannelAvailable, PATCH_JUMP); -// InjectHook(0x579520, &cAudioManager::MissionScriptAudioUsesPoliceChannel, PATCH_JUMP); -// InjectHook(0x56AD10, &cAudioManager::PlayerJustGotInCar, PATCH_JUMP); -// InjectHook(0x56AD20, &cAudioManager::PlayerJustLeftCar, PATCH_JUMP); -// InjectHook(0x579620, &cAudioManager::PlayLoadedMissionAudio, PATCH_JUMP); -// InjectHook(0x57A500, &cAudioManager::PlayOneShot, PATCH_JUMP); -// InjectHook(0x569420, &cAudioManager::PostInitialiseGameSpecificSetup, PATCH_JUMP); -// InjectHook(0x569640, &cAudioManager::PostTerminateGameSpecificShutdown, PATCH_JUMP); -// InjectHook(0x569400, &cAudioManager::PreInitialiseGameSpecificSetup, PATCH_JUMP); -// InjectHook(0x579550, &cAudioManager::PreloadMissionAudio, PATCH_JUMP); -// InjectHook(0x569570, &cAudioManager::PreTerminateGameSpecificShutdown, PATCH_JUMP); -// InjectHook(0x57BA60, &cAudioManager::ProcessActiveQueues, PATCH_JUMP); -// InjectHook(0x56C940, &cAudioManager::ProcessAirBrakes, PATCH_JUMP); -// InjectHook(0x577B30, &cAudioManager::ProcessAirportScriptObject, PATCH_JUMP); -// InjectHook(0x56DE80, &cAudioManager::ProcessBoatEngine, PATCH_JUMP); -// InjectHook(0x56E500, &cAudioManager::ProcessBoatMovingOverWater, PATCH_JUMP); -// InjectHook(0x5790D0, &cAudioManager::ProcessBridge, PATCH_JUMP); -// InjectHook(0x579250, &cAudioManager::ProcessBridgeMotor, PATCH_JUMP); -// InjectHook(0x579310, &cAudioManager::ProcessBridgeOneShots, PATCH_JUMP); -// InjectHook(0x579170, &cAudioManager::ProcessBridgeWarning, PATCH_JUMP); -// InjectHook(0x56CC20, &cAudioManager::ProcessCarBombTick, PATCH_JUMP); -// InjectHook(0x577CA0, &cAudioManager::ProcessCinemaScriptObject, PATCH_JUMP); -// InjectHook(0x577E50, &cAudioManager::ProcessDocksScriptObject, PATCH_JUMP); -// InjectHook(0x56CAF0, &cAudioManager::ProcessEngineDamage, PATCH_JUMP); -// InjectHook(0x569870, &cAudioManager::ProcessEntity, PATCH_JUMP); -// InjectHook(0x575AC0, &cAudioManager::ProcessExplosions, PATCH_JUMP); -// InjectHook(0x578FD0, &cAudioManager::ProcessFireHydrant, PATCH_JUMP); -// InjectHook(0x5785E0, &cAudioManager::ProcessFrontEnd, PATCH_JUMP); -// InjectHook(0x56E6A0, &cAudioManager::ProcessHelicopter, PATCH_JUMP); -// InjectHook(0x577FE0, &cAudioManager::ProcessHomeScriptObject, PATCH_JUMP); -// InjectHook(0x56E8F0, &cAudioManager::ProcessJumbo, PATCH_JUMP); -// InjectHook(0x56EA40, &cAudioManager::ProcessJumboAccel, PATCH_JUMP); -// InjectHook(0x56EE40, &cAudioManager::ProcessJumboDecel, PATCH_JUMP); -// InjectHook(0x56ECF0, &cAudioManager::ProcessJumboFlying, PATCH_JUMP); -// InjectHook(0x56ED10, &cAudioManager::ProcessJumboLanding, PATCH_JUMP); -// InjectHook(0x56EC00, &cAudioManager::ProcessJumboTakeOff, PATCH_JUMP); -// InjectHook(0x56EA10, &cAudioManager::ProcessJumboTaxi, PATCH_JUMP); -// InjectHook(0x5777E0, &cAudioManager::ProcessLaunderetteScriptObject, PATCH_JUMP); -// InjectHook(0x576770, &cAudioManager::ProcessLoopingScriptObject, PATCH_JUMP); -// InjectHook(0x5796E0, &cAudioManager::ProcessMissionAudio, PATCH_JUMP); -// InjectHook(0x56A050, &cAudioManager::ProcessModelCarEngine, PATCH_JUMP); -// InjectHook(0x5760C0, &cAudioManager::ProcessOneShotScriptObject, PATCH_JUMP); -// InjectHook(0x56F450, &cAudioManager::ProcessPed, PATCH_JUMP); -// InjectHook(0x56F4D0, &cAudioManager::ProcessPedHeadphones, PATCH_JUMP); -// InjectHook(0x56F650, &cAudioManager::ProcessPedOneShots, PATCH_JUMP); -// InjectHook(0x5699C0, &cAudioManager::ProcessPhysical, PATCH_JUMP); -// InjectHook(0x56E860, &cAudioManager::ProcessPlane, PATCH_JUMP); -// InjectHook(0x56B0D0, &cAudioManager::ProcessPlayersVehicleEngine, PATCH_JUMP); -// InjectHook(0x578190, &cAudioManager::ProcessPoliceCellBeatingScriptObject, PATCH_JUMP); -// InjectHook(0x577280, &cAudioManager::ProcessPornCinema, PATCH_JUMP); -// InjectHook(0x578A80, &cAudioManager::ProcessProjectiles, PATCH_JUMP); -// InjectHook(0x569CC0, &cAudioManager::ProcessRainOnVehicle, PATCH_JUMP); -// InjectHook(0x569700, &cAudioManager::ProcessReverb, PATCH_JUMP); -// InjectHook(0x569E50, &cAudioManager::ProcessReverseGear, PATCH_JUMP); -// InjectHook(0x577630, &cAudioManager::ProcessSawMillScriptObject, PATCH_JUMP); -// InjectHook(0x576070, &cAudioManager::ProcessScriptObject, PATCH_JUMP); -// InjectHook(0x577970, &cAudioManager::ProcessShopScriptObject, PATCH_JUMP); -// InjectHook(0x5697D0, &cAudioManager::ProcessSpecial, PATCH_JUMP); -// InjectHook(0x56DBF0, &cAudioManager::ProcessTrainNoise, PATCH_JUMP); -// InjectHook(0x569A00, &cAudioManager::ProcessVehicle, PATCH_JUMP); -// InjectHook(0x56C770, &cAudioManager::ProcessVehicleDoors, PATCH_JUMP); -// InjectHook(0x56C200, &cAudioManager::ProcessVehicleHorn, PATCH_JUMP); -// InjectHook(0x56C640, &cAudioManager::ProcessVehicleReverseWarning, PATCH_JUMP); -// InjectHook(0x56A230, &cAudioManager::ProcessVehicleRoadNoise, PATCH_JUMP); -// InjectHook(0x56C420, &cAudioManager::ProcessVehicleSirenOrAlarm, PATCH_JUMP); -// InjectHook(0x56BCB0, &cAudioManager::ProcessVehicleSkidding, PATCH_JUMP); -// InjectHook(0x575F30, &cAudioManager::ProcessWaterCannon, PATCH_JUMP); -// InjectHook(0x578370, &cAudioManager::ProcessWeather, PATCH_JUMP); -// InjectHook(0x56A440, &cAudioManager::ProcessWetRoadNoise, PATCH_JUMP); -// InjectHook(0x577530, &cAudioManager::ProcessWorkShopScriptObject, PATCH_JUMP); -// InjectHook(0x57AF90, &cAudioManager::RandomDisplacement, PATCH_JUMP); -// InjectHook(0x57A9F0, &cAudioManager::ReacquireDigitalHandle, PATCH_JUMP); -// InjectHook(0x57A9E0, &cAudioManager::ReleaseDigitalHandle, PATCH_JUMP); -// InjectHook(0x569650, &cAudioManager::ResetAudioLogicTimers, PATCH_JUMP); -// InjectHook(0x57A7B0, &cAudioManager::ResetTimers, PATCH_JUMP); -// InjectHook(0x57A2A0, &cAudioManager::Service, PATCH_JUMP); -// InjectHook(0x57AA60, &cAudioManager::ServiceSoundEffects, PATCH_JUMP); -// InjectHook(0x57A910, &cAudioManager::SetCurrent3DProvider, PATCH_JUMP); -// InjectHook(0x57AA00, &cAudioManager::SetDynamicAcousticModelingStatus, PATCH_JUMP); -// InjectHook(0x57A770, &cAudioManager::SetEffectsFadeVolume, PATCH_JUMP); -// InjectHook(0x57A730, &cAudioManager::SetEffectsMasterVolume, PATCH_JUMP); -// InjectHook(0x57A4C0, &cAudioManager::SetEntityStatus, PATCH_JUMP); -// InjectHook(0x5795F0, &cAudioManager::SetMissionAudioLocation, PATCH_JUMP); -// InjectHook(0x57A790, &cAudioManager::SetMusicFadeVolume, PATCH_JUMP); -// InjectHook(0x57A750, &cAudioManager::SetMusicMasterVolume, PATCH_JUMP); -// InjectHook(0x57A9A0, &cAudioManager::SetSpeakerConfig, PATCH_JUMP); -// InjectHook(0x56F230, &cAudioManager::SetupJumboFlySound, PATCH_JUMP); -// InjectHook(0x56F310, &cAudioManager::SetupJumboRumbleSound, PATCH_JUMP); -// InjectHook(0x56EF20, &cAudioManager::SetupJumboTaxiSound, PATCH_JUMP); -// InjectHook(0x56F070, &cAudioManager::SetupJumboWhineSound, PATCH_JUMP); -// InjectHook(0x570690, &cAudioManager::SetupPedComments, PATCH_JUMP); -// InjectHook(0x57A150, &cAudioManager::Terminate, PATCH_JUMP); -// InjectHook(0x57AC60, &cAudioManager::TranslateEntity, PATCH_JUMP); -// InjectHook(0x56AC80, &cAudioManager::UpdateGasPedalAudio, PATCH_JUMP); -// InjectHook(0x57B470, &cAudioManager::UpdateReflections, PATCH_JUMP); -// InjectHook(0x56C600, &cAudioManager::UsesReverseWarning, PATCH_JUMP); -// InjectHook(0x56C3C0, &cAudioManager::UsesSiren, PATCH_JUMP); -// InjectHook(0x56C3F0, &cAudioManager::UsesSirenSwitching, PATCH_JUMP); - -// InjectHook(0x57C2B0, &cAudioManager::AdjustSamplesVolume, PATCH_JUMP); -// InjectHook(0x57C320, &cAudioManager::ComputeEmittingVolume, PATCH_JUMP); - -// InjectHook(0x5755C0, &cPedComments::Add, PATCH_JUMP); -// InjectHook(0x575730, &cPedComments::Process, PATCH_JUMP); -// ENDPATCHES diff --git a/src/audio/AudioScriptObject.cpp b/src/audio/AudioScriptObject.cpp index da9e1d2e..3d84006d 100644 --- a/src/audio/AudioScriptObject.cpp +++ b/src/audio/AudioScriptObject.cpp @@ -1,5 +1,5 @@ #include "common.h" -#include "patcher.h" + #include "AudioScriptObject.h" #include "Pools.h" #include "DMAudio.h" @@ -86,10 +86,3 @@ PlayOneShotScriptObject(uint8 id, CVector const &pos) audioScriptObject->AudioEntity = AEHANDLE_NONE; DMAudio.CreateOneShotScriptObject(audioScriptObject); } - -STARTPATCHES -InjectHook(0x57C430, &cAudioScriptObject::Reset, PATCH_JUMP); -InjectHook(0x57C5F0, &PlayOneShotScriptObject, PATCH_JUMP); -InjectHook(0x57C560, &cAudioScriptObject::LoadAllAudioScriptObjects, PATCH_JUMP); -InjectHook(0x57c460, &cAudioScriptObject::SaveAllAudioScriptObjects, PATCH_JUMP); -ENDPATCHES
\ No newline at end of file diff --git a/src/audio/DMAudio.cpp b/src/audio/DMAudio.cpp index a01c85ae..11c85dbd 100644 --- a/src/audio/DMAudio.cpp +++ b/src/audio/DMAudio.cpp @@ -1,12 +1,12 @@ #include "common.h" -#include "patcher.h" + #include "DMAudio.h" #include "MusicManager.h" #include "AudioManager.h" #include "AudioScriptObject.h" #include "sampman.h" -cDMAudio &DMAudio = *(cDMAudio*)0x95CDBE; +cDMAudio DMAudio; void cDMAudio::Initialise(void) @@ -318,57 +318,3 @@ cDMAudio::SetRadioChannel(int8 radio, int32 pos) { MusicManager.SetRadioChannelByScript(radio, pos); } - -STARTPATCHES - InjectHook(0x57C760, &cDMAudio::Initialise, PATCH_JUMP); - InjectHook(0x57C780, &cDMAudio::Terminate, PATCH_JUMP); - InjectHook(0x57C7A0, &cDMAudio::Service, PATCH_JUMP); - InjectHook(0x57C7C0, &cDMAudio::CreateEntity, PATCH_JUMP); - InjectHook(0x57C7F0, &cDMAudio::DestroyEntity, PATCH_JUMP); - InjectHook(0x57C810, &cDMAudio::SetEntityStatus, PATCH_JUMP); - InjectHook(0x57C840, &cDMAudio::PlayOneShot, PATCH_JUMP); - InjectHook(0x57C870, &cDMAudio::DestroyAllGameCreatedEntities, PATCH_JUMP); - InjectHook(0x57C890, &cDMAudio::SetEffectsMasterVolume, PATCH_JUMP); - InjectHook(0x57C8C0, &cDMAudio::SetMusicMasterVolume, PATCH_JUMP); - InjectHook(0x57C8F0, &cDMAudio::SetEffectsFadeVol, PATCH_JUMP); - InjectHook(0x57C920, &cDMAudio::SetMusicFadeVol, PATCH_JUMP); - InjectHook(0x57C950, &cDMAudio::GetNum3DProvidersAvailable, PATCH_JUMP); - InjectHook(0x57C970, &cDMAudio::Get3DProviderName, PATCH_JUMP); - InjectHook(0x57C990, &cDMAudio::GetCurrent3DProviderIndex, PATCH_JUMP); - InjectHook(0x57C9B0, &cDMAudio::SetCurrent3DProvider, PATCH_JUMP); - InjectHook(0x57C9D0, &cDMAudio::SetSpeakerConfig, PATCH_JUMP); - InjectHook(0x57C9F0, &cDMAudio::IsMP3RadioChannelAvailable, PATCH_JUMP); - InjectHook(0x57CA10, &cDMAudio::ReleaseDigitalHandle, PATCH_JUMP); - InjectHook(0x57CA30, &cDMAudio::ReacquireDigitalHandle, PATCH_JUMP); - InjectHook(0x57CA50, &cDMAudio::SetDynamicAcousticModelingStatus, PATCH_JUMP); - InjectHook(0x57CA70, &cDMAudio::CheckForAnAudioFileOnCD, PATCH_JUMP); - InjectHook(0x57CA90, &cDMAudio::GetCDAudioDriveLetter, PATCH_JUMP); - InjectHook(0x57CAB0, &cDMAudio::IsAudioInitialised, PATCH_JUMP); - InjectHook(0x57CAD0, &cDMAudio::ReportCrime, PATCH_JUMP); - InjectHook(0x57CB00, &cDMAudio::CreateLoopingScriptObject, PATCH_JUMP); - InjectHook(0x57CB40, &cDMAudio::DestroyLoopingScriptObject, PATCH_JUMP); - InjectHook(0x57CB60, &cDMAudio::CreateOneShotScriptObject, PATCH_JUMP); - InjectHook(0x57CBB0, &cDMAudio::PlaySuspectLastSeen, PATCH_JUMP); - InjectHook(0x57CBE0, &cDMAudio::ReportCollision, PATCH_JUMP); - InjectHook(0x57CC20, &cDMAudio::PlayFrontEndSound, PATCH_JUMP); - InjectHook(0x57CC60, &cDMAudio::PlayRadioAnnouncement, PATCH_JUMP); - InjectHook(0x57CC80, &cDMAudio::PlayFrontEndTrack, PATCH_JUMP); - InjectHook(0x57CCB0, &cDMAudio::StopFrontEndTrack, PATCH_JUMP); - InjectHook(0x57CCD0, &cDMAudio::ResetTimers, PATCH_JUMP); - InjectHook(0x57CCF0, &cDMAudio::ChangeMusicMode, PATCH_JUMP); - InjectHook(0x57CD10, &cDMAudio::PreloadCutSceneMusic, PATCH_JUMP); - InjectHook(0x57CD30, &cDMAudio::PlayPreloadedCutSceneMusic, PATCH_JUMP); - InjectHook(0x57CD50, &cDMAudio::StopCutSceneMusic, PATCH_JUMP); - InjectHook(0x57CD70, &cDMAudio::PreloadMissionAudio, PATCH_JUMP); - InjectHook(0x57CD90, &cDMAudio::GetMissionAudioLoadingStatus, PATCH_JUMP); - InjectHook(0x57CDB0, &cDMAudio::SetMissionAudioLocation, PATCH_JUMP); - InjectHook(0x57CDE0, &cDMAudio::PlayLoadedMissionAudio, PATCH_JUMP); - InjectHook(0x57CE00, &cDMAudio::IsMissionAudioSampleFinished, PATCH_JUMP); - InjectHook(0x57CE20, &cDMAudio::ClearMissionAudio, PATCH_JUMP); - InjectHook(0x57CE40, &cDMAudio::GetRadioInCar, PATCH_JUMP); - InjectHook(0x57CE60, &cDMAudio::SetRadioInCar, PATCH_JUMP); - InjectHook(0x57CE80, &cDMAudio::SetRadioChannel, PATCH_JUMP); - - //InjectHook(0x57CEB0, `global constructor keyed to'dmaudio.cpp, PATCH_JUMP); - //InjectHook(0x57CED0, cDMAudio::~cDMAudio, PATCH_JUMP); -ENDPATCHES diff --git a/src/audio/DMAudio.h b/src/audio/DMAudio.h index d2cdf466..9ce073b4 100644 --- a/src/audio/DMAudio.h +++ b/src/audio/DMAudio.h @@ -256,4 +256,4 @@ public: void SetRadioInCar(uint32 radio); void SetRadioChannel(int8 radio, int32 pos); }; -extern cDMAudio &DMAudio; +extern cDMAudio DMAudio; diff --git a/src/audio/MusicManager.cpp b/src/audio/MusicManager.cpp index d4b60d9b..2cc1d929 100644 --- a/src/audio/MusicManager.cpp +++ b/src/audio/MusicManager.cpp @@ -13,7 +13,7 @@ #include "Timer.h" #include "World.h" #include "sampman.h" -#include "patcher.h" + cMusicManager MusicManager; int32 gNumRetunePresses; @@ -904,34 +904,3 @@ cMusicManager::ChangeRadioChannel() } return true; } - -STARTPATCHES -InjectHook(0x57E4B0, &cMusicManager::PlayerInCar, PATCH_JUMP); -InjectHook(0x57E6D0, &cMusicManager::DisplayRadioStationName, PATCH_JUMP); -InjectHook(0x57CF70, &cMusicManager::Initialise, PATCH_JUMP); -InjectHook(0x57D140, &cMusicManager::Terminate, PATCH_JUMP); -InjectHook(0x57D1D0, &cMusicManager::GetRadioInCar, PATCH_JUMP); -InjectHook(0x57D2C0, &cMusicManager::SetRadioInCar, PATCH_JUMP); -InjectHook(0x57D180, &cMusicManager::SetRadioChannelByScript, PATCH_JUMP); -InjectHook(0x57CF30, &cMusicManager::ResetMusicAfterReload, PATCH_JUMP); -InjectHook(0x57E6A0, &cMusicManager::UsesPoliceRadio, PATCH_JUMP); -InjectHook(0x57D310, &cMusicManager::ChangeMusicMode, PATCH_JUMP); -InjectHook(0x57D420, &cMusicManager::ResetTimers, PATCH_JUMP); -InjectHook(0x57D440, &cMusicManager::Service, PATCH_JUMP); -InjectHook(0x57D530, &cMusicManager::ServiceFrontEndMode, PATCH_JUMP); -InjectHook(0x57E3D0, &cMusicManager::StopFrontEndTrack, PATCH_JUMP); -InjectHook(0x57E430, &cMusicManager::PlayAnnouncement, PATCH_JUMP); -InjectHook(0x57E2E0, &cMusicManager::PlayFrontEndTrack, PATCH_JUMP); -InjectHook(0x57E210, &cMusicManager::PreloadCutSceneMusic, PATCH_JUMP); -InjectHook(0x57E290, &cMusicManager::PlayPreloadedCutSceneMusic, PATCH_JUMP); -InjectHook(0x57E2B0, &cMusicManager::StopCutSceneMusic, PATCH_JUMP); -InjectHook(0x57E450, &cMusicManager::GetTrackStartPos, PATCH_JUMP); -InjectHook(0x57D690, &cMusicManager::ServiceGameMode, PATCH_JUMP); -InjectHook(0x57DCB0, &cMusicManager::ServiceAmbience, PATCH_JUMP); -InjectHook(0x57DEA0, &cMusicManager::ComputeAmbienceVol, PATCH_JUMP); -InjectHook(0x57E100, &cMusicManager::ServiceTrack, PATCH_JUMP); -InjectHook(0x57DFC0, &cMusicManager::ServiceAnnouncement, PATCH_JUMP); -InjectHook(0x57E530, &cMusicManager::GetCarTuning, PATCH_JUMP); -InjectHook(0x57E5A0, &cMusicManager::GetNextCarTuning, PATCH_JUMP); -InjectHook(0x57E130, &cMusicManager::ChangeRadioChannel, PATCH_JUMP); -ENDPATCHES
\ No newline at end of file diff --git a/src/audio/PoliceRadio.cpp b/src/audio/PoliceRadio.cpp index 255d7026..d9c6bfd7 100644 --- a/src/audio/PoliceRadio.cpp +++ b/src/audio/PoliceRadio.cpp @@ -1,5 +1,5 @@ #include "common.h" -#include "patcher.h" + #include "DMAudio.h" #include "AudioManager.h" #include "AudioSamples.h" @@ -21,14 +21,14 @@ struct tPoliceRadioZone { int32 field_12; }; -tPoliceRadioZone (&ZoneSfx)[NUMAUDIOZONES] = *(tPoliceRadioZone(*)[NUMAUDIOZONES])*(uintptr*)0x880240; -char *SubZo2Label = (char*)0x6E9918; -char *SubZo3Label = (char*)0x6E9870; +tPoliceRadioZone ZoneSfx[NUMAUDIOZONES]; +char SubZo2Label[8]; +char SubZo3Label[8]; -int32 &g_nMissionAudioSfx = *(int32*)0x60ED84; -int8 &g_nMissionAudioPlayingStatus = *(int8*)0x60ED88; -uint8 &gSpecialSuspectLastSeenReport = *(uint8*)0x95CD4D; -uint32 (&gMinTimeToNextReport)[NUM_CRIME_TYPES] = *(uint32(*)[NUM_CRIME_TYPES])*(uintptr*)0x8E2828; +int32 g_nMissionAudioSfx = TOTAL_AUDIO_SAMPLES; +int8 g_nMissionAudioPlayingStatus = 2; +uint8 gSpecialSuspectLastSeenReport; +uint32 gMinTimeToNextReport[NUM_CRIME_TYPES]; void cAudioManager::InitialisePoliceRadioZones() @@ -774,19 +774,3 @@ cAudioManager::AgeCrimes() } } } - -STARTPATCHES -InjectHook(0x580AF0, &cAudioManager::AgeCrimes, PATCH_JUMP); -InjectHook(0x57F060, &cAudioManager::DoPoliceRadioCrackle, PATCH_JUMP); -InjectHook(0x57F050, &cAudioManager::GetMissionScriptPoliceAudioPlayingStatus, PATCH_JUMP); -InjectHook(0x57EEC0, &cAudioManager::InitialisePoliceRadio, PATCH_JUMP); -InjectHook(0x57EAC0, &cAudioManager::InitialisePoliceRadioZones, PATCH_JUMP); -InjectHook(0x580500, &cAudioManager::PlaySuspectLastSeen, PATCH_JUMP); -InjectHook(0x5803D0, &cAudioManager::ReportCrime, PATCH_JUMP); -InjectHook(0x57EFF0, &cAudioManager::ResetPoliceRadio, PATCH_JUMP); -InjectHook(0x57F110, &cAudioManager::ServicePoliceRadio, PATCH_JUMP); -InjectHook(0x57F1B0, &cAudioManager::ServicePoliceRadioChannel, PATCH_JUMP); -InjectHook(0x57F020, &cAudioManager::SetMissionScriptPoliceAudio, PATCH_JUMP); -InjectHook(0x57F5B0, &cAudioManager::SetupCrimeReport, PATCH_JUMP); -InjectHook(0x57FCC0, &cAudioManager::SetupSuspectLastSeenReport, PATCH_JUMP); -ENDPATCHES diff --git a/src/audio/sampman.cpp b/src/audio/sampman.cpp index 7887c363..d24de27f 100644 --- a/src/audio/sampman.cpp +++ b/src/audio/sampman.cpp @@ -13,7 +13,7 @@ #include "MusicManager.h" #include "Frontend.h" #include "Timer.h" -#include "patcher.h" + #pragma comment( lib, "mss32.lib" ) @@ -2236,66 +2236,3 @@ cSampleManager::InitialiseSampleBanks(void) return true; } - -STARTPATCHES - //InjectHook(0x565500, cSampleManager::cSampleManager, PATCH_JUMP); - //InjectHook(0x565510, cSampleManager::~cSampleManager, PATCH_JUMP); - InjectHook(0x565520, comp, PATCH_JUMP); - InjectHook(0x565540, add_providers, PATCH_JUMP); - InjectHook(0x565680, release_existing, PATCH_JUMP); - InjectHook(0x5656F0, set_new_provider, PATCH_JUMP); - InjectHook(0x565900, &cSampleManager::SetSpeakerConfig, PATCH_JUMP); - InjectHook(0x565970, &cSampleManager::GetMaximumSupportedChannels, PATCH_JUMP); - InjectHook(0x565990, &cSampleManager::GetCurrent3DProviderIndex, PATCH_JUMP); - InjectHook(0x5659A0, &cSampleManager::SetCurrent3DProvider, PATCH_JUMP); - InjectHook(0x565A10, _ResolveLink, PATCH_JUMP); - InjectHook(0x565B40, _FindMP3s, PATCH_JUMP); - InjectHook(0x566380, _DeleteMP3Entries, PATCH_JUMP); - InjectHook(0x566400, _GetMP3EntryByIndex, PATCH_JUMP); - InjectHook(0x566490, &cSampleManager::IsMP3RadioChannelAvailable, PATCH_JUMP); - InjectHook(0x5664B0, &cSampleManager::ReleaseDigitalHandle, PATCH_JUMP); - InjectHook(0x5664F0, &cSampleManager::ReacquireDigitalHandle, PATCH_JUMP); - InjectHook(0x566530, &cSampleManager::Initialise, PATCH_JUMP); - InjectHook(0x566DC0, &cSampleManager::Terminate, PATCH_JUMP); - InjectHook(0x566EA0, &cSampleManager::CheckForAnAudioFileOnCD, PATCH_JUMP); - InjectHook(0x566F20, &cSampleManager::GetCDAudioDriveLetter, PATCH_JUMP); - InjectHook(0x566F50, &cSampleManager::UpdateEffectsVolume, PATCH_JUMP); - InjectHook(0x567010, &cSampleManager::SetEffectsMasterVolume, PATCH_JUMP); - InjectHook(0x567020, &cSampleManager::SetMusicMasterVolume, PATCH_JUMP); - InjectHook(0x567030, &cSampleManager::SetEffectsFadeVolume, PATCH_JUMP); - InjectHook(0x567040, &cSampleManager::SetMusicFadeVolume, PATCH_JUMP); - InjectHook(0x567050, &cSampleManager::LoadSampleBank, PATCH_JUMP); - InjectHook(0x567110, &cSampleManager::UnloadSampleBank, PATCH_JUMP); - InjectHook(0x567130, &cSampleManager::IsSampleBankLoaded, PATCH_JUMP); - InjectHook(0x567150, &cSampleManager::IsPedCommentLoaded, PATCH_JUMP); - InjectHook(0x5671A0, &cSampleManager::LoadPedComment, PATCH_JUMP); - InjectHook(0x5672A0, &cSampleManager::GetSampleBaseFrequency, PATCH_JUMP); - InjectHook(0x5672C0, &cSampleManager::GetSampleLoopStartOffset, PATCH_JUMP); - InjectHook(0x5672E0, &cSampleManager::GetSampleLoopEndOffset, PATCH_JUMP); - InjectHook(0x567300, &cSampleManager::GetSampleLength, PATCH_JUMP); - InjectHook(0x567320, &cSampleManager::UpdateReverb, PATCH_JUMP); - InjectHook(0x567630, &cSampleManager::SetChannelReverbFlag, PATCH_JUMP); - InjectHook(0x5676A0, &cSampleManager::InitialiseChannel, PATCH_JUMP); - InjectHook(0x567820, &cSampleManager::SetChannelEmittingVolume, PATCH_JUMP); - InjectHook(0x567890, &cSampleManager::SetChannel3DPosition, PATCH_JUMP); - InjectHook(0x5678D0, &cSampleManager::SetChannel3DDistances, PATCH_JUMP); - InjectHook(0x567900, &cSampleManager::SetChannelVolume, PATCH_JUMP); - InjectHook(0x567980, &cSampleManager::SetChannelPan, PATCH_JUMP); - InjectHook(0x5679D0, &cSampleManager::SetChannelFrequency, PATCH_JUMP); - InjectHook(0x567A30, &cSampleManager::SetChannelLoopPoints, PATCH_JUMP); - InjectHook(0x567AA0, &cSampleManager::SetChannelLoopCount, PATCH_JUMP); - InjectHook(0x567B00, &cSampleManager::GetChannelUsedFlag, PATCH_JUMP); - InjectHook(0x567B80, &cSampleManager::StartChannel, PATCH_JUMP); - InjectHook(0x567BE0, &cSampleManager::StopChannel, PATCH_JUMP); - InjectHook(0x567C50, &cSampleManager::PreloadStreamedFile, PATCH_JUMP); - InjectHook(0x567D30, &cSampleManager::PauseStream, PATCH_JUMP); - InjectHook(0x567D60, &cSampleManager::StartPreloadedStreamedFile, PATCH_JUMP); - InjectHook(0x567D80, &cSampleManager::StartStreamedFile, PATCH_JUMP); - InjectHook(0x5680E0, &cSampleManager::StopStreamedFile, PATCH_JUMP); - InjectHook(0x568130, &cSampleManager::GetStreamedFilePosition, PATCH_JUMP); - InjectHook(0x5681D0, &cSampleManager::SetStreamedVolumeAndPan, PATCH_JUMP); - InjectHook(0x568270, &cSampleManager::GetStreamedFileLength, PATCH_JUMP); - InjectHook(0x568290, &cSampleManager::IsStreamPlaying, PATCH_JUMP); - InjectHook(0x5682D0, &cSampleManager::InitialiseSampleBanks, PATCH_JUMP); - //InjectHook(0x5683F0, `global constructor keyed to'sampman.cpp, PATCH_JUMP); -ENDPATCHES |