From 4b8ed3cebbd43fb6af13e5cead3c5d5fbb29ec32 Mon Sep 17 00:00:00 2001 From: Rekai Musuka Date: Sun, 23 Oct 2022 04:39:31 -0300 Subject: [PATCH] fix(io): resolve embarrasingly simple regression introduced in 21eddac31ec6839ea51f23b3101282c423a21142 --- src/core/bus/io.zig | 4 ++-- src/util.zig | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core/bus/io.zig b/src/core/bus/io.zig index d33e015..08ed08f 100644 --- a/src/core/bus/io.zig +++ b/src/core/bus/io.zig @@ -11,8 +11,8 @@ const Bus = @import("../Bus.zig"); const DmaController = @import("dma.zig").DmaController; const Scheduler = @import("../scheduler.zig").Scheduler; -const setHi = util.setLo; -const setLo = util.setHi; +const setHi = util.setHi; +const setLo = util.setLo; const log = std.log.scoped(.@"I/O"); diff --git a/src/util.zig b/src/util.zig index cca1297..a137ce3 100644 --- a/src/util.zig +++ b/src/util.zig @@ -275,7 +275,7 @@ pub const audio = struct { }; /// Sets the high bits of an integer to a value -pub inline fn setHi(comptime T: type, left: T, right: HalfInt(T)) T { +pub inline fn setLo(comptime T: type, left: T, right: HalfInt(T)) T { return switch (T) { u32 => (left & 0xFFFF_0000) | right, u16 => (left & 0xFF00) | right, @@ -285,7 +285,7 @@ pub inline fn setHi(comptime T: type, left: T, right: HalfInt(T)) T { } /// sets the low bits of an integer to a value -pub inline fn setLo(comptime T: type, left: T, right: HalfInt(T)) T { +pub inline fn setHi(comptime T: type, left: T, right: HalfInt(T)) T { return switch (T) { u32 => (left & 0x0000_FFFF) | @as(u32, right) << 16, u16 => (left & 0x00FF) | @as(u16, right) << 8,