Re: Waiting for a retrace..
- Posted by Pete Eberlein <xseal at HARBORSIDE.COM> Jun 28, 1997
- 808 views
Ralf Nieuwenhuijsen wrote: > I have some assembly code i like to translate... > I dunno asmebly, i just know that this piece of code waits until a > screen redraw is done. The automatic refresh rate says how many times > per sec this is done. > With this you will have no flicker on ANY Fast computer and the same > speed on all fast computers. On the slower ones (386 & slow 486) > there may be still some flickering. <snip> > > The WaitRetrace Code: > Well here's the code as is should be typed in C: > What's the Euphoria equilevent? > > Ralf Nieuwenhuijsen > nieuwen at xs4all.nl > ---------------------------Code: Turbo C ------------- > void WaitRetrace() { > > _DX = 0x03DA; > > l1: asm { > in al,dx; > and al,0x08; > jnz l1; > } > > l2: asm { > in al,dx; > and al,0x08; > jz l2; > } > } > ------------------------------ > BTW This is from the Asphyxia Tutorials by Denthor updated by SnowMan ok, Ralf. Here it is: ---- code begins ---- include ports.e procedure wait_retrace() ---- wait for a vertical retrace to start while and_bits(Input(#3DA), #08) != 0 do end while ---- then wait for it to end while and_bits(Input(#3DA), #08) = 0 do end while ---- now it's safe to write to the screen end procedure ---- code ends ---- Pete Eberlein <xseal at harborside.com>