code improve for nes init & reset & free.