[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Trying to make complete sense of the video scanner, HBL, and the floating bus



I was sure that I had implemented everything right, but for some strange reason things aren't right yet.  If you all would indulge me, I'm going to brain dump the various things I've gathered on the subject of floating bus.  Sather does an awesome job at talking it up from the hardware side, but after re-reading his notes a couple of times I still can't quite make sense of what exactly happens during HBL, except when he talks about what happens on the left-most fringe, where the previous byte in memory affects the left edge (e.g. the upper-right pixel at $2027 affects the middle-left pixel 64 rows down at $2028).

So, for starters, I assume that the video scanner draws the screen from Row 0 ($2000), then row 1 ($2400), and so on up to row 191.  Each clock cycle, a byte is read from ram and that byte remains available via the floating bus.

At the end of each row, HBL is started for the next 25 cycles.  The row is immediately incremented, and the scanner starts reading the next row at the start address minus 25 bytes, so after writing row 0 the HBL starts the scanner at $2400 - 25, or $2E37.  The scanner continues reading bytes, but video doesn't get output until 25 cycles later at $2400.

Once the scanner has finished row 191, VBL starts but the scanner effectively repeats this process over again for the last 70 rows as if it was re-scanning them again.

I get kind of confused on these points, because when I re-read Sather, he talks about the HBL and VBL accounting for the left, right, top and bottom margins.  But effectively, there are only left and bottom margins so to speak, because Y is incremented at the very end of the visible scanline, and VBL stops the moment it begins rendering row 0.  Am I reading too much into this?

All things being said and done, if I am right about the behavior of the scanner and floating bus then JACE should have worked for money munchers and the rainbow example a couple of iterations ago -- provided I didn't blatantly fat-finger something (ok, so I really shouldn't rule that out either. ;-)

Does this synopsis sound correct or did I miss something?

-B