While all of Nintendo's official emulators are afaik made internally, it's interesting to note that Sony used an existing open source emulator (PCSX ReARMed) for their Playstation Classic.
https://arstechnica.com/gaming/2018/11/sony-using-open-sourc...