Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!willett!ForthNet From: ForthNet@willett.UUCP (ForthNet articles from GEnie) Newsgroups: comp.lang.forth Subject: GRAPHICS BUGS Message-ID: <199.UUL1.3#5129@willett.UUCP> Date: 5 Jan 90 20:43:57 GMT Organization: Latest Link in ForthNet Chain Lines: 61 Date: 01-02-90 (05:48) Number: 1696 To: MIKE SPERL Refer#: NONE From: MARK SMILEY Read: NO Subj: GRAPHICS BUGS Status: PUBLIC MESSAGE Mike, Alas, FILL-ELLIPSE (renamed to FILL_ELLIPSE) didn't work for me. In EGA or VGA640 mode, try: : FF ( -- ) \ draws a centered filled ellipse hres @ 2/ vres @ 2/ 2DUP SWAP 2/ SWAP 2/ ; FILL_ELLIPSE ; FF It only filled the horizontal line one away from the bottom line of the ellipse. On the other hand, EGA 300 200 20 30 FILL_ELLIPSE filled only a thin vertical line to the left of center. . In checking out FILL_ELLIPSE, I discovered another bug in GRAFKRNL.SEQ. . DOT ( x y color -- ) and CDOT didn't work properly, due to the value of COLOR being used in set.res2. The change I made is simple, though you may know a better way: . \ write mode 2 (assumes di=color) label set.res2di \ load set/reset reg. w/ color mov dx, # $3ce \ address graphics contrl. regs. mov ax, # $0f01 \ al = enable set/res. reg. index = 1 out dx, ax \ ah = all 8 bits on, written to $3cf xor ax, ax \ al = set/reset reg. index = 0 XCHG BX, DI \ save BX MOV AH, BL \ send color (host data to vga) \ Can't MOV AH, DI out dx, ax XCHG BX, DI \ restore BX (necessary for routines that \ compute the pixel address before calling \ this routine.). Restores DI just in case \ it's needed by the calling routine. ret c; . code ega.dot ( x y color -- ) POP DI \ color in di pop cx pop dx \ dx = col, cx = row (dx=x, cx=y) +code ega.d push es \ save forth; color in di call ega.pel.addr call set.res2DI \ does: mov dx, # $3ce \THE ONLY CHANGE not cl \ = 255 - cl and cl, # 7 \ = 0 to 7 mov ax, # $108 rol ah, cl \ position our bit out dx, ax \ mask to data reg mov ax, di \ color in ega = 0..15 or es: 0 [bx], al \ write pixel call restr.state pop es next c; ----- This message came from GEnie via willett through a semi-automated program. Report problems to: 'uunet!willett!dwp' or 'willett!dwp@gateway.sei.cmu.edu'