                 .replace /.*\[Function\].*\n/g, ""
         else if typeof result is "number"
             result = "0x#{numberAsHex result}"
-        stdout.write "[Exec] #{param} = #{result}\n"
+        print "#{param} = #{result}"
     catch error
-        stdout.write "[Error] #{error.message}\n"
+        print "Error: #{error.message}"
+
+resetCommand = (param) ->
+    nes.pressReset()
 
 quitCommand = (param) ->
     process.exit 0

nes = injector.getInstance "nes"
nes.insertCartridge cartridge

stdin = process.stdin
stdout = process.stdout

###########################################################
# Commands

        when "j", "jump"  then jumpCommand param
        when "b", "break" then breakCommand param
        when "x", "exec"  then execCommand param
        when "r", "reset" then resetCommand param
        when "q", "quit"  then quitCommand param
        else print "Type 'help' to print available commands."
    rl.prompt()

rl.on "close", ->
    quitCommand()
