From 5fec8ac5c30112571bd91a702a77072f494f43b8 Mon Sep 17 00:00:00 2001 From: cuz Date: Thu, 3 Oct 2002 13:54:42 +0000 Subject: [PATCH] Don't call the driver if we don't have one loaded git-svn-id: svn://svn.cc65.org/cc65/trunk@1431 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- libsrc/tgi/tgi_geterror.s | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libsrc/tgi/tgi_geterror.s b/libsrc/tgi/tgi_geterror.s index 0aa12e17c..569d6c276 100644 --- a/libsrc/tgi/tgi_geterror.s +++ b/libsrc/tgi/tgi_geterror.s @@ -11,11 +11,14 @@ .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 -- 2.39.5