Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > Different side border colors
2015-01-29 16:55
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
2015-01-29 17:54
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.
2015-01-29 17:54
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)
2015-01-29 17:55
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.
2015-01-29 17:56
algorithm

Registered: May 2002
Posts: 705
ofcourse, what mixer said.. :-|
2015-01-29 18:00
Dane

Registered: May 2002
Posts: 423
Cycle

Check the loader parts.
2015-01-29 18:13
Mixer

Registered: Apr 2008
Posts: 452
Dane: That demo is witchcraft!
2015-01-29 20:47
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.
2015-01-30 07:38
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
2015-01-30 08:47
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
2015-01-30 09:57
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
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
Didi/Laxity
Tomse/RCEU
Alakran_64
Mythus/Delysid
Guests online: 114
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 Edge of Disgrace  (9.6)
6 What Is The Matrix 2  (9.6)
7 The Demo Coder  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 No Listen  (9.6)
2 Layers  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 Dawnfall V1.1  (9.5)
7 Rainbow Connection  (9.5)
8 Onscreen 5k  (9.5)
9 Morph  (9.5)
10 Libertongo  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Triad  (9.3)
5 Censor Design  (9.3)
Top Musicians
1 Rob Hubbard  (9.7)
2 Mutetus  (9.7)
3 Jeroen Tel  (9.7)
4 Linus  (9.6)
5 Stinsen  (9.6)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.059 sec.