RE: [stella] VBLANK or VSYNC first?

Subject: RE: [stella] VBLANK or VSYNC first?
From: Chris Wilkson <ecwilkso@xxxxxxx>
Date: Sun, 28 Oct 2001 04:29:26 -0500 (EST)
> >I´m not sure if I understood what you want to do here, but the only way to
> >start a new frame is using vsync, the beam won´t reposition by itself no
> >matter how many scanlines have passed. So when VSYNC is turned off you
> >should restart the scanline counter, but not the beam counter. Also, I think
> >you should activate TIA_vblank while VSYNC is on  ( I would like a
> >confirmation on this subject).

Hi Ben (and whomever wrote the above),

Yes, activate VBLANK while VSYNC is active.

> 1. The docs all show VSYNC as the top of the frame (3 lines) and then 37
> lines for VBLANK.  So isnt the scanline counter reset when VSYNC is written
> to, not when it is turned off?  Doing it as you suggest would be 3 lines
> too late, yes?

This is a pretty fine point, but it can lead to confusion.  As with most things
mathematical, the definition is arbitrary as long as you're self consistent.

You can activate VSYNC on lines 0-2, 1-3, 259-262, or 17-19.  As long as your other
kernel sections match.  Ie. Vertical Blank (not to be confused with VBLANK) would
occur during lines 3-39, 4-40, 1-37, or 20-56, respectively.  And if VSYNC happens
on lines 17-19, by your adopted definition, then it must ALWAYS happen on lines 17-19.

> 2. What is the beam counter actually used for?  Only for reference?  If I
> understand it, RSYNC controls this, but RSYNC seems hardly ever used :/

Beam counter.  By this I assume you mean the counter used to keep track of the
current horizontal position.  It it incremented inside the TIA on every color clock.
Automatically.  And it rolls over from 227 to 0.  All the horizontal stuff happens
automatically.  RSYNC simply forces this internal position counter to be zero.
That's it.  :)


PS.  In the private email I sent to you, I think I used 159 instead of 227 for the
horizontal counter.  That's a mistake, and you should correct it.  :)

Archives (includes files) at
Unsub & more at

Current Thread