Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

VSYNC with VGA 640x350,16 color ???

johnxxjohnxx Posts: 3Member
Hi there.
Could somebody tell me, how to make vsync in the 640x350, 16 colors mode ? Known at Turbo Pascal VGAmed ???

Thank's a lot!!!

Comments

  • SephirothSephiroth Fayetteville, NC, USAPosts: 1,035Member
    : Hi there.
    : Could somebody tell me, how to make vsync in the 640x350, 16 colors mode ? Known at Turbo Pascal VGAmed ???
    :
    : Thank's a lot!!!
    :
    I would think you need only render the entire buffer prior to sending it to the display, and only send X number of renders where X is the refresh rate of the monitor. I haven't touched DOS since around 1994 though, so I honestly don't remember specifics.

    -[italic][b][red]S[/red][purple]e[/purple][blue]p[/blue][green]h[/green][red]i[/red][purple]r[/purple][blue]o[/blue][green]t[/green][red]h[/red][/b][/italic]

  • Phat NatPhat Nat Posts: 757Member
    : : Hi there.
    : : Could somebody tell me, how to make vsync in the 640x350, 16 colors mode ? Known at Turbo Pascal VGAmed ???
    : :
    : : Thank's a lot!!!
    : :
    : I would think you need only render the entire buffer prior to sending it to the display, and only send X number of renders where X is the refresh rate of the monitor. I haven't touched DOS since around 1994 though, so I honestly don't remember specifics.
    :
    : -[italic][b][red]S[/red][purple]e[/purple][blue]p[/blue][green]h[/green][red]i[/red][purple]r[/purple][blue]o[/blue][green]t[/green][red]h[/red][/b][/italic]
    :

    I think it would be the same as with all other DOS resolutions (which I still play with here and there, love DOS ;)

    Read Port 3DAh until bit 3 becomes , then immediately read it until bit 3 becomes 1. This will give you the beam at the top of the refresh.

    I program in TP, but I use inline assembly for the speed. Hopefully this makes sense to you:
    [code]
    Mov dx,3DAh
    @l1:
    In al,dx
    And al,08h
    Jnz @l1
    @l2:
    In al,dx
    And al,08h
    Jz @l2
    [/code]

    I think the first loop waits until the beam hits the end, then the second is where it starts at the top. (not sure on this though)

    Phat Nat

  • johnxxjohnxx Posts: 3Member
    : : : Hi there.
    : : : Could somebody tell me, how to make vsync in the 640x350, 16 colors mode ? Known at Turbo Pascal VGAmed ???
    : : :
    : : : Thank's a lot!!!
    : : :
    : : I would think you need only render the entire buffer prior to sending it to the display, and only send X number of renders where X is the refresh rate of the monitor. I haven't touched DOS since around 1994 though, so I honestly don't remember specifics.
    : :
    : : -[italic][b][red]S[/red][purple]e[/purple][blue]p[/blue][green]h[/green][red]i[/red][purple]r[/purple][blue]o[/blue][green]t[/green][red]h[/red][/b][/italic]
    : :
    :
    : I think it would be the same as with all other DOS resolutions (which I still play with here and there, love DOS ;)
    :
    : Read Port 3DAh until bit 3 becomes , then immediately read it until bit 3 becomes 1. This will give you the beam at the top of the refresh.
    :
    : I program in TP, but I use inline assembly for the speed. Hopefully this makes sense to you:
    : [code]
    : Mov dx,3DAh
    : @l1:
    : In al,dx
    : And al,08h
    : Jnz @l1
    : @l2:
    : In al,dx
    : And al,08h
    : Jz @l2
    : [/code]
    :
    : I think the first loop waits until the beam hits the end, then the second is where it starts at the top. (not sure on this though)
    :
    : Phat Nat
    :
    :
    Thanks a lot!!! it works funnily enough, 'cause i tried it before with this routine, but it didn't want work. Thanks a lot for the hint!!!
Sign In or Register to comment.