Skip to content

Commit f3e5a56

Browse files
committed
Modifico marie.ts para recalcular window.dataBytes en HALT y al retroceder con stepback y microstepck.
1 parent c7ea85d commit f3e5a56

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

src/marie.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,11 @@ export class MarieSim {
452452
this._log[this._log.length - 1].type !== 'step'
453453
);
454454

455+
// Recalcular datos totales después de retroceder
456+
if (typeof window !== 'undefined') {
457+
window.dataBytes = calculateDataBytesOccupied(window.staticDataAddresses);
458+
}
459+
455460
// Decrementar contador global de steps
456461
if (typeof window !== 'undefined') {
457462
window.stepCount = Math.max(0, window.stepCount - 1);
@@ -632,6 +637,11 @@ export class MarieSim {
632637
window.microStepCount = Math.max(0, window.microStepCount - 1);
633638
}
634639

640+
// Recalcular datos totales después de retroceder
641+
if (typeof window !== 'undefined') {
642+
window.dataBytes = calculateDataBytesOccupied(window.staticDataAddresses);
643+
}
644+
635645
return last;
636646
}
637647

@@ -1007,6 +1017,10 @@ export class MarieSim {
10071017
microSteps: [
10081018
(sim) => {
10091019
sim._halted = true;
1020+
// Recalcular datos totales al llegar a HALT
1021+
if (typeof window !== 'undefined') {
1022+
window.dataBytes = calculateDataBytesOccupied(window.staticDataAddresses);
1023+
}
10101024
return {
10111025
type: 'halt',
10121026
halt: true,

0 commit comments

Comments
 (0)