]> git.sur5r.net Git - cc65/blob - include/lynx.h
Lynx update including file routines that access a file system on a cartridge
[cc65] / include / lynx.h
1 /*****************************************************************************/
2 /*                                                                           */
3 /*                                  lynx.h                                   */
4 /*                                                                           */
5 /*                     Lynx system specific definitions                      */
6 /*                                                                           */
7 /*                                                                           */
8 /*                                                                           */
9 /* (C) 2003      Shawn Jefferson                                             */
10 /*                                                                           */
11 /* Adapted with many changes Ullrich von Bassewitz, 2004-10-09               */
12 /*                                                                           */
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 _LYNX_H
37 #define _LYNX_H
38
39
40
41 /* Check for errors */
42 #if !defined(__LYNX__)
43 #  error This module may only be used when compiling for the Lynx game console!
44 #endif
45
46
47
48 /*****************************************************************************/
49 /*                                   Data                                    */
50 /*****************************************************************************/
51
52
53
54 /* Color defines (default palette) */
55 #define COLOR_BLACK             0x00
56 #define COLOR_RED               0x01
57 #define COLOR_BLUE              0x02
58 #define COLOR_GREEN             0x03
59 #define COLOR_VIOLET            0x04
60 #define COLOR_PURPLE            COLOR_VIOLET
61 #define COLOR_CYAN              0x05
62 #define COLOR_PEAGREEN          0x06
63 #define COLOR_GREY              0x07
64 #define COLOR_NAVYBLUE          0x08
65 #define COLOR_LIGHTRED          0x09
66 #define COLOR_LIGHTBLUE         0x0A
67 #define COLOR_LIGHTGREEN        0x0B
68 #define COLOR_LIGHTPURPLE       0x0C
69 #define COLOR_LIGHTCYAN         0x0D
70 #define COLOR_YELLOW            0x0E
71 #define COLOR_WHITE             0x0F
72
73
74
75 /*****************************************************************************/
76 /*                           Accessing the cart                              */
77 /*****************************************************************************/
78
79
80
81 void __fastcall__ lynx_load (int fileno);
82 /* Load a file into ram. The first entry is fileno=0. */
83
84 void __fastcall__ lynx_exec (int fileno);
85 /* Load a file into ram and execute it. */
86
87
88
89 /*****************************************************************************/
90 /*                           Accessing the EEPROM                            */
91 /*****************************************************************************/
92
93
94
95 unsigned __fastcall__ lynx_eeprom_read (unsigned char cell);
96 /* Read a 16 bit word from the given address */
97
98 unsigned __fastcall__ lynx_eeprom_write (unsigned char cell, unsigned val);
99 /* Write the word at the given address */
100
101 void __fastcall__ lynx_eeprom_erase (unsigned char cell);
102 /* Clear the word at the given address */
103
104
105
106 /*****************************************************************************/
107 /*                           TGI extras                                      */
108 /*****************************************************************************/
109
110
111
112 #define tgi_sprite(spr) tgi_ioctl(0, spr)
113 #define tgi_flip() tgi_ioctl(1, (void*)0)
114 #define tgi_setbgcolor(bgcol) tgi_ioctl(2, (void*)(bgcol))
115 #define tgi_setframerate(rate) tgi_ioctl(3, (void*)(rate))
116 #define tgi_busy() tgi_ioctl(4, (void*)0)
117 #define tgi_updatedisplay() tgi_ioctl(4, (void*)1)
118 #define tgi_setcollisiondetection(active) tgi_ioctl(5, (void*)(active))
119
120
121
122 /* End of lynx.h */
123 #endif
124
125
126