Hmm.. okay, here's what the test program does (apologies for the potato-camera images, but they get the message across I think):
; Draw filled rectangleCommand 0x8020H ; set X[0] to 32
Command 0x0C001H ; set Y[0] to 1
Command 0x9024H ; set X[1] to 36
Command 0x0D004H ; set Y[1] to 4
Command 0x0CFFH ; draw filled rectangle
; 1st diagonalCommand 0x8021H ; set X[0] to 33
Command 0x0C002H ; set Y[0] to 2
Command 0x9023H ; set X[1] to 35
Command 0x0D03H ; set Y[1] to 3
Command 0x02FFH ; draw line X[0],Y[0] to X[1],Y[1]
; 2nd diagonalCommand 0x8021H ; set X[0] to 33
Command 0x0C003H ; set Y[0] to 3
Command 0x9023H ; set X[1] to 35
Command 0x0D002H ; set Y[1] to 2
Command 0x02FFH ; draw line X[0],Y[0] to X[1],Y[1]
; Non-filled rectangleCommand 0x8020H ; set X[0] to 32
Command 0x0C001H ; set Y[0] to 1
Command 0x9024H ; set X[1] to 36
Command 0x0D004H ; set Y[1] to 4
Command 0x04FFH ; draw rectangle
Attached images show the output of the FIRST filled rectangle block above, then the output after the first keypress (i.e. the diagonals) - although it all seems to have gone to rat food after the first rectangle.
There's obviously a couple of lines of code between setting the register coordinates and telling the GPU to draw the shape that I have missed out of the above - this just overwrites the 'FF' in the draw command to set a different colour and has worked fine all along, so I don't suspect anything wrong with that and have left it out for the sake of simplicity.
16-bit values starting with a letter have a leading zero in front because the assembler that I use, Z80ASM, requires it.