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 > Picture without badlines.
2018-02-08 10:15
Golara
Account closed

Registered: Jan 2018
Posts: 212
Picture without badlines.

In the last part of Time Machine by Booze Design HCL says that the picture looks very colorful despite not having any badlines. How is that possible to have pictures without badlines ? Lack of badlines causes FLD effect, right ?
 
... 39 posts hidden. Click here to view all posts....
 
2019-11-12 13:44
Krill

Registered: Apr 2002
Posts: 2804
Quoting ready.
So we get a half badline.
Seems like you're inadvertently triggering delayed DMA. If done right, every line really has the full 63 cycles.
2019-11-12 14:02
Golara
Account closed

Registered: Jan 2018
Posts: 212
Quote: investigating deeper into what really happens, I found that the badline kind of starts, so that it steals the cycles from the CPU but then it is aborted by $d011 first write, so that the VIC does not get color info from the screen. This can be checked by running the code above. IRQ starts with $d012=N and $DC04 = $3f or so depending on the jitter given by last instruction executed outside of IRQ. Note: $DC04 = $3f means raster is on the left of screen. Then $d012 becomes N+1 before executing LDA #$3E, but in such moment $DC04=$0a, so raster is almost at the right side of screen. All cycles in between were stolen from CPU. So we get a half badline.

This is a piece of code from my part that does this effect. There's 4 sprites on the line


!for line,0,164{
stx $d017
!if (line >= 250-135){
lda #$0 + ((line + 7 ) & 7 )
}else{
lda #$38 + ((line + 7 ) & 7 )
}
sta $d011


lda sinus_read + (((line*4) + 0)&255)
sta $d000
lda sinus_read + (((line*4) + 1)&255)
sta $d002
lda sinus_read + (((line*4) + 2)&255)
sta $d004
lda sinus_read + (((line*4) + 3)&255)
sta $d006

lda #3 //free 6 cycles
sta $d021 //for something....
sty $d017

}


My loop is 52 cycles, exactly how many cycles the CPU has on a non-badline line with 4 sprites enabled. Not sure why are you losing some cycles.

BTW. This is different kind of "picture without badlines", the Booze part I mentioned in the first post does FPD, so I think it's different (repeating the last line of a char ?)
2019-11-12 19:42
ready.

Registered: Feb 2003
Posts: 441
I still can get it right then. I understood I must trigger a badline at RC=7. Using screen position = %011, RC=7 at raster $37, $3F, $47,... I guess that if screen position changes, also the condition RC=7 happens at a different rasterline, because the end of a char block is moved vertically.
So I set my first IRQ to set $d011=$3F at raster=$037 and cycle 55. This forces a badline.
Next thing is to restore $d011 to $3b, which ensures that RC=7 happens at raster $37, $3F, $47,.... But it will also provide a badline at raster $3b, $43,.... which is unwanted of course.
So I can't get out of it. What I am missing? Tried to analyze some code of demos posted above but I couldn't really get into it, since there were also other $d011 tricks mixed in the middle.
2019-11-12 23:58
ready.

Registered: Feb 2003
Posts: 441
I also tried to use this approach in my code:
https://codebase64.org/doku.php?id=base:repeating_char-lines&s[..

Also Oswald seems to use the same, as stated in a post from this:
https://csdb.dk/forums/index.php?roomid=11&topicid=119133&first..

The problem is that the code I linked doubles both text screen and bitmap screen, so all I get is the first 8 piexls line of the bitmap repeated through the whole screen. I want to repeat just the text (thus color in bimtap mode) screen.
2019-11-13 08:17
Oswald

Registered: Apr 2002
Posts: 5007
the greetings part in here Smart Girls Hate Booze has such a bitmap screen, maybe you can peek from it.
2019-11-13 09:23
Krill

Registered: Apr 2002
Posts: 2804
Quoting ready.
I understood I must trigger a badline at RC=7. Using screen position = %011, RC=7 at raster $37, $3F, $47,...
The fake badline condition must be triggered in every line (within the correct cycle window), thus $d011 needs to be written to in every line, just as Golara does. See also https://codebase64.org/doku.php?id=base:linecrunch.
2019-11-13 09:49
ready.

Registered: Feb 2003
Posts: 441
ok, I was expecting it could be done just for a few lines, triggering an irq every 8 rows. Since I need to run a background program, I need the irq to steal as little cycles as possible. Then I guess my first approach will just do fine. The whole need for this effect was to save memory getting rid of the screen RAM, to be able to alternate 2 bitmaps in the same bank.
Thanks a lot for the support!
2019-11-13 10:00
Golara
Account closed

Registered: Jan 2018
Posts: 212
Quote: ok, I was expecting it could be done just for a few lines, triggering an irq every 8 rows. Since I need to run a background program, I need the irq to steal as little cycles as possible. Then I guess my first approach will just do fine. The whole need for this effect was to save memory getting rid of the screen RAM, to be able to alternate 2 bitmaps in the same bank.
Thanks a lot for the support!


This effect only makes sense if you need all the cycles every line, like me, I needed to change 4 sprite X positions and stretch them (2 writes to d017), had to get rid of the badlines. I don't think you can manipulate badlines just to avoid them stealing cycles from your non-irq code. Besides, if you add up all the cycles the badline takes, you get 1000 cycles per frame. A full frame has 19656 cycles, so all the badline steal only 5% of the raster time
2019-11-13 12:48
ready.

Registered: Feb 2003
Posts: 441
In fact, Golara, I was not seeking for extra cycles by removing badlines. My goal is to get rid of screen RAM due to memory constraints, so I can use 1 single VIC bank for 2 bitmaps, without screen RAM. And with the code I posted I succeeded in that. On the practical side, I have half badlines allover the screen.
2019-11-13 12:59
Krill

Registered: Apr 2002
Posts: 2804
Something doesn't quite add up then. If you're getting any kind of badline DMA, colour information should be read and applied. Can you post a binary of your code?
Previous - 1 | 2 | 3 | 4 | 5 - 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
Dr. Doom/RAD
hedning/G★P
csabanw
Airwolf/F4CG
iceout/Avatar/HF
Mr SQL
Laurent
Guests online: 315
Top Demos
1 Next Level  (9.8)
2 Mojo  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 No Bounds  (9.6)
6 Comaland 100%  (9.6)
7 Uncensored  (9.6)
8 The Ghost  (9.6)
9 Wonderland XIV  (9.6)
10 Bromance  (9.6)
Top onefile Demos
1 Party Elk 2  (9.7)
2 Cubic Dream  (9.6)
3 Copper Booze  (9.5)
4 Rainbow Connection  (9.5)
5 TRSAC, Gabber & Pebe..  (9.5)
6 Onscreen 5k  (9.5)
7 Dawnfall V1.1  (9.5)
8 Quadrants  (9.5)
9 Daah, Those Acid Pil..  (9.5)
10 Birth of a Flower  (9.5)
Top Groups
1 Booze Design  (9.3)
2 Nostalgia  (9.3)
3 Oxyron  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top Fullscreen Graphicians
1 Carrion  (9.8)
2 Joe  (9.8)
3 Duce  (9.8)
4 Mirage  (9.7)
5 Facet  (9.7)

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