--------------- FIDO MESSAGE AREA==> TOPIC: 145 ASSEMBLY LANG. Ref: E2T00065Date: 02/19/97 From: DENIS BOYLES Time: 05:06pm \/To: FRANK TOPPING (Read 2 times) Subj: Vertical Retrace Demo 2/ >>> Continued from previous message ;[WaitRetrace]------------------------- ; wait for full vertical retrace ;-------------------------------------- WaitRetrace PROC mov DX,03DAh ;DX = CGA status port WR0: ;`flush' current retrace if any in AL,DX ;input CGA status into AL test AL,8 ;test bit 3(8) for retrace? jnz WR0 ;keep looping while ON (1) WR1: ;after flush, wait for retrace in AL,DX test AL,8 jz WR1 ;keep looping while OFF (0) ret WaitRetrace ENDP ;[WritePalette]------------------------ ; dump palette starting at DACIndex ;-------------------------------------- WritePalette PROC mov DX,03C8h ;DX = index to write to port mov AL,[DACIndex] ;set AL to starting index DACIndex out DX,AL ;inform card of write position inc DX ;DX=DX+1 to form RGB write/read port mov CX,768 ;again, we're writing 768 bytes rep outsb ;dump palette to video card ret WritePalette ENDP CODE ENDS DATA SEGMENT palette db 768 dup(?) ;256 * 3 = 768 palette buffer DACIndex db 0,? ;index to write to (flips over) switch db ? ;store command line switch DATA ENDS STACK SEGMENT STACK db 0100h dup(?) ;256 bytes of stack space? STACK ENDS END main * OLX 2.1 TD * Hello, I am part number ||X||||X||X||X|| --- Maximus/2 3.01 * Origin: Frog Hollow Port Moody BC 604-469-0264/0284 (1:153/290) --------------- FIDO MESSAGE AREA==> TOPIC: 145 ASSEMBLY LANG. Ref: E2T00066Date: 02/19/97 From: DENIS BOYLES Time: 03:46pm \/To: FRANK TOPPING (Read 2 times) Subj: Wait for Vertical Retrac Hello Frank, FT>Could someone please explain the technique for waiting for vertical FT>retrace for smooth scrolling, page flipping etc. Simply read the CGA status port located @ 03DAh and test bit 3 for vertical retrace or no retrace. When the bit is ON then the display card is in a vertical retrace. When the bit is OFF then the display card is refreshing the screen. For a complete vertical retrace, `flush' out the current one, if any, and then wait for the next one to start. [--------------------------------------------------------------------------] WaitVerticalRetrace PROC mov DX,03DAh ;setup DX with CGA port address VR0: ;this `flushes' current retrace in AL,DX ;input CGA status into AL test AL,00001000b ;test bit 3 (8) for vertical retrace jnz VR0 ;loop until zero (start of redraw) VR1: ;wait for start of retrace in AL,DX test AL,00001000b jz VR1 ;loop until one (start of retrace) ret WaitVerticalRetrace ENDP [--------------------------------------------------------------------------] Cheers, Denis Boyles * OLX 2.1 TD * Backup not found: (A)bort (R)etry (P)anic --- Maximus/2 3.01 * Origin: Frog Hollow Port Moody BC 604-469-0264/0284 (1:153/290) --------------- FIDO MESSAGE AREA==> TOPIC: 145 ASSEMBLY LANG. Ref: E2T00067Date: 02/19/97 From: MIKKO HYVARINEN Time: 02:52pm \/To: KEVIN BARROW (Read 2 times) Subj: Writing to the "DOS" enviroment KB> I am wanting to "Create" A program that modifies The "Shells" Enviroment KB> I am looking to do this so that I can write a TSR or A Driver that Will KB> allow me to Push and Pop The Enviroment, So that I can save everything, KB> modify the enviroment, and then restore the enviroment.. And it can't KB> be all that hard to do, Command.com Does it.. The point is that COMMAND.COM knows for sure where its environment is. You don't and there's no 100% sure way of locating it. There are ways that work quite well but die horribly in some cases and there are ways that work only in rare circumstances. Most of these are documented in the 80xxx echo snippets collection for the year 1995. If you don't have it, get it. 80xxx_95.zip is the filename, IIRC. End of thread. --- * Origin: Out from the new days mist I have come... (2:229/229.5) --------------- FIDO MESSAGE AREA==> TOPIC: 145 ASSEMBLY LANG. Ref: E2T00068Date: 02/19/97 From: MIKKO HYVARINEN Time: 02:49pm \/To: FRANK TOPPING (Read 2 times) Subj: Wait for Vertical Retrace FT> Could someone please explain the technique for waiting for vertical FT> retrace for smooth scrolling, page flipping etc. mov dx, 3dah @@loop1: in al, dx test al, 8 jnz @@loop1 @@loop2: in al, dx test al, 8 jz @@loop2 Bit 3 of register 3DAh is set when a vertical retrace is in progress. First you wait until the current rectrace (if any) is finished (to avoid begin drawing near the end of the retrace) and then you wait for the next trace to start. --- * Origin: By myself but not alone... (2:229/229.5)