mirror of
https://github.com/bobbimanners/ProDOS-Utils.git
synced 2024-06-08 19:29:28 +00:00
Fixed computation of slot and drive number
This commit is contained in:
parent
7dd8e9b13e
commit
092df9c672
10
sortdir.c
10
sortdir.c
|
@ -29,6 +29,7 @@
|
|||
* v0.66 Modified to build sorted blocks on the fly rather than in aux memory.
|
||||
* v0.67 Fixed bug in v0.66 where garbage was written to end of directory.
|
||||
* v0.68 Cleaned up error msgs.
|
||||
* v0.69 Fixed support for drive number >2.
|
||||
*/
|
||||
|
||||
//#pragma debug 9
|
||||
|
@ -627,9 +628,14 @@ void firstblk(char *dirname, uchar *device, uint *block) {
|
|||
//
|
||||
// *device = st.st_dev;
|
||||
|
||||
/*
|
||||
* lastdev is in the following format:
|
||||
* ProDOS 2.5+ DSSS00DD (supports drives 1-8 for each slot)
|
||||
* ProDOS 2.x DSSS0000 (supports drives 1-2 for each slot)
|
||||
*/
|
||||
*device = *lastdev;
|
||||
slot = (*lastdev & 0x70) >> 4;
|
||||
drive = ((*lastdev & 0x80) >> 7) + (*lastdev & 0x02) + 1;
|
||||
drive = ((*lastdev & 0x80) >> 7) + ((*lastdev & 0x03) << 1) + 1;
|
||||
printf("[Slot %u, Drive %u]\n", slot, drive);
|
||||
*device = slot + (drive - 1) * 8;
|
||||
dio_hdl = dio_open(*device); // TODO should dio_close on exit
|
||||
|
@ -1873,7 +1879,7 @@ void interactive(void) {
|
|||
|
||||
doverbose = 1;
|
||||
|
||||
puts("S O R T D I R v0.68 alpha Use ^ to return to previous question");
|
||||
puts("S O R T D I R v0.69 alpha Use ^ to return to previous question");
|
||||
|
||||
q1:
|
||||
fputs("\nEnter path (e.g.: /H1) of starting directory> ", stdout);
|
||||
|
|
Loading…
Reference in New Issue
Block a user