.include "tgi-kernel.inc"
.include "tgi-error.inc"
- .import pushax
+ .import pushax, pusha, decax1
.importzp ptr1
+
+;----------------------------------------------------------------------------
+
+.code
.proc _tgi_init
jsr _tgi_done ; Switch off graphics if needed
inc _tgi_gmode ; Remember that graph mode is active
+; Get the maximum X and Y coordinate
+
+ jsr _tgi_getxres
+ jsr decax1
+ sta _tgi_xmax
+ stx _tgi_xmax+1
+
+ jsr _tgi_getyres
+ jsr decax1
+ sta _tgi_ymax
+ stx _tgi_ymax+1
+
; Do driver initialization. Set draw and view pages.
lda #0
; Set the drawing color to white
-@L1: lda TGI_COLOR_WHITE
+@L1: lda #TGI_COLOR_WHITE
jsr _tgi_setcolor ; tgi_setcolor (TGI_COLOR_WHITE);
; Set the text style
ldx #>$100
jsr pushax ; Width scale
jsr pushax ; Heigh scale
- jsr _tgi_textstyle ; A = Direction = TEXT_VERTICAL
+ jsr pusha ; Text direction = TGI_TEXT_VERTICAL
+ jsr _tgi_textstyle ; A = Font = TGI_FONT_BITMAP
; Clear the screen