]> git.sur5r.net Git - cc65/blob - include/ace.h
8ce86e18fcc2310227c1ba7b7779cf0468109f89
[cc65] / include / ace.h
1 /*****************************************************************************/
2 /*                                                                           */
3 /*                                   ace.h                                   */
4 /*                                                                           */
5 /*                      ACE system-specific definitions                      */
6 /*                                                                           */
7 /*                                                                           */
8 /*                                                                           */
9 /* (C) 1998-2015, Ullrich von Bassewitz                                      */
10 /*                Roemerstrasse 52                                           */
11 /*                D-70794 Filderstadt                                        */
12 /* EMail:         uz@cc65.org                                                */
13 /*                                                                           */
14 /*                                                                           */
15 /* This software is provided 'as-is', without any expressed or implied       */
16 /* warranty.  In no event will the authors be held liable for any damages    */
17 /* arising from the use of this software.                                    */
18 /*                                                                           */
19 /* Permission is granted to anyone to use this software for any purpose,     */
20 /* including commercial applications, and to alter it and redistribute it    */
21 /* freely, subject to the following restrictions:                            */
22 /*                                                                           */
23 /* 1. The origin of this software must not be misrepresented; you must not   */
24 /*    claim that you wrote the original software. If you use this software   */
25 /*    in a product, an acknowledgment in the product documentation would be  */
26 /*    appreciated but is not required.                                       */
27 /* 2. Altered source versions must be plainly marked as such, and must not   */
28 /*    be misrepresented as being the original software.                      */
29 /* 3. This notice may not be removed or altered from any source              */
30 /*    distribution.                                                          */
31 /*                                                                           */
32 /*****************************************************************************/
33
34
35
36 #ifndef _ACE_H
37 #define _ACE_H
38
39
40
41 /* Check for errors */
42 #if !defined(__ACE__)
43 #  error This module may only be used when compiling for the ACE os!
44 #endif
45
46
47
48 #include <stddef.h>
49
50
51
52 struct aceDirentBuf {
53     unsigned long   ad_size;            /* Size in bytes */
54     unsigned char   ad_date [8];        /* YY:YY:MM:DD:HH:MM:SS:TW */
55     char            ad_type [4];        /* File type as ASCIIZ string */
56     unsigned char   ad_flags;           /* File flags */
57     unsigned char   ad_usage;           /* More flags */
58     unsigned char   ad_namelen;         /* Length of name */
59     char            ad_name [17];       /* Name itself, ASCIIZ */
60 };
61
62 int __cdecl__ aceDirOpen (char* dir);
63 int __cdecl__ aceDirClose (int handle);
64 int __cdecl__ aceDirRead (int handle, struct aceDirentBuf* buf);
65
66 /* Type of an ACE key. Key in low byte, shift mask in high byte */
67 typedef unsigned int aceKey;
68
69 /* #defines for the shift mask returned by aceConGetKey */
70 #define aceSH_KEY               0x00FF  /* Mask key itself */
71 #define aceSH_MASK              0xFF00  /* Mask shift mask */
72 #define aceSH_EXT               0x2000  /* Extended key */
73 #define aceSH_CAPS              0x1000  /* Caps lock key */
74 #define aceSH_ALT               0x0800  /* Alternate key */
75 #define aceSH_CTRL              0x0400  /* Ctrl key */
76 #define aceSH_CBM               0x0200  /* Commodore key */
77 #define aceSH_SHIFT             0x0100  /* Shift key */
78
79 /* #defines for the options in aceConSetOpt/aceConGetOpt */
80 #define aceOP_PUTMASK           1       /* Console put mask */
81 #define aceOP_CHARCOLOR         2       /* Character color */
82 #define aceOP_CHARATTR          3       /* Character attribute */
83 #define aceOP_FILLCOLOR         4       /* Fill color */
84 #define aceOP_FILLATTR          5       /* Fill attribute */
85 #define aceOP_CRSCOLOR          6       /* Cursor color */
86 #define aceOP_CRSWRAP           7       /* Force cursor wrap */
87 #define aceOP_SHSCROLL          8       /* Shift keys for scrolling */
88 #define aceOP_MOUSCALE          9       /* Mouse scaling */
89 #define aceOP_RPTDELAY          10      /* Key repeat delay */
90 #define aceOP_RPTRATE           11      /* Key repeat rate */
91
92 /* Console functions */
93 void __cdecl__ aceConWrite (char* buf, size_t count);
94 void __cdecl__ aceConPutLit (int c);
95 void __cdecl__ aceConPos (unsigned x, unsigned y);
96 void __cdecl__ aceConGetPos (unsigned* x, unsigned* y);
97 unsigned aceConGetX (void);
98 unsigned aceConGetY (void);
99 char __cdecl__* aceConInput (char* buf, unsigned initial);
100 int aceConStopKey (void);
101 aceKey aceConGetKey (void);
102 int __cdecl__ aceConKeyAvail (aceKey* key);
103 void __cdecl__ aceConKeyMat (char* matrix);
104 void __cdecl__ aceConSetOpt (unsigned char opt, unsigned char val);
105 int __cdecl__ aceConGetOpt (unsigned char opt);
106
107 /* Misc stuff */
108 int __cdecl__ aceMiscIoPeek (unsigned addr);
109 void __cdecl__ aceMiscIoPoke (unsigned addr, unsigned char val);
110
111
112
113 /* End of ace.h */
114 #endif
115
116
117