tepples wrote:
To draw each scanline of a background, do this 33 times:
- Fetch a nametable entry.
- Fetch the corresponding attribute table entry.
- Fetch the low-order byte of the pattern table sliver.
- Fetch the high-order byte of the pattern table sliver.
- Turn the attribute data and the pattern table data into palette indices, and store them in an array for combination with sprite data.
Which one of the five steps do you want explained in detail first?
ok, i think this algorithm you wrote may be helpful.
let's start with step 1: fetch a name table entry.
first of all, i have to read wich is written in $2000 to fetch the information about the address of the name table wich is gonna be used (bits 0 and 1) and the sprite pattern table and background pattern table wich are gonna be used (bits 3 and 4, respectively). that's easy. but what do you mean with "name table entry"? is it a write to $2004 or $2006 or any write to an address between the name table space?
also i have another question about this. as i read, $2003 is used to write the 8-bit address in SPR-RAM to access via $2004. i.e.:
(extracted from GbaGuy demo)
lda #$00 ; these lines tell $2003
sta $2003 ; to tell
lda #$00 ; $2004 to start
sta $2003 ; at $0000.
when i'm handling a routine like that, do i have to store the first write to $2003 (the first "sta $2003") in some variable in order to later assemble it with the value written in the second write? because if i don't, at the second write i'll miss the value written in first time. in that case, why its says it's a 8-bit address if it's a 16-bits address (2 bytes written to $2003 = 16-bits address)?
does all the addresses in a name table work like this? (i.e.: $2014 -> the address register, $2015 -> I/O register)