]> git.sur5r.net Git - cc65/commitdiff
Don't call the driver if we don't have one loaded
authorcuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Thu, 3 Oct 2002 13:54:42 +0000 (13:54 +0000)
committercuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Thu, 3 Oct 2002 13:54:42 +0000 (13:54 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@1431 b7a2c559-68d2-44c3-8de9-860c34a00d81

libsrc/tgi/tgi_geterror.s

index 0aa12e17c187cc794687ee01a3d8c8481dd17ec9..569d6c27675ba5b0c42f52d2ddeaaaa6c5bcd223 100644 (file)
         .export         _tgi_geterror
 
 _tgi_geterror:
+        lda     _tgi_drv                ; Check if we have a driver
+        ora     _tgi_drv+1
+        beq     @L1
         jsr     tgi_geterror            ; First call driver
-        ldx     #$00                    ; Clear high byte
+@L1:    ldx     #$00                    ; Clear high byte
         ldy     _tgi_error              ; Test high level error code
-        beq     @L1                     ; Branch if no high level error code
+        beq     @L2                     ; Branch if no high level error code
         tya                             ; Use high level code if we have one
         stx     _tgi_error              ; Clear high level error code
-@L1:    rts
+@L2:    rts