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,