.byte 8 ; System font X size
.byte 8 ; System font Y size
.word aspect ; Aspect ratio
+ .byte 0 ; TGI driver flags
; Function table
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
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