TED badlines, how do they work?

From: Gerrit Heitsch <gerrit_at_laosinh.s.bawue.de>
Date: Thu, 01 Sep 2011 18:26:07 +0200
Message-ID: <4E5FB21F.1030005@laosinh.s.bawue.de>

I'm trying to understand how the TED handles the badlines it needs to 
get character and attribute info.

The VIC-II in the C64 has an internal RAM of 40 x 12 Bits and since it 
has a 12 Bit data bus it only needs one badline per character row. This 
can happen on the first raster line of a character row.

TED on the other hand has only 8 Bits on the data bus and 8 Bit 
attributes so it needs 2 badlines per character row, one for the 
character pointer and one for the attributes (color, brightness, flash). 
It also needs 2 internal RAM blocks of 40 x 8 Bits. The problem I see is 
that in order to produce a correct character row all the information 
necessary for that row needs to be present at all times. So you cannot 
just have one badline at the first raster line and one at the second 
raster line of a character row since that would mean that you don't have 
the correct attributes during the first raster line.

The only working way I could come up with is that the badlines happen at 
the last raster line of the preceeding character row and at the first 
raster line of the current character row.

Also the access timing for the internal RAM blocks and system RAM access 
needs to differ between the 2 badlines. During the first badline (at the 
end of a character row) TED first hands the Byte from internal RAM to 
the video logic and then replaces it with the one it read from system 
RAM during the next cycle since it no longer needs the internally 
buffered Byte by then. During the second badline, TED first grabs a Byte 
from system RAM, stores it internally and then uses it together with the 
data from the character ROM it gets in the next cycle.

Memory access to system RAM during badline 1 would look like this:


Badline 2:


A = Attribute or character pointer load
C = Character ROM access.

I have no idea if that's the way it's really implemented but that's the 
only way I could come up with that would work. Looks like a rather 
complicated state machine though, especially at the end of the screen.

Also, TED seems to be the only MOS video controller that needs 2 badlines.

I'm open for suggestions and corrections.


       Message was sent through the cbm-hackers mailing list
Received on 2011-09-01 17:00:17

Archive generated by hypermail 2.2.0.