]> git.sur5r.net Git - cc65/blob - asminc/tgi-kernel.inc
The outcode constants from tgi_outcode went into this header file.
[cc65] / asminc / tgi-kernel.inc
1 ;*****************************************************************************/
2 ;*                                                                           */
3 ;*                                tgi-kernel.inc                             */
4 ;*                                                                           */
5 ;*                             TGI kernel interface                          */
6 ;*                                                                           */
7 ;*                                                                           */
8 ;*                                                                           */
9 ;* (C) 2002-2009, 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 ;------------------------------------------------------------------------------
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             FONTWIDTH       .byte   1   ; System font width
48             FONTHEIGHT      .byte   1   ; System font height
49             ASPECTRATIO     .word   1   ; Fixed point 8.8 format
50         .endstruct
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             TEXTSTYLE       .addr       ; TEXTSTYLE routine
70             OUTTEXT         .addr       ; OUTTEXT routine
71             IRQ             .addr       ; IRQ routine
72         .endstruct
73 .endstruct
74
75 ;------------------------------------------------------------------------------
76 ; The TGI API version, stored at TGI_HDR_VERSION
77
78 TGI_API_VERSION         = $03
79
80 ;------------------------------------------------------------------------------
81 ; Color and text constants
82
83 TGI_COLOR_BLACK         = 0
84 TGI_COLOR_WHITE         = 1
85
86 TGI_FONT_BITMAP         = 0
87 TGI_FONT_VECTOR         = 1
88
89 TGI_TEXT_HORIZONTAL     = 0
90 TGI_TEXT_VERTICAL       = 1  
91
92 ;----------------------------------------------------------------------------
93 ; Results of tgi_outcode
94
95 TGI_CLIP_NONE           = $00
96 TGI_CLIP_LEFT           = $01
97 TGI_CLIP_RIGHT          = $02
98 TGI_CLIP_BOTTOM         = $04
99 TGI_CLIP_TOP            = $08
100
101 ;------------------------------------------------------------------------------
102 ; C accessible Variables
103
104         .global _tgi_drv                ; Pointer to driver
105         .global _tgi_error              ; Last error code
106         .global _tgi_gmode              ; Flag: graphics mode active
107         .global _tgi_curx               ; Current drawing cursor X
108         .global _tgi_cury               ; Current drawing cursor Y
109         .global _tgi_color              ; Current drawing color
110         .global _tgi_font               ; Which font to use
111         .global _tgi_textdir            ; Current text direction
112         .global _tgi_vectorfont         ; Pointer to vector font
113         .global _tgi_textscalew         ; Text magnification for the width
114         .global _tgi_textscaleh         ; Text magnification for the height
115         .global _tgi_charwidth          ; Width of scaled system font char
116         .global _tgi_charheight         ; Height of scaled system font char
117         .global _tgi_xres               ; X resolution of the current mode
118         .global _tgi_yres               ; Y resolution of the current mode
119         .global _tgi_xmax               ; Maximum X coordinate
120         .global _tgi_ymax               ; Maximum Y coordinate
121         .global _tgi_colorcount         ; Number of available colors
122         .global _tgi_pagecount          ; Number of available screen pages
123         .global _tgi_fontwidth          ; System font width
124         .global _tgi_fontheight         ; System font height
125         .global _tgi_aspectratio        ; Aspect ratio, fixed point 8.8
126
127 ;------------------------------------------------------------------------------
128 ; ASM accessible Variables
129
130         .global tgi_clip_x1             ; Coordinate for line clipper
131         .global tgi_clip_y1             ; Coordinate for line clipper
132         .global tgi_clip_x2             ; Coordinate for line clipper
133         .global tgi_clip_y2             ; Coordinate for line clipper
134
135 ;------------------------------------------------------------------------------
136 ; Driver entry points
137
138         .global tgi_install
139         .global tgi_uninstall
140         .global tgi_init
141         .global tgi_done
142         .global tgi_geterror
143         .global tgi_control
144         .global tgi_clear
145         .global tgi_setviewpage
146         .global tgi_setdrawpage
147         .global tgi_setcolor
148         .global tgi_setpalette
149         .global tgi_getpalette
150         .global tgi_getdefpalette
151         .global tgi_setpixel
152         .global tgi_getpixel
153         .global tgi_line
154         .global tgi_bar
155         .global tgi_textstyle
156         .global tgi_outtext
157
158 ;------------------------------------------------------------------------------
159 ; ASM functions
160
161         .global tgi_clippedline
162         .global tgi_curtoxy
163         .global tgi_getset
164         .global tgi_imulround
165         .global tgi_inv_arg
166         .global tgi_inv_drv
167         .global tgi_linepop
168         .global tgi_outcode
169         .global tgi_popxy
170         .global tgi_popxy2
171         .global tgi_set_ptr
172
173 ;------------------------------------------------------------------------------
174 ; C callable functions
175
176         .global _tgi_arc
177         .global _tgi_bar
178         .global _tgi_circle
179         .global _tgi_clear
180         .global _tgi_done
181         .global _tgi_ellipse
182         .global _tgi_getcolor
183         .global _tgi_getcolorcount
184         .global _tgi_getdefpalette
185         .global _tgi_geterror
186         .global _tgi_geterrormsg
187         .global _tgi_getmaxcolor
188         .global _tgi_getmaxx
189         .global _tgi_getmaxy
190         .global _tgi_getpagecount
191         .global _tgi_getpalette
192         .global _tgi_getpixel
193         .global _tgi_getxres
194         .global _tgi_getyres
195         .global _tgi_gotoxy
196         .global _tgi_imulround
197         .global _tgi_init
198         .global _tgi_install
199         .global _tgi_install_vectorfont
200         .global _tgi_ioctl
201         .global _tgi_line
202         .global _tgi_lineto
203         .global _tgi_load
204         .global _tgi_load_driver
205         .global _tgi_outtext
206         .global _tgi_outtextxy
207         .global _tgi_pieslice
208         .global _tgi_setcolor
209         .global _tgi_setdrawpage
210         .global _tgi_setpalette
211         .global _tgi_setpixel
212         .global _tgi_setviewpage
213         .global _tgi_textheight
214         .global _tgi_textscale
215         .global _tgi_textstyle
216         .global _tgi_textwidth
217         .global _tgi_uninstall
218         .global _tgi_unload