diff --git a/A8CLibReference_145.pdf b/A8CLibReference_146.pdf similarity index 86% rename from A8CLibReference_145.pdf rename to A8CLibReference_146.pdf index 46eead3..015ad6d 100644 Binary files a/A8CLibReference_145.pdf and b/A8CLibReference_146.pdf differ diff --git a/README.md b/README.md index 4e7a5be..cee8c63 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,8 @@ Version 1.44 brings GLOWER to GInput() to force lowercase text, and GFNAME to GI Version 1.45 brings GStat() function to display simple non-interactive status windows for short program operations. +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. + License: GNU General Public License v3.0 See the LICENSE file for full license information. diff --git a/bin/sddtdemo.xex b/bin/sddtdemo.xex new file mode 100644 index 0000000..229da18 Binary files /dev/null and b/bin/sddtdemo.xex differ diff --git a/src/a8defdos.h b/src/a8defdos.h new file mode 100644 index 0000000..190ea60 --- /dev/null +++ b/src/a8defdos.h @@ -0,0 +1,32 @@ +// -------------------------------------------------- +// Library: a8defdos.h +// Desc...: Atari 8 Bit Library SpartaDOS definitions +// Author.: Wade Ripkowski +// Date...: 2024.03 +// License: GNU General Public License v3.0 +// Note...: +// Revised: +// -------------------------------------------------- + +#ifndef A8DEFDOS_H +#define A8DEFDOS_H + +// -------------------------------------------------- +// Definitions +// -------------------------------------------------- + +// Date/Time function buffer elements +#define ASD_DT_DY 0 +#define ASD_DT_MO 1 +#define ASD_DT_YR 2 +#define ASD_DT_HR 3 +#define ASD_DT_MN 4 +#define ASD_DT_SC 5 + + +// -------------------------------------------------- +// Function Prototypes +// -------------------------------------------------- +void SDGDate(unsigned char *bD); + +#endif diff --git a/src/a8defines.h b/src/a8defines.h index 8657c9f..f8e93a1 100644 --- a/src/a8defines.h +++ b/src/a8defines.h @@ -15,7 +15,7 @@ #define A8DEFINES_H // Version -#define LIB_VERSION "1.4.5" +#define LIB_VERSION "1.4.6" // True & False #ifndef TRUE diff --git a/src/a8libdos.c b/src/a8libdos.c new file mode 100644 index 0000000..5476574 --- /dev/null +++ b/src/a8libdos.c @@ -0,0 +1,41 @@ +// -------------------------------------------------- +// Library: a8libdos.c +// Desc...: Atari 8 Bit SpartaDOS Library +// Author.: Wade Ripkowski +// Date...: 2024.03 +// License: GNU General Public License v3.0 +// Note...: Requires: a8defines.c +// Revised: +// -------------------------------------------------- + +// -------------------------------------------------- +// Includes +// -------------------------------------------------- +#include +#include "a8defines.h" +#include "a8defdos.h" + + +// ------------------------------------------------------------ +// Func...: void SDGDate(unsigned char *bD) +// Desc...: Gets date and time from SpartaDOS +// Returns: void +// Notes..: SpartaDOS 3.4+. +// ------------------------------------------------------------ +void SDGDate(unsigned char *bD) +{ + unsigned int iV = 0; + + // Get COMTAB vector + iV = PEEKW(0x0A); + + // Get date from COMTAB + bD[ASD_DT_YR] = PEEK(iV + 15); + bD[ASD_DT_MO] = PEEK(iV + 14); + bD[ASD_DT_DY] = PEEK(iV + 13); + + // Get time from COMTAB + bD[ASD_DT_HR] = PEEK(iV + 16); + bD[ASD_DT_MN] = PEEK(iV + 17); + bD[ASD_DT_SC] = PEEK(iV + 18); +}