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 08:05
Radiant

Registered: Sep 2004
Posts: 639
Now that I think about it it does seem a little strange, as if one line would be lost... But that was the first thing I coded for the demo, don't remember the implementation details.
2016-09-07 09:17
lft

Registered: Jul 2007
Posts: 369
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.

I don't immediately see how this could be done in cycle 54-57 with one write every 7th line. It seems like RC would be 6 the second time. What am I missing?

However, I think it could be possible to repeat rows by switching off the badline condition in cycle 14. This would work with partial rows, e.g. every 7th line. Then you'd utilise the resetting of RC that happens in the first half of that cycle. Is that how you do it?
2016-09-07 09:22
Radiant

Registered: Sep 2004
Posts: 639
I don't remember - it's possible I did two d011 writes for every doubled row. Will have to check my code. :-)
2016-09-07 09:26
Radiant

Registered: Sep 2004
Posts: 639
You can restart the current row by triggering a badline condition before cycle 14 (IIRC) when RC > 0. It's one way of doing FPP (if you don't mind wasting 40 cycles on a badline), though I haven't found any real use for it just by thinking about it.
2016-09-07 11:58
lft

Registered: Jul 2007
Posts: 369
Yes, but then you get DMA. The benefit of FPP with badlines is that you can select among 128 different lines per VIC bank, whereas if you do it without badlines you only get 8. But normally, the point of repeating a row is that you want to avoid badlines/DMA.
2016-09-07 13:35
Oswald

Registered: Apr 2002
Posts: 5086
dma or no dma doesnt matter, the Q is if its possible? :) could be 2 d011 writes too...
2016-09-07 13:49
Radiant

Registered: Sep 2004
Posts: 639
Quote: Yes, but then you get DMA. The benefit of FPP with badlines is that you can select among 128 different lines per VIC bank, whereas if you do it without badlines you only get 8. But normally, the point of repeating a row is that you want to avoid badlines/DMA.

I don't see how you'd get access to more possible FPP lines, given that VC doesn't change when you retrigger a line?
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.
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
Marq/Fit^Lieves!Tuor..
Scooby/G★P/Light
Nordischsound/Hokuto..
Magnar
Sokrates
DJ Gruby/TRiAD
Guests online: 75
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 Comaland 100%  (9.6)
10 Wonderland XIV  (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 Graphicians
1 Mirage  (9.7)
2 Archmage  (9.7)
3 Mikael  (9.6)
4 Carrion  (9.6)
5 Sulevi  (9.6)

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