| |
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.... |
| |
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. |
| |
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. :-) |
| |
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. |
| |
lft
Registered: Jul 2007 Posts: 369 |
Quoting lftHowever, 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. |
| |
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. |
| |
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. |
| |
Oswald
Registered: Apr 2002 Posts: 5086 |
so you have all 8 lines repeated with this? as many times as you want ? |
| |
Radiant
Registered: Sep 2004 Posts: 639 |
25 char rows, a single badline in the very beginning of the screen. |
| |
lft
Registered: Jul 2007 Posts: 369 |
Quoting RadiantYou'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.) |
| |
Oswald
Registered: Apr 2002 Posts: 5086 |
okay thanks for the hints guys. |
Previous - 1 | 2 | 3 | 4 | 5 | 6 | 7 - Next |