]> git.sur5r.net Git - cc65/blob - asminc/tgi-kernel.inc
Use "override" when appending to CFLAGS, so this works even when CFLAGS is
[cc65] / asminc / tgi-kernel.inc
1 ;*****************************************************************************/
2 ;*                                                                           */
3 ;*                                tgi-kernel.inc                             */
4 ;*                                                                           */
5 ;*                             TGI kernel interface                          */
6 ;*                                                                           */
7 ;*                                                                           */
8 ;*                                                                           */
9 ;* (C) 2002-2004 Ullrich von Bassewitz                                       */
10 ;*               Römerstraße 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 ;------------------------------------------------------------------------------
37 ; The driver header
38
39 .struct TGI_HDR
40         ID                  .byte   3   ; Contains 0x74, 0x67, 0x69 ("tgi")
41         VERSION             .byte   1   ; Interface version
42         VARS                .struct
43             XRES            .word   1   ; X resolution
44             YRES            .word   1   ; Y resolution
45             COLORCOUNT      .byte   1   ; Number of available colors
46             PAGECOUNT       .byte   1   ; Number of screens available
47             FONTSIZE_X      .byte   1   ; System font size in X direction
48             FONTSIZE_Y      .byte   1   ; System font size in Y direction
49         .endstruct
50         RESERVED            .byte   4   ; Reserved for extensions
51         JUMPTAB             .struct
52             INSTALL         .addr       ; INSTALL routine
53             UNINSTALL       .addr       ; UNINSTALL routine
54             INIT            .addr       ; INIT routine
55             DONE            .addr       ; DONE routine
56             GETERROR        .addr       ; GETERROR routine
57             CONTROL         .addr       ; CONTROL routine
58             CLEAR           .addr       ; CLEAR routine
59             SETVIEWPAGE     .addr       ; SETVIEWPAGE routine
60             SETDRAWPAGE     .addr       ; SETDRAWPAGE routine
61             SETCOLOR        .addr       ; SETCOLOR routine
62             SETPALETTE      .addr       ; SETPALETTE routine
63             GETPALETTE      .addr       ; GETPALETTE routine
64             GETDEFPALETTE   .addr       ; GETDEFPALETTE routine
65             SETPIXEL        .addr       ; SETPIXEL routine
66             GETPIXEL        .addr       ; GETPIXEL routine
67             LINE            .addr       ; LINE routine
68             BAR             .addr       ; BAR routine
69             CIRCLE          .addr       ; CIRCLE routine
70             TEXTSTYLE       .addr       ; TEXTSTYLE routine
71             OUTTEXT         .addr       ; OUTTEXT routine
72             IRQ             .addr       ; IRQ routine
73         .endstruct
74 .endstruct
75
76 ;------------------------------------------------------------------------------
77 ; The TGI API version, stored at TGI_HDR_VERSION
78
79 TGI_API_VERSION         = $02
80
81 ;------------------------------------------------------------------------------
82 ; Text style constants
83
84 TGI_TEXT_HORIZONTAL     = 0
85 TGI_TEXT_VERTICAL       = 1
86
87 ;------------------------------------------------------------------------------
88 ; Variables
89
90         .global _tgi_drv                ; Pointer to driver
91         .global _tgi_error              ; Last error code
92         .global _tgi_gmode              ; Flag: graphics mode active
93         .global _tgi_curx               ; Current drawing cursor X
94         .global _tgi_cury               ; Current drawing cursor Y
95         .global _tgi_color              ; Current drawing color
96         .global _tgi_textdir            ; Current text direction
97         .global _tgi_textmagx           ; Text magnification in X dir
98         .global _tgi_textmagy           ; Text magnification in Y dir
99         .global _tgi_xres               ; X resolution of the current mode
100         .global _tgi_yres               ; Y resolution of the current mode
101         .global _tgi_colorcount         ; Number of available colors
102         .global _tgi_pagecount          ; Number of available screen pages
103         .global _tgi_fontsizex          ; System font X size
104         .global _tgi_fontsizey          ; System font Y size
105
106 ;------------------------------------------------------------------------------
107 ; Driver entry points
108
109         .global tgi_install
110         .global tgi_uninstall
111         .global tgi_init
112         .global tgi_done
113         .global tgi_geterror
114         .global tgi_control
115         .global tgi_clear
116         .global tgi_setviewpage
117         .global tgi_setdrawpage
118         .global tgi_setcolor
119         .global tgi_setpalette
120         .global tgi_getpalette
121         .global tgi_getdefpalette
122         .global tgi_setpixel
123         .global tgi_getpixel
124         .global tgi_line
125         .global tgi_bar
126         .global tgi_circle
127         .global tgi_textstyle
128         .global tgi_outtext
129
130 ;------------------------------------------------------------------------------
131 ; ASM functions
132
133         .global tgi_getset
134         .global tgi_inv_arg
135         .global tgi_inv_drv
136         .global tgi_linepop
137         .global tgi_set_ptr
138         .global tgi_popxy
139         .global tgi_popxy2
140         .global tgi_curtoxy
141
142 ;------------------------------------------------------------------------------
143 ; C callable functions
144
145         .global _tgi_load
146         .global _tgi_load_driver
147         .global _tgi_unload
148         .global _tgi_install
149         .global _tgi_uninstall
150         .global _tgi_init
151         .global _tgi_ioctl
152         .global _tgi_done
153         .global _tgi_geterror
154         .global _tgi_geterrormsg
155         .global _tgi_clear
156         .global _tgi_getpagecount
157         .global _tgi_setviewpage
158         .global _tgi_setdrawpage
159         .global _tgi_getcolorcount
160         .global _tgi_getmaxcolor
161         .global _tgi_setcolor
162         .global _tgi_getcolor
163         .global _tgi_setpalette
164         .global _tgi_getpalette
165         .global _tgi_getdefpalette
166         .global _tgi_getxres
167         .global _tgi_getmaxx
168         .global _tgi_getyres
169         .global _tgi_getmaxy
170         .global _tgi_getpixel
171         .global _tgi_setpixel
172         .global _tgi_gotoxy
173         .global _tgi_line
174         .global _tgi_lineto
175         .global _tgi_circle
176         .global _tgi_bar
177         .global _tgi_textstyle
178         .global _tgi_textwidth
179         .global _tgi_textheight
180         .global _tgi_outtext
181         .global _tgi_outtextxy
182
183