]> git.sur5r.net Git - cc65/blobdiff - libsrc/atari/atari_tgi_common.inc
The spans do now contain the size of a span, no longer the end offset.
[cc65] / libsrc / atari / atari_tgi_common.inc
index 9e952099f6c7a7b69c2b3643deb337f13bcbb908..9e9f74aa4ddb9e1443b60a491a7557839bc61ea3 100644 (file)
@@ -25,6 +25,7 @@
        .byte   8                       ; System font X size
        .byte   8                       ; System font Y size
        .word   aspect                  ; Aspect ratio
+        .byte   0                       ; TGI driver flags
 
 ; Function table
 
@@ -168,9 +169,10 @@ search: tax
        sub     #$10
        bcs     search
 
-       ; No free IOCB
-       lda     #TGI_ERR_NO_IOCB
-       jmp     exit
+       ; Not enough resources available (free IOCB or memory)
+       ; enter with C cleared!
+nores: lda     #TGI_ERR_NO_RES
+       bcc     exit
 
 found: ; Check if enough RAM is available
        lda     #0
@@ -179,14 +181,10 @@ found:    ; Check if enough RAM is available
        lda     RAMTOP
        sbc     #>mem_needed
        cmp     APPMHI + 1
-       bcc     nomem
+       bcc     nores
        bne     switch
        cpy     APPMHI
-       bcs     switch
-
-       ; No memory
-nomem: lda     #TGI_ERR_NO_MEM
-       jmp     exit
+       bcc     nores                   ; not enough memory
 
        ; Switch into graphics mode
 switch:        lda     #OPEN