From f80799a59356ef18da766d70da6246ca3878fc52 Mon Sep 17 00:00:00 2001 From: Rekai Musuka Date: Sun, 30 Oct 2022 04:12:58 -0300 Subject: [PATCH] fix(util): resolve bug in setHalf function introduced in 472215b4c20163a5ba08c7bc8aef021d758b0db0 --- src/util.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util.zig b/src/util.zig index 1ab49a5..4da0b6d 100644 --- a/src/util.zig +++ b/src/util.zig @@ -314,7 +314,7 @@ pub inline fn setHalf(comptime T: type, left: T, addr: u8, right: HalfInt(T)) T }, u16 => switch (offset) { 0b0 => (left & 0xFF00) | right, - 0b1 => (right & 0x00FF) | @as(u16, right) << 8, + 0b1 => (left & 0x00FF) | @as(u16, right) << 8, }, else => @compileError("unsupported type"), };