| |
tob1as Account closed
Registered: May 2017 Posts: 2 |
Sprite position with open side border
Hello,
Experimenting with open sideborder and sprites and have two questions.
1. I am Not able to view sprite 0 in sideborder. It this possible at all or do you have to use sprite 1-7 in side border?
2. When setting sprite1 x position to zero, there still is a 8 pixel gap in left sideborder before sprite. Is this just how it is or it is possible to push sprite all the way to the left?
(in right border sprite can be all the way to right - ie. no pixel gap). |
|
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
2, set 9th bit of sprite X hi in d010, then iirc next position to the left of pos 0 is $f8. |
| |
chatGPZ
Registered: Dec 2001 Posts: 11386 |
sprite 0 shouldnt be a problem either :) |
| |
JackAsser
Registered: Jun 2002 Posts: 2014 |
There are 63x8 = 504 x-positions on a raster line.
Sprite registers are 9-bit = 512 x-positions.
Hence there has to be a 8-pixel gap somewhere, happens to be just at the left edge of the screen. |
| |
Compyx
Registered: Jan 2005 Posts: 631 |
Like Oswald said:
lda #$f8
sta $d000
lda #0
sta $d002
clc
adc #$18
sta $d004
adc #$18
sta $d006
adc #$18
sta $d008
adc #$18
sta $d00a
adc #$18
sta $d00c
adc #$18
sta $d00e
lda #%00000001
sta $d010
That should give all 8 sprites properly aligned. Keep in mind that sprite 0 is a bit of a bitch, you'll need a read-modify-write on $d016 to get an open border for 8 sprites, so: DEC $d016/INC $d016, ST[AXY] won't work.
People other than me can explain why more clearly than I can. |
| |
tob1as Account closed
Registered: May 2017 Posts: 2 |
Thanx, X-position was easy :-) I had the right theori, but just didnt hit correct value. Rookie mistake :-)
Sprite 0 is supposed to take 5 cycles, but damage my open side border timing. Just cant get it to work. Works fine with the other sprites.
But have a problem with enough cycles on bad line.
So bad line is 23 cycles. First sprite displayed takes 5 cycles and then the rest should take 2 cycles each if I am correct? I dont do DEC/INC d016, but rather sta/sty d016. Saves 4 cycles. So there should be time to at least 4 sprites (I need 4 in the border). Or do I miss something? |
| |
chatGPZ
Registered: Dec 2001 Posts: 11386 |
have a look at the vic article (or perhaps try Victimer) - its not only about how many cycles are free - its also about _which_ cycles are free :) |
| |
Compyx
Registered: Jan 2005 Posts: 631 |
Like groepaz said, it's not only the number of cycles that are free but also where the horizontal beam is, I suggest taking a look at the VIC article, and indeed using Victimer (set your terminal window very wide when using that).
For using sprites including badlines, it's best to use the 'upper' sprites ie sprites 4-7. On a badline you can then use
sta $d016,y
stx $d016
Using A = 0-7, X = 8-15 and Y = 0. OR the X and A values with 16 if using multicolor. |
| |
Trash
Registered: Jan 2002 Posts: 122 |
Quote: There are 63x8 = 504 x-positions on a raster line.
Sprite registers are 9-bit = 512 x-positions.
Hence there has to be a 8-pixel gap somewhere, happens to be just at the left edge of the screen.
How do you bridge that gap when for example making a multiplexed sideborder scroll (like in Revolutions) |
| |
JackAsser
Registered: Jun 2002 Posts: 2014 |
If x<0 then x-=8
X&=0x1ff |