Re: [stella] VBLANK or VSYNC first?

Subject: Re: [stella] VBLANK or VSYNC first?
From: Chris Wilkson <ecwilkso@xxxxxxx>
Date: Mon, 22 Oct 2001 11:30:35 -0400 (EDT)
On Tue, 23 Oct 2001, ben wrote:

> The stella docs say that there should be 3 lines of VSYNC, followed by
> VBLANK for 37 lines.  But it seems combat sets the VBLANK first, then WSYNC
> for 3 lines, then VSYNC start, then 3 lines then VSYNC stop.  Which seems
> to me like VBLANK is used to 'skip' a frame and get back to the start ready
> for an RSYNC?

I think you may be confusing RSYNC with VSYNC.  The *ONLY* thing RSYNC does
is reset the horizontal counters.  That's it.

The above is correct.  VBLANK just blanks the video output.  The sync line
is still active.  VBLANK is a lazy way to get a black screen.  In this case,
they are using VBLANK to create the 3 lines of equalization pulses before
VSYNC.  Then they do 3 lines of VSYNC.  You don't mention when they turn off
VBLANK, and I don't have the code in front of me.  But it's perfectly
acceptable to do the following:

turn on VBLANK
turn on VSYNC
turn off SYNC
turn off VBLANK

> If not, what is the purpose of writing to VBLANK start?  What actually is
> used to allow the programmer to set the real start of the frame (ie
> scanline 0, position 0), VBLANK or VSYNC, or both?  It is clear WSYNC is to
> wait for the start of the scanline, but can anyone clear up the frame
> start/stop easily for me please?

The start of the frame is set by when you turn off VSYNC.  VBLANK can come at
any has no effect whatsoever on timing.  You can change VSYNC at any
time too, for that matter.   That's why you must wait for WSYNC (or count
cycles) to toggle VSYNC.  It has no knowledge of the horizontal counter.
Internally, VSYNC is just XORed with the regular sync signal that is generated
by the horizontal counters.

> In my emulator, I have managed to RSYNC to the start of the frame, WSYNC to
> start of scanline, and sure enough, 3 scanlines later rsync was stopped,
> but VBLANK was not following the rules :) you mean RSYNC, or VSYNC?  For (most) intents and purposes, you
can entirely ignore RSYNC when programming.  The only reason I can think of
to mess with that, is if you're trying to create a non-standard video signal.

Does anyone know of a released game that frobs RSYNC?  I'd be interested...
Oh!  Does "GI Joe" do this with the giant cobra?  Hmmm...yeah, that would
seem plausible.  Any others?

> PS: I have read the archives, but could not get an exact answer from an
> emulation view, so please excuse me if this has been asked alot :)

Heehee...I think Manuel and Thomas have scared people into submission.  :)


Archives (includes files) at
Unsub & more at

Current Thread
  • RE: [stella] stellax and z26
    • Gonzalo Fernández - Sat, 20 Oct 2001 15:36:42 -0400 (EDT)
      • Joel Park - Mon, 22 Oct 2001 08:27:01 -0400 (EDT)
        • ben - Mon, 22 Oct 2001 10:55:08 -0400 (EDT)
          • Chris Wilkson - Mon, 22 Oct 2001 11:40:22 -0400 (EDT) <=
          • ben - Mon, 22 Oct 2001 20:14:43 -0400 (EDT)
          • ben - Mon, 22 Oct 2001 20:55:08 -0400 (EDT)
          • Chris Wilkson - Tue, 23 Oct 2001 00:28:09 -0400 (EDT)
          • ben - Tue, 23 Oct 2001 03:01:11 -0400 (EDT)