Allow passing multiple arguments to mount multiple disks
This commit is contained in:
parent
5d6bfbb409
commit
940023f47b
|
@ -20,7 +20,7 @@ After that, just run `cargo build --release`. The resulting binary will be saved
|
|||
|
||||
**fox32** attempts to read its ROM from a file called `fox32.rom` in the current directory. If this file isn't found then it falls back to `../fox32rom/fox32.rom`, and if this file isn't found then it exits.
|
||||
|
||||
Passing a file as an argument will mount that file as Disk 0.
|
||||
Passing files as arguments will mount those files as disks, in the order that the arguments were passed.
|
||||
|
||||
See [encoding.md](encoding.md) for information about the instruction set.
|
||||
|
||||
|
|
|
@ -102,7 +102,11 @@ fn main() {
|
|||
};
|
||||
|
||||
if args.len() > 1 {
|
||||
bus.disk_controller.insert(File::open(&args[1]).expect("failed to load provided disk image"), 0);
|
||||
let mut args_iter = args.iter();
|
||||
args_iter.next();
|
||||
for (i, arg) in args_iter.enumerate() {
|
||||
bus.disk_controller.insert(File::open(&arg).expect("failed to load provided disk image"), i as u8);
|
||||
}
|
||||
}
|
||||
|
||||
let (mut runtime, memory): (Box<dyn Runtime>, MemoryWrapped) = {
|
||||
|
|
Loading…
Reference in New Issue
Block a user