Making own games for emulator

Is it possible to program your own game and have it work on a SNES or N64 emulator?