Re: [stella] Screen shots

Subject: Re: [stella] Screen shots
From: emooney@xxxxxxxxxxxxxxxx (Erik Mooney)
Date: Tue, 20 Jan 1998 04:40:22 GMT
>Sorry about the complexity!  Was all in the interest of speed.  But
>underestimating the complexity of a project seems to be a fairly common
>occurence in this business :)

Unfortunately, yeah.

>Interesting info about byte stores to video mem, I was wondering about that.

Well, the VGA hardware wasn't even originally designed for 256 colors.. it
was designed to surpass EGA and get a square aspect ratio at 640x480x16.
Someone at IBM hacked it for 256 colors.  Anytime the bank-switch register
is active (all 16 color modes and mode X), word and dword writes aren't
handled properly by the hardware.

>If it's not too hard to do then cool!
>
>One thing I've been thinking about is making sure that mode 13 can still be
>an option.  Would it be possible for you to set up a parameter that's
>hard-coded for now but which could easily be turned into a command line
>option?  I was also thinking you might want to have you're own version of
>TIALineTo, or else we split out the smallest portion needed, maybe call it
>TIARenderLine or something like that and we select it with something like
>
>CALL [TIAREGVECTOR + EBX*2] :)
>
>and maybe the same thing with the graphics setup code.  What do you think?

Actually, what I was thinking is to just render the whole thing into a
buffer, then call a procedure I'll make to write it to the screen in
mode-X.  This'd work by setting GS - if we're in mode-X, at the beginning
of the frame you'd set GS:DI to point to a 160-byte memory buffer; if in
mode 13h, GS:DI points to the screen memory.  Then, after rendering each
line, you call my procedure if modeX is active, so it'd look like
(at beginning of frame) if modeX then gs=buffer else gs=video segment
(each line) call TIADoLine
(each line) if modeX then call EriksVideo

Since, in modeX, I'd have to buffer and rewrite half the pixels anyway,
this method slows down by two instructions for every other pixel.  2
instructions * 160 pixels * 2 clocks per instruction (average for a
Pentium) * 200 lines * 60 Hz = 7.68 million cycles per second, or about a
10% performance decrease on a P75 in exchange for about a 75% decrease in
programming complexity.  I'm also planning to unroll the loop by writing
out the instructions for each and every pixel, so I eliminate keeping a
counter and branching (would have to inc counter and RET once per line
instead of every pixel.)

What I need you to do is set up the framework.  Put in a command-line
option for modeX, and put in the tests even if they don't do anything yet -
do something like
if modeX then gs=video else gs=video
and I'd like you to put in the "if modeX then call EriksVideo" and put in
the EriksVideo procedure - leave it empty and I'll actually write it.  I'd
much prefer you to take the 10 minutes to do this than the hour it'd take
me to figure out your code and do it.

Make sense?  I hope? :)  Also, I need a segment, offset, and general
register for scratch work during EriksVideo - can I use FS, SI, and AX?
Two generals would be even better - can I borrow BX too?

--
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