fix support for requiring the cpu as a node.js module and a problem in the javascript in example page

This commit is contained in:
Preston Skupinski 2012-05-31 10:43:02 -04:00
parent 23b595ba74
commit fddcbeb865
2 changed files with 4 additions and 3 deletions

5
cpu.js
View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2011, Preston Skupinski <skupinsk@cse.msu.edu> * Copyright (c) 2011-2012, Preston Skupinski <skupinsk@cse.msu.edu>
* *
* Permission to use, copy, modify, and/or distribute this software for any * Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above * purpose with or without fee is hereby granted, provided that the above
@ -3937,4 +3937,5 @@ window.CPU_65816 = function() {
this.cycle_count = 0; this.cycle_count = 0;
}; };
}; };
})(this); })((typeof module !== 'undefined' &&
typeof module.exports !== 'undefined')?module.exports:this);

View File

@ -25,7 +25,7 @@ $(document).ready(function() {
}); });
$("#load").click(function() { $("#load").click(function() {
cpu.reset(); cpu.reset();
cpu.load_program($("#hex").val()); cpu.load_binary($("#hex").val());
updateFields(); updateFields();
can_step = true; can_step = true;
$("#step").removeAttr("disabled"); $("#step").removeAttr("disabled");