Developed by John Carmack and id Software, Wolfenstein 3D is the granddaddy of first person shooter games, first released in 1992. Originally designed for MS-DOS-based PCs, it’s since been ported to just about every system, including Steam and iOS. The game also helped to pioneer shareware, as the first episode was made available for free, while the full 3-episode version had to be purchased. Wolfenstein 3D helped pave the way for other massively popular FPS games like Doom, Duke Nukem and Quake. The source code for Wolfenstein 3D was released in 1995 along with that of its prequel, Spear of Destiny.
You can download the source code for Wolfenstein 3D from GitHub.