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)
{
char driveNo = path[0] - '@';
char driveNo = path[0] - 'A';
short rc, wRc, cRc;
short handle;
int i;
if(driveNo > 32) driveNo -= 32;
if(driveNo >= 32) driveNo -= 32;
Dsetdrv(driveNo);
Dsetpath("\\");

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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