The freemco NES Corelib is a set of routines meant for NES development. However, it's very incomplete and hasn't been tested on hardware at all.