mirror of
https://github.com/aaru-dps/fstester.git
synced 2025-12-16 19:24:39 +00:00
Fix calculation of drive no. in Atari ST.
This commit is contained in:
@@ -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("\\");
|
||||||
|
|||||||
@@ -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("\\");
|
||||||
|
|||||||
@@ -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("\\");
|
||||||
|
|||||||
@@ -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("\\");
|
||||||
|
|||||||
@@ -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("\\");
|
||||||
|
|||||||
@@ -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("\\");
|
||||||
|
|||||||
@@ -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("\\");
|
||||||
|
|||||||
@@ -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("\\");
|
||||||
|
|||||||
@@ -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("\\");
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user