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 > Unexpected linecrunch
2016-09-06 08:58
ChristopherJam

Registered: Aug 2004
Posts: 1408
Unexpected linecrunch

I'm sure in the past I've displayed full screen FLI just by writing a new value to $d011 every 23 cycles, and using some of the intervening time to update $d018 (ie, writing to $d011 on what vic artikel refers to as cycle 14).
However, if I have sprites zero to five enabled, and am only writing d011 every second line, it appears that I need to perform the first $d011 write for new char rows at least one cycle earlier, lest I get a linecrunch.

Any idea what's going on here?

(every two lines, I'm running something like this:
	lda#efy0+ 71:sta $d007
	lda#d18v0
	ldx#$38+1
	ldy#0
	sta $d018
	sty VM0+$3f8:iny
	sty VM0+$3f9:iny
	sty VM0+$3fa:iny
	sty VM0+$3fb:iny
	sty VM0+$3fc:iny
	sty VM0+$3fd:nop
	stx $d011


Also: not sure if it's relevant, but I stabilise the interrupt by forcing a DMA one and a half lines before the first such block of code is run, ie the first block is preceded by
	sta $d011 ; trigger badline just before effct starts; this one's just to stabilise
	nop:nop:nop:nop:nop:nop  ;extra nops because there's no sprite DMA at the end of the above DMA
 
... 57 posts hidden. Click here to view all posts....
 
2016-09-07 14:31
lft

Registered: Jul 2007
Posts: 369
The trick is to put different lines in different parts of the font. For instance, (the top line of) chars 0-39 in each of the 8 font banks gives 8 different lines to choose from. Chars 40-79 give 8 more lines, etc. Then you put different chars in the top row of each of the 16 video-matrix banks. In principle, this would give you 48 different full-width lines to choose between, just by writing a different value into d018. However, you'll actually get slightly less because you have to leave room for 2x40 bytes of video matrix inside each font, so that takes away 10 chars.

If you then massage the data a bit more, you could make use of all the 128 unique values that could be written into d018. This requires re-using chars in multiple lines.

I used this technique for the wavy chessboard in Shards of Fancy, with (IIRC) 64 different lines, each with a maximum usable width of 32 chars.
2016-09-07 14:50
Radiant

Registered: Sep 2004
Posts: 639
Thanks for the explaination; makes sense! Now I just need to figure out something novel to do with it. :-)
2016-09-07 16:21
Fresh

Registered: Jan 2005
Posts: 101
Quote:

In principle, this would give you 48 different full-width lines to choose between, just by writing a different value into d018. However, you'll actually get slightly less because you have to leave room for 2x40 bytes of video matrix inside each font, so that takes away 10 chars.

Actually you always get at least 48 different full-width lines because there are 246 (256-10) available chars, thats more than 6x40. If you need even only one more, like you said, you need to either use shorter lines or check for repeatable chars.
2016-09-07 17:23
lft

Registered: Jul 2007
Posts: 369
Quoting lft
However, I think it could be possible to repeat rows by switching off the badline condition in cycle 14.


Oh, silly me. Of course we can't do it that way. The explanation is left as an exercise for the reader.
2016-09-07 18:13
Oswald

Registered: Apr 2002
Posts: 5086
"The way you normally repeat a char row is to enable the badline condition in cycle 54-57. In order to do this every 8 lines, it follows that you have to write the same number into d011 every time. But you also have to prevent the badline condition before cycle 54, so you have to write something else to d011 in between. In conclusion, you can't do it with one write per char row."

so 8th row of char row, trigger badline in cycle 54-57, then write something else ? cycle 58, is fine for that ?

Radiant, did you manage 8 lines high chars ?

benefit of this would be soft bitmapmode, with page aligned rows. or to put in another way where the HI byte changes inside row, it happens always on the same column :)

the reason I want to repeat first row is that I also want tripple buffering and fullscreen, and having 3 screens in each bank is too expensive.

so one could reserve a charset for each row, 128 chars for each row, then 40 chars inside row for each buffer.
2016-09-07 18:31
Radiant

Registered: Sep 2004
Posts: 639
Let's see now. Yes, I'm resetting d011 again on the line after the doubling, which happens on cycle 54 of each line where RC=7 (that is, each eighth line).

You'd be hard pressed to squeeze in a write cycle on cycle 58 immediately after doubling. :-) But on the next line is of course ok. I do the resetting on cycle 56 on the line after the doubling.
2016-09-07 18:46
Oswald

Registered: Apr 2002
Posts: 5086
so you have all 8 lines repeated with this? as many times as you want ?
2016-09-07 19:04
Radiant

Registered: Sep 2004
Posts: 639
25 char rows, a single badline in the very beginning of the screen.
2016-09-07 19:10
lft

Registered: Jul 2007
Posts: 369
Quoting Radiant
You'd be hard pressed to squeeze in a write cycle on cycle 58 immediately after doubling. :-) But on the next line is of course ok.


It has to be on a different line, actually. Otherwise you'd get a spurious badline somewhere during the following row. (Because YSCROLL has to have some value, and that value is going to match the raster position at some point.)
2016-09-07 19:12
Oswald

Registered: Apr 2002
Posts: 5086
okay thanks for the hints guys.
Previous - 1 | 2 | 3 | 4 | 5 | 6 | 7 - 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
CyberBrain/NoName
Yogibear/Protovision
Core/VPN
iceout/Avatar/HF
Guests online: 87
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Mojo  (9.6)
6 The Demo Coder  (9.6)
7 What Is The Matrix 2  (9.6)
8 Uncensored  (9.6)
9 Wonderland XIV  (9.6)
10 Comaland 100%  (9.6)
Top onefile Demos
1 Layers  (9.6)
2 Party Elk 2  (9.6)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.6)
5 Libertongo  (9.5)
6 Rainbow Connection  (9.5)
7 Onscreen 5k  (9.5)
8 Morph  (9.5)
9 Dawnfall V1.1  (9.5)
10 It's More Fun to Com..  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Nostalgia  (9.3)
5 Triad  (9.2)
Top NTSC-Fixers
1 Pudwerx  (10)
2 Booze  (9.7)
3 Stormbringer  (9.7)
4 Fungus  (9.6)
5 Grim Reaper  (9.3)

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