I give you this little demonstration:
100 COLOR 15,0,0:SCREEN 5 110 COLOR=(4,7,0,0):COLOR=(8,0,7,0):COLOR=(12,7,7,0) 120 P=0:SETPAGE P,1-P:CLS 130 FOR I=-31 TO 32 140 SETPAGE P,1-P 150 J=ABS(I)-16 160 LINE (64,74)-(191,137),0,BF 170 LINE (80+J,74)-(80-J,137),4,,XOR 180 LINE (159+J,74)-(159-J,137),4,,XOR 190 LINE (96-J,74)-(96+J,137),8,,XOR 200 LINE (175-J,74)-(175+J,137),8,,XOR 210 COPY (64,74)-(191,137) TO (65,74),,XOR 220 P=1-P:NEXT I 230 GOTO 130
It just draws the edges of the polygon, and then fills them by executing an LMMM with XOR with a 1-pixel overlapping offset. The limitation being that you can have as many colours as there are bits, or more if the polygons don’t overlap. It can be used to great effect to implement a Glenz Vector effect.
Obviously in assembly this could be optimised to let the VDP do back-to-back polygon fills while the CPU clears the VRAM and draws the lines. The CPU should do the line drawing anyway since for lines angled more than 45 degrees horizontally only the first pixel should be drawn (with a modified Bresenham algorithm).
!login ou Inscrivez-vous pour poster