Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!willett!ForthNet From: ForthNet@willett.UUCP (ForthNet articles from GEnie) Newsgroups: comp.lang.forth Subject: Graphics Message-ID: <291.UUL1.3#5129@willett.UUCP> Date: 19 Jan 90 23:18:42 GMT Organization: Latest Link in ForthNet Chain (Pittsburgh, PA) Lines: 90 Date: 01-17-90 (23:46) Number: 1715 (Echo) To: MARK SMILEY Refer#: 1709 From: MIKE SPERL Read: NO Subj: SCRNSAV.SEQ Status: PUBLIC MESSAGE Mark, >how about a faster version of CLIP_FILL_ELLIPSE ? Here's the first step: smart ellipse with automatic clipping. What about drawing segments of ellipses on the display? Would this be useful? All the tools are already available (with minor mods). : CLIP4PIXELS ( -- ) \ uses values of: x y xc yc inline \ XC @ X + YC @ Y + mov ax, xc add ax, ' x 3 + #) push ax mov ax, yc add ax, ' y 3 + #) 1push end-inline clip-dot inline \ XC @ X - YC @ Y + mov ax, xc sub ax, ' x 3 + #) push ax mov ax, yc add ax, ' y 3 + #) 1push end-inline clip-dot inline \ XC @ X + YC @ Y - mov ax, xc add ax, ' x 3 + #) push ax mov ax, yc sub ax, ' y 3 + #) 1push end-inline clip-dot inline \ XC @ X - YC @ Y - mov ax, xc sub ax, ' x 3 + #) push ax mov ax, yc sub ax, ' y 3 + #) 1push end-inline clip-dot ; : ELLIPSE ( xc yc a0 b0 -- ) \ smart ellipse inline \ clip? mov bx, sp mov ax, 6 [bx] \ xc cmp ax, 2 [bx] \ xc - a0 check left edge js 1 $ mov dx, 4 [bx] \ yc cmp dx, 0 [bx] \ yc - b0 check top edge js 1 $ add ax, 2 [bx] \ xc + a0 check right edge cmp ax, hres jge 1 $ add dx, 0 [bx] \ yc + b0 check bottom edge cmp dx, vres jge 1 $ xor ax, ax \ false 1push \ false -> don't clip 1 $: mov ax, # -1 1push \ true -> clip end-inline \ clip? if ['] CLIP4PIXELS IS ELLIPSE_PIXELS else ['] SET4PIXELS IS ELLIPSE_PIXELS then (ELLIPSE) ; commment: \ If you use smart ellipse, these words are redundant : CLIPELLIPSE ( xc yc a0 b0 -- ) ['] CLIP4PIXELS IS ELLIPSE_PIXELS (ELLIPSE) ; : CLIPELLIPSE? ( xc yc a0 b0 -- ) clip? \ substitute the inline code from ellipse here if ['] SET4PIXELS IS ELLIPSE_PIXELS else ['] CLIP4PIXELS IS ELLIPSE_PIXELS then (ELLIPSE) ; comment; Another suggestion: add ASSEMBLER INLINEON to tthe beginning af files containing assembler words (inluding high level words with inline code), and ASSEMBLER INLINEOFF ONLY FORTH ( optional ) at the end. This makes a big difference in the dot and line words particularly. I've got BARNEX running with the new words, now. Nice. If you want to send me something, I'd love a copy of your new book, 615 E. 68th St., Richfield, MN 55423. ;-) - Mike - ----- This message came from GEnie via willett through a semi-automated process. Report problems to: 'uunet!willett!dwp' or 'willett!dwp@gateway.sei.cmu.edu'