Got some more of the GraphicsPort class written now that I’m using a VM that doesn’t crash every 10 minutes. I’ve renamed most of the functions that are currently implemented to something more meaningful. Instead of “drawFilledRect()”, “drawFilledRect(clip)” and “drawIntFilledRect()”, I’ve now got “drawFilledRect()”, “clipFilledRect(clip)” and “drawClippedFilledRect()”. Makes more sense to me, anyway.
All of the clipping routines for the drawing functions, which were previously copied-and-pasted throughout all of the functions with fiddly changes, are now consolidated into a single function. Much better. They now clip to the GraphicsPort, too.
I’ve added a couple more functions to the class - it can now draw vertical lines, horizontal lines, filled rectangles and text. This enabled me make another change - the Pong demo now uses a GraphicsPort for its drawing operations instead of a SuperBitmap gadget. That means I’m drawing directly to the framebuffer instead of to a RAM buffer and DMA copying it back to the framebuffer later.