fix: replace toml dep + update dependency list

This commit is contained in:
2025-11-12 18:47:02 -06:00
parent 242060e35d
commit f4c8bd9099
4 changed files with 70 additions and 31 deletions

View File

@@ -58,11 +58,7 @@ pub fn build(b: *std.Build) void {
//
// If neither case applies to you, feel free to delete the declaration you
// don't need and to put everything under a single module.
const exe = b.addExecutable(.{
.name = "zba",
.root_module = exe_mod,
.use_llvm = true,
});
const exe = b.addExecutable(.{ .name = "zba", .root_module = exe_mod });
const zgui = b.dependency("zgui", .{ .shared = false, .with_implot = true, .backend = .sdl3_opengl3 });
const sdl = b.dependency("sdl", .{ .target = target, .optimize = optimize, .preferred_linkage = .static });
@@ -84,6 +80,7 @@ pub fn build(b: *std.Build) void {
exe_mod.addImport("nfd", b.dependency("nfdzig", .{}).module("nfd"));
exe_mod.addImport("zgui", zgui.module("root"));
exe_mod.addImport("bitjuggle", b.dependency("bitjuggle", .{}).module("bitjuggle"));
exe_mod.addImport("toml", b.dependency("toml", .{}).module("toml"));
exe_mod.addAnonymousImport("example.toml", .{ .root_source_file = b.path("example.toml") });

View File

@@ -11,11 +11,6 @@
.minimum_zig_version = "0.15.1",
.fingerprint = 0xcb596c7fbdb20efc,
.dependencies = .{
// .tomlz = .{
// .url = "git+https://github.com/paoda/tomlz#9a16dd53927ef2012478b6494bafb4475e44f4c9",
// .hash = "12204f922cab84980e36b5c058d354ec0ee169bda401c8e0e80a463580349b476569",
// },
.zba_util = .{ .path = "../zba-util" },
.arm32 = .{ .path = "../arm32" },
.zba_gdbstub = .{ .path = "../zba-gdbstub" },
@@ -51,5 +46,9 @@
.url = "git+https://github.com/zig-gamedev/zgui#7fa8081c208885b85e3fdfc043cd9d9cb9559123",
.hash = "zgui-0.6.0-dev--L6sZL7tbQAPRLYrcQAVx0V49tPHAXNxclZ-v8IP4wLr",
},
.toml = .{
.url = "git+https://github.com/sam701/zig-toml?ref=zig-0.15#475b03c630c802f8b6bd3e239d8fc2279b4fadb8",
.hash = "toml-0.3.0-bV14BfV7AQD8DkuQI7skP8ekQTaBYKTO0MY_35Cw_EXo",
},
},
}

View File

@@ -1,5 +1,5 @@
const std = @import("std");
// const tomlz = @import("tomlz");
const toml = @import("toml");
const Allocator = std.mem.Allocator;
@@ -7,7 +7,6 @@ const log = std.log.scoped(.Config);
var state: Config = .{};
const Config = struct {
// FIXME: tomlz expects these to be case sensitive
host: Host = .{},
guest: Guest = .{},
debug: Debug = .{},
@@ -69,7 +68,11 @@ pub fn load(allocator: Allocator, config_path: []const u8) !void {
const contents = try file.readToEndAlloc(allocator, try file.getEndPos());
defer allocator.free(contents);
// FIXME(2025-09-22): re-enable
// state = try tomlz.parser.decode(Config, allocator, contents);
state = .{};
var parser = toml.Parser(Config).init(allocator);
defer parser.deinit();
const parsed = try parser.parseString(contents);
defer parsed.deinit();
state = parsed.value; // FIXME: should copy the struct to state
}

View File

@@ -204,44 +204,84 @@ pub fn draw(state: *State, sync: *Synchro, dim: Dimensions, cpu: *const Arm7tdmi
_ = zgui.begin("Dependencies", .{ .popen = &state.win_stat.show_deps });
defer zgui.end();
zgui.bulletText("known-folders by ziglibs", .{});
zgui.bulletText("nfd-zig ported by Fabio Arnold", .{});
zgui.textLinkOpenURL("known-folders", "https://github.com/ziglibs/known-folders");
zgui.sameLine(.{});
zgui.text("by ziglibs", .{});
zgui.textLinkOpenURL("nfd-zig", "https://github.com/fabioarnold/nfd-zig");
zgui.sameLine(.{});
zgui.text("ported by Fabio Arnold", .{});
{
zgui.indent(.{});
defer zgui.unindent(.{});
zgui.bulletText("nativefiledialog by Michael Labbe", .{});
zgui.textLinkOpenURL("nativefiledialog", "https://github.com/mlabbe/nativefiledialog");
zgui.sameLine(.{});
zgui.text("by Michael Labbe", .{});
}
zgui.bulletText("SDL ported by Carl Åstholm", .{});
zgui.textLinkOpenURL("SDL", "https://github.com/castholm/SDL");
zgui.sameLine(.{});
zgui.text("ported by Carl Åstholm", .{});
{
zgui.indent(.{});
defer zgui.unindent(.{});
zgui.bulletText("SDL by Sam Lantinga", .{});
zgui.textLinkOpenURL("SDL", "by Sam Lantinga");
zgui.sameLine(.{});
zgui.text("by Sam Lantinga", .{});
}
// zgui.bulletText("tomlz by Matthew Hall", .{});
zgui.bulletText("zba-gdbstub by Rekai Musuka", .{});
zgui.bulletText("zba-util by Rekai Musuka", .{});
zgui.bulletText("zgui ported by Michal Ziulek et al.", .{});
zgui.textLinkOpenURL("zig-toml", "https://github.com/sam701/zig-toml");
zgui.sameLine(.{});
zgui.text("by Alexei Samokvalov", .{});
zgui.textLinkOpenURL("zba-gdbstub", "https://git.musuka.dev/paoda/zba-gdbstub");
zgui.sameLine(.{});
zgui.text("by Rekai Musuka", .{});
zgui.textLinkOpenURL("zba-util", "https://git.musuka.dev/paoda/zba-util");
zgui.sameLine(.{});
zgui.text("by Rekai Musuka", .{});
zgui.textLinkOpenURL("arm32", "https://git.musuka.dev/paoda/arm32");
zgui.sameLine(.{});
zgui.text("by Rekai Musuka", .{});
zgui.textLinkOpenURL("zgui", "https://github.com/zig-gamedev/zgui");
zgui.sameLine(.{});
zgui.text("ported by Michal Ziulek et al.", .{});
{
zgui.indent(.{});
defer zgui.unindent(.{});
zgui.bulletText("DearImGui by Omar Cornut", .{});
zgui.textLinkOpenURL("Dear ImGui", "https://github.com/ocornut/imgui");
zgui.sameLine(.{});
zgui.text("by Omar Cornut", .{});
}
zgui.bulletText("zig-clap by Jimmi Holst Christensen", .{});
zgui.bulletText("zig-datetime by Jairus Martin", .{});
zgui.newLine();
zgui.bulletText("bitfield.zig by Hannes Bredberg et al.", .{});
zgui.bulletText("zigglgen ported by Carl Åstholm", .{});
zgui.textLinkOpenURL("zig-clap", "https://github.com/Hejsil/zig-clap");
zgui.sameLine(.{});
zgui.text("by Jimmi Holst Christensen", .{});
zgui.textLinkOpenURL("zig-datetime", "https://github.com/frmdstryr/zig-datetime");
zgui.sameLine(.{});
zgui.text("by Jairus Martin", .{});
zgui.textLinkOpenURL("zig-bitjuggle", "https://github.com/leecannon/zig-bitjuggle");
zgui.sameLine(.{});
zgui.text("by Lee Cannon + Hannes Bredberg et al.", .{});
zgui.textLinkOpenURL("zigglgen", "https://github.com/castholm/zigglgen");
zgui.sameLine(.{});
zgui.text("ported by Carl Åstholm", .{});
{
zgui.indent(.{});
defer zgui.unindent(.{});
zgui.bulletText("OpenGL-Registry by The Khronos Group", .{});
zgui.textLinkOpenURL("OpenGL-Registry", "https://github.com/KhronosGroup/OpenGL-Registry");
zgui.sameLine(.{});
zgui.text("by The Khronos Group", .{});
}
}