   a.download = retro.md5 + '.' + retro.name + '.sav'
   a.click()
   URL.revokeObjectURL url
-document.getElementById('save').addEventListener(window.save)
+document.getElementById('save').addEventListener 'click', window.save
 
 savechooser = document.getElementById 'savechooser'
 savechooser.addEventListener 'change', ->

    retro.player.destination.gain.value = 0
    document.getElementById('mute').textContent = 'unmute'
  window.resume()
document.getElementById('mute').addEventListener(window.mute)

window.save = ->
  a = document.createElement 'a'

  retro.classList.remove 'hidden'
  menu.classList.add 'hidden'
  retro.start()
document.getElementById('resume').addEventListener 'click', window.resume

window.reset = ->
  retro.stop()
  retro.core.reset()
  window.resume()
document.getElementById('reset').addEventListener 'click', window.reset

window.mute = ->
  if retro.player.destination.gain.value == 0
