rp2040js 0.17.13 → 0.17.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -40,6 +40,8 @@ export declare class CortexM0Core {
40
40
  VTOR: number;
41
41
  SHPR2: number;
42
42
  SHPR3: number;
43
+ /** Hook to listen for function calls - branch-link (BL/BLX) instructions */
44
+ blTaken: (core: CortexM0Core, blx: boolean) => void;
43
45
  constructor(rp2040: RP2040);
44
46
  get logger(): import(".").Logger;
45
47
  reset(): void;
@@ -77,6 +77,11 @@ class CortexM0Core {
77
77
  this.VTOR = 0;
78
78
  this.SHPR2 = 0;
79
79
  this.SHPR3 = 0;
80
+ /** Hook to listen for function calls - branch-link (BL/BLX) instructions */
81
+ this.blTaken = (core, blx) => {
82
+ void core; // surpress unused variable warnings
83
+ void blx;
84
+ };
80
85
  this.SP = 0xfffffffc;
81
86
  this.bankedSP = 0xfffffffc;
82
87
  }
@@ -671,6 +676,7 @@ class CortexM0Core {
671
676
  this.LR = (this.PC + 2) | 0x1;
672
677
  this.PC += 2 + imm32;
673
678
  this.cycles += 2;
679
+ this.blTaken(this, false);
674
680
  }
675
681
  // BLX
676
682
  else if (opcode >> 7 === 0b010001111 && (opcode & 0x7) === 0) {
@@ -678,6 +684,7 @@ class CortexM0Core {
678
684
  this.LR = this.PC | 0x1;
679
685
  this.PC = this.registers[Rm] & ~1;
680
686
  this.cycles++;
687
+ this.blTaken(this, true);
681
688
  }
682
689
  // BX
683
690
  else if (opcode >> 7 === 0b010001110 && (opcode & 0x7) === 0) {
@@ -40,6 +40,8 @@ export declare class CortexM0Core {
40
40
  VTOR: number;
41
41
  SHPR2: number;
42
42
  SHPR3: number;
43
+ /** Hook to listen for function calls - branch-link (BL/BLX) instructions */
44
+ blTaken: (core: CortexM0Core, blx: boolean) => void;
43
45
  constructor(rp2040: RP2040);
44
46
  get logger(): import("./index").Logger;
45
47
  reset(): void;
@@ -74,6 +74,11 @@ export class CortexM0Core {
74
74
  this.VTOR = 0;
75
75
  this.SHPR2 = 0;
76
76
  this.SHPR3 = 0;
77
+ /** Hook to listen for function calls - branch-link (BL/BLX) instructions */
78
+ this.blTaken = (core, blx) => {
79
+ void core; // surpress unused variable warnings
80
+ void blx;
81
+ };
77
82
  this.SP = 0xfffffffc;
78
83
  this.bankedSP = 0xfffffffc;
79
84
  }
@@ -668,6 +673,7 @@ export class CortexM0Core {
668
673
  this.LR = (this.PC + 2) | 0x1;
669
674
  this.PC += 2 + imm32;
670
675
  this.cycles += 2;
676
+ this.blTaken(this, false);
671
677
  }
672
678
  // BLX
673
679
  else if (opcode >> 7 === 0b010001111 && (opcode & 0x7) === 0) {
@@ -675,6 +681,7 @@ export class CortexM0Core {
675
681
  this.LR = this.PC | 0x1;
676
682
  this.PC = this.registers[Rm] & ~1;
677
683
  this.cycles++;
684
+ this.blTaken(this, true);
678
685
  }
679
686
  // BX
680
687
  else if (opcode >> 7 === 0b010001110 && (opcode & 0x7) === 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rp2040js",
3
- "version": "0.17.13",
3
+ "version": "0.17.14",
4
4
  "description": "Raspberry Pi Pico (RP2040) Emulator",
5
5
  "repository": "https://github.com/wokwi/rp2040js",
6
6
  "keywords": [