Re: [stella] Screen shots

Subject: Re: [stella] Screen shots
From: Erik Mooney <emooney@xxxxxxxxxxxxxxxx>
Date: Fri, 16 Jan 1998 09:46:25 -0500 (EST)
> Indeed.... however, suppose we used a 320x400 tweaked VGA mode.  Put even
> frames on even scanlines, odd frames on odd scanlines.... flickered objects
> would merely have a Venetian-blind effect.  Objects that flicker at a
> different rate than once per two frames, would flicker slightly less and
> slowly vibrate.  And solid objects would stay solid, but they might leave
> trails when they move.

I just ran a couple quickie tests in Quickbasic... had to use 640x480
rather than 320x400, but I just doubled the pixels horizontally, and the
vertical difference should be close enough.  Anyways, moving around a
sprite, displaying it in the venetian-blind style on every frame does look
better than displaying it on every other frame (if you back up a couple 
feet, the venetian-blind effect is unnoticeable)... and vertical lines
Missile Commmand-style also look better on every other line than every
other frame.  Also, I'm running at the monitor's refresh rate of 72 hz
rather than TV's 60 hz - the improvement from 30hz flicker to blinds on an
emulator would be even better than the improvement I got from 36hz flicker
to blinds.

Unfortunately, the problem is that tweaked VGA is difficult to write for.
In 320x400x256, you need 128,000 bytes of video memory.  The PC only has a
64k address space for VGA memory.  You need to put the thing into Mode-X,
where each byte of the 64k actually controls four bytes of the 256k.
There's a register on the card that controls which of the four video
memory bytes responds to a write to the 64k video segment - on each line,
pixels 0, 4, 8, 12, etc would be in bank 0; pixels 1,5,9 in bank 1, etc.
Since the 2600 uses 160 pixels across, you'd be dealing with banks 0 and 1
as a unit and 2 and 3 as a unit (this isn't a problem - the bank-select
register can be set to enable banks 0 and 1 together.)  You'd either have
to make the emulator write to the bank-select register after each and
every pixel (remember, 160x200x60hz = 1.92 million pixels per second)....
or you could write the even-numbered 2600 pixels (banks 0 and 1 on 
the PC, since we're doubling horz pixels) directly to the screen while
storing the odd-numbered pixels in a buffer, then at the end of the
scanline, switch the bank-select register to enable the odd pixels, and
write them to the screen (pausing the 6502 emulation engine while writing
these.)  It'd take some tricky coding, but it just might be doable.  Also,
using MMX instructions may even help, because (I think) the MMX registers
are 8 registers of 10 bytes each = 80 bytes, just what we need to store
our pixels on-chip instead of resorting to slower main memory.

The other alternative is to use a 640x400x256 SVGA mode, and quadruple the
pixels horizontally.  I'm not completely sure on the addressing scheme for
VESA modes, but I *think* they use a contiguous address space ( = the
card's video memory) at the upper end of the 386's 32-bit (4 gig) address
space.  This requires protected mode.. if the emulator isn't already in
p-mode, it definitely isn't worth converting.

Apologies for rambling, (damn, that was one hell of a ramble) but I
haven't had a good brainstorm in a while :)  If anyone wants to let me see
the source to the rendering portion of their emulator, I'll take a stab at
making it work in 320x400.



--
Stella list is Administered by krishna@xxxxxxxxxxxx <Glenn Saunders>
Archives (includes files) at http://www.biglist.com/lists/stella/archives/
Unsub & more at http://www.biglist.com/lists/stella/stella.html
+-shameless plugs-------------------------------------------------------+
| Stella documentary at http://www.primenet.com/~krishna                |
| Nick's VCS links via http://www.primenet.com/~nickb/atariprg.htm      |
| Write the best game, win framed autographs of famous Atari alumni!!   |
+-----------------------------------------------------------------------+

Current Thread