| |
wozza
Registered: May 2003 Posts: 18 |
flashing and coloring a char logo
Hi guys, need a little help. (again)
Trying to code a routine that will change the color of a multi-color char logo via a table with the $d021,$d022,$d023 values stored.
I thought something like this : (call from irq)
time lda #$01
dec time+$01
lda time+$01
bne out
counter ldx #$00
lda logocoldata,x
sta colour1+$01
lda logocoldata+$01,x
sta colour2+$01
lda logocoldata+$02,x
sta colour3+$01
lda logocoldata+$03,x
sta time+$01
lda counter+$01
clc
adc #$03
sta counter+$01
cmp #$09
bcc out
...
etc
out rts
colour1 lda #$00
sta $d023
colour2 lda #$00
sta $d022
colour3 lda #$00
sta $d021
logocoldata
!byte $08,$08,$0f
!byte $02,$03,$09 etc..
All I get is slow increase in the colours and they seem out
of 'time' and not correctly displaying the next set of color
data.
What am I doing wrong and can you help.
Thanks in advance.
|
|
| |
chatGPZ
Registered: Dec 2001 Posts: 11386 |
the adc#3 should be adc #4 ? :) |
| |
TNT Account closed
Registered: Oct 2004 Posts: 189 |
Quote: the adc#3 should be adc #4 ? :)
Alternatively change clc to sec just to confuse everyone (including yourself) :)
No matter how you bump counter by 4 your routine works better if you actually add the time field to your data lines. |
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
also you dont need lda time+1, because dec will set Z bit for bne out.
|
| |
Testa Account closed
Registered: Oct 2004 Posts: 197 |
dec fr+1 ;
fr lda #4 ;
bne end ;
lda #4 ;here you can control speed.
sta fr+1 ;
next ldx #0
lda data1,x
sta $d021
lda data2,x
sta $d022
lda data3,x
sta $d023
inx
cpx #? ;lengte of your color table.(+1).
bne con
ldx #0
con stx next+1
end rts
ofcourse use a interupt to run this.
greetings,
testa
|
| |
Testa Account closed
Registered: Oct 2004 Posts: 197 |
wozza, shit forgot to say that: (in your code)
logocoldata+$03
sta time+$01
fucks up your routine...
you put your colortable at the the timer adress!!!!
bye
|
| |
wozza
Registered: May 2003 Posts: 18 |
Stuff me! - really had some problems there didn't I.
Thanks gentlemen
I'll give it another shot or maybe a new approach - dunno. |