diff --git a/build.zig b/build.zig index 9e83445..dc9af7d 100644 --- a/build.zig +++ b/build.zig @@ -12,6 +12,10 @@ pub fn build(b: *std.build.Builder) void { const mode = b.standardReleaseOptions(); const exe = b.addExecutable("zba", "src/main.zig"); + + // Bitfield type from FlorenceOS: https://github.com/FlorenceOS/ + exe.addPackage(.{ .name = "bitfield", .path = .{ .path = "./lib/util/bitfield.zig" } }); + exe.setTarget(target); exe.setBuildMode(mode); exe.install(); diff --git a/src/util/bitfield.zig b/lib/util/bitfield.zig similarity index 97% rename from src/util/bitfield.zig rename to lib/util/bitfield.zig index 7253dc3..1124cd2 100644 --- a/src/util/bitfield.zig +++ b/lib/util/bitfield.zig @@ -1,5 +1,3 @@ -// source + credit: https://github.com/FlorenceOS/Florence/blob/master/lib/util/bitfields.zig -- - const std = @import("std"); fn PtrCastPreserveCV(comptime T: type, comptime PtrToT: type, comptime NewT: type) type { diff --git a/src/cpu.zig b/src/cpu.zig index e6844d7..9b7cee1 100644 --- a/src/cpu.zig +++ b/src/cpu.zig @@ -1,6 +1,6 @@ const std = @import("std"); const util = @import("util.zig"); -const bitfield = @import("util/bitfield.zig"); +const bitfield = @import("bitfield"); const Bus = @import("bus.zig").Bus; const Scheduler = @import("scheduler.zig").Scheduler;