Skip to content

Commit

Permalink
Merge pull request #5 from Ripjetski6502/IsSD
Browse files Browse the repository at this point in the history
v1.47
  • Loading branch information
Ripjetski6502 authored Mar 30, 2024
2 parents 5a02510 + 063afce commit 0d5bdc0
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 0 deletions.
Binary file renamed A8CLibReference_146.pdf → A8CLibReference_147.pdf
Binary file not shown.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ Version 1.45 brings GStat() function to display simple non-interactive status wi

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.

Version 1.47 brings IsSD() to A8LibDOS, which detects and returns if SpartaDOS is present or not.

License: GNU General Public License v3.0

See the LICENSE file for full license information.
Binary file modified bin/sddtdemo.xex
Binary file not shown.
4 changes: 4 additions & 0 deletions src/a8defdos.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
// Definitions
// --------------------------------------------------

// Locations
#define DOSID *((word *) 0x0F31)

// Date/Time function buffer elements
#define ASD_DT_DY 0
#define ASD_DT_MO 1
Expand All @@ -27,6 +30,7 @@
// --------------------------------------------------
// Function Prototypes
// --------------------------------------------------
unsigned char IsSD(void);
void SDGDate(unsigned char *bD);

#endif
19 changes: 19 additions & 0 deletions src/a8libdos.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,25 @@
#include "a8defdos.h"


// ------------------------------------------------------------
// Func...: byte IsSD(void)
// Desc...: Determines if SpartaDOS is present
// Returns: TRUE or FALSE
// ------------------------------------------------------------
byte IsSD(void)
{
byte bR = FALSE;
byte bP = DOSID;

// Check DOSID for one of 4 bytes indicating SpartaDOS
if ((bP == 0) || (bP == 15) || (bP == 68) || (bP ==89)) {
bR = TRUE;
}

return (bR);
}


// ------------------------------------------------------------
// Func...: void SDGDate(unsigned char *bD)
// Desc...: Gets date and time from SpartaDOS
Expand Down

0 comments on commit 0d5bdc0

Please sign in to comment.