Skip to content

Commit 0d5bdc0

Browse files
Merge pull request #5 from Ripjetski6502/IsSD
v1.47
2 parents 5a02510 + 063afce commit 0d5bdc0

File tree

5 files changed

+25
-0
lines changed

5 files changed

+25
-0
lines changed
Binary file not shown.

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ Version 1.45 brings GStat() function to display simple non-interactive status wi
3131

3232
Version 1.46 brings A8LibDOS, which includes the function SDGDate(). SDGDate() retrieves the date and time from the SpartaDOS COMTAB table, which is independent of the actual real time clock being used.
3333

34+
Version 1.47 brings IsSD() to A8LibDOS, which detects and returns if SpartaDOS is present or not.
35+
3436
License: GNU General Public License v3.0
3537

3638
See the LICENSE file for full license information.

bin/sddtdemo.xex

302 Bytes
Binary file not shown.

src/a8defdos.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
// Definitions
1616
// --------------------------------------------------
1717

18+
// Locations
19+
#define DOSID *((word *) 0x0F31)
20+
1821
// Date/Time function buffer elements
1922
#define ASD_DT_DY 0
2023
#define ASD_DT_MO 1
@@ -27,6 +30,7 @@
2730
// --------------------------------------------------
2831
// Function Prototypes
2932
// --------------------------------------------------
33+
unsigned char IsSD(void);
3034
void SDGDate(unsigned char *bD);
3135

3236
#endif

src/a8libdos.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,25 @@
1616
#include "a8defdos.h"
1717

1818

19+
// ------------------------------------------------------------
20+
// Func...: byte IsSD(void)
21+
// Desc...: Determines if SpartaDOS is present
22+
// Returns: TRUE or FALSE
23+
// ------------------------------------------------------------
24+
byte IsSD(void)
25+
{
26+
byte bR = FALSE;
27+
byte bP = DOSID;
28+
29+
// Check DOSID for one of 4 bytes indicating SpartaDOS
30+
if ((bP == 0) || (bP == 15) || (bP == 68) || (bP ==89)) {
31+
bR = TRUE;
32+
}
33+
34+
return (bR);
35+
}
36+
37+
1938
// ------------------------------------------------------------
2039
// Func...: void SDGDate(unsigned char *bD)
2140
// Desc...: Gets date and time from SpartaDOS

0 commit comments

Comments
 (0)