2 ; Ullrich von Bassewitz, 21.06.2002
4 ; void __fastcall__ tgi_bar (int x1, int y1, int x2, int y2);
5 ; /* Draw a bar (a filled rectangle) using the current color */
8 .include "tgi-kernel.inc"
10 .importzp ptr1, ptr2, ptr3, ptr4
31 ; Make sure X1 is less than X2. Swap both if not.
47 ; Make sure Y1 is less than Y2. Swap both if not.
63 ; Check if X2 or Y2 are negative. If so, the bar is completely out of screen.
69 ; Check if X1 is negative. If so, clip it to the left border (zero).
76 beq @L4 ; Branch always, skip following test
78 ; Check if X1 is beyond the right border. If so, the bar is invisible.
84 bcs @L9 ; Bail out if invisible
86 ; Check if Y1 is negative. If so, clip it to the top border (zero).
93 beq @L6 ; Branch always, skip following test
95 ; Check if Y1 is beyond the bottom border. If so, the bar is invisible.
101 bcs @L9 ; Bail out if invisible
103 ; Check if X2 is larger than the maximum x coord. If so, clip it.
114 ; Check if Y2 is larger than the maximum y coord. If so, clip it.
125 ; The coordinates are now valid. Call the driver.