Shop OBEX P1 Docs P2 Docs Learn Events
Sync with vblank on PTP (v1)? Attn Rayman — Parallax Forums

Sync with vblank on PTP (v1)? Attn Rayman

avsa242avsa242 Posts: 452
edited 2013-05-14 03:04 in Propeller 1
Ray,

Can you tell me if this is the proper way to wait for vblank on the original PTP?
PUB meter|i,j,k,l
  
fs.SetPrecision(2)
i:=f.FFloat(0)
gr.textmode(2,2,6,5)
repeat
 repeat until lcd_status == 1 ' Sync with VBlank
 gr.clear

 i:=f.FAdd(i,0.10)
 j:=fs.FloatToFormat(i,9,0)
 gr.text(-90,50,j)

I don't have enough RAM for a double-buffered display, so I'm trying to wait until the display is ready before clearing it for the next frame, instead. It does seem to work; the flicker is reduced to pretty much nothing, however, the refresh rate of my outer repeat loop is at or slightly less than 10 per second (without waiting it is 20-30/sec), so I just want to be sure this is the right way to sync before trying to change the rest of my program (I'm sure a lot of time is eaten up by f.Fadd and fs.FloatToFormat - F32 and FloatString objects, respectively).

Thanks!

Cheers,
Jesse

Comments

  • RaymanRayman Posts: 14,665
    edited 2013-05-12 18:21
    I think that is the right way. That driver is just a modified version of the Parallax VGA driver.
    I think that part of it works the same may.

    Double buffering that way will probably be a challenge though...
  • avsa242avsa242 Posts: 452
    edited 2013-05-13 15:17
    Ray, thanks. It seemed to work, I just wanted to be sure I wasn't missing something.
    Yeah, with the float objects, I just don't have enough RAM left to double-buffer - so I'm going with a single buffer and syncing with the vblank signal to reduce flicker, instead.

    Cheers,
    Jesse
  • RaymanRayman Posts: 14,665
    edited 2013-05-13 15:34
    Sounds like you're doing a meter of some sort... One thing you can do is do graphics over a smaller portion of the screen and text elsewhere...
    You can actually have multiple independent graphics areas around the screen.
  • avsa242avsa242 Posts: 452
    edited 2013-05-14 03:04
    See I don't have the instincts that that would've occurred to me :) Thanks, I'll look into it. Tile-based graphics are alien to me...I'm still hung up on my old BASIC days of just setting a screen resolution, and drawing text, lines, pixels and circles :)

    Cheers,
    Jesse
Sign In or Register to comment.