feat(ui): add the option to choose the BIOS

This commit is contained in:
2023-06-19 15:19:43 -05:00
parent 44818a4d5b
commit e8bc798120
3 changed files with 38 additions and 6 deletions

View File

@@ -103,6 +103,25 @@ pub fn draw(state: *State, win_dim: Dimensions, tex_id: GLuint, cpu: *Arm7tdmi)
state.title = handleTitle(&cpu.bus.pak.title);
state.emulation = .{ .Transition = .Active };
}
if (zgui.menuItem("Load BIOS", .{})) blk: {
const maybe_path = nfd.openFileDialog("bin", null) catch |e| {
log.err("failed to open file dialog: {}", .{e});
break :blk;
};
const file_path = maybe_path orelse {
log.warn("did not receive a file path", .{});
break :blk;
};
defer nfd.freePath(file_path);
log.info("user chose: \"{s}\"", .{file_path});
emu.replaceBios(cpu, file_path) catch |e| {
log.err("failed to replace BIOS: {}", .{e});
break :blk;
};
}
}
if (zgui.beginMenu("Emulation", true)) {