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
11 .import popax, popptr1
29 ; Make sure X1 is less than X2. Swap both if not.
45 ; Make sure Y1 is less than Y2. Swap both if not.
61 ; Check if X2 or Y2 are negative. If so, the bar is completely out of screen.
67 ; Check if X1 is negative. If so, clip it to the left border (zero).
74 beq @L4 ; Branch always, skip following test
76 ; Check if X1 is beyond the right border. If so, the bar is invisible.
82 bcs @L9 ; Bail out if invisible
84 ; Check if Y1 is negative. If so, clip it to the top border (zero).
91 beq @L6 ; Branch always, skip following test
93 ; Check if Y1 is beyond the bottom border. If so, the bar is invisible.
99 bcs @L9 ; Bail out if invisible
101 ; Check if X2 is larger than the maximum x coord. If so, clip it.
112 ; Check if Y2 is larger than the maximum y coord. If so, clip it.
123 ; The coordinates are now valid. Call the driver.