feat(config): add option to skip BIOS

This commit is contained in:
Rekai Nyangadzayi Musuka 2022-10-17 17:31:07 -03:00
parent 7097e21361
commit fc53a40b3c
3 changed files with 6 additions and 1 deletions

View File

@ -14,6 +14,8 @@ audio_sync = false
video_sync = false video_sync = false
# Force RTC support # Force RTC support
force_rtc = false force_rtc = false
# Skip BIOS
skip_bios = false
[Debug] [Debug]
# Enable detailed CPU logs # Enable detailed CPU logs

View File

@ -30,6 +30,8 @@ const Config = struct {
video_sync: bool = true, video_sync: bool = true,
/// Whether RTC I/O should always be enabled /// Whether RTC I/O should always be enabled
force_rtc: bool = false, force_rtc: bool = false,
/// Skip BIOS
skip_bios: bool = false,
}; };
/// Settings related to debugging ZBA /// 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("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("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("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| { if (table.keys.get("Debug")) |debug| {

View File

@ -65,7 +65,7 @@ pub fn main() anyerror!void {
try bus.init(allocator, &scheduler, &cpu, paths); try bus.init(allocator, &scheduler, &cpu, paths);
defer bus.deinit(); 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(); cpu.fastBoot();
} }