Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Print the right drive in DIR listings #218

Merged
merged 2 commits into from
Jan 19, 2025

Conversation

eduardocasino
Copy link
Contributor

Problem: when issuing a DIR command on a drive other than the current one, the latter is used in the listing. Examples:

A>DIR B:
A: ATBASIC  TXT : BEDIT    TXT
A: ASM      TXT
A>
B>dir a:hello.pas
B: HELLO    PAS
B>

This patch checks if there is a drive number in the user FCB and, if so, uses it instead of the current one:

A>DIR B:
B: ATBASIC  TXT : BEDIT    TXT
B: ASM      TXT
A>

zelse
dey
tya
zendif
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doing:

dey
tya
zif_pl ; if the drive was 0, A will now contain 0xff
  jsr bdos_GETDRIVE
zendif

...ought to save a whole three bytes here! (zelse is expensive.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough, but then it has to be zif_mi, not zif_pl 😉

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops, yes!

@davidgiven
Copy link
Owner

Thanks very much!

@davidgiven davidgiven closed this Jan 19, 2025
@davidgiven davidgiven reopened this Jan 19, 2025
@davidgiven davidgiven merged commit 824d9ab into davidgiven:master Jan 19, 2025
1 check passed
@eduardocasino eduardocasino deleted the dir-fix branch January 20, 2025 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants