feat(cli): Add option to skip BIOS

This commit is contained in:
Rekai Nyangadzayi Musuka 2022-10-21 05:13:10 -03:00
parent ddb0e2f928
commit e3286a9872
1 changed files with 5 additions and 2 deletions

View File

@ -20,8 +20,9 @@ pub const log_level = if (builtin.mode != .Debug) .info else std.log.default_lev
// CLI Arguments + Help Text // CLI Arguments + Help Text
const params = clap.parseParamsComptime( const params = clap.parseParamsComptime(
\\-h, --help Display this help and exit. \\-h, --help Display this help and exit.
\\-s, --skip Skip BIOS.
\\-b, --bios <str> Optional path to a GBA BIOS ROM. \\-b, --bios <str> Optional path to a GBA BIOS ROM.
\\<str> Path to the GBA GamePak ROM \\<str> Path to the GBA GamePak ROM.
\\ \\
); );
@ -64,7 +65,9 @@ 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 (paths.bios == null) cpu.fastBoot(); if (result.args.skip or paths.bios == null) {
cpu.fastBoot();
}
var gui = Gui.init(&bus.pak.title, &bus.apu, width, height); var gui = Gui.init(&bus.pak.title, &bus.apu, width, height);
defer gui.deinit(); defer gui.deinit();