Subject: [stella] More Clock Woes From: crackers@xxxxxxxx Date: Fri, 3 Oct 1997 03:39:29 -0400 (EDT) |
Well I'm doing some experiments with time keeping programmes to incorporate into my V-pet. I've been useing two sprites to display the time each one displays two numbers. The sprite data is stores like this. 111__111 1_1__1_1 1_1__1_1 111__111 1_1__1_1 1_1__1_1 111__111 So that there's two copies of each number in each data block. Then I use a series of ands and ors to select which bits from which blocks I want to make my time numbers. But I seem to be screwing up somewhere because things arn't quite working the way I want them to. The minutes display okay, but for the hours I only get the last 4 bits It's probably a stupid mistake, but a fresh pair of eyes would help right now. Here's an example of my code which generated the data for the display. ---------------------------------------------------------------------------- time ldy #06 ;just load Y ahead of time for #of sprite lines lda #$3C ;60 sbc MINS ;subtract the clock minutes from 60 to get the sta RMINS ;real minutes since clock counts down cmp #$00 ;see if it's 00 minutes beq min0 cmp #$32 ;see if it's more than 50 minutes bpl min5 cmp #$28 ;see if it's more than 40 minutes bpl min4 cmp #$1E ;see if it's more than 30 minutes bpl min3 cmp #$14 ;see if it's more than 20 minutes bpl min2 cmp #$0A ;see if it's more than 10 minutes bpl min1 min0 lda zeros,y ;minutes must be less than 10 so load 00 sprite and #$F0 ;strip the first 4 bits sta SPRITEA,y ;store it to sprite A memory dey bpl min0 ;get next sprite line lda #$00 ;less than 10 minutes jmp minload ;go to where we load the first 4 bits of sprite min5 lda fives,y ;minutes must be 50+ so load 55 sprite and #$F0 ;strip 1st four bits sta SPRITEA,y ;store it to sprite A memory dey bpl min5 ;get next sprite line lda #$32 ;50+ minutes jmp minload etc. etc. for min4,3,2,1 minload STA TEMP LDA RMINS SBC TEMP ASL TAX LDA numblk,x sta TEMP lda numblk+1,x sta TEMP+1 ldy #$06 msload lda (TEMP),y and #$0F ora SPRITEA,y sta SPRITEA,y dey bpl msload ldy #$06 lda #$18 SBC HOURS STA RHOURS beq hour0 cmp #$14 bpl hour2 cmp #$0A bpl hour1 hour0 lda zeros,y and $F0 sta SPRITEB,y dey bpl hour0 lda #$00 jmp loadhrs hour1 lda ones,y and $F0 sta SPRITEB,y dey bpl hour1 lda #$0A jmp loadhrs hour2 lda twos,y and $F0 sta SPRITEB,y dey bpl hour2 lda #$14 jmp loadhrs loadhrs STA TEMP LDA RHOURS SBC TEMP asl tax lda numblk,x sta TEMP lda numblk+1,x sta TEMP+1 ldy #$06 hsload lda (TEMP),y and #$0F ora SPRITEB,y sta SPRITEB,y dey bpl hsload rts numblk .word zeros .word ones .word twos .word threes .word fours .word fives .word sixes .word sevens .word eights .word nines ---------------------------------------------------------------------------- As well, I've noticed another little problem with the decreasing clock counter. Whenever the hour changes, it takes 2 minutes for the minutes to change from 00 to 01. Is this something wrong with the clock counter, or is this something in my display data generator that's causing this? CRACKERS (very sleepy and going to bed 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 |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [stella] Does this look right? , Chris Wilkson - MCD | Thread | Re: [stella] More Clock Woes, Greg Miller |
Re: [stella] Does this look right? , Matthew B. Vigor | Date | Re: [stella] Does this look right? , crackers |
Month |