I've heard the Amiga and Sharp x68000 was used with their graphic programs (like Dpaint) to make 16 bit games for Snes and Genesis etc

So I wondered if that was the same thing for the Commodore 64 and NES, was the c64 used for NES development.

By the way, when companys would go this route, how did the programming part go?

Did they just have to type the code into one of those computers and then send them to the company to put on a cartridge, or was there processor specific assemblers on those kind of computers, or was there emulators for them?

You get what I'm trying to say, I'd just like to know, how exactly game dev on those old consoles on those kind of Computers worked.