]> git.sur5r.net Git - cc65/blobdiff - libsrc/tgi/tgi_init.s
Hold the maximum X and Y coordinate in variables instead of calculating them
[cc65] / libsrc / tgi / tgi_init.s
index 636c5aa16c7108d89b05c9e5ef51c861426a260d..99a64ba7632347d89c9c9128f3d95842244584b7 100644 (file)
@@ -8,9 +8,13 @@
         .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
@@ -39,7 +55,7 @@
 
 ; 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
@@ -48,7 +64,8 @@
         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