2002-06-21 12:00:45 +00:00
|
|
|
|
;*****************************************************************************/
|
|
|
|
|
;* */
|
|
|
|
|
;* tgi-kernel.inc */
|
|
|
|
|
;* */
|
|
|
|
|
;* TGI kernel interface */
|
|
|
|
|
;* */
|
|
|
|
|
;* */
|
|
|
|
|
;* */
|
2004-06-15 09:08:39 +00:00
|
|
|
|
;* (C) 2002-2004 Ullrich von Bassewitz */
|
2003-11-12 15:54:41 +00:00
|
|
|
|
;* R<EFBFBD>merstra<EFBFBD>e 52 */
|
2003-02-11 12:37:46 +00:00
|
|
|
|
;* D-70794 Filderstadt */
|
|
|
|
|
;* EMail: uz@cc65.org */
|
2002-06-21 12:00:45 +00:00
|
|
|
|
;* */
|
|
|
|
|
;* */
|
|
|
|
|
;* This software is provided 'as-is', without any expressed or implied */
|
|
|
|
|
;* warranty. In no event will the authors be held liable for any damages */
|
|
|
|
|
;* arising from the use of this software. */
|
|
|
|
|
;* */
|
|
|
|
|
;* Permission is granted to anyone to use this software for any purpose, */
|
|
|
|
|
;* including commercial applications, and to alter it and redistribute it */
|
|
|
|
|
;* freely, subject to the following restrictions: */
|
|
|
|
|
;* */
|
|
|
|
|
;* 1. The origin of this software must not be misrepresented; you must not */
|
|
|
|
|
;* claim that you wrote the original software. If you use this software */
|
|
|
|
|
;* in a product, an acknowledgment in the product documentation would be */
|
|
|
|
|
;* appreciated but is not required. */
|
|
|
|
|
;* 2. Altered source versions must be plainly marked as such, and must not */
|
|
|
|
|
;* be misrepresented as being the original software. */
|
|
|
|
|
;* 3. This notice may not be removed or altered from any source */
|
|
|
|
|
;* distribution. */
|
|
|
|
|
;* */
|
|
|
|
|
;*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2002-06-21 12:46:52 +00:00
|
|
|
|
;------------------------------------------------------------------------------
|
2002-06-21 12:00:45 +00:00
|
|
|
|
; Offsets into the driver header
|
2002-06-21 12:46:52 +00:00
|
|
|
|
|
2002-06-21 12:00:45 +00:00
|
|
|
|
TGI_HDR_ID = 0 ; Contains 0x74, 0x67, 0x69 ("tgi")
|
|
|
|
|
TGI_HDR_VERSION = 3 ; Interface version
|
|
|
|
|
TGI_HDR_XRES = 4 ; X resolution
|
|
|
|
|
TGI_HDR_YRES = 6 ; Y resolution
|
2002-06-22 21:40:24 +00:00
|
|
|
|
TGI_HDR_COLORCOUNT = 8 ; Number of available colors
|
|
|
|
|
TGI_HDR_PAGECOUNT = 9 ; Number of screens available
|
2002-10-03 11:18:49 +00:00
|
|
|
|
TGI_HDR_FONTSIZE_X = 10 ; System font size in X direction
|
|
|
|
|
TGI_HDR_FONTSIZE_Y = 11 ; System font size in Y direction
|
|
|
|
|
TGI_HDR_RES = 12 ; Reserved for extensions
|
2002-06-21 12:46:52 +00:00
|
|
|
|
|
|
|
|
|
TGI_HDR_JUMPTAB = 16
|
|
|
|
|
TGI_HDR_INSTALL = TGI_HDR_JUMPTAB+0 ; INSTALL routine
|
2003-02-11 12:37:46 +00:00
|
|
|
|
TGI_HDR_UNINSTALL = TGI_HDR_JUMPTAB+2 ; UNINSTALL routine
|
2002-06-21 12:46:52 +00:00
|
|
|
|
TGI_HDR_INIT = TGI_HDR_JUMPTAB+4 ; INIT routine
|
2002-06-21 14:16:32 +00:00
|
|
|
|
TGI_HDR_DONE = TGI_HDR_JUMPTAB+6 ; DONE routine
|
2002-07-07 10:30:31 +00:00
|
|
|
|
TGI_HDR_GETERROR = TGI_HDR_JUMPTAB+8 ; GETERROR routine
|
|
|
|
|
TGI_HDR_CONTROL = TGI_HDR_JUMPTAB+10 ; CONTROL routine
|
|
|
|
|
TGI_HDR_CLEAR = TGI_HDR_JUMPTAB+12 ; CLEAR routine
|
|
|
|
|
TGI_HDR_SETVIEWPAGE = TGI_HDR_JUMPTAB+14 ; SETVIEWPAGE routine
|
|
|
|
|
TGI_HDR_SETDRAWPAGE = TGI_HDR_JUMPTAB+16 ; SETDRAWPAGE routine
|
|
|
|
|
TGI_HDR_SETCOLOR = TGI_HDR_JUMPTAB+18 ; SETCOLOR routine
|
|
|
|
|
TGI_HDR_SETPALETTE = TGI_HDR_JUMPTAB+20 ; SETPALETTE routine
|
|
|
|
|
TGI_HDR_GETPALETTE = TGI_HDR_JUMPTAB+22 ; GETPALETTE routine
|
|
|
|
|
TGI_HDR_GETDEFPALETTE = TGI_HDR_JUMPTAB+24 ; GETDEFPALETTE routine
|
|
|
|
|
TGI_HDR_SETPIXEL = TGI_HDR_JUMPTAB+26 ; SETPIXEL routine
|
|
|
|
|
TGI_HDR_GETPIXEL = TGI_HDR_JUMPTAB+28 ; GETPIXEL routine
|
2003-11-12 15:54:41 +00:00
|
|
|
|
TGI_HDR_LINE = TGI_HDR_JUMPTAB+30 ; LINE routine
|
|
|
|
|
TGI_HDR_BAR = TGI_HDR_JUMPTAB+32 ; BAR routine
|
|
|
|
|
TGI_HDR_CIRCLE = TGI_HDR_JUMPTAB+34 ; CIRCLE routine
|
|
|
|
|
TGI_HDR_TEXTSTYLE = TGI_HDR_JUMPTAB+36 ; TEXTSTYLE routine
|
|
|
|
|
TGI_HDR_OUTTEXT = TGI_HDR_JUMPTAB+38 ; OUTTEXT routine
|
2002-06-21 12:46:52 +00:00
|
|
|
|
|
2003-11-12 15:54:41 +00:00
|
|
|
|
TGI_HDR_JUMPCOUNT = 20 ; Number of jump vectors
|
2002-10-03 11:18:49 +00:00
|
|
|
|
|
2003-10-23 09:04:39 +00:00
|
|
|
|
;------------------------------------------------------------------------------
|
|
|
|
|
; The TGI API version, stored at TGI_HDR_VERSION
|
|
|
|
|
|
|
|
|
|
TGI_API_VERSION = $01
|
|
|
|
|
|
2002-10-03 11:18:49 +00:00
|
|
|
|
;------------------------------------------------------------------------------
|
|
|
|
|
; Text style constants
|
|
|
|
|
|
|
|
|
|
TGI_TEXT_HORIZONTAL = 0
|
|
|
|
|
TGI_TEXT_VERTICAL = 1
|
2002-06-21 12:46:52 +00:00
|
|
|
|
|
|
|
|
|
;------------------------------------------------------------------------------
|
|
|
|
|
; Variables
|
|
|
|
|
|
|
|
|
|
.global _tgi_drv ; Pointer to driver
|
|
|
|
|
.global _tgi_error ; Last error code
|
2002-12-29 20:59:34 +00:00
|
|
|
|
.global _tgi_gmode ; Flag: graphics mode active
|
2002-06-22 21:40:24 +00:00
|
|
|
|
.global _tgi_curx ; Current drawing cursor X
|
|
|
|
|
.global _tgi_cury ; Current drawing cursor Y
|
|
|
|
|
.global _tgi_color ; Current drawing color
|
2002-10-03 11:18:49 +00:00
|
|
|
|
.global _tgi_textdir ; Current text direction
|
|
|
|
|
.global _tgi_textmagx ; Text magnification in X dir
|
|
|
|
|
.global _tgi_textmagy ; Text magnification in Y dir
|
2002-06-21 21:15:46 +00:00
|
|
|
|
.global _tgi_xres ; X resolution of the current mode
|
2002-06-22 21:40:24 +00:00
|
|
|
|
.global _tgi_yres ; Y resolution of the current mode
|
|
|
|
|
.global _tgi_colorcount ; Number of available colors
|
|
|
|
|
.global _tgi_pagecount ; Number of available screen pages
|
2002-10-03 11:18:49 +00:00
|
|
|
|
.global _tgi_fontsizex ; System font X size
|
|
|
|
|
.global _tgi_fontsizey ; System font Y size
|
2002-06-21 12:46:52 +00:00
|
|
|
|
|
|
|
|
|
;------------------------------------------------------------------------------
|
|
|
|
|
; Driver entry points
|
|
|
|
|
|
|
|
|
|
.global tgi_install
|
2003-02-11 12:37:46 +00:00
|
|
|
|
.global tgi_uninstall
|
2002-06-21 12:46:52 +00:00
|
|
|
|
.global tgi_init
|
2002-06-21 14:16:32 +00:00
|
|
|
|
.global tgi_done
|
2002-07-07 10:30:31 +00:00
|
|
|
|
.global tgi_geterror
|
2002-06-21 12:46:52 +00:00
|
|
|
|
.global tgi_control
|
|
|
|
|
.global tgi_clear
|
2002-06-22 21:40:24 +00:00
|
|
|
|
.global tgi_setviewpage
|
|
|
|
|
.global tgi_setdrawpage
|
2002-06-21 12:46:52 +00:00
|
|
|
|
.global tgi_setcolor
|
2002-07-07 10:30:31 +00:00
|
|
|
|
.global tgi_setpalette
|
|
|
|
|
.global tgi_getpalette
|
|
|
|
|
.global tgi_getdefpalette
|
2002-06-21 12:46:52 +00:00
|
|
|
|
.global tgi_setpixel
|
|
|
|
|
.global tgi_getpixel
|
|
|
|
|
.global tgi_line
|
|
|
|
|
.global tgi_bar
|
|
|
|
|
.global tgi_circle
|
2002-10-03 11:18:49 +00:00
|
|
|
|
.global tgi_textstyle
|
|
|
|
|
.global tgi_outtext
|
2002-06-21 12:46:52 +00:00
|
|
|
|
|
|
|
|
|
;------------------------------------------------------------------------------
|
|
|
|
|
; ASM functions
|
2002-06-21 12:00:45 +00:00
|
|
|
|
|
2002-06-22 21:40:24 +00:00
|
|
|
|
.global tgi_getset
|
|
|
|
|
.global tgi_inv_arg
|
2003-02-11 12:37:46 +00:00
|
|
|
|
.global tgi_inv_drv
|
2002-06-22 21:40:24 +00:00
|
|
|
|
.global tgi_linepop
|
2002-06-21 12:46:52 +00:00
|
|
|
|
.global tgi_set_ptr
|
2002-10-03 11:18:49 +00:00
|
|
|
|
.global tgi_popxy
|
|
|
|
|
.global tgi_popxy2
|
|
|
|
|
.global tgi_curtoxy
|
|
|
|
|
|
2003-02-11 12:37:46 +00:00
|
|
|
|
;------------------------------------------------------------------------------
|
|
|
|
|
; C callable functions
|
|
|
|
|
|
|
|
|
|
.global _tgi_load
|
|
|
|
|
.global _tgi_load_driver
|
|
|
|
|
.global _tgi_unload
|
|
|
|
|
.global _tgi_install
|
|
|
|
|
.global _tgi_uninstall
|
|
|
|
|
.global _tgi_init
|
|
|
|
|
.global _tgi_done
|
|
|
|
|
.global _tgi_geterror
|
2004-06-15 09:08:39 +00:00
|
|
|
|
.global _tgi_geterrormsg
|
2003-02-11 12:37:46 +00:00
|
|
|
|
.global _tgi_clear
|
|
|
|
|
.global _tgi_getpagecount
|
|
|
|
|
.global _tgi_setviewpage
|
|
|
|
|
.global _tgi_setdrawpage
|
|
|
|
|
.global _tgi_getcolorcount
|
|
|
|
|
.global _tgi_getmaxcolor
|
|
|
|
|
.global _tgi_setcolor
|
|
|
|
|
.global _tgi_getcolor
|
|
|
|
|
.global _tgi_setpalette
|
|
|
|
|
.global _tgi_getpalette
|
|
|
|
|
.global _tgi_getdefpalette
|
|
|
|
|
.global _tgi_getxres
|
|
|
|
|
.global _tgi_getmaxx
|
|
|
|
|
.global _tgi_getyres
|
|
|
|
|
.global _tgi_getmaxy
|
|
|
|
|
.global _tgi_getpixel
|
|
|
|
|
.global _tgi_setpixel
|
|
|
|
|
.global _tgi_gotoxy
|
|
|
|
|
.global _tgi_line
|
|
|
|
|
.global _tgi_lineto
|
|
|
|
|
.global _tgi_circle
|
|
|
|
|
.global _tgi_bar
|
|
|
|
|
.global _tgi_textstyle
|
|
|
|
|
.global _tgi_textwidth
|
|
|
|
|
.global _tgi_textheight
|
|
|
|
|
.global _tgi_outtext
|
|
|
|
|
.global _tgi_outtextxy
|
|
|
|
|
|
|
|
|
|
|