New PALib, Double Buffering, and AmigaGuideDS

I’ve upgraded to the latest PALib (070717) after backing up my previous install of DevKitPro and PALib. So far it all looks good - both DefenderDS and AmigaGuideDS compile without any problems. Even better, the new library includes double-buffering code for 8-bit and 16-bit screens.

Stripped out my cumbersome double-buffering routines from AmigaGuideDS and replaced them with the “official” versions, but it’s still far too slow. The reason is that the program completely redraws both screens every time the text scrolls. This is no good.

After a little thought, the solution is obvious - I don’t need to re-plot every pixel on the screen when most of the pixels don’t change; I just need to shift the rows of pixels up or down using DMA_Copy() (to copy the row from one position to the next), then draw a new row at either the top or bottom of the screen (this will contain the new content scrolling into the screen). Implemented the copy routine and everything’s now much quicker. Huzzah!