Skip to content

Commit 5a02510

Browse files
Merge pull request #4 from Ripjetski6502/LibDOS
v1.46
2 parents 59c4935 + 4dc1772 commit 5a02510

File tree

6 files changed

+76
-1
lines changed

6 files changed

+76
-1
lines changed
Binary file not shown.

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ Version 1.44 brings GLOWER to GInput() to force lowercase text, and GFNAME to GI
2929

3030
Version 1.45 brings GStat() function to display simple non-interactive status windows for short program operations.
3131

32+
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.
33+
3234
License: GNU General Public License v3.0
3335

3436
See the LICENSE file for full license information.

bin/sddtdemo.xex

3.33 KB
Binary file not shown.

src/a8defdos.h

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// --------------------------------------------------
2+
// Library: a8defdos.h
3+
// Desc...: Atari 8 Bit Library SpartaDOS definitions
4+
// Author.: Wade Ripkowski
5+
// Date...: 2024.03
6+
// License: GNU General Public License v3.0
7+
// Note...:
8+
// Revised:
9+
// --------------------------------------------------
10+
11+
#ifndef A8DEFDOS_H
12+
#define A8DEFDOS_H
13+
14+
// --------------------------------------------------
15+
// Definitions
16+
// --------------------------------------------------
17+
18+
// Date/Time function buffer elements
19+
#define ASD_DT_DY 0
20+
#define ASD_DT_MO 1
21+
#define ASD_DT_YR 2
22+
#define ASD_DT_HR 3
23+
#define ASD_DT_MN 4
24+
#define ASD_DT_SC 5
25+
26+
27+
// --------------------------------------------------
28+
// Function Prototypes
29+
// --------------------------------------------------
30+
void SDGDate(unsigned char *bD);
31+
32+
#endif

src/a8defines.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#define A8DEFINES_H
1616

1717
// Version
18-
#define LIB_VERSION "1.4.5"
18+
#define LIB_VERSION "1.4.6"
1919

2020
// True & False
2121
#ifndef TRUE

src/a8libdos.c

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
// --------------------------------------------------
2+
// Library: a8libdos.c
3+
// Desc...: Atari 8 Bit SpartaDOS Library
4+
// Author.: Wade Ripkowski
5+
// Date...: 2024.03
6+
// License: GNU General Public License v3.0
7+
// Note...: Requires: a8defines.c
8+
// Revised:
9+
// --------------------------------------------------
10+
11+
// --------------------------------------------------
12+
// Includes
13+
// --------------------------------------------------
14+
#include <peekpoke.h>
15+
#include "a8defines.h"
16+
#include "a8defdos.h"
17+
18+
19+
// ------------------------------------------------------------
20+
// Func...: void SDGDate(unsigned char *bD)
21+
// Desc...: Gets date and time from SpartaDOS
22+
// Returns: void
23+
// Notes..: SpartaDOS 3.4+.
24+
// ------------------------------------------------------------
25+
void SDGDate(unsigned char *bD)
26+
{
27+
unsigned int iV = 0;
28+
29+
// Get COMTAB vector
30+
iV = PEEKW(0x0A);
31+
32+
// Get date from COMTAB
33+
bD[ASD_DT_YR] = PEEK(iV + 15);
34+
bD[ASD_DT_MO] = PEEK(iV + 14);
35+
bD[ASD_DT_DY] = PEEK(iV + 13);
36+
37+
// Get time from COMTAB
38+
bD[ASD_DT_HR] = PEEK(iV + 16);
39+
bD[ASD_DT_MN] = PEEK(iV + 17);
40+
bD[ASD_DT_SC] = PEEK(iV + 18);
41+
}

0 commit comments

Comments
 (0)