Draw_Grid_VL ($FF9F)

This routine apparently will draw a vector list using a 16x16 grid, and occasionally using regular vector lists too. This could possibly be useful for drawing gridded things like a chess board and all of its pieces at the same time.

The master vector list contains multiple sublists that start with a flag byte:

Bit 7 = draw the next regular vector list (from X-reg) first
Bit 6 = this is the last sublist in the master vector list
Bits 5,4 = unused
Bits 3-0 = number of points in this sublist (1-16)

The points are stored as a pair of nibbles:

Bits 7-4 = Y coordinate (?)
Bits 3-0 = X coordinate (?)

 

ENTRY:

DP = $D0

X-reg points to regular vector lists

Y-reg points to master vector list

 

EXIT:

X-reg points to next byte after last regular vector list used

Y-reg points to next byte after end of master vector list

D-reg trashed

 

Source