Skip to content

Commit

Permalink
Merge pull request #4 from Ripjetski6502/LibDOS
Browse files Browse the repository at this point in the history
v1.46
  • Loading branch information
Ripjetski6502 authored Mar 15, 2024
2 parents 59c4935 + 4dc1772 commit 5a02510
Show file tree
Hide file tree
Showing 6 changed files with 76 additions and 1 deletion.
Binary file renamed A8CLibReference_145.pdf → A8CLibReference_146.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 @@ -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.
Binary file added bin/sddtdemo.xex
Binary file not shown.
32 changes: 32 additions & 0 deletions src/a8defdos.h
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion src/a8defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#define A8DEFINES_H

// Version
#define LIB_VERSION "1.4.5"
#define LIB_VERSION "1.4.6"

// True & False
#ifndef TRUE
Expand Down
41 changes: 41 additions & 0 deletions src/a8libdos.c
Original file line number Diff line number Diff line change
@@ -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 <peekpoke.h>
#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);
}

0 comments on commit 5a02510

Please sign in to comment.