浏览代码

Add new followRelativeBaseOffset option

To help troubleshoot this new Relative Base Offset feature, added this
flag to track the Relative Base Offset value.
ApisNecros 1 年之前
父节点
当前提交
e11f991650
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      IntComp/Computer.js

+ 3 - 0
IntComp/Computer.js

@@ -20,6 +20,7 @@ module.exports = class Computer {
      * @param {boolean} options.debug.followPointer When true, the memory will be dumped during every call to Execute with the current instruction highlighted
      * @param {boolean} options.debug.followRuntimeInput When true, the runtime input array will be dumped during every call to Execute
      * @param {boolean} options.debug.followOutputValues When true, the output values array will be dumped during every call to Execute
+     * @param {boolean} options.debug.followRelativeBaseOffset When true, the stack's relative base offset will be dumped during every call to Execute
      * @param {boolean} options.inputFromConsole When true, the computer will prompt for input on the console. If false, it will check for an linked computer and, if one exists, will wait for input from that computer.
      * @param {boolean} options.outputToConsole When true, the computer will print the output of opcode 4 to the console. If false, it will check for an linked computer and, if one exists, pass the output to that computer.
      * @param {number[]} options.inputModeMap Map calls to the INPUT opcode to user input or the input array
@@ -61,6 +62,7 @@ module.exports = class Computer {
                 followPointer: options?.debug?.followPointer ?? false,
                 followRuntimeInput: options?.debug?.followRuntimeInput ?? false,
                 followOutputValues: options?.debug?.followOutputValues ?? false,
+                followRelativeBaseOffset: options?.debug?.followRelativeBaseOffset ?? false,
                 tickRate: options?.debug?.tickRate ?? 0,
             },
             inputFromConsole: options.inputFromConsole ?? false,
@@ -459,6 +461,7 @@ module.exports = class Computer {
         if (this.options.debug.followPointer) { this.DumpMemory(true); }
         if (this.options.debug.followRuntimeInput) { this.InspectProperty("Inputs", "runtimeInput"); }
         if (this.options.debug.followOutputValues) { this.InspectProperty("Outputs", "outputValues"); }
+        if (this.options.debug.followRelativeBaseOffset) { this.InspectProperty("Relative Base Offset", null, this.stack.relativeBaseOffset); }
     }
 
     /**