From 0bf0375200d28e558f036103b9a19976f8d45872 Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Sat, 3 Dec 2022 14:44:50 +0100 Subject: Began writing a debugging tui --- src/pointer.zig | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/pointer.zig') diff --git a/src/pointer.zig b/src/pointer.zig index 0c516be..ce188f8 100644 --- a/src/pointer.zig +++ b/src/pointer.zig @@ -11,6 +11,8 @@ const pointerReturn = struct { code: ?i64 = null, }; +const PointerInfo = struct { x: i64, y: i64, dx: i64, dy: i64 }; + pub const Pointer = struct { allocator: std.mem.Allocator, field: *field.Field, @@ -350,6 +352,9 @@ pub const Pointer = struct { self.step(); return result; } + pub inline fn getInfo(self: *Pointer) PointerInfo { + return .{ .x = self.x, .y = self.y, .dx = self.dx, .dy = self.dy }; + } pub fn init(allocator: std.mem.Allocator, f: *field.Field, timestamp: ?i64, argv: []const []const u8, env: []const [*:0]const u8) !*Pointer { var p = try allocator.create(Pointer); errdefer allocator.destroy(p); -- cgit v1.2.3