diff options
Diffstat (limited to 'anim/src/ties.zig')
| -rw-r--r-- | anim/src/ties.zig | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/anim/src/ties.zig b/anim/src/ties.zig index 3048e32..f746f97 100644 --- a/anim/src/ties.zig +++ b/anim/src/ties.zig @@ -186,13 +186,18 @@ pub fn strikeDelay(now: cursors.Now, i: usize) f32 { const pin = [2]?f32{ now.pinLands(0), now.pinLands(1) }; if (i == cursors.sp_index) if (pin[0]) |land| return land - now.plan.at[0]; if (i == cursors.bp_index) if (pin[1]) |land| return land - now.plan.at[0]; + // A call stepped over: its result (rax) in the CPU's slot, the others in a wave after it. + const over = now.plan.result >= 0; + if (over and i == cursors.rax_index) return 0; var before: f32 = 0; for (theme.metric.all_registers[0..16]) |name| { const k = @import("context.zig").index(name).?; if (k == i) break; if ((k == cursors.sp_index and pin[0] != null) or (k == cursors.bp_index and pin[1] != null)) continue; + if (over and k == cursors.rax_index) continue; if (now.registerAge(k) == 0) before += 1; } + if (over) return now.plan.result - now.plan.at[0] + before * time.continue_wave; if (now.plan.wave) return before * time.continue_wave; return @min(before * cursors.write_apart, time.cascade) + @import("syscalls.zig").crossingDelay(now); } |
