You're welcome.
I couldn't completely understand your code due to the spanish comments (as long as you understand them!) but here's how I would accomplish what you did:
With two, nested loops:
ldy #24
OuterLoop
ldx #LIGHTCOLOR
InnerLoop
sta WSYNC
stx COLUBK
dex
dex
cpx #DARKCOLOR
bne InnerLoop
dey
bne Outerloop
907265[/snapback]
Bob :
Very Impresive,,,,with only some lines you showed how to make a background like I wanted. So in order that you could understand a little bit what I tried to document "comments", in my program, I have just translated those comments to English (I hope that you could understand).
I appreciate a lot the time that you are spending on me.
Inicializar
ldy #173 ;begin with light blue
lda #0 ;load the Acumulator with zeros
sta TIEMPO ;initialize TIME var with zeros
Picture
sty COLUBK ;apply background color
inc TIEMPO ;inc, TIEMPO variable (width horizontal stripes)
sty COLOR ;stores current color in COLOR variable
ldy TIEMPO ;load "y", with TIEMPO value
cpy #5 ;Did it pass five scanlines?
bne no_decrementar ;NOP?, then, we must go to "no_decrementar" label
;YES?, the program flow continues here
;here (if we count 5 times, we must initialize TIEMPO)
;--------------------------------------------------------------------------
; This little section of the program is to decrement the "y" register
; in order to apply a darknest color in the background
;--------------------------------------------------------------------------
ldy COLOR ;we rescue COLOR value in "y" register
dey ;decrement the background color
sty COLOR ;store the new color COLOR variable
cpy #162 ;due we want that our color background from light to darknest
;we need to compare those values
beq valor_inicial_y ;if the values are the same, then, we must jump to
;"valor_inicial_y" label
;because there we must initiate again our background color to
;the original blue color (173)
;if the values are not the same, then,
; the flow of the program follows here
;if you remember when we compare against value 5, was true
;I mean, TIEMPO value was equal to 5
;then, we have to initialize TIEMPO variable to zeros
lda #0 ;load the Acumulator with zeros
sta TIEMPO ;store the Acumulator value to TIEMPO variable
jmp no_decrementar ;I did not found another smart idea,,but we need to jump
;to "no_decrementar" label
;---------------------------------------------------------------------------------
; This section "valor_inicial_y", does initiate the y register value
; with the color that we want to apply in the background of our Kernel
;---------------------------------------------------------------------------------
valor_inicial_y
ldy #173 ;load y with the initial color value
;that we want to apply to our background
lda #0 ;load A with zeros (to set TIEMPO)
sta TIEMPO ;store that value in TIEMPO
sty COLOR ;store y value in COLOR variable
;---------------------------------------------------------------------------------
no_decrementar
ldy COLOR
sta WSYNC
inx
cpx #192
bne Picture
Thanks a lot for your help!!!
My best regards
Fernando