| |
turtle Account closed
Registered: Mar 2005 Posts: 44 |
sprites disappears when using d011
I have 6 split .8 sprite each split.
sprites disappears when using the d011 as scroll, for each second line?
is there any type of timing to use ?
i know that it can be error in the end of ploting the sprite, it its on a split. i think =)
pliz help =)
lda#$32
cmp$d012
bne*-3
lda #%00011111
sta $d011
(ok)
lda #%00011110
(error.sprites disappears in one line)
lda #%00011101
(ok)
lda #%00011100
(error)................)
sprites
lda#$48
cmp$d012
bne*-3
sprites
lda#$5e
cmp$d012
bne*-3
sprites
lda#$74
cmp$d012
bne*-3
sprites
lda#$8a
cmp$d012
bne*-3
sprites
lda#$a0
cmp$d012
bne*-3
sprites
lda#$ff
cmp$d012
bne*-3
|
|
| |
JCB Account closed
Registered: Jun 2002 Posts: 241 |
You might be experiencing "badlines" :)
Badline is where the C64 fetches the new character data from screen RAM (every 8 pixels vertically, top of each new character line), to do so it must steal cycles from the CPU. Do a google for C64 badlines, there's lots of explanations. Basically you're seeing it when changing D011 because the badlines are moving vertically and coinciding with one of your CMP $D012 positions.
It will all kind of depend on how your "sprites" (in your code listing) works, you can only do so much before the raster has passed the line the VIC would need the registers to be changed for it to know it has to display the sprites again.
Pete |
| |
WVL
Registered: Mar 2002 Posts: 902 |
these bits of code
lda #$xx
cmp $d012
bne *-3
Are very dangerous when combined with badlines and sprites. You better change this to
lda $d012
cmp #$xx
bcc *-5 ;keep looping as long as value of $d012 is smaller than #$xx
or even better :
lda #$xx
cmp $d012
bcs *-3 ;keep looping as long as #$xx is bigger then or equal to $d012
Now find out why for yourself :) |