DYCP scroller

A DYCP scroller lets you display characters on different y positions by using a neat little trick.

You basically use the character set as a bitmap canvas for copying characters from memory to your desired y position, before scrolling along the x axis. And as always, the hard part is not the method itself, but making it fast enough to actually work. The problem here is clearing the bitmap, which I discovered was harder than I thought, but ended up opting the same method that was used in the y-scroller: using two buffers and only clearing parts of the bitmap on a given scroll position.

In addition, this tutorial enabled me to really test the cycle counter for the first time. With the first version, the total cycle count for the DYCP method was over 500 cycles, but after reorganizing stuff and optimizing, I managed to squeeze it down to 300 cycles. In the end, I rewrote the inner loop to inline assembler, and it suddenly went down to 200 cycles – enough to be able to draw a bitmap in addition to having a scroller.

As in some of the previous tutorials, we will again split the screen into two parts: an upper with multicolor bitmap graphics on bank 3, and a lower regular text non-multicolor scoller area that switches between bank 1 and 2 on every 8th scroll cycle.