浏览代码

Set INPUT opcode to default to Immediate Mode

Commit #d1ef84a551 allowed the INPUT opcode to get its output position
in Position Mode if no Parameter Mode was specified. This is incorrect,
as INPUT should never use Position Mode. Updated to use Immediate Mode
if no mode is specified.
ApisNecros 1 年之前
父节点
当前提交
2b65bc58b6
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      IntComp/Computer.js

+ 2 - 1
IntComp/Computer.js

@@ -304,7 +304,8 @@ module.exports = class Computer {
      * @returns {void}
      */
     Operation_Input(rawOpcode) {
-        const outputParamMode = ComputerParameterMode.ParseParameterMode(rawOpcode, 1);
+        // Disallow Position Parameter Mode
+        const outputParamMode = ComputerParameterMode.ParseParameterMode(rawOpcode, 1) || 1;
         const outputPosition = this.stack.Next().Get(outputParamMode);
 
         /** A variable to store the input in before putting it on the stack */