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 > DISPLAY ENABLE switching at raster pos?
2006-03-26 22:34
Trifox
Account closed

Registered: Mar 2006
Posts: 108
DISPLAY ENABLE switching at raster pos?

i want to switch the DISPLAY ENABLE flag on a certain raster line, and activate it on another, i am trying, but i just can switch it on and off in raster lines < 50 or something ... what can i do ... just use sprites in the area out of my 'copper' bars ?
2006-03-26 22:37
Krill

Registered: Apr 2002
Posts: 2980
What do you want to achieve? Disable the bad lines?
2006-03-26 22:55
Trifox
Account closed

Registered: Mar 2006
Posts: 108
yes, i want to disable the bad lines when doing my rasterbars, and before and after i want to display normal text graphics... because those raster bars are really hard to maintain .. ;(
2006-03-26 23:08
Style

Registered: Jun 2004
Posts: 498
It doesnt work like that.

The DEN bit is only checked in one position. The screen is either blanked in entirety or it isnt.

2006-03-26 23:10
Krill

Registered: Apr 2002
Posts: 2980
Simply do FLD then. That's basically setting $d011 each line so that the lowmost 3 bits of $d012 and $d011 never match, thus no bad line being produced - read, you have a 0..7 cycle on the lowmost 3 $d011 bits.
2006-03-27 01:19
Wanderer
Account closed

Registered: Apr 2003
Posts: 478
This routine works well under PAL and NTSC

LDX #$00
loop LDY COLORS,X
LDA $D012
AA CMP $D012
BNE AA
AND #$07
ORA #$10
STA $D011
**
STY $d020
STY $d021
inx
cpx #$08 (# of colours)
bne loop
rts

** may need bit $ff for timing purposes

colours .byte 9,8,7,1,7,8,9,0

===================

In SOME cases you can skip the whole FLD and use

LDA $d012
ss CMP $d012
BEQ ss
and then store the Y value

*if* you are using a very small number of raster lines, say 2-3 colours.
2006-03-27 01:32
Trifox
Account closed

Registered: Mar 2006
Posts: 108
hm, and all that for avoiding the bad lines ? what if i modify my waiting routine ( at this time it is only NOPing and waiting for passing 63 cycles ) so that it does count the stuff correctly on each line ?
2006-03-27 01:41
Wanderer
Account closed

Registered: Apr 2003
Posts: 478
The routine above works well for instances where you're using a lot of colours. It saves having a lot of NOP's, that's for certain.

The downside is, using the above method won't allow you to put text where the colours are.

The LDA $d012:cmp $d012:BEQ method will allow you to put text there, but it's not as stable.
2006-03-27 08:26
MRT
Account closed

Registered: Sep 2005
Posts: 149
If you don't use any sprites, you could also just keep those badlines and write your routine around them.
That way you're still able to do anything with your text.

Just remember, a badline occurs once in eight rasterlines (on a normal text screen), a badline without sprites takes 40 cycles off, so you have 23 cycles left (on a PAL system) on a badline to do your tricks.
2006-03-27 09:15
Oswald

Registered: Apr 2002
Posts: 5094
rasterbars from the top of my head (tm)

ldx #$00
rasterloop
lda colortab,x
sta $d020
sta $d021
ldy delaytab,x
dey
bne *-1
inx
cpx #numberoflines
bne rasterloop

colortab
.byte 0,6,0,6,6,14,6,14,14,3,14,3,3,1,3,1,1
.byte ,3,1,3,3,14,3,14,14,6,14,6,6,0,6,0,0

delaytab
.byte 1,8,8,8,8,8,8,8
.byte 1,8,8,8,8,8,8,8
.byte 1,8,8,8,8,8,8,8
.byte 1,8,8,8,8,8,8,8
.byte 1,8,8,8,8,8,8,8

a) you have to start this routine on the left side of a badline

b) colortab&delaytab must not cross a page boundary

c) my memory is rusty maybe you need 7 or 9 for the 8s in t he delaytab
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
Raf/Vulture Design
E$G/HF ⭐ 7
MaD ][/Starship
Urban Space Cowboy
acrouzet/G★P
LordCrass
Knut Clausen/SHAPE/F..
Sokrates
Guests online: 115
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 X-Mas Demo 2024  (9.5)
7 Dawnfall V1.1  (9.5)
8 Rainbow Connection  (9.5)
9 Onscreen 5k  (9.5)
10 Morph  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Censor Design  (9.3)
5 Triad  (9.3)
Top Fullscreen Graphicians
1 Joe  (9.7)
2 Sulevi  (9.6)
3 The Sarge  (9.6)
4 Veto  (9.6)
5 Facet  (9.6)

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