Skip to content

Commit

Permalink
Correct the total number of CD tracks
Browse files Browse the repository at this point in the history
For the CD track -> MP3 file mapping to work correctly.
Also updated README with a note about supported MP3 tags.
  • Loading branch information
UCyborg committed Sep 25, 2018
1 parent 27a4dd0 commit 70fa181
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
Small ASI plugin that fixes the issue with not playing correct MP3 files when playing expansion packs/mods with the old pre-Steam version of Half-Life.
For example, you would always hear the Half-Life soundtrack even if playing Half-Life: Opposing Force.

It also fixes the issue with the MP3 file associated with the last track not playing.

Ability to play MP3 files as a substitute for playing soundtrack from CD first appeared with patch 1.1.0.9. It's an undocumented feature that only
became official with Steam version of Half-Life. Refer to the following list to see how to name MP3 files after ripping them from Half-Life CD:

Expand Down Expand Up @@ -35,6 +37,9 @@ became official with Steam version of Half-Life. Refer to the following list to
27. Suspense05.mp3
28. Suspense07.mp3

**Important:** The MP3 decoder used in the old version of Half-Life doesn't understand ID3v2 tags commonly added by CD ripping software and such MP3s
won't be played. Make sure your ripping software offers ability to use ID3v1 tags instead. They may also be omitted entirely.

The files go into following folders. The above list can be used when ripping CDs of the expansion packs, the only difference is they have less tracks.

### Half-Life
Expand Down
8 changes: 8 additions & 0 deletions dllmain.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,14 @@ fail: return FALSE;

free(pVersionInfo);

dwPatchBase = 0x404541;
if (*(BYTE *)dwPatchBase == 27)
{
VirtualProtect((LPVOID)dwPatchBase, sizeof(BYTE), PAGE_EXECUTE_READWRITE, &dwOldProtect);
*(BYTE *)dwPatchBase = 28;
VirtualProtect((LPVOID)dwPatchBase, sizeof(BYTE), dwOldProtect, &dwOldProtect);
}

dwPatchBase = 0x4AD7E8;
VirtualProtect((LPVOID)dwPatchBase, sizeof(DWORD_PTR), PAGE_READWRITE, &dwOldProtect);

Expand Down

0 comments on commit 70fa181

Please sign in to comment.