If you appreciate the work done within the wiki, please consider supporting The Cutting Room Floor on Patreon. Thanks for all your support!

Bugs:Half-Life (PlayStation 2)

From The Cutting Room Floor
Jump to navigation Jump to search

This page details bugs of Half-Life (PlayStation 2).

Memory Leak

There is a section in R5900 RAM which stores a reference to every loaded model, map, and texture/sprite file (0x21CE35E0). This is a common practice in game development, and is used to "cache" previously-loaded files for later usage, to make loading times quicker.

However, that section in RAM is never cleaned out, so every time a file is loaded and added to that section in RAM it slowly starts to build itself towards another section in RAM which stores loaded files from SYSTEM.PAK (0x21D16E40), which will eventually cause the latter section to be overwritten. This will cause your current coordinates to be overwritten once you enter a loading zone, which can have unintended side effects such as softlocking you if the spawn coordinates are out-of-bounds or crashing the game if the spawn coordinates are invalid.

The distance between 0x21CE35E0 and 0x21D16E40 is 0x33800 bytes in total, and each reference is 0x19C bytes, so we can safely estimate that the number of references that can be stored before the SYSTEM.PAK data in RAM gets overwritten is approximately 512.

The end result of this is that it can be very difficult to fully complete the game in one sitting. This can be remedied in two ways:

  • Resetting the console, which causes the entire RAM to be forcibly cleaned out.
  • Increasing the size of that section in RAM within the executable file (SLUS_200.66): 0x1A0038 stores the first two digits, 0x1A0049 stores the middle two digits, and 0x1A0048 stores the last two digits. By default, this is 0x033800 (33,800 bytes; 33.8 KB; 0.0338 MB); modifying them to the maximum of 0xFFFFFF (1,777,776 bytes; 1,777.776 KB; 1.777776 MB) - which can take up more than 1/32 of the entire system's RAM, once data starts to become overwritten - will allow RAM to store up to approximately 40,721 references, with a remainder of 163 bytes for extra padding, once data starts to become overwritten.
(Source: supadupaplex)