🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: rec.games.programmer
Article #489

Re: ModeY vs. 13h

#489
From: Dave Stampe-Psy+Eng
Date: Fri, 07 Aug 1992 15:37
39 lines
2519 bytes
sl8nl@cc.usu.edu writes:
>
>Unless the mode set code differs from the 320x400 mode set code w/o setting
>the max scan line to 0, then yeah, it's ModeY.  Speeds within the modes
>will be the same, but the speed I'm after is mode 13h (regular linear 320x200
>64k mode) as opposed to ModeY (planar 320x200x256x4 mode).

There are a number of ways to match or exceed mode 13 speeds with mode
X, Y, etc.  For loading, you set up one plane, then copy every fourth
byte of the image in.  Select the next plane, offset the source address
by 1, then repeat.  Obviously you can't use a REP MOVSB here, but that 
isn't a huge problem, as the VGA card (and IDE bus) stalls for 0.9-1.3 uS
on each access.

Video-to-video copies (and sprites) are 4x faster with mode Y than maode 13,
but then we all know that.

Now fills can be done 4x faster by keeping a color table (4 planes per byte,
with the same color in each plane).  You do a read from the color table to
start with, then do oodles of one-access writes, writing 4 pixels per access.
For the edges of the fill, set the plane write mask register (preset the 
address portion, and you only need to write the data.  Note the order
of mask bits is bit-reversed compared to the pixel order in 16-color modes.
Of course, the plane mask register access stalls for 1.5 uS or more, so
it costs there a bit.

A neat method for patterns is to set up your color table with different 
colors in each of the 4 planes.  You now can write 4-pixel repeated
pattern fills with no extra cost!  Just change the load address for
each line to get a vertical pattern cycle as well (left as an exercise
for the reader (B-{))


--------------------------------------------------------------------------
| My life is Hardware,                    |                              | 
| my destiny is Software,                 |         Dave Stampe          |
| my CPU is Wetware...                    |                              | 
| Anybody got a SDB I can borrow?         | dstamp@watserv1.uwaterloo.ca |
__________________________________________________________________________
Technical Details
Message-ID: <BsME2u.2L3@watserv1.uwaterloo.ca>
Path: arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!torn!watserv2.uwaterloo.ca!watserv1!dstamp
References: <1992Aug5.175109.57888@cc.usu.edu>

Show Full Headers
Complete Article Headers
Newsgroups: rec.games.programmer
Path: arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!torn!watserv2.uwaterloo.ca!watserv1!dstamp
From: dstamp@watserv1.uwaterloo.ca (Dave Stampe-Psy+Eng)
Subject: Re: ModeY vs. 13h
Message-ID: <BsME2u.2L3@watserv1.uwaterloo.ca>
Organization: University of Waterloo
References:  <1992Aug5.175109.57888@cc.usu.edu>
Date: Fri, 7 Aug 1992 15:37:42 GMT
Lines: 40