Muhammad_R4 wrote:
1- As far as I understood , the output which is 4 bits and equivalent to a pixel , the 4 bits are ( 2 from pattern table and 2 from attribute table ) to be concatenated forming 4 bits which is an index to a color in the palette memory
Is what I understood true ?
Yes.
Quote:
2- If I am true , I think there must be another memory fetch taking the above 4 bits which are index to colour to fetch the colour it self
from the palette memory
Like OAM, palette memory (also called Color Generator Random Access Memory, or CGRAM) is on a separate bus. The eight fetches from CGRAM happen in parallel to the fetches from video memory, one for each pixel.
Quote:
3- In this PDF (page 39)
http://web.mit.edu/6.111/www/f2004/proj ... report.pdfthe diagram is showing the BG buffer , My question is why there are 4 registers ? isn't two enough for the 2 pattern tile ?
what are the other two is doing ?
There are a total of six 8-bit shift registers:
- A parallel-in, serial-out (PISO) shift register for pattern data bit plane 0, to extract individual pixel values from the bytes
- A PISO shift register for pattern data bit plane 1, to extract individual pixel values from the bytes
- A serial-in, parallel-out (SIPO) shift register fed by shift register A, to delay bit 0 of pixel data for fine scrolling
- A SIPO shift register fed by shift register B, to delay bit 1 of pixel data for fine scrolling
- A SIPO shift register fed by attribute bit 0, to delay bit 2 of pixel data for fine scrolling
- A SIPO shift register fed by attribute bit 1, to delay bit 3 of pixel data for fine scrolling
Pattern data fetched from CHR ROM or CHR RAM is fed into shift registers A and B. These in turn feed into C and D, while the attribute data feeds into E and F. Together, shift registers C, D, E, and F act as a delay line, feeding a set of four 8 to 1 multiplexers (or "muxes" for short) that select a pixel from the shift registers based on the fine horizontal (X) scroll value interpreted as a delay amount.
Together, the
pattern_bitmap_one line represents what I call registers A and C, and the
pattern_bitmap_two line represents what I call registers B and D. This makes
palette_data_one equivalent to E and
palette_data_two analogous to F. The
palette_data_one and
palette_data_two registers are 16-bit in the cited diagram, but they really only need to be 9-bit (1 bit of source and 8 bits of shift register), as a single value applies to all eight pixels of an 8x1 pixel background sliver.