urm, at a base level there was probably an assembly language involved. Then it's likely they turned that into a compiled language, unsure of the exact language.... Actually here we go; *Googled: NES ASM*
http://patater.com/gbaguy/nesasm.htm
That's the assembly language used.
Cheers,
Jamey