1. Wait-retrace

Does anyone have a wait-retrace routine hanging wround on their hard-drive?
I've got a problem with a palette cycling routine (see:- Palette Cycling
Problem) and I'm now convinced that only a wait-retrace routine will fix
it. Machine code if it has to be, but I'd prefer something a bit more
palettable, (sorry!)
I'm really stuck on this one and would appreciate the advice of someone
who knows stuff that I don't.
I'm a newbie to E and have only ever delt with Qbasic, but I'm willing to
try anything!
My monster is almost complete -- Ah Ah Ah Ah...........
Please help me to help the world.
Andrew

new topic     » topic index » view message » categorize

2. Re: Wait-retrace

global constant wait_retrace = allocate(20)
poke(wait_retrace, {
                #50,        -- PUSH EAX
                #52,        -- PUSH EDX
                #BA,#DA,3,0,0,-- MOV EDX, 0x03DA
                #EC,        -- IN AL, DX
                #24,#08,    -- AND AL, 0x08
                #75,#FB,    -- JNZ -5
                #EC,        -- IN AL, DX
                #24,#08,    -- AND AL, 0x08
                #74,#FB,    -- JZ -5
                #5A,        -- POP EDX
                #58,        -- POP EAX
                #C3 } )     -- RET

now you should be able to call it with:
call ( wait_retrace )

call it right before you write to the screen.

CHARN

new topic     » goto parent     » topic index » view message » categorize

3. Re: Wait-retrace

----------
> From: CHARN1407 at AOL.COM
> To: EUPHORIA at LISTSERV.MUOHIO.EDU
> Subject: Re: Wait-retrace
> Date: Sunday, January 03, 1999 11:52 AM
>
> ---------------------- Information from the mail header
-----------------------
> Sender:       Euphoria Programming for MS-DOS
<EUPHORIA at LISTSERV.MUOHIO.EDU>
> Poster:       CHARN1407 at AOL.COM
> Subject:      Re: Wait-retrace
>
----------------------------------------------------------------------------
---
>
> global constant wait_retrace = allocate(20)
> poke(wait_retrace, {
>                 #50,        -- PUSH EAX
>                 #52,        -- PUSH EDX
>                 #BA,#DA,3,0,0,-- MOV EDX, 0x03DA
>                 #EC,        -- IN AL, DX
>                 #24,#08,    -- AND AL, 0x08
>                 #75,#FB,    -- JNZ -5
>                 #EC,        -- IN AL, DX
>                 #24,#08,    -- AND AL, 0x08
>                 #74,#FB,    -- JZ -5
>                 #5A,        -- POP EDX
>                 #58,        -- POP EAX
>                 #C3 } )     -- RET
>
> now you should be able to call it with:
> call ( wait_retrace )
>
> call it right before you write to the screen.
>
> CHARN

> call it right before you write to the screen.
And/Or right before changing the palette
_________________________
"I'm good ! Not god." Lucius L. Hilley III - 1998
_________________________

Lucius L. Hilley III    lhilley at cdc.net
http://www.cdc.net/~lhilley
http://www.dragonvet.com
_________________________
<IMG SRC="http://www.cdc.net/~ceace/images/lu4.jpg">
_________________________

new topic     » goto parent     » topic index » view message » categorize

4. Re: Wait-retrace

Hi Euphoria Programming for MS-DOS, replying to your letter dated Minggu, 3
Januari 1999...

> Does anyone have a wait-retrace routine hanging wround on their hard-drive?

This is taken from Allegro (credits to Shawn Hargreaves). It doesn't
use any funky stuff so should be easy to port.

/* _vsync_out_h:
 *  Waits until the VGA is not in either a vertical or horizontal retrace.
 */
__INLINE__ void _vsync_out_h()
{
   do {
   } while (inportb(0x3DA) & 1);
}


/* _vsync_out_v:
 *  Waits until the VGA is not in a vertical retrace.
 */
__INLINE__ void _vsync_out_v()
{
   do {
   } while (inportb(0x3DA) & 8);
}


/* _vsync_in:
 *  Waits until the VGA is in the vertical retrace period.
 */
__INLINE__ void _vsync_in()
{
   if (_timer_use_retrace) {
      int t = retrace_count;

      do {
      } while (t == retrace_count);
   }
   else {
      do {
      } while (!(inportb(0x3DA) & 8));
   }
}



Euphoria, don't forget to reply,
Hendy Irawan => Phone: +62 (354) 685866
 Smash forehead on keyboard to continue.....

Try this...
THE Ultimate Programmers' Search Engine
http://developers.href.com

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu