[stella] Does this look right? (clock)

Subject: [stella] Does this look right? (clock)
From: crackers@xxxxxxxx
Date: Wed, 1 Oct 1997 17:16:53 -0400 (EDT)
Well, I'll need a clock for my virtual pet game, and unfortunately the
2600 does not have a time clock like the C-64. But I'm hoping this code
(stuck first thing into the overscan) will accomplish my time keeping
needs. Is there an easier way to do this?

----------------------------------------------------------------------------

	lda  FRAMES	
	cmp  #$3C	;60 frames = 1 second (change to 50 for PAL)
	bmi  upfrm
	lda  #$00
	sta  FRAMES
	lda  SECS
	cmp  #$32	;60 seconds
	bmi  upsec
	lda  #$00
	sta  SECS
	lda  MINS
	cmp  #$32	;60 minutes
	bmi  upmin
	lda  #$00
	sta  MINS
	lda  HOURS
	cmp  #$18	;24 hours
	bmi  uphrs
	lda  #$00
	sta  HOURS
	inc  DAYS	;new day
	jmp  upfrm
	
upsec	inc  SECS
	lda  SECS
	jmp  upfrm

upmin	inc  MINS
	jmp  upfrm

uphrs	inc  HOURS
	
upfrm	inc  FRAMES	;frame counter

-----------------------------------------------------------------------------

                                CRACKERS
                      (Time after time from hell!!!)


-- 

Accordionist - Wethifl Musician - Atari 2600 Collector | /\/\
*NEW CrAB URL* http://www.hwcn.org/~ad329/crab.html ***| \^^/
Bira Bira Devotee - FES Member - Samurai Pizza Cats Fan| =\/=


--
Archives updated once/day at http://www.biglist.com/lists/stella/archives/
Unsubscribing and other info at http://www.biglist.com/lists/stella/stella.html

Current Thread