Skip to content

Commit

Permalink
Fixed off-by-one in handling of drive P: in CLI args.
Browse files Browse the repository at this point in the history
The command-line interface allows the specification of local
directories to be used as CP/M drives.

I accidentally noticed that the final drive is not specified
as expected because I happen to have a P-drive setup for Turbo-Pascal:

```
$ ./target/debug/iz-cpm --disk-p /home/skx/Repos/github.com/skx/cpm-dist/P
iz-cpm https://github.com/ivanizag/iz-cpm
CP/M 2.2 Emulation
Press ctrl-c ctrl-c Y to return to host

A>p:
P>dir
Bdos Err On P: Bad Sector

No File
```

There is a loop setup which runs from 0-15, but it excludes the last
value.  This PR updates to use 0-16, so that drive 15 (P:) is included.
  • Loading branch information
skx authored and ivanizag committed Jul 3, 2024
1 parent fed4820 commit 730ffbb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ fn main() {
bdos.reset(&mut machine);

// Assign drives
for i in 0..15 {
for i in 0..16 {
let res = matches.value_of(format!("disk_{}", (i + b'a') as char));
if let Some(path) = res {
if let Err(err) = fs::read_dir(path) {
Expand Down

0 comments on commit 730ffbb

Please sign in to comment.