There are two ways. Fully upgrade a weapon, then buy unlimited ammo in Special Settings with points, or complete the game under different conditions to unlock it.