]> git.sur5r.net Git - cc65/commitdiff
Fixed a problem with clock() (Greg King)
authorcuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Mon, 5 May 2003 08:20:07 +0000 (08:20 +0000)
committercuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Mon, 5 May 2003 08:20:07 +0000 (08:20 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@2147 b7a2c559-68d2-44c3-8de9-860c34a00d81

libsrc/nes/clock.s

index b36735e854520e902fe00afe89be3916f871a85a..825283c9d7d3b5880cfeaa3172cd42d27a4c7731 100644 (file)
@@ -1,6 +1,11 @@
 ;
+; clock.s
+;
 ; Written by Groepaz/Hitmen <groepaz@gmx.net>
 ; Cleanup by Ullrich von Bassewitz <uz@cc65.org>
+; 2003-05-02, Greg King <gngking@erols.com>
+;
+; #include <time.h>
 ;
 ; clock_t clock (void);
 ;
         ldy            #0              ; High word is always zero
                sty     sreg+1
                sty     sreg
-        ldx     tickcount+1    ; ## Problem: Cannot disable ints here
+L1:     ldx     tickcount+1
         lda     tickcount
+        cpx     tickcount+1     ; Did tickcount change?
+        bne     L1              ; Yes, re-read it
                rts
 
 .endproc