Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
 Welcome to our latest new user maak ! (Registered 2024-04-18) 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-05 18:29
Krill

Registered: Apr 2002
Posts: 2825
If i'm not mistaken, that's just so-called linecrunching, but with bitmap mode.
Every lines has 63 cycles, the bitmap pointer advances as normal, the colours repeat, all the while the colour/screen pointer is stealthily advanced by 40 bytes each rasterline.

An example is Camel Park - the part in the screenshot. Note how you can also put in empty lines.
2019-11-05 21:48
Oswald

Registered: Apr 2002
Posts: 5017
Quote: I tried to display a bitmap without badlines as described above: I have the following code running inside a stable IRQ, with $dc04 timer counting rasterline cycles from 62 to 0 (62 is in the leftmost positon, 0 on the right):
lda #$3a ;%010
sta $d020
ldx $dc04
;raster = $033 (%011), $d011 = $3b (%011), $dc04 = 5 --> 62-5 = 57--> means cycle of rasterline 57+1=58
sta $d011
lda $d012
cmp $d012
beq *-3
lda #$3b
sta $d011
sta $d020
following the above linked thread I understood that $d011 should be changed around cycle 57 of a badline so that least significant bits of $d011 do not match with $d012 same bits.
As first test I tried to get rid of one badline only, but all I get is a black line 8 pixels high right below raster $033. I expected it to be filled with previous colors fetched by preceeding badline, instead.
What I am doing wrong?


in my experience these things never work without trial and error. try changing value written to d011 +-1, cycle of write , etc.
2019-11-05 22:23
ready.

Registered: Feb 2003
Posts: 441
Tried already, I wrote a flexible code so that I can move along the rasterline and between rasterlines, but without success. I'll investigate Krill's suggetion as next step.
2019-11-05 23:05
Krill

Registered: Apr 2002
Posts: 2825
One Year Camelot 3 (part in the screenshot) has another example, probably with code that's a tad easier to follow in the monitor.
2019-11-06 09:28
ready.

Registered: Feb 2003
Posts: 441
All right , I got it to work. Now if I have just 1 badline per screen and change just the 40 values of screen chars (interpreted as color in Bmp mode) corresponding to the area where the badline is, the whole Bmp changes colors. I will post how it's done as soon as I arrange the code in a cleaner shape.
2019-11-06 11:40
AmiDog

Registered: Mar 2003
Posts: 97
I used the same trick in my REU movie player a while back. Having one or no badlines/frame in order to be able to play samples at 31.2kHz with bitmap video without skipping samples.
2019-11-06 12:06
ChristopherJam

Registered: Aug 2004
Posts: 1370
Yup, if you don't want to change the colours per frame, then once you've had one frame in which you load the desired data into the VIC's internal buffer you don't need any badlines at all in subsequent frames.
2019-11-12 11:18
ready.

Registered: Feb 2003
Posts: 441
here's my IRQ to avoid ALL badlines but still show bitmap:
IRQ0
PHA
lda $01
pha
lda #$35
sta $01
LDA $DC04 ;inverted CIA timer raster stabilizer to compensate jitter
EOR #63
LSR
STA *+4
BPL *+2
.FILL 30-14, $EA
BCC *+2
BIT $EA
lda $dc04
lda #$3e ;$3a
sta $d011
CLC
bit $ea
INC $D019
d012_pointer
lda d012_pointer_tbl ;4
sta $d012 ;4
lda #$3f ;$3b
dec d012_pointer+1 ;6
.fill 9, $ea
sta $d011
bpl IRQ0_000 ;2
lda #d012_pointer_max ;2
sta d012_pointer+1 ;4
dec frame_update_delay ;6
bne IRQ0_000 ;2
lda #frame_update_delay_max
sta frame_update_delay
cli
lda $d018
eor #BMP_OFFS/$0400^BMP_OFFS_A/$0400
sta $d018
dec $01
jsr FRAME_UPDATE
inc $01
IRQ0_000
pla
sta $01
IRQ0_A
PLA
RTI
d012_pointer_max= 24
.ALIGN (* & $FF00) + $0100
d012_pointer_tbl
.for N=25, N>=0, N=N-1
.byte $25+N*8+1
.next
frame_update_delay .byte frame_update_delay_max
frame_update_delay_max = 10

there are some part not really needed to avoid badlines, but are needed in the rest of my code.
2019-11-12 13:05
ready.

Registered: Feb 2003
Posts: 441
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.
2019-11-12 13:44
Krill

Registered: Apr 2002
Posts: 2825
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.
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
Martin Piper
Dr. Doom/RAD
Guests online: 69
Top Demos
1 Next Level  (9.8)
2 Mojo  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Comaland 100%  (9.6)
6 No Bounds  (9.6)
7 Uncensored  (9.6)
8 Wonderland XIV  (9.6)
9 The Ghost  (9.6)
10 Bromance  (9.6)
Top onefile Demos
1 It's More Fun to Com..  (9.9)
2 Party Elk 2  (9.7)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.5)
5 Rainbow Connection  (9.5)
6 TRSAC, Gabber & Pebe..  (9.5)
7 Onscreen 5k  (9.5)
8 Dawnfall V1.1  (9.5)
9 Quadrants  (9.5)
10 Daah, Those Acid Pil..  (9.5)
Top Groups
1 Oxyron  (9.3)
2 Nostalgia  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top Crackers
1 Mr. Z  (9.9)
2 S!R  (9.9)
3 Mr Zero Page  (9.8)
4 Antitrack  (9.8)
5 OTD  (9.8)

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