]> git.sur5r.net Git - cc65/commitdiff
Fixed problem with tgi_init and tgi_setpalette
authorcuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Tue, 21 Oct 2003 10:03:09 +0000 (10:03 +0000)
committercuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Tue, 21 Oct 2003 10:03:09 +0000 (10:03 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@2553 b7a2c559-68d2-44c3-8de9-860c34a00d81

libsrc/tgi/tgi_init.s

index 4c521afba50a6cf8b611e1b7095351589f474a66..136f94f7ab5c6d33316eb60e5a96abe94c433f40 100644 (file)
 
         jsr     tgi_getdefpalette       ; Get the default palette into A/X
         sta     ptr1
-        stx     ptr1+1
-        ora     ptr1+1                  ; Do we have a default palette?
-        beq     @L1                     ; Jump if no
-        jsr     tgi_setpalette          ; Set the default palette
+        stx     ptr1+1                  ; Save it
+        jsr     tgi_geterror            ; Check for errors in getdefpalette
+        cmp     #TGI_ERR_OK
+        beq     @L1                     ; Jump if there is no default palette
+        jsr     tgi_setpalette          ; Set the default palette. Since we're
+                                        ; setting the default palette, we don't
+                                        ; expect errors here.
 
 ; Set the drawing color to the maximum color