| |
Trash
Registered: Jan 2002 Posts: 122 |
D017 stretch
I have a little while trying out som d017-stretching-code-magic-stuff. It seems impossible to stretch sprite 00 when it is alone a raster row.
Can anyone confirm it is possible or tell med where I am going wrong? I just cant get the timings right and I've tried all combinations (I think?).
I've put 1 -> d017 on all cycles after dec $d016 and then 0 on all cycles after that but for me it seems impossible...
Any help at all would be greatly appriciated!
lda #1
ldy #8
- dec $d016 ; 6 Removes the border
cmp #$c9
sta $d017 ; Has been moved around
cmp #$c9
bit $ea
sty $d017 ; Has been moved around
cmp #$c9
cmp #$c9
cmp #$c9
cmp #$c9
cmp #$c9
cmp #$c9
cmp #$c9
cmp #$c9
cmp #$c9
cmp #$c9
cmp #$c9
cmp #$c9
cmp #$c9
cmp #$c9
sty $d016 ; Makes sure the border is removable
inx
cpx #15
bne -
|
|
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
you sure d017 update happens on the same line ? according to my not exact trial and error knowledge d017 stretch always works until you do it within the same line. |
| |
Trash
Registered: Jan 2002 Posts: 122 |
Quote: you sure d017 update happens on the same line ? according to my not exact trial and error knowledge d017 stretch always works until you do it within the same line.
you set d017 to expanded on line X and you clear it before cycle 16 on line x + 1, then you have a stretched row.
I might have figured out my problem however, with one sprite active (or possibly on some combination of sprites) you cant remove the sideborder while stretching since the first write must reside where we remove the border. |
| |
Skate
Registered: Jul 2003 Posts: 494 |
@Trash: never use sprite #0 with side-border stuff. start using sprites in reverse order like #7, #6 etc.
However, if you disable the badlines, all 8 sprites + sprite stretching works fine together. |
| |
Trash
Registered: Jan 2002 Posts: 122 |
Quote: @Trash: never use sprite #0 with side-border stuff. start using sprites in reverse order like #7, #6 etc.
However, if you disable the badlines, all 8 sprites + sprite stretching works fine together.
I need to be able to stretch a single sprite on a line, i dont want all eight sprites there...
But you are right I really shouldnt use sprite 0... |
| |
The Phantom
Registered: Jan 2004 Posts: 360 |
Trash.
Obviously my last comment didn't go through..
You CAN remove the sideborder while stretching.
Censor design showed us that - NTSC II [ntsc]
I have some source code if interested. After seeing that demo, I had to do it, I had to. While my routine isn't as smooth, I was able to do it without much effort. If interested, PM me your email and I can send you the source. |
| |
Trash
Registered: Jan 2002 Posts: 122 |
Quote: Trash.
Obviously my last comment didn't go through..
You CAN remove the sideborder while stretching.
Censor design showed us that - NTSC II [ntsc]
I have some source code if interested. After seeing that demo, I had to do it, I had to. While my routine isn't as smooth, I was able to do it without much effort. If interested, PM me your email and I can send you the source.
Ofcourse I can remove the sideborder while stretching as seen in Cocktail and various other demos but what I can't do is have a single sprite on a line and stretch it while still removing the sideborder. |
| |
Hein
Registered: Apr 2004 Posts: 954 |
You don't remove the badline with some FLD, right? If you can do 8 on a badline and open borders, woohoo! |
| |
Trash
Registered: Jan 2002 Posts: 122 |
Quote: You don't remove the badline with some FLD, right? If you can do 8 on a badline and open borders, woohoo!
I have no badlines to worry about, I have opened the border with bit 4 = 0 in d011, I don't want eight sprites on the row, I need to it be only 1. |
| |
Hein
Registered: Apr 2004 Posts: 954 |
If you have a working stretcher with 8 sprites, you can disable 7 sprites and add 7 NOPs in your loop, 1 NOP for each disabled sprite. Should work fine. |
| |
JackAsser
Registered: Jun 2002 Posts: 2014 |
Quote: I have no badlines to worry about, I have opened the border with bit 4 = 0 in d011, I don't want eight sprites on the row, I need to it be only 1.
Never use sprite #0 when fiddling with side border stuff as a rule of thumb. |
| |
Hein
Registered: Apr 2004 Posts: 954 |
Sprite 0 trauma, worst trauma ever. |
| |
chatGPZ
Registered: Dec 2001 Posts: 11386 |
never put your thumb into the sideborder, girlfriend said |
| |
Smasher
Registered: Feb 2003 Posts: 520 |
let's make a demo about it. |
| |
Trash
Registered: Jan 2002 Posts: 122 |
Sorry for my stupid question, of course it works to stretch a single sprite with d017 while removing the border (even S#00). You just have to stop being stupid and do it the right way :-( |
| |
The Phantom
Registered: Jan 2004 Posts: 360 |
Meh. Whatever.
Good luck. |
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
NOS intro at DOTC 1 sided is having sideborder off + 8 sprites stretched differently ?
Defender of the Crown +9D |
| |
HCL
Registered: Feb 2003 Posts: 728 |
..isn't that what i told you from the beginning Trash? Just do it the right way! :) |
| |
Trash
Registered: Jan 2002 Posts: 122 |
Quote: ..isn't that what i told you from the beginning Trash? Just do it the right way! :)
According to you everything is easy, just some lda and sta's in the right place and the sky is the limit... |
| |
Compyx
Registered: Jan 2005 Posts: 631 |
For some reason when doing an 8-sprite open border routine you have to use DEC $d016 + INC $d016.
This has something to do with sprite 0 DMA eating too many cycles from the CPU, so the $d016 writes don't happen at the right time, occupying the CPU with DEC/INC solves that.
I found this out the hard way, back when I still actively coded demos. The explanation might be a bit off, but I'm sure there's VIC-II guru's out here who can do a better job than I do.
But like others have mentioned, when you don't need all 8 sprites, avoid sprite 0. |
| |
Graham Account closed
Registered: Dec 2002 Posts: 990 |
Explanation is easy: DEC $D016 has 2 write cycles at the end of it's execution, while STA $D016 has only one. The 6510 cannot be stopped on write cycles, so with the right timing you can skip 2 of the 3 bus allocate cycles of the sprite #0 DMA which gets you right to the exact cycle where $D016 has to be changed to open the side border. |
| |
Compyx
Registered: Jan 2005 Posts: 631 |
Thanks Graham,
That explains the sprite 0 nastiness a lot better than I did :) |