From 1c91b497bcc281ede8d5e0644283bec2e3debeca Mon Sep 17 00:00:00 2001 From: Rekai Musuka Date: Fri, 21 Oct 2022 05:13:10 -0300 Subject: [PATCH] feat(config): add option to skip BIOS --- example.toml | 2 ++ src/config.zig | 3 +++ src/main.zig | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/example.toml b/example.toml index cbf5c31..8e11b86 100644 --- a/example.toml +++ b/example.toml @@ -14,6 +14,8 @@ audio_sync = false video_sync = false # Force RTC support force_rtc = false +# Skip BIOS +skip_bios = false [Debug] # Enable detailed CPU logs diff --git a/src/config.zig b/src/config.zig index 3434e0c..5de5ae0 100644 --- a/src/config.zig +++ b/src/config.zig @@ -30,6 +30,8 @@ const Config = struct { video_sync: bool = true, /// Whether RTC I/O should always be enabled force_rtc: bool = false, + /// Skip BIOS + skip_bios: bool = false, }; /// Settings related to debugging ZBA @@ -68,6 +70,7 @@ pub fn load(allocator: Allocator, config_path: []const u8) !void { if (guest.Table.keys.get("audio_sync")) |sync| state.guest.audio_sync = sync.Boolean; if (guest.Table.keys.get("video_sync")) |sync| state.guest.video_sync = sync.Boolean; if (guest.Table.keys.get("force_rtc")) |forced| state.guest.force_rtc = forced.Boolean; + if (guest.Table.keys.get("skip_bios")) |skip| state.guest.skip_bios = skip.Boolean; } if (table.keys.get("Debug")) |debug| { diff --git a/src/main.zig b/src/main.zig index 5d1930b..2e50065 100644 --- a/src/main.zig +++ b/src/main.zig @@ -65,7 +65,7 @@ pub fn main() anyerror!void { try bus.init(allocator, &scheduler, &cpu, paths); defer bus.deinit(); - if (result.args.skip or paths.bios == null) { + if (config.config().guest.skip_bios or result.args.skip or paths.bios == null) { cpu.fastBoot(); }