| |
tonysavon
Registered: Apr 2014 Posts: 25 |
Different side border colors
I'm trying to obtain (what I thought was) a very simple effect. While displaying a bitmap, I need the side borders to be of different colors just for the 200 lines visible part of the screen (so top and bottom borders would be black). Say I want the left border to be white and the right border to be red.
I played a bit with timing and I kinda achieved something, but it's not really working very well yet. I was wondering if there was a pre-made piece of code somewhere for doing this kind of vertical splits, possibly with a LUT, so that I could have 200 different colors on the left and 200 different colors on the right. Right now I feel like if I keep hammering this spaghetti mess I have in front of me I'll eventually manage to do something, but I wouldn't want to re-invent the wheel and I'm sure there's a clean, short way of doing this
Thanks |
|
| |
Mixer
Registered: Apr 2008 Posts: 452 |
This is an interesting question and it may not be a trivial thing to do.
AFAIK, during bad lines, the cycles between 16 and 56 (the screen area) are stolen by VIC, and the free cycles for code are between cycle 56 of last line and 16 of next line. -> While left border color could be set hidden in the left border, the right side color change cannot take place during screen cycles and would therefore be visible on left or right border at least for a cycle.(8 pixels) I could be wrong though.
-> Solution,open sideborders and cover one side with sprites. |
| |
algorithm
Registered: May 2002 Posts: 705 |
You would need to update the border colors per rasterline in order to achieve this (stable raster is not needed as you can update the d020 register in the non-visible area's)
a simple delay loop taking into account badlines will work well but use up valuable cpu time. (using nmi or timers, or interleaving code inbetween can be done instead however) |
| |
tlr
Registered: Sep 2003 Posts: 1790 |
Hmm. This is non-trivial/un-possible for bad lines. You don't have time to change the color before the right border on those.
I see two options:
1. Get rid of the bad lines.
2. Open the side border and use sprites to cover the left and right border area. Cleverly using MC-mode or overlapping sprites together with changing color regs should enable every line color changes left and right. |
| |
algorithm
Registered: May 2002 Posts: 705 |
ofcourse, what mixer said.. :-| |
| |
Dane
Registered: May 2002 Posts: 423 |
Cycle
Check the loader parts. |
| |
Mixer
Registered: Apr 2008 Posts: 452 |
Dane: That demo is witchcraft! |
| |
tonysavon
Registered: Apr 2014 Posts: 25 |
Thanks everyone.I'll check the cycle demo and see if I can learn something from that. About opening the borders, wouldn't that be trickier than changing the border color? To open the side border you have to write to $d016 at a specific time for each scanline, including the badlines, at that point I might as well write to $D020.also, getting rid of the badlines is not really an option for me because I have to display an hires picture. On the other hand wasting cycles is not a big deal: I just have to display this hires picture and play a sid, nothing more.
I'll check the demo! Thanks for your support and sorry for the lame question :-P. |
| |
MagerValp
Registered: Dec 2001 Posts: 1078 |
It's one of those problems that seem simple, but are in fact tricker than you expect. Due to badline DMA you can't change the border color while the screen is being displayed, and the first write cycle is available too late:
https://www.dropbox.com/s/wzac1xmjy6iy2w2/lrborder.png |
| |
Dr.Science
Registered: Oct 2011 Posts: 41 |
In one of my last intros, I use different border colors. As it was only for a small area, the timing was done "by hand" for each rasterline: PETSCII Intro |
| |
ciccior2003
Registered: Jun 2012 Posts: 13 |
Shifting on the right the bitmap ( $D016 $0F ) you can put 2 sprites on the left one on the right to cover all the borders. So you have an other sprite to cover one side border with a new color. |
... 17 posts hidden. Click here to view all posts.... |
Previous - 1 | 2 | 3 - Next |