| |
Radiant
Registered: Sep 2004 Posts: 639 |
$d011 stretching
As far as I've understood, you can stretch the last line of a char by altering $d011, again brought to my attention by the discussion about opening the sideborder while having many sprites on a graphics screen. I've checked the VIC Article and some other sources, but haven't found anything on how or why this works. Doing a simple FLD causes the VIC-II to just do idle reads from $3fff instead of repeating the last line, right? Has it got anything to do with the linecrunching technique, i.e. aborting the badline and then repeatedly doing FLD after that? |
|
| |
JackAsser
Registered: Jun 2002 Posts: 2014 |
Do FLD, stretch the last line of the VIC, induce FLI are all the same trick on different cycles on the line actually. Just enable a stable raster and NOP to see the various effects.
Ofcourse with linecrunching and FLI you force a new badline each line, with FLD and stretching you postpone the badline. Check my part in Panta Rhei and my part in LCP Memories for the timing used to perform char stretching. |
| |
Radiant
Registered: Sep 2004 Posts: 639 |
JackAsser: I'll check it out once I get home. How does stretching work technically; what makes the VIC repeat that one line, instead of just doing idle reads? |
| |
yago
Registered: May 2002 Posts: 333 |
Please read the Vic-Article, if you want to know more about how $d011 fiddling works internally.
http://zimmers.net/cbmpics/cbm/c64/vic-ii.txt
|
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
radiantx, $d011 stretching is dead easy, you dont even need a stable irq. unfortunately I cant tell you exactly how to do it, but if you start to experiment u'll find it in 15 minutes. The "basics" are that you can repeat a char row by setting the appropriate value into $d011. so you can do stuff like this:
(imagine this stuff verticale, each number is the raster line number within a char row)
112345678
1212345678
123412345678
etc. you can repeat rows unlimited times so u can do stuff like:
12312312312312345678
the only limit is that u can repeat a full row only once. u can repeat up to 7 rasterlines unlimitedly.
just play with $d011. (make sure u modify it somewhere at the left side)
|
| |
Radiant
Registered: Sep 2004 Posts: 639 |
yago: Already did, as stated in the first post. :-) I couldn't find info about how or why any $d011 tricks except FLD, FLI, VSP and Linecrunch work, though.
Oswald: I see, that was what I was doing when I was playing around yesterday, however it seemed to induce a badline every time the first row was repeated (as in FLI). The sideborder scroller in Bonanza for example hints that there is a way to do this kind of stretching without having those badlines, as there seems to be $d011 tweaking going on during those lines. Perhaps I did something wrong yesterday (like modifying it on the right side rather than left), I'll have another go at it. |
| |
JackAsser
Registered: Jun 2002 Posts: 2014 |
@radiantx: yes, that includes a new bad line, i.e. you may switch $d018/$dd00 to get new graphics. You can however also stretch line 7 of a char, but ONLY that line without inducing new bad lines.
The char row repeat trick is basically FLI but done to early. With FLI you need very precise timing to make the counter move forward 40 bytes, if you perform the trick too early the counters won't move forward, and it will simply refetch from the same address. |
| |
Cruzer
Registered: Dec 2001 Posts: 1048 |
I guess the sideborder scroller in Bonanza is done by incrementing $d011 so it never reaches a badline. That way the chars are repeated for each char line, but it's still possible to display normal bitmap, which just has the same colors on all char lines. |
| |
Graham Account closed
Registered: Dec 2002 Posts: 990 |
Just incrementing $D011 so it never reaches a badline will cause FLD and not repeating of charlines. |
| |
Cruzer
Registered: Dec 2001 Posts: 1048 |
@Graham: Doesn't that depend on where you start, as well as the number of cycles used per line or something? I usually just trial'n'error my way until it produces the result I need. I haven't really studied any VIC article or cycle tables very thoroughly, but maybe it would be a good idea.
As far as I know, all of the following tricks are possible with the same technique - incrementing $d011's y-scroll bits every line to avoid badlines:
- FLD: Pushes the gfx down, and replaces it with ghost byte on the affected area.
- Bitmap stretching
- Color stretching, which doesn't affect the bitmap gfx
- Line crunching, which makes the updating of bitmap gfx jump 8 lines down for each rasterline
|
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
color stretching = fli ? |
| |
JackAsser
Registered: Jun 2002 Posts: 2014 |
Quote: color stretching = fli ?
nono... color stretching as cruzer said avoids badlines, hence no new fetches hence same colors all the way down the bitmap. |
| |
Graham Account closed
Registered: Dec 2002 Posts: 990 |
@Cruzer:
If the VIC never reaches a badline, it will simply start to display the ghostbyte. Everything else requires a badline condition at different cycles of the rasterline. |
| |
Radiant
Registered: Sep 2004 Posts: 639 |
I also can't see how what Cruzer and JackAsser are proposing would work. I've never been able to repeat char rows without badlines nor seen anything about it, but perhaps it's possible? |
| |
HCL
Registered: Feb 2003 Posts: 728 |
The "color-stretch" effect is commonly used in lots of demos. Don't know if you're really avoiding the badline, but you definitely avoid wasting any cycles on it :). Plus you don't get any new colors (in bitmap mode) or chars (in char mode).
My memory is weak today, but i know i used it in "Smart girls.." in the greetings-logo-zoomer, but that's just one way of using it.. |
| |
Graham Account closed
Registered: Dec 2002 Posts: 990 |
If you use simple FLI timing and delay the DMA so much that 0 DMA cycles are left, you can repeat one charline without any badline. Now you can simply switch the charset for different graphics. This way you can display 4 color gfx without badlines and you only need 2 $D011 accesses per charline. |
| |
HCL
Registered: Feb 2003 Posts: 728 |
Yeah, *burp* exactlywhatiwasgoingtosay.. ;) |
| |
JackAsser
Registered: Jun 2002 Posts: 2014 |
So now RadiantX, go home and play with that $d011! and deliver a fantastic demo to us! :D |