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
 
... 20 posts hidden. Click here to view all posts....
 
2015-01-31 04:47
SIDWAVE
Account closed

Registered: Apr 2002
Posts: 2238
just do it the oldstyle way. look in some upfront demo.
2015-01-31 09:51
Krill

Registered: Apr 2002
Posts: 2980
WAT. Of course it's trivial, and there are plenty of cycles left even with look-up table action including indexed table access and a loop.

Kompokürbis (Yes, i coded this on short notice, at a party, while having a couple of beers. Seems i have used an assembler, not a monitor, though.)

In which strange parallel dimension have i awoken today? Where have the skills of some of the best coders on this machine gone? Since when is "sta mem,x" a read-modify-write operation?

WHAT. THE. FUCK.
2015-01-31 10:39
Peacemaker

Registered: Sep 2004
Posts: 275
irq1:
ldx #$20
jsr rasternail (make raster stable)

lda #$32
cmp $d012
bne *-3
ldy #$0b
dey
bne *-1
nop
nop
nop

.var count = 0

.for(var a=0;a<200;a++) {
.eval count = count +1
ldx color1+a
ldy color2+a
stx $d020
sty $d020
.if ( count <= 7 ) {
jsr delay
} else {
.eval count = 0
nop
nop

}
}

inc $d019
pla
tay
pla
tax
pla
rti
delay:
nop
nop
ldx #$06
dex
bne *-1
rts
2015-01-31 15:29
Peacemaker

Registered: Sep 2004
Posts: 275
Quote: 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)


stable raster is ofcourse needed.
2015-01-31 15:56
Oswald

Registered: Apr 2002
Posts: 5094
Hey Gunnar, I was reading the posts lazily and I thought LUT's would be for delays across bad / non bad lines :) I bet the other best coders have similarly good excuses :)
2015-01-31 18:31
MagerValp

Registered: Dec 2001
Posts: 1078
Haha, well that's what happens when I do a quick forum check and throw together some broken test code before rushing off to work. :)

And yup, don't need RMW but you do need an op with more than one write cycle, lest DMA steals the cycle you need.

As an interesting side note of it'd be a challenge to do it with a 65C02 since extra write cycles in RMW and indexed ops have been replaced by read cycles.
2015-02-02 21:31
HCL

Registered: Feb 2003
Posts: 728
You guys are funny :)
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
Neon Vincent
Endurion
Chrx/Design/Chaos
Matt
Guests online: 140
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 Diskmag Editors
1 Magic  (9.8)
2 hedning  (9.6)
3 Jazzcat  (9.5)
4 Elwix  (9.1)
5 Remix  (9.1)

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