1. machine ports

Does anyone here know how to input data from a machine port?  I'm trying to
wait for a vertical retrace and I know it's value 8 at port #3DA but I don't
know how to read it.
                             TIA,

                              CHARN

new topic     » topic index » view message » categorize

2. Re: machine ports

At 04:15 PM 5/17/98 EDT, CHARN wrote:
>
>Does anyone here know how to input data from a machine port?  I'm trying to
>wait for a vertical retrace and I know it's value 8 at port #3DA but I don't
>know how to read it.

Pete Eberlein's ports.e should do the job. It's available from the
RDS web site, or my web site:
http://www.mindspring.com/~mountains

Irv

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

3. Re: machine ports

At 04:39 PM 5/17/98 -0400, I wrote:
Ooops! I misread your message. I think Ralf's graphic
package uses a wait-for-retrace statement.

Look for nextgfx.zip on my web site, or RDS archives.

Irv

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

4. Re: machine ports

>>Does anyone here know how to input data from a machine port?  I'm tryingto
>>wait for a vertical retrace and I know it's value 8 at port #3DA but I don't
>>know how to read it.
>
>Pete Eberlein's ports.e should do the job. It's available from the
>RDS web site, or my web site:
>http://www.mindspring.com/~mountains

ports.e isn't mine.  Jacques Deschenes is the author of that one.

But ports.e is too slow to use for the vertical retrace, so I rewrote the
wait for retrace in machine code.

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

The do "call(wait_retrace)" whenever you want.

 _______  ______  _______  ______
[    _  \[    _ ][ _   _ ][    _ ]
[/| [_] |[/| [_\][/ | | \][/| [_\]
  |  ___/  |  _]    | |     |  _]
[\| [/]  [\| [_/] [\| |/] [\| [_/]
[_____]  [______] [_____] [______]
       xseal at harborside.com

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

5. Re: machine ports

>At 04:39 PM 5/17/98 -0400, I wrote:
>Ooops! I misread your message. I think Ralf's graphic
>package uses a wait-for-retrace statement.
>
>Look for nextgfx.zip on my web site, or RDS archives.


All graphix libraries use it, only the ports.e (from Jaques Deschenes) is
quite slow for that kind of stuff, so I think it was Pete or Micheal Bolin
that made an ASM- waitretrace. It has been posted on the list-serv about a
year or so ago, and then used by me, hollow horse mode 19 engine, Pete's
ModeX engine, etc.

You could hack it from any of those libs, but here it is:
 global constant wait_retrace_code =
                   { #50,                   -- PUSH EAX
                     #52,                   -- PUSH EDX
                     #BA,#DA,3,0,0,         -- MOV EDX, 0x03DA
                     #EC,                   -- IN AL, 0x08
                     #24,#08,               -- AND AL, 0x08
                     #75,#FB,               -- JNZ $-5
                     #EC,                   -- IN AL, DX
                     #24,#08,               -- AND AL, 0x08
                     #74,#FB,               -- JZN $-5
                     #5A,                   -- POP EDX
                     #58,                   -- POP EAX
                     #C3 }                  -- RET

then you can just call this machine procedure *before* you draw to the
screen. An advice is to draw everything on a virtual screen (a sequence or a
piece of allocated memory) and copy or poke that onto the screen. This will
be the fastest and thus eliminate both the flicked due to mixing as the
flicker due to another wait-retrace. (if you take to long to draw another
wait retrace occurs)

Ralf Nieuwenhuijsen
nieuwen at xs4all.nl

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

Search



Quick Links

User menu

Not signed in.

Misc Menu