Fix calculation of drive no. in Atari ST.

This commit is contained in:
2021-05-16 21:13:50 +01:00
parent 7598b1608c
commit 07095b7e3b
10 changed files with 19 additions and 19 deletions

View File

@@ -34,12 +34,12 @@ Copyright (C) 2011-2021 Natalia Portillo
void FileAttributes(const char* path) void FileAttributes(const char* path)
{ {
char driveNo = path[0] - '@'; char driveNo = path[0] - 'A';
short rc, wRc, cRc; short rc, wRc, cRc;
short handle; short handle;
int i; int i;
if(driveNo > 32) driveNo -= 32; if(driveNo >= 32) driveNo -= 32;
Dsetdrv(driveNo); Dsetdrv(driveNo);
Dsetpath("\\"); Dsetpath("\\");

View File

@@ -31,13 +31,13 @@ Copyright (C) 2011-2021 Natalia Portillo
void DeleteFiles(const char* path) void DeleteFiles(const char* path)
{ {
char driveNo = path[0] - '@'; char driveNo = path[0] - 'A';
unsigned int rc; unsigned int rc;
char filename[9]; char filename[9];
short pos; short pos;
int handle; int handle;
if(driveNo > 32) driveNo -= 32; if(driveNo >= 32) driveNo -= 32;
Dsetdrv(driveNo); Dsetdrv(driveNo);
Dsetpath("\\"); Dsetpath("\\");

View File

@@ -32,12 +32,12 @@ Copyright (C) 2011-2021 Natalia Portillo
void DirectoryDepth(const char* path) void DirectoryDepth(const char* path)
{ {
char driveNo = path[0] - '@'; char driveNo = path[0] - 'A';
unsigned int rc; unsigned int rc;
char filename[9]; char filename[9];
int pos = 2; int pos = 2;
if(driveNo > 32) driveNo -= 32; if(driveNo >= 32) driveNo -= 32;
Dsetdrv(driveNo); Dsetdrv(driveNo);
Dsetpath("\\"); Dsetpath("\\");

View File

@@ -33,13 +33,13 @@ Copyright (C) 2011-2021 Natalia Portillo
void Filenames(const char* path) void Filenames(const char* path)
{ {
char driveNo = path[0] - '@'; char driveNo = path[0] - 'A';
unsigned int rc, wRc = 0, cRc = 0; unsigned int rc, wRc = 0, cRc = 0;
int handle; int handle;
char message[300]; char message[300];
int pos; int pos;
if(driveNo > 32) driveNo -= 32; if(driveNo >= 32) driveNo -= 32;
Dsetdrv(driveNo); Dsetdrv(driveNo);
Dsetpath("\\"); Dsetpath("\\");

View File

@@ -32,14 +32,14 @@ Copyright (C) 2011-2021 Natalia Portillo
void MillionFiles(const char* path) void MillionFiles(const char* path)
{ {
char driveNo = path[0] - '@'; char driveNo = path[0] - 'A';
unsigned int rc; unsigned int rc;
char filename[9]; char filename[9];
unsigned int pos; unsigned int pos;
int handle; int handle;
unsigned total; unsigned total;
if(driveNo > 32) driveNo -= 32; if(driveNo >= 32) driveNo -= 32;
Dsetdrv(driveNo); Dsetdrv(driveNo);
Dsetpath("\\"); Dsetpath("\\");

View File

@@ -40,12 +40,12 @@ void Fragmentation(const char* path, size_t clusterSize)
unsigned int threeQuartersCluster = halfCluster + quarterCluster; unsigned int threeQuartersCluster = halfCluster + quarterCluster;
unsigned int twoAndThreeQuartCluster = threeQuartersCluster + twoCluster; unsigned int twoAndThreeQuartCluster = threeQuartersCluster + twoCluster;
unsigned char* buffer; unsigned char* buffer;
char driveNo = path[0] - '@'; char driveNo = path[0] - 'A';
unsigned int rc, wRc = 0, cRc = 0; unsigned int rc, wRc = 0, cRc = 0;
int handle; int handle;
long i; long i;
if(driveNo > 32) driveNo -= 32; if(driveNo >= 32) driveNo -= 32;
Dsetdrv(driveNo); Dsetdrv(driveNo);
Dsetpath("\\"); Dsetpath("\\");

View File

@@ -39,7 +39,7 @@ void Links(const char* path)
long cookie; long cookie;
int rc; int rc;
FILE* h; FILE* h;
char driveNo = path[0] - '@'; char driveNo = path[0] - 'A';
long savessp; long savessp;
// Retrieve pointer to cookie jar in Supervisor mode // Retrieve pointer to cookie jar in Supervisor mode
@@ -57,7 +57,7 @@ void Links(const char* path)
if(rc == 0) return; if(rc == 0) return;
if(driveNo > 32) driveNo -= 32; if(driveNo >= 32) driveNo -= 32;
Dsetdrv(driveNo); Dsetdrv(driveNo);
Dsetpath("\\"); Dsetpath("\\");

View File

@@ -41,7 +41,7 @@ void FilePermissions(const char* path)
long cookie; long cookie;
int rc, cRc, i; int rc, cRc, i;
FILE* file; FILE* file;
char driveNo = path[0] - '@'; char driveNo = path[0] - 'A';
long savessp; long savessp;
// Retrieve pointer to cookie jar in Supervisor mode // Retrieve pointer to cookie jar in Supervisor mode
@@ -59,7 +59,7 @@ void FilePermissions(const char* path)
if(rc == 0) return; if(rc == 0) return;
if(driveNo > 32) driveNo -= 32; if(driveNo >= 32) driveNo -= 32;
Dsetdrv(driveNo); Dsetdrv(driveNo);
Dsetpath("\\"); Dsetpath("\\");

View File

@@ -34,14 +34,14 @@ Copyright (C) 2011-2021 Natalia Portillo
void Timestamps(const char* path) void Timestamps(const char* path)
{ {
char driveNo = path[0] - '@'; char driveNo = path[0] - 'A';
unsigned int rc, wRc = 0, cRc = 0, tRc = 0; unsigned int rc, wRc = 0, cRc = 0, tRc = 0;
int handle; int handle;
char message[300]; char message[300];
int i; int i;
_DOSTIME timestamp; _DOSTIME timestamp;
if(driveNo > 32) driveNo -= 32; if(driveNo >= 32) driveNo -= 32;
Dsetdrv(driveNo); Dsetdrv(driveNo);
Dsetpath("\\"); Dsetpath("\\");

View File

@@ -35,7 +35,7 @@ Copyright (C) 2011-2021 Natalia Portillo
void GetVolumeInfo(const char* path, size_t* clusterSize) void GetVolumeInfo(const char* path, size_t* clusterSize)
{ {
char driveNo = path[0] - '@'; char driveNo = path[0] - 'A';
_BPB* bpb; _BPB* bpb;
_DISKINFO diskInfo; _DISKINFO diskInfo;
unsigned int rc; unsigned int rc;