]> git.sur5r.net Git - cc65/blob - asminc/tgi-kernel.inc
a299d921a65ef3dc2d95aa3bddc765a78841fe54
[cc65] / asminc / tgi-kernel.inc
1 ;*****************************************************************************/
2 ;*                                                                           */
3 ;*                                tgi-kernel.inc                             */
4 ;*                                                                           */
5 ;*                             TGI kernel interface                          */
6 ;*                                                                           */
7 ;*                                                                           */
8 ;*                                                                           */
9 ;* (C) 2002-2003 Ullrich von Bassewitz                                       */
10 ;*               Römerstrasse 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 ; Offsets into the driver header
38
39 TGI_HDR_ID              = 0             ; Contains 0x74, 0x67, 0x69 ("tgi")
40 TGI_HDR_VERSION         = 3             ; Interface version
41 TGI_HDR_XRES            = 4             ; X resolution
42 TGI_HDR_YRES            = 6             ; Y resolution
43 TGI_HDR_COLORCOUNT      = 8             ; Number of available colors
44 TGI_HDR_PAGECOUNT       = 9             ; Number of screens available
45 TGI_HDR_FONTSIZE_X      = 10            ; System font size in X direction
46 TGI_HDR_FONTSIZE_Y      = 11            ; System font size in Y direction
47 TGI_HDR_RES             = 12            ; Reserved for extensions
48
49 TGI_HDR_JUMPTAB         = 16
50 TGI_HDR_INSTALL         = TGI_HDR_JUMPTAB+0     ; INSTALL routine
51 TGI_HDR_UNINSTALL       = TGI_HDR_JUMPTAB+2     ; UNINSTALL routine
52 TGI_HDR_INIT            = TGI_HDR_JUMPTAB+4     ; INIT routine
53 TGI_HDR_DONE            = TGI_HDR_JUMPTAB+6     ; DONE routine
54 TGI_HDR_GETERROR        = TGI_HDR_JUMPTAB+8     ; GETERROR routine
55 TGI_HDR_CONTROL         = TGI_HDR_JUMPTAB+10    ; CONTROL routine
56 TGI_HDR_CLEAR           = TGI_HDR_JUMPTAB+12    ; CLEAR routine
57 TGI_HDR_SETVIEWPAGE     = TGI_HDR_JUMPTAB+14    ; SETVIEWPAGE routine
58 TGI_HDR_SETDRAWPAGE     = TGI_HDR_JUMPTAB+16    ; SETDRAWPAGE routine
59 TGI_HDR_SETCOLOR        = TGI_HDR_JUMPTAB+18    ; SETCOLOR routine
60 TGI_HDR_SETPALETTE      = TGI_HDR_JUMPTAB+20    ; SETPALETTE routine
61 TGI_HDR_GETPALETTE      = TGI_HDR_JUMPTAB+22    ; GETPALETTE routine
62 TGI_HDR_GETDEFPALETTE   = TGI_HDR_JUMPTAB+24    ; GETDEFPALETTE routine
63 TGI_HDR_SETPIXEL        = TGI_HDR_JUMPTAB+26    ; SETPIXEL routine
64 TGI_HDR_GETPIXEL        = TGI_HDR_JUMPTAB+28    ; GETPIXEL routine
65 TGI_HDR_HORLINE         = TGI_HDR_JUMPTAB+30    ; HORLINE routine
66 TGI_HDR_LINE            = TGI_HDR_JUMPTAB+32    ; LINE routine
67 TGI_HDR_BAR             = TGI_HDR_JUMPTAB+34    ; BAR routine
68 TGI_HDR_CIRCLE          = TGI_HDR_JUMPTAB+36    ; CIRCLE routine
69 TGI_HDR_TEXTSTYLE       = TGI_HDR_JUMPTAB+39    ; TEXTSTYLE routine
70 TGI_HDR_OUTTEXT         = TGI_HDR_JUMPTAB+42    ; OUTTEXT routine
71
72 TGI_HDR_JUMPCOUNT       = 21            ; Number of jump vectors
73
74 ;------------------------------------------------------------------------------
75 ; Text style constants
76
77 TGI_TEXT_HORIZONTAL     = 0
78 TGI_TEXT_VERTICAL       = 1
79
80 ;------------------------------------------------------------------------------
81 ; Variables
82
83         .global _tgi_drv                ; Pointer to driver
84         .global _tgi_error              ; Last error code
85         .global _tgi_gmode              ; Flag: graphics mode active
86         .global _tgi_curx               ; Current drawing cursor X
87         .global _tgi_cury               ; Current drawing cursor Y
88         .global _tgi_color              ; Current drawing color
89         .global _tgi_textdir            ; Current text direction
90         .global _tgi_textmagx           ; Text magnification in X dir
91         .global _tgi_textmagy           ; Text magnification in Y dir
92         .global _tgi_xres               ; X resolution of the current mode
93         .global _tgi_yres               ; Y resolution of the current mode
94         .global _tgi_colorcount         ; Number of available colors
95         .global _tgi_pagecount          ; Number of available screen pages
96         .global _tgi_fontsizex          ; System font X size
97         .global _tgi_fontsizey          ; System font Y size
98
99 ;------------------------------------------------------------------------------
100 ; Driver entry points
101
102         .global tgi_install
103         .global tgi_uninstall
104         .global tgi_init
105         .global tgi_done
106         .global tgi_geterror
107         .global tgi_control
108         .global tgi_clear
109         .global tgi_setviewpage
110         .global tgi_setdrawpage
111         .global tgi_setcolor
112         .global tgi_setpalette
113         .global tgi_getpalette
114         .global tgi_getdefpalette
115         .global tgi_setpixel
116         .global tgi_getpixel
117         .global tgi_horline
118         .global tgi_line
119         .global tgi_bar
120         .global tgi_circle
121         .global tgi_textstyle
122         .global tgi_outtext
123
124 ;------------------------------------------------------------------------------
125 ; ASM functions
126
127         .global tgi_emu_bar
128         .global tgi_getset
129         .global tgi_inv_arg
130         .global tgi_inv_drv
131         .global tgi_linepop
132         .global tgi_set_ptr
133         .global tgi_popxy
134         .global tgi_popxy2
135         .global tgi_curtoxy
136
137 ;------------------------------------------------------------------------------
138 ; C callable functions
139
140         .global _tgi_load
141         .global _tgi_load_driver
142         .global _tgi_unload
143         .global _tgi_install
144         .global _tgi_uninstall
145         .global _tgi_init
146         .global _tgi_done
147         .global _tgi_geterror
148         .global _tgi_clear
149         .global _tgi_getpagecount
150         .global _tgi_setviewpage
151         .global _tgi_setdrawpage
152         .global _tgi_getcolorcount
153         .global _tgi_getmaxcolor
154         .global _tgi_setcolor
155         .global _tgi_getcolor
156         .global _tgi_setpalette
157         .global _tgi_getpalette
158         .global _tgi_getdefpalette
159         .global _tgi_getxres
160         .global _tgi_getmaxx
161         .global _tgi_getyres
162         .global _tgi_getmaxy
163         .global _tgi_getpixel
164         .global _tgi_setpixel
165         .global _tgi_gotoxy
166         .global _tgi_line
167         .global _tgi_lineto
168         .global _tgi_circle
169         .global _tgi_bar
170         .global _tgi_textstyle
171         .global _tgi_textwidth
172         .global _tgi_textheight
173         .global _tgi_outtext
174         .global _tgi_outtextxy
175
176
177