OSDN Git Service

new file: 16/PCGPE10.tar.7z
authorsparky4 <sparky4@cock.li>
Fri, 28 Nov 2014 19:28:14 +0000 (13:28 -0600)
committersparky4 <sparky4@cock.li>
Fri, 28 Nov 2014 19:28:14 +0000 (13:28 -0600)
deleted:    16/PCGPE10/3DROTATE.DOC
deleted:    16/PCGPE10/3DSHADE.DOC
deleted:    16/PCGPE10/ADLIB.TXT
deleted:    16/PCGPE10/ANSI.TXT
deleted:    16/PCGPE10/ASM0.TXT
deleted:    16/PCGPE10/ASM1.TXT
deleted:    16/PCGPE10/ASM2.TXT
deleted:    16/PCGPE10/ASM3.TXT
deleted:    16/PCGPE10/ASMINTRO.TXT
deleted:    16/PCGPE10/ATI.TXT
deleted:    16/PCGPE10/BLASTERS.EXE
deleted:    "16/PCGPE10/BL\346\213\205TER"
deleted:    16/PCGPE10/BMP.TXT
deleted:    16/PCGPE10/BRES.TXT
deleted:    16/PCGPE10/BSP.TXT
deleted:    16/PCGPE10/CAT.TXT
deleted:    16/PCGPE10/CMF.TXT
deleted:    16/PCGPE10/CONIC.CC
deleted:    16/PCGPE10/COPPER.PAS
deleted:    16/PCGPE10/CPUTYPE.TXT
deleted:    16/PCGPE10/DMA_VLA.TXT
deleted:    16/PCGPE10/DOOM.TXT
deleted:    16/PCGPE10/DPMI16BI.OVL
deleted:    16/PCGPE10/DPMIINST.EXE
deleted:    16/PCGPE10/DPMILOAD.EXE
deleted:    16/PCGPE10/DPMIUSER.DOC
deleted:    16/PCGPE10/FDTM.TXT
deleted:    16/PCGPE10/FIRE.TXT
deleted:    16/PCGPE10/FLI.FOR
deleted:    16/PCGPE10/FTPSITES.TXT
deleted:    16/PCGPE10/GAMEBLST.TXT
deleted:    16/PCGPE10/GAMEPAD.TXT
deleted:    16/PCGPE10/GENOA.TXT
deleted:    16/PCGPE10/GIF.TXT
deleted:    16/PCGPE10/GMOUSE.DOC
deleted:    16/PCGPE10/GUS.TXT
deleted:    16/PCGPE10/GUSFAQ.TXT
deleted:    16/PCGPE10/IFF.DOC
deleted:    16/PCGPE10/INTEL.DOC
deleted:    16/PCGPE10/JOYSTICK.TXT
deleted:    16/PCGPE10/KEYBOARD.TXT
deleted:    16/PCGPE10/LIMEMS41.DOC
deleted:    16/PCGPE10/MIDI.TXT
deleted:    16/PCGPE10/MODEX.TXT
deleted:    16/PCGPE10/MODFORM.TXT
deleted:    16/PCGPE10/MOUSE.TXT
deleted:    16/PCGPE10/PALLETTE.COL
deleted:    16/PCGPE10/PARADISE.TXT
deleted:    16/PCGPE10/PCGPE.EXE
deleted:    16/PCGPE10/PCX.TXT
deleted:    16/PCGPE10/PERSPECT.TXT
deleted:    16/PCGPE10/PIT.TXT
deleted:    16/PCGPE10/README.TXT
deleted:    16/PCGPE10/RTM.EXE
deleted:    16/PCGPE10/RTMRES.EXE
deleted:    16/PCGPE10/SBDSP.TXT
deleted:    16/PCGPE10/SBPRO.TXT
deleted:    16/PCGPE10/SCROLL.TXT
deleted:    16/PCGPE10/SOFTROCK.FNT
deleted:    16/PCGPE10/SPEAKER.TXT
deleted:    16/PCGPE10/STARS.TXT
deleted:    16/PCGPE10/SVGINTRO.TXT
deleted:    16/PCGPE10/TEXTURE.TXT
deleted:    16/PCGPE10/TIMER.ASM
deleted:    16/PCGPE10/TRIDENT.TXT
deleted:    16/PCGPE10/TSENG.TXT
deleted:    16/PCGPE10/TUT1.TXT
deleted:    16/PCGPE10/TUT10.TXT
deleted:    16/PCGPE10/TUT2.TXT
deleted:    16/PCGPE10/TUT3.TXT
deleted:    16/PCGPE10/TUT4.TXT
deleted:    16/PCGPE10/TUT5.TXT
deleted:    16/PCGPE10/TUT6.TXT
deleted:    16/PCGPE10/TUT7.TXT
deleted:    16/PCGPE10/TUT8.TXT
deleted:    16/PCGPE10/TUT9.TXT
deleted:    16/PCGPE10/UT.TXT
deleted:    16/PCGPE10/VESASP12.TXT
deleted:    16/PCGPE10/VGABIOS.TXT
deleted:    16/PCGPE10/VGAREGS.TXT
deleted:    16/PCGPE10/VIDEO7.TXT
deleted:    16/PCGPE10/VOC.TXT
deleted:    16/PCGPE10/WAV.TXT
deleted:    16/PCGPE10/WORMIE.PAS
deleted:    16/PCGPE10/XMS30.TXT
deleted:    16/PCGPE10/XTENDED.TXT
deleted:    16/PCGPE10/suround.txt

88 files changed:
16/PCGPE10.tar.7z [new file with mode: 0644]
16/PCGPE10/3DROTATE.DOC [deleted file]
16/PCGPE10/3DSHADE.DOC [deleted file]
16/PCGPE10/ADLIB.TXT [deleted file]
16/PCGPE10/ANSI.TXT [deleted file]
16/PCGPE10/ASM0.TXT [deleted file]
16/PCGPE10/ASM1.TXT [deleted file]
16/PCGPE10/ASM2.TXT [deleted file]
16/PCGPE10/ASM3.TXT [deleted file]
16/PCGPE10/ASMINTRO.TXT [deleted file]
16/PCGPE10/ATI.TXT [deleted file]
16/PCGPE10/BLASTERS.EXE [deleted file]
16/PCGPE10/BL担TER [deleted file]
16/PCGPE10/BMP.TXT [deleted file]
16/PCGPE10/BRES.TXT [deleted file]
16/PCGPE10/BSP.TXT [deleted file]
16/PCGPE10/CAT.TXT [deleted file]
16/PCGPE10/CMF.TXT [deleted file]
16/PCGPE10/CONIC.CC [deleted file]
16/PCGPE10/COPPER.PAS [deleted file]
16/PCGPE10/CPUTYPE.TXT [deleted file]
16/PCGPE10/DMA_VLA.TXT [deleted file]
16/PCGPE10/DOOM.TXT [deleted file]
16/PCGPE10/DPMI16BI.OVL [deleted file]
16/PCGPE10/DPMIINST.EXE [deleted file]
16/PCGPE10/DPMILOAD.EXE [deleted file]
16/PCGPE10/DPMIUSER.DOC [deleted file]
16/PCGPE10/FDTM.TXT [deleted file]
16/PCGPE10/FIRE.TXT [deleted file]
16/PCGPE10/FLI.FOR [deleted file]
16/PCGPE10/FTPSITES.TXT [deleted file]
16/PCGPE10/GAMEBLST.TXT [deleted file]
16/PCGPE10/GAMEPAD.TXT [deleted file]
16/PCGPE10/GENOA.TXT [deleted file]
16/PCGPE10/GIF.TXT [deleted file]
16/PCGPE10/GMOUSE.DOC [deleted file]
16/PCGPE10/GUS.TXT [deleted file]
16/PCGPE10/GUSFAQ.TXT [deleted file]
16/PCGPE10/IFF.DOC [deleted file]
16/PCGPE10/INTEL.DOC [deleted file]
16/PCGPE10/JOYSTICK.TXT [deleted file]
16/PCGPE10/KEYBOARD.TXT [deleted file]
16/PCGPE10/LIMEMS41.DOC [deleted file]
16/PCGPE10/MIDI.TXT [deleted file]
16/PCGPE10/MODEX.TXT [deleted file]
16/PCGPE10/MODFORM.TXT [deleted file]
16/PCGPE10/MOUSE.TXT [deleted file]
16/PCGPE10/PALLETTE.COL [deleted file]
16/PCGPE10/PARADISE.TXT [deleted file]
16/PCGPE10/PCGPE.EXE [deleted file]
16/PCGPE10/PCX.TXT [deleted file]
16/PCGPE10/PERSPECT.TXT [deleted file]
16/PCGPE10/PIT.TXT [deleted file]
16/PCGPE10/README.TXT [deleted file]
16/PCGPE10/RTM.EXE [deleted file]
16/PCGPE10/RTMRES.EXE [deleted file]
16/PCGPE10/SBDSP.TXT [deleted file]
16/PCGPE10/SBPRO.TXT [deleted file]
16/PCGPE10/SCROLL.TXT [deleted file]
16/PCGPE10/SOFTROCK.FNT [deleted file]
16/PCGPE10/SPEAKER.TXT [deleted file]
16/PCGPE10/STARS.TXT [deleted file]
16/PCGPE10/SVGINTRO.TXT [deleted file]
16/PCGPE10/TEXTURE.TXT [deleted file]
16/PCGPE10/TIMER.ASM [deleted file]
16/PCGPE10/TRIDENT.TXT [deleted file]
16/PCGPE10/TSENG.TXT [deleted file]
16/PCGPE10/TUT1.TXT [deleted file]
16/PCGPE10/TUT10.TXT [deleted file]
16/PCGPE10/TUT2.TXT [deleted file]
16/PCGPE10/TUT3.TXT [deleted file]
16/PCGPE10/TUT4.TXT [deleted file]
16/PCGPE10/TUT5.TXT [deleted file]
16/PCGPE10/TUT6.TXT [deleted file]
16/PCGPE10/TUT7.TXT [deleted file]
16/PCGPE10/TUT8.TXT [deleted file]
16/PCGPE10/TUT9.TXT [deleted file]
16/PCGPE10/UT.TXT [deleted file]
16/PCGPE10/VESASP12.TXT [deleted file]
16/PCGPE10/VGABIOS.TXT [deleted file]
16/PCGPE10/VGAREGS.TXT [deleted file]
16/PCGPE10/VIDEO7.TXT [deleted file]
16/PCGPE10/VOC.TXT [deleted file]
16/PCGPE10/WAV.TXT [deleted file]
16/PCGPE10/WORMIE.PAS [deleted file]
16/PCGPE10/XMS30.TXT [deleted file]
16/PCGPE10/XTENDED.TXT [deleted file]
16/PCGPE10/suround.txt [deleted file]

diff --git a/16/PCGPE10.tar.7z b/16/PCGPE10.tar.7z
new file mode 100644 (file)
index 0000000..6311cef
Binary files /dev/null and b/16/PCGPE10.tar.7z differ
diff --git a/16/PCGPE10/3DROTATE.DOC b/16/PCGPE10/3DROTATE.DOC
deleted file mode 100644 (file)
index a0b66b0..0000000
+++ /dev/null
@@ -1,484 +0,0 @@
-\r
-        ÖÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´% VLA Proudly Presents %ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ·\r
-        º                                                          º\r
-        ÓÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĽ\r
-\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-     ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-          ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-              Three Dimensional Rotations For Computer Graphics\r
-          ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-     ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-                              By Lithium /VLA\r
-\r
-\r
-\r
-    One of the most difficult programming difficulties you will face is that\r
-of representing a 3D world on that 2D screen in front of you.  It requires\r
-some linear alegbra that may be difficult for some, so I will spend some\r
-bytes explaining the mathmatic computations of using matricies in addition\r
-to the equations to get you going.  This document is intended to be an aid\r
-to anyone programming in any language, as a result it will use mathmatic\r
-notation.  If you are worthy of using these routines, you ought to be able\r
-to get them into your favorite language.  All I ask is that you pay a little\r
-tribute to your programming buddies in VLA.\r
-\r
-\r
-    If you aren't a math person, skip to the end and get the final equations.  \r
-Just be forewarned, implimenting these equations into a coherient 3D world \r
-is hard enough when you undersand the mathmatics behind them...\r
-\r
-                \r
-                   REAL PROGRAMMERS AREN'T AFRAID OF MATH\r
-\r
-\r
-3D Coordinates\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-\r
-    Just so we all understand each other, 3D is defined in of course three\r
-directions, we'll call them (X,Y,Z).  X will be the horizontal plane of your\r
-screen, Z will stretch vertically, and Y will extend out of and into your\r
-screen.  Got it?  Hope so, becuase it gets a bit tricky now.  The next \r
-system is called Sphereical Coordinates it is defined by angles and distance \r
-in (é,í,p) These Greek letters are Theta (é), Phi (í), and Roe (p)\r
-\r
-        Z                                  Z\r
-        |                                  |         é - Angle in the XY \r
-        |                                  |\            plane\r
-        |                                  |\\\r
-        |                                  | \\      í - Angle from the Z\r
-        |______ X                          |í_|\___X     axis\r
-       /                                  / \ v \\r
-      /                                  / é \   o   p - Distance to point\r
-     /                                  /\    \  |       from the origin\r
-    /                                  /  -->  \ |       (0,0,0)\r
-   Y                                  Y         \|\r
-\r
-\r
-    To relate the two systems you can use these equations.\r
-\r
-    X = p(siní)(cosé)                 é = arctan (X/Y)\r
-    Y = p(siní)(siné)                 í = arccos (Z/p)\r
-    Z = p(cosí)                       p = û(X^2 + Y^2 + Z^2)\r
-\r
-    If these don't seem right, do a couple of example problems for yourself,\r
-it should make since after a bit of trig.\r
-\r
-\r
-Matrix Notation\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-\r
-    Lets say I can define Xt and Yt with the equations:\r
-\r
-Xt = aX + bY        Where a,b,c,d are coeffiencets\r
-Yt = cX + dY\r
-\r
-    The matrix notation for this system of equations would be:\r
-               Ú   ¿\r
-(Xt,Yt) = (X,Y)³a c³\r
-               ³   ³        And we solve for this with these steps\r
-               ³b d³\r
-               À   Ù\r
-           \r
-           Ú   ¿ \r
- Xt = (X,Y)³a .³  = aX + bY\r
-           ³   ³            We move across the coordinates left to right\r
-           ³b .³            and multiply them by the coeffients in the\r
-           À   Ù            matrix, top to bottom\r
-           Ú   ¿ \r
- Yt = (X,Y)³. c³  = cX + dY\r
-           ³   ³            For Y, the second number, we use the second\r
-           ³. d³            column of the matrix\r
-           À   Ù            \r
-\r
- We can also multiply matricies in this fashion    \r
-                        Ú   ¿           Ú   ¿\r
- T = T1*T2  Where  T1 = ³a c³ and  T2 = ³e g³\r
-                        ³   ³           ³   ³\r
-                        ³b d³           ³f h³\r
-                        À   Ù           À   Ù\r
-\r
-Ú   ¿Ú   ¿   Ú                     ¿\r
-³a c³³e g³   ³(ae + cf)   (ag + ch)³    rows ->   columns |\r
-³   ³³   ³ = ³                     ³                      v\r
-³b d³³f h³   ³(be + df)   (bg + dh)³\r
-À   ÙÀ   Ù   À                     Ù\r
-\r
-    This product is dependent on position, so that means that \r
-    T1*T2 *DOES NOT* equal T2*T1\r
-\r
-    In English, the process above went like this, we move left to right in \r
-the first matrix, T1, and top to bottom in the second, T2.  AE + CF is our \r
-first position.  \r
-\r
-    The numbers in the first row are multiplied by the numbers in the\r
-first column.  1st * 1st + 2nd * 2nd is our first value for the new matrix.\r
-Then you repeat the process for the next column of the second matrix.  \r
-\r
-    After that, you move down to the next row of the first matrix, and \r
-multiply it by the 1st column of the second matrix.  You then do the same \r
-for the next column of the second matrix.  This process is repeated until \r
-you've done all of the rows and columns.  \r
-\r
-If this is your introduction to matricies, don't feel bad if you're a bit \r
-confused.  They are a different mode of thinking about equations.  The \r
-operations above give the same results as if you were to do the long hand \r
-algebra to solve them.  It may seem a bit more difficult for these examples, \r
-but when you get to systems of equations with many variables, this way is \r
-MUCH faster to compute.  Trust me, especially when you make your program do \r
-it.\r
-\r
-\r
-So, now you have the basic math....\r
-\r
-\r
-    One important point for these matricies below.  I will use a homogeneous\r
-coordinate system, (X/r, Y/r, Z/r, r) Now I'll use r=1, so nothing will\r
-really be different in my calculations, but you need to understand the \r
-purpose.  \r
-\r
-    This form is very convienent for the translations and rotation\r
-equations we will need to do because it allows for scaling of our points with\r
-respect to a center point.  \r
-    \r
-    Consider a point (2,2,2) in an object centered at (1,1,1).  If we were \r
-to scale the X direction by 3,(the X length to the center is 3 times what it \r
-was) the point we want would be (4,2,2).  Our new X = 3*(OldX-CenterX).  \r
-Without the added factor of the homogeneous system, calculations assume all \r
-objects are centered at the origin, so our point would have turned out to be \r
-(6,2,2), NOT the one we wanted.  So that's why we are going to do it that way.\r
-\r
-\r
-\r
-                        ROTATIONS AND TRANSFORMATIONS\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-\r
-Translation\r
-ÄÄÄÄÄÄÄÄÄÄÄ\r
-    We will start with translation from the origin.  Most objects are not\r
-at (0,0,0,1), so we'll call their center (Tx,Ty,Tz,1).  \r
-\r
-Ú             ¿\r
-³ 1   0   0  0³ = T1\r
-³             ³\r
-³ 0   1   0  0³     This physically moves the object, so it is centered\r
-³             ³     at the origin for our calcuations, eliminating the\r
-³ 0   0   1  0³     need for a -Tx for each X, the matrix will factor it\r
-³             ³     in when we multiply it by the others\r
-³-Tx -Ty -Tz 1³\r
-À             Ù     But, we need sphereical coordinates...\r
-\r
-Ú                                            ¿\r
-³       1             0            0      0  ³\r
-³                                            ³  =  T1  \r
-³       0             1            0      0  ³\r
-³                                            ³\r
-³       0             0            1      0  ³\r
-³                                            ³\r
-³-p(cosé)(siní) -p(siné)(siní) -p(cosí)   1  ³\r
-À                                            Ù\r
-\r
-\r
-XY Clockwise Rotation\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-    This will be our first rotation, about the Z-Axis\r
-\r
-Ú                   ¿\r
-³ siné  cosé  0   0 ³\r
-³                   ³  =  T2\r
-³-cosé  siné  0   0 ³\r
-³                   ³\r
-³  0     0    1   0 ³\r
-³                   ³\r
-³  0     0    0   1 ³\r
-À                   Ù\r
-\r
-\r
-YZ Counter-Clockwise Rotation\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-    Now we rotate about the X axis\r
-Ú                   ¿\r
-³  1    0    0    0 ³\r
-³                   ³  =  T3\r
-³  0 -cosí -siní  0 ³\r
-³                   ³\r
-³  0  siní -cosí  0 ³\r
-³                   ³\r
-³  0    0    0    1 ³\r
-À                   Ù\r
-\r
-    Notice that with two rotations that we can get any position in 3D space.\r
-\r
-Left Hand Correction \r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-    This will flip the X coordinates.  Think about when you\r
-look into the mirror, your left hand looks like your right.\r
-These rotations do the same thing, so by flipping the X, it\r
-will make your X move right when you increase it's value.\r
-\r
-Ú             ¿\r
-³ -1  0  0  0 ³\r
-³             ³  =  T4\r
-³  0  1  0  0 ³\r
-³             ³\r
-³  0  0  1  0 ³\r
-³             ³\r
-³  0  0  0  1 ³\r
-À             Ù\r
-\r
-\r
-The Final Viewing Matrix\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-    This is the net transformation matrix for our viewing perspective\r
-\r
-The math for this one is really messy, and I would need to go over even\r
-more matrix stuff to get it reduced, so I will ask you to trust my \r
-calculations\r
-\r
-V = T1*T2*T3*T4\r
-\r
-Ú                                        ¿\r
-³ -siné  -(cosé)(cosí)  -(cosé)(siní)  0 ³\r
-³                                        ³  =  V\r
-³  cosé  -(siné)(cosí)  -(siné)(siní)  0 ³\r
-³                                        ³\r
-³   0         siní          -cosí      0 ³\r
-³                                        ³\r
-³   0          0              p        1 ³\r
-À                                        Ù\r
-\r
-\r
-Lets say our original (X,Y,Z,1) were just that, and the point after the \r
-rotation is (Xv,Yv,Zv,1)\r
-\r
-(Xv,Yv,Zv,1) = (X,Y,Z,1) * V\r
-\r
-\r
-Xv = -Xsiné + Ycosé\r
-\r
-Yv = -X(cosé)(cosí) - Y(siné)(cosí) + Zsiní\r
-\r
-Zv = -X(cosé)(siní) - Y(siné)(siní) - Zcosí + p\r
-\r
-\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-\r
-\r
-    Some people have had trouble concepts of this implimentation, so I have\r
-another way of setting up the equations.  This works off of the straight\r
-X,Y, and Z coordinates too, but uses another angle.\r
-\r
-\r
-We will define the following variables\r
-\r
-Xan = Rotation about the X-Axis  \r
-Yan = Rotation about the Y-Axis  \r
-Zan = Rotation about the Z-Axis\r
-\r
-\r
-Rotation about the Y Axis \r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-\r
-Ú                                   ¿\r
-³  cos(Yan)     0       sin(Yan)    ³\r
-³                                   ³  \r
-³   0           1           0       ³\r
-³                                   ³\r
-³ -sin(Yan)     0       cos(Yan)    ³\r
-À                                   Ù\r
-\r
-\r
-Rotation about the Z Axis \r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-\r
-Ú                                   ¿\r
-³   1           0           0       ³\r
-³                                   ³  \r
-³   0        cos(Zan)   -sin(Zan)   ³\r
-³                                   ³\r
-³   0        sin(Zan)    cos(Zan)   ³\r
-À                                   Ù\r
-\r
-\r
-Rotation about the X Axis \r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-\r
-Ú                                   ¿\r
-³  cos(Xan)  -sin(Xan)      0       ³\r
-³                                   ³\r
-³  sin(Xan)   cos(Xan)      0       ³\r
-³                                   ³\r
-³   0           0           1       ³\r
-À                                   Ù\r
-\r
-\r
-For simplification, lets call sin(Yan) = s1, cos(Xan) = c3, \r
- sin(Zan) = s2, etc\r
-\r
-Final Rotation Matrix\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-\r
-Ú                                                       ¿\r
-³  c1c3 + s1s2s3        -c1s3 + c3s1s2          c2s1    ³\r
-³                                                       ³\r
-³      c2s3                  c2c3               -s2     ³\r
-³                                                       ³\r
-³ -c3s1 + c1s2s3         s1s3 + c1c3s2          c1c2    ³\r
-À                                                       Ù\r
-\r
-\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-\r
-Xv = x(s1s2s3 + c1c3) + y(c2s3) + z(c1s2s3 - c3s1)\r
-\r
-Yv = x(c3s1s2 - c1s3) + y(c2c3) + z(c1c3s2 + s1s3)\r
-\r
-Zv = x(c1s2s3 - c3s1) + y(-s2)  + z(c1c2)\r
-\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-\r
-\r
-Where Xv,Yv, and Zv are the final rotated points and the little x,y,z are\r
-the original points.\r
-\r
-\r
-\r
-\r
-\r
-        Normal Vectors - The Secret To Shading and Plane Elimination\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-\r
-\r
-    So, now you have the rotation equations...  But, how do we make it fast?\r
-Well, one of the best optimizations you can impliment is plane elimination.\r
-It boils down to not displaying the planes that won't be seen.  With that\r
-said, here comes more math....\r
-\r
-                        BE A MAN, KNOW YOUR NORMALS\r
-\r
-    A 'normal' vector is perpendicular to a plane.  Imagine the face of a\r
-clock as a plane.  Take your right hand and point your thumb toward yourself\r
-and the other end toward the clock.  Now curl your fingers in the \r
-counter-clockwise direction.  Your thumb is pointing in the direction of the\r
-normal vector.  This is called 'The Right Hand Rule' and it is the basis for\r
-figuring the facing of planes.\r
-\r
-    A plane can be determined with three points, try it.  That's the minimum\r
-you need, so that's what we will base our process on.  Now if we have a line\r
-segment, we could move it to the origin, maintaining it's direction and \r
-lenght by subtracting the (X,Y,Z) of one of the points from both ends.  This\r
-is our definition of a vector.  A line segment, starting at the origin and\r
-extending in the direction (X,Y,Z).  \r
-\r
-    Here will be our plane, built from the three points below.\r
-\r
-(X1,Y1,Z1)      V = (X1-X2, Y1-Y2, Z1-Z2)\r
-(X2,Y2,Z2)      W = (X1-X3, Y1-Y3, Z1-Z3)\r
-(X3,Y3,Z3)\r
-\r
-    So, we have our three points that define a plane.  From these points we\r
-create two vectors V and W.  Now if you where to use the right hand rule with\r
-these vectors, pointing your fingers in the direction of V and curling them\r
-toward the direction of W, you would have the direction of the Normal vector.\r
-This vector is perpendicular to both vectors, and since we have defined the\r
-plane by these vectors, the normal is perpendicular to the plane as well.\r
-\r
-The process of finding the normal vector is called the 'Cross Product' and\r
-it is of this form:\r
-\r
-     Ú                     ¿\r
-V*W =³   i      k      j   ³ \r
-     ³                     ³\r
-     ³ X1-X2  Y1-Y2  Z1-Z2 ³\r
-     ³                     ³\r
-     ³ X1-X3  Y1-Y3  Z1-Z3 ³\r
-     À                     Ù\r
-\r
- i = (Y1-Y2)(Z1-Z3) - (Z1-Z2)(Y1-Y3)\r
-\r
--k = (Z1-Z2)(X1-X3) - (X1-X2)(Z1-Z3) \r
-\r
- j = (X1-X2)(Y1-Y3) - (Y1-Y2)(X1-X3)\r
-\r
-The Normal to the plane is (i,-k,j)\r
-\r
-\r
-NOTE: V*W *DOESN'T* equal W*V, it will be pointing in the negative direction\r
-        To prove that to yourself, lets go back to how I explained it before\r
-        We pointed in the direction of V and curled our fingers toward W, the\r
-        normal vector in the direction of your thumb.  Try it in the \r
-        direction of W, toward V.  It should be in the opposite direction.\r
-        Your normal, still perpendicular to both vectors, but it is negative.\r
-        If you use in your program, you will have the planes appearing when\r
-        they shouldn't and dissapearing when they are coming into view.\r
-\r
-    So, now that we have a way to determin the direction of the plane,\r
-how do we hide the plane?  If the angle between the view point and the\r
-normal is greater than 90 degrees, don't show it.  One quick way that I\r
-always use is to place the view point on an axis.  I tipically set the \r
-Z axis to come out of the screen, Y up and X across.  Set the view point\r
-to be at a positive point on the Z and then, if that normal vector has Z\r
-greater than zero, I display it, otherwise I skip to the next one.\r
-\r
-    This also has an application in shading.  If you define a light scource,\r
-just like the view point, you find the angle the normal and the light form.\r
-Since you don't usually just want two colors, our 90 degree trick won't work\r
-for you, but by finding this angle, and dividing all of the possible angles\r
-by the number of colors you will allow in the shading, that color can be\r
-assigned to the plane and, presto-chango, it looks like you know what your \r
-doing...\r
-\r
-    As you do your rotations, just rotate the coordinates of the normal and\r
-that will keep everything updated.\r
-\r
-\r
-Tips To Speed-Up Your Routines\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-\r
-Pre-Calculate as many values as possible\r
-    The main limitation you will have is the speed of your math, using\r
-    precalculated values like Normals, Sin/Cos charts, and distance from the\r
-    origin are all good candidates.\r
-\r
-If you can get away with using a math-coprocessor, well...\r
-    This will greatly increase the speed of your routine.  Unfortunately,\r
-    not everyone has one.\r
-\r
-Only figure values once\r
-    If you multiply (Siné)(Cosé) and will use that same value later, by all \r
-    means, keep it and use it then instead of doing the multiplication again.\r
-\r
-Another thing to keep in mind\r
-    The order of rotations *DOES* make a difference.  Try it out and you'll\r
-    understand.  Also, when you start to use these routines, you'll find\r
-    yourself making arrays of points and plane structures.  \r
-\r
-\r
-Counter-Clockwise points\r
-    Be sure to list your points for the planes in counter-clockwise order.  \r
-    If you don't, not all of your planes will display correctly when you \r
-    start hiding planes.\r
-\r
-And as always, be clever\r
-    Just watch out, because when you have clever ideas you can lose a foot.\r
-    My brother once had a clever idea to cut his toe nails with an axe and\r
-    he lost his foot.\r
-\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-\r
-Books to look for...\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-    Any math book, the topics I covered will be found in:\r
-\r
-    Normal Vectors      - Analytic Geometry\r
-    Matrix Operations   - Linear Algebra\r
-    Sines and Cosines   - Trigonometry\r
-\r
-    The Art of Graphics, by Jim McGregor and Alan Watt\r
-        1986 Addison-Wesley Publishers\r
-\r
-\r
-\r
-Read the VLA.NFO file to find out how to contact us.\r
diff --git a/16/PCGPE10/3DSHADE.DOC b/16/PCGPE10/3DSHADE.DOC
deleted file mode 100644 (file)
index 2a45677..0000000
+++ /dev/null
@@ -1,311 +0,0 @@
-\r
-        ÖÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´% VLA Proudly Presents %ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ·\r
-        º                                                          º\r
-        ÓÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĽ\r
-\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-     ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-          ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-                Three Dimensional Shading In Computer Graphics\r
-          ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-     ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-                              By Lithium /VLA\r
-\r
-\r
-\r
-    Hopefully you have read the companion document 3DROTATE.DOC, as this one\r
-will build apon the concepts presented in my attempt to teach some of the\r
-math need to make 3D graphics a reality.  This file will cover such important\r
-topics as the Dot Product and how routines are best constructed for real-time \r
-3D rotations and planar shading.\r
-\r
-\r
-\r
-\r
-                        Our Friend, The Dot Product\r
-\r
-    The Dot Product is a neat relation that will allow you to quickly find\r
-the angle between any two vectors.  It's easiest to explain graphicly, so\r
-I will exercise my extended-ASCII keys.\r
-\r
-\r
-Two Vectors A & B\r
-\r
-A (Xa, Ya, Za)     ³A³ = û( (Xa)ý + (Ya)ý + (Za)ý )\r
-\r
-B (Xb, Yb, Zb)     ³B³ = û( (Xb)ý + (Yb)ý + (Zb)ý )\r
-\r
-\r
-Where Xa, and the others coorispond to some value on their respective Axis's\r
-\r
-\r
-       ¿A\r
-      /\r
-     /\r
-    /\r
-   /  \r
-   \ é   <-- Angle Theta between vector A and B\r
-    \\r
-     \\r
-      \\r
-       ÙB\r
-\r
-\r
- Cos(é) =  Xa * Xb + Ya * Yb + Za * Zb\r
-          ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-                  ³A³*³B³\r
-\r
-\r
-\r
-Example:\r
-\r
-A (1,2,3)         ³A³ = û( 1ý + 2ý + 3ý) = û(14) = 3.7417\r
-\r
-B (4,5,6)         ³b³ = û( 4ý + 5ý + 6ý) = û(77) = 8.7750\r
-\r
-\r
- Cos(é) =  1 * 4 + 2 * 5 + 3 * 6   =  4 + 10 + 18    =    32    =  0.9746\r
-           ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ     ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ    ÄÄÄÄÄ\r
-             (3.7417)*(8.7750)           32.8334       32.8334\r
\r
-\r
- ArcCos (.9746) = 12.9ø \r
-\r
-\r
-    So, your wondering how this revolutionizes you code, huh?  Well, remember\r
-our other friend, the Normal vector?  You use Normal vectors that define\r
-the directions of everything in our 3D world.  Let's say that vector A was\r
-the Normal vector from my plane, and B is a vector that shows the direction\r
-that the light in my scene is pointing.  If I do the Dot Product of them,\r
-you will get the angle between them, if that angle is >= 90ø and <= 270ø\r
-then no light falls on the visible surface and it doesn't need to be \r
-displayed.\r
-\r
-\r
-Also notice, the way the values of the Cosine orient themselves\r
-\r
-            \r
-\r
-           90ø                  Cos 000ø =  1\r
-                                Cos 090ø =  0\r
-            ³                   Cos 180ø = -1 \r
-  Negative  ³  Positive         Cos 270ø =  0\r
-            ³\r
-            ³\r
-180ø ÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄ  0ø        An angle between a light and a plane that\r
-            ³                   is less than 90ø or greater than 270ø will\r
-            ³                   be visible, so you can check if the Cos(é)\r
-  Negative  ³  Positive         is greater than 0 to see if it is visible.\r
-            ³\r
-            ³\r
-\r
-           270ø\r
-\r
-                \r
-                How Do You Implement The Code?  Easy As ã.\r
-\r
-Examples in ASM structures\r
-\r
-We will define our points like this\r
-\r
-    STRUC XYZs\r
-        Xpos    dd  ?\r
-        Ypos    dd  ?\r
-        Zpos    dd  ?\r
-        Dist    dd  ?       \r
-    ENDS  XYZs              ;size is 16 bytes\r
-\r
-\r
-The X,Y,Zpos define a point in 3D space, Dist is the distance from the origin\r
-\r
-Dist = û( Xý + Yý + Zý )\r
-\r
-Precalculate these values and have them handy in your data area\r
-\r
-\r
-Our planes should look something like this\r
-\r
-    STRUC PlaneSt\r
-        NumPts      db      ?               ;3 or 4\r
-        NormIndex   dw      ?\r
-        PtsIndex    dw      ?\r
-                    dw      ?\r
-                    dw      ?\r
-                    dw      ?\r
-    ENDS  PlaneSt\r
-\r
-The number of points that in the plane depends on the number your fill\r
-routines can handle you must have at least 3 and more than 6 is not suggested\r
-\r
-\r
-Then we set up our data like this\r
-\r
-MaxPoints   =           100\r
-MaxPlanes   =           100\r
-\r
-PointList   XYZs        MaxPoints DUP()\r
-PlaneList   PlaneSt     MaxPlanes DUP()\r
-NormalList  XYZs        <0,0,0, 10000h> , MaxPlanes DUP()\r
-\r
-    Non-ASM User Note:   \r
-            \r
-            I set up points in a structure that had an X,Y,Z and Distance\r
-        value.  I set up a plane structure that had the number of points\r
-        the index number of the normal vector for that plane and the index\r
-        numbers for the points in the plane.\r
-\r
-            The next lines set up arrays of these points in PointList, and\r
-        the number of points was defined as MaxPoints.  An array of planes\r
-        was created as PlaneList with MaxPlanes as the total number of \r
-        plane structures in the array.  NormalList is an array of the vectors\r
-        that are normal to the planes, one is set up initally (I'll explain \r
-        that next) and then one for each possible plane is allocated.\r
-\r
-\r
-You'll notice that I defined the first Normal and then created space for \r
-the rest of the possible normals.  I'll call this first normal, the \r
-Zero Normal.  It will have special properties for planes that don't shade \r
-and are never hidden.\r
-\r
-\r
-\r
-    Well, before I start telling all the tricks to the writting code, let me\r
-make sure a couple of points are clear.\r
-\r
--       In the 3DROTATE.DOC I said that you could set your view point on the \r
-    Z-Axis and then figure out if planes were visible by the post-rotation\r
-    Normal vectors, if their Z was > 0 then display, if not, don't\r
-        That is an easy way to set up the data, and I didn't feel like going\r
-    into the Dot Product at the time, so I generalized.  So, what if you\r
-    don't view your plane from the Z-Axis, the answer is you use the...\r
-    \r
-    Dot Product!  \r
-    \r
-    that's right.  The angle will be used now to figure wheither or not to\r
-    display the plane.\r
-\r
--       I have been mentioning lights and view points as vectors that I can\r
-    use with the Normal vector from my plane.  To work correctly, these \r
-    vectors for the lights and view should point in the direction that you\r
-    are looking or the direction that the light is pointing, *NOT* a vector \r
-    drawn from the origin to the viewer position or light position.\r
-\r
--       True Normal vectors only state a direction, and should therefore have\r
-    a unit distance of 1.  This will have the advantage of simplifying the\r
-    math involved to figure you values.  Also, for God's sake, pre-compute\r
-    your normal, don't do this everytime.  Just rotate them when you do your\r
-    points and that will update their direction.\r
-\r
-        If the Normal's have a length of 1 then ³A³*³B³ = 1 * 1 = 1\r
-\r
-    So:\r
-        Cos(é) = Xa * Xb + Ya * Yb + Za * Zb\r
-                 ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-                          ³A³*³B³\r
-\r
-    Is Reduced To:    \r
-        \r
-        Cos(é) = Xa * Xb + Ya * Yb + Za * Zb\r
-     \r
-\r
-    We eliminated a multiply and a divide!  Pat yourself on the back.\r
-\r
--       You ASM users might be wondering why I defined my Zero Normal as:\r
-    <0,0,0,10000h>  How does 10000h = a length of 1 ?\r
-\r
-    Well, this is a trick you can do in ASM, instead of using floating point\r
-    values that will be slow on computers without math co-processors, we can\r
-    use a double word to hold our value.  The high word holds the integer\r
-    value, and the low word is our decimal.  You do all of your computations\r
-    with the whole register, but only pull the high word when you go to \r
-    display the point.  So, with that under consideration, 10000h = 1.00000\r
-    Not bad for integers.\r
-\r
-\r
--       How does the Zero Normal work?  Since the X,Y,and Z are all 0, the\r
-    Cos(é) = 0, so if you always display when Cos(é) = 0, then that plane\r
-    will always be seen.\r
-\r
-\r
-            So, Beyond The Babble...  How To Set Up Your Code    \r
-\r
-\r
-Define Data Points, Normals, and Planes\r
-    Pre-Calculate as many values as possible\r
-\r
- Rotate Points and Normals\r
-\r
- Determin Visible Planes With Dot Product\r
-    (Save this value if you want to shade)\r
-\r
-    Sort Visible Planes Back to Front\r
-\r
-         (Determin Shade From Dot Product)\r
-\r
-         Clip Plane to fit scene\r
-\r
-         Draw to the screen\r
-\r
- Change Angles\r
-\r
- Goto Rotation\r
-\r
-\r
-\r
-        A quick way to figure out which color to shade your plane if you are\r
-    using the double word values like I described before is to take the\r
-    Dot Product result, it will lie between 10000h - 0h if you would like\r
-    say 16 shades over the angles, then take that value and shr ,12 that will\r
-    give you a value from 0h - 10h (0-16, or 17 colors)  if you make 10h into\r
-    0fh, add that offset to a gradient in your palette, then you will have\r
-    the color to fill your polygon with.\r
-\r
-        Note also that the Cosine function is weighted toward the extremes.\r
-    If you want a smooth palette change as the angles change, your palette\r
-    should weight the gradient accordingly.\r
-\r
-\r
-        A useful little relation for depth sorting is to be able to find the\r
-    center of a triangle.\r
-\r
-        E         The center C = (D + E + F)/3\r
-        ^\r
-       / \        Divide each cooridinate by (Xd + Xe + Xf)/3 = Xc\r
-      / C \         and do the same for the Y's and Z's if you \r
-     /     \        choose to sort with this method.  Then rotate\r
-   DÄÄÄÄÄÄÄÄÄF      that point and use it to depth sort the planes\r
-\r
-\r
-Phong and Goraud Shading\r
-\r
-    Recently, someone asked me about the practiblity of real-time phong and\r
-goraud shading.  The technique is common to ray-tracers and requires a great\r
-deal of calculation when working with individual rays cast from each pixel,\r
-but when only using this for each plane, it is possible.  This type of shading\r
-involves taking into account the reduced luminousity of light as distance\r
-increases.  For each light, you define a falloff value.  This value should be\r
-the distance a which the light will be at full intensity.  Then at 2*FallOff \r
-you will have 1/2 intensity, 3*FallOff will yeild 1/3 and so on.  To implement\r
-this type of shading, you will need to determin the distance from the light\r
-to the center of the plane.  If distance < FallOff, then use the normal\r
-intensity.  If it is greater, divide the FallOff value by the distance.  This\r
-will give you a scalar value that you can multiple by the shading color that\r
-the plane should have.  Use that offset and it will be darker since it is\r
-further away from the light source.\r
-    However, to determin the distance form the light to each plane, you must\r
-use a Square Root function, these are inherently slow unless you don't care\r
-about accuracy.  Also, it would be difficult to notice the use of this \r
-technique unless you have a relatively small FallOff value and your objects\r
-move about in the low intesity boundries.\r
-\r
-\r
-\r
-\r
-Well, that's all that I feel like doing tonight, and besides, Star Trek is on!\r
-So, see VLA.NFO for information about contacting myself or any of the other \r
-members of VLA.\r
-\r
-                            Happy Coding!\r
-\r
-\r
diff --git a/16/PCGPE10/ADLIB.TXT b/16/PCGPE10/ADLIB.TXT
deleted file mode 100644 (file)
index 6904c75..0000000
+++ /dev/null
@@ -1,479 +0,0 @@
-\r
-                      Programming the AdLib/Sound Blaster\r
-                                FM Music Chips\r
-                           Version 2.0 (24 Feb 1992)\r
-\r
-                  Copyright (c) 1991, 1992 by Jeffrey S. Lee\r
-\r
-                               jlee@smylex.uucp\r
-\r
-\r
\r
-                        Warranty and Copyright Policy\r
-\r
-     This document is provided on an "as-is" basis, and its author makes\r
-     no warranty or representation, express or implied, with respect to\r
-     its quality performance or fitness for a particular purpose.  In no\r
-     event will the author of this document be liable for direct, indirect,\r
-     special, incidental, or consequential damages arising out of the use\r
-     or inability to use the information contained within.  Use of this\r
-     document is at your own risk.\r
-\r
-     This file may be used and copied freely so long as the applicable\r
-     copyright notices are retained, and no modifications are made to the\r
-     text of the document.  No money shall be charged for its distribution\r
-     beyond reasonable shipping, handling and duplication costs, nor shall\r
-     proprietary changes be made to this document so that it cannot be\r
-     distributed freely.  This document may not be included in published\r
-     material or commercial packages without the written consent of its\r
-     author.\r
-\r
-\r
-\r
-                                   Overview\r
-\r
-     Two of the most popular sound cards for the IBM-PC, the AdLib and the\r
-     Sound Blaster, suffer from a real dearth of clear documentation for \r
-     programmers.  AdLib Inc. and Creative Labs, Inc. both sell developers'\r
-     kits for their sound cards, but these are expensive, and (in the case\r
-     of the Sound Blaster developers' kit) can be extremely cryptic.\r
-\r
-     This document is intended to provide programmers with a FREE source\r
-     of information about the programming of these sound cards.\r
-\r
-     The information contained in this document is a combination of\r
-     information found in the Sound Blaster Software Developer's Kit, and\r
-     that learned by painful experience.  Some of the information may not\r
-     be valid for AdLib cards; if this is so, I apologize in advance.\r
-\r
-     Please note that numbers will be given in hexadecimal, unless otherwise\r
-     indicated.  If a number is written out longhand (sixteen instead of 16)\r
-     it is in decimal.\r
-\r
- |   Changes from Version 1 of the file will be indicated by the use of change\r
- |   bars in the left-hand margin.\r
-\r
-\r
-\r
-                         Chapter One - Sound Card I/O\r
-\r
-     The sound card is programmed by sending data to its internal registers\r
-     via its two I/O ports:\r
-\r
-             0388 (hex) - Address/Status port  (R/W)\r
-             0389 (hex) - Data port            (W/O)\r
-\r
- |   The Sound Blaster Pro is capable of stereo FM music, which is accessed\r
- |   in exactly the same manner.  Ports 0220 and 0221 (hex) are the address/\r
- |   data ports for the left speaker, and ports 0222 and 0223 (hex) are the\r
- |   ports for the right speaker.  Ports 0388 and 0389 (hex) will cause both\r
- |   speakers to output sound.\r
-\r
-     The sound card possesses an array of two hundred forty-four registers;\r
-     to write to a particular register, send the register number (01-F5) to\r
-     the address port, and the desired value to the data port.\r
-\r
-     After writing to the register port, you must wait twelve cycles before \r
-     sending the data; after writing the data, eighty-four cycles must elapse\r
-     before any other sound card operation may be performed.\r
-\r
- |   The AdLib manual gives the wait times in microseconds: three point three\r
- |   (3.3) microseconds for the address, and twenty-three (23) microseconds\r
- |   for the data.\r
- |\r
- |   The most accurate method of producing the delay is to read the register\r
- |   port six times after writing to the register port, and read the register\r
- |   port thirty-five times after writing to the data port.\r
-\r
-     The sound card registers are write-only.\r
-\r
-     The address port also functions as a sound card status byte.  To \r
-     retrieve the sound card's status, simply read port 388.  The status \r
-     byte has the following structure:\r
-\r
-              7      6      5      4      3      2      1      0\r
-          +------+------+------+------+------+------+------+------+\r
-          | both | tmr  | tmr  |              unused              |\r
-          | tmrs |  1   |  2   |                                  |\r
-          +------+------+------+------+------+------+------+------+\r
-\r
-          Bit 7 - set if either timer has expired.\r
-              6 - set if timer 1 has expired.\r
-              5 - set if timer 2 has expired.\r
-\r
-\r
-\r
-                       Chapter Two - The Registers\r
-\r
-The following table shows the function of each register in the sound \r
-card.  Registers will be explained in detail after the table.  Registers\r
-not listed are unused.\r
-\r
-   Address      Function\r
-   -------      ----------------------------------------------------\r
-     01         Test LSI / Enable waveform control\r
-     02         Timer 1 data\r
-     03         Timer 2 data\r
-     04         Timer control flags\r
-     08         Speech synthesis mode / Keyboard split note select\r
-   20..35       Amp Mod / Vibrato / EG type / Key Scaling / Multiple\r
-   40..55       Key scaling level / Operator output level\r
-   60..75       Attack Rate / Decay Rate\r
-   80..95       Sustain Level / Release Rate\r
-   A0..A8       Frequency (low 8 bits)\r
-   B0..B8       Key On / Octave / Frequency (high 2 bits)\r
-     BD         AM depth / Vibrato depth / Rhythm control\r
-   C0..C8       Feedback strength / Connection type\r
-   E0..F5       Wave Select\r
-\r
-The groupings of twenty-two registers (20-35, 40-55, etc.) have an odd\r
-order due to the use of two operators for each FM voice.  The following\r
-table shows the offsets within each group of registers for each operator.\r
-\r
-\r
-   Channel        1   2   3   4   5   6   7   8   9\r
-   Operator 1    00  01  02  08  09  0A  10  11  12\r
-   Operator 2    03  04  05  0B  0C  0D  13  14  15\r
-\r
-Thus, the addresses of the attack/decay bytes for channel 3 are 62 for\r
-the first operator, and 65 for the second.  (The address of the second\r
-operator is always the address of the first operator plus three).\r
-\r
-To further illustrate the relationship, the addresses needed to control\r
-channel 5 are:\r
-\r
-    29 - Operator 1  AM/VIB/EG/KSR/Multiplier\r
-    2C - Operator 2  AM/VIB/EG/KSR/Multiplier\r
-    49 - Operator 1  KSL/Output Level\r
-    4C - Operator 2  KSL/Output Level\r
-    69 - Operator 1  Attack/Decay\r
-    6C - Operator 2  Attack/Decay\r
-    89 - Operator 1  Sustain/Release\r
-    8C - Operator 2  Sustain/Release\r
-    A4 -             Frequency (low 8 bits)\r
-    B4 -             Key On/Octave/Frequency (high 2 bits)\r
-    C4 -             Feedback/Connection Type\r
-    E9 - Operator 1  Waveform\r
-    EC - Operator 2  Waveform\r
-\r
-\r
-\r
-                       Explanations of Registers\r
-\r
-Byte 01 - This byte is normally used to test the LSI device.  All bits\r
-          should normally be zero.  Bit 5, if enabled, allows the FM \r
-          chips to control the waveform of each operator.\r
-\r
-             7     6     5     4     3     2     1     0\r
-          +-----+-----+-----+-----+-----+-----+-----+-----+\r
-          |   unused  | WS  |            unused           |\r
-          +-----+-----+-----+-----+-----+-----+-----+-----+\r
-\r
-\r
-Byte 02 - Timer 1 Data.  If Timer 1 is enabled, the value in this \r
-          register will be incremented until it overflows.  Upon\r
-          overflow, the sound card will signal a TIMER interrupt\r
-          (INT 08) and set bits 7 and 6 in its status byte.  The\r
-          value for this timer is incremented every eighty (80)\r
-          microseconds.\r
-\r
-\r
-Byte 03 - Timer 2 Data.  If Timer 2 is enabled, the value in this \r
-          register will be incremented until it overflows.  Upon\r
-          overflow, the sound card will signal a TIMER interrupt\r
-          (INT 08) and set bits 7 and 5 in its status byte.  The\r
-          value for this timer is incremented every three hundred\r
-          twenty (320) microseconds.\r
-\r
-\r
-Byte 04 - Timer Control Byte\r
-\r
-        7     6     5     4     3     2     1     0\r
-     +-----+-----+-----+-----+-----+-----+-----+-----+\r
-     | IRQ | T1  | T2  |     unused      | T2  | T1  |\r
-     | RST | MSK | MSK |                 | CTL | CTL |\r
-     +-----+-----+-----+-----+-----+-----+-----+-----+\r
-\r
-          bit 7 - Resets the flags for timers 1 & 2.  If set,\r
-                  all other bits are ignored.\r
-          bit 6 - Masks Timer 1.  If set, bit 0 is ignored.\r
-          bit 5 - Masks Timer 2.  If set, bit 1 is ignored.\r
-          bit 1 - When clear, Timer 2 does not operate.\r
-                  When set, the value from byte 03 is loaded into\r
-                  Timer 2, and incrementation begins.\r
-          bit 0 - When clear, Timer 1 does not operate.\r
-                  When set, the value from byte 02 is loaded into\r
-                  Timer 1, and incrementation begins.\r
-\r
-\r
-Byte 08 - CSM Mode / Keyboard Split.\r
-\r
-        7     6     5     4     3     2     1     0\r
-     +-----+-----+-----+-----+-----+-----+-----+-----+\r
-     | CSM | Key |              unused               |\r
-     | sel | Spl |                                   |\r
-     +-----+-----+-----+-----+-----+-----+-----+-----+\r
-     \r
-          bit 7 - When set, selects composite sine-wave speech synthesis\r
-                  mode (all KEY-ON bits must be clear).  When clear,\r
-                  selects FM music mode.\r
-\r
-          bit 6 - Selects the keyboard split point (in conjunction with\r
-                  the F-Number data).  The documentation in the Sound \r
-                  Blaster manual is utterly incomprehensible on this;\r
-                  I can't reproduce it without violating their copyright.\r
-\r
-\r
-Bytes 20-35 - Amplitude Modulation / Vibrato / Envelope Generator Type /\r
-              Keyboard Scaling Rate / Modulator Frequency Multiple\r
-\r
-        7     6     5     4     3     2     1     0\r
-     +-----+-----+-----+-----+-----+-----+-----+-----+\r
-     | Amp | Vib | EG  | KSR |  Modulator Frequency  |\r
-     | Mod |     | Typ |     |       Multiple        |\r
-     +-----+-----+-----+-----+-----+-----+-----+-----+\r
-\r
-          bit 7 - Apply amplitude modulation when set; AM depth is\r
-                  controlled by the AM-Depth flag in address BD.\r
-          bit 6 - Apply vibrato when set;  vibrato depth is controlled\r
-                  by the Vib-Depth flag in address BD.\r
-          bit 5 - When set, the sustain level of the voice is maintained\r
-                  until released; when clear, the sound begins to decay\r
-                  immediately after hitting the SUSTAIN phase.\r
-          bit 4 - Keyboard scaling rate.  This is another incomprehensible\r
-                  bit in the Sound Blaster manual.  From experience, if \r
-                  this bit is set, the sound's envelope is foreshortened as\r
-                  it rises in pitch.\r
-          bits 3-0 - These bits indicate which harmonic the operator will \r
-                  produce sound (or modulation) in relation to the voice's \r
-                  specified frequency:\r
-\r
-                      0 - one octave below\r
-                      1 - at the voice's specified frequency\r
-                      2 - one octave above\r
-                      3 - an octave and a fifth above\r
-                      4 - two octaves above\r
-                      5 - two octaves and a major third above\r
-                      6 - two octaves and a fifth above\r
-                      7 - two octaves and a minor seventh above\r
-                      8 - three octaves above\r
-                      9 - three octaves and a major second above\r
-                      A - three octaves and a major third above\r
-                      B -  "       "     "  "   "     "     "\r
-                      C - three octaves and a fifth above\r
-                      D -   "      "     "  "   "     "\r
-                      E - three octaves and a major seventh above\r
-                      F -   "      "     "  "   "      "      "\r
-                  \r
-\r
-Bytes 40-55 - Level Key Scaling / Total Level\r
-\r
-        7     6     5     4     3     2     1     0\r
-     +-----+-----+-----+-----+-----+-----+-----+-----+\r
-     |  Scaling  |             Total Level           |\r
-     |   Level   | 24    12     6     3    1.5   .75 | <-- dB\r
-     +-----+-----+-----+-----+-----+-----+-----+-----+\r
-\r
-          bits 7-6 - causes output levels to decrease as the frequency\r
-                     rises:\r
-\r
-                          00   -  no change\r
-                          10   -  1.5 dB/8ve\r
-                          01   -  3 dB/8ve\r
-                          11   -  6 dB/8ve\r
-\r
-          bits 5-0 - controls the total output level of the operator.\r
-                     all bits CLEAR is loudest; all bits SET is the\r
-                     softest.  Don't ask me why.\r
-\r
-\r
-Bytes 60-75 - Attack Rate / Decay Rate\r
-\r
-        7     6     5     4     3     2     1     0\r
-     +-----+-----+-----+-----+-----+-----+-----+-----+\r
-     |         Attack        |          Decay        |\r
-     |          Rate         |          Rate         |\r
-     +-----+-----+-----+-----+-----+-----+-----+-----+\r
-\r
-          bits 7-4 - Attack rate.  0 is the slowest, F is the fastest.\r
-          bits 3-0 - Decay rate.  0 is the slowest, F is the fastest.\r
-\r
-\r
-Bytes 80-95 - Sustain Level / Release Rate\r
-\r
-        7     6     5     4     3     2     1     0\r
-     +-----+-----+-----+-----+-----+-----+-----+-----+\r
-     |     Sustain Level     |         Release       |\r
-     | 24    12     6     3  |          Rate         |\r
-     +-----+-----+-----+-----+-----+-----+-----+-----+\r
-\r
-          bits 7-4 - Sustain Level.  0 is the loudest, F is the softest.\r
-          bits 3-0 - Release Rate.  0 is the slowest, F is the fastest.\r
-\r
-\r
-Bytes A0-B8 - Octave / F-Number / Key-On\r
-\r
-        7     6     5     4     3     2     1     0\r
-     +-----+-----+-----+-----+-----+-----+-----+-----+\r
-     |        F-Number (least significant byte)      |  (A0-A8)\r
-     |                                               |\r
-     +-----+-----+-----+-----+-----+-----+-----+-----+\r
-\r
-        7     6     5     4     3     2     1     0\r
-     +-----+-----+-----+-----+-----+-----+-----+-----+\r
-     |  Unused   | Key |    Octave       | F-Number  |  (B0-B8)\r
-     |           | On  |                 | most sig. |\r
-     +-----+-----+-----+-----+-----+-----+-----+-----+\r
-\r
-          bit   5  - Channel is voiced when set, silent when clear.\r
-          bits 4-2 - Octave (0-7).  0 is lowest, 7 is highest.\r
-          bits 1-0 - Most significant bits of F-number.\r
-\r
-     In octave 4, the F-number values for the chromatic scale and their \r
-     corresponding frequencies would be:\r
-\r
-        F Number     Frequency     Note\r
-           16B          277.2       C#\r
-           181          293.7       D\r
-           198          311.1       D#\r
-           1B0          329.6       E\r
-           1CA          349.2       F\r
-           1E5          370.0       F#\r
-           202          392.0       G\r
-           220          415.3       G#\r
-           241          440.0       A\r
-           263          466.2       A#\r
-           287          493.9       B\r
-           2AE          523.3       C\r
-\r
-\r
-Bytes C0-C8 - Feedback / Algorithm\r
-\r
-        7     6     5     4     3     2     1     0\r
-     +-----+-----+-----+-----+-----+-----+-----+-----+\r
-     |         unused        |    Feedback     | Alg |\r
-     |                       |                 |     |\r
-     +-----+-----+-----+-----+-----+-----+-----+-----+\r
-\r
-          bits 3-1 - Feedback strength.  If all three bits are set to\r
-                     zero, no feedback is present.  With values 1-7,\r
-                     operator 1 will send a portion of its output back\r
-                     into itself.  1 is the least amount of feedback,\r
-                     7 is the most.\r
-          bit 0    - If set to 0, operator 1 modulates operator 2.  In this\r
-                     case, operator 2 is the only one producing sound.\r
-                     If set to 1, both operators produce sound directly.\r
-                     Complex sounds are more easily created if the algorithm\r
-                     is set to 0.\r
-\r
-\r
-Byte BD - Amplitude Modulation Depth / Vibrato Depth / Rhythm\r
-\r
-        7     6     5     4     3     2     1     0\r
-     +-----+-----+-----+-----+-----+-----+-----+-----+\r
-     | AM  | Vib | Rhy | BD  | SD  | TOM | Top | HH  |\r
-     | Dep | Dep | Ena |     |     |     | Cym |     |\r
-     +-----+-----+-----+-----+-----+-----+-----+-----+\r
-\r
-          bit 7 - Set:    AM depth is 4.8dB\r
-                  Clear:  AM depth is 1 dB\r
-          bit 6 - Set:    Vibrato depth is 14 cent\r
-                  Clear:  Vibrato depth is 7 cent\r
-          bit 5 - Set:    Rhythm enabled  (6 melodic voices) \r
-                  Clear:  Rhythm disabled (9 melodic voices)\r
-          bit 4 - Bass drum on/off\r
-          bit 3 - Snare drum on/off\r
-          bit 2 - Tom tom on/off\r
-          bit 1 - Cymbal on/off\r
-          bit 0 - Hi Hat on/off\r
-\r
-          Note:  KEY-ON registers for channels 06, 07, and 08 must be OFF\r
-                 in order to use the rhythm section.  Other parameters\r
-                 such as attack/decay/sustain/release must also be set\r
-                 appropriately.\r
-\r
-\r
-Bytes E0-F5 - Waveform Select\r
-\r
-        7     6     5     4     3     2     1     0\r
-     +-----+-----+-----+-----+-----+-----+-----+-----+\r
-     |               unused              |  Waveform |\r
-     |                                   |  Select   |\r
-     +-----+-----+-----+-----+-----+-----+-----+-----+\r
-\r
-          bits 1-0 - When bit 5 of address 01 is set, the output waveform\r
-                     will be distorted according to the waveform indicated\r
-                     by these two bits.  I'll try to diagram them here,\r
-                     but this medium is fairly restrictive.\r
-\r
-         ___              ___            ___    ___       _      _\r
-        /   \            /   \          /   \  /   \     / |    / |\r
-       /_____\_______   /_____\_____   /_____\/_____\   /__|___/__|___\r
-              \     /\r
-               \___/\r
-\r
-            00              01               10               11\r
-\r
-\r
-\r
- |                          Detecting a Sound Card\r
- |\r
- |   According to the AdLib manual, the 'official' method of checking for a \r
- |   sound card is as follows:\r
- |\r
- |      1)  Reset both timers by writing 60h to register 4.\r
- |      2)  Enable the interrupts by writing 80h to register 4.  NOTE: this\r
- |          must be a separate step from number 1.\r
- |      3)  Read the status register (port 388h).  Store the result.\r
- |      4)  Write FFh to register 2 (Timer 1).\r
- |      5)  Start timer 1 by writing 21h to register 4.\r
- |      6)  Delay for at least 80 microseconds.\r
- |      7)  Read the status register (port 388h).  Store the result.\r
- |      8)  Reset both timers and interrupts (see steps 1 and 2).\r
- |      9)  Test the stored results of steps 3 and 7 by ANDing them\r
- |          with E0h.  The result of step 3 should be 00h, and the \r
- |          result of step 7 should be C0h.  If both are correct, an\r
- |          AdLib-compatible board is installed in the computer.\r
- |\r
- |\r
- |                              Making a Sound\r
- | \r
- |   Many people have asked me, upon reading this document, what the proper\r
- |   register values should be to make a simple sound.  Well, here they are.\r
- | \r
- |   First, clear out all of the registers by setting all of them to zero.\r
- |   This is the quick-and-dirty method of resetting the sound card, but it\r
- |   works.  Note that if you wish to use different waveforms, you must then\r
- |   turn on bit 5 of register 1.  (This reset need be done only once, at the\r
- |   start of the program, and optionally when the program exits, just to \r
- |   make sure that your program doesn't leave any notes on when it exits.)\r
- |\r
- |   Now, set the following registers to the indicated value:\r
- |\r
- |     REGISTER     VALUE     DESCRIPTION\r
- |        20          01      Set the modulator's multiple to 1\r
- |        40          10      Set the modulator's level to about 40 dB\r
- |        60          F0      Modulator attack:  quick;   decay:   long\r
- |        80          77      Modulator sustain: medium;  release: medium\r
- |        A0          98      Set voice frequency's LSB (it'll be a D#)\r
- |        23          01      Set the carrier's multiple to 1\r
- |        43          00      Set the carrier to maximum volume (about 47 dB)\r
- |        63          F0      Carrier attack:  quick;   decay:   long\r
- |        83          77      Carrier sustain: medium;  release: medium\r
- |        B0          31      Turn the voice on; set the octave and freq MSB\r
- |\r
- |   To turn the voice off, set register B0h to 11h (or, in fact, any value \r
- |   which leaves bit 5 clear).  It's generally preferable, of course, to\r
- |   induce a delay before doing so.\r
- |\r
- |\r
- |                             Acknowledgements\r
- |\r
- |   Thanks are due to the following people:\r
- |\r
- |   Ezra M. Dreisbach (ed10+@andrew.cmu.edu), for providing the information\r
- |     about the recommended port write delay from the AdLib manual, and the\r
- |     'official' method of detecting an AdLib-compatible sound card.\r
- |\r
- |   Nathan Isaac Laredo (gt7080a@prism.gatech.edu), for providing the\r
- |     port numbers for stereo sound on the Sound Blaster Pro.\r
diff --git a/16/PCGPE10/ANSI.TXT b/16/PCGPE10/ANSI.TXT
deleted file mode 100644 (file)
index fa894b6..0000000
+++ /dev/null
@@ -1,326 +0,0 @@
-\e[0;1mÛÛÛÛÛ\e[0mÛ \e[1;30mÛ\e[43m Û   Û             \e[40mÝ\e[37mßÛÛÛÛÛÛÛÛÛ\r
-\e[A\e[38C\e[47mÛ\e[40mÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ\e[47mßßßß\e[40mßßßßßÛÛÛÛÛÛÛÛÛÛÛ\r
-\e[43mÛÛÛÛ\e[47mÝ\e[0mÝ\e[1;30mÞ\e[43m ÛÛ  Û             Û\e[1C\e[0mÛÜ\e[1mßÛÛÛ\r
-\e[A\e[34C\e[47mßßßÜÜÜÜÜÜÜÜ\e[40mÛÛÛÛÛÛÛÛÛÛÛ\e[47mß\e[0mßß\e[33mÜÜÜÜÛÛÛÛÛÜÜÜÜ\r
-\e[A\e[72C\e[1;37mßßÛÛÛÛÛ\r
-ÛÛÛÛÛ\e[0mÛ \e[1;30mÛ\e[43mÛÛß               \e[40mÛ \e[0mÛÛÛÜ\e[1mßÛÛÛÛÛÛÛÛÛÛ\r
-\e[A\e[43C\e[47mÛÛ\e[40mÛ\e[47mÛßßÜ\e[40mÛÛÛÛ\e[47mß\e[0mß\e[33mÜÛÛÛÛÛÛÛÞÛÛÜÜßÛÛÛÛÜ\r
-\e[A\e[75C\e[1;37mßÛÛÛ\r
-ÛÛÛÛÛ\e[0mÛ \e[43m \e[1;30mÛ  Û             Û\e[40mÛ \e[0mÛÛÛÛÛÜ\e[1mßÛÛÛÛ\r
-\e[A\e[39C\e[47mßßßßßÜÜÜÛ\e[40mÛÛÛÛÛ\e[47m \e[1C\e[0;33mÛÛÛßßßßÞßÝßÛÛÛÛÛÛÛÛÛÛ \r
-\e[A\e[77C\e[1;37mÛÛ\r
-ÛÛÛÛÛ\e[0mÛ \e[1;30mÛ\e[43mÛÛ             Û Û\e[40mÛ \e[0mÛÛÛÛÛÛÛÜ\e[1mßÛÛÛÛÛÛÛÛÛ\r
-\e[A\e[46C\e[47mÛÛÛÛÛ\e[40mÛ\e[47m \e[1C\e[0;33mÛß\e[1;31mÜÜÛÛÛÛÜÛÜÛÜÜ \e[0;33mÛßÜÛÛÛ\r
-\e[A\e[75CÛÝ\e[1;37mÞÛ\r
-ÛÛÛÛÛ\e[0mÛ \e[1;30mÛ\e[43m           \e[0;33mß\e[37mÜ\e[1mÜÜÜ\e[0;33mß\e[43m \e[40m\r
-\e[A\e[26C\e[1;30;40mÛ \e[0mÛÛÛÛÛÛÛÛÛÜ\e[1mßÛÛÛÛÛÛÛÛÛÛÛÛ\e[47mÝ\e[0mÝ\e[33mÞÝ\e[1;31m\r
-\e[A\e[55CÞÛß\e[0mÜ\e[1mÜÜÜ\e[31mßß\e[0mÜ\e[1mÜÜÜ\e[31mßÜ \e[0;33mÝÛÛÛÛÛ \e[1;37mÛ\r
-ÛÛÛÛÛ\e[0mÛ \e[1;30mÛ\e[43mÛ     \e[0;33mßß\e[37mÜÜÜ\e[1;47mÜÛ\e[40mÛÛÛÛ \e[30mÛ \r
-\e[A\e[28C\e[47m           \e[0mÜ\e[1mßÛÛÛÛÛÛÛÛÛÛÛ\e[47m \e[1C\e[31;40mÜÛ \e[0mÛ\e[1mÛ\r
-\e[A\e[59CÛÛÛÛ\e[0mÞ\e[1;47mÞ\e[40mÛÛÛÛ \e[31mÛÜ\e[0;33mÞÛÛÛÛ \e[1;37mÛ\r
-ÛÛÛÛÛ\e[0mÛ \e[43m \e[1;30mÛÛß \e[0;33mß\e[37mÜ\e[1;47mÜÜ\e[40mÛÛÛÛÛÛÛÛß\e[0;33mÜ\r
-\e[A\e[26C\e[1;30mÛ \e[0mÛÛ\e[47m           \e[40mÜ\e[1mßÛÛ\e[47mßßßßÛ\e[40mÛÛ\r
-\e[A\e[52C\e[47m \e[1C\e[31;40mÛÝ\e[0mÞ\e[1;47mÞ\e[40mÛßÛÛÝ\e[0mÛ\e[1mÛßÛÛÛ \e[31mÛÛ\r
-\e[A\e[72C\e[0;33mÞÞÛÛÝ\e[1;37mÞÛ\r
-ÛÛÛÛÛ\e[0mÛ \e[1;30mÛ\e[43mÛ  \e[0;33mÝ\e[37mÞ\e[1;47mÞ\e[40mÛÛÛÛÛÛ\e[47mÛ\e[40mÛÛÛÛÜ\r
-\e[A\e[26C\e[30mÛ \e[0mÛÛÛÛ\e[47m           \e[40mÜ\e[1mßÛÛÛÛ\e[47mÜ\e[40mÛÛ\r
-\e[A\e[52C\e[47m \e[1C\e[31;40mÛÛÜ\e[0mß\e[1;47mß\e[40mß\e[31mÜÜÜ\e[0mß\e[1;47mß\e[40m\r
-\e[A\e[65C\e[40mÛÛÛß\e[31mÜÛ \e[0;33mÝÛÛÛ \e[1;37mÛÛ\r
-ÛÛÛÛ\e[47mÝ\e[0mÝ\e[1;30mÞ\e[43mÛ Û \e[0;33mÝ\e[37mÞ\e[1;47mÞ\e[40mÛÛ\e[47mÛ\e[40m\r
-\e[A\e[17C\e[40mÛÛÛÛÛÛÛÛÛß \e[47m                 \e[0mÜ\e[1mßÛÛÛÛÛ\e[47m \e[1C\e[40m\r
-\e[A\e[54C\e[31;40mÛÛÛÛ ÛÛÛÛÛÜÜÜÜÜÛÛÛ \e[0;33mÛÛ \e[1;37mÛÛÛ\r
-ÛÛÛÛ\e[47mÝ\e[0mÝ\e[1;30mÞ\e[43m Û   \e[1C\e[0mÛ\e[1mÛÛÛÛÛÛÛÛÛÛ \e[30;43mÛ\e[40mÛ \r
-\e[A\e[28C\e[47m                   \e[0mÜ\e[1mßÛÛÛ\e[47mÝ\e[0mÝ\e[1;31mÞÛÛÛÛÜßßßÛÛÛß\r
-\e[A\e[67C  ßÛÛÛÜ \e[37mÛÛÛÛ\r
-ÛÛÛÛ\e[47mÝ\e[0mÝ\e[1;30mÞ\e[43mÛÛÛ\e[0;33mÛ\e[43m \e[1;30mÛ\e[0;33mÜ\e[37mß\e[1mß\r
-\e[A\e[16C\e[0;33mÜÜÜ\e[1;37mßÛÛÛ \e[43m  \e[30;40mÛ \e[47m                   \e[40m\r
-\e[A\e[47C\e[47m  \e[0mÜ\e[1mßÛÛ\e[47m \e[1C\e[31;40mÛÛÛ  ßßßß \e[0;31mÜÛßß\e[1mÜÛÛß \r
-\e[A\e[74C\e[37mßÛÛÛÛ\r
-ÛÛÛÛ\e[47mÝ\e[0mÝ\e[1;30mÞ\e[43mÛÛ       \e[0;33mß\e[37mÜ\e[33mß\e[43m \e[40mÜÜÜß\r
-\e[A\e[24C\e[37mÜ\e[33mß\e[1;30mÛ \e[47m                       \e[0mÜ\e[1mß\e[0mß\r
-\e[A\e[54C\e[36mÜÜ\e[1;31mßÛÛÜÜÜÜÜÜÜÜÛÛßß\e[0;36mÜÛÛÛÜÜ\e[1;37mßÛ\r
-ÛÛÛÛ\e[47mÝ\e[0mÝ\e[1;30mÞ\e[43mÛ Ûß      \e[0;33mÜ\e[43m    \e[1C\e[47m \e[40m\r
-\e[A\e[24C\e[1;37;40mÛ \e[30mÛ \e[47m                     \e[0mß\e[36mÜÜÛÛÛÛÛÜÜ\r
-\e[A\e[59C\e[1;31mßßßßßßßß\e[0;36mÜÜÛÛÛÛÛÛÛÛÛÜ\r
-\e[1;37;47mÜßß\e[40mÛ\e[0mÛ \e[1;30;43mÛÛÛ              \e[0;33mÜÜ\e[1;30;43m\e[40m\r
-\e[A\e[25C\e[43mÛÛ\e[1C\e[0mÛÛ\e[47m                 \e[40mß\e[36mÜÛÛÛÛÛÛÛÛÜÜßßßßßÛß\r
-\e[A\e[66C\e[34mÜÜÜÜÜÜ\e[36mßÛÛÛÛÛÛ\r
-\e[1;37mÛÛÛÛ\e[47mÝ\e[0mÝ\e[1;30mÞ\e[43mÛÛ                 \e[40mÛ \e[47m     \e[40m\r
-\e[A\e[33C\e[47m             \e[1C\e[0;36mÛÛÛÛÛÛÛÛÛÛÛÛÛßÜÛÛ \e[34mÛÛÛÛÛÛÛÛÝ\e[36mÞÛ\r
-\e[A\e[76CÛÛÛ\r
-\e[1;37mÛÛÛÛ\e[47mÝ\e[0mÝ\e[1;30mÞ\e[43mÛÛ                Û\e[40mÛ \e[0mÛÛ\r
-\e[A\e[30C\e[47m                \e[40mÜ\e[36mßÛÛÛÛÛÛÛÛÛÛÛÝÞÛÛÝ\e[34mÞÛÛÛÛÛÛÛÛÛ \r
-\e[A\e[75C\e[36mßÛÛÛ\r
-\e[1;37mÛÛÛÛ\e[47mÝ\e[0mÝ\e[1;30mÞ\e[43m ÛÛ  Û             \e[40mÛ \e[47m     \e[40m\r
-\e[A\e[33C\e[47m               \e[0mÜÜ\e[36mßßßßßÛÛÛÛÛ ÛÛÛ \e[34mÛÛÛÛÛÛÛÛÝ\e[1;37mÞ\r
-\e[A\e[75CÛÜ\e[0;36mßÛ\r
-\e[1;37mÛÛÛÛ\e[47mÝ\e[0mÝ\e[1;30mÞ\e[43mÛÛÛ             Û Û\e[40mÛ \e[47m     \e[40m\r
-\e[A\e[33C\e[47m                   \e[1C\e[0;36mÛÛÜÜÜÜÜÜÜ  Û \e[34mßßßßßß \e[1;37mÜ\r
-\e[A\e[74CÛÛÛÛÜ\r
-ÛÛÛÛ\e[47mÝ\e[0mÝ\e[1;30mÞ\e[43m Û                 \e[40mÛ ß\e[47mÜ          \e[40m\r
-\e[A\e[40C\e[47m            \e[1C\e[0;36mÛÛÛÛÛÛÛÛÛ ÛÛ ÛÛÛÛÛÛ \e[1;37mÛÛÛÛÛÛ\r
\e[47mÜÜßÝ\e[0mÝ\e[1;30mÞ\e[43mÛ                 Û\e[40mÛ \e[37;47mÜ\e[0mÜ\e[1;30mß\r
-\e[A\e[31C\e[47mÜ                   \e[0mÝ\e[36mÞÛÛÛÛÛÛÛÛÛ ÝÛ ÛÛÛÛÛÛÝ\e[1;37mÞÛÛÛÛ\r
-\e[A\e[78CÛ\r
-ÛÛÛÛ\e[0mÛ \e[1;30mÛ\e[43mÛÛ                 Û\e[40mÝ\e[37mÞ\e[47mÛÜ\e[0mÜ\e[1;30mß\r
-\e[A\e[33C\e[47mÜ                 \e[1C\e[0;36mÛÛÛÛÛÛÛÛÛÛ ÛÛ ÛÛÛÛÛÛÛ \e[1;37mÛÛÛÛÛ\r
-ÛÛÛÛ\e[0mÝ\e[1;30mÞ\e[43mÛ                   Û\e[40mÛ \e[37mÛÛÛ\e[0mÜ\e[1;30mß\r
-\e[A\e[34C\e[47mÜ                \e[1C\e[40mÜ\e[0;36mßÛÛÛÛÛÛÛÛ ÝÛ ÛÛÛÛÛÛÛÝ\e[1;37mÞ\r
-\e[A\e[75CÛÛÛÛ\r
-ÛÛÛ\e[0mÛ \e[1;30;43mÛ                     Û\e[40mÝ\e[37mÞÛÛÛ\e[47mÜ\e[0mÜ\r
-\e[A\e[35C\e[1;30;47mÛÜ             \e[0mÝ\e[1;30mÞÛÛÜÜÜ\e[0;36mßßßßÛ ÛÛ ÛÛÛÛÛÛß\r
-\e[A\e[73C\e[1;30mÜ\e[37mß\e[47mÜÜßß\e[40m\r
-ÛÛ\e[0mÛ \e[1;30mÛ\e[43mÛ ÜÜÜÜÜÜÜÜÜ           ÛÛ\e[40mÝ\e[37mÞÛÛÛ\e[47mÛÜ\e[0mÜ\e[A\r
-\e[37C\e[1;30mß\e[47mÜ           \e[0mÝ\e[1;30mÞÛÛÛÛÛÛÛÛÛÜÜÜÜÜÜÜ\e[0;36mßß\e[1;30mÜ\e[A\r
-\e[71CÜÛÛÛ \e[37mßÛÛ\r
-\e[47mß\e[0mß\e[1;30mÜÛßßß\e[37mÜÜÜÜÜÜÜÜÜ\e[30mßßßßßßßßß\e[43mÛÛÛÛ\e[40mÛÜ\e[37mßÛÛÛ\e[A\r
-\e[35C\e[47mÛÜ\e[0mÜ\e[1;30mß\e[47mÜ          \e[0mÝ\e[1;30mÞÛÛÛÛÛÛÛÛÛÛÛßÛÛÛÛÛÛÛÛÛÛ\e[A\r
-\e[74CÛÝ\e[0mßÜ\e[1mß\r
\e[30mß\e[37mÜÜÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÜÜÜÜÜÜÛÛÛÛÛÛÛ\e[47mÜ\e[0mÜ\e[1;30mß\e[A\r
-\e[41C\e[47mÜ        \e[0mßÜ\e[1mÜÜÜÜÜÜÜÜ\e[30mßßß\e[0mÜ\e[1mÜÜÜÜÜÜÜÜÜ\e[30mßßß\e[0mÜ\e[A\r
-\e[77CÛÛ\r
-\e[1mÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ\e[47mÜ\e[0mÜ\e[1;30mß\e[47mÜ  \e[40m\e[A\r
-\e[46C\e[47m  \e[0mßÜ\e[1;47mÜ\e[40mÛÛÛÛÛÛÛßÜÛÛÛÜ\e[0mß\e[1;47mß\e[40mÛÛÛÛÛßÜÛÛÛÜ\e[A\r
-\e[77C\e[0mßÛ\r
-\e[1;47mÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÜ\e[0mÜ\e[1;30mß\e[47mÜ  \e[40m\e[A\r
-\e[48C\e[47m\e[0mÜß\e[1;47mß\e[40mÛÛÛÛÛÛÝÞÛÛÛÛÛ \e[0mÛ\e[1mÛÛÛÛÝÞÛÛÛÛÛ \e[0mÛ\r
-\e[1;47mÛÛÛÛÛÛÛÛÛÛÛÛÛÛßßßßÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÜ\e[0mÜ\e[1;30mß\e[47mÜ\e[40m\e[A\r
-\e[47C\e[47m\e[0mÛÛÛÜß\e[1mßß\e[47mÛ\e[40mÛÛ ÛÛÛßß\e[0mÜß\e[1mßßÛÛÛ ÛÛÛßß\e[0mÜÛÛ\r
-\e[1;47mÛÛßßßßßÜÜÜÜÜÜÜÛÛÛÛÛÛÛÛÛÛÛÛÛÜÜÜÜÜÜßßßÛÛÛÛÛÛÛÛÛÜ\e[0mÜ\e[1;30mß\e[47m\e[40m\e[A\r
-\e[48C\e[47mÜ\e[0mÛÛÛÛÛÜÜÜÜÜÜÜÛÛÛÛÛÛÜÜÜÜÜÜÜÛÛÛÛÛ\r
-\e[1;47mÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÜÛÛÛÛÛÛÛÛÛÛÜ\e[0mÜ\e[1;30mß\e[A\r
-\e[50C\e[47mÜ\e[0mÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ\r
-\e[1;47mÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÜ\e[0mÜ\e[1;30mß\e[A\r
-\e[52C\e[47mÜ\e[0mÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ\r
-\e[1;47mÛÛÛÛÛÛÛÛÜÜÜÜÜÜÜßßßßÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÜ\e[0mÜ\e[1;30mß\e[A\r
-\e[54C\e[47mÜ\e[0mÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ\r
-\e[1;47mÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛßßßßßÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÜ\e[0mÜ\e[1;30mß\e[A\r
-\e[56C\e[47mÜ \e[0mÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ\r
-\e[1;47mÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÜÜÜÜÜÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÜ\e[0mÜ\e[1;30mß\e[A\r
-\e[58C\e[47mÜ\e[0mÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ\r
-\e[1mÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ\e[0mÛ\e[1;30mßÛ\e[A\r
-\e[60C\e[0mÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ\r
-\e[1mÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ\e[47mÜ\e[40m\e[A\r
-\e[59C\e[47m\e[0mÜ\e[1;30mß\e[47mÜ\e[0mÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ\r
-\e[1mÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ\e[47mÜ\e[40m\e[A\r
-\e[61C\e[47m\e[0mÜ\e[1;30mß\e[47mÜ\e[0mÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ\r
-\e[1mÛÛÛÛÛÛÛÛÛÛÛÛÛÛ\e[47mßßÛ\e[40mÛÛÛÛÛ\e[47mßßßßßßßßßßÛ\e[40mÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ\e[A\r
-\e[52CÛÛÛÛÛÛÛÛÛÛ\e[47mÜ\e[0mÜ\e[1;30mß\e[47mÜ\e[0mÛÛÛÛÛÛÛÛÛÛÛÛÛ\r
-\e[1mÛÛÛÛÛÛÛÛÛÛÛÛ\e[47mß\e[40mßß\e[47mÛÜÜÜÜÜÜ\e[40mßßÛ\e[47mÛÛÛÛÛÛÛÜÜÜÜÜ\e[40mÛÛÛÛÛ\e[A\r
-\e[42CÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ\e[47mÜ\e[0mÜ\e[1;30mß\e[47mÜ\e[0mÛÛÛÛÛÛÛÛÛÛÛ\r
-\e[1mÛÛÛÛÛÛÛÛÛ\e[47mÛÛÝ\e[0mÝ\e[1;33mÞÝ\e[37mÞ\e[47mÛÛÛÛ\e[0mÛ \e[1;33mÛÝ\e[37mÞ\e[A\r
-\e[25C\e[47mÛÛÛÛß\e[40mßÛ\e[47mÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛßÛÛÛÛÛÜ\e[0mÜ\e[1;30mß\e[A\r
-\e[69C\e[47mÜ\e[0mÛÛÛÛÛÛÛÛÛ\r
-\e[1;47mÛÛÛÛÛÛÛÛÛÛÛ\e[0mÛ \e[1;33mÛÛ \e[37;47mÛÛÛÝ\e[0mÝ\e[1;33mÞÛÝ\e[37mÞ\e[A\r
-\e[25C\e[47mÛÛß\e[0mß\e[1;33mÜÛ \e[37;47mÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛßßßßßßÜÜÜÜÜÜÛÛÛÛÛÛÛ\e[40m\e[A\r
-\e[67C\e[47mÛÜ\e[0mÜ\e[1;30mß\e[47mÜ\e[0mÛÛÛÛÛÛÛ\r
-\e[1;47mÛÛÛÜÜÜÜßßßß\e[0mÛ \e[1;33mÛÛÝ\e[37mÞ\e[47mÛÝ\e[0mÝ\e[1;33mÞÛÛÝ\e[37mÞ\e[A\r
-\e[25C\e[47mß\e[0mß\e[1;33mÜÛÛÝ\e[37mÞ\e[47mÛÛÛß\e[0mß\e[1;33mÜ\e[37mß\e[47mÛÛÛÛÛ\e[40m\e[A\r
-\e[44C\e[47mÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÜ\e[0mÜ\e[1;30mß\e[47mÜ\e[0mÛÛÛÛÛ\r
-\e[1;47mÛÛÛÛÛÛÛÛÛÛÝ\e[0mÝ\e[1;33mÞÛÛÛÜ\e[37mß\e[0mÝ\e[1;33mÞÛÛÛÛÜ ÛÛÛÛ \e[37mÛ\e[A\r
-\e[32C\e[47mÛß\e[0mß\e[1;33mÜÛÝ\e[37mÞÛÛÛÛÛÛÛÛÛ\e[47mÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ\e[40m\e[A\r
-\e[72C\e[47mÜ\e[0mÜ\e[1;30mß\e[47mÜ\e[0mÛÛÛ\r
-\e[1;47mÛÛÛß\e[0mß\e[1;33mÜ\e[37mßßÛÛ\e[47mÝ\e[0mÝ\e[1;33mÞÛÛÛÛÛÜÛÛÛÛÛÛÛÛÛÛÛÜ\e[37mß\e[A\r
-\e[32C\e[0mß\e[1;33mÜÛÛÝ\e[0mÜßß\e[1;33mÜ\e[37mßÛÛÛÛ\e[47mÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ\e[40m\e[A\r
-\e[66C\e[47mÛÛÛÛÛÛÛÜ\e[0mÜ\e[1;30mß\e[47mÜ\e[0mÛÛ\r
-\e[1;47mÛÛÛÝ\e[0mÝ\e[1;33mÞÛÛÜÜ\e[0mß \e[1;33mÛÛÛÛÛßßßßßßßßßßßßßßÛÛÛÛÝ Üßß \e[37mß\e[A\r
-\e[42CÛÛÛÛ\e[47mÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛßßßÜÛÛÛÛÜ\e[0mÜ\e[1;30mß\e[47mÜ\e[40m\r
-\e[37;47mÛß\e[40mß\e[47mÛÜ\e[0mÜ\e[1;33mßÛÛÛÛÜÛßß\e[31mÜÜÛÛÛÛÛÛÛÛÛÛÛÛÛÛÜÜÜÜ\e[33mßß\e[A\r
-\e[37CÜÜßßß\e[37mÜ\e[47mÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛßßßÜÜÜÜÜÜÛÛÛÛÛÛÛÛÛÛÜ\e[0mÜ\r
-Û \e[1;33mßÜ\e[37mß\e[0mß \e[1;33mÛÛÛß\e[31mÜÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÝ\e[37mÜÛ\e[A\r
-\e[40C\e[47mÛÛ\e[40mÛ\e[47mÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ\e[40m\r
-\e[33mÜßßÜßßß Û \e[31mÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ \e[37;47mÛÛÛÛÛÛÛÛÛÛÛÛÛÛ\e[40m\e[A\r
-\e[53C\e[47mÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ\e[0m\e[255D\r
-\e[1C\e[0;1;33mÜßß\e[31mÜÛÛÛÜÞÛÛÛÛÛÛÛÛÛÛÛÛÛßßßßßÛÛßßßßßÛÛÛÝ\e[37mÞÛÛ\e[47mßß\e[40m\r
-\e[A\e[44C\e[47mßßßßÜÜÜÜ\e[40mÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ\r
-ÛÜ\e[0mÝ\e[1;31mÞÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÝ\e[0mÞ\e[1;47mÞ\e[40mÛÜÝ\e[31mÞÝ\e[0mÞ\r
-\e[A\e[31C\e[1;47mÞÛ\e[40mÜÝ\e[31mÞÛÛÝ\e[37mÞÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ\r
-\e[A\e[77CÛÛ\r
-ÛÛ\e[0mÛ \e[1;31mÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÜÜÜÜÜÛÛÜÜÜÜÜÛÛÛÝ\e[37mÞÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ\r
-\e[A\e[60CÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ\r
-ÛÛ\e[47mÝ\e[0mÝ\e[1;31mÞÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛßÜÜÜßÛÛÛÛÛÛÛ \e[37mÛÛÛÛÛ\e[47m\e[40m\r
-\e[A\e[45C\e[47mßß\e[40mÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ\r
-ÛÛÛ\e[47mÜ\e[0mÜ\e[1;31mßÛÛÛßÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÝÞÛÛÛÛÛÛÝ\e[37mÞÛÛÛÛÛÛ\r
-\e[A\e[47C\e[47mÜÜÜÜÜßßßßßßßßßß\e[40mÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ\r
-ÛÛÛÛ\e[47mÛÜ\e[40mÜÜ\e[0mÜ \e[1;31mÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛßßÜÛÛÛÛÛÛÛÝ\e[37mÞÛÛÛÛÛÛÛÛÛ\r
-\e[A\e[50CÛÛÛÛÛÛÛÛÛÛÛÛ\e[47mÜÜÜÜÜÜÜÜÜÜÜ\e[40mÛÛÛÛÛÛ\r
-ÛÛÛÛÛÛÛÛÛ\e[47mÜ\e[0mÜ\e[1;31mßÛÛÛÛÛÛÛÛÛßÛÛÛÛÛÛÛÛÛÛÛÛÛßÛÛÛ \e[37mÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ\r
-\e[A\e[55CÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ\r
-\e[47mÜßßßßßßßßÛ\e[40mÛ\e[47mÜ\e[0mÜ\e[1;31mßÛÛÛÛÛÛÛÛÜÜßßßßßßßßßÜÜÛÛÛß \e[37mÛÛÛÛÛ\r
-\e[A\e[45CÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ\r
-ÛÛÛÛÛÛÛÛÛ\e[47mÜ\e[40mÛ\e[47mß\e[40mß\e[0mß \e[35mÜ\e[1;31mßßßÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛßßß\r
-\e[A\e[37C\e[37mÜÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ\r
-ÛÛÛÛÛÛÛÛ\e[47mß\e[0mß\e[35mÜÜÛÛÛÛÛÛÛ ÜÜ\e[1;31mßßßßßßßßß\e[0;35mÜÜÜ ÛÜ\e[1;37mßÛÛÛ\r
-\e[A\e[41CÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ\e[47mÛß\e[40mÛÛÛÛÛÛÛÛÛÛÛÛÛ\r
-ÛÛÛÛÛÛ\e[47mß\e[0mß\e[35mÜÛÛÛÛÛÛÛÛÛÛÛÜÜßßß ÛÛ ßßßÜÜÛßß\e[1;34mÜÜÜÜÜ\e[37mßß\e[0mÜ\r
-\e[A\e[45C\e[1mÜßßÛßßÛÛÛÛÛÛÛ\e[47mßßßßßßÜ\e[40mÛÛÛÛÛÛÛÛÛÛÛÛÛÛ\r
-ÛÛÛÛÛ\e[47mÝ\e[0mÝ\e[35mÞÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ÝÛ ÛÛßßß\e[1;34mÜÛÛÛÛÛÛÛÛÛÜ\e[0mß\r
-\e[A\e[46C\e[1;47mß\e[40mÛÜ\e[34mßÛÜÜ\e[37mß\e[47mÜÜÜÜ\e[40mÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ\r
-ÛÛÛÛÛ\e[47mÝ\e[0mÝ\e[35mÞÛÛÛÛÛÛÛÛÛÛÛÜßßßßß ßÜÜÜÜÛß\e[1;34mÜÛÛÛÛÛÛÛÛÛÛÛÛ \e[0mÛ\r
-\e[A\e[48C\e[1mÛ \e[34mÛÛÛÛ \e[37mÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ\r
-ÛÛÛÛÛ\e[47mÝ\e[0mÝ\e[35mÞÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ \e[1;34mÛÛÛÛÛÛÛÛÛÛÛÛÛ \e[0mÛ\r
-\e[A\e[48C\e[1mÛÝ\e[34mÞÛÛÛÛ \e[37mÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ\e[47mß\e[40mÛÛÛÛ\r
-ÛÛÛÛÛ\e[47mÛ \e[1C\e[0;35mÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÜ\e[1;34mßÛÛÛÛÛÛÛÛÛÛÛß\e[0mÜ\r
-\e[A\e[47C\e[1;47mÜ\e[40mÛ \e[34mÛÛÛÛÛ \e[37mÛÛÛÛÛÛÛÛ\e[47mßßßßßßßÜÜÜ\e[40mÛÛÛÛÛ\r
-ÛÛÛÛÛÛÛ\e[47mÜ\e[0mÜ\e[35mßÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÜÜ\e[1;34mßßÛÛÛÛßßß\e[0mÜ\r
-\e[A\e[45C\e[1;47mÜ\e[40mßß\e[34mÜÛÛÛÛÛÝ\e[37mÞÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ\r
-ÛÛÛÛÛÛÛÛÛ\e[47mÜ\e[40mÜ\e[0mÜ\e[35mßßÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛßÜÜÛÛÜ \e[1;37mÜÜÛÛÛÜÜÛÛÜÜ\r
-\e[A\e[50C\e[34mßßß\e[37mÜÜÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ\r
-ÛÛÛÛÛÛÛÛÛÛ\e[47mÛ \e[1C\e[0;35mÛÜÜÜÜÜÜÜßßßßßßß ÜÜÜÛÛÛÛÛÛÝ\e[1;37mÞÛÛÛÛÛÛÛÛÛÛÛÛÛÛ\r
-\e[A\e[54CÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ\r
-ÛÛ\e[47mÛÛÛ\e[40mÛÛÛÛÛÛ\e[47m \e[1C\e[0;35mÛÛÛÛÛÛÛÛÛÛÛÛ ÝÛ ÛÛÛÛÛÛÛÛÛÝ\e[1;37mÞÛÛÛÛ\r
-\e[A\e[44CÛÛÛÛÛÛÛÛÛÛÛÛÛÛ\e[47mÛ\e[40mÛÛÛ\e[47mÛÛ\e[40mÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ\r
-ÛÛÛÛÛÛÛÛÛÛÛ\e[47m \e[1C\e[0;35mÛÛÛÛÛÛÛÛÛÛÛÛ ÛÛ ÛÛÛÛÛÛÛÛÛÝ\e[1;37mÞÛÛÛÛÛÛÛÛÛÛÛÛÛÛ\r
-\e[A\e[54CÛÛÛÛÛ\e[47mßßßÜ\e[40mÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ\r
-\e[47mÛÛÛÛÛÛÛÛÛ\e[40mÛ\e[47mÝ\e[0mÝ\e[35mÞÛÛÛÛÛÛÛÛÛÛÛÛ ÝÛ ÛÛÛÛÛÛÛÛÛÛ \e[1;37mÛÛÛÛ\r
-\e[A\e[44C\e[47mßßßßßÜÜÜÜÜÜÜÜÜÜÛ\e[40mÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ\r
-\e[47mßßÜÜÜÜÜÜÜÛ\e[40mÛ\e[47mÜ\e[0mÜ\e[35mßßßÛÛÛÛÛÛÛÛÛ ÛÛ ÛÛÛÛÛÛÛßß\e[37mÜÛ \e[1mÛÛ\r
-\e[A\e[43CÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ\r
-ÛÛÛÛÛÛÛÛÛÛÛ\e[47m \e[1C\e[0mÛÛÛÜ ÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜ ÛÛÛÝ\e[1mÞÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ\r
-\e[A\e[60CÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ\r
-ÛÛÛÛÛÛÛÛÛÛÛ\e[0mÛ ÛÛÛßÜÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÜßßÛ \e[1mÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ\r
-\e[A\e[63C\e[47mßßßßßßßÜÜÜÜßß\e[40mÛÛÛ\r
-ÛÛÛÛÛÛÛÛÛÛÛ\e[47mÜ\e[0mÜßÜÜÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÜ\e[1mßÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ\e[A\r
-\e[63CÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ\r
-ÛÛÛÛÛÛÛÛÛÛÛ\e[0mÛ ÛÛÛÛÛÛÛÛÛÛÛÛÛßÛÛÛÛÛÛÛÛÛÛÛÛÛÛ \e[1mÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ\e[A\r
-\e[68CÛÛÛÛÛÛÛÛÛÛÛ\r
-ÛÛÛÛÛÛÛÛÛÛ\e[47mÝ\e[0mÝÞÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ÛÛÛÛÛÛÛÛÛÛÛÛÛÝ\e[1mÞÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ\e[A\r
-\e[63CÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ\r
-ÛÛÛÛÛÛÛÛÛÛ\e[47mÝ\e[0mÝÞÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ÛÛÛÛÛÛÛÛÛÛÛÛÛÛ \e[1mÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ\e[A\r
-\e[63CÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ\r
-ÛÛÛÛÛÛÛÛÛÛ\e[0mÛ ÛÛÛÛßßßßßßßÛÛÛÛ ÛÛÛßßßßßßßßÛÛÛÝ\e[1mÞÛÛÛ\e[47mßßßßßßßßßßß\e[40m\e[A\r
-\e[58C\e[47mß\e[40mÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ\r
-ÛÛÛÛÛÛÛÛÛ\e[47mÝ\e[0mÝÞÛßÜ\e[1mÜ\e[47mÜ\e[40mÛÛÛÛÝÞÜÜÜ\e[0mßÝÞÝÜ\e[1mÜ\e[47mÜ\e[40m\e[A\r
-\e[33C\e[40mÛÛÛÛÝÞÜÜ\e[0mßÛ \e[1mÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ\e[47mÜÜÜÜÜÜÜßßß\e[40mÛÛÛÛÛÛÛÛÛÛ\r
-ÛÛÛÛÛÛÛÛÛ\e[47mÛ\e[0mÛ Ü\e[1;47mÜ\e[40mÛÛÛÛÛÛÛÛ ÛÛÛÛÜ \e[0mÛ\e[1mÛÛÛÛÛÛÛÛ ÛÛÛÜ ÛÛÛ\e[A\r
-\e[47CÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ\e[47mÛÛÛ\e[40mÛÛÛÛÛÛÛÛÛÛÛ\r
-ÛÛÛÛÛÛÛÛÛ\e[47mÝ\e[0mÝÞ\e[1;47mÞ\e[40mÛÛÛÛÛÛÛÛÛÝÞÛÛÛÛÝ\e[0mÞ\e[1;47mÞ\e[40mÛÛÛÛÛÛÛÝ\e[A\r
-\e[39CÞÛÛÛÝÞÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ\r
-ÛÛÛÛÛÛÛÛÛÛ\e[47mÜ\e[0mÜß\e[1mß\e[47mß\e[40mÛÛÛÛÛÛÛ ÛÛÛßß\e[0mÜß\e[1mß\e[47mß\e[40m\e[A\r
-\e[32C\e[40mÛÛÛÛÛÛ ÛÛßßÜÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ\r
-ÛÛÛÛÛÛÛ\e[47mÛÛÛÛ\e[40mÛÛÛÜÜÜÜÜÜÜÜÜÜÜÜ\e[47mÛÛÛÛÜ\e[40mÜÜÜÜÜÜÜÜÜÜÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ\e[A\r
-\e[56CÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ\r
-ÛÛÛ\e[47mÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ\e[40mÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ\e[A\r
-\e[66CÛÛÛÛÛÛÛÛÛÛÛÛÛ\r
-\e[0mß\e[1mÜ\e[0mÜÜÜÜ\e[1;30mÜÜÜÜ  \e[37mÜÜ\e[0mÜÜ\e[1mßÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ\e[A\r
-\e[40C\e[47mß\e[40mßßßßßßßÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ\e[47mÛ\e[40mÛÛÛÛÛÛÛÛÛÛÛÛÛ\r
\e[47m²Û²±°\e[30m°±²\e[40mÛ\e[47mß\e[40mÛÜÜ\e[0mß\e[1;47m°\e[0mß\e[1mÜÛÛÛÛ\e[47m\e[40m\e[A\r
-\e[22C\e[47mßßßßßßÜÜÜÜÜÜÜ\e[40mÛÛÛ\e[47mß\e[0mß\e[1mÜÛ\e[47m±±° \e[30m±²\e[40mÜ\e[37mß\e[A\r
-\e[50CÛÛÛÛÛÛÛÛÛÛ\e[47mÜÜÜÜÜßßßßßßß\e[40mÛÛÛÛÛÛÛ\r
-\e[0mÜ\e[1mßÛ\e[47m²±°\e[30m°\e[0mß\e[1;30mß\e[47mÜß\e[40mÛÛÛÛÜ\e[37mßÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ\e[A\r
-\e[32CÛÛÛÛÛÛÛ\e[47mÜ\e[0mÜ\e[1mßÛ\e[47m²±°\e[30m°\e[40mß\e[37mÜÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ\e[A\r
-\e[65C\e[47mÛÛ\e[40mÛÛÛÛÛÛÛÛÛÛÛÛ\r
-\e[47mÝ\e[0mÝ\e[1mÞÛ\e[47m²±°\e[0mÝ\e[1mÞ\e[47mÜ\e[0mÜ\e[1;30mßÛÛÛÛÝÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜ\e[A\r
-\e[34CÜÜÜÜÜÜÜÜ\e[37mÞÛ\e[47m²°\e[0mÝ\e[1;30mÜÜÜÜ\e[0;31mÜÜÜÜÜÜÜÜÜ\e[1mÜ\e[37mßÛÛÛÛÛÛ\e[A\r
-\e[68CÛÛÛÛÛÛÛÛÛÛÛ\r
\e[0mÛ \e[1mÛ\e[47m²±°\e[30m°\e[1C\e[37;40mß\e[0mß\e[1;30mÜ\e[47mÜ\e[40mÛÛÛÝ\e[37mÜÜÜÜ\e[A\r
-\e[21CÜÜÜÜ\e[0mÜÜÜ\e[1mÜÜ\e[0;31mßßßßßßßßßßßß \e[1;37mÛ\e[47m²°\e[1C\e[0;31mß\e[A\r
-\e[48C\e[1;30;41m²²±±°° \e[31m°°±±²²\e[40mÛ \e[37mÛÛÛÛÛ\e[47mÛÛÛ\e[40mÛÛÛÛÛÛÛÛ\r
\e[0mÛ \e[1;47mÛ²±°\e[30m°\e[0mÜ\e[1;30mÛ\e[47m Üß\e[40mÛÛß\e[37mÜÛÛÛ\e[47mÜÜÜÜ\e[40m\e[A\r
-\e[24C\e[47mÜÛ\e[40mÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ\e[0mÛ \e[1mÛ\e[47m²°\e[1C\e[40mÛÜÜÜÜÜÜÜÜ\e[0;31mß\e[A\r
-\e[57Cß\e[1mßßß\e[37mÜÛÛ\e[47mßßßßÜÜÜ\e[40mÛÛÛÛÛÛÛÛ\r
\e[0mÛ \e[1;47m²Û²±°\e[30m±²ß\e[40mÛßß Ü\e[0mÜ\e[1mÜÜ\e[0mÜ\e[1mßßÛ\e[47mß\e[0mß\e[1mÜ\e[A\r
-\e[26CÜ\e[0mÜÜ\e[1mßß\e[47mÛß\e[0mß\e[1mÜÜ\e[0mÜÜ\e[1mßßÛ\e[0mÛ \e[1mÛ\e[47m²°\e[1C\e[40m\e[A\r
-\e[47C\e[40mÜ\e[0mÜÜ\e[1mßßÛÛßßßßßßßßßÛÛÛÛÛÛÛÛÛßßßßÛÛÛ\r
\e[0mÛ \e[1mÛ\e[47mÛ²±°\e[30;40mßß \e[37mÜ\e[47m± \e[1C\e[30;40mÛ\e[0mÛ\e[1mÛ\e[A\r
-\e[18C\e[47mÛ²±°\e[0mÜ \e[1mÛ\e[47m²²²±°\e[30m°\e[0mÜÜ\e[1mßÛ\e[47m²²±°\e[30m°\e[40m\e[A\r
-\e[40C\e[47m\e[0mÜÜ \e[1mÛ\e[47m²°\e[1C²²±°\e[30m°\e[0mÜÜ\e[1mß\e[47m²±° \e[30m°±²\e[40m\e[A\r
-\e[62C\e[47mÛ\e[40mÜÜÜÜÜÜÜÜ \e[37;47m²±° \e[0mÜ\e[1mßÛ\r
\e[0mÛ \e[1;47m²Û²±°\e[1C\e[0mÛ \e[1mÛ\e[47m± \e[1C\e[30;40mß\e[0mß\e[1mßßÛ\e[47m\e[40m\e[A\r
-\e[20C\e[47m²±° \e[1C\e[40mÛ\e[47m±\e[0mßß\e[1;47m²±° \e[30m°\e[0mÜß\e[1mßß\e[47m²\e[40m\e[A\r
-\e[39C\e[47m±° \e[30m°\e[0mÜ\e[1mß\e[47m°\e[1C±\e[0mßß\e[1;47m²±° \e[30m°\e[0mÜ\e[1mß\e[A\r
-\e[57C\e[47m²\e[0mÜÜ\e[1;30mÜÜ  \e[37mÜÜÜÜÜ\e[0mÜÜ\e[1;47m²±° \e[30m°°\e[1C\e[40m\e[A\r
-\e[78C\e[37;40mÛ\r
\e[0mÛ \e[1mÛÛ\e[47m²±°\e[1C\e[0mÛ \e[1mÛ\e[47m± \e[1C\e[40mÛÛÛ\e[0mÛ \e[1mÛ\e[47m\e[40m\e[A\r
-\e[21C\e[47m²±°\e[0mÝ\e[1mÞ\e[47m±\e[1C\e[0mß  \e[1mß\e[47m²±°\e[0mÛ \e[1;47mÜ\e[40m\e[A\r
-\e[38C\e[40mÜ\e[0mÜ\e[1mß\e[47m²±°\e[0mÛ  \e[1;47m±\e[4C\e[40mß\e[47m²±°\e[0mÛ \e[1mÛ\e[A\r
-\e[59C\e[47m²±°\e[0mÛ\e[1;30;47m°\e[0mÜ\e[1mß\e[47m±\e[1C\e[40mÜß\e[47mÛ\e[0mßÜ \e[A\r
-\e[74C\e[47m \e[1;30m°±\e[1C\e[37;40mÛ\r
-\e[47mÝ\e[0mÝ\e[1mÞÛÛ\e[47m²±°\e[0mÝÞ\e[1mÞ\e[47m²±°\e[30;40mÝ\e[37mÞÛÛ\e[47mÝ\e[40m\e[A\r
-\e[19C\e[47m\e[0mÝ\e[1mÞ\e[47m²±° \e[1C²\e[40mß\e[0mßß\e[1;30mßß\e[37mÞ\e[47m²±°\e[40m\e[A\r
-\e[36C\e[47m\e[0mÝ\e[1mÞÛ\e[47mÝ\e[0mÝ\e[1mÞ\e[47m²±°\e[0mÝ \e[1;47m²\e[40mß\e[0mßß\e[A\r
-\e[51C\e[1;30mßß\e[37mÞ\e[47m²±°\e[0mÝ  \e[1mß\e[47m²±°\e[30m°\e[0mÝ\e[1mÞ ÛÛÜÛ\e[A\r
-\e[72C\e[47m \e[1C \e[30m°±\e[1C\e[37;40mÛ\r
-\e[0mß\e[1mÜ\e[47m²\e[40mÛ\e[47m²±°\e[30m°±\e[40mÜ \e[37;47m²±° \e[30;40mÜ\e[37mßÛ\e[0m\e[A\r
-\e[18Cß\e[1mÜÛ\e[47m²±° \e[30;40mÜ\e[37mß\e[0mÜ\e[1mßÛÛ\e[0mÛ \e[1mÛ\e[47m²±°\e[1C\e[40m\e[A\r
-\e[38C\e[40mÛÛ\e[0mÛ \e[1mÛ\e[47m²±°\e[1C\e[30;40mÜ\e[37mßÛÛÛ\e[47m \e[1C\e[40mÛ\e[A\r
-\e[55C\e[47m²±°\e[1C\e[40mÜ\e[47m²±°\e[30m°°\e[0mÝ\e[1mÞ\e[0mÜ\e[1mßÛÛ\e[47mß\e[0mßÜ\e[A\r
-\e[74C\e[47m \e[1;30m°±\e[40mÜ\e[37mß\r
-ßÛÛ\e[47m²±°\e[30m°±²\e[40mÛß\e[37mÜ\e[47m²±° \e[30;40mß\e[0mÜ\e[1mßÛ\e[47m²±° \e[40m\e[A\r
-\e[24C\e[47m\e[30m±²\e[40mß\e[0mÜß\e[1mÜÛ\e[47mÜ\e[0mÜ\e[1mß\e[47m²±\e[0mß\e[1mÜÛÛÛ\e[0mÜ\e[A\r
-\e[42C\e[1mß\e[47m²±\e[0mß\e[1;30mÜßß\e[37mÜÛÛ\e[47mÜ\e[0mÜ\e[1mß\e[47m²±\e[0mß\e[1mÜ\e[A\r
-\e[59C\e[47m²±°\e[30m°\e[0mß\e[1;30mß\e[37mÜ\e[47m²°\e[0mß\e[1mÜ\e[47mÜ\e[0mÜß\e[A\r
-\e[73C\e[47m \e[1;30m°±²Û\e[40mß\r
-\e[37;47mÜ\e[40mÜÜÜÜÜÜÜÜÜ\e[47mÜ\e[40mÜÜÜÜÜÛÛ\e[47mÜ\e[40mÜÜÜÜÜÜÜÛÜÛÛÛÛÛ\e[47m\e[40m\e[A\r
-\e[33C\e[47mÜ\e[40mÜÜÛÛÛÛÛÛ\e[47mÜ\e[40mÜÜ\e[47mÜ\e[40mÜÛÛÛÛÛÛÛ\e[47mÜ\e[40mÜÜ\e[A\r
-\e[57C\e[47mÜ\e[40mÜÜÜÜÜÛ\e[47mÜ\e[40mÜÜÜÛÛÛÛ\e[47mÜ\e[40mÜÜÜÜÜÛ\r
-ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ\e[A\r
-\e[76CÛÛÛ\e[0m\e[255D\r
-\e[0;1mÛÛÛÛÛÛÛÛÛÛÛÛÛÛ\e[47mÛÛ\e[40mÛ\e[47mÜÜÜÜ\e[40mÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ\r
-\e[A\e[42C\e[47mßßßßßßßßßßßßßßßß\e[40mÛÛÛÛÛÛÛÛÛÛÛ\e[47mßßßß\e[40mÛÛÛÛÛÛ\r
-\e[47mÛÛ\e[40mÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ\e[47mßßßÜÜÜÜÜ\e[40mÛÛÛÛÛÛÛÛÛÛÛÛÛÛ\r
-\e[A\e[56CÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ\e[47mÜÜÜ\e[40mÛÛÛ\r
-\e[47mÜÜÜÜßß\e[40mÛÛÛÛÛÛÛßß\e[47mß\e[40mÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛßß\e[30m±±±±±±±\e[0mß\r
-\e[A\e[47C\e[1;47mß\e[40mÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ\r
-ÛÛÛÛÛÛ\e[47mÜ\e[40mÛÛÛß\e[30m°°°°°\e[0mÛ\e[1mÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÝ\e[30m²²²²²²²²²²²\r
-\e[A\e[48C\e[0mÛ\e[1mÛ\e[47mÛÛÛ\e[40mÛ\e[47mÜÜÜßßßßß\e[40mÛÛÛßß\e[47mß\e[40mÛÛÛÛÛÛÛÛÛÛ\r
-\e[A\e[78CÛ\r
-ÛÛÛÛÛÛÛÛÛÝ\e[30m°°°°°°\e[0mÞ\e[1;47mÞ\e[40mÛÛÛÛÛÛ\e[47mßßßßÛ\e[40mÛÛÛÛÛÛÛ\e[30mÜÛÛÛ\r
-\e[A\e[40CÛÛÛÛÛÛÛÛÛ\e[0mß\e[1mßßß\e[47mß\e[40mÛÛÛ\e[47mÛ\e[40mÛÛÛÛÛÛÝ\e[30mÛÛÛ\e[0mß\r
-\e[A\e[69C\e[1mß\e[47mß\e[40mÛÛÛÛÛÛÛÛ\r
-ÛÛÛÛÛÛÛÛß\e[30m°±±±±±±±\e[0mß\e[1mß\e[47mß\e[40mÛÛÛÛÛÛÛÛ\e[47mÜÜ\e[40mÛÛÛÛÛÛ\e[30mÛÛ\r
-\e[A\e[38CÛÛÛ\e[44m²²²²±±±±±°°°° \e[0;44mß\e[1;47mß\e[40mÛÛÛÛÛÛ\e[44mß\e[34m²²Û\e[40m\r
-\e[A\e[67C\e[44mÛÛ\e[46m²\e[0mÞ\e[1;47mÞ\e[40mÛÛÛÛÛÛÛ\r
-ÛÛÛß\e[30m±±±±±²²²²²²ÛÛÛÛÛÛ\e[47mÜ\e[37;40mß\e[47mß\e[40mÛÛÛÛÛÛÛÛÛÛÛÝ\r
-\e[A\e[36C\e[30;44m°°°°°°\e[0;34mÛÛÛÛÛÛ\e[1;44m°°°±±±±±²\e[0;44mß\e[1mßßß\e[34m\e[40m\r
-\e[A\e[61C\e[44m²²ÛÛÛÛ\e[46m²²²²\e[47m \e[37mÛ\e[40mÛÛÛÛÛÛ\r
-ÛÛÝ\e[30m°±±±±±²²²²²²ÛÛÛ  \e[36mÜ\e[0;36mÜÜÜ\e[37mÛ\e[1mÛÛÛÛÛÛÛÛÛÛ\e[6C\e[36mÜ\r
-\e[A\e[42C\e[0;36mÜÜÜÜÜÜÜÜÜÜÜ\e[1;30mÜ   \e[34;44m²ÛÛ\e[46m±±±±°°°°    \e[40m\r
-\e[A\e[72C\e[0;36;47mÜ\e[1;37;46mßß\e[47mß\e[40mÛÛÛ\r
-ßß\e[30m°°°±±±±²²²²²²ÛÛ\e[44m²\e[1C\e[36;46mß\e[5C\e[0mß\e[1mßßß\e[47mß\e[40mÛÛÛß\r
-\e[A\e[34C\e[20C\e[36;46mß\e[2C\e[34;44mÛ\e[46mÛ²±±±±°°°°    \e[36m°°°°±\e[0;46m\e[40m\r
-\e[A\e[77C\e[46mß\e[1mß\e[40m\r
-\e[30m°°°°°±±±±²²²²²²\e[44m²²±\e[1C\e[46m \e[6C\e[0mP\e[1mhantasm \e[34mù \e[37m2O6\r
-\e[A\e[40C\e[0m-\e[1m232\e[0m-\e[1m5912\e[5C\e[46m \e[2C\e[34;44mÛ\e[46m²±±±±±°°°°\e[40m\r
-\e[A\e[68C\e[46m    \e[36m°°°°±±±\e[40m\r
-\e[30m°°°°°°°±±±±±±²²\e[44m²±±\e[1C\e[46m \e[3C\e[0mS\e[1mys\e[0mO\e[1mp: \e[0mS\e[1mat\r
-\e[A\e[33Canic \e[0mA\e[1mnimal \e[0mS\e[1mlasher  \e[46m \e[2C\e[34m²±°±±±°°°° \e[40m\r
-\e[A\e[68C\e[46m   \e[36m°°°°±±±±\e[40m\r
-\e[30m°°°±±±±±±²²²²²²\e[44m±±°\e[1C\e[46m \e[0mC\e[1mo\e[0mS\e[1mys\e[0mO\e[1mp: \e[0mD\r
-\e[A\e[30C\e[1mesolation \e[34mù \e[0mN\e[1mUP: \e[0mN\e[1mEWBIE \e[46m \e[2C\e[40m\r
-\e[A\e[57C\e[46m\e[34m±° ±±±±°°°°    \e[36m°°°°±±±\e[40m\r
-\e[30m°°°±±±±±±²²²²²²\e[44m±°°\e[1C\e[46m \e[2C\e[0mU\e[1mSR 14.4k \e[0mD\e[1mS \e[34m\r
-\e[A\e[35Cù \e[37m375 \e[0mM\e[1megs \e[0mO\e[1mnline  \e[46m \e[2C\e[34m±  ±±±±°\e[40m\r
-\e[A\e[65C\e[46m°°°    \e[36m°°°°±±±\e[40m\r
-\e[30m°°°°±±±±±²²²²²²\e[44m°\e[0;34mÛ\e[1;44m°\e[1C\e[46m \e[1C\e[0mC\e[1mCi/\e[0mC\r
-\e[A\e[26C\e[1mTF \e[0mN\e[1mets \e[34mù \e[0mH\e[1m/P/C/V/A \e[0mS\e[1mupport \r
-\e[A\e[54C\e[46m \e[2C  \e[36m°\e[34m±±±±°°°°    \e[36m°°°°±±±\e[40m\r
-\e[30m°°°°°±±±±²²²²²²\e[44m°\e[34m°±\e[1C\e[46m \e[6C\e[0mS\e[1moftware: \e[0mT\e[1mel\r
-\e[A\e[39Cegard 2.7\e[6C\e[46m \e[2C \e[36m°±\e[34m±±±°°°°    \e[36m°°°°±±±±\e[40m\r
-\e[30m°°°°°±±±±²²²²²²\e[34;44m°±²\e[1C\e[30;46mÜ\e[34CÜ\e[2C\e[36m°±Û\e[34m±±±\e[40m\r
-\e[A\e[63C\e[46m\e[37mÜ\e[34m°°°°    \e[36m°°°°±±±\e[40m\r
-\e[30m°°°°°±±±±²²²²²²\e[34;44m±²Û\e[2C\e[36;40mß\e[0;36mßßßßßßßßßßßß\e[1;30mß\e[7C\r
-\e[A\e[41C\e[36mß\e[0;36mßßßßßßßßßßß\e[1;30mß   \e[36;46m²ÛÛ\e[34m±\e[0;46mÜ\e[40m\r
-\e[A\e[62C\e[46m\e[1mß\e[34m±°°°°    \e[36m°°°°±±±\e[40m\r
-\e[30m°°°±±±±±±²²²²²²\e[34;44m²ÛÛÛÛÛÛÛ\e[46m²²²²²²±±±±±±±±±°°°°°°        \e[40m\r
-\e[A\e[52C\e[46m\e[36m°°°±±²ÛÛ\e[34m±\e[0;36;47mß\e[1;37;46mÜÜÜÜÜÜÜ   \e[36m°°°\e[40m\r
-\e[A\e[75C\e[46m°±±±\e[40m\r
-\e[30m°°°°°±±±±²²²²²²ÛÛÛÛÛÛÛ\e[44m²²²²²±±±±°°°°    \e[34m°°°°±±±±²²²²ÛÛÛÛ\e[40m\r
-\e[A\e[55C\e[46m²²\e[47mß\e[46m²\e[0;36;47mß\e[1;34;46m±\e[0;36;47mß\e[1;34;46m±\e[40m\r
-\e[A\e[63C\e[46m°°°°\e[0;36mÛÛÛ\e[46m \e[1m°°°°±±±±\e[40m\r
-\e[30m°°°°°±±±±²²²²²²ÛÛÛÛÛÛÛ\e[44m²²²²²±±±±°°°°    \e[34m°°°°±±±±²²²²ÛÛÛ\e[40m\r
-\e[A\e[54C\e[40mÛ\e[37;46mÜß\e[34m²²\e[37;40mÛ\e[34;46m±±\e[37mßÜ\e[34m°°°    \e[40m\r
-\e[A\e[71C\e[46m\e[36m°°°°±±±±\e[40m\r
-\e[30m°°°°°±±±±²²²²²²ÛÛÛÛÛÛÛ\e[44m²²²²²±±±±°°°°    \e[34m°°°°±±±±²²²²ÛÛÛÛ\e[40m\r
-\e[A\e[55C\e[46m²²²²\e[37;40mÛ\e[34;46m±±±°°°°    \e[36m°°°°±±±±\e[40m\r
-\e[30m°°°±±±±±±²²²²²²ÛÛÛÛÛÛÛÛ\e[44m²²²²²±±±±°°°°    \e[34m°°°°±±±±²²²²ÛÛÛÛ\e[40m\r
-\e[A\e[56C\e[46m²²²\e[37mß\e[34m±±±±°°°°    \e[36m°°°°±±±\e[40m\r
-\e[30m°°°°°±±±±²²²²²²ÛÛÛÛÛÛÛ\e[44m²²²²±±±±±°°°°    \e[34m°°°°±±±±²²²²ÛÛÛÛ\e[40m\r
-\e[A\e[55C\e[46m²²²²±±±±°°°°    \e[36m°°°°±±±±\e[40m\r
-\e[30mÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-\e[A\e[71CÄÄÄÄÄÄÄÄ\r
-  \e[37mi \e[34mC \e[0;34mE   P R O D U C T I O N S (tm)  \e[1;30mÄ  \e[0;34mN A \e[A\r
-\e[45CP A L M  [ \e[1;37mi \e[34mC \e[0;34mE ]  \e[1;30mÄ  \e[0;34mo2\e[1m/\e[0;34mo\e[A\r
-\e[72C1\e[1m/\e[0;34m93\r
-\e[1;30mÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\e[A\r
-\e[69CÄÄÄÄÄÄÄÄÄÄ\e[0m\e[255D\r
diff --git a/16/PCGPE10/ASM0.TXT b/16/PCGPE10/ASM0.TXT
deleted file mode 100644 (file)
index 14996d7..0000000
+++ /dev/null
@@ -1,193 +0,0 @@
-Text for ASM #0\r
-    \r
-    Hello there, this is Draeden typing this wonderful document.  This is \r
-an explanation of the basic assembler frame.  This document assumes that you\r
-know what hexdecimal is and somewhat how it works, that you have a copy of  \r
-TASM and TLINK, that you know what AX is, and how it relates to AL and AH, \r
-and you know the commands: \r
-\r
-    MOV xx,xx \r
-    JMP xxxx\r
-and INT xx\r
-\r
-    I'm also making the rash assumption that you want to learn ASSEMBLER. :)\r
-To assemble ASM0.ASM into an executable do the following:\r
-\r
-        TASM ASM0\r
-        TLINK ASM0\r
-\r
-    Now you can exececute this wonderful program.  Go ahead.  Try it.  In\r
-case you are having problems figuring out how to execute this, just type:\r
-\r
-        ASM0  (followed by the enter key)\r
-\r
-    No, you did nothing wrong. This code (ASM0.ASM) does nothing.  All it \r
-does is return control to DOS.  It is the basic frame for an assembler \r
-program.  All of the programs that I write use this frame.  If you want to \r
-know what each part does, read on.  If you already know, just go read \r
-ASM1.TXT.\r
-\r
-    The number followed by the colon means that this is from ASM0.ASM and \r
-tells which line it is from.\r
-    \r
-1:    DOSSEG        \r
-\r
-  DOSSEG Sorts the segment using DOS standard, which is:\r
-\r
-     1) 'code' segments (in alphabetical order)\r
-     2) 'data' segments (in alphabetical order)\r
-     3) 'stack' segments (again, in alphabetical order)\r
-\r
-  Although it may not seem clear what this does, don't worry about it.  Just\r
-have it as the first line in your assembler programs, until you understand it.\r
-\r
-2:    .MODEL SMALL  \r
-\r
-MODEL ONLY needs to be used if you use the simplified segments, which I \r
-strongly recommend.\r
-\r
-In a nutshell, .MODEL Selects the MODEL to use.  This is used so that this \r
-code can be linked with C, PASCAL, ADA, BASIC, other ASSEMBLER program, and \r
-other languages with ease.  It also tells the compiler how to treat your\r
-code and data segments.\r
-\r
-NEAR means that the data/code can be reached using a 16bit pointer (offset)\r
-FAR  means that a SEGMENT:OFFSET pair must be used to access all the data/code\r
-\r
-Possible MODELS are:\r
-\r
-     TINY: Code and Data must fit in same 64k segment.  \r
-           Both Code and Data are NEAR.\r
-\r
-    SMALL: Code & Data have seperate segment, but must be each less than 64k\r
-           Both Code and Data are NEAR.\r
-           For most applications, this will suffice.\r
-\r
-   MEDIUM: Code may be larger than 64k, but Data has to be less than 64k\r
-           Code is FAR, Data is NEAR.\r
-\r
-  COMPACT: Code is less than 64k, but Data may be greater than 64k\r
-           Code is NEAR, Data is FAR.\r
-\r
-    LARGE: Both Code & Data can be greather than 64k.  Both are FAR, but a \r
-           single array cannot be greater than 64k.  Note that max array size\r
-           means nothing if you are just writing in assembler.  This only\r
-           matters when you link to C or another high level language.\r
-\r
-     HUGE: Same as LARGE, but arrays can be greater than 64k.\r
-           What that means is that the array index is a far pointer, instead\r
-           of a NEAR one.\r
-           LARGE and HUGE are identicle to the assembler programmer.\r
-\r
-3:    .STACK 200h   \r
-\r
-    Tells the compiler to set up a 200h byte stack upon execution of the\r
-program.  NOTE: the size you choose for the stack does not change the size \r
-of the file on disk.  You can see what I mean by changing the 200h to, say,\r
-400h and then recompiling.  The file sizes are identicle.\r
-\r
-    This could be replaced with:\r
-\r
-: MyStack SEGMENT PARA PUBLIC STACK 'STACK'\r
-:       db  200h dup (0)\r
-: MyStack ENDS\r
-\r
-    BUT, doing it this way makes your executable 512 bytes bigger.  If you\r
-were to double to 400h, the executable would be another 512 bytes bigger.\r
-I think it's pretty obvious why the simplified version is preferred.\r
-\r
-4:    .DATA           \r
-\r
-    Simplified, unnamed 'data' segment.  This is where those simplified \r
-segments become very handy.  If you were to write out the segment declaration\r
-the regular way, you'd have to write something like this:\r
-\r
-: MyData SEGMENT PARA PUBLIC 'DATA'\r
-:\r
-:  ...                  ;your data goes here...\r
-:\r
-: MyData ENDS\r
-\r
-Where 'MyData' is the name of the segment, public means that its, well, \r
-public, and PARA is the alignment of the start of the segment.  'DATA' \r
-specifies the type of the segment.  Instead of PARA, WORD or BYTE could \r
-have been used.  (PARA = segment will start on an adress that is a multiple \r
-of 16, WORD = even addresses, BYTE = where ever it lands.)\r
-\r
-5:    .CODE\r
-\r
-    Pretty much the same story as above, but this is for the code segment.\r
-Could be replaced with:\r
-\r
- - IN MASM MODE -\r
-: MyCode SEGMENT PARA PUBLIC 'CODE'\r
-:  ...\r
-: MyCode ENDS\r
-\r
- - IN IDEAL MODE -\r
-: SEGMENT MyCode PARA PUBLIC 'CODE'\r
-:  ...\r
-: ENDS MyCode  ;the 'MyCode' is optional in IDEAL mode\r
-    \r
-6: START:\r
-\r
-    This is just a label.  Labels just provide a way of refencing memory \r
-easily.  Like I could say "JMP START" which would jump to the label START and \r
-execute the code immediatly after it.  Or I could say MOV AX,[Start], which\r
-would grab the WORD that was immediatly after the label START.\r
-\r
-7: mov     ax,4c00h\r
-8: int     21h         \r
-\r
-    This bit of code calls DOS function # 4ch, which returns control to DOS\r
-and sends back the error level code that is in AL (which is zero).\r
-Note that for all int 21h DOS functions, AH contains the function number.\r
-\r
-THIS MUST BE AT THE END OF THE CODE! If it isn't, the code will continue to\r
-run...  right out of the end of your program and will execute whatever code\r
-is there!  The program will crash with out it!\r
-\r
-9: END START\r
-\r
-This tells the compiler that we are all done with our program and that it can\r
-stop compiling, now.  And it tells the compiler to put the entry point at\r
-the label START.  This means that DOS is effectivly starting your program by\r
-executing this:\r
-\r
-: JMP START\r
-\r
-    As you would probably guess, if you just put `END' instead of `END START'\r
-and you compiled and linked the program, when you went to execute the code,\r
-the computer will probably freeze because it does not know where to start\r
-execution.\r
-\r
-    Ok, now that you know what the frame is/does, lets actually make the \r
-program do something.  Lets be wild and crazy, and PRINT A MESSAGE! \r
-\r
-\r
-                            CONTINUED IN ASM1.TXT\r
-\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ ASM0.ASM ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-    DOSSEG\r
-    .MODEL SMALL\r
-    .STACK 200h\r
-    .DATA\r
-    .CODE\r
-\r
-START:\r
-\r
-;\r
-;   Your code goes here...\r
-;\r
-\r
-    mov     ax,4c00h\r
-    int     21h\r
-END START\r
-\r
-;   THIS CODE DOES ABSOLUTLY NOTHING EXCEPT RETURN CONTROL TO DOS!\r
-\r
-\r
diff --git a/16/PCGPE10/ASM1.TXT b/16/PCGPE10/ASM1.TXT
deleted file mode 100644 (file)
index a9c2a59..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-    ASM1.ASM - print a string\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-\r
-    Well, here's the classic example for the first program in just about\r
-every language.  It prints a message to the screen by using a DOS function.\r
-More specifically, it uses function 9 of interrupt 21h.  Here's the mock\r
-specification for the function:\r
-\r
-þ-\r
-|IN:     ah = 9      ;ah tells INT 21h which function you want\r
-|        DS:DX = FAR pointer to the string to be printed.\r
-|                    ;the string must terminate with a dollar sign ($)\r
-|\r
-|OUT:    Prints the string to the screen\r
-þ-\r
-\r
-    Other than that function, there's nothing new that can't easily be\r
-figured out.  The directive SEG, as you might have guessed, returns the \r
-segment that the specified label is in.  OFFSET returns the offset from \r
-the begining of the segment to the specified label.  Together, you can\r
-form a FAR pointer to a specified label.\r
-\r
-    Another thing you might wonder about is why I put the SEG Message into\r
-AX and THEN Put it in DS.  \r
-\r
-    The answer is:  You have to.  An immediate value cannot be put into a \r
-segment register, but a register or an indexed value can.  For instance:\r
-\r
-These are legal:\r
-\r
-:   mov     DS,AX\r
-:   mov     DS,[TheSegment]\r
-\r
-But these are not:\r
-\r
-:   mov     DS,50\r
-:   mov     DS,0a000h\r
-    \r
-    One last piece of info: in the lines:\r
-\r
-:Message     db  "This was printed using function 9 " \r
-:            db  "of the DOS interrupt 21h.$"\r
-\r
-    The DB is just a data type.  Its the same as a CHAR in C, which is 1 byte\r
-    in length.\r
-\r
-    Other common data types are:\r
-\r
-    DW  same as an INT in C - 2 bytes\r
-    DD  same as a double int or long int or a FAR pointer - 4 bytes\r
-\r
-\r
-    Well, that's pretty much it for this short section...  Try playing around\r
-with the 'print' function... Ya learn best by playing with it.\r
-\r
-\r
-One last side note:\r
-    I COULD have put the message in the CODE segment instead, by doing this:\r
-    \r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-\r
-    DOSSEG\r
-    .MODEL SMALL\r
-    .STACK 200h\r
-    .CODE\r
-\r
-Message     db  "Hey look! I'm in the code segment!$" \r
-            \r
-START:\r
-    mov     ax,cs   ;since CS already points to the same segment as Message,\r
-    mov     ds,ax   ;I don't have to explicitly load the segment that message\r
-                    ;is in..\r
-\r
-    mov     dx,offset Message\r
-    mov     ah,9\r
-    int     21h\r
-\r
-    mov     ax,4c00h    ;Returns control to DOS\r
-    int     21h         ;MUST be here! Program will crash without it!\r
-\r
-END START\r
-\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-\r
-    The advantage to having all your data in the CODE segment is that DS and\r
-ES can be pointing anywhere and you can still access your data via a segment\r
-override!  \r
-\r
-    Example:\r
-        say I'm in the middle of copying one section of the screen memory to\r
-    another and I need to access the variable "NumLines" I'd do it like this:\r
-\r
-ÄÄÄÄÄÄÄÄ\r
-\r
-    mov ax,[CS:NumLines]    ;this is in IDEAL mode\r
-            ^^^\r
-ÄÄÄÄÄÄÄÄ    Code Segment override\r
-\r
-    Pretty flexable, eh?\r
-\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ ASM1.ASM ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-    DOSSEG\r
-    .MODEL SMALL\r
-    .STACK 200h\r
-    .DATA\r
-\r
-Message     db  "This was printed using function 9 " \r
-            db  "of the DOS interrupt 21h.$"\r
-                  \r
-    .CODE\r
-    \r
-START:\r
-    mov     ax,seg Message  ;moves the SEGMENT that `Message' is in into AX\r
-    mov     ds,ax           ;moves ax into ds (ds=ax)\r
-                            ;you cannot do this -> mov ds,seg Message\r
-\r
-    mov     dx,offset Message   ;move the OFFSET of `Message' into DX\r
-    mov     ah,9        ;Function 9 of DOS interupt 21h prints a string that\r
-    int     21h         ;terminates with a "$".  It requires a FAR pointer to\r
-                        ;what is to be printed in DS:DX\r
-\r
-    mov     ax,4c00h    ;Returns control to DOS\r
-    int     21h         ;MUST be here! Program will crash without it!\r
-\r
-END START\r
-\r
diff --git a/16/PCGPE10/ASM2.TXT b/16/PCGPE10/ASM2.TXT
deleted file mode 100644 (file)
index b5e124b..0000000
+++ /dev/null
@@ -1,245 +0,0 @@
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-    ASM2.TXT - intro to keyboard and flow control\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-    \r
-    Alright.  This bit of code introduces control flow, keyboard input, and \r
-    a way to easily print out one character.\r
-\r
-ÄÄÄÄÄÄÄÄ\r
-    First off, lets examine the easiest one: printing a character.\r
-\r
-    It's like this: you put the character to print in DL, put 2 in AH and\r
-    call interrupt 21h.  Damn easy.\r
-\r
-ÄÄÄÄÄÄÄÄ\r
-    Ok, lets look at the next easiest one: keyboard input.\r
-\r
-    There are quite a few functions related to INT 16h (the keyboard\r
-    interrupt.)  They are:\r
-\r
-FUNCTION#\r
----------\r
-\r
-    0h  -Gets a key from the keyboard buffer.  If there isn't one, it waits\r
-            until there is.\r
-            Returns the SCAN code in ah, and the ASCII translation in AL\r
-\r
-    1h  -Checks to see if a key is ready to grab.  Sets the zero flag if a\r
-            key is ready to grab.  Grab it with Fn# 0\r
-            This also returns the same info about the key as Fn#0, but does\r
-            not remove it from the buffer.\r
-\r
-    2h  -Returns the shift flags in al.  They are:\r
-            bit 7 - Insert active\r
-            bit 6 - Caps lock active\r
-            bit 5 - Num Lock active\r
-            bit 4 - Scroll lock active\r
-            bit 3 - Alt pressed\r
-            bit 2 - Ctrl pressed\r
-            bit 1 - Left shift pressed\r
-            bit 0 - right shift pressed\r
-\r
-    3h  -You can set the Typematic Rate and delay with this function\r
-            registers must be set as follows\r
-            AL = 5\r
-            BH = Delay value (0-3: 250,500,750,1000 millisec)\r
-            BL = Typematic rate (0-1fh) 1fh = slowest (2 chars per sec)\r
-                0 =fastest (30 chars per second)\r
-\r
-    4h  -Key Click control - not important\r
-\r
-    5h  -STUFF the keyboard\r
-        input:\r
-            CH = scan code\r
-            CL = ascii code\r
-\r
-        output:\r
-            al = 0 no error\r
-            al = 1 keyboard buffer is full\r
-\r
-   10h  -Same as #0, but its for the extended keyboard.  Checks all the keys.\r
-\r
-   11h  -Same as #1, but for the extended keyboard.\r
-\r
-   12h  -Same as #2, but AH contains additional shift flags:\r
-            bit 7 - Sys req pressed\r
-            bit 6 - Caps lock active\r
-            bit 5 - Num Lock active\r
-            bit 4 - Scroll lock active\r
-            bit 3 - Right Alt active\r
-            bit 2 - Right Ctrl active\r
-            bit 1 - Left Alt active\r
-            bit 0 - Right Alt active\r
-        Al is EXACTLY the same as in Fn#2\r
-\r
-\r
-WHERE AH= the function number when you call INT 16h\r
-\r
-ÄÄÄÄÄÄÄÄ\r
-    That's neat-o, eh?  Now on to flow controll via CMP and Jcc...\r
-\r
-CMP:\r
-ÄÄÄ\r
-    CMP is the same as SUB, but it does NOT alter any registers, only the\r
-    flags.  This is used in conjunction with Jcc.\r
-\r
-Jcc:\r
-ÄÄÄ\r
-    Ok, Jcc is not a real instruction, it means 'jump if conditionis met.'\r
-\r
-    I'll break this into 3 sections, comparing signed numbers, comparing \r
-    unsigned numbers, and misc.\r
-\r
-    Note that a number being 'unsigned' or 'signed' only depends on how you\r
-    treat it.  That's why there are different Jcc for each...\r
-\r
-    If you treat it as a signed number, the highest bit denotes whether it's\r
-    negative or not.  \r
-    \r
-    Prove to yourself that 0FFFFh is actually -1 by adding 1 to 0FFFFh.  You \r
-    should get a big zero: 00000h.  (Remember that the number is ONLY 16 bits\r
-    and the carry dissapears..)\r
-\r
-UNSIGNED:\r
-ÄÄÄÄÄÄÄÄ\r
-    JA  -jumps if the first number was above the second number\r
-    JAE -same as above, but will also jump if they are equal\r
-\r
-    JB  -jumps if the first number was below the second\r
-    JBE -duh...\r
-\r
-    JNA -jumps if the first number was NOT above... (same as JBE)\r
-    JNAE-jumps if the first number was NOT above or the same as..\r
-            (same as JB)\r
-    JNB -jumps if the first number was NOT below... (same as JAE)\r
-    JNBE-jumps if the first number was NOT below or the same as..\r
-            (same as JA)\r
-    JZ  -jumps if the two numbers were equal (zero flag = 1)\r
-    JE  -same as JZ, just a different name\r
-\r
-    JNZ -pretty obvious, I hope...\r
-    JNE -same as above...\r
-\r
-SIGNED:\r
-ÄÄÄÄÄÄ\r
-    JG  -jumps if the first number was > the second number\r
-    JGE -same as above, but will also jump if they are equal\r
-\r
-    JL  -jumps if the first number was < the second\r
-    JLE -duh...\r
-\r
-    JNG -jumps if the first number was NOT >... (same as JLE)\r
-    JNGE-jumps if the first number was NOT >=.. (same as JL)\r
-\r
-    JNL -jumps if the first number was NOT <... (same as JGE)\r
-    JNLE-jumps if the first number was NOT <=... (same as JG)\r
-\r
-    JZ, JE, JNZ, JNE - Same as for Unsigned\r
-\r
-MISC:\r
-ÄÄÄÄ\r
-    JC  -jumps if the carry flag is set\r
-    JNC -Go figgure...\r
-\r
-    Here's the rest of them... I've never had to use these, though...\r
-\r
-    JO  -jump if overflow flag is set\r
-    JNO -...\r
-\r
-    JP  -jump is parity flag is set\r
-    JNP -...\r
-    JPE -jump if parity even (same as JP)\r
-    JPO -jump if parity odd (same as JNP)\r
-\r
-    JS  -jumps if sign flag is set\r
-    JNS -...\r
-\r
-\r
-Here's the flags really quickly:\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-bit#    8 7 6 5 4 3 2 1 0\r
-        ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-symbol: O D I T S Z A P C\r
-\r
-    O = OverFlow flag\r
-    D = Direction flag  *\r
-    I = Interrupt flag\r
-    T = Trap flag\r
-    S = Sign flag\r
-    Z = Zero flag       *\r
-    A = Auxiliary flag\r
-    C = Carry flag      *\r
-\r
-The * denotes the ones that you should know.\r
-\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-\r
-That's it for now...  Until next time...\r
-\r
-Draeden\VLA\r
-\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ ASM2.ASM ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-;   ASM2.ASM\r
-; Prints messages get keyboard input and has control flow\r
-\r
-    DOSSEG\r
-    .MODEL SMALL\r
-    .STACK 200h\r
-    .DATA\r
-\r
-Prompt      db  13,10,"Do you want to be prompted again? (Y/N) $"\r
-NoMessage   db  13,10,"Ok, then I won't prompt you anymore.$"\r
-YesMessage  db  13,10,"Here comes another prompt!$"\r
-UnKnownKey  db  13,10,"Please hit either Y or N.$"\r
-\r
-    .CODE\r
-\r
-START:\r
-    mov     ax,@DATA    ;moves the segment of data into ax\r
-    mov     ds,ax\r
-\r
-MainLoop:\r
-    mov     ah,9\r
-    mov     dx,offset Prompt\r
-    int     21h         ;print a message\r
-\r
-    mov     ah,0\r
-    int     16h         ;get a key, returned in AX\r
-                        ;AL is the ASCII part\r
-                        ;AH is the SCAN CODE\r
-    push    ax\r
-    mov     dl,al\r
-    mov     ah,2\r
-    int     21h         ;print character in dl\r
-    pop     ax\r
-\r
-    cmp     al,"Y"      ;was the character a 'Y'?\r
-    jne     NotYes      ;nope it was Not Equal\r
-\r
-    mov     ah,9\r
-    mov     dx,offset YesMessage\r
-    int     21h\r
-    jmp     MainLoop\r
-\r
-NotYes:\r
-    cmp     al,"N"      ;was the character a 'N'\r
-    je      ByeBye      ;Yes, it was Equal\r
-\r
-    mov     dx,offset UnknownKey\r
-    mov     ah,9\r
-    int     21h\r
-    jmp     MainLoop\r
-\r
-ByeBye:\r
-    mov     dx,offset NoMessage\r
-    mov     ah,9\r
-    int     21h\r
-\r
-    mov     ax,4c00h    ;Returns control to DOS\r
-    int     21h         ;MUST be here! Program will crash without it!\r
-\r
-END START\r
diff --git a/16/PCGPE10/ASM3.TXT b/16/PCGPE10/ASM3.TXT
deleted file mode 100644 (file)
index ed5bb64..0000000
+++ /dev/null
@@ -1,526 +0,0 @@
-\r
-                  - ASMVLA01 - File I/O - 04/14/93 -\r
-\r
-    Lately we have been quite busy with school, so this second issue is a \r
-little behind schedule.  But that's life... This little issue will quickly\r
-show off the DOS file functions: read, write, open, close, create & others.  \r
-They are all pretty much the same, so there isn't a whole lot to go over.\r
-But, as a bonus, I'm going to throw in a bit about how to do a subroutine.\r
-Let's do the subroutine stuff first.\r
-\r
-`Procedures' as they are called, are declared like this:\r
-\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-\r
-PROC TheProcedure\r
-\r
-    ...             ;do whatever..\r
-    \r
-    ret             ;MUST have a RET statement!\r
-ENDP TheProcedure\r
-\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-\r
-    In the procedure, you can do basically anything you want, just at the \r
-end of it, you say ret.  You can also specify how to call the PROC by putting\r
-a NEAR or FAR after the procedure name.  This tells the compiler whether\r
-to change segment AND offset, or just offset when the procedure is called.\r
-Note that if you don't specify, it compiles into whatever the default is for\r
-the current .MODEL (small = near, large = far)\r
-\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-\r
-PROC TheProc NEAR\r
-\r
-    ...\r
-\r
-    ret             ;this compiles to `retn' (return near- pops offset off\r
-ENDP TheProc        ; stack only)\r
-\r
-    OR\r
-\r
-PROC TheProc FAR\r
-\r
-    ...\r
-\r
-    ret             ;compiles to `retf' pops both offset & segment off stack\r
-ENDP TheProc        ; pops offset first\r
-\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-\r
-    That's basically all there is to that.  Note that if you REALLY wanted to\r
-be tricky, you could do a far jump by doing this:\r
-\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-    push    seg TheProc\r
-    push    offset TheProc\r
-    retf\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-\r
-    This would "return" you to the beginning of the procedure "TheProc"...\r
-This code is just to illustrate a point.  If you actually did something like\r
-this and compiled and executed it, it would bomb.  Know why?  What happens \r
-when it hits the `ret' in the PROC?  Well it pops off the offset and puts \r
-it in IP and then pops the segment and puts it in CS.  Who knows what was\r
-on the stack... will return to an unknown address and probably crash.  (It\r
-DEFINATELY will not continue executing your code.)\r
-\r
-    Of course, the only stack operations are PUSH and POP.  All they do is \r
-push or pop off the stack a word sized or a Dword sized piece of data.  NEVER\r
-under ANY circumstance try to push a byte sized piece of data!  The results \r
-are unpredictable.  Well, not really, but just don't do it, ok?\r
-\r
-    There are also two commands that'll save you some time and code space:\r
-\r
-PUSHA and POPA (push all and Pop all)\r
-\r
-    PUSHA pushes the general registers in this order:\r
-\r
-AX, CX, DX, BX, SP, BP, SI, DI\r
-\r
-    POPA pops the general registers in this order:\r
-\r
-DI, SI, BP, (sp), BX, DX, CX, AX\r
-\r
-    SP is different because popa does NOT restore the value of SP.  It merely \r
-pops it off and throws it away.\r
-\r
-    For the 386+, pushad and popad push and pop all extended registers in\r
-the same order.  You don't need to memorize the order, because you don't\r
-need to know the order until you go and get tricky. (hint: the location of\r
-AX on the stack is [sp + 14] - useful if you want to change what AX returns,\r
-but you did a pusha cause you wanted to save all the registers (except AX)\r
-Then you'd do a popa, and AX= whatever value you put in there.\r
-\r
-    ÄÄÄÄ\r
-\r
-    Alright, now a slightly different topic: memory management\r
-\r
-    Ok, this isn't true by-the-book memory management, but you need to know\r
-one thing:  Upon execution of a program, DOS gives it ALL memory up to the\r
-address A000:0000. This happens to be the beginning of the VGA buffer...\r
-Another thing you must know is that, if you used DOSSEG at the top of your\r
-file, the segment is the last piece of your program.  The size of the segment\r
-is derived from the little command `STACK 200h' or whatever the value was\r
-that you put up there.  The 200h is the number of bytes in the stack.  To get\r
-the number of paragraphs, you'd divide by 16.  Here's an example of how I can\r
-get a pointer to the first valid available segment that I can use for data:\r
-\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-    mov     ax,ss       ;grab the stack segment\r
-    add     ax,200h/16  ;add the size of the stack 200h/16 = 20h\r
-\r
-    ;AX now contains the value of the first available segment the you can\r
-    ; use.\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-\r
-    This is very nice, because you can just plop your data right there\r
-and you have a 64k buffer you can use for anything you want.\r
-\r
-    Ok, say you want to find out how much memory is available to use.  This\r
-would be done like this:  (no suprises, I hope.)\r
-\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-    mov     ax,ss       ;grab the stack segment\r
-    add     ax,200h/16  ;add the size of the stack 200h/16 = 20h\r
-    mov     bx,0A000h   ;upper limit of the free memory\r
-    sub     bx,ax       ;bx= # of paragraphs available\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-\r
-    Pretty darn simple.  That's enough of the overhead that you must know\r
-to understand the included ANSI viewer (asm3.asm)  \r
-\r
-        Now to the FILE I/O stuff...\r
-\r
-    Files can be opened, read from, written to, created, and closed.  To open\r
-a file, all you need to do is give the DOS interrupt a name & path.  All\r
-references to that file are done through what's known as a file handle. A\r
-file handle is simply a 16bit integer that DOS uses to identify the file.\r
-It's used more or less like an index into chart of pointers that point to \r
-a big structure that holds all the info about the file- like current position\r
-in the file, file type, etc.. all the data needed to maintain a file.\r
-The `FILES= 20' thing in your autoexec simply tells DOS how much memory to\r
-grab for those structures. ( Files=20 grabs enough room for 20 open files. )\r
-\r
-    ANYway, here's each of the important function calls and a rundown on what\r
-they do and how to work them.\r
-\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-FILE OPEN: Function 3Dh\r
-\r
- IN:\r
-    ah= 3Dh\r
-    al= open mode\r
-\r
-        bits 7-3: Stuff that doesn't matter to us\r
-        bits 2-0: Access code\r
-            000 read only access\r
-            001 write only access\r
-            010 read and write access\r
-\r
-    DS:DX= pointer to the ASCIIZ filename\r
-        ASCIIZ means that its an ASCII string with a Zero on the end.\r
-\r
- Returns:\r
-        CF=1 error occured\r
-            AX= error code- don't worry about what they are, if the carry\r
-                is set, you didn't open the file.\r
-\r
-        CF=0 no error\r
-            AX= File Handle ;you need to keep this- it's your only way to\r
-                            ; reference your file!\r
-\r
-  ÄÄÄÄ EXAMPLE ÄÄÄÄ\r
-\r
-    [...]   ;header stuff\r
-\r
-    .CODE           ;this stuff is used for all the examples\r
-\r
-  FileName  db "TextFile.TXT",0\r
-  FileHandle dw 0\r
-  Buffer    db  300 dup (0)\r
-  BytesRead dw  0\r
-  FileSize  dd  0\r
-\r
-    [...]   ;more stuff\r
-\r
-    mov     ax,3d00h    ; open file for read only\r
-    mov     ax,cs\r
-    mov     ds,ax       ;we use CS, cause it's pointing to the CODE segment\r
-                        ; and our file name is in the code segment\r
-    mov     dx,offset FileName\r
-    int     21h\r
-    jc      FileError_Open\r
-\r
-    mov     [FileHandle],ax\r
-\r
-    [...]   ;etc...\r
-\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-FILE CLOSE: Function 3Eh\r
-\r
-  IN:\r
-    AH= 3Eh\r
-    BX= File Handle\r
-\r
-  RETURN:\r
-    CF=1 error occured, but who cares?\r
-  \r
-  ÄÄÄÄ EXAMPLE ÄÄÄÄ\r
-\r
-    mov     bx,[FileHandle]\r
-    mov     ah,3eh\r
-    int     21h\r
-\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-FILE READ: Function 3Fh\r
-\r
-  IN:\r
-    AH= 3Fh\r
-    BX= File Handle\r
-    CX= Number of bytes to read\r
-    DS:DX= where to put data that is read from the file (in memory)\r
-    \r
-  RETURN:\r
-    AX= number of bytes actually read- if 0, then you tried to read from\r
-        the end of the file.\r
-\r
-  ÄÄÄÄ EXAMPLE ÄÄÄÄ\r
-\r
-    mov     bx,[FileHandle]\r
-    mov     ax,cs\r
-    mov     ds,ax\r
-    mov     dx,offset buffer\r
-    mov     ah,3Fh\r
-    mov     cx,300\r
-    int     21h\r
-\r
-    mov     [BytesRead],ax\r
-\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-FILE WRITE: Function 40h\r
-\r
-  IN:\r
-    AH= 40h\r
-    BX= File Handle\r
-    CX= Number of bytes to write\r
-    DS:DX= where to read data from (in memory) to put on disk\r
-    \r
-  RETURN:\r
-    AX= number of bytes actually written- if not equal to the number of bytes\r
-        that you wanted to write, you have an error.\r
-        \r
-  ÄÄÄÄ EXAMPLE ÄÄÄÄ\r
-\r
-    mov     bx,[FileHandle]\r
-    mov     ax,cs\r
-    mov     ds,ax\r
-    mov     dx,offset buffer\r
-    mov     ah,40h\r
-    mov     cx,[BytesRead]\r
-    int     21h\r
-\r
-    cmp     cx,ax\r
-    jne     FileError_Write\r
-\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-FILE CREATE: Function 3Ch\r
-\r
- IN:\r
-    ah= 3Ch\r
-    cl= file attribute\r
-\r
-        bit 0: read-only\r
-        bit 1: hidden\r
-        bit 2: system\r
-        bit 3: volume label\r
-        bit 4: sub directory\r
-        bit 5: Archive\r
-        bit 6&7: reserved\r
-\r
-    DS:DX= pointer to the ASCIIZ filename\r
-        ASCIIZ means that its an ASCII string with a Zero on the end.\r
-\r
- Returns:\r
-        CF=1 error occured\r
-            AX= error code- don't worry about what they are, if CF\r
-                is set, you didn't create the file.\r
-\r
-        CF=0 no error\r
-            AX= File Handle ;you need to keep this- it's your only way to\r
-                            ; reference your file!\r
-  ÄÄÄÄ EXAMPLE ÄÄÄÄ\r
-\r
-    mov     ah,3ch\r
-    mov     ax,cs\r
-    mov     ds,ax       ;we use CS, cause it's pointing to the CODE segment\r
-                        ; and our file name is in the code segment\r
-    mov     dx,offset FileName\r
-    mov     cx,0        ;no attributes\r
-    int     21h\r
-    jc      FileError_Create\r
-\r
-    mov     [FileHandle],ax\r
-\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-FILE DELETE: Function 41h\r
-\r
- IN:\r
-    ah= 41h\r
-    DS:DX= pointer to the ASCIIZ filename\r
-    \r
- Returns:\r
-        CF=1 error occured\r
-            AX= error code- 2= file not found, 3= path not found\r
-                    5= access denied\r
-\r
-        CF=0 no error\r
-\r
-  ÄÄÄÄ EXAMPLE ÄÄÄÄ\r
-\r
-    mov     ah,41h      ;kill the sucker\r
-    mov     ax,cs\r
-    mov     ds,ax\r
-    mov     dx,offset FileName\r
-    int     21h\r
-    jc      FileError_Delete\r
-\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-FILE MOVE POINTER: Function 42h\r
-\r
- IN:\r
-    ah= 42h\r
-    BX= File Handle\r
-    CX:DX= 32 bit pointer to location in file to move to    \r
-    AL= 0  offset from beginning of file\r
-      = 1  offset from curent position\r
-      = 2  offset from the end of the file\r
-      \r
- Returns:\r
-        CF=1 error occured\r
-            AX= error code- no move occured\r
-\r
-        CF=0 no error\r
-            DX:AX 32 bit pointer to indicate current location in file\r
-            \r
-  ÄÄÄÄ EXAMPLE ÄÄÄÄ\r
-\r
-    mov     ah,42h      ;find out the size of the file\r
-    mov     bx,[FileHandle]\r
-    xor     cx,cx\r
-    xor     dx,dx\r
-    mov     al,2\r
-    int     21h\r
-    \r
-    mov     [word low FileSize],ax\r
-    mov     [word high FileSize],dx ;load data into filesize\r
-\r
-    (or in MASM mode, \r
-\r
-            mov word ptr [FileSize],ax\r
-            mov word ptr [FileSize+2],dx\r
-\r
-    need I say why I like Ideal mode? )\r
-\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-FILE CHANGE MODE: Function 43h\r
-\r
- IN:\r
-    ah= 43h\r
-    DS:DX= pointer to the ASCIIZ filename\r
-    al= 0\r
-        returns file attributes in CX\r
-    al= 1 \r
-        sets file attributes to what's in CX\r
-    \r
- Returns:\r
-        CF=1 error occured\r
-            AX= error code- 2= file not found, 3= path not found.\r
-                    5= access denied\r
-\r
-        CF=0 no error\r
-\r
-  ÄÄÄÄ EXAMPLE ÄÄÄÄ Lets erase a hidden file in your root directory...\r
-\r
-  FileName db   "C:\msdos.sys",0\r
-\r
-    [...]\r
-\r
-    mov     ah,43h          ;change attribute to that of a normal file\r
-    mov     ax,cs\r
-    mov     ds,ax\r
-    mov     dx,offset FileName\r
-    mov     al,1            ;set to whats in CX\r
-    mov     cx,0            ;attribute = 0\r
-    int     21h\r
-\r
-    mov     ah,41h          ;Nuke it with the delete command\r
-    int     21h\r
-\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-\r
-    Well, that's all for now.  I hope this info is enough for you to do some \r
-SERIOUS damage... :)  I just don't want to see any 'bombs' running around\r
-erasing the hidden files in the root directory, ok?\r
-\r
-    Anyway, go take a look at asm3.asm- it's a SIMPLE ansi/text displayer.\r
-It just opens the file, reads it all into a "buffer" that was "allocated"\r
-immediatly after the stack & reads in the entire file (if it's < 64k) and \r
-prints out the file character by character via DOS's print char (fn# 2).\r
-Very simple and very slow.  You'd need a better print routine to go faster...\r
-The quickest display programs would decode the ANSI on its own... But that's\r
-kinda a chore...  Oh, well.  Enjoy.\r
-\r
-    Draeden/VLA\r
-\r
-\r
-    Suggested projects:\r
-\r
-    1)  Write a program that will try to open a file, but if it does not\r
-        find it, the program creates the file and fills it with a simple\r
-        text message.\r
-\r
-    2)  Write a program that will input your keystrokes and write them\r
-        directly to a text file.\r
-\r
-    3)  The write & read routines actually can be used for a file or device.\r
-        Try to figure out what the FileHandle for the text screen is by\r
-        writing to the device with various file handles.  This same channel,\r
-        when read from, takes it's data from the keyboard.  Try to read data\r
-        from the keyboard.  Maybe read like 20 characters...  CTRL-Z is the \r
-        end of file marker.\r
-\r
-    4)  Try to use a file as `virtual memory'- open it for read/write access\r
-        and write stuff to it and then read it back again after moving the \r
-        cursor position.\r
-\r
-\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ ASM3.ASM ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-;   VERY, VERY simple ANSI/text viewer\r
-;\r
-;   Coded by Draeden [VLA]\r
-;\r
-\r
-    DOSSEG\r
-    .MODEL SMALL\r
-    .STACK 200h\r
-    .CODE\r
-    Ideal\r
-\r
-;===- Data -===\r
-\r
-BufferSeg   dw  0\r
-\r
-ErrMsgOpen  db  "Error opening `"\r
-FileName    db  "ANSI.TXT",0,8,"'$"     ;8 is a delete character\r
-                                        ;0 is required for filename \r
-                                        ;(displays a space)\r
-FileLength dw 0\r
-\r
-;===- Subroutines -===\r
-\r
-PROC DisplayFile NEAR\r
-    push    ds\r
-\r
-    mov     ax,cs\r
-    mov     ds,ax\r
-    mov     ax,3d00h    ;open file (ah=3dh)\r
-    mov     dx,offset FileName\r
-    int     21h\r
-    jc      OpenError\r
-    mov     bx,ax       ;move the file handle into bx\r
-\r
-    mov     ds,[BufferSeg]\r
-    mov     dx,0            ;load to [BufferSeg]:0000\r
-    mov     ah,3fh\r
-    mov     cx,0FFFFh       ;try to read an entire segments worth\r
-    int     21h\r
-\r
-    mov     [cs:FileLength],ax\r
-\r
-    mov     ah,3eh\r
-    int     21h             ;close the file\r
-\r
-    cld\r
-    mov     si,0\r
-    mov     cx,[cs:FileLength]\r
-PrintLoop:\r
-    mov     ah,2\r
-    lodsb\r
-    mov     dl,al\r
-    int     21h         ;print a character\r
-\r
-    dec     cx\r
-    jne     PrintLoop\r
-    \r
-    pop     ds\r
-    ret\r
-\r
-OpenError:\r
-    mov     ah,9\r
-    mov     dx,offset ErrMsgOpen\r
-    int     21h\r
-\r
-    pop     ds\r
-    ret\r
-ENDP DisplayFile\r
-\r
-;===- Main Program -===\r
-\r
-START:\r
-    mov     ax,cs\r
-    mov     ds,ax\r
-    mov     bx,ss\r
-    add     bx,200h/10h     ;get past the end of the file\r
-    mov     [BufferSeg],bx  ;store the buffer segment\r
-\r
-    call    DisplayFile\r
-\r
-    mov     ax,4c00h\r
-    int     21h\r
-END START\r
-\r
diff --git a/16/PCGPE10/ASMINTRO.TXT b/16/PCGPE10/ASMINTRO.TXT
deleted file mode 100644 (file)
index d12429e..0000000
+++ /dev/null
@@ -1,626 +0,0 @@
-\r
-        ÖÄÄÄÄÄÄÄÄÄÄ´% VLA Presents: Intro to Assembler %ÃÄÄÄÄÄÄÄÄÄÄ·\r
-        º                                                          º\r
-        ÓÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĽ\r
-\r
-\r
-\r
-  ¯ Dedicated To Those Who Wish To Begin Exploring The Art Of Assembler. ®\r
-\r
-\r
-\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ \ 4 VLA Members Are \ 4 ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-\r
-                         (© Draeden - Main Coder ª)\r
-                      (© The Priest - Coder/ Artist ª)\r
-                  (© Lithium -  Coder/Ideas/Ray Tracing ª)\r
-                   (© The Kabal -  Coder/Ideas/Artwork ª)\r
-                      (© Desolation - Artwork/Ideas ª)\r
-\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ The Finn - Mods/Sounds ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-\r
-\r
-   ÖÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ͵ Contact Us On These Boards ÆÍÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ·\r
-   º                                                                    º\r
-   ³  % Phantasm BBS .................................. (206) 232-5912  ³\r
-   ³  * The Deep ...................................... (305) 888-7724  ³\r
-   ³  * Dark Tanget Systems ........................... (206) 722-7357  ³\r
-   ³  * Metro Holografix .............................. (619) 277-9016  ³\r
-   ³                                                                    ³\r
-   º        % - World Head Quarters      * - Distribution Site          º\r
-   ÓÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĽ\r
-\r
-     Or Via Internet Mail For The Group: tkabal@carson.u.washington.edu\r
-\r
-                       Or to reach the other members:\r
-\r
-                        - draeden@u.washington.edu -\r
-\r
-                        - lithium@u.washington.edu -\r
-\r
-                       - desolation@u.washington.edu-\r
-\r
-\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-    VLA 3/93  Introduction to ASSEMBLER\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-\r
-Here's something to help those of you who were having trouble understanding\r
-the instructional programs we released.  Dreaden made these files for the \r
-Kabal and myself when we were just learning.  These files go over some of \r
-the basic concepts of assembler.  Bonus of bonuses.  These files also have \r
-programs imbedded in them.  Most of them have a ton of comments so even\r
-the beginning programmers should be able to figure them out.\r
-\r
-If you'd like to learn more, post a message on Phantasm.  We need to know\r
-where you're interests are before we can make more files to bring out the\r
-little programmers that are hiding inside all of us.\r
-\r
-    Lithium/VLA\r
-\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-\r
-    First thing ya need to know is a little jargon so you can talk about \r
-the basic data structures with your friends and neighbors.  They are (in\r
-order of increasing size) BIT, NIBBLE, BYTE, WORD, DWORD, FWORD, PWORD and\r
-QWORD, PARA, KiloByte, MegaByte.  The ones that you'll need to memorize are\r
-BYTE, WORD, DWORD, KiloByte, and MegaByte.  The others aren't used all that \r
-much, and you wont need to know them to get started.  Here's a little \r
-graphical representation of a few of those data structures:\r
-\r
-(The zeros in between the || is a graphical representation of the number of\r
-bits in that data structure.)\r
-\r
-ÄÄÄÄÄÄ\r
-1 BIT :     |0|\r
-\r
-    The simplest piece of data that exists.  Its either a 1 or a zero.\r
-    Put a string of them together and you have a BASE-2 number system.\r
-    Meaning that instead of each 'decimal' place being worth 10, its only \r
-    worth 2.  For instance: 00000001 = 1; 00000010 = 2; 00000011 = 3, etc..\r
-\r
-ÄÄÄÄÄÄ\r
-1 NIBBLE:   |0000|\r
-4 BITs\r
-\r
-    The NIBBLE is half a BYTE or four BITS.  Note that it has a maximum value\r
-    of 15 (1111 = 15).  Not by coincidence, HEXADECIMAL, a base 16 number \r
-    system (computers are based on this number system) also has a maximum \r
-    value of 15, which is represented by the letter 'F'.  The 'digits' in\r
-    HEXADECIMAL are (in increasing order): \r
-    \r
-    "0123456789ABCDEF"\r
-\r
-    The standard notation for HEXADECIMAL is a zero followed by the number        \r
-    in HEX followed by a lowercase "h"  For instance: "0FFh" = 255 DECIMAL.\r
-\r
-ÄÄÄÄÄÄ\r
-1 BYTE      |00000000|\r
-2 NIBBLEs    ÀÄ AL ÄÙ\r
-8 BITs\r
-\r
-    The BYTE is the standard chunk of information.  If you asked how much \r
-    memory a machine had, you'd get a response stating the number of BYTEs it\r
-    had. (Usually preceded by a 'Mega' prefix).  The BYTE is 8 BITs or \r
-    2 NIBBLEs.  A BYTE has a maximum value of 0FFh (= 255 DECIMAL).  Notice\r
-    that because a BYTE is just 2 NIBBLES, the HEXADECIMAL representation is\r
-    simply two HEX digits in a row (ie. 013h, 020h, 0AEh, etc..)\r
-\r
-    The BYTE is also that size of the 'BYTE sized' registers - AL, AH, BL, BH,\r
-    CL, CH, DL, DH.\r
-\r
-ÄÄÄÄÄÄ\r
-1  WORD      |0000000000000000|\r
-2  BYTEs      ÀÄ AH ÄÙÀÄ AL ÄÙ     \r
-4  NIBBLEs    ÀÄÄÄÄÄ AX ÄÄÄÄÄÙ\r
-16 BITs\r
-\r
-    The WORD is just two BYTEs that are stuck together.  A word has a maximum \r
-    value of 0FFFFh (= 65,535).  Since a WORD is 4 NIBBLEs, it is represented\r
-    by 4 HEX digits.  This is the size of the 16bit registers on the 80x86\r
-    chips.  The registers are: AX, BX, CX, DX, DI, SI, BP, SP, CS, DS, ES, SS,\r
-    and IP.  Note that you cannot directly change the contents of IP or CS in \r
-    any way.  They can only be changed by JMP, CALL, or RET.\r
-\r
-ÄÄÄÄÄÄ\r
-1  DWORD\r
-2  WORDs     |00000000000000000000000000000000|\r
-4  BYTEs      ³               ÀÄ AH ÄÙÀÄ AL ÄÙ     \r
-8  NIBBLEs    ³               ÀÄÄÄÄÄ AX ÄÄÄÄÄÙ\r
-32 BITs       ÀÄÄÄÄÄÄÄÄÄÄÄÄ EAX ÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-    A DWORD (or "DOUBLE WORD") is just two WORDs, hence the name DOUBLE-WORD.\r
-    This can have a maximum value of 0FFFFFFFFh (8 NIBBLEs, 8 'F's) which\r
-    equals 4,294,967,295.  Damn large.  This is also the size or the 386's\r
-    32bit registers: EAX, EBX, ECX, EDX, EDI, ESI, EBP, ESP, EIP.  The 'E '\r
-    denotes that they are EXTENDED registers.  The lower 16bits is where the \r
-    normal 16bit register of the same name is located. (See diagram.)\r
-\r
-ÄÄÄÄÄÄ\r
-1    KILOBYTE   |-lots of zeros (8192 of 'em)-|\r
-256  DWORDs\r
-512  WORDs\r
-1024 BYTEs\r
-2048 NIBBLEs\r
-8192 BITs\r
-\r
-    We've all heard the term KILOBYTE byte, before, so I'll just point out\r
-    that a KILOBYTE, despite its name, is -NOT- 1000 BYTEs.  It is actually\r
-    1024 bytes.\r
-\r
-ÄÄÄÄÄÄ\r
-          1 MEGABYTE   |-even more zeros (8,388,608 of 'em)-|\r
-      1,024 KILOBYTEs\r
-    262,144 DWORDs\r
-    524,288 WORDs\r
-  1,048,576 BYTEs\r
-  2,097,152 NIBBLEs\r
-  8,388,608 BITs\r
-\r
-    Just like the KILOBYTE, the MEGABYTE is -NOT- 1 million bytes.  It is\r
-    actually 1024*1024 BYTEs, or 1,048,578 BYTEs\r
-\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-\r
-    Now that we know what the different data types are, we will investigate\r
-    an annoying little aspect of the 80x86 processors.  I'm talking about \r
-    nothing other than SEGMENTS & OFFSETS!\r
-\r
-\r
-SEGMENTS & OFFSETS:\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-    Pay close attention, because this topic is (I believe) the single most\r
-    difficult (or annoying, once you understand it) aspect of ASSEMBLER.\r
-\r
-An OverView:\r
-\r
-    The original designers of the 8088, way back when dinasaurs ruled the \r
-    planet, decided that no one would ever possibly need more than one MEG\r
-    (short for MEGABYTE :) of memory.  So they built the machine so that it \r
-    couldn't access above 1 MEG. To access the whole MEG, 20 BITs are needed.\r
-    Problem was that the registers only had 16 bits, and if the used two\r
-    registers, that would be 32 bits, which was way too much (they thought.)  \r
-    So they came up with a rather brilliant (blah) way to do their addressing-\r
-    they would use two registers.  They decided that they would not be 32bits, \r
-    but the two registers would create 20 bit addressing.  And thus Segments\r
-    and OFfsets were born.  And now the confusing specifics.\r
-\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-    \r
-OFFSET  = SEGMENT*16\r
-SEGMENT = OFFSET /16    ;note that the lower 4 bits are lost\r
-\r
-                 \r
-SEGMENT * 16    |0010010000010000----|  range (0 to 65535) * 16\r
- +                    \r
-OFFSET          |----0100100000100010|  range (0 to 65535)\r
- =\r
-20 bit address  |00101000100100100010|  range 0 to 1048575 (1 MEG)\r
-                 ÀÄÄÄÄÄ DS ÄÄÄÄÄÙ\r
-                     ÀÄÄÄÄÄ SI ÄÄÄÄÄÙ\r
-                     ÀÄ OverlapÄÙ\r
-\r
- This shows how DS:SI is used to construct a 20 bit address.\r
-\r
-Segment registers are: CS, DS, ES, SS. On the 386+ there are also FS & GS\r
-\r
-Offset registers  are: BX, DI, SI, BP, SP, IP.  In 386+ protected mode, ANY\r
-        general register (not a segment register) can be used as an Offset\r
-        register.  (Except IP, which you can't access.)\r
-\r
-    CS:IP => Points to the currently executing code.\r
-    SS:SP => Points to the current stack position.\r
-    \r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-\r
-    If you'll notice, the value in the SEGMENT register is multiplied by\r
-    16 (or shifted left 4 bits) and then added to the OFFSET register.\r
-    Together they create a 20 bit address.  Also Note that there are MANY\r
-    combinations of the SEGMENT and OFFSET registers that will produce the \r
-    same address.  The standard notation for a SEGment/OFFset pair is:\r
-\r
-ÄÄÄÄ\r
-SEGMENT:OFFSET or A000:0000 ( which is, of course in HEX )\r
-\r
-    Where SEGMENT = 0A000h and OFFSET = 00000h.  (This happens to be the \r
-    address of the upper left pixel on a 320x200x256 screen.)\r
-ÄÄÄÄ\r
-\r
-    You may be wondering what would happen if you were to have a segment\r
-    value of 0FFFFh and an offset value of 0FFFFh.  \r
-\r
-    Take notice: 0FFFFh * 16 (or 0FFFF0h ) + 0FFFFh = 1,114,095, which is \r
-      definately larger than 1 MEG (which is 1,048,576.)\r
-\r
-    This means that you can actually access MORE than 1 meg of memory!  \r
-    Well, to actually use that extra bit of memory, you would have to enable\r
-    something called the A20 line, which just enables the 21st bit for\r
-    addressing.  This little extra bit of memory is usually called\r
-    "HIGH MEMORY" and is used when you load something into high memory or\r
-    say DOS = HIGH in your AUTOEXEC.BAT file.  (HIMEM.SYS actually puts it up\r
-    there..)  You don't need to know that last bit, but hey, knowledge is \r
-    good, right?\r
-\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-    THE REGISTERS:\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-\r
-    I've mentioned AX, AL, and AH before, and you're probably wondering what\r
-    exactly they are.  Well, I'm gonna go through one by one and explain\r
-    what each register is and what it's most common uses are.  Here goes:\r
-\r
-ÄÄÄÄ\r
-AX (AH/AL): \r
-    AX is a 16 bit register which, as metioned before, is merely two bytes\r
-    attached together.  Well, for AX, BX, CX, & DX you can independantly \r
-    access each part of the 16 bit register through the 8bit (or byte sized)\r
-    registers.  For AX, they are AL and AH, which are the Low and High parts\r
-    of AX, respectivly.  It should be noted that any change to AL or AH, \r
-    will change AX.  Similairly any changes to AX may or may not change AL and\r
-    AH.  For instance:\r
-\r
-ÄÄÄÄÄÄÄÄ\r
-Let's suppose that AX = 00000h (AH and AL both = 0, too) \r
-\r
-    mov     AX,0\r
-    mov     AL,0\r
-    mov     AH,0\r
-\r
-Now we set AL = 0FFh.  \r
\r
-    mov     AL,0FFh\r
-\r
-:AX => 000FFh  ;I'm just showing ya what's in the registers\r
-:AL =>   0FFh\r
-:AH => 000h\r
-\r
-Now we increase AX by one:\r
-\r
-    INC     AX\r
-\r
-:AX => 00100h (= 256.. 255+1= 256)\r
-:AL =>   000h (Notice that the change to AX changed AL and AH)\r
-:AH => 001h\r
-\r
-Now we set AH = 0ABh (=171)\r
-\r
-    mov     AH,0ABh\r
-\r
-:AX => 0AB00h\r
-:AL =>   000h\r
-:AH => 0ABh\r
-\r
-Notice that the first example was just redundant...\r
-We could've set AX = 0 by just doing\r
-\r
-    mov     ax,0\r
-\r
-:AX => 00000h\r
-:AL =>   000h\r
-:AH => 000h\r
-\r
-I think ya got the idea...\r
-ÄÄÄÄÄÄÄÄ\r
-\r
-    SPECIAL USES OF AX:\r
-        Used as the destination of an IN (in port) \r
-            ex: IN  AL,DX\r
-                IN  AX,DX\r
-\r
-        Source for the output for an OUT           \r
-            ex: OUT DX,AL\r
-                OUT DX,AX\r
-\r
-        Destination for LODS (grabs byte/word from [DS:SI] and INCreses SI)\r
-            ex: lodsb   (same as:   mov al,[ds:si] ; inc si )\r
-                lodsw   (same as:   mov ax,[ds:si] ; inc si ; inc si )\r
-\r
-        Source for STOS      (puts AX/AL into [ES:DI] and INCreses DI)\r
-            ex: stosb   (same as:   mov [es:di],al ; inc di )\r
-                stosw   (same as:   mov [es:di],ax ; inc di ; inc di )\r
-\r
-        Used for MUL, IMUL, DIV, IDIV\r
-ÄÄÄÄ\r
-BX (BH/BL): same as AX (BH/BL)\r
-\r
-    SPECIAL USES:\r
-        As mentioned before, BX can be used as an OFFSET register.\r
-            ex: mov ax,[ds:bx]  (grabs the WORD at the address created by\r
-                                    DS and BX)\r
-\r
-CX (CH/CL): Same as AX\r
-    \r
-    SPECIAL USES:\r
-        Used in REP prefix to repeat an instruction CX number of times\r
-            ex: mov cx,10\r
-                mov ax,0\r
-                rep stosb ;this would write 10 zeros to [ES:DI] and increase\r
-                          ;DI by 10.\r
-        Used in LOOP\r
-            ex: mov cx,100\r
-            THELABEL:\r
-\r
-                ;do something that would print out 'HI'\r
-\r
-                loop THELABEL   ;this would print out 'HI' 100 times\r
-                                ;the loop is the same as: dec cx\r
-                                                          jne THELABAL\r
-            \r
-DX (DH/DL): Same as above\r
-    SPECIAL USES:\r
-        USED in word sized MUL, DIV, IMUL, IDIV as DEST for high word\r
-                or remainder\r
-\r
-            ex: mov bx,10\r
-                mov ax,5\r
-                mul bx  ;this multiplies BX by AX and puts the result \r
-                        ;in DX:AX\r
-\r
-            ex: (continue from above)\r
-                div bx  ;this divides DX:AX by BX and put the result in AX and\r
-                        ;the remainder (in this case zero) in DX\r
-\r
-        Used as address holder for IN's, and OUT's (see ax's examples)\r
-            \r
-INDEX REGISTERS:  \r
-\r
-    DI: Used as destination address holder for stos, movs (see ax's examples)\r
-        Also can be used as an OFFSET register\r
-\r
-    SI: Used as source address holder for lods, movs (see ax's examples)\r
-        Also can be used as OFFSET register\r
-\r
-        Example of MOVS:\r
-            movsb   ;moves whats at [DS:SI] into [ES:DI] and increases\r
-            movsw   ; DI and SI by one for movsb and 2 for movsw\r
-\r
-        NOTE: Up to here we have assumed that the DIRECTION flag was cleared.\r
-            If the direction flag was set, the DI & SI would be DECREASED \r
-            instead of INCREASED.\r
-            ex:     cld     ;clears direction flag\r
-                    std     ;sets direction flag\r
-\r
-STACK RELATED INDEX REGISTERS:\r
-    BP: Base Pointer. Can be used to access the stack. Default segment is\r
-        SS.  Can be used to access data in other segments throught the use\r
-        of a SEGMENT OVERRIDE.\r
-\r
-        ex: mov al,[ES:BP] ;moves a byte from segment ES, offset BP\r
-            Segment overrides are used to specify WHICH of the 4 (or 6 on the\r
-            386) segment registers to use.\r
-\r
-    SP: Stack Pointer. Does just that.  Segment overrides don't work on this \r
-        guy.  Points to the current position in the stack.  Don't alter unless\r
-        you REALLY know what you are doing.\r
-        \r
-SEGMENT REGISTERS:\r
-    DS: Data segment- all data read are from the segment pointed to be this\r
-        segment register unless a segment overide is used.\r
-        Used as source segment for movs, lods\r
-        This segment also can be thought of as the "Default Segment" because\r
-        if no segment override is present, DS is assumed to be the segmnet\r
-        you want to grab the data from.\r
-\r
-    ES: Extra Segment- this segment is used as the destination segment\r
-        for movs, stos\r
-        Can be used as just another segment...  You need to specify [ES:°°]\r
-        to use this segment.\r
-\r
-    FS: (386+) No particular reason for it's name... I mean, we have CS, DS,\r
-        and ES, why not make the next one FS? :)  Just another segment..\r
-    \r
-    GS: (386+) Same as FS\r
-\r
-    \r
-OTHERS THAT YOU SHOULDN'T OR CAN'T CHANGE:\r
-    CS: Segment that points to the next instruction- can't change directly\r
-    IP: Offset pointer to the next instruction- can't even access\r
-        The only was to change CS or IP would be through a JMP, CALL, or RET\r
-\r
-    SS: Stack segment- don't mess with it unless you know what you're\r
-        doing.  Changing this will probably crash the computer.  This is the\r
-        segment that the STACK resides in.\r
-\r
-ÄÄÄÄÄÄÄÄ\r
-Heck, as long as I've mentioned it, lets look at the STACK:\r
-\r
-    The STACK is an area of memory that has the properties of a STACK of\r
-    plates- the last one you put on is the first one take off.  The only\r
-    difference is that the stack of plates is on the roof.  (Ok, so that\r
-    can't really happen... unless gravity was shut down...)  Meaning that\r
-    as you put another plate (or piece of data) on the stack, the STACK grows\r
-    DOWNWARD.  Meaning that the stack pointer is DECREASED after each PUSH,\r
-    and INCREASED after each POP.\r
-\r
-  _____ Top of the allocated memory in the stack segment (SS)\r
-    þ \r
-    þ\r
-    þ\r
-    þ ® SP (the stack pointer points to the most recently pushed byte)\r
-\r
-    Truthfully, you don't need to know much more than a stack is Last In,\r
-    First Out (LIFO).\r
-\r
-  WRONG ex: push    cx  ;this swaps the contents of CX and AX\r
-            push    ax  ;of course, if you wanted to do this quicker, you'd\r
-            ...\r
-            pop     cx  ;just say XCHG cx,ax\r
-            pop     ax  ; but thats not my point.\r
-\r
-  RIGHT ex: push    cx  ;this correctly restores AX & CX  \r
-            push    ax\r
-            ...\r
-            pop     ax\r
-            pop     cx\r
-\r
-ÄÄÄÄÄÄÄÄÄÄÄÄ\r
-\r
-Now I'll do a quick run through on the assembler instructions that you MUST\r
-know:\r
-\r
-ÄÄÄÄ\r
-MOV:\r
-\r
-    Examples of different addressing modes: \r
-\r
-        MOV ax,5        ;moves and IMMEDIATE value into ax (think 'AX = 5')\r
-        MOV bx,cx       ;moves a register into another register\r
-        MOV cx,[SI]     ;moves [DS:SI] into cx (the Default Segment is Used)\r
-        MOV [DI+5],ax   ;moves ax into [DS:DI+5]\r
-        MOV [ES:DI+BX+34],al    ;same as above, but has a more complicated\r
-                                ;OFFSET (=DI+BX+34) and a SEGMENT OVERRIDE\r
-        MOV ax,[546]    ;moves whats at [DS:546] into AX\r
-                        \r
-    Note that the last example would be totally different if the brackets \r
-    were left out.  It would mean that an IMMEDIATE value of 546 is put into\r
-    AX, instead of what's at offset 546 in the Default Segment.\r
-    \r
-ANOTHER STANDARD NOTATION TO KNOW:\r
-    Whenever you see brackets [] around something, it means that it refers to \r
-    what is AT that offset.  For instance, say you had this situation:\r
-\r
-ÄÄÄÄÄÄÄÄÄÄÄÄ\r
-MyData  dw  55\r
-    ...\r
-    mov ax,MyData\r
-ÄÄÄÄÄÄÄÄÄÄÄÄ\r
-\r
-    What is that supposed to mean?  Is MyData an Immediate Value?  This is\r
-    confusing and for our purposes WRONG.  The 'Correct' way to do this would\r
-    be:\r
-\r
-ÄÄÄÄÄÄÄÄÄÄÄÄ\r
-MyData  dw  55\r
-    ...\r
-    mov ax,[MyData]\r
-ÄÄÄÄÄÄÄÄÄÄÄÄ\r
-\r
-    This is clearly moving what is AT the address of MyData, which would be\r
-    55, and not moving the OFFSET of MyData itself.  But what if you \r
-    actually wanted the OFFSET?  Well, you must specify directly.\r
-\r
-ÄÄÄÄÄÄÄÄÄÄÄÄ\r
-MyData  dw  55\r
-    ...\r
-    mov ax,OFFSET MyData\r
-ÄÄÄÄÄÄÄÄÄÄÄÄ\r
-\r
-    Similiarly, if you wanted the SEGMENT that MyData was in, you'd do this:\r
-\r
-ÄÄÄÄÄÄÄÄÄÄÄÄ\r
-MyData  dw  55\r
-    ...\r
-    mov ax,SEG MyData\r
-ÄÄÄÄÄÄÄÄÄÄÄÄ\r
-\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-INT:\r
-    Examples:\r
-        INT 21h     ;calls DOS standard interrupt # 21h\r
-        INT 10h     ;the Video BIOS interrupt..\r
-        \r
-    INT is used to call a subroutine that performs some function that you'd\r
-    rather not write yourself.  For instance, you would use a DOS interrupt \r
-    to OPEN a file.  You would similiarly use the Video BIOS interrupt to\r
-    set the screen mode, move the cursor, or to do any other function that \r
-    would be difficult to program.\r
-\r
-    Which subroutine the interrupt preforms is USUALLY specified by AH.\r
-    For instance, if you wanted to print a message to the screen you'd\r
-    use INT 21h, subfunction 9 by doing this:\r
-\r
-ÄÄÄÄÄÄÄÄÄÄÄÄ\r
-    mov ah,9\r
-    int 21h\r
-ÄÄÄÄÄÄÄÄÄÄÄÄ\r
-\r
-    Yes, it's that easy.  Of course, for that function to do anything, you\r
-    need to specify WHAT to print.  That function requires that you have\r
-    DS:DX be a FAR pointer that points to the string to display.  This string\r
-    must terminate with a dollar sign.  Here's an example:\r
-\r
-ÄÄÄÄÄÄÄÄÄÄÄÄ\r
-MyMessage db    "This is a message!$" \r
-    ...\r
-    mov     dx,OFFSET MyMessage\r
-    mov     ax,SEG MyMessage\r
-    mov     ds,ax\r
-    mov     ah,9\r
-    int     21h\r
-    ...\r
-ÄÄÄÄÄÄÄÄÄÄÄÄ\r
-\r
-    The DB, like the DW (and DD) merely declares the type of a piece of data.\r
-\r
-        DB => Declare Byte (I think of it as 'Data Byte')\r
-        DW => Declare Word\r
-        DD => Declare Dword\r
-    \r
-    Also, you may have noticed that I first put the segment value into AX\r
-    and then put it into DS.  I did that because the 80x86 does NOT allow\r
-    you to put an immediate value into a segment register.  You can, however,\r
-    pop stuff into a Segment register or mov an indexed value into the\r
-    segment register.  A few examples:\r
-\r
-ÄÄÄÄÄÄÄÄÄÄÄÄ\r
-  LEGAL:\r
-    mov     ax,SEG MyMessage\r
-    mov     ds,ax\r
-\r
-    push    SEG Message\r
-    pop     ds\r
-\r
-    mov     ds,[SegOfMyMessage]     \r
-            ;where [SegOfMyMessage] has already been loaded with \r
-            ; the SEGMENT that MyMessage resides in\r
-  ILLEGAL:\r
-    mov     ds,10\r
-    mov     ds,SEG MyMessage\r
-ÄÄÄÄÄÄÄÄÄÄÄÄ\r
-\r
-Well, that's about it for what you need to know to get started...\r
-\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-    And now the FRAME for an ASSEMBLER program.\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-\r
-The Basic Frame for an Assembler program using Turbo Assembler simplified\r
-    directives is:\r
-\r
-;===========-\r
-\r
-    DOSSEG  ;This arranges the segments in order according DOS standards\r
-            ;CODE, DATA, STACK\r
-    .MODEL SMALL    ;dont worry about this yet\r
-    .STACK  200h    ;tells the compiler to put in a 200h byte stack\r
-    .CODE           ;starts code segment\r
-\r
-    ASSUME  CS:@CODE, DS:@CODE \r
-\r
-START:      ;generally a good name to use as an entry point\r
-\r
-    mov     ax,4c00h\r
-    int     21h\r
-\r
-END START\r
-\r
-;===========- By the way, a semicolon means the start of a comment.\r
-\r
-    If you were to enter this program and TASM & TLINK it, it would execute\r
-    perfectly.  It will do absolutly nothing, but it will do it well.\r
-\r
-    What it does:\r
-        Upon execution, it will jump to START. move 4c00h into AX,\r
-        and call the DOS interrupt, which exits back to DOS.\r
-\r
-        Outout seen: NONE\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-\r
-That's nice, eh?  If you've understood the majority of what was presented \r
-in this document, you are ready to start programming!\r
-\r
-See ASM0.TXT and ASM0.ASM to continue this wonderful assembler stuff...\r
-\r
-\r
-Written By Draeden/VLA\r
-\r
diff --git a/16/PCGPE10/ATI.TXT b/16/PCGPE10/ATI.TXT
deleted file mode 100644 (file)
index 6fd299a..0000000
+++ /dev/null
@@ -1,158 +0,0 @@
-\r
-             ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-             ³ Programming the ATI Technologies SVGA Chip ³\r
-             ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-                 Written for the PC-GPE by Mark Feldman\r
-            e-mail address : u914097@student.canberra.edu.au\r
-                             myndale@cairo.anu.edu.au\r
-\r
-                  Please read the file SVGINTRO.TXT\r
-              (Graphics/SVGA/Intro PC-GPE menu option)\r
-\r
-             ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-             ³      THIS FILE MAY NOT BE DISTRIBUTED     ³\r
-             ³ SEPARATE TO THE ENTIRE PC-GPE COLLECTION. ³\r
-             ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Disclaimer ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-I assume no responsibility whatsoever for any effect that this file, the\r
-information contained therein or the use thereof has on you, your sanity,\r
-computer, spouse, children, pets or anything else related to you or your\r
-existance. No warranty is provided nor implied with this information.\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Locating the Extended Register Set ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-The ATI extended register set is based on the vga's index register scheme,\r
-ie you write the value of the register you want to modify to Index Register\r
-Port and write the actual data to the Data Port (the Data Port is one port\r
-number higher than the Index Register Port). The value of the Index Register\r
-for the ATI extended register set is stored in a word in BIOS ROM at\r
-C000:0010. Apparently ATI want to change the value of this register in\r
-future so they recommend you obtain it by reading the value at this memory\r
-address.\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Identifying the ATI Chip ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-The ATI chip can be identified by checking the string in memory locations\r
-C000:0031-003A for the following characters : 761295520\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Identifying which ATI Chip ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-The first version of the ATI chip is the 18800. The second version is the\r
-28800, which from a programming perspective is identical to the 18800-2.\r
-The 18800 can be identified by it's lack of support for display mode\r
-55h.\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Determining the ATI Chip Revision Number ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-The ATI chip revision number is stored at BIOS location C000:0043.\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ ATI Graphics Display Modes ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-             ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-             ³ Mode    Resolution   Colors          Chip     ³\r
-             ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´\r
-             ³  53h     800x600      16              18800   ³\r
-             ³  54h     800x600      16              18800   ³\r
-             ³  55h     1024x768     16 (planar)     18800-1 ³\r
-             ³  61h     640x400      256             18800   ³\r
-             ³  62h     640x480      256             18800   ³\r
-             ³  63h     800x600      256             18800   ³\r
-             ³  65h     1024x768     256 (packed)    18800   ³\r
-             ³  67h     1024x768     4               ?       ³\r
-             ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ ATI Display Memory ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-In the following examples the EXT variable is the extended register index\r
-value obtained from reading the word at C000:0010.\r
-\r
-The ATI supports both single and duel bank memory mapping. It supports 64K\r
-byte pages, each of these can be mapped into the host address space.\r
-\r
-\r
-\r
-Single or duel bank mode is selected by the E2B bit in register BE\r
-\r
-          Index : BEh at port EXT\r
-          Read/Write at port EXT + 1\r
-          ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿\r
-          ³ 7 ³ 6 ³ 5 ³ 4 ³ 3 ³ 2 ³ 1 ³ 0 ³\r
-          ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÙ\r
-                            ³\r
-                            ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄ E2B 0 = Single Bank Mode\r
-                                                1 = Duel Bank Mode\r
-\r
-Selecting a bank to write to in single bank mode is done by writing the bank\r
-number to the Bank Select Register :\r
-\r
-          Index : B2h\r
-          ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿\r
-          ³ 7 ³ 6 ³ 5 ³ 4 ³ 3 ³ 2 ³ 1 ³ 0 ³\r
-          ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÙ\r
-                        ÀÄÄÄÄÄÂÄÄÄÄÄÙ\r
-                         Bank number\r
-\r
-The following procedure will select a bank in single bank mode :\r
-\r
-Port[EXT] := $B2;\r
-Port[EXT + 1] := (Port[EXT + 1] And $E1) Or (bank_number shl 1);\r
-\r
-where bank_number = 0 - 15. Each bank is 64K long and has a 64K\r
-granularity.\r
-\r
-Duel Bank Mode is only supported on the 18800-1 and 28800 chips. You can\r
-map one bank to A000:0000-FFFF for read operations and another to the\r
-same address space for write operations.\r
-\r
-          Index : B2h\r
-          ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿\r
-          ³ 7 ³ 6 ³ 5 ³ 4 ³ 3 ³ 2 ³ 1 ³ 0 ³\r
-          ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÙ\r
-            ÀÄÄÄÂÄÄÄÙ       ÀÄÄÄÂÄÄÄÙ\r
-              Read            Write\r
-              Bank            Bank\r
-              Number          Number\r
-\r
-The following code will set the write bank number:\r
-\r
-Port[EXT] := $B2;\r
-Port[EXT + 1] := (Port[EXT + 1] And $F0) Or (write_bank_number shl 1);\r
-\r
-The following code will set the read bank number:\r
-\r
-Port[EXT] := $B2;\r
-Port[EXT + 1] := (Port[EXT + 1] And $0F) Or (read_bank_number shl 5);\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ ATI IsModeAvailable BIOS Call ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-Int 10h\r
-Inputs :\r
-    AH = 12h            Extended VGA Control\r
-    BX = 5506h          Get Mode Information\r
-    BP = FFFF           Set up for Return Argument\r
-    AL = Mode Number    Mode number you want to test\r
-\r
-Returns:\r
-BP = FFFFh Mode not supported\r
-     Anything else : mode is supported, BP = offset into CRTC table for mode\r
-\r
diff --git a/16/PCGPE10/BLASTERS.EXE b/16/PCGPE10/BLASTERS.EXE
deleted file mode 100644 (file)
index 0552d3c..0000000
Binary files a/16/PCGPE10/BLASTERS.EXE and /dev/null differ
diff --git a/16/PCGPE10/BL担TER b/16/PCGPE10/BL担TER
deleted file mode 100644 (file)
index 152f4e2..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-  ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ    \r
-                  ÖÄ· ·      ·        ÖÄÄ·           ·\r
-                  ÇÄзºÖÄ·ÖÄ·ÇÄ ÖÄ·ÒÄ·ÓÄÄ·ÖÄ·· ·ÒÄ·ÖĶ\r
-                  º  ººÖĶÓÄ·º  ÇĽº     ºº ºº ºº ºº º\r
-                  ÓÄĽÐÓÄÐÓĽÓĽÓĽР ÓÄĽÓĽÓÄÐРÐÓĽ\r
-                             ÖÄ· ÖÄ· ÖÄÄ·\r
-                             ÇÄзÇÄзÓÄÄ·\r
-                             º  ºº  º   º\r
-  SysOp: Mikel               ÓÄĽÓÄĽÓÄĽþ   Phone/Fax: + 34-58-293583\r
-  ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ\r
-      Sound Blaster Connection 14:4500/200 & 201 HUB Granada (Spain)\r
-         Creativity Demo Net 94:620/200 & 201 HUB Granada (Spain)\r
-            SoundNet Espa¤a 34:1000/10 & 34:1000/100 RC (Spain)\r
-              SkyNEt 94:345/200&94:345/201 HUB Granada (Spain)\r
-                       FidoNet Organization  2:345/805 \r
-                     Authorized Product Support Node for\r
-                                         A d v a n c e d\r
-                   ÜÜÜÜ  ÜÜÜÜÜ    ÜÜÜÜ  ÜÜ    ÜÜ Ü  ÜÜÜÜÜ\r
-                  Þ  ÜÜ  Þ    Ý  ÞÛ  ÛÝ ÞÛ    ÛÝ Û ÞÜÜÜÜÜ\r
-                  Þ    Ý ÞßßÛß  ÞÛ    ÛÝ ÞÛ  ÛÝ  Û       Ý\r
-                   ßßßß  ß   ß  ß      ß  ßßßß   ß  ßßßßß\r
-                   Advanced Gravis Computer Technology Ltd.\r
-                         *IGUANA WorLd HeadQuarTers_\r
-\r
-                   THE LORDS OF THE BITS World HeadQuarters\r
-                        Distribution Site VangeliSTeam\r
-                          Distribution Site RESET-TVC.\r
-       =-= DUST HQ Spain =-= Xography HQ Spain =-= Infiny HQ Spain =-= \r
-                          /// Hemoroids HQ Spain \\\\r
-                 Software: FrontDoor 2.02 - Remote Access 2.01\r
-           Hardware: 386/33 64Kb /\ 1 Gb On-Line /\ Modem ZyXEL 19k2\r
-                   CD-ROM  Philips  Electronics  /-> 375 ms.\r
-\r
-\1a
\ No newline at end of file
diff --git a/16/PCGPE10/BMP.TXT b/16/PCGPE10/BMP.TXT
deleted file mode 100644 (file)
index 9124091..0000000
+++ /dev/null
@@ -1,1034 +0,0 @@
-Graphics File Formats\r
-\r
-This topic describes the graphics-file formats used by the Microsoft Windows\r
-operating system. Graphics files include bitmap files, icon-resource files,\r
-and cursor-resource files.\r
-\r
-Bitmap-File Formats\r
-\r
-Windows bitmap files are stored in a device-independent bitmap (DIB) format\r
-that allows Windows to display the bitmap on any type of display device. The\r
-term "device independent" means that the bitmap specifies pixel color in a\r
-form independent of the method used by a display to represent color. The\r
-default filename extension of a Windows DIB file is .BMP.\r
-\r
-Bitmap-File Structures\r
-\r
-Each bitmap file contains a bitmap-file header, a bitmap-information header,\r
-a color table, and an array of bytes that defines the bitmap bits. The file\r
-has the following form:\r
-\r
-BITMAPFILEHEADER bmfh;\r
-BITMAPINFOHEADER bmih;\r
-RGBQUAD          aColors[];\r
-BYTE             aBitmapBits[];\r
-\r
-The bitmap-file header contains information about the type, size, and layout\r
-of a device-independent bitmap file. The header is defined as a\r
-BITMAPFILEHEADER structure.\r
-\r
-The bitmap-information header, defined as a BITMAPINFOHEADER structure,\r
-specifies the dimensions, compression type, and color format for the bitmap.\r
-\r
-The color table, defined as an array of RGBQUAD structures, contains as many\r
-elements as there are colors in the bitmap. The color table is not present\r
-for bitmaps with 24 color bits because each pixel is represented by 24-bit\r
-red-green-blue (RGB) values in the actual bitmap data area. The colors in the\r
-table should appear in order of importance. This helps a display driver\r
-render a bitmap on a device that cannot display as many colors as there are\r
-in the bitmap. If the DIB is in Windows version 3.0 or later format, the\r
-driver can use the biClrImportant member of the BITMAPINFOHEADER structure to\r
-determine which colors are important.\r
-\r
-The BITMAPINFO structure can be used to represent a combined\r
-bitmap-information header and color table.  The bitmap bits, immediately\r
-following the color table, consist of an array of BYTE values representing\r
-consecutive rows, or "scan lines," of the bitmap. Each scan line consists of\r
-consecutive bytes representing the pixels in the scan line, in left-to-right\r
-order. The number of bytes representing a scan line depends on the color\r
-format and the width, in pixels, of the bitmap. If necessary, a scan line\r
-must be zero-padded to end on a 32-bit boundary. However, segment boundaries\r
-can appear anywhere in the bitmap. The scan lines in the bitmap are stored\r
-from bottom up. This means that the first byte in the array represents the\r
-pixels in the lower-left corner of the bitmap and the last byte represents\r
-the pixels in the upper-right corner.\r
-\r
-The biBitCount member of the BITMAPINFOHEADER structure determines the number\r
-of bits that define each pixel and the maximum number of colors in the\r
-bitmap. These members can have any of the following values:\r
-\r
-Value   Meaning\r
-\r
-1       Bitmap is monochrome and the color table contains two entries. Each\r
-bit in the bitmap array represents a pixel. If the bit is clear, the pixel is\r
-displayed with the color of the first entry in the color table. If the bit is\r
-set, the pixel has the color of the second entry in the table.\r
-\r
-4       Bitmap has a maximum of 16 colors. Each pixel in the bitmap is\r
-represented by a 4-bit index into the color table. For example, if the first\r
-byte in the bitmap is 0x1F, the byte represents two pixels. The first pixel\r
-contains the color in the second table entry, and the second pixel contains\r
-the color in the sixteenth table entry.\r
-\r
-8       Bitmap has a maximum of 256 colors. Each pixel in the bitmap is\r
-represented by a 1-byte index into the color table. For example, if the first\r
-byte in the bitmap is 0x1F, the first pixel has the color of the\r
-thirty-second table entry.\r
-\r
-24      Bitmap has a maximum of 2^24 colors. The bmiColors (or bmciColors)\r
-member is NULL, and each 3-byte sequence in the bitmap array represents the\r
-relative intensities of red, green, and blue, respectively, for a pixel.\r
-\r
-The biClrUsed member of the BITMAPINFOHEADER structure specifies the number\r
-of color indexes in the color table actually used by the bitmap. If the\r
-biClrUsed member is set to zero, the bitmap uses the maximum number of colors\r
-corresponding to the value of the biBitCount member.  An alternative form of\r
-bitmap file uses the BITMAPCOREINFO, BITMAPCOREHEADER, and RGBTRIPLE\r
-structures.\r
-\r
-Bitmap Compression\r
-\r
-Windows versions 3.0 and later support run-length encoded (RLE) formats for\r
-compressing bitmaps that use 4 bits per pixel and 8 bits per pixel.\r
-Compression reduces the disk and memory storage required for a bitmap.\r
-\r
-Compression of 8-Bits-per-Pixel Bitmaps\r
-\r
-When the biCompression member of the BITMAPINFOHEADER structure is set to\r
-BI_RLE8, the DIB is compressed using a run-length encoded format for a\r
-256-color bitmap. This format uses two modes: encoded mode and absolute mode.\r
-Both modes can occur anywhere throughout a single bitmap.\r
-\r
-Encoded Mode\r
-\r
-A unit of information in encoded mode consists of two bytes. The first byte\r
-specifies the number of consecutive pixels to be drawn using the color index\r
-contained in the second byte.  The first byte of the pair can be set to zero\r
-to indicate an escape that denotes the end of a line, the end of the bitmap,\r
-or a delta. The interpretation of the escape depends on the value of the\r
-second byte of the pair, which must be in the range 0x00 through 0x02.\r
-Following are the meanings of the escape values that can be used in the\r
-second byte:\r
-\r
-Second byte     Meaning\r
-\r
-0       End of line. \r
-1       End of bitmap. \r
-2       Delta. The two bytes following the escape contain unsigned values\r
-indicating the horizontal and vertical offsets of the next pixel from the\r
-current position.\r
-\r
-Absolute Mode\r
-\r
-Absolute mode is signaled by the first byte in the pair being set to zero and\r
-the second byte to a value between 0x03 and 0xFF. The second byte represents\r
-the number of bytes that follow, each of which contains the color index of a\r
-single pixel. Each run must be aligned on a word boundary.  Following is an\r
-example of an 8-bit RLE bitmap (the two-digit hexadecimal values in the\r
-second column represent a color index for a single pixel):\r
-\r
-Compressed data         Expanded data\r
-\r
-03 04                   04 04 04 \r
-05 06                   06 06 06 06 06 \r
-00 03 45 56 67 00       45 56 67 \r
-02 78                   78 78 \r
-00 02 05 01             Move 5 right and 1 down \r
-02 78                   78 78 \r
-00 00                   End of line \r
-09 1E                   1E 1E 1E 1E 1E 1E 1E 1E 1E \r
-00 01                   End of RLE bitmap \r
-\r
-Compression of 4-Bits-per-Pixel Bitmaps\r
-\r
-When the biCompression member of the BITMAPINFOHEADER structure is set to\r
-BI_RLE4, the DIB is compressed using a run-length encoded format for a\r
-16-color bitmap. This format uses two modes: encoded mode and absolute mode.\r
-\r
-Encoded Mode\r
-\r
-A unit of information in encoded mode consists of two bytes. The first byte\r
-of the pair contains the number of pixels to be drawn using the color indexes\r
-in the second byte.\r
-\r
-The second byte contains two color indexes, one in its high-order nibble\r
-(that is, its low-order 4 bits) and one in its low-order nibble.\r
-\r
-The first pixel is drawn using the color specified by the high-order nibble,\r
-the second is drawn using the color in the low-order nibble, the third is\r
-drawn with the color in the high-order nibble, and so on, until all the\r
-pixels specified by the first byte have been drawn.\r
-\r
-The first byte of the pair can be set to zero to indicate an escape that\r
-denotes the end of a line, the end of the bitmap, or a delta. The\r
-interpretation of the escape depends on the value of the second byte of the\r
-pair. In encoded mode, the second byte has a value in the range 0x00 through\r
-0x02. The meaning of these values is the same as for a DIB with 8 bits per\r
-pixel.\r
-\r
-Absolute Mode\r
-\r
-In absolute mode, the first byte contains zero, the second byte contains the\r
-number of color indexes that follow, and subsequent bytes contain color\r
-indexes in their high- and low-order nibbles, one color index for each pixel.\r
-Each run must be aligned on a word boundary.\r
-\r
-Following is an example of a 4-bit RLE bitmap (the one-digit hexadecimal\r
-values in the second column represent a color index for a single pixel):\r
-\r
-Compressed data         Expanded data\r
-\r
-03 04                   0 4 0\r
-05 06                   0 6 0 6 0 \r
-00 06 45 56 67 00       4 5 5 6 6 7 \r
-04 78                   7 8 7 8 \r
-00 02 05 01             Move 5 right and 1 down \r
-04 78                   7 8 7 8 \r
-00 00                   End of line \r
-09 1E                   1 E 1 E 1 E 1 E 1 \r
-00 01                   End of RLE bitmap \r
-\r
-Bitmap Example\r
-\r
-The following example is a text dump of a 16-color bitmap (4 bits per pixel):\r
-\r
-Win3DIBFile\r
-              BitmapFileHeader\r
-                  Type       19778\r
-                  Size       3118\r
-                  Reserved1  0\r
-                  Reserved2  0\r
-                  OffsetBits 118\r
-              BitmapInfoHeader\r
-                  Size            40\r
-                  Width           80\r
-                  Height          75\r
-                  Planes          1\r
-                  BitCount        4\r
-                  Compression     0\r
-                  SizeImage       3000\r
-\r
-                  XPelsPerMeter   0\r
-                  YPelsPerMeter   0\r
-                  ColorsUsed      16\r
-                  ColorsImportant 16\r
-              Win3ColorTable\r
-                  Blue  Green  Red  Unused\r
-[00000000]        84    252    84   0\r
-[00000001]        252   252    84   0\r
-[00000002]        84    84     252  0\r
-[00000003]        252   84     252  0\r
-[00000004]        84    252    252  0\r
-[00000005]        252   252    252  0\r
-[00000006]        0     0      0    0\r
-[00000007]        168   0      0    0\r
-[00000008]        0     168    0    0\r
-[00000009]        168   168    0    0\r
-[0000000A]        0     0      168  0\r
-[0000000B]        168   0      168  0\r
-[0000000C]        0     168    168  0\r
-[0000000D]        168   168    168  0\r
-[0000000E]        84    84     84   0\r
-[0000000F]        252   84     84   0\r
-              Image\r
-    .\r
-    .                                           Bitmap data\r
-    .\r
-\r
-Icon-Resource File Format\r
-\r
-An icon-resource file contains image data for icons used by Windows\r
-applications. The file consists of an icon directory identifying the number\r
-and types of icon images in the file, plus one or more icon images. The\r
-default filename extension for an icon-resource file is .ICO.\r
-\r
-Icon Directory\r
-\r
-Each icon-resource file starts with an icon directory. The icon directory,\r
-defined as an ICONDIR structure, specifies the number of icons in the\r
-resource and the dimensions and color format of each icon image. The ICONDIR\r
-structure has the following form:\r
-\r
-\r
-\r
-typedef struct ICONDIR {\r
-    WORD          idReserved;\r
-    WORD          idType;\r
-    WORD          idCount;\r
-    ICONDIRENTRY  idEntries[1];\r
-} ICONHEADER;\r
-\r
-Following are the members in the ICONDIR structure:\r
-\r
-idReserved      Reserved; must be zero. \r
-idType          Specifies the resource type. This member is set to 1. \r
-idCount         Specifies the number of entries in the directory. \r
-idEntries       Specifies an array of ICONDIRENTRY structures containing\r
-information about individual icons. The idCount member specifies the number\r
-of structures in the array.\r
-\r
-The ICONDIRENTRY structure specifies the dimensions and color format for an\r
-icon. The structure has the following form:\r
-\r
-\r
-\r
-struct IconDirectoryEntry {\r
-    BYTE  bWidth;\r
-    BYTE  bHeight;\r
-    BYTE  bColorCount;\r
-    BYTE  bReserved;\r
-    WORD  wPlanes;\r
-    WORD  wBitCount;\r
-    DWORD dwBytesInRes;\r
-    DWORD dwImageOffset;\r
-};\r
-\r
-Following are the members in the ICONDIRENTRY structure: \r
-\r
-bWidth          Specifies the width of the icon, in pixels. Acceptable values\r
-are 16, 32, and 64.\r
-\r
-bHeight         Specifies the height of the icon, in pixels. Acceptable\r
-values are 16, 32, and 64.\r
-\r
-bColorCount     Specifies the number of colors in the icon. Acceptable values\r
-are 2, 8, and 16.\r
-\r
-bReserved       Reserved; must be zero. \r
-wPlanes         Specifies the number of color planes in the icon bitmap. \r
-wBitCount       Specifies the number of bits in the icon bitmap. \r
-dwBytesInRes    Specifies the size of the resource, in bytes. \r
-dwImageOffset   Specifies the offset, in bytes, from the beginning of the\r
-file to the icon image.\r
-\r
-Icon Image\r
-\r
-Each icon-resource file contains one icon image for each image identified in\r
-the icon directory. An icon image consists of an icon-image header, a color\r
-table, an XOR mask, and an AND mask. The icon image has the following form:\r
-\r
-\r
-\r
-BITMAPINFOHEADER    icHeader;\r
-RGBQUAD             icColors[];\r
-BYTE                icXOR[];\r
-BYTE                icAND[];\r
-\r
-The icon-image header, defined as a BITMAPINFOHEADER structure, specifies the\r
-dimensions and color format of the icon bitmap. Only the biSize through\r
-biBitCount members and the biSizeImage member are used. All other members\r
-(such as biCompression and biClrImportant) must be set to zero.\r
-\r
-The color table, defined as an array of RGBQUAD structures, specifies the\r
-colors used in the XOR mask. As with the color table in a bitmap file, the\r
-biBitCount member in the icon-image header determines the number of elements\r
-in the array. For more information about the color table, see Section 1.1,\r
-"Bitmap-File Formats."\r
-\r
-The XOR mask, immediately following the color table, is an array of BYTE\r
-values representing consecutive rows of a bitmap. The bitmap defines the\r
-basic shape and color of the icon image. As with the bitmap bits in a bitmap\r
-file, the bitmap data in an icon-resource file is organized in scan lines,\r
-with each byte representing one or more pixels, as defined by the color\r
-format. For more information about these bitmap bits, see Section 1.1,\r
-"Bitmap-File Formats."\r
-\r
-The AND mask, immediately following the XOR mask, is an array of BYTE values,\r
-representing a monochrome bitmap with the same width and height as the XOR\r
-mask. The array is organized in scan lines, with each byte representing 8\r
-pixels.\r
-\r
-When Windows draws an icon, it uses the AND and XOR masks to combine the icon\r
-image with the pixels already on the display surface. Windows first applies\r
-the AND mask by using a bitwise AND operation; this preserves or removes\r
-existing pixel color.  Windows then applies the XOR mask by using a bitwise\r
-XOR operation. This sets the final color for each pixel.\r
-\r
-The following illustration shows the XOR and AND masks that create a\r
-monochrome icon (measuring 8 pixels by 8 pixels) in the form of an uppercase\r
-K:\r
-\r
-Windows Icon Selection\r
-\r
-Windows detects the resolution of the current display and matches it against\r
-the width and height specified for each version of the icon image. If Windows\r
-determines that there is an exact match between an icon image and the current\r
-device, it uses the matching image. Otherwise, it selects the closest match\r
-and stretches the image to the proper size.\r
-\r
-If an icon-resource file contains more than one image for a particular\r
-resolution, Windows uses the icon image that most closely matches the color\r
-capabilities of the current display. If no image matches the device\r
-capabilities exactly, Windows selects the image that has the greatest number\r
-of colors without exceeding the number of display colors. If all images\r
-exceed the color capabilities of the current display, Windows uses the icon\r
-image with the least number of colors.\r
-\r
-\r
-\r
-Cursor-Resource File Format\r
-\r
-A cursor-resource file contains image data for cursors used by Windows\r
-applications. The file consists of a cursor directory identifying the number\r
-and types of cursor images in the file, plus one or more cursor images. The\r
-default filename extension for a cursor-resource file is .CUR.\r
-\r
-Cursor Directory\r
-\r
-Each cursor-resource file starts with a cursor directory. The cursor\r
-directory, defined as a CURSORDIR structure, specifies the number of cursors\r
-in the file and the dimensions and color format of each cursor image. The\r
-CURSORDIR structure has the following form:\r
-\r
-\r
-typedef struct _CURSORDIR {\r
-    WORD           cdReserved;\r
-    WORD           cdType;\r
-    WORD           cdCount;\r
-    CURSORDIRENTRY cdEntries[];\r
-} CURSORDIR;\r
-\r
-Following are the members in the CURSORDIR structure: \r
-\r
-cdReserved      Reserved; must be zero. \r
-cdType          Specifies the resource type. This member must be set to 2. \r
-cdCount         Specifies the number of cursors in the file. \r
-cdEntries       Specifies an array of CURSORDIRENTRY structures containing\r
-information about individual cursors. The cdCount member specifies the number\r
-of structures in the array.\r
-\r
-A CURSORDIRENTRY structure specifies the dimensions and color format of a\r
-cursor image. The structure has the following form:\r
-\r
-\r
-\r
-typedef struct _CURSORDIRENTRY {\r
-    BYTE  bWidth;\r
-    BYTE  bHeight;\r
-    BYTE  bColorCount;\r
-    BYTE  bReserved;\r
-    WORD  wXHotspot;\r
-    WORD  wYHotspot;\r
-    DWORD lBytesInRes;\r
-    DWORD dwImageOffset;\r
-} CURSORDIRENTRY;\r
-\r
-Following are the members in the CURSORDIRENTRY structure: \r
-\r
-bWidth          Specifies the width of the cursor, in pixels. \r
-bHeight         Specifies the height of the cursor, in pixels. \r
-bColorCount     Reserved; must be zero. \r
-bReserved       Reserved; must be zero.\r
-wXHotspot       Specifies the x-coordinate, in pixels, of the hot spot. \r
-wYHotspot       Specifies the y-coordinate, in pixels, of the hot spot. \r
-lBytesInRes     Specifies the size of the resource, in bytes. \r
-dwImageOffset   Specifies the offset, in bytes, from the start of the file to\r
-the cursor image.\r
-\r
-Cursor Image\r
-\r
-Each cursor-resource file contains one cursor image for each image identified\r
-in the cursor directory. A cursor image consists of a cursor-image header, a\r
-color table, an XOR mask, and an AND mask. The cursor image has the following\r
-form:\r
-\r
-\r
-\r
-BITMAPINFOHEADER    crHeader;\r
-RGBQUAD             crColors[];\r
-BYTE                crXOR[];\r
-BYTE                crAND[];\r
-\r
-The cursor hot spot is a single pixel in the cursor bitmap that Windows uses\r
-to track the cursor. The crXHotspot and crYHotspot members specify the x- and\r
-y-coordinates of the cursor hot spot. These coordinates are 16-bit integers.\r
-\r
-The cursor-image header, defined as a BITMAPINFOHEADER structure, specifies\r
-the dimensions and color format of the cursor bitmap. Only the biSize through\r
-biBitCount members and the biSizeImage member are used. The biHeight member\r
-specifies the combined height of the XOR and AND masks for the cursor. This\r
-value is twice the height of the XOR mask. The biPlanes and biBitCount\r
-members must be 1. All other members (such as biCompression and\r
-biClrImportant) must be set to zero.\r
-\r
-The color table, defined as an array of RGBQUAD structures, specifies the\r
-colors used in the XOR mask. For a cursor image, the table contains exactly\r
-two structures, since the biBitCount member in the cursor-image header is\r
-always 1.\r
-\r
-The XOR mask, immediately following the color table, is an array of BYTE\r
-values representing consecutive rows of a bitmap. The bitmap defines the\r
-basic shape and color of the cursor image. As with the bitmap bits in a\r
-bitmap file, the bitmap data in a cursor-resource file is organized in scan\r
-lines, with each byte representing one or more pixels, as defined by the\r
-color format. For more information about these bitmap bits, see Section 1.1,\r
-"Bitmap-File Formats."\r
-\r
-The AND mask, immediately following the XOR mask, is an array of BYTE values\r
-representing a monochrome bitmap with the same width and height as the XOR\r
-mask. The array is organized in scan lines, with each byte representing 8\r
-pixels.\r
-\r
-When Windows draws a cursor, it uses the AND and XOR masks to combine the\r
-cursor image with the pixels already on the display surface. Windows first\r
-applies the AND mask by using a bitwise AND operation; this preserves or\r
-removes existing pixel color.  Window then applies the XOR mask by using a\r
-bitwise XOR operation. This sets the final color for each pixel.\r
-\r
-The following illustration shows the XOR and the AND masks that create a\r
-cursor (measuring 8 pixels by 8 pixels) in the form of an arrow:\r
-\r
-Following are the bit-mask values necessary to produce black, white,\r
-inverted, and transparent results:\r
-\r
-Pixel result    AND maskXOR mask\r
-\r
-Black           0               0 \r
-White           0               1 \r
-Transparent     1               0 \r
-Inverted1               1 \r
-\r
-Windows Cursor Selection\r
-\r
-If a cursor-resource file contains more than one cursor image, Windows\r
-determines the best match for a particular display by examining the width and\r
-height of the cursor images.\r
-\r
-\r
-==============================================================================\r
-\r
-\r
-BITMAPFILEHEADER (3.0)\r
-\r
-\r
-\r
-typedef struct tagBITMAPFILEHEADER {    /* bmfh */\r
-    UINT    bfType;\r
-    DWORD   bfSize;\r
-    UINT    bfReserved1;\r
-    UINT    bfReserved2;\r
-    DWORD   bfOffBits;\r
-} BITMAPFILEHEADER;\r
-\r
-The BITMAPFILEHEADER structure contains information about the type, size, and\r
-layout of a device-independent bitmap (DIB) file.\r
-\r
-Member          Description\r
-\r
-bfType          Specifies the type of file. This member must be BM. \r
-bfSize          Specifies the size of the file, in bytes. \r
-bfReserved1     Reserved; must be set to zero. \r
-bfReserved2     Reserved; must be set to zero.\r
-bfOffBits       Specifies the byte offset from the BITMAPFILEHEADER structure\r
-to the actual bitmap data in the file.\r
-\r
-Comments\r
-\r
-A BITMAPINFO or BITMAPCOREINFO structure immediately follows the\r
-BITMAPFILEHEADER structure in the DIB file.\r
-\r
-See Also\r
-\r
-BITMAPCOREINFO, BITMAPINFO \r
-\r
-\r
-==============================================================================\r
-BITMAPINFO (3.0)\r
-\r
-\r
-\r
-typedef struct tagBITMAPINFO {  /* bmi */\r
-    BITMAPINFOHEADER    bmiHeader;\r
-    RGBQUAD             bmiColors[1];\r
-} BITMAPINFO;\r
-\r
-The BITMAPINFO structure fully defines the dimensions and color information\r
-for a Windows 3.0 or later device-independent bitmap (DIB).\r
-\r
-Member          Description\r
-\r
-bmiHeader       Specifies a BITMAPINFOHEADER structure that contains\r
-information about the dimensions and color format of a DIB.\r
-\r
-bmiColors       Specifies an array of RGBQUAD structures that define the\r
-colors in the bitmap.\r
-\r
-Comments\r
-\r
-A Windows 3.0 or later DIB consists of two distinct parts: a BITMAPINFO\r
-structure, which describes the dimensions and colors of the bitmap, and an\r
-array of bytes defining the pixels of the bitmap. The bits in the array are\r
-packed together, but each scan line must be zero-padded to end on a LONG\r
-boundary. Segment boundaries, however, can appear anywhere in the bitmap. The\r
-origin of the bitmap is the lower-left corner.\r
-\r
-The biBitCount member of the BITMAPINFOHEADER structure determines the number\r
-of bits which define each pixel and the maximum number of colors in the\r
-bitmap. This member may be set to any of the following values:\r
-\r
-Value   Meaning\r
-\r
-1       The bitmap is monochrome, and the bmciColors member must contain two\r
-entries. Each bit in the bitmap array represents a pixel. If the bit is\r
-clear, the pixel is displayed with the color of the first entry in the\r
-bmciColors table. If the bit is set, the pixel has the color of the second\r
-entry in the table.\r
-\r
-4       The bitmap has a maximum of 16 colors, and the bmciColors member\r
-contains 16 entries. Each pixel in the bitmap is represented by a four-bit\r
-index into the color table.\r
-\r
-For example, if the first byte in the bitmap is 0x1F, the byte represents two\r
-pixels. The first pixel contains the color in the second table entry, and the\r
-second pixel contains the color in the sixteenth table entry.\r
-\r
-8       The bitmap has a maximum of 256 colors, and the bmciColors member\r
-contains 256 entries. In this case, each byte in the array represents a\r
-single pixel.\r
-\r
-24      The bitmap has a maximum of 2^24 colors. The bmciColors member is\r
-NULL, and each 3-byte sequence in the bitmap array represents the relative\r
-intensities of red, green, and blue, respectively, of a pixel.\r
-\r
-The biClrUsed member of the BITMAPINFOHEADER structure specifies the number\r
-of color indexes in the color table actually used by the bitmap. If the\r
-biClrUsed member is set to zero, the bitmap uses the maximum number of colors\r
-corresponding to the value of the biBitCount member.\r
-\r
-The colors in the bmiColors table should appear in order of importance.\r
-Alternatively, for functions that use DIBs, the bmiColors member can be an\r
-array of 16-bit unsigned integers that specify an index into the currently\r
-realized logical palette instead of explicit RGB values. In this case, an\r
-application using the bitmap must call DIB functions with the wUsage\r
-parameter set to DIB_PAL_COLORS.\r
-\r
-Note:   The bmiColors member should not contain palette indexes if the bitmap\r
-is to be stored in a file or transferred to another application. Unless the\r
-application uses the bitmap exclusively and under its complete control, the\r
-bitmap color table should contain explicit RGB values.\r
-\r
-See Also\r
-\r
-BITMAPINFOHEADER, RGBQUAD \r
-\r
-==============================================================================\r
-BITMAPINFOHEADER (3.0)\r
-\r
-\r
-\r
-typedef struct tagBITMAPINFOHEADER {    /* bmih */\r
-    DWORD   biSize;\r
-    LONG    biWidth;\r
-    LONG    biHeight;\r
-    WORD    biPlanes;\r
-    WORD    biBitCount;\r
-    DWORD   biCompression;\r
-    DWORD   biSizeImage;\r
-    LONG    biXPelsPerMeter;\r
-    LONG    biYPelsPerMeter;\r
-    DWORD   biClrUsed;\r
-    DWORD   biClrImportant;\r
-} BITMAPINFOHEADER;\r
-\r
-The BITMAPINFOHEADER structure contains information about the dimensions and\r
-color format of a Windows 3.0 or later device-independent bitmap (DIB).\r
-\r
-Member          Description\r
-\r
-biSize          Specifies the number of bytes required by the\r
-BITMAPINFOHEADER structure.\r
-\r
-biWidth         Specifies the width of the bitmap, in pixels. \r
-biHeightSpecifies the height of the bitmap, in pixels. \r
-\r
-biPlanesSpecifies the number of planes for the target device. This\r
-member must be set to 1.\r
-\r
-biBitCount      Specifies the number of bits per pixel. This value must be 1,\r
-4, 8, or 24.\r
-\r
-biCompression   Specifies the type of compression for a compressed bitmap. It\r
-can be one of the following values:\r
-\r
-Value           Meaning\r
-\r
-BI_RGB          Specifies that the bitmap is not compressed. \r
-\r
-BI_RLE8         Specifies a run-length encoded format for bitmaps with 8 bits\r
-per pixel. The compression format is a 2-byte format consisting of a count\r
-byte followed by a byte containing a color index.  For more information, see\r
-the following Comments section.\r
-\r
-BI_RLE4         Specifies a run-length encoded format for bitmaps with 4 bits\r
-per pixel. The compression format is a 2-byte format consisting of a count\r
-byte followed by two word-length color indexes.  For more information, see\r
-the following Comments section.\r
-\r
-biSizeImage     Specifies the size, in bytes, of the image. It is valid to\r
-set this member to zero if the bitmap is in the BI_RGB format.\r
-\r
-biXPelsPerMeter Specifies the horizontal resolution, in pixels per meter, of\r
-the target device for the bitmap. An application can use this value to select\r
-a bitmap from a resource group that best matches the characteristics of the\r
-current device.\r
-\r
-biYPelsPerMeter Specifies the vertical resolution, in pixels per meter, of\r
-the target device for the bitmap.\r
-\r
-biClrUsed       Specifies the number of color indexes in the color table\r
-actually used by the bitmap. If this value is zero, the bitmap uses the\r
-maximum number of colors corresponding to the value of the biBitCount member.\r
-For more information on the maximum sizes of the color table, see the\r
-description of the BITMAPINFO structure earlier in this topic.\r
-\r
-If the biClrUsed member is nonzero, it specifies the actual number of colors\r
-that the graphics engine or device driver will access if the biBitCount\r
-member is less than 24. If biBitCount is set to 24, biClrUsed specifies the\r
-size of the reference color table used to optimize performance of Windows\r
-color palettes.  If the bitmap is a packed bitmap (that is, a bitmap in which\r
-the bitmap array immediately follows the BITMAPINFO header and which is\r
-referenced by a single pointer), the biClrUsed member must be set to zero or\r
-to the actual size of the color table.\r
-\r
-biClrImportant  Specifies the number of color indexes that are considered\r
-important for displaying the bitmap. If this value is zero, all colors are\r
-important.\r
-\r
-Comments\r
-\r
-The BITMAPINFO structure combines the BITMAPINFOHEADER structure and a color\r
-table to provide a complete definition of the dimensions and colors of a\r
-Windows 3.0 or later DIB. For more information about specifying a Windows 3.0\r
-DIB, see the description of the BITMAPINFO structure.\r
-\r
-An application should use the information stored in the biSize member to\r
-locate the color table in a BITMAPINFO structure as follows:\r
-\r
-pColor = ((LPSTR) pBitmapInfo + (WORD) (pBitmapInfo->bmiHeader.biSize))\r
-\r
-Windows supports formats for compressing bitmaps that define their colors\r
-with 8 bits per pixel and with 4 bits per pixel. Compression reduces the disk\r
-and memory storage required for the bitmap. The following paragraphs describe\r
-these formats.\r
-\r
-BI_RLE8\r
-\r
-When the biCompression member is set to BI_RLE8, the bitmap is compressed\r
-using a run-length encoding format for an 8-bit bitmap. This format may be\r
-compressed in either of two modes: encoded and absolute. Both modes can occur\r
-anywhere throughout a single bitmap.\r
-\r
-Encoded mode consists of two bytes: the first byte specifies the number of\r
-consecutive pixels to be drawn using the color index contained in the second\r
-byte. In addition, the first byte of the pair can be set to zero to indicate\r
-an escape that denotes an end of line, end of bitmap, or a delta. The\r
-interpretation of the escape depends on the value of the second byte of the\r
-pair. The following list shows the meaning of the second byte:\r
-\r
-Value   Meaning\r
-\r
-0       End of line. \r
-1       End of bitmap. \r
-2       Delta. The two bytes following the escape contain unsigned values\r
-indicating the horizontal and vertical offset of the next pixel from the\r
-current position.\r
-\r
-Absolute mode is signaled by the first byte set to zero and the second byte\r
-set to a value between 0x03 and 0xFF. In absolute mode, the second byte\r
-represents the number of bytes that follow, each of which contains the color\r
-index of a single pixel. When the second byte is set to 2 or less, the escape\r
-has the same meaning as in encoded mode. In absolute mode, each run must be\r
-aligned on a word boundary.  The following example shows the hexadecimal\r
-values of an 8-bit compressed bitmap:\r
-\r
-\r
-\r
-03 04 05 06 00 03 45 56 67 00 02 78 00 02 05 01\r
-02 78 00 00 09 1E 00 01\r
-\r
-This bitmap would expand as follows (two-digit values represent a color index\r
-for a single pixel):\r
-\r
-\r
-\r
-04 04 04\r
-06 06 06 06 06\r
-45 56 67\r
-78 78\r
-move current position 5 right and 1 down\r
-78 78\r
-end of line\r
-1E 1E 1E 1E 1E 1E 1E 1E 1E\r
-end of RLE bitmap\r
-\r
-BI_RLE4\r
-\r
-When the biCompression member is set to BI_RLE4, the bitmap is compressed\r
-using a run-length encoding (RLE) format for a 4-bit bitmap, which also uses\r
-encoded and absolute modes. In encoded mode, the first byte of the pair\r
-contains the number of pixels to be drawn using the color indexes in the\r
-second byte. The second byte contains two color indexes, one in its\r
-high-order nibble (that is, its low-order four bits) and one in its low-order\r
-nibble. The first of the pixels is drawn using the color specified by the\r
-high-order nibble, the second is drawn using the color in the low-order\r
-nibble, the third is drawn with the color in the high-order nibble, and so\r
-on, until all the pixels specified by the first byte have been drawn.  In\r
-absolute mode, the first byte contains zero, the second byte contains the\r
-number of color indexes that follow, and subsequent bytes contain color\r
-indexes in their high- and low-order nibbles, one color index for each pixel.\r
-In absolute mode, each run must be aligned on a word boundary. The\r
-end-of-line, end-of-bitmap, and delta escapes also apply to BI_RLE4.\r
-\r
-The following example shows the hexadecimal values of a 4-bit compressed\r
-bitmap:\r
-\r
-\r
-\r
-03 04 05 06 00 06 45 56 67 00 04 78 00 02 05 01\r
-04 78 00 00 09 1E 00 01\r
-\r
-This bitmap would expand as follows (single-digit values represent a color\r
-index for a single pixel):\r
-\r
-\r
-\r
-0 4 0\r
-0 6 0 6 0\r
-4 5 5 6 6 7\r
-7 8 7 8\r
-move current position 5 right and 1 down\r
-7 8 7 8\r
-end of line\r
-1 E 1 E 1 E 1 E 1\r
-end of RLE bitmap\r
-\r
-See Also\r
-\r
-BITMAPINFO \r
-\r
-==============================================================================\r
-RGBQUAD (3.0)\r
-\r
-\r
-\r
-typedef struct tagRGBQUAD {     /* rgbq */\r
-    BYTE    rgbBlue;\r
-    BYTE    rgbGreen;\r
-    BYTE    rgbRed;\r
-    BYTE    rgbReserved;\r
-} RGBQUAD;\r
-\r
-The RGBQUAD structure describes a color consisting of relative intensities of\r
-red, green, and blue. The bmiColors member of the BITMAPINFO structure\r
-consists of an array of RGBQUAD structures.\r
-\r
-Member          Description\r
-\r
-rgbBlue         Specifies the intensity of blue in the color. \r
-rgbGreenSpecifies the intensity of green in the color. \r
-rgbRed          Specifies the intensity of red in the color. \r
-rgbReserved     Not used; must be set to zero. \r
-\r
-See Also\r
-\r
-BITMAPINFO \r
-\r
-==============================================================================\r
-RGB (2.x)\r
-\r
-COLORREF RGB(cRed, cGreen, cBlue)\r
-\r
-BYTE cRed;      /* red component of color       */\r
-BYTE cGreen;    /* green component of color     */\r
-BYTE cBlue;     /* blue component of color      */\r
-\r
-\r
-The RGB macro selects an RGB color based on the parameters supplied and the\r
-color capabilities of the output device.\r
-\r
-Parameter       Description\r
-\r
-cRed    Specifies the intensity of the red color field. \r
-cGreen  Specifies the intensity of the green color field. \r
-cBlue   Specifies the intensity of the blue color field. \r
-\r
-Returns\r
-\r
-The return value specifies the resultant RGB color. \r
-\r
-Comments\r
-\r
-The intensity for each argument can range from 0 through 255. If all three\r
-intensities are specified as zero, the result is black. If all three\r
-intensities are specified as 255, the result is white.\r
-\r
-Comments\r
-\r
-The RGB macro is defined in WINDOWS.H as follows: \r
-\r
-\r
-\r
-#define RGB(r,g,b)   ((COLORREF)(((BYTE)(r)|((WORD)(g)<<8))| \\r
-    (((DWORD)(BYTE)(b))<<16)))\r
-\r
-See Also\r
-\r
-GetBValue, GetGValue, GetRValue, PALETTEINDEX, PALETTERGB\r
-\r
-==============================================================================\r
-BITMAPCOREINFO (3.0)\r
-\r
-\r
-\r
-typedef struct tagBITMAPCOREINFO {  /* bmci */\r
-    BITMAPCOREHEADER bmciHeader;\r
-    RGBTRIPLE        bmciColors[1];\r
-} BITMAPCOREINFO;\r
-\r
-The BITMAPCOREINFO structure fully defines the dimensions and color\r
-information for a device-independent bitmap (DIB).  Windows applications\r
-should use the BITMAPINFO structure instead of BITMAPCOREINFO whenever\r
-possible.\r
-\r
-Member          Description\r
-\r
-bmciHeader      Specifies a BITMAPCOREHEADER structure that contains\r
-information about the dimensions and color format of a DIB.\r
-\r
-bmciColors      Specifies an array of RGBTRIPLE structures that define the\r
-colors in the bitmap.\r
-\r
-Comments\r
-\r
-The BITMAPCOREINFO structure describes the dimensions and colors of a bitmap.\r
-It is followed immediately in memory by an array of bytes which define the\r
-pixels of the bitmap. The bits in the array are packed together, but each\r
-scan line must be zero-padded to end on a LONG boundary. Segment boundaries,\r
-however, can appear anywhere in the bitmap. The origin of the bitmap is the\r
-lower-left corner.\r
-\r
-The bcBitCount member of the BITMAPCOREHEADER structure determines the number\r
-of bits that define each pixel and the maximum number of colors in the\r
-bitmap. This member may be set to any of the following values:\r
-\r
-Value   Meaning\r
-\r
-1       The bitmap is monochrome, and the bmciColors member must contain two\r
-entries. Each bit in the bitmap array represents a pixel. If the bit is\r
-clear, the pixel is displayed with the color of the first entry in the\r
-bmciColors table. If the bit is set, the pixel has the color of the second\r
-entry in the table.\r
-\r
-4       The bitmap has a maximum of 16 colors, and the bmciColors member\r
-contains 16 entries. Each pixel in the bitmap is represented by a four-bit\r
-index into the color table.\r
-\r
-For example, if the first byte in the bitmap is 0x1F, the byte represents two\r
-pixels. The first pixel contains the color in the second table entry, and the\r
-second pixel contains the color in the sixteenth table entry.\r
-\r
-8       The bitmap has a maximum of 256 colors, and the bmciColors member\r
-contains 256 entries. In this case, each byte in the array represents a\r
-single pixel.\r
-\r
-24      The bitmap has a maximum of 2^24 colors. The bmciColors member is\r
-NULL, and each 3-byte sequence in the bitmap array represents the relative\r
-intensities of red, green, and blue, respectively, of a pixel.\r
-\r
-The colors in the bmciColors table should appear in order of importance.\r
-Alternatively, for functions that use DIBs, the bmciColors member can be an\r
-array of 16-bit unsigned integers that specify an index into the currently\r
-realized logical palette instead of explicit RGB values. In this case, an\r
-application using the bitmap must call DIB functions with the wUsage\r
-parameter set to DIB_PAL_COLORS.\r
-\r
-Note:   The bmciColors member should not contain palette indexes if the\r
-bitmap is to be stored in a file or transferred to another application.\r
-Unless the application uses the bitmap exclusively and under its complete\r
-control, the bitmap color table should contain explicit RGB values.\r
-\r
-See Also\r
-\r
-BITMAPINFO, BITMAPCOREHEADER, RGBTRIPLE \r
-\r
-\r
-==============================================================================\r
-BITMAPCOREHEADER (3.0)\r
-\r
-\r
-\r
-typedef struct tagBITMAPCOREHEADER {    /* bmch */\r
-    DWORD   bcSize;\r
-    short   bcWidth;\r
-    short   bcHeight;\r
-    WORD    bcPlanes;\r
-    WORD    bcBitCount;\r
-} BITMAPCOREHEADER;\r
-\r
-The BITMAPCOREHEADER structure contains information about the dimensions and\r
-color format of a device-independent bitmap (DIB). Windows applications\r
-should use the BITMAPINFOHEADER structure instead of BITMAPCOREHEADER\r
-whenever possible.\r
-\r
-Member          Description\r
-\r
-bcSize          Specifies the number of bytes required by the\r
-BITMAPCOREHEADER structure.\r
-\r
-bcWidth         Specifies the width of the bitmap, in pixels. \r
-bcHeightSpecifies the height of the bitmap, in pixels. \r
-\r
-bcPlanesSpecifies the number of planes for the target device. This\r
-member must be set to 1.\r
-\r
-bcBitCount      Specifies the number of bits per pixel. This value must be 1,\r
-4, 8, or 24.\r
-\r
-Comments\r
-\r
-The BITMAPCOREINFO structure combines the BITMAPCOREHEADER structure and a\r
-color table to provide a complete definition of the dimensions and colors of\r
-a DIB. See the description of the BITMAPCOREINFO structure for more\r
-information about specifying a DIB.\r
-\r
-An application should use the information stored in the bcSize member to\r
-locate the color table in a BITMAPCOREINFO structure with a method such as\r
-the following:\r
-\r
-\r
-\r
-lpColor = ((LPSTR) pBitmapCoreInfo + (UINT) (pBitmapCoreInfo->bcSize))\r
-\r
-See Also\r
-\r
-BITMAPCOREINFO, BITMAPINFOHEADER, BITMAPINFOHEADER \r
-\r
-=============================================================================\r
-RGBTRIPLE (3.0)\r
-\r
-\r
-\r
-typedef struct tagRGBTRIPLE {   /* rgbt */\r
-    BYTE    rgbtBlue;\r
-    BYTE    rgbtGreen;\r
-    BYTE    rgbtRed;\r
-} RGBTRIPLE;\r
-\r
-The RGBTRIPLE structure describes a color consisting of relative intensities\r
-of red, green, and blue. The bmciColors member of the BITMAPCOREINFO\r
-structure consists of an array of RGBTRIPLE structures.  Windows applications\r
-should use the BITMAPINFO structure instead of BITMAPCOREINFO whenever\r
-possible. The BITMAPINFO structure uses an RGBQUAD structure instead of the\r
-RGBTRIPLE structure.\r
-\r
-Member  Description\r
-\r
-rgbtBlueSpecifies the intensity of blue in the color. \r
-rgbtGreen       Specifies the intensity of green in the color. \r
-rgbtRed         Specifies the intensity of red in the color.\r
-\r
-See Also\r
-\r
-BITMAPCOREINFO, BITMAPINFO, RGBQUAD\r
-\r
-==============================================================================\r
diff --git a/16/PCGPE10/BRES.TXT b/16/PCGPE10/BRES.TXT
deleted file mode 100644 (file)
index 3e08092..0000000
+++ /dev/null
@@ -1,399 +0,0 @@
-\r
-               ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-               ³ Bresenham's Line and Circle Algorithms ³\r
-               ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-                 Written for the PC-GPE by Mark Feldman\r
-            e-mail address : u914097@student.canberra.edu.au\r
-                             myndale@cairo.anu.edu.au\r
-\r
-             ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-             ³      THIS FILE MAY NOT BE DISTRIBUTED     ³\r
-             ³ SEPARATE TO THE ENTIRE PC-GPE COLLECTION. ³\r
-             ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Disclaimer ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-I assume no responsibility whatsoever for any effect that this file, the\r
-information contained therein or the use thereof has on you, your sanity,\r
-computer, spouse, children, pets or anything else related to you or your\r
-existance. No warranty is provided nor implied with this information.\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Introduction ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-Bresenham is a pretty smart cookie (note the use of the word "is", last I\r
-heard he was still working for IBM). This file contains the algorithms he\r
-developped for drawing lines and circles on a pixelated display system\r
-such as the VGA.\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Line Algorithm ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-The basic algorithm works for lines which look like this:\r
-\r
-\r
-      o-------                         ¿\r
-     p1       --------                 ³ deltay\r
-                      -------      p2  ³\r
-                             -------o  Ù\r
-\r
-      ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-                  deltax\r
-\r
-where p1 = (x1,y1),\r
-      p2 = (x2, y2),\r
-      x and y are both increasing from p1 to p2,\r
-      deltax = x2 - x1,\r
-      deltay = y2 - y1 and\r
-      deltax >= deltay.\r
-\r
-All other types of lines can be derived from this type. I'll get to this\r
-bit later.\r
-\r
-First you need to perform the following intialisation:\r
-\r
-x = x1\r
-y = y1\r
-d = (2 * deltay) - deltax\r
-\r
-x is the current x location, you will add 1 to this variable after every\r
-pixel you draw until all pixels have been drawn.\r
-y is the current y location. The decision variable is used to determine\r
-when to add 1 to this value. d is the decision variable which will be used\r
-to keep a track of what to do.\r
-\r
-Now you loop across the screen from x1 to x2 and for each loop perform the\r
-following operations for each pixel :\r
-\r
-PutPixel(x, y);  { Draw a pixel at the current point }\r
-if d < 0 then\r
-    d := d + (2 * deltay)\r
-else\r
-  begin\r
-    d := d + 2 * (deltay - deltax);\r
-    y := y + 1;\r
-  end;\r
-x := x + 1;\r
-\r
-It's that simple!\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Speeding Up The Line Algorithm ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-There are several useful techniques for speeding up Bresenhams line\r
-algorithm.\r
-\r
-For starters, notice that all multiplications are by 2. This can be\r
-performed with a simple shift left instruction (Shl in Pascal, << in C).\r
-\r
-Next notice that the values you add to the decision variable do not change\r
-throughout the loop, so they can be precalculated beforehand.\r
-\r
-One property of lines is that they are symetrical about their mid-points,\r
-and we can use this property to speed up the algorithm. Store two x and y\r
-values, (xa, ya) and (xb, yb). Have each pair start on either end of the\r
-line. For each pass through the loop you draw the pixel at both points, add\r
-1 to xa and subtract one from xb. When d >= 0 add 1 to ya and subtract one\r
-from yb. You then only need to loop until xa = xb.\r
-\r
-It's also obvious that if the decision variable becomes the same value\r
-it was when it was initialised, then the rest of the line is just\r
-copies of the line you have already drawn up to that point. You might be\r
-able to speed the algorithm up by keeping an array of how y has been\r
-modified and then use this array if the line starts repeating itself. If\r
-you are using the Intel registers to store all values then you probably\r
-wouldn't get much of a speed increase (in fact it could slow it down), but\r
-it would probably be useful for thing like linear texture mapping (discussed\r
-below). I've never actually tried implementing this technique, and I would\r
-like to hear the results if anyone does.\r
-\r
-Above all remember that these optimisations will only significantly speed\r
-up the line drawing algorithm if the whole thing is done in assembly. A\r
-profile of the example program at the end of this file showed that 40% of\r
-CPU time was spent in the slow PutPixel routine I was using, the loop\r
-mechanics and testing the sign of the decision variable.\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Other Uses for the Line Algorithm ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-A line can be represented by the equation y = mx + c, where\r
-m = deltay / deltax. Note that this is a version of the standard linear\r
-equation ax + bx + c = 0. There are many algorithms which use this equation.\r
-\r
-One good use for the bresenham line algorithm is for quickly drawing filled\r
-concave polygons (eg triangles). You can set up an array of minimum and\r
-maximum x values for every horizontal line on the screen. You then use\r
-bresenham's algorithm to loop along each of the polygon's sides, find where\r
-it's x value is on every line and adjust the min and max values accordingly.\r
-When you've done it for every line you simply loop down the screen drawing\r
-horizontal lines between the min and max values for each line.\r
-\r
-Another area is in linear texture mapping (see the PC-GPE article on texture\r
-mapping). This method involves taking a string of bitmap pixels and\r
-stretching them out (or squashing them in) to a line of pixels on the screen.\r
-Typically you would draw a vertical line down the screen and use Bresenhams\r
-to calculate which bitmap pixel should be drawn at each screen pixel.\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Circle Algorithm ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-Circles have the property of being highly symetrical, which is handy\r
-when it comes to drawing them on a display screen.\r
-\r
-      |y          (This diagram is supposed to be a circle, try viewing\r
-      |           it in 50 line mode).\r
-  \ ..... /\r
-   .  |  .        We know that there are 360 degrees in a circle. First we\r
-  . \ | / .       see that a circle is symetrical about the x axis, so\r
-  .  \|/  .       only the first 180 degrees need to be calculated. Next\r
---.---+---.--     we see that it's also symetrical about the y axis, so now\r
-  .  /|\  . x     we only need to calculate the first 90 degrees. Finally\r
-  . / | \ .       we see that the circle is also symetrical about the 45\r
-   .  |  .        degree diagonal axis, so we only need to calculate the\r
-  / ..... \       first 45 degrees.\r
-      |\r
-      |\r
-\r
-Bresenhams circle algorithm calculates the locations of the pixels in the\r
-first 45 degrees. It assumes that the circle is centered on the origin. So\r
-for every pixel (x,y) it calculates we draw a pixel in each of the 8 octants\r
-of the circle :\r
-\r
-PutPixel(CenterX + X, Center Y + Y)\r
-PutPixel(CenterX + X, Center Y - Y)\r
-PutPixel(CenterX - X, Center Y + Y)\r
-PutPixel(CenterX - X, Center Y - Y)\r
-PutPixel(CenterX + Y, Center Y + X)\r
-PutPixel(CenterX + Y, Center Y - X)\r
-PutPixel(CenterX - Y, Center Y + X)\r
-PutPixel(CenterX - Y, Center Y - X)\r
-\r
-So let's get into the actual algorithm. Given a radius for the circle\r
-we perform this initialisation:\r
-\r
-d := 3 - (2 * RADIUS)\r
-x := 0\r
-y := RADIUS\r
-\r
-Now for each pixel we do the following operations:\r
-\r
-Draw the 8 circle pixels\r
-if d < 0 then\r
-    d := d + (4 * x) + 6\r
-else\r
-  begin\r
-    d := d + 4 * (x - y) + 10\r
-    y := y - 1;\r
-  end;\r
-\r
-And we keep doing this until x = y. Note that the values added to the\r
-decision variable in this algorithm (x and y) are constantly changing, so\r
-we cannot precalculate them. The muliplications however are by 4, and we\r
-can accomplish this by shifting left twice.\r
-\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ A Pascal General Line Procedure ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-The basic bresenham line algorithm can be modified to handle all types of\r
-lines. In this section assume that deltax = abs(x2 - x1) and\r
-deltay = abs(y2 - y1).\r
-\r
-First let's take lines where deltax >= deltay. Now if x1 > x2 then you will\r
-need to subtract 1 from x for every pass through the loop. Similarly if y1 >\r
-y2 then you will be also need to subtract 1 from y for every pass through the\r
-loop where d < 0.\r
-\r
-Lines where deltax < deltay can be handled the same way, you just swap all\r
-the deltax's and deltay's around.\r
-\r
-The fastest method of handling all cases is to write a custom routine for\r
-each of the 8 line types:\r
-\r
-1) x1 <= x2, y1 <= y2, deltax >= deltay\r
-2) x1 <= x2, y1 <= y2, deltax <  deltay\r
-3) x1 <= x2, y1 >  y2, deltax >= deltay\r
-4) x1 <= x2, y1 >  y2, deltax <  deltay\r
-5) x1 >  x2, y1 <= y2, deltax >= deltay\r
-6) x1 >  x2, y1 <= y2, deltax <  deltay\r
-7) x1 >  x2, y1 >  y2, deltax >= deltay\r
-8) x1 >  x2, y1 >  y2, deltax <  deltay\r
-\r
-This will give you the fastest results, but will also make your code 8\r
-times larger! Alternatively you can declare a few extra variables and\r
-use a common inner loop for all lines:\r
-\r
-numpixels = number of pixels to draw\r
-          = deltax if deltax >= deltay or\r
-          = deltay if deltax < deltay\r
-dinc1 = the amount to add to d when d < 0\r
-dinc2 = the amount to add to d when d >= 0\r
-xinc1 = the amount to add to x when d < 0\r
-xinc2 = the amount to add to x when d >= 0\r
-yinc1 = the amount to add to y when d < 0\r
-yinc2 = the amount to add to y when d >= 0\r
-\r
-The following is a simple example program which uses this technique:\r
-\r
-\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-\r
-{\r
-\r
-BRESLINE.PAS - A general line drawing procedure.\r
-               By Mark Feldman\r
-\r
-This is a very simple implementation of bresenhams' line algorithm with\r
-no optimisations. It can draw about 6000 random lines a second in mode 13h\r
-on my 486SX33 with sloooooow Paradise Extended VGA.\r
-\r
-}\r
-\r
-procedure Line(x1, y1, x2, y2 : integer; color : byte);\r
-var i, deltax, deltay, numpixels,\r
-    d, dinc1, dinc2,\r
-    x, xinc1, xinc2,\r
-    y, yinc1, yinc2 : integer;\r
-begin\r
-\r
-  { Calculate deltax and deltay for initialisation }\r
-  deltax := abs(x2 - x1);\r
-  deltay := abs(y2 - y1);\r
-\r
-  { Initialize all vars based on which is the independent variable }\r
-  if deltax >= deltay then\r
-    begin\r
-\r
-      { x is independent variable }\r
-      numpixels := deltax + 1;\r
-      d := (2 * deltay) - deltax;\r
-      dinc1 := deltay Shl 1;\r
-      dinc2 := (deltay - deltax) shl 1;\r
-      xinc1 := 1;\r
-      xinc2 := 1;\r
-      yinc1 := 0;\r
-      yinc2 := 1;\r
-    end\r
-  else\r
-    begin\r
-\r
-      { y is independent variable }\r
-      numpixels := deltay + 1;\r
-      d := (2 * deltax) - deltay;\r
-      dinc1 := deltax Shl 1;\r
-      dinc2 := (deltax - deltay) shl 1;\r
-      xinc1 := 0;\r
-      xinc2 := 1;\r
-      yinc1 := 1;\r
-      yinc2 := 1;\r
-    end;\r
-\r
-  { Make sure x and y move in the right directions }\r
-  if x1 > x2 then\r
-    begin\r
-      xinc1 := - xinc1;\r
-      xinc2 := - xinc2;\r
-    end;\r
-  if y1 > y2 then\r
-    begin\r
-      yinc1 := - yinc1;\r
-      yinc2 := - yinc2;\r
-    end;\r
-\r
-  { Start drawing at <x1, y1> }\r
-  x := x1;\r
-  y := y1;\r
-\r
-  { Draw the pixels }\r
-  for i := 1 to numpixels do\r
-    begin\r
-      PutPixel(x, y, color);\r
-      if d < 0 then\r
-        begin\r
-          d := d + dinc1;\r
-          x := x + xinc1;\r
-          y := y + yinc1;\r
-        end\r
-      else\r
-        begin\r
-          d := d + dinc2;\r
-          x := x + xinc2;\r
-          y := y + yinc2;\r
-        end;\r
-    end;\r
-end;\r
-\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-\r
-\r
-\r
-\r
-\r
-\r
-Note that if you are writing a line routine for mode 13h (for example) you\r
-can speed it up by converting the inner loop to assembly and including\r
-mode 13h specific code. This portion of the above routine works the same but\r
-the <x, y> values are stored in a single variable (screen) which holds the\r
-memory address of the current pixel, screeninc1 and screeninc2 are the\r
-update values for screen.\r
-\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-\r
-var screen : word;\r
-    screeninc1, screeninc2 : integer;\r
-     .\r
-     .\r
-     .\r
-  { Start drawing at <x1, y1> }\r
-  screen := word(y1) * 320 + x1;\r
-  screeninc1 := yinc1 * 320 + xinc1;\r
-  screeninc2 := yinc2 * 320 + xinc2;\r
-\r
-  { Draw the pixels }\r
-  asm\r
-\r
-    { Use as many registers as are available }\r
-    push $A000\r
-    pop es\r
-    mov di, screen\r
-    mov dx, d\r
-    mov al, color\r
-    mov cx, numpixels\r
-    mov bx, dinc1\r
-\r
-    @bres1:\r
-\r
-    { Draw the current pixel and compare the decision variable to 0 }\r
-    mov es:[di], al\r
-    cmp dx, 0\r
-    jnl @bres2\r
-\r
-    { D < 0 }\r
-    add dx, bx { bx = dinc1 }\r
-    add di, screeninc1\r
-    jmp @bres3\r
-\r
-    @bres2:\r
-\r
-    { D >= 0 }\r
-    add dx, dinc2\r
-    add di, screeninc2\r
-\r
-    @bres3:\r
-\r
-    loop @bres1\r
-  end;\r
-\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-\r
-\r
diff --git a/16/PCGPE10/BSP.TXT b/16/PCGPE10/BSP.TXT
deleted file mode 100644 (file)
index 0364956..0000000
+++ /dev/null
@@ -1,149 +0,0 @@
-                 ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-                 ³ A Simple Explanation of BSP Trees ³\r
-                 ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-            Written for the PC-GPE by Mark Feldman\r
-            e-mail address : u914097@student.canberra.edu.au\r
-                             myndale@cairo.anu.edu.au\r
-\r
-             ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-             ³      THIS FILE MAY NOT BE DISTRIBUTED     ³\r
-             ³ SEPARATE TO THE ENTIRE PC-GPE COLLECTION. ³\r
-             ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Disclaimer ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-I assume no responsibility whatsoever for any effect that this file, the\r
-information contained therein or the use thereof has on you, your sanity,\r
-computer, spouse, children, pets or anything else related to you or your\r
-existance. No warranty is provided nor implied with this information.\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ BSP Trees ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-Binary Space Partition trees are handy for drawing 3D scenes where the\r
-positions of objects are fixed and the user's viewing coordinate changes\r
-(flight simulators being a classic example).\r
-\r
-BSP's are an extention of the "Painter's Algorithm". The painter's algorithm\r
-works by drawing all the polygons (or texture maps) in a scene in back-to-\r
-front order, so that polygon's in the background are drawn first, and\r
-polygons in the foreground are drawn over them. The "classic" painter's\r
-algorithm does have a few problems however:\r
-1) polygon's will not be drawn correctly if they pass through any other\r
-polygon\r
-2) it's difficult and computationally expensive calculating the order that\r
-the polygons should be drawn in for each frame\r
-3) the algorithm cannot handle cases of cyclic overlap such as the\r
-following :\r
-                           ___       ___\r
-                          |   |     |   |\r
-                        __|   |_____|___|___\r
-                       |  |   |             |\r
-                       |__|   |_____________|\r
-                          |   |     |   |\r
-                        __|___|_____|   |___\r
-                       |            |   |   |\r
-                       |____________|   |___|\r
-                          |   |     |   |\r
-                          |___|     |___|\r
-\r
-In this case it doesn't matter which order you draw the polygon's it still\r
-won't look right!\r
-\r
-BSP's help solve all these problems.\r
-\r
-Ok, so let's get down to business. BSP's work by building an ordered tree of\r
-all the objects in a scene. Let's imagine we live in a 2D world and we have\r
-a scene like this:\r
-\r
-             ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-             ³                                    ³\r
-             ³                                    ³\r
-             ³              ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ  ³\r
-             ³                    line 1          ³\r
-             ³           \                        ³\r
-             ³             \                      ³\r
-             ³               \ line 2             ³\r
-             ³                 \                  ³\r
-             ³                   \                ³\r
-             ³   ÄÄÄÄÄÄÄÄ          \              ³\r
-             ³   line 3              \            ³\r
-             ³                                    ³\r
-             ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-                              ^\r
-                              viewpoint (assume the viewpoint is the\r
-                                         origin for this example)\r
-\r
-\r
-Now if we were to draw this scene using the painters algorithm we would\r
-draw line 1 first, then line 2, finally line 3. Using BSP's we can figure\r
-out the order beforehand and create a tree. First we note that any\r
-arbitrary point <x,y> can be on either of it's 2 sides or on the line (which\r
-can be regarded as being on either of the sides). When we build our tree, we\r
-take a line and put all the lines on one side of it to the left and all the\r
-nodes on the other side on the right. So for the above example could wind up\r
-with the following tree:\r
-\r
-          1\r
-         /\r
-        2\r
-       /\r
-      3\r
-\r
-Alternatively, we could also wind up with this tree:\r
-\r
-        2\r
-       / \\r
-      3   1\r
-\r
-Notice that line 2 is the head node, line 3 is on the same side of line 2\r
-as the origin is and line 1 is on the opposite side.\r
-\r
-Now, I hear you say "but hang on a tic, what if line 3 is the head node? What\r
-side of it is line 2 on?". Yes boys and girls, there had to be a catch\r
-somewhere and this is it. What you have to do here is split line 2 into\r
-*TWO* lines so that each portion falls nice and neatly onto either side of\r
-line 3, so you get a tree like this:\r
-\r
-       3\r
-      / \\r
-    2a   2b\r
-          \\r
-           1\r
-\r
-The lines 2a and 2b are portions of the original line 2. If you draw *BOTH*\r
-of them on the screen it will look as though you've drawn the entire original\r
-line.\r
-\r
-You don't have to worry about balancing a BSP tree, since you have to\r
-traverse every node in it every time you draw the scene anyway. The trick\r
-is to figure out how to organise the tree so that you get the *least* number\r
-of polygon splits. I tackled this by looking at each polygon yet to be\r
-inserted into the tree, calculating how many splits it will cause if it\r
-is inserted next and selecting the one which will cause the fewest. This\r
-is a very slow way of going about things, O(N^2) I think, but for most games\r
-you only need to sort the tree once when you are developping the game and not\r
-during the game itself.\r
-\r
-Extending these concepts to 3D is pretty straight-forward. Let's say that\r
-polygon 1 is at the top of the BSP tree and we want to insert polygon 2. If\r
-all the points in polygon 2 fall on one side or the other of polygon 1 then\r
-you insert it into polygon 2's left or right node. If some points fall on\r
-one side and the rest fall on the other, then you have to figure out the line\r
-of intersection formed by the planes that each polygon lies in and split\r
-polygon 2 along this line. Each of these 2 new polygons will then fall on\r
-either side of polygon 1.\r
-\r
-\r
-To draw the objects in a BSP tree you start at the top node and figure out\r
-which side of the object your view coordinate is on. You then traverse the\r
-node for the *other* side, draw the current object, then traverse the node\r
-for the side the view coordinate is on.\r
-\r
-\r
diff --git a/16/PCGPE10/CAT.TXT b/16/PCGPE10/CAT.TXT
deleted file mode 100644 (file)
index b2bbf55..0000000
+++ /dev/null
@@ -1,163 +0,0 @@
-\r
-          ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-          ³ Programming the Chips And Technologies SVGA Chip ³\r
-          ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-                 Written for the PC-GPE by Mark Feldman\r
-              e-mail address : u914097@student.canberra.edu.au\r
-                               myndale@cairo.anu.edu.au\r
-\r
-                  Please read the file SVGINTRO.TXT\r
-              (Graphics/SVGA/Intro PC-GPE menu option)\r
-\r
-             ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-             ³      THIS FILE MAY NOT BE DISTRIBUTED     ³\r
-             ³ SEPARATE TO THE ENTIRE PC-GPE COLLECTION. ³\r
-             ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Disclaimer ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-I assume no responsibility whatsoever for any effect that this file, the\r
-information contained therein or the use thereof has on you, your sanity,\r
-computer, spouse, children, pets or anything else related to you or your\r
-existance. No warranty is provided nor implied with this information.\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Setup mode ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-To modify some of the CAT's internal SVGA registers the card must be placed\r
-into setup mode. This is done by writing the value 1Eh to port 46E8h. To\r
-exit setup mode write the value 0Eh to port 46E8h.\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Enabling Extensions ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-The CAT's extended registers are normally locked and must be enabled before\r
-you attempt to modify them. To enable them, you must enter setup mode,\r
-write the value 80h to port 103h and exit setup mode. To disable them\r
-you must enter setup mode, write the value 00h to port 103h and exit\r
-setup mode.\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Identifying the CAT Chip ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-Detecting the presence of a CAT chip can be done by entering setup mode,\r
-checking that the value returned from reading port 104h is A5h and then\r
-exiting setup mode.\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Identifying which CAT Chip and Revision Number ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-The CAT chip type and revision number can be determined by enabling\r
-extensions, reading the value of register 0 and disabling extensions.\r
-The top 4 bits (4-7) are the chip id and the lower 4 are the version\r
-number.\r
-\r
-                     ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-                     ³ Chip ID      Chip             ³\r
-                     ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´\r
-                     ³    1         82c451 or 82c452 ³\r
-                     ³    2         82c455           ³\r
-                     ³    3         82c453           ³\r
-                     ³    5         82c456           ³\r
-                     ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-\r
-The 82c451 and 82c452 can be distinguished by attempting to modify\r
-register 3Ah (Graphics Cursor Color 1, make sure you set it back to what it\r
-was). If the register exists the chip is an 82c452.\r
-\r
-Alternatively the chip ID can be determined using the Get Controller\r
-Information BIOS call (see below).\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ CAT Graphics Display Modes ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-        ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-        ³ Mode    Resolution   Colors          Chip         ³\r
-        ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´\r
-        ³ 25h     640x480      16              451/452/453  ³\r
-        ³ 6Ah     800x600      16              451/452/453  ³\r
-        ³ 70h     800x600      16              451/452/453  ³\r
-        ³ 71h     960x720      16              452          ³\r
-        ³ 72h     1024x768     16              452/453      ³\r
-        ³ 78h     640x400      256             451/452/453  ³\r
-        ³ 79h     640x480      256             452/453      ³\r
-        ³ 7Ah     768x576      256             452          ³\r
-        ³ 7Ch     800x600      256             453          ³\r
-        ³ 7Eh     1024x768     256             453          ³\r
-        ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ The CAT Display Memory ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-The following registers can only be modified while the extended registers\r
-are enabled (See Enabling Extensions above).\r
-\r
-The 451, 455 and 456 are always in single-paging mode and have 4 64K\r
-banks. To switch to a bank you must first enable access to extended memory\r
-with the following procedure:\r
-\r
-Port[$3D6] := $0B;\r
-Port[$3D6] := Port[$3D6] and $FD;\r
-\r
-Selecting a bank can be done with the following procedure:\r
-\r
-Port[$3D6] := $0B;\r
-Port[$3D7] := bank_number;\r
-\r
-where bank_number = 0 - 3. Each bank is 64K long and has a 86K granularity.\r
-\r
-The 452 and 453 banks have a 16K granularity, so if you want 64K granularity\r
-you must multiply the bank number by 4 before writing it to the registers :\r
-\r
-Port[$3D6] := $10;\r
-Port[$3D7] := bank_number Shl 2;  { = bank_numer * 4 }\r
-\r
-The 452 and 453 allow duel paging. The 64K host address space is split in\r
-two, one low area A000:0000-7FFFh and a high area A000:8000-FFFFh. This\r
-mode can be enabled with the following procedure:\r
-\r
-Port[$3D6] := $10;\r
-Port[$3D6] := Port[$3D6] or 2;\r
-\r
-In this mode each bank also has a granularity of 16K. The lower bank is\r
-selected with the same procedure for setting the bank in single-paging\r
-mode. The upper bank is selected with the following call:\r
-\r
-Port[$3D6] := $11;\r
-Port[$3D7] := bank_number Shl 2;  { = bank_numer * 4 }\r
-\r
-None of the CAT chips allow you to select one bank for reading and\r
-another for writing.\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ CAT Get Controller Information BIOS Call ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-Int 10h\r
-Inputs :\r
-    AH = 5Fh            Extended VGA Control\r
-    AL = 00h            Get Controller Information\r
-\r
-Returns:\r
-AL = 5Fh                Extended VGA control function supported\r
-BL = Chip type          bits 7-4 contain the chip type number\r
-                            0 = 82c451\r
-                            1 = 82c452\r
-                            2 = 82c455\r
-                            ? = 82c453\r
-                        bits 3-0 contain the revision number\r
-BH = Memory Size        Video memory size\r
-                          0 = 256k\r
-                          1 = 512k\r
-                          2 = 1M\r
diff --git a/16/PCGPE10/CMF.TXT b/16/PCGPE10/CMF.TXT
deleted file mode 100644 (file)
index 2e095be..0000000
+++ /dev/null
@@ -1,159 +0,0 @@
-\r
-               ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-               ³ Creative Labs File Formats (SBI/CMF/IBK) ³\r
-               ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-                 Written for the PC-GPE by Mark Feldman\r
-              e-mail address : u914097@student.canberra.edu.au\r
-                               myndale@cairo.anu.edu.au\r
-\r
-              ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-              ³      THIS FILE MAY NOT BE DISTRIBUTED     ³\r
-              ³ SEPARATE TO THE ENTIRE PC-GPE COLLECTION. ³\r
-              ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Disclaimer ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-I assume no responsibility whatsoever for any effect that this file, the\r
-information contained therein or the use thereof has on you, your sanity,\r
-computer, spouse, children, pets or anything else related to you or your\r
-existance. No warranty is provided nor implied with this information.\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Sound Blaster Instrument File Format (SBI) ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-The SBI format contains the register values for the FM chip to synthesize\r
-an instrument.\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-³ Offset    Description                                                  ³\r
-ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´\r
-³ 00h-03h   Contains id characters "SBI" followed by byte 1Ah            ³\r
-³ 04h-23h   Instrument name, NULL terminated string                      ³\r
-³   24h     Modulator Sound Characteristic (Mult, KSR, EG, VIB, AM)      ³\r
-³   25h     Carrier Sound Characteristic                                 ³\r
-³   26h     Modulator Scaling/Output Level                               ³\r
-³   27h     Carrier Scaling/Output Level                                 ³\r
-³   28h     Modulator Attack/Delay                                       ³\r
-³   29h     Carrier Attack/Delay                                         ³\r
-³   2Ah     Modulator Sustain/Release                                    ³\r
-³   2Bh     Carrier Sustain/Release                                      ³\r
-³   2Ch     Modulator Wave Seelct                                        ³\r
-³   2Dh     Carrier Wave Select                                          ³\r
-³   2Eh     Feedback/Connection                                          ³\r
-³ 2Fh-33h   Reserved                                                     ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Creative Music File Format (CMF) ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-The CMF file format consists of 3 blocks: the header block, the instrument\r
-block and the music block.\r
-\r
-\r
-The CMF Header Block\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-³ Offset    Description                                                  ³\r
-ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´\r
-³ 00h-03h   Contains id characters "CTMF"                                ³\r
-³ 04h-05h   CMF Format Version MSB = major version, lsb = minor version  ³\r
-³ 06h-07h   File offset of the instrument block                          ³\r
-³ 08h-09h   File offset of the music block                               ³\r
-³ 0Ah-0Bh   Clock ticks per quarter note (one beat) default = 120        ³\r
-³ 0Ch-0Dh   Clock ticks per second                                       ³\r
-³ 0Eh-0Fh   File offset of the music title (0 = none)                    ³\r
-³ 10h-11h   File offset of the composer name (0 = none)                  ³\r
-³ 12h-13h   File offset of the remarks (0 = none)                        ³\r
-³ 14h-23h   Channel-In-Use Table                                         ³\r
-³ 24h-25h   Number of instruments used                                   ³\r
-³ 26h-27h   Basic Tempo                                                  ³\r
-³ 28h-?     Title, composer and remarks stored here                      ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-\r
-The CMF Instrument Block\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-\r
-The instrument block contains one 16 byte data structure for each instrument\r
-in the piece. Each record is of the same format as bytes 24h-33h in the\r
-SBI file format.\r
-\r
-\r
-The CMF Music Block\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-\r
-The music block adheres to the standard MIDI file format, and can have from\r
-1 to 16 instruments. The PC-GPE file MIDI.TXT contains more information\r
-on this file format.\r
-\r
-The music block consists of an alternating seqence of time and MIDI event\r
-records:\r
-\r
-ÚÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÂÄ\r
-³dTime³MIDI Event³dTime³MIDI Event³dTime³MIDI Event³ ........\r
-ÀÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÁÄ\r
-\r
-dTime (delta Time) is the amount of time before the following MIDI event.\r
-MIDI Event is any MIDI channel message (see MIDI.TXT).\r
-\r
-\r
-The CMF file format defines the following MIDI Control Change events:\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-³ Control                                                                ³\r
-³ Number        Control Data                                             ³\r
-ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´\r
-³  66h          1-127, used as markers in the music                      ³\r
-³  67h          0 - melody mode, 1 = rhythm mode                         ³\r
-³  68h          0-127, changes the pitch of all following notes upward   ³\r
-³               by the given number of 1/128 semitones                   ³\r
-³  69h          0-127, changes the pitch of all following notes downward ³\r
-³               by the given number of 1/128 semitones                   ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-In rhythm mode, the last five channels are allocated for the percussion\r
-instruments:\r
-\r
-                   ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-                   ³ Channel   Instrument      ³\r
-                   ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´\r
-                   ³  12h      Bass Drum       ³\r
-                   ³  13h      Snare Drum      ³\r
-                   ³  14h      Tom-Tom         ³\r
-                   ³  15h      Top Cymbal      ³\r
-                   ³  16h      High-hat Cymbal ³\r
-                   ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Sound Blaster Instrument Bank File Format (IBK) ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-A bank file is a group of up to 128 instruments.\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-³ Offset    Description                                                  ³\r
-ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´\r
-³ 00h-03h   Contains id characters "IBK" followed by byte 1Ah            ³\r
-³ 04h-803h  Parameters for 128 instruments, 16 bytes for each instrument ³\r
-³           in the same format as bytes 24h-33h in the SBI format        ³\r
-³ 804h-C83h Instrument names for 128 instruments, 9 bytes for each       ³\r
-³           instrument, each name must be null terminated                ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ References ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-Title : Sound Blaster - The Official Book\r
-Authors : Richard Heimlich, David M. Golden, Ivan Luk, Peter M. Ridge\r
-Publishers : Osborne/McGraw Hill\r
-ISBN : 0-07-881907-5\r
diff --git a/16/PCGPE10/CONIC.CC b/16/PCGPE10/CONIC.CC
deleted file mode 100644 (file)
index 9e1b9c3..0000000
+++ /dev/null
@@ -1,356 +0,0 @@
-\r
-           ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-           ³ A General Conics Sections Scan Line Algorithm ³\r
-           ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-\r
-The following code is the complete algorithm for the general conic\r
-drawer as mentioned in Foley/VanDam. It is included here with the\r
-permission of Andrew W. Fitzgibbon, who derived the remaining code\r
-sections not included in the book.\r
-\r
-\r
-//\r
-// CONIC  2D Bresenham-like conic drawer.\r
-//       CONIC(Sx,Sy, Ex,Ey, A,B,C,D,E,F) draws the conic specified\r
-//       by A x^2 + B x y + C y^2 + D x + E y + F = 0, between the\r
-//       start point (Sx, Sy) and endpoint (Ex,Ey).\r
-\r
-// Author: Andrew W. Fitzgibbon (andrewfg@ed.ac.uk),\r
-//         Machine Vision Unit,\r
-//         Dept. of Artificial Intelligence,\r
-//         Edinburgh University,\r
-//         \r
-// Date: 31-Mar-94\r
-\r
-#include <stdlib.h>\r
-#include <stdio.h>\r
-#include <math.h>\r
-\r
-static int DIAGx[] = {999, 1,  1, -1, -1, -1, -1,  1,  1};\r
-static int DIAGy[] = {999, 1,  1,  1,  1, -1, -1, -1, -1};\r
-static int SIDEx[] = {999, 1,  0,  0, -1, -1,  0,  0,  1};\r
-static int SIDEy[] = {999, 0,  1,  1,  0,  0, -1, -1,  0};\r
-static int BSIGNS[] = {99, 1,  1, -1, -1,  1,  1, -1, -1};\r
-\r
-int   debugging = 1;\r
-\r
-struct ConicPlotter {\r
-  virtual void plot(int x, int y);\r
-};\r
-\r
-struct DebugPlotter : public ConicPlotter {\r
-  int xs;\r
-  int ys;\r
-  int xe;\r
-  int ye;\r
-  int A;\r
-  int B;\r
-  int C;\r
-  int D;\r
-  int E;\r
-  int F;      \r
-\r
-  int octant;\r
-  int d;\r
-\r
-  void plot(int x, int y);\r
-};\r
-\r
-void DebugPlotter::plot(int x, int y)\r
-{\r
-  printf("%3d %3d\n",x,y);\r
-\r
-  if (debugging) {\r
-    // Translate start point to origin...\r
-    float tF = A*xs*xs + B*xs*ys + C*ys*ys + D*xs + E*ys + F;\r
-    float tD = D + 2 * A * xs + B * ys;\r
-    float tE = E + B * xs + 2 * C * ys;\r
-  \r
-    float tx = x - xs + ((float)DIAGx[octant] + SIDEx[octant])/2;\r
-    float ty = y - ys + ((float)DIAGy[octant] + SIDEy[octant])/2;\r
-    // Calculate F\r
-    \r
-    float td = 4*(A*tx*tx + B*tx*ty + C*ty*ty + tD*tx + tE*ty + tF);\r
-    \r
-    fprintf(stderr,"O%d ", octant);\r
-    if (d<0)\r
-      fprintf(stderr," Inside "); \r
-    else \r
-      fprintf(stderr,"Outside "); \r
-    float err = td - d;\r
-    fprintf(stderr,"Real(%5.1f,%5.1f) = %8.2f Recurred = %8.2f err = %g\n", \r
-            tx, ty, td/4, d/4.0f, err);\r
-    if (fabs(err) > 1e-14)\r
-      abort();\r
-  }\r
-  \r
-}\r
-\r
-inline int odd(int n)\r
-{\r
-  return n&1;\r
-}\r
-\r
-inline int abs(int a)\r
-{\r
-  if (a > 0)\r
-    return a;\r
-  else\r
-    return -a;\r
-}\r
-    \r
-int getoctant(int gx, int gy)\r
-{\r
-  // Use gradient to identify octant.\r
-  int upper = abs(gx)>abs(gy);\r
-  if (gx>=0)                            // Right-pointing\r
-    if (gy>=0)                          //    Up\r
-      return 4 - upper;\r
-    else                                //    Down\r
-      return 1 + upper;\r
-  else                                  // Left\r
-    if (gy>0)                           //    Up\r
-      return 5 + upper;\r
-    else                                //    Down\r
-      return 8 - upper;\r
-}\r
-\r
-int conic(int xs, int ys, int xe, int ye,\r
-          int A, int B, int C, int D, int E, int F,\r
-          ConicPlotter * plotterdata)\r
-{\r
-  A *= 4;\r
-  B *= 4;\r
-  C *= 4;\r
-  D *= 4;\r
-  E *= 4;\r
-  F *= 4;\r
-  \r
-  // Translate start point to origin...\r
-  F = A*xs*xs + B*xs*ys + C*ys*ys + D*xs + E*ys + F;\r
-  D = D + 2 * A * xs + B * ys;\r
-  E = E + B * xs + 2 * C * ys;\r
-  \r
-  // Work out starting octant\r
-  int octant = getoctant(D,E);\r
-  \r
-  int dxS = SIDEx[octant]; \r
-  int dyS = SIDEy[octant]; \r
-  int dxD = DIAGx[octant];\r
-  int dyD = DIAGy[octant];\r
-\r
-  int bsign = BSIGNS[octant];\r
-  int d,u,v;\r
-  switch (octant) {\r
-  case 1:\r
-    d = A + B/2 + C/4 + D + E/2 + F;\r
-    u = A + B/2 + D;\r
-    v = u + E;\r
-    break;\r
-  case 2:\r
-    d = A/4 + B/2 + C + D/2 + E + F;\r
-    u = B/2 + C + E;\r
-    v = u + D;\r
-    break;\r
-  case 3:\r
-    d = A/4 - B/2 + C - D/2 + E + F;\r
-    u = -B/2 + C + E;\r
-    v = u - D;\r
-    break;\r
-  case 4:\r
-    d = A - B/2 + C/4 - D + E/2 + F;\r
-    u = A - B/2 - D;\r
-    v = u + E;\r
-    break;\r
-  case 5:\r
-    d = A + B/2 + C/4 - D - E/2 + F;\r
-    u = A + B/2 - D;\r
-    v = u - E;\r
-    break;\r
-  case 6:\r
-    d = A/4 + B/2 + C - D/2 - E + F;\r
-    u = B/2 + C - E;\r
-    v = u - D;\r
-    break;\r
-  case 7:\r
-    d = A/4 - B/2 + C + D/2 - E + F;\r
-    u =  -B/2 + C - E;\r
-    v = u + D;\r
-    break;\r
-  case 8:\r
-    d = A - B/2 + C/4 + D - E/2 + F;\r
-    u = A - B/2 + D;\r
-    v = u - E;\r
-    break;\r
-  default:\r
-    fprintf(stderr,"FUNNY OCTANT\n");\r
-    abort();\r
-  }\r
-  \r
-  int k1sign = dyS*dyD;\r
-  int k1 = 2 * (A + k1sign * (C - A));\r
-  int Bsign = dxD*dyD;\r
-  int k2 = k1 + Bsign * B;\r
-  int k3 = 2 * (A + C + Bsign * B);\r
-\r
-  // Work out gradient at endpoint\r
-  int gxe = xe - xs;\r
-  int gye = ye - ys;\r
-  int gx = 2*A*gxe +   B*gye + D;\r
-  int gy =   B*gxe + 2*C*gye + E;\r
-  \r
-  int octantcount = getoctant(gx,gy) - octant;\r
-  if (octantcount <= 0)\r
-    octantcount = octantcount + 8;\r
-  fprintf(stderr,"octantcount = %d\n", octantcount);\r
-  \r
-  int x = xs;\r
-  int y = ys;\r
-  \r
-  while (octantcount > 0) {\r
-    if (debugging)\r
-      fprintf(stderr,"-- %d -------------------------\n", octant); \r
-    \r
-    if (odd(octant)) {\r
-      while (2*v <= k2) {\r
-        // Plot this point\r
-        ((DebugPlotter*)plotterdata)->octant = octant;\r
-        ((DebugPlotter*)plotterdata)->d = d;\r
-        plotterdata->plot(x,y);\r
-        \r
-        // Are we inside or outside?\r
-        if (d < 0) {                    // Inside\r
-          x = x + dxS;\r
-          y = y + dyS;\r
-          u = u + k1;\r
-          v = v + k2;\r
-          d = d + u;\r
-        }\r
-        else {                          // outside\r
-          x = x + dxD;\r
-          y = y + dyD;\r
-          u = u + k2;\r
-          v = v + k3;\r
-          d = d + v;\r
-        }\r
-      }\r
-    \r
-      d = d - u + v/2 - k2/2 + 3*k3/8; \r
-      // error (^) in Foley and van Dam p 959, "2nd ed, revised 5th printing"\r
-      u = -u + v - k2/2 + k3/2;\r
-      v = v - k2 + k3/2;\r
-      k1 = k1 - 2*k2 + k3;\r
-      k2 = k3 - k2;\r
-      int tmp = dxS; dxS = -dyS; dyS = tmp;\r
-    }\r
-    else {                              // Octant is even\r
-      while (2*u < k2) {\r
-        // Plot this point\r
-        ((DebugPlotter*)plotterdata)->octant = octant;\r
-        ((DebugPlotter*)plotterdata)->d = d;\r
-        plotterdata->plot(x,y);\r
-        \r
-        // Are we inside or outside?\r
-        if (d > 0) {                    // Outside\r
-          x = x + dxS;\r
-          y = y + dyS;\r
-          u = u + k1;\r
-          v = v + k2;\r
-          d = d + u;\r
-        }\r
-        else {                          // Inside\r
-          x = x + dxD;\r
-          y = y + dyD;\r
-          u = u + k2;\r
-          v = v + k3;\r
-          d = d + v;\r
-        }\r
-      }\r
-      int tmpdk = k1 - k2;\r
-      d = d + u - v + tmpdk;\r
-      v = 2*u - v + tmpdk;\r
-      u = u + tmpdk;\r
-      k3 = k3 + 4*tmpdk;\r
-      k2 = k1 + tmpdk;\r
-      \r
-      int tmp = dxD; dxD = -dyD; dyD = tmp;\r
-    }\r
-    \r
-    octant = (octant&7)+1;\r
-    octantcount--;\r
-  }\r
-\r
-  // Draw final octant until we reach the endpoint\r
-  if (debugging)\r
-    fprintf(stderr,"-- %d (final) -----------------\n", octant); \r
-    \r
-  if (odd(octant)) {\r
-    while (2*v <= k2 && x != xe && y != ye) {\r
-      // Plot this point\r
-      ((DebugPlotter*)plotterdata)->octant = octant;\r
-      ((DebugPlotter*)plotterdata)->d = d;\r
-      plotterdata->plot(x,y);\r
-      \r
-      // Are we inside or outside?\r
-      if (d < 0) {                      // Inside\r
-        x = x + dxS;\r
-        y = y + dyS;\r
-        u = u + k1;\r
-        v = v + k2;\r
-        d = d + u;\r
-      }\r
-      else {                            // outside\r
-        x = x + dxD;\r
-        y = y + dyD;\r
-        u = u + k2;\r
-        v = v + k3;\r
-        d = d + v;\r
-      }\r
-    }\r
-  }\r
-  else {                        // Octant is even\r
-    while ((2*u < k2) && (x != xe) && (y != ye)) {\r
-      // Plot this point\r
-      ((DebugPlotter*)plotterdata)->octant = octant;\r
-      ((DebugPlotter*)plotterdata)->d = d;\r
-      plotterdata->plot(x,y);\r
-      \r
-      // Are we inside or outside?\r
-      if (d > 0) {                      // Outside\r
-        x = x + dxS;\r
-        y = y + dyS;\r
-        u = u + k1;\r
-        v = v + k2;\r
-        d = d + u;\r
-      }\r
-      else {                            // Inside\r
-        x = x + dxD;\r
-        y = y + dyD;\r
-        u = u + k2;\r
-        v = v + k3;\r
-        d = d + v;\r
-      }\r
-    }\r
-  }\r
-\r
-\r
-\r
-  return 1;\r
-}\r
-\r
-main(int argc, char ** argv)\r
-{\r
-  DebugPlotter db;\r
-  db.xs = -7;\r
-  db.ys = -19;\r
-  db.xe = -8;\r
-  db.ye = -8;\r
-  db.A = 1424;\r
-  db.B = -964;\r
-  db.C = 276;\r
-  db.D = 0;\r
-  db.E = 0;\r
-  db.F = -40000;\r
-  conic(db.xs,db.ys,db.xe,db.ye,db.A,db.B,db.C,db.D,db.E,db.F, &db);\r
-}\r
diff --git a/16/PCGPE10/COPPER.PAS b/16/PCGPE10/COPPER.PAS
deleted file mode 100644 (file)
index 1d79111..0000000
+++ /dev/null
@@ -1,361 +0,0 @@
-{$X+}\r
-Program Copper;\r
-Uses Crt;\r
-\r
-\r
-\r
-Type\r
-   ColType = Record\r
-                R,\r
-                G,\r
-                B : Byte;\r
-             End;\r
-\r
-   PalType = Array[0..255] of ColType;\r
-\r
-   BarType = Record\r
-                Col : Array[1..20] of ColType;\r
-                Pos : Array[1..20] of Byte;\r
-                 UP : Array[1..20] of Boolean;\r
-             End;\r
-\r
-\r
-\r
-Var\r
-   Pal1 : PalType;\r
-   Bars : Array[1..40] Of BarType;\r
-   NumBars, NumLines : Byte;\r
-\r
-\r
-Procedure Pal(Col, R, G, B : Byte);\r
-Begin\r
-   Asm\r
-      mov   dx, 3c8h\r
-      mov   al, [Col]\r
-      out   dx, al\r
-      inc   dx\r
-      mov   al, [R]\r
-      out   dx, al\r
-      mov   al, [G]\r
-      out   dx, al\r
-      mov   al, [B]\r
-      out   dx, al\r
-   End;\r
-End;\r
-\r
-Procedure GetPal(Col : Byte; Var R, G, B : Byte);\r
-Var\r
-   Rt,Gt,Bt : Byte;\r
-Begin\r
-   Asm\r
-      mov   dx, 3c7h\r
-      mov   al, [Col]\r
-      out   dx, al\r
-      inc   dx\r
-      inc   dx\r
-      in    al, dx\r
-      mov   [Rt],al\r
-      in    al, dx\r
-      mov   [Gt],al\r
-      in    al, dx\r
-      mov   [Bt],al\r
-   End;\r
-   R := Rt;\r
-   G := Gt;\r
-   B := Bt;\r
-End;\r
-\r
-\r
-\r
-Procedure WaitRetrace; Assembler;\r
-Asm\r
-    mov   dx,3DAh\r
-@@1:\r
-    in    al,dx\r
-    and   al,08h\r
-    jnz   @@1\r
-@@2:\r
-    in    al,dx\r
-    and   al,08h\r
-    jz    @@2\r
-End;\r
-\r
-\r
-Procedure SetPal(Var Palet : PalType); Assembler;\r
-Asm\r
-   call  WaitRetrace\r
-   push  ds\r
-   lds   si, Palet\r
-   mov   dx, 3c8h\r
-   mov   al, 0\r
-   out   dx, al\r
-   inc   dx\r
-   mov   cx, 768\r
-   rep   outsb\r
-   pop   ds\r
-End;\r
-\r
-\r
-Procedure FadeOut(NoBars, BarSize : Byte);\r
-Var\r
-      F, L : Integer;\r
-   PalFade : PalType;\r
-\r
-Begin\r
-   For F := 1 to NoBars do\r
-      For L := 1 to BarSize do\r
-      Begin\r
-         If Bars[F].Col[L].R > 0 Then Dec(Bars[F].Col[L].R);\r
-         If Bars[F].Col[L].G > 0 Then Dec(Bars[F].Col[L].G);\r
-         If Bars[F].Col[L].B > 0 Then Dec(Bars[F].Col[L].B);\r
-      End;\r
-End;\r
-\r
-\r
-\r
-Procedure SetMcga;\r
-Begin\r
-   Asm\r
-      mov   ax, 0013h\r
-      int   10h\r
-   End;\r
-End;\r
-\r
-Procedure SetText;\r
-Begin\r
-   Asm\r
-      mov   ax, 0003h\r
-      int   10h\r
-   End;\r
-End;\r
-\r
-\r
-\r
-Procedure DrawCopper(NoLines,  StartCol, YStart : Byte);\r
-Var\r
-   Loop : Word;\r
-Begin\r
-   For Loop := YStart to YStart + NoLines do\r
-   Begin\r
-      FillChar(Mem[$a000:Loop*320],320,StartCol+Loop-YStart);\r
-   End;\r
-End;\r
-\r
-\r
-Procedure SetCopperPal(NoBars, BarSize, YStart, ColStart, Space : Byte);\r
-Var\r
-      Loop : Byte;\r
-     Loop2 : Word;\r
-      IncR : Byte;\r
-       RGB : Byte;\r
-   HalfBar : Byte;\r
-\r
-Begin\r
-   FillChar(Bars, SizeOf (Bars),0);\r
-   HalfBar := BarSize Div 2;\r
-   IncR := 63 Div HalfBar;\r
-   RGB := 0;\r
-   For Loop := 1 to NoBars do\r
-   Begin\r
-      For Loop2 := 1 to HalfBar do\r
-      Begin\r
-         If RGB = 0 Then\r
-         Bars[Loop].Col[Loop2].R := Loop2 * IncR;\r
-         If RGB = 1 Then\r
-         Bars[Loop].Col[Loop2].G := Loop2 * IncR;\r
-         If RGB = 2 Then\r
-         Bars[Loop].Col[Loop2].B := Loop2 * IncR;\r
-\r
-         Bars[Loop].Pos[Loop2] := YStart + (Loop-1) * (BarSize+Space) + Loop2 -1 + ColStart;\r
-         Bars[Loop].UP[Loop2] := True\r
-      End;\r
-\r
-      For Loop2 := HalfBar + 1  to BarSize  do\r
-      Begin\r
-         If RGB = 0 Then\r
-         Bars[Loop].Col[Loop2].R := (BarSize - Loop2) * IncR;\r
-         If RGB = 1 Then\r
-         Bars[Loop].Col[Loop2].G := (BarSize - Loop2) * IncR;\r
-         If RGB = 2 Then\r
-         Bars[Loop].Col[Loop2].B := (BarSize - Loop2) * IncR;\r
-\r
-         Bars[Loop].Pos[Loop2] := YStart + (Loop-1) * (BarSize+Space) + Loop2 -1 + ColStart;\r
-         Bars[Loop].UP[Loop2] := True\r
-      End;\r
-\r
-      RGB := (RGB + 1) Mod 3;\r
-   End;\r
-\r
-End;\r
-\r
-\r
-\r
-\r
-Procedure RotatePal(NoBars, BarSize, YStart, StartCol, NumLines : Byte;\r
-                    Up : Boolean);\r
-\r
-Var\r
-   TPal : PalType;\r
-   TCol : ColType;\r
-   Loop,\r
-   Loop2 : Byte;\r
-\r
-Begin\r
-   FillChar(TPal, 768, 0);\r
-   For Loop := 1 to NoBars do\r
-   Begin\r
-      For Loop2 := 1 to BarSize do\r
-      Begin\r
-         TPal[Bars[Loop].Pos[Loop2]] := Bars[Loop].Col[Loop2];\r
-         If Up Then\r
-         Begin\r
-            If Bars[Loop].Pos[Loop2] = StartCol Then\r
-            Bars[Loop].UP[Loop2] := False;\r
-            If Bars[Loop].Pos[Loop2] = NumLines Then\r
-            Bars[Loop].UP[Loop2] := True;\r
-\r
-            If Bars[Loop].UP[Loop2] Then\r
-            Dec(Bars[Loop].Pos[Loop2])\r
-            Else\r
-            Inc(Bars[Loop].Pos[Loop2]);\r
-\r
-         End;\r
-      End;\r
-\r
-   End;\r
-   SetPal(TPal);\r
-\r
-End;\r
-\r
-\r
-Procedure SetUP(NumLines, NumBars, BarSize, YStart, ColStart, Space : Byte);\r
-Begin\r
-   SetMcga;\r
-   DrawCopper(NumLines,ColStart,YStart);\r
-   SetCopperPal(NumBars, BarSize, YStart, ColStart, Space);\r
-End;\r
-\r
-\r
-Procedure DoItAll;\r
-Var\r
-   NumLines,\r
-   NumBars,\r
-   BarSize,\r
-   YStart,\r
-   ColStart,\r
-   Space : Byte;\r
-   Loop : Byte;\r
-\r
-Begin\r
-   NumLines := 200;\r
-   NumBars := 10;\r
-   BarSize := 10;\r
-   YStart := 0;\r
-   ColStart := 1;\r
-   Space := 5;\r
-   SetUP(NumLines, NumBars, BarSize, YStart, ColStart, Space);\r
-   Repeat\r
-       RotatePal(NumBars, BarSize,YStart, ColStart, NumLines, True);\r
-       If KeyPressed Then\r
-       Begin\r
-          For Loop := 0 to 63 do\r
-          Begin\r
-             RotatePal(NumBars, BarSize,YStart, ColStart, NumLines, True);\r
-             FadeOut(NumBars, BarSize);\r
-          End;\r
-          Exit;\r
-       End;\r
-   Until False;\r
-End;\r
-\r
-\r
-\r
-Procedure Creds;\r
-Var\r
-      R, G, B : Byte;\r
-   R1, G1, B1 : Byte;\r
-         Loop : Byte;\r
-\r
-Begin\r
-   SetText;\r
-   While KeyPressed do ReadKey;\r
-\r
-   Asm\r
-      mov   ah, 1\r
-      mov   ch, 1\r
-      mov   cl, 0\r
-      int   10h\r
-   End;\r
-\r
-   GetPal(7,R,G,B);\r
-   Pal(7,0,0,0);\r
-   WriteLn('Copper Bars Trainer...');\r
-   WriteLn;\r
-   WriteLn('By EzE of Asphyxia.');\r
-   WriteLn;\r
-   WriteLn('Contact Us on ...');\r
-   WriteLn;\r
-   WriteLn;\r
-   WriteLn('the Asphyxia BBS (031) - 7655312');\r
-   WriteLn;\r
-   WriteLn('Email :       eze@');\r
-   WriteLn('         asphyxia@');\r
-   WriteLn('          edwards@');\r
-   WriteLn('           bailey@');\r
-   WriteLn('          mcphail@');\r
-   WriteLn('                  beastie.cs.und.ac.za');\r
-   WriteLn;\r
-   WriteLn('or  peter.edwards@datavert.co.za');\r
-   WriteLn;\r
-   WriteLn('Write me snail-mail at...');\r
-   WriteLn('P.O. Box 2313');\r
-   WriteLn('Hillcrest');\r
-   WriteLn('Natal');\r
-   WriteLn('3650');\r
-   R1 := 0;\r
-   G1 := 0;\r
-   B1 := 0;\r
-   For Loop := 0 to 63 do\r
-   Begin\r
-      WaitRetrace;\r
-      WaitRetrace;\r
-      Pal(7, R1, G1, B1);\r
-      If R1 < R Then Inc(R1);\r
-      If G1 < G Then Inc(G1);\r
-      If B1 < B Then Inc(B1);\r
-   End;\r
-   Asm\r
-      mov   ah, 1\r
-      mov   ch, 1\r
-      mov   cl, 0\r
-      int   10h\r
-   End;\r
-\r
-End;\r
-\r
-\r
-Procedure Fadecurs;\r
-Var\r
-   Loop : Byte;\r
-   R, G, B : Byte;\r
-Begin\r
-   GetPal(7, R, G, B);\r
-   For Loop := 0 to 63 do\r
-   Begin\r
-      WaitRetrace;\r
-      WaitRetrace;\r
-      Pal(7, R, G, B);\r
-      If R > 0 Then Dec(R);\r
-      If G > 0 Then Dec(G);\r
-      If B > 0 Then Dec(B);\r
-   End;\r
-End;\r
-\r
-\r
-Begin\r
-   TextAttr := $07;\r
-   While KeyPressed do ReadKey;\r
-   FadeCurs;\r
-   DoItAll;\r
-   Creds;\r
-End.
\ No newline at end of file
diff --git a/16/PCGPE10/CPUTYPE.TXT b/16/PCGPE10/CPUTYPE.TXT
deleted file mode 100644 (file)
index d8cc7b3..0000000
+++ /dev/null
@@ -1,245 +0,0 @@
-                   ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-                   ³ Testing the Intel CPU Type ³\r
-                   ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-            Written for the PC-GPE by Mark Feldman\r
-            e-mail address : u914097@student.canberra.edu.au\r
-                             myndale@cairo.anu.edu.au\r
-\r
-           ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-           ³      THIS FILE MAY NOT BE DISTRIBUTED     ³\r
-           ³ SEPERATE TO THE ENTIRE PC-GPE COLLECTION. ³\r
-           ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Disclaimer ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-I assume no responsibility whatsoever for any effect that this file, the\r
-information contained therein or the use thereof has on you, your sanity,\r
-computer, spouse, children, pets or anything else related to you or your\r
-existance. No warranty is provided nor implied with this information.\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Introduction ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-Believe it or not there are people in the world who still own 8088s! Heck I\r
-only just upgraded my 286 to a 486SUX33 a couple of months ago.\r
-\r
-As we all know, 286's and below just don't make the cut anymore, and even\r
-386's are becoming a thing of the past. Personally I think a program should\r
-politely tell someone they are a phleb rather than unceremoniously hanging\r
-their machine for them.\r
-\r
-This text file will show one mothed of detecting the CPU type. Unfortunately\r
-I don't have a Pentium op code list so it'll only detect up to a 486.\r
-\r
-Most of the information in this file came from a well documented assembly\r
-program available on various ftp sites called 80486.asm, written by Robert\r
-Collins. I tried calling Robert for permission to use his original file, but\r
-he appears to have moved house.\r
-\r
-ÚÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Method ³\r
-ÀÄÄÄÄÄÄÄÄÙ\r
-\r
-80186 chips and higher generate an interrupt 6 when they come across an\r
-instruction they don't support, this provides us with a real simple method\r
-of determining the cpu type (coupled with the trap interrupt it would\r
-conceivably also allow us to write a Pentium emulator for the 80286, but\r
-that's another story). We simply have to try execting a 486 command, if it\r
-causes an interrupt 6 then we know the machine is a 386 or lower.\r
-\r
-The op codes used in the program below all modify the dx register.\r
-\r
-     ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-     ³  Op Code           Machine Language Bytes   Supported by      ³\r
-     ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´\r
-     ³  shl  dx, 5               C1 E2 05           80186 and higher ³\r
-     ³  smsw dx                  0F 01 E2           80286 and higher ³\r
-     ³  mov  edx, cr0            0F 20 C2           80386 and higher ³\r
-     ³  xadd dx, dx              0F C1 D2           80486 and higher ³\r
-     ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-When an interrupt 6 is generated you have to modify the value of the IP\r
-register which was pushed onto the stack when the interrupt occurred,\r
-otherwise the CPU will go back to it after the interrupt and keep trying\r
-to execute it. Each of the instructions in the table above are 3 bytes long\r
-so our interrupt handler can simply add 3 to the IP value on the stack.\r
-\r
-Identifying an 8088 chip is even simpler. If you push the SP register onto\r
-the stack the 8088 increments the SP value before it pushes it, the other\r
-chips all increment it afterwards. So to test for the presence of an 8088\r
-push SP onto the stack and pop it off into another variable, say AX. If AX\r
-and SP are not equal then the chip is an 8088.\r
-\r
-Keep in mind that you *MUST* check for the presence of an 8088 before\r
-doing anything else. Attempting to execute an invalid op code on an 8088\r
-will cause it to hang. Each of the functions in the unit below check for\r
-an 8088 first to prevent this happening.\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ A Pascal Unit to Test the CPU Type ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-The following pascal unit contains some functions your program can use to\r
-make sure it's running on the right kind of machine. If your program will\r
-only work on a 386 and higher (for example) then put this unit first in your\r
-Uses clause and modify the unit's initialization code to terminate the\r
-program if the wrong CPU type is detected. The unit's current initialization\r
-simply test the CPU type and store it in the 'cpu' variable.\r
-\r
-{\r
-\r
-  CPUTYPE - A Pascal Unit to Test the CPU Type\r
-            By Mark Feldman u914097@student.canberra.edu\r
-                            myndale@cairo.anu.edu.au\r
-\r
-            Based on an original assembly program by Robert Collins.\r
-\r
-\r
-}\r
-\r
-\r
-Unit CPUTYPE;\r
-\r
-\r
-Interface\r
-\r
-const CPU_8088    =  0;\r
-      CPU_80186   =  1;\r
-      CPU_80286   =  2;\r
-      CPU_80386   =  3;\r
-      CPU_80486   =  4;\r
-      CPU_UNKNOWN = -1;\r
-\r
-{ The cpu variable is initialised to the cpu type }\r
-var cpu : integer;\r
-\r
-{ Isa8088 returns true only if cpu is an 8088 or 8086 }\r
-function Isa8088 : boolean;\r
-\r
-{ Isa80186 returns true if cpu is an 80186 or higher }\r
-function Isa80186 : boolean;\r
-\r
-{ Isa80286 returns true if cpu is an 80286 or higher }\r
-function Isa80286 : boolean;\r
-\r
-{ Isa80386 returns true if cpu is an 80386 or higher }\r
-function Isa80386 : boolean;\r
-\r
-{ Isa80486 returns true if cpu is an 80486 or higher }\r
-function Isa80486 : boolean;\r
-\r
-\r
-\r
-\r
-Implementation\r
-\r
-Uses Dos;\r
-\r
-var OldIntr6Handler : procedure;\r
-      valid_op_code : boolean;\r
-\r
-procedure Intr6Handler;\r
-interrupt;\r
-begin\r
-  valid_op_code := false;\r
-\r
-  { Stoopid TP7 won't let me modify IP directly }\r
-  asm\r
-    add word ptr ss:[bp + 18], 3\r
-  end;\r
-end;\r
-\r
-function Isa8088 : boolean;\r
-var sp1, sp2 : word;\r
-begin\r
-  asm\r
-    mov sp1, sp\r
-    push sp\r
-    pop sp2\r
-  end;\r
-  if sp1 <> sp2 then\r
-    Isa8088 := true\r
-  else\r
-    Isa8088 := false;\r
-end;\r
-\r
-function Isa80186 : boolean;\r
-begin\r
-  if Isa8088 then\r
-    Isa80186 := false\r
-  else\r
-    begin\r
-      valid_op_code := true;\r
-      GetIntVec(6, @OldIntr6Handler);\r
-      SetIntVec(6, Addr(Intr6Handler));\r
-      inline($C1/$E2/$05);  { shl dx, 5 }\r
-      SetIntVec(6, @OldIntr6Handler);\r
-      Isa80186 := valid_op_code;\r
-    end;\r
-end;\r
-\r
-function Isa80286 : boolean;\r
-begin\r
-  if Isa8088 then\r
-    Isa80286 := false\r
-  else\r
-    begin\r
-      valid_op_code := true;\r
-      GetIntVec(6, @OldIntr6Handler);\r
-      SetIntVec(6, Addr(Intr6Handler));\r
-      inline($0F/$01/$E2);  { smsw dx }\r
-      SetIntVec(6, @OldIntr6Handler);\r
-      Isa80286 := valid_op_code;\r
-    end;\r
-end;\r
-\r
-function Isa80386 : boolean;\r
-begin\r
-  if Isa8088 then\r
-    Isa80386 := false\r
-  else\r
-    begin\r
-      valid_op_code := true;\r
-      GetIntVec(6, @OldIntr6Handler);\r
-      SetIntVec(6, Addr(Intr6Handler));\r
-      inline($0F/$20/$C2);  { mov edx, cr0 }\r
-      SetIntVec(6, @OldIntr6Handler);\r
-      Isa80386 := valid_op_code;\r
-    end;\r
-end;\r
-\r
-function Isa80486 : boolean;\r
-begin\r
-  if Isa8088 then\r
-    Isa80486 := false\r
-  else\r
-    begin\r
-      valid_op_code := true;\r
-      GetIntVec(6, @OldIntr6Handler);\r
-      SetIntVec(6, Addr(Intr6Handler));\r
-      inline($0F/$C1/$D2);  { xadd dx, dx }\r
-      SetIntVec(6, @OldIntr6Handler);\r
-      Isa80486 := valid_op_code;\r
-    end;\r
-end;\r
-\r
-\r
-begin\r
-  if Isa8088 then\r
-    cpu := CPU_8088\r
-  else if Isa80486 then\r
-    cpu := CPU_80486\r
-  else if Isa80386 then\r
-    cpu := CPU_80386\r
-  else if Isa80286 then\r
-    cpu := CPU_80286\r
-  else if Isa80186 then\r
-    cpu := CPU_80186\r
-  else\r
-    cpu := CPU_UNKNOWN;\r
-end.\r
diff --git a/16/PCGPE10/DMA_VLA.TXT b/16/PCGPE10/DMA_VLA.TXT
deleted file mode 100644 (file)
index fba1775..0000000
+++ /dev/null
@@ -1,506 +0,0 @@
-\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-                       INTRO TO DMA by Draeden of VLA\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-    \r
-\r
-    DMA means Direct Memory Access.  You probably already know where and\r
-why you use it, so I'll skip right down to the dirty stuff.  This all \r
-should speak for it's self, so... Enjoy.\r
-\r
-    Draeden /VLA\r
-\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-\r
-    To do a DMA transfer, you need to know a few things:\r
-\r
-        1)  Address of the memory to access\r
-\r
-        2)  Length of data to read/write\r
-\r
-    This can all be put into a structure:\r
-    \r
-STRUC DMAInfo\r
-    Page        db  ?\r
-    Offset      dw  ?\r
-    Length      dw  ?\r
-ENDS\r
-\r
-    Page is the highest 4 bits of the absolute 20 bit address of the memory\r
-location.  Note that DMA transfers CANNOT cross 64k page boundries.\r
-    \r
-    The Length is actually LENGTH-1; sending in a 0 will move 1 byte,\r
-sending a 0FFFFh will move 64k.\r
-\r
-    ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-    ; IN: DX:AX = segment/offset address of memory area\r
-    ;\r
-    ;OUT: DH = Page (0-F)  (DL is destroyed)\r
-    ;     AX = Offset\r
-    ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-PROC MakePage\r
-    push    bx\r
-\r
-    mov     bl,dh\r
-    shr     bl,4    ;isolate upper 4 bits of segment\r
-\r
-    shl     dx,4    ;make segment into ABS address\r
-    add     ax,dx   ;add the offset and put it in AX\r
-    adc     bl,0    ;complete the addition\r
-\r
-    mov     dh,bl   ;put the PAGE where it goes\r
-\r
-    pop     bx      ; DH:AX is now the PAGE:OFFSET address\r
-    ret\r
-ENDP\r
-\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-    Programming DMA channels 0 thru 3\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-    There are 3 ports that are DMA channel specific:\r
-\r
-        1) The Page register\r
-        2) The DMA count (length) register\r
-        3) The memory address (offset register)\r
-\r
-    They are as follows:\r
-\r
-DMACH   PAGE    ADDRESS  LENGTH\r
\r
- 0       87h       0       1\r
-\r
- 1       83h       2       3\r
-\r
- 2       81h       4       5\r
-\r
- 3       82h       6       7\r
-\r
-        \r
-    And now some general registers:\r
-\r
- DMA Mask Register:  0Ah\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-        bit 7 - 3 = 0  Reserved\r
-\r
-            bit 2 = 0  clear mask\r
-                  = 1  set mask\r
-\r
-       bits 1 - 0 = 00 Select channel 0\r
-                  = 01 select channel 1\r
-                  = 10 select channel 2\r
-                  = 11 select channel 3\r
-\r
-       USE: You must set the mask of the channel before you\r
-            can reprogram it.\r
-\r
- DMA Mode Register:  0Bh\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-        bit 7 - 6 = 00 Demand mode\r
-                  = 01 Signal mode\r
-                  = 10 Block mode\r
-                  = 11 Cascade mode\r
-\r
-        bit 5 - 4 = 0  Reserved\r
-\r
-        bit 3 - 2 = 00 Verify operation\r
-                  = 01 Write operation\r
-                  = 10 Read operation\r
-                  = 11 Reserved\r
-\r
-       bits 1 - 0 = 00 Select channel 0\r
-                  = 01 select channel 1\r
-                  = 10 select channel 2\r
-                  = 11 select channel 3\r
-\r
-       USE: Tell the DMAC what to do. Common modes are:\r
-\r
-            48h (Read operation, Signal mode)\r
-                Used to read data from host memory and send to whomever\r
-                polls it.\r
-\r
-            44h (Write operation, Signal mode)\r
-                Used to write data taken from a device to memory.\r
-\r
-DMA clear byte ptr:  0Ch\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-       USE: Send a zero to reset the internal ptrs\r
-\r
-\r
-\r
-    WHAT TO DO:\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-\r
-    1) Set the Mask bit for the channel\r
-\r
-        mov     al,4\r
-        add     al,[DMA_Channel]\r
-        out     0ah,al\r
-\r
-    2) Clear Byte Ptr\r
-\r
-        sub     al,al\r
-        out     0Ch,al\r
-\r
-    3) Set the DMA transfer mode\r
-\r
-        mov     al,48h                  ;MODE output (read)\r
-        add     al,[DMA_Channel]\r
-        out     0Bh,al\r
-\r
-    4) Set the memory ADDRESS and LENGTH\r
-\r
-        ;        AX = offset\r
-        ;        CX = Length\r
-        ;[DMA_Base] = port # of memory address\r
-        \r
-        mov     dx,[DMA_Base]\r
-        out     dx,al                   ;send lower byte address\r
-        mov     al,ah\r
-        out     dx,al                   ;send high byte address\r
-\r
-        inc     dl                  ;point to Count port\r
-        mov     al,cl\r
-        out     dx,al                   ;send low byte length\r
-        mov     al,ch\r
-        out     dx,al                   ;send high byte length\r
-\r
-    5) Set the DMA page\r
-\r
-        ; AL = Page\r
-\r
-        mov     dx,[Dma_Page]\r
-        out     dx,al                   ; write the Page\r
-\r
-    6) Clear DMA mask bit\r
-\r
-        mov     al,[byte DMA_Channel]\r
-        out     0Ah,al                  ; port 0Ah, DMA-1 mask reg bit\r
-\r
-    7) Program the other device that is going to use the DMA output/input\r
-\r
-\r
-    ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-    ; This routine programs the DMAC for channels 0-3\r
-    ;\r
-    ; IN: [DMA_Channel], [DMAbaseAdd], [DMApageReg] must be setup\r
-    ;       [DAMBaseAdd] =  Memory Address port\r
-    ;\r
-    ;     dh = mode\r
-    ;     ax = address\r
-    ;     cx = length  \r
-    ;     dl = page\r
-    ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-PROC Prog_DMA03 NEAR\r
-        push    bx\r
-        mov     bx,ax\r
-\r
-        mov     al,4\r
-        add     al,[DMA_Channel]\r
-        out     0Ah,al          ; mask reg bit\r
-\r
-        sub     al,al\r
-        out     0Ch,al          ; clr byte ptr\r
-\r
-        mov     al,dh\r
-        add     al,[DMA_Channel]\r
-        out     0Bh,al          ; set mode reg\r
-\r
-        push    dx\r
-        \r
-        mov     dx,[DMAbaseAdd]\r
-        mov     al,bl\r
-        out     dx,al           ; set base address low\r
-        mov     al,bh\r
-        out     dx,al           ; set base address high\r
-\r
-        inc     dx              ;point to length\r
-        mov     al,cl\r
-        out     dx,al           ; set length low\r
-        mov     al,ch\r
-        out     dx,al           ; set length high\r
-\r
-        pop     dx\r
-\r
-        mov     al,dl\r
-        mov     dx,[DmaPageReg]\r
-        out     dx,al           ; set DMA page reg\r
-\r
-        mov     al,[DMA_Channel]\r
-        out     0Ah,al          ; unmask (activate) dma channel\r
-        pop     bx\r
-        ret\r
-ENDP\r
-\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-    Programming DMA channels 4 thru 7\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-\r
-    Again, there are 3 ports that are DMA channel specific:\r
-\r
-        1) The Page register\r
-        2) The DMA count (length) register\r
-        3) The memory address (offset register\r
-\r
-    They are as follows:\r
-\r
-DMACH   PAGE    ADDRESS  LENGTH\r
\r
- 4       8Fh      C0h      C2h  \r
-\r
- 5       8Bh      C4h      C6h  \r
-\r
- 6       89h      C8h      CAh  \r
-\r
- 7       8Ah      CCh      CEh \r
-\r
-\r
-    And now some general registers:\r
-\r
- DMA Mask Register: 0D4h\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-        bit 7 - 3 = 0  Reserved\r
-\r
-            bit 2 = 0  clear mask\r
-                  = 1  set mask\r
-\r
-       bits 1 - 0 = 00 Select channel 4\r
-                  = 01 select channel 5\r
-                  = 10 select channel 6\r
-                  = 11 select channel 7\r
-\r
-       USE: You must set the mask of the channel before you\r
-            can reprogram it.\r
-\r
- DMA Mode Register: 0D6h\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-        bit 7 - 6 = 00 Demand mode\r
-                  = 01 Signal mode\r
-                  = 10 Block mode\r
-                  = 11 Cascade mode\r
-\r
-        bit 5 - 4 = 0  Reserved\r
-\r
-        bit 3 - 2 = 00 Verify operation\r
-                  = 01 Write operation\r
-                  = 10 Read operation\r
-                  = 11 Reserved\r
-\r
-       bits 1 - 0 = 00 Select channel 4\r
-                  = 01 select channel 5\r
-                  = 10 select channel 6\r
-                  = 11 select channel 7\r
-\r
-       USE: Tell the DMAC what to do. Common modes are:\r
-\r
-            48h (Read operation, Signal mode)\r
-                Used to read data from host memory and send to whomever\r
-                polls it.\r
-\r
-            44h (Write operation, Signal mode)\r
-                Used to write data taken from a device to memory.\r
-\r
-DMA clear byte ptr: 0D8h\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-       USE: Send a zero to reset the internal ptrs\r
-\r
-\r
-    WHAT TO DO: (exactly the same thing, just different io PORTs)\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-\r
-    1) Set the Mask bit for the channel\r
-\r
-        mov     al,[DMA_Channel]    ;because the DMA's are 4-7, bit #3\r
-        out     0D4h,al             ; is already set\r
-\r
-    2) Clear Byte Ptr\r
-\r
-        sub     al,al\r
-        out     0D8h,al\r
-\r
-    3) Set the DMA transfer mode\r
-        \r
-        mov     al,[DMA_Channel]\r
-        sub     al,4\r
-        or      al,48h                  ;MODE output (read)\r
-        out     0D6h,al\r
-\r
-    4) Set the memory ADDRESS and LENGTH\r
-\r
-        ;        AX = offset\r
-        ;        CX = Length\r
-        ;[DMA_Base] = port # of memory address\r
-        \r
-        mov     dx,[DMA_Base]\r
-        out     dx,al                   ;send lower byte address\r
-        mov     al,ah\r
-        out     dx,al                   ;send high byte address\r
-\r
-        add     dl,2                ;point to Count port (seperated by 2)\r
-        mov     al,cl\r
-        out     dx,al                   ;send low byte length\r
-        mov     al,ch\r
-        out     dx,al                   ;send high byte length\r
-\r
-    5) Set the DMA page\r
-\r
-        ; AL = Page\r
-\r
-        mov     dx,[Dma_Page]\r
-        out     dx,al                   ; write the Page\r
-\r
-    6) Clear DMA mask bit\r
-\r
-        mov     al,[byte DMA_Channel]\r
-        and     al,00000011b\r
-        out     0d4h,al                 ; port 0Ah, DMA-1 mask reg bit\r
-\r
-    7) Program the other device that is going to use the DMA output/input\r
-\r
-\r
-    ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-    ; This routine programs the DMAC for channels 4-7\r
-    ;\r
-    ; IN: [DMA_Channel], [DMAbaseAdd], [DMApageReg] must be setup\r
-    ;       [DAMBaseAdd] =  Memory Address port\r
-    ;\r
-    ;     dh = mode\r
-    ;     ax = address\r
-    ;     cx = length  \r
-    ;     dl = page\r
-    ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-PROC Prog_DMA47 NEAR\r
-        push    bx\r
-        mov     bx,ax\r
-\r
-        mov     al,[DMA_Channel]\r
-        out     0D4h,al         ; mask reg bit\r
-\r
-        sub     al,al\r
-        out     0D8h,al         ; clr byte ptr\r
-\r
-        mov     al,[DMA_Channel]\r
-        sub     al,4\r
-        add     al,dh\r
-        out     0D6h,al         ; set mode reg\r
-\r
-        push    dx\r
-\r
-        mov     dx,[DMAbaseAdd]\r
-        mov     al,bl\r
-        out     dx,al           ; set base address low\r
-        mov     al,bh\r
-        out     dx,al           ; set base address high\r
-\r
-        add     dl,2            ;point to length\r
-        mov     al,cl\r
-        out     dx,al           ; set length low\r
-        mov     al,ch\r
-        out     dx,al           ; set length high\r
-\r
-        pop     dx\r
-\r
-        mov     al,dl\r
-        mov     dx,[DmaPageReg]\r
-        out     dx,al           ; set DMA page reg\r
-\r
-        mov     al,[DMA_Channel]\r
-        and     al,00000011b\r
-        out     0D4h,al         ; unmask (activate) dma channel\r
-        pop     bx\r
-        ret\r
-ENDP\r
-\r
-    ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-    ; This routine programs the DMAC for channels 0-7\r
-    ;\r
-    ; IN: [DMA_Channel], [DMAbaseAdd], [DMApageReg] must be setup\r
-    ;       [DAMBaseAdd] =  Memory Address port\r
-    ;\r
-    ;     dh = mode\r
-    ;     ax = address\r
-    ;     cx = length  \r
-    ;     dl = page\r
-    ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-PROC Prog_DMA NEAR\r
-        push    bx\r
-        mov     bx,ax\r
-\r
-        cmp     [DMA_Channel],4\r
-        jb      @@DoDMA03\r
-\r
-        mov     al,[DMA_Channel]\r
-        out     0D4h,al         ; mask reg bit\r
-\r
-        sub     al,al\r
-        out     0D8h,al         ; clr byte ptr\r
-\r
-        mov     al,[DMA_Channel]\r
-        sub     al,4\r
-        add     al,dh\r
-        out     0D6h,al         ; set mode reg\r
-\r
-        push    dx\r
-\r
-        mov     dx,[DMAbaseAdd]\r
-        mov     al,bl\r
-        out     dx,al           ; set base address low\r
-        mov     al,bh\r
-        out     dx,al           ; set base address high\r
-\r
-        add     dl,2            ;point to length\r
-        mov     al,cl\r
-        out     dx,al           ; set length low\r
-        mov     al,ch\r
-        out     dx,al           ; set length high\r
-\r
-        pop     dx\r
-\r
-        mov     al,dl\r
-        mov     dx,[DmaPageReg]\r
-        out     dx,al           ; set DMA page reg\r
-\r
-        mov     al,[DMA_Channel]\r
-        and     al,00000011b\r
-        out     0D4h,al         ; unmask (activate) dma channel\r
-        pop     bx\r
-        ret\r
-\r
-@@DoDMA03:\r
-        mov     al,4\r
-        add     al,[DMA_Channel]\r
-        out     0Ah,al          ; mask reg bit\r
-\r
-        sub     al,al\r
-        out     0Ch,al          ; clr byte ptr\r
-\r
-        mov     al,dh\r
-        add     al,[DMA_Channel]\r
-        out     0Bh,al          ; set mode reg\r
-\r
-        push    dx\r
-        \r
-        mov     dx,[DMAbaseAdd]\r
-        mov     al,bl\r
-        out     dx,al           ; set base address low\r
-        mov     al,bh\r
-        out     dx,al           ; set base address high\r
-\r
-        inc     dx              ;point to length\r
-        mov     al,cl\r
-        out     dx,al           ; set length low\r
-        mov     al,ch\r
-        out     dx,al           ; set length high\r
-\r
-        pop     dx\r
-\r
-        mov     al,dl\r
-        mov     dx,[DmaPageReg]\r
-        out     dx,al           ; set DMA page reg\r
-\r
-        mov     al,[DMA_Channel]\r
-        out     0Ah,al          ; unmask (activate) dma channel\r
-        pop     bx\r
-        ret\r
-ENDP\r
diff --git a/16/PCGPE10/DOOM.TXT b/16/PCGPE10/DOOM.TXT
deleted file mode 100644 (file)
index 3e2f25f..0000000
+++ /dev/null
@@ -1,505 +0,0 @@
-\r
-******************************************************************************\r
-*                       'Doom' 3D Engine techniques                          *\r
-******************************************************************************\r
-By Brian 'Neuromancer' Marshall\r
-(Email: brianm@vissci.demon.co.uk)\r
-\r
-        This document is submitted subject to certain conditions:\r
-\r
-1. This Document is not in any way related to Id Software, and is \r
-   not meant to be representive of their techniques : it is based\r
-   upon my own investigations of a realtime 3d engine that produces\r
-   a screen display similar to 'Doom' by Id software.\r
-\r
-2. I take no responsibility for any damange to data or computer equipment\r
-   caused by attempts to implement these algorithms.\r
-\r
-3. Although I have made every attempt to ensure that this document is error\r
-   free i take no responsability for any errors it may contain.\r
-\r
-4. Anyone is free to use this information as they wish, however I would\r
-   appreciate being credited if the information has been useful.\r
-\r
-5. I take no responsability for the spelling or grammar.\r
-   (My written english is none too good...so I won't take offence\r
-    at any corrections: I am a programmer not a writer...)\r
-\r
-        Right now that that little lot is out of the way I will start this\r
-document proper....\r
-\r
-1:  Definition of Terms\r
-======================\r
-\r
-        Throughout this document I will be making use of many graphical terms\r
-using my understanding of them as they apply to this algorithm. I will\r
-explain all the terms below. Feel free to skip this part....\r
-\r
-Texture:\r
-        A texture for the purpose of this is a square image.\r
-\r
-U and V:\r
-        U and V are the equivelants of x and y but are in texture space.\r
-ie They are the the two axies of the two dimensional texture.\r
-\r
-Screen:\r
-        For my purposes 'screen' is the window we wish to fill: it doesn't\r
-have to be the whole screen.\r
-\r
-Affine Mapping:\r
-        A affine mapping is a texture map where the texture is sampled\r
-in a linear fashion in both U and V.\r
-\r
-Biquadratic Mapping:\r
-        A biquadratic mapping is a mapping where the texture is sampled\r
-along a curve in both U and V that approximates the perspective transform.\r
-This gives almost proper forshortening.\r
-\r
-\r
-Projective Mapping:\r
-        A projective mapping is a mapping where a changing homogenous\r
-coordinated is added to the texture coordinateds to give (U,V,W) and\r
-a division is performed at every pixel. This is the mathematically and\r
-visual correct for of texture mapping for the square to quadrilateral\r
-mappings we are using.\r
-        (As an aside it is possible to do a projective mapping without\r
-the divide (or 3 multiplies) but that is totally unrelated to the matter\r
-in hand...)\r
-\r
-Ray Casting:\r
-        Ray Casting in this context is back-firing 'rays' along a two\r
-dinesional map. The rays do however follow heights... more on that later\r
-\r
-Sprite:\r
-        A Sprite is a bitmap that is either a monster or an object. To\r
-put it another way it is anything that is not made out of wall or\r
-floor sectins.\r
-\r
-Sprite Scaling:\r
-        By this I mean scaling a bitmap in either x or y or both.\r
-\r
-Right... Now thats over with onto the foundation:\r
-\r
-2:   Two Dimensional Ray Casting Techniques\r
-===========================================\r
-\r
-        In order to make this accessible to anyone I will start by\r
-explaining 2d raycasting as used in Wolfenstein 3d style games.\r
-\r
-  2.1: Wolfenstien 3D Style Techniques...\r
-  =======================================\r
-\r
-          Wolfenstein 3d was a game that rocked the world (well me anyway!).\r
-  It used a technique where you fire a ray accross a 2d grid based map to\r
-  find all its walls and objects. The walls were then drawn vertically\r
-  using sprite scaling techniques to simulate texture mapping.\r
-\r
-          The tracing accross the map looked something like this;\r
-\r
-\r
-        =============================================\r
-        =   =   =   =   =   =  /=   =   =   =   =   =\r
-        =   =   =   =   =   = / =   =   =   =   =   =\r
-        =   =   =   =   =   =/  =   =   =   =   =   =\r
-        ====================/========================\r
-        =   =   =   =   =  /=   =   =   =   =   =   =\r
-        =   =   =   =   = / =   =   =   =   =   =   =\r
-        =   =   =   =   =/  =   =   =   =   =   =   =\r
-        ================/============================\r
-        =   =   =   =  /#   =   =   =   =   =   =   =\r
-        =   =   =   = / #   =   =   =   =   =   =   =\r
-        =   =   =   =/  #   =   =   =   =   =   =   =\r
-        ============/===#########====================\r
-        =   =   =  /=   =   =   #   =   =   =   =   =\r
-        =   =   = / =   =   =   #   =   =   =   =   =\r
-        =   =   =/  =   =   =   #   =   =   =   =   =\r
-        ========/===============#====================\r
-        =   =  /=   =   =   =   #   =   =   =   =   =\r
-        =   = P =   =   =   =   #   =   =   =   =   =\r
-        =   =  \=   =   =   =   #   =   =   =   =   =\r
-        ========\===============#====================\r
-        =   =   =\  =   =   =   #   =   =   =   =   =\r
-        =   =   = \ =   =   =   #   =   =   =   =   =\r
-        =   =   =  \=   =   =   #   =   =   =   =   =\r
-        ============\=======#####====================\r
-        =   =   =   =\  =   #   =   =   =   =   =   =\r
-        =   =   =   = \ =   #   =   =   =   =   =   =\r
-        =   =   =   =  \=   #   =   =   =   =   =   =\r
-        ================\===#========================\r
-        =   =   =   =   =\  #   =   =   =   =   =   =\r
-        =   =   =   =   = \ #   =   =   =   =   =   =\r
-        =   =   =   =   =  \#   =   =   =   =   =   =\r
-        =============================================\r
-\r
-        (#'s are walls, = is the grid....)\r
-\r
-        This is just a case of firing a ray for each vertical\r
-  line on the screen. This ray is traced accross the map to\r
-  see where it crosses a grid boundry. Where it crosses a\r
-  boundry you cjeck to see if there is a wall there we see how\r
-  far away it it and draw a scaled vertical line from the texture\r
-  on screen. The line we draw is selected from the texture by\r
-  seeing where the line has intersected on the side of the square it\r
-  hit.\r
-        This is repeated with a ray for each vertical line on the\r
-  screen that we wish to display.\r
-        This is a very quick explaination of how it works missing\r
-  out how the sprites are handled. If you want a more detailed \r
-  explaination then I suggest getting acksrc.zip from\r
-  ftp.funet.fi in /pub/msdos/games/programming\r
-\r
-        This is someone's source for a Wolfenstien engine written\r
-  in Borland C and Assembly language on the Pc.\r
-        Its is not the fastest or best but has good documentation\r
-  and solves similiar sprite probelms, distance probelms and has\r
-  some much better explaination of the tracing technique tahn I have\r
-  put here. I recommend to everyone interested taht you get a copy\r
-  and have a thorough play around with it.\r
-  (Even if you don't have a Pc: Everything but the drawing and video\r
-   mode setting is done in 'C' so it should not be too hard to port\r
-   ....)\r
-\r
\r
-  2.2 Ray Casting in the Doom Environment\r
-  =======================================\r
-\r
-        When you look at a screen from Doom you see floors, steps\r
-  walls and lots of other trappings.\r
-        You look out of windows and accross courtyards and you\r
-  say WOW! what a great 3d game!!\r
-        Then you fire your gun a baddie who's in line with you but\r
-  above you and bang! he's a corpse.\r
-        Then you climb up to the level where the corpse is and look\r
-  out the window to where you were and you say Gosh! a 3d game!!\r
-\r
-        Hmmm....\r
-\r
-        Stop gawping at the graphics for a minute and look at the map\r
-  screen. Nice line vectors. But isn't the map a bit simple???\r
-        Notice how depite colours showing you that there are different\r
-  heights. Then notice that despite the fact that there is NEVER a\r
-  place where you can exist on two different levels. Smelling a little\r
-  2d yet???\r
-        Look where there are bridges (or sort of bridges) : managed to\r
-  see under them yet??\r
-\r
-        The whole point to this is that Doom is a 2D games just like\r
-  its ancestor Wolfenstein but it has rather more advanced raycasting\r
-  which does a very nice job of fooling the player into thinking its a\r
-  3d game that shifting loads of polygons and back-culling, depth\r
-  sorting etc... \r
-\r
-        Right the explaination of how you turn a 2d map into the 3d\r
-  doom screen is complex so if you are having difficulty try reading\r
-  it a few times and if all else fails mail me....\r
-\r
-\r
-  2.3 What is actually done!\r
-  ==========================\r
-\r
-        Right to start with the raycasting is started in the same\r
-  way as Wolfenstien. That is find out where the player is in the 2d\r
-  map and get a ray setup for the first vertical line on the screen.\r
-\r
-        Now we have an extra stage from the Wolfenstein I described\r
-  whcih involves a data srtucture that we will use later to actually\r
-  draw the screen.\r
-\r
-        In this data structure we start the ray off as at the bottom\r
-  of the screen. This is shown in the diagram below;\r
-\r
-        =================================\r
-        =                               =\r
-        =                               =\r
-        =                               =\r
-        =                               =\r
-        =                               =\r
-        =                               =\r
-        =                               =\r
-        =                               =\r
-        =                               =\r
-        =                               =\r
-        =                               =\r
-        =                               =\r
-        =                               =\r
-        =                               =\r
-        =                               =\r
-        =                               =\r
-        =*                              =\r
-        =================================\r
-\r
-\r
-        Where the '=' show the boundry of the screen and '*' is the virtual\r
-  position of the ray.\r
-\r
-        Note: the Data structure is really two structures:\r
-        One which is a set of list for each vertical 'scanline' and\r
-        One which is a corresponding list for horizontal scanlines.\r
-\r
-        Now we start tracing the ray. We skip accross the 2d map until\r
-  we hit something interesting. By something interesting I mean something\r
-  that is an actual wall or florr section edge.\r
-        Right we have hit the edge of either a floor or wall section.\r
-  We have several things to do know. These are;\r
-\r
-        If it was a wall we hit:\r
-\r
-  1: Find out how 'high' of screen this section of wall should be\r
-     due to the distance it is accross the 2d map.\r
-  2: Find out at what 'virtual height' it is: This is so that we can see\r
-     where in the vertical scanline in comes for testing where to insert\r
-     it and for clipping it.\r
-  3: Test in our structure to see if you draw it or not.\r
-     (This is done so that you can look through windows : how this works\r
-      will become apparent later.)\r
-  4: If any of the wall segment is visible then we find out where along\r
-     the texture we have hit it and write into the structure the area of\r
-     the screen it takes up as well as the texture, the point where we\r
-     have hit the texture and the size it should be on screen. (This is\r
-     so that we can draw it correctly even if the whole span is not on\r
-     screen.\r
-\r
-\r
-        If it was a floor section that we hit:\r
-\r
-  1: Find out where on the vertical line we are working the floor section\r
-     that the ray has hit is. (We know the height of the the floor in the\r
-     virtual map (2d) and we know the height of the player and the distance\r
-     of the floor square from the player so it is easy).\r
-     As a side effect of this we now know the U,V value where the ray has\r
-     hit the floor square.\r
-\r
-  2: Trace Accross the floor square till we hit the far edge of the floor\r
-     square : we then workout where this is on the vertical scanline using\r
-     the same technique as above. We now know the vertical span of the\r
-     floor section, and where on the span it is.\r
-\r
-  3: We check to see if the span is visible on the vertical span.\r
-     If it is or part of it is used then we mark that part of the vertical\r
-     scanline as used.\r
-     We also have to make use of the horizontal buffer I mentioned. We\r
-     insert into this in 2 places. The first is the x coordinate of where\r
-     we hit the floor square into the y line where we where on the screen.\r
-     Phew got that bit?? We also insert here the U,V value which we knew \r
-     from the tracing. (I told you we'd need it later....)                                                                \r
-\r
-\r
-        As you can see there's a little more to hiting a floor segment than\r
-a wall segment. Also note that a you exit a floor segment you may also hit\r
-a wall segment.\r
-\r
-        Tracing the individual ray is continued until we hit a special kind\r
-of wall. This wall is marked as a wall that connects to the ceiling.\r
-This is one place to stop tracing this ray. However we can stop tracing early\r
-if we have found enough to fill the whole vertical scanline then we can stop\r
-whenevr we have done this.\r
-\r
-        Next come a trick. I said we were tracing along a 2d map. Well I\r
-lied a bit. There are (In my implementation at least..) TWO 2d maps. One is\r
-basically from the floor along including all the 'floor' walls and everything\r
-up to and including the walls that join onto the ceiling. The other map\r
-is basically the ceiling (with anything coming down from the ceiling on it\r
-if you are doing this: this makes life a little more complex as I'll explain\r
-below..)\r
-        Now when we have traced along the bottom map and hit a wall that \r
-connects to the ceiling then we go back and trace along the ceiling from\r
-the start to fill in the gaps. There is a problem with this however.\r
-The problem is when you have things like a monolith or something else built\r
-out of walls jutting down from the ceiling. you have to decide whether to\r
-draw it or draw whatever was already in the scanline structure. This means\r
-either storing extra information in the buffer ie z coordinates or tracing\r
-along both the ceiling and floor at the same time.... for most people I would\r
-suggest just not having anything jutting down from the ceiling.\r
-        Also you could trace backwards instead of starting a new ray. This \r
-would be fasterfor many cases as you wouldn't be tracing through lots\r
-of floor squares that aren't on screen. By tracing backwards you can keep\r
-going up the vertical scanline and you know that you are on the screen. As\r
-soon as something goes off the top of the screen you can handle that and then\r
-stop tracing.\r
-\r
-        Phew. has everyone got that???\r
-\r
-        Now we just go back and fire rays up the rest of the vertical\r
-scanlines. Easy!!???\r
-\r
-        At the end of this lot we have the necessary data in the two buffers\r
-to go back and draw the screen background.\r
-(There is one more thing done while tracing but I'll explain that later...)\r
-\r
-\r
-        Oh... one other thing... you have may want to change the raycasting\r
-a bit to subdivide the map... it helps with speed.\r
-        And don't forget the added complexity that walls aren't all at\r
-90 degrees to each other...\r
-\r
-3: Drawing the walls and Why it works!!\r
-=======================================\r
-\r
-        If you are familiar with Wolfenstein then please still read this\r
-as it is esential background to understanding the floor routine.\r
-\r
-\r
-        As all of you probably know the walls are drawn by scaling the line\r
-of the texture to the correct size for the screen. The information in the\r
-vertical buffer makes this easy. What you probably don't know is why this\r
-creates texture mapping that is good enough to fool us.\r
-\r
-        The wall function is a Affine texture mapping. (well almost)\r
-Now affine texture mappings look abysmal unless you do quite a lot of\r
-subdivision (The amount needed varies according to the angle the projected\r
-square is at.). So why does the Doom technique work??\r
-\r
-        Well when we traced the rays we found out exactly where along the\r
-side of the square we hit we were in relation to the width of the texture.\r
-This means that the top and bottom pixels of the scaled wall piece are\r
-calculated correctly. This means that we have effecively subdivided the\r
-texture along vertical scanlines and as the effective subdidvisons are\r
-calculated exactly with proper forshortening as a result of the tracing.\r
-So the ray casting has made the texture mapping easy for us.\r
-        (We have enough subdivision by this scanline effect as the wall\r
-only rotates about one axis and we have proper foreshortening.)\r
-\r
-        This knowlege helps us understand how to do the floors and why\r
-that works.\r
-\r
-        We can now draw all the wall segments by just looking at the buffer\r
-and drawing the parts marked as walls.(Skiping where we put in the bits used\r
-by the floor/ceiling bits: we draw them later.)\r
-\r
-4:  Drawing the Floor/Ceiling and why it works!\r
-===============================================\r
-\r
-        If you have grasped why the walls work then you have just about\r
-won for the floors.\r
-        We have the information needed to draw the floors from the horizontal\r
-buffer.\r
-        All we have to do is look at the horizontal spans in the buffer\r
-and draw them in all.\r
-        Each of these spans has 2 end coordinates for which we have\r
-exact texture coorinates. This tells us which line across the texture\r
-we have to step along to do an Affine or linear mapping.\r
-        This is shown below;\r
-\r
-\r
-        =================================\r
-        =                               =\r
-        =                               =\r
-        =                               =\r
-        =                               = U1,V1 (exit)\r
-        =                              **\r
-        =                           *** =\r
-        =                        ***    =\r
-        =                     ***       =\r
-        =                  ***          =\r
-        =               ***             =\r
-        =            ***                =\r
-        =         ***                   =\r
-        =       **                      =\r
-        =     **                        =\r
-        =   **                          =\r
-        = **                            =\r
-  U0,V0 **                              =\r
-(entry) =                               =\r
-        =                               =\r
-        =                               =\r
-        =                               =\r
-        =                               =\r
-        =                               =\r
-        =                               =\r
-        =================================\r
-\r
-(apologies for the wonky line: it should be straight!!)\r
-\r
-        Now...as the end coordinates are correct and the axis along\r
-which forshortening takes place is not involved (this is a fudge)\r
-we can step linearly along this line across the texture to approximate\r
-the mapping. (This is far easier than a proper texture map).\r
-        This is effectivly a wall lying on its side which works as the\r
-texture coordinates at the ends of the span have been calculated correctly.\r
-This is a benefit of the raycasting we used to find everything.\r
-        Easy huh??\r
-\r
-\r
-5: Sprites\r
-==========\r
-\r
-        The Sprites are really quite easy to do. The basic technique is the\r
-same as used in Wolfenstein 3d.\r
-        This is done as follows:\r
-\r
-When you enter a 'square' on the floor map you test to see if there are\r
-any sprites in the square. If there are you flag that sprite as visible\r
-and add it to a list of visible sprites.\r
-\r
-When you have finished tracing and drawing the walls and floor you\r
-depth sort the sprites and draw them from the back to the front. (painters\r
-algorithm). The only complication in drawing them is that you have to check \r
-buffer that has the walls in, in order to clip the sprites correctly.\r
-\r
-        (If you're interested in Doom you can occasionally see large \r
-explosions (ie BFG) slip partially behind a wall segment.)\r
-\r
-        On possibly faster way of handling the sprites would be to mark\r
-them like wall segments as you find them in the buffer. The only (ONLY!)\r
-complication to this approach is that sprites can have holes in them. By\r
-this I mean things like the gap between an arm and a leg which should be \r
-the background colour.\r
-\r
-\r
-6: Lighting and Depth Cueing\r
-============================\r
-\r
-        Lighting and Depth Cueing fits nicely in with the way that we have\r
-prepared the screen ready for drawing.\r
-        All we have to do is see how far away we are when we found either\r
-the floor or wall section and set the light level according to the distance.\r
-        The other thing that is applied is a light level. This is taken from\r
-the map at the edges where you have hit something. As the map is 2D it is\r
-easy to manage lighting, flickering etc.\r
-        For things like pools of light on the floor all you have to do\r
-is subdivide that patch of floor so that you can set the bit under the \r
-skylight to a lighter colour. Its also very easy to frig this for the\r
-lighting goggles.\r
-\r
-\r
-7: Controlling the Baddies\r
-==========================\r
-        \r
-\r
-        This is pretty easy: all you have to think about is moving and\r
-reacting on a 2d map. the only complications are things like the monsters\r
-looking through windows and seeing a player but this all degenerates into\r
-a simple 2d problem. Things like deciding whether the player has been hit or\r
-has he/she hit a monster is just another case of firing a ray. (Or do it\r
-another way...)\r
-\r
-\r
-8: Where next???\r
-================\r
-\r
-        Thats all folks... hopefully a useful and intersting insight into\r
-my Doom engine works.\r
-        As to the question where next... well I already have some enhancements\r
-to my Doom enigine and others are in the works...\r
-\r
-Some of what you may eventually see are:\r
-\r
-        Proper lighting (I have done this already...its easier than you\r
-                        think)\r
-        Non-Vertical walls (i.e. Aliens style corridors...)\r
-        Orgranic Walls (i.e. Curved like the Aliens nest...)\r
-        Fractal Landscapes (This one is still very much a theory but how\r
-                        about being able to go outside and walk up and down\r
-                        hills etc??)\r
-\r
-        If there are bits people are really shaky about I may post a new\r
-version of this... but I cannot get into implimentation issues as all\r
-implementation work is under copyright...\r
-\r
-        By the way if anyone out there implements this I'd love to here\r
-how you get on...\r
-\r
-        Anyone got any comments or any other interesting algorithms???\r
-\r
-Brian 'Neuromancer' Marshall         'When do graphics not look like graphics?\r
-( Email: brianm@vissci.demon.co.uk )  :when we get it RIGHT.'\r
diff --git a/16/PCGPE10/DPMI16BI.OVL b/16/PCGPE10/DPMI16BI.OVL
deleted file mode 100644 (file)
index 61e5742..0000000
Binary files a/16/PCGPE10/DPMI16BI.OVL and /dev/null differ
diff --git a/16/PCGPE10/DPMIINST.EXE b/16/PCGPE10/DPMIINST.EXE
deleted file mode 100644 (file)
index f500d8b..0000000
Binary files a/16/PCGPE10/DPMIINST.EXE and /dev/null differ
diff --git a/16/PCGPE10/DPMILOAD.EXE b/16/PCGPE10/DPMILOAD.EXE
deleted file mode 100644 (file)
index 68f96b3..0000000
Binary files a/16/PCGPE10/DPMILOAD.EXE and /dev/null differ
diff --git a/16/PCGPE10/DPMIUSER.DOC b/16/PCGPE10/DPMIUSER.DOC
deleted file mode 100644 (file)
index bfee237..0000000
+++ /dev/null
@@ -1,245 +0,0 @@
-                     DPMI USER DOCUMENTATION\r
-                 Borland Pascal With Objects 7.0\r
-\r
-This file documents the use of RTM.EXE, RTMRES.EXE, DPMI16BI.OVL,\r
-DPMIINST.EXE and DPMILOAD.EXE is intended for redistribution\r
-under the terms of the license statement accompanying this\r
-product. Modify and use this text to provide information to users\r
-of your protected-mode applications.\r
-\r
-Included is documentation about these topics:\r
-\r
-  o Running a DOS Protected-Mode Program\r
-\r
-  o What to do if Borland's DPMI server does not run on your\r
-    system\r
-\r
-  o How to set DOS environment variables that affect all\r
-    protected-mode programs generated by Borland Pascal with\r
-    Objects 7.0\r
-\r
-  o Special notes for running under Windows\r
-\r
-  o Controlling the amount of memory the run-time manager uses\r
-\r
-  o Special note for Borland C++ and Paradox 4.0 users\r
-\r
-================================================================\r
-Running a DOS Protected-Mode Program\r
-================================================================\r
-\r
-When you run a DOS protected-mode application, you must ensure\r
-that DPMI16BI.OVL (the DPMI server), RTM.EXE (the run-time\r
-manager), and any DLLs used by the application are present in the\r
-current directory, the same directory as the application, or on\r
-the DOS path.\r
-\r
-\r
-Protected Mode and Memory\r
--------------------------\r
-\r
-A DOS protected-mode program uses DPMI (DOS Protected Mode\r
-Interface) to run in protected mode which gives the application\r
-access to all your computer's memory. With the exceptions\r
-outlined below, the DOS protected-mode technology is completely\r
-transparent and no extra steps are necessary in order to run a\r
-protected-mode application.\r
-\r
-\r
-DPMIINST\r
-\r
-One such exception might be when you run a protected-mode program\r
-for the very first time on a 286-based system. The protected mode\r
-technology uses an internal database which contains various\r
-machine characteristics to determine how to enable protected mode\r
-operation on your system, and configures itself accordingly. If\r
-you have a computer with an older 80286 microprocessor, your\r
-system might not be recognized. You'll see this message when you\r
-try to run a protected-mode application:\r
-\r
-  Machine not in database (RUN DPMIINST)\r
-\r
-If you get this message, simply run the DPMIINST program by\r
-typing DPMIINST at the DOS prompt and following the program's\r
-instructions.\r
-\r
-DPMIINST runs your machine through a series of tests to determine\r
-the best way of enabling protected mode, and automatically\r
-configures accordingly. Once you have run DPMIINST, you won't\r
-have to run it again.\r
-\r
-Some memory managers, device drivers, and memory-resident (TSR)\r
-programs can interfere with DPMIINST's ability to analyze your\r
-system. If DPMIINST fails, try temporarily disabling or removing\r
-these programs. That gives DPMIINST the unrestricted access it\r
-needs to determine the best way to enter protected mode.\r
-\r
-Note that running DPMIINST.EXE will never be required on any\r
-system running HIMEM (or equivalent) or on any system based on\r
-an 80386 (or later) processor.\r
-\r
-\r
-DPMIMEM\r
-\r
-By default, the DPMI interface allocates all available extended\r
-memory for its own use. If you don't want all of the available\r
-memory to be taken by the DPMI kernel, you can set a DOS\r
-environment variable to specify the maximum amount of memory to\r
-use. This variable can be entered directly at the DOS prompt or\r
-inserted in your AUTOEXEC.BAT file, using this syntax:\r
-\r
-  SET DPMIMEM=MAXMEM nnnn\r
-\r
-where nnnn is the amount of memory in kilobytes.\r
-\r
-For example, if you have a system with 4MB and want the DPMI\r
-kernel to use only 2MB of it, leaving the other 2MB alone, the\r
-DPMIMEM variable would be set as follows:\r
-\r
-  SET DPMIMEM=MAXMEM 2048\r
-\r
-Some memory managers, like QEMM or 386^Max, allow allocating the\r
-same area of memory as either extended or expanded and many older\r
-applications can use only expanded memmory (EMS). By using the\r
-DPMIMEM DOS environment variable to limit the amount of extended\r
-memory used by the DPMI server, your system will still have\r
-expanded memory available for use by older applications.\r
-\r
-\r
-RTMRES\r
-\r
-RTMRES preloads the protected-mode system. Preloading the DPMI\r
-server lets you load a protected-mode program slightly faster.\r
-RTMRES will start a program if you specify a program name as a\r
-parameter. If no parameter is specified, RTMRES will run a DOS\r
-shell. Type EXIT to close the shell.\r
-\r
-RTMRES is especially useful if you start, exit, and start a\r
-protected-mode program frequently. Normally, every time you run a\r
-protected-mode application, the DPMI server is loaded. If you've\r
-run RTMRES previously, the server is already present, and the\r
-protected-mode application loads faster.\r
-\r
-\r
-EXTENDED MEMORY\r
-\r
-A protected-mode application interacts with the DPMI server\r
-through Borland's run-time manager (RTM.EXE). By default, a\r
-protected-mode application uses all the extended memory reserved\r
-by the DPMI kernel.\r
-\r
-\r
-================================================================\r
-Running A DOS Protected-Mode Program from Windows\r
-================================================================\r
-\r
-A DOS protected-mode program will run in Windows in 386 enhanced\r
-mode. To configure the amount of memory available to the\r
-application, create a Windows PIF file. To learn more about PIF\r
-files, see your Microsoft Windows User's Guide.\r
-\r
-\r
-Running Your Program in Windows Standard Mode\r
----------------------------------------------\r
-\r
-In order to run a protected-mode program from Windows\r
-standard-mode, you must set the DPMIMEM DOS environment variable\r
-and run RTMRES (both are described above) before running Windows.\r
-Make sure your DPMIMEM setting leaves enough physical memory for\r
-Windows to operate.\r
-\r
-Note that once you've run RTMRES, you won't be able to run\r
-Windows in 386 enhanced mode until you exit the RTMRES shell (by\r
-typing EXIT at a DOS prompt).\r
-\r
-\r
-Running from a Windows DOS Prompt\r
----------------------------------\r
-\r
-To run a DOS protected-mode application from a Windows DOS\r
-prompt, you must first modify the DOSPRMPT.PIF file found in your\r
-Windows directory so that the protected-mode program will be able\r
-to use extended memory.\r
-\r
-Using the Windows PIF editor, open the DOSPRMPT.PIF file, and\r
-indicate the amount of extended memory you want the\r
-protected-mode program to use. If you are unsure how to use the\r
-PIF editor, see your Microsoft Windows User's Guide.\r
-\r
-\r
-================================================================\r
-Controlling the Amount of Memory the Run-Time Manager Uses\r
-================================================================\r
-\r
-The run-time manager attempts to free as much conventional memory\r
-as possible (by moving moveable memory blocks into extended\r
-memory, for example) before starting an application. No attempt\r
-is made to release extended memory, however. Therefore, if you\r
-are going to run other protected-mode applications that don't use\r
-the run-time manager (Paradox 4.0, for example), use the RTM DOS\r
-environment variable to control the run-time manager's allocation\r
-of memory.\r
-\r
-Use the DOS command line to add the RTM environment variable to\r
-your system's DOS environment. Here is the syntax:\r
-\r
-  SET RTM=[option nnnn]\r
-\r
-The following table lists the options you can use. nnnn can be a\r
-decimal number or a hex number in the form of xAB54 or xab54.\r
-\r
-   Option          Description\r
-   -------------------------------------------------------------\r
-   EXTLEAVE nnnn   Always leave at least nnnn kilobytes of\r
-                   extended memory available. The default value\r
-                   is 640K.\r
-\r
-   EXTMAX nnnn     Don't allocate more than nnnn kilobytes of\r
-                   extended memory. The default value is 4\r
-                   gigabytes. In Windows, the default value is\r
-                   one-half the available memory.\r
-\r
-   EXTMIN nnnn     If fewer than nnnn kilobytes are available\r
-                   after applying EXTMAX and EXTLEAVE limits,\r
-                   terminate with an Out of Memory message. The\r
-                   default value is zero.\r
-\r
-   REALLEAVE nnnn  Always leave at least nnnn paragraphs of real\r
-                   memory available. The default value is 64K or\r
-                   4096 paragraphs.\r
-\r
-   REALMAX nnnn    Don't allocate more than nnnn paragraphs of\r
-                   real memory. The default value is 1 megabyte\r
-                   or 65,535 paragraphs.\r
-\r
-   REALMIN nnnn   If fewer than nnnn paragraphs are available\r
-                  after applying REALMAX and REALLEAVE, terminate\r
-                  with an Out of Memory message. The default\r
-                  value is zero.\r
-\r
-The following DOS command limits RTM to 2M bytes of extended\r
-memory, and ensures that 128K bytes of real memory are left\r
-unallocated:\r
-\r
-  SET RTM=EXTMAX 2048 REALLEAVE 8192\r
-\r
-\r
-================================================================\r
-Important Note for Borland C++ and Paradox 4.0 Users\r
-================================================================\r
-\r
-The DPMILOAD.EXE and DPMI16BI.OVL files provided in this package\r
-replace the older ones that came with Paradox 4.0 and BC++ 3.0 or\r
-later. Delete or rename the older versions and make sure the\r
-newer ones are on your DOS path (both Paradox and BC will search\r
-the path and find the newer versions).\r
-\r
-If you plan to shell out from Paradox or BC++ to run another\r
-protected-mode application, first limit the amount of extended\r
-memory used by Paradox or BC++. For Paradox, use its /extk\r
-command-line parameter; and for BC++, use its /x command-line\r
-parameter. Refer to the Paradox or BC++ documentation for more\r
-information on the use of command-line options.\r
-\r
-                      *    *    *    *    *\r
-\1a
\ No newline at end of file
diff --git a/16/PCGPE10/FDTM.TXT b/16/PCGPE10/FDTM.TXT
deleted file mode 100644 (file)
index fc81623..0000000
+++ /dev/null
@@ -1,178 +0,0 @@
-\r
-                   ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-                   ³ Free Direction Texture Mapping ³\r
-                   ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-The following article was posted by Hannu Helminen (dm@stekt.oulu.fi) to\r
-comp.graphics.algorithms (article 4061). It has been included in the PC-GPE\r
-with his permission.\r
-\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-\r
-From X Sat Apr  2 10:24:14 EST 1994\r
-Article: 4061 of comp.graphics.algorithms\r
-Newsgroups: comp.graphics.algorithms\r
-Path: csc.canberra.edu.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!msuinfo!agate!howland.reston.ans.net!EU.net!news.funet.fi!ousrvr.oulu.fi!news.oulu.fi!dm\r
-From: dm@stekt13.oulu.fi (Hannu Helminen)\r
-Subject: Re: extended DOOM: free-direction texture mapping\r
-In-Reply-To: dm@stekt13.oulu.fi's message of Fri, 25 Mar 1994 10:37:02 GMT\r
-Message-ID: <DM.94Mar28152625@stekt13.oulu.fi>\r
-Lines: 160\r
-Sender: news@ousrvr.oulu.fi\r
-Organization: University of Oulu, Department of Electrical Engineering, Finland\r
-References: <DM.94Mar25123702@stekt13.oulu.fi>\r
-Date: Mon, 28 Mar 1994 12:26:24 GMT\r
-\r
-The idea of free-direction texture-mapping seems to be new to many\r
-few people, so I decided to post this short introduction.\r
-\r
-Warning: The level of this discussion is quite introductory, if you know\r
-(or guess) what I'm going to talk about, you probably know as much as I\r
-do.\r
-\r
-\r
-First look at the principles. In Doom (and in Wolfenstain) the method\r
-used to draw the walls is quite simple. You divide the wall into\r
-vertical lines. Then you calculate where the wall should start and where\r
-to end on the screen (A and B in my nice ascii-picture), and where in\r
-the texture space the corresponding line should start and end.\r
-\r
-Wall:      Texture:\r
- \            Y\r
-  \B       \/\^\/\/\\r
-  ^\       /\/./\/\/\r
-  . \      \/\.\/\/\\r
-  . /      /\/./\/\/\r
-  ./          X\r
-  /A\r
- /      \r
-\r
-Then you simply do a highly optimized loop in which you do all the\r
-pixels in the vertical line, pick a color from the texture, put it onto\r
-the screen, and move to next position in the texture.\r
-\r
-\r
-The floor is a bit more complicated. (I understand that Wolfenstain had\r
-no floor texturing, am I correct?) This time, the floor segment is\r
-mapped to a horizontal line, which is simple enough. However, in texture\r
-space that same line may be in any direction, so you'll have a 2D line\r
-in the texture, like this:\r
-\r
-Floor:     Texture:\r
-    /\                Y\r
- A/...>\B       \/\/\.\/\\r
-/        \      /\/\.\/\/\r
-                \/./\/\/\\r
-                /./\/\/\/\r
-                X\r
\r
-\r
-This is old and dull. Now for the new and exciting part: suppose we wish\r
-to draw a polygon in 3-space that has free orientation. A bit of thought\r
-and a simple extension of the above ideas tell us that we should use a\r
-free-direction line in the display coordinates as well.\r
-\r
-When we map a plane with free orientation to the screen, there is\r
-always one direction on the screen, in which the z-coordinate\r
-(distance) stays the same. In doom's walls it is vertical, in doom's\r
-floors it is horisontal.  But there is one such direction for every\r
-plane.\r
-\r
-Why is constant z-coordinate important? These lines have the special\r
-property that constant movement along them corresponds to constant\r
-movement in texture space.\r
-\r
-Read the above two paragraphs again until you have understood them,\r
-since they are the key thing. The rest is only implementation,\r
-following is a short explanation on how I did it.\r
-\r
-For each polygon you are about to draw on the screen, do the following.\r
-Find the plane equation. From that, derive the "constant-z" direction.\r
-(Come on, take a piece of paper and a pen, it is quite easy.)\r
-\r
-It helps to make the distinction between two cases here.  Either the\r
-"constant-z" direction is more horisontal, or it is more vertical.\r
-Suppose that it is more horisontal. The constant-z line equation is now\r
-something like y = p*x, where -1 <= p <= 1.\r
-\r
- ----\r
-     ---   Example of a constant-z line\r
-        ----\r
-            ----\r
-\r
-Now, a change in the coordinate system is in order. x is the same x as\r
-before, but y is "slanted" by the factor of p. This means that the\r
-x-axis will be "slanted" but y-axis will be the same as before.\r
-\r
-The next thing is to convert the polygon to this coordinate system.\r
-Scan convert it line by line, but along these "slanted" (constant-z)\r
-lines.\r
-\r
-Suppose that we are about to draw a triangle shown below, and the\r
-slanted line is the one shown above. So the path to follow on the\r
-is as follows (ascii art is back again). The path in the texture is\r
-also determined.\r
-        \r
-On the screen:     In texture (eg.):\r
-\r
- \-------            Y\r
- A...    -----/      /./\/\/\/\r
-   \ ...     /       \/./\/\/\\r
-    \   ..../        /\/./\/\/\r
-     \     /B        \/\/./\/\\r
-      \   /               X\r
-       \ /\r
-        X\r
-\r
-\r
-So when you render the triangle, the result would be like this. The\r
-numbers are lines of constant Z-value.\r
-\r
- 22221110   \r
-  3332221111000\r
-   44333222211\r
-    544433332  \r
-     5554444   \r
-      66555    \r
-       766     \r
-        7      \r
-\r
-Note: you should stack the constant-z lines just as shown in the picture.\r
-\r
-Implementation notes: this will be a bit slower than DOOM floors, since\r
-the algorithm is a bit more complicated. Another thing is that it will\r
-not be quite as cache-coherent.\r
-\r
-If you are rendering big polygons (and have a large cache), it helps\r
-to precalculate the pixels lying on the line, so you need not worry about\r
-your Bresenham having to choose right pixels. All you need to do is offset\r
-the line to right memory offset.\r
-\r
-The inner loop of this machine could look something like this:\r
-\r
-zbufpointer = zbufbase + offset;\r
-pixelpointer = pixelbase + offset;\r
-\r
-while (--count >= 0) {\r
-  off = *precalculatedline++;\r
-  if (z > zbufpoiner[off]) {\r
-    zbufpointer[off] = z;\r
-    pixelpointer[off] = texture(x,y);\r
-  }\r
-  x += dx;\r
-  y += dy;\r
-}\r
-\r
-There is an error of about 0.5 pixel-lengths, since the pixels lying on\r
-the constant-z lines are rounded to nearest pixels.\r
-\r
-Another error can also be seen in the above picture, the line marked\r
-with 0's has a small "gap" in it, what should we do with it?\r
-\r
-Happy programming!\r
-\r
---dm\r
---\r
-\r
-  Hannu    dm@stekt.oulu.fi  || You have been hacking too long when you\r
- Helminen dm@phoenix.oulu.fi || talk of people as users (or end-users)\r
diff --git a/16/PCGPE10/FIRE.TXT b/16/PCGPE10/FIRE.TXT
deleted file mode 100644 (file)
index 4612bc9..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-\r
-         ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»\r
-         º        How to code youre own "Fire" Routines        º\r
-         ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ\r
-\r
-    Hiya Puppies!\r
-\r
-    Hopefully this information file will give you all the information you\r
-    need to code youre own fire routines, seen in many demo's and also to\r
-    actually take it all further and develop youre own effects..\r
-\r
-    Ok, so lets get on....\r
-\r
-    Setting up\r
-\r
-\r
-    first thing we need to do is set up two arrays, the size of the arrays\r
-    depends on the many things, screen mode, speed of computer etc, its not\r
-    really important, just that they should both be the same size... I'll\r
-    use 320x200 (64000 byte) arrays for this text, because that happens to\r
-    be the size needed for using a whole screen in vga mode 13h.\r
-\r
-    The next thing we need to do is set a gradient palette, this can be\r
-    smoothly gradiated through ANY colours, but for the purpose of this\r
-    text lets assume the maximum value is a white/yellow and the bottom\r
-    value is black, and it grades through red in the middle.\r
-\r
-    Ok, we have two arrays, lets call them startbuffer and screenbuffer, so\r
-    we know whats going on. Firstly, we need to setup an initial value for\r
-    the start buffer...  so what we need is a random function, that returns\r
-    a value between 0 and 199 (because our screen is 200 bytes wide) this\r
-    will give us the initial values for our random "hotspots" so we do this\r
-    as many times as we think is needed, and set all our bottom line values\r
-    of the start buffer to the maximum colour value. (so we have the last\r
-    300 bytes of the start buffer set randomly with our maximum colour,\r
-    usually if we use a full palette this would be 255 but it can be\r
-    anything that is within our palette range.)\r
-\r
-    Ok, thats set the bottom line up.. so now we need to add the effect,\r
-    for this we need to copy the start buffer, modify it and save it to the\r
-    screenbuffer, we do this by averaging the pixels (this is in effect\r
-    what each byte in our array represents) surrounding our target....\r
-\r
-    It helps to think of these operations in X,Y co-ordinates....\r
-\r
-    Lets try a little diagram for a single pixel.....\r
-\r
-    This is the startbuffer             This is our screenbuffer\r
-\r
-    ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿               ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿\r
-    ³0,0³0,1³0,2³0,3³0,4³ etc...        ³   ³   ³   ³   ³   ³\r
-    ÃÄÄÄÅÄÄÄÅÄÄÄÅÄÄÄÅÄÄÄ´               ÃÄÄÄÅÄÄÄÅÄÄÄÅÄÄÄÅÄÄÄ´\r
-    ³1,0³1,1³1,2³1,3³1,4³ etc..         ³   ³X,Y³   ³   ³   ³\r
-    ÃÄÄÄÅÄÄÄÅÄÄÄÅÄÄÄÅÄÄÄ´               ÃÄÄÄÅÄÄÄÅÄÄÄÅÄÄÄÅÄÄÄ´\r
-    ³2,0³2,1³2,2³2,3³2,4³ etc..         ³   ³   ³   ³   ³   ³\r
-    ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÙ               ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÙ\r
-\r
-    Here we're going to calulate the value for X,Y (notice I didnt start at\r
-    0,0 for calculating our new pixel values?? thats because we need to\r
-    average the 8 surrounding pixels to get out new value.. and the pixels\r
-    around the edges wouldn't have 8 pixels surrounding them), so what we\r
-    need to do to get the value for X,Y is to average the values for all\r
-    the surrounding pixels... that means adding 0,0 0,1 0,2 + 1,0 1,2 + 2,0\r
-    2,1 2,2 and then dividing the total by 8 (the number of pixels we've\r
-    takes our averages from), but there's two problems still facing us..\r
-\r
-    1) The fire stays on the bottom line....\r
-    2) Its slow....\r
-    3) The fire colours dont fade...\r
-\r
-    Ok, so first thing, we need to get the fire moving! :) this is really\r
-    VERY easy. All we need to do is to take our average values from the\r
-    pixel value BELOW the pixel we are calculating for, this in effect,\r
-    moves the lines of the new array up one pixel... so for example our old\r
-    X,Y value we were calculating for was 1,1 so now we just calculate for\r
-    2,1 and put the calculated value in the pixel at 1,1 instead.. easy..\r
-\r
-    The second problem can be approached in a few ways.. first and easiest\r
-    is to actually calculate less pixels in our averaging.. so instead of\r
-    the 8 surrounding pixels we calculate for example, 2 pixels, the one\r
-    above and the one below our target pixel (and divide by 2 instead of 8)\r
-    this saves a lot of time, another approach is to use a screen mode,\r
-    where you can set 4 pixels at a time, or set up the screen so that you\r
-    can use smaller arrays (jare's original used something like 80X50 mode)\r
-    which in effect reduces to 1/4 the number of pixels needed to be\r
-    calculated.\r
-\r
-    The third problem is just a matter of decrementing the calculated value\r
-    that we get after averaging by 1 (or whatever) and storing that value.\r
-\r
-    Last but not least, we need to think about what else can be done...\r
-    well, you can try setting a different palette, you can also try setting\r
-    the pixel value we calculated from to another place, so say, instead of\r
-    calculating from one pixel below our target pixel, you use one pixel\r
-    below and 3 to the right of our target... FUN! :))\r
-\r
-    Well, I hope I didnt confuse you all too much, if you need anything\r
-    clearing up about this, then email me at pc@espr.demon.co.uk ok?\r
-\r
-    Written by  Phil Carlisle (aka Zoombapup // CodeX) 1994.\r
diff --git a/16/PCGPE10/FLI.FOR b/16/PCGPE10/FLI.FOR
deleted file mode 100644 (file)
index c64911b..0000000
+++ /dev/null
@@ -1,244 +0,0 @@
-\r
\r
-Flic Files (.FLI) Format description:\r
\r
-     The details of a FLI file are moderately complex, but the\r
-idea behind it is simple: don't bother storing the parts of a\r
-frame that are the same as the last frame.  Not only does this\r
-save space, but it's very quick.  It's faster to leave a pixel\r
-alone than to set it.\r
\r
-     A FLI file has a 128-byte header followed by a sequence of\r
-frames. The first frame is compressed using a bytewise run-length\r
-compression scheme.  Subsequent frames are stored as the\r
-difference from the previous frame.  (Occasionally the first\r
-frame and/or subsequent frames are uncompressed.)  There is one\r
-extra frame at the end of a FLI which contains the difference\r
-between the last frame and the first frame.\r
\r
-     The FLI header:\r
\r
-     byte size name      meaning\r
-     offset\r
\r
-     0    4    size      Length of file, for programs that want\r
-                         to read the FLI all at once if possible.\r
-     4    2    magic     Set to hex AF11.  Please use another\r
-                         value here if you change format (even to\r
-                         a different resolution) so Autodesk\r
-                         Animator won't crash trying to read it.\r
-     6    2    frames    Number of frames in FLI.  FLI files have\r
-                         a maxium length of 4000 frames.\r
-     8    2    width     Screen width (320).\r
-     10   2    height    Screen height (200).\r
-     12   2    depth     Depth of a pixel (8).\r
-     14   2    flags     Must be 0.\r
-     16   2    speed     Number of video ticks between frames.\r
-     18   4    next      Set to 0.\r
-     22   4    frit      Set to 0.\r
-     26   102  expand    All zeroes -- for future enhancement.\r
\r
-     Next are the frames, each of which has a header:\r
\r
-     byte size name      meaning\r
-     offset\r
-     0    4    size      Bytes in this frame.  Autodesk Animator\r
-                         demands that this be less than 64K.\r
-     4    2    magic     Always hexadecimal F1FA\r
-     6    2    chunks    Number of 'chunks' in frame.\r
-     8    8    expand    Space for future enhancements.  All\r
-                         zeros.\r
\r
-     After the frame header come the chunks that make up the\r
-frame.  First comes a color chunk if the color map has changed\r
-from the last frame.  Then comes a pixel chunk if the pixels have\r
-changed.  If the frame is absolutely identical to the last frame\r
-there will be no chunks at all.\r
\r
-     A chunk itself has a header, followed by the data.  The\r
-chunk header is:\r
\r
-     byte size name meaning\r
-     offset\r
-     0    4    size Bytes in this chunk.\r
-     4    2    type Type of chunk (see below).\r
\r
-     There are currently five types of chunks you'll see in a FLI\r
-file.\r
\r
-     number    name      meaning\r
-     11        FLI_COLOR Compressed color map\r
-     12        FLI_LC    Line compressed -- the most common type\r
-                         of compression for any but the first\r
-                         frame.  Describes the pixel difference\r
-                         from the previous frame.\r
-     13        FLI_BLACK Set whole screen to color 0 (only occurs\r
-                         on the first frame).\r
-     15        FLI_BRUN  Bytewise run-length compression -- first\r
-                         frame only\r
-     16        FLI_COPY  Indicates uncompressed 64000 bytes soon\r
-                         to follow.  For those times when\r
-                         compression just doesn't work!\r
\r
-     The compression schemes are all byte-oriented.  If the\r
-compressed data ends up being an odd length a single pad byte is\r
-inserted so that the FLI_COPY's always start at an even address\r
-for faster DMA.\r
\r
-FLI_COLOR Chunks\r
-     The first word is the number of packets in this chunk. This\r
-is followed directly by the packets.  The first byte of a packet\r
-says how many colors to skip.  The next byte says how many colors\r
-to change.  If this byte is zero it is interpreted to mean 256. \r
-Next follows 3 bytes for each color to change (one each for red,\r
-green and blue).\r
\r
-FLI_LC Chunks\r
-     This is the most common, and alas, most complex chunk.   The\r
-first word (16 bits) is the number of lines starting from the top\r
-of the screen that are the same as the previous frame. (For\r
-example, if there is motion only on the bottom line of screen\r
-you'd have a 199 here.)  The next word is the number of lines\r
-that do change.  Next there is the data for the changing lines\r
-themselves.  Each line is compressed individually; among other\r
-things this makes it much easier to play back the FLI at a\r
-reduced size.\r
\r
-     The first byte of a compressed line is the number of packets\r
-in this line.  If the line is unchanged from the last frame this \r
-is zero.  The format of an individual packet is:\r
\r
-skip_count\r
-size_count\r
-data\r
\r
-     The skip count is a single byte.  If more than 255 pixels\r
-are to be skipped it must be broken into 2 packets. The size\r
-count is also a byte.  If it is positive, that many bytes of data\r
-follow and are to be copied to the screen.  If it's negative a\r
-single byte follows, and is repeated -skip_count times.\r
\r
-     In the worst case a FLI_LC frame can be about 70K.  If it\r
-comes out to be 60000 bytes or more Autodesk Animator decides\r
-compression isn't worthwhile and saves the frame as FLI_COPY.\r
\r
-FLI_BLACK Chunks\r
-     These are very simple.  There is no data associated with\r
-them at all. In fact they are only generated for the first frame\r
-in Autodesk Animator after the user selects NEW under the FLIC\r
-menu.\r
\r
-FLI_BRUN Chunks\r
-     These are much like FLI_LC chunks without the skips.  They\r
-start immediately with the data for the first line, and go line-\r
-by-line from there.  The first byte contains the number of\r
-packets in that line.  The format for a packet is:\r
-\r
-size_count\r
-data\r
\r
-     If size_count is positive the data consists of a single byte\r
-which is repeated size_count times. If size_count is negative\r
-there are -size_count bytes of data which are copied to the\r
-screen. In Autodesk Animator if the "compressed" data shows signs\r
-of exceeding 60000 bytes the frame is stored as FLI_COPY instead.\r
\r
-FLI_COPY Chunks\r
-     These are 64000 bytes of data for direct reading onto the\r
-screen.\r
\r
------------------------------------------------------------------------\r
-And here's the PRO extensions:\r
------------------------------------------------------------------------\r
\r
-This is supplemental info on the AutoDesk Animator FLI and FLC formats.\r
\r
-The following is an attempt at describing the newer chunks and frames\r
-that are not described in the Turbo C FLI library documentation.\r
\r
-  Chunk type       Chunk ID \r
-  ----------       -----------\r
-  FLI_DELTA        7 (decimal)\r
-  \r
-  First WORD (16 bits) is the number of compressed lines to follow.  Next\r
-  is the data for the changing lines themselves, always starting with the\r
-  first line.   Each line is compressed individually.\r
\r
-  The first WORD (16 bits) of a compressed line is the number of packets in\r
-  the line.  If the number of packets is a negative skip -packets lines.\r
-  If the number of packets is positive, decode the packets.  The format of\r
-  an individual packet is:\r
\r
-  skip_count\r
-  size_count\r
-  data\r
\r
-  The skip count is a single byte.  If more than 255 pixels are to be\r
-  skipped, it must be broken into 2 packets.  The size_count is also a byte.\r
-  If it is positive, that many WORDS of data follow and are to be copied to\r
-  the screen.  If it is negative, a single WORDS value follows, and is to be\r
-  repeated -size_count times.\r
-\r
-  Chunk type       Chunk ID \r
-  ----------       -----------\r
-  FLI_256_COLOR    4 (decimal)\r
\r
-  The first WORD is the number of packets in this chunk.  This is followed\r
-  directly by the packets.  The first byte of a packet is how many colors\r
-  to skip.  The next byte is how many colors to change.  If this number is\r
-  0, (zero), it means 256.  Next follow 3 bytes for each color to change.\r
-  (One each for red, green and blue).\r
\r
-  The only difference between a FLI_256_COLOR chunk (type 4 decimal) and a\r
-  FLI_COLOR chunk (type 11 decimal) is that the values in the type 4 chunk\r
-  range from 0 to 255, and the values in a type 11 chunk range from 0 to 63.\r
\r
-  NOTE:  WORD  refer to a 16 bit int in INTEL (Little Endian) format.\r
-         WORDS refer to two-bytes (16 bits) of consecutive data. (Big Endian)\r
\r
-  .FLC special frames and chunks\r
\r
-  FLC's may contain all the above chunks plus one other:\r
\r
-  Chunk type       Chunk ID \r
-  ----------       -----------\r
-  FLI_MINI         18 (decimal) 12 (Hex)\r
\r
-  From what I understand,  this is a miniture 64 x 32 version of the first\r
-  frame in FLI_BRUN format, used as an button for selecting flc's from\r
-  within Animator Pro.  Simply do nothing with this chunk.\r
\r
-  FLC New Frame\r
\r
-  FLC's also contains a frame with the magic bytes set to hex 00A1.  This\r
-  is the first frame in the .flc file.  Actually it isn't a frame at all\r
-  but to have several chunks within it that specify file location info\r
-  specific to Animator Pro.  IE:  filepath, font to use, and .COL file info.\r
-  This FRAME may be skipped while loading.  That's right!  Ignore it!  The\r
-  frame header is the same length as all other frames.  So you may read the\r
-  frame header, then skip past the rest of the frame.\r
\r
\r
-  NOTE:  When reading the FLI header on the newer FLI and FLC files, the\r
-  FLI signature bytes are AF12 instead of AF11 used in the older FLI files.\r
-  Also, you cannot ignore the screen width and height they may not be\r
-  320 x 200.\r
-\r
-  Allowable screen sizes include:\r
\r
-  320 x 200, 640 x 480, 800 x 600, 1280 x 1024\r
\r
\r
-  NOTE:  the delay value between frames appears to be in 1000th's of a\r
-  second instead of 70th's.\r
\r
-If you have any questions or more info on the FLI or FLC formats,\r
-please let me know.\r
\r
-Mike Haaland\r
\r
-CompuServe : 72300,1433\r
-Delphi     : MikeHaaland\r
-Internet   : mike@htsmm1.las-vegas.nv.us\r
-Usenet     : ...!htsmm1.las-vegas.nv.us!mike\r
\r
diff --git a/16/PCGPE10/FTPSITES.TXT b/16/PCGPE10/FTPSITES.TXT
deleted file mode 100644 (file)
index 54e4c1d..0000000
+++ /dev/null
@@ -1,198 +0,0 @@
-\r
-                                Resource Guide\r
-                                     for\r
-                            Computer Game Developers\r
-                \r
-\r
-This lists various libraries, development systems, and source packages available\r
-on the Internet via anonymous FTP to game development designers and programmers.\r
-\r
-\r
-Comments: game-dev@netcom.com\r
-Copyright 1993, Tom Czarnik\r
---------------------------------------------------------------------------------\r
-                                SECTIONS\r
-                                ========\r
-(1) Painting, Sprite Designers\r
-(2) Sound Development\r
-(3) Development Libraries or Systems\r
-(4) Source Code\r
-\r
-\r
-                        Definitions: archives\r
-                        =====================\r
-        funet\r
-                Finland nic.funet.fi:/pub/msdos/games/programming\r
-        garbo-tp\r
-                Finland garbo.uwasa.fi:/pc/turbopas\r
-                USA     ftp.wustl.edu:/mirrors/garbo.uwasa.fi/pc/turbopas\r
-        netcom\r
-                USA     ftp.netcom.com:/pub/profile/game-dev/tools\r
-                USA     ftp.uwp.edu:/pub/msdos/games/game-dev/tools\r
-\r
-                        Definitions: system notations\r
-                        =============================\r
-                MS      MSDOS                   MC Macintosh\r
-                WIN     MS Windows 3.x          UX Unix/X-Windows\r
-                AM      Amiga                   ST Atari ST\r
-\r
-\r
-\r
-------------------------------------------------------------------------------\r
-(1) Painting, Sprite Designers\r
-==============================\r
-* VGA256 [MS]\r
-  A 256 color VGA paint program.\r
-        Archives:\r
-                netcom, funet\r
-        Distribution:\r
-                256paint.zip\r
-\r
-* Sprite Designer v0.8 [MS]\r
-  A sprte designer for ModeX or VGA256\r
-        Archives:\r
-                funet, netcom\r
-        Distribtuion:\r
-                sprdes.zip\r
-\r
-* Tile256 v1.0 [MS]\r
-  A VGA256 tile and map editor\r
-        Archives:\r
-                netcom\r
-        Distribibution:\r
-                tile11.zip\r
-\r
-\r
-(2) Sound Development\r
-=====================\r
-* Blast v1.3 [MS]\r
-  Sound Blaster utility and MOD player. Includes binaries, documentation, and\r
-  objects for Turbo C/C++.\r
-        Archives:\r
-                funet, netcom\r
-        Distribution:\r
-                blast13.lzh\r
-\r
-* FMPlay v1.0 [MS]\r
-  An Adlib and SoundBlaster FM toolkit with background player. A .rol to\r
-  .scr convertor is included. Borland C 3.0 source available.\r
-        Archives:\r
-                netcom\r
-        Distribution:\r
-                fmplay10.zip\r
-\r
-\r
-(3) Game Development Libraries or Systems\r
-=========================================       \r
-* Animation Contruction Kit 3-D [MS]\r
-  A package for making Wolf3D style games.\r
-        Archives:\r
-                funet, netcom\r
-        Distribution:\r
-                ackkit.zip      Main development system\r
-                acksrc.zip      Borland C and Microsoft assembly sources\r
-                pcx2img.zip     PCX to IMG conversions for ACK3D\r
-\r
-\r
-* ANIVGA v1.1 [MS]\r
-  Sprite routines, editor, examples, VGA256 binaries with Turbo Pascal\r
-  6.0 source.\r
-        Archives:\r
-                funet\r
-        Distribution:\r
-                anivga11.zip\r
-\r
-\r
-* DCGames v3.1 [MS]\r
-  Graphics adventure and RPG building system. Includes example games.\r
-        Archives:\r
-                netcom\r
-        Distribution:\r
-                dcg301.zip      Main system\r
-                dcg301sb.zip    SoundBlaster support\r
-                dcg301xb.zip    Voice and music files\r
-                dcg301ut.zip    Utilities\r
-                dcg301up.zip    Upgrade from v3.0 to v3.1 only\r
-\r
-* EGOF v1.0 [MS]\r
-  A Turbo/Borland Pascal 7.0 programming library for VGA256, ModeX, VESA\r
-  graphics. Documentation included.\r
-        Archives:\r
-                garbo-tp\r
-        Distribution:\r
-                egof10.zip      Main library\r
-                egof10b.zip     Demo PCX files for egof10.zip\r
-                egof10m.zip     Postscript manual for EGOF v1.0\r
-                egof10p.zip     Protected mode units for EGOF v1.0\r
-\r
-* Hobbes Library v3.0 [MS]\r
-  A modeX library for VGA256. No documentation available. Inlcudes Borland\r
-  C and assembly.\r
-        Archives:\r
-                funet, nectom\r
-        Distribution:\r
-                hobbs3.zip      Main system\r
-                hobbspr2.zip    Related examples. C++ source/sprite executable\r
-\r
-* SPX v1.0 [MS]\r
-  A VGA256 game library for Turbo Pascal 6.0 and 7.0 by Scott Ramsay.\r
-  Successor to GameTP libray.\r
-        Archives:\r
-                funet, netcom\r
-        Distribution:\r
-                spx10.zip\r
-                spxdemo1.zip    Demos with binary and source\r
-\r
-* Unchain v2.1 [MS]\r
-  A Planar VGA Mode (aka modeX) Enforcer for Borland's IDE by Colin Buckely\r
-        Archives:\r
-                netcom\r
-        Distribution:\r
-                unchain2.zip\r
-\r
-* VGA Graphics Library v2.0 [MS]\r
-  A VGA graphics library by Scott Ramsay. C and assembly source included.\r
-        Archives: \r
-                netcom\r
-        Distribution:\r
-                vgl20.zip\r
-\r
-* Wordup Graphics Toolkit v3.5 [MS]\r
-  A VGA256 sprite library by Barry and Chris Egerter. Shareware\r
-        Archives:\r
-                funet, netcom\r
-        Distribution:\r
-                wgt35.zip       Main system\r
-                wgtdemo1.zip    Demo\r
-                wgtmap15.zip    Map editor v1.5\r
-                wgtspr35.zip    Sprite editor v3.5\r
-\r
-* XLib v4.0c [MS]\r
-  A VGA256 ModeX sprite library by Themie Gouthas. Includes Turbo C/TASM source.\r
-  Free.\r
-        Archives:\r
-                funet, netcom\r
-        Distribution:\r
-                xlib04c.zip     Main system\r
-                xlibtool.zip    Bitmap conversion tools for XLib\r
-\r
-\r
-* yakIcons v2.4 [MS]\r
-  A VGA256 sprite library with higher level routines over xLib, by Victor Putz.\r
-  Borland C++ 3.1 source, with doumentation. Free shareware.\r
-        Archives:\r
-                netcom\r
-        Distribution:\r
-                yak24pat.zip    Patch to yakIcons v2.3\r
-                yakdemo.zip     Demo of yakIcons\r
-                yaktool.zip     Converts PCX to .yak and .ypl \r
-                yicons24.zip    Main system\r
-\r
-\r
-(4) Source Code\r
-===============\r
-* Michael Abrash's Columns on Graphics Programming from Dr. Dobbs Journal\r
-        Archives:\r
-                ftp.uwp.edu:/pub/msdos/demos/source\r
-        Distribution:\r
-                grphprg.lzh\r
diff --git a/16/PCGPE10/GAMEBLST.TXT b/16/PCGPE10/GAMEBLST.TXT
deleted file mode 100644 (file)
index 1b6afd5..0000000
+++ /dev/null
@@ -1,275 +0,0 @@
-\r
-               ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-               ³ Programming the GameBlaster Sound Card ³\r
-               ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-                  Written for the PC-GPE by Mark Feldman\r
-              e-mail address : u914097@student.canberra.edu.au\r
-                               myndale@cairo.anu.edu.au\r
-\r
-             ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-             ³      THIS FILE MAY NOT BE DISTRIBUTED     ³\r
-             ³ SEPARATE TO THE ENTIRE PC-GPE COLLECTION. ³\r
-             ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Disclaimer ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-I assume no responsibility whatsoever for any effect that this file, the\r
-information contained therein or the use thereof has on you, your sanity,\r
-computer, spouse, children, pets or anything else related to you or your\r
-existance. No warranty is provided nor implied with this information.\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Introduction ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-The GameBlaster sound card (also known as the CMS) is now pretty much\r
-obsolete, well I haven't seen any apart from the one I own. The card was\r
-developped by Creative Labs, the same people who designed the SoundBlaster.\r
-You can still buy the CMS chips to place inside your SoundBlaster 1.0 and\r
-2.0 cards to make them compatible, but believe me, it isn't worth it. The\r
-only reason I'm writing this file is because the GameBlaster chips are really\r
-easy to program (due to the fact that it can't do anything) so this should be\r
-of use to those of you who already own one.\r
-\r
-I have no idea how to detect the presence of the CMS chips in a SoundBlaster,\r
-trying to write to it's registers while the chips were not installed made\r
-my machine hang.\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ General Programming Info ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-The GameBlaster has 12 channels. Each channel can produce either a single\r
-sine wave of a given frequency and magnitude (in stereo), or noise.\r
-\r
-The GameBlaster is programmed through 4 ports as follows:\r
-\r
-    For voices 1 to 6\r
-        Write 2x1 with register address\r
-        Write 2x0 with data to register\r
-\r
-    For voices 7 to 12\r
-        Write 2x3 with register address\r
-        Write 2x2 with data to register\r
-\r
-The x value depends on the jumper setting on your card, x = 1 for 210h, x =\r
-2 for 220h etc...\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Reseting the GameBlaster ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-First you have to reset the GameBlaster and enable all voices. This is done\r
-by setting register 1Ch, which is laid out as follows:\r
-\r
-                      ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿\r
-                      ³ 7 ³ 6 ³ 5 ³ 4 ³ 3 ³ 2 ³ 1 ³ 0 ³\r
-                      ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÙ\r
-                                                ³   ³\r
-Sound Enable for all channels ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ   ³\r
-  0 all channels disabled                           ³\r
-  1 all channels enabled                            ³\r
-                                                    ³\r
-Reset signal to all generators ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-  0 all generators enabled\r
-  1 all generators reset and synchronized\r
-\r
-The following Pascal code will reset and enable the card (assuming jumper\r
-setting is for 220h) :\r
-\r
-  Port[$221] := $1C;\r
-  Port[$220] := $02; { Reset voices }\r
-  Port[$221] := $15;\r
-  Port[$220] := $00; { Disable noise * }\r
-  Port[$221] := $1C;\r
-  Port[$220] := $01; { Enable voices }\r
-\r
-* Noise is discussed in the next section\r
-\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Enabling Voice Frequency ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-To hear a frequency from a voice you must set the appropriate bit in\r
-register 14h:\r
-\r
-       ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿\r
-       ³ 7 ³ 6 ³ 5 ³ 4 ³ 3 ³ 2 ³ 1 ³ 0 ³\r
-       ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÙ\r
-                 ³   ³   ³   ³   ³   ³\r
-                 ³   ³   ³   ³   ³   ÀÄÄ Frequency enable 1/7\r
-                 ³   ³   ³   ³   ÀÄÄÄÄÄÄ Frequency enable 2/8\r
-                 ³   ³   ³   ÀÄÄÄÄÄÄÄÄÄÄ Frequency enable 3/9\r
-                 ³   ³   ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Frequency enable 4/10\r
-                 ³   ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Frequency enable 5/11\r
-                 ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Frequency enable 6/12\r
-\r
-Note that for each bit in the above table two voice numbers are given. If\r
-ports 2x1 and 2x0 are used then the first voice is modified. If ports 2x3\r
-and 2x2 are used then the second voice is modified.\r
-\r
-Setting a bit to 1 enables the voice. Clearing it to 0 disables the voice.\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Setting a Voice Volume ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-Each voice can have a volume between 0 and 15 on both left and right\r
-channels. The amplitude registers are laid out as follows:\r
-\r
-                      ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿\r
-                      ³ 7 ³ 6 ³ 5 ³ 4 ³ 3 ³ 2 ³ 1 ³ 0 ³\r
-                      ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÙ\r
-                        ÀÄÄÄÄÄÂÄÄÄÄÄÙ   ÀÄÄÄÄÄÂÄÄÄÄÄÙ\r
-                              ³               ³\r
- Right channel volume ÄÄÄÄÄÄÄÄÙ               ÀÄÄÄÄÄÄÄÄ Left channel volume\r
-\r
-\r
-To set a channel volume you write the register address to the appropriate\r
-Register Address port and write the volume byte to the Data To Register\r
-port. The register address map for amplitudes is as follows:\r
-\r
-                   ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-                   ³ Register Address     Voice ³\r
-                   ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´\r
-                   ³       00h             1/7  ³\r
-                   ³       01h             2/8  ³\r
-                   ³       02h             3/9  ³\r
-                   ³       03h             4/10 ³\r
-                   ³       04h             5/11 ³\r
-                   ³       05h             6/12 ³\r
-                   ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Setting a Voice Frequency ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-Setting a voice frequency is similar to setting the volume, one byte is\r
-written to the appropriate register. The frequency register map is as\r
-follows:\r
-\r
-                   ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-                   ³ Register Address     Voice ³\r
-                   ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´\r
-                   ³       08h             1/7  ³\r
-                   ³       09h             2/8  ³\r
-                   ³       0Ah             3/9  ³\r
-                   ³       0Bh             4/10 ³\r
-                   ³       0Ch             5/11 ³\r
-                   ³       0Dh             6/12 ³\r
-                   ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-The following table is a list of the bytes you write for each note:\r
-\r
-\r
-                         ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-                         ³ Note   Value ³\r
-                         ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´\r
-                         ³  A        3  ³\r
-                         ³  A#      31  ³\r
-                         ³  B       58  ³\r
-                         ³  C       83  ³\r
-                         ³  C#     107  ³\r
-                         ³  D      130  ³\r
-                         ³  D#     151  ³\r
-                         ³  E      172  ³\r
-                         ³  F      191  ³\r
-                         ³  F#     209  ³\r
-                         ³  G      226  ³\r
-                         ³  G#     242  ³\r
-                         ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-This is the first octave available. The C frequency in this octave is\r
-55 Hz.\r
-\r
-To get tones in higher octaves you need to set the octave register for a \r
-voice. Each octave register stores the octave number for two voices. The\r
-octave registers are laid out as follows:\r
-\r
-                      ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿\r
-                      ³ 7 ³ 6 ³ 5 ³ 4 ³ 3 ³ 2 ³ 1 ³ 0 ³\r
-                      ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÙ\r
-                            ÀÄÄÄÂÄÄÄÙ       ÀÄÄÄÂÄÄÄÙ\r
-                                ³               ³\r
-        Octave Number 2 ÄÄÄÄÄÄÄÄÙ               ÀÄÄÄÄÄÄ Octave number 1\r
-\r
-The octave register address map is as follows:\r
-\r
-                    ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-                    ³ Register Address     Voices      ³\r
-                    ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´\r
-                    ³     10h              2;1 / 8;7   ³\r
-                    ³     11h              4;3 / 10;9  ³\r
-                    ³     12h              6;5 / 12;11 ³\r
-                    ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-ÚÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Noise ³\r
-ÀÄÄÄÄÄÄÄÙ\r
-\r
-There are 4 noise generators, each noise genrator can be connected up to\r
-any of three voices:\r
-\r
-                          ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-                          ³   Noise              ³\r
-                          ³  Generator   Voices  ³\r
-                          ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´\r
-                          ³   1           1,2,3  ³\r
-                          ³   2           4,5,6  ³\r
-                          ³   3           7,8,9  ³\r
-                          ³   4         10,11,12 ³\r
-                          ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-\r
-The noise generators are controlled via two registers:\r
-\r
-Register 16h at ports 2x1 and 2x0 :\r
-\r
-                   ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿\r
-                   ³ 7 ³ 6 ³ 5 ³ 4 ³ 3 ³ 2 ³ 1 ³ 0 ³\r
-                   ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÙ\r
-                             ÀÄÂÄÙ           ÀÄÂÄÙ\r
-                               ³               ³\r
-           Noise Gen 2 ÄÄÄÄÄÄÄÄÙ               ÀÄÄÄÄÄÄ Noise Gen 1\r
-\r
-Register 16h at ports 2x3 and 2x2 :\r
-\r
-                   ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿\r
-                   ³ 7 ³ 6 ³ 5 ³ 4 ³ 3 ³ 2 ³ 1 ³ 0 ³\r
-                   ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÙ\r
-                             ÀÄÂÄÙ           ÀÄÂÄÙ\r
-                               ³               ³\r
-           Noise Gen 4 ÄÄÄÄÄÄÄÄÙ               ÀÄÄÄÄÄÄ Noise Gen 3\r
-\r
-Each generator has two bits associated with it which control the noise\r
-generator rate:\r
-\r
-                       ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-                       ³ Nn1 Nn0    Frequency ³\r
-                       ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´\r
-                       ³ 0   0     28.0 kHz   ³\r
-                       ³ 0   1     14.0 kHz   ³\r
-                       ³ 1   0      6.8 kHz   ³\r
-                       ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-A voice can be connected to it's noise generator by setting the appropriate\r
-bit in register 15h:\r
-\r
-                ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿\r
-                ³ 7 ³ 6 ³ 5 ³ 4 ³ 3 ³ 2 ³ 1 ³ 0 ³\r
-                ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÙ\r
-                          ³   ³   ³   ³   ³   ³\r
-                          ³   ³   ³   ³   ³   ÀÄÄ Noice enable 1/7\r
-                          ³   ³   ³   ³   ÀÄÄÄÄÄÄ Noice enable 2/8\r
-                          ³   ³   ³   ÀÄÄÄÄÄÄÄÄÄÄ Noice enable 3/9\r
-                          ³   ³   ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Noice enable 4/10\r
-                          ³   ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Noice enable 5/11\r
-                          ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Noice enable 6/12\r
-\r
-Setting a bit to 1 enables the voice. Clearing it to 0 disables the voice.\r
-\r
diff --git a/16/PCGPE10/GAMEPAD.TXT b/16/PCGPE10/GAMEPAD.TXT
deleted file mode 100644 (file)
index 353c91b..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-             ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-             ³ Programming the Gravis GamePad and Analog Pro ³\r
-             ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-                 Written for the PC-GPE by Mark Feldman\r
-              e-mail address : u914097@student.canberra.edu.au\r
-                               myndale@cairo.anu.edu.au\r
-\r
-               ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-               ³      THIS FILE MAY NOT BE DISTRIBUTED     ³\r
-               ³ SEPARATE TO THE ENTIRE PC-GPE COLLECTION. ³\r
-               ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Disclaimer ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-I assume no responsibility whatsoever for any effect that this file, the\r
-information contained therein or the use thereof has on you, your sanity,\r
-computer, spouse, children, pets or anything else related to you or your\r
-existance. No warranty is provided nor implied with this information.\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Programming the Gravis GamePad ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-The Gravis GamePad plugs into the standard joystick connector. It is\r
-a pad with a 9 direction controller (including center) and four buttons.\r
-Two of the buttons can be selected as "autofire" by a switch on the\r
-GamePad.\r
-\r
-                       _____     ||\r
-                      |     \____||________\r
-                      |  __    GRAVIS      \\r
-                      | /  \  GamePad   B  |\r
-                      | \__/          A   C|\r
-                      |______________   D  |\r
-                                     \_____|\r
-\r
-The chief difference between the GamePad and a regular joystick is that\r
-the GamePad uses fixed resistances of about 0ê, 50kê and 100kê. The\r
-resistances for each controller position are as follows:\r
-\r
-        ÚÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄ¿\r
-        ³ x = 0ê   ³  x = 50ê  ³  x = 100ê ³\r
-        ³ y = 0ê   ³  y = 0ê   ³  y = 0ê   ³\r
-        ÃÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄ´\r
-        ³ x = 0ê   ³  x = 50ê  ³  x = 100ê ³\r
-        ³ y = 50kê ³  y = 50ê  ³  y = 50ê  ³\r
-        ÃÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄ´\r
-        ³ x = 0ê   ³  x = 50ê  ³  x = 100ê ³\r
-        ³ y = 100ê ³  y = 100ê ³  y = 100ê ³\r
-        ÀÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-The x axis is read via the regular Joystick A X Axis, the y axis is read\r
-via the Joystick A Y Axis.\r
-\r
-The GamePad buttons are accessed the same way that the normal joystick\r
-buttons are accessed:\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-³ GamePad Button A               =  Joystick A, Button 1 ³\r
-³ GamePad Button B               =  Joystick A, Button 2 ³\r
-³ GamePad Button C (autofire A)  =  Joystick B, Button 2 ³\r
-³ GamePad Button D (autofire B)  =  Joystick B, Button 1 ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Programming the Gravis Analog Pro ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-The Analog Pro is very similar to a regular joystick, except it has 5\r
-buttons and a dial on the joystick, originally intended for use as a\r
-throttle for flight simulators.\r
-\r
-\r
-\r
-                      \19-- B & A\r
-                     ___\r
-                C -> \ |\r
-                      ||\r
-                 D -\19 || \19- E\r
-                   _Ü_||_Ü_\r
-                   |______|\r
-\r
-                   Left Side\r
-\r
-\r
-\r
-The Analog Pro joystick position is read the same as the regular Joystick A.\r
-The throttle value is read the same as for the regular Joystick B X Axis\r
-value.\r
-\r
-           ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-           ³ Analog Pro Button A =  Joystick A, Button 1 ³\r
-           ³ Analog Pro Button B =  Joystick A, Button 2 ³\r
-           ³ Analog Pro Button C =  Joystick B, Button 1 ³\r
-           ³ Analog Pro Button D =  Joystick B, Button 2 ³\r
-           ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-The SDK is a bit vague as to how button E is read. It mentions that the\r
-buttons D and E can be set as any of the joystick buttons, but I believe\r
-this is done via switches on the joystick itself (not sure, I don't actually\r
-own one).\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ References ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-All the information in this file was obtained from the PC GamePad and Analog\r
-Pro SDK V1.1 which can be obtained via anonymous ftp:\r
-\r
-site: wasp.eng.ufl.edu\r
-directory: /pub/msdos/demos/programming/source\r
-filename: joysdk11.lzh\r
diff --git a/16/PCGPE10/GENOA.TXT b/16/PCGPE10/GENOA.TXT
deleted file mode 100644 (file)
index a5fd91a..0000000
+++ /dev/null
@@ -1,134 +0,0 @@
-\r
-                  ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-                  ³ Programming the Genoa SVGA Chip ³\r
-                  ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-                 Written for the PC-GPE by Mark Feldman\r
-            e-mail address : u914097@student.canberra.edu.au\r
-                             myndale@cairo.anu.edu.au\r
-\r
-                  Please read the file SVGINTRO.TXT\r
-              (Graphics/SVGA/Intro PC-GPE menu option)\r
-\r
-             ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-             ³      THIS FILE MAY NOT BE DISTRIBUTED     ³\r
-             ³ SEPARATE TO THE ENTIRE PC-GPE COLLECTION. ³\r
-             ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Disclaimer ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-I assume no responsibility whatsoever for any effect that this file, the\r
-information contained therein or the use thereof has on you, your sanity,\r
-computer, spouse, children, pets or anything else related to you or your\r
-existance. No warranty is provided nor implied with this information.\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Introduction ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-Genoa has produced 2 SVGA cards. The earlier Genoa cards were based on the\r
-Tseng ET3000 chip, the more recents cards are based on the Genoa chip. This\r
-file will deal only with the cards based on the Genoa chip (the GVGA).\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ The Extended Register Set ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-The Genoa uses the same ports as the VGA sequencer register set to access\r
-most of it's extended registers, ie the Index Register port for the Genoa\r
-is 3C4h and Data port is 3C5h.\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Identifying the Genoa SVGA Card ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-To identify if a Genoa SVGA is present read the byte at address C000:0000.\r
-Let's call this byte SIG_OFFSET. Next read the four bytes at\r
-C000:SIG_OFFSET. These four bytes should have the following values :\r
-\r
-                ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-                ³  Memory Address              Value  ³\r
-                ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´\r
-                ³  C000:SIG_OFFSET              77h   ³\r
-                ³  C000:SIG_OFFSET + 1          xx    ³\r
-                ³  C000:SIG_OFFSET + 2          66h   ³\r
-                ³  C000:SIG_OFFSET + 3          99h   ³\r
-                ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Identifying which Genoa Card is Present ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-The value of the byte at C000:SIG_OFFSET + 1 is the chip identify code. The\r
-values for each of the Genoa cards is as follows\r
-\r
-              ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-              ³ xx       Card             Chip         ³\r
-              ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´\r
-              ³ 33h      5100/5200        Tseng ET3000 ³\r
-              ³ 55h      5300/5400        Tseng ET3000 ³\r
-              ³ 22h      6100             Genoa GVGA   ³\r
-              ³ 00h      6200/6300        Genoa GVGA   ³\r
-              ³ 11h      6400/6600        Genoa GVGA   ³\r
-              ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-There is no method for determining the card revision number.\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Genoa Graphics Display Modes ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-All Genoa cards support the following graphics modes :\r
-\r
-                  ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-                  ³ Mode     Resolution       Colors  ³\r
-                  ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´\r
-                  ³ 59h      720x512          16      ³\r
-                  ³ 5Bh      640x350          256     ³\r
-                  ³ 5Ch      640x480          256     ³\r
-                  ³ 5Dh      720x512          256     ³\r
-                  ³ 5Eh      800x600          256     ³\r
-                  ³ 5Fh      1024x768         16      ³\r
-                  ³ 6Ah      800x600          16      ³\r
-                  ³ 6Ch      800x600          256     ³\r
-                  ³ 73h      640x480          16      ³\r
-                  ³ 79h      800x600          16      ³\r
-                  ³ 7Ch      512x512          16      ³\r
-                  ³ 7Dh      512x512          256     ³\r
-                  ³ 7Eh      640x400          256     ³\r
-                  ³ 7Fh      1024x768         4       ³\r
-                  ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Genoa Display Memory ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-Two banks can be mapped to the segment A000:0000-FFFFh, one for\r
-reading and one for writing. The banks can be selected by writing to\r
-the Memory Segment Register :\r
-\r
-          Index : 06h at port 3C4h\r
-          Read/Write at port 3C5h\r
-          ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿\r
-          ³ 7 ³ 6 ³ 5 ³ 4 ³ 3 ³ 2 ³ 1 ³ 0 ³\r
-          ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÙ\r
-          MEM ÄÄÙ   ÀÄÄÄÂÄÄÄÙ   ÀÄÄÄÂÄÄÄÙ\r
-                      Write        Read\r
-                      Bank         Bank\r
-\r
-The following code can be used to set the write bank:\r
-\r
-Port[$3C4] := $06;\r
-Port[$3C5] := (Port[$3C5] and $C7) or (write_bank_number shl 3);\r
-\r
-The following code can be used to set the read bank:\r
-\r
-Port[$3C4] := $06;\r
-Port[$3C5] := (Port[$3C5] and $F8) or read_bank_number;\r
-\r
-There are 8 banks (numbered 0 -7). Each bank is 64K long, has a 64K\r
-granularity and is mapped to host memory A000:0000-FFFFh.\r
diff --git a/16/PCGPE10/GIF.TXT b/16/PCGPE10/GIF.TXT
deleted file mode 100644 (file)
index 88d2894..0000000
+++ /dev/null
@@ -1,1321 +0,0 @@
-\r
-\r
-                   LZW and GIF explained----Steve Blackstock\r
-\r
-\r
-      I hope this little document will help enlighten those of you out there\r
-who want to know more about the Lempel-Ziv Welch compression algorithm, and,\r
-specifically, the implementation that GIF uses.\r
-     Before we start, here's a little terminology, for the purposes of this\r
-document:\r
-\r
-      "character": a fundamental data element. In normal text files, this is\r
-just a single byte. In raster images, which is what we're interested in, it's\r
-an index that specifies the color of a given pixel. I'll refer to an arbitray\r
-character as "K".\r
-      "charstream": a stream of characters, as in a data file.\r
-      "string": a number of continuous characters, anywhere from one to very\r
-many characters in length. I can specify an arbitrary string as "[...]K".\r
-      "prefix": almost the same as a string, but with the implication that a\r
-prefix immediately precedes a character, and a prefix can have a length of\r
-zero. So, a prefix and a character make up a string. I will refer to an\r
-arbitrary prefix as "[...]".\r
-      "root": a single-character string. For most purposes, this is a\r
-character, but we may occasionally make a distinction. It is [...]K, where\r
-[...] is empty.\r
-      "code": a number, specified by a known number of bits, which maps to a\r
-string.\r
-      "codestream": the output stream of codes, as in the "raster data"\r
-      "entry": a code and its string.\r
-      "string table": a list of entries; usually, but not necessarily, unique.\r
-      That should be enough of that.\r
-\r
-     LZW is a way of compressing data that takes advantage of repetition of\r
-strings in the data. Since raster data usually contains a lot of this\r
-repetition, LZW is a good way of compressing and decompressing it.\r
-     For the moment, lets consider normal LZW encoding and decoding. GIF's\r
-variation on the concept is just an extension from there.\r
-     LZW manipulates three objects in both compression and decompression: the\r
-charstream, the codestream, and the string table. In compression, the\r
-charstream is the input and the codestream is the output. In decompression,\r
-the codestream is the input and the charstream is the output. The string table\r
-is a product of both compression and decompression, but is never passed from\r
-one to the other.\r
-     The first thing we do in LZW compression is initialize our string table.\r
-To do this, we need to choose a code size (how many bits) and know how many\r
-values our characters can possibly take. Let's say our code size is 12 bits,\r
-meaning we can store 0->FFF, or 4096 entries in our string table. Lets also\r
-say that we have 32 possible different characters. (This corresponds to, say,\r
-a picture in which there are 32 different colors possible for each pixel.) To\r
-initialize the table, we set code#0 to character#0, code #1 to character#1,\r
-and so on, until code#31 to character#31. Actually, we are specifying that\r
-each code from 0 to 31 maps to a root. There will be no more entries in the\r
-table that have this property.\r
-     Now we start compressing data. Let's first define something called the\r
-"current prefix". It's just a prefix that we'll store things in and compare\r
-things to now and then. I will refer to it as "[.c.]". Initially, the current\r
-prefix has nothing in it. Let's also define a "current string", which will be\r
-the current prefix plus the next character in the charstream. I will refer to\r
-the current string as "[.c.]K", where K is some character. OK, look at the\r
-first character in the charstream. Call it P. Make [.c.]P the current string.\r
-(At this point, of course, it's just the root P.) Now search through the\r
-string table to see if [.c.]P appears in it. Of course, it does now, because\r
-our string table is initialized to have all roots. So we don't do anything.\r
-Now make [.c.]P the current prefix. Look at the next character in the\r
-charstream. Call it Q. Add it to the current prefix to form [.c.]Q, the\r
-current string. Now search through the string table to see if [.c.]Q appears\r
-in it. In this case, of course, it doesn't. Aha! Now we get to do something.\r
-Add [.c.]Q (which is PQ in this case) to the string table for code#32, and\r
-output the code for [.c.] to the codestream. Now start over again with the\r
-current prefix being just the root P. Keep adding characters to [.c.] to form\r
-[.c.]K, until you can't find [.c.]K in the string table. Then output the code\r
-for [.c.] and add [.c.]K to the string table. In pseudo-code, the algorithm\r
-goes something like this:\r
-\r
-     [1] Initialize string table;\r
-     [2] [.c.] <- empty;\r
-     [3] K <- next character in charstream;\r
-     [4] Is [.c.]K in string table?\r
-      (yes: [.c.] <- [.c.]K;\r
-            go to [3];\r
-      )\r
-      (no: add [.c.]K to the string table;\r
-           output the code for [.c.] to the codestream;\r
-           [.c.] <- K;\r
-           go to [3];\r
-      )\r
-\r
-       It's as simple as that! Of course, when you get to step [3] and there\r
-aren't any more characters left, you just output the code for [.c.] and throw\r
-the table away. You're done.\r
-      Wanna do an example? Let's pretend we have a four-character alphabet:\r
-A,B,C,D. The charstream looks like ABACABA. Let's compress it. First, we\r
-initialize our string table to: #0=A, #1=B, #2=C, #3=D. The first character is\r
-A, which is in the string table, so [.c.] becomes A. Next we get AB, which is\r
-not in the table, so we output code #0 (for [.c.]),\r
-     and add AB to the string table as code #4. [.c.] becomes B. Next we get\r
-[.c.]A = BA, which is not in the string table, so output code #1, and add BA\r
-to the string table as code #5. [.c.] becomes A. Next we get AC, which is not\r
-in the string table. Output code #0, and add AC to the string table as code\r
-#6. Now [.c.] becomes C. Next we get [.c.]A = CA, which is not in the table.\r
-Output #2 for C, and add CA to table as code#7. Now [.c.] becomes A. Next we\r
-get AB, which IS in the string table, so [.c.] gets AB, and we look at ABA,\r
-which is not in the string table, so output the code for AB, which is #4, and\r
-add ABA to the string table as code #8. [.c.] becomes A. We can't get any more\r
-characters, so we just output #0 for the code for A, and we're done. So, the\r
-codestream is #0#1#0#2#4#0.\r
-      A few words (four) should be said here about efficiency: use a hashing\r
-strategy. The search through the string table can be computationally\r
-intensive, and some hashing is well worth the effort. Also, note that\r
-"straight LZW" compression runs the risk of overflowing the string table -\r
-getting to a code which can't be represented in the number of bits you've set\r
-aside for codes. There are several ways of dealing with this problem, and GIF\r
-implements a very clever one, but we'll get to that.\r
-      An important thing to notice is that, at any point during the\r
-compression, if [...]K is in the string table, [...] is there also. This fact\r
-suggests an efficient method for storing strings in the table. Rather than\r
-store the entire string of K's in the table, realize that any string can be\r
-expressed as a prefix plus a character: [...]K. If we're about to store [...]K\r
-in the table, we know that [...] is already there, so we can just store the\r
-code for [...] plus the final character K.\r
-      Ok, that takes care of compression. Decompression is perhaps more\r
-difficult conceptually, but it is really easier to program.\r
-      Here's how it goes: We again have to start with an initialized string\r
-table. This table comes from what knowledge we have about the charstream that\r
-we will eventually get, like what possible values the characters can take. In\r
-GIF files, this information is in the header as the number of possible pixel\r
-values. The beauty of LZW, though, is that this is all we need to know. We\r
-will build the rest of the string table as we decompress the codestream. The\r
-compression is done in such a way that we will never encounter a code in the\r
-codestream that we can't translate into a string.\r
-      We need to define something called a "current code", which I will refer\r
-to as "<code>", and an "old-code", which I will refer to as "<old>". To start\r
-things off, look at the first code. This is now <code>. This code will be in\r
-the intialized string table as the code for a root. Output the root to the\r
-charstream. Make this code the old-code <old>. *Now look at the next code, and\r
-make it <code>. It is possible that this code will not be in the string table,\r
-but let's assume for now that it is. Output the string corresponding to <code>\r
-to the codestream. Now find the first character in the string you just\r
-translated. Call this K. Add this to the prefix [...] generated by <old> to\r
-form a new string [...]K. Add this string [...]K to the string table, and set\r
-the old-code <old> to the current code <code>. Repeat from where I typed the\r
-asterisk, and you're all set. Read this paragraph again if you just skimmed\r
-it!!!  Now let's consider the possibility that <code> is not in the string\r
-table. Think back to compression, and try to understand what happens when you\r
-have a string like P[...]P[...]PQ appear in the charstream. Suppose P[...] is\r
-already in the string table, but P[...]P is not. The compressor will parse out\r
-P[...], and find that P[...]P is not in the string table. It will output the\r
-code for P[...], and add P[...]P to the string table. Then it will get up to\r
-P[...]P for the next string, and find that P[...]P is in the table, as\r
-     the code just added. So it will output the code for P[...]P if it finds\r
-that P[...]PQ is not in the table. The decompressor is always "one step\r
-behind" the compressor. When the decompressor sees the code for P[...]P, it\r
-will not have added that code to it's string table yet because it needed the\r
-beginning character of P[...]P to add to the string for the last code, P[...],\r
-to form the code for P[...]P. However, when a decompressor finds a code that\r
-it doesn't know yet, it will always be the very next one to be added to the\r
-string table. So it can guess at what the string for the code should be, and,\r
-in fact, it will always be correct. If I am a decompressor, and I see\r
-code#124, and yet my string table has entries only up to code#123, I can\r
-figure out what code#124 must be, add it to my string table, and output the\r
-string. If code#123 generated the string, which I will refer to here as a\r
-prefix, [...], then code#124, in this special case, will be [...] plus the\r
-first character of [...]. So just add the first character of [...] to the end\r
-of itself. Not too bad.  As an example (and a very common one) of this special\r
-case, let's assume we have a raster image in which the first three pixels have\r
-the same color value. That is, my charstream looks like: QQQ.... For the sake\r
-of argument, let's say we have 32 colors, and Q is the color#12. The\r
-compressor will generate the code sequence 12,32,.... (if you don't know why,\r
-take a minute to understand it.) Remember that #32 is not in the initial\r
-table, which goes from #0 to #31. The decompressor will see #12 and translate\r
-it just fine as color Q. Then it will see #32 and not yet know what that\r
-means. But if it thinks about it long enough, it can figure out that QQ should\r
-be entry#32 in the table and QQ should be the next string output.  So the\r
-decompression pseudo-code goes something like:\r
-\r
-      [1] Initialize string table;\r
-     [2] get first code: <code>;\r
-     [3] output the string for <code> to the charstream;\r
-     [4] <old> = <code>;\r
-     [5] <code> <- next code in codestream;\r
-     [6] does <code> exist in the string table?\r
-      (yes: output the string for <code> to the charstream;\r
-            [...] <- translation for <old>;\r
-            K <- first character of translation for <code>;\r
-            add [...]K to the string table;        <old> <- <code>;  )\r
-      (no: [...] <- translation for <old>;\r
-           K <- first character of [...];\r
-           output [...]K to charstream and add it to string table;\r
-           <old> <- <code>\r
-      )\r
-     [7] go to [5];\r
-\r
-      Again, when you get to step [5] and there are no more codes, you're\r
-finished.  Outputting of strings, and finding of initial characters in strings\r
-are efficiency problems all to themselves, but I'm not going to suggest ways\r
-to do them here. Half the fun of programming is figuring these things out!\r
-      ---\r
-      Now for the GIF variations on the theme. In part of the header of a GIF\r
-file, there is a field, in the Raster Data stream, called "code size". This is\r
-a very misleading name for the field, but we have to live with it. What it is\r
-really is the "root size". The actual size, in bits, of the compression codes\r
-actually changes during compression/decompression, and I will refer to that\r
-size here as the "compression size". The initial table is just the codes for\r
-all the roots, as usual, but two special codes are added on top of those.\r
-Suppose you have a "code size", which is usually the number of bits per pixel\r
-in the image, of N. If the number of bits/pixel is one, then N must be 2: the\r
-roots take up slots #0 and #1 in the initial table, and the two special codes\r
-will take up slots #4 and #5. In any other case, N is the number of bits per\r
-pixel, and the roots take up slots #0 through #(2**N-1), and the special codes\r
-are (2**N) and (2**N + 1). The initial compression size will be N+1 bits per\r
-code. If you're encoding, you output the codes (N+1) bits at a time to start\r
-with, and if you're decoding, you grab (N+1) bits from the codestream at a\r
-time.  As for the special codes: <CC> or the clear code, is (2**N), and <EOI>,\r
-or end-of-information, is (2**N + 1). <CC> tells the compressor to re-\r
-initialize the string table, and to reset the compression size to (N+1). <EOI>\r
-means there's no more in the codestream.  If you're encoding or decoding, you\r
-should start adding things to the string table at <CC> + 2. If you're\r
-encoding, you should output <CC> as the very first code, and then whenever\r
-after that you reach code #4095 (hex FFF), because GIF does not allow\r
-compression sizes to be greater than 12 bits. If you're decoding, you should\r
-reinitialize your string table when you observe <CC>.  The variable\r
-compression sizes are really no big deal. If you're encoding, you start with a\r
-compression size of (N+1) bits, and, whenever you output the code\r
-(2**(compression size)-1), you bump the compression size up one bit. So the\r
-next code you output will be one bit longer. Remember that the largest\r
-compression size is 12 bits, corresponding to a code of 4095. If you get that\r
-far, you must output <CC> as the next code, and start over.  If you're\r
-decoding, you must increase your compression size AS SOON AS YOU write entry\r
-#(2**(compression size) - 1) to the string table. The next code you READ will\r
-be one bit longer. Don't make the mistake of waiting until you need to add the\r
-code (2**compression size) to the table. You'll have already missed a bit from\r
-the last code.  The packaging of codes into a bitsream for the raster data is\r
-also a potential stumbling block for the novice encoder or decoder. The lowest\r
-order bit in the code should coincide with the lowest available bit in the\r
-first available byte in the codestream. For example, if you're starting with\r
-5-bit compression codes, and your first three codes are, say, <abcde>,\r
-<fghij>, <klmno>, where e, j, and o are bit#0, then your codestream will start\r
-off like:\r
-\r
-       byte#0: hijabcde\r
-       byte#1: .klmnofg\r
-\r
-      So the differences between straight LZW and GIF LZW are: two additional\r
-special codes and variable compression sizes. If you understand LZW, and you\r
-understand those variations, you understand it all!\r
-      Just as sort of a P.S., you may have noticed that a compressor has a\r
-little bit of flexibility at compression time. I specified a "greedy" approach\r
-to the compression, grabbing as many characters as possible before outputting\r
-codes. This is, in fact, the standard LZW way of doing things, and it will\r
-yield the best compression ratio. But there's no rule saying you can't stop\r
-anywhere along the line and just output the code for the current prefix,\r
-whether it's already in the table or not, and add that string plus the next\r
-character to the string table. There are various reasons for wanting to do\r
-this, especially if the strings get extremely long and make hashing difficult.\r
-If you need to, do it.\r
-      Hope this helps out.----steve blackstock\r
-\r
----------------------------------------------------------------------------\r
-Article 5729 of comp.graphics:\r
-Path: polya!shelby!labrea!agate!ucbvax!tut.cis.ohio-state.edu!rutgers!cmcl2!phri!cooper!john\r
->From: john@cooper.cooper.EDU (John Barkaus)\r
-Newsgroups: comp.graphics\r
-Subject: GIF file format responses 4/5\r
-Keywords: GIF LZW\r
-Message-ID: <1489@cooper.cooper.EDU>\r
-Date: 21 Apr 89 20:56:35 GMT\r
-Organization: The Cooper Union (NY, NY)\r
-Lines: 1050\r
-\r
-\r
->From: cmcl2!neuron1.Jpl.Nasa.Gov!harry (Harry Langenbacher)\r
-\r
-                                G I F (tm)\r
-\r
-                     Graphics Interchange Format (tm)\r
-\r
-                      A standard defining a mechanism\r
-\r
-                     for the storage and transmission\r
-\r
-                   of raster-based graphics information\r
-\r
-                               June 15, 1987\r
-\r
-                     (c) CompuServe Incorporated, 1987\r
-\r
-                            All rights reserved\r
-\r
-            While this document is copyrighted, the information\r
-\r
-          contained within is made available for use in computer\r
-\r
-          software without royalties, or licensing restrictions.\r
-\r
-          GIF and 'Graphics Interchange Format' are trademarks of\r
-\r
-                         CompuServe, Incorporated.\r
-\r
-                           an H&R Block Company\r
-\r
-                        5000 Arlington Centre Blvd.\r
-\r
-                           Columbus, Ohio 43220\r
-\r
-                              (614) 457-8600\r
-\r
-                                                                     Page 2\r
-\r
-              Graphics Interchange Format (GIF) Specification\r
-\r
-                             Table of Contents\r
-\r
-        INTRODUCTION . . . . . . . . . . . . . . . . . page 3\r
-\r
-        GENERAL FILE FORMAT  . . . . . . . . . . . . . page 3\r
-\r
-        GIF SIGNATURE  . . . . . . . . . . . . . . . . page 4\r
-\r
-        SCREEN DESCRIPTOR  . . . . . . . . . . . . . . page 4\r
-\r
-        GLOBAL COLOR MAP . . . . . . . . . . . . . . . page 5\r
-\r
-        IMAGE DESCRIPTOR . . . . . . . . . . . . . . . page 6\r
-\r
-        LOCAL COLOR MAP  . . . . . . . . . . . . . . . page 7\r
-\r
-        RASTER DATA  . . . . . . . . . . . . . . . . . page 7\r
-\r
-        GIF TERMINATOR . . . . . . . . . . . . . . . . page 8\r
-\r
-        GIF EXTENSION BLOCKS . . . . . . . . . . . . . page 8\r
-\r
-        APPENDIX A - GLOSSARY  . . . . . . . . . . . . page 9\r
-\r
-        APPENDIX B - INTERACTIVE SEQUENCES . . . . . . page 10\r
-\r
-        APPENDIX C - IMAGE PACKAGING & COMPRESSION . . page 12\r
-\r
-        APPENDIX D - MULTIPLE IMAGE PROCESSING . . . . page 15\r
-\r
-Graphics Interchange Format (GIF)                                    Page 3\r
-\r
-Specification\r
-\r
-INTRODUCTION\r
-\r
-        'GIF' (tm) is CompuServe's standard for defining generalized  color\r
-\r
-   raster   images.    This   'Graphics  Interchange  Format'  (tm)  allows\r
-\r
-   high-quality, high-resolution graphics to be displayed on a  variety  of\r
-\r
-   graphics  hardware  and is intended as an exchange and display mechanism\r
-\r
-   for graphics images.  The image format described  in  this  document  is\r
-\r
-   designed  to  support  current  and  future image technology and will in\r
-\r
-   addition serve as a basis for future CompuServe graphics products.\r
-\r
-        The main focus  of  this  document  is  to  provide  the  technical\r
-\r
-   information  necessary  for  a  programmer to implement GIF encoders and\r
-\r
-   decoders.  As such, some assumptions are made as to terminology relavent\r
-\r
-   to graphics and programming in general.\r
-\r
-        The first section of this document describes the  GIF  data  format\r
-\r
-   and its components and applies to all GIF decoders, either as standalone\r
-\r
-   programs or as part of  a  communications  package.   Appendix  B  is  a\r
-\r
-   section  relavent to decoders that are part of a communications software\r
-\r
-   package and describes the protocol requirements for entering and exiting\r
-\r
-   GIF mode, and responding to host interrogations.  A glossary in Appendix\r
-\r
-   A defines some of the terminology used in  this  document.   Appendix  C\r
-\r
-   gives  a  detailed  explanation  of  how  the  graphics  image itself is\r
-\r
-   packaged as a series of data bytes.\r
-\r
-                Graphics Interchange Format Data Definition\r
-\r
- GENERAL FILE FORMAT\r
-\r
-        +-----------------------+\r
-\r
-        | +-------------------+ |\r
-\r
-        | |   GIF Signature   | |\r
-\r
-        | +-------------------+ |\r
-\r
-        | +-------------------+ |\r
-\r
-        | | Screen Descriptor | |\r
-\r
-        | +-------------------+ |\r
-\r
-        | +-------------------+ |\r
-\r
-        | | Global Color Map  | |\r
-\r
-        | +-------------------+ |\r
-\r
-        . . .               . . .\r
-\r
-        | +-------------------+ |    ---+\r
-\r
-        | |  Image Descriptor | |       |\r
-\r
-        | +-------------------+ |       |\r
-\r
-        | +-------------------+ |       |\r
-\r
-        | |  Local Color Map  | |       |-   Repeated 1 to n times\r
-\r
-        | +-------------------+ |       |\r
-\r
-        | +-------------------+ |       |\r
-\r
-        | |    Raster Data    | |       |\r
-\r
-        | +-------------------+ |    ---+\r
-\r
-        . . .               . . .\r
-\r
-        |-    GIF Terminator   -|\r
-\r
-        +-----------------------+\r
-\r
-Graphics Interchange Format (GIF)                                    Page 4\r
-\r
-Specification\r
-\r
- GIF SIGNATURE\r
-\r
-        The following GIF Signature identifies  the  data  following  as  a\r
-\r
-   valid GIF image stream.  It consists of the following six characters:\r
-\r
-             G I F 8 7 a\r
-\r
-        The last three characters '87a' may be viewed as a  version  number\r
-\r
-   for  this  particular  GIF  definition  and will be used in general as a\r
-\r
-   reference  in  documents  regarding  GIF  that   address   any   version\r
-\r
-   dependencies.\r
-\r
- SCREEN DESCRIPTOR\r
-\r
-        The Screen Descriptor describes the overall parameters for all  GIF\r
-\r
-   images  following.  It defines the overall dimensions of the image space\r
-\r
-   or logical screen required, the existance of color mapping  information,\r
-\r
-   background  screen color, and color depth information.  This information\r
-\r
-   is stored in a series of 8-bit bytes as described below.\r
-\r
-              bits\r
-\r
-         7 6 5 4 3 2 1 0  Byte #\r
-\r
-        +---------------+\r
-\r
-        |               |  1\r
-\r
-        +-Screen Width -+      Raster width in pixels (LSB first)\r
-\r
-        |               |  2\r
-\r
-        +---------------+\r
-\r
-        |               |  3\r
-\r
-        +-Screen Height-+      Raster height in pixels (LSB first)\r
-\r
-        |               |  4\r
-\r
-        +-+-----+-+-----+      M = 1, Global color map follows Descriptor\r
-\r
-        |M|  cr |0|pixel|  5   cr+1 = # bits of color resolution\r
-\r
-        +-+-----+-+-----+      pixel+1 = # bits/pixel in image\r
-\r
-        |   background  |  6   background=Color index of screen background\r
-\r
-        +---------------+          (color is defined from the Global color\r
-\r
-        |0 0 0 0 0 0 0 0|  7        map or default map if none specified)\r
-\r
-        +---------------+\r
-\r
-        The logical screen width and height can both  be  larger  than  the\r
-\r
-   physical  display.   How  images  larger  than  the physical display are\r
-\r
-   handled is implementation dependent and can take advantage  of  hardware\r
-\r
-   characteristics  (e.g.   Macintosh scrolling windows).  Otherwise images\r
-\r
-   can be clipped to the edges of the display.\r
-\r
-        The value of 'pixel' also defines  the  maximum  number  of  colors\r
-\r
-   within  an  image.   The  range  of  values  for 'pixel' is 0 to 7 which\r
-\r
-   represents 1 to 8 bits.  This translates to a range of 2 (B & W) to  256\r
-\r
-   colors.   Bit  3 of word 5 is reserved for future definition and must be\r
-\r
-   zero.\r
-\r
-Graphics Interchange Format (GIF)                                    Page 5\r
-\r
-Specification\r
-\r
- GLOBAL COLOR MAP\r
-\r
-        The Global Color Map is optional but recommended for  images  where\r
-\r
-   accurate color rendition is desired.  The existence of this color map is\r
-\r
-   indicated in the 'M' field of byte 5 of the Screen Descriptor.  A  color\r
-\r
-   map  can  also  be associated with each image in a GIF file as described\r
-\r
-   later.  However this  global  map  will  normally  be  used  because  of\r
-\r
-   hardware  restrictions  in equipment available today.  In the individual\r
-\r
-   Image Descriptors the 'M' flag will normally be  zero.   If  the  Global\r
-\r
-   Color  Map  is  present,  it's definition immediately follows the Screen\r
-\r
-   Descriptor.   The  number  of  color  map  entries  following  a  Screen\r
-\r
-   Descriptor  is equal to 2**(# bits per pixel), where each entry consists\r
-\r
-   of three byte values representing the relative intensities of red, green\r
-\r
-   and blue respectively.  The structure of the Color Map block is:\r
-\r
-              bits\r
-\r
-         7 6 5 4 3 2 1 0  Byte #\r
-\r
-        +---------------+\r
-\r
-        | red intensity |  1    Red value for color index 0\r
-\r
-        +---------------+\r
-\r
-        |green intensity|  2    Green value for color index 0\r
-\r
-        +---------------+\r
-\r
-        | blue intensity|  3    Blue value for color index 0\r
-\r
-        +---------------+\r
-\r
-        | red intensity |  4    Red value for color index 1\r
-\r
-        +---------------+\r
-\r
-        |green intensity|  5    Green value for color index 1\r
-\r
-        +---------------+\r
-\r
-        | blue intensity|  6    Blue value for color index 1\r
-\r
-        +---------------+\r
-\r
-        :               :       (Continues for remaining colors)\r
-\r
-        Each image pixel value received will be displayed according to  its\r
-\r
-   closest match with an available color of the display based on this color\r
-\r
-   map.  The color components represent a fractional intensity  value  from\r
-\r
-   none  (0)  to  full (255).  White would be represented as (255,255,255),\r
-\r
-   black as (0,0,0) and medium yellow as (180,180,0).  For display, if  the\r
-\r
-   device  supports fewer than 8 bits per color component, the higher order\r
-\r
-   bits of each component are used.  In the creation of  a  GIF  color  map\r
-\r
-   entry  with  hardware  supporting  fewer  than 8 bits per component, the\r
-\r
-   component values for the hardware  should  be  converted  to  the  8-bit\r
-\r
-   format with the following calculation:\r
-\r
-        <map_value> = <component_value>*255/(2**<nbits> -1)\r
-\r
-        This assures accurate translation of colors for all  displays.   In\r
-\r
-   the  cases  of  creating  GIF images from hardware without color palette\r
-\r
-   capability, a fixed palette should be created  based  on  the  available\r
-\r
-   display  colors for that hardware.  If no Global Color Map is indicated,\r
-\r
-   a default color map is generated internally  which  maps  each  possible\r
-\r
-   incoming  color  index to the same hardware color index modulo <n> where\r
-\r
-   <n> is the number of available hardware colors.\r
-\r
-Graphics Interchange Format (GIF)                                    Page 6\r
-\r
-Specification\r
-\r
- IMAGE DESCRIPTOR\r
-\r
-        The Image Descriptor defines the actual placement  and  extents  of\r
-\r
-   the  following  image within the space defined in the Screen Descriptor.\r
-\r
-   Also defined are flags to indicate the presence of a local color  lookup\r
-\r
-   map, and to define the pixel display sequence.  Each Image Descriptor is\r
-\r
-   introduced by an image separator  character.   The  role  of  the  Image\r
-\r
-   Separator  is simply to provide a synchronization character to introduce\r
-\r
-   an Image Descriptor.  This is desirable if a GIF file happens to contain\r
-\r
-   more  than  one  image.   This  character  is defined as 0x2C hex or ','\r
-\r
-   (comma).  When this character is encountered between images,  the  Image\r
-\r
-   Descriptor will follow immediately.\r
-\r
-        Any characters encountered between the end of a previous image  and\r
-\r
-   the image separator character are to be ignored.  This allows future GIF\r
-\r
-   enhancements to be present in newer image formats and yet ignored safely\r
-\r
-   by older software decoders.\r
-\r
-              bits\r
-\r
-         7 6 5 4 3 2 1 0  Byte #\r
-\r
-        +---------------+\r
-\r
-        |0 0 1 0 1 1 0 0|  1    ',' - Image separator character\r
-\r
-        +---------------+\r
-\r
-        |               |  2    Start of image in pixels from the\r
-\r
-        +-  Image Left -+       left side of the screen (LSB first)\r
-\r
-        |               |  3\r
-\r
-        +---------------+\r
-\r
-        |               |  4\r
-\r
-        +-  Image Top  -+       Start of image in pixels from the\r
-\r
-        |               |  5    top of the screen (LSB first)\r
-\r
-        +---------------+\r
-\r
-        |               |  6\r
-\r
-        +- Image Width -+       Width of the image in pixels (LSB first)\r
-\r
-        |               |  7\r
-\r
-        +---------------+\r
-\r
-        |               |  8\r
-\r
-        +- Image Height-+       Height of the image in pixels (LSB first)\r
-\r
-        |               |  9\r
-\r
-        +-+-+-+-+-+-----+       M=0 - Use global color map, ignore 'pixel'\r
-\r
-        |M|I|0|0|0|pixel| 10    M=1 - Local color map follows, use 'pixel'\r
-\r
-        +-+-+-+-+-+-----+       I=0 - Image formatted in Sequential order\r
-\r
-                                I=1 - Image formatted in Interlaced order\r
-\r
-                                pixel+1 - # bits per pixel for this image\r
-\r
-        The specifications for the image position and size must be confined\r
-\r
-   to  the  dimensions defined by the Screen Descriptor.  On the other hand\r
-\r
-   it is not necessary that the image fill the entire screen defined.\r
-\r
- LOCAL COLOR MAP\r
-\r
-Graphics Interchange Format (GIF)                                    Page 7\r
-\r
-Specification\r
-\r
-        A Local Color Map is optional and defined here for future use.   If\r
-\r
-   the  'M' bit of byte 10 of the Image Descriptor is set, then a color map\r
-\r
-   follows the Image Descriptor that applies only to the  following  image.\r
-\r
-   At the end of the image, the color map will revert to that defined after\r
-\r
-   the Screen Descriptor.  Note that the 'pixel' field of byte  10  of  the\r
-\r
-   Image  Descriptor  is used only if a Local Color Map is indicated.  This\r
-\r
-   defines the parameters not only for the image pixel size, but determines\r
-\r
-   the  number  of color map entries that follow.  The bits per pixel value\r
-\r
-   will also revert to the value specified in the  Screen  Descriptor  when\r
-\r
-   processing of the image is complete.\r
-\r
- RASTER DATA\r
-\r
-        The format of the actual image is defined as the  series  of  pixel\r
-\r
-   color  index  values that make up the image.  The pixels are stored left\r
-\r
-   to right sequentially for an image row.  By default each  image  row  is\r
-\r
-   written  sequentially, top to bottom.  In the case that the Interlace or\r
-\r
-   'I' bit is set in byte 10 of the Image Descriptor then the row order  of\r
-\r
-   the  image  display  follows  a  four-pass process in which the image is\r
-\r
-   filled in by widely spaced rows.  The first pass writes every  8th  row,\r
-\r
-   starting  with  the top row of the image window.  The second pass writes\r
-\r
-   every 8th row starting at the fifth row from the top.   The  third  pass\r
-\r
-   writes every 4th row starting at the third row from the top.  The fourth\r
-\r
-   pass completes the image, writing  every  other  row,  starting  at  the\r
-\r
-   second row from the top.  A graphic description of this process follows:\r
-\r
-   Image\r
-\r
-   Row  Pass 1  Pass 2  Pass 3  Pass 4          Result\r
-\r
-   ---------------------------------------------------\r
-\r
-     0  **1a**                                  **1a**\r
-\r
-     1                          **4a**          **4a**\r
-\r
-     2                  **3a**                  **3a**\r
-\r
-     3                          **4b**          **4b**\r
-\r
-     4          **2a**                          **2a**\r
-\r
-     5                          **4c**          **4c**\r
-\r
-     6                  **3b**                  **3b**\r
-\r
-     7                          **4d**          **4d**\r
-\r
-     8  **1b**                                  **1b**\r
-\r
-     9                          **4e**          **4e**\r
-\r
-    10                  **3c**                  **3c**\r
-\r
-    11                          **4f**          **4f**\r
-\r
-    12          **2b**                          **2b**\r
-\r
-   . . .\r
-\r
-        The image pixel values are processed as a series of  color  indices\r
-\r
-   which  map  into the existing color map.  The resulting color value from\r
-\r
-   the map is what is actually displayed.  This series  of  pixel  indices,\r
-\r
-   the  number  of  which  is equal to image-width*image-height pixels, are\r
-\r
-   passed to the GIF image data stream one value per pixel, compressed  and\r
-\r
-   packaged  according  to  a  version  of the LZW compression algorithm as\r
-\r
-   defined in Appendix C.\r
-\r
-Graphics Interchange Format (GIF)                                    Page 8\r
-\r
-Specification\r
-\r
- GIF TERMINATOR\r
-\r
-        In order to provide a synchronization for the termination of a  GIF\r
-\r
-   image  file,  a  GIF  decoder  will process the end of GIF mode when the\r
-\r
-   character 0x3B hex or ';' is found after an image  has  been  processed.\r
-\r
-   By  convention  the  decoding software will pause and wait for an action\r
-\r
-   indicating that the user is ready to continue.  This may be  a  carriage\r
-\r
-   return  entered  at  the  keyboard  or  a  mouse click.  For interactive\r
-\r
-   applications this user action must  be  passed  on  to  the  host  as  a\r
-\r
-   carriage  return  character  so  that the host application can continue.\r
-\r
-   The decoding software will then typically leave graphics mode and resume\r
-\r
-   any previous process.\r
-\r
- GIF EXTENSION BLOCKS\r
-\r
-        To provide for orderly extension of the GIF definition, a mechanism\r
-\r
-   for  defining  the  packaging  of extensions within a GIF data stream is\r
-\r
-   necessary.  Specific GIF extensions are to be defined and documented  by\r
-\r
-   CompuServe in order to provide a controlled enhancement path.\r
-\r
-        GIF Extension Blocks are packaged in a manner similar to that  used\r
-\r
-   by the raster data though not compressed.  The basic structure is:\r
-\r
-         7 6 5 4 3 2 1 0  Byte #\r
-\r
-        +---------------+\r
-\r
-        |0 0 1 0 0 0 0 1|  1       '!' - GIF Extension Block Introducer\r
-\r
-        +---------------+\r
-\r
-        | function code |  2       Extension function code (0 to 255)\r
-\r
-        +---------------+    ---+\r
-\r
-        |  byte count   |       |\r
-\r
-        +---------------+       |\r
-\r
-        :               :       +-- Repeated as many times as necessary\r
-\r
-        |func data bytes|       |\r
-\r
-        :               :       |\r
-\r
-        +---------------+    ---+\r
-\r
-        . . .       . . .\r
-\r
-        +---------------+\r
-\r
-        |0 0 0 0 0 0 0 0|       zero byte count (terminates block)\r
-\r
-        +---------------+\r
-\r
-        A GIF Extension Block may immediately preceed any Image  Descriptor\r
-\r
-   or occur before the GIF Terminator.\r
-\r
-        All GIF decoders must be able to recognize  the  existence  of  GIF\r
-\r
-   Extension  Blocks  and  read past them if unable to process the function\r
-\r
-   code.  This ensures that older decoders will be able to process extended\r
-\r
-   GIF   image   files   in  the  future,  though  without  the  additional\r
-\r
-   functionality.\r
-\r
-Graphics Interchange Format (GIF)                                    Page 9\r
-\r
-Appendix A - Glossary\r
-\r
-                                 GLOSSARY\r
-\r
-Pixel - The smallest picture element of a  graphics  image.   This  usually\r
-\r
-   corresponds  to  a single dot on a graphics screen.  Image resolution is\r
-\r
-   typically given in units of  pixels.   For  example  a  fairly  standard\r
-\r
-   graphics  screen  format  is  one 320 pixels across and 200 pixels high.\r
-\r
-   Each pixel can  appear  as  one  of  several  colors  depending  on  the\r
-\r
-   capabilities of the graphics hardware.\r
-\r
-Raster - A horizontal row of pixels representing one line of an  image.   A\r
-\r
-   typical method of working with images since most hardware is oriented to\r
-\r
-   work most efficiently in this manner.\r
-\r
-LSB - Least Significant Byte.  Refers to a convention for two byte  numeric\r
-\r
-   values in which the less significant byte of the value preceeds the more\r
-\r
-   significant byte.  This convention is typical on many microcomputers.\r
-\r
-Color Map - The list of definitions of each color  used  in  a  GIF  image.\r
-\r
-   These  desired  colors are converted to available colors through a table\r
-\r
-   which is derived by assigning an incoming color index (from  the  image)\r
-\r
-   to  an  output  color  index  (of  the  hardware).   While the color map\r
-\r
-   definitons are specified in a GIF image, the output  pixel  colors  will\r
-\r
-   vary  based  on  the  hardware used and its ability to match the defined\r
-\r
-   color.\r
-\r
-Interlace - The method of displaying a GIF image in which  multiple  passes\r
-\r
-   are  made,  outputting  raster  lines  spaced  apart to provide a way of\r
-\r
-   visualizing the general content of an entire image  before  all  of  the\r
-\r
-   data has been processed.\r
-\r
-B Protocol - A CompuServe-developed error-correcting file transfer protocol\r
-\r
-   available  in  the  public  domain  and implemented in CompuServe VIDTEX\r
-\r
-   products.  This error checking mechanism will be used  in  transfers  of\r
-\r
-   GIF images for interactive applications.\r
-\r
-LZW - A sophisticated data compression algorithm  based  on  work  done  by\r
-\r
-   Lempel-Ziv  &  Welch  which  has  the feature of very efficient one-pass\r
-\r
-   encoding and decoding.  This allows the image  to  be  decompressed  and\r
-\r
-   displayed  at  the  same  time.   The  original  article from which this\r
-\r
-   technique was adapted is:\r
-\r
-          Terry  A.   Welch,  "A  Technique  for  High   Performance   Data\r
-\r
-          Compression", IEEE Computer, vol 17 no 6 (June 1984)\r
-\r
-        This basic algorithm is also used in the  public  domain  ARC  file\r
-\r
-   compression  utilities.   The  CompuServe  adaptation  of LZW for GIF is\r
-\r
-   described in Appendix C.\r
-\r
-Graphics Interchange Format (GIF)                                   Page 10\r
-\r
-Appendix B - Interactive Sequences\r
-\r
-           GIF Sequence Exchanges for an Interactive Environment\r
-\r
-        The following sequences are defined for use  in  mediating  control\r
-\r
-   between a GIF sender and GIF receiver over an interactive communications\r
-\r
-   line.  These  sequences  do  not  apply  to  applications  that  involve\r
-\r
-   downloading  of  static  GIF  files and are not considered part of a GIF\r
-\r
-   file.\r
-\r
- GIF CAPABILITIES ENQUIRY\r
-\r
-        The GCE sequence is issued from a host and requests an  interactive\r
-\r
-   GIF  decoder  to  return  a  response  message that defines the graphics\r
-\r
-   parameters for the decoder.  This involves returning  information  about\r
-\r
-   available screen sizes, number of bits/color supported and the amount of\r
-\r
-   color detail supported.  The escape sequence for the GCE is defined as:\r
-\r
-        ESC [ > 0 g     (g is lower case, spaces inserted for clarity)\r
-\r
-                         (0x1B 0x5B 0x3E 0x30 0x67)\r
-\r
- GIF CAPABILITIES RESPONSE\r
-\r
-        The GIF Capabilities Response message is returned by an interactive\r
-\r
-   GIF  decoder  and  defines  the  decoder's  display capabilities for all\r
-\r
-   graphics modes that are supported by the software.  Note that  this  can\r
-\r
-   also include graphics printers as well as a monitor screen.  The general\r
-\r
-   format of this message is:\r
-\r
-     #version;protocol{;dev, width, height, color-bits, color-res}... <CR>\r
-\r
-   '#'          - GCR identifier character (Number Sign)\r
-\r
-   version      - GIF format version number;  initially '87a'\r
-\r
-   protocol='0' - No end-to-end protocol supported by decoder\r
-\r
-                  Transfer as direct 8-bit data stream.\r
-\r
-   protocol='1' - Can use an error correction protocol to transfer GIF data\r
-\r
-               interactively from the host directly to the display.\r
-\r
-   dev = '0'    - Screen parameter set follows\r
-\r
-   dev = '1'    - Printer parameter set follows\r
-\r
-   width- Maximum supported display width in pixels\r
-\r
-   height       - Maximum supported display height in pixels\r
-\r
-   color-bits   - Number of  bits  per  pixel  supported.   The  number  of\r
-\r
-               supported colors is therefore 2**color-bits.\r
-\r
-   color-res    - Number of bits  per  color  component  supported  in  the\r
-\r
-               hardware  color  palette.   If  color-res  is  '0'  then  no\r
-\r
-               hardware palette table is available.\r
-\r
-        Note that all values in the  GCR  are  returned  as  ASCII  decimal\r
-\r
-   numbers and the message is terminated by a Carriage Return character.\r
-\r
-Graphics Interchange Format (GIF)                                   Page 11\r
-\r
-Appendix B - Interactive Sequences\r
-\r
-        The  following   GCR   message   describes   three   standard   EGA\r
-\r
-   configurations  with  no  printer;  the GIF data stream can be processed\r
-\r
-   within an error correcting protocol:\r
-\r
-        #87a;1 ;0,320,200,4,0 ;0,640,200,2,2 ;0,640,350,4,2<CR>\r
-\r
- ENTER GIF GRAPHICS MODE\r
-\r
-        Two sequences are currently defined to invoke  an  interactive  GIF\r
-\r
-   decoder into action.  The only difference between them is that different\r
-\r
-   output media are selected.  These sequences are:\r
-\r
-     ESC [ > 1 g   Display GIF image on screen\r
-\r
-                   (0x1B 0x5B 0x3E 0x31 0x67)\r
-\r
-     ESC [ > 2 g   Display image directly to an attached graphics  printer.\r
-\r
-                   The  image  may optionally be displayed on the screen as\r
-\r
-                   well.\r
-\r
-                   (0x1B 0x5B 0x3E 0x32 0x67)\r
-\r
-        Note that the 'g' character terminating each sequence is  in  lower\r
-\r
-   case.\r
-\r
- INTERACTIVE ENVIRONMENT\r
-\r
-        The assumed environment for the transmission of GIF image data from\r
-\r
-   an  interactive  application  is  a  full 8-bit data stream from host to\r
-\r
-   micro.  All 256 character codes must be transferrable.  The establishing\r
-\r
-   of  an 8-bit data path for communications will normally be taken care of\r
-\r
-   by the host application programs.  It is however  up  to  the  receiving\r
-\r
-   communications programs supporting GIF to be able to receive and pass on\r
-\r
-   all 256 8-bit codes to the GIF decoder software.\r
-\r
-Graphics Interchange Format (GIF)                                   Page 12\r
-\r
-Appendix C - Image Packaging & Compression\r
-\r
-        The Raster Data stream that represents the actual output image  can\r
-\r
-   be represented as:\r
-\r
-         7 6 5 4 3 2 1 0\r
-\r
-        +---------------+\r
-\r
-        |   code size   |\r
-\r
-        +---------------+     ---+\r
-\r
-        |blok byte count|        |\r
-\r
-        +---------------+        |\r
-\r
-        :               :        +-- Repeated as many times as necessary\r
-\r
-        |  data bytes   |        |\r
-\r
-        :               :        |\r
-\r
-        +---------------+     ---+\r
-\r
-        . . .       . . .\r
-\r
-        +---------------+\r
-\r
-        |0 0 0 0 0 0 0 0|       zero byte count (terminates data stream)\r
-\r
-        +---------------+\r
-\r
-        The conversion of the image from a series  of  pixel  values  to  a\r
-\r
-   transmitted or stored character stream involves several steps.  In brief\r
-\r
-   these steps are:\r
-\r
-   1.  Establish the Code Size -  Define  the  number  of  bits  needed  to\r
-\r
-       represent the actual data.\r
-\r
-   2.  Compress the Data - Compress the series of image pixels to a  series\r
-\r
-       of compression codes.\r
-\r
-   3.  Build a Series of Bytes - Take the  set  of  compression  codes  and\r
-\r
-       convert to a string of 8-bit bytes.\r
-\r
-   4.  Package the Bytes - Package sets of bytes into blocks  preceeded  by\r
-\r
-       character counts and output.\r
-\r
-ESTABLISH CODE SIZE\r
-\r
-        The first byte of the GIF Raster Data stream is a value  indicating\r
-\r
-   the minimum number of bits required to represent the set of actual pixel\r
-\r
-   values.  Normally this will be the same as the  number  of  color  bits.\r
-\r
-   Because  of  some  algorithmic constraints however, black & white images\r
-\r
-   which have one color bit must be indicated as having a code size  of  2.\r
-\r
-   This  code size value also implies that the compression codes must start\r
-\r
-   out one bit longer.\r
-\r
-COMPRESSION\r
-\r
-        The LZW algorithm converts a series of data values into a series of\r
-\r
-   codes  which may be raw values or a code designating a series of values.\r
-\r
-   Using text characters as an analogy,  the  output  code  consists  of  a\r
-\r
-   character or a code representing a string of characters.\r
-\r
-Graphics Interchange Format (GIF)                                   Page 13\r
-\r
-Appendix C - Image Packaging & Compression\r
-\r
-        The LZW algorithm used in  GIF  matches  algorithmically  with  the\r
-\r
-   standard LZW algorithm with the following differences:\r
-\r
-   1.  A   special   Clear   code   is    defined    which    resets    all\r
-\r
-       compression/decompression parameters and tables to a start-up state.\r
-\r
-       The value of this code is 2**<code size>.  For example if  the  code\r
-\r
-       size  indicated  was 4 (image was 4 bits/pixel) the Clear code value\r
-\r
-       would be 16 (10000 binary).  The Clear code can appear at any  point\r
-\r
-       in the image data stream and therefore requires the LZW algorithm to\r
-\r
-       process succeeding codes as if  a  new  data  stream  was  starting.\r
-\r
-       Encoders  should output a Clear code as the first code of each image\r
-\r
-       data stream.\r
-\r
-   2.  An End of Information code is defined that explicitly indicates  the\r
-\r
-       end  of  the image data stream.  LZW processing terminates when this\r
-\r
-       code is encountered.  It must be the last code output by the encoder\r
-\r
-       for an image.  The value of this code is <Clear code>+1.\r
-\r
-   3.  The first available compression code value is <Clear code>+2.\r
-\r
-   4.  The output codes are of variable length, starting  at  <code size>+1\r
-\r
-       bits  per code, up to 12 bits per code.  This defines a maximum code\r
-\r
-       value of 4095 (hex FFF).  Whenever the LZW code value  would  exceed\r
-\r
-       the  current  code length, the code length is increased by one.  The\r
-\r
-       packing/unpacking of these codes must then be altered to reflect the\r
-\r
-       new code length.\r
-\r
-BUILD 8-BIT BYTES\r
-\r
-        Because the LZW compression  used  for  GIF  creates  a  series  of\r
-\r
-   variable  length  codes, of between 3 and 12 bits each, these codes must\r
-\r
-   be reformed into a series of 8-bit bytes that  will  be  the  characters\r
-\r
-   actually stored or transmitted.  This provides additional compression of\r
-\r
-   the image.  The codes are formed into a stream of bits as if  they  were\r
-\r
-   packed  right to left and then picked off 8 bits at a time to be output.\r
-\r
-   Assuming a character array of 8 bits per character and using 5 bit codes\r
-\r
-   to be packed, an example layout would be similar to:\r
-\r
-         byte n       byte 5   byte 4   byte 3   byte 2   byte 1\r
-\r
-        +-.....-----+--------+--------+--------+--------+--------+\r
-\r
-        | and so on |hhhhhggg|ggfffffe|eeeedddd|dcccccbb|bbbaaaaa|\r
-\r
-        +-.....-----+--------+--------+--------+--------+--------+\r
-\r
-        Note that the physical  packing  arrangement  will  change  as  the\r
-\r
-   number  of  bits per compression code change but the concept remains the\r
-\r
-   same.\r
-\r
-PACKAGE THE BYTES\r
-\r
-        Once the bytes have been created, they are grouped into blocks  for\r
-\r
-   output by preceeding each block of 0 to 255 bytes with a character count\r
-\r
-   byte.  A block with a zero byte count terminates the Raster Data  stream\r
-\r
-   for  a  given  image.  These blocks are what are actually output for the\r
-\r
-Graphics Interchange Format (GIF)                                   Page 14\r
-\r
-Appendix C - Image Packaging & Compression\r
-\r
-   GIF image.  This block format has the side effect of allowing a decoding\r
-\r
-   program  the  ability to read past the actual image data if necessary by\r
-\r
-   reading block counts and then skipping over the data.\r
-\r
-Graphics Interchange Format (GIF)                                   Page 15\r
-\r
-Appendix D - Multiple Image Processing\r
-\r
-        Since a  GIF  data  stream  can  contain  multiple  images,  it  is\r
-\r
-   necessary  to  describe  processing and display of such a file.  Because\r
-\r
-   the image descriptor allows  for  placement  of  the  image  within  the\r
-\r
-   logical  screen,  it is possible to define a sequence of images that may\r
-\r
-   each be a partial screen, but in total  fill  the  entire  screen.   The\r
-\r
-   guidelines for handling the multiple image situation are:\r
-\r
-   1.  There is no pause between images.  Each is processed immediately  as\r
-\r
-       seen by the decoder.\r
-\r
-   2.  Each image explicitly overwrites any image  already  on  the  screen\r
-\r
-       inside  of  its window.  The only screen clears are at the beginning\r
-\r
-       and end of the  GIF  image  process.   See  discussion  on  the  GIF\r
-\r
-       terminator.\r
-\r
-\r
diff --git a/16/PCGPE10/GMOUSE.DOC b/16/PCGPE10/GMOUSE.DOC
deleted file mode 100644 (file)
index 78d4556..0000000
+++ /dev/null
@@ -1,1501 +0,0 @@
-             PROGRAMMER'S  REFERENCE  FOR  GENIUS  MOUSE  DRIVER\r
-\r
-*** 1 : BRIEF DESCRIPTION\r
-\r
-The Genius Mouse Driver enables you to use mouse hardware to move an on-screen\r
-cursor and control its movement through a software program.  Various functions\r
-allow you to determine cursor placement, cursor shape, and button status.\r
-\r
-In order for you to interface your Genius Mouse with an application program, the\r
-following information on the Genius Driver has been provided.\r
-\r
-*** 2 : GRAPHICS AND TEXT CURSORS\r
-\r
-GMOUSE Driver supports a hardware text cursor,  a software  text   cursor, and\r
-a graphics cursor. A hardware text cursor is a blinking cursor which moves from\r
-one character to another on-screen. This blinking cursor may take the form of a\r
-block or underscore. A software text cursor makes use of display attributes to\r
-change the visual appearance of a character on-screen.  Movement is from\r
-character to character. A graphics cursor is a shape that moves over on-screen\r
-images.\r
-\r
-You can choose any of these three cursors to use on-screen, however, only one\r
-cursor can be displayed at a given time.  Also, within your application program,\r
-you can switch back and forth between cursors.\r
-\r
-\r
-Display the Graphics Cursor\r
-\r
-The cursor appears on-screen or disappears from the screen through the calling\r
-program.  This cursor consists of a block of pixels.  As this block moves\r
-on-screen and affects the pixels beneath it, the cursor shape and background are\r
-created. This interaction is defined by two 16-by-16 bit arrays;\r
-one is the screen mask and the other is the cursor mask. The screen mask\r
-determines what part of the cursor pixel is to be the shape, and what part  is\r
-is to be the background. The cursor mask determines which pixels contribute to\r
-the color of the cursor. Whenever changes are made to the screen which lie\r
-directly  beneath the cursor, the cursor should be concealed so that old values\r
-are not restored to the screen.\r
-\r
-Please note that with a high resolution mode, you have a 16-by-16 pixel block;\r
-with a medium resolution (four color) mode, you have a 8-by-16 pixel block; with\r
-a medium resolution (sixteen color) mode, you have a 4-by-16 pixel block.\r
-\r
-Refer to function 9.\r
-\r
-To create the cursor, the software uses data from the computer's screen memory\r
-which defines the color of each pixel on-screen.  Operations are performed that\r
-affect individual screen bits.  Software ANDs the screen mask defining the\r
-pixels under the cursor and XORs the cursor mask with the result of the AND\r
-operation.\r
-\r
-Note the results when:\r
-\r
-\r
-\r
-\r
-\r
-\r
-                                 page 1\r
-\f\r
-Screen Mask Bit is      Cursor Mask Bit is      Resulting Screen Bit is\r
-------------------      ------------------      -----------------------\r
-        0                        0                         0\r
-        0                        1                         1\r
-        1                        0                     unchanged\r
-        1                        1                      inverted\r
-\r
-With each mouse function, a reference to the graphics cursor location is in\r
-reference to a point on-screen directly beneath the cursor.  This point that the\r
-mouse software uses to determine the cursor coordinates is known as the cursor's\r
-hot spot.\r
-Generally, the upper_left hand corner of the cursor block is designated as the\r
-coordinates for the cursor default value. ((0,0) are the upper_left hand corner\r
-coordinates.)\r
-\r
-Software Text Cursor\r
-\r
-You can use this text cursor when your computer is in one of the text modes.  By\r
-changing the character attributes beneath the cursor, the appearance of the\r
-character is influenced on-screen.  This effect on the text cursor can be\r
-defined by two 16-bit mask values. These bits can be described as follows:\r
-bit 15 sets the blinking (1) or non-blinking (0) character ; bit 12 - 14 set the\r
-background (1); bits 8 - 10 set the foreground color; and bits 0 - 7 set the\r
-character code. These values in the screen mask and the cursor mask\r
-determine the character's new attributes when the cursor is covering the\r
-character.  The screen mask decides which of the character's attributes are\r
-maintained. The cursor mask decides in what manner the attributes are altered\r
-to produce the cursor.\r
-\r
-In creating this cursor, the software works from data which defines each\r
-character on the screen.  The software first ANDs the screen mask and the screen\r
-data bit for the character beneath the cursor.  Next, the software XORs the\r
-cursor mask and the result of the AND operation.\r
-\r
-When a function refers to the text cursor location, it gives the coordinates of\r
-the character beneath the cursor.\r
-\r
-Refer  to function 10.\r
-\r
-Hardware Text Cursor\r
-\r
-This cursor is also available when the computer is in one of the text modes.\r
-This cursor is the one seen on-screen when the computer is powered on.  It\r
-consists of 8 pixels wide and 8 to 14 pixels tall.  Software allows you to use\r
-this cursor for your needs. Scan lines determine a cursor's appearance\r
-on-screen. A scan line consists of a horizontal set of pixels.\r
-If a line is on, there will be flashing on the screen. If a line is off, there\r
-is no effect. Scan lines are numbered from 0 to 7, or 0 to 11 depending on the\r
-type of display used. 0 indicates the top scan line.\r
-\r
-Refer to function 10.\r
-\r
-*** 2.1 : Mouse Buttons\r
-\r
-\r
-\r
-\r
-\r
-                                 page 2\r
-\f\r
-Mouse functions can give the status of the mouse buttons and the number of times\r
-a certain button has been pressed and released.  The button status is given as\r
-an integer. If a bit is set to 1 the button is down; if a bit is set to 0, the\r
-button is up.\r
-      Bit 0 - Left Button Status\r
-      Bit 1 - Right Button Status\r
-      Bit 2 - Middle Button Status\r
-Each time a mouse button is pressed, a counter records the number of presses and\r
-releases.  The software sets the counter to zero once it has been read or after\r
-a reset.\r
-\r
-*** 2.2 : Unit of Distance - Mouse Motion\r
-\r
-The motion of the mouse can be expressed in a unit of distance (mouse motion)\r
-and is approximately 1/200 of an inch.\r
-\r
-With mouse movement, mouse software determines a horizontal and vertical mouse\r
-motion count.  This count is used by the software to move a cursor a certain\r
-number of pixels on-screen.  Software defines mouse motion sensitivity (the\r
-number of mouse motions needed to move the cursor 8 pixels on-screen) and this\r
-sensitivity determines the rate at which the cursor moves on-screen.\r
-\r
-Refer to function 15.\r
-\r
-*** 2.3 : Internal Cursor Flag\r
-\r
-Mouse software supports an internal flag.  This flag determines when the cursor\r
-should appear on-screen.  If the flag equals 0, the cursor appears on-screen; if\r
-the flag is any other number, the cursor disappears from the screen.\r
-\r
-You can call functions 1 and 2 a number of times, however, if you call function\r
-2, you must call function 1 later.  This is necessary to restore the flag's\r
-previous value.\r
-\r
-Refer to functions 1 and 2.\r
-\r
-*** 3 : CALLING FROM ASSEMBLY LANGUAGE PROGRAMS\r
-\r
-To make mouse function calls:\r
-\r
-Load the appropriate registers (AX, BX, CX, DX) with the parameter values.\r
-These correspond to G1%, G2%, G3%, and G4% as shown in the BASIC example to\r
-follow.  Then execute software interrupt 51 (33H).  The values given by the\r
-mouse functions will be installed in the registers.\r
-\r
-Example:\r
-\r
-   ; * set cursor to location (150,100)\r
-   Mov AX,4    ;(function call 4)\r
-   Mov CX,150  ;(set horizontal to 150)\r
-   Mov DX,100  ;(set vertical to 100)\r
-   Int 51(33H) ;(interrupt to mouse)\r
-\r
-It is important to note that before using INT 33H, one should verify the\r
-presence of the mouse driver.  Executing an INT 33H will cause uncertain results\r
-if the mouse driver is not loaded.  Assume a mouse driver is present when INT\r
-33H vector is non-zero and the vector does not point to an IRET instruction.\r
-\r
-                                 page 3\r
-\f\r
-Note:  When making a mouse call in Assembly Language, expect somewhat of a\r
-different value for the fourth parameter (when compared with calls using a BASIC\r
-program) involving functions 9, 12, and 16.\r
-\r
-*** 4 : CALLING FROM BASIC LANGUAGE PROGRAM\r
-\r
-To make  mouse function calls:\r
-\r
-  Set a pair of integer variables in your program for the offset and the segment\r
-  of the mouse driver entry point.\r
-\r
-  In order to obtain the offset and segment values, the following statements\r
-  must be inserted into your program before any calls to mouse functions:\r
-\r
-10 DEF SEG = 0\r
-15 ' GET GMOUSE ENTRY POINT\r
-20 GMSEG   = PEEK( 51*4 + 2 ) + 256 * PEEK( 51*4 + 3 )   ' GET SEGMENT ENTRY\r
-30 GMOUSE  = 2 + PEEK( 51*4 ) + 256 * PEEK( 51*4 + 1 )   ' GET OFFSET  ENTRY\r
-40 DEF SEG = GMSEG           ' SET SEGMENT REGISTER AS THE SEGMENT OF GMOUSE\r
-\r
-To enter the mouse driver, use the CALL statement:\r
-\r
-  CALL GMOUSE (G1%, G2%, G3%, G4%)\r
-\r
-GMOUSE contains the entry offset of the mouse driver.  G1%, G2%, G3%, and G4%\r
-are the integer variables given in the call.  These four must be specified in\r
-the CALL statement even if a value is not assigned.  When a value is assigned,\r
-it must be an integer, that is, a whole number.\r
-\r
-Example:\r
-\r
-50  ' Find the Activated Mode of Genius Mouse\r
-60  G1% = 0 : G2% = 0\r
-70  CALL GMOUSE ( G1%, G2%, G3%, G4% )\r
-80  IF G2% AND 2 THEN PRINT "Genius Mouse ( 2_Button Mode ) Enable"\r
-90  IF G2% AND 3 THEN PRINT "Genius Mouse ( 3_Button Mode ) Enable"\r
-100 IF NOT G1%   THEN PRINT "Can't Find Genius Mouse"\r
-\r
-*** 5 : MOUSE FUNCTIONS\r
-\r
-These functions listed apply to the Genius Mouse.  Further descriptions of each\r
-mouse function will be given in the following pages.\r
-\r
-Functions                                         Function Number\r
------------------------------------------------------------------\r
-Reset Genius Mouse Driver                                 0\r
-Enable Cursor Display                                     1\r
-Disable Cursor Display                                    2\r
-Read Cursor Location & Button State of Genius Mouse       3\r
-Set Cursor Location of Genius Mouse                       4\r
-Read Button Press State of Genius Mouse                   5\r
-Read Button Release State of Genius Mouse                 6\r
-Define Horizontal (X) Range of Cursor Location            7\r
-Define Vertical (Y) Range of Cursor Location              8\r
-Define Graphics Mode Cursor Style                         9\r
-Define Text Mode Cursor Style                            10\r
-Read Genius Mouse Motion Number                          11\r
-\r
-                                 page 4\r
-\f\r
-Define Event Handler Entry Location                      12\r
-Enable Light Pen Emulation Function                      13\r
-Disable Light Pen Emulation Function                     14\r
-Define Sensitivity (Mouse Motion/Pixel) of Genius Mouse  15\r
-Disable Cursor Display in Special Range                  16\r
-Define Double-Speed Threshold                            19\r
-Swap Event Handler Entry Location                        20\r
-Get Mouse Driver State Storage Size                      21\r
-Save Mouse Driver state                                  22\r
-Restore Mouse Driver state                               23\r
-Set CRT Page Number                                      29\r
-Read CRT Page Number                                     30\r
-\r
-EGA functions are described in Section *** 7.\r
-\r
-*** 6 : DESCRIPTION OF THE MOUSE FUNCTIONS\r
-\r
-You'll notice that with the following mouse function descriptions, the\r
-parameters needed to make the calls and the expected outcome (return) for each\r
-is indicated. Also,  any special conditions regarding any of the mouse functions\r
-have been included.  Further, an example of a program has been provided in order\r
-for you to understand how to make the call.\r
-\r
-The input and return values are presented for 8086 registers and for BASIC in\r
-the following pages.\r
-\r
-It is important to note that each mouse function call needs four parameters.\r
-The Genius Mouse software does not verify any input values, and therefore, if\r
-any incorrect values are given, uncertain results will occur.\r
-\r
-Function 0: Reset Genius Mouse Driver\r
-\r
-Function 0 gives the current status of the mouse hardware plus the current\r
-status of the mouse software.  The calling program is able to determine the\r
-presence of a mouse driver and/or a serial port.\r
-\r
-This function resets the mouse driver to the following default status as\r
-indicated:\r
-\r
-Variable                                Value\r
-------------------------------------------------------------------------------\r
-internal cursor flag                    -1 (cursor concealed)\r
-graphics  cursor shape                  horizontal oval\r
-text cursor                             reverse video\r
-user-defined call mask                  all zeroes\r
-light pen emulation mode                enabled\r
-vertical mouse motion/pixel ratio       16 to 8\r
-horizontal mouse motion/pixel ratio     8 to 8\r
-vertical min/max cursor coordinates     0/current display mode y values minus 1\r
-horizontal min/max cursor coordinates   0/current display mode x values minus 1\r
-\r
-8086 Register\r
-Input:  AX = 0\r
-Return: AX = mouse state (-1: installed, 0: not installed)\r
-        BX = number of buttons (2 button mode, 3 button mode)\r
-\r
-\r
-\r
-                                 page 5\r
-\f\r
-BASIC\r
-Input:  G1% = 0\r
-Return: G1% = mouse state (-1: installed, 0: not installed)\r
-        G2% = number of buttons (2 button mode, 3 button mode)\r
-\r
-Example:  Used initially to determine if the GMOUSE driver is present and to\r
-          reset GMOUSE.\r
-\r
-50  ' Find the Actived Mode of Genius Mouse\r
-60  G1% = 0 : G2% = 0\r
-70  CALL GMOUSE ( G1%, G2%, G3%, G4% )\r
-80  IF G2% AND 2 THEN PRINT "Genius Mouse ( 2_Button Mode ) Enable"\r
-90  IF G2% AND 3 THEN PRINT "Genius Mouse ( 3_Button Mode ) Enable"\r
-100 IF NOT G1%   THEN PRINT "Can't Find Genius Mouse"\r
-\r
-Function 1: Enable Cursor Display\r
-\r
-Function 1 increments the internal cursor flag counter.  If the counter is zero,\r
-the cursor is enabled and appears on-screen.\r
-\r
-The default value is -1 which indicates a concealed cursor.  Function 1 must be\r
-called to display the cursor.  In case the internal cursor flag is already zero,\r
-a call to this function produces no effect.\r
-\r
-8086 Register\r
-Input:  AX = 1\r
-Return: none\r
-\r
-BASIC\r
-Input:  G1% = 1\r
-Return: none\r
-\r
-Example:\r
-\r
-110  ' Enable Genius Mouse's Cursor\r
-120  G1% = 1\r
-130 CALL GMOUSE ( G1%, G2%, G3%, G4% )\r
-\r
-Function 2: Disable Cursor Display\r
-\r
-Function 2 disables the cursor by removing it from the screen and decrementing\r
-the internal cursor flag.  Even though the cursor cannot be seen, it still\r
-tracks any motion made with the mouse.\r
-\r
-You should use this function before changing any portion of the screen\r
-containing the cursor.  You will avoid the problem of the cursor affecting\r
-screen data.\r
-\r
-Keep in mind that whenever your program calls function 2, it must later call\r
-function 1 to return the internal cursor flag to its default value.  In\r
-addition, if your program changes the screen mode, function 2 is called\r
-automatically. Therefore, the cursor's movement is enabled the next time it is\r
-displayed.\r
-\r
-Call function 2 at the end of a program in order to conceal the cursor.  This\r
-ensures that nothing remains on-screen.\r
-\r
-\r
-                                 page 6\r
-\f\r
-8086 Register\r
-Input:  AX = 2\r
-Return: none\r
-\r
-BASIC\r
-Input:  G1% = 2\r
-Return: none\r
-\r
-Example:\r
-\r
-110  ' Disable Genius Mouse's Cursor\r
-120  G1% = 2\r
-130 CALL GMOUSE ( G1%, G2%, G3%, G4% )\r
-\r
-Function 3: Read Cursor Location & Button State of Genius Mouse\r
-\r
-Function 3 gives the status of mouse buttons, plus cursor location.\r
-\r
-Button status consists of a single integer value:\r
-  Bit 0 = left button (2 button mode, 3 button mode)\r
-  Bit 1 = right button (2 button mode, 3 button mode)\r
-  Bit 2 = middle button (3 button mode)\r
-\r
-The bit is 1 when the button is pressed.  The bit is 0 when the button is\r
-released.\r
-\r
-8086 Register\r
-Input:  AX = 3\r
-Return: BX = button status\r
-        CX = horizontal cursor coordinate\r
-        DX = vertical cursor coordinate\r
-\r
-BASIC\r
-Input:  G1% = 3\r
-Return: G2% = button status\r
-        G3% = horizontal cursor coordinate\r
-        G4% = vertical cursor coordinate\r
-\r
-Example:\r
-\r
-110  ' Read Genius Mouse Location & Button State\r
-120  G1% = 3\r
-130 CALL GMOUSE ( G1%, G2%, G3%, G4% )\r
-140 PRINT "Genius Mouse Location : X_Coord=" G3% " Y_Coord=" G4%\r
-150 IF G2% AND 1 THEN PRINT "Left Button"\r
-160 IF G2% AND 2 THEN PRINT "Right Button"\r
-170 IF G2% AND 4 THEN PRINT "Middle Button"\r
-180 PRINT "Pressed"\r
-\r
-Function 4: Set Cursor Location of Genius Mouse\r
-\r
-Function 4 sets the current cursor location.  Values must be within the\r
-coordinate ranges for the virtual screen and, if necessary, are rounded to the\r
-nearest values allowed for the current screen mode.\r
-\r
-\r
-\r
-\r
-                                 page 7\r
-\f\r
-  Screen     Display        Virtual         Cell        Bits/Pixel\r
-   Mode      Adapter       Screen (XxY)     Size      Graphics Mode\r
----------  ------------  ---------------  --------   ----------------\r
-    0      C, E, 3270     640 x 200        16 x 8          -\r
-    1      C, E, 3270     640 x 200        16 x 8          -\r
-    2      C, E, 3270     640 x 200         8 x 8          -\r
-    3      C, E, 3270     640 x 200         8 x 8          -\r
-    4      C, E, 3270     640 x 200         2 x 1          2\r
-    5      C, E, 3270     640 x 200         2 x 1          2\r
-    6      C, E, 3270     640 x 200         1 x 1          1\r
-    7      M, E, 3270     640 x 200         8 x 8          -\r
-    D      E              640 x 200        16 x 8          2\r
-    E      E              640 x 200         1 x 1          1\r
-    F      E              640 x 350         1 x 1          1\r
-    10     E              640 x 350         1 x 1          1\r
-    30     3270           720 x 350         1 x 1          1\r
-           H              720 x 348         1 x 1          1\r
-\r
-Display Adapter:\r
-  M = IBM Monochrome Display/Printer Adapter\r
-  C = IBM Color/Graphics Adapter\r
-  E = IBM Enhanced Graphics Adapter\r
-3270 = IBM All Points Addressable Graphics Adapter (3270 PC)\r
-  H = Hercules Monochrome Graphics Card\r
-\r
-8086 Register\r
-Input:  AX = 4\r
-        CX = new horizontal cursor coordinate\r
-        DX = new vertical cursor coordinate\r
-Return: none\r
-\r
-BASIC\r
-Input:  G1% = 4\r
-        G3% = new horizontal cursor coordinate\r
-        G4% = new vertical cursor coordinate\r
-Return: none\r
-\r
-Example:\r
-\r
-110  ' Set Cursor Location at the Upper_Left Corner of Screen\r
-120 G1% = 4\r
-130 G3% = 0 : G4% = 0\r
-140 CALL GMOUSE ( G1%, G2%, G3%, G4% )\r
-\r
-Function 5: Read Button Press State of Genius Mouse\r
-\r
-Function 5 provides status on the specified button, gives the number of button\r
-presses since the last call, and produces the location of the cursor at last\r
-button press.\r
-\r
-Button status consists of a single integer value.  Again, as in function 3:\r
-             Bit 0 = left button (2 button mode, 3 button mode)\r
-             Bit 1 = right button (2 button mode, 3 button mode)\r
-             Bit 2 = middle button (3 button mode)\r
-\r
-The bit is 1 when the button is pressed.  The bit is 0 when the button is\r
-released.\r
-\r
-                                 page 8\r
-\f\r
-The number of button presses will always fall in the range of 0 to 32767.  There\r
-is no indicator for overflow.  Following this function call, the count is reset\r
-to zero.\r
-\r
-8086 Register\r
-Input:  AX = 5\r
-        BX = button status (left = 0, right = 1, middle = 2)\r
-Return: AX = button status\r
-        BX = number of button presses\r
-        CX = horizontal cursor coordinate at last press\r
-        DX = vertical cursor coordinate at last press\r
-\r
-BASIC\r
-Input:  G1% = 5\r
-        G2% = button status (left = 0, right = 1, middle = 2)\r
-Return: G1% = button status\r
-        G2% = number of button presses\r
-        G3% = horizontal cursor coordinate at last press\r
-        G4% = vertical cursor coordinate at last press\r
-\r
-Example:\r
-\r
-110 ' Read the Left Button Press State of Genius Mouse\r
-120 G1% = 5 : G2% = 2\r
-130 CALL GMOUSE ( G1%, G2%, G3%, G4% )\r
-140 IF G1% AND 2 THEN PRINT "The Middle Button Pressed at X_loc=" G3%\r
-\r
-Function 6: Read Button Release State of Genius Mouse\r
-\r
-Function 6 provides status on the specified button, gives the number of button\r
-releases since the last call, and provides the location of the cursor at the\r
-last button release.\r
-\r
-Button status consists of a single integer value.  Again, as in function 3:\r
-             Bit 0 = left button (2 button mode, 3 button mode)\r
-             Bit 1 = right button (2 button mode, 3 button mode)\r
-             Bit 2 = middle button (3 button mode)\r
-\r
-The bit is 1 when the button is pressed.  The bit is 0 when the button is\r
-released.\r
-\r
-The number of button releases will always fall in the range of 0 to 32767.\r
-There is no indicator for overflow.  Following this function call, the count is\r
-reset to zero.\r
-\r
-8086 Register\r
-Input:  AX = 6\r
-        BX = button status (left = 0, right = 1, middle = 2)\r
-Return: AX = button status\r
-        BX = number of button releases\r
-        CX = horizontal cursor coordinate at last release\r
-        DX = vertical cursor coordinate at last release\r
-\r
-BASIC\r
-Input:  G1% = 6\r
-        G2% = button status (left = 0, right = 1, middle = 2)\r
-\r
-\r
-                                 page 9\r
-\f\r
-Return: G1% = button status\r
-        G2% = number of button releases\r
-        G3% = horizontal cursor coordinate at last release\r
-        G4% = vertical cursor coordinate at last release\r
-\r
-Example:\r
-\r
-110 ' Read the Left Button Release State of Genius Mouse\r
-120 G1% = 6 : G2% = 2\r
-130 CALL GMOUSE ( G1%, G2%, G3%, G4% )\r
-140 IF NOT G1% OR &HFFFB THEN PRINT "The Middle Button Released at X_loc=" G3%\r
-\r
-Function 7: Define Horizontal (X) Range of Cursor Location\r
-\r
-Function 7 defines the horizontal range of the cursor on-screen.  As a result,\r
-cursor movement is limited to this specified area.  If a cursor happens to be\r
-outside of this area when a call is made, the cursor is moved to just inside the\r
-area.\r
-\r
-8086 Register\r
-Input:  AX = 7\r
-        CX = minimum horizontal cursor coordinate\r
-        DX = maximum horizontal cursor coordinate\r
-Return: none\r
-\r
-BASIC\r
-Input:  G1% = 7\r
-        G3% = minimum horizontal cursor coordinate\r
-        G4% = maximum horizontal cursor coordinate\r
-Return: none\r
-\r
-Example:\r
-\r
-110 ' Enable Cursor in Horizontal Range between 100 to 200\r
-120 G1% = 7\r
-130 G2% = 100 : G3% = 200\r
-140 CALL GMOUSE ( G1%, G2%, G3%, G4% )\r
-\r
-Function 8: Define Vertical (Y) Range of Cursor Location\r
-\r
-Function 8 defines the vertical range of the cursor on-screen.  As a result,\r
-cursor movement is limited to this specified area.  If a cursor happens to be\r
-outside of this area when a call is made, the cursor is moved to just inside the\r
-area.\r
-\r
-8086 Register\r
-Input:  AX = 8\r
-        CX = minimum vertical cursor coordinate\r
-        DX = maximum vertical cursor coordinate\r
-Return: none\r
-\r
-BASIC\r
-Input:  G1% = 8\r
-        G3% = minimum vertical cursor coordinate\r
-        G4% = maximum vertical cursor coordinate\r
-Return: none\r
-\r
-\r
-                                 page 10\r
-\f\r
-Example:\r
-\r
-110 ' Enable Cursor in Vertical Range between 100 to 200\r
-120 G1% = 8\r
-130 G2% = 100 : G3% = 200\r
-140 CALL GMOUSE ( G1%, G2%, G3%, G4% )\r
-\r
-Function 9: Define Graphics Mode Cursor Style\r
-\r
-Function 9 defines the style of the cursor in terms of color, shape, and center\r
-for the graphics.  As mentioned before, this cursor is a 16-by-16 pixel block\r
-and is defined by two 16-bit arrays (the screen mask bit and the cursor mask\r
-bit). Cursor coordinates for the hot spot must be in the range of -16 to +16.\r
-8086 Register\r
-Input:  AX = 9\r
-        BX = horizontal cursor hot spot\r
-        CX = vertical cursor hot spot\r
-        DX = pointer to screen and cursor mask\r
-Return: none\r
-\r
-BASIC\r
-Input:  G1% = 9\r
-        G2% = horizontal cursor hot spot\r
-        G3% = vertical cursor hot spot\r
-        G4% = pointer to screen and cursor mask\r
-Return: none\r
-\r
-Example:\r
-\r
-10  ' Define the screen mask\r
-20  '\r
-30    cursor (0,0)  = &HFFFF       '1111111111111111\r
-40    cursor (1,0)  = &HFFFF       '1111111111111111\r
-50    cursor (2,0)  = &HFFFF       '1111111111111111\r
-60    cursor (3,0)  = &HFFFF       '1111111111111111\r
-70    cursor (4,0)  = &HFFFF       '1111111111111111\r
-80    cursor (5,0)  = &HF00F       '1111000000001111\r
-90    cursor (6,0)  = &H0000       '0000000000000000\r
-100   cursor (7,0)  = &H0000       '0000000000000000\r
-110   cursor (8,0)  = &H0000       '0000000000000000\r
-120   cursor (9,0)  = &H0000       '0000000000000000\r
-130   cursor (10,0) = &HF00F       '1111000000001111\r
-140   cursor (11,0) = &HFFFF       '1111111111111111\r
-150   cursor (12,0) = &HFFFF       '1111111111111111\r
-160   cursor (13,0) = &HFFFF       '1111111111111111\r
-170   cursor (14,0) = &HFFFF       '1111111111111111\r
-180   cursor (15,0) = &HFFFF       '1111111111111111\r
-190 '\r
-200 ' Define the cursor mask\r
-210 '\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-                                 page 11\r
-\f\r
-220   cursor (0,1)  = &H0000       '0000000000000000\r
-230   cursor (1,1)  = &H0000       '0000000000000000\r
-240   cursor (2,1)  = &H0000       '0000000000000000\r
-250   cursor (3,1)  = &H0000       '0000000000000000\r
-260   cursor (4,1)  = &H0000       '0000000000000000\r
-270   cursor (5,1)  = &H0000       '0000000000000000\r
-280   cursor (6,1)  = &H07E0       '0000011111100000\r
-290   cursor (7,1)  = &H7FFE       '0111111111111110\r
-300   cursor (8,1)  = &H7FFE       '0111111111111110\r
-310   cursor (9,1)  = &H07E0       '0000011111100000\r
-320   cursor (10,1) = &H0000       '0000000000000000\r
-330   cursor (11,1) = &H0000       '0000000000000000\r
-340   cursor (12,1) = &H0000       '0000000000000000\r
-350   cursor (13,1) = &H0000       '0000000000000000\r
-360   cursor (14,1) = &H0000       '0000000000000000\r
-370   cursor (15,1) = &H0000       '0000000000000000\r
-380 '\r
-390 ' Set the cursor style and hot spot number of Genius Mouse\r
-400 '\r
-410 '\r
-420   G1% = 9\r
-430   G2% = 6 ' horizontal hot spot\r
-440   G3% = 5 ' vertical hot spot\r
-450   CALL GMOUSE ( G1%, G2%, G3%, cursor (0,0))\r
-\r
-Function 10: Define Text Mode Cursor Style\r
-\r
-Function 10 chooses the hardware or the software text cursor.\r
-\r
-For example, if BX (G2%) is 1, the hardware cursor is selected and the hardware\r
-is set up with the first and last scan lines which define the cursor.\r
-(Values for CX (G3%) and DX (G4%) range from 0 to 7 for the color display and 0\r
-to 11 for the monochrome display.)\r
-\r
-If BX (G2%) is 0, the software cursor is selected; and CX (G3%) and DX (G4%)\r
-must specify the screen and cursor masks.  (These masks give the attributes and\r
-character code of the cursor, and their values are dependent on the type of\r
-display in use.)\r
-\r
-8086 Register\r
-Input:  AX = 10\r
-        BX = select cursor (0: software text, 1: hardware text)\r
-        CX = screen mask value/scan line start\r
-        DX = cursor mask value/scan line stop\r
-Return: none\r
-\r
-BASIC\r
-Input:  G1% = 10\r
-        G2% = select cursor (0: software text, 1: hardware text)\r
-        G3% = screen mask value/scan line start\r
-        G4% = cursor mask value/scan line stop\r
-Return: none\r
-\r
-Example:\r
-\r
-\r
-\r
-\r
-                                 page 12\r
-\f\r
-110 ' Enable an Inverting Cursor\r
-120 G1% = 10\r
-130 G2% = 0\r
-140 G3% = &HFFFF  :  G4% = &H7700\r
-150 CALL GMOUSE ( G1%, G2%, G3%, G4% )\r
-\r
-Function 11: Read Genius Mouse Motion Number\r
-\r
-Function 11 gives the mouse motion number since the last call.  A positive\r
-horizontal number indicates rightward movement (negative shows leftward\r
-movement).  A positive vertical number indicates downward movement (negative\r
-shows upward movement).\r
-The number is always in the range of -32768 to 32767.  Overflow is disregarded.\r
-Once the call is completed, the number is set to 0.\r
-\r
-8086 Registers\r
-Input:  AX = 11\r
-Return: CX = horizontal number\r
-        DX = vertical number\r
-\r
-BASIC\r
-Input:  G1% = 11\r
-Return: G3% = horizontal number\r
-        G4% = vertical number\r
-\r
-Example:\r
-\r
-110 ' Read Genius Mouse Motion Number\r
-120 G1% = 11\r
-130 CALL GMOUSE ( G1%, G2%, G3%, G4% )\r
-140 IF G3% > 0 THEN PRINT "Genius Mouse is Moving to Right"\r
-150 IF G4% > 0 THEN PRINT "Genius Mouse is Moving Down"\r
-\r
-Function 12: Define Event Handler Entry Location\r
-\r
-Function 12 defines the address entry location of an event handler routine which\r
-is called when a certain event (defined by the call mask) occurs.  The program\r
-is temporarily interrupted by the mouse driver. At the end of the event handler\r
-routine  the program continues at the point it was interrupted.\r
-\r
-The call mask is a single integer value defining the conditions which will cause\r
-an interrupt.\r
-\r
-A specific condition corresponds to a bit in the call mask:\r
-\r
-Mask Bit                Condition\r
---------------------------------------------------\r
-   0                    cursor location changed\r
-   1                    left button pressed\r
-   2                    left button released\r
-   3                    right button pressed\r
-   4                    right button released\r
-   5                    middle button pressed\r
-   6                    middle button released\r
-   7 - 15               not used\r
-\r
-\r
-\r
-                                 page 13\r
-\f\r
-In order to call the event handler routine, set the mask bit to 1 and put the\r
-mask in at CX (G3%).  To disable, set the mask bit to 0 and put the mask in at\r
-CX (G3%).  Always be sure to set the call mask to 0 before the program finishes.\r
-(Leave the system in the same state upon exit as if was upon entrance.)\r
-\r
-8086 Register\r
-Input:  AX = 12\r
-        CX = call mask\r
-        ES:DX = pointer to event handler routine\r
-Return: none\r
-\r
-BASIC\r
-Input:  G1% = 12\r
-        G3% = call mask\r
-        G4% = pointer to event handler routine\r
-Return: none\r
-\r
-Example:\r
-\r
-\r
-110 ' Active BUTTDOWN Event Handler Routine, When One or More Buttons Pressed\r
-120 G1% = 12\r
-130 G3% = &H002A  :  G4% = BUTTDOWN%\r
-140 CALL GMOUSE ( G1%, G2%, G3%, G4% )\r
-\r
-Function 13: Enable Light Pen Emulation Function\r
-\r
-Function 13 permits the mouse to act like a light pen.  When in this mode, calls\r
-to the pen function will give the cursor coordinates at the last pen down\r
-location.\r
-\r
-Note that the status of "pen down" and "pen off-screen" is controlled by the\r
-mouse buttons:  all buttons up, pen off-screen; one button pressed, pen down.\r
-\r
-Light pen emulation is ON after each call to function 0 (Reset Mouse Driver).\r
-\r
-8086 Register\r
-Input:  AX = 13\r
-Return: none\r
-\r
-BASIC\r
-Input:  G1% = 13\r
-Return: none\r
-\r
-Example:\r
-\r
-110 ' Enable Light Pen Emulation Function\r
-120 G1% = 13\r
-130 CALL GMOUSE ( G1%, G2%, G3%, G4% )\r
-\r
-Function 14: Disable Light Pen Emulation Function\r
-\r
-Function 14 turns off the light pen emulation mode.  When disabled, any call to\r
-the pen function will give information only about a real light pen.\r
-\r
-8086 Register\r
-Input:  AX = 14\r
-\r
-                                 page 14\r
-\f\r
-Return: none\r
-\r
-BASIC\r
-Input:  G1% = 14\r
-Return: none\r
-\r
-Example:\r
-\r
-110 ' Disable Light Pen Emulation Function\r
-120 G1% = 14\r
-130 CALL GMOUSE ( G1%, G2%, G3%, G4% )\r
-\r
-Function 15: Define Sensitivity (Mouse Motion/Pixel) of Genius Mouse\r
-\r
-Function 15 defines mouse sensitivity as determined by the mouse motion/pixel\r
-ratio.  This is a way of setting the amount of cursor motion wanted for mouse\r
-movement.  These ratios specify mouse motion per 8 pixels.  These values must\r
-be in the range of 1 to 32767.  With a larger ratio, the cursor movement is\r
-shortened for each mouse movement.\r
-\r
-Default values:   horizontal ratio - 8  mouse motions to 8 pixels\r
-                  vertical ratio   - 16 mouse motions to 8 pixels\r
-\r
-Note: 1 mouse motion = 1/200 of an inch increment\r
-\r
-8086 Register\r
-Input:  AX = 15\r
-        CX = horizontal mouse motion counts to pixel ratio\r
-        DX = vertical mouse motion counts to pixel ratio\r
-Return: none\r
-\r
-BASIC\r
-Input:  G1% = 15\r
-        G3% = horizontal mouse motion counts to pixel ratio\r
-        G4% = vertical mouse motion counts to pixel ratio\r
-Return: none\r
-\r
-Example:\r
-\r
-110 ' Define Horizontal Sensitivity as 8\r
-120 ' Define Vertical Sensitivity as 16\r
-130 G1% = 15\r
-140 G3% =  8\r
-150 G4% = 16\r
-160 CALL GMOUSE ( G1%, G2%, G3%, G4% )\r
-\r
-Function 16: Disable Cursor Display in Special Range\r
-\r
-Function 16 sets up a special range on-screen.  If the cursor moves to this area\r
-or is in this area, it will be disabled.  After a call is made to this function,\r
-it is necessary to call function 1 to enable the cursor again.\r
-\r
-Define the special range with screen location values using four components:\r
-\r
-\r
-\r
-\r
-\r
-                                 page 15\r
-\f\r
-Components          Values\r
---------------------------------------------------------\r
-    1               Left horizontal screen location\r
-    2               Upper vertical screen location\r
-    3               Right horizontal screen location\r
-    4               Lower vertical screen location\r
-\r
-8086 Register\r
-Input:  AX = 16\r
-        ES:DX = pointer to special range\r
-Return: none\r
-\r
-BASIC\r
-Input:  G1% = 16\r
-        G4% = pointer to special range\r
-Return: none\r
-\r
-Example:\r
-\r
-110 ' Disable Cursor Display in (0,0) to (100,100) Range\r
-120 G1% = 16\r
-130 RANGE%(1) = 0   : RANGE%(2) = 0\r
-140 RANGE%(3) = 100 : RANGE%(4) = 100\r
-150 CALL GMOUSE ( G1%, G2%, G3%, RANGE%(0) )\r
- .\r
- .\r
- .\r
-\r
-500 ' Enable Cursor Display Again\r
-510 G1% = 1\r
-520 CALL GMOUSE ( G1%, G2%, G3%, G4% )\r
-\r
-Function 19: Define Double-Speed Threshold\r
-\r
-Function 19 defines the threshold value (mouse motion per second) for doubling\r
-the cursor's motion.  Should the mouse move faster than the DX (G4%) value, the\r
-cursor motion doubles.  The default value is 64 mouse motions per second.\r
-\r
-If you should want to disable double-speed, just set the threshold to 32767\r
-(7FFFH) mouse motions/second.\r
-\r
-8086 Register\r
-Input:  AX = 19\r
-        DX = threshold speed in mouse motions/second\r
-Return: none\r
-\r
-BASIC\r
-Input:  G1% = 19\r
-        G4% = threshold speed in mouse motions/second\r
-Return: none\r
-\r
-Example:\r
-\r
-110 ' Define Double-Speed Threshold as 20 Mouse Motions/Second\r
-\r
-\r
-\r
-\r
-                                 page 16\r
-\f\r
-120 G1% = 19\r
-130 G4% = 20\r
-140 CALL GMOUSE ( G1%, G2%, G3%, G4% )\r
-.\r
-.\r
-.\r
-\r
-500 ' Disable Double-Speed Threshold Function\r
-510 G1% = 19\r
-520 G4% = 256 'MAX. VALUE\r
-530 CALL GMOUSE ( G1%, G2%, G3%, G4% )\r
-\r
-Function 20: Swap Event Handler Entry Location\r
-\r
-Function 20 sets new values for the call mask and event handler routine\r
-address  for mouse  hardware interrupts and return the values that were\r
-previously specified.\r
-\r
-For detail information to reference Function 12 description.\r
-\r
-8086 Register\r
-Input:  AX = 20\r
-        CX = new call mask\r
-        ES:DX = new pointer to event handler routine\r
-Return: CX = old call mask\r
-        ES:DX = old pointer to event handler routine\r
-\r
-BASIC\r
-Input:  G1% = 20\r
-        G3% = call mask\r
-        G4% = pointer to event handler routine\r
-Return: G3% = old call mask\r
-        G4% = old pointer to event handler routine\r
-\r
-Example:\r
-\r
-100 ' Swap Event Handler Entry Location\r
-110 ' Active BUTTDOWN Event Handler Routine, When One or More Buttons Pressed\r
-120 G1% = 20\r
-130 G3% = &H002A  :  G4% = BUTTDOWN%\r
-140 CALL MOUSE ( G1%, G2%, G3%, G4% )\r
-\r
-Function 21: Get Mouse Driver State Storage Size\r
-\r
-Function 21 returns the size of the buffer required to store the current state\r
-of the  mouse  driver.  It is used with  functions 22  and 23 when you want to\r
-temporarily  interrupt a program  that is using the mouse  and execute another\r
-that also uses the mouse.\r
-\r
-8086 Register\r
-Input:  AX = 21\r
-\r
-Return: BX = buffer size required for mouse driver state\r
-\r
-BASIC\r
-Input:  G1% = 21\r
-\r
-\r
-                                 page 17\r
-\f\r
-Return: G2% = buffer size required for mouse driver state\r
-\r
-Example:\r
-\r
-110 ' Get Mouse Driver State Storage Size\r
-120 G1% = 21\r
-130 CALL MOUSE ( G1%, G2%, G3%, G4% )\r
-140 STATESIZE% = G2%\r
-\r
-Function 22: Save Mouse Driver state\r
-\r
-Function 22 saves the current mouse driver state in a buffer allocated by your\r
-program.   It is used with  functions 21  and 23  when you want to temporarily\r
-interrupt a program  that is using the mouse  and execute another program that\r
-also uses the mouse.\r
-\r
-Before your program  calls function 22, the program should call function 21 to\r
-determine  the buffer size required  for saving the  mouse driver state,  then\r
-allocate the appropriate amount of memory.\r
-\r
-8086 Register\r
-Input:  AX = 22\r
-        ES:DX = pointer to the buffer\r
-Return: None\r
-\r
-BASIC\r
-Input:  G1% = 22\r
-        G4% = pointer to the buffer\r
-Return: None\r
-\r
-Example:\r
-\r
-110 ' Save The Mouse Driver State\r
-120 G1% = 22\r
-130 G4% =  BUFPTR\r
-140 ' Assume BUFPTR contains the address of the buffer\r
-150 CALL MOUSE ( G1%, G2%, G3%, G4% )\r
-\r
-Function 23: Restore Mouse Driver State\r
-\r
-Function 23 restores the last  mouse driver state saved by function 22.  It is\r
-used with functions 21 and 22 when you want to temporarily interrupt a program\r
-that is  using the mouse  and execute another program that also uses the mouse.\r
-To restore the mouse driver state saved by function 22, call function 23 at the\r
-end of the interrupt program.\r
-\r
-8086 Register\r
-Input:  AX = 23\r
-        ES:DX = pointer to the buffer\r
-Return: None\r
-\r
-BASIC\r
-Input:  G1% = 23\r
-        G4% = pointer to the buffer\r
-Return: None\r
-\r
-Example:\r
-\r
-                                 page 18\r
-\f\r
-110 ' Restore The Mouse Driver State\r
-120 G1% = 23\r
-130 G4% =  BUFPTR\r
-140 ' Assume BUFPTR contains the address of the buffer\r
-150 CALL MOUSE ( G1%, G2%, G3%, G4% )\r
-\r
-Function 29: Set CRT Page Number\r
-\r
-Function 29 specifies the CRT page on which the mouse cursor will be displayed.\r
-\r
-For information on the number of CRT pages available in each display mode your\r
-adapter supports, see the documentation that came with the graphics adapter.\r
-\r
-8086 Register\r
-Input:  AX = 29\r
-        BX = CRT page for mouse cursor display\r
-Return: none\r
-\r
-BASIC\r
-Input:  G1% = 29\r
-        G2% = CRT page for mouse cursor display\r
-Return: none\r
-\r
-Example:\r
-\r
-110 ; Set CRT page 2 for display mouse cursor\r
-120 G1% = 29\r
-130 G2% = 2\r
-140 CALL MOUSE ( G1%, G2%, G3%, G4% )\r
- .\r
- .\r
- .\r
-\r
-500 ; Enable Cursor Display Again\r
-510 G1% = 1\r
-520 CALL MOUSE ( G1%, G2%, G3%, G4% )\r
-\r
-Function 30: Read CRT Page Number\r
-\r
-Function 30 returns the number of the CRT page on which the mouse cursor is\r
-displayed.\r
-\r
-8086 Register\r
-Input:  AX = 30\r
-\r
-Return: BX = CRT page number of current cursor display\r
-\r
-BASIC\r
-Input:  G1% = 30\r
-\r
-Return: G2% = CRT page number of current cursor display\r
-\r
-Example:\r
-\r
-110 ; Read CRT page number\r
-120 G1% = 30\r
-130 CALL MOUSE ( G1%, G2%, G3%, G4% )\r
-\r
-                                 page 19\r
-\f\r
-*** 7 : USING GENIUS MOUSE WITH IBM ENHANCED GRAPHICS ADAPTER\r
-\r
-Within the Genius Mouse driver, you'll find nine EGA functions.  These functions\r
-permit your program to write to and read from write-only registers.\r
-\r
-The cursor in use is defined as a monochrome cursor with one bit per pixel.  The\r
-bit masks are determined by function 9 and apply to all active planes.\r
-\r
-In order to make an EGA function call from an Assembly-Language program, first\r
-load the AX, BX, CX, DX, and ES registers with the values indicated for the\r
-parameters.  Note that five values must be given for a high level language\r
-program.  Next, execute software interrupt 16 (10h). The values that are\r
-returned are intalled in the registers by EGA functions.\r
-\r
-Upon start with DOS, PC BIOS will verify if the EGA BIOS exists.  When this is\r
-verified, the PC will execute the EGA BIOS, booting up the program to write the\r
-INT 10h entry vector to the address of the INT 42h vector.  Now, EGA BIOS\r
-address will be written to INT 10h. Following this, you are able to call EGA\r
-BIOS (by using INT 10h) and PC video BIOS (by using INT 42h).\r
-\r
-There are twenty functions in EGA BIOS.  (PC BIOS has only 16.) The EGA BIOS\r
-routines only intercept the BIOS ROM video routines (INT 10h, AH = 13h or less).\r
-\r
-The following indicates nine EGA functions and the corresponding function\r
-number:\r
-\r
-Function                                             Number (HEX)\r
------------------------------------------------------------------\r
-Retrieve Single Data                                       F0\r
-Save Single Data                                           F1\r
-Retrieve Registers on a Specified Port                     F2\r
-Save Registers on a Specified Port                         F3\r
-Retrieve Several Registers Data                            F4\r
-Save Several Registers Data                                F5\r
-Reset All Registers as Initial Values                      F6\r
-Set Initial Values                                         F7\r
-Get Version Number of Genius Mouse Driver                  FA\r
-\r
-In the above functions, the EGA I/O port number and address are as follows:\r
-\r
-Port No.  Register Name   No. of Registers  Index No.  Address Select Register\r
-------------------------------------------------------------------------------\r
- 00H      CRT Controller         25           0 - 24            3x4H\r
- 08H      Sequencer               5           0 - 4             3C4H\r
- 10H      Graphics Controller     9           0 - 8             3CEH\r
- 18H      Attribute Controlle    20           0 - 19            3C0H\r
-          Singular Registers\r
- 20H      Miscellaneous Output    1           ignored           3C2H\r
- 28H      Feature Control         1           ignored           3xAH\r
- 30H      Graphics 1 Position     1           ignored           3CCH\r
- 38H      Graphics 2 Position     1           ignored           3CAH\r
-\r
-  Note: x = B or D depending on the base I/O address;\r
-        determined by Miscellaneous Output Register bit 1.\r
-\r
-\r
-\r
-\r
-                                 page 20\r
-\f\r
-Function F0: Retrieve Single Data\r
-\r
-This function retrieves data from a single register.\r
-\r
-Input:  AH = F0H\r
-        BX = Index number\r
-        DX = Port number\r
-Return: BL = Retrieved data from EGA register\r
-\r
-\r
-Example:\r
-\r
-FUN_F0     EQU     0f0H         ; Function F0\r
-;\r
-GR_CONTR   EQU     010H         ; Graphics Controller\r
-MODE_REG   EQU     005H         ; Mode Regisiter\r
-;\r
-GR1_PORT   EQU     030H         ; Graphics 1 Position Register\r
-GR2_PORT   EQU     038H         ; Graphics 2 Position Register\r
-;\r
-VIDEO      EQU     010H         ; BIOS ROM Video Routine Entry\r
-\r
-           ; Retrieve the Mode Register in Graphics Controller\r
-MODE_REG   DB      00\r
-           ;\r
-           MOV     DX, GR_CONTR\r
-           MOV     BX, MODE_REG\r
-           MOV     AH, FUN_F0\r
-           INT     VIDEO\r
-           MOV     MODE_REG, BL\r
-\r
-\r
-           ; Retrieve Graphics 1 Position Data\r
-GR1_POS    DB      00\r
-           ;\r
-           MOV     DX, GR1_POS\r
-           MOV     AH, FUN_F0\r
-           INT     VIDEO\r
-           MOV     GR1_POS, NL\r
-\r
-\r
-Function F1: Save Single Data\r
-\r
-This function saves data to an EGA register.  Upon finishing a call to this\r
-function, the BH and DX values are altered.\r
-\r
-Input:  AH = F1H\r
-        BL = Index number (Non-single register only)\r
-           = Data (Single register only)\r
-        BH = Data (Non-single register only)\r
-           = Disregard (Single register only)\r
-        DX = Port number\r
-Return: None\r
-\r
-\r
-Example:\r
-\r
-\r
-                                 page 21\r
-\f\r
-FUN_F1     EQU     0f1H         ; Function F1\r
-;\r
-SEQUENCE   EQU     008H         ; Sequencer\r
-MASK_REG   EQU     002H         ; Map Mask Register\r
-;\r
-FEAT_PORT  EQU     028H         ; Feature Control Register\r
-;\r
-VIDEO      EQU     010H         ; BIOS ROM Video Routine Entry\r
-\r
-           ; Save Map Mask Register of Sequencer\r
-MAP_MASK   EQU     03H\r
-           ;\r
-           MOV     DX, SEQUENCE\r
-           MOV     BL, MASK_REG\r
-           MOV     BH, MAP_MASK\r
-           MOV     AH, FUN_F1\r
-           INT     VIDEO\r
-           MOV     MAP_MASK, BL\r
-\r
-\r
-           ; Save Feature Control Register\r
-FEATURE    DB      02H\r
-           ;\r
-           MOV     DX, FEAT_PORT\r
-           MOV     BL, FEATURE\r
-           MOV     AH, FUN_F1\r
-           INT     VIDEO\r
-           MOV     FEATURE, BL\r
-\r
-Function F2: Retrieve Registers on a Specified Port\r
-\r
-This function retrieves data from registers on a specifiã port.  Upon finishing\r
-a call to this function, the CX value is altered.\r
-\r
-Input:  AH = F3H\r
-        CH = Starting index number\r
-        CL = Number of registers\r
-        DX = Port number\r
-        ES:BX = Destination of returned data\r
-Return: Returned data to destination address\r
-\r
-Example:\r
-\r
-FUN_F2     EQU     0f2H         ; Function F2\r
-;\r
-GR_CONTR   EQU     010H         ; Graphics Controller\r
-;\r
-VIDEO      EQU     010H         ; BIOS ROM Video Routine Entry\r
-\r
-\r
-           ; Retrieve Four Registers Data from Graphics Controller\r
-GRAPH_POOL DB      04   DUP (0)\r
-           ;\r
-           MOV     DX, DS\r
-           MOV     ES, DX\r
-           ;\r
-\r
-\r
-                                 page 22\r
-\f\r
-           MOV     DX, GR_CONTR\r
-           MOV     BX, OFFSET GRAPH_POOL\r
-           MOV     CX, 04H\r
-           MOV     AH, FUN_F2\r
-           INT     VIDEO\r
-\r
-Function F3: Save Registers on a Specified Port\r
-\r
-This function saves data from registers on a specifiã port.  Upon finishing a\r
-call to this function, the BX, CX, and DX values are altered.\r
-\r
-Input:  AH = F3H\r
-        CH = Starting index number\r
-        CL = Number of register\r
-        DX = Port number\r
-        ES:BX = Address source of incoming data\r
-Return: None\r
-\r
-Example:\r
-\r
-FUN_F3     EQU     0f3H         ; Function F3\r
-;\r
-ATTR_CONTR EQU     018H         ; Attribute Controller\r
-;\r
-VIDEO      EQU     010H         ; BIOS ROM Video Routine Entry\r
-\r
-\r
-           ; Save Four Registers Data into Attribute Controller\r
-PALET_DATA DB      1, 2, 4, 3\r
-           ;\r
-           MOV     DX, DS\r
-           MOV     ES, DX\r
-           ;\r
-           MOV     DX, ATTR_CONTR\r
-           MOV     BX, OFFSET PALET_DATA\r
-           MOV     CX, 08\r
-           MOV     AH, FUN_F3\r
-           INT     VIDEO\r
-\r
-Function F4: Retrieve Several Registers Data At The Same Time\r
-\r
-This function retrieves data from several registers at the same time.  Upon\r
-finishing a call to this function, the CX value is altered.\r
-\r
-Input:  AH = F4H\r
-        CX = Number of registers (more than 1)\r
-        ES:BX = Address of register packet (each consists of 4 bytes;\r
-                port  address,  byte 1-2;  index number,  byte 3;\r
-                returned data, byte 4)\r
-Return: Returned data is saved into byte 4\r
-\r
-Example:\r
-\r
-FUN_F4     EQU     0f4H         ; Function F4\r
-;\r
-VIDEO      EQU     010H         ; BIOS ROM Video Routine Entry\r
-\r
-\r
-                                 page 23\r
-\f\r
-            ; Retrieve Follow  Registers Data\r
-TABLE       DW     030H         ; Graphics 1 Position Register\r
-            DB      00          ; Single Register\r
-            DB      00          ; Retrieved Data\r
-            ;\r
-            DW     010H         ; Graphics Controller\r
-            DB      05          ; Mode Register\r
-            DB      00          ; Retrieved Data\r
-            ;\r
-            ;\r
-            MOV    DX, DS\r
-            MOV    ES, DX\r
-            ;\r
-            MOV    BX, OFFSET TABLE\r
-            MOV    CX, 02\r
-            MOV    AH, FUN_F4\r
-            INT    VIDEO\r
-\r
-\r
-Function F5: Save Several Registers Data At The Same Time\r
-\r
-This function saves data from several registers at the same time.  Upon\r
-finishing a call to this function, the CX value is altered.\r
-\r
-Input:  AH = F5H\r
-        CX = Number of registers (more than 1)\r
-        ES:BX = Address of register packet (each consists of 4 bytes;\r
-                port  number, byte 1-2;  index number,  byte 3;\r
-                output data, byte 4)\r
-Return: None\r
-\r
-Example:\r
-\r
-FUN_F5     EQU     0f5H         ; Function F5\r
-;\r
-VIDEO      EQU     010H         ; BIOS ROM Video Routine Entry\r
-\r
-            ; Save Follow Registers Data\r
-TABLE       DW      20H         ; Miscellaneous\r
-            DB      00          ; Single Register\r
-            DB      01          ; Data\r
-            ;\r
-            DW      18H         ; Attribute Controller\r
-            DB      12H         ; Color Plane Enable\r
-            DB      07H         ; Data\r
-            ;\r
-            ;\r
-            MOV    DX, DS\r
-            MOV    ES, DX\r
-            ;\r
-            MOV    BX, OFFSET TABLE\r
-            MOV    CX, 02\r
-            MOV    AH, FUN_F5\r
-            INT    VIDEO\r
-\r
-\r
-\r
-\r
-                                 page 24\r
-\f\r
-Function F6: Reset All Registers as Initial Values\r
-\r
-This function resets all values to default values for the specific registers.\r
-Function 7 sets the default values.\r
-\r
-Input:  AH = F6H\r
-Return: None\r
-\r
-Example:\r
-\r
-FUN_F6     EQU     0f6H         ; Function F6h\r
-;\r
-VIDEO      EQU     010H         ; BIOS ROM Video Routine Entry\r
-\r
-           MOV     AH, FUN_F6\r
-           INT     VIDEO\r
-\r
-Function F7: Set Initial Values\r
-\r
-This function sets the initial default values.  Upon finishing a call to this\r
-function, the BX and DX values are altered.\r
-\r
-Input:  AH = F7H\r
-        DX = Port number\r
-        ES:BX = Table of output data\r
-Return: None\r
-\r
-Example:\r
-\r
-FUN_F7     EQU     0f7H         ; Function F7\r
-;\r
-ATTR_CONTR EQU     018H         ; Attribute Controller\r
-;\r
-VIDEO      EQU     010H         ; BIOS ROM Video Routine Entry\r
-\r
-           ; Setting Initial Values for the Attribute Controller\r
-ATTR_DATA  DB      1,  2,  4,  3,  5,  6,  0,  7\r
-           DB      0,  0,  0,  0,  0,  0,  0,  0\r
-           DB      0,  0, 0fh, 0\r
-           ;\r
-           MOV     DX, DS\r
-           MOV     ES, DX\r
-           ;\r
-           MOV     DX, ATTR_CONTR\r
-           MOV     BX, OFFSET ATTR_DATA\r
-           MOV     AH, FUN_F7\r
-           INT     VIDEO\r
-\r
-Function FA: Get Version Number of Genius Mouse Driver\r
-\r
-This function will give the Genius Mouse driver version number.\r
-\r
-Input:  AH = FAH\r
-        BX = 00H\r
-Return: ES:BX = Pointer to Genius Mouse driver version number.\r
-\r
-\r
-\r
-                                 page 25\r
-\f\r
-\1a
\ No newline at end of file
diff --git a/16/PCGPE10/GUS.TXT b/16/PCGPE10/GUS.TXT
deleted file mode 100644 (file)
index 610ff9e..0000000
+++ /dev/null
@@ -1,1403 +0,0 @@
-ÚÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ GUSDOC ³\r
-ÀÄÄÄÄÄÄÄÄÙ\r
-\r
-\r
-\r
-\r
-\r
-                               THE OFFICAL\r
-\r
-\r
-\r
-                GRAVIS ULTRASOUND PROGRAMMERS ENCYCLOPEDIA\r
-\r
-                               ( G.U.P.E )\r
-\r
-\r
-\r
-                                 v 0.1\r
-\r
-\r
-                           Written by Mark Dixon.\r
-\r
-\r
-\r
-\r
-\r
-\r
-  -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\r
-\r
- INTRODUCTION\r
- ~~~~~~~~~~~~\r
-    The Gravis Ultrasound is by far the best & easiest sound card to\r
-  program. Why? Because the card does all the hard stuff for you, leaving\r
-  you and the CPU to do other things! This reference will document some\r
-  (but not all) of the Gravis Ultrasound's hardware functions, allowing\r
-  you to play music & sound effects on your GUS.\r
-\r
-    We will not be going into great detail as to the theory behind\r
-  everything - if you want to get technical information then read the\r
-  GUS SDK. We will be merely providing you with the routines necessary\r
-  to play samples on the GUS, and a basic explanation of how they work.\r
-  \r
-    This document will NOT go into DMA transfer or MIDI specifications.\r
-  If someone knows something about them, and would like to write some\r
-  info on them, we would appreciate it very much.\r
-\r
-    All source code is in Pascal (tested under Turbo Pascal v7.0, but\r
-  should work with TP 6.0 and possibly older versions). This document\r
-  will assume reasonable knowledge of programming, and some knowledge of\r
-  soundcards & music.\r
-\r
-\r
- INITIALISATION & AUTODETECTION\r
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r
-   Since we are not using DMA, we only need to find the GUS's I/O port,\r
- which can be done from the DOS environment space, or preferably from a\r
- routine that will scan all possible I/O ports until it finds a GUS.\r
-\r
-   The theory behind the detection routine is to store some values into\r
- GUS memory, and then read them back. If we have the I/O port correct,\r
- we will read back exactly what we wrote. So first, we need a routine\r
- that will write data to the memory of the GUS :\r
-\r
-\r
-  Function  GUSPeek(Loc : Longint) : Byte;\r
-\r
-  { Read a value from GUS memory }\r
-\r
-  Var\r
-    B : Byte;\r
-    AddLo : Word;\r
-    AddHi : Byte;\r
-  Begin\r
-    AddLo := Loc AND $FFFF;\r
-    AddHi := LongInt(Loc AND $FF0000) SHR 16;\r
-\r
-    Port [Base+$103] := $43;\r
-    Portw[Base+$104] := AddLo;\r
-    Port [Base+$103] := $44;\r
-    Port [Base+$105] := AddHi;\r
-\r
-    B := Port[Base+$107];\r
-    GUSPeek := B;\r
-  End;\r
-\r
-\r
-  Procedure GUSPoke(Loc : Longint; B : Byte);\r
-\r
-  { Write a value into GUS memory }\r
-\r
-  Var\r
-    AddLo : Word;\r
-    AddHi : Byte;\r
-  Begin\r
-    AddLo := Loc AND $FFFF;\r
-    AddHi := LongInt(Loc AND $FF0000) SHR 16;\r
-    Port [Base+$103] := $43;\r
-    Portw[Base+$104] := AddLo;\r
-    Port [Base+$103] := $44;\r
-    Port [Base+$105] := AddHi;\r
-    Port [Base+$107] := B;\r
-  End;\r
-\r
-\r
-   Since the GUS can have up to 1meg of memory, we need to use a 32bit\r
- word to address all possible memory locations. However, the hardware of\r
- the GUS will only accept a 24bit word, which means we have to change\r
- the 32bit address into a 24bit address. The first two lines of each\r
- procedure does exactly that.\r
-\r
-   The rest of the procedures simply send commands and data out through\r
- the GUS I/O port defined by the variable BASE (A word). So to test for\r
- the presence of the GUS, we simply write a routine to read/write memory\r
- for all possible values of BASE :\r
-\r
-\r
-  Function GUSProbe : Boolean;\r
-\r
-  { Returns TRUE if there is a GUS at I/O address BASE }\r
-\r
-  Var\r
-    B : Byte;\r
-  Begin\r
-    Port [Base+$103] := $4C;\r
-    Port [Base+$105] := 0;\r
-    GUSDelay;\r
-    GUSDelay;\r
-    Port [Base+$103] := $4C;\r
-    Port [Base+$105] := 1;\r
-    GUSPoke(0, $AA);\r
-    GUSPoke($100, $55);\r
-    B := GUSPeek(0);\r
-    If B = $AA then GUSProbe := True else GUSProbe := False;\r
-  End;\r
-\r
-\r
-  Procedure GUSFind;\r
-\r
-  { Search all possible I/O addresses for the GUS }\r
-\r
-  Var\r
-    I : Word;\r
-  Begin\r
-    for I := 1 to 8 do\r
-    Begin\r
-      Base := $200 + I*$10;\r
-      If GUSProbe then I := 8;\r
-    End;\r
-    If Base < $280 then\r
-      Write('Found your GUS at ', Base, ' ');\r
-  End;\r
-\r
-\r
-   The above routines will obviously need to be customised for your own\r
- use - for example, setting a boolean flag to TRUE if you find a GUS,\r
- rather than just displaying a message.\r
-\r
-   It is also a good idea to find out exactly how much RAM is on the\r
- GUS, and this can be done in a similar process to the above routine.\r
- Since the memory can either be 256k, 512k, 768k or 1024k, all we have\r
- to do is to read/write values on the boundaries of these memory\r
- addresses. If we read the same value as we wrote, then we know exactly\r
- how much memory is available.\r
-\r
-\r
-  Function  GUSFindMem : Longint;\r
-\r
-  { Returns how much RAM is available on the GUS }\r
-\r
-  Var\r
-    I : Longint;\r
-    B : Byte;\r
-  Begin\r
-    GUSPoke($40000, $AA);\r
-    If GUSPeek($40000) <> $AA then I := $3FFFF\r
-      else\r
-    Begin\r
-      GUSPoke($80000, $AA);\r
-      If GUSPeek($80000) <> $AA then I := $8FFFF\r
-        else\r
-      Begin\r
-        GUSPoke($C0000, $AA);\r
-        If GUSPeek($C0000) <> $AA then I := $CFFFF\r
-          else I := $FFFFF;\r
-      End;\r
-    End;\r
-    GUSFindMem := I;\r
-  End;\r
-\r
-\r
-   Now that we know where the GUS is, and how much memory it has, we\r
- need to initialise it for output. Unfortunately, the below routine is\r
- slightly buggy. If you run certain programs (I discovered this after\r
- running Second Reality demo) that use the GUS, and then your program\r
- using this init routine, it will not initialise the GUS correctly.\r
-\r
-   It appears that I am not doing everything that is necessary to\r
- initialise the GUS. However, I managed to correct the problem by\r
- either re-booting (not a brilliant solution) or running Dual Module\r
- Player, which seems to initialise it properly. If someone knows where\r
- i'm going wrong, please say so!\r
-\r
-   Anyway, the following routine should be called after you have found\r
- the GUS, and before you start doing anything else with the GUS.\r
-\r
-\r
-\r
-  Procedure GUSDelay; Assembler;\r
-\r
-  { Pause for approx. 7 cycles. }\r
-\r
-  ASM\r
-    mov   dx, 0300h\r
-    in    al, dx\r
-    in    al, dx\r
-    in    al, dx\r
-    in    al, dx\r
-    in    al, dx\r
-    in    al, dx\r
-    in    al, dx\r
-  End;\r
-\r
\r
-  Procedure GUSReset;\r
-\r
-  { An incomplete routine to initialise the GUS for output. }\r
-\r
-  Begin\r
-    port [Base+$103]   := $4C;\r
-    port [Base+$105] := 1;\r
-    GUSDelay;\r
-    port [Base+$103]   := $4C;\r
-    port [Base+$105] := 7;\r
-    port [Base+$103]   := $0E;\r
-    port [Base+$105] := (14 OR $0C0);\r
-  End;\r
-\r
-\r
-   Now you have all the routine necessary to find and initialise the\r
- GUS, let's see just what we can get the GUS to do!\r
-\r
-\r
- MAKING SOUNDS\r
- ~~~~~~~~~~~~~\r
-   The GUS is unique in that it allows you to store the data to be\r
- played in it's onboard DRAM. To play the sample, you then tell it what\r
- frequency to play it at, what volume and pan position, and which sample\r
- to play. The GUS will then do everything in the background, it will\r
- interpolate the data to give an effective 44khz (or less, depending on\r
- how many active voices) sample. This means that an 8khz sample will\r
- sound better on the GUS than most other cards, since the GUS will play\r
- it at 44khz!\r
-\r
-   The GUS also has 32 seperate digital channels (that are mixed by a\r
- processor on the GUS) which all have their own individual samples,\r
- frequencies, volumes and panning positions. For some reason, however,\r
- the GUS can only maintain 44khz output with 16 channels - the more\r
- channels, the lower the playback rate (which basically means, lower\r
- quality). If you are using all 32 channels (unlikely), then playback is\r
- reduced to 22khz.\r
-\r
-   Since you allready know how to store samples in the GUS dram (simply\r
- use the GUSPoke routine to store the bytes) we will now look at various\r
- routines to change the way the gus plays a sample. The first routine we\r
- will look at will set the volume of an individual channel :\r
-\r
-  Procedure GUSSetVolume( Voi : Byte; Vol : Word);\r
-\r
-  { Set the volume of channel VOI to Vol, a 16bit logarithmic scale\r
-    volume value -  0 is off, $ffff is full volume, $e0000 is half\r
-    volume, etc }\r
-\r
-  Begin\r
-    Port [Base+$102] := Voi;\r
-    Port [Base+$102] := Voi;\r
-    Port [Base+$102] := Voi;\r
-    Port [Base+$103] := 9;\r
-    Portw[Base+$104] := Vol;  { 0-0ffffh, log scale not linear }\r
-  End;\r
-\r
-   The volume (and pan position & frequency) can be changed at ANY time\r
- regardless of weather the GUS is allready playing the sample or not.\r
- This means that to fade out a sample, you simply make several calls to\r
- the GUSSetVolume routine with exponentially (to account for the\r
- logarithmic scale) decreasing values.\r
-\r
-   The next two routines will set the pan position (from 0 to 15, 0\r
-   being left, 15 right and 7 middle) and the frequency respectively :\r
-\r
-  Procedure GUSSetBalance( V, B : Byte);\r
-  Begin\r
-    Port [Base+$102] := V;\r
-    Port [Base+$102] := V;\r
-    Port [Base+$102] := V;\r
-    Port [Base+$103] := $C;\r
-    Port [Base+$105] := B;\r
-  End;\r
-\r
-  Procedure GUSSetFreq( V : Byte; F : Word);\r
-  Begin\r
-    Port [Base+$102] := V;\r
-    Port [Base+$102] := V;\r
-    Port [Base+$102] := V;\r
-    Port [Base+$103] := 1;\r
-    Portw[Base+$104] := F;\r
-  End;\r
-\r
-   I'm not sure the the value F in the set frequency procedure. The GUS\r
- SDK claims that it is the exact frequency at which the sample should be\r
- played.\r
-\r
-   When playing a sample, it is necessary to set the volume, position\r
- and frequency BEFORE playing the sample. In order to start playing a\r
- sample, you need to tell the GUS where abouts in memory the sample is\r
- stored, and how big the sample is  :\r
-\r
\r
-  Procedure GUSPlayVoice( V, Mode : Byte;VBegin, VStart, VEnd : Longint);\r
-\r
-  { This routine tells the GUS to play a sample commencing at VBegin,\r
-    starting at location VStart, and stopping at VEnd }\r
-\r
-  Var\r
-    GUS_Register : Word;\r
-  Begin\r
-    Port [Base+$102] := V;\r
-    Port [Base+$102] := V;\r
-    Port [Base+$103] := $0A;\r
-    Portw[Base+$104] := (VBegin SHR 7) AND 8191;\r
-    Port [Base+$103] := $0B;\r
-    Portw[Base+$104] := (VBegin AND $127) SHL 8;\r
-    Port [Base+$103] := $02;\r
-    Portw[Base+$104] := (VStart SHR 7) AND 8191;\r
-    Port [Base+$103] := $03;\r
-    Portw[Base+$104] := (VStart AND $127) SHL 8;\r
-    Port [Base+$103] := $04;\r
-    Portw[Base+$104] := ((VEnd)   SHR 7) AND 8191;\r
-    Port [Base+$103] := $05;\r
-    Portw[Base+$104] := ((VEnd)   AND $127) SHL 8;\r
-    Port [Base+$103] := $0;\r
-    Port [Base+$105] := Mode;\r
-\r
-    { The below part isn't mentioned as necessary, but the card won't\r
-      play anything without it! }\r
-\r
-    Port[Base] := 1;\r
-    Port[Base+$103] := $4C;\r
-    Port[Base+$105] := 3;\r
-  end;\r
-\r
-   There are a few important things to note about this routine. Firstly,\r
- the value VEnd refers to the location in memory, not the length of the\r
- sample. So if the sample commenced at location 1000, and was 5000 bytes\r
- long, the VEnd would be 6000 if you wanted the sample to play to the\r
- end. VBegin and VStart are two weird values, one of them defines the\r
- start of the sample, and the other defines where abouts to actually\r
- start playing. I'm not sure why both are needed, since I have allways\r
- set them to the same value.\r
-\r
-   Now that the gus is buisy playing a sample, the CPU is totally free\r
- to be doing other things. We might, for example, want to spy on the gus\r
- and see where it is currently up to in playing the sample :\r
-\r
-  Function VoicePos( V : Byte) : Longint;\r
-  Var\r
-    P : Longint;\r
-    Temp0, Temp1 : Word;\r
-  Begin\r
-    Port [Base+$102] := V;\r
-    Port [Base+$102] := V;\r
-    Port [Base+$102] := V;\r
-    Port [Base+$103] := $8A;\r
-    Temp0 := Portw[Base+$104];\r
-    Port [Base+$103] := $8B;\r
-    Temp1 := Portw[Base+$104];\r
-    VoicePos := (Temp0 SHL 7)+ (Temp1 SHR 8);\r
-  End;\r
-\r
-   This routine will return the memory location that the channel V is\r
- currently playing. If the GUS has reached the end of the sample, then\r
- the returned value will be VEnd. If you want to see what BYTE value is\r
- currently being played (for visual output of the sample's waveform),\r
- then you simply PEEK the location pointed to by this routine.\r
-\r
-   Finally, we might want to stop playing the sample before it has\r
- reached it's end - the following routine will halt the playback on\r
- channel V.\r
-\r
-\r
-  Procedure GUSStopVoice( V : Byte);\r
-  Var\r
-    Temp : Byte;\r
-  Begin\r
-    Port [Base+$102] := V;\r
-    Port [Base+$102] := V;\r
-    Port [Base+$102] := V;\r
-    Port [Base+$103] := $80;\r
-    Temp := Port[Base+$105];\r
-    Port [Base+$103] := 0;\r
-    Port [Base+$105] := (Temp AND $df) OR 3;\r
-    GUSDelay;\r
-    Port [Base+$103] := 0;\r
-    Port [Base+$105] := (Temp AND $df) OR 3;\r
-  End;\r
-\r
-\r
- SPECIAL EFFECTS\r
- ~~~~~~~~~~~~~~~\r
-   There are a few extra features of the GUS that are worthy of mention,\r
- the main one being hardware controlled sample looping. The GUS has a\r
- control byte for each of the 32 channels. This control byte consists of\r
- 8 flags that effect the way the sample is played, as follows :\r
-  ( The table is taken directly from the GUS Software Developers Kit )\r
-\r
-           =================================\r
-           | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |\r
-           =================================\r
-             |   |   |   |   |   |   |   |\r
-             |   |   |   |   |   |   |   +---- Voice Stopped\r
-             |   |   |   |   |   |   +-------- Stop Voice\r
-             |   |   |   |   |   +------------ 16 bit data\r
-             |   |   |   |   +---------------- Loop enable\r
-             |   |   |   +-------------------- Bi-directional loop enable\r
-             |   |   +------------------------ Wave table IRQ\r
-             |   +---------------------------- Direction of movement\r
-             +-------------------------------- IRQ pending\r
-        (*)Bit 0 = 1 : Voice is stopped. This gets set by hitting the end\r
-                   address (not looping) or by setting bit 1 in this reg.\r
-           Bit 1 = 1 : Stop Voice. Manually force voice to stop.\r
-           Bit 2 = 1 : 16 bit wave data, 0 = 8 bit data\r
-           Bit 3 = 1 : Loop to begin address when it hits the end address.\r
-           Bit 4 = 1 : Bi-directional looping enabled\r
-           Bit 5 = 1 : Enable wavetable IRQ. Generate an irq when the voice\r
-                       hits the end address. Will generate irq even if looping\r
-                       is enabled.\r
-        (*)Bit 6 = 1 - Decreasing addresses, 0 = increasing addresses. It is\r
-                       self-modifying because it might shift directions when\r
-                       it hits one of the loop boundaries and looping is enabled.\r
-        (*)Bit 7 = 1 - Wavetable IRQ pending. If IRQ's are enabled and\r
-                       looping is NOT enabled, an IRQ will be constantly\r
-                       generated until voice is stopped. This means that\r
-                       you may get more than 1 IRQ if it isn't handled\r
-                       properly.\r
-\r
-\r
-  Procedure GUSVoiceControl( V, B : Byte);\r
-  Begin\r
-    Port [Base+$102] := V;\r
-    Port [Base+$102] := V;\r
-    Port [Base+$103] := $0;\r
-    Port [Base+$105] := B;\r
-  End;\r
-\r
-\r
-   The above routine will set the Voice Control byte for the channel\r
- defined in V. For example, if you want channel 1 to play the sample in\r
- a continuous loop, you would use the procedure like this :\r
-\r
-    GUSVoiceControl( 1, $F );  { Bit 3 ON = $F }\r
-\r
-\r
- CONCLUSION\r
- ~~~~~~~~~~\r
-\r
-   The above routines are all that is necessary to get the GUS to start\r
- playing music. To prove this, I have included my 669 player & source\r
- code in the package as a practical example. The GUSUnit contains all\r
- the routines discussed above. I won't go into the theory of the 669\r
- player, but it is a good starting point if you want to learn about\r
- modplayers. The player is contained within the archive 669UNIT.ARJ\r
-\r
-\r
-\r
-ÚÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ README ³\r
-ÀÄÄÄÄÄÄÄÄÙ\r
-\r
-\r
-  GUS669 Unit  v0.2b\r
-  Copyright 1994 Mark Dixon.\r
-  (aka C.D. of Silicon Logic)\r
-\r
-\r
-  LEGAL STUFF\r
-  ~~~~~~~~~~~\r
-  I'd like to avoid this, but it has to be done. Basically, if anything\r
-  in this archive causes any kind of damage, I cannot be held\r
-  responsable - USE AT YOUR OWN RISK.\r
-\r
-  In adition, since I spent long hours working on this project, and\r
-  attempting to decode the GUS SDK, I would appreciate it if people\r
-  didn't rip off my work. Give me credit for what I have done, and if\r
-  your planning to use my routines for commercial purposes, talk to me\r
-  first, or you might find yourself on the wrong side of a legal battle.\r
-  (Hey, let's sound tough while i'm at it, I have lawyer's in the\r
-  family, so it's not gonna cost me much to sue someone. And don't\r
-  criticise my spelling! :)\r
-\r
-\r
-\r
-  BORING STUFF\r
-  ~~~~~~~~~~~~\r
-  Well, if your the sort of person who likes to ignore all the rubishy\r
-  bits that go into a README text file, then you'd better stop now and\r
-  go and try out the source code!\r
-\r
-  Basically, this readme isn't going to say much more than what the\r
-  source code is, and then go dribling on for five pages about\r
-  absolutely nothing.\r
-\r
-\r
-  SOURCE CODE! DID SOMEONE SAY - SOURCE CODE!! - ????\r
-  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r
-  Yes, that's right, free with every download of this wonderful archive\r
-  comes the complete Pascal source code to a 669 module player for the\r
-  GUS. I'd have included my MOD player, but I haven't been able to get\r
-  all the MOD commands working, so you'll just have to make do with a\r
-  669 player :)\r
-\r
-  Feel free to make use of this source code for any non-commercial\r
-  purposes you might be able to think of - and mention my name while\r
-  your at it! Since the source code is here, people are bound to modify\r
-  it for their personal uses. If you do this, I would very much like to\r
-  see your modifications - so that I can include them in the next\r
-  release of the player.\r
-\r
-\r
-  Well, I don't want to bore you anymore, and it's getting late (not!)\r
-  so i'd better let you go and play around with the source code :)\r
-\r
-\r
-  SILICON LOGIC\r
-  ~~~~~~~~~~~~~\r
-  What ever happened to Silicon Logic? Well, after being killed off over\r
-  in Perth, a major revival is underway here in Canberra, with a more\r
-  commercial view - more on that later.\r
-\r
-  For those of you who have never heard of Silicon Logic, then you're\r
-  either not Australian, or not into the ausie demo scene. But then,\r
-  that covers about 99.999999999999% of the world population :)\r
-\r
-\r
-  GREETINGS\r
-  ~~~~~~~~~\r
-  I've allways wanted to dribble some thanks, so here goes.\r
-\r
-   Thanks go to...\r
-\r
-    Darren Lyon    - Who got me into this programming lark in the first\r
-                     place. Finally wrote myself a mod player :)\r
-    Tran           - Your source code really helped!\r
-    Kitsune        - Love those mods, keep up the good work!\r
-\r
-    ... and Advanced Gravis, for making the best sound card ever.\r
-\r
-   Greetings to...\r
-\r
-    FiRE members   - I'll probably never join you guys, but good luck\r
-                     anyway!\r
-    UNiQUE         - How's the board going?\r
-    CRaSH          - Still ripping other peoples source code?\r
-    Old SL members - Thanks for the support, good luck with your new\r
-                     group!\r
-    Oliver White   - G'day... just thought i'd say hi, since you so\r
-                     kindly beta tested the player for me.\r
-    Murray Head    - Rick Price sux! :-) SoundBlaster sux too! :-)\r
-    Perth people   - I'm coming back... someday!\r
-\r
-\r
-    THE PICK / MINNOW   -  Hey, give me a call sometime, long time no\r
-                           talk...\r
-\r
-\r
-\r
-  INTERESTED IN A DEMO GROUP IN CANBERRA?\r
-  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r
-  If there is anyone interested in joining a demo / coding group in\r
-  Canberra (ACT), then drop me a line.\r
-\r
-\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ GUSUNIT.PAS³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-Unit  GUSUnit;\r
-\r
-{\r
-  GUS DigiUnit  v1.0\r
-  Copyright 1994 Mark Dixon.\r
-\r
-  This product is "Learnware".\r
-\r
-  All contents of this archive, including source and executables, are the\r
-  intellectual property of the author, Mark Dixon. Use of this product for\r
-  commercial programs, or commercial gain in ANY way, is illegal. Private\r
-  use, or non-commercial use (such as demos, PD games, etc) is allowed,\r
-  provided you give credit to the author for these routines.\r
-\r
-  Feel free to make any modifications to these routines, but I would\r
-  appreciate it if you sent me these modifications, so that I can include\r
-  them in the next version of the Gus669 Unit.\r
-\r
-  If you wish to use these routines for commercial purposes, then you will\r
-  need a special agreement. Please contact me, Mark Dixon, and we can work\r
-  something out.\r
-\r
-  What's "Learnware"? Well, I think I just made it up actually. What i'm\r
-  getting at is that the source code is provided for LEARNING purposes only.\r
-  I'd get really angry if someone ripped off my work and tried to make out\r
-  that they wrote a mod player.\r
-\r
-  As of this release (Gus699 Unit), the Gus DigiUnit has moved to version\r
-  1.0, and left the beta stage. I feel these routines are fairly sound,\r
-  and I haven't made any changes to them in weeks.\r
-\r
-\r
-  Notice the complete absence of comments here? Well, that's partially\r
-  the fault of Gravis and their SDK, since it was so hard to follow, I\r
-  was more worried about getting it working than commenting it. No offense\r
-  to Gravis though, since they created this wonderful card! :-) It helps\r
-  a lot if you have the SDK as a reference when you read this code,\r
-  otherwise you might as well not bother reading it.\r
-\r
-}\r
-\r
-\r
-\r
-INTERFACE\r
-\r
-Procedure GUSPoke(Loc : Longint; B : Byte);\r
-Function  GUSPeek(Loc : Longint) : Byte;\r
-Procedure GUSSetFreq( V : Byte; F : Word);\r
-Procedure GUSSetBalance( V, B : Byte);\r
-Procedure GUSSetVolume( Voi : Byte; Vol : Word);\r
-Procedure GUSPlayVoice( V, Mode : Byte;VBegin, VStart, VEnd : Longint);\r
-Procedure GUSVoiceControl( V, B : Byte);\r
-Procedure GUSReset;\r
-Function VoicePos( V : Byte) : Longint;\r
-\r
-Const\r
-  Base : Word = $200;\r
-  Mode : Byte = 0;\r
-\r
-IMPLEMENTATION\r
-\r
-\r
-Uses Crt;\r
-\r
-Function Hex( W : Word) : String;\r
-Var\r
-  I, J : Word;\r
-  S : String;\r
-  C : Char;\r
-Const\r
-  H : Array[0..15] of Char = ('0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F');\r
-Begin\r
-  S := '';\r
-  S := S + H[(W DIV $1000) MOD 16];\r
-  S := S + H[(W DIV $100 ) MOD 16];\r
-  S := S + H[(W DIV $10  ) MOD 16];\r
-  S := S + H[(W DIV $1   ) MOD 16];\r
-  Hex := S+'h';\r
-End;\r
-\r
-\r
-Procedure GUSDelay; Assembler;\r
-ASM\r
-  mov   dx, 0300h\r
-  in    al, dx\r
-  in    al, dx\r
-  in    al, dx\r
-  in    al, dx\r
-  in    al, dx\r
-  in    al, dx\r
-  in    al, dx\r
-End;\r
-\r
-\r
-\r
-Function VoicePos( V : Byte) : Longint;\r
-Var\r
-  P : Longint;\r
-  I, Temp0, Temp1 : Word;\r
-Begin\r
-  Port [Base+$102] := V;\r
-  Port [Base+$103] := $8A;\r
-  Temp0 := Portw[Base+$104];\r
-  Port [Base+$103] := $8B;\r
-  Temp1 := Portw[Base+$104];\r
-  VoicePos := (Temp0 SHL 7)+ (Temp1 SHR 8);\r
-  For I := 1 to 10 do GusDelay;\r
-End;\r
-\r
-\r
-Function  GUSPeek(Loc : Longint) : Byte;\r
-Var\r
-  B : Byte;\r
-  AddLo : Word;\r
-  AddHi : Byte;\r
-Begin\r
-  AddLo := Loc AND $FFFF;\r
-  AddHi := LongInt(Loc AND $FF0000) SHR 16;\r
-\r
-  Port [Base+$103] := $43;\r
-  Portw[Base+$104] := AddLo;\r
-  Port [Base+$103] := $44;\r
-  Port [Base+$105] := AddHi;\r
-\r
-  B := Port[Base+$107];\r
-  GUSPeek := B;\r
-End;\r
-\r
-\r
-Procedure GUSPoke(Loc : Longint; B : Byte);\r
-Var\r
-  AddLo : Word;\r
-  AddHi : Byte;\r
-Begin\r
-  AddLo := Loc AND $FFFF;\r
-  AddHi := LongInt(Loc AND $FF0000) SHR 16;\r
-{  Write('POKE  HI :', AddHi:5, '  LO : ', AddLo:5, '    ');}\r
-  Port [Base+$103] := $43;\r
-  Portw[Base+$104] := AddLo;\r
-  Port [Base+$103] := $44;\r
-  Port [Base+$105] := AddHi;\r
-  Port [Base+$107] := B;\r
-{  Writeln(B:3);}\r
-End;\r
-\r
-\r
-Function GUSProbe : Boolean;\r
-Var\r
-  B : Byte;\r
-Begin\r
-  Port [Base+$103] := $4C;\r
-  Port [Base+$105] := 0;\r
-  GUSDelay;\r
-  GUSDelay;\r
-  Port [Base+$103] := $4C;\r
-  Port [Base+$105] := 1;\r
-  GUSPoke(0, $AA);\r
-  GUSPoke($100, $55);\r
-  B := GUSPeek(0);\r
-{  Port [Base+$103] := $4C;\r
-  Port [Base+$105] := 0;}\r
-  { Above bit disabled since it appears to prevent the GUS from accessing\r
-    it's memory correctly.. in some bizare way.... }\r
-\r
-  If B = $AA then GUSProbe := True else GUSProbe := False;\r
-End;\r
-\r
-\r
-Procedure GUSFind;\r
-Var\r
-  I : Word;\r
-Begin\r
-  for I := 1 to 8 do\r
-  Begin\r
-    Base := $200 + I*$10;\r
-    If GUSProbe then I := 8;\r
-  End;\r
-  If Base < $280 then\r
-    Write('Found your GUS at ', Hex(Base), ' ');\r
-End;\r
-\r
-\r
-Function  GUSFindMem : Longint;\r
-{ Returns how much RAM is available on the GUS }\r
-Var\r
-  I : Longint;\r
-  B : Byte;\r
-Begin\r
-  GUSPoke($40000, $AA);\r
-  If GUSPeek($40000) <> $AA then I := $3FFFF\r
-    else\r
-  Begin\r
-    GUSPoke($80000, $AA);\r
-    If GUSPeek($80000) <> $AA then I := $8FFFF\r
-      else\r
-    Begin\r
-      GUSPoke($C0000, $AA);\r
-      If GUSPeek($C0000) <> $AA then I := $CFFFF\r
-        else I := $FFFFF;\r
-    End;\r
-  End;\r
-  GUSFindMem := I;\r
-End;\r
-\r
-\r
-Procedure GUSSetFreq( V : Byte; F : Word);\r
-Begin\r
-  Port [Base+$102] := V;\r
-  Port [Base+$102] := V;\r
-  Port [Base+$102] := V;\r
-  Port [Base+$103] := 1;\r
-  Portw[Base+$104] := (F { DIV 19}); { actual frequency / 19.0579083837 }\r
-End;\r
-\r
-Procedure GUSVoiceControl( V, B : Byte);\r
-Begin\r
-  Port [Base+$102] := V;\r
-  Port [Base+$102] := V;\r
-  Port [Base+$103] := $0;\r
-  Port [Base+$105] := B;\r
-End;\r
-\r
-\r
-\r
-Procedure GUSSetBalance( V, B : Byte);\r
-Begin\r
-  Port [Base+$102] := V;\r
-  Port [Base+$102] := V;\r
-  Port [Base+$102] := V;\r
-  Port [Base+$103] := $C;\r
-  Port [Base+$105] := B;\r
-End;\r
-\r
-\r
-Procedure GUSSetVolume( Voi : Byte; Vol : Word);\r
-Begin\r
-  Port [Base+$102] := Voi;\r
-  Port [Base+$102] := Voi;\r
-  Port [Base+$102] := Voi;\r
-  Port [Base+$103] := 9;\r
-  Portw[Base+$104] := Vol;  { 0-0ffffh, log ... not linear }\r
-End;\r
-\r
-\r
-Procedure GUSSetLoopMode( V : Byte);\r
-Var\r
-  Temp : Byte;\r
-Begin\r
-  Port [Base+$102] := V;\r
-  Port [Base+$102] := V;\r
-  Port [Base+$102] := V;\r
-  Port [Base+$103] := $80;\r
-  Temp := Port[Base+$105];\r
-  Port [Base+$103] := 0;\r
-  Port [Base+$105] := (Temp AND $E7) OR Mode;\r
-End;\r
-\r
-\r
-Procedure GUSStopVoice( V : Byte);\r
-Var\r
-  Temp : Byte;\r
-Begin\r
-  Port [Base+$102] := V;\r
-  Port [Base+$102] := V;\r
-  Port [Base+$102] := V;\r
-  Port [Base+$103] := $80;\r
-  Temp := Port[Base+$105];\r
-  Port [Base+$103] := 0;\r
-  Port [Base+$105] := (Temp AND $df) OR 3;\r
-  GUSDelay;\r
-  Port [Base+$103] := 0;\r
-  Port [Base+$105] := (Temp AND $df) OR 3;\r
-End;\r
-\r
-\r
-Procedure GUSPlayVoice( V, Mode : Byte;VBegin, VStart, VEnd : Longint);\r
-Var\r
-  GUS_Register : Word;\r
-Begin\r
-  Port [Base+$102] := V;\r
-  Port [Base+$102] := V;\r
-  Port [Base+$103] := $0A;\r
-  Portw[Base+$104] := (VBegin SHR 7) AND 8191;\r
-  Port [Base+$103] := $0B;\r
-  Portw[Base+$104] := (VBegin AND $127) SHL 8;\r
-  Port [Base+$103] := $02;\r
-  Portw[Base+$104] := (VStart SHR 7) AND 8191;\r
-  Port [Base+$103] := $03;\r
-  Portw[Base+$104] := (VStart AND $127) SHL 8;\r
-  Port [Base+$103] := $04;\r
-  Portw[Base+$104] := ((VEnd)   SHR 7) AND 8191;\r
-  Port [Base+$103] := $05;\r
-  Portw[Base+$104] := ((VEnd)   AND $127) SHL 8;\r
-  Port [Base+$103] := $0;\r
-  Port [Base+$105] := Mode;\r
-\r
-  { The below part isn't mentioned as necessary, but the card won't\r
-    play anything without it! }\r
-\r
-  Port[Base] := 1;\r
-  Port[Base+$103] := $4C;\r
-  Port[Base+$105] := 3;\r
-\r
-end;\r
-\r
-\r
-Procedure GUSReset;\r
-Begin\r
-  port [Base+$103]   := $4C;\r
-  port [Base+$105] := 1;\r
-  GUSDelay;\r
-  port [Base+$103]   := $4C;\r
-  port [Base+$105] := 7;\r
-  port [Base+$103]   := $0E;\r
-  port [Base+$105] := (14 OR $0C0);\r
-End;\r
-\r
-\r
-\r
-Var\r
-  I : Longint;\r
-  F : File;\r
-  Buf : Array[1..20000] of Byte;\r
-  S : Word;\r
-\r
-\r
-Begin\r
-  Clrscr;\r
-  Writeln('GUS DigiUnit V1.0');\r
-  Writeln('Copyright 1994 Mark Dixon.');\r
-  Writeln;\r
-  GUSFind;\r
-  Writeln('with ', GUSFindMem, ' bytes onboard.');\r
-  Writeln;\r
-  GUSReset;\r
-End.\r
-\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ GUS669.PAS ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-UNIT Gus669;\r
-\r
-{\r
-  GUS669 Unit  v0.2b\r
-  Copyright 1994 Mark Dixon.\r
-\r
-  This product is "Learnware".\r
-\r
-  All contents of this archive, including source and executables, are the\r
-  intellectual property of the author, Mark Dixon. Use of this product for\r
-  commercial programs, or commercial gain in ANY way, is illegal. Private\r
-  use, or non-commercial use (such as demos, PD games, etc) is allowed,\r
-  provided you give credit to the author for these routines.\r
-\r
-  Feel free to make any modifications to these routines, but I would\r
-  appreciate it if you sent me these modifications, so that I can include\r
-  them in the next version of the Gus669 Unit.\r
-\r
-  If you wish to use these routines for commercial purposes, then you will\r
-  need a special agreement. Please contact me, Mark Dixon, and we can work\r
-  something out.\r
-\r
-  What's "Learnware"? Well, I think I just made it up actually. What i'm\r
-  getting at is that the source code is provided for LEARNING purposes only.\r
-  I'd get really angry if someone ripped off my work and tried to make out\r
-  that they wrote a mod player.\r
-\r
-  Beta version? Yes, since the product is still slightly unstable, I feel\r
-  it is right to keep it under beta status until I find and fix a few\r
-  bugs.\r
-\r
-  FEATURES\r
-    - Only works with the GUS!\r
-    - 8 channel, 669 music format.\r
-    - That's about it really.\r
-    - Oh, 100% Pascal high level source code = NO ASSEMBLER!\r
-      (So if you want to learn about how to write your own MOD player, this\r
-       should make it easier for you)\r
-    - Tested & compiled with Turbo Pascal v7.0\r
-\r
-  BUGS\r
-    - Not yet, give me a chance!\r
-      (If you find any, I would very much appreciate it if you could take\r
-       the time to notify me)\r
-    - Doesn't sound right with some modules, advice anyone??\r
-    - Could do with some better I/O handling routines when loading the\r
-      669 to give better feedback to the user about what went wrong\r
-      if the module didn't load.\r
-\r
-\r
- You can contact me at any of the following :\r
-\r
- FidoNet  : Mark Dixon  3:620/243\r
- ItnerNet : markd@cairo.anu.edu.au         ( prefered )\r
-            d9404616@karajan.anu.edu.au    ( might not work for mail :) )\r
-            sdixonmj@cc.curtin.edu.au      ( Don't use this one often )\r
-            sdixonmj01@cc.curtin.edu.au    ( Might not exist any more,\r
-                                             that's how often it's used! )\r
-            I collect internet accounts.... :)\r
-\r
- If you happen to live in the Australian Capital Territory, you can\r
- call me on  231-2000, but at respectable hours please.\r
-\r
-\r
- "Want more comments? Write em!"\r
- Sorry, I just had to quote that. I'm not in the mood for writing lots\r
- of comments just yet. The main reason for writing it in Pascal is so\r
- that it would be easy to understand. Comments may (or may not) come later\r
- on.\r
-\r
- Okay, enough of me dribbling, here's the source your after!\r
-\r
-}\r
-\r
-\r
-\r
-\r
-Interface\r
-\r
-Procedure Load669(N : String);\r
-Procedure PlayMusic;\r
-Procedure StopMusic;\r
-\r
-Type\r
-  { This is so that we can keep a record of what each channel is\r
-    currently doing, so that we can inc/dec the Frequency or volume,\r
-    or pan left/right, etc }\r
-  Channel_Type    = Record\r
-                      Vol : Word;\r
-                      Freq : Word;\r
-                      Pan : Byte;\r
-                    End;\r
-\r
-Var\r
-  Channels : Array[1..8] of Channel_Type;\r
-  Flags : Array[0..15] of Byte;\r
-  { Programmer flags. This will be explained when it is fully implemented. }\r
-\r
-Const\r
-  Loaded : Boolean = False;    { Is a module loaded? }\r
-  Playing : Boolean = False;   { Is a module playing? }\r
-  WaitState : Boolean = False; { Set to TRUE whenever a new note is played }\r
-                               { Helpful for timing in with the player }\r
-\r
-\r
-Const\r
-  NumChannels = 8;\r
-\r
-  { Thanks to Tran for releasing the Hell demo source code, from which\r
-    I managed to find these very helpfull volume and frequency value\r
-    tables, without which this player would not have worked! }\r
-\r
-  voltbl : Array[0..15] of Byte =\r
-                     (  $004,$0a0,$0b0,$0c0,$0c8,$0d0,$0d8,$0e0,\r
-                        $0e4,$0e8,$0ec,$0f1,$0f4,$0f6,$0fa,$0ff);\r
-  freqtbl : Array[1..60] of Word = (\r
-                        56,59,62,66,70,74,79,83,88,94,99,105,\r
-                        112,118,125,133,141,149,158,167,177,188,199,211,\r
-                        224,237,251,266,282,299,317,335,355,377,399,423,\r
-                        448,475,503,532,564,598,634,671,711,754,798,846,\r
-                        896,950,1006,1065,1129,1197,1268,1343,1423,1508,1597,1692 );\r
-\r
-\r
-\r
-Type\r
-  Header_669_Type = Record\r
-                      Marker      : Word;\r
-                      Title       : Array[1..108] of Char;\r
-                      NOS,                     { No of Samples  0 - 64 }\r
-                      NOP         : Byte;      { No of Patterns 0 - 128 }\r
-                      LoopOrder   : Byte;\r
-                      Order       : Array[0..127] of Byte;\r
-                      Tempo       : Array[0..127] of Byte;\r
-                      Break       : Array[0..127] of Byte;\r
-                    End;\r
-  Sample_Type     = Record\r
-                      FileName  : Array[1..13] of Char;\r
-                      Length    : Longint;\r
-                      LoopStart : Longint;\r
-                      LoopLen   : Longint;\r
-                    End;\r
-  Sample_Pointer  = ^Sample_Type;\r
-  Note_Type       = Record\r
-                      Info,  { <- Don't worry about this little bit here }\r
-                      Note,\r
-                      Sample,\r
-                      Volume,\r
-                      Command,\r
-                      Data    : Byte;\r
-                    End;\r
-  Event_Type      = Array[1..8] of Note_Type;\r
-  Pattern_Type    = Array[0..63] of Event_Type;\r
-  Pattern_Pointer = ^Pattern_Type;\r
-\r
-\r
-\r
-Var\r
-  Header : Header_669_Type;\r
-  Samples : Array[0..64] of Sample_Pointer;\r
-  Patterns : Array[0..128] of Pattern_Pointer;\r
-  GusTable : Array[0..64] of Longint;\r
-  GusPos : Longint;\r
-  Speed : Byte;\r
-  Count : Word;\r
-  OldTimer : Procedure;\r
-  CurrentPat, CurrentEvent : Byte;\r
-\r
-\r
-Implementation\r
-\r
-Uses Dos, Crt, GUSUnit;\r
-\r
-\r
-Procedure Load669(N : String);\r
-Var\r
-  F : File;\r
-  I, J, K : Byte;\r
-  T : Array[1..8,1..3] of Byte;\r
-\r
-  Procedure LoadSample(No, Size : Longint);\r
-  Var\r
-    Buf : Array[1..1024] of Byte;\r
-    I : Longint;\r
-    J, K : Integer;\r
-  Begin\r
-    GusTable[No] := GusPos;\r
-\r
-    I := Size;\r
-    While I > 1024 do\r
-    Begin\r
-      BlockRead(F, Buf, SizeOf(Buf), J);\r
-      For K := 1 to J do GusPoke(GusPos+K-1, Buf[K] XOR 127);\r
-      Dec(I, J);\r
-      Inc(GusPos, J);\r
-    End;\r
-    BlockRead(F, Buf, I, J);\r
-    For K := 1 to J do GusPoke(GusPos+K-1, Buf[K] XOR 127);\r
-    Inc(GusPos, J);\r
-  End;\r
-\r
-Begin\r
-  {$I-}\r
-  Assign(F, N);\r
-  Reset(F, 1);\r
-  BlockRead(F, Header, SizeOf(Header));\r
-  If Header.Marker = $6669 then\r
-  Begin\r
-    For I := 1 to Header.NOS do\r
-    Begin\r
-      New(Samples[I-1]);\r
-      BlockRead(F, Samples[I-1]^, SizeOf(Samples[I-1]^));\r
-    End;\r
-\r
-    For I := 0 to Header.NOP-1 do\r
-    Begin\r
-      New(Patterns[I]);\r
-      For J := 0 to 63 do\r
-      Begin\r
-        BlockRead(F, T, SizeOf(T));\r
-        For K := 1 to 8 do\r
-        Begin\r
-          Patterns[I]^[J,K].Info    := t[K,1];\r
-          Patterns[I]^[J,K].Note    := ( t[K,1] shr 2);\r
-          Patterns[I]^[J,K].Sample  := ((t[K,1] AND 3) SHL 4) +  (t[K,2] SHR 4);\r
-          Patterns[I]^[J,K].Volume  := ( t[K,2] AND 15);\r
-          Patterns[I]^[J,K].Command := ( t[K,3] shr 4);\r
-          Patterns[I]^[J,K].Data    := ( t[K,3] AND 15);\r
-        End;\r
-      End;\r
-    End;\r
-\r
-    For I := 1 to Header.NOS do\r
-      LoadSample(I-1, Samples[I-1]^.Length);\r
-  End;\r
-\r
-  Close(F);\r
-  {$I+}\r
-  If (IOResult <> 0) OR (Header.Marker <> $6669) then\r
-    Loaded := False else Loaded := True;\r
-\r
-End;\r
-\r
-\r
-\r
-\r
-Procedure UpDateNotes;\r
-Var\r
-  I : Word;\r
-  Inst : Byte;\r
-  Note : Word;\r
-Begin\r
-  WaitState := True;\r
-  For I := 1 to NumChannels do\r
-  With Patterns[Header.Order[CurrentPat]]^[CurrentEvent, I] do\r
-\r
-  For I := 1 to NumChannels do\r
-  If (Patterns[Header.Order[CurrentPat]]^[CurrentEvent, I].Info < $FE) then\r
-  Begin\r
-    Inst := Patterns[Header.Order[CurrentPat]]^[CurrentEvent, I].Sample;\r
-    Note := Patterns[Header.Order[CurrentPat]]^[CurrentEvent, I].Note;\r
-    Channels[I].Freq := FreqTbl[Note];\r
-{    Channels[I].Pan  := (1-(I AND 1)) * 15;}\r
-    Channels[I].Vol  := $100*VolTbl[Patterns[Header.Order[CurrentPat]]^[CurrentEvent, I].Volume];\r
-{    Write(Note:3,Inst:3,' -');}\r
-\r
-    GUSSetVolume    (I, 0);\r
-    GUSVoiceControl (I, 1);\r
-    GUSSetBalance   (I, Channels[I].Pan);\r
-    GusSetFreq      ( I, Channels[I].Freq);\r
-{    GUSPlayVoice    ( I, 0, GusTable[Inst],\r
-                            GusTable[Inst],\r
-                            GusTable[Inst]+Samples[Inst]^.Length  );}\r
-\r
-{    Write(Samples[Inst]^.LoopLen:5);}\r
-    If Samples[Inst]^.LoopLen < 1048575 then\r
-    Begin\r
-    GUSPlayVoice    ( I, 8, GusTable[Inst],\r
-                            GusTable[Inst]+Samples[Inst]^.LoopStart,\r
-                            GusTable[Inst]+Samples[Inst]^.LoopLen  );\r
-    End\r
-      Else\r
-    Begin\r
-    GUSPlayVoice    ( I, 0, GusTable[Inst],\r
-                            GusTable[Inst],\r
-                            GusTable[Inst]+Samples[Inst]^.Length  );\r
-    End;\r
-\r
-\r
-  End;\r
-\r
-{  Writeln;}\r
-\r
-  For I := 1 to NumChannels do\r
-    If (Patterns[Header.Order[CurrentPat]]^[CurrentEvent, I].Info < $FF) then\r
-      GUSSetVolume (I, $100*VolTbl[Patterns[Header.Order[CurrentPat]]^[CurrentEvent, I].Volume]);\r
-\r
-  For I := 1 to NumChannels do\r
-  With Patterns[Header.Order[CurrentPat]]^[CurrentEvent, I] do\r
-  Case Command of\r
-    5 : Speed := Data;\r
-    3 : Begin\r
-          Channels[I].Freq := Channels[I].Freq + 10;\r
-          GUSSetFreq(I, Channels[I].Freq);\r
-        End;\r
-    8 : Inc(Flags[Data]);\r
-    6 : Case Data of\r
-          0 : If Channels[I].Pan > 0 then\r
-              Begin\r
-                Dec(Channels[I].Pan);\r
-                GusSetBalance(I, Channels[I].Pan);\r
-              End;\r
-          1 : If Channels[I].Pan < 15 then\r
-              Begin\r
-                Inc(Channels[I].Pan);\r
-                GusSetBalance(I, Channels[I].Pan);\r
-              End;\r
-        End;\r
-  End;\r
-\r
-\r
-\r
-\r
-\r
-  Inc(CurrentEvent);\r
-  If CurrentEvent > Header.Break[CurrentPat] then Begin CurrentEvent := 0; Inc(CurrentPat) End;\r
-  If Header.Order[CurrentPat] > (Header.NOP) then Begin CurrentEvent := 0; CurrentPat := 0; End;\r
-\r
-End;\r
-\r
-\r
-Procedure UpDateEffects;\r
-Var\r
-  I : Word;\r
-Begin\r
-  For I := 1 to 4 do\r
-  With Patterns[Header.Order[CurrentPat]]^[CurrentEvent, I] do\r
-  Begin\r
-    Case Command of\r
-      0 : Begin\r
-            Inc(Channels[I].Freq, Data);\r
-            GusSetFreq(I, Channels[I].Freq);\r
-          End;\r
-      1 : Begin\r
-            Dec(Channels[I].Freq, Data);\r
-            GusSetFreq(I, Channels[I].Freq);\r
-          End;\r
-    End;\r
-  End;\r
-End;\r
-\r
-\r
-\r
-\r
-{ $ F+,S-,W-}\r
-Procedure ModInterrupt; Interrupt;\r
-Begin\r
-  Inc(Count);\r
-  If Count = Speed then\r
-  Begin\r
-    UpDateNotes;\r
-    Count := 0;\r
-  End;\r
-  UpDateEffects;\r
-  If (Count MOD 27) = 1 then\r
-  Begin\r
-    inline ($9C);\r
-    OldTimer;\r
-  End;\r
-  Port[$20] := $20;\r
-End;\r
-{ $ F-,S+}\r
-\r
-Procedure TimerSpeedup(Speed : Word);\r
-Begin\r
-  Port[$43] := $36;\r
-  Port[$40] := Lo(Speed);\r
-  Port[$40] := Hi(Speed);\r
-end;\r
-\r
-Procedure PlayMusic;\r
-Begin\r
-  If Loaded then\r
-  Begin\r
-    TimerSpeedUp( (1192755 DIV 32));\r
-    GetIntVec($8, Addr(OldTimer));\r
-    SetIntVec($8, Addr(ModInterrupt));\r
-    Speed := Header.Tempo[0];\r
-    Playing := True;\r
-  End\r
-  { If the module is not loaded, then the Playing flag will not be set,\r
-    so your program should check the playing flag just after calling\r
-    PlayMusic to see if everything was okay. }\r
-End;\r
-\r
-\r
-Procedure StopMusic;\r
-Var\r
-  I : Byte;\r
-Begin\r
-  If Playing then\r
-  Begin\r
-    SetIntVec($8, Addr(OldTimer));\r
-    For I := 1 to NumChannels do GusSetVolume(I, 0);\r
-  End;\r
-  TimerSpeedUp($FFFF);\r
-End;\r
-\r
-\r
-Procedure Init;\r
-Var\r
-  I : Byte;\r
-Begin\r
-  GusPos := 1;\r
-  Count := 0;\r
-  Speed := 6;\r
-  CurrentPat := 0;\r
-  CurrentEvent := 0;\r
-  For I := 1 to NumChannels do Channels[I].Pan  := (1-(I AND 1)) * 15;\r
-  For I := 1 to NumChannels do GUSVoiceControl(I, 1);\r
-  For I := 0 to 15 do Flags[I] := 0;\r
-End;\r
-\r
-\r
-Var\r
-  I, J : Byte;\r
-\r
-\r
-Begin\r
-  Init;\r
-  Writeln('GUS669 Unit V0.2b');\r
-  Writeln('Copyright 1994 Mark Dixon.');\r
-  Writeln;\r
-End.\r
-\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ PLAY669.PAS ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-Program Testout_Gus669_Unit;\r
-\r
-Uses Crt, GUS669;\r
-\r
-Begin\r
-\r
-  If ParamCount > 0 then Load669(Paramstr(1))\r
-    else\r
-  Begin\r
-    Writeln;\r
-    Writeln('Please specify the name of the 669 module you wish to play');\r
-    Writeln('from the command line.');\r
-    Writeln;\r
-    Writeln('eg :    Play669  Hardwired.669 ');\r
-    Writeln;\r
-    Halt(1);\r
-  End;\r
-  PlayMusic;\r
-  If Playing then\r
-  Begin\r
-    Writeln('Playing ', ParamStr(1) );\r
-    Writeln('Press any key to stop and return to DOS.');\r
-    Repeat\r
-    Until Keypressed\r
-  End\r
-    else\r
-  Begin\r
-    Writeln;\r
-    Writeln('Couldn''t load or play the module for some reason!');\r
-    Writeln;\r
-    Writeln('Please check your GUS is working correctly, and that you have');\r
-    Writeln('correctly specified the 669 filename.');\r
-    Writeln;\r
-  End;\r
-  StopMusic;\r
-End.\r
diff --git a/16/PCGPE10/GUSFAQ.TXT b/16/PCGPE10/GUSFAQ.TXT
deleted file mode 100644 (file)
index 395e204..0000000
+++ /dev/null
@@ -1,1455 +0,0 @@
-\r
-        GRAVIS ULTRASOUND ("GUS") FAQ VERSION 1.50 [94/01/12]\r
-\r
-----------------------------------------------------------------------\r
-\r
-        Certain questions concerning the Gravis UltraSound ("GUS")\r
-sound card are asked over and over on the UltraSound Daily Digest (a\r
-mailing list for GUS users) and on comp.sys.ibm.pc.soundcard.  In an\r
-attempt to alleviate some redundancy from the lives of USENET/Internet\r
-folk, this FAQ (Frequently Asked Questions, with answers) list has\r
-been created.  It is maintained by Matthew Bernold (MEB117@PSUVM.PSU.EDU)\r
-If you have any questions, comments, complaints, or extra cash, (especially\r
-the cash) please feel free to send them to him.  Please do not send your\r
-question more than once, as Matthew does have other things to do aside from\r
-answering FAQ mail.  If you do not get an answer after a month or so, then\r
-there may be a mail problem.  :-)\r
-\r
-        If you would like to join the mailing list and be privy to the\r
-latest and greatest information, banter, and poor spelling concerning\r
-the GUS, mail to <ultrasound-request@dsd.es.com>.  The automated\r
-server will tell you how to sign up for the mailing list, tell you\r
-where the FTP sites associated with the Digest are (they recieve\r
-software updates directly from Gravis often), and other such\r
-information that will eventually lead you down the trail to Nirvana,\r
-Valhalla, Heaven, or whatever Land O' Happiness your religion wants to\r
-get to.\r
-\r
-        BTW: All FAQs, including this one, are available on the\r
-archive site rtfm.mit.edu in the directory pub/usenet/news.answers.\r
-The name under which a FAQ is archived appears in the "Archive-Name:"\r
-line at the top of the article.  This FAQ is archived as\r
-PCsoundcards/gravis-ultrasound/faq.\r
-\r
-        Special thanks are due to many people who helped (and are\r
-helping) with this FAQ.  I won't try to name off people; I'll probably\r
-forget half of you, and you all know who you are, anyway.\r
-\r
-----------------------------------------------------------------------\r
-\r
-        BIG IMPORTANT NOTE: Neither this FAQ, the mailing lists or\r
-digests, nor the FTP sites are owned or operated by Gravis.  Gravis\r
-employees *read* the digest and mailing lists and they upload things\r
-to the FTP sites, but that's it.\r
-\r
-        SO: Please don't email me about problems with your card, if\r
-the latest release of software hasn't arrived on disks in the mail\r
-yet, lack of documentation, etc., etc.  I'm doing this on my own time,\r
-and I have no desire to receive hate mail intended for Gravis.\r
-\r
-----------------------------------------------------------------------\r
-\r
-Index of Questions\r
-------------------\r
-         1] What is the GUS?\r
-         2] How does the GUS emulate other soundcards?\r
-         3] Where can I get a GUS, and how much will it cost?\r
-         4] What version of the GUS hardware is the latest?\r
-         5] What GUS software is available?  What version is it?\r
-         6] Where can I get the latest GUS software?\r
-            (AKA: Where is the GUS FTP site and/or Gravis BBS?)\r
-                6a] What if I don't have FTP access?\r
-         7] What machines will the GUS work with?\r
-                7a] I've heard about problems with the OPTi chipset...\r
-         8] Why should I upgrade the memory onboard my GUS?\r
-         9] Where can I get memory for the GUS, and how much will it cost?\r
-        10] I'm having trouble getting the GUS to work with Windows...\r
-        11] What new hardware is coming out for the GUS?\r
-        12] How do I build the MIDI interface for the GUS?\r
-        13] What exactly is GUS 3D?\r
-        14] What are *.PAT *.VOC *.WAV *.SND *.MOD *.669, and *.MID\r
-                files, and how do I use them?\r
-        15] What exactly is Wavetable Synthesis?\r
-        16] Is there a GUS device driver for Linux/BSD386/*IX?\r
-        17] How do I get the GUS to work with OS/2?\r
-        18] How do I go about programming the GUS?\r
-        19] What are the pinouts for the CD Audio IN on the GUS?\r
-        20] I'm having trouble with... GENERAL TROUBLESHOOTING TIPS\r
-        21] I can't seem to fit the new disks onto a floppy.\r
-        22] Why shouldn't I use the comp.sys.ibm.pc.soundcard.GUS\r
-                newgroup?\r
-        23] What are "Miles Drivers", and how do I use them?\r
-\r
-----------------------------------------------------------------------\r
-\r
- 1] What is the GUS?\r
-\r
-        The Gravis UltraSound (generall referred to as the "GUS") is a\r
-sound card built by Advanced Gravis Technologies (GRVSF on the Nasdaq\r
-exchange).  It is a stereo card that can play 32 synthesized voices\r
-and 32 sampled voices simultaneously.  It is also MIDI compatible.\r
-\r
-        The synthesizer on the GUS is based on a technology called\r
-Wavetable Synthesis (WS) instead of FM synthesis (like the Adlib and\r
-Soundblaster series).  WS is flexible enough to emulate FM synthesis,\r
-and so an emulator has been created so SoundBlaster and Adlib programs\r
-can use the GUS (see question #2).\r
-\r
-        The GUS, in its basic state, can sample 8 bit stereo at 44kHz.\r
-It can playback 16 bit stereo samples at 44kHz.  There is a\r
-daughterboard that you can buy (to be released) and plug on to the GUS\r
-that makes it possible to sample at 16 bit stereo 44kHz.\r
-\r
-        Each voice can play independantly, but as the maximum number\r
-of voices goes up, the sample playback rate drops.  With 14 active\r
-voices, the GUS can playback at 44100Hz.  At 28 active voices, the\r
-playback rate drops to 22050Hz.  With the maximum 32 voices, the GUS\r
-can playback at a rate of 19293Hz.  Following is a chart taken from the\r
-GUS SDK v2.01 listing the number of active voices and the playback rate.\r
-\r
-  Active   Playback    Active   Playback    Active   Playback\r
-  voices     rate      voices     rate      voices     rate\r
-    14      44100        21      29400        27      22866\r
-    15      41160        22      28063        28      22050\r
-    16      38587        23      26843        29      21289\r
-    17      36317        24      25725        30      20580\r
-    18      34300        25      24696        31      19916\r
-    19      32494        26      23746        32      19293\r
-    20      30870\r
-\r
-        If you tell the GUS to play at a different rate than listed\r
-above, the GF1 processor automatically interpolates the sample, and\r
-simulates playback at the desired rate.\r
-\r
-        Each voice also has 15 panning positions, and 4096 settings of\r
-volume.  The GUS has automated volume-ramping that can be used as\r
-one-shot or oscillating volume modulators.  Thus, amplitude envelopes\r
-use very little CPU horsepower.  For more technical information, read\r
-the GUS SDK (see question #24).\r
-\r
-        The GUS has the following "external" ports:\r
-        o Stereo line in\r
-        o Stereo line out\r
-        o Stereo amplified out\r
-        o Stereo microphone in\r
-        o Game port / MIDI port\r
-\r
-        The GUS has several "internal" ports, including:\r
-        o CD Audio IN\r
-        o Expansion ports for daughtercards (see question #15).\r
-        o Other as of yet unexplained pins/ports.\r
-\r
-        The game port can be changed to MIDI in/out/through ports by\r
-means of an adapter available from Gravis.  Alternatively (and for a\r
-LOT less money) you can build your own (see question #17).\r
-\r
-----------------------------------------------------------------------\r
-\r
- 2] How does the GUS emulate other soundcards?\r
-\r
-        Right now, there are several ways the GUS may emulate other\r
-soundcards/soundcard combinations.  Following is a list of combinations\r
-that the GUS may emulate, and the program to be used for this emulation:\r
-\r
-        Sound Blaster/Adlib        SBOS\r
-        Roland/SB Digital          MegaEm\r
-        General MIDI/SB Digital    MegaEm\r
-\r
- (* Insert info about lists here *)\r
-\r
-\r
-----------------------------------------------------------------------\r
-\r
- 3] Where can I get a GUS, and how much will it cost?\r
-\r
-        The "suggested retail" for the card is $200 (U.S. dollars),\r
-but if you pay that much, you haven't done your homework.  However,\r
-homework on this card isn't easy because Gravis still hasn't actually\r
-advertised (they have a weird policy concerning advertising).\r
-\r
-Here are some mail order places that supposedly carry the GUS.  Since\r
-prices tend to change faster than FAQs, I am not posting prices.  For\r
-our non-american users, there are some FAX or non-800 numbers as well.\r
-\r
-Vendor                 800 Number          FAX             Voice\r
-Zeroes & Ones        1-800-788-2193   1-702-897-1571\r
-Disk-Count Software  1-800-448-6658   1-908-396-8881   1-908-396-8880\r
-Mission Control      1-800-999-7995   1-201-677-9484   1-201-677-1400\r
-Bit Wit Software     1-800-259-2453   1-214-306-9603   1-214-539-5473\r
-Viking Software      1-800-852-6187   1-404-840-7925\r
-Chips & Bits         1-800-753-4263   1-802-767-3382   1-802-767-3033\r
-Computer Express     1-800-228-7449   1-508-443-5645\r
-\r
-        If you call around, you should have no trouble getting the GUS\r
-for less than $150.  Suggested places are Babbages, Bizmart, OfficeMax,\r
-and Disk-Count software.\r
-\r
-----------------------------------------------------------------------\r
-\r
- 4] What version of the GUS hardware is the latest?\r
-\r
-        This is a question that is actually pretty irrelevant.  Yes,\r
-there have been different "releases" of the GUS card (the number is\r
-etched into the board), but there really aren't any differences.\r
-Evidently, some of the newer cards have been redesigned to require\r
-less hardware (and less cost to Gravis), but no functionality changes\r
-have been made.\r
-\r
-        Also, the newest versions of the GUS (v3.4+) have volume\r
-control on some of the inputs, and adds an on/off and volume control\r
-on the CD input.  The new windows mixer takes advantage of this.\r
-If you have an older GUS, the mixer just grays out the volume sliders.\r
-\r
-----------------------------------------------------------------------\r
-\r
- 5] What version of the GUS software is the latest?\r
-\r
-\r
-    Title       Ver    Filename   Where?\r
-    ---------  -----   ---------  -------\r
-    Install    2.06L              GUS FTP\r
-               2.06               Mailed\r
-    SBOS       3.4                GUS FTP\r
-    MegaEm     2.02               GUS FTP\r
-\r
-----------------------------------------------------------------------\r
-\r
- 6] Where can I get the latest GUS software?\r
-    (AKA: Where is the GUS FTP site and/or Gravis BBS?)\r
-\r
-GUS FTP sites:\r
-        archive.epas.utoronto.ca              /pub/pc/ultrasound\r
-        wuarchive.wustl.edu            /systems/ibmpc/ultrasound\r
-        archive.orst.edu                    /pub/packages/gravis\r
-        theoris.rz.uni-konstanz.de                /pub/sound/gus\r
-        nctuccca.edu.tw                           /PC/ultrasound\r
-\r
-GUS Mailserver:\r
-        mail-server@nike.rz.uni-konstanz.de\r
-\r
-        BTW: You can get a LOT more than just GUS software releases\r
-from Gravis on the FTP sites.  There's lots of PD software written\r
-specifically for the GUS, music (midi music, midi patches, mods, 669\r
-music, samples, etc., etc), tech info on the card, back issues of the\r
-UltraSound Daily Digest, etc., etc... check it out!\r
-\r
-Gravis BBS:\r
-        (604) 431-5927\r
-\r
-6a] What if I don't have FTP access?\r
-\r
-        Use the GUS Mailserver!\r
-\r
-        Send mail to mail-server@nike.rz.uni-konstanz.de with the body\r
-of the message as follows:\r
-\r
-        begin\r
-        send help\r
-        end\r
-\r
-        Alternatively, you can call the Gravis BBS.  There are several\r
-major disadvantages with this, though:\r
-\r
-        1] Long distance to Canada (no offense to you Canadians :).\r
-        2] 2400 baud.\r
-        3] The BBS doesn't have all the public domain stuff that\r
-                the FTP sites do.\r
-        4] It's almost *always* busy.\r
-\r
-        Please *DO NOT* ask people to post binaries to\r
-comp.sys.ibm.pc.soundcard.  It's not a binary newsgroup, and that's a\r
-lot of wasted bandwidth to people who don't want the programs.  Use\r
-email.  It saves bandwidth, fights cavities, and builds character.\r
-\r
-----------------------------------------------------------------------\r
-\r
- 7] What machines will the GUS work with?\r
-\r
-        You need an IBM compatible computer with at least a 286\r
-processor.  It needs to be at least a 386 if you want to use the GUS\r
-with Windows.\r
-\r
-7a] I've heard about problems with the OPTi chipset...\r
-\r
-        There have been troubles with the GUS if your computer's\r
-chipset is made by OPTI.  Not all OPTI chipsets are bad, but some of\r
-them have a faulty DMA controller.  We're still trying to pin down\r
-which chipsets are flawed; when we have a better idea of exactly which\r
-ones are bad they'll be added here.  Until then, be careful if your\r
-computer has an OPTI set, and try reading the UltraSound Daily Digest,\r
-or comp.sys.ibm.pc.soundcard on USENET.\r
-\r
-Written by: dantonio@magick.tay2.dec.com\r
-        Actually, it's not just OPTi chipsets, UMC has been implicated\r
-as well (Gravis first noticed the problem with UMC chipsets) and\r
-according to Digital Audio Labs (who told Gravis what was going on),\r
-the bad datacode is 9149 and the bad chip is the 82C206.  This is all\r
-explained in the docs for GUS0013.ZIP (I think), the OPTi fix posted\r
-to the GUS FTP sites.\r
-\r
-----------------------------------------------------------------------\r
-\r
- 8] Why should I upgrade the memory onboard my GUS?\r
-\r
-        For starters, the announcement has already come out of Gravis\r
-that the standard GUS will come with 512k instead of 256k.  This means\r
-that software companies will write their programs to use *at least*\r
-512k onboard the GUS.  And with all the users going to 1meg, chances\r
-are that things will be written for that limit.\r
-\r
-        It's a cheap upgrade.  If your board came with 256k, it will\r
-only cost you about $30 to go up to 1meg (see question #10).\r
-\r
-        There's already a lot of MIDI files out there that require the\r
-full 1meg to play them, because they use lots of different instrument\r
-patches.\r
-\r
-        If you plan on doing any sampling, you'll need the space.  You\r
-can do direct-to-disk sampling, but it can cause "skips" to go into\r
-the sample each time the sample goes down the bus to the drive.  In a\r
-worst case situation, you could be sampling 16 bits in stereo at\r
-44kHz.  So, you're doing 88000 samples (stereo, remember) of 16 bits\r
-each every second.  That's 171k (176000 bytes) every second, which\r
-means the full 1meg memory will fill up in 5 seconds at that rate.\r
-With only 256k, you can get about 1.5 seconds.\r
-\r
-        Of course, only people doing very serious stuff with the card\r
-need to sample at that high of a rate in 16 bits.  MOD files generally\r
-do 16kHz 8 bit mono samples.  But upgrading the card is still pretty\r
-important in that case... do the math, and you'll see.\r
-\r
-----------------------------------------------------------------------\r
-\r
- 9] Where can I get memory for the GUS, and how much will it cost?\r
-\r
-        You need six 256x4 DRAM chips, with speeds of 80ns or better\r
-(in other words, 80ns OR LESS).  They tend to run about $4 a piece, so\r
-the total price will be $24 + shipping.  Make sure you ask for\r
-"page mode" ram, or they will not work correctly with your GUS.\r
-\r
-        To find  a  place with them, just  look through  the  Computer\r
-Shopper magazine.  Check the index for  'memory' and call a few places\r
-for prices.  (After a little calling, I found a place selling them for\r
-$3.45 apiece.)\r
-\r
-        To ensure compatibility, look for the number "44256" in the\r
-chip number.  If you do not see this number, you probably do not have\r
-the right chip.\r
-\r
-        NEW NOTE: Gravis is now offering to sell the chips directly to\r
-you for a much lower cost (they can buy in bulk).  Give them a call\r
-for latest chip prices.\r
-\r
-----------------------------------------------------------------------\r
-\r
-10] I'm having trouble getting the GUS to work with Windows...\r
-\r
-        There in one possibility that accounts for about 50% of the\r
-problems people have with the GUS and Windows: you can't have SBOS\r
-loaded before going to Windows.  (You don't need it... if the Windows\r
-program was written right, Windows will handle the link to the card;\r
-the program shouldn't care.)  Try running ULTRINIT (it clears the GUS'\r
-program memory), or rebooting.\r
-\r
-        Other problems:\r
-\r
-(a) No sound at all in Windows...\r
-\r
-Written by: dantonio@magick.tay2.dec.com\r
-        People often put ultrasnd.ini into \windows\system which they\r
-shouldn't.  They SHOULD put \ultrasnd\windows\midimap.cfg into\r
-\windows\system to get the MIDI stuff setup correctly.\r
-\r
-(b) I'm not getting any sound when I play MIDI files under Windows.\r
-        The Patch Manager shows empty boxes.\r
-\r
-Written by: bs@mda.ca (Bruce Sharpe)\r
-        You need a file  called ULTRASND.INI.  You  can find this file\r
-in any one of the following places:\r
-\r
-        1. The v2.06 distribution disk set.\r
-        2. One of the GUS FTP sites.\r
-        3. The Gravis BBS.\r
-        4. CompuServe: GO PCVENB, Library 14, name is ULTSND.INI\r
-                (rename it to ULTRASND.INI after downloading).\r
-\r
-        ULTRASND.INI must be placed in the directory pointed to by the\r
-environment variable ULTRADIR (usually C:\ULTRASND).  It does *not* go\r
-into the WINDOWS or WINDOWS\SYSTEM directory.\r
-\r
-        Even if you have an ULTRASND.INI in your ULTRADIR directory,\r
-look at it.  It should have many lines in it saying things like\r
-"0=acpiano".  If it is only a few lines long, get another copy and put\r
-it into the ULTRADIR directory.  Reboot Windows and you will soon be\r
-hearing beautiful music!\r
-\r
-        (The purpose of the ULTRASND.INI file is to let the Windows\r
-driver know what patch file goes with what patch number.  If the\r
-driver doesn't find the .INI file in the ULTRADIR directory it creates\r
-a truncated version with no patch names in it.)\r
-\r
-(c) All the list boxes are blacked out in the UltraSound Patch\r
-        Manager.\r
-\r
-Written by: bs@mda.ca (Bruce Sharpe)\r
-        This was a problem that was fixed in v1.02.  It only occurs in\r
-certain Windows color schemes (e.g., Ocean).  If you can't get your\r
-hands on a more recent PatchManager, then change your color scheme.\r
-\r
-(d) Other general Windows/GUS problems.\r
-\r
-Written by: john.smith@gravis.com (John Smith)\r
-        At least one major problem people have been having with the\r
-new release has been solved.  Many thanks to Fransisco Perez. He\r
-noticed that he had a grvsultr.386 file in his \windows directory and\r
-it was NOT the new one.  Apparently, windows looks in the path and\r
-uses the first one that it finds. It should have gotten the one in the\r
-windows\system directory. Using the old one with the new patches etc.\r
-causes SERIOUS problems. The old install software required the user to\r
-copy some things manually and some people put the files in the windows\r
-directory instead of the windows\system directory.  The new install\r
-will install windows automatically and puts the files in the\r
-windows\system directory.  To correct the problem, make sure the\r
-following files are in your windows\system and ultrasnd\windows\r
-directory ONLY!!!  If you find them anywhere else, you should remove\r
-them....\r
-\r
-\r
-...\windows\system\\r
-    grvsultr.386                     <\r
-    midimap.cfg                      < These files are also located\r
-    ultmport.drv                     < in the UltraSnd\Windows\r
-    ultrasnd.drv                     <\r
-\r
-...\ultrasnd\\r
-    ultrasnd.ini\r
-\r
-...\ultrasnd\windows\\r
-    ultrasnd.ini\r
-    oemsetup.inf\r
-    mixer.exe\r
-    patchmgr.exe\r
-    patchmgr.hlp\r
-    ultrahlp.hlp\r
-\r
-        Some of you have been trying to re-run the automatic Windows\r
-install simply by running WINGUS from your UltraSound\Windows\r
-directory.  The problem with this is WINGUS is looking for an install\r
-script file that has an extension of .INF.  The first file it\r
-encounters is OEMSETUP.INF, which it trys to execute but because this\r
-is NOT a script file you will get MANY error messages.  Try renaming\r
-OEMSETUP.INF to OEM.TMP then run WINGUS.  WINGUS will then see WIN.INF\r
-and load that instead.\r
-\r
-----------------------------------------------------------------------\r
-\r
-11] What new hardware is coming out for the GUS?\r
-\r
-Ed. Note: I know this list is out of date, but I don't have anything\r
-          better/more up to date, so I'm leaving it.  If you have\r
-          some more recent info, let me know, and I'll put it in here.\r
-\r
-Written by: Bruce Sharpe (bs@mda.ca)\r
-\r
-   -------------------------------------------------------------------\r
-   | Advanced Gravis Product Support BBS      Pricing & Availability |\r
-   -------------------------------------------------------------------\r
-   |                Item                           When?    SRP($US) |\r
-   -------------------------------------------------------------------\r
-   | MIDI Connector Box                        |  Apr '93  |  $49.95 |\r
-   | 16-bit Stereo Recording Interface Card    |  Apr '93  | $149.95 |\r
-   | LMSI CD-ROM Daughter Card for CM205 and   | Qtr 1 '93 |  $59.95 |\r
-   |  and CM215 (Phillips, Magnavox, LMSI)     |           |         |\r
-   | Sony CD-ROM Daughter Card for Sony 31A    | Qtr 1 '93 |  $49.95 |\r
-   | Mitsumi CD-ROM Daughter Card              | Qtr 1 '93 |  $49.95 |\r
-   | SCSI CD-ROM Daughter Card                 | Qtr 1 '93 |   TBA   |\r
-   -------------------------------------------------------------------\r
-\r
-Details?  Good question.\r
-\r
-----------------------------------------------------------------------\r
-\r
-12] How do I build the MIDI interface for the GUS?\r
-\r
-Written by: pcunnell@micrognosis.co.uk (Paul Cunnell)\r
-\r
-> Has anyone made the midi interface for the GUS that is in the FAQ?\r
-> If so, were did you find the part# 6N138?  I cant seem to locate\r
-> this anywhere.  Also, (excuse my ingorance i'm not an EE) but\r
-> what exactly is that part and its purpose? Thanks...\r
-\r
-        The 6N138 is a high sensitivity opto-isolator, manufactured by\r
-Hewlett Packard (and I believe, a company called Quality Technology)\r
-The main point in using this part as opposed to other more common\r
-opto-isolators is the low LED ON current spec. (1.6mA)\r
-\r
-        A midi out circuit is basically a LED in series with 600 ohms,\r
-and a 5V supply. Taking into account the 1.7V forward drop across the\r
-LED, you get about 5mA in the on state.  Other optos generally need\r
-more current to turn them on (say 15-60mA, but this varies a lot). A\r
-'high speed' 6N137 opto will also work, I believe, but that would be a\r
-bit marginal on the input current (spec. is min 5mA).\r
-\r
-        Since a number of people have been asking, I'll add below the\r
-midi circuit that I'm using, plus a bit of general explanation I've\r
-culled from other peoples' postings on the subject.\r
-\r
-Generic Midi Out/In/Through Circuit\r
-===================================\r
-\r
-The following shows a typical OUT, cable, and IN circuit\r
-\r
-      MIDI OUT port ---->|<- cable ->|<---- MIDI IN port              +5V\r
-                                                                 270   |\r
-            +5V        DIN           DIN                     +--\/\/\/-+\r
-             |  220    +-+ +-------+ +-+   220    +--------+ |\r
-        |\   +-\/\/\/--|4|-|-------|-|4|--\/\/\/--|  OPTO  |-+-+- UART RXD\r
- UART   | \            | | |       | | |          |ISOLATOR|   |\r
- TXD ---|  \---\/\/\/--|5|-|-------|-|5|----------|        |-+ |\r
-        |  /    220    | | +-------+ | |          +--------+ | |\r
-        | /         +--|2|-+       +-|2|            6N138   GND|\r
-        |/ 7407     |  +-+           +-+                       |\r
-                   GND                                         |\r
-                                                               |\r
-                   +-------------------------------------------+\r
-                   |\r
-                   |      +5V        DIN\r
-                   |       |  220    +-+\r
-                   |  |\   +-\/\/\/--|4|\r
-                   |  | \            | |\r
-                   +--|  \---\/\/\/--|5|   MIDI THRU\r
-                      |  /    220    | |\r
-                      | /         +--|2|\r
-                      |/ 7407     |  +-+\r
-                                 GND\r
-\r
-        Note that when the UART TXD is high, no current flows through\r
-the resistors and optoisolator's LED, causing the optoisolator's\r
-phototransistor to remain off, allowing the UART RXD to be pulled high\r
-by the 270 ohm resistor.  When the UART TXD is low, current flows\r
-through the resistors and optoisolator's LED, turning on\r
-optoisolator's phototransistor, grounding the UART RXD.  The voltage\r
-drop across the optoisolator's LED is typically 1.5 volts, leaving 3.5\r
-volts to be dropped across (3 times 220) 660 ohms, which allows about\r
-5 ma to flow.\r
-\r
-        The reason a current loop is used is that it allows an ground\r
-isolated interconnection.  Note that the ground from the MIDI OUT\r
-port's device is not connected to the ground of the MIDI IN port's\r
-device.  This prevents ground loops in systems where appropriate\r
-attention has not been paid to grounding issues, such as the case of\r
-typical musicians in a typical club!\r
-\r
-Gravis Ultrasound Circuit\r
-=========================\r
-\r
-15 pin D connector\r
-                                          220R\r
-pin-1 +5v ----+--------------------------/\/\/\---------------\\r
-              |                                                \ 4\r
-              |                                          Gnd--2   MIDI OUT\r
-              |      |\      |\            220R                / 5\r
-pin-12 tr >---|------| o-----| o----------/\/\/\--------------/\r
-              |    13|/ 12 11|/ 10\r
-              |                            220R\r
-              +---------------------------/\/\/\-------------\\r
-              |                                               \ 4\r
-pin-15 rx <---|--------------------+                    Gnd--2    MIDI THRU\r
-              |      |\      |\    |        220R              / 5\r
-              |   +--| o-----| o---+-------/\/\/\------------/\r
-              |   | 1|/ 2   3|/ 4\r
-              |   |\r
-              |   +------+\r
-              |   270R   |                       220R\r
-              +--/\/\/\--+    +------+----------/\/\/\--------\\r
-              |B         |C   |A     |                         \  4\r
-            +-|----------|----|-+    |                             MIDI IN\r
-            |  8        6     2 |  -----                       /  5\r
-            |                   |   / \ IN914 or IN4148     +-/\r
-            |      6N138        |   ---                     |\r
-            |                   |    |                      |\r
-            |           5     3 |    |                      |\r
-            +------------|----|-+    |                      |\r
-                         |    |K     |                      |\r
-pin-5 Gnd  --------------+    +------+----------------------+\r
-\r
-        Inverters are 74LS04. (This is a 14-pin IC containing 6\r
-inverters.  Connect pin 14 to +5V, pin 7 to GND)\r
-\r
-        Leave pin 2 of the MIDI IN unconnected (Don't connect to ground).\r
-\r
-Some hints for testing your circuit\r
-===================================\r
-\r
-        1] Check *all* connections (use a continuity tester, and tick\r
-them off on a printout of the circuit).\r
-\r
-        2] Check them again ;-)\r
-\r
-        3] Make sure you have the latest (GUS0012.zip) windows midi\r
-driver, and make sure it is installed properly.\r
-\r
-        4] Make sure your midi sequencer package is set up to use the\r
-Ultrasound Midi In/Out ports. (As opposed to the Ultrasound Synth)\r
-\r
-        5] If you still have no joy,\r
-\r
-                a] Just connect the +5V and GND to your midi circuit,\r
-        (leave the d-connector pins 12 and 15 unconnected), and then\r
-        connect pin 13 of the 7404 to +5V check you have (about) +5V\r
-        appearing on pin 10.  This checks midi out.\r
-\r
-                b] Connect pin 4 of the midi-in DIN socket via 2 extra\r
-        220R resistors to +5V.  Check pin 4 of the 7404.  It should be\r
-        low (about 0V).  Then connect pin 4 of the midi-in DIN socket\r
-        to 0V.  Pin 4 of the 7404 should go high.  This checks midi in.\r
-\r
-                c] Reconnect the d-type pins 12 and 15, and connect a\r
-        midi cable between midi-out on the circuit and and midi-in on\r
-        your synth.  Set up your sequencer to use the Ultrasound MIDI\r
-        port as an output, and ensure that one of the tracks is set to\r
-        use this port.  Check your synth is expecting MIDI data on the\r
-        same channel as sequencer is transmitting.  Start sequencer\r
-        playing.  Check that midi data is being transmitted at pin 12\r
-        of the d-type (look at it with an oscilloscope, if possible).\r
-\r
-Note\r
-====\r
-\r
-        Standard disclaimers apply - use this information at your own\r
-risk, and if your fry your card/PC/synth/toaster, then you have my\r
-sympathy, but not much else ;-)\r
-\r
-        If you're not happy about messing with circuits and soldering\r
-irons and wires and stuff, then you may wish to wait for the midi\r
-connector box from Gravis to become available.\r
-\r
-        I notice that in the older FAQs, there is a description (from\r
-Dustin Caldwell <DUSTIN@gse.utah.edu>) of the solder side pinout for a\r
-15-pin D-type connector. This looks wrong to me. I have a 15-pin male\r
-d-type in from of me, and it looks like this from the solder side\r
-(i.e. the side you attach the wires to, rather than the side with the\r
-pins that plugs into the card):\r
-\r
-                    Gnd             +5V\r
-         8   7   6   5   4   3   2   1\r
- +-----/-------------------------------\-----+\r
- |     \ o   o   o   o   o   o   o   o /     |\r
- | ( )  \                             / ( )  |\r
- |       \ o   o   o   o   o   o   o /       |\r
- +--------\-------------------------/--------+\r
-           15  14  13  12  11  10  9\r
-           Rx          Tx\r
-\r
-        It is easy to get the pins confused on these connectors - the\r
-female version seen from the solder side of course has everything the\r
-other way around (pin 1 is on the left hand side).\r
-\r
-        Hope this helps (or at least doesn't add to the confusion :-).\r
-All reasonable quality D-type connectors have pin numbers marked\r
-against the pins anyway.\r
-\r
-----------------------------------------------------------------------\r
-\r
-13] What exactly is GUS 3D?\r
-\r
-        First and foremost: YES, this is SOFTWARE.  You will NOT need\r
-to upgrade your GUS to be able to do the GUS-3D stuff.\r
-\r
-Written By: dionf@ERE.UMontreal.CA (Francois Dion)\r
-\r
-        There are several systems that are in use to get 3D sounds on\r
-recordings and some have been around since the 50s. Now i wont go into\r
-the "how it works" of the more recent ones, but i think this will\r
-clear up some confusion.  The first part is a "hands-on" experiment,\r
-the second is informations, including the address and phone of the\r
-owner of the technology that is used with the Gravis Ultrasound.\r
-\r
-        Let's get back to the early days of stereo. One record company\r
-(i cant seem to remember) was pushing it, while another (again, blank.\r
-anyone?)  competed.  Interestingly enough, technological development\r
-was put on stereo, and not on the first 3D system which was called\r
-"binaural recording" and it simply consisted of two microphones placed\r
-like the ears. You can try it this way:\r
-\r
-        Go to a hat store and buy an extruded foam mannequin head.\r
-You'll then need two microphones. Condenser will do, but you will need\r
-to power them if you want to use them with the GUS, since it take a\r
-dynamic microphone because it does not supply phantom power like some\r
-mixer with XLR plugs. I will post a circuit later for Radio-shack\r
-condenser mike unit (a small element that cost about 2$) if there is\r
-some interest. If you dont want to mess with that, go with a cardiod\r
-dynamic element.  Note that sensitive enough cardiod will cost you a\r
-lot, so think about that.  You cut holes in the ears of the head, to\r
-insert the microphone units (dont forget to make the wires of the\r
-elements go inside the head and out the rear (or wherever). Use glue\r
-to fill the crack around the mic.  Also, the more the ears look like\r
-real ears, the better it will work. If you trim the foam, dont forget\r
-to use an hairdryer to soften it (it will be more uniform). That's it.\r
-Try recording sounds, and you'll be surprised.  I was! I did the\r
-experiment with a polystyrene head on which i incrusted two PZM\r
-microphones.\r
-\r
-        Now that you understand how 3D recording is nothing like\r
-stereo recording, we'll see what is accesible presently.\r
-\r
-        First, the gadget we just built in the previous section exist\r
-commercially, and is called "Mikey" and is made by Spherical Sound.\r
-It's the only system commercialised where the microphones are placed\r
-in a head.\r
-\r
-        Another system is made by Virtual Audio and claims to enhance\r
-stereo depth, but is not labeled 3D audio. I dont have much more info\r
-on it, but from the description it looks like the same thing as the\r
-"mikey".\r
-\r
-        Two other systems use less restraining microphones situation\r
-and can also be used on any signal because a DSP simulate a 3D signal\r
-from parameters entered on the machine.  QSound (no hyphen) was\r
-developped in Quebec, and the inventor sold the concept to another\r
-company (Archer it seems). It is not that good even with electrostatic\r
-headphones, and is pretty bad if you are listening to it thru speakers\r
-and you are not in the sweet spot. And for trivia: Madonna, Sting,\r
-Wilson Phillips and Paula Abdul to name a few have used the QSound on\r
-their latest recordings. Another trivia: The Q logo is very very close\r
-to Hydro-Quebec logo... QSound cost around 18K$ and is not midi\r
-controllable.\r
-\r
-        The other variant with a DSP is Roland RSS (Roland Sound\r
-Space). It is a bit better (depending on how it is used) than QSound\r
-with headphones, but suffers the same faith as QSound when you are\r
-listening with speakers. Just move a bit from the sweet spot, and\r
-suddenly what was in front left is now back left. RSS was used on\r
-Suzanne Cianni _Hotel Luna_ album.  RSS cost around 40K$ and is midi\r
-controllable.\r
-\r
-        Another system on which i have zero information is called\r
-Audio Cybernetics.\r
-\r
-        The last technology is called Focal Point 3D Audio. It was\r
-developped by Bo Gehring and first used on the Macintosh computers\r
-with a modified Audiomedia (Digidesign). It cost around 1400$ in this\r
-configuration. But, Gravis saw that (Focal Point is from Seattle) and\r
-it is the system that we will be getting. At a much better price. The\r
-system produce the sounds with these parameters: direction, elevation\r
-and distance.  I am pretty sure that Gravis will have to develop a\r
-SYSEX command set. We already need it badly, but with 3D, i will shoot\r
-myself if i cant control it thru sysex.\r
-\r
-        By the way, here's how to get in touch with Focal Point 3D\r
-Audio, if you're interested.\r
-\r
-        Focal Point(tm) 3D audio\r
-        1402 Pine av., #127\r
-        Niagara Falls, NY 14301\r
-        Voice/fax: 1-416-963-9188\r
-\r
-        Ok, you have read the 3D thing, and you cant wait. You want\r
-big sound. The only possibility for now is surround. Now surround cost\r
-a lot of money, and it will not be useable anymore once you get the 3D\r
-driver. Wrong.\r
-\r
-        Now, i hope you have an amplifier, cause if you dont, you\r
-can't use this little hack to get surrounding sound. WARNING: i am not\r
-responsible for any damage resulting from the use or misuse or\r
-anything else related to this circuit.  Check that your - posts are\r
-connected to ground and not the +. If it's the case reverse the\r
-connections to the amplifier.\r
-\r
-        It works surprisingly well considering the cost. Have fun!\r
-\r
-  | Amplifier |\r
-  | + -   - + |   You connect the front speakers as usual (dont mixup\r
-   /| |   | |\    the polarities!)          _\r
-  | |_|   |_| |   FLS: Front left speaker (/_\)\r
-  | /_\   /_\ |   FRS: Front right speaker\r
-  | FLS   FRS |   R: variable pot 50 ohm. 10 watts or more (depends on\r
-  |_         _|      the amplifier)\r
-  > |       | <\r
-  ><'R     R'><    RLS: Rear left speaker (use a much smaller speaker\r
-  >           <         for rear than front. 8 ohm also.)\r
-  | RLS   RRS |    RRS: Rear right speaker (")\r
-  |  _     _  |\r
-  | \_/   \_/ |    the 2 - on front speakers are connected to the\r
-  |_/ \_._/ \_|    ground of the amplifier internally, so you dont\r
-   +   -|-   +     have to connect them.\r
-        |_\r
-        > |\r
-        ><'R\r
-        >          Here, you do need to connect the 2 - thru R to the\r
-       _|_         amplifier ground.\r
-        -  AMP GND\r
-\r
-        Put the 3 potentiometer in a box so that you have the control\r
-in one place, and use enough wire so you can move with it. You'll have\r
-to experiment so that the R going to ground is a little higher than\r
-the other 2 and once that adjusment made, the other two must be\r
-adjusted so that the rear speakers are just adding a touch of depth\r
-(if you turn them off, you notice that the surround is gone). Also, if\r
-you have A-B speaker selection, plug the rear speakers on the + of B\r
-instead of A, you will then be able to switch them off easily.  Of\r
-course, when you will use the 3D audio, it will affect the signal, so\r
-it's better to unplug the rear section.  But for your video, tape, CD\r
-and regular GUS, you will still find it cool.\r
-\r
-----------------------------------------------------------------------\r
-\r
-14] What are *.PAT *.VOC *.WAV *.SND *.MOD *.669, and *.MID files, and\r
-        how do I use them?\r
-\r
-Written by: Matthew E. Bernold <MEB117@PSUVM.PSU.EDU>\r
-\r
-        These are all different types of sound files.\r
-\r
-        *.PAT files are GUS instrument files, or PATCH files.  These\r
-files are what your GUS uses to recreate the various instruments it is\r
-capable of playing.  Your .PAT files should be in your /ULTRASND/MIDI\r
-and /ULTRASND/SBOS directories.\r
-\r
-        *.VOC and *.WAV files are basic digital sound files with\r
-headers.  The *.VOC files are used on the soundblaster, and the *.WAV\r
-files are used by Microsoft Windows.  Players capable of using these\r
-formats can read information on sampling rate, 8 or 16 bit, and\r
-mono/stereo from the header of these files.  *.WAV files can be played\r
-in MS Windows by many programs.  *.VOC files can be converted to *.WAV\r
-by many different programs, including SOX which is available via FTP.\r
-The latest version (7.0) has been ported to PC clones and can be found\r
-on the GUS FTP sites.\r
-\r
-        *.SND files are raw sound files with no header information.\r
-This is the format currently used by the GUS.  This means that you\r
-have to tell the player program about the sample, because the\r
-information on how to play it is NOT in the file, like with the *.VOC\r
-or *.WAV files.  You can play these files using PLAYFILE which came\r
-with the GUS.\r
-\r
-        *.MOD files are 4-voice 15 or 31 instrument music files which\r
-originated on the Amiga.  They use 8-bit, 16kHz samples to produce the\r
-instruments, and note information to play the songs.  *.MOD files are\r
-similar to MIDI files, but they are a bit more flexible because you\r
-can use any sample as an instrument (including voices and sound\r
-effects) instead of relying on the MIDI synth's own built in\r
-instruments.  You can play these files using GUSMOD which can be found\r
-on epas.\r
-\r
-        *.669 files are 8-voice music files.  I don't know much about\r
-them, so maybe Tran (author of the GUS 669 player) can fill in this\r
-area.  You can play these files using P669GU0 which can be found on\r
-epas.\r
-\r
-        *.MID files are MIDI files.  You can play these files with\r
-PLAYMIDI that came with the Ultrasound package, or with MediaPlayer in\r
-MS Windows.  You might have to create a *.cfg file for the MIDI file\r
-if it was originally created for a synth that does not conform to the\r
-GM Midi standard.\r
-\r
-----------------------------------------------------------------------\r
-\r
-15] What exactly is Wavetable Synthesis?\r
-\r
-Written By: dionf@ERE.UMontreal.CA (Francois Dion)\r
-\r
-        It is easier to find the Holy Grail than to find a text\r
-describing precisely what synthesis method the GUS uses, so it's time\r
-i take a shot at it. For this text i have searched thru ftp archives\r
-troughout the world, have asked info from Ensoniq, Roland,\r
-TurtleBeach, Advanced Gravis, Forte Creative Labs and i also took into\r
-account the numerous comments, praise and flames i received to model\r
-the text. Since this text is a result of a collective internet and\r
-industry wisdom, flames will go the way of /dev/nul.  And please, read\r
-the text carefully, because i have received some comments from people\r
-who were thinking i wrote something when in fact i wrote the opposite\r
-(particularly from non anglophones).\r
-\r
-        You probably have heard about the GUS beeing a wavetable\r
-soundcard.  I have received some comments that the GUS is not such a\r
-thing, but since the industry uses this term (i.e. CL waveblaster,\r
-GUS, TB multisound etc...), i am not in a position to create confusion\r
-by renaming the technology.  Wavetable explains perfectly what it is.\r
-A table containing a waveform.\r
-\r
-        The GUS uses the third generation of wavetable synthesis, so\r
-before i start explaining it, i'll talk about the first two\r
-generations first.\r
-\r
-        The first generation of wavetable synthesis was actually a\r
-_digitally_ controlled _analog_ oscillator(s) where parameters\r
-controlling the waveform were kept in memory. The curtis based synths\r
-and some others are directly derived from this concept.\r
-\r
-        The second generation of wavetable synthesis uses a digital\r
-oscillator, with the waveform held in memory in it's basic form (one\r
-period usually).  Parameters to alter the oscillator behaviour are\r
-also in memory.  I use the general term "memory" instead of RAM,\r
-because in some case it's actually ROM, FlashROM, PROM, EPROM,\r
-switches, buffers etc... The Ensoniq chip found in the Macintosh Plus\r
-is an example (8 bit, 4 oscillators, 4096 byte wavetable).\r
-\r
-        The third generation of wavetable synthesis which can be found\r
-in two flavors (RAM or ROM) is based on the second generation, but\r
-uses bigger wavetables to hold the waveform (either in single period\r
-or multi period format) including this time the attack and release. In\r
-this section, i will focus only on the GUS implementation, which\r
-basically encompass all other implementations.  Basically, what you\r
-have are 32 oscillators which can do the exact same thing, and be\r
-programmed separately and/or simultaneously. What the hardware can do\r
-without the operating system is not too important here since we are\r
-looking at what the GUS _can_presently_do_ (with modifications to the\r
-OS, the GUS could do pretty much any synthesis method one can dream\r
-up), not what it would have done if the OS wasn't available.  Of\r
-course, more processing done in hardware means more CPU cycles left\r
-for other things.\r
-\r
-        So in the GUS, you have some RAM (up to 1Mb) that holds 1, 2,\r
-3, etc, wavetables which consist of a sampled (or soft-synthesised)\r
-waveform, some parameters and optionally a sampled attack and release.\r
-The GF1 chip (an asic based on the Ensoniq DOC-II chip) will then\r
-playback a waveform when triggered based on some parameters it is\r
-given, and on others it will fetch from the wavetable. I dont know if\r
-all parameters can be fetched from RAM by the GF1, nor if the GF1 can\r
-fetch some instructions from RAM, but by using the current OS built in\r
-the windows drivers or in the DOS library, this is what the GUS\r
-_can_presently_use_ to synthesise music:\r
-\r
-        - sampled or envelopped attack in 8/16 bit, signed/unsigned\r
-                format *\r
-        - sampled waveform (anything! a period, or a several seconds\r
-                sample) *\r
-        - sampled or envelopped release *\r
-\r
-with:\r
-        - velocity (volume) *\r
-        - panning (balance) *\r
-        - precise frequency playback rates (with frequency based\r
-                antialiasing and oversampling) *\r
-        - mixing of all the channels *\r
-\r
-Up to here, it's sample playback. But there is more:\r
-\r
-        - full vibrato (FM, depth, rate, sweep)\r
-        - full tremolo (AM, depth, rate, sweep)\r
-        - LFO (Low Frequency Oscillator) *\r
-        - forward, reverse, dual direction looping or no looping *\r
-        - the loop points can be anywhere (for sampled attack and release) *\r
-                |-------|-------------|--------------|\r
-                Start   Start loop    End loop     End\r
-        - 6 point envelope\r
-        - tuning *\r
-        - fractional endpoint *\r
-        - combination of oscillators (up to 4 if the GF1\r
-                implementation is the same as Ensoniq) *\r
-        - previous waveform usage *\r
-\r
-And more recently:\r
-        - 3D (focal point 3D positioning)\r
-\r
-        ( "*" indicates that the operation is done in hardware. Some\r
-others may be done in hardware but i have not done any tests or found\r
-any technical information to confirm it. I also base 1 item on the DOC\r
-II capability, which should be implemented in the GF1.)\r
-\r
-        Also, reverb, flanger, phasing etc...  could be easily\r
-implemente within the drivers. Presently it can be done with a little\r
-work on the patches and/or midi timestamp (i have succesfully made\r
-flanger and phasing).  Another thing that could be implemented is\r
-dynamic patch loading since the card supports it (i have done it). You\r
-can even get a distorted sound (ideal for guitars, vox, analog synths)\r
-by simply changing the 2's complement flag (work best with\r
-soft-synthesised patches).\r
-\r
-        Last, it is far better to have a RAM wavetable synth than a\r
-ROM one, since you can upload your samples.  Even sound canvas owners\r
-(and other synths too) complain that their ROM based GS synth lacks\r
-interesting drum and bass sounds, cannot play sound effects, and is\r
-not usable for dance and techno.  Also you can have more space for\r
-each samples, because you always have only the samples you need in\r
-memory, so you can have better sampling rates and better waveforms.\r
-\r
-----------------------------------------------------------------------\r
-\r
-16] Is there a GUS device driver for Linux/BSD386/*IX?\r
-\r
-        There is a group of people working on device drivers and C\r
-libraries for Linux, BSD386, 386bsd, Minix, SysVR3/386, and whatever\r
-other PC/UNIX flavors there are out there.\r
-\r
-        I know there is at least a beta driver out for Linux.  If\r
-anyone out there has more information on this, please mail it to\r
-me.  I had some information from Hannu Solvanen (Forgive my spelling)\r
-but I lost it.  If you're reading this, Hannu, please mail me that\r
-info on your driver again.\r
-\r
-----------------------------------------------------------------------\r
-\r
-17] How do I get the GUS to work with OS/2?\r
-\r
-        As of now, there is no OS/2 specific device driver for the\r
-GUS.  According to Gravis, they are working directly with IBM to get\r
-OS/2 drivers for the GUS written.  A specific release date has not\r
-been announced.\r
-\r
-        There are a few simple tricks to get the GUS to work with OS/2\r
-to a small degree right now:\r
-\r
-Written by: Thomas Wong <twong@civil.ubc.ca>\r
-\r
-        As it is right now, what you'll have to do is use a 8 bit DMA\r
-channel in your setup of the GUS to make it work under a DOS window\r
-under OS/2.  If you have already installed/setup your GUS card, just\r
-go into the c:\autoexec.bat file under OS/2 and manually change the\r
-number in the environment variable.  So, for example, use DMA channel\r
-#1.  By doing this, you can now use playmidi, 669 player, gusmod... a\r
-number of GUS programs. But you still can't run playfile or SBOS (it\r
-may crash).  In other words, you can use a play a list of midi, 669,\r
-mod...etc files in a DOS window, but can't play games.  Gravis did say\r
-they will come out with an OS/2 driver but no date is set.\r
-\r
-----------------------------------------------------------------------\r
-\r
-18] How do I go about programming the GUS?\r
-\r
-        Gravis and Forte have released a very detailed SDK for the\r
-GUS.  It includes source code, libraries, documentation, etc., etc,\r
-and it's available on the FTP sites (see question #6).\r
-\r
-        Also, there are two UltraDox files written by Phat Tran up for\r
-FTP as well.  Read them carefully, learn to love them.\r
-\r
-        (If you want to use the GUS with another OS besides MSDOS,\r
-read questions #21 and #23.)\r
-\r
-----------------------------------------------------------------------\r
-\r
-19] What are the pinouts for the CD Audio IN on the GUS?\r
-\r
-Written by: <grtorlba@seattleu.edu>\r
-\r
-        About two days ago I posted requested some info on the 4-pin\r
-CD audio pin on the GUS.  I never got a reply but I got the info by\r
-downloading volume 1 of the digest.\r
-\r
-        The pin info was:\r
-\r
-        left ground ground right\r
-\r
-        I've tried this pin assignment and it seems to work.  The\r
-articles in the digest pointed out that they weren't certain of the\r
-left-right assignment but the two pins in the middle are definitely\r
-the grounds.\r
-\r
-----------------------------------------------------------------------\r
-\r
-20] I'm having trouble with... GENERAL TROUBLESHOOTING TIPS\r
-\r
-Written by: john.smith@gravis.com (John Smith)\r
-\r
-        It looks like a lot of the problems are incorrect\r
-installations.\r
-\r
-        Make sure that you put ALL the correct files in the\r
-/ultrasnd/sbos directory and remove any old ones. Sbosdrv.exe,\r
-Loadsbos.exe and Sboslib.sbs MUST all be from the same release\r
-revision. They are NOT mixable. A lot of the problems you are seeing\r
-could happen if the wrong driver is used with the new loader and patch\r
-library.  To make sure you are using the correct files, delete ALL\r
-files from /ultrasnd/sbos. Then unzip the new release into the sbos\r
-directory. Then COPY sbosdrv.exe up to the /ultrasnd directory.  Then\r
-COPY loadsbos.exe up to the /ultrasnd directory also.  Now pick either\r
-sboslo.bat or sboshi.bat up to /ultrasnd/sbos.bat.  These two batch\r
-files assume you are using emm386. If you are using another memory\r
-manager (like qemm, 386max etc), use the appropriate command to load\r
-it into high memory.  (NOTE: If you installed your software in some\r
-other directory, substitute it in place of /ultrasnd).  ] Not all of\r
-the tips below apply to all programs. This is just a brief summary of\r
-some of the things we had to do to get some games running properly.\r
-\r
-        1) Make sure the BLASTER environment string tracks our\r
-ULTRASND string. Many games look at BLASTER to set up their stuff.\r
-SBOS needs ULTRASND. If they are not the same, the game will be\r
-looking one place and SBOS will using another. This is another reason\r
-NOT to have an SB and GUS in the same system. Presumably, the SB would\r
-want BLASTER set up for it and any game looking at it would not work\r
-with SBOS. BLASTER is set up like this:\r
-\r
-    BLASTER=A220 I5 D1 T1\r
-              |    |  |  |\r
-              |    |  |  -  Type of SB (1 = regular SB)\r
-              |    |  ----- DMA channel (MUST be 1)\r
-              |    -------- IRQ used.     (same as GUS midi irq)\r
-              ------------- I/O base address\r
-\r
-        This variable is set up by the GUS setup program.  It should\r
-never need to be modified unless you modify ULTRASND by hand.\r
-\r
-        For example, wolf3d looks at BLASTER to get its parameters.\r
-Sound will NOT function if the IRQs are different, but it will detect\r
-an Adlib.\r
-\r
-        2) Make sure that SBOS is up and running BEFORE you install\r
-your game. Some games configure themselves during their installation\r
-procedure. If SBOS is not running, it will assume there is no sound\r
-board present.\r
-\r
-        3) Some games have a separate setup/configuration section.\r
-Make sure you run this after you install the game OR change the\r
-ULTRASND variable. They are usually called setup, install or config.\r
-Look around for it. Some games also save the last configuration to use\r
-the next time the game is run. This means that if it didn't detect the\r
-card (because SBOS wasn't loaded), it will save that info and will\r
-start up the NEXT time with sound disabled. You will have to manually\r
-turn sound back on somehow.  See your games manual. For example,\r
-Wolf-3d will do this.\r
-\r
-        4) Some games need all available RAM to run.  Since SBOS\r
-currently takes approximately 19K, it may not have enough to run. Some\r
-games will shut off some of the sounds if RAM is short.  Check your\r
-manual. It may also be necessary to load SBOS high to reclaim some of\r
-the RAM.\r
-\r
-        5) If you have poor performance with SBOS loaded, see if you\r
-have an expanded memory manager running.  (qemm, 386max, emm386 etc)\r
-There is a SEVERE performance penalty to be paid if you run with\r
-these. Its a byproduct of your machine running in protected mode.\r
-Usually, only games that use direct I/O (mod players for example) are\r
-seriously effected by this. If you must have SBOS loaded high, then\r
-you will have to live with this. It is possible to disable the virtual\r
-DMA if you are using qemm. (NOVDS) Doing so should speed things up a\r
-bit.\r
-\r
-Comments on above paragraph by mike@batpad.org (Mike Batchelor)\r
-]\r
-]               This paragraph contains some errors, from where I sit.\r
-]       You may disagree, but I offer my perspective anyway:\r
-]\r
-]               1.  Virtual 8086 mode entails no more than a 5%\r
-]       performance penalty over real mode.  It does not matter which\r
-]       memory manager you use, the degradation is dependent on the\r
-]       CPU and the motherboard.  In any case, the penalty is hardly\r
-]       what you might call SEVERE.\r
-]\r
-]               2.  QEMM's NOVDS parameter has NOTHING to do with\r
-]       virtualization of the standard DMA channels.  There is no\r
-]       switch to disable this feature of QEMM, DMA would not fuction\r
-]       in V86 mode if the memory manager does not virtualize it.\r
-]       They all do this, they all MUST do this.  NOVDS tells QEMM not\r
-]       to support the Virtual DMA Specification, which has to do with\r
-]       virtualizing non-standard DMA used by bus-mastering adapters\r
-]       (usually SCSI host adapters, but can be network cards, etc.).\r
-]       The VDS spec is a means by which these non-standard DMA\r
-]       operations may be virtualized in V86 mode.  QEMM normally\r
-]       virtualizes the DMA channels handled by the motherboard's DMA\r
-]       controller.  So-called bus-mastering disk controllers do DMA\r
-]       on their own, without help from the DMA controller, so the\r
-]       normal way of virtualizing DMA will not work.  VDS is the\r
-]       solution for this.  Adding NOVDS to the QEMM line will disable\r
-]       support for ASPI4DOS.SYS, USPI24.SYS and other VDS-supporting\r
-]       SCSI host adapter drivers.  This will prevent the user from\r
-]       loading anything into mapped memory in the first megabyte\r
-]       (High RAM) from the SCSI hard disk.\r
-]\r
-]               The usual way to improve DMA performance is to\r
-]       increase QEMM's DMA buffer.  The default on ISA systems is\r
-]       12K, and 64K on MCA systems.  It can be increased to 128K max.\r
-]       DMA=nnn specifies how large the length of a single DMA\r
-]       transfer can be, in nnn Kb.  QEMM should prompt you to\r
-]       increase the DMA buffer if a program attempts to exceed the\r
-]       capacity of the current buffer.  I have found that 64K is\r
-]       plenty for all programs I have used with the GUS.\r
-\r
-        6) It is possible for an application to detect the Adlib side\r
-of the GUS without SBOS being loaded. It depends on the method it uses\r
-to detect it. Obviously if that happens, the application will think it\r
-has an Adlib, but nothing is going to work.\r
-\r
-        7) Many games need to detect (and use) extended/expanded RAM\r
-before some sounds will be activated (usually digitized stuff) Refer\r
-to your manual for these kind of problems.  An SB will not operate\r
-properly under these conditions either.  For example, Falcon III will\r
-not play digitized sounds until EMS is set up properly.  SBOS has\r
-nothing to do with this problem.\r
-\r
-        8) Some games hard code their I/O address and/or irq\r
-selections. Refer to your manual.  You will have to make the GUS'\r
-selections match these. I believe some Sierra games do this.  Wing\r
-Commander requires a base port of address of 220 for digital speech to\r
-work.\r
-\r
-        9) Unless you are POSITIVE that a particular game needs an\r
-option, (-o1 -o2 etc) DON'T specify one, 99% of the games do NOT need\r
-one. You may screw up the driver by specifying one that you don't\r
-need.  You should unload and reload the driver before specifying an\r
-option. Since it is possible to use more than one option, you may be\r
-telling it conflicting things if you don't unload it.\r
-\r
-        10) There are several new features in SBOS that you should be\r
-aware of:\r
-\r
-                a) SBOS reloads its patches before an application\r
-        runs.  This should eliminate having to reload it between\r
-        running windows or a native GUS application (GUSMOD Star Con\r
-        II, playmidi etc) and a game that uses SBOS.\r
-\r
-                b) You can change the vector that it uses for\r
-        communicating between sbosdrv.exe and loadsbos.exe.  The\r
-        option is -Cxx, where xx is the new software vector to use.\r
-        This is specified to sbosdrv.  Currently, only 1 application\r
-        is known to need this.  Netroom uses the default vector (7E)\r
-        so sbosdrv thinks it is already loaded.  If you are using\r
-        netroom, you MUST change the vector #.  Netroom is the only\r
-        application that we know of that has this problem.  There may\r
-        be others.  We don't know of ANY games that do.\r
-\r
-                c) You can tell SBOS to leave line-in enabled by\r
-        specifying a -L when SBOS is loaded. This can be useful if you\r
-        want to monitor some other audio output source thru the GUS.\r
-\r
-        11) The volume up and down keys (defaults are [ and ]) do not\r
-work in all games. Any game that takes over the keyboard vectors will\r
-disable this feature. You must use the -V option when loading sbos to\r
-alter the volume for these games.  This option works like this: -vxx\r
-where xx ranges from 0 to 31 (31 being max volume) Note: in SOME\r
-versions prior to 1.4B2, hitting the volume keys would hang your\r
-system. This has been fixed.\r
-\r
-        12) Some games grab all possible SB irqs (2,5 and 7) when they\r
-initialize to find what IRQ the SB is on.  If they do this with SBOS\r
-and SBOS happens to have the UltraSound IRQ on one of the SB irqs, it\r
-will not let SBOS get its irq. Make sure that you set the UltraSound\r
-irq to one of the upper ones (11,12 or 15). Jill of the Jungle is an\r
-example of a game that exhibits this problem.\r
-\r
-        13) Now for some simple things to look for.\r
-\r
-                a) Is board seated properly?\r
-                b) Is DRAM in sockets correctly (bent pins etc)?\r
-                c) Are stereo/speakers hooked up properly?\r
-                d) Are you connected to the right outputs on GUS?\r
-                   (Some Ultrasound boxes are labeled wrong ...)\r
-\r
-                        TOP OF ULTRASOUND\r
-                        =================\r
-\r
-                        Amplified Out\r
-                        Line Out\r
-\r
-                        Joystick/Midi 15 pin connector\r
-\r
-                        Microphone In\r
-                        Line In\r
-\r
-                        BOTTOM OF ULTRASOUND\r
-                        ====================\r
-\r
-                e) Do you have enough environment space for ULTRASND\r
-                   and BLASTER variables?\r
-                f) Did you set the volume too low?\r
-                g) Is \ultrasnd in your path?\r
-                h) Could you have gotten a bad download of new SBOS?\r
-\r
-        14) Several people have complained about sbos loading VERY\r
-slowly.  Is your joystick or MIDI plugged in?  Try unplugging it.  As\r
-of now, we haven't been able to reproduce this problem.  It may be\r
-related to installing the software incorrectly or a DMA conflict.\r
-\r
-        15) If your joystick doesn't operate properly in a game, look\r
-for these things.\r
-\r
-                a) Has it been calibrated (see manual)\r
-                b) Do you have 2 games ports in your system? (GUS and\r
-                   another game port). If so, one MUST be disabled.\r
-                c) DO you have a line like the following in your autoexec\r
-\r
-                   joycomp 20\r
-\r
-                   where 20 is the compensation factor determined thru\r
-                   the calibration utility, ultrajoy.\r
-\r
-        16) There are several things people have noticed that seem to\r
-effect SBOS that need to be investigated. None of these have been\r
-verified, but you should be aware of them and you might try\r
-eliminating them as possible sources of your problem.\r
-\r
-                a) Loading SBOS hi can cause some FM stuff to sound\r
-                   'weird'.\r
-                b) Using 'Stealth' mode on QEMM seems to have a\r
-                   detrimental effect.\r
-                c) Change sbos.bat file to use loadhi instead of lh if\r
-                   using QEMM.\r
-                d) Stacker seems to cause some people problems.  It\r
-                   works OK for others.\r
-                e) Order that TSR's are loaded may have an effect. Try\r
-                   loading SBOS first, last etc.\r
-                f) When using XWing make sure that you have at least\r
-                   896K of EMS (not XMS) and 563K of conventional.  If\r
-                   you are having problems with slowdowns try turning\r
-                   off the music.\r
-\r
-        17) The only other thing we can think of is a hardware problem\r
-on your card. The diagnostics in the new setup program should be able\r
-to isolate it.\r
-\r
-        Granted, we are a bit biased, but we believe that you should\r
-get SUPERB sound out of your GUS.  If you are getting less than\r
-satisfactory results, there can only be a few explanations.\r
-\r
-                a) in windows, make sure its in 'high fidelity' mode.\r
-                b) Incorrect software installation.\r
-                c) Incorrect hardware installation (IRQ,DMA etc)\r
-                   (probably)\r
-                4) Bad hardware.(PC or GUS)\r
-\r
-----------------------------------------------------------------------\r
-\r
-21] I can't seem to fit the new disks onto a floppy.\r
-\r
-        First of all, the files need to go on to a HD 3.5" disk.\r
-\r
-        Next, some of the disks were zip'ed a second time to include a\r
-small README file (in other words, the .zip file you downloaded\r
-contains two files: a README file, and another .zip file).  This would\r
-have been a good idea, except the .zip file got bigger; too big for a\r
-HD 3.5" disk.  So, you'll need to unzip the file, read the README, and\r
-copy the new .zip file to a floppy.\r
-\r
-----------------------------------------------------------------------\r
-\r
-22] Why shouldn't I use the comp.sys.ibm.pc.soundcard.GUS newgroup?\r
-\r
-        c.s.i.p.s.GUS wasn't created legally; ie: there was no formal\r
-call for discussion, voting, etc., etc.  As such, many sites refuse to\r
-carry the group.  Posts there get to few readers.\r
-\r
-        If anyone wants to take the time and energy to go through the\r
-steps needed to get a new group created the correct way, I'm sure all\r
-the GUSers would be more than happy to move there.\r
-\r
-        (USENET tip for newbies: Don't create a new group for every\r
-new topic that comes along.  Find the group that your topic fits best\r
-in, and use that.  If you don't like all the other posts in the group,\r
-learn the magic incantations that go along with killfiles in your\r
-newsreader.)\r
-\r
-----------------------------------------------------------------------\r
-\r
-23] What are "Miles Drivers", and how do I use them?\r
-\r
-Written by: Matthew E. Bernold <MEB117@PSUVM.PSU.EDU>\r
-\r
-        Miles drivers (also known as MIDPAK/DIGIPAK) are a set of\r
-drivers that software companies to easily support many soundcards.\r
-The game is programmed to use these drivers, and then any soundcard\r
-with an appropriate driver will automatically be supported.  The Miles\r
-drivers for the GUS can be found on the Epas archive site.  The\r
-current version of these drivers is v.97beta (filename GUSAIL97.ZIP)\r
-\r
-        There are three driver files and one TSR in the GUS Miles\r
-Drivers.  The drivers are GF1MIDI.ADV, GF1DIGI.ADV, GF166.COM and the\r
-TSR is ULTRAMID.EXE In order to use these drivers, you need to copy\r
-them over existing sound drivers for another card.  These drivers\r
-should have easily recognizable names like:\r
-\r
-        (List taken from Monopoly Deluxe)\r
-\r
-        SBDIG.ADV               Sound Blaster Digital\r
-        SBFM.ADV                Sound Blaster FM Music\r
-        SBPDIG.ADV              Sound Blaster Pro Digital\r
-        SBP1FM.ADV              Sound Blaster Pro v1 Music\r
-        SBP2FM.ADV              Sound Blaster Pro v2 Music (OPL3)\r
-        MT32MPU.ADV             Roland MT32 Music\r
-        PCSPKR.ADV              PC Speaker driver\r
-\r
-        The above names are typical, but they may change.\r
-\r
-        To get the game to work, you should do the following (This\r
-example assumes that your Ultrasound directory is c:\ultrasnd and that\r
-your miles drivers are in c:\ultrasnd\miles and your game is in the\r
-directory c:\game):\r
-\r
-        1) Change into your Game's directory\r
-\r
-C:\>CD GAME\r
-\r
-        NOTE: Any of the below steps MAY not be necessary, depending\r
-on what your application uses.  If the app uses only Digital sound,\r
-and no MIDI music, for example, you will not have to do step 3.\r
-\r
-        2) Copy GF1DIGI.ADV over a Digital driver.  I would suggest\r
-choosing the one that is most functional.  Choose the SBPro driver\r
-over the SB one and you MIGHT get stereo (depending on what the game\r
-does) and choose the PAS-16 driver (if one is present) and you MIGHT\r
-get 16-bit sound if the game uses it.  We'll choose the SBPro driver.\r
-\r
-C:\GAME>COPY C:\ULTRASND\MILES\GF1DIGI.ADV SBPDIG.ADV\r
-\r
-        3) Copy GF1MIDI.ADV over a Music driver.  Here, I would\r
-suggest that you try different ones and see which sounds best.\r
-Sometimes the program plays a different version of the music depending\r
-on your card.  For Terminator 2029, I found that the MT32 setting\r
-sounds better, but the SCC-1 setting sounds more like the movie music,\r
-even though it isn't as clear and nice sounding.  For this example,\r
-we'll try the MT32 driver.\r
-\r
-C:\GAME>COPY C:\ULTRASND\MILES\GF1MIDI.ADV MT32MPU.ADV\r
-\r
-        4) Copy GF166.COM over the .COM file for the card you selected\r
-above.  This should be fairly simple.  If you chose 2 different cards\r
-as we did in this example, then copy the GF166.COM over the .COM file\r
-for BOTH cards (just to be safe)\r
-\r
-C:\GAME>COPY C:\ULTRASND\MILES\GF166.COM SBLASTER.COM\r
-\r
-        (For this game [Monopoly Deluxe] there doesn't seem to be a\r
-.COM file for the Roland MT32, so I didn't copy over it here)\r
-\r
-        5) This step is MANDITORY.  Run the game's SETUP utility and\r
-choose the cards you chose above.  In this example, we chose SBPro for\r
-Digital, and MT32 for Music.  If the SETUP utility does NOT allow you\r
-to choose two different cards, you must redo steps 2-4 patching only\r
-ONE card's drivers.  Most programs now allow you to choose 2 cards,\r
-however.\r
-\r
-        6) Run ULTRAMID.EXE.  This needs to be done before you run any\r
-games that use the Miles Drivers.  There should be instructions on\r
-different command line options for ULTRAMID in the readme file that\r
-comes with the archive.  Realize that ULTRAMID takes around 50k right\r
-now, so you may have to load it high to get enough conventional memory\r
-to run your game.\r
-\r
-        That's it!  Your game SHOULD now have full GUS support.  If it\r
-doesn't, here are a few hints on how to possibly fix things:\r
-\r
-        1) Try copying the GUS's *.ADV drivers over ALL the *.ADV\r
-drivers in the game's directory.  According to the README file, a good\r
-indication of what a driver is is that if the driver is <10k then it\r
-is a Digital driver, and should be replaced with GUSDIGI.ADV, if\r
-larger, then it is a MIDI driver, and should be replaced with\r
-GUSMIDI.ADV.  The name should also give you a clue as to what to\r
-replace it with.\r
-\r
-                a) MIDI drivers: MT32, SCC1, ADLIB (Usually), Anything\r
-        with 'FM' like SBFM or SBP2FM\r
-\r
-                b) Digital drivers: SBDIG, SBPDIG, PASDIG, PCSPKR.\r
-        Usually these drivers will have 'DIG' in them, but not\r
-        necessarily.\r
-\r
-        2) Try copying the GF166.COM file over ALL the .COM files in\r
-the directory.  BE CAREFUL WHEN YOU DO THIS!  Some games have .COM\r
-files other than the music drivers that should NOT be copied over.\r
-Most of the time, the .COM files you are looking for will be small,\r
-and will usually have a recognizable name, although this is not always\r
-the case.\r
-\r
-        3) Some games on the list in the readme file from the archive\r
-may use the Miles drivers, but NOT have *.ADV files anywhere.  From\r
-what I understand, the Miles drivers will have the word "Miles"\r
-embedded in them somewhere near the beginning.  Look through some of\r
-the smaller files in the directory with an editor and see if you can\r
-find the word "Miles" somewhere.  Some games rename the Miles drivers\r
-to *.DRV.\r
-\r
-        Good luck, and happy GUSing.\r
-\r
-----------------------------------------------------------------------\r
-\r
-\r
diff --git a/16/PCGPE10/IFF.DOC b/16/PCGPE10/IFF.DOC
deleted file mode 100644 (file)
index a085704..0000000
+++ /dev/null
@@ -1,1424 +0,0 @@
-\r
-\r
-"EA IFF 85" Standard for Interchange Format Files\r
-\r
-Document Date:          January 14, 1985\r
-From:                   Jerry Morrison, Electronic Arts\r
-Status of Standard:     Released and in use\r
-\r
-1. Introduction\r
-\r
-Standards are Good for Software Developers\r
-\r
-As home computer hardware evolves to better and better media machines, \r
-the demand increases for higher quality, more detailed data. Data \r
-development gets more expensive, requires more expertise and better \r
-tools, and has to be shared across projects. Think about several ports \r
-of a product on one CD-ROM with 500M Bytes of common data!\r
-\r
-Development tools need standard interchange file formats. Imagine \r
-scanning in images of "player" shapes, moving them to a paint program \r
-for editing, then incorporating them into a game. Or writing a theme \r
-song with a Macintosh score editor and incorporating it into an Amiga \r
-game. The data must at times be transformed, clipped, filled out, \r
-and moved across machine kinds. Media projects will depend on data \r
-transfer from graphic, music, sound effect, animation, and script \r
-tools.\r
-\r
-Standards are Good for Software Users\r
-\r
-Customers should be able to move their own data between independently \r
-developed software products. And they should be able to buy data libraries \r
-usable across many such products. The types of data objects to exchange \r
-are open-ended and include plain and formatted text, raster and structured \r
-graphics, fonts, music, sound effects, musical instrument descriptions, \r
-and animation.\r
-\r
-The problem with expedient file formats typically memory dumps is \r
-that they're too provincial. By designing data for one particular \r
-use (e.g. a screen snapshot), they preclude future expansion (would \r
-you like a full page picture? a multi-page document?). In neglecting \r
-the possibility that other programs might read their data, they fail \r
-to save contextual information (how many bit planes? what resolution?). \r
-Ignoring that other programs might create such files, they're intolerant \r
-of extra data (texture palette for a picture editor), missing data \r
-(no color map), or minor variations (smaller image). In practice, \r
-a filed representation should rarely mirror an in-memory representation. \r
-The former should be designed for longevity; the latter to optimize \r
-the manipulations of a particular program. The same filed data will \r
-be read into different memory formats by different programs.\r
-\r
-The IFF philosophy: "A little behind-the-scenes conversion when programs \r
-read and write files is far better than NxM explicit conversion utilities \r
-for highly specialized formats."\r
-\r
-So we need some standardization for data interchange among development \r
-tools and products. The more developers that adopt a standard, the \r
-better for all of us and our customers.\r
-\r
-Here is "EA IFF 1985"\r
-\r
-Here is our offering: Electronic Arts' IFF standard for Interchange \r
-File Format. The full name is "EA IFF 1985". Alternatives and justifications \r
-are included for certain choices. Public domain subroutine packages \r
-and utility programs are available to make it easy to write and use \r
-IFF-compatible programs.\r
-\r
-Part 1 introduces the standard. Part 2 presents its requirements and \r
-background. Parts 3, 4, and 5 define the primitive data types, FORMs, \r
-and LISTs, respectively, and how to define new high level types. Part \r
-6 specifies the top level file structure. Appendix A is included for \r
-quick reference and Appendix B names the committee responsible for \r
-this standard.\r
-\r
-References\r
-\r
-American National Standard Additional Control Codes for Use with ASCII, \r
-ANSI standard 3.64-1979 for an 8-bit character set. See also ISO standard \r
-2022 and ISO/DIS standard 6429.2.\r
-\r
-Amiga[tm] is a trademark of Commodore-Amiga, Inc.\r
-\r
-C, A Reference Manual, Samuel P. Harbison and Guy L. Steele Jr., Tartan \r
-Laboratories. Prentice-Hall, Englewood Cliffs, NJ, 1984.\r
-\r
-Compiler Construction, An Advanced Course, edited by F. L. Bauer and \r
-J. Eickel (Springer-Verlag, 1976). This book is one of many sources \r
-for information on recursive descent parsing.\r
-\r
-DIF Technical Specification (c)1981 by Software Arts, Inc. DIF[tm] is \r
-the format for spreadsheet data interchange developed by Software \r
-Arts, Inc.\r
-DIF[tm] is a trademark of Software Arts, Inc.\r
-\r
-Electronic Arts[tm] is a trademark of Electronic Arts.\r
-\r
-"FTXT" IFF Formatted Text, from Electronic Arts. IFF supplement document \r
-for a text format.\r
-\r
-Inside Macintosh (c) 1982, 1983, 1984, 1985 Apple Computer, Inc., a \r
-programmer's reference manual.\r
-Apple(R) is a trademark of Apple Computer, Inc.\r
-Macintosh[tm] is a trademark licensed to Apple Computer, Inc.\r
-\r
-"ILBM" IFF Interleaved Bitmap, from Electronic Arts. IFF supplement \r
-document for a raster image format.\r
-\r
-M68000 16/32-Bit Microprocessor Programmer's Reference Manual(c) 1984, \r
-1982, 1980, 1979 by Motorola, Inc.\r
-\r
-PostScript Language Manual (c) 1984 Adobe Systems Incorporated.\r
-PostScript[tm] is a trademark of Adobe Systems, Inc.\r
-Times and Helvetica(R) are trademarks of Allied Corporation.\r
-\r
-InterScript: A Proposal for a Standard for the Interchange of Editable \r
-Documents (c)1984 Xerox Corporation.\r
-Introduction to InterScript (c) 1985 Xerox Corporation.\r
-\r
-\r
-\f\r
-2. Background for Designers\r
-\r
-Part 2 is about the background, requirements, and goals for the standard. \r
-It's geared for people who want to design new types of IFF objects. \r
-People just interested in using the standard may wish to skip this \r
-part.\r
-\r
-What Do We Need?\r
-\r
-A standard should be long on prescription and short on overhead. It \r
-should give lots of rules for designing programs and data files for \r
-synergy. But neither the programs nor the files should cost too much \r
-more than the expedient variety. While we're looking to a future with \r
-CD-ROMs and perpendicular recording, the standard must work well on \r
-floppy disks.\r
-\r
-For program portability, simplicity, and efficiency, formats should \r
-be designed with more than one implementation style in mind. (In practice, \r
-pure stream I/O is adequate although random access makes it easier \r
-to write files.) It ought to be possible to read one of many objects \r
-in a file without scanning all the preceding data. Some programs need \r
-to read and play out their data in real time, so we need good compromises \r
-between generality and efficiency.\r
-\r
-As much as we need standards, they can't hold up product schedules. \r
-So we also need a kind of decentralized extensibility where any software \r
-developer can define and refine new object types without some "standards \r
-authority" in the loop. Developers must be able to extend existing \r
-formats in a forward- and backward-compatible way. A central repository \r
-for design information and example programs can help us take full \r
-advantage of the standard.\r
-\r
-For convenience, data formats should heed the restrictions of various \r
-processors and environments. E.g. word-alignment greatly helps 68000 \r
-access at insignificant cost to 8088 programs.\r
-\r
-Other goals include the ability to share common elements over a list \r
-of objects and the ability to construct composite objects containing \r
-other data objects with structural information like directories.\r
-\r
-And finally, "Simple things should be simple and complex things should \r
-be possible."   Alan Kay.\r
-\r
-Think Ahead\r
-\r
-Let's think ahead and build programs that read and write files for \r
-each other and for programs yet to be designed. Build data formats \r
-to last for future computers so long as the overhead is acceptable. \r
-This extends the usefulness and life of today's programs and data.\r
-\r
-To maximize interconnectivity, the standard file structure and the \r
-specific object formats must all be general and extensible. Think \r
-ahead when designing an object. It should serve many purposes and \r
-allow many programs to store and read back all the information they \r
-need; even squeeze in custom data. Then a programmer can store the \r
-available data and is encouraged to include fixed contextual details. \r
-Recipient programs can read the needed parts, skip unrecognized stuff, \r
-default missing data, and use the stored context to help transform \r
-the data as needed.\r
-\r
-Scope\r
-\r
-IFF addresses these needs by defining a standard file structure, some \r
-initial data object types, ways to define new types, and rules for \r
-accessing these files. We can accomplish a great deal by writing programs \r
-according to this standard, but don't expect direct compatibility \r
-with existing software. We'll need conversion programs to bridge the \r
-gap from the old world.\r
-\r
-IFF is geared for computers that readily process information in 8-bit \r
-bytes. It assumes a "physical layer" of data storage and transmission \r
-that reliably maintains "files" as strings of 8-bit bytes. The standard \r
-treats a "file" as a container of data bytes and is independent of \r
-how to find a file and whether it has a byte count.\r
-\r
-This standard does not by itself implement a clipboard for cutting \r
-and pasting data between programs. A clipboard needs software to mediate \r
-access, to maintain a "contents version number" so programs can detect \r
-updates, and to manage the data in "virtual memory".\r
-\r
-Data Abstraction\r
-\r
-The basic problem is how to represent information  in a way that's \r
-program-independent, compiler- independent, machine-independent, and \r
-device-independent.\r
-\r
-The computer science approach is "data abstraction", also known as \r
-"objects", "actors", and "abstract data types". A data abstraction \r
-has a "concrete representation" (its storage format), an "abstract \r
-representation" (its capabilities and uses), and access procedures \r
-that isolate all the calling software from the concrete representation. \r
-Only the access procedures touch the data storage. Hiding mutable \r
-details behind an interface is called "information hiding". What data \r
-abstraction does is abstract from details of implementing the object, \r
-namely the selected storage representation and algorithms for manipulating \r
-it.\r
-\r
-The power of this approach is modularity. By adjusting the access \r
-procedures we can extend and restructure the data without impacting \r
-the interface or its callers. Conversely, we can extend and restructure \r
-the interface and callers without making existing data obsolete. It's \r
-great for interchange!\r
-\r
-But we seem to need the opposite: fixed file formats for all programs \r
-to access. Actually, we could file data abstractions ("filed objects") \r
-by storing the data and access procedures together. We'd have to encode \r
-the access procedures in a standard machine-independent programming \r
-language   la PostScript. Even still, the interface can't evolve freely \r
-since we can't update all copies of the access procedures. So we'll \r
-have to design our abstract representations for limited evolution \r
-and occasional revolution (conversion).\r
-\r
-In any case, today's microcomputers can't practically store data abstractions. \r
-They can do the next best thing: store arbitrary types of data in \r
-"data chunks", each with a type identifier and a length count. The \r
-type identifier is a reference by name to the access procedures (any \r
-local implementation). The length count enables storage-level object \r
-operations like "copy" and "skip to next" independent of object type.\r
-\r
-Chunk writing is straightforward. Chunk reading requires a trivial \r
-parser to scan each chunk and dispatch to the proper access/conversion \r
-procedure. Reading chunks nested inside other chunks requires recursion, \r
-but no lookahead or backup.\r
-\r
-That's the main idea of IFF. There are, of course, a few other detailsI\r
-\r
-Previous Work\r
-\r
-Where our needs are similar, we borrow from existing standards.\r
-\r
-Our basic need to move data between independently developed programs \r
-is similar to that addressed by the Apple Macintosh desk scrap or \r
-"clipboard" [Inside Macintosh chapter "Scrap Manager"]. The Scrap \r
-Manager works closely with the Resource Manager, a handy filer and \r
-swapper for data objects (text strings, dialog window templates, pictures, \r
-fontsI) including types yet to be designed [Inside Macintosh chapter \r
-"Resource Manager"]. The Resource Manager is a kin to Smalltalk's \r
-object swapper.\r
-\r
-We will probably write a Macintosh desk accessory that converts IFF \r
-files to and from the Macintosh clipboard for quick and easy interchange \r
-with programs like MacPaint and Resource Mover.\r
-\r
-Macintosh uses a simple and elegant scheme of 4-character "identifiers" \r
-to identify resource types, clipboard format types, file types, and \r
-file creator programs. Alternatives are unique ID numbers assigned \r
-by a central authority or by hierarchical authorities, unique ID numbers \r
-generated by algorithm, other fixed length character strings, and \r
-variable length strings. Character string identifiers double as readable \r
-signposts in data files and programs. The choice of 4 characters is \r
-a good tradeoff between storage space, fetch/compare/store time, and \r
-name space size. We'll honor Apple's designers by adopting this scheme.\r
-\r
-"PICT" is a good example of a standard structured graphics format \r
-(including raster images) and its many uses [Inside Macintosh chapter \r
-"QuickDraw"]. Macintosh provides QuickDraw routines in ROM to create, \r
-manipulate, and display PICTs. Any application can create a PICT by \r
-simply asking QuickDraw to record a sequence of drawing commands. \r
-Since it's just as easy to ask QuickDraw to render a PICT to a screen \r
-or a printer, it's very effective to pass them between programs, say \r
-from an illustrator to a word processor. An important feature is the \r
-ability to store "comments" in a PICT which QuickDraw will ignore. \r
-Actually, it passes them to your optional custom "comment handler".\r
-\r
-PostScript, Adobe's print file standard, is a more general way to \r
-represent any print image (which is a specification for putting marks \r
-on paper) [PostScript Language Manual]. In fact, PostScript is a full-fledged \r
-programming language. To interpret a PostScript program is to render \r
-a document on a raster output device. The language is defined in layers: \r
-a lexical layer of identifiers, constants, and operators; a layer \r
-of reverse polish semantics including scope rules and a way to define \r
-new subroutines; and a printing-specific layer of built-in identifiers \r
-and operators for rendering graphic images. It is clearly a powerful \r
-(Turing equivalent) image definition language. PICT and a subset of \r
-PostScript are candidates for structured graphics standards.\r
-\r
-A PostScript document can be printed on any raster output device (including \r
-a display) but cannot generally be edited. That's because the original \r
-flexibility and constraints have been discarded. Besides, a PostScript \r
-program may use arbitrary computation to supply parameters like placement \r
-and size to each operator. A QuickDraw PICT, in comparison, is a more \r
-restricted format of graphic primitives parameterized by constants. \r
-So a PICT can be edited at the level of the primitives, e.g. move \r
-or thicken a line. It cannot be edited at the higher level of, say, \r
-the bar chart data which generated the picture.\r
-\r
-PostScript has another limitation: Not all kinds of data amount to \r
-marks on paper. A musical instrument description is one example. PostScript \r
-is just not geared for such uses.\r
-\r
-"DIF" is another example of data being stored in a general format \r
-usable by future programs [DIF Technical Specification]. DIF is a \r
-format for spreadsheet data interchange. DIF and PostScript are both \r
-expressed in plain ASCII text files. This is very handy for printing, \r
-debugging, experimenting, and transmitting across modems. It can have \r
-substantial cost in compaction and read/write work, depending on use. \r
-We won't store IFF files this way but we could define an ASCII alternate \r
-representation with a converter program.\r
-\r
-InterScript is Xerox' standard for interchange of editable documents \r
-[Introduction to InterScript]. It approaches a harder problem: How \r
-to represent editable word processor documents that may contain formatted \r
-text, pictures, cross-references like figure numbers, and even highly \r
-specialized objects like mathematical equations? InterScript aims \r
-to define one standard representation for each kind of information. \r
-Each InterScript-compatible editor is supposed to preserve the objects \r
-it doesn't understand and even maintain nested cross-references. So \r
-a simple word processor would let you edit the text of a fancy document \r
-without discarding the equations or disrupting the equation numbers.\r
-\r
-Our task is similarly to store high level information and preserve \r
-as much content as practical while moving it between programs. But \r
-we need to span a larger universe of data types and cannot expect \r
-to centrally define them all. Fortunately, we don't need to make programs \r
-preserve information that they don't understand. And for better or \r
-worse, we don't have to tackle general-purpose cross-references yet.\r
-\r
-\r
-\f\r
-3. Primitive Data Types\r
-\r
-Atomic components such as integers and characters that are interpretable \r
-directly by the CPU are specified in one format for all processors. \r
-We chose a format that's most convenient for the Motorola MC68000 \r
-processor [M68000 16/32-Bit Microprocessor Programmer's Reference \r
-Manual].\r
-\r
-N.B.: Part 3 dictates the format for "primitive" data types where and \r
-only where used in the overall file structure and standard kinds of \r
-chunks (Cf. Chunks). The number of such occurrences will be small \r
-enough that the costs of conversion, storage, and management of processor-\r
-specific files would far exceed the costs of conversion during I/O by "foreign" \r
-programs. A particular data chunk may be specified with a different \r
-format for its internal primitive types or with processor- or environment-\r
-speci fic variants if necessary to optimize local usage. Since that hurts \r
-data interchange, it's not recommended. (Cf. Designing New Data Sections, \r
-in Part 4.)\r
-\r
-Alignment\r
-\r
-All data objects larger than a byte are aligned on even byte addresses \r
-relative to the start of the file. This may require padding. Pad bytes \r
-are to be written as zeros, but don't count on that when reading.\r
-\r
-This means that every odd-length "chunk" (see below) must be padded \r
-so that the next one will fall on an even boundary. Also, designers \r
-of structures to be stored in chunks should include pad fields where \r
-needed to align every field larger than a byte. Zeros should be stored \r
-in all the pad bytes.\r
-\r
-Justification: Even-alignment causes a little extra work for files \r
-that are used only on certain processors but allows 68000 programs \r
-to construct and scan the data in memory and do block I/O. You just \r
-add an occasional pad field to data structures that you're going to \r
-block read/write or else stream read/write an extra byte. And the \r
-same source code works on all processors. Unspecified alignment, on \r
-the other hand, would force 68000 programs to (dis)assemble word and \r
-long-word data one byte at a time. Pretty cumbersome in a high level \r
-language. And if you don't conditionally compile that out for other \r
-processors, you won't gain anything.\r
-\r
-Numbers\r
-\r
-Numeric types supported are two's complement binary integers in the \r
-format used by the MC68000 processor high byte first, high word first the \r
-reverse of 8088 and 6502 format. They could potentially include signed \r
-and unsigned 8, 16, and 32 bit integers but the standard only uses \r
-the following:\r
-\r
-UBYTE    8 bits unsigned\r
-WORD    16 bits signed\r
-UWORD   16 bits unsigned\r
-LONG    32 bits signed\r
-\r
-The actual type definitions depend on the CPU and the compiler. In \r
-this document, we'll express data type definitions in the C programming \r
-language. [See C, A Reference Manual.] In 68000 Lattice C:\r
-\r
-typedef unsigned char   UBYTE;  /*  8 bits unsigned     */\r
-typedef short   WORD;   /* 16 bits signed       */\r
-typedef unsigned short  UWORD;  /* 16 bits unsigned     */\r
-typedef long    LONG;   /* 32 bits signed       */\r
-\r
-Characters\r
-\r
-The following character set is assumed wherever characters are used, \r
-e.g. in text strings, IDs, and TEXT chunks (see below).\r
-\r
-Characters are encoded in 8-bit ASCII. Characters in the range NUL \r
-(hex 0) through DEL (hex 7F) are well defined by the 7-bit ASCII standard. \r
-IFF uses the graphic group RJS (SP, hex 20) through R~S (hex 7E).\r
-\r
-Most of the control character group hex 01 through hex 1F have no \r
-standard meaning in IFF. The control character LF (hex 0A) is defined \r
-as a "newline" character. It denotes an intentional line break, that \r
-is, a paragraph or line terminator. (There is no way to store an automatic \r
-line break. That is strictly a function of the margins in the environment \r
-the text is placed.) The control character ESC (hex 1B) is a reserved \r
-escape character under the rules of ANSI standard 3.64-1979 American \r
-National Standard Additional Control Codes for Use with ASCII, ISO \r
-standard 2022, and ISO/DIS standard 6429.2.\r
-\r
-Characters in the range hex 7F through hex FF are not globally defined \r
-in IFF. They are best left reserved for future standardization. But \r
-note that the FORM type FTXT (formatted text) defines the meaning \r
-of these characters within FTXT forms. In particular, character values \r
-hex 7F through hex 9F are control codes while characters hex A0 through \r
-hex FF are extended graphic characters like  , as per the ISO and \r
-ANSI standards cited above. [See the supplementary document "FTXT" \r
-IFF Formatted Text.]\r
-\r
-Dates\r
-\r
-A "creation date" is defined as the date and time a stream of data \r
-bytes was created. (Some systems call this a "last modified date".) \r
-Editing some data changes its creation date. Moving the data between \r
-volumes or machines does not.\r
-\r
-The IFF standard date format will be one of those used in MS-DOS, \r
-Macintosh, or Amiga DOS (probably a 32-bit unsigned number of seconds \r
-since a reference point). Issue: Investigate these three.\r
-\r
-Type IDs\r
-\r
-A "type ID", "property name", "FORM type", or any other IFF identifier \r
-is a 32-bit value: the concatenation of four ASCII characters in the \r
-range R S (SP, hex 20) through R~S (hex 7E). Spaces (hex 20) should \r
-not precede printing characters; trailing spaces are ok. Control characters \r
-are forbidden.\r
-\r
-typedef CHAR ID[4];\r
-\r
-IDs are compared using a simple 32-bit case-dependent equality test.\r
-\r
-Data section type IDs (aka FORM types) are restriced IDs. (Cf. Data \r
-Sections.) Since they may be stored in filename extensions (Cf. Single \r
-Purpose Files) lower case letters and punctuation marks are forbidden. \r
-Trailing spaces are ok.\r
-\r
-Carefully choose those four characters when you pick a new ID. Make \r
-them mnemonic so programmers can look at an interchange format file \r
-and figure out what kind of data it contains. The name space makes \r
-it possible for developers scattered around the globe to generate \r
-ID values with minimal collisions so long as they choose specific \r
-names like "MUS4" instead of general ones like "TYPE" and "FILE". \r
-EA will "register" new FORM type IDs and format descriptions as they're \r
-devised, but collisions will be improbable so there will be no pressure \r
-on this "clearinghouse" process. Appendix A has a list of currently \r
-defined IDs.\r
-\r
-Sometimes it's necessary to make data format changes that aren't backward \r
-compatible. Since IDs are used to denote data formats in IFF, new \r
-IDs are chosen to denote revised formats. Since programs won't read \r
-chunks whose IDs they don't recognize (see Chunks, below), the new \r
-IDs keep old programs from stumbling over new data. The conventional \r
-way to chose a "revision" ID is to increment the last character if \r
-it's a digit or else change the last character to a digit. E.g. first \r
-and second revisions of the ID "XY" would be "XY1" and "XY2". Revisions \r
-of "CMAP" would be "CMA1" and "CMA2".\r
-\r
-Chunks\r
-\r
-Chunks are the building blocks in the IFF structure. The form expressed \r
-as a C typedef is:\r
-\r
-typedef struct {\r
-        ID      ckID;\r
-        LONG    ckSize; /* sizeof(ckData) */\r
-        UBYTE   ckData[/* ckSize */];\r
-        } Chunk;\r
-\r
-We can diagram an example chunk a "CMAP" chunk containing 12 data \r
-bytes like this:\r
-                        ----------------\r
-                ckID:   |    'CMAP'    |\r
-                ckSize: |      12      |\r
-                ckData: | 0, 0, 0, 32  |   -------- \r
-                        | 0, 0, 64, 0  |    12 bytes\r
-                        | 0, 0, 64, 0  |   ---------\r
-                        ----------------\r
-\r
-The fixed header part means "Here's a type ckID chunk with ckSize \r
-bytes of data."\r
-\r
-The ckID identifies the format and purpose of the chunk. As a rule, \r
-a program must recognize ckID to interpret ckData. It should skip \r
-over all unrecognized chunks. The ckID also serves as a format version \r
-number as long as we pick new IDs to identify new formats of ckData \r
-(see above).\r
-\r
-The following ckIDs are universally reserved to identify chunks with \r
-particular IFF meanings: "LIST", "FORM", "PROP", "CAT ", and "    \r
-". The special ID "    " (4 spaces) is a ckID for "filler" chunks, \r
-that is, chunks that fill space but have no meaningful contents. The \r
-IDs "LIS1" through "LIS9", "FOR1" through "FOR9", and "CAT1" through \r
-"CAT9" are reserved for future "version number" variations. All IFF-compatible \r
-software must account for these 23 chunk IDs. Appendix A has a list \r
-of predefined IDs.\r
-\r
-The ckSize is a logical block size how many data bytes are in ckData. \r
-If ckData is an odd number of bytes long, a 0 pad byte follows which \r
-is not included in ckSize. (Cf. Alignment.) A chunk's total physical \r
-size is ckSize rounded up to an even number plus the size of the header. \r
-So the smallest chunk is 8 bytes long with ckSize = 0. For the sake \r
-of following chunks, programs must respect every chunk's ckSize as \r
-a virtual end-of-file for reading its ckData even if that data is \r
-malformed, e.g. if nested contents are truncated.\r
-\r
-We can describe the syntax of a chunk as a regular expression with \r
-"#" representing the ckSize, i.e. the length of the following {braced} \r
-bytes. The "[0]" represents a sometimes needed pad byte. (The regular \r
-expressions in this document are collected in Appendix A along with \r
-an explanation of notation.)\r
-\r
-Chunk   ::= ID #{ UBYTE* } [0]\r
-\r
-One chunk output technique is to stream write a chunk header, stream \r
-write the chunk contents, then random access back to the header to \r
-fill in the size. Another technique is to make a preliminary pass \r
-over the data to compute the size, then write it out all at once.\r
-\r
-Strings, String Chunks, and String Properties\r
-\r
-In a string of ASCII text, LF denotes a forced line break (paragraph \r
-or line terminator). Other control characters are not used. (Cf. Characters.)\r
-\r
-The ckID for a chunk that contains a string of plain, unformatted \r
-text is "TEXT". As a practical matter, a text string should probably \r
-not be longer than 32767 bytes. The standard allows up to 231 - 1 \r
-bytes.\r
-\r
-When used as a data property (see below), a text string chunk may \r
-be 0 to 255 characters long. Such a string is readily converted to \r
-a C string or a Pascal STRING[255]. The ckID of a property must be \r
-the property name, not "TEXT".\r
-\r
-When used as a part of a chunk or data property, restricted C string \r
-format is normally used. That means 0 to 255 characters followed by \r
-a NUL byte (ASCII value 0).\r
-\r
-Data Properties\r
-\r
-Data properties specify attributes for following (non-property) chunks. \r
-A data property essentially says "identifier = value", for example \r
-"XY = (10, 200)", telling something about following chunks. Properties \r
-may only appear inside data sections ("FORM" chunks, cf. Data Sections) \r
-and property sections ("PROP" chunks, cf. Group PROP).\r
-\r
-The form of a data property is a special case of Chunk. The ckID is \r
-a property name as well as a property type. The ckSize should be small \r
-since data properties are intended to be accumulated in RAM when reading \r
-a file. (256 bytes is a reasonable upper bound.) Syntactically:\r
-\r
-Property::= Chunk\r
-\r
-When designing a data object, use properties to describe context information \r
-like the size of an image, even if they don't vary in your program. \r
-Other programs will need this information.\r
-\r
-Think of property settings as assignments to variables in a programming \r
-language. Multiple assignments are redundant and local assignments \r
-temporarily override global assignments. The order of assignments \r
-doesn't matter as long as they precede the affected chunks. (Cf. LISTs, \r
-CATs, and Shared Properties.)\r
-\r
-Each object type (FORM type) is a local name space for property IDs. \r
-Think of a "CMAP" property in a "FORM ILBM" as the qualified ID "ILBM.CMAP". \r
-Property IDs specified when an object type is designed (and therefore \r
-known to all clients) are called "standard" while specialized ones \r
-added later are "nonstandard".\r
-\r
-Links\r
-\r
-Issue: A standard mechanism for "links" or "cross references" is very \r
-desirable for things like combining images and sounds into animations. \r
-Perhaps we'll define "link" chunks within FORMs that refer to other \r
-FORMs or to specific chunks within the same and other FORMs. This \r
-needs further work. EA IFF 1985 has no standard link mechanism.\r
-\r
-For now, it may suffice to read a list of, say, musical instruments, \r
-and then just refer to them within a musical score by index number.\r
-\r
-File References\r
-\r
-Issue: We may need a standard form for references to other files. \r
-A "file ref" could name a directory and a file in the same type of \r
-operating system as the ref's originator. Following the reference \r
-would expect the file to be on some mounted volume. In a network environment, \r
-a file ref could name a server, too.\r
-\r
-Issue: How can we express operating-system independent file refs?\r
-\r
-Issue: What about a means to reference a portion of another file? \r
-Would this be a "file ref" plus a reference to a "link" within the \r
-target file?\r
-\r
-\r
-\f\r
-4. Data Sections\r
-\r
-The first thing we need of a file is to check: Does it contain IFF \r
-data and, if so, does it contain the kind of data we're looking for? \r
-So we come to the notion of a "data section".\r
-\r
-A "data section" or IFF "FORM" is one self-contained "data object" \r
-that might be stored in a file by itself. It is one high level data \r
-object such as a picture or a sound effect. The IFF structure "FORM" \r
-makes it self- identifying. It could be a composite object like a \r
-musical score with nested musical instrument descriptions.\r
-\r
-Group FORM\r
-\r
-A data section is a chunk with ckID "FORM" and this arrangement:\r
-\r
-FORM    ::= "FORM" #{ FormType (LocalChunk | FORM | LIST | CAT)* \r
-}\r
-FormType::= ID\r
-LocalChunk      ::= Property | Chunk\r
-\r
-The ID "FORM" is a syntactic keyword like "struct" in C. Think of \r
-a "struct ILBM" containing a field "CMAP". If you see "FORM" you'll \r
-know to expect a FORM type ID (the structure name, "ILBM" in this \r
-example) and a particular contents arrangement or "syntax" (local \r
-chunks, FORMs, LISTs, and CATs). (LISTs and CATs are discussed in \r
-part 5, below.) A "FORM ILBM", in particular, might contain a local \r
-chunk "CMAP", an "ILBM.CMAP" (to use a qualified name).\r
-\r
-So the chunk ID "FORM" indicates a data section. It implies that the \r
-chunk contains an ID and some number of nested chunks. In reading \r
-a FORM, like any other chunk, programs must respect its ckSize as \r
-a virtual end-of-file for reading its contents, even if they're truncated.\r
-\r
-The FormType (or FORM type) is a restricted ID that may not contain \r
-lower case letters or punctuation characters. (Cf. Type IDs. Cf. Single \r
-Purpose Files.)\r
-\r
-The type-specific information in a FORM is composed of its "local \r
-chunks": data properties and other chunks. Each FORM type is a local \r
-name space for local chunk IDs. So "CMAP" local chunks in other FORM \r
-types may be unrelated to "ILBM.CMAP". More than that, each FORM type \r
-defines semantic scope. If you know what a FORM ILBM is, you'll know \r
-what an ILBM.CMAP is.\r
-\r
-Local chunks defined when the FORM type is designed (and therefore \r
-known to all clients of this type) are called "standard" while specialized \r
-ones added later are "nonstandard".\r
-\r
-Among the local chunks, property chunks give settings for various \r
-details like text font while the other chunks supply the essential \r
-information. This distinction is not clear cut. A property setting \r
-cancelled by a later setting of the same property has effect only \r
-on data chunks in between. E.g. in the sequence:\r
-\r
-prop1 = x  (propN = value)*  prop1 = y\r
-\r
-where the propNs are not prop1, the setting prop1 = x has no effect.\r
-\r
-The following universal chunk IDs are reserved inside any FORM: "LIST", \r
-"FORM", "PROP", "CAT ", "JJJJ", "LIS1" through "LIS9", "FOR1" through \r
-"FOR9", and "CAT1" through "CAT9". (Cf. Chunks. Cf. Group LIST. Cf. \r
-Group PROP.) For clarity, these universal chunk names may not be FORM \r
-type IDs, either.\r
-\r
-Part 5, below, talks about grouping FORMs into LISTs and CATs. They \r
-let you group a bunch of FORMs but don't impose any particular meaning \r
-or constraints on the grouping. Read on.\r
-\r
-Composite FORMs\r
-\r
-A FORM chunk inside a FORM is a full-fledged data section. This means \r
-you can build a composite object like a multi-frame animation sequence \r
-from available picture FORMs and sound effect FORMs. You can insert \r
-additional chunks with information like frame rate and frame count.\r
-\r
-Using composite FORMs, you leverage on existing programs that create \r
-and edit the component FORMs. Those editors may even look into your \r
-composite object to copy out its type of component, although it'll \r
-be the rare program that's fancy enough to do that. Such editors are \r
-not allowed to replace their component objects within your composite \r
-object. That's because the IFF standard lets you specify consistency \r
-requirements for the composite FORM such as maintaining a count or \r
-a directory of the components. Only programs that are written to uphold \r
-the rules of your FORM type should create or modify such FORMs.\r
-\r
-Therefore, in designing a program that creates composite objects, \r
-you are strongly requested to provide a facility for your users to \r
-import and export the nested FORMs. Import and export could move the \r
-data through a clipboard or a file.\r
-\r
-Here are several existing FORM types and rules for defining new ones.\r
-\r
-FTXT\r
-\r
-An FTXT data section contains text with character formatting information \r
-like fonts and faces. It has no paragraph or document formatting information \r
-like margins and page headers. FORM FTXT is well matched to the text \r
-representation in Amiga's Intuition environment. See the supplemental \r
-document "FTXT" IFF Formatted Text.\r
-\r
-ILBM\r
-\r
-"ILBM" is an InterLeaved BitMap image with color map; a machine-independent \r
-format for raster images. FORM ILBM is the standard image file format \r
-for the Commodore-Amiga computer and is useful in other environments, \r
-too. See the supplemental document "ILBM" IFF Interleaved Bitmap.\r
-\r
-PICS\r
-\r
-The data chunk inside a "PICS" data section has ID "PICT" and holds \r
-a QuickDraw picture. Issue: Allow more than one PICT in a PICS? See \r
-Inside Macintosh chapter "QuickDraw" for details on PICTs and how \r
-to create and display them on the Macintosh computer.\r
-\r
-The only standard property for PICS is "XY", an optional property \r
-that indicates the position of the PICT relative to "the big picture". \r
-The contents of an XY is a QuickDraw Point.\r
-\r
-Note: PICT may be limited to Macintosh use, in which case there'll \r
-be another format for structured graphics in other environments.\r
-\r
-Other Macintosh Resource Types\r
-\r
-Some other Macintosh resource types could be adopted for use within \r
-IFF files; perhaps MWRT, ICN, ICN#, and STR#.\r
-\r
-Issue: Consider the candidates and reserve some more IDs.\r
-\r
-Designing New Data Sections\r
-\r
-Supplemental documents will define additional object types. A supplement \r
-needs to specify the object's purpose, its FORM type ID, the IDs and \r
-formats of standard local chunks, and rules for generating and interpreting \r
-the data. It's a good idea to supply typedefs and an example source \r
-program that accesses the new object. See "ILBM" IFF Interleaved Bitmap \r
-for a good example.\r
-\r
-Anyone can pick a new FORM type ID but should reserve it with Electronic \r
-Arts at their earliest convenience. [Issue: EA contact person? Hand \r
-this off to another organization?] While decentralized format definitions \r
-and extensions are possible in IFF, our preference is to get design \r
-consensus by committee, implement a program to read and write it, \r
-perhaps tune the format, and then publish the format with example \r
-code. Some organization should remain in charge of answering questions \r
-and coordinating extensions to the format.\r
-\r
-If it becomes necessary to revise the design of some data section, \r
-its FORM type ID will serve as a version number (Cf. Type IDs). E.g. \r
-a revised "VDEO" data section could be called "VDE1". But try to get \r
-by with compatible revisions within the existing FORM type.\r
-\r
-In a new FORM type, the rules for primitive data types and word-alignment \r
-(Cf. Primitive Data Types) may be overriden for the contents of its \r
-local chunks but not for the chunk structure itself if your documentation \r
-spells out the deviations. If machine-specific type variants are needed, \r
-e.g. to store vast numbers of integers in reverse bit order, then \r
-outline the conversion algorithm and indicate the variant inside each \r
-file, perhaps via different FORM types. Needless to say, variations \r
-should be minimized.\r
-\r
-In designing a FORM type, encapsulate all the data that other programs \r
-will need to interpret your files. E.g. a raster graphics image should \r
-specify the image size even if your program always uses 320 x 200 \r
-pixels x 3 bitplanes. Receiving programs are then empowered to append \r
-or clip the image rectangle, to add or drop bitplanes, etc. This enables \r
-a lot more compatibility.\r
-\r
-Separate the central data (like musical notes) from more specialized \r
-information (like note beams) so simpler programs can extract the \r
-central parts during read-in. Leave room for expansion so other programs \r
-can squeeze in new kinds of information (like lyrics). And remember \r
-to keep the property chunks manageably short let's say 2 256 bytes.\r
-\r
-When designing a data object, try to strike a good tradeoff between \r
-a super-general format and a highly-specialized one. Fit the details \r
-to at least one particular need, for example a raster image might \r
-as well store pixels in the current machine's scan order. But add \r
-the kind of generality that makes it usable with foreseeable hardware \r
-and software. E.g. use a whole byte for each red, green, and blue \r
-color value even if this year's computer has only 4-bit video DACs. \r
-Think ahead and help other programs so long as the overhead is acceptable. \r
-E.g. run compress a raster by scan line rather than as a unit so future \r
-programs can swap images by scan line to and from secondary storage.\r
-\r
-Try to design a general purpose "least common multiple" format that \r
-encompasses the needs of many programs without getting too complicated. \r
-Let's coalesce our uses around a few such formats widely separated \r
-in the vast design space. Two factors make this flexibility and simplicity \r
-practical. First, file storage space is getting very plentiful, so \r
-compaction is not a priority. Second, nearly any locally-performed \r
-data conversion work during file reading and writing will be cheap \r
-compared to the I/O time.\r
-\r
-It must be ok to copy a LIST or FORM or CAT intact, e.g. to incorporate \r
-it into a composite FORM. So any kind of internal references within \r
-a FORM must be relative references. They could be relative to the \r
-start of the containing FORM, relative from the referencing chunk, \r
-or a sequence number into a collection.\r
-\r
-With composite FORMs, you leverage on existing programs that create \r
-and edit the components. If you write a program that creates composite \r
-objects, please provide a facility for your users to import and export \r
-the nested FORMs. The import and export functions may move data through \r
-a separate file or a clipboard.\r
-\r
-Finally, don't forget to specify all implied rules in detail.\r
-\r
-\r
-\f\r
-5. LISTs, CATs, and Shared Properties\r
-\r
-Data often needs to be grouped together like a list of icons. Sometimes \r
-a trick like arranging little images into a big raster works, but \r
-generally they'll need to be structured as a first class group. The \r
-objects "LIST" and "CAT" are IFF-universal mechanisms for this purpose.\r
-\r
-Property settings sometimes need to be shared over a list of similar \r
-objects. E.g. a list of icons may share one color map. LIST provides \r
-a means called "PROP" to do this. One purpose of a LIST is to define \r
-the scope of a PROP. A "CAT", on the other hand, is simply a concatenation \r
-of objects.\r
-\r
-Simpler programs may skip LISTs and PROPs altogether and just handle \r
-FORMs and CATs. All "fully-conforming" IFF programs also know about \r
-"CAT ", "LIST", and "PROP". Any program that reads a FORM inside a \r
-LIST must process shared PROPs to correctly interpret that FORM.\r
-\r
-Group CAT\r
-\r
-A CAT is just an untyped group of data objects.\r
-\r
-Structurally, a CAT is a chunk with chunk ID "CAT " containing a "contents \r
-type" ID followed by the nested objects. The ckSize of each contained \r
-chunk is essentially a relative pointer to the next one.\r
-\r
-CAT     ::= "CAT " #{ ContentsType (FORM | LIST | CAT)* }\r
-ContentsType    ::= ID  -- a hint or an "abstract data type" ID\r
-\r
-In reading a CAT, like any other chunk, programs must respect it's \r
-ckSize as a virtual end-of-file for reading the nested objects even \r
-if they're malformed or truncated.\r
-\r
-The "contents type" following the CAT's ckSize indicates what kind \r
-of FORMs are inside. So a CAT of ILBMs would store "ILBM" there. It's \r
-just a hint. It may be used to store an "abstract data type". A CAT \r
-could just have blank contents ID ("JJJJ") if it contains more than \r
-one kind of FORM.\r
-\r
-CAT defines only the format of the group. The group's meaning is open \r
-to interpretation. This is like a list in LISP: the structure of cells \r
-is predefined but the meaning of the contents as, say, an association \r
-list depends on use. If you need a group with an enforced meaning \r
-(an "abstract data type" or Smalltalk "subclass"), some consistency \r
-constraints, or additional data chunks, use a composite FORM instead \r
-(Cf. Composite FORMs).\r
-\r
-Since a CAT just means a concatenation of objects, CATs are rarely \r
-nested. Programs should really merge CATs rather than nest them.\r
-\r
-Group LIST\r
-\r
-A LIST defines a group very much like CAT but it also gives a scope \r
-for PROPs (see below). And unlike CATs, LISTs should not be merged \r
-without understanding their contents.\r
-\r
-Structurally, a LIST is a chunk with ckID "LIST" containing a "contents \r
-type" ID, optional shared properties, and the nested contents (FORMs, \r
-LISTs, and CATs), in that order. The ckSize of each contained chunk \r
-is a relative pointer to the next one. A LIST is not an arbitrary \r
-linked list the cells are simply concatenated.\r
-\r
-LIST    ::= "LIST" #{ ContentsType PROP* (FORM | LIST | CAT)* }\r
-ContentsType    ::= ID\r
-\r
-Group PROP\r
-\r
-PROP chunks may appear in LISTs (not in FORMs or CATs). They supply \r
-shared properties for the FORMs in that LIST. This ability to elevate \r
-some property settings to shared status for a list of forms is useful \r
-for both indirection and compaction. E.g. a list of images with the \r
-same size and colors can share one "size" property and one "color \r
-map" property. Individual FORMs can override the shared settings.\r
-\r
-The contents of a PROP is like a FORM with no data chunks:\r
-\r
-PROP    ::= "PROP" #{ FormType Property* }\r
-\r
-It means, "Here are the shared properties for FORM type <<FormType>."\r
-\r
-A LIST may have at most one PROP of a FORM type, and all the PROPs \r
-must appear before any of the FORMs or nested LISTs and CATs. You \r
-can have subsequences of FORMs sharing properties by making each subsequence \r
-a LIST.\r
-\r
-Scoping: Think of property settings as variable bindings in nested \r
-blocks of a programming language. Where in C you could write:\r
-\r
-TEXT_FONT text_font = Courier;  /* program's global default     */\r
-\r
-File(); {\r
-        TEXT_FONT text_font = TimesRoman;       /* shared setting       */\r
-\r
-                {\r
-                TEXT_FONT text_font = Helvetica;  /* local setting      */\r
-                Print("Hello ");/* uses font Helvetica  */\r
-                }\r
-\r
-                {\r
-                Print("there.");/* uses font TimesRoman */\r
-                }\r
-        }\r
-\r
-An IFF file could contain:\r
-\r
-LIST {\r
-        PROP TEXT {\r
-                FONT {TimesRoman}       /* shared setting       */\r
-                }\r
-\r
-        FORM TEXT {\r
-                FONT {Helvetica}/* local setting*/\r
-                CHRS {Hello }           /* uses font Helvetica  */\r
-                }\r
-\r
-        FORM TEXT {\r
-                CHRS {there.}   /* uses font TimesRoman */\r
-                }\r
-        }\r
-\r
-The shared property assignments selectively override the reader's \r
-global defaults, but only for FORMs within the group. A FORM's own \r
-property assignments selectively override the global and group-supplied \r
-values. So when reading an IFF file, keep property settings on a stack. \r
-They're designed to be small enough to hold in main memory.\r
-\r
-Shared properties are semantically equivalent to copying those properties \r
-into each of the nested FORMs right after their FORM type IDs.\r
-\r
-Properties for LIST\r
-\r
-Optional "properties for LIST" store the origin of the list's contents \r
-in a PROP chunk for the fake FORM type "LIST". They are the properties \r
-originating program "OPGM", processor family "OCPU", computer type \r
-"OCMP", computer serial number or network address "OSN ", and user \r
-name "UNAM". In our imperfect world, these could be called upon to \r
-distinguish between unintended variations of a data format or to work \r
-around bugs in particular originating/receiving program pairs. Issue: \r
-Specify the format of these properties.\r
-\r
-A creation date could also be stored in a property but let's ask that \r
-file creating, editing, and transporting programs maintain the correct \r
-date in the local file system. Programs that move files between machine \r
-types are expected to copy across the creation dates.\r
-\r
-\r
-\f\r
-6. Standard File Structure\r
-\r
-File Structure Overview\r
-\r
-An IFF file is just a single chunk of type FORM, LIST, or CAT. Therefore \r
-an IFF file can be recognized by its first 4 bytes: "FORM", "LIST", \r
-or "CAT ". Any file contents after the chunk's end are to be ignored.\r
-\r
-Since an IFF file can be a group of objects, programs that read/write \r
-single objects can communicate to an extent with programs that read/write \r
-groups. You're encouraged to write programs that handle all the objects \r
-in a LIST or CAT. A graphics editor, for example, could process a \r
-list of pictures as a multiple page document, one page at a time.\r
-\r
-Programs should enforce IFF's syntactic rules when reading and writing \r
-files. This ensures robust data transfer. The public domain IFF reader/writer \r
-subroutine package does this for you. A utility program "IFFCheck" \r
-is available that scans an IFF file and checks it for conformance \r
-to IFF's syntactic rules. IFFCheck also prints an outline of the chunks \r
-in the file, showing the ckID and ckSize of each. This is quite handy \r
-when building IFF programs. Example programs are also available to \r
-show details of reading and writing IFF files.\r
-\r
-A merge program "IFFJoin" will be available that logically appends \r
-IFF files into a single CAT group. It "unwraps" each input file that \r
-is a CAT so that the combined file isn't nested CATs.\r
-\r
-If we need to revise the IFF standard, the three anchoring IDs will \r
-be used as "version numbers". That's why IDs "FOR1" through "FOR9", \r
-"LIS1" through "LIS9", and "CAT1" through "CAT9" are reserved.\r
-\r
-IFF formats are designed for reasonable performance with floppy disks. \r
-We achieve considerable simplicity in the formats and programs by \r
-relying on the host file system rather than defining universal grouping \r
-structures like directories for LIST contents. On huge storage systems, \r
-IFF files could be leaf nodes in a file structure like a B-tree. Let's \r
-hope the host file system implements that for us!\r
-\r
-Thre are two kinds of IFF files: single purpose files and scrap files. \r
-They differ in the interpretation of multiple data objects and in \r
-the file's external type.\r
-\r
-Single Purpose Files\r
-\r
-A single purpose IFF file is for normal "document" and "archive" storage. \r
-This is in contrast with "scrap files" (see below) and temporary backing \r
-storage (non-interchange files).\r
-\r
-The external file type (or filename extension, depending on the host \r
-file system) indicates the file's contents. It's generally the FORM \r
-type of the data contained, hence the restrictions on FORM type IDs.\r
-\r
-Programmers and users may pick an "intended use" type as the filename \r
-extension to make it easy to filter for the relevant files in a filename \r
-requestor. This is actually a "subclass" or "subtype" that conveniently \r
-separates files of the same FORM type that have different uses. Programs \r
-cannot demand conformity to its expected subtypes without overly restricting \r
-data interchange since they cannot know about the subtypes to be used \r
-by future programs that users will want to exchange data with.\r
-\r
-Issue: How to generate 3-letter MS-DOS extensions from 4-letter FORM \r
-type IDs?\r
-\r
-Most single purpose files will be a single FORM (perhaps a composite \r
-FORM like a musical score containing nested FORMs like musical instrument \r
-descriptions). If it's a LIST or a CAT, programs should skip over \r
-unrecognized objects to read the recognized ones or the first recognized \r
-one. Then a program that can read a single purpose file can read something \r
-out of a "scrap file", too.\r
-\r
-Scrap Files\r
-\r
-A "scrap file" is for maximum interconnectivity in getting data between \r
-programs; the core of a clipboard function. Scrap files may have type \r
-"IFF " or filename extension ".IFF".\r
-\r
-A scrap file is typically a CAT containing alternate representations \r
-of the same basic information. Include as many alternatives as you \r
-can readily generate. This redundancy improves interconnectivity in \r
-situations where we can't make all programs read and write super-general \r
-formats. [Inside Macintosh chapter "Scrap Manager".] E.g. a graphically-\r
-annotated musical score might be supplemented by a stripped down 4-voice \r
-melody and by a text (the lyrics).\r
-\r
-The originating program should write the alternate representations \r
-in order of "preference": most preferred (most comprehensive) type \r
-to least preferred (least comprehensive) type. A receiving program \r
-should either use the first appearing type that it understands or \r
-search for its own "preferred" type.\r
-\r
-A scrap file should have at most one alternative of any type. (A LIST \r
-of same type objects is ok as one of the alternatives.) But don't \r
-count on this when reading; ignore extra sections of a type. Then \r
-a program that reads scrap files can read something out of single \r
-purpose files.\r
-\r
-Rules for Reader Programs\r
-\r
-Here are some notes on building programs that read IFF files. If you \r
-use the standard IFF reader module "IFFR.C", many of these rules and \r
-details will be automatically handled. (See "Support Software" in \r
-Appendix A.) We recommend that you start from the example program \r
-"ShowILBM.C". You should also read up on recursive descent parsers. \r
-[See, for example, Compiler Construction, An Advanced Course.]\r
-\r
-%       The standard is very flexible so many programs can exchange \r
-data. This implies a program has to scan the file and react to what's \r
-actually there in whatever order it appears. An IFF reader program \r
-is a parser.\r
-\r
-%       For interchange to really work, programs must be willing to \r
-do some conversion during read-in. If the data isn't exactly what \r
-you expect, say, the raster is smaller than those created by your \r
-program, then adjust it. Similarly, your program could crop a large \r
-picture, add or drop bitplanes, and create/discard a mask plane. The \r
-program should give up gracefully on data that it can't convert.\r
-\r
-%       If it doesn't start with "FORM", "LIST", or "CAT ", it's not \r
-an IFF-85 file.\r
-\r
-%       For any chunk you encounter, you must recognize its type ID \r
-to understand its contents.\r
-\r
-%       For any FORM chunk you encounter, you must recognize its FORM \r
-type ID to understand the contained "local chunks". Even if you don't \r
-recognize the FORM type, you can still scan it for nested FORMs, LISTs, \r
-and CATs of interest.\r
-\r
-%       Don't forget to skip the pad byte after every odd-length chunk.\r
-\r
-%       Chunk types LIST, FORM, PROP, and CAT are generic groups. They \r
-always contain a subtype ID followed by chunks.\r
-\r
-%       Readers ought to handle a CAT of FORMs in a file. You may treat \r
-the FORMs like document pages to sequence through or just use the \r
-first FORM.\r
-\r
-%       Simpler IFF readers completely skip LISTs. "Fully IFF-conforming" \r
-readers are those that handle LISTs, even if just to read the first \r
-FORM from a file. If you do look into a LIST, you must process shared \r
-properties (in PROP chunks) properly. The idea is to get the correct \r
-data or none at all.\r
-\r
-%       The nicest readers are willing to look into unrecognized FORMs \r
-for nested FORM types that they do recognize. For example, a musical \r
-score may contain nested instrument descriptions and an animation \r
-file may contain still pictures.\r
-\r
-Note to programmers: Processing PROP chunks is not simple! You'll \r
-need some background in interpreters with stack frames. If this is \r
-foreign to you, build programs that read/write only one FORM per file. \r
-For the more intrepid programmers, the next paragraph summarizes how \r
-to process LISTs and PROPs. See the general IFF reader module "IFFR.C" \r
-and the example program "ShowILBM.C" for details.\r
-\r
-Allocate a stack frame for every LIST and FORM you encounter and initialize \r
-it by copying the stack frame of the parent LIST or FORM. At the top \r
-level, you'll need a stack frame initialized to your program's global \r
-defaults. While reading each LIST or FORM, store all encountered properties \r
-into the current stack frame. In the example ShowILBM, each stack \r
-frame has a place for a bitmap header property ILBM.BMHD and a color \r
-map property ILBM.CMAP. When you finally get to the ILBM's BODY chunk, \r
-use the property settings accumulated in the current stack frame.\r
-\r
-An alternate implementation would just remember PROPs encountered, \r
-forgetting each on reaching the end of its scope (the end of the containing \r
-LIST). When a FORM XXXX is encountered, scan the chunks in all remembered \r
-PROPs XXXX, in order, as if they appeared before the chunks actually \r
-in the FORM XXXX. This gets trickier if you read FORMs inside of FORMs.\r
-\r
-Rules for Writer Programs\r
-\r
-Here are some notes on building programs that write IFF files, which \r
-is much easier than reading them. If you use the standard IFF writer \r
-module "IFFW.C" (see "Support Software" in Appendix A), many of these \r
-rules and details will automatically be enforced. See the example \r
-program "Raw2ILBM.C".\r
-\r
-%       An IFF file is a single FORM, LIST, or CAT chunk.\r
-\r
-%       Any IFF-85 file must start with the 4 characters "FORM", "LIST", \r
-or "CAT ", followed by a LONG ckSize. There should be no data after \r
-the chunk end.\r
-\r
-%       Chunk types LIST, FORM, PROP, and CAT are generic. They always \r
-contain a subtype ID followed by chunks. These three IDs are universally \r
-reserved, as are "LIS1" through "LIS9", "FOR1" through "FOR9", "CAT1" \r
-through "CAT9", and "    ".\r
-\r
-%       Don't forget to write a 0 pad byte after each odd-length chunk.\r
-\r
-%       Four techniques for writing an IFF group: (1) build the data \r
-in a file mapped into virtual memory, (2) build the data in memory \r
-blocks and use block I/O, (3) stream write the data piecemeal and \r
-(don't forget!) random access back to set the group length count, \r
-and (4) make a preliminary pass to compute the length count then stream \r
-write the data.\r
-\r
-%       Do not try to edit a file that you don't know how to create. \r
-Programs may look into a file and copy out nested FORMs of types that \r
-they recognize, but don't edit and replace the nested FORMs and don't \r
-add or remove them. That could make the containing structure inconsistent. \r
-You may write a new file containing items you copied (or copied and \r
-modified) from another IFF file, but don't copy structural parts you \r
-don't understand.\r
-\r
-%       You must adhere to the syntax descriptions in Appendex A. E.g. \r
-PROPs may only appear inside LISTs.\r
-\r
-\r
-\r
-\f\r
-Appendix A. Reference\r
-\r
-Type Definitions\r
-\r
-The following C typedefs describe standard IFF structures. Declarations \r
-to use in practice will vary with the CPU and compiler. For example, \r
-68000 Lattice C produces efficient comparison code if we define ID \r
-as a "LONG". A macro "MakeID" builds these IDs at compile time.\r
-\r
-/* Standard IFF types, expressed in 68000 Lattice C.    */\r
-\r
-typedef unsigned char UBYTE;    /*  8 bits unsigned     */\r
-typedef short WORD;     /* 16 bits signed       */\r
-typedef unsigned short UWORD;   /* 16 bits unsigned     */\r
-typedef long LONG;      /* 32 bits signed       */\r
-\r
-typedef char ID[4];     /* 4 chars in ' ' through '~'   */\r
-\r
-typedef struct {\r
-        ID      ckID;\r
-        LONG    ckSize; /* sizeof(ckData)       */\r
-        UBYTE   ckData[/* ckSize */];\r
-        } Chunk;\r
-\r
-/* ID typedef and builder for 68000 Lattice C. */\r
-typedef LONG ID;        /* 4 chars in ' ' through '~'   */\r
-#define MakeID(a,b,c,d) ( (a)<<<<24 | (b)<<<<16 | (c)<<<<8 | (d) )\r
-\r
-/* Globally reserved IDs. */\r
-#define ID_FORM   MakeID('F','O','R','M')\r
-#define ID_LIST   MakeID('L','I','S','T')\r
-#define ID_PROP   MakeID('P','R','O','P')\r
-#define ID_CAT    MakeID('C','A','T',' ')\r
-#define ID_FILLER MakeID(' ',' ',' ',' ')\r
-\r
-Syntax Definitions\r
-\r
-Here's a collection of the syntax definitions in this document.\r
-\r
-Chunk   ::= ID #{ UBYTE* } [0]\r
-\r
-Property::= Chunk\r
-\r
-FORM    ::= "FORM" #{ FormType (LocalChunk | FORM | LIST | CAT)* \r
-}\r
-FormType::= ID\r
-LocalChunk      ::= Property | Chunk\r
-\r
-CAT     ::= "CAT " #{ ContentsType (FORM | LIST | CAT)* }\r
-ContentsType    ::= ID  -- a hint or an "abstract data type" ID\r
-\r
-LIST    ::= "LIST" #{ ContentsType PROP* (FORM | LIST | CAT)* }\r
-PROP    ::= "PROP" #{ FormType Property* }\r
-\r
-In this extended regular expression notation, the token "#" represents \r
-a ckSize LONG count of the following {braced} data bytes. Literal \r
-items are shown in "quotes", [square bracketed items] are optional, \r
-and "*" means 0 or more instances. A sometimes-needed pad byte is \r
-shown as "[0]".\r
-\r
-Defined Chunk IDs\r
-\r
-This is a table of currently defined chunk IDs. We may also borrow \r
-some Macintosh IDs and data formats.\r
-\r
-Group chunk IDs\r
-        FORM, LIST, PROP, CAT.\r
-Future revision group chunk IDs\r
-        FOR1 I FOR9, LIS1 I LIS9, CAT1 I CAT9.\r
-FORM type IDs\r
-        (The above group chunk IDs may not be used for FORM type IDs.)\r
-        (Lower case letters and punctuation marks are forbidden in FORM \r
-type IDs.)\r
-        8SVX 8-bit sampled sound voice, ANBM animated bitmap, FNTR raster \r
-font, FNTV vector font, FTXT formatted text, GSCR general-use musical \r
-score, ILBM interleaved raster bitmap image, PDEF Deluxe Print page \r
-definition, PICS Macintosh picture, PLBM (obsolete), USCR Uhuru Sound \r
-Software musical score, UVOX Uhuru Sound Software Macintosh voice, \r
-SMUS simple musical score, VDEO Deluxe Video Construction Set video.\r
-Data chunk IDs\r
-        "JJJJ", TEXT, PICT.\r
-PROP LIST property IDs\r
-        OPGM, OCPU, OCMP, OSN, UNAM.\r
-\r
-\r
-\f\r
-Support Software\r
-\r
-These public domain C source programs are available for use in building \r
-IFF-compatible programs:\r
-\r
-IFF.H, IFFR.C, IFFW.C   \r
-\r
-                IFF reader and writer package. \r
-                These modules handle many of the details of reliably \r
-                reading and writing IFF files.\r
-\r
-IFFCheck.C      This handy utility program scans an IFF file, checks \r
-                that the contents are well formed, and prints an outline \r
-                of the chunks.\r
-\r
-PACKER.H, Packer.C, UnPacker.C  \r
-\r
-                Run encoder and decoder used for ILBM files.\r
-\r
-ILBM.H, ILBMR.C, ILBMW.C\r
-\r
-                Reader and writer support routines for raster image \r
-                FORM ILBM. ILBMR calls IFFR and UnPacker. ILBMW calls \r
-                IFFW and Packer.\r
-\r
-ShowILBM.C      \r
-                Example caller of IFFR and ILBMR modules. This \r
-                Commodore-Amiga program reads and displays a FORM ILBM.\r
-Raw2ILBM.C      \r
-                Example ILBM writer program. As a demonstration, it \r
-                reads a raw raster image file and writes the image \r
-                as a FORM ILBM file.\r
-ILBM2Raw.C      \r
-                Example ILBM reader program.  Reads a FORM ILBM file\r
-                and writes it into a raw raster image.\r
-\r
-REMALLOC.H, Remalloc.c\r
-\r
-                Memory allocation routines used in these examples.\r
-\r
-INTUALL.H       generic "include almost everything" include-file\r
-                with the sequence of includes correctly specified.\r
-\r
-READPICT.H, ReadPict.c  \r
-\r
-                given an ILBM file, read it into a bitmap and \r
-                a color map\r
-\r
-PUTPICT.H, PutPict.c    \r
-\r
-                given a bitmap and a color map, save it as\r
-                an ILBM file.\r
-\r
-GIO.H, Gio.c    generic I/O speedup package.  Attempts to speed\r
-                disk I/O by buffering writes and reads.\r
-\r
-giocall.c       sample call to gio.\r
-\r
-ilbmdump.c      reads in ILBM file, prints out ascii representation\r
-                for including in C files.\r
-\r
-bmprintc.c      prints out a C-language representation of data for\r
-                a bitmap.\r
-\r
-\r
-\f\r
-Example Diagrams\r
-\r
-Here's a box diagram for an example IFF file, a raster image FORM \r
-ILBM. This FORM contains a bitmap header property chunk BMHD, a color \r
-map property chunk CMAP, and a raster data chunk BODY. This particular \r
-raster is 320 x 200 pixels x 3 bit planes uncompressed. The "0" after \r
-the CMAP chunk represents a zero pad byte; included since the CMAP \r
-chunk has an odd length. The text to the right of the diagram shows \r
-the outline that would be printed by the IFFCheck utility program \r
-for this particular file.\r
-\r
-        +-----------------------------------+\r
-        |'FORM'         24070               |   FORM 24070 IBLM\r
-        +-----------------------------------+\r
-        |'ILBM'                             |\r
-        +-----------------------------------+\r
-        | +-------------------------------+ |\r
-        | | 'BMHD'      20                | |   .BMHD  20\r
-        | | 320, 200, 0, 0, 3, 0, 0, ...  | |\r
-        | + ------------------------------+ |\r
-        | | 'CMAP'      21                | |   .CMAP  21\r
-        | | 0, 0, 0; 32, 0, 0; 64,0,0; .. | |\r
-        | +-------------------------------+ |\r
-        | 0                                 |\r
-        +-----------------------------------+\r
-        |'BODY'         24000               |   .BODY 24000\r
-        |0, 0, 0, ...                       |\r
-        +-----------------------------------+\r
-\r
-This second diagram shows a LIST of two FORMs ILBM sharing a common \r
-BMHD property and a common CMAP property. Again, the text on the right \r
-is an outline  a la IFFCheck.\r
-\r
-\r
-     +-----------------------------------------+\r
-     |'LIST'            48114                  |  LIST  48114  AAAA\r
-     +-----------------------------------------+\r
-     |'AAAA'                                   |  .PROP  62  ILBM\r
-     |  +-----------------------------------+  |\r
-     |  |'PROP'         62                  |  |  \r
-     |  +-----------------------------------+  |\r
-     |  |'ILBM'                             |  |\r
-     |  +-----------------------------------+  |\r
-     |  | +-------------------------------+ |  |\r
-     |  | | 'BMHD'      20                | |  |  ..BMHD  20\r
-     |  | | 320, 200, 0, 0, 3, 0, 0, ...  | |  |\r
-     |  | | ------------------------------+ |  |\r
-     |  | | 'CMAP'      21                | |  |  ..CMAP  21\r
-     |  | | 0, 0, 0; 32, 0, 0; 64,0,0; .. | |  |\r
-     |  | +-------------------------------+ |  |\r
-     |  | 0                                 |  |\r
-     |  +-----------------------------------+  |\r
-     |  +-----------------------------------+  |\r
-     |  |'FORM'         24012               |  |  .FORM  24012  ILBM\r
-     |  +-----------------------------------+  |\r
-     |  |'ILBM'                             |  |  \r
-     |  +-----------------------------------+  |\r
-     |  |  +-----------------------------+  |  |\r
-     |  |  |'BODY'              24000    |  |  |  ..BODY  24000\r
-     |  |  |0, 0, 0, ...         |  |  |\r
-     |  |  +-----------------------------+  |  |\r
-     |  +-----------------------------------+  |\r
-     |  +-----------------------------------+  |\r
-     |  |'FORM'         24012               |  |  .FORM  24012  ILBM\r
-     |  +-----------------------------------+  |\r
-     |  |'ILBM'                             |  |\r
-     |  +-----------------------------------+  |\r
-     |  |  +-----------------------------+  |  |\r
-     |  |  |'BODY'              24000    |  |  |  ..BODY  24000\r
-     |  |  |0, 0, 0, ...         |  |  |\r
-     |  |  +-----------------------------+  |  |\r
-     |  +-----------------------------------+  |\r
-     +-----------------------------------------+\r
-\r
-\r
-\f\r
-Appendix B. Standards Committee\r
-\r
-The following people contributed to the design of this IFF standard:\r
-\r
-Bob "Kodiak" Burns, Commodore-Amiga\r
-R. J. Mical, Commodore-Amiga\r
-Jerry Morrison, Electronic Arts\r
-Greg Riker, Electronic Arts\r
-Steve Shaw, Electronic Arts\r
-Barry Walsh, Commodore-Amiga\r
diff --git a/16/PCGPE10/INTEL.DOC b/16/PCGPE10/INTEL.DOC
deleted file mode 100644 (file)
index bd7d758..0000000
+++ /dev/null
@@ -1,2807 +0,0 @@
-\r
-Intel 8086 Family Architecture. . . . . . . . . . . . . . . . . . . . .   3\r
-\r
-Instruction Clock Cycle Calculation . . . . . . . . . . . . . . . . . .   3\r
-\r
-8088/8086  Effective Address (EA) Calculation . . . . . . . . . . . . .   3\r
-\r
-Task State Calculation. . . . . . . . . . . . . . . . . . . . . . . . .   4\r
-\r
-FLAGS - Intel 8086 Family Flags Register. . . . . . . . . . . . . . . .   4\r
-\r
-MSW - Machine Status Word (286+ only) . . . . . . . . . . . . . . . . .   5\r
-\r
-8086/80186/80286/80386/80486 Instruction Set. . . . . . . . . . . . . .   6\r
-     AAA - Ascii Adjust for Addition. . . . . . . . . . . . . . . . . .   6\r
-     AAD - Ascii Adjust for Division. . . . . . . . . . . . . . . . . .   6\r
-     AAM - Ascii Adjust for Multiplication. . . . . . . . . . . . . . .   6\r
-     AAS - Ascii Adjust for Subtraction . . . . . . . . . . . . . . . .   6\r
-     ADC - Add With Carry . . . . . . . . . . . . . . . . . . . . . . .   7\r
-     ADD - Arithmetic Addition. . . . . . . . . . . . . . . . . . . . .   7\r
-     AND - Logical And. . . . . . . . . . . . . . . . . . . . . . . . .   7\r
-     ARPL - Adjusted Requested Privilege Level of Selector (286+ PM). .   7\r
-     BOUND - Array Index Bound Check (80188+) . . . . . . . . . . . . .   8\r
-     BSF - Bit Scan Forward (386+). . . . . . . . . . . . . . . . . . .   8\r
-     BSR - Bit Scan Reverse  (386+) . . . . . . . . . . . . . . . . . .   8\r
-     BSWAP - Byte Swap       (486+) . . . . . . . . . . . . . . . . . .   8\r
-     BT - Bit Test           (386+) . . . . . . . . . . . . . . . . . .   9\r
-     BTC - Bit Test with Compliment (386+). . . . . . . . . . . . . . .   9\r
-     BTR - Bit Test with Reset (386+) . . . . . . . . . . . . . . . . .   9\r
-     BTS - Bit Test and Set  (386+) . . . . . . . . . . . . . . . . . .   9\r
-     CALL - Procedure Call. . . . . . . . . . . . . . . . . . . . . . .  10\r
-     CBW - Convert Byte to Word . . . . . . . . . . . . . . . . . . . .  10\r
-     CDQ - Convert Double to Quad (386+). . . . . . . . . . . . . . . .  10\r
-     CLC - Clear Carry. . . . . . . . . . . . . . . . . . . . . . . . .  11\r
-     CLD - Clear Direction Flag . . . . . . . . . . . . . . . . . . . .  11\r
-     CLI - Clear Interrupt Flag (disable) . . . . . . . . . . . . . . .  11\r
-     CLTS - Clear Task Switched Flag (286+ privileged). . . . . . . . .  11\r
-     CMC - Complement Carry Flag. . . . . . . . . . . . . . . . . . . .  11\r
-     CMP - Compare. . . . . . . . . . . . . . . . . . . . . . . . . . .  12\r
-     CMPS - Compare String (Byte, Word or Doubleword) . . . . . . . . .  12\r
-     CMPXCHG - Compare and Exchange . . . . . . . . . . . . . . . . . .  12\r
-     CWD - Convert Word to Doubleword . . . . . . . . . . . . . . . . .  12\r
-     CWDE - Convert Word to Extended Doubleword (386+). . . . . . . . .  13\r
-     DAA - Decimal Adjust for Addition. . . . . . . . . . . . . . . . .  13\r
-     DAS - Decimal Adjust for Subtraction . . . . . . . . . . . . . . .  13\r
-     DEC - Decrement. . . . . . . . . . . . . . . . . . . . . . . . . .  13\r
-     DIV - Divide . . . . . . . . . . . . . . . . . . . . . . . . . . .  13\r
-     ENTER - Make Stack Frame  (80188+) . . . . . . . . . . . . . . . .  14\r
-     ESC - Escape . . . . . . . . . . . . . . . . . . . . . . . . . . .  14\r
-     HLT - Halt CPU . . . . . . . . . . . . . . . . . . . . . . . . . .  14\r
-     IDIV - Signed Integer Division . . . . . . . . . . . . . . . . . .  14\r
-     IMUL - Signed Multiply . . . . . . . . . . . . . . . . . . . . . .  15\r
-     IN - Input Byte or Word From Port. . . . . . . . . . . . . . . . .  15\r
-     INC - Increment. . . . . . . . . . . . . . . . . . . . . . . . . .  16\r
-     INS - Input String from Port  (80188+) . . . . . . . . . . . . . .  16\r
-     INT - Interrupt. . . . . . . . . . . . . . . . . . . . . . . . . .  16\r
-     INTO - Interrupt on Overflow . . . . . . . . . . . . . . . . . . .  17\r
-     INVD - Invalidate Cache  (486+). . . . . . . . . . . . . . . . . .  17\r
-     INVLPG - Invalidate Translation Look-Aside Buffer Entry (486+) . .  17\r
-     IRET/IRETD - Interrupt Return. . . . . . . . . . . . . . . . . . .  17\r
-     Jxx - Jump Instructions Table. . . . . . . . . . . . . . . . . . .  18\r
-     JCXZ/JECXZ - Jump if Register (E)CX is Zero. . . . . . . . . . . .  18\r
-     JMP - Unconditional Jump . . . . . . . . . . . . . . . . . . . . .  19\r
-     LAHF - Load Register AH From Flags . . . . . . . . . . . . . . . .  19\r
-     LAR - Load Access Rights (286+ protected). . . . . . . . . . . . .  19\r
-     LDS - Load Pointer Using DS. . . . . . . . . . . . . . . . . . . .  20\r
-     LEA - Load Effective Address . . . . . . . . . . . . . . . . . . .  20\r
-     LEAVE - Restore Stack for Procedure Exit (80188+). . . . . . . . .  20\r
-     LES - Load Pointer Using ES. . . . . . . . . . . . . . . . . . . .  20\r
-     LFS - Load Pointer Using FS (386+) . . . . . . . . . . . . . . . .  21\r
-     LGDT - Load Global Descriptor Table (286+ privileged). . . . . . .  21\r
-     LIDT - Load Interrupt Descriptor Table (286+ privileged) . . . . .  21\r
-     LGS - Load Pointer Using GS (386+) . . . . . . . . . . . . . . . .  21\r
-     LLDT - Load Local Descriptor Table (286+ privileged) . . . . . . .  22\r
-     LMSW - Load Machine Status Word (286+ privileged). . . . . . . . .  22\r
-     LOCK - Lock Bus. . . . . . . . . . . . . . . . . . . . . . . . . .  22\r
-     LODS - Load String (Byte, Word or Double). . . . . . . . . . . . .  22\r
-     LOOP - Decrement CX and Loop if CX Not Zero. . . . . . . . . . . .  23\r
-     LOOPE/LOOPZ - Loop While Equal / Loop While Zero . . . . . . . . .  23\r
-     LOOPNZ/LOOPNE - Loop While Not Zero / Loop While Not Equal . . . .  23\r
-     LSL - Load Segment Limit (286+ protected). . . . . . . . . . . . .  23\r
-     LSS - Load Pointer Using SS (386+) . . . . . . . . . . . . . . . .  24\r
-     LTR - Load Task Register (286+ privileged) . . . . . . . . . . . .  24\r
-     MOV - Move Byte or Word. . . . . . . . . . . . . . . . . . . . . .  24\r
-     MOVS - Move String (Byte or Word). . . . . . . . . . . . . . . . .  25\r
-     MOVSX - Move with Sign Extend (386+) . . . . . . . . . . . . . . .  25\r
-     MOVZX - Move with Zero Extend (386+) . . . . . . . . . . . . . . .  25\r
-     MUL - Unsigned Multiply. . . . . . . . . . . . . . . . . . . . . .  25\r
-     NEG - Two's Complement Negation. . . . . . . . . . . . . . . . . .  26\r
-     NOP - No Operation (90h) . . . . . . . . . . . . . . . . . . . . .  26\r
-     NOT - One's Compliment Negation (Logical NOT). . . . . . . . . . .  26\r
-     OR - Inclusive Logical OR. . . . . . . . . . . . . . . . . . . . .  26\r
-     OUT - Output Data to Port. . . . . . . . . . . . . . . . . . . . .  27\r
-     OUTS - Output String to Port  (80188+) . . . . . . . . . . . . . .  27\r
-     POP - Pop Word off Stack . . . . . . . . . . . . . . . . . . . . .  27\r
-     POPA/POPAD - Pop All Registers onto Stack  (80188+). . . . . . . .  28\r
-     POPF/POPFD - Pop Flags off Stack . . . . . . . . . . . . . . . . .  28\r
-     PUSH - Push Word onto Stack. . . . . . . . . . . . . . . . . . . .  28\r
-     PUSHA/PUSHAD - Push All Registers onto Stack  (80188+) . . . . . .  28\r
-     PUSHF/PUSHFD - Push Flags onto Stack . . . . . . . . . . . . . . .  29\r
-     RCL - Rotate Through Carry Left. . . . . . . . . . . . . . . . . .  29\r
-     RCR - Rotate Through Carry Right . . . . . . . . . . . . . . . . .  29\r
-     REP - Repeat String Operation. . . . . . . . . . . . . . . . . . .  30\r
-     REPE/REPZ - Repeat Equal / Repeat Zero . . . . . . . . . . . . . .  30\r
-     REPNE/REPNZ - Repeat Not Equal / Repeat Not Zero . . . . . . . . .  30\r
-     RET/RETF - Return From Procedure . . . . . . . . . . . . . . . . .  31\r
-     ROL - Rotate Left. . . . . . . . . . . . . . . . . . . . . . . . .  31\r
-     ROR - Rotate Right . . . . . . . . . . . . . . . . . . . . . . . .  31\r
-     SAHF - Store AH Register into FLAGS. . . . . . . . . . . . . . . .  32\r
-     SAL/SHL - Shift Arithmetic Left / Shift Logical Left . . . . . . .  32\r
-     SAR - Shift Arithmetic Right . . . . . . . . . . . . . . . . . . .  32\r
-     SBB - Subtract with Borrow/Carry . . . . . . . . . . . . . . . . .  33\r
-     SCAS - Scan String  (Byte, Word or Doubleword) . . . . . . . . . .  33\r
-     SETAE/SETNB - Set if Above or Equal / Set if Not Below (386+). . .  33\r
-     SETB/SETNAE - Set if Below / Set if Not Above or Equal (386+). . .  33\r
-     SETBE/SETNA - Set if Below or Equal / Set if Not Above (386+). . .  34\r
-     SETE/SETZ - Set if Equal / Set if Zero (386+). . . . . . . . . . .  34\r
-     SETNE/SETNZ - Set if Not Equal / Set if Not Zero (386+). . . . . .  34\r
-     SETL/SETNGE - Set if Less / Set if Not Greater or Equal (386+) . .  34\r
-     SETGE/SETNL - Set if Greater or Equal / Set if Not Less (386+) . .  35\r
-     SETLE/SETNG - Set if Less or Equal / Set if Not greater or Equal (386+)  35\r
-     SETG/SETNLE - Set if Greater / Set if Not Less or Equal (386+) . .  35\r
-     SETS - Set if Signed (386+). . . . . . . . . . . . . . . . . . . .  35\r
-     SETNS - Set if Not Signed (386+) . . . . . . . . . . . . . . . . .  36\r
-     SETC - Set if Carry (386+) . . . . . . . . . . . . . . . . . . . .  36\r
-     SETNC - Set if Not Carry (386+). . . . . . . . . . . . . . . . . .  36\r
-     SETO - Set if Overflow (386+). . . . . . . . . . . . . . . . . . .  36\r
-     SETNO - Set if Not Overflow (386+) . . . . . . . . . . . . . . . .  36\r
-     SETP/SETPE - Set if Parity / Set if Parity Even  (386+). . . . . .  37\r
-     SETNP/SETPO - Set if No Parity / Set if Parity Odd (386+). . . . .  37\r
-     SGDT - Store Global Descriptor Table (286+ privileged) . . . . . .  37\r
-     SIDT - Store Interrupt Descriptor Table (286+ privileged). . . . .  37\r
-     SHL - Shift Logical Left . . . . . . . . . . . . . . . . . . . . .  37\r
-     SHR - Shift Logical Right. . . . . . . . . . . . . . . . . . . . .  38\r
-     SHLD/SHRD - Double Precision Shift (386+). . . . . . . . . . . . .  38\r
-     SLDT - Store Local Descriptor Table (286+ privileged). . . . . . .  38\r
-     SMSW - Store Machine Status Word (286+ privileged) . . . . . . . .  38\r
-     STC - Set Carry. . . . . . . . . . . . . . . . . . . . . . . . . .  39\r
-     STD - Set Direction Flag . . . . . . . . . . . . . . . . . . . . .  39\r
-     STI - Set Interrupt Flag  (Enable Interrupts). . . . . . . . . . .  39\r
-     STOS - Store String  (Byte, Word or Doubleword). . . . . . . . . .  39\r
-     STR - Store Task Register (286+ privileged). . . . . . . . . . . .  39\r
-     SUB - Subtract . . . . . . . . . . . . . . . . . . . . . . . . . .  40\r
-     TEST - Test For Bit Pattern. . . . . . . . . . . . . . . . . . . .  40\r
-     VERR - Verify Read (286+ protected). . . . . . . . . . . . . . . .  40\r
-     VERW - Verify Write (286+ protected) . . . . . . . . . . . . . . .  40\r
-     WAIT/FWAIT - Event Wait. . . . . . . . . . . . . . . . . . . . . .  41\r
-     WBINVD - Write-Back and Invalidate Cache (486+). . . . . . . . . .  41\r
-     XCHG - Exchange. . . . . . . . . . . . . . . . . . . . . . . . . .  41\r
-     XLAT/XLATB - Translate . . . . . . . . . . . . . . . . . . . . . .  41\r
-     XOR - Exclusive OR . . . . . . . . . . . . . . . . . . . . . . . .  42\r
-\f\r
-Intel 8086 Family Architecture\r
-\r
-        General Purpose Registers               Segment Registers\r
-\r
-        AH/AL  AX  (EAX)  Accumulator            CS     Code Segment\r
-        BH/BL  BX  (EBX)  Base                   DS     Data Segment\r
-        CH/CL  CX  (ECX)  Counter                SS     Stack Segment\r
-        DH/DL  DX  (EDX)  Data                   ES     Extra Segment\r
-                                                (FS)    386 and newer\r
-        (Exx) indicates 386+ 32 bit register    (GS)    386 and newer\r
-\r
-\r
-        Pointer Registers                       Stack Registers\r
-\r
-        SI (ESI)  Source Index                  SP (ESP)  Stack Pointer\r
-        DI (EDI)  Destination Index             BP (EBP)  Base Pointer\r
-        IP        Instruction Pointer\r
-\r
-        Status Registers\r
-\r
-        FLAGS Status Flags   (see FLAGS)\r
-\r
-        Special Registers (386+ only)\r
-\r
-        CR0     Control Register 0        DR0    Debug Register 0\r
-        CR2     Control Register 2        DR1    Debug Register 1\r
-        CR3     Control Register 3        DR2    Debug Register 2\r
-                                          DR3    Debug Register 3\r
-        TR4     Test Register 4           DR6    Debug Register 6\r
-        TR5     Test Register 5           DR7    Debug Register 7\r
-        TR6     Test Register 6\r
-        TR7     Test Register 7\r
-        \r
-        Register          Default Segment    Valid Overrides\r
-\r
-        BP                      SS              DS, ES, CS\r
-        SI or DI                DS              ES, SS, CS\r
-        DI strings              ES              None\r
-        SI strings              DS              ES, SS, CS\r
-\r
-\r
-        - see  CPU   DETECTING  Instruction Timing\r
-\r
-Instruction Clock Cycle Calculation\r
-\r
-\r
-        Some instructions require additional clock cycles due to a "Next\r
-        Instruction Component" identified by a "+m" in the instruction\r
-        clock cycle listings.  This is due to the prefetch queue being\r
-        purge on a control transfers.   Below is the general rule for\r
-        calculating "m":\r
-\r
-\r
-        88/86 not applicable\r
-        286  "m" is the number of bytes in the next instruction\r
-        386  "m" is the number of components in the next instruction\r
-                (the instruction coding (each byte), plus the data and\r
-                the displacement are all considered components)\r
-\r
-\r
-8088/8086  Effective Address (EA) Calculation\r
-\r
-                   Description                            Clock Cycles\r
-\r
-        Displacement                                            6\r
-        Base or Index (BX,BP,SI,DI)                             5\r
-        Displacement+(Base or Index)                            9\r
-        Base+Index (BP+DI,BX+SI)                                7\r
-        Base+Index (BP+SI,BX+DI)                                8\r
-        Base+Index+Displacement (BP+DI,BX+SI)                  11\r
-        Base+Index+Displacement (BP+SI+disp,BX+DI+disp)        12\r
-\r
-\r
-        - add 4 cycles for word operands at odd addresses\r
-        - add 2 cycles for segment override\r
-        - 80188/80186 timings differ from those of the 8088/8086/80286\r
-\fTask State Calculation\r
-\r
-        "TS" is defined as switching from VM/486 or 80286 TSS to one of\r
-        the following:\r
-\r
-                        ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-                        ³               New Task                ³\r
-                        ÃÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄ´\r
-        ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´486 TSS³486 TSS³386 TSS³386 TSS³286 TSS³\r
-        ³   Old Task    ³ (VM=0)³ (VM=1)³ (VM=0)³ (VM=1)³       ³\r
-        ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄ´\r
-        386 TSS (VM=0)  ³       ³       ³  309  ³  226  ³  282  ³\r
-                        ÃÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄ´\r
-        386 TSS (VM=1)  ³       ³       ³  314  ³  231  ³  287  ³\r
-                        ÃÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄ´\r
-        386 CPU/286 TSS ³       ³       ³  307  ³  224  ³  280  ³\r
-                        ÃÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄ´\r
-        486 CPU/286 TSS ³  199  ³  177  ³       ³       ³  180  ³\r
-                        ÀÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÙ\r
-\r
-                             \r
-        Miscellaneous\r
-\r
-        - all timings are for best case and do not take into account wait\r
-          states, instruction alignment, the state of the prefetch queue,\r
-          DMA refresh cycles, cache hits/misses or exception processing.\r
-        - to convert clocks to nanoseconds divide one microsecond by the\r
-          processor speed in MegaHertz:\r
-   \r
-          (1000MHz/(n MHz)) = X nanoseconds\r
-\r
-        - see   8086 Architecture\r
-\r
-\r
-FLAGS - Intel 8086 Family Flags Register\r
-\r
-      ³11³10³F³E³D³C³B³A³9³8³7³6³5³4³3³2³1³0³\r
-        ³  ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ ÀÄÄÄ  CF Carry Flag\r
-        ³  ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ ÀÄÄÄ  1\r
-        ³  ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ ÀÄÄÄ  PF Parity Flag\r
-        ³  ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ ÀÄÄÄ  0\r
-        ³  ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ ÀÄÄÄ  AF Auxiliary Flag\r
-        ³  ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ ÀÄÄÄ  0\r
-        ³  ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ ÀÄÄÄ  ZF Zero Flag\r
-        ³  ³ ³ ³ ³ ³ ³ ³ ³ ³ ÀÄÄÄ  SF Sign Flag\r
-        ³  ³ ³ ³ ³ ³ ³ ³ ³ ÀÄÄÄ  TF Trap Flag  (Single Step)\r
-        ³  ³ ³ ³ ³ ³ ³ ³ ÀÄÄÄ  IF Interrupt Flag\r
-        ³  ³ ³ ³ ³ ³ ³ ÀÄÄÄ  DF Direction Flag\r
-        ³  ³ ³ ³ ³ ³ ÀÄÄÄ  OF Overflow flag\r
-        ³  ³ ³ ³ ÀÄÁÄÄÄ  IOPL I/O Privilege Level  (286+ only)\r
-        ³  ³ ³ ÀÄÄÄÄÄ  NT Nested Task Flag  (286+ only)\r
-        ³  ³ ÀÄÄÄÄÄ  0\r
-        ³  ÀÄÄÄÄÄ  RF Resume Flag (386+ only)\r
-        ÀÄÄÄÄÄÄ  VM  Virtual Mode Flag (386+ only)\r
-\r
-        - see   PUSHF  POPF  STI  CLI  STD  CLD\r
-\fMSW - Machine Status Word (286+ only)\r
-\r
-\r
-      ³31³30-5³4³3³2³1³0³  Machine Status Word\r
-        ³   ³  ³ ³ ³ ³ ÀÄÄÄÄ Protection Enable (PE)\r
-        ³   ³  ³ ³ ³ ÀÄÄÄÄÄ Math Present (MP)\r
-        ³   ³  ³ ³ ÀÄÄÄÄÄÄ Emulation (EM)\r
-        ³   ³  ³ ÀÄÄÄÄÄÄÄ Task Switched (TS)\r
-        ³   ³  ÀÄÄÄÄÄÄÄÄ Extension Type (ET)\r
-        ³   ÀÄÄÄÄÄÄÄÄÄÄ Reserved\r
-        ÀÄÄÄÄÄÄÄÄÄÄÄÄÄ Paging (PG)\r
-\r
-\r
-        Bit 0   PE      Protection Enable, switches processor between\r
-                        protected and real mode\r
-        Bit 1   MP      Math Present, controls function of the WAIT\r
-                        instruction\r
-        Bit 2   EM      Emulation, indicates whether coprocessor functions\r
-                        are to be emulated\r
-        Bit 3   TS      Task Switched, set and interrogated by coprocessor\r
-                        on task switches and when interpretting coprocessor\r
-                        instructions\r
-        Bit 4   ET      Extension Type, indicates type of coprocessor in\r
-                        system\r
-        Bits 5-30       Reserved\r
-        bit 31  PG      Paging, indicates whether the processor uses page\r
-                        tables to translate linear addresses to physical\r
-                        addresses\r
-\r
-        - see   SMSW  LMSW\r
-\f8086/80186/80286/80386/80486 Instruction Set\r
-\r
-AAA - Ascii Adjust for Addition\r
-\r
-        Usage:  AAA\r
-        Modifies flags: AF CF (OF,PF,SF,ZF undefined)\r
-\r
-        Changes contents of AL to valid unpacked decimal.  The high order\r
-        nibble is zeroed.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        none              8     3     4     3             1\r
-\r
-\r
-AAD - Ascii Adjust for Division\r
-\r
-        Usage:  AAD\r
-        Modifies flags: SF ZF PF (AF,CF,OF undefined)\r
-\r
-        Used before dividing unpacked decimal numbers.   Multiplies AH by\r
-        10 and the adds result into AL.  Sets AH to zero.  This instruction\r
-        is also known to have an undocumented behavior.\r
-\r
-        AL := 10*AH+AL\r
-        AH := 0\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        none              60    14    19    14            2\r
-\r
-\r
-AAM - Ascii Adjust for Multiplication\r
-\r
-\r
-        Usage:  AAM\r
-        Modifies flags: PF SF ZF (AF,CF,OF undefined)\r
-\r
-        AH := AL / 10\r
-        AL := AL mod 10\r
-\r
-        Used after multiplication of two unpacked decimal numbers, this\r
-        instruction adjusts an unpacked decimal number.  The high order\r
-        nibble of each byte must be zeroed before using this instruction.\r
-        This instruction is also known to have an undocumented behavior.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        none              83    16    17    15            2\r
-\r
-\r
-AAS - Ascii Adjust for Subtraction\r
-\r
-        Usage:  AAS\r
-        Modifies flags: AF CF (OF,PF,SF,ZF undefined)\r
-\r
-        Corrects result of a previous unpacked decimal subtraction in AL.\r
-        High order nibble is zeroed.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        none              8     3     4     3             1\r
-\fADC - Add With Carry\r
-\r
-        Usage:  ADC     dest,src\r
-        Modifies flags: AF CF OF SF PF ZF\r
-\r
-        Sums two binary operands placing the result in the destination.\r
-        If CF is set, a 1 is added to the destination.\r
-\r
-                                Clocks                  Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        reg,reg           3     2     2     1             2\r
-        mem,reg         16+EA   7     7     3            2-4  (W88=24+EA)\r
-        reg,mem          9+EA   7     6     2            2-4  (W88=13+EA)\r
-        reg,immed         4     3     2     1            3-4\r
-        mem,immed       17+EA   7     7     3            3-6  (W88=23+EA)\r
-        accum,immed       4     3     2     1            2-3\r
-\r
-\r
-ADD - Arithmetic Addition\r
-\r
-        Usage:  ADD     dest,src\r
-        Modifies flags: AF CF OF PF SF ZF\r
-\r
-        Adds "src" to "dest" and replacing the original contents of "dest".\r
-        Both operands are binary.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        reg,reg           3     2     2     1             2\r
-        mem,reg         16+EA   7     7     3            2-4  (W88=24+EA)\r
-        reg,mem          9+EA   7     6     2            2-4  (W88=13+EA)\r
-        reg,immed         4     3     2     1            3-4\r
-        mem,immed       17+EA   7     7     3            3-6  (W88=23+EA)\r
-        accum,immed       4     3     2     1            2-3\r
-\r
-\r
-AND - Logical And\r
-\r
-        Usage:  AND     dest,src\r
-        Modifies flags: CF OF PF SF ZF (AF undefined)\r
-\r
-        Performs a logical AND of the two operands replacing the destination\r
-        with the result.\r
-\r
-                                Clocks                  Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        reg,reg           3     2     2     1             2\r
-        mem,reg         16+EA   7     7     3            2-4  (W88=24+EA)\r
-        reg,mem          9+EA   7     6     1            2-4  (W88=13+EA)\r
-        reg,immed         4     3     2     1            3-4\r
-        mem,immed       17+EA   7     7     3            3-6  (W88=23+EA)\r
-        accum,immed       4     3     2     1            2-3\r
-\r
-\r
-ARPL - Adjusted Requested Privilege Level of Selector (286+ PM)\r
-\r
-        Usage:  ARPL    dest,src\r
-        (286+ protected mode)\r
-        Modifies flags: ZF\r
-\r
-        Compares the RPL bits of "dest" against "src".  If the RPL bits\r
-        of "dest" are less than "src", the destination RPL bits are set\r
-        equal to the source RPL bits and the Zero Flag is set.  Otherwise\r
-        the Zero Flag is cleared.\r
-\r
-                                Clocks                  Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        reg,reg           -     10    20    9             2\r
-        mem,reg           -     11    21    9             4\r
-\fBOUND - Array Index Bound Check (80188+)\r
-\r
-        Usage:  BOUND   src,limit\r
-        Modifies flags: None\r
-\r
-        Array index in source register is checked against upper and lower\r
-        bounds in memory source.  The first word located at "limit" is\r
-        the lower boundary and the word at "limit+2" is the upper array bound.\r
-        Interrupt 5 occurs if the source value is less than or higher than\r
-        the source.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        reg16,mem32       -   nj=13 nj=10   7             2\r
-        reg32,mem64       -   nj=13 nj=10   7             2\r
-\r
-        - nj = no jump taken\r
-\r
-\r
-BSF - Bit Scan Forward (386+)\r
-\r
-        Usage:  BSF     dest,src\r
-        Modifies flags: ZF\r
-\r
-        Scans source operand for first bit set.  Sets ZF if a bit is found\r
-        set and loads the destination with an index to first set bit.  Clears\r
-        ZF is no bits are found set.  BSF scans forward across bit pattern\r
-        (0-n) while BSR scans in reverse (n-0).\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        reg,reg           -     -   10+3n  6-42           3\r
-        reg,mem           -     -   10+3n  7-43          3-7\r
-        reg32,reg32       -     -   10+3n  6-42          3-7\r
-        reg32,mem32       -     -   10+3n  7-43          3-7\r
-\r
-\r
-BSR - Bit Scan Reverse  (386+)\r
-\r
-        Usage:  BSR     dest,src\r
-        Modifies flags: ZF\r
-\r
-        Scans source operand for first bit set.  Sets ZF if a bit is found\r
-        set and loads the destination with an index to first set bit.  Clears\r
-        ZF is no bits are found set.  BSF scans forward across bit pattern\r
-        (0-n) while BSR scans in reverse (n-0).\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        reg,reg           -     -   10+3n  6-103          3\r
-        reg,mem           -     -   10+3n  7-104         3-7\r
-        reg32,reg32       -     -   10+3n  6-103         3-7\r
-        reg32,mem32       -     -   10+3n  7-104         3-7\r
-\r
-\r
-BSWAP - Byte Swap       (486+)\r
-\r
-        Usage:  BSWAP   reg32\r
-        Modifies flags: none\r
-\r
-        Changes the byte order of a 32 bit register from big endian to\r
-        little endian or vice versa.   Result left in destination register\r
-        is undefined if the operand is a 16 bit register.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        reg32             -     -     -     1             2\r
-\fBT - Bit Test           (386+)\r
-\r
-        Usage:  BT      dest,src\r
-        Modifies flags: CF\r
-\r
-        The destination bit indexed by the source value is copied into the\r
-        Carry Flag.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        reg16,immed8      -     -     3     3            4-8\r
-        mem16,immed8      -     -     6     6            4-8\r
-        reg16,reg16       -     -     3     3            3-7\r
-        mem16,reg16       -     -     12    12           3-7\r
-\r
-\r
-BTC - Bit Test with Compliment (386+)\r
-\r
-        Usage:  BTC     dest,src\r
-        Modifies flags: CF\r
-\r
-        The destination bit indexed by the source value is copied into the\r
-        Carry Flag after being complimented (inverted).\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        reg16,immed8      -     -     6     6            4-8\r
-        mem16,immed8      -     -     8     8            4-8\r
-        reg16,reg16       -     -     6     6            3-7\r
-        mem16,reg16       -     -     13    13           3-7\r
-\r
-\r
-BTR - Bit Test with Reset (386+)\r
-\r
-        Usage:  BTR     dest,src\r
-        Modifies flags: CF\r
-\r
-        The destination bit indexed by the source value is copied into the\r
-        Carry Flag and then cleared in the destination.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        reg16,immed8      -     -     6     6            4-8\r
-        mem16,immed8      -     -     8     8            4-8\r
-        reg16,reg16       -     -     6     6            3-7\r
-        mem16,reg16       -     -     13    13           3-7\r
-\r
-\r
-BTS - Bit Test and Set  (386+)\r
-\r
-        Usage:  BTS     dest,src\r
-        Modifies flags: CF\r
-\r
-        The destination bit indexed by the source value is copied into the\r
-        Carry Flag and then set in the destination.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        reg16,immed8      -     -     6     6            4-8\r
-        mem16,immed8      -     -     8     8            4-8\r
-        reg16,reg16       -     -     6     6            3-7\r
-        mem16,reg16       -     -     13    13           3-7\r
-\fCALL - Procedure Call\r
-\r
-        Usage:  CALL    destination\r
-        Modifies flags: None\r
-\r
-        Pushes Instruction Pointer (and Code Segment for far calls) onto\r
-        stack and loads Instruction Pointer with the address of proc-name.\r
-        Code continues with execution at CS:IP.\r
-\r
-                                                         Clocks\r
-                   Operands                     808x   286     386     486\r
-\r
-        rel16 (near, IP relative)                19     7      7+m      3\r
-        rel32 (near, IP relative)                -      -      7+m      3\r
-\r
-        reg16 (near, register indirect)          16     7      7+m      5\r
-        reg32 (near, register indirect)          -      -      7+m      5\r
-\r
-        mem16 (near, memory indirect)            -     21+EA    11    10+m      5\r
-        mem32 (near, memory indirect)            -      -     10+m      5\r
-\r
-        ptr16:16 (far, full ptr supplied)        28     13    17+m      18\r
-        ptr16:32 (far, full ptr supplied)        -      -     17+m      18\r
-        ptr16:16 (far, ptr supplied, prot. mode) -      26    34+m      20\r
-        ptr16:32 (far, ptr supplied, prot. mode) -      -     34+m      20\r
-        m16:16 (far, indirect)                 37+EA    16    22+m      17\r
-        m16:32 (far, indirect)                   -      -     22+m      17\r
-        m16:16 (far, indirect, prot. mode)       -      29    38+m      20\r
-        m16:32 (far, indirect, prot. mode)       -      -     38+m      20\r
-\r
-        ptr16:16 (task, via TSS or task gate)    -     177     TS     37+TS\r
-        m16:16 (task, via TSS or task gate)      -   180/185  5+TS    37+TS\r
-        m16:32 (task)                            -      -      TS     37+TS\r
-        m16:32 (task)                            -      -     5+TS    37+TS\r
-\r
-        ptr16:16 (gate, same privilege)          -      41    52+m      35\r
-        ptr16:32 (gate, same privilege)          -      -     52+m      35\r
-        m16:16 (gate, same privilege)            -      44    56+m      35\r
-        m16:32 (gate, same privilege)            -      -     56+m      35\r
-\r
-        ptr16:16 (gate, more priv, no parm)      -      82    86+m      69\r
-        ptr16:32 (gate, more priv, no parm)      -      -     86+m      69\r
-        m16:16 (gate, more priv, no parm)        -      83    90+m      69\r
-        m16:32 (gate, more priv, no parm)        -      -     90+m      69\r
-\r
-        ptr16:16 (gate, more priv, x parms)      -    86+4x  94+4x+m  77+4x\r
-        ptr16:32 (gate, more priv, x parms)      -      -    94+4x+m  77+4x\r
-        m16:16 (gate, more priv, x parms)        -    90+4x  98+4x+m  77+4x\r
-        m16:32 (gate, more priv, x parms)        -      -    98+4x+m  77+4x\r
-\r
-\r
-CBW - Convert Byte to Word\r
-\r
-        Usage:  CBW\r
-        Modifies flags: None\r
-\r
-        Converts byte in AL to word Value in AX by extending sign of AL\r
-        throughout register AH.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        none              2     2     3     3             1\r
-\r
-\r
-CDQ - Convert Double to Quad (386+)\r
-\r
-        Usage:  CDQ\r
-        Modifies flags: None\r
-\r
-        Converts signed DWORD in EAX to a signed quad word in EDX:EAX by\r
-        extending the high order bit of EAX throughout EDX\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        none              -     -     2     3             1\r
-\fCLC - Clear Carry\r
-\r
-        Usage:  CLC\r
-        Modifies flags: CF\r
-\r
-        Clears the Carry Flag.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        none              2     2     2     2             1\r
-\r
-\r
-CLD - Clear Direction Flag\r
-\r
-        Usage:  CLD\r
-        Modifies flags: DF\r
-\r
-        Clears the Direction Flag causing string instructions to increment\r
-        the SI and DI index registers.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        none              2     2     2     2             1\r
-\r
-\r
-CLI - Clear Interrupt Flag (disable)\r
-\r
-        Usage:  CLI\r
-        Modifies flags: IF\r
-\r
-        Disables the maskable hardware interrupts by clearing the Interrupt\r
-        flag.  NMI's and software interrupts are not inhibited.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        none              2     2     3     5             1\r
-\r
-\r
-CLTS - Clear Task Switched Flag (286+ privileged)\r
-\r
-        Usage:  CLTS\r
-        Modifies flags: None\r
-\r
-        Clears the Task Switched Flag in the Machine Status Register.  This\r
-        is a privileged operation and is generally used only by operating\r
-        system code.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        none              -     2     5     7             2\r
-\r
-\r
-CMC - Complement Carry Flag\r
-\r
-        Usage:  CMC\r
-        Modifies flags: CF\r
-\r
-        Toggles (inverts) the Carry Flag\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        none              2     2     2     2             1\r
-\fCMP - Compare\r
-\r
-        Usage:  CMP     dest,src\r
-        Modifies flags: AF CF OF PF SF ZF\r
-\r
-        Subtracts source from destination and updates the flags but does\r
-        not save result.  Flags can subsequently be checked for conditions.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        reg,reg           3     2     2     1             2\r
-        mem,reg          9+EA   7     5     2            2-4  (W88=13+EA)\r
-        reg,mem          9+EA   6     6     2            2-4  (W88=13+EA)\r
-        reg,immed         4     3     2     1            3-4\r
-        mem,immed       10+EA   6     5     2            3-6  (W88=14+EA)\r
-        accum,immed       4     3     2     1            2-3\r
-\r
-\r
-CMPS - Compare String (Byte, Word or Doubleword)\r
-\r
-        Usage:  CMPS    dest,src\r
-                CMPSB\r
-                CMPSW\r
-                CMPSD   (386+)\r
-        Modifies flags: AF CF OF PF SF ZF\r
-\r
-        Subtracts destination value from source without saving results.\r
-        Updates flags based on the subtraction and  the index registers\r
-        (E)SI and (E)DI are incremented or decremented depending on the\r
-        state of the Direction Flag.  CMPSB inc/decrements the index\r
-        registers by 1, CMPSW inc/decrements by 2, while CMPSD increments\r
-        or decrements by 4.  The REP prefixes can be used to process\r
-        entire data items.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        dest,src          22    8     10    8             1  (W88=30)\r
-\r
-\r
-CMPXCHG - Compare and Exchange\r
-\r
-        Usage:  CMPXCHG dest,src  (486+)\r
-        Modifies flags: AF CF OF PF SF ZF\r
-\r
-        Compares the accumulator (8-32 bits) with "dest".  If equal the\r
-        "dest" is loaded with "src", otherwise the accumulator is loaded\r
-        with "dest".\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        reg,reg           -     -     -     6             2\r
-        mem,reg           -     -     -     7             2\r
-\r
-        - add 3 clocks if the "mem,reg" comparison fails\r
-\r
-\r
-CWD - Convert Word to Doubleword\r
-\r
-        Usage:  CWD\r
-        Modifies flags: None\r
-\r
-        Extends sign of word in register AX throughout register DX forming\r
-        a doubleword quantity in DX:AX.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        none              5     2     2     3             1\r
-\fCWDE - Convert Word to Extended Doubleword (386+)\r
-\r
-        Usage:  CWDE\r
-        Modifies flags: None\r
-\r
-        Converts a signed word in AX to a signed doubleword in EAX by\r
-        extending the sign bit of AX throughout EAX.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        none              -     -     3     3             1\r
-\r
-\r
-DAA - Decimal Adjust for Addition\r
-\r
-        Usage:  DAA\r
-        Modifies flags: AF CF PF SF ZF (OF undefined)\r
-\r
-        Corrects result (in AL) of a previous BCD addition operation.\r
-        Contents of AL are changed to a pair of packed decimal digits.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        none              4     3     4     2             1\r
-\r
-\r
-DAS - Decimal Adjust for Subtraction\r
-\r
-        Usage:  DAS\r
-        Modifies flags: AF CF PF SF ZF (OF undefined)\r
-\r
-        Corrects result (in AL) of a previous BCD subtraction operation.\r
-        Contents of AL are changed to a pair of packed decimal digits.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        none              4     3     4     2             1\r
-\r
-\r
-DEC - Decrement\r
-\r
-        Usage:  DEC     dest\r
-        Modifies flags: AF OF PF SF ZF\r
-\r
-        Unsigned binary subtraction of one from the destination.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        reg8              3     2     2     1             2\r
-        mem             15+EA   7     6     3            2-4\r
-        reg16/32          3     2     2     1             1\r
-\r
-\r
-DIV - Divide\r
-\r
-        Usage:  DIV     src\r
-        Modifies flags: (AF,CF,OF,PF,SF,ZF undefined)\r
-\r
-        Unsigned binary division of accumulator by source.  If the source\r
-        divisor is a byte value then AX is divided by "src" and the quotient\r
-        is placed in AL and the remainder in AH.  If source operand is a word\r
-        value, then DX:AX is divided by "src" and the quotient is stored in AX\r
-        and the remainder in DX.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        reg8             80-90  14    14    16            2\r
-        reg16           144-162 22    22    24            2\r
-        reg32              -    -     38    40            2\r
-        mem8        (86-96)+EA  17    17    16           2-4\r
-        mem16     (150-168)+EA  25    25    24           2-4  (W88=158-176+EA)\r
-        mem32              -    -     41    40           2-4\r
-\fENTER - Make Stack Frame  (80188+)\r
-\r
-        Usage:  ENTER   locals,level\r
-        Modifies flags: None\r
-\r
-        Modifies stack for entry to procedure for high level language.\r
-        Operand "locals" specifies the amount of storage to be allocated\r
-        on the stack.   "Level" specifies the nesting level of the routine.\r
-        Paired with the LEAVE instruction, this is an efficient method of\r
-        entry and exit to procedures.\r
-\r
-                                     Clocks                     Size\r
-        Operands         808x    286       386       486        Bytes\r
-\r
-        immed16,0         -       11       10         14          4\r
-        immed16,1         -       15       12         17          4\r
-        immed16,immed8    -   12+4(n-1) 15+4(n-1)    17+3n        4\r
-\r
-\r
-ESC - Escape\r
-\r
-        Usage:  ESC     immed,src\r
-        Modifies flags: None\r
-\r
-        Provides access to the data bus for other resident processors.\r
-        The CPU treats it as a NOP but places memory operand on bus.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        immed,reg         2   9-20    ?                   2\r
-        immed,mem         2   9-20    ?                  2-4\r
-\r
-\r
-HLT - Halt CPU\r
-\r
-        Usage:   HLT\r
-        Modifies flags: None\r
-\r
-        Halts CPU until RESET line is activated, NMI or maskable interrupt\r
-        received.  The CPU becomes dormant but retains the current CS:IP\r
-        for later restart.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        none              2     2     5     4             1\r
-\r
-\r
-IDIV - Signed Integer Division\r
-\r
-        Usage:   IDIV   src\r
-        Modifies flags: (AF,CF,OF,PF,SF,ZF undefined)\r
-\r
-        Signed binary division of accumulator by source.  If source is a\r
-        byte value, AX is divided by "src" and the quotient is stored in\r
-        AL and the remainder in AH.  If source is a word value, DX:AX is\r
-        divided by "src", and the quotient is stored in AL and the\r
-        remainder in DX.\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        reg8          101-112   17    19    19            2\r
-        reg16         165-184   25    27    27            2\r
-        reg32            -      -     43    43            2\r
-        mem8     (107-118)+EA   20    22    20           2-4\r
-        mem16    (171-190)+EA   38    30    28           2-4  (W88=175-194)\r
-        mem32            -      -     46    44           2-4\r
-\fIMUL - Signed Multiply\r
-\r
-        Usage:  IMUL    src\r
-                IMUL    src,immed        (286+)\r
-                IMUL    dest,src,immed8  (286+)\r
-                IMUL    dest,src         (386+)\r
-        Modifies flags: CF OF (AF,PF,SF,ZF undefined)\r
-\r
-        Signed multiplication of accumulator by "src" with result placed\r
-        in the accumulator.  If the source operand is a byte value, it\r
-        is multiplied by AL and the result stored in AX.  If the source\r
-        operand is a word value it is multiplied by AX and the result is\r
-        stored in DX:AX.  Other variations of this instruction allow\r
-        specification of source and destination registers as well as a\r
-        third immediate factor.\r
-\r
-                                  Clocks                Size\r
-        Operands         808x   286   386   486         Bytes\r
-\r
-        reg8             80-98   13   9-14  13-18         2\r
-        reg16           128-154  21   9-22  13-26         2\r
-        reg32              -     -    9-38  12-42         2\r
-        mem8             86-104  16  12-17  13-18        2-4\r
-        mem16           134-160  24  12-25  13-26        2-4\r
-        mem32              -     -   12-41  13-42        2-4\r
-        reg16,reg16        -     -    9-22  13-26        3-5\r
-        reg32,reg32        -     -    9-38  13-42        3-5\r
-        reg16,mem16        -     -   12-25  13-26        3-5\r
-        reg32,mem32        -     -   12-41  13-42        3-5\r
-        reg16,immed        -     21   9-22  13-26         3\r
-        reg32,immed        -     21   9-38  13-42        3-6\r
-        reg16,reg16,immed  -     2    9-22  13-26        3-6\r
-        reg32,reg32,immed  -     21   9-38  13-42        3-6\r
-        reg16,mem16,immed  -     24  12-25  13-26        3-6\r
-        reg32,mem32,immed  -     24  12-41  13-42        3-6\r
-\r
-\r
-IN - Input Byte or Word From Port\r
-\r
-        Usage:  IN      accum,port\r
-        Modifies flags: None\r
-\r
-        A byte, word or dword is read from "port" and placed in AL, AX or\r
-        EAX respectively.  If the port number is in the range of 0-255\r
-        it can be specified as an immediate, otherwise the port number\r
-        must be specified in DX.  Valid port ranges on the PC are 0-1024,\r
-        though values through 65535 may be specified and recognized by\r
-        third party vendors and PS/2's.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386    486         Bytes\r
-\r
-        accum,immed8    10/14   5     12     14           2\r
-        accum,immed8 (PM)            6/26  8/28/27        2\r
-        accum,DX         8/12   5     13     14           1\r
-        accum,DX (PM)                7/27  8/28/27        1\r
-\r
-        - 386+ protected mode timings depend on privilege levels.\r
-\r
-          first number is the timing if:    CPL ó IOPL\r
-          second number is the timing if:   CPL > IOPL or in VM 86 mode (386)\r
-                                            CPL ò IOPL  (486)\r
-          third number is the timing when:    virtual mode on 486 processor\r
-        - 486 virtual mode always requires 27 cycles\r
-\fINC - Increment\r
-\r
-        Usage:  INC     dest\r
-        Modifies flags: AF OF PF SF ZF\r
-\r
-        Adds one to destination unsigned binary operand.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        reg8              3     2     2     1             2\r
-        reg16             3     2     2     1             1\r
-        reg32             3     2     2     1             1\r
-        mem             15+EA   7     6     3            2-4  (W88=23+EA)\r
-\r
-\r
-INS - Input String from Port  (80188+)\r
-\r
-        Usage:  INS     dest,port\r
-                INSB\r
-                INSW\r
-                INSD    (386+)\r
-        Modifies flags: None\r
-\r
-        Loads data from port to the destination ES:(E)DI  (even if a\r
-        destination operand is supplied).  (E)DI is adjusted by the size\r
-        of the operand and increased if the Direction Flag is cleared and\r
-        decreased if the Direction Flag is set.  For INSB, INSW, INSD no\r
-        operands are allowed and the size is determined by the mnemonic.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386    486         Bytes\r
-\r
-        dest,port         -     5     15     17           1\r
-        dest,port (PM)    -     5    9/29 10/32/30        1\r
-        none              -     5     15     17           1\r
-        none (PM)         -     5    9/29 10/32/30        1\r
-\r
-        - 386+ protected mode timings depend on privilege levels.\r
-\r
-          first number is the timing if:    CPL ó IOPL\r
-          second number is the timing if:   CPL > IOPL\r
-          third number is the timing if:    virtual mode on 486 processor\r
-\r
-\r
-INT - Interrupt\r
-\r
-        Usage:  INT     num\r
-        Modifies flags: TF IF\r
-\r
-        Initiates a software interrupt by pushing the flags, clearing the\r
-        Trap and Interrupt Flags, pushing CS followed by IP and loading\r
-        CS:IP with the value found in the interrupt vector table.  Execution\r
-        then begins at the location addressed by the new CS:IP\r
-\r
-                                               Clocks           Size\r
-            Operands                    808x  286   386   486   Bytes\r
-\r
- 3 (constant)                          52/72  23+m   33    26     2\r
- 3 (prot. mode, same priv.)              -    40+m   59    44     2       \r
- 3 (prot. mode, more priv.)              -    78+m   99    71     2\r
- 3 (from VM86 to PL 0)                   -     -    119    82     2\r
- 3 (prot. mode via task gate)            -   167+m   TS  37+TS    2\r
- immed8                                51/71  23+m   37    30     1\r
- immed8 (prot. mode, same priv.)         -    40+m   59    44     1\r
- immed8 (prot. mode, more priv.)         -    78+m   99    71     1\r
- immed8 (from VM86 to PL 0)              -     -    119    86     1\r
- immed8 (prot. mode, via task gate)      -   167+m   TS  37+TS    1\r
-\fINTO - Interrupt on Overflow\r
-\r
-        Usage:  INTO\r
-        Modifies flags: IF TF\r
-\r
-        If the Overflow Flag is set this instruction generates an INT 4\r
-        which causes the code addressed by 0000:0010 to be executed.\r
-\r
-                                          Clocks           Size\r
-        Operands                808x    286   386   486    Bytes\r
-\r
-        none: jump             53/73   24+m    35    28      1\r
-              no jump            4       3     3     3\r
-        (prot. mode, same priv.) -       -     59    46      1\r
-        (prot. mode, more priv.) -       -     99    73      1\r
-        (from VM86 to PL 0)      -       -    119    84      1\r
-        (prot. mode, via task gate)      -     TS  39+TS     1\r
-\r
-\r
-INVD - Invalidate Cache  (486+)\r
-\r
-        Usage:  INVD\r
-        Modifies flags: none\r
-\r
-        Flushes CPU internal cache.  Issues special function bus cycle\r
-        which indicates to flush external caches.   Data in write-back\r
-        external caches is lost.\r
-        \r
-                                  Clocks                Size\r
-        Operands         808x   286   386   486         Bytes\r
-\r
-        none              -      -     -     4            2\r
-\r
-\r
-INVLPG - Invalidate Translation Look-Aside Buffer Entry (486+)\r
-\r
-        Usage:  INVLPG\r
-        Modifies flags: none\r
-\r
-        Invalidates a single page table entry in the Translation\r
-        Look-Aside Buffer.  Intel warns that this instruction may be\r
-        implemented differently on future processors.\r
-        \r
-                                  Clocks                Size\r
-        Operands         808x   286   386   486         Bytes\r
-\r
-        none              -      -     -     12           2\r
-\r
-        - timing is for TLB entry hit only.\r
-\r
-\r
-IRET/IRETD - Interrupt Return\r
-\r
-        Usage:  IRET\r
-                IRETD  (386+)\r
-        Modifies flags: AF CF DF IF PF SF TF ZF\r
-\r
-        Returns control to point of interruption by popping IP, CS\r
-        and then the Flags from the stack and continues execution at\r
-        this location.  CPU exception interrupts will return to the\r
-        instruction that cause the exception because the CS:IP placed\r
-        on the stack during the interrupt is the address of the offending\r
-        instruction.\r
-\r
-                                         Clocks                 Size\r
-            Operands            808x   286   386   486          Bytes\r
-\r
-    iret                       32/44  17+m    22    15            1\r
-    iret  (prot. mode)           -    31+m    38    15            1\r
-    iret  (to less privilege)    -    55+m    82    36            1\r
-    iret  (different task, NT=1) -   169+m    TS  TS+32           1\r
-    iretd                        -      -   22/38   15            1\r
-    iretd (to less privilege)    -      -     82    36            1\r
-    iretd (to VM86 mode)         -      -     60    15            1\r
-    iretd (different task, NT=1) -      -     TS  TS+32           1\r
-\r
-    - 386 timings are listed as real-mode/protected-mode\r
-\fJxx - Jump Instructions Table\r
-\r
-        Mnemonic              Meaning                    Jump Condition\r
-\r
-          JA     Jump if Above                         CF=0 and ZF=0\r
-          JAE    Jump if Above or Equal                CF=0\r
-          JB     Jump if Below                         CF=1\r
-          JBE    Jump if Below or Equal                CF=1 or ZF=1\r
-          JC     Jump if Carry                         CF=1\r
-          JCXZ   Jump if CX Zero                       CX=0\r
-          JE     Jump if Equal                         ZF=1\r
-          JG     Jump if Greater (signed)              ZF=0 and SF=OF\r
-          JGE    Jump if Greater or Equal (signed)     SF=OF\r
-          JL     Jump if Less (signed)                 SF != OF\r
-          JLE    Jump if Less or Equal (signed)        ZF=1 or SF != OF\r
-          JMP    Unconditional Jump                    unconditional\r
-          JNA    Jump if Not Above                     CF=1 or ZF=1\r
-          JNAE   Jump if Not Above or Equal            CF=1\r
-          JNB    Jump if Not Below                     CF=0\r
-          JNBE   Jump if Not Below or Equal            CF=0 and ZF=0\r
-          JNC    Jump if Not Carry                     CF=0\r
-          JNE    Jump if Not Equal                     ZF=0\r
-          JNG    Jump if Not Greater (signed)          ZF=1 or SF != OF\r
-          JNGE   Jump if Not Greater or Equal (signed) SF != OF\r
-          JNL    Jump if Not Less (signed)             SF=OF\r
-          JNLE   Jump if Not Less or Equal (signed)    ZF=0 and SF=OF\r
-          JNO    Jump if Not Overflow (signed)         OF=0\r
-          JNP    Jump if No Parity                     PF=0\r
-          JNS    Jump if Not Signed (signed)           SF=0\r
-          JNZ    Jump if Not Zero                      ZF=0\r
-          JO     Jump if Overflow (signed)             OF=1\r
-          JP     Jump if Parity                        PF=1\r
-          JPE    Jump if Parity Even                   PF=1\r
-          JPO    Jump if Parity Odd                    PF=0\r
-          JS     Jump if Signed (signed)               SF=1\r
-          JZ     Jump if Zero                          ZF=1\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        Jx: jump          16   7+m   7+m    3             2\r
-            no jump        4    3     3     1\r
-        Jx  near-label     -    -    7+m    3             4\r
-            no jump        -    -     3     1\r
-\r
-        - It's a good programming practice to organize code so the\r
-          expected case is executed without a jump since the actual\r
-          jump takes longer to execute than falling through the test.\r
-        - see   JCXZ  and  JMP  for their respective timings\r
-\r
-\r
-JCXZ/JECXZ - Jump if Register (E)CX is Zero\r
-\r
-        Usage:  JCXZ    label\r
-                JECXZ   label  (386+)\r
-        Modifies flags: None\r
-\r
-        Causes execution to branch to "label" if register CX is zero.  Uses\r
-        unsigned comparision.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        label:  jump      18   8+m   9+m    8             2\r
-                no jump    6    4     5     5\r
-\fJMP - Unconditional Jump\r
-\r
-        Usage:  JMP     target\r
-        Modifies flags: None\r
-\r
-        Unconditionally transfers control to "label".  Jumps by default\r
-        are within -32768 to 32767 bytes from the instruction following\r
-        the jump.  NEAR and SHORT jumps cause the IP to be updated while FAR\r
-        jumps cause CS and IP to be updated.\r
-\r
-                                                        Clocks\r
-                   Operands                     808x  286    386   486\r
-\r
-        rel8  (relative)                        15    7+m    7+m    3\r
-        rel16 (relative)                        15    7+m    7+m    3\r
-        rel32 (relative)                         -     -     7+m    3\r
-        reg16 (near, register indirect)         11    7+m    7+m    5\r
-        reg32 (near, register indirect)          -     -     7+m    5\r
-        mem16 (near, mem indirect)             18+EA  11+m  10+m    5\r
-        mem32 (near, mem indirect)             24+EA  15+m  10+m    5\r
-        ptr16:16 (far, dword immed)              -     -    12+m    17\r
-        ptr16:16 (far, PM dword immed)           -     -    27+m    19\r
-        ptr16:16 (call gate, same priv.)         -    38+m  45+m    32\r
-        ptr16:16 (via TSS)                       -   175+m   TS   42+TS\r
-        ptr16:16 (via task gate)                 -   180+m   TS   43+TS\r
-        mem16:16 (far, indirect)                 -     -    43+m    13\r
-        mem16:16 (far, PM indirect)              -     -    31+m    18\r
-        mem16:16 (call gate, same priv.)         -    41+m  49+m    31\r
-        mem16:16 (via TSS)                       -   178+m  5+TS  41+TS\r
-        mem16:16 (via task gate)                 -   183+m  5+TS  42+TS\r
-        ptr16:32 (far, 6 byte immed)             -     -    12+m    13\r
-        ptr16:32 (far, PM 6 byte immed)          -     -    27+m    18\r
-        ptr16:32 (call gate, same priv.)         -     -    45+m    31\r
-        ptr16:32 (via TSS)                       -     -     TS   42+TS\r
-        ptr16:32 (via task state)                -     -     TS   43+TS\r
-        m16:32 (far, address at dword)           -     -    43+m    13\r
-        m16:32 (far, address at dword)           -     -    31+m    18\r
-        m16:32 (call gate, same priv.)           -     -    49+m    31\r
-        m16:32 (via TSS)                         -     -    5+TS  41+TS\r
-        m16:32 (via task state)                  -     -    5+TS  42+TS\r
-\r
-\r
-LAHF - Load Register AH From Flags\r
-\r
-        Usage:  LAHF\r
-        Modifies flags: None\r
-\r
-        Copies bits 0-7 of the flags register into AH.  This includes flags\r
-        AF, CF, PF, SF and ZF other bits are undefined.\r
-\r
-        AH := SF ZF xx AF xx PF xx CF\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        none              4     2     2     3             1\r
-\r
-\r
-LAR - Load Access Rights (286+ protected)\r
-\r
-        Usage:  LAR     dest,src\r
-        Modifies flags: ZF\r
-\r
-        The high byte of the of the destination register is overwritten by\r
-        the value of the access rights byte and the low order byte is zeroed\r
-        depending on the selection in the source operand.  The Zero Flag is\r
-        set if the load operation is successful.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        reg16,reg16       -     14    15    11            3\r
-        reg32,reg32       -     -     15    11            3\r
-        reg16,mem16       -     16    16    11           3-7\r
-        reg32,mem32       -     -     16    11           3-7\r
-\fLDS - Load Pointer Using DS\r
-\r
-        Usage:  LDS     dest,src\r
-        Modifies flags: None\r
-\r
-        Loads 32-bit pointer from memory source to destination register\r
-        and DS.  The offset is placed in the destination register and the\r
-        segment is placed in DS.  To use this instruction the word at the\r
-        lower memory address must contain the offset and the word at the\r
-        higher address must contain the segment.  This simplifies the loading\r
-        of far pointers from the stack and the interrupt vector table.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        reg16,mem32     16+EA   7     7     6            2-4\r
-        reg,mem (PM)      -     -     22    12           5-7\r
-\r
-\r
-LEA - Load Effective Address\r
-\r
-        Usage:  LEA     dest,src\r
-        Modifies flags: None\r
-\r
-        Transfers offset address of "src" to the destination register.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        reg,mem          2+EA   3     2     1            2-4\r
-\r
-        - the MOV instruction can often save clock cycles when used in\r
-          place of LEA on 8088 processors\r
-\r
-\r
-LEAVE - Restore Stack for Procedure Exit (80188+)\r
-\r
-        Usage:  LEAVE\r
-        Modifies flags: None\r
-\r
-        Releases the local variables created by the previous ENTER\r
-        instruction by restoring SP and BP to their condition before\r
-        the procedure stack frame was initialized.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        none              -     5     4     5             1\r
-\r
-\r
-LES - Load Pointer Using ES\r
-\r
-        Usage:  LES     dest,src\r
-        Modifies flags: None\r
-\r
-        Loads 32-bit pointer from memory source to destination register\r
-        and ES.  The offset is placed in the destination register and the\r
-        segment is placed in ES.  To use this instruction the word at the\r
-        lower memory address must contain the offset and the word at the\r
-        higher address must contain the segment.  This simplifies the loading\r
-        of far pointers from the stack and the interrupt vector table.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        reg,mem         16+EA   7     7     6            2-4  (W88=24+EA)\r
-        reg,mem (PM)      -     -     22    12           5-7\r
-\fLFS - Load Pointer Using FS (386+)\r
-\r
-        Usage:  LFS     dest,src\r
-        Modifies flags: None\r
-\r
-        Loads 32-bit pointer from memory source to destination register\r
-        and FS.  The offset is placed in the destination register and the\r
-        segment is placed in FS.  To use this instruction the word at the\r
-        lower memory address must contain the offset and the word at the\r
-        higher address must contain the segment.  This simplifies the loading\r
-        of far pointers from the stack and the interrupt vector table.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        reg,mem           -     -     7     6            5-7\r
-        reg,mem (PM)      -     -     22    12           5-7\r
-\r
-\r
-LGDT - Load Global Descriptor Table (286+ privileged)\r
-\r
-        Usage:  LGDT    src\r
-        Modifies flags: None\r
-\r
-        Loads a value from an operand into the Global Descriptor Table\r
-        (GDT) register.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        mem64             -     11    11    11            5\r
-\r
-\r
-LIDT - Load Interrupt Descriptor Table (286+ privileged)\r
-\r
-        Usage:  LIDT    src\r
-        Modifies flags: None\r
-\r
-        Loads a value from an operand into the Interrupt Descriptor Table\r
-        (IDT) register.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        mem64             -     12    11    11            5\r
-\r
-\r
-LGS - Load Pointer Using GS (386+)\r
-\r
-        Usage:  LGS     dest,src\r
-        Modifies flags: None\r
-\r
-        Loads 32-bit pointer from memory source to destination register\r
-        and GS.  The offset is placed in the destination register and the\r
-        segment is placed in GS.  To use this instruction the word at the\r
-        lower memory address must contain the offset and the word at the\r
-        higher address must contain the segment.  This simplifies the loading\r
-        of far pointers from the stack and the interrupt vector table.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        reg,mem           -     -     7     6            5-7\r
-        reg,mem (PM)      -     -     22    12           5-7\r
-\fLLDT - Load Local Descriptor Table (286+ privileged)\r
-\r
-        Usage:  LLDT    src\r
-        Modifies flags: None\r
-\r
-        Loads a value from an operand into the Local Descriptor Table \r
-        Register (LDTR).\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        reg16             -     17    20    11            3\r
-        mem16             -     19    24    11            5\r
-\r
-\r
-LMSW - Load Machine Status Word (286+ privileged)\r
-\r
-        Usage:  LMSW    src\r
-        Modifies flags: None\r
-\r
-        Loads the Machine Status Word (MSW) from data found at "src"\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        reg16             -     3     10    13            3\r
-        mem16             -     6     13    13            5\r
-\r
-\r
-LOCK - Lock Bus\r
-\r
-        Usage:  LOCK\r
-                LOCK: (386+ prefix)\r
-        Modifies flags: None\r
-\r
-        This instruction is a prefix that causes the CPU assert bus lock\r
-        signal during the execution of the next instruction.  Used to\r
-        avoid two processors from updating the same data location.  The\r
-        286 always asserts lock during an XCHG with memory operands.  This\r
-        should only be used to lock the bus prior to XCHG, MOV, IN and\r
-        OUT instructions.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        none              2     0     0     1             1\r
-\r
-\r
-LODS - Load String (Byte, Word or Double)\r
-\r
-        Usage:  LODS    src\r
-                LODSB\r
-                LODSW\r
-                LODSD  (386+)\r
-        Modifies flags: None\r
-\r
-        Transfers string element addressed by DS:SI (even if an operand is\r
-        supplied) to the accumulator.   SI is incremented based on the size\r
-        of the operand or based on the instruction used.  If the Direction\r
-        Flag is set SI is decremented, if the Direction Flag is clear SI\r
-        is incremented.  Use with REP prefixes.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        src             12/16   5     5     5             1\r
-\fLOOP - Decrement CX and Loop if CX Not Zero\r
-\r
-        Usage:  LOOP    label\r
-        Modifies flags: None\r
-\r
-        Decrements CX by 1 and transfers control to "label" if CX is not\r
-        Zero.  The "label" operand must be within -128 or 127 bytes of the\r
-        instruction following the loop instruction\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        label:  jump      18   8+m  11+m    6             2\r
-                no jump    5    4     ?     2\r
-\r
-\r
-LOOPE/LOOPZ - Loop While Equal / Loop While Zero\r
-\r
-        Usage:  LOOPE   label\r
-                LOOPZ   label\r
-        Modifies flags: None\r
-\r
-        Decrements CX by 1 (without modifying the flags) and transfers\r
-        control to "label" if CX != 0 and the Zero Flag is set.  The\r
-        "label" operand must be within -128 or 127 bytes of the instruction\r
-        following the loop instruction.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        label:  jump      18   8+m  11+m    9             2\r
-                no jump    5    4     ?     6\r
-\r
-\r
-LOOPNZ/LOOPNE - Loop While Not Zero / Loop While Not Equal\r
-\r
-        Usage:  LOOPNZ  label\r
-                LOOPNE  label\r
-        Modifies flags: None\r
-\r
-        Decrements CX by 1 (without modifying the flags) and transfers\r
-        control to "label" if CX != 0 and the Zero Flag is clear.  The\r
-        "label" operand must be within -128 or 127 bytes of the instruction\r
-        following the loop instruction.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        label:  jump      19   8+m  11+m    9             2\r
-                no jump    5    4     ?     6\r
-\r
-\r
-LSL - Load Segment Limit (286+ protected)\r
-\r
-        Usage:  LSL     dest,src\r
-        Modifies flags: ZF\r
-\r
-        Loads the segment limit of a selector into the destination register\r
-        if the selector is valid and visible at the current privilege level.\r
-        If loading is successful the Zero Flag is set, otherwise it is\r
-        cleared.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        reg16,reg16       -     14  20/25   10            3\r
-        reg32,reg32       -     -   20/25   10            3\r
-        reg16,mem16       -     16  21/26   10            5\r
-        reg32,mem32       -     -   21/26   10            5\r
-\r
-        - 386 times are listed "byte granular" / "page granular"\r
-\fLSS - Load Pointer Using SS (386+)\r
-\r
-        Usage:  LSS     dest,src\r
-        Modifies flags: None\r
-\r
-        Loads 32-bit pointer from memory source to destination register\r
-        and SS.  The offset is placed in the destination register and the\r
-        segment is placed in SS.  To use this instruction the word at the\r
-        lower memory address must contain the offset and the word at the\r
-        higher address must contain the segment.  This simplifies the loading\r
-        of far pointers from the stack and the interrupt vector table.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        reg,mem           -     -     7     6            5-7\r
-        reg,mem (PM)      -     -     22    12           5-7\r
-\r
-\r
-LTR - Load Task Register (286+ privileged)\r
-\r
-        Usage:  LTR     src\r
-        Modifies flags: None\r
-\r
-        Loads the current task register with the value specified in "src".\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        reg16             -     17    23    20            3\r
-        mem16             -     19    27    20            5\r
-\r
-\r
-MOV - Move Byte or Word\r
-\r
-        Usage:  MOV     dest,src\r
-        Modifies flags: None\r
-\r
-        Copies byte or word from the source operand to the destination\r
-        operand.  If the destination is SS interrupts are disabled except\r
-        on early buggy 808x CPUs.  Some CPUs disable interrupts if the\r
-        destination is any of the segment registers\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        reg,reg           2     2     2     1             2\r
-        mem,reg          9+EA   3     2     1            2-4  (W88=13+EA)\r
-        reg,mem          8+EA   5     4     1            2-4  (W88=12+EA)\r
-        mem,immed       10+EA   3     2     1            3-6  (W88=14+EA)\r
-        reg,immed         4     2     2     1            2-3\r
-        mem,accum         10    3     2     1             3   (W88=14)\r
-        accum,mem         10    5     4     1             3   (W88=14)\r
-        segreg,reg16      2     2     2     3             2\r
-        segreg,mem16     8+EA   5     5     9            2-4  (W88=12+EA)\r
-        reg16,segreg      2     2     2     3             2\r
-        mem16,segreg     9+EA   3     2     3            2-4  (W88=13+EA)\r
-        reg32,CR0/CR2/CR3 -     -     6     4\r
-        CR0,reg32         -     -     10    16\r
-        CR2,reg32         -     -     4     4             3\r
-        CR3,reg32         -     -     5     4             3\r
-        reg32,DR0/DR1/DR2/DR3   -     22   10             3\r
-        reg32,DR6/DR7     -     -     22   10             3\r
-        DR0/DR1/DR2/DR3,reg32   -     22   11             3\r
-        DR6/DR7,reg32     -     -     16   11             3\r
-        reg32,TR6/TR7     -     -     12    4             3\r
-        TR6/TR7,reg32     -     -     12    4             3\r
-        reg32,TR3                           3\r
-        TR3,reg32                           6\r
-\r
-        - when the 386 special registers are used all operands are 32 bits\r
-\fMOVS - Move String (Byte or Word)\r
-\r
-        Usage:  MOVS    dest,src\r
-                MOVSB\r
-                MOVSW\r
-                MOVSD  (386+)\r
-        Modifies flags: None\r
-\r
-        Copies data from addressed by DS:SI (even if operands are given) to\r
-        the location ES:DI destination and updates SI and DI based on the\r
-        size of the operand or instruction used.  SI and DI are incremented\r
-        when the Direction Flag is cleared and decremented when the Direction\r
-        Flag is Set.  Use with REP prefixes.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        dest,src          18    5     7     7             1   (W88=26)\r
-\r
-\r
-MOVSX - Move with Sign Extend (386+)\r
-\r
-        Usage:  MOVSX   dest,src\r
-        Modifies flags: None\r
-\r
-        Copies the value of the source operand to the destination register\r
-        with the sign extended.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        reg,reg           -     -     3     3             3\r
-        reg,mem           -     -     6     3            3-7\r
-\r
-\r
-MOVZX - Move with Zero Extend (386+)\r
-\r
-        Usage:  MOVZX   dest,src\r
-        Modifies flags: None\r
-\r
-        Copies the value of the source operand to the destination register\r
-        with the zeroes extended.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        reg,reg           -     -     3     3             3\r
-        reg,mem           -     -     6     3            3-7\r
-\r
-\r
-MUL - Unsigned Multiply\r
-\r
-        Usage:  MUL     src\r
-        Modifies flags: CF OF (AF,PF,SF,ZF undefined)\r
-\r
-        Unsigned multiply of the accumulator by the source.  If "src" is\r
-        a byte value, then AL is used as the other multiplicand and the\r
-        result is placed in AX.  If "src" is a word value, then AX is\r
-        multiplied by "src" and DX:AX receives the result.  If "src" is\r
-        a double word value, then EAX is multiplied by "src" and EDX:EAX\r
-        receives the result.  The 386+ uses an early out algorithm which\r
-        makes multiplying any size value in EAX as fast as in the 8 or 16\r
-        bit registers.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        reg8            70-77   13   9-14  13-18          2\r
-        reg16          118-113  21   9-22  13-26          2\r
-        reg32             -     -    9-38  13-42         2-4\r
-        mem8        (76-83)+EA  16  12-17  13-18         2-4\r
-        mem16     (124-139)+EA  24  12-25  13-26         2-4\r
-        mem32             -     -   12-21  13-42         2-4\r
-\fNEG - Two's Complement Negation\r
-\r
-        Usage:  NEG     dest\r
-        Modifies flags: AF CF OF PF SF ZF\r
-\r
-        Subtracts the destination from 0 and saves the 2s complement of\r
-        "dest" back into "dest".\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        reg               3     2     2     1             2\r
-        mem             16+EA   7     6     3            2-4  (W88=24+EA)\r
-\r
-\r
-NOP - No Operation (90h)\r
-\r
-        Usage:  NOP\r
-        Modifies flags: None\r
-\r
-        This is a do nothing instruction.  It results in occupation of both\r
-        space and time and is most useful for patching code segments.\r
-        (This is the original XCHG AL,AL instruction)\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        none              3     3     3     1             1\r
-\r
-\r
-NOT - One's Compliment Negation (Logical NOT)\r
-\r
-        Usage:  NOT     dest\r
-        Modifies flags: None\r
-\r
-        Inverts the bits of the "dest" operand forming the 1s complement.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        reg               3     2     2     1             2\r
-        mem             16+EA   7     6     3            2-4  (W88=24+EA)\r
-\r
-\r
-OR - Inclusive Logical OR\r
-\r
-        Usage:  OR      dest,src\r
-        Modifies flags: CF OF PF SF ZF (AF undefined)\r
-\r
-        Logical inclusive OR of the two operands returning the result in\r
-        the destination.  Any bit set in either operand will be set in the\r
-        destination.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        reg,reg           3     2     2     1             2\r
-        mem,reg         16+EA   7     7     3            2-4  (W88=24+EA)\r
-        reg,mem          9+EA   7     6     2            2-4  (W88=13+EA)\r
-        reg,immed         4     3     2     1            3-4\r
-        mem8,immed8     17+EA   7     7     3            3-6\r
-        mem16,immed16   25+EA   7     7     3            3-6\r
-        accum,immed       4     3     2     1            2-3\r
-\fOUT - Output Data to Port\r
-\r
-        Usage:  OUT     port,accum\r
-        Modifies flags: None\r
-\r
-        Transfers byte in AL,word in AX or dword in EAX to the specified\r
-        hardware port address.  If the port number is in the range of 0-255\r
-        it can be specified as an immediate.  If greater than 255 then the\r
-        port number must be specified in DX.  Since the PC only decodes 10\r
-        bits of the port address, values over 1023 can only be decoded by\r
-        third party vendor equipment and also map to the port range 0-1023.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386    486         Bytes\r
-\r
-        immed8,accum    10/14   3     10     16           2\r
-        immed8,accum (PM) -     -    4/24 11/31/29        2\r
-        DX,accum         8/12   3     11     16           1\r
-        DX,accum (PM)     -     -    5/25 10/30/29        1\r
-\r
-        - 386+ protected mode timings depend on privilege levels.\r
-\r
-          first number is the timing when:    CPL ó IOPL\r
-          second number is the timing when:   CPL > IOPL\r
-          third number is the timing when:    virtual mode on 486 processor\r
-\r
-\r
-OUTS - Output String to Port  (80188+)\r
-\r
-        Usage:  OUTS    port,src\r
-                OUTSB\r
-                OUTSW\r
-                OUTSD   (386+)\r
-        Modifies flags: None\r
-\r
-        Transfers a byte, word or doubleword from "src" to the hardware\r
-        port specified in DX.  For instructions with no operands the "src"\r
-        is located at DS:SI and SI is incremented or decremented by the\r
-        size of the operand or the size dictated by the instruction format.\r
-        When the Direction Flag is set SI is decremented, when clear, SI is\r
-        incremented.  If the port number is in the range of 0-255 it can\r
-        be specified as an immediate.  If greater than 255 then the port\r
-        number must be specified in DX.  Since the PC only decodes 10 bits\r
-        of the port address, values over 1023 can only be decoded by third\r
-        party vendor equipment and also map to the port range 0-1023.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386    486         Bytes\r
-\r
-        port,src          -     5     14     17           1\r
-        port,src (PM)     -     -    8/28 10/32/30        1\r
-\r
-        - 386+ protected mode timings depend on privilege levels.\r
-\r
-          first number is the timing when:    CPL ó IOPL\r
-          second number is the timing when:   CPL > IOPL\r
-          third number is the timing when:    virtual mode on 486 processor\r
-\r
-\r
-POP - Pop Word off Stack\r
-\r
-        Usage:  POP     dest\r
-        Modifies flags: None\r
-\r
-        Transfers word at the current stack top (SS:SP) to the destination\r
-        then increments SP by two to point to the new stack top.  CS is not\r
-        a valid destination.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        reg16             8     5     4     4             1\r
-        reg32             4     -     -     4             1\r
-        segreg            8     5     7     3             1\r
-        mem16           17+EA   5     5     6            2-4\r
-        mem32             5     -     -     6            2-4\r
-\fPOPA/POPAD - Pop All Registers onto Stack  (80188+)\r
-\r
-        Usage:  POPA\r
-                POPAD  (386+)\r
-        Modifies flags: None\r
-\r
-        Pops the top 8 words off the stack into the 8 general purpose 16/32\r
-        bit registers.   Registers are popped in the following order: (E)DI,\r
-        (E)SI, (E)BP, (E)SP, (E)DX, (E)CX and (E)AX.  The (E)SP value popped\r
-        from the stack is actually discarded.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        none              -     19    24    9             1\r
-\r
-\r
-POPF/POPFD - Pop Flags off Stack\r
-\r
-        Usage:  POPF\r
-                POPFD  (386+)\r
-        Modifies flags: all flags\r
-\r
-        Pops word/doubleword from stack into the Flags Register and then\r
-        increments SP by 2 (for POPF) or 4 (for POPFD).\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        none             8/12   5     5     9             1  (W88=12)\r
-        none  (PM)        -     -     5     6             1\r
-\r
-\r
-PUSH - Push Word onto Stack\r
-\r
-        Usage:  PUSH    src\r
-                PUSH    immed   (80188+ only)\r
-        Modifies flags: None\r
-\r
-        Decrements SP by the size of the operand (two or four, byte values\r
-        are sign extended) and transfers one word from source to the stack\r
-        top (SS:SP).\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        reg16           11/15   3     2     1             1\r
-        reg32             -     -     2     1             1\r
-        mem16           16+EA   5     5     4            2-4  (W88=24+EA)\r
-        mem32             -     -     5     4            2-4\r
-        segreg          10/14   3     2     3             1\r
-        immed             -     3     2     1            2-3\r
-\r
-\r
-PUSHA/PUSHAD - Push All Registers onto Stack  (80188+)\r
-\r
-        Usage:  PUSHA\r
-                PUSHAD  (386+)\r
-        Modifies flags: None\r
-\r
-        Pushes all general purpose registers onto the stack in the following\r
-        order: (E)AX, (E)CX, (E)DX, (E)BX, (E)SP, (E)BP, (E)SI, (E)DI.  The\r
-        value of SP is the value before the actual push of SP.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        none              -     19    24    11            1\r
-\fPUSHF/PUSHFD - Push Flags onto Stack\r
-\r
-        Usage:  PUSHF\r
-                PUSHFD  (386+)\r
-        Modifies flags: None\r
-\r
-        Transfers the Flags Register onto the stack.  PUSHF saves a 16 bit\r
-        value while PUSHFD saves a 32 bit value.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        none            10/14   3     4     4             1\r
-        none  (PM)        -     -     4     3             1\r
-\r
-\r
-RCL - Rotate Through Carry Left\r
-\r
-        Usage:  RCL     dest,count\r
-        Modifies flags: CF OF\r
-\r
-           ÚÄ¿     ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-        ÚÄþ³C³<þÄÄþ³7 <ÄÄÄÄÄÄÄÄÄÄ 0³<Ä¿\r
-        ³  ÀÄÙ     ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ  ³\r
-        ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-        Rotates the bits in the destination to the left "count" times with\r
-        all data pushed out the left side re-entering on the right.  The\r
-        Carry Flag holds the last bit rotated out.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        reg,1             2     2     9     3            2\r
-        mem,1           15+EA   7     10    4           2-4  (W88=23+EA)\r
-        reg,CL           8+4n  5+n    9    8-30          2\r
-        mem,CL        20+EA+4n 8+n    10   9-31         2-4  (W88=28+EA+4n)\r
-        reg,immed8        -    5+n     9   8-30          3\r
-        mem,immed8        -    8+n    10   9-31         3-5\r
-\r
-\r
-RCR - Rotate Through Carry Right\r
-\r
-        Usage:  RCR     dest,count\r
-        Modifies flags: CF OF\r
-\r
-           ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿     ÚÄ¿\r
-        ÚÄ>³7 þÄÄÄÄÄÄÄÄÄ> 0³þÄÄÄ>³C³þÄ¿\r
-        ³  ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ     ÀÄÙ  ³\r
-        ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-        Rotates the bits in the destination to the right "count" times with\r
-        all data pushed out the right side re-entering on the left.  The\r
-        Carry Flag holds the last bit rotated out.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        reg,1             2     2     9     3            2\r
-        mem,1           15+EA   7     10    4           2-4   (W88=23+EA)\r
-        reg,CL           8+4n  5+n    9    8-30          2\r
-        mem,CL        20+EA+4n 8+n    10   9-31         2-4   (W88=28+EA+4n)\r
-        reg,immed8        -    5+n    9    8-30          3\r
-        mem,immed8        -    8+n    10   9-31         3-5\r
-\fREP - Repeat String Operation\r
-\r
-        Usage:  REP\r
-        Modifies flags: None\r
-\r
-        Repeats execution of string instructions while CX != 0.  After\r
-        each string operation, CX is decremented and the Zero Flag is\r
-        tested.  The combination of a repeat prefix and a segment override\r
-        on CPU's before the 386 may result in errors if an interrupt occurs\r
-        before CX=0.  The following code shows code that is susceptible to\r
-        this and how to avoid it:\r
-\r
-         again:  rep movs  byte ptr ES:[DI],ES:[SI]   ; vulnerable instr.\r
-                     jcxz  next              ; continue if REP successful\r
-                     loop  again             ; interrupt goofed count\r
-         next:\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        none              2     2     2                   1\r
-\r
-\r
-REPE/REPZ - Repeat Equal / Repeat Zero\r
-\r
-        Usage:  REPE\r
-                REPZ\r
-        Modifies flags: None\r
-\r
-        Repeats execution of string instructions while CX != 0 and the Zero\r
-        Flag is set.  CX is decremented and the Zero Flag tested after\r
-        each string operation.   The combination of a repeat prefix and a\r
-        segment override on processors other than the 386 may result in\r
-        errors if an interrupt occurs before CX=0.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        none              2     2     2                   1\r
-\r
-\r
-REPNE/REPNZ - Repeat Not Equal / Repeat Not Zero\r
-\r
-        Usage:  REPNE\r
-                REPNZ\r
-        Modifies flags: None\r
-\r
-        Repeats execution of string instructions while CX != 0 and the Zero\r
-        Flag is clear.   CX is decremented and the Zero Flag tested after\r
-        each string operation.   The combination of a repeat prefix and a\r
-        segment override on processors other than the 386 may result in\r
-        errors if an interrupt occurs before CX=0.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        none              2     2     2                   1\r
-\fRET/RETF - Return From Procedure\r
-\r
-        Usage:  RET     nBytes\r
-                RETF    nBytes\r
-                RETN    nBytes\r
-        Modifies flags: None\r
-\r
-        Transfers control from a procedure back to the instruction address\r
-        saved on the stack.  "n bytes" is an optional number of bytes to\r
-        release.  Far returns pop the IP followed by the CS, while near\r
-        returns pop only the IP register.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286    386   486         Bytes\r
-\r
-        retn            16/20  11+m  10+m    5            1\r
-        retn immed      20/24  11+m  10+m    5            3\r
-        retf            26/34  15+m  18+m    13           1\r
-        retf (PM, same priv.)   -    32+m    18           1\r
-        retf (PM, lesser priv.) -      68    33           1\r
-        retf immed      25/33  15+m  18+m    14           3\r
-        retf immed (PM, same priv.)  32+m    17           1\r
-        retf immed (PM, lesser priv.)  68    33           1\r
-\r
-\r
-ROL - Rotate Left\r
-\r
-        Usage:  ROL     dest,count\r
-        Modifies flags: CF OF\r
-\r
-        ÚÄ¿     ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-        ³C³<þÂÄþ³7 <ÄÄÄÄÄÄÄÄÄÄ 0³<Ä¿\r
-        ÀÄÙ  ³  ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ  ³\r
-             ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-        Rotates the bits in the destination to the left "count" times with\r
-        all data pushed out the left side re-entering on the right.  The\r
-        Carry Flag will contain the value of the last bit rotated out.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        reg,1             2     2     3     3             2\r
-        mem,1           15+EA   7     7     4            2-4  (W88=23+EA)\r
-        reg,CL           8+4n  5+n    3     3             2\r
-        mem,CL        20+EA+4n 8+n    7     4            2-4  (W88=28+EA+4n)\r
-        reg,immed8        -    5+n    3     2             3\r
-        mem,immed8        -    8+n    7     4            3-5\r
-\r
-\r
-ROR - Rotate Right\r
-\r
-        Usage:  ROR     dest,count\r
-        Modifies flags: CF OF\r
-\r
-           ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿     ÚÄ¿\r
-        ÚÄ>³7 þÄÄÄÄÄÄÄÄÄ> 0³þÄÂÄ>³C³   \r
-        ³  ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ  ³  ÀÄÙ   \r
-        ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ        \r
-\r
-        Rotates the bits in the destination to the right "count" times with\r
-        all data pushed out the right side re-entering on the left.  The\r
-        Carry Flag will contain the value of the last bit rotated out.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        reg,1             2     2     3     3             2\r
-        mem,1           15+EA   7     7     4            2-4  (W88=23+EA)\r
-        reg,CL           8+4n  5+n    3     3             2\r
-        mem,CL        20+EA+4n 8+n    7     4            2-4  (W88=28+EA+4n)\r
-        reg,immed8        -    5+n    3     2             3\r
-        mem,immed8        -    8+n    7     4            3-5\r
-\fSAHF - Store AH Register into FLAGS\r
-\r
-        Usage:  SAHF\r
-        Modifies flags: AF CF PF SF ZF\r
-\r
-        Transfers bits 0-7 of AH into the Flags Register.  This includes\r
-        AF, CF, PF, SF and ZF.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        none              4     2     3     2             1\r
-\r
-\r
-SAL/SHL - Shift Arithmetic Left / Shift Logical Left\r
-\r
-        Usage:  SAL     dest,count\r
-                SHL     dest,count\r
-        Modifies flags: CF OF PF SF ZF (AF undefined)\r
-\r
-        ÚÄ¿     ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿     ÚÄ¿\r
-        ³C³<ÄÄÄþ³7 <ÄÄÄÄÄÄÄÄÄÄ 0³<ÄÄÄþ³0³\r
-        ÀÄÙ     ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ     ÀÄÙ\r
-\r
-        Shifts the destination left by "count" bits with zeroes shifted\r
-        in on right.  The Carry Flag contains the last bit shifted out.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        reg,1             2     2     3     3            2\r
-        mem,1           15+EA   7     7     4           2-4  (W88=23+EA)\r
-        reg,CL           8+4n  5+n    3     3            2\r
-        mem,CL        20+EA+4n 8+n    7     4           2-4  (W88=28+EA+4n)\r
-        reg,immed8        -    5+n    3     2            3\r
-        mem,immed8        -    8+n    7     4           3-5\r
-\r
-\r
-SAR - Shift Arithmetic Right\r
-\r
-        Usage:  SAR     dest,count\r
-        Modifies flags: CF OF PF SF ZF (AF undefined)\r
-\r
-           ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿     ÚÄ¿\r
-        ÚÄþ³7 ÄÄÄÄÄÄÄÄÄÄ> 0³ÄÄÄþ>³C³\r
-        ³  ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ     ÀÄÙ\r
-        ÀÄÄÄ^\r
-\r
-        Shifts the destination right by "count" bits with the current sign\r
-        bit replicated in the leftmost bit.  The Carry Flag contains the\r
-        last bit shifted out.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        reg,1             2     2     3     3             2\r
-        mem,1           15+EA   7     7     4            2-4  (W88=23+EA)\r
-        reg,CL           8+4n  5+n    3     3             2\r
-        mem,CL        20+EA+4n 8+n    7     4            2-4  (W88=28+EA+4n)\r
-        reg,immed8        -    5+n    3     2             3\r
-        mem,immed8        -    8+n    7     4            3-5\r
-\fSBB - Subtract with Borrow/Carry\r
-\r
-        Usage:  SBB     dest,src\r
-        Modifies flags: AF CF OF PF SF ZF\r
-\r
-        Subtracts the source from the destination, and subtracts 1 extra if\r
-        the Carry Flag is set.   Results are returned in "dest".\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        reg,reg           3     2     2     1             2\r
-        mem,reg         16+EA   7     6     3            2-4  (W88=24+EA)\r
-        reg,mem          9+EA   7     7     2            2-4  (W88=13+EA)\r
-        reg,immed         4     3     2     1            3-4\r
-        mem,immed       17+EA   7     7     3            3-6  (W88=25+EA)\r
-        accum,immed       4     3     2     1            2-3\r
-\r
-\r
-SCAS - Scan String  (Byte, Word or Doubleword)\r
-\r
-        Usage:  SCAS    string\r
-                SCASB\r
-                SCASW\r
-                SCASD   (386+)\r
-        Modifies flags: AF CF OF PF SF ZF\r
-\r
-        Compares value at ES:DI (even if operand is specified) from the\r
-        accumulator and sets the flags similar to a subtraction.  DI is\r
-        incremented/decremented based on the instruction format (or\r
-        operand size) and the state of the Direction Flag.  Use with REP\r
-        prefixes.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        string            15    7     7     6             1  (W88=19)\r
-\r
-\r
-SETAE/SETNB - Set if Above or Equal / Set if Not Below (386+)\r
-\r
-        Usage:  SETAE   dest\r
-                SETNB   dest\r
-        (unsigned, 386+)\r
-        Modifies flags: none\r
-\r
-        Sets the byte in the operand to 1 if the Carry Flag is clear\r
-        otherwise sets the operand to 0.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        reg8              -     -     4     3             3\r
-        mem8              -     -     5     4             3\r
-\r
-\r
-SETB/SETNAE - Set if Below / Set if Not Above or Equal (386+)\r
-\r
-        Usage:  SETB    dest\r
-                SETNAE  dest\r
-        (unsigned, 386+)\r
-        Modifies flags: none\r
-\r
-        Sets the byte in the operand to 1 if the Carry Flag is set\r
-        otherwise sets the operand to 0.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        reg8              -     -     4     3             3\r
-        mem8              -     -     5     4             3\r
-\fSETBE/SETNA - Set if Below or Equal / Set if Not Above (386+)\r
-\r
-        Usage:  SETBE   dest\r
-                SETNA   dest\r
-        (unsigned, 386+)\r
-        Modifies flags: none\r
-\r
-        Sets the byte in the operand to 1 if the Carry Flag or the Zero\r
-        Flag is set, otherwise sets the operand to 0.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        reg8              -     -     4     3             3\r
-        mem8              -     -     5     4             3\r
-\r
-\r
-SETE/SETZ - Set if Equal / Set if Zero (386+)\r
-\r
-        Usage:  SETE    dest\r
-                SETZ    dest\r
-        Modifies flags: none\r
-\r
-        Sets the byte in the operand to 1 if the Zero Flag is set,\r
-        otherwise sets the operand to 0.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        reg8              -     -     4     3             3\r
-        mem8              -     -     5     4             3\r
-\r
-\r
-SETNE/SETNZ - Set if Not Equal / Set if Not Zero (386+)\r
-\r
-        Usage:  SETNE   dest\r
-                SETNZ   dest\r
-        Modifies flags: none\r
-\r
-        Sets the byte in the operand to 1 if the Zero Flag is clear,\r
-        otherwise sets the operand to 0.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        reg8              -     -     4     3             3\r
-        mem8              -     -     5     4             3\r
-\r
-\r
-SETL/SETNGE - Set if Less / Set if Not Greater or Equal (386+)\r
-\r
-        Usage:  SETL    dest\r
-                SETNGE  dest\r
-        (signed, 386+)\r
-        Modifies flags: none\r
-\r
-        Sets the byte in the operand to 1 if the Sign Flag is not equal\r
-        to the Overflow Flag, otherwise sets the operand to 0.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        reg8              -     -     4     3             3\r
-        mem8              -     -     5     4             3\r
-\fSETGE/SETNL - Set if Greater or Equal / Set if Not Less (386+)\r
-\r
-        Usage:  SETGE   dest\r
-                SETNL   dest\r
-        (signed, 386+)\r
-        Modifies flags: none\r
-\r
-        Sets the byte in the operand to 1 if the Sign Flag equals the\r
-        Overflow Flag, otherwise sets the operand to 0.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        reg8              -     -     4     3             3\r
-        mem8              -     -     5     4             3\r
-\r
-\r
-SETLE/SETNG - Set if Less or Equal / Set if Not greater or Equal (386+)\r
-\r
-        Usage:  SETLE   dest\r
-                SETNG   dest\r
-        (signed, 386+)\r
-        Modifies flags: none\r
-\r
-        Sets the byte in the operand to 1 if the Zero Flag is set or the\r
-        Sign Flag is not equal to the Overflow Flag,  otherwise sets the\r
-        operand to 0.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        reg8              -     -     4     3             3\r
-        mem8              -     -     5     4             3\r
-\r
-\r
-SETG/SETNLE - Set if Greater / Set if Not Less or Equal (386+)\r
-\r
-        Usage:  SETG    dest\r
-                SETNLE  dest\r
-        (signed, 386+)\r
-        Modifies flags: none\r
-\r
-        Sets the byte in the operand to 1 if the Zero Flag is clear or the\r
-        Sign Flag equals to the Overflow Flag,  otherwise sets the operand\r
-        to 0.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        reg8              -     -     4     3             3\r
-        mem8              -     -     5     4             3\r
-\r
-\r
-SETS - Set if Signed (386+)\r
-\r
-        Usage:  SETS    dest\r
-        Modifies flags: none\r
-\r
-        Sets the byte in the operand to 1 if the Sign Flag is set, otherwise\r
-        sets the operand to 0.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        reg8              -     -     4     3             3\r
-        mem8              -     -     5     4             3\r
-\fSETNS - Set if Not Signed (386+)\r
-\r
-        Usage:  SETNS   dest\r
-        Modifies flags: none\r
-\r
-        Sets the byte in the operand to 1 if the Sign Flag is clear,\r
-        otherwise sets the operand to 0.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        reg8              -     -     4     3             3\r
-        mem8              -     -     5     4             3\r
-\r
-\r
-SETC - Set if Carry (386+)\r
-\r
-        Usage:  SETC    dest\r
-        Modifies flags: none\r
-\r
-        Sets the byte in the operand to 1 if the Carry Flag is set,\r
-        otherwise sets the operand to 0.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        reg8              -     -     4     3             3\r
-        mem8              -     -     5     4             3\r
-\r
-\r
-SETNC - Set if Not Carry (386+)\r
-\r
-        Usage:  SETNC   dest\r
-        Modifies flags: none\r
-\r
-        Sets the byte in the operand to 1 if the Carry Flag is clear,\r
-        otherwise sets the operand to 0.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        reg8              -     -     4     3             3\r
-        mem8              -     -     5     4             3\r
-\r
-\r
-SETO - Set if Overflow (386+)\r
-\r
-        Usage:  SETO    dest\r
-        Modifies flags: none\r
-\r
-        Sets the byte in the operand to 1 if the Overflow Flag is set,\r
-        otherwise sets the operand to 0.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        reg8              -     -     4     3             3\r
-        mem8              -     -     5     4             3\r
-\r
-\r
-SETNO - Set if Not Overflow (386+)\r
-\r
-        Usage:  SETNO   dest\r
-        Modifies flags: none\r
-\r
-        Sets the byte in the operand to 1 if the Overflow Flag is clear,\r
-        otherwise sets the operand to 0.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        reg8              -     -     4     3             3\r
-        mem8              -     -     5     4             3\r
-\fSETP/SETPE - Set if Parity / Set if Parity Even  (386+)\r
-\r
-        Usage:  SETP    dest\r
-                SETPE   dest\r
-        Modifies flags: none\r
-\r
-        Sets the byte in the operand to 1 if the Parity Flag is set,\r
-        otherwise sets the operand to 0.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        reg8              -     -     4     3             3\r
-        mem8              -     -     5     4             3\r
-\r
-\r
-SETNP/SETPO - Set if No Parity / Set if Parity Odd (386+)\r
-\r
-        Usage:  SETNP   dest\r
-                SETPO   dest\r
-        Modifies flags: none\r
-\r
-        Sets the byte in the operand to 1 if the Parity Flag is clear,\r
-        otherwise sets the operand to 0.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        reg8              -     -     4     3             3\r
-        mem8              -     -     5     4             3\r
-\r
-\r
-SGDT - Store Global Descriptor Table (286+ privileged)\r
-\r
-        Usage:  SGDT    dest\r
-        Modifies flags: none\r
-\r
-        Stores the Global Descriptor Table (GDT) Register into the\r
-        specified operand.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        mem64             -     11    9     10            5\r
-\r
-\r
-SIDT - Store Interrupt Descriptor Table (286+ privileged)\r
-\r
-        Usage:  SIDT    dest\r
-        Modifies flags: none\r
-\r
-        Stores the Interrupt Descriptor Table (IDT) Register into the\r
-        specified operand.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        mem64             -     12    9     10            5\r
-\r
-\r
-SHL - Shift Logical Left\r
-\r
-        See: SAL\r
-\fSHR - Shift Logical Right\r
-\r
-        Usage:  SHR     dest,count\r
-        Modifies flags: CF OF PF SF ZF (AF undefined)\r
-\r
-        ÚÄ¿     ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿     ÚÄ¿\r
-        ³0³ÄÄÄþ>³7 ÄÄÄÄÄÄÄÄÄÄ> 0³ÄÄÄþ>³C³\r
-        ÀÄÙ     ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ     ÀÄÙ\r
-\r
-        Shifts the destination right by "count" bits with zeroes shifted\r
-        in on the left.  The Carry Flag contains the last bit shifted out.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        reg,1             2     2     3                   2\r
-        mem,1           15+EA   7     7                  2-4   (W88=23+EA)\r
-        reg,CL           8+4n  5+n    3                   2\r
-        mem,CL        20+EA+4n 8+n    7                  2-4   (W88=28+EA+4n)\r
-        reg,immed8        -    5+n    3                   3\r
-        mem,immed8        -    8+n    7                  3-5\r
-\r
-\r
-SHLD/SHRD - Double Precision Shift (386+)\r
-\r
-        Usage:  SHLD    dest,src,count\r
-                SHRD    dest,src,count\r
-        Modifies flags: CF PF SF ZF (OF,AF undefined)\r
-\r
-        SHLD shifts "dest" to the left "count" times and the bit positions\r
-        opened are filled with the most significant bits of "src".  SHRD\r
-        shifts "dest" to the right "count" times and the bit positions\r
-        opened are filled with the least significant bits of the second\r
-        operand.  Only the 5 lower bits of "count" are used.\r
-\r
-                                        Clocks                  Size\r
-        Operands                808x  286   386   486           Bytes\r
-\r
-        reg16,reg16,immed8       -     -     3     2              4\r
-        reg32,reg32,immed8       -     -     3     2              4\r
-        mem16,reg16,immed8       -     -     7     3              6\r
-        mem32,reg32,immed8       -     -     7     3              6\r
-        reg16,reg16,CL           -     -     3     3              3\r
-        reg32,reg32,CL           -     -     3     3              3\r
-        mem16,reg16,CL           -     -     7     4              5\r
-        mem32,reg32,CL           -     -     7     4              5\r
-\r
-\r
-SLDT - Store Local Descriptor Table (286+ privileged)\r
-\r
-        Usage:  SLDT    dest\r
-        Modifies flags: none\r
-\r
-        Stores the Local Descriptor Table (LDT) Register into the\r
-        specified operand.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        reg16             -     2     2     2             3\r
-        mem16             -     2     2     3             5\r
-\r
-\r
-SMSW - Store Machine Status Word (286+ privileged)\r
-\r
-        Usage:  SMSW    dest\r
-        Modifies flags: none\r
-\r
-        Store Machine Status Word (MSW) into "dest".\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        reg16             -     2     10    2             3\r
-        mem16             -     3     3     3             5\r
-\fSTC - Set Carry\r
-\r
-        Usage:  STC\r
-        Modifies flags: CF\r
-\r
-        Sets the Carry Flag to 1.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        none              2     2     2     2             1\r
-\r
-\r
-STD - Set Direction Flag\r
-\r
-        Usage:  STD\r
-        Modifies flags: DF\r
-\r
-        Sets the Direction Flag to 1 causing string instructions to\r
-        auto-decrement SI and DI instead of auto-increment.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        none              2     2     2     2             1\r
-\r
-\r
-STI - Set Interrupt Flag  (Enable Interrupts)\r
-\r
-        Usage:  STI\r
-        Modifies flags: IF\r
-\r
-        Sets the Interrupt Flag to 1, which enables recognition of all\r
-        hardware interrupts.  If an interrupt is generated by a hardware\r
-        device, an End of Interrupt (EOI) must also be issued to enable\r
-        other hardware interrupts of the same or lower priority.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        none              2     2     2     5             1\r
-\r
-\r
-STOS - Store String  (Byte, Word or Doubleword)\r
-\r
-        Usage:  STOS    dest\r
-                STOSB\r
-                STOSW\r
-                STOSD\r
-        Modifies flags: None\r
-\r
-        Stores value in accumulator to location at ES:(E)DI (even if operand\r
-        is given).  (E)DI is incremented/decremented based on the size of\r
-        the operand (or instruction format) and the state of the Direction\r
-        Flag.   Use with REP prefixes.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        dest              11    3     4     5             1  (W88=15)\r
-\r
-\r
-STR - Store Task Register (286+ privileged)\r
-\r
-        Usage:  STR     dest\r
-        Modifies flags: None\r
-\r
-        Stores the current Task Register to the specified operand.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        reg16             -     2     2     2             3\r
-        mem16             -     3     2     3             5\r
-\fSUB - Subtract\r
-\r
-        Usage:  SUB     dest,src\r
-        Modifies flags: AF CF OF PF SF ZF\r
-\r
-        The source is subtracted from the destination and the result is\r
-        stored in the destination.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        reg,reg           3     2     2     1             2\r
-        mem,reg         16+EA   7     6     3            2-4  (W88=24+EA)\r
-        reg,mem          9+EA   7     7     2            2-4  (W88=13+EA)\r
-        reg,immed         4     3     2     1            3-4\r
-        mem,immed       17+EA   7     7     3            3-6  (W88=25+EA)\r
-        accum,immed       4     3     2     1            2-3\r
-\r
-\r
-TEST - Test For Bit Pattern\r
-\r
-        Usage:  TEST    dest,src\r
-        Modifies flags: CF OF PF SF ZF (AF undefined)\r
-\r
-        Performs a logical AND of the two operands updating the flags\r
-        register without saving the result.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        reg,reg           3     2     1     1             2\r
-        reg,mem          9+EA   6     5     1            2-4  (W88=13+EA)\r
-        mem,reg          9+EA   6     5     2            2-4  (W88=13+EA)\r
-        reg,immed         5     3     2     1            3-4\r
-        mem,immed       11+EA   6     5     2            3-6\r
-        accum,immed       4     3     2     1            2-3\r
-\r
-\r
-VERR - Verify Read (286+ protected)\r
-\r
-        Usage:  VERR    src\r
-        Modifies flags: ZF\r
-\r
-        Verifies the specified segment selector is valid and is readable\r
-        at the current privilege level.  If the segment is readable,\r
-        the Zero Flag is set, otherwise it is cleared.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        reg16             -     14    10    11            3\r
-        mem16             -     16    11    11            5\r
-\r
-\r
-VERW - Verify Write (286+ protected)\r
-\r
-        Usage:  VERW    src\r
-        Modifies flags: ZF\r
-\r
-        Verifies the specified segment selector is valid and is ratable\r
-        at the current privilege level.  If the segment is writable,\r
-        the Zero Flag is set, otherwise it is cleared.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        reg16             -     14    15    11            3\r
-        mem16             -     16    16    11            5\r
-\fWAIT/FWAIT - Event Wait\r
-\r
-        Usage:  WAIT\r
-                FWAIT\r
-        Modifies flags: None\r
-\r
-        CPU enters wait state until the coprocessor signals it has finished\r
-        its operation.  This instruction is used to prevent the CPU from\r
-        accessing memory that may be temporarily in use by the coprocessor.\r
-        WAIT and FWAIT are identical.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        none              4     3     6+   1-3            1\r
-\r
-\r
-WBINVD - Write-Back and Invalidate Cache (486+)\r
-\r
-        Usage:  WBINVD\r
-        Modifies flags: None\r
-\r
-        Flushes internal cache, then signals the external cache to write\r
-        back current data followed by a signal to flush the external cache.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        none              -     -     -     5             2\r
-\r
-\r
-XCHG - Exchange\r
-\r
-        Usage:  XCHG    dest,src\r
-        Modifies flags: None\r
-\r
-        Exchanges contents of source and destination.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        reg,reg           4     3     3     3             2\r
-        mem,reg         17+EA   5     5     5            2-4  (W88=25+EA)\r
-        reg,mem         17+EA   5     5     3            2-4  (W88=25+EA)\r
-        accum,reg         3     3     3     3             1\r
-        reg,accum         3     3     3     3             1\r
-\r
-\r
-XLAT/XLATB - Translate\r
-\r
-        Usage:  XLAT    translation-table\r
-                XLATB   (masm 5.x)\r
-        Modifies flags: None\r
-\r
-        Replaces the byte in AL with byte from a user table addressed by\r
-        BX.  The original value of AL is the index into the translate table.\r
-        The best way to discripe this is MOV AL,[BX+AL]\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        table offset      11    5     5     4             1\r
-\fXOR - Exclusive OR\r
-\r
-        Usage:  XOR     dest,src\r
-        Modifies flags: CF OF PF SF ZF (AF undefined)\r
-\r
-        Performs a bitwise exclusive OR of the operands and returns\r
-        the result in the destination.\r
-\r
-                                 Clocks                 Size\r
-        Operands         808x  286   386   486          Bytes\r
-\r
-        reg,reg           3     2     2     1             2\r
-        mem,reg         16+EA   7     6     3            2-4  (W88=24+EA)\r
-        reg,mem          9+EA   7     7     2            2-4  (W88=13+EA)\r
-        reg,immed         4     3     2     1            3-4\r
-        mem,immed       17+EA   7     7     3            3-6  (W88=25+EA)\r
-        accum,immed       4     3     2     1            2-3\r
-\1a
\ No newline at end of file
diff --git a/16/PCGPE10/JOYSTICK.TXT b/16/PCGPE10/JOYSTICK.TXT
deleted file mode 100644 (file)
index 0ddd22a..0000000
+++ /dev/null
@@ -1,255 +0,0 @@
-                    ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-                    ³ Programming the PC Joystick  ³\r
-                    ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-                       Written for the PC-GPE by\r
-                     Steve McGowan and Mark Feldman\r
-\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Programming Info ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-All joystick programming is done via port 201h.\r
-\r
-                      ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿\r
-                      ³ 7 ³ 6 ³ 5 ³ 4 ³ 3 ³ 2 ³ 1 ³ 0 ³\r
-                      ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÙ\r
-                        ³   ³   ³   ³   ³   ³   ³   ³\r
-Joystick B, Button 2 ÄÄÄÙ   ³   ³   ³   ³   ³   ³   ÀÄÄÄ Joystick A, X Axis\r
-Joystick B, Button 1 ÄÄÄÄÄÄÄÙ   ³   ³   ³   ³   ÀÄÄÄÄÄÄÄ Joystick A, Y Axis\r
-Joystick A, Button 2 ÄÄÄÄÄÄÄÄÄÄÄÙ   ³   ³   ÀÄÄÄÄÄÄÄÄÄÄÄ Joystick B, X Axis\r
-Joystick A, Button 1 ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ   ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Joystick B, Y Axis\r
-\r
-Reading the status of the joystick buttons is fairly simple. Just read the\r
-byte from the joystick port and check the status of the appropriate bit. A\r
-clear bit (0) means the button is pressed, a set bit (1) means it is not\r
-pressed. Note that the button's are not hardware debounced. Each time a\r
-button is pressed it's bit may "bounce" between 0 and 1 a couple of times.\r
-\r
-Reading the position of the stick positions is a bit more complicated. You\r
-must first write a dummy byte (any value will do) to the joystick port. This\r
-will set each axis bit to 1. You must then time how long the bit takes to\r
-drop back to 0, this time is roughly proportional to the position of\r
-the joystick axis (see Steve McGowan's discussion below).\r
-\r
-AT computers also have a BIOS call which supports the joystick. I have come\r
-across numerous machines which apparently did not support this call. My own\r
-machine supports reading the joystick buttons apparently can't read the\r
-stick position values, so I do not advise using this call for any serious\r
-games. In any case here is info on the call:\r
-\r
-Joystick Support BIOS Call\r
-\r
-Int 15h\r
-\r
-To call:\r
-  AH = 84h\r
-  DX = 00h Read switch settings\r
-       01h Read joystick position\r
-\r
-Returns:\r
-    PC, PCjr : Carry flag set, AH = 80h\r
-       PC XT : Carry flag set, AH = 86h\r
-  All others : DX = 00h on calling\r
-                 AL = Switch settings (bits 4 - 7)\r
-                 Carry flag set on error\r
-               DX = 01h on calling\r
-                 AX = A(X) value\r
-                 BX = A(Y) value\r
-                 CX = B(X) value\r
-                 DX = B(Y) value\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Hardware Pinout ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-The joystick connects to a 15 pin female plug :\r
-\r
-                     __________________________\r
-                     \ 8  7  6  5  4  3  2  1 /\r
-                      \ 9  10 11 12 13 14 15 /\r
-                       ----------------------\r
-\r
-                  ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-                  ³ Pin #  Joystick               ³\r
-                  ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´\r
-                  ³  1     +5v                    ³\r
-                  ³  2     Joystick A, Button 1   ³\r
-                  ³  3     Joystick A, X Axis     ³\r
-                  ³  4     Gnd                    ³\r
-                  ³  5     Gnd                    ³\r
-                  ³  6     Joystick A, Y Axis     ³\r
-                  ³  7     Joystick A, Button 2   ³\r
-                  ³  8     +5v                    ³\r
-                  ³  9     +5v                    ³\r
-                  ³  10    Joystick B, Button 1   ³\r
-                  ³  11    Joystick B, X Axis     ³\r
-                  ³  12    Gnd                    ³\r
-                  ³  13    Joystick B, Y Axis     ³\r
-                  ³  14    Joystick B, Button 2   ³\r
-                  ³  15    +5v                    ³\r
-                  ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Misc notes on Joystick handling by Steve McGowan ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-With a polling loop on a 486-66 I got x/y values between 8 and 980. When\r
-I centered the stick the value was usually a value around 330.\r
-\r
-NOTE: a Gravis Game Pad it only put out 3 values, 8(min), 330(center),\r
-and 980(max). Every joystick I have tried has been non-linear.\r
-\r
-The "speed compensation" that some games require is due to the fact that\r
-the game designer did not anticipate the range of values that could\r
-come back on faster machines. On a 486-25 you may see max values of 360,\r
-I saw 980, on a Pentium the max value could be well over 2000. If you\r
-had used a unsigned byte value you probably would have been in good\r
-shape on an AT, or 386 but you would be in big trouble with faster machines.\r
-\r
-Because the joystick logic returns a non linear value, if you base your\r
-scaling only on the 4 corners then the center will be off (biased towards\r
-a corner). If you just use the center value and a single scaling factor\r
-(i.e. of the center is at 330 then full throw should be at 660), then the\r
-stick will saturate (660) half way to the full throw position (980).\r
-That is why most joystick setup programs make the distinction between\r
-hitting the 4 corners and centering the stick.\r
-\r
-Joystick position vs. loop count\r
-\r
-     x,y--------------------\r
-     8,8|      330,8       | 980,8\r
-        |                  |\r
-        |                  |    delta 330\r
-        |                  |\r
-   8,330|      330,330     | 980,330 (y centered)\r
-        |                  |\r
-        |                  |    delta 650\r
-        |                  |\r
-   8,980|      330,980     | 980,980\r
-        --------------------\r
-            (x centered)\r
-\r
-For the best effect you basically need 2 scale factors, depending on whether\r
-you are above or below the center value. I think the curve is actually an\r
-exponential (charging capacitor) but a straight line approximation should\r
-do fine.\r
-\r
-The 10% dead zone in the center is a good idea. The centering mechanism of\r
-joysticks vary in repeatablity, they don't always come back to the same place.\r
-I have a cheap one that (1 time in 8) does not return to the X center if I\r
-just let it snap to center. It hangs on the high side.\r
-\r
-I would recommend disabling interrupts while polling. An interrupt\r
-in the middle of your polling loop will really throw off the results. And\r
-any DMA that takes place will also give you bad values.\r
-\r
-Joysticks are noisy, so holding the stick in a fixed position will return\r
-values that vary +-5% easily. I added a smoothing function to my joystick\r
-code where I throw away single values that are not continuous. It helped\r
-a lot with the noise and the DMA.\r
-\r
-I use protected mode and the interrupt disable() call doesn't actually work\r
-because it only disables interrupts for the process not the processor.\r
-The smoothing trick can help here too.\r
-\r
-If I turn on my machine and start the polling loop immediately, it will\r
-put out a centered value of 330,330 but after warming up for 10 minutes\r
-the value changes to 285,285. This variance also needs to be absorbed in\r
-your center dead zone. If after warming up the 'center' value is outside your\r
-dead zone then the cursor will drift (to the left and/or up). Make\r
-sure your game has a "center joystick" command to get around joystick\r
-interfaces with lousy temperature compensation.\r
-\r
-You must wait for all of the axis bits to settle before initiating\r
-another read, otherwise strange results may come out. So, instead of\r
-reading X, then Y, in two separate loops (which take twice as much time)\r
-Read both X and Y simultaneously, polling until both bits settle. This\r
-can be extended for two joysticks, assuming that they are both attached.\r
-The respective X/Y bits never come true if there is no joystick attached.\r
-\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ A Simple Demo Joystick Unit ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-{\r
-  JOY.PAS - By Mark Feldman\r
-            e-mail address : u914097@student.canberra.edu.au\r
-                             myndale@cairo.anu.edu.au\r
-\r
-\r
-  A simple Pascal Joystick Unit.\r
-}\r
-\r
-\r
-unit Joy;\r
-\r
-Interface\r
-\r
-{ Define constants for use as JoystickButton and JoystickPosition parameters }\r
-const JoystickAButton1 = $10;\r
-      JoystickAButton2 = $20;\r
-      JoystickBButton1 = $40;\r
-      JoystickBButton2 = $80;\r
-      JoystickAAxisX   = $01;\r
-      JoystickAAxisY   = $02;\r
-      JoystickBAxisX   = $04;\r
-      JoystickBAxisY   = $08;\r
-\r
-function JoystickButton(buttonnum : byte) : boolean;\r
-function JoystickPosition(axisnum : byte) : word;\r
-\r
-Implementation\r
-\r
-const JOYSTICKPORT = $201;\r
-\r
-{ Button returns true is button is pressed }\r
-function JoystickButton(buttonnum : byte) : boolean;\r
-begin\r
-  JoystickButton := (Port[JOYSTICKPORT] and buttonnum) = 0;\r
-end;\r
-\r
-{ Returns position value of joystick. The value returned is highly\r
-  dependent on machine speed. Changing the setting of the computer's\r
-  Turbo speed button will affect the value returned.\r
-  Returns $FFFF if the joystick is not connected\r
-}\r
-function JoystickPosition(axisnum : byte) : word;\r
-var count : word;\r
-begin\r
-  asm\r
-    mov word ptr count, 0\r
-    cli          { Disable interrupts so they don't interfere with timing }\r
-    mov dx, JOYSTICKPORT   { Write dummy byte to joystick port }\r
-    out dx, al\r
-    @joystickloop:\r
-    inc count              { Add one to count }\r
-    cmp count, $FFFF       { Check for time out }\r
-    je @done\r
-    in al, dx              { Get joystick port value }\r
-    and al, axisnum        { Test the appropriate bit }\r
-    jne @joystickloop\r
-    @done:\r
-    sti                    { Enable interrupts again }\r
-  end;\r
-  JoystickPosition := count;\r
-end;\r
-\r
-end.\r
-\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ References  ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-Title : Flights of Fantasy\r
-Author : Christopher Lampton\r
-Publishers : The Waite Group\r
-ISBN : 1-878739-18-2\r
-\r
-Title : DOS and BIOS Functions Quick Reference\r
-Publishers : Que Corporation\r
-ISBN : 0-88022-426-6\r
diff --git a/16/PCGPE10/KEYBOARD.TXT b/16/PCGPE10/KEYBOARD.TXT
deleted file mode 100644 (file)
index 21c5587..0000000
+++ /dev/null
@@ -1,243 +0,0 @@
-\r
-                     ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-                     ³ Programming the Keyboard ³\r
-                     ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-                 Written for the PC-GPE by Mark Feldman\r
-              e-mail address : u914097@student.canberra.edu.au\r
-                               myndale@cairo.anu.edu.au\r
-\r
-             ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-             ³      THIS FILE MAY NOT BE DISTRIBUTED     ³\r
-             ³ SEPARATE TO THE ENTIRE PC-GPE COLLECTION. ³\r
-             ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Disclaimer ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-I assume no responsibility whatsoever for any effect that this file, the\r
-information contained therein or the use thereof has on you, your sanity,\r
-computer, spouse, children, pets or anything else related to you or your\r
-existance. No warranty is provided nor implied with this information.\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Overview ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-The operation of the keyboard is really quite simple. Every time a key\r
-is pressed or released an interrupt 9 is generated, and reading the value\r
-from port 60h tells you what happened.\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Decoding the Keyboard Byte ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-So let's say you've installed an interrupt handler to handle all keyboard\r
-events and when an interrupt is generated your handler reads the byte from\r
-port 60h. What now?\r
-\r
-Well..each key on the keyboard has an associated scan code which is contained\r
-in the lower 7 bits of the byte. The most significant bit (ie bit 7) tells\r
-you what was actually done, 0 = key was just pressed, 1 = key was just\r
-released. If someone had just pressed the ESC key for instance, the port will\r
-show a value of 1 (1 is the ESC key's scan code). If they hold their finger\r
-on the button the keyboard will keep generating interrupt 9's and each\r
-time the port will still show a value of 1. When the person releases the key\r
-a final interrupt will be generated and the port will return 129 (1 + 128,\r
-since the high bit will be set indicating the person has released the key).\r
-\r
-Well...it's almost this simple. Some keys are "extended" keys. When an\r
-extended key is pressed an interrupt is generated and the keyboard port\r
-will return a value of 224 (E0h). This means that an extended key was pressed\r
-and it's *extended* scan code will be available during the *next* interrupt.\r
-Note that the left control key has a scan code of 29, while the *right*\r
-control key has an *extended* scan code of 29. The same applies to the alt\r
-keys and the arrow keys (keypad arrows vs the other ones).\r
-\r
-It would be nice if all keys were created equal and we could just throw away\r
-the 224 extended bytes and handle all the other bytes normally. Unfortunately\r
-there are two buttons which on my machine at least (and others I have tested)\r
-do some really weird stuff:\r
-\r
-PrtScn\r
-ÄÄÄÄÄÄ\r
-Pressing this button will send *2* extended characters to the handler, 42\r
-and 55, so the actual byte sequence will be 224, 42, 224, 55. (Also note\r
-that the left shift key has a regular scan code of 42, so there goes our\r
-idea of just throwing 224's away). Only the extended 55's are sent during\r
-auto-repeat. When the key is released, the two are sent again with the high\r
-bits set (224, 170, 224, and 183). If any of the shift or control keys are\r
-being held down when the PrtScn button is pressed then only the (224, 55) is\r
-sent when the key is pressed and only the (224, 183) is sent when it's\r
-released. If the alt key is being held down (System Request) then the key\r
-behaves like an ordinary key with scan code 84. The practical upshot of all\r
-this is that the handlers you write to handle normal keys and extended keys\r
-will work fine with all the different PrtScn combinations (although a program\r
-would have to check normal key 84 *AND* extended key 55 in order to determine\r
-if the key is currently being pressed).\r
-\r
-Pause/Break\r
-ÄÄÄÄÄÄÄÄÄÄÄ\r
-Welcome to hell. If you press this key while either of the the control keys\r
-are being held down, it will behave like extended key 70, at all other times\r
-it will send the following bytes: (225, 29, 69, 225, 157, 197). Holding the\r
-key down does not result in autorepeat. Taking your finger off the key does\r
-not send any extra bytes, they appear to be sent after the "key down" bytes\r
-when you first press the key. Notice that 225 isn't 224, so our normal\r
-extended character handler will not take care of this. My personal theory is\r
-that while a scan code of 224 (E0h) means there is 1 more character\r
-following, a scan code of 225 (E1h) means there are *2* more following. I've\r
-seen a number of keyboard handler libraries and they all seem to overlook\r
-this key. So why not be the first kid on your block to have a keyboard\r
-handler which properly supports the Pause/Break key? CHECK IT OUT!!\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Writing a Handler ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-Writing a keyboard handler is fairly straightforward. This section will\r
-show how to do it in Pascal (you C and asm programmers would probably already\r
-know this stuff anyway).\r
-\r
-First we'll declare a few things we'll need:\r
-\r
-const KEYBOARDINTR = 9;\r
-      KEYBOARDPORT = $60;\r
-\r
-var BIOSKeyboardHandler : procedure;\r
-    CallBIOSHandler : boolean;\r
-\r
-The CallBIOSHandler variable will be initialised by the calling program. If\r
-we also want the BIOS handler to process all keystrokes then this variable\r
-must be set to true.\r
-\r
-Next we need to store the value of the current handler and set up own our\r
-own one. We'll use a procedure called KeyboardHandler to handle the actual\r
-interrupt.\r
-\r
-CallBIOSHandler := false; { ...or set it to true if you want. }\r
-GetIntVec(KEYBOARDINTR, @BIOSKeyboardHandler);\r
-SetIntVec(KEYBOARDINTR, Addr(KeyboardHandler));\r
-\r
-Ok, so everything is now set up and our handler will now be able to process\r
-all keyboard events. The actual interrupt handler could look like this:\r
-\r
-{$F+}\r
-procedure KeyboardHandler(Flags, CS, IP, AX, BX, CX, DX,\r
-                          SI, DI, DS, ES, BP: Word);\r
-interrupt;\r
-var key : byte;\r
-begin\r
-\r
-  key := Port[KEYBOARDPORT];\r
-\r
-  { PROCESS THE KEYSTROKE HERE }\r
-\r
-  if CallBIOSHandler then\r
-\r
-  { Call the BIOS keyboard handler if the calling program wants us to }\r
-    begin\r
-      asm pushf end;\r
-      BIOSKeyboardHandler;\r
-    end\r
-\r
-  { Otherwise just acknowledge the interrupt }\r
-  else Port[$20] := $20;\r
-end;\r
-{$F-}\r
-\r
-\r
-When the program is finished we can set the old keyboard handler again:\r
-\r
-SetIntVec(KEYBOARDINTR, @BIOSKeyboardHandler);\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ A Word of Warning ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-When I was writing a simple handler to test the info in this file I did\r
-something REALLY stoopid which I would like to share with the world. I\r
-thought that my program was stuffing the keyboard up because when I exited\r
-the program my editor (Borland Pascal 7.0) would act as though the control\r
-button was being held down (I'm sure some of you have already started\r
-laughing by now). I had to press it after each time I ran the program\r
-just to sort it out. After spending a few hours looking all over the place\r
-for info on what could possibly be wrong I realised what I was doing. I was\r
-pressing CTRL-F9 to compile the program which would also immediately make it\r
-run and I was releasing the control key when my program was running, ie the\r
-regular BIOS handler was not getting the control key's "key up" command and\r
-still thought it was being held down when my program returned control to\r
-it. Moron.....\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Scan Codes ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-The following is a list of all the regular key scan codes in numerical\r
-order:\r
-\r
-Scan                                   Scan\r
-Code Key                               Code Key\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ             ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
- 1   ESC                               44   Z\r
- 2   1                                 45   X\r
- 3   2                                 46   C\r
- 4   3                                 47   V\r
- 5   4                                 48   B\r
- 6   5                                 49   N\r
- 7   6                                 50   M\r
- 8   7                                 51   , <\r
- 9   8                                 52   . >\r
-10   9                                 53   / ?\r
-11   0                                 54   RIGHT SHIFT\r
-12   - _                               55   *            (KEYPAD)\r
-13   = +                               56   LEFT ALT\r
-14   BACKSPACE                         57   SPACEBAR\r
-15   TAB                               58   CAPSLOCK\r
-16   Q                                 59   F1\r
-17   W                                 60   F2\r
-18   E                                 61   F3\r
-19   R                                 62   F4\r
-20   T                                 63   F5\r
-21   Y                                 64   F6\r
-22   U                                 65   F7\r
-23   I                                 66   F8\r
-24   O                                 67   F9\r
-25   P                                 68   F10\r
-26   [ {                               69   NUMLOCK      (KEYPAD)\r
-27   ] }                               70   SCROLL LOCK\r
-28   ENTER (RETURN)                    71   7 HOME       (KEYPAD)\r
-29   LEFT CONTROL                      72   8 UP         (KEYPAD)\r
-30   A                                 73   9 PGUP       (KEYPAD)\r
-31   S                                 74   -            (KEYPAD)\r
-32   D                                 75   4 LEFT       (KEYPAD)\r
-33   F                                 76   5            (KEYPAD)\r
-34   G                                 77   6 RIGHT      (KEYPAD)\r
-35   H                                 78   +            (KEYPAD)\r
-36   J                                 79   1 END        (KEYPAD)\r
-37   K                                 80   2 DOWN       (KEYPAD)\r
-38   L                                 81   3 PGDN       (KEYPAD)\r
-39   ; :                               82   0 INSERT     (KEYPAD)\r
-40   ' "                               83   . DEL        (KEYPAD)\r
-41   ` ~                               87   F11\r
-42   LEFT SHIFT                        88   F12\r
-\r
-\r
-The following is a list of all the extended key scan codes in numerical\r
-order:\r
-\r
-Scan                                   Scan\r
-Code Key                               Code Key\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ        ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-28   ENTER        (KEYPAD)              75   LEFT         (NOT KEYPAD)\r
-29   RIGHT CONTROL                      77   RIGHT        (NOT KEYPAD)\r
-42   PRINT SCREEN (SEE TEXT)            79   END          (NOT KEYPAD)\r
-53   /            (KEYPAD)              80   DOWN         (NOT KEYPAD)\r
-55   PRINT SCREEN (SEE TEXT)            81   PAGE DOWN    (NOT KEYPAD)\r
-56   RIGHT ALT                          82   INSERT       (NOT KEYPAD)\r
-71   HOME         (NOT KEYPAD)          83   DELETE       (NOT KEYPAD)\r
-72   UP           (NOT KEYPAD)         111   MACRO\r
-73   PAGE UP      (NOT KEYPAD)\r
-\r
diff --git a/16/PCGPE10/LIMEMS41.DOC b/16/PCGPE10/LIMEMS41.DOC
deleted file mode 100644 (file)
index 22f41ad..0000000
+++ /dev/null
@@ -1,13224 +0,0 @@
-\r
-\r
-          The associated file (LIMEMS41.DOC) is a complete transcription of\r
-          the Lotus/Intel/Microsoft (LIM) Expanded Memory Specification\r
-          (EMS) Version 4.0, updated October 1987.  It can be printed by\r
-          "COPY LIMEMS41.DOC PRN:"\r
-\r
-          I created this transcription because of the difficulty I origin-\r
-          ally had finding a copy of the document, because of the number of\r
-          people who have subsequently expressed an interest in having\r
-          access to a machine-readable copy of the specification, and,\r
-          finally, because of the annoying number of typographical errors\r
-          contained in the original and updated documents.\r
-\r
-          This transcription is not an exact letter-for-letter duplicate of\r
-          the original document.  Some minor changes were necessitated by\r
-          the simple fact that the document's proportionally-spaced, multi-\r
-          fonted typography and line drawings did not lend themselves to\r
-          the generic fixed-spacing, single-fonted, non-graphical ASCII\r
-          transcription I wanted to produce for general dissemination.\r
-\r
-          Other minor changes were made to correct obvious typographical\r
-          and grammatical errors, or to simply improve the visual aes-\r
-          thetics of the presented material.\r
-\r
-          In one area, however, I simply trashed their original material\r
-          and substituted my own.  This area is the Index.  The original\r
-          document contains an Index that is little more than a reformatt-\r
-          ing of the Table of Contents.  As anyone who has ever indexed a\r
-          large document knows, it is very difficult to produce an Index\r
-          that is both complete AND easy to use.  I didn't have time to\r
-          produce one that was both, so I aimed for the former.  In fact,\r
-          the Index I have provided is more of an alphabetical listing of\r
-          key words and phrases and the pages where they are referenced,\r
-          than it is a more typical Index with its multi-level headings and\r
-          subheadings.\r
-\r
-          You should be able obtain a printed, 3-hole-punched, 5.5 x 8.5"\r
-          copy of the original (and uncorrected) document directly from\r
-          Intel by calling their "Information Department" at 1-800-538-3373\r
-          and asking for a copy of the "LIM EMS 4.0 Developer's Kit."  It\r
-          is available free of charge and mine arrived in about two weeks. \r
-          (European availability, however, is reported to be from poor to\r
-          non-existent.)\r
-\r
-          It is my intent to provide this transcription as a public\r
-          service.  I am, therefore, releasing it into the public domain. \r
-          The original document has also been released into the public\r
-          domain by Lotus, Intel, and Microsoft, though it remains their\r
-          copyrighted property (I'm not quite sure how they manage to do\r
-          that).\r
-\r
-          I have tried as best I can to provide an accurate and corrected\r
-          transcription of the original document.  It is inevitable,\r
-          however, that some typographical errors have slipped through in\r
-          spite of my hours of bleary-eyed proof reading.  For these errors\r
-          I apologize and plead simple human frailty.\r
-\r
-               THIS TRANSCRIPTION IS PROVIDED WITHOUT ANY GUARANTEES\r
-               OR WARRANTIES OF ANY KIND, AND I ASSUME ABSOLUTELY NO\r
-               LIABILITY FOR ITS ACCURACY, CONTENT, OR SUBSEQUENT USE.\r
-\r
-          Dick Flanagan, W6OLD, Ben Lomond, California        November 1987\r
-\f\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-                           LOTUS(R)/INTEL(R)/MICROSOFT(R)\r
-\r
-                          EXPANDED MEMORY SPECIFICATION [1]\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-                                     Version 4.0\r
-                                     300275-005\r
-                                    October, 1987\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          Copyright (C) 1987\r
-\r
-          Lotus Development Corporation\r
-          55 Cambridge Parkway\r
-          Cambridge, MA  02142\r
-\r
-          Intel Corporation\r
-          5200 NE Elam Young Parkway\r
-          Hillsboro, OR  97124\r
-\r
-          Microsoft Corporation\r
-          16011 NE 35th Way\r
-          Box 97017\r
-          Redmond, WA  98073\r
-\r
-\r
-               [1] Transcribed into machine-readable form by Dick Flanagan,\r
-          Ben Lomond, California.  This transcription is released into the\r
-          public domain without warranty or assumption of liability.\r
-\f\r
-\r
-\r
-\r
-\r
-               This specification was jointly developed by Lotus Develop-\r
-               ment Corporation, Intel Corporation, and Microsoft Corpora-\r
-               tion.  Although it has been released into the public domain\r
-               and is not confidential or proprietary, the specification is\r
-               still the copyright and property of Lotus Development\r
-               Corporation, Intel Corporation, and Microsoft Corporation.\r
-\r
-\r
-          DISCLAIMER OF WARRANTY\r
-\r
-               LOTUS DEVELOPMENT CORPORATION, INTEL CORPORATION, AND MICRO-\r
-               SOFT CORPORATION EXCLUDE ANY AND ALL IMPLIED WARRANTIES,\r
-               INCLUDING WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A\r
-               PARTICULAR PURPOSE.  NEITHER LOTUS NOR INTEL NOR MICROSOFT\r
-               MAKE ANY WARRANTY OF REPRESENTATION, EITHER EXPRESS OR\r
-               IMPLIED, WITH RESPECT TO THIS SPECIFICATION, ITS QUALITY,\r
-               PERFORMANCE, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR\r
-               PURPOSE.  NEITHER LOTUS NOR INTEL NOR MICROSOFT SHALL HAVE\r
-               ANY LIABILITY FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL\r
-               DAMAGES ARISING OUT OF OR RESULTING FROM THE USE OR MODIF-\r
-               ICATION OF THIS SPECIFICATION.\r
-\r
-\r
-\r
-          This specification uses the following trademarks:\r
-\r
-          Intel is a trademark of Intel Corporation\r
-          Lotus is a trademark of Lotus Development Corporation\r
-          Microsoft is a trademark of Microsoft Corporation\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-                                                                         ii\r
-\f\r
-\r
-\r
-\r
-\r
-          CONTENTS\r
-\r
-\r
-\r
-          Chapter 1\r
-          INTRODUCTION\r
-            What is Expanded Memory? . . . . . . . . . . . . . . . . .    1\r
-            How Expanded Memory Works  . . . . . . . . . . . . . . . .    1\r
-\r
-          Chapter 2\r
-          WRITING PROGRAMS THAT USE EXPANDED MEMORY\r
-            What Every Program Must Do . . . . . . . . . . . . . . . .    4\r
-            Advanced Programming . . . . . . . . . . . . . . . . . . .    5\r
-              Saving The State of Mapping Hardware . . . . . . . . . .    6\r
-              Retrieving Handle and Page Counts  . . . . . . . . . . .    6\r
-              Mapping and Unmapping Multiple Pages . . . . . . . . . .    6\r
-              Reallocating Pages . . . . . . . . . . . . . . . . . . .    6\r
-              Using Handles and Assigning Names to Handles . . . . . .    6\r
-              Using Handle Attributes  . . . . . . . . . . . . . . . .    7\r
-              Altering Page Maps and Jumping/Calling . . . . . . . . .    7\r
-              Moving or Exchanging Memory Regions  . . . . . . . . . .    7\r
-              Getting the Amount of Mappable Memory  . . . . . . . . .    8\r
-              Operating System Functions . . . . . . . . . . . . . . .    8\r
-            Programming Guidelines . . . . . . . . . . . . . . . . . .   12\r
-            Examples . . . . . . . . . . . . . . . . . . . . . . . . .   14\r
-              Example 1  . . . . . . . . . . . . . . . . . . . . . . .   14\r
-              Example 2  . . . . . . . . . . . . . . . . . . . . . . .   19\r
-              Example 3  . . . . . . . . . . . . . . . . . . . . . . .   30\r
-              Example 4  . . . . . . . . . . . . . . . . . . . . . . .   32\r
-\r
-          Chapter 3\r
-          EMM FUNCTIONS\r
-            Function 1. Get Status . . . . . . . . . . . . . . . . . .   37\r
-            Function 2. Get Page Frame Address . . . . . . . . . . . .   38\r
-            Function 3. Get Unallocated Page Count . . . . . . . . . .   40\r
-            Function 4. Allocate Pages . . . . . . . . . . . . . . . .   42\r
-            Function 5. Map/Unmap Handle Pages . . . . . . . . . . . .   46\r
-            Function 6. Deallocate Pages . . . . . . . . . . . . . . .   49\r
-            Function 7. Get Version  . . . . . . . . . . . . . . . . .   51\r
-            Function 8. Save Page Map  . . . . . . . . . . . . . . . .   53\r
-            Function 9. Restore Page Map . . . . . . . . . . . . . . .   55\r
-            Function 10. Reserved  . . . . . . . . . . . . . . . . . .   57\r
-            Function 11. Reserved  . . . . . . . . . . . . . . . . . .   58\r
-            Function 12. Get Handle Count  . . . . . . . . . . . . . .   59\r
-            Function 13. Get Handle Pages  . . . . . . . . . . . . . .   61\r
-            Function 14. Get All Handle Pages  . . . . . . . . . . . .   63\r
-            Function 15. Get/Set Page Map  . . . . . . . . . . . . . .   65\r
-              Get Page Map subfunction . . . . . . . . . . . . . . . .   65\r
-              Set Page Map subfunction . . . . . . . . . . . . . . . .   67\r
-              Get & Set Page Map subfunction . . . . . . . . . . . . .   69\r
-              Get Size of Page Map Save Array subfunction  . . . . . .   71\r
-\r
-\r
-                                                                        iii\r
-\f\r
-\r
-\r
-\r
-\r
-            Function 16. Get/Set Partial Page Map  . . . . . . . . . .   73\r
-              Get Partial Page Map subfunction . . . . . . . . . . . .   73\r
-              Set Partial Page Map subfunction . . . . . . . . . . . .   76\r
-              Get Size of Partial Page Map Save Array subfunction  . .   78\r
-            Function 17. Map/Unmap Multiple Handle Pages . . . . . . .   80\r
-              Mapping Multiple Pages . . . . . . . . . . . . . . . . .   80\r
-              Unmapping Multiple Pages . . . . . . . . . . . . . . . .   80\r
-              Mapping and Unmapping Multiple Pages Simultaneously  . .   80\r
-              Alternate Mapping and Unmapping Methods  . . . . . . . .   81\r
-              Logical Page/Physical Page Method  . .OF THE EXPANDED MEMORY MANAGER\r
-            Which method should your program use?  . . . . . . . . . .  199\r
-            The "open handle" technique  . . . . . . . . . . . . . . .  199\r
-            The "get interrupt vector" technique . . . . . . . . . . .  204\r
-\r
-          Appendix C\r
-          EXPANDED MEMORY MANAGER IMPLEMENTATION GUIDELINES\r
-            The amount of expanded memory supported  . . . . . . . . .  206\r
-            The number of handles supported  . . . . . . . . . . . . .  206\r
-            Handle Numbering . . . . . . . . . . . . . . . . . . . . .  206\r
-            New handle type:  Handles versus Raw Handles . . . . . . .  206\r
-            The system Raw Handle (Raw Handle = 0000h) . . . . . . . .  207\r
-            Terminate and Stay Resident (TSR) Program Cooperation  . .  208\r
-            Accelerator Cards  . . . . . . . . . . . . . . . . . . . .  208\r
-\r
-          Appendix D\r
-          OPERATING SYSTEM/ENVIRONMENT USE OF FUNCTION 28\r
-            Examples . . . . . . . . . . . . . . . . . . . . . . . . .  209\r
-              Example 1  . . . . . . . . . . . . . . . . . . . . . . .  209\r
-              Example 2  . . . . . . . . . . . . . . . . . . . . . . .  210\r
-              Example 3  . . . . . . . . . . . . . . . . . . . . . . .  211\r
-\r
-          GLOSSARY\r
-\r
-          INDEX\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-                                                                          v\r
-\f\r
-\r
-\r
-\r
-\r
-          Chapter 1\r
-          INTRODUCTION\r
-\r
-\r
-               Because even the maximum amount (640K bytes) of conventional\r
-               memory isn't always enough for large application programs,\r
-               Lotus Development Corporation, Intel Corporation, and Micro-\r
-               soft Corporation created the Lotus/Intel/Microsoft (LIM)\r
-               Expanded Memory Specification.\r
-\r
-               The LIM Expanded Memory Specification defines the software\r
-               interface between the Expanded Memory Manager (EMM) -- a\r
-               device driver that controls and manages expanded memory --\r
-               and application programs that use expanded memory.\r
-\r
-\r
-          What is Expanded Memory?\r
-\r
-               Expanded memory is memory beyond DOS's 640K-byte limit.  The\r
-               LIM specification supports up to 32M bytes of expanded\r
-               memory.  Because the 8086, 8088, and 80286 (in real mode)\r
-               microprocessors can physically address only 1M bytes of\r
-               memory, they access expanded memory through a window in\r
-               their physical address range.  The next section explains how\r
-               this is done.\r
-\r
-\r
-          How Expanded Memory Works\r
-\r
-               Expanded memory is divided into segments called logical\r
-               pages.  These pages are typically 16K bytes of memory.  Your\r
-               computer accesses logical pages through a physical block of\r
-               memory called a page frame.  The page frame contains\r
-               multiple physical pages, pages that the microprocessor can\r
-               address directly.  Physical pages are also typically 16K\r
-               bytes of memory.\r
-\r
-               This page frame serves as a window into expanded memory. \r
-               Just as your computer screen is a window into a large\r
-               spreadsheet, so the page frame is a window into expanded\r
-               memory.\r
-\r
-               A logical page of expanded memory can be mapped into (made\r
-               to appear in) any one of the physical pages in the page\r
-               frame.  Thus, a read or write to the physical page actually\r
-               becomes a read or write to the associated logical page.  One\r
-               logical page can be mapped into the page frame for each\r
-               physical page.\r
-\r
-               Figure 1-1 shows the relationship among the page frame,\r
-               physical pages, and logical pages.\r
-\r
-\r
-          Introduction                                                    1\r
-\f\r
-\r
-\r
-\r
-\r
-                                                       32M +--------------+\r
-                                                          /|              |\r
-                                                           |              |\r
-                                                     /     |              |\r
-                                                           |              |\r
-                                                /          |              |\r
-                                                           |              |\r
-                                           /               |              |\r
-                                                           |   Expanded   |\r
-                                      /                    |    Memory    |\r
-          1024K +--------------+                           |              |\r
-                | / / / / / /  | /                         |              |\r
-           960K +--------------+                           |              |\r
-                |  Page Frame  |                           |              |\r
-                |              |                           |              |\r
-                | 12 16K-Byte  |                           |              |\r
-                |   Physical   |                           |              |\r
-                |    Pages     |                           |              |\r
-           768K +--------------+                           | Divided into |\r
-                | / / / / / /  | \                         |   logical    |\r
-           640K +--------------+                           |    pages     |\r
-                |              |   \                       |              |\r
-                |              |                           |              |\r
-                |              |     \                     |              |\r
-                |              |                           |              |\r
-                | 24 16K-Byte  |       \                   |              |\r
-                |   Physical   |                           |              |\r
-                |    Pages*    |         \                 |              |\r
-                |              |                           |              |\r
-                |              |           \               |              |\r
-                |              |                           |              |\r
-                |              |             \             |              |\r
-           256K +--------------+                           |              |\r
-                |              |               \           |              |\r
-                | / / / / / /  |                           |              |\r
-                |              |                 \         |              |\r
-                | / / / / / /  |                           |              |\r
-                |              |                   \       |              |\r
-                | / / / / / /  |                           |              |\r
-                |              |                     \     |              |\r
-              0 +--------------+                           |              |\r
-                                                       \   |              |\r
-                                                           |              |\r
-          *Intended for operating                        \ |              |\r
-           system/environment use only                   0 +--------------+\r
-\r
-\r
-\r
-          Figure 1-1.  Expanded Memory\r
-\r
-\r
-\r
-\r
-          Introduction                                                    2\r
-\f\r
-\r
-\r
-\r
-\r
-               The page frame is located above 640K bytes.  Normally, only\r
-               video adapters, network cards, and similar devices exist\r
-               between 640K and 1024K.\r
-\r
-               This specification also defines methods for operating\r
-               systems and environments to access expanded memory through\r
-               physical pages below 640K bytes.  These methods are intended\r
-               for operating system/environment developers only.\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          Introduction                                                    3\r
-\f\r
-\r
-\r
-\r
-\r
-          Chapter 2\r
-          WRITING PROGRAMS THAT USE EXPANDED MEMORY\r
-\r
-\r
-               This chapter describes what every program must do to use\r
-               expanded memory and describes more advanced techniques of\r
-               using expanded memory.\r
-\r
-               This chapter also lists programming guidelines you should\r
-               follow when writing programs that use expanded memory and\r
-               provides the listings of some example programs.\r
-\r
-\r
-          What Every Program Must Do\r
-\r
-               This section describes the steps every program must take to\r
-               use expanded memory.\r
-\r
-               In order to use expanded memory, applications must perform\r
-               these steps in the following order:\r
-\r
-               1.  Determine if EMM is installed.\r
-\r
-               2.  Determine if enough expanded memory pages exist for your\r
-                   application.  (Function 3)\r
-\r
-               3.  Allocate expanded memory pages.  (Function 4, 18, or 27)\r
-\r
-               4.  Get the page frame base address.  (Function 2)\r
-\r
-               5.  Map in expanded memory pages.  (Function 5 or 17)\r
-\r
-               6.  Read/write/execute data in expanded memory, just as if\r
-                   it were conventional memory.\r
-\r
-               7.  Return expanded memory pages to expand memory pool\r
-                   before exiting.  (Function 6 or 18)\r
-\r
-               Table 2-1 overviews the functions while Chapter 3 describes\r
-               each of these functions in detail.  Example programs at the\r
-               end of this chapter illustrate using expanded memory.\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          Writing Programs That Use Expanded Memory                       4\r
-\f\r
-\r
-\r
-\r
-\r
-          Table 2-1.  The Basic Functions\r
-          ----------------------------------------------------------------\r
-\r
-          Function                        Description\r
-\r
-          ----------------------------------------------------------------\r
-\r
-             1         The Get Status Function returns a status code\r
-                       indicating whether the memory manager hardware is\r
-                       working correctly.\r
-\r
-             2         The Get Page Frame Address function returns the\r
-                       address where the 64K-byte page frame is located.\r
-\r
-             3         The Get Unallocated Page Count function returns the\r
-                       number of unallocated pages (pages available to your\r
-                       program) and the total number of pages in expanded\r
-                       memory.\r
-\r
-             4         The Allocate Pages function allocates the number of\r
-                       pages requested and assigns a unique EMM handle to\r
-                       these pages.\r
-\r
-             5         The Map/Unmap Handle Page function maps a logical\r
-                       page to a specific physical page anywhere in the\r
-                       mappable regions of system memory.\r
-\r
-             6         The Deallocate Pages deallocates the logical pages\r
-                       currently allocated to an EMM handle.\r
-\r
-             7         The Get Version function returns the version number\r
-                       of the memory manager software.\r
-\r
-          ----------------------------------------------------------------\r
-\r
-\r
-\r
-          Advanced Programming\r
-\r
-               In addition to the basic functions, the Lotus/Intel/Micro-\r
-               soft Expanded Memory Specification provides several advanced\r
-               functions which enhance the capabilities of software that\r
-               uses expanded memory.\r
-\r
-               The following sections describe the advanced programming\r
-               capabilities and list the advanced EMM functions.\r
-\r
-\r
-          Note............................................................\r
-               Before using the advanced functions, programs should first\r
-               call Function 7 (Get Version) to determine whether the\r
-               installed version of EMM supports these functions.\r
-\r
-          Writing Programs That Use Expanded Memory                       5\r
-\f\r
-\r
-\r
-\r
-\r
-          Saving The State of Mapping Hardware\r
-\r
-               Some software (such as interrupt service routines, device\r
-               drivers, and resident software) must save the current state\r
-               of the mapping hardware, switch mapping contexts, manipulate\r
-               sections of expanded memory, and restore the original\r
-               context of the memory mapping hardware.  Use Functions 8 and\r
-               9 or 15 and 16 to save the state of the hardware.\r
-\r
-\r
-          Retrieving Handle and Page Counts\r
-\r
-               Some utility programs need to keep track of how expanded\r
-               memory is being used; use Functions 12 through 14 to do\r
-               this.\r
-\r
-\r
-          Mapping and Unmapping Multiple Pages\r
-\r
-               Mapping multiple pages reduces the overhead an application\r
-               must perform during mapping.  Function 17 lets a program map\r
-               (or unmap) multiple pages at one time.\r
-\r
-               In addition, you can map pages using segment addresses\r
-               instead of physical pages.  For example, if the page frame\r
-               base address is set to D000, you can map to either physical\r
-               page 0 or segment D000.  Function 25 (Get Mappable Physical\r
-               Address Array) returns a cross reference between all\r
-               expanded memory physical pages and their corresponding\r
-               segment values.\r
-\r
-\r
-          Reallocating Pages\r
-\r
-               Reallocating pages (Function 18) lets applications dynami-\r
-               cally allocate expanded memory pages without acquiring\r
-               another handle or obtain a handle without allocating pages. \r
-               Reallocating pages is an efficient means for applications to\r
-               obtain and release expanded memory pages.\r
-\r
-\r
-          Using Handles and Assigning Names to Handles\r
-\r
-               This specification lets you associate a name with a handle,\r
-               so a family of applications can share information in\r
-               expanded memory.  For example, a software package consisting\r
-               of a word processor, spreadsheet, and print spooler can\r
-               share the same data among the different applications.  The\r
-               print spooler could use a handle name to reference data that\r
-               either the spreadsheet or word processor put in expanded\r
-               memory and could check for data in a particular handle\r
-               name's expanded memory pages.\r
-\r
-          Writing Programs That Use Expanded Memory                       6\r
-\f\r
-\r
-\r
-\r
-\r
-               Use Function 20 (Set Handle Name subfunction) to assign a\r
-               handle name to an EMM handle or Function 21 (Search for\r
-               Named Handle subfunction) to obtain the EMM handle as-\r
-               sociated with the handle name.  In addition, you can use\r
-               Function 14 (Get Handle Pages) to determine the number of\r
-               expanded memory pages allocated to an EMM handle.\r
-\r
-\r
-          Using Handle Attributes\r
-\r
-               In addition to naming a handle, you can use Function 19 to\r
-               associate an attribute (volatile or non-volatile) with a\r
-               handle name.  A non-volatile attribute enables expanded\r
-               memory pages to preserve their data through a warmboot. \r
-               With a volatile attribute, the data is not preserved.  The\r
-               default attribute for handles is volatile.\r
-\r
-               Because using this function depends on the capabilities of\r
-               the expanded memory hardware installed in the system, you\r
-               should use the Get Attribute Capability subfunction before\r
-               attempting to assign an attribute to a handle's pages.\r
-\r
-\r
-          Altering Page Maps and Jumping/Calling\r
-\r
-               You can use Functions 22 (Alter Page Map & Jump) and 23\r
-               (Alter Page Map & Call) to map a new set of values into the\r
-               map registers and transfer program control to a specified\r
-               address within expanded memory.  These functions can be used\r
-               to load and execute code in expanded memory.  An application\r
-               using this feature can significantly reduce the amount of\r
-               conventional memory it requires.  Programs can load needed\r
-               modules into expanded memory at run time and use Functions\r
-               22 and 23 to transfer control to these modules.\r
-\r
-               Using expanded memory to store code can improve program\r
-               execution in many ways.  For example, sometimes programs\r
-               need to be divided into small overlays because of conven-\r
-               tional memory size limitations.  Overlays targeted for\r
-               expanded memory can be very large because LIM EMS 4.0\r
-               supports up to 32M bytes of expanded memory.  This method of\r
-               loading overlays improves overall system performance by\r
-               conserving conventional memory and eliminating conventional\r
-               memory allocation errors.\r
-\r
-\r
-          Moving or Exchanging Memory Regions\r
-\r
-               Using Function 24 (Move/Exchange Memory Region), you can\r
-               easily move and exchange data between conventional and\r
-               expanded memory.  Function 24 can manipulate up to one\r
-               megabyte of data with one function call.  Although applica-\r
-\r
-          Writing Programs That Use Expanded Memory                       7\r
-\f\r
-\r
-\r
-\r
-\r
-               tions can perform this operation without this function,\r
-               having the expanded memory manager do it reduces the amount\r
-               of overhead for the application.\r
-\r
-               In addition, this function checks for overlapping regions\r
-               and performs all the necessary mapping, preserving the\r
-               mapping context from before the exchange/move call.\r
-\r
-\r
-          Getting the Amount of Mappable Memory\r
-\r
-               Function 25 enables applications to determine the total\r
-               amount of mappable memory the hardware/system currently\r
-               supports.  Not all expanded memory boards supply the same\r
-               number of physical pages (map registers).\r
-\r
-               The Get Mappable Physical Address Array Entries subfunction\r
-               returns the total number of physical pages the expanded\r
-               memory hardware/system is capable of supporting.  The Get\r
-               Mappable Physical Array subfunction returns a cross refer-\r
-               ence between physical page numbers and the actual segment\r
-               address for each of the physical pages.\r
-\r
-\r
-          Operating System Functions\r
-\r
-               In addition to the functions for application programs, this\r
-               specification defines functions for operating systems/en-\r
-               vironments.  These functions can be disabled at any time by\r
-               the operating system/environment, so programs should not\r
-               depend on their presence.  Applications that avoid this\r
-               warning and use these functions run a great risk of being\r
-               incompatible with other programs, including the operating\r
-               system.\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          Writing Programs That Use Expanded Memory                       8\r
-\f\r
-\r
-\r
-\r
-\r
-          Table 2-2.  The Advanced Functions\r
-          ----------------------------------------------------------------\r
-\r
-          Function                        Description\r
-\r
-          ----------------------------------------------------------------\r
-\r
-             8         The Save Page Map saves the contents of the page\r
-                       mapping registers from all expanded memory boards in\r
-                       an internal save area.\r
-\r
-             9         The Restore Page Map function restores (from an\r
-                       internal save area) the page mapping register\r
-                       contents on the expanded memory boards for a\r
-                       particular EMM handle.\r
-\r
-             10        Reserved.\r
-\r
-             11        Reserved.\r
-\r
-             12        The Get Handle Count function returns the number of\r
-                       open EMM handles in the system.\r
-\r
-             13        The Get Handle Pages function returns the number of\r
-                       pages allocated to a specific EMM handle.\r
-\r
-             14        The Get All Handle Pages function returns an array\r
-                       of the active EMM handles and the number of pages\r
-                       allocated to each one.\r
-\r
-             15        The Get/Set Page Map subfunction saves or restores\r
-                       the mapping context for all mappable memory regions\r
-                       (conventional and expanded) in a destination array\r
-                       which the application supplies.\r
-\r
-             16        The Get/Set Partial Page Map subfunction provides a\r
-                       mechanism for saving a partial mapping context for\r
-                       specific mappable memory regions in a system.\r
-\r
-             17        The Map/Unmap Multiple Handle Pages function can, in\r
-                       a single invocation, map (or unmap) logical pages\r
-                       into as many physical pages as the system supports.\r
-\r
-             18        The Reallocate Pages function can increase or\r
-                       decrease the amount of expanded memory allocated to\r
-                       a handle.\r
-\r
-             19        The Get/Set Handle Attribute function allows an\r
-                       application program to determine and set the\r
-                       attribute associated with a handle.\r
-\r
-\r
-\r
-          Writing Programs That Use Expanded Memory                       9\r
-\f\r
-\r
-\r
-\r
-\r
-          Table 2-2.  The Advanced Functions (continued)\r
-          ----------------------------------------------------------------\r
-\r
-          Function                        Description\r
-\r
-          ----------------------------------------------------------------\r
-\r
-             20        The Get/Set Handle Name function gets the eight\r
-                       character name currently assigned to a handle and\r
-                       can assign an eight character name to a handle.\r
-\r
-             21        The Get Handle Directory function returns informa-\r
-                       tion about active handles and the names assigned to\r
-                       each.\r
-\r
-             22        The Alter Page Map & Jump function alters the memory\r
-                       mapping context and transfers control to the\r
-                       specified address.\r
-\r
-             23        The Alter Page Map & Call function alters the speci-\r
-                       fied mapping context and transfers control to the\r
-                       specified address.  A return can then restore the\r
-                       context and return control to the caller.\r
-\r
-             24        The Move/Exchange Memory Region function copies or\r
-                       exchanges a region of memory from conventional to\r
-                       conventional memory, conventional to expanded\r
-                       memory, expanded to conventional memory, or expanded\r
-                       to expanded memory.\r
-\r
-             25        The Get Mappable Physical Address Array function\r
-                       returns an array containing the segment address and\r
-                       physical page number for each mappable physical page\r
-                       in a system.\r
-\r
-             26        The Get Expanded Memory Hardware Information\r
-                       function returns an array containing the hardware\r
-                       capabilities of the expanded memory system.\r
-\r
-             27        The Allocate Standard/Raw Pages function allocates\r
-                       the number of standard or non-standard size pages\r
-                       that the operating system requests and assigns a\r
-                       unique EMM handle to these pages.\r
-\r
-             28        The Alternate Map Register Set function enables an\r
-                       application to simulate alternate sets of hardware\r
-                       mapping registers.\r
-\r
-             29        The Prepare Expanded Memory Hardware for Warm Boot\r
-                       function prepares the expanded memory hardware for\r
-                       an "impending" warm boot.\r
-\r
-\r
-          Writing Programs That Use Expanded Memory                      10\r
-\f\r
-\r
-\r
-\r
-\r
-          Table 2-2.  The Advanced Functions (continued)\r
-          ----------------------------------------------------------------\r
-\r
-          Function                        Description\r
-\r
-          ----------------------------------------------------------------\r
-\r
-             30        The Enable/Disable OS/E function enables operating\r
-                       systems developers to enable and disable functions\r
-                       designed for operating system use.\r
-\r
-          ----------------------------------------------------------------\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          Writing Programs That Use Expanded Memory                      11\r
-\f\r
-\r
-\r
-\r
-\r
-          Programming Guidelines\r
-\r
-               The following section contains guidelines for programmers\r
-               writing applications that use EMM.\r
-\r
-               o   Do not put a program's stack in expanded memory.\r
-\r
-               o   Do not replace interrupt 67h.  This is the interrupt\r
-                   vector the EMM uses.  Replacing interrupt 67h could\r
-                   result in disabling the Expanded Memory Manager.\r
-\r
-               o   Do not map into conventional memory address space your\r
-                   application doesn't own.  Applications that use the EMM\r
-                   to swap into conventional memory space, must first\r
-                   allocate this space from the operating system.  If the\r
-                   operating system is not aware that a region of memory it\r
-                   manages is in use, it will think it is available.  This\r
-                   could have disastrous results.  EMM should not be used\r
-                   to "allocate" conventional memory.  DOS is the proper\r
-                   manager of conventional memory space.  EMM should only\r
-                   be used to swap data in conventional memory space\r
-                   previously allocated from DOS.\r
-\r
-               o   Applications that plan on using data aliasing in\r
-                   expanded memory must check for the presence of expanded\r
-                   memory hardware.  Data aliasing occurs when mapping one\r
-                   logical page into two or more mappable segments.  This\r
-                   makes one 16K-byte expanded memory page appear to be in\r
-                   more than one 16K-byte memory address space.  Data\r
-                   aliasing is legal and sometimes useful for applications.\r
-\r
-                   Software-only expanded memory emulators cannot perform\r
-                   data aliasing.  A simple way to distinguish software\r
-                   emulators from actual expanded memory hardware is to\r
-                   attempt data aliasing and check the results.  For\r
-                   example, map one logical page into four physical pages. \r
-                   Write to physical page 0.  Read physical pages 1-3 to\r
-                   see if the data is there as well.  If the data appears\r
-                   in all four physical pages, then expanded memory\r
-                   hardware is installed in the system, and data aliasing\r
-                   is supported.\r
-\r
-               o   Applications should always return expanded memory pages\r
-                   to the expanded memory manager upon termination.  These\r
-                   pages will be made available for other applications.  If\r
-                   unneeded pages are not returned to the expanded memory\r
-                   manager, the system could "run out" of expanded memory\r
-                   pages or expanded memory handles.\r
-\r
-               o   Terminate and stay resident programs (TSR's) should\r
-                   ALWAYS save the state of the map registers before\r
-                   changing them.  Since TSR's may interrupt other programs\r
-\r
-          Writing Programs That Use Expanded Memory                      12\r
-\f\r
-\r
-\r
-\r
-\r
-                   which may be using expanded memory, they must not change\r
-                   the state of the page mapping registers without first\r
-                   saving them.  Before exiting, TSR's must restore the\r
-                   state of the map registers.\r
-\r
-                   The following sections describe the three ways to save\r
-                   and restore the state of the map registers.\r
-\r
-                   1.  Save Page Map and Restore Page Map (Functions 8 and\r
-                       9).  This is the simplest of the three methods.  The\r
-                       EMM saves the map register contents in its own data\r
-                       structures -- the application does not need to\r
-                       provide extra storage locations for the mapping\r
-                       context.  The last mapping context to be saved,\r
-                       under a particular handle, will be restored when a\r
-                       call to Restore Page Map is issued with the same\r
-                       handle.  This method is limited to one mapping\r
-                       context for each handle and saves the context for\r
-                       only LIM standard 64K-byte page frames.\r
-\r
-                   2.  Get/Set Page Map (Function 15).  This method\r
-                       requires the application to allocate space for the\r
-                       storage array.  The EMM saves the mapping context in\r
-                       an array whose address is passed to the EMM.  When\r
-                       restoring the mapping context with this method, an\r
-                       application passes the address of an array which\r
-                       contains a previously stored mapping context.\r
-\r
-                       This method is preferable if an application needs to\r
-                       do more than one save before a restore.  It provides\r
-                       a mechanism for switching between more than one\r
-                       mapping context.\r
-\r
-                   3.  Get/Set Partial Page Map (Function 16).  This method\r
-                       provides a way for saving a partial mapping context. \r
-                       It should be used when the application does not need\r
-                       to save the context of all mappable memory.  This\r
-                       function also requires that the storage array be\r
-                       part of the application's data.\r
-\r
-               o   All functions using pointers to data structures must\r
-                   have those data structures in memory which will not be\r
-                   mapped out.  Functions 22 and 23 (Alter Map & Call and\r
-                   Alter Map & Jump) are the only exceptions.\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          Writing Programs That Use Expanded Memory                      13\r
-\f\r
-\r
-\r
-\r
-\r
-          Examples\r
-\r
-               This section lists four example programs that demonstrate\r
-               the use of expanded memory.\r
-\r
-\r
-          Example 1\r
-\r
-               This program was written using the Microsoft C compiler\r
-               Version 3.0.  EMM function calls are made with the int86\r
-               function found in the dos.h library.  To create an ex-\r
-               ecutable program use the following compile command line:\r
-\r
-                         msc /Gs /Oat /Ml program,,program;\r
-\r
-          #include <dos.h>\r
-          #include <stdio.h>\r
-\r
-          #define EMM_INT                 0x67  /* EMM interrupt number */\r
-          #define GET_PAGE_FRAME          0x41  /* EMM get page frame */\r
-                                                /* function number */\r
-          #define GET_UNALLOC_PAGE_COUNT  0x42  /* EMM get unallocated */\r
-                                                /* page count */\r
-                                                /* function number */\r
-          #define ALLOCATE_PAGES          0x43  /* EMM allocate pages */\r
-                                                /* function number */\r
-          #define MAP_PAGES               0x44  /* EMM map pages */\r
-                                                /* function number */\r
-          #define DEALLOCATE_PAGES        0x45  /* EMM deallocate pages */\r
-                                                /* function number */\r
-          #define DEVICE_NAME_LENGTH      8     /* length of a device */\r
-                                                /* name string */\r
-          #define TRUE                    1\r
-          #define FALSE                   0\r
-\r
-          union REGS input_regs, output_regs;\r
-          struct SREGS segment_regs;\r
-          int pf_addr;\r
-\r
-          /*------------------------------------------------------------*/\r
-          /* Routine to convert a segment:offset pair to a far ptr.     */\r
-          /*------------------------------------------------------------*/\r
-          char *build_ptr (segment, offset)\r
-\r
-              unsigned int segment;\r
-              unsigned int offset;\r
-          {\r
-              char *ptr;\r
-\r
-              ptr = (char *)(((unsigned long)segment << 16) + offset);\r
-              return (ptr);\r
-          }\r
-\r
-          Writing Programs That Use Expanded Memory                      14\r
-\f\r
-\r
-\r
-\r
-\r
-          /*------------------------------------------------------------*/\r
-          /* Function which determines whether EMM device driver        */\r
-          /* is installed.                                              */\r
-          /*------------------------------------------------------------*/\r
-          char emm_installed()\r
-\r
-          {\r
-              char *EMM_device_name = "EMMXXXX0";\r
-              char *int_67_device_name_ptr;\r
-\r
-              /*--------------------------------------------------------*/\r
-              /* AH = DOS get interrupt vector function.                */\r
-              /*--------------------------------------------------------*/\r
-              input_regs.h.ah = 0x35;\r
-\r
-              /*--------------------------------------------------------*/\r
-              /* AL = EMM interrupt vector number.                      */\r
-              /*--------------------------------------------------------*/\r
-              input_regs.h.al = EMM_INT;\r
-              intdosx (&input_regs, &output_regs, &segment_regs);\r
-\r
-              /*--------------------------------------------------------*/\r
-              /* Upon return ES:0Ah points to location where            */\r
-              /* device name should be.                                 */\r
-              /*--------------------------------------------------------*/\r
-              int_67_device_name_ptr = build_ptr (segment_regs.es, 0x0A);\r
-\r
-              /*--------------------------------------------------------*/\r
-              /* Compare memory with EMM device name.                   */\r
-              /*--------------------------------------------------------*/\r
-              if (memcmp (EMM_device_name, int_67_device_name_ptr,\r
-                                             DEVICE_NAME_LENGTH) == 0)\r
-                  return (TRUE);\r
-              else\r
-                  return (FALSE);\r
-          }\r
-\r
-          /*------------------------------------------------------------*/\r
-          /* Function which determines if there are enough unallocated  */\r
-          /* expanded memory pages for the application.                 */\r
-          /*------------------------------------------------------------*/\r
-          char enough_unallocated_pages (pages_needed)\r
-\r
-              int pages_needed;\r
-          {\r
-              input_regs.h.ah = GET_UNALLOCATED_PAGE_COUNT;\r
-              int86 (EMM_INT, &input_regs, &output_regs);\r
-              if (output_regs.h.ah != 0 || pages_needed > output_regs.x.bx)\r
-                  return (FALSE);\r
-              else\r
-                  return (TRUE);\r
-          }\r
-\r
-          Writing Programs That Use Expanded Memory                      15\r
-\f\r
-\r
-\r
-\r
-\r
-          /*------------------------------------------------------------*/\r
-          /* Function which allocates expanded memory pages and passes  */\r
-          /* back to the main EMM handle.                               */\r
-          /*------------------------------------------------------------*/\r
-          char allocate_expanded_memory_pages (pages_needed,emm_handle_ptr)\r
-\r
-              int pages_needed;\r
-              unsigned int *emm_handle_ptr;\r
-          {\r
-              input_regs.h.ah = ALLOCATE_PAGES;\r
-              input_regs.x.bx = pages_needed;\r
-              int86 (EMM_INT, &input_regs, &output_regs);\r
-              if (output_regs.h.ah == 0) {\r
-                  *emm_handle_ptr = output_regs.x.dx;\r
-                  return (TRUE);\r
-              }\r
-              else\r
-                  return (FALSE);\r
-          }\r
-\r
-          /*------------------------------------------------------------*/\r
-          /* Routine to map a logical page to a physical page.          */\r
-          /*------------------------------------------------------------*/\r
-          char map_expanded_memory_pages (emm_handle, physical_page,       \r
-                                                             logical_page)\r
-              unsigned int emm_handle;\r
-              int physical_page;\r
-              int logical_page;\r
-          {\r
-              input_regs.h.ah = MAP_PAGES;\r
-              input_regs.h.al = physical_page;\r
-              input_regs.x.bx = logical_page;\r
-              input_regs.x.dx = emm_handle;\r
-              int86 (EMM_INT, &input_regs, &output_regs);\r
-              if (output_regs.h.ah == 0)\r
-                  return (TRUE);\r
-              else\r
-                  return (FALSE);\r
-          }\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          Writing Programs That Use Expanded Memory                      16\r
-\f\r
-\r
-\r
-\r
-\r
-          /*------------------------------------------------------------*/\r
-          /* Routine which gets the page frame base address from EMM.   */\r
-          /*------------------------------------------------------------*/\r
-          char get_page_frame_address (pf_ptr)\r
-\r
-              char **pf_ptr;\r
-          {\r
-              input_regs.h.ah = GET_PAGE_FRAME;\r
-              int86 (EMM_INT, &input_regs, &output_regs);\r
-              if (output_regs.h.ah != 0)       /* check EMM status */\r
-                  return (FALSE);\r
-              else\r
-                 *pf_ptr = build_ptr (output_regs.x.bx, 0);\r
-              return (TRUE);\r
-          }\r
-\r
-          /*------------------------------------------------------------*/\r
-          /* Routine to release all expanded memory pages allocated     */\r
-          /* by an EMM handle.                                          */\r
-          /*------------------------------------------------------------*/\r
-\r
-          char deallocate_expanded_memory_pages (emm_handle)\r
-\r
-              unsigned int emm_handle;\r
-          {\r
-              input_regs.h.ah = DEALLOCATE_PAGES;\r
-              input_regs.x.dx = emm_handle;\r
-              int86 (EMM_INT, &input_regs, &output_regs);\r
-              if (output_regs.h.ah == 0)\r
-                  return (TRUE);\r
-              else\r
-                  return (FALSE);\r
-          }\r
-\r
-          main()\r
-\r
-          {\r
-              unsigned int emm_handle;\r
-              char *pf_addr;\r
-              int pages_needed;\r
-              int physical_page;\r
-              int logical_page;\r
-              int index;\r
-\r
-              /*--------------------------------------------------------*/\r
-              /* Determine if EMM is installed.                         */\r
-              /*--------------------------------------------------------*/\r
-              if (!emm_installed())\r
-                  exit(1);\r
-\r
-\r
-\r
-\r
-          Writing Programs That Use Expanded Memory                      17\r
-\f\r
-\r
-\r
-\r
-\r
-              /*--------------------------------------------------------*/\r
-              /* Determine if enough expanded memory pages exist for    */\r
-              /* application.                                           */\r
-              /*--------------------------------------------------------*/\r
-              pages_needed = 1;\r
-              if (!enough_unallocated_pages (pages_needed))\r
-                  exit(1);\r
-\r
-              /*--------------------------------------------------------*/\r
-              /* Allocate expanded memory pages.                        */\r
-              /*--------------------------------------------------------*/\r
-              if (!allocate_expanded_memory_pages (pages_needed,\r
-                                                             &emm_handle))\r
-                  exit(1);\r
-\r
-              /*--------------------------------------------------------*/\r
-              /* Map in the required pages.                             */\r
-              /*--------------------------------------------------------*/\r
-              physical_page = 0;\r
-              logical_page = 0;\r
-              if (!map_expanded_memory_pages (emm_handle, physical_page,\r
-                                                            logical_page))\r
-                  exit(1);\r
-\r
-              /*--------------------------------------------------------*/\r
-              /* Get expanded memory page frame address.                */\r
-              /*--------------------------------------------------------*/\r
-              if (!get_page_frame_address (&pf_addr))\r
-                  exit(1);\r
-\r
-              /*--------------------------------------------------------*/\r
-              /* Write to expanded memory.                              */\r
-              /*--------------------------------------------------------*/\r
-              for (index = 0; index < 0x3fff; index++)\r
-                  pf_addr[index] = index;\r
-\r
-              /*--------------------------------------------------------*/\r
-              /* Return expanded memory pages before exiting.           */\r
-              /*--------------------------------------------------------*/\r
-              if (!deallocate_expanded_memory_pages (emm_handle))\r
-                  exit(1);\r
-          }\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          Writing Programs That Use Expanded Memory                      18\r
-\f\r
-\r
-\r
-\r
-\r
-          Example 2\r
-\r
-          This program shows you how to use the basic functions of the LIM\r
-          Expanded Memory Specification with Turbo Pascal.  The program\r
-          does the following:\r
-\r
-               1.  Makes sure the LIM Expanded Memory Manager (EMM) has\r
-                   been installed.\r
-\r
-               2.  Displays the version number of the EMM.\r
-\r
-               3.  Determines if there are enough pages of memory for the\r
-                   program.  It then displays the total number of EMM pages\r
-                   present in the system and the number available for use.\r
-\r
-               4.  Requests the desired number of pages from the EMM.\r
-\r
-               5.  Maps a logical page into one of the physical pages.\r
-\r
-               6.  Displays the base address of our EMM memory page frame. \r
-                   Performs a simple read/write test on the EMM memory.\r
-\r
-               7.  Returns the EMM memory given to us back to the EMM.\r
-\r
-               8.  Exits.\r
-\r
-          All the calls are structured to return the result or error code\r
-          of the Expanded Memory function performed as an integer.  If the\r
-          error code is not zero, an error has occurred, a simple error\r
-          procedure is called, and the program terminates.\r
-\r
-          Type\r
-            ST3  = string[3];\r
-            ST80 = string[80];\r
-            ST5  = string[5];\r
-\r
-            Registers = record\r
-              case integer of\r
-                1: (AX,BX,CX,DX,BP,SI,DI,DS,ES,FLAGS: Integer);\r
-                2: (AL,AH,BL,BH,CL,CH,DL,DH         : Byte);\r
-              end;\r
-\r
-          Const\r
-            EMM_INT                    = $67;\r
-            DOS_Int                    = $21;\r
-            GET_PAGE_FRAME             = $41;\r
-            GET_UNALLOCATED_PAGE_COUNT = $42;\r
-            ALLOCATE_PAGES             = $43;\r
-            MAP_PAGES                  = $44;\r
-            DEALLOCATE_PAGES           = $45;\r
-            GET_VERSION                = $46;\r
-            STATUS_OK                  = 0;\r
-\r
-          Writing Programs That Use Expanded Memory                      19\r
-\f\r
-\r
-\r
-\r
-\r
-            {------------------------------------------------------------}\r
-            { Assume the application needs one EMM page.                 }\r
-            {------------------------------------------------------------}\r
-            APPLICATION_PAGE_COUNT = 1;\r
-\r
-          Var\r
-            Regs: Registers;\r
-\r
-            Emm_handle,\r
-            Page_Frame_Base_Address,\r
-            Pages_Needed,\r
-            Physical_Page,\r
-            Logical_Page,\r
-            Offset,\r
-            Error_Code,\r
-            Pages_EMM_Available,\r
-            Total_EMM_Pages,\r
-            Available_EMM_Pages: Integer;\r
-\r
-            Version_Number,\r
-            Pages_Number_String: ST3;\r
-\r
-            Verify: Boolean;\r
-\r
-            {------------------------------------------------------------}\r
-            { The function Hex_String converts an integer into a four    }\r
-            { character hexadecimal number (string) with leading zeros.  }\r
-            {------------------------------------------------------------}\r
-            Function Hex_String (Number: Integer): ST5;\r
-              Function Hex_Char (Number: Integer): Char;\r
-                Begin\r
-                  If Number < 10 then\r
-                    Hex_Char := Char (Number + 48)\r
-                  else\r
-                    Hex_Char := Char (Number + 55);\r
-                end; { Function Hex_char }\r
-\r
-            Var\r
-              S: ST5;\r
-\r
-            Begin\r
-              S := '';\r
-              S := Hex_Char ((Number shr 1) div 2048);\r
-              Number := (((Number shr 1) mod 2048) shl 1) + (Number and 1);\r
-              S := S + Hex_Char (Number div 256);\r
-              Number := Number mod 256;\r
-              S := S + Hex_Char (Number div 16);\r
-              Number := Number mod 16;\r
-              S := S + Hex_Char (Number);\r
-              Hex_String := S + 'h';\r
-            end; { Function Hex_String }\r
-\r
-\r
-          Writing Programs That Use Expanded Memory                      20\r
-\f\r
-\r
-\r
-\r
-\r
-            {------------------------------------------------------------}\r
-            { The function Emm_Installed checks to see if the            }\r
-            { EMM is loaded in memory.  It does this by looking          }\r
-            { for the string 'EMMXXXX0', which should be located         }\r
-            { at 10 bytes from the beginning of the code segment the     }\r
-            { EMM interrupt, 67h, points to.                             }\r
-            {------------------------------------------------------------}\r
-            Function Emm_Installed: Boolean;\r
-              Var\r
-                Emm_Device_Name   : string[8];\r
-                Int_67_Device_Name: string[8];\r
-                Position          : integer;\r
-                Regs              : registers;\r
-\r
-              Begin\r
-                Int_67_Device_Name := '';\r
-                Emm_Device_Name    := 'EMMXXXX0';\r
-                with Regs do\r
-                  Begin\r
-                    {----------------------------------------------------}\r
-                    { Get the code segment interrupt 67h points to       }\r
-                    { the EMM interrupt by using DOS function 35h.       }\r
-                    { (get interrupt vector)                             }\r
-                    {----------------------------------------------------}\r
-                    AH := $35;\r
-                    AL := EMM_INT;\r
-                    Intr (DOS_Int, Regs);\r
-                    {----------------------------------------------------}\r
-                    { The ES pseudo-register contains the segment        }\r
-                    { address pointed to by interrupt 67h.  Create an    }\r
-                    { eight character string from the eight successive   }\r
-                    { bytes at address ES:$000A (10 bytes from ES)       }\r
-                    {----------------------------------------------------}\r
-                    For Position := 0 to 7 do\r
-                      Int_67_Device_Name :=\r
-                        Int_67_Device_Name + Chr (mem[ES:Position + $0A]);\r
-                    Emm_Installed := True;\r
-                    {----------------------------------------------------}\r
-                    { If the string is the EMM manager signature,        }\r
-                    { 'EMMXXXX0', then EMM is installed and ready for    }\r
-                    { use.  If not, then EMM is not present.             }\r
-                    {----------------------------------------------------}\r
-                    If Int_67_Device_Name <> Emm_Device_Name\r
-                      then Emm_Installed := False;\r
-                  end; { with Regs do }\r
-              end; { Function Emm_Installed }\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          Writing Programs That Use Expanded Memory                      21\r
-\f\r
-\r
-\r
-\r
-\r
-            {------------------------------------------------------------}\r
-            { This function returns the total number of EMM pages        }\r
-            { present in the system, and the number of EMM pages that    }\r
-            { are available.                                             }\r
-            {------------------------------------------------------------}\r
-            Function EMM_Pages_Available\r
-              (Var Total_EMM_Pages, Pages_Available: Integer): Integer;\r
-              Var\r
-                Regs: Registers;\r
-\r
-              Begin\r
-                with Regs do\r
-                  Begin\r
-                    {----------------------------------------------------}\r
-                    { Get the number of currently unallocated pages and  }\r
-                    { the total number of pages in the system from EMM.  }\r
-                    { Load pseudo-registers prior to invoking EMM.       }\r
-                    {    AH = get unallocated page count function        }\r
-                    {----------------------------------------------------}\r
-                    AH := GET_UNALLOCATED_PAGE_COUNT;\r
-                    Intr (EMM_INT, Regs);\r
-                    {----------------------------------------------------}\r
-                    { Unload the pseudo-registers after invoking EMM.    }\r
-                    {    BX = currently unallocated pages                }\r
-                    {    DX = total pages in the system                  }\r
-                    {    AH = status                                     }\r
-                    {----------------------------------------------------}\r
-                    Pages_Available := BX;\r
-                    Total_EMM_Pages := DX;\r
-                    EMM_Pages_Available := AH;\r
-                  end;\r
-              end; { Function EMM_Pages_Available }\r
-\r
-\r
-            {------------------------------------------------------------}\r
-            { This function requests the specified number of pages       }\r
-            { from the EMM.                                              }\r
-            {------------------------------------------------------------}\r
-            Function Allocate_Expanded_Memory_Pages\r
-              (Pages_Needed: Integer; Var Handle: Integer): Integer;\r
-              Var\r
-                Regs: Registers;\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          Writing Programs That Use Expanded Memory                      22\r
-\f\r
-\r
-\r
-\r
-\r
-              Begin\r
-                with Regs do\r
-                  Begin\r
-                    {----------------------------------------------------}\r
-                    { Allocate the specified number of pages from EMM.   }\r
-                    { Load pseudo-registers prior to invoking EMM.       }\r
-                    {    AH = allocate pages function.                   }\r
-                    {    BX = number of pages to allocate.               }\r
-                    {----------------------------------------------------}\r
-                    AH := ALLOCATE_PAGES;\r
-                    BX := Pages_Needed;\r
-                    Intr (EMM_INT, Regs);\r
-                    {----------------------------------------------------}\r
-                    { Unload the pseudo-registers after invoking EMM.    }\r
-                    {    DX = EMM handle                                 }\r
-                    {    AH = status                                     }\r
-                    {----------------------------------------------------}\r
-                    Handle := DX;\r
-                    Allocate_Expanded_Memory_Pages := AH;\r
-                  end;\r
-              end; { Function Allocate_Expanded_Memory_Pages }\r
-\r
-\r
-            {------------------------------------------------------------}\r
-            { This function maps a logical page allocated by the         }\r
-            { Allocate_Expanded_Memory_Pages function into one of the    }\r
-            { four physical pages.                                       }\r
-            {------------------------------------------------------------}\r
-            Function Map_Expanded_Memory_Pages\r
-              (Handle, Logical_Page, Physical_Page: Integer): Integer;\r
-              Var\r
-                Regs: Registers;\r
-\r
-              Begin\r
-                with Regs do\r
-                  Begin\r
-                    {----------------------------------------------------}\r
-                    { Map a logical page at a physical page.             }\r
-                    { Load pseudo-registers prior to invoking EMM.       }\r
-                    {    AH = map page function                          }\r
-                    {    DX = handle                                     }\r
-                    {    BX = logical page number                        }\r
-                    {    AL = physical page number                       }\r
-                    {----------------------------------------------------}\r
-                    AH := MAP_PAGES;\r
-                    DX := Handle;\r
-                    BX := Logical_Page;\r
-                    AL := Physical_Page;\r
-                    Intr (EMM_INT, Regs);\r
-\r
-\r
-\r
-\r
-          Writing Programs That Use Expanded Memory                      23\r
-\f\r
-\r
-\r
-\r
-\r
-                    {----------------------------------------------------}\r
-                    { Unload the pseudo-registers after invoking EMM.    }\r
-                    {    AH = status                                     }\r
-                    {----------------------------------------------------}\r
-                    Map_Expanded_Memory_Pages := AH;\r
-                  end; { with Regs do }\r
-              end; { Function Map_Expanded_Memory_Pages }\r
-\r
-\r
-            {------------------------------------------------------------}\r
-            { This function gets the physical address of the EMM page    }\r
-            { frame we are using.  The address returned is the segment   }\r
-            { of the page frame.                                         }\r
-            {------------------------------------------------------------}\r
-            Function Get_Page_Frame_Base_Address\r
-              (Var Page_Frame_Address: Integer): Integer;\r
-              Var\r
-                Regs: Registers;\r
-\r
-              Begin\r
-                with Regs do\r
-                  Begin\r
-                    {----------------------------------------------------}\r
-                    { Get the page frame segment address from EMM.       }\r
-                    { Load pseudo-registers prior to invoking EMM.       }\r
-                    {    AH = get page frame segment function            }\r
-                    {----------------------------------------------------}\r
-                    AH := GET_PAGE_FRAME;\r
-                    Intr (EMM_INT, Regs);\r
-                    {----------------------------------------------------}\r
-                    { Unload the pseudo-registers after invoking EMM.    }\r
-                    {    BX = page frame segment address                 }\r
-                    {    AH = status                                     }\r
-                    {----------------------------------------------------}\r
-                    Page_Frame_Address := BX;\r
-                    Get_Page_Frame_Base_Address := AH;\r
-                  end; { with Regs do }\r
-              end; { Function Get_Page_Frame_Base_Address }\r
-\r
-\r
-            {------------------------------------------------------------}\r
-            { This function releases the EMM memory pages allocated to   }\r
-            { us, back to the EMM memory pool.                           }\r
-            {------------------------------------------------------------}\r
-            Function Deallocate_Expanded_Memory_Pages\r
-              (Handle: Integer): Integer;\r
-              Var\r
-                Regs: Registers;\r
-\r
-\r
-\r
-\r
-\r
-          Writing Programs That Use Expanded Memory                      24\r
-\f\r
-\r
-\r
-\r
-\r
-              Begin\r
-                with Regs do\r
-                  Begin\r
-                    {----------------------------------------------------}\r
-                    { Deallocate the pages allocated to an EMM handle.   }\r
-                    { Load pseudo-registers prior to invoking EMM.       }\r
-                    {    AH = deallocate pages function                  }\r
-                    {    DX = EMM handle                                 }\r
-                    {----------------------------------------------------}\r
-                    AH := DEALLOCATE_PAGES;\r
-                    DX := Handle;\r
-                    Intr (EMM_INT, Regs);\r
-                    {----------------------------------------------------}\r
-                    { Unload the pseudo-registers after invoking EMM.    }\r
-                    {    AH = status                                     }\r
-                    {----------------------------------------------------}\r
-                    Deallocate_Expanded_Memory_Pages := AH;\r
-                  end; { with Regs do }\r
-              end; { Function Deallocate_Expanded_Memory_Pages }\r
-\r
-\r
-            {------------------------------------------------------------}\r
-            { This function returns the version number of the EMM as     }\r
-            { a three-character string.                                  }\r
-            {------------------------------------------------------------}\r
-            Function Get_Version_Number (Var Version_String: ST3): Integer;\r
-              Var\r
-                Regs: Registers;\r
-                Integer_Part, Fractional_Part: Char;\r
-\r
-              Begin\r
-                with Regs do\r
-                  Begin\r
-                    {----------------------------------------------------}\r
-                    { Get the version of EMM.                            }\r
-                    { Load pseudo-registers prior to invoking EMM.       }\r
-                    {    AH = get EMM version function                   }\r
-                    {----------------------------------------------------}\r
-                    AH := GET_VERSION;\r
-                    Intr (EMM_INT, Regs);\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          Writing Programs That Use Expanded Memory                      25\r
-\f\r
-\r
-\r
-\r
-\r
-                    {----------------------------------------------------}\r
-                    { If the version number returned was OK, then        }\r
-                    { convert it to a three-character string.            }\r
-                    {----------------------------------------------------}\r
-                    If AH=STATUS_OK then\r
-                      Begin\r
-                        {------------------------------------------------}\r
-                        { The upper four bits of AH are the integer      }\r
-                        { portion of the version number, the lower four  }\r
-                        { bits are the fractional portion.  Convert the  }\r
-                        { integer value to ASCII by adding 48.           }\r
-                        {------------------------------------------------}\r
-                        Integer_Part    := Char (AL shr 4  + 48);\r
-                        Fractional_Part := Char (AL and $F + 48);\r
-                        Version_String  := Integer_Part + '.' +\r
-                                                          Fractional_Part;\r
-                      end; { If AH=STATUS_OK }\r
-                    {----------------------------------------------------}\r
-                    { Unload the pseudo-registers after invoking EMM.    }\r
-                    {    AH = status                                     }\r
-                    {----------------------------------------------------}\r
-                    Get_Version_Number := AH;\r
-                  end; { with Regs do }\r
-              end; { Function Get_Version_Number }\r
-\r
-\r
-            {------------------------------------------------------------}\r
-            { This procedure prints an error message passed by the       }\r
-            { caller, prints the error code passed by the caller in hex, }\r
-            { and then terminates the program with an error level of 1.  }\r
-            {------------------------------------------------------------}\r
-            Procedure Error (Error_Message: ST80; Error_Number: Integer);\r
-              Begin\r
-                Writeln (Error_Message);\r
-                Writeln ('  Error_Number = ', Hex_String (Error_Number));\r
-                Writeln ('EMM test program aborting.');\r
-                Halt (1);\r
-              end; { Procedure Error }\r
-\r
-\r
-          {--------------------------------------------------------------}\r
-          { This program is an example of the basic EMM functions that   }\r
-          { you need in order to use EMM memory with Turbo Pascal.       }\r
-          {--------------------------------------------------------------}\r
-          Begin\r
-            ClrScr;\r
-            Window (5,2,77,22);\r
-\r
-\r
-\r
-\r
-\r
-\r
-          Writing Programs That Use Expanded Memory                      26\r
-\f\r
-\r
-\r
-\r
-\r
-            {------------------------------------------------------------}\r
-            { Determine if the Expanded Memory Manager is installed.  If }\r
-            { not, then terminate 'main' with an ErrorLevel code of 1.   }\r
-            {------------------------------------------------------------}\r
-            If not (Emm_Installed) then\r
-              Begin\r
-                Writeln ('The LIM EMM is not installed.');\r
-                Halt (1);\r
-              end\r
-            else\r
-              Begin\r
-                { Get the version number and display it }\r
-                Error_Code := Get_Version_Number (Version_Number);\r
-                If Error_Code <> STATUS_OK then\r
-                  Error ('Error getting EMM version number.', Error_Code)\r
-                else\r
-                  Writeln ('LIM Expanded Memory Manager, version ',\r
-                           Version_Number, ' is ready for use.');\r
-              end;\r
-            Writeln;\r
-\r
-            {------------------------------------------------------------}\r
-            { Determine if there are enough expanded memory pages for    }\r
-            { this application.                                          }\r
-            {------------------------------------------------------------}\r
-            Pages_Needed := APPLICATION_PAGE_COUNT;\r
-            Error_Code   := EMM_Pages_Available (Total_EMM_Pages,\r
-                                                 Available_EMM_Pages);\r
-            If Error_Code <> STATUS_OK then\r
-              Error ('Error determining number of EMM pages available.',\r
-                     Error_Code);\r
-            Writeln ('There are a total of ', Total_EMM_Pages,\r
-                     ' expanded memory pages present in this system.');\r
-            Writeln ('  ', Available_EMM_Pages,\r
-                     ' of those pages are available for use.');\r
-            Writeln;\r
-\r
-            {------------------------------------------------------------}\r
-            { If there is an insufficient number of pages for the        }\r
-            { application, then report the error and terminate the EMM   }\r
-            { example program.                                           }\r
-            {------------------------------------------------------------}\r
-            If Pages_Needed > Available_EMM_Pages then\r
-              Begin\r
-                Str (Pages_Needed, Pages_Number_String);\r
-                Error ('We need ' + Pages_Number_String +\r
-                       ' EMM pages.  There are not that many available.',\r
-                       Error_Code);\r
-              end; { Pages_Needed > Available_EMM_Pages }\r
-\r
-\r
-\r
-\r
-          Writing Programs That Use Expanded Memory                      27\r
-\f\r
-\r
-\r
-\r
-\r
-            {------------------------------------------------------------}\r
-            { Allocate expanded memory pages for our use.                }\r
-            {------------------------------------------------------------}\r
-            Error_Code :=\r
-              Allocate_Expanded_Memory_Pages (Pages_Needed, Emm_Handle);\r
-            Str (Pages_Needed, Pages_Number_String);\r
-            If Error_Code <> STATUS_OK then\r
-              Error ('EMM test program failed trying to allocate '\r
-                     + Pages_Number_String\r
-                     + ' pages for usage.', Error_Code);\r
-            Writeln (APPLICATION_PAGE_COUNT,\r
-                     ' EMM page(s) allocated for the EMM test program.');\r
-            Writeln;\r
-\r
-            {------------------------------------------------------------}\r
-            { Map in the required logical pages to the physical pages    }\r
-            { given to us, in this case just one page.                   }\r
-            {------------------------------------------------------------}\r
-            Logical_Page  := 0;\r
-            Physical_Page := 0;\r
-            Error_Code := Map_Expanded_Memory_Pages (Emm_Handle,\r
-                                                     Logical_Page,\r
-                                                     Physical_Page);\r
-            If Error_Code <> STATUS_OK then\r
-              Error ('EMM test program failed trying to map '\r
-                     + 'logical pages into physical pages.',\r
-                     Error_Code);\r
-\r
-            Writeln ('Logical Page ',\r
-                     Logical_Page,\r
-                     ' successfully mapped into Physical Page ',\r
-                     Physical_Page);\r
-            Writeln;\r
-\r
-            {------------------------------------------------------------}\r
-            { Get the expanded memory page frame address.                }\r
-            {------------------------------------------------------------}\r
-            Error_Code := Get_Page_Frame_Base_Address\r
-                            (Page_Frame_Base_Address);\r
-            If Error_Code <> STATUS_OK then\r
-              Error ('EMM test program unable to get the base Page'\r
-                     + ' Frame Address.',\r
-                     Error_Code);\r
-            Writeln ('The base address of the EMM page frame is = '\r
-                     + Hex_String (Page_Frame_Base_Address));\r
-            Writeln;\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          Writing Programs That Use Expanded Memory                      28\r
-\f\r
-\r
-\r
-\r
-\r
-            {------------------------------------------------------------}\r
-            { Write a test pattern to expanded memory.                   }\r
-            {------------------------------------------------------------}\r
-            For Offset := 0 to 16382 do\r
-              Begin\r
-                Mem[Page_Frame_Base_Address:Offset] := Offset mod 256;\r
-              end;\r
-\r
-            {------------------------------------------------------------}\r
-            { Make sure that what is in EMM memory is what was just      }\r
-            { written.                                                   }\r
-            {------------------------------------------------------------}\r
-            Writeln ('Testing EMM memory.');\r
-\r
-            Offset := 1;\r
-            Verify := True;\r
-            while (Offset <= 16382) and (Verify = True) do\r
-              Begin\r
-                If Mem[Page_Frame_Base_Address:Offset] <> Offset mod 256\r
-                  then Verify := False;\r
-                Offset := Succ (Offset);\r
-              end; { while (Offset <= 16382) and (Verify = True) }\r
-\r
-            {------------------------------------------------------------}\r
-            { If what is read does not match what was written,           }\r
-            { an error occurred.                                         }\r
-            {------------------------------------------------------------}\r
-            If not Verify then\r
-              Error ('What was written to EMM memory was not found during'\r
-                     + ' memory verification test.',\r
-                     0);\r
-            Writeln ('EMM memory test successful.');\r
-            Writeln;\r
-\r
-            {------------------------------------------------------------}\r
-            { Return the expanded memory pages given to us back to the   }\r
-            { EMM memory pool before terminating our test program.       }\r
-            {------------------------------------------------------------}\r
-            Error_Code := Deallocate_Expanded_Memory_Pages (Emm_Handle);\r
-            If Error_Code <> STATUS_OK then\r
-              Error ('EMM test program was unable to deallocate '\r
-                     + 'the EMM pages in use.',\r
-                     Error_Code);\r
-            Writeln (APPLICATION_PAGE_COUNT,\r
-                     ' pages(s) deallocated.');\r
-            Writeln;\r
-            Writeln ('EMM test program completed.');\r
-\r
-          end.\r
-\r
-\r
-\r
-\r
-          Writing Programs That Use Expanded Memory                      29\r
-\f\r
-\r
-\r
-\r
-\r
-          Example 3\r
-\r
-               This program is written in Microsoft's macro assembler.\r
-\r
-\r
-          CODE SEGMENT\r
-               ASSUME CS:CODE, DS:CODE\r
-\r
-          MOV   AX,CS\r
-          MOV   DX,AX\r
-               .\r
-               .\r
-               .\r
-          check_emm_installed:\r
-\r
-          MOV   AH,35h                  ; AH = DOS get interrupt vector\r
-                                        ; function\r
-          MOV   AL,67h                  ; AL = EMM interrupt vector number\r
-          INT   21h\r
-          MOV   DI,0Ah                  ; ES:DI points to where device     \r
-                                        ; name should be\r
-          LEA   SI,EMM_device_name      ; DS:SI points to ASCII string     \r
-                                        ; containing EMM device name\r
-\r
-          MOV   CX,device_name_length   ; set up loop counter for string op\r
-          CLD                           ; set up direction flag for forward\r
-          REPE  CMPSB                   ; Compare the strings\r
-          JNE   exit                    ; IF strings not equal THEN exit\r
-                                        ; ELSE\r
-          check_enough_unallocated_pages:\r
-\r
-          MOV   AH,41h                  ;    AH = EMM get unallocated page\r
-                                        ;    count function code\r
-          INT   67h\r
-          OR    AH,AH                   ; Check EMM status\r
-          JNZ   emm_error_handler       ; IF error THEN goto error handler\r
-                                        ; ELSE\r
-          allocate_expanded_memory_pages:\r
-\r
-          MOV   AH,43h                  ;    AH = EMM allocate pages\r
-                                        ;    function code\r
-          MOV   BX,2                    ;    BX = number of pages needed\r
-          INT   67h\r
-          OR    AH,AH                   ; Check EMM status\r
-          JNZ   emm_error_handler       ; IF error THEN goto error handler\r
-                                        ; ELSE\r
-          MOV   emm_handle,DX           ;    save EMM handle\r
-\r
-          map_expanded_memory_pages:\r
-\r
-          MOV   AH,44h                  ; AH = EMM map pages function\r
-          MOV   DX,emm_handle           ; DX = application's handle\r
-\r
-          Writing Programs That Use Expanded Memory                      30\r
-\f\r
-\r
-\r
-\r
-\r
-          map_0_to_0:\r
-\r
-          MOV   BX,0                    ; BX = logical page 0\r
-          MOV   AL,0                    ; AL = physical page 0\r
-          INT   67h\r
-          OR    AH,AH                   ; Check EMM status\r
-          JNZ   emm_error_handler       ; If error THEN goto error handler\r
-                                        ; ELSE\r
-          get_page_frame_address:\r
-\r
-          MOV   AH,41h                  ; AH = EMM get page frame base\r
-                                        ; address function\r
-          INT   67h\r
-          OR    AH,AH                   ; Check EMM status\r
-          JNZ   emm_error_handler       ; IF error THEN goto error handler\r
-          MOV   pf_addr,BX              ; ELSE save pf_addr\r
-\r
-          write_to_expanded_memory:     ; Write zeros to memory mapped at\r
-                                        ; physical page 0\r
-          MOV   AX,pf_addr\r
-          MOV   ES,AX                   ; ES points to physical page 0\r
-          MOV   DI,0                    ; DI indexes into physical page 0\r
-          MOV   AL,0                    ; Initialize AL for string STOSB\r
-          MOV   CX,4000h                ; Initialize loop counter to length \r
-                                        ; of expanded memory page size\r
-          CLD                           ; set up direction flag for forward\r
-          REP   STOSB\r
-\r
-          deallocate_pages:\r
-\r
-          MOV   AH,45h                  ; AH = EMM deallocate pages        \r
-                                        ; function\r
-          MOV   DX,emm_handle\r
-          INT   67h                     ; return handle's pages to EMM\r
-          OR    AH,AH                   ; Check EMM status\r
-          JNZ   emm_error_handler       ; IF error THEN goto error handler\r
-\r
-          exit:\r
-\r
-          MOV   AH,4Ch                  ; AH = DOS exit function\r
-          INT   21h                     ; return to DOS\r
-\r
-\r
-          EMM_device_name DB 'EMMXXXX0' ; ASCII EMM device name string\r
-\r
-          device_name_length EQU 8\r
-\r
-          CODE ENDS\r
-               END\r
-\r
-\r
-\r
-\r
-          Writing Programs That Use Expanded Memory                      31\r
-\f\r
-\r
-\r
-\r
-\r
-          Example 4\r
-\r
-               This program is an example of how to exchange a 256K-byte\r
-               block of data from conventional memory to expanded memory.\r
-\r
-\r
-          CODE SEGMENT\r
-               ASSUME CS:CODE, DS:CODE\r
-               .\r
-               .\r
-               .\r
-          xchg_packet_set_up:\r
-\r
-          ;DS:SI = xchg_packet\r
-\r
-          MOV   AX,SEG xchg_packet\r
-          MOV   DS,AX\r
-          MOV   SI,OFFSET xchg_packet\r
-\r
-          ;Moving 256K of data from conventional memory to expanded memory\r
-\r
-          MOV   WORD PTR [SI].region_length[0],0\r
-          MOV   WORD PTR [SI].region_length[2],4\r
-          MOV   [SI].src_mem_type,0\r
-          MOV   [SI].dest_mem_type,1\r
-\r
-          ;starting at segment: 4000h, offset: 0\r
-\r
-          MOV   [SI].src_init_seg_page,4000h\r
-          MOV   [SI].src_init_offset,0\r
-\r
-          ;Move data into expanded memory logical page 0, offset 0.\r
-\r
-          MOV   [SI].dest_init_seg_page,0\r
-          MOV   [SI].dest_init_offset,0\r
-\r
-          ;Initialize for future compatibility\r
-\r
-          MOV   [SI].src_handle,0\r
-\r
-          ;Need handle for expanded memory destination.\r
-\r
-          MOV   DX,emm_handle\r
-          MOV   [SI].dest_handle,DX\r
-\r
-          ;AX = EMM Exchange Memory function\r
-\r
-          MOV   AX,5701h\r
-          INT   67h\r
-          OR    AH,AH\r
-          JNZ   emm_error_handler\r
-\r
-\r
-          Writing Programs That Use Expanded Memory                      32\r
-\f\r
-\r
-\r
-\r
-\r
-          xchg_struct                    STRUC\r
-             region_length               DD ?\r
-             src_mem_type                DB ?\r
-             src_handle                  DW ?\r
-             src_init_offset             DW ?\r
-             src_init_seg_page           DW ?\r
-             dest_mem_type               DB ?\r
-             dest_handle                 DW ?\r
-             dest_init_offset            DW ?\r
-             dest_init_seg_page          DW ?\r
-          xchg_struct                    ENDS\r
-\r
-          xchg_packet                    xchg_struct\r
-\r
-          CODE  ENDS\r
-                END\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          Writing Programs That Use Expanded Memory                      33\r
-\f\r
-\r
-\r
-\r
-\r
-          Chapter 3\r
-          EMM FUNCTIONS\r
-\r
-\r
-               This chapter provides you with a standardized set of\r
-               expanded memory functions.  Because they are standardized,\r
-               you avoid potential compatibility problems with other\r
-               expanded memory programs that also adhere to the memory\r
-               manager specification.  Programs that deal directly with the\r
-               hardware or that don't adhere to this specification will be\r
-               incompatible.\r
-\r
-               Table 3-1 presents a sequential list of the EMM functions. \r
-               The remainder of this chapter provides detailed descriptions\r
-               of each function.\r
-\r
-\r
-          Table 3-1.  List of EMM Functions\r
-          ----------------------------------------------------------------\r
-\r
-          Number             Function Name                Hex Value   Page\r
-\r
-          ----------------------------------------------------------------\r
-\r
-             1    Get Status                                40h         37\r
-\r
-             2    Get Page Frame Address                    41h         38\r
-\r
-             3    Get Unallocated Page Count                42h         40\r
-\r
-             4    Allocate Pages                            43h         42\r
-\r
-             5    Map/Unmap Handle Page                     44h         46\r
-\r
-             6    Deallocate Pages                          45h         49\r
-\r
-             7    Get Version                               46h         51\r
-\r
-             8    Save Page Map                             47h         53\r
-\r
-             9    Restore Page Map                          48h         55\r
-\r
-            10    Reserved                                  49h         57\r
-\r
-            11    Reserved                                  4Ah         58\r
-\r
-            12    Get Handle Count                          4Bh         59\r
-\r
-            13    Get Handle Pages                          4Ch         61\r
-\r
-            14    Get All Handle Pages                      4Dh         63\r
-\r
-\r
-          EMM Functions                                                  34\r
-\f\r
-\r
-\r
-\r
-\r
-          Table 3-1.  List of EMM Functions (continued)\r
-          ----------------------------------------------------------------\r
-\r
-          Number             Function Name                Hex Value   Page\r
-\r
-          ----------------------------------------------------------------\r
-\r
-            15    Get Page Map                              4E00h       65\r
-                  Set Page Map                              4E01h       67\r
-                  Get & Set Page Map                        4E02h       69\r
-                  Get Size of Page Map Save Array           4E03h       71\r
-\r
-            16    Get Partial Page Map                      4F00h       73\r
-                  Set Partial Page Map                      4F01h       76\r
-                  Get Size of Partial Page Map\r
-                     Save Array                             4F02h       78\r
-\r
-            17    Map/Unmap Multiple Handle Pages\r
-                  (Physical page number mode)               5000h       82\r
-                  Map/Unmap Multiple Handle Pages\r
-                  (Segment address mode)                    5001h       85\r
-\r
-            18    Reallocate Pages                          51h         88\r
-\r
-            19    Get Handle Attribute                      5200h       92\r
-                  Set Handle Attribute                      5201h       94\r
-                  Get Handle Attribute Capability           5202h       96\r
-\r
-            20    Get Handle Name                           5300h       98\r
-                  Set Handle Name                           5301h      100\r
-\r
-            21    Get Handle Directory                      5400h      102\r
-                  Search for Named Handle                   5401h      105\r
-                  Get Total Handles                         5402h      107\r
-\r
-            22    Alter Page Map & Jump\r
-                  (Physical page number mode)               5500h      109\r
-                  Alter Page Map & Jump\r
-                  (Segment address mode)                    5501h      109\r
-\r
-            23    Alter Page Map & Call\r
-                  (Physical page number mode)               5600h      113\r
-                  Alter Page Map & Call\r
-                  (Segment address mode)                    5601h      113\r
-                  Get Page Map Stack Space Size             5602h      118\r
-\r
-            24    Move Memory Region                        5700h      120\r
-                  Exchange Memory Region                    5701h      126\r
-\r
-            25    Get Mappable Physical Address Array       5800h      132\r
-                  Get Mappable Physical Address Array\r
-                     Entries                                5801h      136\r
-\r
-          EMM Functions                                                  35\r
-\f\r
-\r
-\r
-\r
-\r
-          Table 3-1.  List of EMM Functions (continued)\r
-          ----------------------------------------------------------------\r
-\r
-          Number             Function Name                Hex Value   Page\r
-\r
-          ----------------------------------------------------------------\r
-\r
-            26    Get Hardware Configuration Array          5900h      138\r
-                  Get Unallocated Raw Page Count            5901h      142\r
-\r
-            27    Allocate Standard Pages                   5A00h      144\r
-                  Allocate Raw Pages                        5A01h      147\r
-\r
-            28    Get Alternate Map Register Set            5B00h      153\r
-                  Set Alternate Map Register Set            5B01h      157\r
-                  Get Alternate Map Save Array Size         5B02h      161\r
-                  Allocate Alternate Map Register Set       5B03h      163\r
-                  Deallocate Alternate Map Register Set     5B04h      166\r
-                  Allocate DMA Register Set                 5B05h      168\r
-                  Enable DMA on Alternate Map\r
-                     Register Set                           5B06h      170\r
-                  Disable DMA on Alternate Map\r
-                     Register Set                           5B07h      173\r
-                  Deallocate DMA Register Set               5B08h      175\r
-\r
-            29    Prepare Expanded Memory Hardware\r
-                     for Warmboot                           5Ch        177\r
-\r
-            30    Enable OS/E Function Set                  5D00h      179\r
-                  Disable OS/E Function Set                 5D01h      182\r
-                  Return OS/E Access Key                    5D02h      185\r
-\r
-          ----------------------------------------------------------------\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                  36\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 1. Get Status\r
-\r
-\r
-\r
-          PURPOSE\r
-\r
-               The Get Status function returns a status code indicating\r
-               whether the memory manager is present and the hardware is\r
-               working correctly.\r
-\r
-\r
-          CALLING PARAMETERS\r
-\r
-               AH = 40h\r
-                   Contains the Get Status Function.\r
-\r
-\r
-          REGISTERS MODIFIED\r
-\r
-               AX\r
-\r
-\r
-          STATUS\r
-\r
-               AH = 0   SUCCESSFUL.\r
-                   The manager is present in the system, and the hardware\r
-                   is working correctly.\r
-\r
-               AH = 80h   NON-RECOVERABLE.\r
-                   The manager detected a malfunction in the memory manager\r
-                   software.\r
-\r
-               AH = 81h   NON-RECOVERABLE.\r
-                   The manager detected a malfunction in the expanded\r
-                   memory hardware.\r
-\r
-               AH = 84h   NON-RECOVERABLE.\r
-                   The function code passed to the memory manager is not\r
-                   defined.\r
-\r
-\r
-          EXAMPLE\r
-\r
-          MOV   AH,40h                   ; load function code\r
-          INT   67h                      ; call the memory manager\r
-          OR    AH,AH                    ; check EMM status\r
-          JNZ   emm_err_handler          ; jump to error handler on error\r
-\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                  37\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 2. Get Page Frame Address\r
-\r
-\r
-\r
-          PURPOSE\r
-\r
-               The Get Page Frame Address function returns the segment\r
-               address where the page frame is located.\r
-\r
-\r
-          CALLING PARAMETERS\r
-\r
-               AH = 41h\r
-                   Contains the Get Page Frame Address function.\r
-\r
-\r
-          RESULTS\r
-\r
-               These results are valid only if the status returned is zero.\r
-\r
-               BX = page frame segment address\r
-                   Contains the segment address of the page frame.\r
-\r
-\r
-          REGISTERS MODIFIED\r
-\r
-               AX, BX\r
-\r
-\r
-          STATUS\r
-\r
-               AH = 0   SUCCESSFUL.\r
-                   The manager has returned the page frame address in the\r
-                   BX register.\r
-\r
-               AH = 80h   NON-RECOVERABLE.\r
-                   The manager detected a malfunction in the memory manager\r
-                   software.\r
-\r
-               AH = 81h   NON-RECOVERABLE.\r
-                   The manager detected a malfunction in the expanded\r
-                   memory hardware.\r
-\r
-               AH = 84h   NON-RECOVERABLE.\r
-                   The function code passed to the memory manager is not\r
-                   defined.\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                  38\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 2. Get Page Frame Address\r
-\r
-\r
-\r
-          EXAMPLE\r
-\r
-          page_frame_segment             DW ?\r
-\r
-          MOV   AH,41h                   ; load function code\r
-          INT   67h                      ; call the memory manager\r
-          OR    AH,AH                    ; check EMM status\r
-          JNZ   emm_err_handler          ; jump to error handler on error\r
-          MOV   page_frame_segment,BX    ; save page frame address\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                  39\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 3. Get Unallocated Page Count\r
-\r
-\r
-\r
-          PURPOSE\r
-\r
-               The Get Unallocated Page Count function returns the number\r
-               of unallocated pages and the total number of expanded memory\r
-               pages.\r
-\r
-\r
-          CALLING PARAMETERS\r
-\r
-               AH = 42h\r
-                   Contains the Get Unallocated Page Count function.\r
-\r
-\r
-          RESULTS\r
-\r
-               These results are valid only if the status returned is zero.\r
-\r
-               BX = unallocated pages\r
-                   The number of expanded memory pages that are currently\r
-                   available for use (unallocated).\r
-\r
-               DX = total pages\r
-                   The total number of expanded memory pages.\r
-\r
-\r
-          REGISTERS MODIFIED\r
-\r
-               AX, BX, DX\r
-\r
-\r
-          STATUS\r
-\r
-               AH = 0   SUCCESSFUL.\r
-                   The manager has returned the number of unallocated pages\r
-                   and the number of total pages in expanded memory.\r
-\r
-               AH = 80h   NON-RECOVERABLE.\r
-                   The manager detected a malfunction in the memory manager\r
-                   software.\r
-\r
-               AH = 81h   NON-RECOVERABLE.\r
-                   The manager detected a malfunction in the expanded\r
-                   memory hardware.\r
-\r
-               AH = 84h   NON-RECOVERABLE.\r
-                   The function code passed to the memory manager is not\r
-                   defined.\r
-\r
-\r
-          EMM Functions                                                  40\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 3. Get Unallocated Page Count\r
-\r
-\r
-\r
-          EXAMPLE\r
-\r
-          un_alloc_pages                 DW ?\r
-          total_pages                    DW ?\r
-\r
-          MOV   AH,42h                   ; load function code\r
-          INT   67h                      ; call the memory manager\r
-          OR    AH,AH                    ; check EMM status\r
-          JNZ   emm_err_handler          ; jump to error handler on error\r
-          MOV   un_alloc_pages,BX        ; save unallocated page count\r
-          MOV   total_pages,DX           ; save total page count\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                  41\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 4. Allocate Pages\r
-\r
-\r
-\r
-               The Allocate Pages function allocates the number of pages\r
-               requested and assigns a unique EMM handle to these pages. \r
-               The EMM handle owns these pages until the application\r
-               deallocates them.\r
-\r
-               Handles which are assigned using this function will have\r
-               16K-byte pages, the size of a standard expanded memory page. \r
-               If the expanded memory board hardware isn't able to supply\r
-               16K-byte pages, it will emulate them by combining multiple\r
-               non-standard size pages to form a single 16K-byte page.  All\r
-               application programs and functions that use the handles this\r
-               function returns will deal with 16K-byte pages.\r
-\r
-               The numeric value of the handles the EMM returns are in the\r
-               range of 1 to 254 decimal (0001h to 00FEh).  The OS handle\r
-               (handle value 0) is never returned by the Allocate Pages\r
-               function.  Also, the uppermost byte of the handle will be\r
-               zero and cannot be used by the application.  A memory\r
-               manager should be able to supply up to 255 handles, includ-\r
-               ing the OS handle.  An application can use Function 21 to\r
-               find out how many handles an EMM supports.\r
-\r
-               Allocating zero pages to a handle is not valid.  If an\r
-               application needs to allocate 0 pages to a handle it should\r
-               use Function 27 (Allocate Standard Pages subfunction)\r
-               provided for this purpose.\r
-\r
-          Note............................................................\r
-               This note affects expanded memory manager implementors and\r
-               operating system developers only.  Applications should not\r
-               use the following characteristics of the memory manager.  An\r
-               application violating this rule will be incompatible with\r
-               future versions of Microsoft's operating systems and\r
-               environments.\r
-\r
-               To be compatible with this specification, an expanded memory\r
-               manager will provide a special handle which is available to\r
-               the operating system only.  This handle will have a value of\r
-               0000h and will have a set of pages allocated to it when the\r
-               expanded memory manager driver installs.  The pages that the\r
-               memory manager will automatically allocate to handle 0000h\r
-               are those that backfill conventional memory.  Typically,\r
-               this backfill occurs between addresses 40000h (256K) and\r
-               9FFFFh (640K).  However, the range can extend below and\r
-               above this limit if the hardware and memory manager have the\r
-               capability.\r
-\r
-\r
-\r
-          EMM Functions                                                  42\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 4. Allocate Pages\r
-\r
-\r
-\r
-               An operating system won't have to invoke Function 4 to\r
-               obtain this handle because it can assume the handle already\r
-               exists and is available for use immediately after the\r
-               expanded memory device driver installs.  When an operating\r
-               system wants to use this handle, it uses the special handle\r
-               value of 0000h.  The operating system will be able to invoke\r
-               any EMM function using this special handle value.  To\r
-               allocate pages to this handle, the operating system need\r
-               only invoke Function 18 (Reallocate Pages).\r
-\r
-               There are two special cases for this handle:\r
-\r
-               1.  Function 4 (Allocate Pages).  This function must never\r
-                   return zero as a handle value.  Applications must always\r
-                   invoke Function 4 to allocate pages and obtain a handle\r
-                   which identifies the pages which belong to it.  Since\r
-                   Function 4 never returns a handle value of zero, an\r
-                   application will never gain access to this special\r
-                   handle.\r
-\r
-               2.  Function 6 (Deallocate Pages).  If the operating system\r
-                   uses it to deallocate the pages which are allocated to\r
-                   this special handle, the pages the handle owns will be\r
-                   returned to the manager for use.  But the handle will\r
-                   not be available for reassignment.  The manager should\r
-                   treat a deallocate pages function request for this\r
-                   handle the same as a reallocate pages function request,\r
-                   where the number of pages to reallocate to this handle\r
-                   is zero.\r
-\r
-\r
-          CALLING PARAMETERS\r
-\r
-               AH = 43h\r
-                   Contains the Allocate Pages function.\r
-\r
-               BX = num_of_pages_to_alloc\r
-                   Contains the number of pages you want your program to\r
-                   allocate.\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                  43\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 4. Allocate Pages\r
-\r
-\r
-\r
-          RESULTS\r
-\r
-               These results are valid only if the status returned is zero.\r
-\r
-               DX = handle\r
-                   Contains a unique EMM handle.  Your program must use\r
-                   this EMM handle (as a parameter) in any function that\r
-                   requires it.  You can use up to 255 handles.  The\r
-                   uppermost byte of the handle will be zero and cannot be\r
-                   used by the application.\r
-\r
-\r
-          REGISTERS MODIFIED\r
-\r
-               AX, DX\r
-\r
-\r
-          STATUS\r
-\r
-               AH = 0   SUCCESSFUL.\r
-                   The manager has allocated the requested pages to the\r
-                   assigned EMM handle.\r
-\r
-               AH = 80h   NON-RECOVERABLE.\r
-                   The manager detected a malfunction in the memory manager\r
-                   software.\r
-\r
-               AH = 81h   NON-RECOVERABLE.\r
-                   The manager detected a malfunction in the expanded\r
-                   memory hardware.\r
-\r
-               AH = 84h   NON-RECOVERABLE.\r
-                   The function code passed to the memory manager is not\r
-                   defined.\r
-\r
-               AH = 85h   RECOVERABLE.\r
-                   All EMM handles are being used.\r
-\r
-               AH = 87h   RECOVERABLE.\r
-                   There aren't enough expanded memory pages present in the\r
-                   system to satisfy your program's request.\r
-\r
-               AH = 88h   RECOVERABLE.\r
-                   There aren't enough unallocated pages to satisfy your\r
-                   program's request.\r
-\r
-               AH = 89h   RECOVERABLE.\r
-                   Your program attempted to allocate zero pages.\r
-\r
-          EMM Functions                                                  44\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 4. Allocate Pages\r
-\r
-\r
-\r
-          EXAMPLE\r
-\r
-          num_of_pages_to_alloc          DW ?\r
-          emm_handle                     DW ?\r
-\r
-          MOV   BX,num_of_pages_to_alloc ; load number of pages\r
-          MOV   AH,43h                   ; load function code\r
-          INT   67h                      ; call the memory manager\r
-          OR    AH,AH                    ; check EMM status\r
-          JNZ   emm_err_handler          ; jump to error handler on error\r
-          MOV   emm_handle,DX            ; save EMM handle\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                  45\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 5. Map/Unmap Handle Pages\r
-\r
-\r
-\r
-          PURPOSE\r
-\r
-               The Map/Unmap Handle Page function maps a logical page at a\r
-               specific physical page anywhere in the mappable regions of\r
-               system memory.  The lowest valued physical page numbers are\r
-               associated with regions of memory outside the conventional\r
-               memory range.  Use Function 25 (Get Mappable Physical\r
-               Address Array) to determine which physical pages within a\r
-               system are mappable and determine the segment addresses\r
-               which correspond to a specific physical page number. \r
-               Function 25 provides a cross reference between physical page\r
-               numbers and segment addresses.\r
-\r
-               This function can also unmap physical pages, making them\r
-               inaccessible for reading or writing.  You unmap a physical\r
-               page by setting its associated logical page to FFFFh.\r
-\r
-               You might unmap an entire set of mapped pages, for example,\r
-               before loading and executing a program.  Doing so ensures\r
-               the loaded program, if it accesses expanded memory, won't\r
-               access the pages your program has mapped.  However, you must\r
-               save the mapped context before you unmap the physical pages. \r
-               This enables you to restore it later so you can access the\r
-               memory you mapped there.  To save the mapping context, use\r
-               Function 8, 15, or 16.  To restore the mapping context, use\r
-               Function 9, 15, or 16.\r
-\r
-               The handle determines what type of pages are being mapped. \r
-               Logical pages allocated by Function 4 and Function 27\r
-               (Allocate Standard Pages subfunction) are referred to as\r
-               pages and are 16K bytes long.  Logical pages allocated by\r
-               Function 27 (Allocate Raw Pages subfunction) are referred to\r
-               as raw pages and might not be the same size as logical\r
-               pages.\r
-\r
-\r
-          CALLING PARAMETERS\r
-\r
-               AH = 44h\r
-                   Contains the Map Handle Page function.\r
-\r
-               AL = physical_page_number\r
-                   Contains the number of the physical page into which the\r
-                   logical page number is to be mapped.  Physical pages are\r
-                   numbered zero-relative.\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                  46\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 5. Map/Unmap Handle Pages\r
-\r
-\r
-\r
-               BX = logical_page_number\r
-                   Contains the number of the logical page to be mapped at\r
-                   the physical page within the page frame.  Logical pages\r
-                   are numbered zero-relative.  The logical page must be in\r
-                   the range zero through (number of pages allocated to the\r
-                   EMM handle - 1).  However, if BX contains logical page\r
-                   number FFFFh, the physical page specified in AL will be\r
-                   unmapped (be made inaccessible for reading or writing).\r
-\r
-               DX = emm_handle\r
-                   Contains the EMM handle your program received from\r
-                   Function 4 (Allocate Pages).\r
-\r
-\r
-          REGISTERS MODIFIED\r
-\r
-               AX\r
-\r
-\r
-          STATUS\r
-\r
-               AH = 0   SUCCESSFUL.\r
-                   The manager has mapped the page.  The page is ready to\r
-                   be accessed.\r
-\r
-               AH = 80h   NON-RECOVERABLE.\r
-                   The manager detected a malfunction in the memory manager\r
-                   software.\r
-\r
-               AH = 81h   NON-RECOVERABLE.\r
-                   The manager detected a malfunction in the expanded\r
-                   memory hardware.\r
-\r
-               AH = 83h   NON-RECOVERABLE.\r
-                   The memory manager couldn't find the EMM handle your\r
-                   program specified.\r
-\r
-               AH = 84h   NON-RECOVERABLE.\r
-                   The function code passed to the memory manager isn't\r
-                   defined.\r
-\r
-               AH = 8Ah   RECOVERABLE.\r
-                   The logical page is out of the range of logical pages\r
-                   which are allocated to the EMM handle.  This status is\r
-                   also returned if a program attempts to map a logical\r
-                   page when no logical pages are allocated to the handle.\r
-\r
-\r
-\r
-          EMM Functions                                                  47\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 5. Map/Unmap Handle Pages\r
-\r
-\r
-\r
-               AH = 8Bh   RECOVERABLE.\r
-                   The physical page number is out of the range of allow-\r
-                   able physical pages.  The program can recover by\r
-                   attempting to map into memory at a physical page which\r
-                   is within the range of allowable physical pages.\r
-\r
-\r
-          EXAMPLE\r
-\r
-          emm_handle                     DW ?\r
-          logical_page_number            DW ?\r
-          physical_page_number           DB ?\r
-\r
-          MOV   DX,emm_handle            ; load EMM handle\r
-          MOV   BX,logical_page_number   ; load logical page number\r
-          MOV   AL,physical_page_number  ; load physical page number\r
-          MOV   AH,44h                   ; load function code\r
-          INT   67h                      ; call the memory manager\r
-          OR    AH,AH                    ; check EMM status\r
-          JNZ   emm_err_handler          ; jump to error handler on error\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                  48\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 6. Deallocate Pages\r
-\r
-\r
-\r
-          PURPOSE\r
-\r
-               Deallocate Pages deallocates the logical pages currently\r
-               allocated to an EMM handle.  Only after the application\r
-               deallocates these pages can other applications use them. \r
-               When a handle is deallocated, its name is set to all ASCII\r
-               nulls (binary zeros).\r
-\r
-          Note............................................................\r
-               A program must perform this function before it exits to DOS. \r
-               If it doesn't, no other programs can use these pages or the\r
-               EMM handle.  This means that a program using expanded memory\r
-               should trap critical errors and control-break if there is a\r
-               chance that the program will have allocated pages when\r
-               either of these events occur.\r
-\r
-\r
-          CALLING PARAMETERS\r
-\r
-               AH = 45h\r
-                   Contains the Deallocate Pages function.\r
-\r
-               DX = handle\r
-                   Contains the EMM handle returned by Function 4 (Allocate\r
-                   Pages).\r
-\r
-\r
-          REGISTERS MODIFIED\r
-\r
-               AX\r
-\r
-\r
-          STATUS\r
-\r
-               AH = 0   SUCCESSFUL.\r
-                   The manager has deallocated the pages previously allo-\r
-                   cated to the EMM handle.\r
-\r
-               AH = 80h   NON-RECOVERABLE.\r
-                   The manager detected a malfunction in the memory manager\r
-                   software.\r
-\r
-               AH = 81h   NON-RECOVERABLE.\r
-                   The manager detected a malfunction in the expanded\r
-                   memory hardware.\r
-\r
-               AH = 83h   NON-RECOVERABLE.\r
-                   The manager couldn't find the specified EMM handle.\r
-\r
-          EMM Functions                                                  49\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 6. Deallocate Pages\r
-\r
-\r
-\r
-               AH = 84h   NON-RECOVERABLE.\r
-                   The function code passed to the memory manager is not\r
-                   defined.\r
-\r
-               AH = 86h   RECOVERABLE.\r
-                   The memory manager detected a save or restore page\r
-                   mapping context error (Function 8 or 9).  There is a\r
-                   page mapping register state in the save area for the\r
-                   specified EMM handle.  Save Page Map (Function 8) placed\r
-                   it there and a subsequent Restore Page Map (Function 9)\r
-                   has not removed it.\r
-\r
-                   If you have saved the mapping context, you must restore\r
-                   it before you deallocate the EMM handle's pages.\r
-\r
-\r
-          EXAMPLE\r
-\r
-          emm_handle                     DW ?\r
-\r
-          MOV   DX,emm_handle            ; load EMM handle\r
-          MOV   AH,45h                   ; load function code\r
-          INT   67h                      ; call the memory manager\r
-          OR    AH,AH                    ; check EMM status\r
-          JNZ   emm_err_handler          ; jump to error handler on error\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                  50\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 7. Get Version\r
-\r
-\r
-\r
-          PURPOSE\r
-\r
-               The Get Version function returns the version number of the\r
-               memory manager software.\r
-\r
-\r
-          CALLING PARAMETERS\r
-\r
-               AH = 46h\r
-                   Contains the Get Version function.\r
-\r
-\r
-          RESULTS\r
-\r
-               These results are valid only if the status returned is zero.\r
-\r
-               AL = version number\r
-                   Contains the memory manager's version number in binary\r
-                   coded decimal (BCD) format.  The upper four bits contain\r
-                   the integer digit of the version number.  The lower four\r
-                   bits contain the fractional digit of version number. \r
-                   For example, version 4.0 is represented like this:\r
-\r
-                                      0100 0000\r
-                                        /   \\r
-                                       4  .  0\r
-\r
-                   When checking for a version number, an application\r
-                   should check for a version number or greater.  Vendors\r
-                   may use the fractional digit to indicate enhancements or\r
-                   corrections to their memory managers.  Therefore, to\r
-                   allow for future versions of memory managers, an\r
-                   application shouldn't depend on an exact version number.\r
-\r
-\r
-          REGISTERS MODIFIED\r
-\r
-               AX\r
-\r
-\r
-          STATUS\r
-\r
-               AH = 0   SUCCESSFUL.\r
-                   The manager is present in the system and the hardware is\r
-                   working correctly.\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                  51\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 7. Get Version\r
-\r
-\r
-\r
-               AH = 80h   NON-RECOVERABLE.\r
-                   The manager detected a malfunction in the memory manager\r
-                   software.\r
-\r
-               AH = 81h   NON-RECOVERABLE.\r
-                   The manager detected a malfunction in the expanded\r
-                   memory hardware.\r
-\r
-               AH = 84h   NON-RECOVERABLE.\r
-                   The function code passed to the memory manager is not\r
-                   defined.\r
-\r
-\r
-          EXAMPLE\r
-\r
-          emm_version                    DB ?\r
-\r
-          MOV   AH,46h                   ; load function code\r
-          INT   67h                      ; call the memory manager\r
-          OR    AH,AH                    ; check EMM status\r
-          JNZ   emm_err_handler          ; jump to error handler on error\r
-          MOV   emm_version,AL           ; save version number\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                  52\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 8. Save Page Map\r
-\r
-\r
-\r
-          PURPOSE\r
-\r
-               Save Page Map saves the contents of the page mapping\r
-               registers on all expanded memory boards in an internal save\r
-               area.  The function is typically used to save the memory\r
-               mapping context of the EMM handle that was active when a\r
-               software or hardware interrupt occurred.  (See Function 9,\r
-               Restore Page Map, for the restore operation.)\r
-\r
-               If you're writing a resident program, an interrupt service\r
-               routine, or a device driver that uses expanded memory, you\r
-               must save the state of the mapping hardware.  You must save\r
-               this state because application software using expanded\r
-               memory may be running when your program is invoked by a\r
-               hardware interrupt, a software interrupt, or DOS.\r
-\r
-               The Save Page Map function requires the EMM handle that was\r
-               assigned to your resident program, interrupt service\r
-               routine, or device driver at the time it was initialized. \r
-               This is not the EMM handle that the application software was\r
-               using when your software interrupted it.\r
-\r
-               The Save Page Map function saves the state of the map\r
-               registers for only the 64K-byte page frame defined in\r
-               versions 3.x of this specification.  Since all applications\r
-               written to LIM versions 3.x require saving the map register\r
-               state of only this 64K-byte page frame, saving the entire\r
-               mapping state for a large number of mappable pages would be\r
-               inefficient use of memory.  Applications that use a mappable\r
-               memory region outside the LIM 3.x page frame should use\r
-               Function 15 or 16 to save and restore the state of the map\r
-               registers.\r
-\r
-\r
-          CALLING PARAMETERS\r
-\r
-               AH = 47h\r
-                   Contains the Save Page Map function.\r
-\r
-               DX = handle\r
-                   Contains the EMM handle assigned to the interrupt\r
-                   service routine that's servicing the software or\r
-                   hardware interrupt.  The interrupt service routine needs\r
-                   to save the state of the page mapping hardware before\r
-                   mapping any pages.\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                  53\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 8. Save Page Map\r
-\r
-\r
-\r
-          REGISTERS MODIFIED\r
-\r
-               AX\r
-\r
-\r
-          STATUS\r
-\r
-               AH = 0   SUCCESSFUL.\r
-                   The manager has saved the state of the page mapping\r
-                   hardware.\r
-\r
-               AH = 80h   NON-RECOVERABLE.\r
-                   The manager detected a malfunction in the memory manager\r
-                   software.\r
-\r
-               AH = 81h   NON-RECOVERABLE.\r
-                   The manager detected a malfunction in the expanded\r
-                   memory hardware.\r
-\r
-               AH = 83h   NON-RECOVERABLE.\r
-                   The memory manager couldn't find the EMM handle your\r
-                   program specified.\r
-\r
-               AH = 84h   NON-RECOVERABLE.\r
-                   The function code passed to the memory manager is not\r
-                   defined.\r
-\r
-               AH = 8Ch   NON-RECOVERABLE.\r
-                   There is no room in the save area to store the state of\r
-                   the page mapping registers.  The state of the map\r
-                   registers has not been saved.\r
-\r
-               AH = 8Dh   CONDITIONALLY-RECOVERABLE.\r
-                   The save area already contains the page mapping register\r
-                   state for the EMM handle your program specified.\r
-\r
-\r
-          EXAMPLE\r
-\r
-          emm_handle                     DW ?\r
-\r
-          MOV   DX,emm_handle            ; load EMM handle\r
-          MOV   AH,47h                   ; load function code\r
-          INT   67h                      ; call the memory manager\r
-          OR    AH,AH                    ; check EMM status\r
-          JNZ   emm_err_handler          ; jump to error handler on error\r
-\r
-\r
-\r
-          EMM Functions                                                  54\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 9. Restore Page Map\r
-\r
-\r
-\r
-          PURPOSE\r
-\r
-               The Restore Page Map function restores the page mapping\r
-               register contents on the expanded memory boards for a\r
-               particular EMM handle.  This function lets your program\r
-               restore the contents of the mapping registers its EMM handle\r
-               saved.  (See Function 8, Save Page Map for the save opera-\r
-               tion.)\r
-\r
-               If you're writing a resident program, an interrupt service\r
-               routine, or a device driver that uses expanded memory, you\r
-               must restore the mapping hardware to the state it was in\r
-               before your program took over.  You must save this state\r
-               because application software using expanded memory might\r
-               have been running when your program was invoked.\r
-\r
-               The Restore Page Map function requires the EMM handle that\r
-               was assigned to your resident program, interrupt service\r
-               routine, or device driver at the time it was initialized. \r
-               This is not the EMM handle that the application software was\r
-               using when your software interrupted it.\r
-\r
-               The Restore Page Map function restores the state of the map\r
-               registers for only the 64K-byte page frame defined in\r
-               versions 3.x of this specification.  Since all applications\r
-               written to LIM versions 3.x require restoring the map\r
-               register state of only this 64K-byte page frame, restoring\r
-               the entire mapping state for a large number of mappable\r
-               pages would be inefficient use of memory.  Applications that\r
-               use a mappable memory region outside the LIM 3.x page frame\r
-               should use Function 15 or 16 to save and restore the state\r
-               of the map registers.\r
-\r
-\r
-          CALLING PARAMETERS\r
-\r
-               AH = 48h\r
-                   Contains the Restore Page Map function.\r
-\r
-               DX = emm_handle\r
-                   Contains the EMM handle assigned to the interrupt\r
-                   service routine that's servicing the software or\r
-                   hardware interrupt.  The interrupt service routine needs\r
-                   to restore the state of the page mapping hardware.\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                  55\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 9. Restore Page Map\r
-\r
-\r
-\r
-          REGISTERS MODIFIED\r
-\r
-               AX\r
-\r
-\r
-          STATUS\r
-\r
-               AH = 0   SUCCESSFUL.\r
-                   The manager has restored the state of the page mapping\r
-                   registers.\r
-\r
-               AH = 80h   NON-RECOVERABLE.\r
-                   The manager detected a malfunction in the memory manager\r
-                   software.\r
-\r
-               AH = 81h   NON-RECOVERABLE.\r
-                   The manager detected a malfunction in the expanded\r
-                   memory hardware.\r
-\r
-               AH = 83h   NON-RECOVERABLE.\r
-                   The memory manager couldn't find the EMM handle your\r
-                   program specified.\r
-\r
-               AH = 84h   NON-RECOVERABLE.\r
-                   The function code passed to the memory manager is not\r
-                   defined.\r
-\r
-               AH = 8Eh   CONDITIONALLY-RECOVERABLE.\r
-                   There is no page mapping register state in the save area\r
-                   for the specified EMM handle.  Your program didn't save\r
-                   the contents of the page mapping hardware, so Restore\r
-                   Page can't restore it.\r
-\r
-\r
-          EXAMPLE\r
-\r
-          emm_handle                     DW ?\r
-\r
-          MOV   DX,emm_handle            ; load EMM handle\r
-          MOV   AH,48h                   ; load function code\r
-          INT   67h                      ; call the memory manager\r
-          OR    AH,AH                    ; check EMM status\r
-          JNZ   emm_err_handler          ; jump to error handler on error\r
-\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                  56\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 10. Reserved\r
-\r
-\r
-\r
-               In earlier versions of the Lotus/Intel/Microsoft Expanded\r
-               Memory Specification, Function 10 returned the page mapping\r
-               register I/O array.  This function is now reserved and new\r
-               programs should not use it.\r
-\r
-               Existing programs that use this function may still work\r
-               correctly if the hardware is capable of supporting them. \r
-               However, programs that use Functions 16 through 30 in\r
-               Version 4.0 of this specification must not use Functions 10\r
-               and 11.  These functions won't work correctly if your\r
-               program attempts to mix the use of the new functions\r
-               (Functions 16 through 30) and Functions 10 and 11.  Func-\r
-               tions 10 and 11 are specific to the hardware on Intel\r
-               expanded memory boards and will not work correctly on all\r
-               vendors' expanded memory boards.\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                  57\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 11. Reserved\r
-\r
-\r
-\r
-               In earlier versions of the Lotus/Intel/Microsoft Expanded\r
-               Memory Specification, Function 11 returned a page transla-\r
-               tion array.  This function is now reserved and new programs\r
-               should not use it.\r
-\r
-               Existing programs that use this function may still work\r
-               correctly if the hardware is capable of supporting them. \r
-               However, programs that use Functions 16 through 30 in\r
-               Version 4.0 of this specification must not use Functions 10\r
-               and 11.  These functions won't work correctly if your\r
-               program attempts to mix the use of the new functions\r
-               (Functions 16 through 30) and Functions 10 and 11.  Func-\r
-               tions 10 and 11 are specific to the hardware on Intel\r
-               expanded memory boards and will not work correctly on all\r
-               vendors' expanded memory boards.\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                  58\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 12. Get Handle Count\r
-\r
-\r
-\r
-          PURPOSE\r
-\r
-               The Get Handle Count function returns the number of open EMM\r
-               handles (including the operating system handle 0) in the\r
-               system.\r
-\r
-\r
-          CALLING PARAMETERS\r
-\r
-               AH = 4Bh\r
-                   Contains the Get Handle Count function.\r
-\r
-\r
-          RESULTS\r
-\r
-               These results are valid only if the status returned is zero.\r
-\r
-               BX = total_open_emm_handles\r
-                   Contains the number of open EMM handles [including the\r
-                   operating system handle (0)].  This number will not\r
-                   exceed 255.\r
-\r
-\r
-          REGISTERS MODIFIED\r
-\r
-               AX, BX\r
-\r
-\r
-          STATUS\r
-\r
-               AH = 0   SUCCESSFUL.\r
-                   The manager has returned the number of active EMM\r
-                   handles.\r
-\r
-               AH = 80h   NON-RECOVERABLE.\r
-                   The manager detected a malfunction in the memory manager\r
-                   software.\r
-\r
-               AH = 81h   NON-RECOVERABLE.\r
-                   The manager detected a malfunction in the expanded\r
-                   memory hardware.\r
-\r
-               AH = 84h   NON-RECOVERABLE.\r
-                   The function code passed to the memory manager is not\r
-                   defined.\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                  59\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 12. Get Handle Count\r
-\r
-\r
-\r
-          EXAMPLE\r
-\r
-          total_open_emm_handles              DW ?\r
-\r
-          MOV   AH,4Bh                        ; load function code\r
-          INT   67h                           ; call the memory manger\r
-          OR    AH,AH                         ; check EMM status\r
-          JNZ   emm_err_handler               ; jump to error handler on   \r
-                                              ; error\r
-          MOV   total_open_emm_handles,BX     ; save total active handle   \r
-                                              ; count\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                  60\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 13. Get Handle Pages\r
-\r
-\r
-\r
-          PURPOSE\r
-\r
-               The Get Handle Pages function returns the number of pages\r
-               allocated to a specific EMM handle.\r
-\r
-\r
-          CALLING PARAMETERS\r
-\r
-               AH = 4Ch\r
-                   Contains the Get Handle Pages function.\r
-\r
-               DX = emm_handle\r
-                   Contains the EMM handle.\r
-\r
-\r
-          RESULTS\r
-\r
-               These results are valid only if the status returned is zero.\r
-\r
-               BX = num_pages_alloc_to_emm_handle\r
-                   Contains the number of logical pages allocated to the\r
-                   specified EMM handle.  This number never exceeds 2048\r
-                   because the memory manager allows a maximum of 2048\r
-                   pages (32M bytes) of expanded memory.\r
-\r
-\r
-          REGISTERS MODIFIED\r
-\r
-               AX, BX\r
-\r
-\r
-          STATUS\r
-\r
-               AH = 0   SUCCESSFUL.\r
-                   The manager has returned the number of pages allocated\r
-                   to the EMM handle.\r
-\r
-               AH = 80h   NON-RECOVERABLE.\r
-                   The manager detected a malfunction in the memory manager\r
-                   software.\r
-\r
-               AH = 81h   NON-RECOVERABLE.\r
-                   The manager detected a malfunction in the expanded\r
-                   memory hardware.\r
-\r
-               AH = 83h   NON-RECOVERABLE.\r
-                   The memory manager couldn't find the EMM handle your\r
-                   program specified.\r
-\r
-          EMM Functions                                                  61\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 13. Get Handle Pages\r
-\r
-\r
-\r
-               AH = 84h   NON-RECOVERABLE.\r
-                   The function code passed to the memory manager is not\r
-                   defined.\r
-\r
-\r
-          EXAMPLE\r
-\r
-          emm_handle                          DW ?\r
-          pages_alloc_to_handle               DW ?\r
-\r
-          MOV   DX,emm_handle                 ; load EMM handle\r
-          MOV   AH,4Ch                        ; load function code\r
-          INT   67h                           ; call the memory manager\r
-          OR    AH,AH                         ; check EMM status\r
-          JNZ   emm_err_handler               ; jump to error handler on   \r
-                                              ; error\r
-          MOV   pages_alloc_to_handle,BX      ; save number of pages       \r
-                                              ; allocated to specified     \r
-                                              ; handle\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                  62\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 14. Get All Handle Pages\r
-\r
-\r
-\r
-          PURPOSE\r
-\r
-               The Get All Handle Pages function returns an array of the\r
-               open EMM handles and the number of pages allocated to each\r
-               one.\r
-\r
-\r
-          CALLING PARAMETERS\r
-\r
-               AH = 4Dh\r
-                   Contains the Get All Handle Pages function.\r
-\r
-                   handle_page_struct              STRUC\r
-                       emm_handle                  DW ?\r
-                       pages_alloc_to_handle       DW ?\r
-                   handle_page_struct              ENDS\r
-\r
-               ES:DI = pointer to handle_page\r
-                   Contains a pointer to an array of structures where a\r
-                   copy of all open EMM handles and the number of pages\r
-                   allocated to each will be stored.  Each structure has\r
-                   these two members:\r
-\r
-                   .emm_handle\r
-                       The first member is a word which contains the value\r
-                       of the open EMM handle.  The values of the handles\r
-                       this function returns will be in the range of 0 to\r
-                       255 decimal (0000h to 00FFh).  The uppermost byte of\r
-                       the handle is always zero.\r
-\r
-                   .pages_alloc_to_handle\r
-                       The second member is a word which contains the\r
-                       number of pages allocated to the open EMM handle.\r
-\r
-\r
-          RESULTS\r
-\r
-               These results are valid only if the status returned is zero.\r
-\r
-               BX = total_open_emm_handles\r
-                   Contains the number of open EMM handles (including the\r
-                   operating system handle [0]).  The number cannot be zero\r
-                   because the operating system handle is always active and\r
-                   cannot be deallocated.  This number will not exceed 255.\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                  63\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 14. Get All Handle Pages\r
-\r
-\r
-\r
-          REGISTERS MODIFIED\r
-\r
-               AX, BX\r
-\r
-\r
-          STATUS\r
-\r
-               AH = 0   SUCCESSFUL.\r
-                   The manager has returned the array.\r
-\r
-               AH = 80h   NON-RECOVERABLE.\r
-                   The manager detected a malfunction in the memory manager\r
-                   software.\r
-\r
-               AH = 81h   NON-RECOVERABLE.\r
-                   The manager detected a malfunction in the expanded\r
-                   memory hardware.\r
-\r
-               AH = 84h   NON-RECOVERABLE.\r
-                   The function code passed to the memory manager is not\r
-                   defined.\r
-\r
-\r
-          EXAMPLE\r
-\r
-          handle_page                    handle_page_struct 255 DUP (?)\r
-          total_open_handles             DW ?\r
-\r
-          MOV   AX,SEG handle_page\r
-          MOV   ES,AX\r
-          LEA   DI,handle_page           ; ES:DI points to handle_page\r
-          MOV   AH,4Dh                   ; load function code\r
-          INT   67h                      ; call the memory manager\r
-          OR    AH,AH                    ; check the EMM status\r
-          JNZ   emm_err_handler          ; jump to error handler on error\r
-          MOV   total_open_handles,BX    ; save total open handle count\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                  64\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 15. Get/Set Page Map\r
-          Get Page Map subfunction\r
-\r
-\r
-\r
-          PURPOSE\r
-\r
-               The Get Page Map subfunction saves the mapping context for\r
-               all mappable memory regions (conventional and expanded) by\r
-               copying the contents of the mapping registers from each\r
-               expanded memory board to a destination array.  The applica-\r
-               tion must pass a pointer to the destination array.  This\r
-               subfunction doesn't require an EMM handle.\r
-\r
-               Use this function instead of Functions 8 and 9 if you need\r
-               to save or restore the mapping context but don't want (or\r
-               have) to use a handle.\r
-\r
-\r
-          CALLING PARAMETERS\r
-\r
-               AX = 4E00h\r
-                   Contains the Get Page Map subfunction.\r
-\r
-               ES:DI = dest_page_map\r
-                   Contains a pointer to the destination array address in\r
-                   segment:offset format.  Use the Get Size of Page Map\r
-                   Save Array subfunction to determine the size of the\r
-                   desired array.\r
-\r
-\r
-          RESULTS\r
-\r
-               These results are valid only if the status returned is zero.\r
-\r
-               dest_page_map\r
-                   The array contains the state of all the mapping regis-\r
-                   ters on all boards in the system.  It also contains any\r
-                   additional information necessary to restore the boards\r
-                   to their original state when the program invokes a Set\r
-                   subfunction.\r
-\r
-\r
-          REGISTERS MODIFIED\r
-\r
-               AX\r
-\r
-\r
-          STATUS\r
-\r
-               AH = 0   SUCCESSFUL.\r
-                   The manager has returned the array.\r
-\r
-          EMM Functions                                                  65\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 15. Get/Set Page Map\r
-          Get Page Map subfunction\r
-\r
-\r
-\r
-               AH = 80h   NON-RECOVERABLE.\r
-                   The manager detected a malfunction in the memory manager\r
-                   software.\r
-\r
-               AH = 81h   NON-RECOVERABLE.\r
-                   The manager detected a malfunction in the expanded\r
-                   memory hardware.\r
-\r
-               AH = 84h   NON-RECOVERABLE.\r
-                   The function code passed to the memory manager is not\r
-                   defined.\r
-\r
-               AH = 8Fh   NON-RECOVERABLE.\r
-                   The subfunction parameter is invalid.\r
-\r
-\r
-          EXAMPLE\r
-\r
-          dest_page_map                  DB ? DUP (?)\r
-\r
-          MOV   AX,SEG dest_page_map\r
-          MOV   ES,AX\r
-          LEA   DI,dest_page_map         ; ES:DI points to dest_page_map\r
-          MOV   AX,4E00h                 ; load function code\r
-          INT   67h                      ; call the memory manager\r
-          OR    AH,AH                    ; check EMM status\r
-          JNZ   emm_err_handler          ; jump to error handler on error\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                  66\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 15. Get/Set Page Map\r
-          Set Page Map subfunction\r
-\r
-\r
-\r
-          PURPOSE\r
-\r
-               The Set Page Map subfunction restores the mapping context\r
-               for all mappable memory regions (conventional and expanded)\r
-               by copying the contents of a source array into the mapping\r
-               registers on each expanded memory board in the system.  The\r
-               application must pass a pointer to the source array.  This\r
-               subfunction doesn't require an EMM handle.\r
-\r
-               Use this function instead of Functions 8 and 9 if you need\r
-               to save or restore the mapping context but don't want (or\r
-               have) to use a handle.\r
-\r
-\r
-          CALLING PARAMETERS\r
-\r
-               AX = 4E01h\r
-                   Contains the Set Page Map subfunction.\r
-\r
-               DS:SI = source_page_map\r
-                   Contains a pointer to the source array address in\r
-                   segment:offset format.  The application must point to an\r
-                   array which contains the mapping register state.  Use\r
-                   the Get Size of Page Map Save Array subfunction to\r
-                   determine the size of the desired array.\r
-\r
-\r
-          REGISTERS MODIFIED\r
-\r
-               AX\r
-\r
-\r
-          STATUS\r
-\r
-               AH = 0   SUCCESSFUL.\r
-                   The manager has passed the array.\r
-\r
-               AH = 80h   NON-RECOVERABLE.\r
-                   The manager detected a malfunction in the memory manager\r
-                   software.\r
-\r
-               AH = 81h   NON-RECOVERABLE.\r
-                   The manager detected a malfunction in the expanded\r
-                   memory hardware.\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                  67\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 15. Get/Set Page Map\r
-          Set Page Map subfunction\r
-\r
-\r
-\r
-               AH = 84h   NON-RECOVERABLE.\r
-                   The function code passed to the memory manager is not\r
-                   defined.\r
-\r
-               AH = 8Fh   NON-RECOVERABLE.\r
-                   The subfunction parameter is invalid.\r
-\r
-               AH = A3h   NON-RECOVERABLE.\r
-                   The contents of the source array have been corrupted, or\r
-                   the pointer passed to the subfunction is invalid.\r
-\r
-\r
-          EXAMPLE\r
-\r
-          source_page_map                DB ? DUP (?)\r
-\r
-          MOV   AX,SEG source_page_map\r
-          MOV   DS,AX\r
-          LEA   SI,source_page_map       ; DS:SI points to source_page_map\r
-          MOV   AX,4E01h                 ; load function code\r
-          INT   67h                      ; call the memory manager\r
-          OR    AH,AH                    ; check EMM status\r
-          JNZ   emm_err_handler          ; jump to error handler on error\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                  68\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 15. Get/Set Page Map\r
-          Get & Set Page Map subfunction\r
-\r
-\r
-\r
-          PURPOSE\r
-\r
-               The Get & Set Page Map subfunction simultaneously saves a\r
-               current mapping context and restores a previous mapping\r
-               context for all mappable memory regions (both conventional\r
-               and expanded).  It first copies the contents of the mapping\r
-               registers from each expanded memory board in the system into\r
-               a destination array.  (The application must pass a pointer\r
-               to the destination array.)  Then, the subfunction copies the\r
-               contents of a source array into the mapping registers on\r
-               each of the expanded memory boards.  (The application must\r
-               pass a pointer to the source array.)\r
-\r
-               Use this function instead of Functions 8 and 9 if you need\r
-               to save or restore the mapping context but don't want (or\r
-               have) to use a handle.\r
-\r
-\r
-          CALLING PARAMETERS\r
-\r
-               AX = 4E02h\r
-                   Contains the Get & Set Page Map subfunction.\r
-\r
-               ES:DI = dest_page_map\r
-                   Contains a pointer to the destination array address in\r
-                   segment:offset format.  The current contents of the map\r
-                   registers will be saved in this array.\r
-\r
-               DS:SI = source_page_map\r
-                   Contains a pointer to the source array address in\r
-                   segment:offset format.  The contents of this array will\r
-                   be copied into the map registers.  The application must\r
-                   point to an array which contains the mapping register\r
-                   state.  This address is required only for the Set or Get\r
-                   and Set subfunctions.\r
-\r
-\r
-          RESULTS\r
-\r
-               These results are valid only if the status returned is zero.\r
-\r
-               dest_page_map\r
-                   The array contains the mapping state.  It also contains\r
-                   any additional information necessary to restore the\r
-                   original state when the program invokes a Set subfunc-\r
-                   tion.\r
-\r
-\r
-          EMM Functions                                                  69\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 15. Get/Set Page Map\r
-          Get & Set Page Map subfunction\r
-\r
-\r
-\r
-          REGISTERS MODIFIED\r
-\r
-               AX\r
-\r
-\r
-          STATUS\r
-\r
-               AH = 0   SUCCESSFUL.\r
-                   The manager has returned and passed both arrays.\r
-\r
-               AH = 80h   NON-RECOVERABLE.\r
-                   The manager detected a malfunction in the memory manager\r
-                   software.\r
-\r
-               AH = 81h   NON-RECOVERABLE.\r
-                   The manager detected a malfunction in the expanded\r
-                   memory hardware.\r
-\r
-               AH = 84h   NON-RECOVERABLE.\r
-                   The function code passed to the memory manager is not\r
-                   defined.\r
-\r
-               AH = 8Fh   NON-RECOVERABLE.\r
-                   The subfunction parameter is invalid.\r
-\r
-               AH = A3h   NON-RECOVERABLE.\r
-                   The contents of the source array have been corrupted, or\r
-                   the pointer passed to the subfunction is invalid.\r
-\r
-\r
-          EXAMPLE\r
-\r
-          dest_page_map                  DB ? DUP (?)\r
-\r
-          source_page_map                DB ? DUP (?)\r
-\r
-          MOV   AX,SEG dest_page_map\r
-          MOV   ES,AX\r
-          MOV   AX,SEG source_page_map\r
-          MOV   DS,AX\r
-          LEA   DI,dest_page_map         ; ES:DI points to dest_page_map\r
-          LEA   SI,source_page_map       ; DS:SI points to source_page_map\r
-          MOV   AX,4E02h                 ; load function code\r
-          INT   67h                      ; call the memory manager\r
-          OR    AH,AH                    ; check EMM status\r
-          JNZ   emm_err_handler          ; jump to error handler on error\r
-\r
-\r
-          EMM Functions                                                  70\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 15. Get/Set Page Map\r
-          Get Size of Page Map Save Array subfunction\r
-\r
-\r
-\r
-          PURPOSE\r
-\r
-               The Get Size of Page Map Save Array subfunction returns the\r
-               storage requirements for the array passed by the other three\r
-               subfunctions.  This subfunction doesn't require an EMM\r
-               handle.\r
-\r
-\r
-          CALLING PARAMETERS\r
-\r
-               AX = 4E03h\r
-                   Contains the Get Size of Page Map Save Array subfunc-\r
-                   tion.  The size of this array depends on how the\r
-                   expanded memory system is configured and how the\r
-                   expanded memory manager is implemented.  Therefore, the\r
-                   size must be determined after the memory manager is\r
-                   loaded.\r
-\r
-\r
-          RESULTS\r
-\r
-               These results are valid only if the status returned is zero.\r
-\r
-               AL = size_of_array\r
-                   Contains the number of bytes that will be transferred to\r
-                   the memory area an application supplies whenever a\r
-                   program requests the Get, Set, or Get and Set subfunc-\r
-                   tions.\r
-\r
-\r
-          REGISTERS MODIFIED\r
-\r
-               AX\r
-\r
-\r
-          STATUS\r
-\r
-               AH = 0   SUCCESSFUL.\r
-                   The manager has returned the array size.\r
-\r
-               AH = 80h   NON-RECOVERABLE.\r
-                   The manager detected a malfunction in the memory manager\r
-                   software.\r
-\r
-               AH = 81h   NON-RECOVERABLE.\r
-                   The manager detected a malfunction in the expanded\r
-                   memory hardware.\r
-\r
-          EMM Functions                                                  71\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 15. Get/Set Page Map\r
-          Get Size of Page Map Save Array subfunction\r
-\r
-\r
-\r
-               AH = 84h   NON-RECOVERABLE.\r
-                   The function code passed to the memory manager is not\r
-                   defined.\r
-\r
-               AH = 8Fh   NON-RECOVERABLE.\r
-                   The subfunction parameter is invalid.\r
-\r
-\r
-          EXAMPLE\r
-\r
-          size_of_array                  DB ?\r
-\r
-          MOV   AX,4E03h                 ; load function code\r
-          INT   67h                      ; call the memory manager\r
-          OR    AH,AH                    ; check EMM status\r
-          JNZ   emm_err_handler          ; jump to error handler on error\r
-          MOV   size_of_array,AL         ; save array size\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                  72\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 16. Get/Set Partial Page Map\r
-          Get Partial Page Map subfunction\r
-\r
-\r
-\r
-          PURPOSE\r
-\r
-               The Get Partial Page Map subfunction saves a partial mapping\r
-               context for specific mappable memory regions in a system. \r
-               Because this function saves only a subset of the entire\r
-               mapping context, it uses much less memory for the save area\r
-               and may be potentially faster than Function 15.  The\r
-               subfunction does this by copying the contents of selected\r
-               mapping registers from each expanded memory board to a\r
-               destination array.\r
-\r
-               The application must pass a pair of pointers.  The first\r
-               points to a structure which specifies which mappable\r
-               segments to save; the second points to the destination\r
-               array.\r
-\r
-               Use this function instead of Functions 8 and 9 if you need\r
-               to save or restore the mapping context but don't want (or\r
-               have) to use a handle.\r
-\r
-\r
-          CALLING PARAMETERS\r
-\r
-               AX = 4F00h\r
-                   Contains the Get Partial Page Map subfunction.\r
-\r
-                   partial_page_map_struct         STRUC\r
-                       mappable_segment_count      DW ?\r
-                       mappable_segment            DW (?) DUP (?)\r
-                   partial_page_map_struct         ENDS\r
-\r
-               DS:SI = partial_page_map\r
-                   Contains a pointer to a structure which specifies only\r
-                   those mappable memory regions which are to have their\r
-                   mapping context saved.  The structure members are\r
-                   described below.\r
-\r
-                   .mappable_segment_count\r
-                       The first member is a word which specifies the\r
-                       number of members in the word array which immediate-\r
-                       ly follows it.  This number should not exceed the\r
-                       number of mappable segments in the system.\r
-\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                  73\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 16. Get/Set Partial Page Map\r
-          Get Partial Page Map subfunction\r
-\r
-\r
-\r
-                   .mappable_segment\r
-                       The second member is a word array which contains the\r
-                       segment addresses of the mappable memory regions\r
-                       whose mapping contexts are to be saved.  The segment\r
-                       address must be a mappable segment.  Use Function 25\r
-                       to determine which segments are mappable.\r
-\r
-               ES:DI = dest_array\r
-                   Contains a pointer to the destination array address in\r
-                   segment:offset format.  To determine the size of the\r
-                   required array, see the Get Size of Partial Page Map\r
-                   Save Array subfunction.\r
-\r
-\r
-          RESULTS\r
-\r
-               These results are valid only if the status returned is zero.\r
-\r
-               dest_array\r
-                   The array contains the partial mapping context and any\r
-                   additional information necessary to restore this context\r
-                   to its original state when the program invokes a Set\r
-                   subfunction.\r
-\r
-\r
-          REGISTERS MODIFIED\r
-\r
-               AX\r
-\r
-\r
-          STATUS\r
-\r
-               AH = 0   SUCCESSFUL.\r
-                   The manager has saved the partial map context.\r
-\r
-               AH = 80h   NON-RECOVERABLE.\r
-                   The manager detected a malfunction in the memory manager\r
-                   software.\r
-\r
-               AH = 81h   NON-RECOVERABLE.\r
-                   The manager detected a malfunction in the expanded\r
-                   memory hardware.\r
-\r
-               AH = 84h   NON-RECOVERABLE.\r
-                   The function code passed to the memory manager is not\r
-                   defined.\r
-\r
-\r
-          EMM Functions                                                  74\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 16. Get/Set Partial Page Map\r
-          Get Partial Page Map subfunction\r
-\r
-\r
-\r
-               AH = 8Bh   NON-RECOVERABLE.\r
-                   One of the specified segments is not a mappable segment.\r
-\r
-               AH = 8Fh   NON-RECOVERABLE.\r
-                   The subfunction parameter is invalid.\r
-\r
-               AH = A3h   NON-RECOVERABLE.\r
-                   The contents of the partial page map structure have been\r
-                   corrupted, the pointer passed to the subfunction is\r
-                   invalid, or the mappable_segment_count exceeds the\r
-                   number of mappable segments in the system.\r
-\r
-\r
-          EXAMPLE\r
-\r
-          partial_page_map               partial_page_map_struct <>\r
-\r
-          dest_array                     DB ? DUP (?)\r
-\r
-          MOV   AX,SEG partial_page_map\r
-          MOV   DS,AX\r
-          LEA   SI,partial_page_map      ; DS:SI points to partial_page_map\r
-          MOV   AX,SEG dest_array\r
-          MOV   ES,AX\r
-          LEA   DI,dest_array            ; ES:DI points to dest_array\r
-          MOV   AX,4F00h                 ; load function code\r
-          INT   67h                      ; call the memory manager\r
-          OR    AH,AH                    ; check EMM status\r
-          JNZ   emm_err_handler          ; jump to error handler on error\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                  75\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 16. Get/Set Partial Page Map\r
-          Set Partial Page Map subfunction\r
-\r
-\r
-\r
-          PURPOSE\r
-\r
-               The Set Partial Page Map subfunction provides a mechanism\r
-               for restoring the mapping context for a partial mapping\r
-               context for specific mappable memory regions in a system. \r
-               Because this function restores only a subset of the entire\r
-               mapping context and not the entire systems mapping context,\r
-               it uses much less memory for the save area and is potential-\r
-               ly faster than Function 15.  The subfunction does this by\r
-               copying the contents of the source array to selected mapping\r
-               registers on each expanded memory board.  The application\r
-               passes a pointer to the source array.\r
-\r
-               Use this function instead of Functions 8 and 9 if you need\r
-               to save or restore the mapping context but don't want (or\r
-               have) to use a handle.\r
-\r
-\r
-          CALLING PARAMETERS\r
-\r
-               AX = 4F01h\r
-                   Contains the Set Partial Page Map subfunction\r
-\r
-                           source_array     DB ? DUP (?)\r
-\r
-               DS:SI = source_array\r
-                   Contains a pointer to the source array in segment:offset\r
-                   format.  The application must point to an array which\r
-                   contains the partial mapping register state.  To deter-\r
-                   mine the size of the required array, see the Get Size of\r
-                   Partial Page Map Save Array subfunction.\r
-\r
-\r
-          REGISTERS MODIFIED\r
-\r
-               AX\r
-\r
-\r
-          STATUS\r
-\r
-               AH = 0   SUCCESSFUL.\r
-                   The manager has restored the partial mapping context.\r
-\r
-               AH = 80h   NON-RECOVERABLE.\r
-                   The manager detected a malfunction in the memory manager\r
-                   software.\r
-\r
-\r
-          EMM Functions                                                  76\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 16. Get/Set Partial Page Map\r
-          Set Partial Page Map subfunction\r
-\r
-\r
-\r
-               AH = 81h   NON-RECOVERABLE.\r
-                   The manager detected a malfunction in the expanded\r
-                   memory hardware.\r
-\r
-               AH = 84h   NON-RECOVERABLE.\r
-                   The function code passed to the memory manager is not\r
-                   defined.\r
-\r
-               AH = 8Fh   NON-RECOVERABLE.\r
-                   The subfunction parameter is invalid.\r
-\r
-               AH = A3h   NON-RECOVERABLE.\r
-                   The contents of the source array have been corrupted, or\r
-                   the pointer passed to the subfunction is invalid.\r
-\r
-\r
-          EXAMPLE\r
-\r
-          MOV   AX,SEG source_array\r
-          MOV   DS,AX\r
-          LEA   SI,source_array          ; DS:SI points to source_array\r
-          MOV   AX,4F01h                 ; load function code\r
-          INT   67h                      ; call the memory manager\r
-          OR    AH,AH                    ; check EMM status\r
-          JNZ   emm_err_handler          ; jump to error handler on error\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                  77\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 16. Get/Set Partial Page Map\r
-          Get Size of Partial Page Map Save Array subfunction\r
-\r
-\r
-\r
-          PURPOSE\r
-\r
-               The Get Size of Partial Page Map Save Array subfunction\r
-               returns the storage requirements for the array passed by the\r
-               other two subfunctions.  This subfunction doesn't require an\r
-               EMM handle.\r
-\r
-\r
-          CALLING PARAMETERS\r
-\r
-               AX = 4F02h\r
-                   Contains the Get Size of Partial Page Map Save Array\r
-                   subfunction.  The size of this array depends on the\r
-                   expanded memory system configuration and the implementa-\r
-                   tion of the expanded memory manager.  Therefore, it will\r
-                   vary between hardware configurations and implementations\r
-                   and must be determined after a specific memory manager\r
-                   is loaded.\r
-\r
-               BX = number of pages in the partial array\r
-                   Contains the number of pages in the partial map to be\r
-                   saved by the Get/Set Partial Page Map subfunctions. \r
-                   This number should be the same as the mappable_seg-\r
-                   ment_count in the Get Partial Page Map subfunction.\r
-\r
-\r
-          RESULTS\r
-\r
-               These results are valid only if the status returned is zero.\r
-\r
-               AL = size_of_partial_save_array\r
-                   Contains the number of bytes that will be transferred to\r
-                   the memory areas supplied by an application whenever a\r
-                   program requests the Get or Set subfunction.\r
-\r
-\r
-          REGISTERS MODIFIED\r
-\r
-               AX\r
-\r
-\r
-          STATUS\r
-\r
-               AH = 0   SUCCESSFUL.\r
-                   The manager has returned the array size.\r
-\r
-\r
-\r
-          EMM Functions                                                  78\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 16. Get/Set Partial Page Map\r
-          Get Size of Partial Page Map Save Array subfunction\r
-\r
-\r
-\r
-               AH = 80h   NON-RECOVERABLE.\r
-                   The manager detected a malfunction in the memory manager\r
-                   software.\r
-\r
-               AH = 81h   NON-RECOVERABLE.\r
-                   The manager detected a malfunction in the expanded\r
-                   memory hardware.\r
-\r
-               AH = 84h   NON-RECOVERABLE.\r
-                   The function code passed to the memory manager is not\r
-                   defined.\r
-\r
-               AH = 8Bh   NON-RECOVERABLE.\r
-                   The number of pages in the partial array is outside the\r
-                   range of physical pages in the system.\r
-\r
-               AH = 8Fh   NON-RECOVERABLE.\r
-                   The subfunction parameter is invalid.\r
-\r
-\r
-          EXAMPLE\r
-\r
-          number_of_pages_to_map              DW ?\r
-          size_of_partial_save_array          DB ?\r
-\r
-          MOV   BX,number_of_pages_to_map\r
-          MOV   AX,4F02h                      ; load function code\r
-          INT   67h                           ; call the memory manager\r
-          OR    AH,AH                         ; check EMM status\r
-          JNZ   emm_err_handler               ; jump to error handler on   \r
-                                              ; error\r
-          MOV   size_of_partial_save_array,AL ; save array size\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                  79\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 17. Map/Unmap Multiple Handle Pages\r
-\r
-\r
-\r
-          PURPOSE\r
-\r
-               This function can, in a single invocation, map (or unmap)\r
-               logical pages into as many physical pages as the system\r
-               supports.  Consequently, it has less execution overhead than\r
-               mapping pages one at a time.  For applications which do a\r
-               lot of page mapping, this is the preferred mapping method.\r
-\r
-\r
-          Mapping Multiple Pages\r
-\r
-               The handle passed to this function determines what type of\r
-               logical pages are being mapped.  Logical pages that Function\r
-               4 and Function 27 (Allocate Standard Pages subfunction)\r
-               allocate are referred to as pages and are 16K bytes. \r
-               Logical pages that Function 27 (Allocate Raw Pages subfunc-\r
-               tion) allocates are referred to as raw pages and might not\r
-               be the same size as the pages Function 4 and Function 27\r
-               (Allocate Standard Pages subfunction) allocate.\r
-\r
-\r
-          Unmapping Multiple Pages\r
-\r
-               This function can make specific physical pages unavailable\r
-               for reading or writing.  A logical page which is unmapped\r
-               from a specific physical page cannot be read or written from\r
-               that physical page.  The logical page which is unavailable\r
-               (unmapped) can be made available again by mapping it, or a\r
-               new logical page, at the physical page that was unmapped. \r
-               Unmapping a physical page is accomplished by setting the\r
-               logical page it is associated with to FFFFh.\r
-\r
-               You might unmap an entire set of mapped pages, for example,\r
-               before loading and executing a program.  This ensures that\r
-               the loaded program won't be able to access the pages your\r
-               program has mapped.  However, you must save the mapping\r
-               context before you unmap the physical pages.  This enables\r
-               you to restore it later so that you may access the memory\r
-               you had mapped there.  You can save the mapping context with\r
-               Functions 8, 15, or 16.  You can restore the mapping context\r
-               with Functions 9, 15, or 16.\r
-\r
-\r
-          Mapping and Unmapping Multiple Pages Simultaneously\r
-\r
-               Both mapping and unmapping pages can be done in the same\r
-               invocation.\r
-\r
-\r
-          EMM Functions                                                  80\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 17. Map/Unmap Multiple Handle Pages\r
-\r
-\r
-\r
-               Mapping or unmapping no pages is not considered an error. \r
-               If a request to map or unmap zero pages is made, nothing is\r
-               done and no error is returned.\r
-\r
-\r
-          Alternate Mapping and Unmapping Methods\r
-\r
-               You can map or unmap pages using two methods.  Both methods\r
-               produce identical results.\r
-\r
-               1.  The first method specifies both a logical page and a\r
-                   physical page at which the logical page is to be mapped. \r
-                   This method is an extension of Function 5 (Map Handle\r
-                   Page).\r
-\r
-               2.  The second method specifies both a logical page and a\r
-                   corresponding segment address at which the logical page\r
-                   is to be mapped.  While this is functionally the same as\r
-                   the first method, it may be easier to use the actual\r
-                   segment address of a physical page than to use a number\r
-                   which only represents its location.  The memory manager\r
-                   verifies whether the specified segment address falls on\r
-                   the boundary of a mappable physical page.  The manager\r
-                   then translates the segment address passed to it into\r
-                   the necessary internal representation to map the pages.\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                  81\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 17. Map/Unmap Multiple Handle Pages\r
-          Logical Page/Physical Page Method\r
-\r
-\r
-          CALLING PARAMETERS\r
-\r
-               AX = 5000h\r
-                   Contains the Map/Unmap Multiple Handle Pages subfunction\r
-                   using the logical page/physical page method.\r
-\r
-                   log_to_phys_map_struct          STRUC\r
-                       log_page_number             DW ?\r
-                       phys_page_number            DW ?\r
-                   log_to_phys_map_struct          ENDS\r
-\r
-               DX = handle\r
-                   Contains the EMM handle.\r
-\r
-               CX = log_to_phys_map_len\r
-                   Contains the number of entries in the array.  For\r
-                   example, if the array contained four pages to map or\r
-                   unmap, then CX would contain 4.  The number in CX should\r
-                   not exceed the number of mappable pages in the system.\r
-\r
-               DS:SI = pointer to log_to_phys_map array\r
-                   Contains a pointer to an array of structures that\r
-                   contains the information necessary to map the desired\r
-                   pages.  The array is made up of the following two\r
-                   elements:\r
-\r
-                   .log_page_number\r
-                       The first member is a word which contains the number\r
-                       of the logical page which is to be mapped.  Logical\r
-                       pages are numbered zero-relative, so the number for\r
-                       a logical page can only range from zero to (maximum\r
-                       number of logical pages allocated to the handle -\r
-                       1).\r
-\r
-                       If the logical page number is set to FFFFh, the\r
-                       physical page associated with it is unmapped rather\r
-                       than mapped.  Unmapping a physical page makes it\r
-                       inaccessible for reading or writing.\r
-\r
-                   .phys_page_number\r
-                       The second member is a word which contains the\r
-                       number of the physical page at which the logical\r
-                       page is to be mapped.  Physical pages are numbered\r
-                       zero-relative, so the number for a physical page can\r
-                       only range from zero to (maximum number of physical\r
-                       pages supported in the system - 1).\r
-\r
-\r
-\r
-          EMM Functions                                                  82\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 17. Map/Unmap Multiple Handle Pages\r
-          Logical Page/Physical Page Method\r
-\r
-\r
-\r
-          REGISTERS MODIFIED\r
-\r
-               AX\r
-\r
-\r
-          STATUS\r
-\r
-               AH = 0   SUCCESSFUL.\r
-                   The logical pages have been mapped, or unmapped, at the\r
-                   specified physical pages.\r
-\r
-               AH = 80h   NON-RECOVERABLE.\r
-                   The manager has detected a malfunction in the memory\r
-                   manager software.\r
-\r
-               AH = 81h   NON-RECOVERABLE.\r
-                   The manager has detected a malfunction in the expanded\r
-                   memory hardware.\r
-\r
-               AH = 83h   NON-RECOVERABLE.\r
-                   The manager couldn't find the specified EMM handle.  The\r
-                   manager doesn't currently have any information pertain-\r
-                   ing to the specified EMM handle.  The program has\r
-                   probably corrupted its EMM handle.\r
-\r
-               AH = 84h   NON-RECOVERABLE.\r
-                   The function code passed to the manager is not defined.\r
-\r
-               AH = 8Ah   RECOVERABLE.\r
-                   One or more of the mapped logical pages is out of the\r
-                   range of logical pages allocated to the EMM handle.  The\r
-                   program can recover by attempting to map a logical page\r
-                   which is within the bounds for the specified EMM handle. \r
-                   When this error occurs, the only pages mapped were the\r
-                   ones valid up to the point that the error occurred.\r
-\r
-               AH = 8Bh   RECOVERABLE.\r
-                   One or more of the physical pages is out of the range of\r
-                   mappable physical pages, or the log_to_phys_map_len\r
-                   exceeds the number of mappable pages in the system.  The\r
-                   program can recover from this condition by attempting to\r
-                   map into memory at the physical page which is in the\r
-                   range of the physical page numbers supported by the\r
-                   system.  When this error occurs, the only pages mapped\r
-                   were the ones valid up to the point that the error\r
-                   occurred.\r
-\r
-\r
-          EMM Functions                                                  83\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 17. Map/Unmap Multiple Handle Pages\r
-          Logical Page/Physical Page Method\r
-\r
-\r
-\r
-               AH = 8Fh   NON-RECOVERABLE.\r
-                   The subfunction parameter is invalid.\r
-\r
-\r
-          EXAMPLE\r
-\r
-          log_to_phys_map            log_to_phys_map_struct ? DUP (?)\r
-\r
-          emm_handle                 DW ?\r
-\r
-          MOV   AX,SEG log_to_phys_map\r
-          MOV   DS,AX\r
-          LEA   SI,log_to_phys_map            ; DS:SI points to\r
-                                              ; log_to_phys_map\r
-          MOV   CX,LENGTH log_to_phys_map     ; set length field\r
-          MOV   DX,emm_handle\r
-          MOV   AX,5000h                      ; load function code\r
-          INT   67h                           ; call the memory manager\r
-          OR    AH,AH                         ; check EMM status\r
-          JNZ   emm_err_handler               ; jump to error handler on   \r
-                                              ; error\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                  84\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 17. Map/Unmap Multiple Handle Pages\r
-          Logical Page/Segment Address Method\r
-\r
-\r
-          CALLING PARAMETERS\r
-\r
-               AX = 5001h\r
-                   Contains the Map/Unmap Multiple Handle Pages subfunction\r
-                   using the logical page/segment address method.\r
-\r
-                   log_to_seg_map_struct           STRUC\r
-                       log_page_number             DW ?\r
-                       mappable_segment_address    DW ?\r
-                   log_to_seg_map_struct           ENDS\r
-\r
-               DX = handle\r
-                   Contains the EMM handle.\r
-\r
-               CX = log_to_segment_map_len\r
-                   Contains the number of entries in the array.  For\r
-                   example, if the array contained four pages to map or\r
-                   unmap, then CX would contain four.\r
-\r
-               DS:SI = pointer to log_to_segment_map array\r
-                   Contains a pointer to an array of structures that\r
-                   contains the information necessary to map the desired\r
-                   pages.  The array is made up of the following elements:\r
-\r
-                   .log_page_number\r
-                       The first member is a word which contains the number\r
-                       of the logical pages to be mapped.  Logical pages\r
-                       are numbered zero-relative, so the number for a\r
-                       logical page can range from zero to (maximum number\r
-                       of logical pages allocated to the handle - 1).\r
-\r
-                       If the logical page number is set to FFFFh, the\r
-                       physical page associated with it is unmapped rather\r
-                       than mapped.  Unmapping a physical page makes it\r
-                       inaccessible for reading or writing.\r
-\r
-                   .mappable_segment_address\r
-                       The second member is a word which contains the\r
-                       segment address at which the logical page is to be\r
-                       mapped.  This segment address must correspond\r
-                       exactly to a mappable segment address.  The mappable\r
-                       segment addresses are available with Function 25\r
-                       (Get Mappable Physical Address Array).\r
-\r
-\r
-          REGISTERS MODIFIED\r
-\r
-               AX\r
-\r
-          EMM Functions                                                  85\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 17. Map/Unmap Multiple Handle Pages\r
-          Logical Page/Segment Address Method\r
-\r
-\r
-\r
-          STATUS\r
-\r
-               AH = 0   SUCCESSFUL.\r
-                   The logical pages have been mapped (or unmapped) at the\r
-                   specified physical pages.\r
-\r
-               AH = 80h   NON-RECOVERABLE.\r
-                   The manager has detected a malfunction in the memory\r
-                   manager software.\r
-\r
-               AH = 81h   NON-RECOVERABLE.\r
-                   The manager has detected a malfunction in the expanded\r
-                   memory hardware.\r
-\r
-               AH = 83h   NON-RECOVERABLE.\r
-                   The manager could not find the specified EMM handle. \r
-                   The manager doesn't currently have any information\r
-                   pertaining to the specified EMM handle.  The program has\r
-                   probably corrupted its EMM handle.\r
-\r
-               AH = 84h   NON-RECOVERABLE.\r
-                   The function code passed to the manager is not defined.\r
-\r
-               AH = 8Ah   RECOVERABLE.\r
-                   One or more of the logical pages to be mapped is out of\r
-                   the range of logical pages allocated to the EMM handle. \r
-                   The program can recover from this condition by mapping a\r
-                   logical page which is within the bounds for the speci-\r
-                   fied EMM handle.  When this error occurs, the only pages\r
-                   mapped or unmapped were the ones valid up to the point\r
-                   that the error occurred.\r
-\r
-               AH = 8Bh   RECOVERABLE.\r
-                   One or more of the mappable segment addresses specified\r
-                   is not mappable, the segment address doesn't fall\r
-                   exactly on a mappable address boundary, or the log_to_-\r
-                   segment_map_len exceeds the number of mappable segments\r
-                   in the system.  The program can recover from this\r
-                   condition by mapping into memory on an exact mappable\r
-                   segment address.  When this error occurs, the only pages\r
-                   mapped were the ones valid up to the point that the\r
-                   error occurred.\r
-\r
-               AH = 8Fh   NON-RECOVERABLE.\r
-                   The subfunction parameter is invalid.\r
-\r
-\r
-\r
-          EMM Functions                                                  86\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 17. Map/Unmap Multiple Handle Pages\r
-          Logical Page/Segment Address Method\r
-\r
-\r
-\r
-          EXAMPLE\r
-\r
-          log_to_seg_map             log_to_seg_map_struct 4 DUP (?)\r
-\r
-          emm_handle                 DW ?\r
-\r
-          MOV   AX,SEG log_to_seg_map\r
-          MOV   DS,AX\r
-          LEA   SI,log_to_seg_map             ; DS:SI points to\r
-                                              ; log_to_seg_map\r
-          MOV   CX,LENGTH log_to_seg_map\r
-          MOV   DX,emm_handle\r
-          MOV   AX,5001h                      ; load function code\r
-          INT   67h                           ; call the memory manager\r
-          OR    AH,AH                         ; check EMM status\r
-          JNZ   emm_err_handler               ; jump to error handler on   \r
-                                              ; error\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                  87\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 18. Reallocate Pages\r
-\r
-\r
-\r
-          PURPOSE\r
-\r
-               This function allows an application program to increase or\r
-               decrease (reallocate) the number of logical pages allocated\r
-               to an EMM handle.  There are four reallocation cases of\r
-               interest:\r
-\r
-               1.  A reallocation count of zero.  The handle assigned to\r
-                   the application remains assigned and is still available\r
-                   for use by the application.  The memory manager won't\r
-                   reassign the handle to any other application.  However,\r
-                   the handle will have any currently allocated pages\r
-                   returned to the memory manager.  The application must\r
-                   invoke the Deallocate Pages function (Function 6) before\r
-                   returning to DOS, or the handle will remain assigned and\r
-                   no other application will be able to use it.\r
-\r
-               2.  A reallocation count equal to the current allocation\r
-                   count.  This is not treated as an error, and a success-\r
-                   ful status is returned.\r
-\r
-               3.  A reallocation count greater than the current allocation\r
-                   count.  The memory manager will attempt to add new pages\r
-                   to those pages already allocated to the specified EMM\r
-                   handle.  The number of new pages added is the difference\r
-                   between the reallocation count and the current alloca-\r
-                   tion count.  The sequence of logical pages allocated to\r
-                   the EMM handle remains continuous after this operation. \r
-                   The newly allocated pages have logical page numbers\r
-                   which begin where the previously allocated pages ended,\r
-                   and continue in ascending sequence.\r
-\r
-               4.  A reallocation count less than the current allocation\r
-                   count.  The memory manager will attempt to subtract some\r
-                   of the currently allocated pages and return them to the\r
-                   memory manager.  The number of old pages subtracted is\r
-                   the difference between the current allocation count and\r
-                   the re-allocation count.  The pages are subtracted from\r
-                   the end of the sequence of pages currently allocated to\r
-                   the specified EMM handle.  The sequence of logical pages\r
-                   allocated to the EMM handle remains continuous after\r
-                   this operation.\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                  88\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 18. Reallocate Pages\r
-\r
-\r
-\r
-          The handle determines what type of logical pages are being\r
-          reallocated.  Logical pages which were originally allocated with\r
-          Function 4 or Function 27 (Allocate Standard Pages subfunction)\r
-          are called pages and are 16K bytes long.  Logical pages which\r
-          were allocated with Function 27 (Allocate Raw Pages subfunction)\r
-          are called raw pages and might not be the same size as pages\r
-          allocated with Function 4.\r
-\r
-\r
-          CALLING PARAMETERS\r
-\r
-               AH = 51h\r
-                   Contains the Reallocate Handle Pages function.\r
-\r
-               DX = handle\r
-                   Contains the EMM handle.\r
-\r
-               BX = reallocation_count\r
-                   Contains the total number of pages this handle should\r
-                   have allocated to it after this function is invoked.\r
-\r
-\r
-          RESULTS\r
-\r
-               BX = number of pages allocated to handle after reallocation\r
-                   Contains the number of pages now allocated to the EMM\r
-                   handle after the pages have been added or subtracted. \r
-                   If the status returned is not zero, the value in BX is\r
-                   equal to the number of pages allocated to the handle\r
-                   prior to the invocation of this function.  This informa-\r
-                   tion can be used to verify that the request generated\r
-                   the expected results.\r
-\r
-\r
-          REGISTERS MODIFIED\r
-\r
-               AX, BX\r
-\r
-\r
-          STATUS\r
-\r
-               AH = 0   SUCCESSFUL.\r
-                   The pages specified have been added to or subtracted\r
-                   from the handle specified.\r
-\r
-               AH = 80h   NON-RECOVERABLE.\r
-                   The manager has detected a malfunction in the memory\r
-                   manager software.\r
-\r
-          EMM Functions                                                  89\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 18. Reallocate Pages\r
-\r
-\r
-\r
-               AH = 81h   NON-RECOVERABLE.\r
-                   The manager has detected a malfunction in the expanded\r
-                   memory hardware.\r
-\r
-               AH = 83h   NON-RECOVERABLE.\r
-                   The manager could not find the specified EMM handle. \r
-                   The manager doesn't have any information pertaining to\r
-                   the specified EMM handle.  The program may have cor-\r
-                   rupted its EMM handle.\r
-\r
-               AH = 84h   NON-RECOVERABLE.\r
-                   The function code passed to the manager is not defined.\r
-\r
-               AH = 87h   RECOVERABLE.\r
-                   The number of pages that are available in the system is\r
-                   insufficient for the new allocation request.  The\r
-                   program can recover from this condition by specifying\r
-                   fewer pages be allocated to the EMM handle.\r
-\r
-               AH = 88h   RECOVERABLE.\r
-                   The number of unallocated pages is insufficient for the\r
-                   new allocation request.  The program can recover from\r
-                   this condition by either requesting again when addition-\r
-                   al pages are available or specifying fewer pages.\r
-\r
-\r
-          EXAMPLE\r
-\r
-          emm_handle                          DW ?\r
-          realloc_count                       DW ?\r
-          current_alloc_page_count            DW ?\r
-\r
-          MOV   DX,emm_handle                 ; specify EMM handle\r
-          MOV   BX,realloc_count              ; specify count\r
-          MOV   AH,51h                        ; load function code\r
-          INT   67h                           ; call the memory manager\r
-          OR    AH,AH                         ; check EMM status\r
-          JNZ   emm_err_handler               ; jump to error handler on   \r
-                                              ; error\r
-          MOV   current_alloc_page_count,BX\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                  90\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 19. Get/Set Handle Attribute\r
-\r
-\r
-\r
-          Design Considerations\r
-\r
-               This function is an option which will probably not be\r
-               available in a typical expanded memory manager, system, or\r
-               memory board.  Most personal computer systems disable memory\r
-               refresh signals for a considerable period during a warm\r
-               boot.  This can corrupt some of the data in memory boards,\r
-               even though there is no problem with the design of the\r
-               memory board, its operation, or the memory chips.  This\r
-               memory refresh deficiency is present in the software design\r
-               of the ROM BIOS in most personal computer systems.\r
-\r
-               The majority of memory board designs, chip types, or\r
-               personal computer systems won't be able to support the non-\r
-               volatility feature.  The reason that this ROM BIOS deficien-\r
-               cy is not evident in the conventional or extended memory\r
-               area is that the ROM BIOS always initializes this area\r
-               during a warm boot.  Memory data integrity is not a problem\r
-               with the conventional or extended memory region, because it\r
-               isn't physically possible to have data retained there across\r
-               a warm boot event -- the ROM BIOS sets it to zero.\r
-\r
-               Consequently, expanded memory board manufacturers should not\r
-               supply this function unless their board can guarantee the\r
-               integrity of data stored in the board's memory during a warm\r
-               boot.  Generally, this means the memory board has an\r
-               independent memory refresh controller which does not depend\r
-               on the system board's memory refresh.\r
-\r
-               If the expanded memory manager, system, or memory board\r
-               cannot support this feature, it should return the not\r
-               supported status described in the function.\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                  91\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 19. Get/Set Handle Attribute\r
-          Get Handle Attribute subfunction\r
-\r
-\r
-\r
-          PURPOSE\r
-\r
-               This subfunction returns the attribute associated with a\r
-               handle.  The attributes are volatile or non-volatile. \r
-               Handles with non-volatile attributes enable the memory\r
-               manager to save the contents of a handle's pages between\r
-               warm boots.  However, this function may be disabled with a\r
-               user option or may not be supported by the memory board or\r
-               system hardware.\r
-\r
-               If the handle's attribute has been set to non-volatile, the\r
-               handle, its name (if it is assigned one), and the contents\r
-               of the pages allocated to the handle are all maintained\r
-               after a warm boot.\r
-\r
-\r
-          CALLING PARAMETERS\r
-\r
-               AX = 5200h\r
-                   Contains the Get Handle Attribute subfunction.\r
-\r
-               DX = handle\r
-                   Contains the EMM handle.\r
-\r
-\r
-          RESULTS\r
-\r
-               These results are valid only if the status returned is zero.\r
-\r
-               AL = handle attribute\r
-                   Contains the EMM handle's attribute.  The only at-\r
-                   tributes a handle may have are volatile or non-volatile. \r
-                   A value of zero indicates the handle is volatile.  A\r
-                   value of one indicates that the handle is non-volatile.\r
-\r
-\r
-          REGISTERS MODIFIED\r
-\r
-               AX\r
-\r
-\r
-          STATUS\r
-\r
-               AH = 0   SUCCESSFUL.\r
-                   The handle's attribute has been obtained.\r
-\r
-\r
-\r
-          EMM Functions                                                  92\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 19. Get/Set Handle Attribute\r
-          Get Handle Attribute subfunction\r
-\r
-\r
-\r
-               AH = 80h   NON-RECOVERABLE.\r
-                   The manager has detected a malfunction in the memory\r
-                   manager software.\r
-\r
-               AH = 81h   NON-RECOVERABLE.\r
-                   The manager has detected a malfunction in the expanded\r
-                   memory hardware.\r
-\r
-               AH = 83h   NON-RECOVERABLE.\r
-                   The manager couldn't find the specified EMM handle.  The\r
-                   manager doesn't have any information pertaining to the\r
-                   specified EMM handle.  The program may have corrupted\r
-                   its EMM handle.\r
-\r
-               AH = 84h   NON-RECOVERABLE.\r
-                   The function code passed to the manager is not defined.\r
-\r
-               AH = 8Fh   NON-RECOVERABLE.\r
-                   The subfunction parameter is invalid.\r
-\r
-               AH = 91h   NON-RECOVERABLE.\r
-                   This feature is not supported.\r
-\r
-\r
-          EXAMPLE\r
-\r
-          emm_handle                     DW ?\r
-          handle_attrib                  DB ?\r
-\r
-          MOV   DX,emm_handle            ; specify EMM handle\r
-          MOV   AX,5200h                 ; load function code\r
-          INT   67h                      ; call the memory manager\r
-          OR    AH,AH                    ; check EMM status\r
-          JNZ   emm_err_handler          ; jump to error handler on error\r
-          MOV   handle_attrib,AL         ; save handle attribute\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                  93\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 19. Get/Set Handle Attribute\r
-          Set Handle Attribute subfunction\r
-\r
-\r
-\r
-          PURPOSE\r
-\r
-               This subfunction can be used to modify the attribute which a\r
-               handle has associated with it.  The attributes which a\r
-               handle may have are volatile or non-volatile.  The non-\r
-               volatile attribute enables the EMM to save the contents of a\r
-               handle's pages between warm boots.  However, this function\r
-               may be disabled with a user option or may not be supported\r
-               by the memory board or system hardware.\r
-\r
-               If the handle's attribute has been set to non-volatile, the\r
-               handle, its name (if it is assigned one), and the contents\r
-               of the pages allocated to the handle are all maintained\r
-               after a warm boot.\r
-\r
-\r
-          CALLING PARAMETERS\r
-\r
-               AX = 5201h\r
-                   Contains the Set Handle Attribute function.\r
-\r
-               DX = handle\r
-                   Contains the EMM handle.\r
-\r
-               BL = new handle attribute\r
-                   Contains the handle's new attribute.  A value of zero\r
-                   indicates that the handle should be made volatile.  A\r
-                   value of one indicates that the handle should be made\r
-                   non-volatile.\r
-\r
-                   A volatile handle attribute instructs the memory manager\r
-                   to deallocate both the handle and the pages allocated to\r
-                   it after a warm boot.  If all handles have the volatile\r
-                   attribute (the default attribute) at warm boot, the\r
-                   handle directory will be empty and all of expanded\r
-                   memory will be initialized to zero immediately after a\r
-                   warm boot.\r
-\r
-\r
-          REGISTERS MODIFIED\r
-\r
-               AX\r
-\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                  94\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 19. Get/Set Handle Attribute\r
-          Set Handle Attribute subfunction\r
-\r
-\r
-\r
-          STATUS\r
-\r
-               AH = 0   SUCCESSFUL.\r
-                   The handle's attribute has been modified.\r
-\r
-               AH = 80h   NON-RECOVERABLE.\r
-                   The manager has detected a malfunction in the memory\r
-                   manager software.\r
-\r
-               AH = 81h   NON-RECOVERABLE.\r
-                   The manager has detected a malfunction in the expanded\r
-                   memory hardware.\r
-\r
-               AH = 83h   NON-RECOVERABLE.\r
-                   The manager could not find the specified EMM handle. \r
-                   The manager doesn't have any information pertaining to\r
-                   the specified EMM handle.  The program may have cor-\r
-                   rupted its EMM handle.\r
-\r
-               AH = 84h   NON-RECOVERABLE.\r
-                   The function code passed to the manager is not defined.\r
-\r
-               AH = 8Fh   NON-RECOVERABLE.\r
-                   The subfunction parameter is invalid.\r
-\r
-               AH = 90h   NON-RECOVERABLE.\r
-                   The attribute type is undefined.\r
-\r
-               AH = 91h   NON-RECOVERABLE.\r
-                   This feature is not supported.\r
-\r
-\r
-          EXAMPLE\r
-\r
-          emm_handle                     DW ?\r
-          new_handle_attrib              DB ?\r
-\r
-          MOV   DX,emm_handle            ; specify EMM handle\r
-          MOV   BL,new_handle_attrib     ; specify the set attribute\r
-          MOV   AX,5201h                 ; load function code\r
-          INT   67h                      ; call the memory manager\r
-          OR    AH,AH                    ; check EMM status\r
-          JNZ   emm_err_handler          ; jump to error handler on error\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                  95\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 19. Get/Set Handle Attribute\r
-          Get Attribute Capability subfunction\r
-\r
-\r
-\r
-          PURPOSE\r
-\r
-               This subfunction can be used to determine whether the memory\r
-               manager can support the non-volatile attribute.\r
-\r
-\r
-          CALLING PARAMETERS\r
-\r
-               AX = 5202h\r
-                   Contains the Get Attribute Capability subfunction.\r
-\r
-\r
-          RESULTS\r
-\r
-               These results are valid only if the status returned is zero.\r
-\r
-               AL = attribute capability\r
-                   Contains the attribute capability.  A value of zero\r
-                   indicates that the memory manager and hardware supports\r
-                   only volatile handles.  A value of one indicates that\r
-                   the memory manager/hardware supports both volatile and\r
-                   non-volatile handles.\r
-\r
-\r
-          REGISTERS MODIFIED\r
-\r
-               AX\r
-\r
-\r
-          STATUS\r
-\r
-               AH = 0   SUCCESSFUL.\r
-                   The attribute capability has been returned.\r
-\r
-               AH = 80h   NON-RECOVERABLE.\r
-                   The manager has detected a malfunction in the memory\r
-                   manager software.\r
-\r
-               AH = 81h   NON-RECOVERABLE.\r
-                   The manager has detected a malfunction in the expanded\r
-                   memory hardware.\r
-\r
-               AH = 84h   NON-RECOVERABLE.\r
-                   The function code passed to the manager is not defined.\r
-\r
-               AH = 8Fh   NON-RECOVERABLE.\r
-                   The subfunction parameter is invalid.\r
-\r
-          EMM Functions                                                  96\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 19. Get/Set Handle Attribute\r
-          Get Attribute Capability subfunction\r
-\r
-\r
-\r
-          EXAMPLE\r
-\r
-          attrib_capability              DB ?\r
-\r
-          MOV   AX,5202h                 ; load function code\r
-          INT   67h                      ; call the memory manager\r
-          OR    AH,AH                    ; check EMM status\r
-          JNZ   emm_err_handler          ; jump to error handler on error\r
-          MOV   attrib_capability,AL     ; save attribute capability\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                  97\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 20. Get/Set Handle Name\r
-          Get Handle Name subfunction\r
-\r
-\r
-\r
-          PURPOSE\r
-\r
-               This subfunction gets the eight character name currently\r
-               assigned to a handle.  There is no restriction on the\r
-               characters which may be used in the handle name (that is,\r
-               anything from 00h through FFh).\r
-\r
-               The handle name is initialized to ASCII nulls (binary zeros)\r
-               three times:  when the memory manager is installed, when a\r
-               handle is allocated, and when a handle is deallocated.  A\r
-               handle with a name which is all ASCII nulls, by definition,\r
-               has no name.  When a handle is assigned a name, at least one\r
-               character in the name must be a non-null character in order\r
-               to distinguish it from a handle without a name.\r
-\r
-\r
-          CALLING PARAMETERS\r
-\r
-               AX = 5300h\r
-                   Contains the Get Handle Name function.\r
-\r
-               DX = handle number\r
-                   Contains the EMM handle.\r
-\r
-               ES:DI = pointer to handle_name array\r
-                   Contains a pointer to an eight-byte array into which the\r
-                   name currently assigned to the handle will be copied.\r
-\r
-\r
-          RESULTS\r
-\r
-               These results are valid only if the status returned is zero.\r
-\r
-               handle_name array\r
-                   Contains the name associated with the specified handle.\r
-\r
-\r
-          REGISTERS MODIFIED\r
-\r
-               AX\r
-\r
-\r
-          STATUS\r
-\r
-               AH = 0   SUCCESSFUL.\r
-                   The handle name has been returned.\r
-\r
-\r
-          EMM Functions                                                  98\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 20. Get/Set Handle Name\r
-          Get Handle Name subfunction\r
-\r
-\r
-\r
-               AH = 80h   NON-RECOVERABLE.\r
-                   The manager has detected a malfunction in the memory\r
-                   manager software.\r
-\r
-               AH = 81h   NON-RECOVERABLE.\r
-                   The manager has detected a malfunction in the expanded\r
-                   memory hardware.\r
-\r
-               AH = 83h   NON-RECOVERABLE.\r
-                   The manager couldn't find the specified EMM handle.  The\r
-                   manager doesn't have any information on the specified\r
-                   EMM handle.  The program may have corrupted its EMM\r
-                   handle.\r
-\r
-               AH = 84h   NON-RECOVERABLE.\r
-                   The function code passed to the manager is not defined.\r
-\r
-               AH = 8Fh   NON-RECOVERABLE.\r
-                   The subfunction parameter is invalid.\r
-\r
-\r
-          EXAMPLE\r
-\r
-          handle_name                    DB 8 DUP (?)\r
-          emm_handle                     DW ?\r
-\r
-          MOV   AX,SEG handle_name\r
-          MOV   ES,AX\r
-          LEA   DI,handle_name           ; ES:DI points to handle_name\r
-          MOV   DX,emm_handle            ; specify EMM handle\r
-          MOV   AX,5300h                 ; load function code\r
-          INT   67h                      ; call the memory manager\r
-          OR    AH,AH                    ; check EMM status\r
-          JNZ   emm_err_handler          ; jump to error handler on error\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                  99\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 20. Get/Set Handle Name\r
-          Set Handle Name subfunction\r
-\r
-\r
-\r
-          PURPOSE\r
-\r
-               This subfunction assigns an eight character name to a\r
-               handle.  There is no restriction on the characters which may\r
-               be used in the handle name.  The full range of values may be\r
-               assigned to each character in a name (that is, 00h through\r
-               FFh).\r
-\r
-               At installation, all handles have their name initialized to\r
-               ASCII nulls (binary zeros).  A handle with a name consisting\r
-               of all ASCII nulls has no name.  When a handle is assigned a\r
-               name, at least one character in the name must be a non-null\r
-               character in order to distinguish it from a handle without a\r
-               name.  No two handles may have the same name.\r
-\r
-               A handle can be renamed at any time by setting the handle's\r
-               name to a new value.  A handle can have its name removed by\r
-               setting the handle's name to all ASCII nulls.  When a handle\r
-               is deallocated, its name is removed (set to ASCII nulls).\r
-\r
-\r
-          CALLING PARAMETERS\r
-\r
-               AX = 5301h\r
-                   Contains the Set Handle Name function.\r
-\r
-               DX = handle number\r
-                   Contains the EMM handle.\r
-\r
-               DS:SI = pointer to handle_name\r
-                   Contains a pointer to a byte array which contains the\r
-                   name that is to be assigned to the handle.  The handle\r
-                   name must be padded with nulls if the name is less than\r
-                   eight characters long.\r
-\r
-\r
-          REGISTERS MODIFIED\r
-\r
-               AX\r
-\r
-\r
-          STATUS\r
-\r
-               AH = 0   SUCCESSFUL.\r
-                   The handle name has been assigned.\r
-\r
-\r
-\r
-          EMM Functions                                                 100\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 20. Get/Set Handle Name\r
-          Set Handle Name subfunction\r
-\r
-\r
-\r
-               AH = 80h   NON-RECOVERABLE.\r
-                   The manager has detected a malfunction in the memory\r
-                   manager software.\r
-\r
-               AH = 81h   NON-RECOVERABLE.\r
-                   The manager has detected a malfunction in the expanded\r
-                   memory hardware.\r
-\r
-               AH = 83h   NON-RECOVERABLE.\r
-                   The manager couldn't find the specified EMM handle.  The\r
-                   manager doesn't currently have any information pertain-\r
-                   ing to the specified EMM handle.  The program may have\r
-                   corrupted its EMM handle.\r
-\r
-               AH = 84h   NON-RECOVERABLE.\r
-                   The function code passed to the manager is not defined.\r
-\r
-               AH = 8Fh   NON-RECOVERABLE.\r
-                   The subfunction parameter is invalid.\r
-\r
-               AH = A1h   RECOVERABLE.\r
-                   A handle with this name already exists.  The specified\r
-                   handle was not assigned a name.\r
-\r
-\r
-          EXAMPLE\r
-\r
-          handle_name                    DB 'AARDVARK'\r
-          emm_handle                     DW ?\r
-\r
-          MOV   AX,SEG handle_name\r
-          MOV   DS,AX\r
-          LEA   SI,handle_name           ; DS:SI points to handle_name\r
-          MOV   DX,emm_handle            ; specify EMM handle\r
-          MOV   AX,5301h                 ; load function code\r
-          INT   67h                      ; call the memory manager\r
-          OR    AH,AH                    ; check EMM status\r
-          JNZ   emm_err_handler          ; jump to error handler on error\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                 101\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 21. Get Handle Directory\r
-          Get Handle Directory subfunction\r
-\r
-\r
-\r
-          PURPOSE\r
-\r
-               This function returns an array which contains all active\r
-               handles and the names associated with each.  Handles which\r
-               have not been assigned names have a default name of all\r
-               ASCII nulls (binary zeros).  When a handle is first allo-\r
-               cated, or when all the pages belonging to a handle are\r
-               deallocated (that is, an open handle is closed), its default\r
-               name is set to ASCII nulls.  It takes a subsequent assign-\r
-               ment of a name for a handle to have a name after it has been\r
-               opened.  The full range of values may be assigned to each\r
-               character in a name (that is, 00h through FFh).\r
-\r
-               The number of bytes required by the array is:\r
-\r
-                           10 bytes * total number of handles\r
-\r
-               The maximum size of this array is:\r
-\r
-                           (10 bytes/entry) * 255 entries = 2550 bytes.\r
-\r
-\r
-          CALLING PARAMETERS\r
-\r
-               AX = 5400h\r
-                   Contains the Get Handle Directory function.\r
-\r
-                   handle_dir_struct               STRUC\r
-                       handle_value                DW ?\r
-                       handle_name                 DB 8 DUP (?)\r
-                   handle_dir_struct               ENDS\r
-\r
-               ES:DI = pointer to handle_dir\r
-                   Contains a pointer to an area of memory into which the\r
-                   memory manager will copy the handle directory.  The\r
-                   handle directory is an array of structures.  There are\r
-                   as many entries in the array as there are open EMM\r
-                   handles.  The structure consists of the following\r
-                   elements:\r
-\r
-                   .handle_value\r
-                       The first member is a word which contains the value\r
-                       of the open EMM handle.\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                 102\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 21. Get Handle Directory\r
-          Get Handle Directory subfunction\r
-\r
-\r
-\r
-                   .handle_name\r
-                       The second member is an 8 byte array which contains\r
-                       the ASCII name associated with the EMM handle.  If\r
-                       there is no name currently associated with the\r
-                       handle, it has a value of all zeros (ASCII nulls).\r
-\r
-\r
-          RESULTS\r
-\r
-               These results are valid only if the status returned is zero.\r
-\r
-               handle_dir\r
-                   Contains the handle values and handle names associated\r
-                   with each handle value.\r
-\r
-               AL = number of entries in the handle_dir array\r
-                   Contains the number of entries in the handle directory\r
-                   array.  This is also the same as the number of open\r
-                   handles.  For example, if only one handle is active, AL\r
-                   will contain a one.\r
-\r
-\r
-          REGISTERS MODIFIED\r
-\r
-               AX\r
-\r
-\r
-          STATUS\r
-\r
-               AH = 0   SUCCESSFUL.\r
-                   The handle directory has been returned.\r
-\r
-               AH = 80h   NON-RECOVERABLE.\r
-                   The manager has detected a malfunction in the memory\r
-                   manager software.\r
-\r
-               AH = 81h   NON-RECOVERABLE.\r
-                   The manager has detected a malfunction in the expanded\r
-                   memory hardware.\r
-\r
-               AH = 84h   NON-RECOVERABLE.\r
-                   The function code passed to the manager is not defined.\r
-\r
-               AH = 8Fh   NON-RECOVERABLE.\r
-                   The subfunction parameter is invalid.\r
-\r
-\r
-\r
-          EMM Functions                                                 103\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 21. Get Handle Directory\r
-          Get Handle Directory subfunction\r
-\r
-\r
-\r
-          EXAMPLE\r
-\r
-          handle_dir                    handle_dir_struct 255 DUP (?)\r
-\r
-          num_entries_in_handle_dir     DB ?\r
-\r
-          MOV   AX,SEG handle_dir\r
-          MOV   ES,AX\r
-          LEA   DI,handle_dir                 ; ES:DI points to handle_dir\r
-          MOV   AX,5400h                      ; load function code\r
-          INT   67h                           ; call the memory manager\r
-          OR    AH,AH                         ; check EMM status\r
-          JNZ   emm_err_handler               ; jump to error handler on   \r
-                                              ; error\r
-          MOV   num_entries_in_handle_dir,AL  ; save number of entries\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                 104\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 21. Get Handle Directory\r
-          Search For Named Handle subfunction\r
-\r
-\r
-\r
-          PURPOSE\r
-\r
-               This subfunction searches the handle name directory for a\r
-               handle with a particular name.  If the named handle is\r
-               found, this subfunction returns the handle number associated\r
-               with the name.  At the time of installation, all handles\r
-               have their names initialized to ASCII nulls.  A handle with\r
-               a name which is all ASCII nulls has, by definition, no name. \r
-               When a handle is assigned a name, at least one character in\r
-               the name must be a non-null character in order to distin-\r
-               guish it from a handle without a name.\r
-\r
-\r
-          CALLING PARAMETERS\r
-\r
-               AX = 5401h\r
-                   Contains the Search for Named Handle subfunction.\r
-\r
-               DS:SI = handle_name\r
-                   Contains a pointer to an 8-byte string that contains the\r
-                   name of the handle being searched for.\r
-\r
-\r
-          RESULTS\r
-\r
-               These results are valid only if the status returned is zero.\r
-\r
-               DX = value of named handle\r
-                   The value of the handle which matches the handle name\r
-                   specified.\r
-\r
-\r
-          REGISTERS MODIFIED\r
-\r
-               AX, DX\r
-\r
-\r
-          STATUS\r
-\r
-               AH = 0   SUCCESSFUL.\r
-                   The handle value for the named handle has been found.\r
-\r
-               AH = 80h   NON-RECOVERABLE.\r
-                   The manager has detected a malfunction in the memory\r
-                   manager software.\r
-\r
-\r
-\r
-          EMM Functions                                                 105\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 21. Get Handle Directory\r
-          Search For Named Handle subfunction\r
-\r
-\r
-\r
-               AH = 81h   NON-RECOVERABLE.\r
-                   The manager has detected a malfunction in the expanded\r
-                   memory hardware.\r
-\r
-               AH = 84h   NON-RECOVERABLE.\r
-                   The function code passed to the manager is not defined.\r
-\r
-               AH = 8Fh   NON-RECOVERABLE.\r
-                   The subfunction parameter is invalid.\r
-\r
-               AH = A0h   NON-RECOVERABLE.\r
-                   No corresponding handle could be found for the handle\r
-                   name specified.\r
-\r
-               AH = A1h   NON-RECOVERABLE.\r
-                   A handle found had no name (all ASCII nulls).\r
-\r
-\r
-          EXAMPLE\r
-\r
-          named_handle                   DB 'AARDVARK'\r
-          named_handle_value             DW ?\r
-\r
-          MOV   AX,SEG named_handle\r
-          MOV   DS,AX\r
-          LEA   SI,named_handle          ; DS:SI points to named_handle\r
-          MOV   AX,5401h                 ; load function code\r
-          INT   67h                      ; call the memory manager\r
-          OR    AH,AH                    ; check EMM status\r
-          JNZ   emm_err_handler          ; jump to error handler on error\r
-          MOV   named_handle_value,DX    ; save value of named handle\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                 106\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 21. Get Handle Directory\r
-          Get Total Handles subfunction\r
-\r
-\r
-\r
-          PURPOSE\r
-\r
-               This subfunction returns the total number of handles that\r
-               the memory manager supports, including the operating system\r
-               handle (handle value 0).\r
-\r
-\r
-          CALLING PARAMETERS\r
-\r
-               AX = 5402h\r
-                   Contains the Get Total Handles subfunction.\r
-\r
-\r
-          RESULTS\r
-\r
-               These results are valid only if the status returned is zero.\r
-\r
-               BX = total_handles\r
-                   The value returned represents the maximum number of\r
-                   handles which a program may request the memory manager\r
-                   to allocate memory to.  The value returned includes the\r
-                   operating system handle (handle value 0).\r
-\r
-\r
-          REGISTERS MODIFIED\r
-\r
-               AX, BX\r
-\r
-\r
-          STATUS\r
-\r
-               AH = 0   SUCCESSFUL.\r
-                   The total number of handles supported has been returned.\r
-\r
-               AH = 80h   NON-RECOVERABLE.\r
-                   The manager has detected a malfunction in the memory\r
-                   manager software.\r
-\r
-               AH = 81h   NON-RECOVERABLE.\r
-                   The manager has detected a malfunction in the expanded\r
-                   memory hardware.\r
-\r
-               AH = 84h   NON-RECOVERABLE.\r
-                   The function code passed to the manager is not defined.\r
-\r
-               AH = 8Fh   NON-RECOVERABLE.\r
-                   The subfunction parameter is invalid.\r
-\r
-          EMM Functions                                                 107\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 21. Get Handle Directory\r
-          Get Total Handles subfunction\r
-\r
-\r
-\r
-          EXAMPLE\r
-\r
-          total_handles                  DW ?\r
-\r
-          MOV   AX,5402h                 ; load function code\r
-          INT   67h                      ; call the memory manager\r
-          OR    AH,AH                    ; check EMM status\r
-          JNZ   emm_err_handler          ; jump to error handler on error\r
-          MOV   total_handles,BX         ; save total handle count\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                 108\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 22. Alter Page Map & Jump\r
-\r
-\r
-\r
-          PURPOSE\r
-\r
-               This function alters the memory mapping context and trans-\r
-               fers control to the specified address.  It is analogous to\r
-               the FAR JUMP in the 8086 family architecture.  The memory\r
-               mapping context which existed before the invocation of this\r
-               function is lost.\r
-\r
-               Mapping no pages and jumping is not considered an error.  If\r
-               a request to map zero pages and jump is made, control is\r
-               transferred to the target address, and this function\r
-               performs a far jump.\r
-\r
-\r
-          CALLING PARAMETERS\r
-\r
-               AH = 55h\r
-                   Contains the Alter Page Map & Jump function.\r
-\r
-                   log_phys_map_struct             STRUC\r
-                       log_page_number             DW ?\r
-                       phys_page_number_seg        DW ?\r
-                   log_phys_map_struct             ENDS\r
-\r
-                   map_and_jump_struct             STRUC\r
-                       target_address              DD ?\r
-                       log_phys_map_len            DB ?\r
-                       log_phys_map_ptr            DD ?\r
-                   map_and_jump_struct             ENDS\r
-\r
-               AL = physical page number/segment selector\r
-                   Contains a code which indicates whether the value\r
-                   contained in the\r
-\r
-                       .log_phys_map.phys_page_number_seg\r
-\r
-                   members are physical page numbers or are the segment\r
-                   address representation of the physical page numbers.  A\r
-                   zero in AL indicates that the values are physical page\r
-                   numbers.  A one in AL indicates that the values in these\r
-                   members are the segment address representations of the\r
-                   physical page numbers.\r
-\r
-               DX = handle number\r
-                   Contains the EMM handle.\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                 109\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 22. Alter Page Map & Jump\r
-\r
-\r
-\r
-               DS:SI = pointer to map_and_jump structure\r
-                   Contains a pointer to a structure that contains the\r
-                   information necessary to map the desired physical pages\r
-                   and jump to the target address.  The structure consists\r
-                   of the following elements:\r
-\r
-                   .target_address\r
-                       The first member is a far pointer which contains the\r
-                       target address to which control is to be trans-\r
-                       ferred.  The address is represented in segment:of-\r
-                       fset format.  The offset portion of the address is\r
-                       stored in the low portion of the double word.\r
-\r
-                   .log_phys_map_len\r
-                       The second member is a byte which contains the\r
-                       number of entries in the array of structures which\r
-                       immediately follows it.  The array is as long as the\r
-                       application developer needs in order to map the\r
-                       desired logical pages into physical pages.  The\r
-                       number of entries cannot exceed the number of\r
-                       mappable pages in the system.\r
-\r
-                   .log_phys_map_ptr\r
-                       The third member is a pointer to an array of struc-\r
-                       tures which contain the logical page numbers and\r
-                       physical pages or segment address at which they are\r
-                       to be mapped.  Each entry in the array of structures\r
-                       contains the following two elements:\r
-\r
-                   .log_page_number\r
-                       The first member of this structure is a word which\r
-                       contains the number of the logical page to be\r
-                       mapped.\r
-\r
-                   .phys_page_number_seg\r
-                       The second member of this structure is a word which\r
-                       contains either the physical page number or the\r
-                       segment address representation of the physical page\r
-                       number at which the previous logical page number is\r
-                       to be mapped.  The value passed in AL determines the\r
-                       type of representation.\r
-\r
-\r
-          REGISTERS MODIFIED\r
-\r
-               AX\r
-\r
-\r
-\r
-          EMM Functions                                                 110\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 22. Alter Page Map & Jump\r
-\r
-\r
-\r
-          Note............................................................\r
-               Values in registers which don't contain required parameters\r
-               maintain the values across the jump.  The values in regis-\r
-               ters (with the exception of AX) and the flag state at the\r
-               beginning of the function are still in the registers and\r
-               flags when the target address is reached.\r
-\r
-\r
-          STATUS\r
-\r
-               AH = 0   SUCCESSFUL.\r
-                   Control has been transferred to the target address.\r
-\r
-               AH = 80h   NON-RECOVERABLE.\r
-                   The manager has detected a malfunction in the memory\r
-                   manager software.\r
-\r
-               AH = 81h   NON-RECOVERABLE.\r
-                   The manager has detected a malfunction in the expanded\r
-                   memory hardware.\r
-\r
-               AH = 83h   NON-RECOVERABLE.\r
-                   The manager could not find the specified EMM handle. \r
-                   The manager does not currently have any information\r
-                   pertaining to the specified EMM handle.  The program may\r
-                   have corrupted its EMM handle.\r
-\r
-               AH = 84h   NON-RECOVERABLE.\r
-                   The function code passed to the manager is not defined.\r
-\r
-               AH = 8Ah   RECOVERABLE.\r
-                   One or more of the logical pages to map into a cor-\r
-                   responding physical page is out of the range of logical\r
-                   pages which are allocated to the EMM handle.  The\r
-                   program can recover from this condition by mapping a\r
-                   logical page which is within the bounds for the EMM\r
-                   handle.\r
-\r
-               AH = 8Bh   RECOVERABLE.\r
-                   One or more of the physical pages is out of the range of\r
-                   allowable physical pages, or the log_phys_map_len\r
-                   exceeds the number of mappable pages in the system. \r
-                   Physical page numbers are numbered zero-relative.  The\r
-                   program can recover from this condition by mapping into\r
-                   memory at a physical page which is in the range of\r
-                   supported physical pages.\r
-\r
-\r
-\r
-          EMM Functions                                                 111\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 22. Alter Page Map & Jump\r
-\r
-\r
-\r
-               AH = 8Fh   NON-RECOVERABLE.\r
-                   The subfunction parameter is invalid.\r
-\r
-\r
-          EXAMPLE\r
-\r
-          log_phys_map              log_phys_map_struct (?) DUP (?)\r
-\r
-          map_and_jump              map_and_jump_struct (?)\r
-\r
-          emm_handle                          DW ?\r
-          phys_page_or_seg_mode               DB ?\r
-\r
-          MOV   AX,SEG map_and_jump\r
-          MOV   DS,AX\r
-          LEA   SI,map_and_jump               ; DS:SI points to\r
-                                              ; map_and_jump\r
-          MOV   DX,emm_handle\r
-          MOV   AH,55h                        ; load function code\r
-          MOV   AL,phys_page_or_seg_mode      ; specify physical page\r
-                                              ; or segment mode\r
-          INT   67h                           ; call memory manager\r
-          OR    AH,AH                         ; check EMM status\r
-          JNZ   emm_err_handler               ; jump to error handler on   \r
-                                              ; error\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                 112\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 23. Alter Page Map & Call\r
-          Alter Page Map & Call subfunction\r
-\r
-\r
-\r
-          PURPOSE\r
-\r
-               This subfunction saves the current memory mapping context,\r
-               alters the specified memory mapping context, and transfers\r
-               control to the specified address.  It is analogous to the\r
-               FAR CALL in the 8086 family architecture.  Just as a return\r
-               from a FAR CALL restores the original value in the code\r
-               segment register, this subfunction restores the state of the\r
-               specified mapping context after the return.\r
-\r
-               There is no explicit expanded memory subfunction which\r
-               emulates a return from a FAR CALL.  However, this facility\r
-               is implicitly available through the standard return from a\r
-               FAR CALL.  The following paragraphs describe how this works:\r
-\r
-               After this function is invoked, unless an error is detected,\r
-               the memory manager will transfer control to the address\r
-               specified.  If an error occurs, the memory manager returns\r
-               immediately with the error code in the AH register. \r
-               Otherwise, the memory manager pushes on the stack informa-\r
-               tion which enables it to restore the mapping context after\r
-               the return.\r
-\r
-               When the called procedure wants to return to the calling\r
-               procedure, it simply issues a standard FAR RETURN.  The\r
-               memory manager traps this return, restores the specified\r
-               mapping context, and returns to the calling procedure.  The\r
-               memory manager also returns a status from a successful\r
-               return just as it does for all functions.\r
-\r
-               Developers using this subfunction must make allowances for\r
-               the additional stack space this subfunction will use.\r
-\r
-\r
-          CALLING PARAMETERS\r
-\r
-               AH = 56h\r
-                   Contains the Alter Page Map & Call function.\r
-\r
-                   log_phys_map_struct             STRUC\r
-                       log_page_number             DW ?\r
-                       phys_page_number_seg        DW ?\r
-                   log_phys_map_struct             ENDS\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                 113\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 23. Alter Page Map & Call\r
-          Alter Page Map & Call subfunction\r
-\r
-\r
-\r
-                   map_and_call_struct             STRUC\r
-                       target_address              DD ?\r
-                       new_page_map_len            DB ?\r
-                       new_page_map_ptr            DD ?\r
-                       old_page_map_len            DB ?\r
-                       old_page_map_ptr            DD ?\r
-                       reserved                    DW 4 DUP (?)\r
-                   map_and_call_struct             ENDS\r
-\r
-               AL = physical page number/segment selector\r
-                   Contains a code which indicates whether the value\r
-                   contained in the\r
-\r
-                       .new_page_map.phys_page_number_seg\r
-                       .old_page_map.phys_page_number_seg\r
-\r
-                   members are physical page numbers or are the segment\r
-                   address representation of the physical page numbers.  A\r
-                   value of zero in AL indicates that the values in these\r
-                   members are physical page numbers.  A value of one in AL\r
-                   indicates that the values in these members are the\r
-                   segment address representations of the physical page\r
-                   numbers.\r
-\r
-               DX = handle number\r
-                   Contains the EMM handle.\r
-\r
-               DS:SI = pointer to map_and_call structure\r
-                   Contains a pointer to a structure which contains the\r
-                   information necessary to map the desired physical pages\r
-                   and call the target address.  The structure members are\r
-                   described here:\r
-\r
-                   .target_address\r
-                       The first member is a far pointer which contains the\r
-                       target address to which control is to be trans-\r
-                       ferred.  The address is represented in segment:of-\r
-                       fset format.  The offset portion of the address is\r
-                       stored in the low portion of the pointer.  The\r
-                       application must supply this value.\r
-\r
-                   .new_page_map_len\r
-                       The second member is a byte which contains the\r
-                       number of entries in the new mapping context to\r
-                       which new_page_map_ptr points.  This number cannot\r
-                       exceed the number of mappable pages in the system.\r
-\r
-\r
-          EMM Functions                                                 114\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 23. Alter Page Map & Call\r
-          Alter Page Map & Call subfunction\r
-\r
-\r
-\r
-                   .new_page_map_ptr\r
-                       The third member is a far pointer that points to an\r
-                       array of structures which contains a list of the\r
-                       logical page numbers and the physical page num-\r
-                       bers/segments at which they are to be mapped im-\r
-                       mediately after the call.  The contents of the new\r
-                       array of structures are described at the end of the\r
-                       map_and_call structure.\r
-\r
-                   .old_page_map_len\r
-                       The fourth member is a byte which contains the\r
-                       number of entries in the old mapping context to\r
-                       which old_page_map_ptr points.  This number cannot\r
-                       exceed the number of mappable pages in the system.\r
-\r
-                   .old_page_map_ptr\r
-                       The fifth member is a far pointer that points to an\r
-                       array of structures which contains a list of the\r
-                       logical page numbers and the physical page num-\r
-                       bers/segments at which they are to be mapped im-\r
-                       mediately after the return.  The contents of the old\r
-                       array of structures are described at the end of the\r
-                       map_and_call structure.\r
-\r
-                   .reserved\r
-                       The sixth member is reserved for use by the memory\r
-                       manager.\r
-\r
-               Each entry in the old and new array of structures contains\r
-               two elements:\r
-\r
-                   .log_page_number\r
-                       The first member of this structure is a word which\r
-                       contains a logical page number which is to be mapped\r
-                       at the succeeding physical page number/segment\r
-                       immediately after the CALL (in the case of the new\r
-                       array of structures) or after the RETURN (in the\r
-                       case of the old array of structures).\r
-\r
-                   .phys_page_number_seg\r
-                       The second member of this structure is a word which\r
-                       contains either the physical page number or the\r
-                       segment address representation of the physical page\r
-                       number/segment at which the preceding logical page\r
-                       is to be mapped immediately after the CALL (in the\r
-                       case of the new array of structures) or after the\r
-                       RETURN (in the case of the old array of structures).\r
-\r
-          EMM Functions                                                 115\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 23. Alter Page Map & Call\r
-          Alter Page Map & Call subfunction\r
-\r
-\r
-\r
-          REGISTERS MODIFIED\r
-\r
-               AX\r
-\r
-          Note............................................................\r
-               Values in registers which don't contain required parameters\r
-               maintain the values across the call.  The values in regis-\r
-               ters (with the exception of AX) and the flag state at the\r
-               beginning of the function are still in the registers and\r
-               flags when the target address is reached.\r
-\r
-\r
-          STATUS\r
-\r
-               AH = 0   SUCCESSFUL.\r
-                   Control has been transferred to the target address.\r
-\r
-               AH = 80h   NON-RECOVERABLE.\r
-                   The manager has detected a malfunction in the memory\r
-                   manager software.\r
-\r
-               AH = 81h   NON-RECOVERABLE.\r
-                   The manager has detected a malfunction in the expanded\r
-                   memory hardware.\r
-\r
-               AH = 83h   NON-RECOVERABLE.\r
-                   The manager couldn't find the specified EMM handle.  The\r
-                   manager doesn't have any information pertaining to the\r
-                   specified EMM handle.  The program may have corrupted\r
-                   its EMM handle.\r
-\r
-               AH = 84h   NON-RECOVERABLE.\r
-                   The function code passed to the manager is not defined.\r
-\r
-               AH = 8Ah   RECOVERABLE.\r
-                   One or more of the logical pages to map into a cor-\r
-                   responding physical page is out of the range of logical\r
-                   pages which are allocated to the EMM handle.  The\r
-                   program can recover from this condition by mapping a\r
-                   logical page which is within the bounds for the EMM\r
-                   handle.\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                 116\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 23. Alter Page Map & Call\r
-          Alter Page Map & Call subfunction\r
-\r
-\r
-\r
-               AH = 8Bh   RECOVERABLE.\r
-                   One or more of the physical pages is out of the range of\r
-                   allowable physical pages, or you've specified more\r
-                   physical pages than exist in the system.  Physical page\r
-                   numbers are numbered zero-relative.  The program can\r
-                   recover from this condition by mapping a physical page\r
-                   which is in the range from zero to three.\r
-\r
-               AH = 8Fh   NON-RECOVERABLE.\r
-                   The subfunction parameter is invalid.\r
-\r
-\r
-          EXAMPLE\r
-\r
-          new_page_map              log_phys_map_struct (?) DUP (?)\r
-\r
-          old_page_map              log_phys_map_struct (?) DUP (?)\r
-\r
-          map_and_call              map_and_call_struct (?)\r
-\r
-          emm_handle                DW ?\r
-          phys_page_or_seg_mode     DB ?\r
-\r
-          MOV   AX,SEG map_and_call\r
-          MOV   DS,AX\r
-          LEA   SI,map_and_call               ; DS:SI points to\r
-                                              ; map_and_call\r
-          MOV   DX,emm_handle                 ; specify EMM handle\r
-          MOV   AH,56h                        ; load function code\r
-          MOV   AL,phys_page_or_seg_mode      ; specify physical page\r
-                                              ; or segment mode\r
-          INT   67h                           ; control is actually\r
-                                              ; transferred to the called\r
-                                              ; procedure at this point\r
-          OR    AH,AH                         ; check EMM status\r
-          JNZ   emm_err_handler               ; jump to error handler on\r
-                                              ; error\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                 117\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 23. Alter Page Map & Call\r
-          Get Page Map Stack Space Size subfunction\r
-\r
-\r
-\r
-          PURPOSE\r
-\r
-               Since the Alter Page Map & Call function pushes additional\r
-               information onto the stack, this subfunction returns the\r
-               number of bytes of stack space the function requires.\r
-\r
-\r
-          CALLING PARAMETERS\r
-\r
-               AX = 5602h\r
-                   Contains the Get Page Map Stack Space Size subfunction.\r
-\r
-\r
-          RESULTS\r
-\r
-               These results are valid only if the status returned is zero.\r
-\r
-               BX = stack space required\r
-                   Contains the number of bytes which the Alter Page Map &\r
-                   Call function will require.  In other words, BX contains\r
-                   the number (including the return address) which has to\r
-                   be added to the stack pointer to remove all elements\r
-                   from the stack.\r
-\r
-\r
-          REGISTERS MODIFIED\r
-\r
-               AX, BX\r
-\r
-\r
-          STATUS\r
-\r
-               AH = 0   SUCCESSFUL.\r
-                   The size of the array has been returned.\r
-\r
-               AH = 80h   NON-RECOVERABLE.\r
-                   The manager has detected a malfunction in the memory\r
-                   manager software.\r
-\r
-               AH = 81h   NON-RECOVERABLE.\r
-                   The manager has detected a malfunction in the expanded\r
-                   memory hardware.\r
-\r
-               AH = 84h   NON-RECOVERABLE.\r
-                   The function code passed to the manager is not defined.\r
-\r
-\r
-\r
-          EMM Functions                                                 118\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 23. Alter Page Map & Call\r
-          Get Page Map Stack Space Size subfunction\r
-\r
-\r
-\r
-               AH = 8Fh   NON-RECOVERABLE.\r
-                   The subfunction parameter is invalid.\r
-\r
-\r
-          EXAMPLE\r
-\r
-          stack_space_reqd               DW ?\r
-\r
-          MOV   AX,5602h                 ; load function code\r
-          INT   67h                      ; call the memory manager\r
-          OR    AH,AH                    ; check EMM status\r
-          JNZ   emm_err_handler          ; jump to error handler on error\r
-          MOV   stack_space_reqd,BX      ; save required stack size count\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                 119\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 24. Move/Exchange Memory Region\r
-          Move Memory Region subfunction\r
-\r
-\r
-\r
-          PURPOSE\r
-\r
-               This subfunction copies a region of memory in the following\r
-               memory source/destination combinations.\r
-\r
-               o   conventional memory to conventional memory\r
-\r
-               o   conventional memory to expanded memory\r
-\r
-               o   expanded memory to conventional memory\r
-\r
-               o   expanded memory to expanded memory\r
-\r
-               You do not have to save and restore the expanded memory\r
-               mapping context to perform these move operations.  The\r
-               current mapping context is maintained throughout this\r
-               operation.\r
-\r
-               The length of the region is limited by the amount of\r
-               expanded memory allocated to the handles specified. \r
-               However, in most practical applications, the region length\r
-               will be considerably smaller.  A region length of zero is\r
-               not an error, and no move will be performed.\r
-\r
-               A region length which exceeds 16K bytes is not an error.  In\r
-               this case the function assumes that a group of logical pages\r
-               is the target for the move.  The logical page specified\r
-               represents the first logical page in which the move will\r
-               take place.  If the region length exceeds 16K bytes, or if\r
-               the region is less than 16K bytes but spans logical pages,\r
-               there must be sufficient logical pages remaining after the\r
-               first logical page for the entire region to fit.\r
-\r
-               If your application needs to save a region of conventional\r
-               memory in expanded memory, you can move it without having to\r
-               perform a save or restore of the current mapping context. \r
-               The memory manager maintains the context.  A move of up to\r
-               1M bytes may be performed, although practical lengths are\r
-               substantially less than this value.\r
-\r
-               If the source and destination handles are identical, the\r
-               source and destination regions are tested for overlap before\r
-               the move.  If they overlap, the move direction is chosen so\r
-               that the destination region receives an intact copy of the\r
-               source region.  A status will be returned indicating that\r
-               this overlap has occurred.\r
-\r
-\r
-          EMM Functions                                                 120\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 24. Move/Exchange Memory Region\r
-          Move Memory Region subfunction\r
-\r
-\r
-\r
-          CALLING PARAMETERS\r
-\r
-               AX = 5700h\r
-                   Contains the Move Memory Region function.\r
-\r
-                   move_source_dest_struct         STRUC\r
-                       region_length               DD ?\r
-                       source_memory_type          DB ?\r
-                       source_handle               DW ?\r
-                       source_initial_offset       DW ?\r
-                       source_initial_seg_page     DW ?\r
-                       dest_memory_type            DB ?\r
-                       dest_handle                 DW ?\r
-                       dest_initial_offset         DW ?\r
-                       dest_initial_seg_page       DW ?\r
-                   move_source_dest_struct         ENDS\r
-\r
-               DS:SI = pointer to move_source_dest structure\r
-                   Contains a pointer to a data structure which contains\r
-                   the source and destination information for the move. \r
-                   The structure members are described here:\r
-\r
-                   .region_length\r
-                       The first member is a double word which specifies\r
-                       the length of the memory region (in bytes) to be\r
-                       moved.\r
-\r
-                   .source_memory_type\r
-                       The second member is a byte which specifies the type\r
-                       of memory where the source region resides.  A value\r
-                       of zero indicates that the source region resides in\r
-                       conventional memory (excluding the page frame seg-\r
-                       ment).  A value of one indicates that the source\r
-                       region resides in expanded memory.\r
-\r
-                   .source_handle\r
-                       If the source region resides in expanded memory, the\r
-                       third member is a word which specifies the handle\r
-                       number associated with the source memory region.  If\r
-                       the source region resides in conventional memory,\r
-                       this variable has no meaning and should be set to\r
-                       zero for future compatibility.\r
-\r
-                   .source_initial_offset\r
-                       The fourth member is a word which specifies the\r
-                       offset within the source region from which to begin\r
-                       the move.\r
-\r
-          EMM Functions                                                 121\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 24. Move/Exchange Memory Region\r
-          Move Memory Region subfunction\r
-\r
-\r
-\r
-                       If the source region resides in expanded memory, the\r
-                       source_initial_offset is relative to the beginning\r
-                       of the 16K logical page.  Because the offset is\r
-                       relative to the beginning of a 16K expanded memory\r
-                       page, it may only take on values between 0000h and\r
-                       3FFFh.\r
-\r
-                       If the source region resides in conventional memory,\r
-                       the source_initial_offset is a word which specifies\r
-                       the offset, relative to the beginning of the source\r
-                       segment, from which to begin the move.  Because the\r
-                       offset is relative to the beginning of a 64K-byte\r
-                       conventional memory segment, it may take on values\r
-                       between 0000h and FFFFh.\r
-\r
-                   .source_initial_seg_page\r
-                       The fifth member is a word which specifies the\r
-                       initial segment or logical page number within the\r
-                       source region from which to begin the move.\r
-\r
-                       If the source region resides in expanded memory, the\r
-                       value specifies the logical page within the source\r
-                       region from which to begin the move.\r
-\r
-                       If the source region resides in conventional memory,\r
-                       the source_initial_seg_page specifies the initial\r
-                       segment address within conventional memory from\r
-                       which to begin the move.\r
-\r
-                   .dest_memory_type\r
-                       The sixth member is a byte which specifies the type\r
-                       of memory where the destination region resides.  A\r
-                       value of zero indicates conventional memory; a value\r
-                       of one indicates expanded memory.\r
-\r
-                   .dest_handle\r
-                       If the destination region resides in expanded\r
-                       memory, the seventh member is a word which specifies\r
-                       the handle number associated with the destination\r
-                       memory region.  If the destination region resides in\r
-                       conventional memory, this variable has no meaning\r
-                       and should be set to zero for future compatibility.\r
-\r
-                   .dest_initial_offset\r
-                       The eighth member is a word which specifies the\r
-                       offset within the destination region from which to\r
-                       begin the move.\r
-\r
-          EMM Functions                                                 122\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 24. Move/Exchange Memory Region\r
-          Move Memory Region subfunction\r
-\r
-\r
-\r
-                       If the destination region resides in expanded\r
-                       memory, the dest_initial_offset is relative to the\r
-                       beginning of the 16K-byte logical page.  Because the\r
-                       offset is relative to the beginning of a 16K-byte\r
-                       expanded memory page, it may only take on values\r
-                       between 0000h and 3FFFh.\r
-\r
-                       If the destination region resides in conventional\r
-                       memory, the dest_initial_offset is a word which\r
-                       specifies the offset, relative to the beginning of\r
-                       the destination segment, to begin the move.  Because\r
-                       the offset is relative to the beginning of a 64K\r
-                       conventional memory segment, it may take on values\r
-                       between 0000h and FFFFh.\r
-\r
-                   .dest_initial_seg_page\r
-                       The ninth member is a word which specifies the\r
-                       initial segment or logical page number within the\r
-                       destination region from which to begin the move.\r
-\r
-                       If the destination region resides in expanded memory\r
-                       then the value specifies the logical page within the\r
-                       destination region from which to begin the move.\r
-\r
-                       If the destination region resides in conventional\r
-                       memory, the dest_initial_seg_page specifies the\r
-                       initial segment address within conventional memory\r
-                       from which to begin the move.\r
-\r
-\r
-          REGISTERS MODIFIED\r
-\r
-               AX\r
-\r
-\r
-          STATUS\r
-\r
-               AH = 0   SUCCESSFUL.\r
-                   The memory regions have been moved.\r
-\r
-               AH = 80h   NON-RECOVERABLE.\r
-                   The manager has detected a malfunction in the memory\r
-                   manager software.\r
-\r
-               AH = 81h   NON-RECOVERABLE.\r
-                   The manager has detected a malfunction in the expanded\r
-                   memory hardware.\r
-\r
-          EMM Functions                                                 123\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 24. Move/Exchange Memory Region\r
-          Move Memory Region subfunction\r
-\r
-\r
-\r
-               AH = 83h   NON-RECOVERABLE.\r
-                   The manager couldn't find either the source or destina-\r
-                   tion EMM handles.  The memory manager doesn't have any\r
-                   information on the handles specified.  The program may\r
-                   have corrupted its EMM handles.\r
-\r
-               AH = 84h   NON-RECOVERABLE.\r
-                   The function code passed to the manager is not defined.\r
-\r
-               AH = 8Ah   NON-RECOVERABLE.\r
-                   One or more of the logical pages is out of the range of\r
-                   logical pages allocated to the source/destination\r
-                   handle.\r
-\r
-               AH = 8Fh   NON-RECOVERABLE.\r
-                   The subfunction parameter is invalid.\r
-\r
-               AH = 92h   SUCCESSFUL.\r
-                   The source and destination expanded memory regions have\r
-                   the same handle and overlap.  This is valid for a move. \r
-                   The move has been completed and the destination region\r
-                   has a full copy of the source region.  However, at least\r
-                   a portion of the source region has been overwritten by\r
-                   the move.  Note that the source and destination expanded\r
-                   memory regions with different handles will never physi-\r
-                   cally overlap because the different handles specify\r
-                   totally different regions of expanded memory.\r
-\r
-               AH = 93h   CONDITIONALLY-RECOVERABLE.\r
-                   The length of the source or destination expanded memory\r
-                   region specified exceeds the length of the expanded\r
-                   memory region allocated either the source or destination\r
-                   handle.  Insufficient pages are allocated to this handle\r
-                   to move a region of the size specified.  The program can\r
-                   recover from this condition by allocating additional\r
-                   pages to the destination or source handle and attempting\r
-                   to execute the function again.  However, if the applica-\r
-                   tion program allocated as much expanded memory as it\r
-                   thought it needed, this may be a program error and is\r
-                   not recoverable.\r
-\r
-               AH = 94h   NON-RECOVERABLE.\r
-                   The conventional memory region and expanded memory\r
-                   region overlap.  This is invalid, the conventional\r
-                   memory region cannot overlap the expanded memory region.\r
-\r
-\r
-\r
-          EMM Functions                                                 124\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 24. Move/Exchange Memory Region\r
-          Move Memory Region subfunction\r
-\r
-\r
-\r
-               AH = 95h   NON-RECOVERABLE.\r
-                   The offset within the logical page exceeds the length of\r
-                   the logical page.  The initial source or destination\r
-                   offsets within an expanded memory region must be between\r
-                   0000h and 3FFFh (16383 or (length of a logical page\r
-                   - 1)).\r
-\r
-               AH = 96h   NON-RECOVERABLE.\r
-                   Region length exceeds 1M bytes.\r
-\r
-               AH = 98h   NON-RECOVERABLE.\r
-                   The memory source and destination types are undefined.\r
-\r
-               AH = A2h   NON-RECOVERABLE.\r
-                   An attempt was made to wrap around the 1M-byte address\r
-                   space of conventional memory during the move.  The\r
-                   combination of source/destination starting address and\r
-                   length of the region to be moved exceeds 1M bytes.  No\r
-                   data was moved.\r
-\r
-\r
-          EXAMPLE\r
-\r
-          move_source_dest               move_source_dest_struct (?)\r
-\r
-          MOV   AX,SEG move_source_dest\r
-          MOV   DS,AX\r
-          LEA   SI,move_source_dest      ; DS:SI points to move_source_dest\r
-          MOV   AX,5700h                 ; load function code\r
-          INT   67h                      ; call the memory manager\r
-          OR    AH,AH                    ; check EMM status\r
-          JNZ   emm_err_handler          ; jump to error handler on error\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                 125\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 24. Move/Exchange Memory Region\r
-          Exchange Memory Region subfunction\r
-\r
-\r
-\r
-          PURPOSE\r
-\r
-               This subfunction exchanges (using a string move) a region of\r
-               memory in any of the following memory source/destination\r
-               combinations.\r
-\r
-               o   conventional memory to conventional memory\r
-\r
-               o   conventional memory to expanded memory\r
-\r
-               o   expanded memory to conventional memory\r
-\r
-               o   expanded memory to expanded memory\r
-\r
-               The term expanded memory region refers only to the area of\r
-               memory above 640K bytes (9FFFFh).  If a system provides\r
-               mappable conventional memory, this function treats the\r
-               mappable conventional memory regions as ordinary convention-\r
-               al memory.  The contents of the source region and the\r
-               destination region are exchanged.\r
-\r
-               The exchange operation can be performed without having to\r
-               save and restore the expanded memory mapping context.  The\r
-               current mapping context is maintained throughout this\r
-               operation.  The length of the region is limited to the\r
-               amount of expanded memory allocated to the specified EMM\r
-               handles.  A length of zero is not an error; however, no\r
-               exchange will be performed.  A region length which exceeds\r
-               16K bytes is not an error.  In this case the function\r
-               assumes that a group of logical pages is the target for the\r
-               exchange.  The logical page specified represents the first\r
-               logical page in which the exchange will take place.  If the\r
-               region length exceeds 16K bytes, or if the region is less\r
-               than 16K bytes but spans logical pages, there must be\r
-               sufficient logical pages remaining after the first logical\r
-               page for the entire region to fit.\r
-\r
-               If your application needs to exchange a region of conven-\r
-               tional memory with expanded memory, you can simply exchange\r
-               it with the region of interest without having to perform a\r
-               save or restore of the current mapping context.  An exchange\r
-               of up to 1M bytes may be performed, although practical\r
-               lengths are obviously below that value.  Checking is done\r
-               before starting the exchange to prevent the possibility of\r
-               overlap during the exchange operation.  Overlapping source\r
-               and destination regions for an exchange are invalid, and the\r
-               exchange will not take place.\r
-\r
-          EMM Functions                                                 126\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 24. Move/Exchange Memory Region\r
-          Exchange Memory Region subfunction\r
-\r
-\r
-\r
-          CALLING PARAMETERS\r
-\r
-               AX = 5701h\r
-                   Contains the Exchange Memory Region function.\r
-\r
-                   xchg_source_dest_struct         STRUC\r
-                       region_length               DD ?\r
-                       source_memory_type          DB ?\r
-                       source_handle               DW ?\r
-                       source_initial_offset       DW ?\r
-                       source_initial_seg_page     DW ?\r
-                       dest_memory_type            DB ?\r
-                       dest_handle                 DW ?\r
-                       dest_initial_offset         DW ?\r
-                       dest_initial_seg_page       DW ?\r
-                   xchg_source_dest_struct         ENDS\r
-\r
-               DS:SI = pointer to xchg_source_dest structure\r
-                   Contains a pointer to the data structure which contains\r
-                   the source and destination information for the exchange. \r
-                   The structure members are described here:\r
-\r
-                   .region_length\r
-                       The first member is a double word which specifies\r
-                       the length of the memory region to be exchanged.\r
-\r
-                   .source_memory_type\r
-                       The second member is a byte which specifies the type\r
-                       of memory where the source region resides.  A value\r
-                       of zero indicates that the source region resides in\r
-                       conventional memory.  A value of one indicates that\r
-                       the source region resides in expanded memory.\r
-\r
-                   .source_handle\r
-                       If the source region resides in expanded memory, the\r
-                       third member is a word which specifies the handle\r
-                       number associated with the source memory region.  If\r
-                       the source region resides in conventional memory,\r
-                       this variable has no meaning and should be set to\r
-                       zero for future compatibility.\r
-\r
-                   .source_initial_offset\r
-                       The fourth member is a word which specifies the\r
-                       offset within the source region from which to begin\r
-                       the exchange.\r
-\r
-\r
-\r
-          EMM Functions                                                 127\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 24. Move/Exchange Memory Region\r
-          Exchange Memory Region subfunction\r
-\r
-\r
-\r
-                       If the source region resides in expanded memory, the\r
-                       source_initial_offset is relative to the beginning\r
-                       of the 16K logical page.  Because the offset is\r
-                       relative to the beginning of a 16K expanded memory\r
-                       page, it may only take on values between 0000h and\r
-                       3FFFh.\r
-\r
-                       If the source region resides in conventional memory,\r
-                       the source_initial_offset is a word which specifies\r
-                       the offset, relative to the beginning of the source\r
-                       segment, from which to begin the exchange at. \r
-                       Because the offset is relative to the beginning of a\r
-                       64K-byte conventional memory segment, it may take on\r
-                       values between 0000h and FFFFh.\r
-\r
-                   .source_initial_seg_page\r
-                       The fifth member is a word which specifies the\r
-                       initial segment or logical page number within the\r
-                       source region from which to begin the exchange.\r
-\r
-                       If the source region resides in expanded memory then\r
-                       the value specifies the logical page within the\r
-                       source region from which to begin the exchange.\r
-\r
-                       If the source region resides in conventional memory,\r
-                       the source_initial_seg_page specifies the initial\r
-                       segment address within conventional memory from\r
-                       which to begin the exchange.\r
-\r
-                   .dest_memory_type\r
-                       The sixth member is a byte which specifies the type\r
-                       of memory where the destination region resides.  A\r
-                       value of zero indicates that the destination region\r
-                       resides in conventional memory (excluding the page\r
-                       frame segment).  A value of one indicates that the\r
-                       destination region resides in expanded memory.\r
-\r
-                   .dest_handle\r
-                       If the destination region resides in expanded\r
-                       memory, the seventh member is a word which specifies\r
-                       the handle number associated with the destination\r
-                       memory region.  If the destination region resides in\r
-                       conventional memory, this variable has no meaning\r
-                       and should be set to zero for future compatibility.\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                 128\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 24. Move/Exchange Memory Region\r
-          Exchange Memory Region subfunction\r
-\r
-\r
-\r
-                   .dest_initial_offset\r
-                       The eighth member is a word which specifies the\r
-                       offset within the destination region from which to\r
-                       begin the exchange.\r
-\r
-                       If the destination region resides in expanded\r
-                       memory, the dest_initial_offset is relative to the\r
-                       beginning of the 16K-byte logical page.  Because the\r
-                       offset is relative to the beginning of a 16K-byte\r
-                       expanded memory page, it may only take on values\r
-                       between 0000h and 3FFFh.\r
-\r
-                       If the destination region resides in conventional\r
-                       memory, the dest_initial_offset is a word which\r
-                       specifies the offset, relative to the beginning of\r
-                       the destination segment, to begin the exchange at. \r
-                       Because the offset is relative to the beginning of a\r
-                       64K conventional memory segment, it may take on\r
-                       values between 0000h and FFFFh.\r
-\r
-                   .dest_initial_seg_page\r
-                       The ninth member is a word which specifies the\r
-                       initial segment or logical page number within the\r
-                       destination region from which to begin the exchange.\r
-\r
-                       If the destination region resides in expanded memory\r
-                       then the value specifies the logical page within the\r
-                       destination region from which to begin the exchange.\r
-\r
-                       If the destination region resides in conventional\r
-                       memory, the dest_initial_seg_page specifies the\r
-                       initial segment address within conventional memory\r
-                       from which to begin the exchange.\r
-\r
-\r
-\r
-          REGISTERS MODIFIED\r
-\r
-               AX\r
-\r
-\r
-          STATUS\r
-\r
-               AH = 0   SUCCESSFUL.\r
-                   The memory regions have been exchanged.\r
-\r
-\r
-\r
-          EMM Functions                                                 129\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 24. Move/Exchange Memory Region\r
-          Exchange Memory Region subfunction\r
-\r
-\r
-\r
-               AH = 80h   NON-RECOVERABLE.\r
-                   The manager has detected a malfunction in the memory\r
-                   manager software.\r
-\r
-               AH = 81h   NON-RECOVERABLE.\r
-                   The manager has detected a malfunction in the expanded\r
-                   memory hardware.\r
-\r
-               AH = 83h   NON-RECOVERABLE.\r
-                   The manager could not find either the source or destina-\r
-                   tion EMM handles.  The memory manager does not currently\r
-                   have any information pertaining to the handles speci-\r
-                   fied.  The program may have corrupted its EMM handles.\r
-\r
-               AH = 84h   NON-RECOVERABLE.\r
-                   The function code passed to the manager is not defined.\r
-\r
-               AH = 8Ah   NON-RECOVERABLE.\r
-                   One or more of the logical pages is out of the range of\r
-                   logical pages allocated to the source/destination\r
-                   handle.\r
-\r
-               AH = 8Fh   NON-RECOVERABLE.\r
-                   The subfunction parameter is invalid.\r
-\r
-               AH = 93h   CONDITIONALLY-RECOVERABLE.\r
-                   The length of the source or destination expanded memory\r
-                   region specified, exceeds the length of the expanded\r
-                   memory region allocated to the source or destination\r
-                   specified EMM handle.  There are insufficient pages\r
-                   allocated to this handle to exchange a region of the\r
-                   size specified.  The program can recover from this\r
-                   condition by attempting to allocate additional pages to\r
-                   the destination or source handle and attempting to\r
-                   execute the function again.  However, if the application\r
-                   program was allocated as much expanded memory as it\r
-                   thought it needed, this may be a program error and is\r
-                   therefore not recoverable.\r
-\r
-               AH = 94h   NON-RECOVERABLE.\r
-                   The conventional memory region and expanded memory\r
-                   region overlap.  This is invalid, the conventional\r
-                   memory region cannot overlap the expanded memory region.\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                 130\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 24. Move/Exchange Memory Region\r
-          Exchange Memory Region subfunction\r
-\r
-\r
-\r
-               AH = 95h   NON-RECOVERABLE.\r
-                   The offset within the logical page exceeds the length of\r
-                   the logical page.  The initial source or destination\r
-                   offsets within an expanded memory region must be between\r
-                   0000h and 3FFFh (16383 or (length of a logical page\r
-                   - 1)).\r
-\r
-               AH = 96h   NON-RECOVERABLE.\r
-                   Region length exceeds 1M-byte limit.\r
-\r
-               AH = 97h   NON-RECOVERABLE.\r
-                   The source and destination expanded memory regions have\r
-                   the same handle and overlap.  This is invalid, the\r
-                   source and destination expanded memory regions cannot\r
-                   have the same handle and overlap when they are being\r
-                   exchanged.  Note that the source and destination\r
-                   expanded memory regions which have different handles\r
-                   will never physically overlap because the different\r
-                   handles specify totally different regions of expanded\r
-                   memory.\r
-\r
-               AH = 98h   NON-RECOVERABLE.\r
-                   The memory source and destination types are undefined.\r
-\r
-               AH = A2h   NON-RECOVERABLE.\r
-                   An attempt was made to wrap around the 1M-byte address\r
-                   space of conventional memory during the exchange.  The\r
-                   combination of source/destination starting address and\r
-                   length of the region to be exchanged exceeds 1M bytes. \r
-                   No data was exchanged.\r
-\r
-\r
-          EXAMPLE\r
-\r
-          xchg_source_dest               xchg_source_dest_struct (?)\r
-\r
-          MOV   AX,SEG xchg_source_dest\r
-          MOV   DS,AX\r
-          LEA   SI,xchg_source_dest      ; DS:SI points to xchg_source_dest\r
-          MOV   AX,5701h                 ; load function code\r
-          INT   67h                      ; call the memory manager\r
-          OR    AH,AH                    ; check EMM status\r
-          JNZ   emm_err_handler          ; jump to error handler on error\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                 131\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 25. Get Mappable Physical Address Array\r
-          Get Mappable Physical Address Array subfunction\r
-\r
-\r
-\r
-          PURPOSE\r
-\r
-               This subfunction returns an array containing the segment\r
-               address and physical page number for each mappable physical\r
-               page in a system.  The contents of this array provide a\r
-               cross reference between physical page numbers and the actual\r
-               segment addresses for each mappable page in the system.  The\r
-               array is sorted in ascending segment order.  This does not\r
-               mean that the physical page numbers associated with the\r
-               segment addresses are also in ascending order.\r
-\r
-\r
-          CALLING PARAMETERS\r
-\r
-               AX = 5800h\r
-                   Contains the Get Mappable Physical Address Array\r
-                   subfunction\r
-\r
-                   mappable_phys_page_struct       STRUC\r
-                       phys_page_segment           DW ?\r
-                       phys_page_number            DW ?\r
-                   mappable_phys_page_struct       ENDS\r
-\r
-               ES:DI = mappable_phys_page\r
-                   Contains a pointer to an application-supplied memory\r
-                   area where the memory manager will copy the physical\r
-                   address array.  Each entry in the array is a structure\r
-                   containing two members:\r
-\r
-                   .phys_page_segment\r
-                       The first member is a word which contains the\r
-                       segment address of the mappable physical page\r
-                       associated with the physical page number following\r
-                       it.  The array entries are sorted in ascending\r
-                       segment address order.\r
-\r
-                   .phys_page_number\r
-                       The second member is a word which contains the\r
-                       physical page number which corresponds to the\r
-                       previous segment address.  The physical page numbers\r
-                       are not necessarily in ascending order.\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                 132\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 25. Get Mappable Physical Address Array\r
-          Get Mappable Physical Address Array subfunction\r
-\r
-\r
-\r
-                   Example 1\r
-\r
-                       An expanded memory board has its page frame starting\r
-                       at address C0000h and has no mappable conventional\r
-                       memory.  For this configuration, physical page 0\r
-                       corresponds to segment address C000h, physical page\r
-                       1 corresponds to segment address C400h, etc.  The\r
-                       array would contain the following data (in this\r
-                       order):\r
-\r
-                       C000h, 00h\r
-                       C400h, 01h\r
-                       C800h, 02h\r
-                       CC00h, 03h\r
-\r
-\r
-                   Example 2\r
-\r
-                       An expanded memory board has a large page frame\r
-                       starting at address C0000h and has mappable conven-\r
-                       tional memory from 90000h through 9FFFFh.  For this\r
-                       configuration, physical page 0 corresponds to\r
-                       segment address C000h, physical page 1 corresponds\r
-                       to segment address C400h, etc.  The array would\r
-                       contain the following data in the order specified. \r
-                       Note that the expanded memory region always has the\r
-                       lowest numerically valued physical page numbers.\r
-\r
-                       9000h, 0Ch\r
-                       9400h, 0Dh\r
-                       9800h, 0Eh\r
-                       9C00h, 0Fh\r
-                       C000h, 00h\r
-                       C400h, 01h\r
-                       C800h, 02h\r
-                       CC00h, 03h\r
-                       D000h, 04h\r
-                       D400h, 05h\r
-                       D800h, 06h\r
-                       DC00h, 07h\r
-                       E000h, 08h\r
-                       E400h, 09h\r
-                       E800h, 0Ah\r
-                       EC00h, 0Bh\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                 133\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 25. Get Mappable Physical Address Array\r
-          Get Mappable Physical Address Array subfunction\r
-\r
-\r
-\r
-          RESULTS\r
-\r
-               These results are valid only if the status returned is zero.\r
-\r
-               CX = number of entries in the mappable_phys_page\r
-                   Multiply this number by (SIZE mappable_phys_page_struct)\r
-                   to determine the number of bytes the physical page\r
-                   address array requires.\r
-\r
-\r
-          REGISTERS MODIFIED\r
-\r
-               AX, CX\r
-\r
-\r
-          STATUS\r
-\r
-               AH = 0   SUCCESSFUL.\r
-                   The hardware configuration array has been returned.\r
-\r
-               AH = 80h   NON-RECOVERABLE.\r
-                   The manager has detected a malfunction in the memory\r
-                   manager software.\r
-\r
-               AH = 81h   NON-RECOVERABLE.\r
-                   The manager has detected a malfunction in the expanded\r
-                   memory hardware.\r
-\r
-               AH = 84h   NON-RECOVERABLE.\r
-                   The function code passed to the manager is not defined.\r
-\r
-               AH = 8Fh   NON-RECOVERABLE.\r
-                   The subfunction parameter is invalid.\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                 134\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 25. Get Mappable Physical Address Array\r
-          Get Mappable Physical Address Array subfunction\r
-\r
-\r
-\r
-          EXAMPLE\r
-\r
-          mappable_phys_page             mappable_phys_page_struct (?)\r
-\r
-          mappable_page_entry_count      DW ?\r
-\r
-          MOV   AX,SEG mappable_phys_page\r
-          MOV   ES,AX\r
-          LEA   DI,mappable_phys_page         ; ES:DI points to\r
-                                              ; mappable_phys_page\r
-          MOV   AX,5800h                      ; load function code\r
-          INT   67h                           ; call the memory\r
-                                              ; manager\r
-          OR    AH,AH                         ; check EMM status\r
-          JNZ   emm_err_handler               ; jump to error handler\r
-                                              ; on error\r
-          MOV   mappable_page_entry_count,CX  ; save mappable\r
-                                              ; page entry count\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                 135\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 25. Get Mappable Physical Address Array\r
-          Get Mappable Physical Address Array Entries subfunction\r
-\r
-\r
-\r
-          PURPOSE\r
-\r
-               This subfunction gets the number of entries which will be\r
-               required for the array the first subfunction returns.\r
-\r
-\r
-          CALLING PARAMETERS\r
-\r
-               AX = 5801h\r
-                   Contains the Get Physical Page Address Array Entries\r
-                   subfunction.  This subfunction returns a word which\r
-                   represents the number of entries in the array returned\r
-                   by the previous subfunction.  This number also repre-\r
-                   sents the number of mappable physical pages in a system.\r
-\r
-\r
-          RESULTS\r
-\r
-               These results are valid only if the status returned is zero.\r
-\r
-               CX = number of entries in the mappable_phys_page\r
-                   Multiply this number by (SIZE mappable_phys_page_struct)\r
-                   to determine the number of bytes the physical page\r
-                   address array will require.\r
-\r
-\r
-          REGISTERS MODIFIED\r
-\r
-               AX, CX\r
-\r
-\r
-          STATUS\r
-\r
-               AH = 0   SUCCESSFUL.\r
-                   The number of mappable physical pages has been returned.\r
-\r
-               AH = 80h   NON-RECOVERABLE.\r
-                   The manager has detected a malfunction in the memory\r
-                   manager software.\r
-\r
-               AH = 81h   NON-RECOVERABLE.\r
-                   The manager has detected a malfunction in the expanded\r
-                   memory hardware.\r
-\r
-               AH = 84h   NON-RECOVERABLE.\r
-                   The function code passed to the manager is not defined.\r
-\r
-\r
-          EMM Functions                                                 136\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 25. Get Mappable Physical Address Array\r
-          Get Mappable Physical Address Array Entries subfunction\r
-\r
-\r
-\r
-               AH = 8Fh   NON-RECOVERABLE.\r
-                   The subfunction parameter is invalid.\r
-\r
-\r
-          EXAMPLE\r
-\r
-          mappable_page_entry_count           DW ?\r
-\r
-          MOV   AX,5801h                      ; load function code\r
-          INT   67h                           ; call memory manager\r
-          OR    AH,AH                         ; check EMM status\r
-          JNZ   emm_err_handler               ; jump to error handler\r
-                                              ; on error\r
-          MOV   mappable_page_entry_count,CX  ; save mappable\r
-                                              ; page entry count\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                 137\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 26. Get Expanded Memory Hardware Information\r
-          Get Hardware Configuration Array subfunction\r
-\r
-\r
-\r
-          Note............................................................\r
-               This function is for use by operating systems only.  This\r
-               function can be disabled at any time by the operating\r
-               system.  Refer to Function 30 for a description of how an\r
-               operating system does this.\r
-\r
-\r
-          PURPOSE\r
-\r
-               This subfunction returns an array containing expanded memory\r
-               hardware configuration information for use by an operating\r
-               system/environment.\r
-\r
-\r
-          CALLING PARAMETERS\r
-\r
-               AX = 5900h\r
-                   Contains the Get Hardware Configuration Array subfunc-\r
-                   tion.\r
-\r
-                   hardware_info_struct            STRUC\r
-                       raw_page_size               DW ?\r
-                       alternate_register_sets     DW ?\r
-                       context_save_area_size      DW ?\r
-                       DMA_register_sets           DW ?\r
-                       DMA_channel_operation       DW ?\r
-                   hardware_info_struct            ENDS\r
-\r
-               ES:DI = hardware_info\r
-                   Contains a pointer to a memory area that the operating\r
-                   system supplies where the memory manager will copy\r
-                   expanded memory hardware information.  The structure\r
-                   contains these five members:\r
-\r
-                   .raw_page_size\r
-                       The first member is a word which contains the size\r
-                       of a raw mappable physical page in paragraphs (16\r
-                       bytes).  LIM standard pages are always 16K bytes. \r
-                       However, other implementations of expanded memory\r
-                       boards do not necessarily comply with this standard\r
-                       and can emulate a 16K-byte page by mapping in\r
-                       multiple smaller pages.  This member specifies the\r
-                       size of a mappable physical page viewed from the\r
-                       hardware implementation level.\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                 138\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 26. Get Expanded Memory Hardware Information\r
-          Get Hardware Configuration Array subfunction\r
-\r
-\r
-\r
-                   .alternate_register_sets\r
-                       The second member is a word which specifies the\r
-                       number of alternate mapping register sets.  The\r
-                       additional mapping register sets are termed alter-\r
-                       nate mapping register sets in this document.\r
-\r
-                       All expanded memory boards have at least one set of\r
-                       hardware registers to perform the logical to\r
-                       physical page mapping.  Some expanded memory boards\r
-                       have more than one set of these mapping registers. \r
-                       This member specifies how many of these alternate\r
-                       mapping register sets exist (beyond the one set that\r
-                       all expanded memory boards have) on the expanded\r
-                       memory boards in the system.  If an expanded memory\r
-                       card has only one set of mapping registers (that is,\r
-                       no alternate mapping register sets) this member has\r
-                       a value of zero.\r
-\r
-                   .context_save_area_size\r
-                       The third member is a word which contains the\r
-                       storage requirements for the array required to save\r
-                       a mapping context.  The value returned in this\r
-                       member is exactly the same as that returned by\r
-                       Function 15 (Get Size of Page Map Save Array\r
-                       subfunction).\r
-\r
-                   .DMA_register_sets\r
-                       The fourth member is a word which contains the\r
-                       number of register sets that can be assigned to DMA\r
-                       channels.  These DMA register sets, although similar\r
-                       in use to alternate register sets, are for DMA\r
-                       mapping and not task mapping.\r
-\r
-                       If the expanded memory hardware does not support DMA\r
-                       register sets, care must be taken when DMA is taking\r
-                       place.\r
-\r
-                       In a multitasking operating system, when one task is\r
-                       waiting for DMA to complete, it is useful to be able\r
-                       to switch to another task.  However, if the DMA is\r
-                       taking place in memory that the second task will\r
-                       need to remap, remapping would be disastrous.\r
-\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                 139\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 26. Get Expanded Memory Hardware Information\r
-          Get Hardware Configuration Array subfunction\r
-\r
-\r
-\r
-                       If the expanded memory hardware can detect when DMA\r
-                       is occurring, the OS/E should allow task switches\r
-                       and remapping during DMA.  If no special support for\r
-                       DMA is available, no remapping should be done when\r
-                       DMA is in progress.\r
-\r
-                   .DMA_channel_operation\r
-                       The fifth member is a word which specifies a special\r
-                       case for the DMA register sets.  A value of zero\r
-                       specifies that the DMA register sets behave as\r
-                       described in Function 28.  A value of one specifies\r
-                       that the expanded memory hardware has only one DMA\r
-                       register set.  In addition, if any channel is mapped\r
-                       through this register set, then all channels are\r
-                       mapped through it.  For LIM standard boards, this\r
-                       value is zero.\r
-\r
-\r
-          RESULTS\r
-\r
-               These results are valid only if the status returned is zero.\r
-\r
-               hardware_info\r
-                   Contains the expanded memory hardware-specific informa-\r
-                   tion described above.\r
-\r
-\r
-          REGISTERS MODIFIED\r
-\r
-               AX\r
-\r
-\r
-          STATUS\r
-\r
-               AH = 0   SUCCESSFUL.\r
-                   The hardware configuration array has been returned.\r
-\r
-               AH = 80h   NON-RECOVERABLE.\r
-                   The manager has detected a malfunction in the memory\r
-                   manager software.\r
-\r
-               AH = 81h   NON-RECOVERABLE.\r
-                   The manager has detected a malfunction in the expanded\r
-                   memory hardware.\r
-\r
-               AH = 84h   NON-RECOVERABLE.\r
-                   The function code passed to the manager is not defined.\r
-\r
-          EMM Functions                                                 140\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 26. Get Expanded Memory Hardware Information\r
-          Get Hardware Configuration Array subfunction\r
-\r
-\r
-\r
-               AH = 8Fh   NON-RECOVERABLE.\r
-                   The subfunction parameter is invalid.\r
-\r
-               AH = A4h   NON-RECOVERABLE.\r
-                   Access to this function has been denied by the operating\r
-                   system.  The function cannot be used at this time.\r
-\r
-\r
-          EXAMPLE\r
-\r
-          hardware_info                  hardware_info_struct (?)\r
-\r
-          MOV   AX,SEG hardware_info\r
-          MOV   ES,AX\r
-          LEA   DI,hardware_info         ; ES:DI points to hardware_info\r
-          MOV   AX,5900h                 ; load function code\r
-          INT   67h                      ; call the memory manager\r
-          OR    AH,AH                    ; check EMM status\r
-          JNZ   emm_err_handler          ; jump to error handler on error\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                 141\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 26. Get Expanded Memory Hardware Information\r
-          Get Unallocated Raw Page Count subfunction\r
-\r
-\r
-\r
-          PURPOSE\r
-\r
-               The Get Unallocated Raw Page Count subfunction returns the\r
-               number of unallocated non-standard length mappable pages as\r
-               well as the total number of non-standard length mappable\r
-               pages in expanded memory to the operating system.\r
-\r
-               One variety of expanded memory board has a page size which\r
-               is a sub-multiple of 16K bytes.  An expanded memory page\r
-               which is a sub-multiple of 16K is termed a raw page.  An\r
-               operating system may deal with mappable physical page sizes\r
-               which are sub-multiples of 16K bytes.\r
-\r
-               If the expanded memory board supplies pages in exact\r
-               multiples of 16K bytes, the number of pages this function\r
-               returns is identical to the number Function 3 (Get Unallo-\r
-               cated Page Count) returns.  In this case, there is no\r
-               difference between a page and a raw page.\r
-\r
-\r
-          CALLING PARAMETERS\r
-\r
-               AX = 5901h\r
-                   Contains the Get Unallocated Raw Page Count subfunction.\r
-\r
-\r
-          RESULTS\r
-\r
-               These results are valid only if the status returned is zero.\r
-\r
-               BX = unallocated raw pages\r
-                   The number of raw pages that are currently available for\r
-                   use.\r
-\r
-               DX = total raw pages\r
-                   The total number of raw pages in expanded memory.\r
-\r
-\r
-          REGISTERS MODIFIED\r
-\r
-               AX, BX, DX\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                 142\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 26. Get Expanded Memory Hardware Information\r
-          Get Unallocated Raw Page Count subfunction\r
-\r
-\r
-\r
-          STATUS\r
-\r
-               AH = 0   SUCCESSFUL.\r
-                   The manager has returned the number of unallocated raw\r
-                   pages and the number of total raw pages in expanded\r
-                   memory.\r
-\r
-               AH = 80h   NON-RECOVERABLE.\r
-                   The manager detected a malfunction in the memory manager\r
-                   software.\r
-\r
-               AH = 81h   NON-RECOVERABLE.\r
-                   The manager detected a malfunction in the expanded\r
-                   memory hardware.\r
-\r
-               AH = 84h   NON-RECOVERABLE.\r
-                   The function code passed to the memory manager is not\r
-                   defined.\r
-\r
-               AH = 8Fh   NON-RECOVERABLE.\r
-                   The subfunction parameter is invalid.\r
-\r
-\r
-          EXAMPLE\r
-\r
-          unalloc_raw_pages              DW ?\r
-          total_raw_pages                DW ?\r
-\r
-          MOV   AX,5901h                 ; load function code\r
-          INT   67h                      ; call the memory manager\r
-          OR    AH,AH                    ; check EMM status\r
-          JNZ   emm_err_handler          ; jump to error handler on error\r
-          MOV   unalloc_raw_pages,BX     ; save unallocated raw page count\r
-          MOV   total_raw_pages,DX       ; save total raw page count\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                 143\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 27. Allocate Standard/Raw Pages\r
-          Allocate Standard Pages subfunction\r
-\r
-\r
-\r
-          PURPOSE\r
-\r
-               The Allocate Standard Pages subfunction allocates the number\r
-               of standard size (16K bytes) pages that the operating system\r
-               requests and assigns a unique EMM handle to these pages. \r
-               The EMM handle owns these pages until the operating system\r
-               deallocates them.  This subfunction allows you to allocate\r
-               zero pages to a handle, unlike Function 4 (Allocate Pages).\r
-\r
-          Note............................................................\r
-               This note affects expanded memory manager implementors and\r
-               operating system developers only.  Applications should not\r
-               use the following characteristic of the memory manager.  An\r
-               application violating this rule will be incompatible with\r
-               future versions of Microsoft's operating systems and\r
-               environments.\r
-\r
-               To be compatible with this specification, an expanded memory\r
-               manager will provide a special handle which is available to\r
-               the operating system only.  This handle will have a value of\r
-               0000h and will have a set of pages allocated to it when the\r
-               expanded memory manager driver installs.  The pages that the\r
-               memory manager will automatically allocate to handle 0000h\r
-               are those that backfill conventional memory.  Typically,\r
-               this backfill occurs between addresses 40000h (256K) and\r
-               9FFFFh (640K).  However, the range can extend below and\r
-               above this limit if the hardware and memory manager have the\r
-               capability.\r
-\r
-               An operating system won't have to invoke Function 27 to\r
-               obtain this handle because it can assume the handle already\r
-               exists and is available for use immediately after the\r
-               expanded memory device driver installs.  When an operating\r
-               system wants to use this handle, it uses the special handle\r
-               value of 0000h.  The operating system will be able to invoke\r
-               any EMM function using this special handle value.  To\r
-               allocate pages to this handle, the operating system need\r
-               only invoke Function 18 (Reallocate Pages).\r
-\r
-               There are two special cases for this handle:\r
-\r
-               1.  Function 27 (Allocate Standard Pages subfunction).  This\r
-                   function must never return zero as a handle value. \r
-                   Applications must always invoke Function 27 to allocate\r
-                   pages and obtain a handle which identifies the pages\r
-                   which belong to it.  Since Function 27 never returns a\r
-\r
-\r
-          EMM Functions                                                 144\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 27. Allocate Standard/Raw Pages\r
-          Allocate Standard Pages subfunction\r
-\r
-\r
-\r
-                   handle value of zero, an application will never gain\r
-                   access to this special handle.\r
-\r
-               2.  Function 6 (Deallocate Pages).  If the operating system\r
-                   uses it to deallocate the pages which are allocated to\r
-                   this handle, the pages the handle owns will be returned\r
-                   to the manager for use.  But the handle will not be\r
-                   available for reassignment.  The manager should treat a\r
-                   deallocate pages function request for this handle the\r
-                   same as a reallocate pages function request, where the\r
-                   number of pages to reallocate to this handle is zero.\r
-\r
-\r
-          CALLING PARAMETERS\r
-\r
-               AX = 5A00h\r
-                   Contains the Allocate Standard Pages subfunction.\r
-\r
-               BX = num_of_standard_pages_to_alloc\r
-                   Contains the number of standard pages the operating\r
-                   system wants to allocate.\r
-\r
-\r
-          RESULTS\r
-\r
-               These results are valid only if the status returned is zero.\r
-\r
-               DX = handle\r
-                   Contains a unique EMM handle.  The operating system must\r
-                   use this EMM handle as a parameter in any function that\r
-                   requires it.  Up to 255 handles may be obtained.  (Both\r
-                   Function 27 and Function 4 must share the same 255\r
-                   handles.)\r
-\r
-                   For all functions using this handle, the length of the\r
-                   physical and logical pages allocated to it are standard\r
-                   length (that is, 16K bytes).\r
-\r
-\r
-          REGISTERS MODIFIED\r
-\r
-               AX, DX\r
-\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                 145\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 27. Allocate Standard/Raw Pages\r
-          Allocate Standard Pages subfunction\r
-\r
-\r
-\r
-          STATUS\r
-\r
-               AH = 0   SUCCESSFUL.\r
-                   The manager has allocated the pages to an assigned EMM\r
-                   standard handle.\r
-\r
-               AH = 80h   NON-RECOVERABLE.\r
-                   The manager detected a malfunction in the memory manager\r
-                   software.\r
-\r
-               AH = 81h   NON-RECOVERABLE.\r
-                   The manager detected a malfunction in the expanded\r
-                   memory hardware.\r
-\r
-               AH = 84h   NON-RECOVERABLE.\r
-                   The function code passed to the memory manager is not\r
-                   defined.\r
-\r
-               AH = 85h   RECOVERABLE.\r
-                   All EMM handles are being used.\r
-\r
-               AH = 87h   RECOVERABLE.\r
-                   There aren't enough expanded memory pages present in the\r
-                   system to satisfy the operating system's request.\r
-\r
-               AH = 88h   RECOVERABLE.\r
-                   There aren't enough unallocated pages to satisfy the\r
-                   operating system's request.\r
-\r
-               AH = 8Fh   NON-RECOVERABLE.\r
-                   The subfunction parameter is invalid.\r
-\r
-\r
-          EXAMPLE\r
-\r
-          num_of_standard_pages_to_alloc      DW ?\r
-          emm_handle                          DW ?\r
-\r
-          MOV   BX,num_of_standard_pages_to_alloc\r
-          MOV   AX,5A00h                      ; load function code\r
-          INT   67h                           ; call the memory manager\r
-          OR    AH,AH                         ; check EMM status\r
-          JNZ   emm_err_handler               ; jump to error handler on\r
-                                              ; error\r
-          MOV   emm_handle,DX                 ; save handle\r
-\r
-\r
-\r
-          EMM Functions                                                 146\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 27. Allocate Standard/Raw Pages\r
-          Allocate Raw Pages subfunction\r
-\r
-\r
-\r
-          PURPOSE\r
-\r
-               The Allocate Raw Pages function allocates the number of non-\r
-               standard size pages that the operating system requests and\r
-               assigns a unique EMM handle to these pages.  The EMM handle\r
-               owns these pages until the operating system deallocates\r
-               them.  This function allows you to allocate zero pages to a\r
-               handle, unlike Function 4 (Allocate Pages).\r
-\r
-               A hardware vendor may design an expanded memory board that\r
-               has a page size which is a sub-multiple of 16K bytes.  A\r
-               physical page which is a sub-multiple of 16K is termed a raw\r
-               page.  The operating system may deal with page sizes which\r
-               are sub-multiples of 16K bytes.  The memory manager must\r
-               treat any function using a handle with raw pages allocated\r
-               to it by Function 27 (Allocate Raw Pages subfunction)\r
-               differently than it does a handle that has normal 16K-byte\r
-               pages allocated to it.\r
-\r
-               Handles which are assigned using Function 4 (Allocate Pages)\r
-               or Function 27 (Allocate Standard Pages subfunction) must\r
-               have pages which are 16K bytes -- this is the length of a\r
-               standard expanded memory page.  If the expanded memory board\r
-               hardware is not able to supply 16K-byte pages, the memory\r
-               manager must emulate pages which are 16K bytes combining\r
-               multiple non-standard size pages to form a single 16K-byte\r
-               page.\r
-\r
-               Handles which are assigned using Function 27 (Allocate Raw\r
-               Pages subfunction) are called raw handles.  All logical\r
-               pages allocated to a raw handle may have a non-standard\r
-               length (that is, not 16K bytes).  However, once the operat-\r
-               ing system has allocated a number of raw pages to a handle,\r
-               it is the responsibility of the memory manager to recognize\r
-               that raw handle as one that has non-standard size pages\r
-               allocated to it.  The memory manager must identify these\r
-               handles and treat all functions which use handles which have\r
-               non-standard page lengths differently.  The logical page\r
-               length becomes the length of the non-standard size page for\r
-               any raw handle that Function 27 assigns.\r
-\r
-          Note............................................................\r
-               This note affects expanded memory manager implementors and\r
-               operating system developers only.  Applications should not\r
-               use the following characteristic of the memory manager.  An\r
-               application violating this rule will be incompatible with\r
-\r
-\r
-          EMM Functions                                                 147\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 27. Allocate Standard/Raw Pages\r
-          Allocate Raw Pages subfunction\r
-\r
-\r
-\r
-               future versions of Microsoft's operating systems and\r
-               environments.\r
-\r
-               To be compatible with this specification, an expanded memory\r
-               manager will provide a special handle which is available to\r
-               the operating system only.  This handle will have a value of\r
-               0000h and will have a set of pages allocated to it when the\r
-               expanded memory manager driver installs.  The pages that the\r
-               memory manager will automatically allocate to handle 0000h\r
-               are those that backfill conventional memory.  Typically,\r
-               this backfill occurs between addresses 40000h (256K) and\r
-               9FFFFh (640K).  However, the range can extend below and\r
-               above this limit if the hardware and memory manager have the\r
-               capability.\r
-\r
-               An operating system won't have to invoke Function 27 to\r
-               obtain this handle because it can assume the handle already\r
-               exists and is available for use immediately after the\r
-               expanded memory device driver installs.  When an operating\r
-               system wants to use this handle, it uses the special handle\r
-               value of 0000h.  The operating system will be able to invoke\r
-               any EMM function using this special handle value.  To\r
-               allocate pages to this handle, the operating system need\r
-               only invoke Function 18 (Reallocate Pages).\r
-\r
-               There are two special cases for this handle:\r
-\r
-               1.  Function 27 (Allocate Raw Pages subfunction).  This\r
-                   function must never return zero as a handle value. \r
-                   Applications must always invoke Function 27 to allocate\r
-                   pages and obtain a handle which identifies the pages\r
-                   which belong to it.  Since Function 27 never returns a\r
-                   handle value of zero, an application will never gain\r
-                   access to this special handle.\r
-\r
-               2.  Function 6 (Deallocate Pages).  If the operating system\r
-                   uses it to deallocate the pages which are allocated to\r
-                   this handle, the pages the handle owns will be returned\r
-                   to the manager for use.  But the handle will not be\r
-                   available for reassignment.  The manager should treat a\r
-                   deallocate pages function request for this handle the\r
-                   same as a reallocate pages function request, where the\r
-                   number of pages to reallocate to this handle is zero.\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                 148\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 27. Allocate Standard/Raw Pages\r
-          Allocate Raw Pages subfunction\r
-\r
-\r
-\r
-          CALLING PARAMETERS\r
-\r
-               AX = 5A01h\r
-                   Contains the Allocate Raw Pages subfunction.\r
-\r
-               BX = num_of_raw_pages_to_alloc\r
-                   Contains the number of raw pages the operating system\r
-                   wishes to allocate.\r
-\r
-\r
-          RESULTS\r
-\r
-               These results are valid only if the status returned is zero.\r
-\r
-               DX = raw handle\r
-                   Contains a unique EMM raw handle.  The operating system\r
-                   must use this EMM raw handle as a parameter in any\r
-                   function that requires it.  Up to 255 handles may be\r
-                   obtained.  (Both Function 4 and Function 27 must share\r
-                   the same 255 handles).\r
-\r
-                   For all functions using this raw handle, the length of\r
-                   the physical and logical pages allocated to it may be\r
-                   non-standard (that is, not 16K bytes).\r
-\r
-\r
-          REGISTERS MODIFIED\r
-\r
-               AX, DX\r
-\r
-\r
-          STATUS\r
-\r
-               AH = 0   SUCCESSFUL.\r
-                   The manager has allocated the raw pages to an assigned\r
-                   EMM raw handle.\r
-\r
-               AH = 80h   NON-RECOVERABLE.\r
-                   The manager detected a malfunction in the memory manager\r
-                   software.\r
-\r
-               AH = 81h   NON-RECOVERABLE.\r
-                   The manager detected a malfunction in the expanded\r
-                   memory hardware.\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                 149\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 27. Allocate Standard/Raw Pages\r
-          Allocate Raw Pages subfunction\r
-\r
-\r
-\r
-               AH = 84h   NON-RECOVERABLE.\r
-                   The function code passed to the memory manager is not\r
-                   defined.\r
-\r
-               AH = 85h   RECOVERABLE.\r
-                   All EMM handles are being used.\r
-\r
-               AH = 87h   RECOVERABLE.\r
-                   There aren't enough expanded memory raw pages present in\r
-                   the system to satisfy the operating system's request.\r
-\r
-               AH = 88h   RECOVERABLE.\r
-                   There aren't enough unallocated raw pages to satisfy the\r
-                   operating system's request.\r
-\r
-               AH = 8Fh   NON-RECOVERABLE.\r
-                   The subfunction parameter is invalid.\r
-\r
-\r
-          EXAMPLE\r
-\r
-          num_of_raw_pages_to_alloc           DW ?\r
-          emm_raw_handle                      DW ?\r
-\r
-          MOV   BX,num_of_raw_pages_to_alloc\r
-          MOV   AX,5A01h                      ; load function code\r
-          INT   67h                           ; call the memory manager\r
-          OR    AH,AH                         ; check EMM status\r
-          JNZ   emm_err_handler               ; jump to error handler\r
-                                              ; on error\r
-          MOV   emm_raw_handle,DX             ; save raw handle\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                 150\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 28. Alternate Map Register Set\r
-\r
-\r
-\r
-          Note............................................................\r
-               This function is for use by operating systems only.  The\r
-               operating system can disable this function at any time. \r
-               Refer to Function 30 for a description of how an operating\r
-               system can enable or disable this function.\r
-\r
-\r
-          Design Considerations\r
-\r
-               The hardware support for the entire set of subfunctions\r
-               described is generally not present on every expanded memory\r
-               board from every vendor of expanded memory board products. \r
-               For some of the subfunctions, software emulation is provid-\r
-               ed.  For other subfunctions, a certain protocol in their use\r
-               must be observed.  The subfunctions for which this is most\r
-               crucial are those which address system DMA capabilities.\r
-\r
-\r
-          System DMA Capabilities & Expanded Memory Support of DMA\r
-\r
-               In a multitasking operating system, when one task is waiting\r
-               for DMA to complete, it is useful to be able to switch to\r
-               another task.  This specification describes a capability\r
-               which may be designed into expanded memory boards to provide\r
-               DMA into memory regions which may be mapped out while the\r
-               DMA is occurring.  For expanded memory boards that do not\r
-               provide this, it is crucial to understand that while DMA is\r
-               in progress into a region of mappable memory, the memory\r
-               mapping context cannot be changed.  That is, all DMA action\r
-               must be complete before any remapping of pages can be done.\r
-\r
-\r
-          Expanded Memory Support of DMA Register Sets\r
-\r
-               Expanded memory boards which have DMA register sets could\r
-               support DMA into a region of mappable memory while the\r
-               memory mapping context is being switched.  It is important\r
-               to realize that these DMA register sets are separate from\r
-               the alternate map register sets.  An example of how an OS/E\r
-               might use DMA register sets follows:\r
-\r
-                                      Example 1\r
-\r
-               1.  Allocate a DMA register set.\r
-\r
-               2.  Get current register set.\r
-\r
-               3.  Set the DMA register set.\r
-\r
-          EMM Functions                                                 151\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 28. Alternate Map Register Set\r
-\r
-\r
-\r
-               4.  Map in the memory desired.\r
-\r
-               5.  Get the DMA register set.\r
-\r
-               6.  Set the original register set.\r
-\r
-               7.  Assign the desired DMA channel to the DMA register set.\r
-\r
-               The preceding set of calls makes all DMA accesses for the\r
-               desired DMA channel get mapped through the current DMA\r
-               register set regardless of the current register set.  In\r
-               other words, the DMA register set overrides the current\r
-               mapping register set for DMA operations on the DMA channel\r
-               specified.  A DMA channel that is not assigned to a DMA\r
-               register set has all its DMA operations mapped through the\r
-               current mapping register set.\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                 152\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 28. Alternate Map Register Set\r
-          Get Alternate Map Register Set subfunction\r
-\r
-\r
-\r
-          Note............................................................\r
-               This function is for use by operating systems only.  The\r
-               operating system can disable this function at any time. \r
-               Refer to Function 30 for a description of how an operating\r
-               system can enable or disable this function.\r
-\r
-\r
-          PURPOSE\r
-\r
-               The subfunction does one of two things depending on the map\r
-               register set which is active at the time this function is\r
-               invoked:\r
-\r
-               1.  If the preceding Set Alternate Map Register Set call was\r
-                   done with the alternate map register set equal to zero\r
-                   (BL = 0), these points apply:\r
-\r
-                   a.  The context save area pointer saved within EMM by\r
-                       the Set Alternate Map Register subfunction is\r
-                       returned by this call.  This pointer is always\r
-                       returned for boards which do not supply alternate\r
-                       mapping register sets.\r
-\r
-                   b.  If the context save area pointer returned is not\r
-                       equal to zero, this subfunction copies the contents\r
-                       of the mapping registers on each expanded memory\r
-                       board in the system into the save area specified by\r
-                       the pointer.  The format of this save area is the\r
-                       same as that returned by Function 15 (Get Page Map\r
-                       subfunction).  This is intended to simulate getting\r
-                       an alternate map register set.  Note that the memory\r
-                       manager does not allocate the space for the context: \r
-                       the operating system must do so.\r
-\r
-                   c.  If the context save area pointer returned is equal\r
-                       to zero, this subfunction does not copy the contents\r
-                       of the mapping registers on each expanded memory\r
-                       board in the system into the save area specified by\r
-                       the pointer.\r
-\r
-                   d.  The context save area pointer must have been\r
-                       initialized by a previous Set Alternate Map Register\r
-                       Set call.  Note that the value of the context save\r
-                       area pointer saved within EMM is zero immediately\r
-                       after installation.\r
-\r
-\r
-\r
-          EMM Functions                                                 153\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 28. Alternate Map Register Set\r
-          Get Alternate Map Register Set subfunction\r
-\r
-\r
-\r
-                   e.  The context save area must be initialized by a\r
-                       previous Get Page Map call (Function 15).\r
-\r
-               2.  If the preceding Set Alternate Map Register Set call was\r
-                   done with the alternate map register set greater than\r
-                   zero (BL > 0), then the number of the alternate map\r
-                   register set which is in use at the time that this\r
-                   function is invoked is returned.  The context save area\r
-                   pointer is not returned in this case.\r
-\r
-\r
-          CALLING PARAMETERS\r
-\r
-               AX = 5B00h\r
-                   Contains the Get Alternate Map Register Set subfunction.\r
-\r
-\r
-          RESULTS\r
-\r
-               These results are valid only if the status returned is zero.\r
-\r
-               If BL <> 0, current active alternate map register set number\r
-                   Contains the alternate map register set which was active\r
-                   at the time that this function was invoked.\r
-\r
-               ES:DI   Unaffected.\r
-\r
-               If BL = 0\r
-                   Indicates that a pointer to an area which contains the\r
-                   state of all the map registers on all boards in the\r
-                   system, and any additional information necessary to\r
-                   restore the boards to their original state, has been\r
-                   returned.\r
-\r
-               ES:DI = pointer to a map register context save area\r
-                   Contains a pointer to an operating system supplied\r
-                   context save area.  The pointer is in standard seg-\r
-                   ment:offset format.  This pointer is always returned if\r
-                   the expanded memory hardware does not supply alternate\r
-                   mapping register sets.\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                 154\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 28. Alternate Map Register Set\r
-          Get Alternate Map Register Set subfunction\r
-\r
-\r
-\r
-                   The operating system first passes this pointer to the\r
-                   memory manager whenever it invokes a Set Alternate Map\r
-                   Register Set subfunction (the description follows).  If\r
-                   the OS/E invokes this function before invoking a Set\r
-                   Alternate Map Register Set subfunction, this function\r
-                   returns a pointer value of zero.  The OS/E must have\r
-                   allocated the space for the save area.  However, the OS\r
-                   must request that the memory manager initialize the\r
-                   contents of this save area before it contains any useful\r
-                   information.\r
-\r
-                   The OS/E must initialize the save area it has allocated\r
-                   by invoking Function 15 (Get Page Map subfunction). \r
-                   After the OS/E has done this, the save area will contain\r
-                   the state of all the map registers on all boards in the\r
-                   system.  The save area will also contain any additional\r
-                   information necessary to restore the boards to their\r
-                   original state when the operating system invokes a Set\r
-                   Alternate Map Register Set subfunction.\r
-\r
-\r
-          REGISTERS MODIFIED\r
-\r
-               AX, BX, ES:DI\r
-\r
-\r
-          STATUS\r
-\r
-               AH = 0   SUCCESSFUL.\r
-                   The manager got the alternate map register set.\r
-\r
-               AH = 80h   NON-RECOVERABLE.\r
-                   The manager detected a malfunction in the memory manager\r
-                   software.\r
-\r
-               AH = 81h   NON-RECOVERABLE.\r
-                   The manager detected a malfunction in the expanded\r
-                   memory hardware.\r
-\r
-               AH = 84h   NON-RECOVERABLE.\r
-                   The function code passed to the memory manager is not\r
-                   defined.\r
-\r
-               AH = 8Fh   NON-RECOVERABLE.\r
-                   The subfunction parameter is invalid.\r
-\r
-\r
-\r
-          EMM Functions                                                 155\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 28. Alternate Map Register Set\r
-          Get Alternate Map Register Set subfunction\r
-\r
-\r
-\r
-               AH = A4h   NON-RECOVERABLE.\r
-                   The operating system denied access to this function. \r
-                   The function cannot be used at this time.\r
-\r
-\r
-          EXAMPLE\r
-\r
-          alt_map_reg_set                        DB ?\r
-          context_save_area_ptr_seg              DW ?\r
-          context_save_area_ptr_offset           DW ?\r
-\r
-          MOV   AX,5B00h                         ; load function code\r
-          INT   67h                              ; call the memory manager\r
-          OR    AH,AH                            ; check EMM status\r
-          JNZ   emm_err_handler                  ; jump to error handler\r
-                                                 ; on error\r
-          MOV   alt_map_reg_set,BL\r
-          TEST  BL,BL\r
-          JNZ   no_ptr_returned\r
-\r
-          MOV   context_save_area_ptr_seg,ES     ; save pointer values\r
-          MOV   context_save_area_ptr_offset,DI\r
-\r
-          no_ptr_returned:\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                 156\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 28. Alternate Map Register Set\r
-          Set Alternate Map Register Set subfunction\r
-\r
-\r
-\r
-          Note............................................................\r
-               This function is for use by operating systems only.  The\r
-               operating system can disable this function at any time. \r
-               Refer to Function 30 for a description of how an operating\r
-               system can enable or disable this function.\r
-\r
-\r
-          PURPOSE\r
-\r
-               The subfunction does one of two things, depending on the map\r
-               register set specified:\r
-\r
-               1.  If the alternate map register set specified is zero, map\r
-                   register set zero is activated.  If the map register\r
-                   context restore area pointer is not equal to zero, the\r
-                   contents of the restore area pointed to by ES:DI are\r
-                   copied into register set zero on each expanded memory\r
-                   board in the system.  If the pointer is equal to zero,\r
-                   the contents are not copied.\r
-\r
-                   Regardless of its value, the map register context\r
-                   restore area pointer is saved within the memory manager. \r
-                   It will be used during the Get Alternate Map Register\r
-                   Set subfunction.\r
-\r
-                   The operating system must supply the pointer to the\r
-                   area.  This subfunction is intended to simulate setting\r
-                   an alternate map register set.  Note that the operating\r
-                   system must allocate the space for the context.  The\r
-                   memory manager saves the context save area pointer\r
-                   internally.\r
-\r
-               2.  If the alternate map register set specified is not zero,\r
-                   the alternate map register set specified is activated. \r
-                   The restore area, which the operating system is pointing\r
-                   to, is not used.\r
-\r
-\r
-          CALLING PARAMETERS\r
-\r
-               AX = 5B01h\r
-                   Contains the Set Alternate Map Register Set subfunction.\r
-\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                 157\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 28. Alternate Map Register Set\r
-          Set Alternate Map Register Set subfunction\r
-\r
-\r
-\r
-               BL = new alternate map register set number\r
-                   Contains the number of the alternate map register set\r
-                   which is to be activated.\r
-\r
-                   If BL <> 0\r
-                       A pointer to a map register context restore area is\r
-                       not required and the contents of ES:DI is unaffected\r
-                       and ignored.  The alternate map register set\r
-                       specified in BL is activated if the board supports\r
-                       it.\r
-\r
-                   If BL = 0\r
-                       A pointer to an area which contains the state of all\r
-                       the map registers on all boards in the system, and\r
-                       any additional information necessary to restore the\r
-                       boards to their original state, has been passed in\r
-                       ES:DI.\r
-\r
-               ES:DI = pointer to a map register context restore area\r
-                   Contains a pointer to an OS/E supplied map register\r
-                   context restore area.  The pointer is in standard\r
-                   segment:offset format.  This pointer must always be\r
-                   passed if the expanded memory hardware does not supply\r
-                   alternate mapping register sets.\r
-\r
-                   The memory manager must save this pointer whenever the\r
-                   OS/E invokes this function.  The OS/E must have allo-\r
-                   cated the space for the restore area.  Additionally, the\r
-                   contents of this restore area must have been initialized\r
-                   by the memory manager before it will contain any useful\r
-                   information.  The OS/E initializes the restore area it\r
-                   has allocated by invoking Function 15 (Get Page Map\r
-                   subfunction).  After the OS/E has done this, the restore\r
-                   area will contain the state of the map registers on all\r
-                   boards in the system, and any additional information\r
-                   necessary to restore the boards to their original state\r
-                   when the operating system invokes a Set Alternate Map\r
-                   Register Set subfunction.\r
-\r
-\r
-          REGISTERS MODIFIED\r
-\r
-               AX\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                 158\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 28. Alternate Map Register Set\r
-          Set Alternate Map Register Set subfunction\r
-\r
-\r
-\r
-          STATUS\r
-\r
-               AH = 0   SUCCESSFUL.\r
-                   The manager set the alternate map register set.\r
-\r
-               AH = 80h   NON-RECOVERABLE.\r
-                   The manager detected a malfunction in the memory manager\r
-                   software.\r
-\r
-               AH = 81h   NON-RECOVERABLE.\r
-                   The manager detected a malfunction in the expanded\r
-                   memory hardware.\r
-\r
-               AH = 84h   NON-RECOVERABLE.\r
-                   The function code passed to the memory manager is not\r
-                   defined.\r
-\r
-               AH = 8Fh   NON-RECOVERABLE.\r
-                   The subfunction parameter is invalid.\r
-\r
-               AH = 9Ah   NON-RECOVERABLE.\r
-                   Alternate map register sets are supported, but the\r
-                   alternate map register set specified is not supported.\r
-\r
-               AH = 9Ch   NON-RECOVERABLE.\r
-                   Alternate map register sets are not supported, and the\r
-                   alternate map register set specified is not zero.\r
-\r
-               AH = 9Dh   NON-RECOVERABLE.\r
-                   Alternate map register sets are supported, but the\r
-                   alternate map register set specified is either not\r
-                   defined or not allocated.\r
-\r
-               AH = A3h   NON-RECOVERABLE.\r
-                   The contents of the source array have been corrupted, or\r
-                   the pointer passed to the subfunction is invalid.\r
-\r
-               AH = A4h   NON-RECOVERABLE.\r
-                   The operating system has denied access to this function. \r
-                   The function cannot be used at this time.\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                 159\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 28. Alternate Map Register Set\r
-          Set Alternate Map Register Set subfunction\r
-\r
-\r
-\r
-          EXAMPLE\r
-\r
-          alt_map_reg_set                        DB ?\r
-          context_restore_area_ptr_seg           DW ?\r
-          context_restore_area_ptr_offset        DW ?\r
-\r
-          MOV   AX,5B01h                         ; load function code\r
-          MOV   BL,alt_map_reg_set\r
-          TEST  BL,BL\r
-          JZ    no_ptr_passed\r
-\r
-          MOV   ES,context_restore_area_ptr_seg\r
-          MOV   DI,context_restore_area_ptr_offset\r
-\r
-          no_ptr_passed:\r
-\r
-          INT   67h                              ; call the memory manger\r
-          OR    AH,AH                            ; check EMM status\r
-          JNZ   emm_err_handler                  ; jump to error handler\r
-                                                 ; on error\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                 160\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 28. Alternate Map Register Set\r
-          Get Alternate Map Save Array Size subfunction\r
-\r
-\r
-\r
-          Note............................................................\r
-               This function is for use by operating systems only.  The\r
-               operating system can disable this function at any time. \r
-               Refer to Function 30 for a description of how an operating\r
-               system can enable or disable this function.\r
-\r
-\r
-          PURPOSE\r
-\r
-               This subfunction returns the storage requirements for the\r
-               map register context save area referenced by the other\r
-               subfunctions.\r
-\r
-\r
-          CALLING PARAMETERS\r
-\r
-               AX = 5B02h\r
-                   Contains the Get Alternate Map Save Array Size subfunc-\r
-                   tion.\r
-\r
-\r
-          RESULTS\r
-\r
-               These results are valid only if the status returned is zero.\r
-\r
-               DX = size_of_array\r
-                   Contains the number of bytes that will be transferred to\r
-                   the memory area supplied by an operating system whenever\r
-                   an operating system requests the Get, Set, or Get and\r
-                   Set subfunction.\r
-\r
-\r
-          REGISTERS MODIFIED\r
-\r
-               AX, DX\r
-\r
-\r
-          STATUS\r
-\r
-               AH = 0   SUCCESSFUL.\r
-                   The manager has returned the array size.\r
-\r
-               AH = 80h   NON-RECOVERABLE.\r
-                   The manager detected a malfunction in the memory manager\r
-                   software.\r
-\r
-\r
-\r
-          EMM Functions                                                 161\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 28. Alternate Map Register Set\r
-          Get Alternate Map Save Array Size subfunction\r
-\r
-\r
-\r
-               AH = 81h   NON-RECOVERABLE.\r
-                   The manager detected a malfunction in the expanded\r
-                   memory hardware.\r
-\r
-               AH = 84h   NON-RECOVERABLE.\r
-                   The function code passed to the memory manager is not\r
-                   defined.\r
-\r
-               AH = 8Fh   NON-RECOVERABLE.\r
-                   The subfunction parameter is invalid.\r
-\r
-               AH = A4h   NON-RECOVERABLE.\r
-                   The operating system has denied access to this function. \r
-                   The function cannot be used at this time.\r
-\r
-\r
-          EXAMPLE\r
-\r
-          size_of_array                  DW ?\r
-\r
-          MOV   AX,5B02h                 ; load function code\r
-          INT   67h                      ; call the memory manager\r
-          OR    AH,AH                    ; check EMM status\r
-          JNZ   emm_err_handler          ; jump to error handler on error\r
-          MOV   size_of_array,DX         ; save size of array\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                 162\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 28. Alternate Map Register Set\r
-          Allocate Alternate Map Register Set subfunction\r
-\r
-\r
-\r
-          Note............................................................\r
-               This function is for use by operating systems only.  The\r
-               operating system can disable this function at any time. \r
-               Refer to Function 30 for a description of how an operating\r
-               system can enable or disable this function.\r
-\r
-\r
-          PURPOSE\r
-\r
-               The Allocate Alternate Map Register Set subfunction gets the\r
-               number of an alternate map register set for an operating\r
-               system if an alternate map register set is currently\r
-               available for use.  If the hardware does not support\r
-               alternate map register sets, an alternate map register set\r
-               number of zero will be returned.\r
-\r
-               The alternate map register set allocated may be referred to\r
-               by this number when using the Get or Set Alternate Map\r
-               Register Set subfunctions.  The operating system can use\r
-               these subfunctions to switch map contexts very rapidly on\r
-               expanded memory boards with alternate map register sets.\r
-\r
-               This subfunction copies the currently active alternate map\r
-               register set's contents into the newly allocated alternate\r
-               map register set's mapping registers.  This is done so that\r
-               when the OS/E performs a Set Alternate Map Register Set\r
-               subfunction the memory mapped before the allocation of the\r
-               new alternate map will be available for reading and writing. \r
-               This function does not actually change the alternate map\r
-               register set in use, but in addition to allocating a new\r
-               alternate map register set, it prepares the new alternate\r
-               map register set for a subsequent Set Alternate Map Register\r
-               Set subfunction.\r
-\r
-\r
-          CALLING PARAMETERS\r
-\r
-               AX = 5B03h\r
-                   Contains the Allocate Alternate Map Register Set\r
-                   subfunction.\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                 163\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 28. Alternate Map Register Set\r
-          Allocate Alternate Map Register Set subfunction\r
-\r
-\r
-\r
-          RESULTS\r
-\r
-               These results are valid only if the status returned is zero.\r
-\r
-               BL = alternate map register set number\r
-                   Contains the number of an alternate map register set. \r
-                   If there are no alternate map register sets supported by\r
-                   the hardware, a zero will be returned.  In this case,\r
-                   the Get Alternate Map function (Function 28) should be\r
-                   invoked in order to obtain a pointer to a map register\r
-                   context save area.  The OS/E must supply this area.  The\r
-                   save area is necessary because the hardware doesn't\r
-                   support alternate map register sets.\r
-\r
-\r
-          REGISTERS MODIFIED\r
-\r
-               AX, BX\r
-\r
-\r
-          STATUS\r
-\r
-               AH = 0   SUCCESSFUL.\r
-                   The manager has returned the alternate map register set\r
-                   number.\r
-\r
-               AH = 80h   NON-RECOVERABLE.\r
-                   The manager detected a malfunction in the memory manager\r
-                   software.\r
-\r
-               AH = 81h   NON-RECOVERABLE.\r
-                   The manager detected a malfunction in the expanded\r
-                   memory hardware.\r
-\r
-               AH = 84h   NON-RECOVERABLE.\r
-                   The function code passed to the memory manager is not\r
-                   defined.\r
-\r
-               AH = 8Fh   NON-RECOVERABLE.\r
-                   The subfunction parameter is invalid.\r
-\r
-               AH = 9Bh   NON-RECOVERABLE.\r
-                   Alternate map register sets are supported.  However, all\r
-                   alternate map register sets are currently allocated.\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                 164\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 28. Alternate Map Register Set\r
-          Allocate Alternate Map Register Set subfunction\r
-\r
-\r
-\r
-               AH = A4h   NON-RECOVERABLE.\r
-                   The operating system has denied access to this function. \r
-                   The function cannot be used at this time.\r
-\r
-\r
-          EXAMPLE\r
-\r
-          alt_map_reg_num                DB ?\r
-\r
-          MOV   AX,5B03h                 ; load function code\r
-          INT   67h                      ; call the memory manager\r
-          OR    AH,AH                    ; check EMM status\r
-          JNZ   emm_err_handler          ; jump to error handler on error\r
-          MOV   alt_map_reg_num,BL       ; save number of\r
-                                         ; alternate map register set\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                 165\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 28. Alternate Map Register Set\r
-          Deallocate Alternate Map Register Set subfunction\r
-\r
-\r
-\r
-          Note............................................................\r
-               This function is for use by operating systems only.  The\r
-               operating system can disable this function at any time. \r
-               Refer to Function 30 for a description of how an operating\r
-               system can enable or disable this function.\r
-\r
-\r
-          PURPOSE\r
-\r
-               The Deallocate Alternate Map Register Set subfunction\r
-               returns the alternate map register set to the memory manager\r
-               for future use.  The memory manager may reallocate the\r
-               alternate map register set when needed.\r
-\r
-               This subfunction also makes the mapping context of the\r
-               alternate map register specified unavailable for reading or\r
-               writing (unmapping).  This protects the pages previously\r
-               mapped in an alternate map register set by making them\r
-               inaccessible.  Note that the current alternate map register\r
-               set cannot be deallocated.  This makes all memory which was\r
-               currently mapped into conventional and expanded memory\r
-               inaccessible.\r
-\r
-\r
-          CALLING PARAMETERS\r
-\r
-               AX = 5B04h\r
-                   Contains the Deallocate Alternate Map Register Set\r
-                   subfunction.\r
-\r
-               BL = alternate register set number\r
-                   Contains the number of the alternate map register set to\r
-                   deallocate.  Map register set zero cannot be allocated\r
-                   or deallocated.  However, if alternate map register set\r
-                   zero is specified and this subfunction is invoked, no\r
-                   error will be returned.  The function invocation is\r
-                   ignored in this case.\r
-\r
-\r
-          REGISTERS MODIFIED\r
-\r
-               AX\r
-\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                 166\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 28. Alternate Map Register Set\r
-          Deallocate Alternate Map Register Set subfunction\r
-\r
-\r
-\r
-          STATUS\r
-\r
-               AH = 0   SUCCESSFUL.\r
-                   The manager has deallocated the alternate map register\r
-                   set.\r
-\r
-               AH = 80h   NON-RECOVERABLE.\r
-                   The manager detected a malfunction in the memory manager\r
-                   software.\r
-\r
-               AH = 81h   NON-RECOVERABLE.\r
-                   The manager detected a malfunction in the expanded\r
-                   memory hardware.\r
-\r
-               AH = 84h   NON-RECOVERABLE.\r
-                   The function code passed to the memory manager is not\r
-                   defined.\r
-\r
-               AH = 8Fh   NON-RECOVERABLE.\r
-                   The subfunction parameter is invalid.\r
-\r
-               AH = 9Ch   NON-RECOVERABLE.\r
-                   Alternate map register sets are not supported and the\r
-                   alternate map register set specified is not zero.\r
-\r
-               AH = 9Dh   NON-RECOVERABLE.\r
-                   Alternate map register sets are supported, but the\r
-                   alternate map register set specified is either not\r
-                   defined or not allocated.\r
-\r
-               AH = A4h   NON-RECOVERABLE.\r
-                   The operating system has denied access to this function. \r
-                   The function cannot be used at this time.\r
-\r
-\r
-          EXAMPLE\r
-\r
-          alternate_map_reg_set               DB ?\r
-\r
-          MOV   BL,alternate_map_reg_set      ; specify alternate map\r
-                                              ; register set\r
-          MOV   AX,5B04h                      ; load function code\r
-          INT   67h                           ; call the memory manager\r
-          OR    AH,AH                         ; check EMM status\r
-          JNZ   emm_err_handler               ; jump to error handler\r
-                                              ; on error\r
-\r
-\r
-          EMM Functions                                                 167\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 28. Alternate Map Register Set\r
-          Allocate DMA Register Set subfunction\r
-\r
-\r
-\r
-          Note............................................................\r
-               This function is for use by operating systems only.  The\r
-               operating system can disable this function at any time. \r
-               Refer to Function 30 for a description of how an operating\r
-               system can enable or disable this function.\r
-\r
-\r
-          PURPOSE\r
-\r
-               The Allocate DMA Register Set subfunction gets the number of\r
-               a DMA register set for an OS/E, if a DMA register set is\r
-               currently available for use.  If the hardware does not\r
-               support DMA register sets, a DMA register set number of zero\r
-               will be returned.\r
-\r
-               In a multitasking operating system, when one task is waiting\r
-               for DMA to complete, it is useful to be able to switch to\r
-               another task.  However, if the DMA is being mapped through\r
-               the current register set, the switching cannot occur.  That\r
-               is, all DMA action must be complete before any remapping of\r
-               pages can be done.\r
-\r
-               The operating system would initiate a DMA operation on a\r
-               specific DMA channel using a specific alternate map register\r
-               set.  This alternate map register set would not be used\r
-               again, by the operating system or an application, until\r
-               after the DMA operation is complete.  The operating system\r
-               guarantees this by not changing the contents of the alter-\r
-               nate map register set, or allowing an application to change\r
-               the contents of the alternate map register set, for the\r
-               duration of the DMA operation.\r
-\r
-\r
-          CALLING PARAMETERS\r
-\r
-               AX = 5B05h\r
-                   Contains the Allocate DMA Register Set subfunction.\r
-\r
-\r
-          RESULTS\r
-\r
-               These results are valid only if the status returned is zero.\r
-\r
-               BL = DMA register set number\r
-                   Contains the number of a DMA register set.  If there are\r
-                   no DMA register sets supported by the hardware, a zero\r
-                   will be returned.\r
-\r
-          EMM Functions                                                 168\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 28. Alternate Map Register Set\r
-          Allocate DMA Register Set subfunction\r
-\r
-\r
-\r
-          REGISTERS MODIFIED\r
-\r
-               AX, BX\r
-\r
-\r
-          STATUS\r
-\r
-               AH = 0   SUCCESSFUL.\r
-                   The manager has allocated the DMA register set.\r
-\r
-               AH = 80h   NON-RECOVERABLE.\r
-                   The manager detected a malfunction in the memory manager\r
-                   software.\r
-\r
-               AH = 81h   NON-RECOVERABLE.\r
-                   The manager detected a malfunction in the expanded\r
-                   memory hardware.\r
-\r
-               AH = 84h   NON-RECOVERABLE.\r
-                   The function code passed to the memory manager is not\r
-                   defined.\r
-\r
-               AH = 8Fh   NON-RECOVERABLE.\r
-                   The subfunction parameter is invalid.\r
-\r
-               AH = 9Bh   NON-RECOVERABLE.\r
-                   DMA register sets are supported.  However, all DMA\r
-                   register sets are currently allocated.\r
-\r
-               AH = A4h   NON-RECOVERABLE.\r
-                   Access to this function has been denied by the operating\r
-                   system.  The function cannot be used at this time.\r
-\r
-\r
-          EXAMPLE\r
-\r
-          DMA_reg_set_number                  DB ?\r
-\r
-          MOV   AX,5B05h                      ; load function code\r
-          INT   67h                           ; call memory manager\r
-          OR    AH,AH                         ; check EMM status\r
-          JNZ   emm_err_handler               ; jump to error handler\r
-                                              ; on error\r
-          MOV   DMA_reg_set_number,BL         ; save number of DMA\r
-                                              ; register set\r
-\r
-\r
-\r
-          EMM Functions                                                 169\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 28. Alternate Map Register Set\r
-          Enable DMA on Alternate Map Register Set subfunction\r
-\r
-\r
-\r
-          Note............................................................\r
-               This function is for use by operating systems only.  The\r
-               operating system can disable this function at any time. \r
-               Refer to Function 30 for a description of how an operating\r
-               system can enable or disable this function.\r
-\r
-\r
-          PURPOSE\r
-\r
-               This subfunction allows DMA accesses on a specific DMA\r
-               channel to be associated with a specific alternate map\r
-               register set.  In a multitasking operating system, when a\r
-               task is waiting for the completion of DMA, it is useful to\r
-               be able to switch to another task until the DMA operation\r
-               completes.\r
-\r
-               Any DMA on the specified channel will go through the speci-\r
-               fied DMA register set regardless of the current register\r
-               set.  If a DMA channel is not assigned to a DMA register\r
-               set, DMA for that channel will be mapped through the current\r
-               register set.\r
-\r
-\r
-          CALLING PARAMETERS\r
-\r
-               AX = 5B06h\r
-                   Contains the Enable DMA on Alternate Map Register Set\r
-                   subfunction.\r
-\r
-               BL = DMA register set number\r
-                   Contains the number of the alternate map register set to\r
-                   be used for DMA operations on the DMA channel specified\r
-                   by DL.  If the alternate map register set specified is\r
-                   zero, no special action will be taken on DMA accesses\r
-                   for the DMA channel specified.\r
-\r
-               DL = DMA channel number\r
-                   Contains the DMA channel which is to be associated with\r
-                   the DMA map register set specified in BL.\r
-\r
-\r
-          REGISTERS MODIFIED\r
-\r
-               AX\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                 170\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 28. Alternate Map Register Set\r
-          Enable DMA on Alternate Map Register Set subfunction\r
-\r
-\r
-\r
-          STATUS\r
-\r
-               AH = 0   SUCCESSFUL.\r
-                   The manager has enabled DMA on the DMA register set and\r
-                   the DMA channel specified.\r
-\r
-               AH = 80h   NON-RECOVERABLE.\r
-                   The manager detected a malfunction in the memory manager\r
-                   software.\r
-\r
-               AH = 81h   NON-RECOVERABLE.\r
-                   The manager detected a malfunction in the expanded\r
-                   memory hardware.\r
-\r
-               AH = 84h   NON-RECOVERABLE.\r
-                   The function code passed to the memory manager is not\r
-                   defined.\r
-\r
-               AH = 8Fh   NON-RECOVERABLE.\r
-                   The subfunction parameter is invalid.\r
-\r
-               AH = 9Ah   NON-RECOVERABLE.\r
-                   Alternate DMA register sets are supported, but the\r
-                   alternate DMA register set specified is not supported.\r
-\r
-               AH = 9Ch   NON-RECOVERABLE.\r
-                   Alternate DMA register sets are not supported, and the\r
-                   DMA register set specified is not zero.\r
-\r
-               AH = 9Dh   NON-RECOVERABLE.\r
-                   DMA register sets are supported, but the DMA register\r
-                   set specified is either not defined or not allocated.\r
-\r
-               AH = 9Eh   NON-RECOVERABLE.\r
-                   Dedicated DMA channels are not supported.\r
-\r
-               AH = 9Fh   NON-RECOVERABLE.\r
-                   Dedicated DMA channels are supported, but the DMA\r
-                   channel specified is not supported.\r
-\r
-               AH = A4h   NON-RECOVERABLE.\r
-                   The operating system has denied access to this function. \r
-                   The function cannot be used at this time.\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                 171\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 28. Alternate Map Register Set\r
-          Enable DMA on Alternate Map Register Set subfunction\r
-\r
-\r
-\r
-          EXAMPLE\r
-\r
-          alt_map_reg_set                DB ?\r
-          DMA_channel_num                DB ?\r
-\r
-          MOV   BL,alt_map_reg_set\r
-          MOV   DL,DMA_channel_num\r
-          MOV   AX,5B06h                 ; load function code\r
-          INT   67h                      ; call the memory manager\r
-          OR    AH,AH                    ; check EMM status\r
-          JNZ   emm_err_handler          ; jump to error handler on error\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                 172\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 28. Alternate Map Register Set\r
-          Disable DMA on Alternate Map Register Set subfunction\r
-\r
-\r
-\r
-          Note............................................................\r
-               This function is for use by operating systems only.  The\r
-               operating system can disable this function at any time. \r
-               Refer to Function 30 for a description of how an operating\r
-               system can enable or disable this function.\r
-\r
-\r
-          PURPOSE\r
-\r
-               This subfunction disables DMA accesses for all DMA channels\r
-               which were associated with a specific alternate map register\r
-               set.\r
-\r
-\r
-          CALLING PARAMETERS\r
-\r
-               AX = 5B07h\r
-                   Contains the Disable DMA on Alternate Map Register Set\r
-                   subfunction.\r
-\r
-               BL = alternate register set number\r
-                   Contains the number of the DMA register set for which\r
-                   all operations are to be disabled.  If the alternate map\r
-                   register set specified is zero, no action will be taken.\r
-\r
-\r
-          REGISTERS MODIFIED\r
-\r
-               AX\r
-\r
-\r
-          STATUS\r
-\r
-               AH = 0   SUCCESSFUL.\r
-                   The manager has disabled DMA operations on the alternate\r
-                   DMA register set.\r
-\r
-               AH = 80h   NON-RECOVERABLE.\r
-                   The manager detected a malfunction in the memory manager\r
-                   software.\r
-\r
-               AH = 81h   NON-RECOVERABLE.\r
-                   The manager detected a malfunction in the expanded\r
-                   memory hardware.\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                 173\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 28. Alternate Map Register Set\r
-          Disable DMA on Alternate Map Register Set subfunction\r
-\r
-\r
-\r
-               AH = 84h   NON-RECOVERABLE.\r
-                   The function code passed to the memory manager is not\r
-                   defined.\r
-\r
-               AH = 8Fh   NON-RECOVERABLE.\r
-                   The subfunction parameter is invalid.\r
-\r
-               AH = 9Ah   NON-RECOVERABLE.\r
-                   Alternate DMA register sets are supported, but the\r
-                   alternate DMA register set specified is not supported.\r
-\r
-               AH = 9Ch   NON-RECOVERABLE.\r
-                   Alternate DMA register sets are not supported, and the\r
-                   DMA register set specified is not zero.\r
-\r
-               AH = 9Dh   NON-RECOVERABLE.\r
-                   DMA register sets are supported, but the DMA register\r
-                   set specified is either not defined or not allocated.\r
-\r
-               AH = 9Eh   NON-RECOVERABLE.\r
-                   Dedicated DMA channels are not supported.\r
-\r
-               AH = 9Fh   NON-RECOVERABLE.\r
-                   Dedicated DMA channels are supported, but the DMA\r
-                   channel specified is not supported.\r
-\r
-               AH = A4h   NON-RECOVERABLE.\r
-                   The operating system has denied access to this function. \r
-                   The function cannot be used at this time.\r
-\r
-\r
-          EXAMPLE\r
-\r
-          DMA_reg_set                    DB ?\r
-\r
-          MOV   BL,DMA_reg_set\r
-          MOV   AX,5B07h                 ; load function code\r
-          INT   67h                      ; call the memory manager\r
-          OR    AH,AH                    ; check EMM status\r
-          JNZ   emm_err_handler          ; jump to error handler on error\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                 174\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 28. Alternate Map Register Set\r
-          Deallocate DMA Register Set subfunction\r
-\r
-\r
-\r
-          Note............................................................\r
-               This function is for use by operating systems only.  The\r
-               operating system can disable this function at any time. \r
-               Refer to Function 30 for a description of how an operating\r
-               system can enable or disable this function.\r
-\r
-\r
-          PURPOSE\r
-\r
-               The Deallocate DMA Register Set subfunction deallocates the\r
-               specified DMA register set.\r
-\r
-\r
-          CALLING PARAMETERS\r
-\r
-               AX = 5B08h\r
-                   Contains the Deallocate DMA Register Set subfunction.\r
-\r
-               BL = DMA register set number\r
-                   Contains the number of the DMA register set which should\r
-                   not be used for DMA operations any longer.  The DMA\r
-                   register set would have been previously allocated and\r
-                   enabled for DMA operations on a specific DMA channel. \r
-                   If the DMA register set specified is zero, no action\r
-                   will be taken.\r
-\r
-\r
-          REGISTERS MODIFIED\r
-\r
-               AX\r
-\r
-\r
-          STATUS\r
-\r
-               AH = 0   SUCCESSFUL.\r
-                   The manager has deallocated the DMA register set.\r
-\r
-               AH = 80h   NON-RECOVERABLE.\r
-                   The manager detected a malfunction in the memory manager\r
-                   software.\r
-\r
-               AH = 81h   NON-RECOVERABLE.\r
-                   The manager detected a malfunction in the expanded\r
-                   memory hardware.\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                 175\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 28. Alternate Map Register Set\r
-          Deallocate DMA on Alternate Map Register Set subfunction\r
-\r
-\r
-\r
-               AH = 84h   NON-RECOVERABLE.\r
-                   The function code passed to the memory manager is not\r
-                   defined.\r
-\r
-               AH = 8Fh   NON-RECOVERABLE.\r
-                   The subfunction parameter is invalid.\r
-\r
-               AH = 9Ch   NON-RECOVERABLE.\r
-                   DMA register sets are not supported, and the DMA\r
-                   register set specified is not zero.\r
-\r
-               AH = 9Dh   NON-RECOVERABLE.\r
-                   DMA register sets are supported, but the DMA register\r
-                   set specified is either not defined or not allocated.\r
-\r
-               AH = A4h   NON-RECOVERABLE.\r
-                   The operating system has denied access to this function. \r
-                   The function cannot be used at this time.\r
-\r
-\r
-          EXAMPLE\r
-\r
-          DMA_reg_set_num                DB ?\r
-\r
-          MOV   BL,DMA_reg_set_num\r
-          MOV   AX,5B08h                 ; load function code\r
-          INT   67h                      ; call the memory manager\r
-          OR    AH,AH                    ; check EMM status\r
-          JNZ   emm_err_handler          ; jump to error handler on error\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                 176\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 29. Prepare Expanded Memory Hardware For Warm Boot\r
-\r
-\r
-\r
-          PURPOSE\r
-\r
-               This function prepares the expanded memory hardware for an\r
-               impending warm boot.  This function assumes that the next\r
-               operation that the operating system performs is a warm boot\r
-               of the system.  In general, this function will effect the\r
-               current mapping context, the alternate register set in use,\r
-               and any other expanded memory hardware dependencies which\r
-               need to be initialized at boot time.  If an application\r
-               decides to map memory below 640K, the application must trap\r
-               all possible conditions leading to a warm boot and invoke\r
-               this function before performing the warm boot itself.\r
-\r
-\r
-          CALLING PARAMETERS\r
-\r
-               AH = 5Ch\r
-                   Contains the Prepare Expanded Memory Hardware for Warm\r
-                   Boot function.\r
-\r
-\r
-          REGISTERS MODIFIED\r
-\r
-               AX\r
-\r
-\r
-          STATUS\r
-\r
-               AH = 0   SUCCESSFUL.\r
-                   The manager has prepared the expanded memory hardware\r
-                   for a warm boot.\r
-\r
-               AH = 80h   NON-RECOVERABLE.\r
-                   The manager detected a malfunction in the memory manager\r
-                   software.\r
-\r
-               AH = 81h   NON-RECOVERABLE.\r
-                   The manager detected a malfunction in the expanded\r
-                   memory hardware.\r
-\r
-               AH = 84h   NON-RECOVERABLE.\r
-                   The function code passed to the memory manager is not\r
-                   defined.\r
-\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                 177\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 29. Prepare Expanded Memory Hardware for Warm Boot\r
-\r
-\r
-\r
-          EXAMPLE\r
-\r
-          MOV   AH,5Ch                   ; load function code\r
-          INT   67h                      ; call the memory manager\r
-          OR    AH,AH                    ; check EMM status\r
-          JNZ   emm_err_handler          ; jump to error handler on error\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                 178\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 30. Enable/Disable OS/E Function Set Functions\r
-          Enable OS/E Function Set subfunction\r
-\r
-\r
-\r
-          Note............................................................\r
-               This function is for use by operating systems only.  The\r
-               operating system can disable this function at any time.\r
-\r
-\r
-          PURPOSE\r
-\r
-               This subfunction provides an OS/E with the ability to enable\r
-               all programs or device drivers to use the OS/E specific\r
-               functions.  The capability is provided only for an OS/E\r
-               which manages regions of mappable conventional memory and\r
-               cannot permit programs to use any of the functions which\r
-               affect mappable conventional memory regions, but must be\r
-               able to use these functions itself.  When an OS/E disables\r
-               these functions and a program attempts to use them, the\r
-               memory manager returns a status to the program indicating\r
-               that the OS/E has denied the program access to the function. \r
-               In other words, the functions will not work when disabled. \r
-               However, all programs may use them when enabled.\r
-\r
-               The OS/E (Operating System/Environment) functions this\r
-               subfunction enables are:\r
-\r
-               Function 26.  Get Expanded Memory Hardware Information.\r
-               Function 28.  Alternate Map Register Sets.\r
-               Function 30.  Enable/Disable Operating System Functions.\r
-\r
-               It appears contradictory that the OS/E can re-enable these\r
-               functions when the function which re-enables them is itself\r
-               disabled.  An overview of the process follows.\r
-\r
-               The memory manager enables all the OS/E specific functions,\r
-               including this one, when it is loaded.  The OS/E gets\r
-               exclusive access to these functions by invoking either of\r
-               the Enable/Disable OS/E Function Set subfunctions before any\r
-               other software does.\r
-\r
-               On the first invocation of either of these subfunctions, the\r
-               memory manager returns an access_key which the OS/E must use\r
-               in all future invocations of either of these subfunctions. \r
-               The memory manager does not require the access_key on the\r
-               first invocation of the Enable/Disable OS/E Function Set\r
-               subfunctions.\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                 179\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 30. Enable/Disable OS/E Function Set Functions\r
-          Enable OS/E Function Set subfunction\r
-\r
-\r
-\r
-               On all subsequent invocations, the access_key is required\r
-               for either the Enable or Disable OS/E Function Set subfunc-\r
-               tions.  Since the access_key is returned only on the first\r
-               invocation of the Enable/Disable OS/E Function Set subfunc-\r
-               tions, and presumably the OS/E is the first software to\r
-               invoke this function, only the OS/E obtains a copy of this\r
-               key.  The memory manager must return an access key with a\r
-               random value, a fixed value key defeats the purpose of\r
-               providing this level of security for an OS/E.\r
-\r
-\r
-          CALLING PARAMETERS\r
-\r
-               AX = 5D00h\r
-                   Contains the Enable OS/E Function Set subfunction.\r
-\r
-               BX,CX = access_key\r
-                   Required on all function invocations after the first. \r
-                   The access_key value returned by the first function\r
-                   invocation is required.\r
-\r
-\r
-          RESULTS\r
-\r
-               These results are valid only if the status returned is zero.\r
-\r
-               BX,CX = access_key\r
-                   Returned only on the first function invocation, the\r
-                   memory manager returns a random valued key which will be\r
-                   required thereafter for the execution of this function. \r
-                   On all invocations after the first, this key is not\r
-                   returned.  Neither BX nor CX is affected after the first\r
-                   time this function is invoked.\r
-\r
-\r
-          REGISTERS MODIFIED\r
-\r
-               AX, BX, CX\r
-\r
-\r
-          STATUS\r
-\r
-               AH = 0   SUCCESSFUL.\r
-                   The operating system function set has been enabled.\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                 180\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 30. Enable/Disable OS/E Function Set Functions\r
-          Enable OS/E Function Set subfunction\r
-\r
-\r
-\r
-               AH = 80h   NON-RECOVERABLE.\r
-                   The manager detected a malfunction in the memory manager\r
-                   software.\r
-\r
-               AH = 81h   NON-RECOVERABLE.\r
-                   The manager detected a malfunction in the expanded\r
-                   memory hardware.\r
-\r
-               AH = 84h   NON-RECOVERABLE.\r
-                   The function code passed to the memory manager is not\r
-                   defined.\r
-\r
-               AH = 8Fh   NON-RECOVERABLE.\r
-                   The subfunction parameter is invalid.\r
-\r
-               AH = A4h   NON-RECOVERABLE.\r
-                   The operating system has denied access to this function. \r
-                   The function cannot be used at this time.  The value of\r
-                   the key which was passed to this function does not\r
-                   entitle the program to execute this function.\r
-\r
-\r
-          EXAMPLE\r
-\r
-          First invocation\r
-\r
-          access_key                     DW 2 DUP (?)\r
-\r
-          MOV   AX,5D00h                 ; load function code\r
-          INT   67h                      ; call the memory manager\r
-          OR    AH,AH                    ; check EMM status\r
-          JNZ   emm_err_handler          ; jump to error handler on error\r
-          MOV   access_key[0],BX\r
-          MOV   access_key[2],CX\r
-\r
-\r
-          All invocations after the first\r
-\r
-          access_key                     DW 2 DUP (?)\r
-\r
-          MOV   BX,access_key[0]\r
-          MOV   CX,access_key[2]\r
-          MOV   AX,5D00h                 ; load function code\r
-          INT   67h                      ; call the memory manager\r
-          OR    AH,AH                    ; check EMM status\r
-          JNZ   emm_err_handler          ; jump to error handler on error\r
-\r
-\r
-          EMM Functions                                                 181\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 30. Enable/Disable OS/E Function Set Functions\r
-          Disable OS/E Function Set subfunction\r
-\r
-\r
-\r
-          Note............................................................\r
-               This function is for use by operating systems only.  The\r
-               operating system can disable this function at any time.\r
-\r
-\r
-          PURPOSE\r
-\r
-               This subfunction provides an OS/E with the ability to\r
-               disable all programs or device drivers from using the OS/E\r
-               specific functions.  The capability is provided only for an\r
-               OS/E which manages regions of mappable conventional memory\r
-               and cannot permit programs to use any of the functions which\r
-               would affect mappable conventional memory regions.  When an\r
-               OS/E disables these functions and a program attempts to use\r
-               them, the memory manager returns a status to the program\r
-               indicating that the OS/E has denied the program access to\r
-               the function.  In other words, the functions will not work\r
-               when disabled.\r
-\r
-               The OS/E (Operating System) functions which are disabled by\r
-               this subfunction are:\r
-\r
-               Function 26.  Get Expanded Memory Hardware Information.\r
-               Function 28.  Alternate Map Register Sets.\r
-               Function 30.  Enable/Disable Operating System Functions.\r
-\r
-\r
-          CALLING PARAMETERS\r
-\r
-               AX = 5D01h\r
-                   Contains the Disable OS/E Function Set subfunction.\r
-\r
-               BX,CX = access_key\r
-                   Required on all function invocations after the first. \r
-                   The access_key value returned by the first function\r
-                   invocation is required.\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                 182\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 30. Enable/Disable OS/E Function Set Functions\r
-          Disable OS/E Function Set subfunction\r
-\r
-\r
-\r
-          RESULTS\r
-\r
-               These results are valid only if the status returned is zero.\r
-\r
-               BX,CX = access_key\r
-                   Returned only on the first function invocation, the\r
-                   memory manager returns a random valued key which will be\r
-                   required thereafter for the execution of this function. \r
-                   On all invocations after the first, this key is not\r
-                   returned.  Neither BX nor CX is affected after the first\r
-                   time this function is invoked.\r
-\r
-\r
-          REGISTERS MODIFIED\r
-\r
-               AX, BX, CX\r
-\r
-\r
-          STATUS\r
-\r
-               AH = 0   SUCCESSFUL.\r
-                   The operating system function set has been disabled.\r
-\r
-               AH = 80h   NON-RECOVERABLE.\r
-                   The manager detected a malfunction in the memory manager\r
-                   software.\r
-\r
-               AH = 81h   NON-RECOVERABLE.\r
-                   The manager detected a malfunction in the expanded\r
-                   memory hardware.\r
-\r
-               AH = 84h   NON-RECOVERABLE.\r
-                   The function code passed to the memory manager is not\r
-                   defined.\r
-\r
-               AH = 8Fh   NON-RECOVERABLE.\r
-                   The subfunction parameter is invalid.\r
-\r
-               AH = A4h   NON-RECOVERABLE.\r
-                   The operating system has denied access to this function. \r
-                   The function cannot be used at this time.  The value of\r
-                   the key which was passed to this function does not\r
-                   entitle the program to execute this function.\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                 183\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 30. Enable/Disable OS/E Function Set Functions\r
-          Disable OS/E Function Set subfunction\r
-\r
-\r
-\r
-          EXAMPLE\r
-\r
-          First Function invocation\r
-\r
-          access_key                     DW 2 DUP (?)\r
-\r
-          MOV   AX,5D01h                 ; load function code\r
-          INT   67h                      ; call the memory manager\r
-          OR    AH,AH                    ; check EMM status\r
-          JNZ   emm_err_handler          ; jump to error handler on error\r
-          MOV   access_key[0],BX\r
-          MOV   access_key[2],CX\r
-\r
-\r
-          All invocations after the first\r
-\r
-          access_key                     DW 2 DUP (?)\r
-\r
-          MOV   BX,access_key[0]\r
-          MOV   CX,access_key[2]\r
-          MOV   AX,5D01h                 ; load function code\r
-          INT   67h                      ; call the memory manager\r
-          OR    AH,AH                    ; check EMM status\r
-          JNZ   emm_err_handler          ; jump to error handler on error\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                 184\r
-\f\r
-\r
-\r
-\r
\r
-          Function 30. Enable/Disable OS/E Function Set Functions\r
-          Return Access Key subfunction\r
-\r
-\r
-\r
-          Note............................................................\r
-               This function is for use by operating systems only.  The\r
-               operating system can disable this function at any time.\r
-\r
-\r
-          PURPOSE\r
-\r
-               This subfunction provides an OS/E with the ability to return\r
-               the access key to the memory manager.  Returning the access\r
-               key to the memory manager places the memory manager in the\r
-               state it is in at installation time (regarding the use of\r
-               the OS/E function set and the access key).  That is, access\r
-               to the OS/E function set is enabled.  Upon execution of the\r
-               next enable/disable OS/E function set subfunction, the\r
-               access key will once again be returned.\r
-\r
-\r
-          CALLING PARAMETERS\r
-\r
-               AX = 5D02h\r
-                   Contains the Return Access Key subfunction.\r
-\r
-               BX,CX = access_key\r
-                   Required on all function invocations.  The access_key\r
-                   value returned by the first function invocation of the\r
-                   enable or disable subfunctions is required.\r
-\r
-\r
-          REGISTERS MODIFIED\r
-\r
-               AX\r
-\r
-\r
-          STATUS\r
-\r
-               AH = 0   SUCCESSFUL.\r
-                   The access key has been returned to the memory manager.\r
-\r
-               AH = 80h   NON-RECOVERABLE.\r
-                   The manager detected a malfunction in the memory manager\r
-                   software.\r
-\r
-               AH = 81h   NON-RECOVERABLE.\r
-                   The manager detected a malfunction in the expanded\r
-                   memory hardware.\r
-\r
-\r
-\r
-          EMM Functions                                                 185\r
-\f\r
-\r
-\r
-\r
-\r
-          Function 30. Enable/Disable OS/E Function Set Functions\r
-          Return Access Key subfunction\r
-\r
-\r
-\r
-               AH = 84h   NON-RECOVERABLE.\r
-                   The function code passed to the memory manager is not\r
-                   defined.\r
-\r
-               AH = 8Fh   NON-RECOVERABLE.\r
-                   The subfunction parameter is invalid.\r
-\r
-               AH = A4h   NON-RECOVERABLE.\r
-                   The operating system has denied access to this function. \r
-                   The function cannot be used at this time.  The value of\r
-                   the key which was passed to this function does not\r
-                   entitle the program to execute this function.\r
-\r
-\r
-          EXAMPLE\r
-\r
-          access_key                     DW 2 DUP (?)\r
-\r
-          MOV   BX,access_key[0]\r
-          MOV   CX,access_key[2]\r
-          MOV   AX,5D02h                 ; load function code\r
-          INT   67h                      ; call the memory manager\r
-          OR    AH,AH                    ; check EMM status\r
-          JNZ   emm_err_handler          ; jump to error handler on error\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          EMM Functions                                                 186\r
-\f\r
-\r
-\r
-\r
-\r
-          Appendix A\r
-          FUNCTION AND STATUS CODE CROSS REFERENCE TABLES\r
-\r
-\r
-\r
-               This appendix contains two cross reference tables:  one\r
-               lists the function codes and the status codes they return;\r
-               the other lists the status codes and the functions that\r
-               return them.\r
-\r
-\r
-          Table A-1.  Function and Status Code Cross Reference\r
-          ----------------------------------------------------------------\r
-\r
-          Function        Status                 Description\r
-\r
-          ----------------------------------------------------------------\r
-\r
-             40h    00h, 80h, 81h, 84h   Get Memory Manager Status\r
-\r
-             41h    00h, 80h, 81h, 84h   Get Page Frame Segment Address\r
-\r
-             42h    00h, 80h, 81h, 84h   Get Unallocated Page Count\r
-\r
-             43h    00h, 80h, 81h, 84h   Allocate Pages\r
-                    85h, 87h, 88h, 89h\r
-\r
-             44h    00h, 80h, 81h, 83h   Map/Unmap Handle Page\r
-                    84h, 8Ah, 8Bh\r
-\r
-             45h    00h, 80h, 81h, 83h   Deallocate Pages\r
-                    84h, 86h\r
-\r
-             46h    00h, 80h, 81h, 84h   Get EMM Version\r
-\r
-             47h    00h, 80h, 81h, 83h   Save Page Map\r
-                    84h, 8Ch, 8Dh\r
-\r
-             48h    00h, 80h, 81h, 83h   Restore Page Map\r
-                    84h, 8Eh\r
-\r
-             49h                         Reserved\r
-\r
-             4Ah                         Reserved\r
-\r
-             4Bh    00h, 80h, 81h, 84h   Get EMM Handle Count\r
-\r
-             4Ch    00h, 80h, 81h, 83h   Get EMM Handle Pages\r
-                    84h\r
-\r
-             4Dh    00h, 80h, 81h, 84h   Get All EMM Handle Pages\r
-\r
-\r
-          Cross Reference Tables                                        187\r
-\f\r
-\r
-\r
-\r
-\r
-          Table A-1.  Function and Status Code Cross Reference (continued)\r
-          ----------------------------------------------------------------\r
-\r
-          Function        Status                 Description\r
-\r
-          ----------------------------------------------------------------\r
-\r
-           4E00h    00h, 80h, 81h, 84h   Get Page Map\r
-                    8Fh\r
-\r
-           4E01h    00h, 80h, 81h, 84h   Set Page Map\r
-                    8Fh, A3h\r
-\r
-           4E02h    00h, 80h, 81h, 84h   Get & Set Page Map\r
-                    8Fh, A3h\r
-\r
-           4E03h    00h, 80h, 81h, 84h   Get Size of Page Map Save Array\r
-                    8Fh\r
-\r
-           4F00h    00h, 80h, 81h, 84h   Get Partial Page Map\r
-                    8Bh, 8Fh, A3h\r
-\r
-           4F01h    00h, 80h, 81h, 84h   Set Partial Page Map\r
-                    8Fh, A3h\r
-\r
-           4F02h    00h, 80h, 81h, 84h   Get Size of Partial Page Map Array\r
-                    8Bh, 8Fh\r
-\r
-           5000h    00h, 80h, 81h, 83h   Map/Unmap Multiple Handle Pages\r
-                    84h, 8Ah, 8Bh, 8Fh   (physical page number mode)\r
-\r
-           5001h    00h, 80h, 81h, 83h   Map/Unmap Multiple Handle Pages\r
-                    84h, 8Ah, 8Bh, 8Fh   (segment address mode)\r
-\r
-             51h    00h, 80h, 81h, 83h   Reallocate Pages\r
-                    84h, 87h, 88h\r
-\r
-           5200h    00h, 80h, 81h, 83h   Get Handle Attribute\r
-                    84h, 8Fh, 91h\r
-\r
-           5201h    00h, 80h, 81h, 83h   Set Handle Attribute\r
-                    84h, 8Fh, 90h, 91h\r
-\r
-           5202h    00h, 80h, 81h, 84h   Get Handle Attribute Capability\r
-                    8Fh\r
-\r
-           5300h    00h, 80h, 81h, 83h   Get Handle Name\r
-                    84h, 8Fh\r
-\r
-           5301h    00h, 80h, 81h, 83h   Set Handle Name\r
-                    84h, 8Fh, A1h\r
-\r
-\r
-          Cross Reference Tables                                        188\r
-\f\r
-\r
-\r
-\r
-\r
-          Table A-1.  Function and Status Code Cross Reference (continued)\r
-          ----------------------------------------------------------------\r
-\r
-          Function        Status                 Description\r
-\r
-          ----------------------------------------------------------------\r
-\r
-           5400h    00h, 80h, 81h, 84h   Get Handle Directory\r
-                    8Fh\r
-\r
-           5401h    00h, 80h, 81h, 84h   Search for Named Handle\r
-                    8Fh, A0h, A1h\r
-\r
-           5402h    00h, 80h, 81h, 84h   Get Total Handles\r
-                    8Fh\r
-\r
-           5500h    00h, 80h, 81h, 83h   Alter Page Map & Jump (Physical   \r
-                    84h, 8Ah, 8Bh, 8Fh   page mode)\r
-\r
-           5501h    00h, 80h, 81h, 83h   Alter Page Map & Jump (Segment    \r
-                    84h, 8Ah, 8Bh, 8Fh   address mode)\r
-\r
-           5600h    00h, 80h, 81h, 83h   Alter Page Map & Call (Physical   \r
-                    84h, 8Ah, 8Bh, 8Fh   page mode)\r
-\r
-           5601h    00h, 80h, 81h, 83h   Alter Page Map & Call (Segment    \r
-                    84h, 8Ah, 8Bh, 8Fh   address mode)\r
-\r
-           5602h    00h, 80h, 81h, 84h   Get Alter Page Map & Call Stack   \r
-                    8Fh                  Space Size\r
-\r
-           5700h    00h, 80h, 81h, 83h   Move Memory Region\r
-                    84h, 8Ah, 8Fh, 92h\r
-                    93h, 94h, 95h, 96h\r
-                    98h, A2h\r
-\r
-           5701h    00h, 80h, 81h, 83h   Exchange Memory Region\r
-                    84h, 8Ah, 8Fh, 93h\r
-                    94h, 95h, 96h, 97h\r
-                    98h, A2h\r
-\r
-           5800h    00h, 80h, 81h, 84h   Get Mappable Physical Address     \r
-                    8Fh                  Array\r
-\r
-           5801h    00h, 80h, 81h, 84h   Get Mappable Physical Address     \r
-                    8Fh                  Array Entries\r
-\r
-           5900h    00h, 80h, 81h, 84h   Get Expanded Memory Hardware      \r
-                    8Fh, A4h             Information\r
-\r
-           5901h    00h, 80h, 81h, 84h   Get Unallocated Raw Page Count\r
-                    8Fh\r
-\r
-          Cross Reference Tables                                        189\r
-\f\r
-\r
-\r
-\r
-\r
-          Table A-1.  Function and Status Code Cross Reference (continued)\r
-          ----------------------------------------------------------------\r
-\r
-          Function        Status                 Description\r
-\r
-          ----------------------------------------------------------------\r
-\r
-           5A00h    00h, 80h, 81h, 84h   Allocate Standard Pages\r
-                    85h, 87h, 88h, 8Fh\r
-\r
-           5A01h    00h, 80h, 81h, 84h   Allocate Raw Pages\r
-                    85h, 87h, 88h, 8Fh\r
-\r
-           5B00h    00h, 80h, 81h, 84h   Get Alternate Map Register Set\r
-                    8Fh, A4h\r
-\r
-           5B01h    00h, 80h, 81h, 84h   Set Alternate Map Register Set\r
-                    8Fh, 9Ah, 9Ch, 9Dh\r
-                    A3h, A4h\r
-\r
-           5B02h    00h, 80h, 81h, 84h   Get Alternate Map Save Array Size\r
-                    8Fh, A4h\r
-\r
-           5B03h    00h, 80h, 81h, 84h   Allocate Alternate Map Register   \r
-                    8Fh, 9Bh, A4h        Set\r
-\r
-           5B04h    00h, 80h, 81h, 84h   Deallocate Alternate Map Register \r
-                    8Fh, 9Ch, 9Dh, A4h   Set\r
-\r
-           5B05h    00h, 80h, 81h, 84h   Allocate DMA Register Set\r
-                    8Fh, 9Bh, A4h\r
-\r
-           5B06h    00h, 80h, 81h, 84h   Enable DMA on Alternate Map       \r
-                    8Fh, 9Ah, 9Ch, 9Dh   Register Set\r
-                    9Eh, 9Fh, A4h\r
-\r
-           5B07h    00h, 80h, 81h, 84h   Disable DMA on Alternate Map      \r
-                    8Fh, 9Ah, 9Ch, 9Dh   Register Set\r
-                    9Eh, 9Fh, A4h\r
-\r
-           5B08h    00h, 80h, 81h, 84h   Deallocate DMA Register Set\r
-                    8Fh, 9Ch, 9Dh, A4h\r
-\r
-             5Ch    00h, 80h, 81h, 84h   Prepare Expanded Memory Hardware\r
-                                         for Warmboot\r
-\r
-           5D00h    00h, 80h, 81h, 84h   Enable Operating System Function  \r
-                    8Fh, A4h             Set\r
-\r
-           5D01h    00h, 80h, 81h, 84h   Disable Operating System Function \r
-                    8Fh, A4h             Set\r
-\r
-\r
-          Cross Reference Tables                                        190\r
-\f\r
-\r
-\r
-\r
-\r
-          Table A-1.  Function and Status Code Cross Reference (continued)\r
-          ----------------------------------------------------------------\r
-\r
-          Function        Status                 Description\r
-\r
-          ----------------------------------------------------------------\r
-\r
-           5D02h    00h, 80h, 81h, 84h   Return Operating System Access Key\r
-                    8Fh, A4h\r
-          ----------------------------------------------------------------\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          Cross Reference Tables                                        191\r
-\f\r
-\r
-\r
-\r
-\r
-          Table A-2.  Status and Function Code Cross Reference\r
-          ----------------------------------------------------------------\r
-\r
-          Status      Function                   Description\r
-\r
-          ----------------------------------------------------------------\r
-\r
-           00h   All                  The function completed normally.\r
-\r
-           80h   All                  The memory manager has detected a\r
-                                      malfunction in the expanded memory\r
-                                      software.  A condition has been\r
-                                      detected which would not have\r
-                                      occurred if the memory manager had\r
-                                      been operating correctly.\r
-\r
-           81h   All                  The memory manager has detected a\r
-                                      malfunction in the expanded memory\r
-                                      hardware.  A condition has been\r
-                                      detected which would not occur if the\r
-                                      memory hardware were working correct-\r
-                                      ly.  Diagnostics should be run on the\r
-                                      expanded memory system to determine\r
-                                      the source of the problem.\r
-\r
-           82h   None                 This error code is not returned in\r
-                                      version 3.2 of the memory manager or\r
-                                      above.  In earlier versions of the\r
-                                      memory manager this code meant a\r
-                                      "busy" status.  This status indicated\r
-                                      that the memory manager was already\r
-                                      processing an expanded memory request\r
-                                      when the current request was made and\r
-                                      is unable to process another request. \r
-                                      In versions 3.2 of the memory manager\r
-                                      and above, the memory manager is\r
-                                      never "busy" and can always honor\r
-                                      requests.\r
-\r
-           83h   44h, 45h, 47h, 48h   The memory manager can not find the\r
-                 4Ch, 5000h, 5001h    handle specified.  The program has\r
-                 51h, 5200h, 5201h    probably corrupted its specified\r
-                 5300h, 5301h         handle.  The memory manager does not\r
-                 5500h, 5501h         have any information pertaining to\r
-                 5600h, 5601h         the  specified handle.  The program\r
-                 5700h, 5701h         has probably corrupted its handle.\r
-\r
-           84h   All                  The function code passed to the\r
-                                      manager is not currently defined. \r
-                                      Function codes in the range 40h\r
-                                      through 5Dh are currently defined.\r
-\r
-\r
-          Cross Reference Tables                                        192\r
-\f\r
-\r
-\r
-\r
-\r
-          Table A-2.  Status and Function Code Cross Reference (continued)\r
-          ----------------------------------------------------------------\r
-\r
-          Status      Function                   Description\r
-\r
-          ----------------------------------------------------------------\r
-\r
-           85h   43h, 5A00h, 5A01h    No handles are currently available. \r
-                                      All assignable handles are currently\r
-                                      in use.  The program may re-request\r
-                                      the assignment of a handle in the\r
-                                      hope that another program has\r
-                                      released a handle.  The maximum\r
-                                      number of handles that may be\r
-                                      supported is 255.\r
-\r
-           86h   45h                  A mapping context restoration error\r
-                                      has been detected.  This error occurs\r
-                                      when a program attempts to return a\r
-                                      handle and there is still a "mapping\r
-                                      context" on the context stack for the\r
-                                      indicated handle.  A program can\r
-                                      recover from this error by restoring\r
-                                      the mapping context before returning\r
-                                      the handle.\r
-\r
-           87h   43h, 51h, 5A00h,     The number of total pages that are\r
-                 5A01h                available in the system is insuffi-\r
-                                      cient to honor the request.  The\r
-                                      program can recover from this\r
-                                      condition by requesting fewer pages.\r
-\r
-           88h   43h, 51h, 5A00h,     The number of unallocated pages\r
-                 5A01h                currently available is insufficient\r
-                                      to honor the allocation request.  The\r
-                                      program can recover from this\r
-                                      condition by re-posting the request\r
-                                      or by requesting fewer pages.\r
-\r
-           89h   43h                  A Function 4 (Allocate Pages) request\r
-                                      has been made specifying zero pages. \r
-                                      Zero pages cannot be assigned to a\r
-                                      handle with Function 4 (Allocate\r
-                                      Pages).  If it is necessary to assign\r
-                                      zero pages to a handle, Function 27\r
-                                      (Allocate Standard Pages and Allocate\r
-                                      Raw Pages subfunctions) may be used.\r
-\r
-\r
-\r
-\r
-\r
-\r
-          Cross Reference Tables                                        193\r
-\f\r
-\r
-\r
-\r
-\r
-          Table A-2.  Status and Function Code Cross Reference (continued)\r
-          ----------------------------------------------------------------\r
-\r
-          Status      Function                   Description\r
-\r
-          ----------------------------------------------------------------\r
-\r
-           8Ah   44h, 5000h, 5001h    The logical page to map into memory\r
-                 5500h, 5501h         is out of the range of logical pages\r
-                 5600h, 5601h         which are allocated to the handle. \r
-                 5700h, 5701h         The program can recover from this\r
-                                      condition by attempting to map a\r
-                                      logical page which is within the\r
-                                      bounds for the handle.\r
-\r
-           8Bh   44h, 4F00h, 4F02h    One or more of the physical pages is\r
-                 5000h, 5001h         out of the range of allowable\r
-                 5600h, 5601h         physical pages.  Physical page\r
-                 5500h, 5501          numbers are numbered zero-relative. \r
-                                      The program can recover from this\r
-                                      condition by mapping at a physical\r
-                                      page which is in the range from zero\r
-                                      to three.\r
-\r
-           8Ch   47h                  The mapping register context save\r
-                                      area is full.  The program can\r
-                                      recover from this condition by\r
-                                      attempting to save the mapping\r
-                                      registers again.\r
-\r
-           8Dh   47h                  The mapping register context stack\r
-                                      already has a context associated with\r
-                                      the handle.  The program has at-\r
-                                      tempted to save the mapping register\r
-                                      context when there was already a\r
-                                      context for the handle on the stack. \r
-                                      The program can recover from this\r
-                                      condition by not attempting to save\r
-                                      the context again (this assumes the\r
-                                      mapping register context on the stack\r
-                                      for the handle is correct).\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          Cross Reference Tables                                        194\r
-\f\r
-\r
-\r
-\r
-\r
-          Table A-2.  Status and Function Code Cross Reference (continued)\r
-          ----------------------------------------------------------------\r
-\r
-          Status      Function                   Description\r
-\r
-          ----------------------------------------------------------------\r
-\r
-           8Eh   48h                  The mapping register context stack\r
-                                      does not have a context associated\r
-                                      with the handle.  The program has\r
-                                      attempted to restore the mapping\r
-                                      register context when there was no\r
-                                      context for the handle on the stack. \r
-                                      The program can recover from this\r
-                                      condition by not attempting to\r
-                                      restore the context again (this\r
-                                      assumes the current mapping register\r
-                                      context is correct).\r
-\r
-           8Fh   All functions        The subfunction parameter passed to\r
-                 requiring            the function is not defined.\r
-                 subfunction codes\r
-\r
-           90h   5201h                The attribute type is undefined.\r
-\r
-           91h   5200h, 5201h         The system configuration does not\r
-                                      support non-volatility.\r
-\r
-           92h   5700h                The source and destination expanded\r
-                                      memory regions have the same handle\r
-                                      and overlap.  This is valid for a\r
-                                      move.  The move has been completed\r
-                                      and the destination region has a full\r
-                                      copy of the source region.  However,\r
-                                      at least a portion of the source\r
-                                      region has been overwritten by the\r
-                                      move.  Note that the source and\r
-                                      destination expanded memory regions\r
-                                      with different handles will never\r
-                                      physically overlap because the\r
-                                      different handles specify totally\r
-                                      different regions of expanded memory.\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          Cross Reference Tables                                        195\r
-\f\r
-\r
-\r
-\r
-\r
-          Table A-2.  Status and Function Code Cross Reference (continued)\r
-          ----------------------------------------------------------------\r
-\r
-          Status      Function                   Description\r
-\r
-          ----------------------------------------------------------------\r
-\r
-           93h   5700h, 5701h         The length of the specified source or\r
-                                      destination expanded memory region\r
-                                      exceeds the length of the expanded\r
-                                      memory region allocated to the\r
-                                      specified source or destination\r
-                                      handle.  There are insufficient pages\r
-                                      allocated to this handle to move/ex-\r
-                                      change a region of the size speci-\r
-                                      fied.  The program can recover from\r
-                                      this condition by attempting to\r
-                                      allocate additional pages to the\r
-                                      destination or source handle or by\r
-                                      reducing the specified length. \r
-                                      However, if the application program\r
-                                      has allocated as much expanded memory\r
-                                      as it thought it needed, this may be\r
-                                      a program error and is therefore not\r
-                                      recoverable.\r
-\r
-           94h   5700h, 5701h         The conventional memory region and\r
-                                      expanded memory region overlap.  This\r
-                                      is invalid, the conventional memory\r
-                                      region cannot overlap the expanded\r
-                                      memory region.\r
-\r
-           95h   5700h, 5701h         The offset within the logical page\r
-                                      exceeds the length of the logical\r
-                                      page.  The initial source or destina-\r
-                                      tion offsets within an expanded\r
-                                      memory region must be between 0 and\r
-                                      the (length of a logical page - 1) or\r
-                                      16383 (3FFFh).\r
-\r
-           96h   5700h, 5701h         Region length exceeds 1M-byte limit.\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          Cross Reference Tables                                        196\r
-\f\r
-\r
-\r
-\r
-\r
-          Table A-2.  Status and Function Code Cross Reference (continued)\r
-          ----------------------------------------------------------------\r
-\r
-          Status      Function                   Description\r
-\r
-          ----------------------------------------------------------------\r
-\r
-           97h   5701h                The source and destination expanded\r
-                                      memory regions have the SAME handle\r
-                                      AND overlap.  This is invalid; the\r
-                                      source and destination expanded\r
-                                      memory regions cannot have the same\r
-                                      handle and overlap when they are\r
-                                      being exchanged.  Note that the\r
-                                      source and destination expanded\r
-                                      memory regions with different handles\r
-                                      will never physically overlap because\r
-                                      the different handles specify totally\r
-                                      different regions of expanded memory.\r
-\r
-           98h   5700h, 5701h         The memory source and destination\r
-                                      types are undefined/not supported.\r
-\r
-           9Ah   5B01h, 5B06h         Alternate map register sets are\r
-                 5B07h                supported, but the alternate map\r
-                                      register set specified is not\r
-                                      supported.\r
-\r
-           9Bh   5B03h, 5B05h         Alternate map/DMA register sets are\r
-                                      supported.  However, all alternate\r
-                                      map/DMA register sets are currently\r
-                                      allocated.\r
-\r
-           9Ch   5B01h, 5B04h         Alternate map/DMA register sets are\r
-                 5B06h, 5B07h         not supported, and the alternate\r
-                 5B08h                map/DMA register set specified is not\r
-                                      zero.\r
-\r
-           9Dh   5B01h, 5B04h         Alternate map/DMA register sets are\r
-                 5B06h, 5B07h         supported, but the alternate map\r
-                 5B08h                register set specified is not\r
-                                      defined, not allocated, or is the\r
-                                      currently allocated map register set.\r
-\r
-           9Eh   5B06h, 5B07h         Dedicated DMA channels are not\r
-                                      supported.\r
-\r
-           9Fh   5B06h, 5B07h         Dedicated DMA channels are supported. \r
-                                      But the DMA channel specified is not\r
-                                      supported.\r
-\r
-\r
-\r
-          Cross Reference Tables                                        197\r
-\f\r
-\r
-\r
-\r
-\r
-          Table A-2.  Status and Function Code Cross Reference (continued)\r
-          ----------------------------------------------------------------\r
-\r
-          Status      Function                   Description\r
-\r
-          ----------------------------------------------------------------\r
-\r
-           A0h   5401h                No corresponding handle value could\r
-                                      be found for the handle name speci-\r
-                                      fied.\r
-\r
-           A1h   5301h, 5401h         A handle with this name already\r
-                                      exists.  The specified handle was not\r
-                                      assigned a name.\r
-\r
-           A2h   5700h, 5701h         An attempt was made to "wrap around"\r
-                                      the 1M-byte address space during the\r
-                                      move/exchange.  The source starting\r
-                                      address together with the length of\r
-                                      the region to be moved/exchanged\r
-                                      exceeds 1M bytes.  No data was\r
-                                      moved/exchanged.\r
-\r
-           A3h   4E01h, 4E02h         The contents of the data structure\r
-                 4F00h, 4F01h         passed to the function have either\r
-                 5B01h                been corrupted or are meaningless.\r
-\r
-           A4h   5900h, 5B00h         The operating system has denied\r
-                 5B01h, 5B02h         access to this function.  The \r
-                 5B03h, 5B04h         function cannot be used at this time.\r
-                 5B05h, 5B06h\r
-                 5B07h, 5B08h\r
-                 5D00h, 5D01h\r
-                 5D02h\r
-\r
-          ----------------------------------------------------------------\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          Cross Reference Tables                                        198\r
-\f\r
-\r
-\r
-\r
-\r
-          Appendix B\r
-          TESTING FOR THE PRESENCE OF THE EXPANDED MEMORY MANAGER\r
-\r
-\r
-\r
-               Before an application program can use the Expanded Memory\r
-               Manager, it must determine whether DOS has loaded the\r
-               manager.  This appendix describes two methods your program\r
-               can use to test for the presence of the memory manager and\r
-               how to choose the correct one for your situation.\r
-\r
-               The first method uses the DOS "open handle" technique; the\r
-               second method uses the DOS "get interrupt vector" technique.\r
-\r
-\r
-          Which method should your program use?\r
-\r
-               The majority of application programs can use either the\r
-               "open handle" or the "get interrupt vector" method. \r
-               However, if your program is a device driver or if it\r
-               interrupts DOS during file system operations, you must use\r
-               only the "get interrupt vector" method.\r
-\r
-               Device drivers execute from within DOS and can't access the\r
-               DOS file system; programs that interrupt DOS during file\r
-               system operations have a similar restriction.  During their\r
-               interrupt processing procedures, they can't access the DOS\r
-               file system because another program may be using the system. \r
-               Since the "get interrupt vector" method doesn't require the\r
-               DOS file system, you must use it for these types of pro-\r
-               grams.\r
-\r
-\r
-          The "open handle" technique\r
-\r
-               Most application programs can use the DOS "open handle"\r
-               technique to test for the presence of the memory manager. \r
-               This section describes how to use the technique and gives an\r
-               example.\r
-\r
-          Caution.........................................................\r
-               Don't use this technique if your program is a device driver\r
-               or if it interrupts DOS during file system operations.  Use\r
-               the "get interrupt vector" technique described later in this\r
-               appendix.\r
-\r
-\r
-          Using the "open handle" technique\r
-\r
-               This section describes how to use the DOS "open handle"\r
-               technique to test for the presence of the memory manager. \r
-               Follow these steps in order:\r
-\r
-          Testing For The Presence Of The EMM                           199\r
-\f\r
-\r
-\r
-\r
-\r
-               1.  Issue an "open handle" command (DOS function 3Dh) in\r
-                   "read only" access mode (register AL = 0).  This\r
-                   function requires your program to point to an ASCII\r
-                   string which contains the path name of the file or\r
-                   device in which you're interested (register set DS:DX\r
-                   contains the pointer).  In this case the file is\r
-                   actually the name of the memory manager.\r
-\r
-                   You should format the ASCII string as follows:\r
-\r
-                   ASCII_device_name  DB  'EMMXXXX0', 0\r
-\r
-                   The ASCII codes for the capital letters EMMXXXX0 are\r
-                   terminated by a byte containing a value of zero.\r
-\r
-               2.  If DOS returns no error status code, skip Steps 3 and 4\r
-                   and go to Step 5.  If DOS returns a "Too many open\r
-                   files" error status code, go to Step 3.  If DOS returns\r
-                   a "File/Path not found" error status code, skip Step 3\r
-                   and go to Step 4.\r
-\r
-               3.  If DOS returns a "Too many open files" (not enough\r
-                   handles) status code, your program should invoke the\r
-                   "open file" command before it opens any other files. \r
-                   This will guarantee that at least one file handle will\r
-                   be available to perform the function without causing\r
-                   this error.\r
-\r
-                   After the program performs the "open file" command, it\r
-                   should perform the test described in Step 6 and close\r
-                   the "file handle" (DOS function 3Eh).  Don't keep the\r
-                   manager "open" after this status test is performed since\r
-                   "manager" functions are not available through DOS.  Go\r
-                   to Step 6.\r
-\r
-               4.  If DOS returns a "File/Path not found," the memory\r
-                   manager is not installed.  If your application requires\r
-                   the memory manager, the user will have to reboot the\r
-                   system with a disk containing the memory manager and the\r
-                   appropriate CONFIG.SYS file before proceeding.\r
-\r
-               5.  If DOS doesn't return an error status code you can\r
-                   assume that either a device with the name EMMXXXX0 is\r
-                   resident in the system, or a file with this name is on\r
-                   disk in the current disk drive.  Go to Step 6.\r
-\r
-               6.  Issue an "I/O Control for Devices" command (DOS function\r
-                   44h) with a "get device information" command (register\r
-                   AL = 0).  DOS function 44h determines whether EMMXXXX0\r
-                   is a device or a file.\r
-\r
-\r
-\r
-          Testing For The Presence Of The EMM                           200\r
-\f\r
-\r
-\r
-\r
-\r
-                   You must use the file handle (register BX) which you\r
-                   obtained in Step 1 to access the "EMM" device.\r
-\r
-                   This function returns the "device information" in a word\r
-                   (register DX).  Go to Step 7.\r
-\r
-               7.  If DOS returns any error status code, you should assume\r
-                   that the memory manager device driver is not installed. \r
-                   If your application requires the memory manager, the\r
-                   user will have to reboot the system with a disk contain-\r
-                   ing the memory manager and the appropriate CONFIG.SYS\r
-                   file before proceeding.\r
-\r
-               8.  If DOS didn't return an error status, test the contents\r
-                   of bit 7 (counting from 0) of the "device information"\r
-                   word (register DX) the function returned.  Go to Step 9.\r
-\r
-               9.  If bit 7 of the "device information" word contains a\r
-                   zero, then EMMXXXX0 is a file, and the memory manager\r
-                   device driver is not present.  If your application\r
-                   requires the memory manager, the user will have to\r
-                   reboot the system with a disk containing the memory\r
-                   manager and the appropriate CONFIG.SYS file before\r
-                   proceeding.\r
-\r
-                   If bit 7 contains a one, then EMMXXXX0 is a device.  Go\r
-                   to Step 10.\r
-\r
-               10. Issue an "I/O Control for Devices" command (DOS function\r
-                   44h) with a "get output status" command (register AL =\r
-                   7).\r
-\r
-                   You must use the file handle you obtained in Step 1 to\r
-                   access the "EMM" device (register BX).  Go to Step 11.\r
-\r
-               11. If the expanded memory device driver is "ready," the\r
-                   memory manager passes a status value of "FFh" in\r
-                   register AL.  The status value is "00h" if the device\r
-                   driver is "not ready."\r
-\r
-                   If the memory manager device driver is "not ready" and\r
-                   your application requires its presence, the user will\r
-                   have to reboot the system with a disk containing the\r
-                   memory manager and the appropriate CONFIG.SYS file\r
-                   before proceeding.\r
-\r
-                   If the memory manager device driver is "ready," go to\r
-                   Step 12.\r
-\r
-\r
-\r
-\r
-\r
-          Testing For The Presence Of The EMM                           201\r
-\f\r
-\r
-\r
-\r
-\r
-               12. Issue a "Close File Handle" command (DOS function 3Eh)\r
-                   to close the expanded memory device driver.  You must\r
-                   use the file handle you obtained in Step 1 to close the\r
-                   "EMM" device (register BX).\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          Testing For The Presence Of The EMM                           202\r
-\f\r
-\r
-\r
-\r
-\r
-          An example of the "open handle" technique\r
-\r
-               The following procedure is an example of the "open handle"\r
-               technique outlined in the previous section.\r
-\r
-          ;--------------------------------------------------------------;\r
-          ;    The following procedure tests for the presence of the     ;\r
-          ;    EMM in the system.  It returns the CARRY FLAG SET if      ;\r
-          ;    the EMM is present.  If the EMM is not present, this      ;\r
-          ;    procedure returns the CARRY FLAG CLEAR.                   ;\r
-          ;--------------------------------------------------------------;\r
-\r
-          first_test_for_EMM  PROC  NEAR\r
-          PUSH  DS\r
-          PUSH  CS\r
-          POP   DS\r
-          MOV   AX,3D00h                       ; issue "device open" in\r
-          LEA   DX,ASCII_device_name           ; "read only" mode\r
-          INT   21h\r
-          JC    first_test_for_EMM_error_exit  ; test for error\r
-                                               ; during "device open"\r
-          MOV   BX,AX                          ; get the "file\r
-                                               ; handle" returned by DOS\r
-          MOV   AX,4400h                       ; issue "IOCTL\r
-          INT   21h                            ; get device info"\r
-          JC    first_test_for_EMM_error_exit  ; test for error\r
-                                               ; during "get device info"\r
-          TEST  DX,0080h                       ; test to determine\r
-          JZ    first_test_for_EMM_error_exit  ; ASCII_device_name\r
-                                               ; is a device or a file\r
-          MOV   AX,4407h                       ; issue "IOCTL"\r
-          INT   21h\r
-          JC    first_test_for_EMM_error_exit  ; test for error\r
-                                               ; during "IOCTL"\r
-          PUSH  AX                             ; save "IOCTL" status\r
-          MOV   AH,3Eh                         ; issue "close\r
-          INT   21h                            ; file handle"\r
-          POP   AX                             ; restore "IOCTL" status\r
-          CMP   AL,0FFh                        ; test for "device\r
-          JNE   first_test_for_EMM_error_exit  ; ready" status\r
-                                               ; returned by the driver\r
-          first_test_for_EMM_exit:\r
-          POP   DS                             ; EMM is present\r
-          STC                                  ; in the system\r
-          RET\r
-\r
-          first_test_for_EMM_error_exit:\r
-          POP   DS                             ; EMM is NOT present\r
-          CLC                                  ; in the system\r
-          RET\r
-          ASCII_device_name   DB  'EMMXXXX0', 0\r
-          first_test_for_EMM  ENDP\r
-\r
-          Testing For The Presence Of The EMM                           203\r
-\f\r
-\r
-\r
-\r
-\r
-          The "get interrupt vector" technique\r
-\r
-               Any type of program can use the DOS "get interrupt vector"\r
-               technique to test for the presence of the memory manager. \r
-               This section describes how to use the technique and gives an\r
-               example.\r
-\r
-          Caution.........................................................\r
-               Be sure to use this technique (and not the "open handle"\r
-               technique) if your program is a device driver or if it\r
-               interrupts DOS during file system operations.\r
-\r
-\r
-          Using the "get interrupt vector" technique\r
-\r
-               This section describes how to use the DOS "get interrupt\r
-               vector" technique to test for the presence of the memory\r
-               manager.  Follow these steps in order:\r
-\r
-               1.  Issue a "get vector" command (DOS function 35h) to\r
-                   obtain the contents of interrupt vector array entry\r
-                   number 67h (addresses 0000:019Ch thru 0000:019Fh).\r
-\r
-                   The memory manager uses this interrupt vector to perform\r
-                   all manager functions.  The offset portion of this\r
-                   interrupt service routine address is stored in the word\r
-                   located at address 0000:019Ch; the segment portion is\r
-                   stored in the word located at address 0000:019Eh.\r
-\r
-               2.  Compare the "device name field" with the contents of the\r
-                   ASCII string which starts at the address specified by\r
-                   the segment portion of the contents of interrupt vector\r
-                   address 67h and a fixed offset of 000Ah.  If DOS loaded\r
-                   the memory manager at boot time this name field will\r
-                   have the name of the device in it.\r
-\r
-                   Since the memory manager is implemented as a character\r
-                   device driver, its program origin is 0000h.  Device\r
-                   drivers are required to have a "device header" located\r
-                   at the program origin.  Within the "device header" is an\r
-                   8 byte "device name field."  For a character mode device\r
-                   driver this name field is always located at offset 000Ah\r
-                   within the device header.  The device name field\r
-                   contains the name of the device which DOS uses when it\r
-                   references the device.\r
-\r
-                   If the result of the "string compare" in this technique\r
-                   is positive, the memory manager is present.\r
-\r
-\r
-\r
-\r
-\r
-          Testing For The Presence Of The EMM                           204\r
-\f\r
-\r
-\r
-\r
-\r
-          An example of the "get interrupt vector" technique\r
-\r
-               The following procedure is an example of the "get interrupt\r
-               vector" technique outlined in the previous section.\r
-\r
-\r
-          ;--------------------------------------------------------------;\r
-          ;    The following procedure tests for the presence of the     ;\r
-          ;    EMM in the system.  It returns the CARRY FLAG SET if      ;\r
-          ;    the EMM is present.  If the EMM is not present, this      ;\r
-          ;    procedure returns the CARRY FLAG CLEAR.                   ;\r
-          ;--------------------------------------------------------------;\r
-\r
-\r
-          second_test_for_EMM  PROC  NEAR\r
-          PUSH  DS\r
-          PUSH  CS\r
-          POP   DS\r
-          MOV   AX,3567h                       ; issue "get interrupt\r
-                                               ; vector"\r
-          INT   21h\r
-          MOV   DI,000Ah                       ; use the segment in ES\r
-                                               ; returned by DOS, place\r
-                                               ; the "device name field"\r
-                                               ; OFFSET in DI\r
-          LEA   SI,ASCII_device_name           ; place the OFFSET of the\r
-                                               ; device name string in SI,\r
-                                               ; the SEGMENT is already\r
-                                               ; in DS\r
-          MOV   CX,8                           ; compare the name strings\r
-          CLD\r
-          REPE  CMPSB\r
-          JNE   second_test_for_EMM_error_exit\r
-\r
-          second_test_for_EMM_exit:\r
-          POP   DS                             ; EMM is present in\r
-          STC                                  ; the system\r
-          RET\r
-\r
-          second_test_for_EMM_error_exit:\r
-          POP   DS                             ; EMM is NOT present\r
-          CLC                                  ; in the system\r
-          RET\r
-\r
-          ASCII_device_name   DB  'EMMXXXX0'\r
-          second_test_for_EMM ENDP\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          Testing For The Presence Of The EMM                           205\r
-\f\r
-\r
-\r
-\r
-\r
-          Appendix C\r
-          EXPANDED MEMORY MANAGER IMPLEMENTATION GUIDELINES\r
-\r
-\r
-\r
-               In addition to the functional specification, the expanded\r
-               memory manager should provide certain resources.  The\r
-               following guidelines are provided so required resources are\r
-               present in expanded memory managers which comply with this\r
-               version of the LIM specification.\r
-\r
-               o   The amount of expanded memory supported:\r
-                   Up to a maximum of 32M bytes of expanded memory should\r
-                   be supported.\r
-\r
-               o   The number of handles supported:\r
-                   The maximum number of expanded memory handles provided\r
-                   should be 255, the minimum should be 64.\r
-\r
-               o   Handle Numbering:\r
-                   Although a handle is a word quantity, there is a maximum\r
-                   of 255 handles, including the operating system handle. \r
-                   This specification defines the handle word as follows: \r
-                   the low byte of the word is the actual handle value, the\r
-                   high byte of the handle is set to 00h by the memory\r
-                   manager.  Previous versions of this specification did\r
-                   not specify the value of handles.\r
-\r
-               o   New handle type:  Handles versus Raw Handles:\r
-                   The difference between a raw handle and a regular handle\r
-                   is slight.  If you use Function 27 to "Allocate raw\r
-                   pages to a handle," what is returned in DX is termed a\r
-                   raw handle.  The raw handle does not necessarily refer\r
-                   to 16K-byte pages.  Instead it refers to the "raw" page\r
-                   size, which depends on the expanded memory hardware.\r
-\r
-                   An application program can use Function 26 to find the\r
-                   raw page size, and by using the raw handle Function 27\r
-                   returns, it can access them with the finer resolution\r
-                   that a particular expanded memory board may allow.\r
-\r
-                   On the other hand, applications which use Function 4 to\r
-                   "allocate pages to handle" receive a handle which always\r
-                   refers to 16K-byte pages.  On expanded memory boards\r
-                   with smaller raw pages, the EMM driver will allocate and\r
-                   maintain the number of raw pages it takes to create a\r
-                   single composite 16K-byte page.  The difference between\r
-                   the expanded memory boards' raw page size and the 16K-\r
-                   byte LIM page size is transparent to the application\r
-                   when it is using a handle obtained with Function 4.\r
-\r
-\r
-\r
-          EMM Implementation Guidelines                                 206\r
-\f\r
-\r
-\r
-\r
-\r
-                   The memory manager must differentiate between pages\r
-                   allocated to handles and pages allocated to raw handles. \r
-                   The meaning of a call to the driver changes depending on\r
-                   whether a handle or a raw handle is passed to the memory\r
-                   manager.  If, for example, a handle is passed to\r
-                   Function 18 (Reallocate), the memory manager will\r
-                   increase or decrease the number of 16K-byte pages\r
-                   allocated to the handle.  If Function 18 is passed a raw\r
-                   handle, the memory manager will increase or decrease the\r
-                   number of raw (non-16K-byte) pages allocated to the raw\r
-                   handle.  For LIM standard boards, there is no difference\r
-                   between pages and raw pages.\r
-\r
-               o   The system Raw Handle (Raw Handle = 0000h):\r
-                   For expanded memory boards that can remap the memory in\r
-                   the lower 640K-byte address space, managing the pages of\r
-                   memory which are used to fill in the lower 640K can be a\r
-                   problem.  To solve this problem, the memory manager will\r
-                   create a raw handle with a value of 0000h when DOS loads\r
-                   the manager.  This raw handle is called the system\r
-                   handle.\r
-\r
-                   At power up, the memory manager will allocate all of the\r
-                   pages that are mapped into the lower 640K bytes to the\r
-                   system handle.  These pages should be mapped in their\r
-                   logical order.  For example, if the system board\r
-                   supplies 256K bytes of RAM, and the 384K bytes above it\r
-                   is mappable, the system handle should have its logical\r
-                   page zero mapped into the first physical page at 256K,\r
-                   its logical page one mapped into the next physical page,\r
-                   and so on.\r
-\r
-                   The system handle should deal with raw pages.  To\r
-                   release some of these pages so application programs can\r
-                   use them, an operating system could decrease the number\r
-                   of pages allocated to the system handle with the\r
-                   "Reallocate" function.  Invoking the "Deallocate"\r
-                   function would decrease the system handle to zero size,\r
-                   but it must not deallocate the raw handle itself.  The\r
-                   "Deallocate" function treats the system handle dif-\r
-                   ferently than it treats other raw handles.  If the\r
-                   operating system can ever be "exited" (for example, the\r
-                   way Windows can be exited), it must increase the size of\r
-                   the system handle back to what is needed to fill 640K\r
-                   and map these logical pages back into physical memory\r
-                   before returning to DOS.\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          EMM Implementation Guidelines                                 207\r
-\f\r
-\r
-\r
-\r
-\r
-                   There are two functional special cases for this handle:\r
-\r
-                   -   The first special case deals with Function 4\r
-                       (Allocate Pages).  This function must never return\r
-                       zero as a handle value.  Applications must always\r
-                       invoke Function 4 to allocate pages and obtain a\r
-                       handle which identifies its pages.  Since Function 4\r
-                       will never return a handle value of zero, an\r
-                       application will never gain access to this special\r
-                       handle.\r
-\r
-                   -   The second special case deals with Function 6\r
-                       (Deallocate Pages).  If the operating system uses\r
-                       Function 6 to deallocate the pages which are\r
-                       allocated to the system handle, the pages will be\r
-                       returned to the manager for use, but the handle will\r
-                       not be available for reassignment.  The manager\r
-                       should treat a "deallocate pages" function request\r
-                       for this handle the same as a "reallocate pages"\r
-                       function request, where the number of pages to\r
-                       reallocate to this handle is zero.\r
-\r
-               o   Terminate and Stay Resident (TSR) Program Cooperation:\r
-                   In order for TSR's to cooperate with each other and with\r
-                   other applications, TSR's must follow this rule:  a\r
-                   program may only remap the DOS partition it lives in. \r
-                   This rule applies at all times, even when no expanded\r
-                   memory is present.\r
-\r
-               o   Accelerator Cards:\r
-                   To support generic accelerator cards, the support of\r
-                   Function 34, as defined by AST, is encouraged.\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          EMM Implementation Guidelines                                 208\r
-\f\r
-\r
-\r
-\r
-\r
-          Appendix D\r
-          OPERATING SYSTEM/ENVIRONMENT USE OF FUNCTION 28\r
-\r
-\r
-\r
-               All expanded memory boards have a set of registers that\r
-               "remember" the logical to physical page mappings.  Some\r
-               boards have extra (or alternate) sets of these mapping\r
-               registers.  Because no expanded memory board can supply an\r
-               infinite number of alternate map register sets, this\r
-               specification provides a way to simulate them using Function\r
-               28 (Alternate Map Register Set).\r
-\r
-\r
-          Examples\r
-\r
-               For the examples in this section, assume the hardware\r
-               supports alternate map register sets.  First Windows is\r
-               brought up, then "Reversi" is started.  Then control is\r
-               switched back to the MS-DOS Executive.  For this procedure,\r
-               here are the calls to the expanded memory manager:\r
-\r
-                                      Example 1\r
-\r
-          Allocate alt reg set           ; Start up the MS-DOS\r
-          (for MS-DOS Executive)         ; Executive\r
-\r
-          Set alt reg set\r
-          (for MS-DOS Executive)\r
-\r
-          Allocate alt reg set           ; Start up Reversi\r
-          (for Reversi)\r
-\r
-          Set alt reg set\r
-          (for Reversi)\r
-\r
-          Map pages\r
-          (for Reversi)\r
-\r
-          Set alt ret set                ; Switch back to MS-DOS\r
-          (for MS-DOS Executive)         ; Executive\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          Operating System Use Of Function 28                           209\r
-\f\r
-\r
-\r
-\r
-\r
-               Notice this procedure needed no "get" calls because the\r
-               register set contained all the information needed to save a\r
-               context.  However, using "Get" calls would have no ill\r
-               effects.\r
-\r
-                                      Example 2\r
-\r
-          Allocate alt reg set           ; Start up MS-DOS\r
-          (for MS-DOS Executive)         ; Executive\r
-\r
-          Set alt reg set\r
-          (for MS-DOS Executive)\r
-\r
-          Get alt reg set\r
-          (for MS-DOS Executive)\r
-\r
-          Allocate alt reg set           ; Start up Reversi\r
-          (for Reversi)\r
-\r
-          Set alt reg set\r
-          (for Reversi)\r
-\r
-          Map pages\r
-          (for Reversi)\r
-\r
-          Get alt reg set\r
-          (for Reversi)\r
-\r
-          Set alt reg set                ; Switch back to MS-DOS\r
-          (for MS-DOS Executive)         ; Executive\r
-\r
-               The important point to follow is that a Set must always\r
-               precede a Get.  The model of Set then Get is the inverse of\r
-               what interrupt handlers use, which is Get then Set (Get the\r
-               old map context and Set the new one).  Another crucial point\r
-               is that an alternate map register set must have the current\r
-               mapping when allocated; otherwise, the Set will create\r
-               chaos.\r
-\r
-               What happens if this is simulated in software?  The same Set\r
-               and Get model applies.  The main difference is where the\r
-               context is saved.\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          Operating System Use Of Function 28                           210\r
-\f\r
-\r
-\r
-\r
-\r
-               Since the allocate call is dynamic and there is no limit on\r
-               the number of sets allocated, the OS/E must supply the space\r
-               required.  Device drivers cannot allocate space dynamically,\r
-               since the request would fail.  If the Allocate register set\r
-               call returns a status indicating the alternate map register\r
-               sets aren't supported, the OS/E must allocate space for the\r
-               context.  It must also initialize the context using Function\r
-               15.  At that point it can do the Set, passing a pointer to\r
-               the map context space.  On the Get call, the EMM driver is\r
-               to return a pointer to the same context space.\r
-\r
-                                      Example 3\r
-\r
-          Allocate alt reg set           ; Start up MS-DOS\r
-          (for MS-DOS Executive)         ; Executive\r
-\r
-          Get Page Map\r
-          (for MS-DOS Executive)\r
-\r
-          Set alt reg set\r
-          (for MS-DOS Executive)\r
-\r
-          Allocate alt reg set           ; Start up Reversi\r
-          (for Reversi)\r
-\r
-          Set alt reg set\r
-          (for Reversi)\r
-\r
-          Map pages\r
-          (for Reversi)\r
-\r
-          Get Page Map\r
-          (for Reversi)\r
-\r
-          Set alt ret set                ; Switch back to MS-DOS\r
-          (for MS-DOS Executive)         ; Executive\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          Operating System Use Of Function 28                           211\r
-\f\r
-\r
-\r
-\r
-\r
-          GLOSSARY\r
-\r
-\r
-\r
-               The following terms are used frequently in this specifica-\r
-               tion:\r
-\r
-\r
-          Allocate                 To reserve a specified amount of\r
-                                   expanded memory pages.\r
-\r
-          Application Program      An application program is the program\r
-                                   you write and your customer uses.  Some\r
-                                   categories of application software are\r
-                                   word processors, database managers,\r
-                                   spreadsheet managers, and project\r
-                                   managers.\r
-\r
-          Conventional memory      The memory between 0 and 640K bytes,\r
-                                   address range 00000h thru 9FFFFh.\r
-\r
-          Deallocate               To return previously allocated expanded\r
-                                   memory to the memory manager.\r
-\r
-          EMM                      See Expanded Memory Manager.\r
-\r
-          Expanded memory          Expanded memory is memory outside DOS's\r
-                                   640K-byte limit (usually in the range of\r
-                                   C0000h thru EFFFFh).\r
-\r
-          Expanded Memory          A device driver that controls the\r
-            Manager (EMM)          interface between DOS application\r
-                                   programs and expanded memory.\r
-\r
-          Extended memory          The 15M-byte address range between\r
-                                   100000h thru FFFFFFh available on an\r
-                                   80286 processor when it is operating in\r
-                                   protected virtual address mode.\r
-\r
-          Handle                   A value that the EMM assigns and uses to\r
-                                   identify a block of memory requested by\r
-                                   an application program.  All allocated\r
-                                   logical pages are associated with a\r
-                                   particular handle.\r
-\r
-          Logical Page             The EMM allocates expanded memory in\r
-                                   units (typically 16K bytes) called\r
-                                   logical pages.\r
-\r
-          Mappable Segment         A 16K-byte region of memory which can\r
-                                   have a logical page mapped at it.\r
-\r
-\r
-          Glossary                                                      212\r
-\f\r
-\r
-\r
-\r
-\r
-          Map Registers            The set of registers containing the\r
-                                   current mapping context of the EMM\r
-                                   hardware.\r
-\r
-          Mapping                  The process of making a logical page of\r
-                                   memory appear at a physical page.\r
-\r
-          Mapping Context          The contents of the mapping registers at\r
-                                   a specific instant.  This context\r
-                                   represents a map state.\r
-\r
-          Page Frame               A collection of 16K-byte contiguous\r
-                                   physical pages from which an application\r
-                                   program accesses expanded memory.\r
-\r
-          Page Frame               A page frame base address is the\r
-            Base Address           location (in segment format) of the\r
-                                   first byte of the page frame.\r
-\r
-          Physical Page            A physical page is the range of memory\r
-                                   addresses occupied by a single 16K-byte\r
-                                   page.\r
-\r
-          Raw Page                 The smallest unit of mappable memory\r
-                                   that an expanded memory board can\r
-                                   supply.\r
-\r
-          Resident Application     A resident application program is loaded\r
-            Program                by DOS, executes, and remains resident\r
-                                   in the system after it returns control\r
-                                   to DOS.  This type of program occupies\r
-                                   memory and is usually invoked by the\r
-                                   operating system, an application\r
-                                   program, or the hardware.  Some example\r
-                                   of resident application programs are RAM\r
-                                   disks, print spoolers, and "pop-up"\r
-                                   desktop programs.\r
-\r
-          Status code              A code that an EMM function returns\r
-                                   which indicates something about the\r
-                                   result of running the function.  Some\r
-                                   status codes indicate whether the\r
-                                   function worked correctly and others may\r
-                                   tell you something about the expanded\r
-                                   memory hardware or software.\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          Glossary                                                      213\r
-\f\r
-\r
-\r
-\r
-\r
-          Transient Application    A transient application program is\r
-            Program                loaded by DOS, executes, and doesn't\r
-                                   remain in the system after it returns\r
-                                   control to DOS.  After a transient\r
-                                   application program returns control to\r
-                                   DOS, the memory it used is available for\r
-                                   other programs.\r
-\r
-          Unmap                    To make a logical page inaccessible for\r
-                                   reading or writing.\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          Glossary                                                      214\r
-\f\r
-\r
-\r
-\r
-\r
-          INDEX\r
-\r
-\r
-\r
-               Allocate Alternate Map Register Set  36, 163\r
-               Allocate DMA Register Set  36, 168, 190\r
-               Allocate Pages  5, 14, 23, 30, 34, 42, 43, 47, 49, 144,\r
-                   147, 148, 193, 206, 208\r
-               Allocate Raw Pages  36, 46, 80, 89, 147-149, 190, 193,\r
-                   206\r
-               Allocate Standard Pages  36, 42, 46, 80, 89, 144, 145,\r
-                   147, 190, 193\r
-               Alter Page Map & Call  7, 10, 35, 113, 118, 189\r
-               Alter Page Map & Jump  7, 10, 35, 109, 189\r
-               Alternate Map  10, 36, 151, 153-155, 157-159, 161, 163,\r
-                   164, 165-168, 170, 173, 175, 179, 182, 190, 197,\r
-                   209, 210, 211\r
-               Alternate Map Register Set  10, 36, 151, 153-155, 157,\r
-                   158, 159, 161, 163-168, 170, 173, 175, 190, 197,\r
-                   209, 210\r
-               Alternate Mapping and Unmapping Methods  81\r
-               Alternate Register  139, 166, 173, 177\r
-               Data Aliasing  12\r
-               Deallocate Alternate Map Register Set  36, 166\r
-               Deallocate DMA Register Set  36, 175, 190\r
-               Deallocate Pages  5, 14, 25, 31, 34, 43, 49, 88, 145,\r
-                   148, 208\r
-               Design Considerations  91, 151\r
-               Device Driver  1, 15, 43, 53, 55, 144, 148, 199, 201,\r
-                   202, 204, 212\r
-               Disable DMA on Alternate Map Register Set  173\r
-               Disable OS/E Function Set  36, 179, 180, 182, 185\r
-               DMA  36, 138-140, 151, 152, 168-176, 190, 197\r
-               DMA Channels  139, 171, 173, 174, 197\r
-               DMA Register  36, 139, 140, 151, 152, 168-171, 173-176,\r
-                   190, 197\r
-               DOS  1, 12, 14, 15, 19, 21, 30, 31, 49, 53, 88, 199-205,\r
-                   207-214\r
-               Enable DMA on Alternate Map Register Set  170\r
-               Enable OS/E Function Set  36, 179, 180\r
-               Enable/Disable OS/E Function Set  179, 180, 182, 185\r
-               Exchange Memory Region  7, 10, 35, 120, 126, 127, 189\r
-               Expanded Memory Support of DMA  151\r
-               Expanded Memory Support of DMA Register Sets  151\r
-               Extended Memory  91\r
-               Function 1  37\r
-               Function 10  57\r
-               Function 11  58\r
-               Function 12  59\r
-               Function 13  61\r
-               Function 14  7, 63\r
-\r
-\r
-          Index                                                         215\r
-\f\r
-\r
-\r
-\r
-\r
-               Function 15  13, 53, 55, 65, 67, 69, 71, 73, 76, 139,\r
-                   153, 154, 155, 158, 211\r
-               Function 16  13, 73, 76, 78\r
-               Function 17  6, 80, 82, 85\r
-               Function 18  6, 43, 88, 144, 148, 207\r
-               Function 19  7, 91, 92, 94, 96\r
-               Function 2  4, 38\r
-               Function 20  7, 98, 100\r
-               Function 21  7, 42, 102, 105, 107\r
-               Function 22  109\r
-               Function 23  113, 118\r
-               Function 24  7, 120, 126\r
-               Function 25  6, 8, 46, 74, 85, 132, 136\r
-               Function 26  138, 142, 179, 182, 206\r
-               Function 27  42, 46, 80, 89, 144, 145, 147-149, 193, 206\r
-               Function 28  140, 151, 153, 157, 161, 163, 164, 166,\r
-                   168, 170, 173, 175, 179, 182, 209\r
-               Function 29  177\r
-               Function 3  4, 40, 142\r
-               Function 30  138, 151, 153, 157, 161, 163, 166, 168,\r
-                   170, 173, 175, 179, 182, 185\r
-               Function 4  4, 42, 43, 46, 47, 49, 80, 89, 144, 145,\r
-                   147, 149, 193, 206, 208\r
-               Function 5  4, 46, 81\r
-               Function 6  4, 43, 49, 88, 145, 148, 208\r
-               Function 7  5, 51\r
-               Function 8  46, 50, 53, 55\r
-               Function 9  46, 50, 53, 55\r
-               Get & Set Page Map  35, 69\r
-               Get All Handle Pages  9, 34, 63\r
-               Get Alternate Map Register Set  36, 153, 154, 157, 190\r
-               Get Alternate Map Save Array Size  36, 161, 190\r
-               Get Attribute Capability  7, 96\r
-               Get Expanded Memory Hardware Information  10, 138, 142,\r
-                   179, 182\r
-               Get Handle Attribute  35, 92\r
-               Get Handle Count  9, 34, 59\r
-               Get Handle Directory  10, 35, 102, 105, 107\r
-               Get Handle Name  35, 98\r
-               Get Handle Pages  7, 9, 34, 61\r
-               Get Hardware Configuration Array  36, 138\r
-               Get Interrupt Vector  15, 21, 30, 199, 204, 205\r
-               Get Mappable Physical Address Array  6, 8, 10, 35, 46,\r
-                   85, 132, 136\r
-               Get Mappable Physical Address Array Entries  8, 136\r
-               Get Page Frame Address  5, 34, 38\r
-               Get Page Map  35, 65, 118, 153-155, 158, 211\r
-               Get Page Map Stack Space Size  35, 118\r
-               Get Partial Page Map  35, 73, 78\r
-               Get Size of Page Map Save Array  35, 65, 67, 71, 139\r
-               Get Size of Partial Page Map Save Array  74, 76, 78\r
-               Get Status  5, 34, 37\r
-\r
-          Index                                                         216\r
-\f\r
-\r
-\r
-\r
-\r
-               Get Total Handles  35, 107\r
-               Get Unallocated Page Count  5, 22, 34, 40, 142\r
-               Get Unallocated Raw Page Count  36, 142, 189\r
-               Get Version  5, 34, 51\r
-               Get/Set Handle Attribute  9, 91, 92, 94, 96\r
-               Get/Set Handle Name  10, 98, 100\r
-               Get/Set Page Map  9, 13, 65, 67, 69, 71\r
-               Get/Set Partial Page Map  9, 13, 73, 76, 78\r
-               Handle Attribute  9, 35, 91-94, 96, 188\r
-               Handle Name  6, 7, 10, 35, 98, 100, 105, 106, 188, 198\r
-               Intel  i, ii, 1, 5, 57, 58\r
-               Interrupt Vector  12, 15, 21, 30, 199, 204, 205\r
-               LIM  1, 7, 13, 19, 27, 53, 55, 138, 140, 206, 207\r
-               Logical Page  1, 5, 12, 16, 19, 23, 28, 31, 32, 46-48,\r
-                   80-83, 85, 86, 88, 110, 111, 115, 116, 120, 122,\r
-                   123, 125, 126, 128, 129, 131, 147, 194, 196, 207,\r
-                   212-214\r
-               Logical Page/Physical Page Method  82\r
-               Logical Page/Segment Address Method  85\r
-               Lotus  i, ii, 1, 5, 57, 58\r
-               Map Register  10, 13, 36, 53, 55, 151, 153-155, 157-159,\r
-                   161, 163-168, 170, 173, 175, 179, 182, 190, 197,\r
-                   209-211\r
-               Map/Unmap Handle Pages  46\r
-               Map/Unmap Multiple Handle Pages  9, 35, 80, 82, 85\r
-               Mapping and Unmapping Multiple Pages Simultaneously  80\r
-               Mapping Multiple Pages  6, 80\r
-               Microsoft  i, ii, 1, 5, 14, 30, 42, 57, 58, 144, 148\r
-               Move Memory Region  35, 120, 121, 189\r
-               Move/Exchange Memory Region  7, 10, 120, 126\r
-               Open Handle  64, 102, 199, 200, 203, 204\r
-               Operating System  3, 8, 10-12, 42, 43, 59, 63, 107, 138,\r
-                   139, 141, 142, 144-151, 153-159, 161-163, 165-171,\r
-                   173-177, 179-183, 185, 186, 190, 191, 198, 206,\r
-                   207-209, 213\r
-               Page Frame  1-6, 14, 17-19, 24, 28, 31, 34, 38, 39, 47,\r
-                   53, 55, 121, 128, 133, 187, 213\r
-               Page Map  7, 9, 10, 13, 34, 35, 50, 53, 55, 65, 67, 69,\r
-                   71, 73-76, 78, 109, 113, 118, 139, 153-155, 158,\r
-                   187, 188, 189, 211\r
-               Page Mapping Register I/O Array  57\r
-               Page Translation Array  58\r
-               Physical Page  1, 5, 6, 8, 10, 12, 16, 23, 28, 31, 35,\r
-                   46, 47, 48, 80-83, 85, 109-112, 114-117, 132-134,\r
-                   136, 138, 139, 142, 147, 188, 194, 207, 209, 213\r
-               Prepare Expanded Memory Hardware For Warm Boot  10, 177\r
-               Raw Handle  147, 149, 150, 206, 207\r
-               Raw Page  36, 142, 143, 147, 189, 206\r
-               Reallocate Pages  9, 35, 43, 88, 144, 145, 148, 208\r
-               Restore Page Map  9, 13, 34, 50, 53, 55\r
-               Return Access Key  185\r
-               Save Page Map  9, 13, 34, 50, 53, 55\r
-\r
-          Index                                                         217\r
-\f\r
-\r
-\r
-\r
-\r
-               Search For Named Handle  7, 35, 105\r
-               Set Alternate Map Register Set  36, 153-155, 157, 158,\r
-                   163, 190\r
-               Set Handle Attribute  9, 35, 91, 92, 94, 96\r
-               Set Handle Name  7, 10, 35, 98, 100\r
-               Set Page Map  9, 13, 35, 65, 67, 69, 71, 188\r
-               Set Partial Page Map  9, 13, 35, 73, 76, 78\r
-               Standard Handle  146\r
-               Standard Page  147\r
-               System DMA Capabilities  151\r
-               TSR  12, 13, 208\r
-               Unmapping Multiple Pages  6, 80\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-          Index                                                         218\r
-\f\r
-\1a \15\14\ ep\0\0ALLINFO.TXT\0\0\r
-Following are BBSes that are members of DV-NET.  DV-Net is an informal\r
-network of BBS's that carry files that would be useful to DESQview users. \r
-Not all BBSes that carry the DESQview conference are members of DV-Net.\r
-\r
-All address are NetMail addresses.\r
-\r
-            ----------------------------------------------\r
-                 DVNet DESQview Support File Network\r
-            ----------------------------------------------\r
-         DESQview is a trademark of Quarterdeck Office Systems\r
-       -----------------------------------------------------------\r
-         DVNet is not affiliated with Quarterdeck Office Systems\r
-   ----------------------------------------------------------------\r
-\r
-   Name, City and State             NetAddress  Telephone     Maxbaud\r
-   -------------------------------  ---------- ------------  -------\r
- *65'North, Fairbanks, AK         1:17/38    907-452-1460  9600HSTV32\r
-  Opus 386, Davis, CA             1:203/910  916-753-6321  2400\r
-  Carl's Corner, San Jose, CA     1:10/1     408-248-9704  9600HSTV32\r
-  Carl's Corner, San Jose, CA     1:10/2     408-248-0198  2400\r
-  SeaHunt BBS, Burlingame, CA     1:125/20   415-344-4348  9600HST\r
-  Stingray!, Clovis CA            1:205/12   209-298-9461  9600HST\r
-  SF PCUG BBS, San Francisco CA   1:1/310    415-621-2609  9600HSTV32RE\r
-  Bink of an Aye, Portland, OR    1:105/42   503-297-9043  9600PEPV32MO\r
-  P C Support, Portland, OR       1:105/66   503-297-9078  2400\r
-  Atarian BBS, Portland, OR       1:105/10   503-245-9730  9600HSTV32\r
-  Busker's BoneYard, Portland,OR  1:105/14   503-771-4773  9600PEP\r
-  Busker's Boneyard, Portland,OR  1:105/41   503-775-7926  9600HSTV32\r
-  Pacifier BBS, Vancouver, WA     1:105/103  206-253-9770  9600HSTV32\r
-  Puget Sound Gtwy., Puyallup, WA 1:138/3    206-566-8854  9600HST\r
-  Rampart General,Kansas City,MO  1:280/6    816-761-4039  9600HST\r
-  Oregon Trail XRoads, Casper WY  1:303/5    307-472-3615  9600H96\r
-  Dawg Byte, Nashville, TN        1:116/29   615-385-4268  9600HST\r
-  Dickson County, Dickson, TN     1:116/25   615-446-4475  2400\r
-  Programmers' Attic, Will., MI   1:159/850  517-655-3347  2400\r
-  Dark Side Of the Moon,Savoy IL  1:233/493  217-356-6922  9600HSTV32\r
-  Ecclesia Place, Monroeville, PA 1:129/75   412-373-8612  9600HST\r
-  The Other BBS, Harrisburg PA    1:270/101  717-657-2223  9600HST\r
-  IBM Tech Fido, Pepperell, MA    1:322/1    508-433-8452  9600HSTV32\r
-  Waystar BBS, Marlborough, MA    1:322/14   508-481-7147  9600HST\r
-  Andromeda Galaxy, Troy NY       1:267/167  518-273-8313  9600HST\r
-  Treasure Island, Danbury, CT    1:141/730  203-791-8532, 9600HST\r
-  Addict's Attic,Germantown MD    1:109/423  301-428-8998  9600HST\r
-  Maple Shade Opus,Maple Shade NJ 1:266/12   609-482-8604  9600HSTV32\r
-  Capital City , Burlington NJ   99:9230/1   609-386-1989  9600HSTV32\r
-  Capital City , Burlington NJ    8:950/10   609-386-1989  9600HSTV32\r
-  Southern Cross BBS, Miami FL    1:135/69   305-220-8752  9600HST\r
-  Software Designer, Albany, GA   1:3617/1   912-432-2440  9600HSTV32\r
-  Software Designer, Albany, GA   8:928/1    912-432-2440  9600HSTV32\r
-  Dragon's Lair, Galveston, TX    1:386/451  409-762-2761  9600HST\r
-  Dragon's Lair, Galveston, TX    1:386/1451 409-762-7456  2400MNP\r
-  Conch Opus, Houston, TX         1:106/357  713-667-7213  2400PCP\r
-  Inns of Court, Dallas, TX       1:124/6101 214-458-2620  9600HSTV32\r
-  Dallas Email, Dallas, TX        8:930/101  214-358-1205  9600HSTV32MO\r
-  Spare Parts, Bedford, TX        1:130/38   817-540-3527  9600HST\r
-  QE2, Austin TX                  1:382/58   512-328-1229  2400\r
-  Ned's Opus HST Ottawa,ON Canada 1:163/211  613-523-8965  9600HST\r
-  Ned's Opus, Ottawa ON Canada    1:163/210  613-731-8132  2400\r
-  Imperial Terran, St Cath,ON     1:247/102  416-646-7105  9600HST\r
-  Arcane BBS, Laval PQ Canada     1:167/116  514-687-9586  9600HST\r
-  Zone 2 & Zone 3\r
-  ------------------------------  ---------  ------------- -------\r
-  The HEKOM Board (Netherlands)   2:286/3    31-3483-4072  2400MNP5\r
-  BBS_D.C.V.V., Maaseik (Belgium) 2:295/26   32-11-568620
\ No newline at end of file
diff --git a/16/PCGPE10/MIDI.TXT b/16/PCGPE10/MIDI.TXT
deleted file mode 100644 (file)
index 14e5d27..0000000
+++ /dev/null
@@ -1,5939 +0,0 @@
-\r
-                           Standard MIDI File Format\r
-                                Dustin Caldwell\r
-\r
-      The standard MIDI file format is a very strange beast. When viewed as a\r
-whole, it can be quite overwhelming. Of course, no matter how you look at it,\r
-describing a piece of music in enough detail to be able to reproduce it\r
-accurately is no small task. So, while complicated, the structure of the midi\r
-file format is fairly intuitive when understood. \r
-      I must insert a disclaimer here that I am by no means an expert with\r
-midi nor midi files. I recently obtained a Gravis UltraSound board for my PC,\r
-and upon hearing a few midi files (.MID) thought, "Gee, I'd like to be able to\r
-make my own .MID files." Well, many aggravating hours later, I discovered that\r
-this was no trivial task. But, I couldn't let a stupid file format stop me.\r
-(besides, I once told my wife that computers aren't really that hard to use,\r
-and I'd hate to be a hypocrite) So if any errors are found in this\r
-information, please let me know and I will fix it. Also, this document's scope\r
-does not extend to EVERY type of midi command and EVERY possible file\r
-configuration. It is a basic guide that should enable the reader (with a\r
-moderate investment in time) to generate a quality midi file.\r
-\r
-1. Overview\r
-\r
-      A midi (.MID) file contains basically 2 things, Header chunks and Track\r
-chunks. Section 2 explains the header chunks, and Section 3 explains the track\r
-chunks. A midi file contains ONE header chunk describing the file format,\r
-etc., and any number of track chunks. A track may be thought of in the same\r
-way as a track on a multi-track tape deck. You may assign one track to each\r
-voice, each staff, each instrument or whatever you want. \r
-\r
-2. Header Chunk\r
-\r
-      The header chunk appears at the beginning of the file, and describes the\r
-file in three ways. The header chunk always looks like:\r
-\r
-4D 54 68 64 00 00 00 06 ff ff nn nn dd dd\r
-\r
-The ascii equivalent of the first 4 bytes is MThd. After MThd comes the 4-byte\r
-size of the header. This will always be 00 00 00 06, because the actual header\r
-information will always be 6 bytes. \r
-\r
-ff ff is the file format. There are 3 formats:\r
-\r
-0 - single-track \r
-1 - multiple tracks, synchronous\r
-2 - multiple tracks, asynchronous\r
-\r
-Single track is fairly self-explanatory - one track only. Synchronous multiple\r
-tracks means that the tracks will all be vertically synchronous, or in other\r
-words, they all start at the same time, and so can represent different parts\r
-in one song. Asynchronous multiple tracks do not necessarily start at the same\r
-time, and can be completely asynchronous. \r
-\r
-nn nn is the number of tracks in the midi file.\r
-\r
-dd dd is the number of delta-time ticks per quarter note. (More about this\r
-later)\r
-\r
-\r
-3. Track Chunks\r
-\r
-The remainder of the file after the header chunk consists of track chunks.\r
-Each track has one header and may contain as many midi commands as you like.\r
-The header for a track is very similar to the one for the file:\r
-\r
-4D 54 72 6B xx xx xx xx\r
-\r
-As with the header, the first 4 bytes has an ascii equivalent. This one is\r
-MTrk. The 4 bytes after MTrk give the length of the track (not including the\r
-track header) in bytes. \r
-      Following the header are midi events. These events are identical to the\r
-actual data sent and received by MIDI ports on a synth with one addition. A\r
-midi event is preceded by a delta-time. A delta time is the number of ticks\r
-after which the midi event is to be executed. The number of ticks per quarter\r
-note was defined previously in the file header chunk. This delta-time is a\r
-variable-length encoded value. This format, while confusing, allows large\r
-numbers to use as many bytes as they need, without requiring small numbers to\r
-waste bytes by filling with zeros. The number is converted into 7-bit bytes,\r
-and the most-significant bit of each byte is 1 except for the last byte of the\r
-number, which has a msb of 0. This allows the number to be read one byte at a\r
-time, and when you see a msb of 0, you know that it was the last (least\r
-significant) byte of the number. According to the MIDI spec, the entire delta-\r
-time should be at most 4 bytes long. \r
-      Following the delta-time is a midi event. Each midi event (except a\r
-running midi event) has a command byte which will always have a msb of 1 (the\r
-value will be >= 128). A list of most of these commands is in appendix A. Each\r
-command has different parameters and lengths, but the data that follows the\r
-command will have a msb of 0 (less than 128). The exception to this is a meta-\r
-event, which may contain data with a msb of 1. However, meta-events require a\r
-length parameter which alleviates confusion. \r
-      One subtlety which can cause confusion is running mode. This is where\r
-the actual midi command is omitted, and the last midi command issued is\r
-assumed. This means that the midi event will consist of a delta-time and the\r
-parameters that would go to the command if it were included. \r
-\r
-4. Conclusion\r
-\r
-      If this explanation has only served to confuse the issue more, the\r
-appendices contain examples which may help clarify the issue. Also, 2\r
-utilities and a graphic file should have been included with this document: \r
-\r
-DEC.EXE - This utility converts a binary file (like .MID) to a tab-delimited\r
-text file containing the decimal equivalents of each byte.\r
-\r
-REC.EXE - This utility converts a tab-delimited text file of decimal values\r
-into a binary file in which each byte corresponds to one of the decimal\r
-values.\r
-\r
-MIDINOTE.PS - This is the postscript form of a page showing note numbers with\r
-a keyboard and with the standard grand staff.\r
-                                       \f                                  Appendix A\r
-\r
-1. MIDI Event Commands\r
-\r
-Each command byte has 2 parts. The left nybble (4 bits) contains the actual\r
-command, and the right nybble contains the midi channel number on which the\r
-command will be executed. There are 16 midi channels, and 8 midi commands (the\r
-command nybble must have a msb of 1).\r
-In the following table, x indicates the midi channel number. Note that all\r
-data bytes will be <128 (msb set to 0).\r
-\r
-Hex      Binary       Data          Description\r
-8x       1000xxxx     nn vv         Note off (key is released)\r
-                                    nn=note number\r
-                                    vv=velocity\r
-\r
-9x       1001xxxx     nn vv         Note on (key is pressed)\r
-                                    nn=note number\r
-                                    vv=velocity\r
-\r
-Ax       1010xxxx     nn vv         Key after-touch\r
-                                    nn=note number\r
-                                    vv=velocity\r
-\r
-Bx       1011xxxx     cc vv         Control Change\r
-                                    cc=controller number\r
-                                    vv=new value\r
-\r
-Cx       1100xxxx     pp            Program (patch) change\r
-                                    pp=new program number\r
-\r
-Dx       1101xxxx     cc            Channel after-touch\r
-                                    cc=channel number\r
-\r
-Ex       1110xxxx     bb tt         Pitch wheel change (2000H is normal or no\r
-                                    change)\r
-                                    bb=bottom (least sig) 7 bits of value\r
-                                    tt=top (most sig) 7 bits of value\r
-\fThe following table lists meta-events which have no midi channel number. They\r
-are of the format:\r
-\r
-FF xx nn dd\r
-\r
-All meta-events start with FF followed by the command (xx), the length, or\r
-number of bytes that will contain data (nn), and the actual data (dd).\r
-\r
-Hex      Binary       Data          Description\r
-00       00000000     nn ssss       Sets the track's sequence number.\r
-                                    nn=02 (length of 2-byte sequence number)\r
-                                    ssss=sequence number\r
-\r
-01       00000001     nn tt ..      Text event- any text you want.\r
-                                    nn=length in bytes of text\r
-                                    tt=text characters\r
-\r
-02       00000010     nn tt ..      Same as text event, but used for\r
-                                    copyright info.\r
-                                    nn tt=same as text event\r
-\r
-03       00000011     nn tt ..      Sequence or Track name\r
-                                    nn tt=same as text event\r
-\r
-04       00000100     nn tt ..      Track instrument name\r
-                                    nn tt=same as text event\r
-\r
-05       00000101     nn tt ..      Lyric\r
-                                    nn tt=same as text event\r
-\r
-06       00000110     nn tt ..      Marker\r
-                                    nn tt=same as text event\r
-\r
-07       00000111     nn tt ..      Cue point\r
-                                    nn tt=same as text event\r
-\r
-2F       00101111     00            This event must come at the end of each\r
-                                    track\r
-\r
-51       01010001     03 tttttt     Set tempo\r
-                                    tttttt=microseconds/quarter note\r
-\r
-58       01011000     04 nn dd ccbb Time Signature\r
-                                    nn=numerator of time sig.\r
-                                    dd=denominator of time sig. 2=quarter\r
-                                    3=eighth, etc.\r
-                                    cc=number of ticks in metronome click\r
-                                    bb=number of 32nd notes to the quarter\r
-                                    note\r
-\r
-59       01011001     02 sf mi      Key signature\r
-                                    sf=sharps/flats (-7=7 flats, 0=key of C,\r
-                                    7=7 sharps)\r
-                                    mi=major/minor (0=major, 1=minor)\r
-\r
-7F       01111111     xx dd ..      Sequencer specific information\r
-                                    xx=number of bytes to be sent\r
-                                    dd=data\f\r
-The following table lists system messages which control the entire system.\r
-These have no midi channel number. (these will generally only apply to\r
-controlling a midi keyboard, etc.)\r
-\r
-Hex      Binary       Data          Description\r
-F8       11111000                   Timing clock used when synchronization is\r
-                                    required.\r
-\r
-FA       11111010                   Start current sequence\r
-\r
-FB       11111011                   Continue a stopped sequence where left\r
-                                    off\r
-\r
-FC       11111100                   Stop a sequence\r
-\r
-\r
-The following table lists the numbers corresponding to notes for use in note \r
-on and note off commands.\r
-\r
-\r
-Octave||                     Note Numbers\r
-   #  ||\r
-      || C   | C#  | D   | D#  | E   | F   | F#  | G   | G#  | A   | A#  | B\r
------------------------------------------------------------------------------\r
-   0  ||   0 |   1 |   2 |   3 |   4 |   5 |   6 |   7 |   8 |   9 |  10 | 11\r
-   1  ||  12 |  13 |  14 |  15 |  16 |  17 |  18 |  19 |  20 |  21 |  22 | 23\r
-   2  ||  24 |  25 |  26 |  27 |  28 |  29 |  30 |  31 |  32 |  33 |  34 | 35\r
-   3  ||  36 |  37 |  38 |  39 |  40 |  41 |  42 |  43 |  44 |  45 |  46 | 47\r
-   4  ||  48 |  49 |  50 |  51 |  52 |  53 |  54 |  55 |  56 |  57 |  58 | 59\r
-   5  ||  60 |  61 |  62 |  63 |  64 |  65 |  66 |  67 |  68 |  69 |  70 | 71\r
-   6  ||  72 |  73 |  74 |  75 |  76 |  77 |  78 |  79 |  80 |  81 |  82 | 83\r
-   7  ||  84 |  85 |  86 |  87 |  88 |  89 |  90 |  91 |  92 |  93 |  94 | 95\r
-   8  ||  96 |  97 |  98 |  99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107\r
-   9  || 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119\r
-  10  || 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 |\r
-\r
-\r
-                                BIBLIOGRAPHY\r
-\r
-  "MIDI Systems and Control" Francis Rumsey  1990 Focal Press\r
-\r
-  "MIDI and Sound Book for the Atari ST" Bernd Enders and Wolfgang Klemme\r
-          1989 M&T Publishing, Inc.\r
-\r
-  MIDI file specs and general MIDI specs were also obtained by sending e-mail\r
-         to LISTSERV@AUVM.AMERICAN.EDU with the phrase GET MIDISPEC PACKAGE\r
-         in the message.\r
-\r
-\r
-------------------------------- DEC.CPP ------------------------------------\r
-\r
-/*  file  dec.cpp\r
-\r
-by  Dustin Caldwell    (dustin@gse.utah.edu)\r
-\r
-*/\r
-\r
-\r
-#include <dos.h>\r
-#include <stdio.h>\r
-#include <stdlib.h>\r
-\r
-void helpdoc();\r
-\r
-main()\r
-{\r
-        FILE *fp;\r
-\r
-        unsigned char ch, c;\r
-\r
-        if((fp=fopen(_argv[1], "rb"))==NULL)            /* open file to read */\r
-        {\r
-                printf("cannot open file %s\n",_argv[1]);\r
-                helpdoc();\r
-                exit(-1);\r
-        }\r
-\r
-        c=0;\r
-        ch=fgetc(fp);\r
-\r
-        while(!feof(fp))                        /* loop for whole file */\r
-        {\r
-                printf("%u\t", ch);             /* print every byte's decimal equiv. */\r
-                c++;\r
-                if(c>8)                                 /* print 8 numbers to a line */\r
-                {\r
-                        c=0;\r
-                        printf("\n");\r
-                }\r
-\r
-                ch=fgetc(fp);\r
-        }\r
-\r
-        fclose(fp);                     /* close up */\r
-}\r
-\r
-void helpdoc()                  /* print help message */\r
-{\r
-        printf("\n   Binary File Decoder\n\n");\r
-\r
-        printf("\n Syntax:  dec binary_file_name\n\n");\r
-\r
-        printf("by Dustin Caldwell  (dustin@gse.utah.edu)\n\n");\r
-        printf("This is a filter program that reads a binary file\n");\r
-        printf("and prints the decimal equivalent of each byte\n");\r
-        printf("tab-separated. This is mostly useful when piped \n");\r
-        printf("into another file to be edited manually.  eg:\n\n");\r
-        printf("c:\>dec sonata3.mid > son3.txt\n\n");\r
-        printf("This will create a file called son3.txt which can\n");\r
-        printf("be edited with any ascii editor. \n\n");\r
-        printf("(rec.exe may also be useful, as it reencodes the \n");\r
-        printf("ascii text file).\n\n");\r
-        printf("Have Fun!!\n");\r
-}\r
-\r
----------------------------- REC.CPP ----------------------------------\r
-\r
-/*  File  rec.cpp\r
-        by Dustin Caldwell   (dustin@gse.utah.edu)\r
-*/\r
-\r
-#include <dos.h>\r
-#include <stdio.h>\r
-#include <ctype.h>\r
-#include <stdlib.h>\r
-\r
-void helpdoc();\r
-\r
-main()\r
-{\r
-        FILE *rfp, *wfp;\r
-\r
-        unsigned char ch, c;\r
-        char s[20];\r
-\r
-        if((rfp=fopen(_argv[1], "r"))==NULL)                    /* open the read file */\r
-        {\r
-                printf("cannot open file %s \n",_argv[1]);\r
-                helpdoc();\r
-                exit(-1);\r
-        }\r
-\r
-        if((wfp=fopen(_argv[2], "wb"))==NULL)                   /* open the write file */\r
-        {\r
-                printf("cannot open file %s \n",_argv[1]);\r
-                helpdoc();\r
-                exit(-1);\r
-        }\r
-\r
-        c=0;\r
-\r
-        ch=fgetc(rfp);\r
-\r
-        while(!feof(rfp))                       /* loop for whole file */\r
-        {\r
-\r
-                if(isalnum(ch))                 /* only 'see' valid ascii chars */\r
-                {\r
-                        c=0;\r
-                        while(isdigit(ch))      /* only use decimal digits (0-9) */\r
-                        {\r
-                                s[c]=ch;        /* build a string containing the number */\r
-                                c++;\r
-                                ch=fgetc(rfp);\r
-                        }\r
-                        s[c]=NULL;                      /* must have NULL terminator */\r
-\r
-                        fputc(atoi(s), wfp);/* write the binary equivalent to file */\r
-\r
-                }\r
-\r
-                ch=fgetc(rfp);                  /* loop until next number starts */\r
-\r
-\r
-        }\r
-\r
-        fclose(rfp);                    /* close up */\r
-        fclose(wfp);\r
-}\r
-\r
-\r
-void helpdoc()          /* print help message */\r
-{\r
-        printf("\n   Text File Encoder\n\n");\r
-\r
-        printf("\n Syntax:  rec text_file_name binary_file_name\n\n");\r
-\r
-        printf("by Dustin Caldwell  (dustin@gse.utah.edu)\n\n");\r
-        printf("This is a program that reads an ascii tab-\n");\r
-        printf("delimited file and builds a binary file where\n");\r
-        printf("each byte of the binary file is one of the decimal\n");\r
-        printf("digits in the text file.\n");\r
-        printf(" eg:\n\n");\r
-        printf("c:\>rec son3.txt son3.mid\n\n");\r
-        printf("(This will create a file called son3.mid which is\n");\r
-        printf("a valid binary file)\n\n");\r
-        printf("(dec.exe may also be useful, as it decodes binary files)\n\n");\r
-        printf("Have Fun!!\n");\r
-}\r
-\r
------------------------------ MIDIFILE.PS ---------------------------------\r
-\e%-12345X@PJL ENTER LANGUAGE = POSTSCRIPT\r
-%!PS-Adobe\r
-/wpdict 120 dict def\r
-wpdict  begin\r
-/bdef   {bind def} bind def\r
-\r
-/bflg   false def\r
-/Bfont  0 def\r
-/bon    false def\r
-\r
-/psz    0 def\r
-/_S     /show load def\r
-/_t     {0 rmoveto} bdef\r
-\r
-/_pixelsnap\r
-        {transform .25 sub round .25 add\r
-         exch .25 sub round .25 add exch itransform\r
-        } bdef\r
-/_pixeldsnap\r
-        { dtransform round exch round exch idtransform } bdef\r
-\r
-/_lt    {_pixelsnap lineto} bdef\r
-/_rlt   {_pixeldsnap rlineto} bdef\r
-/_mt    {_pixelsnap moveto} bdef\r
-/_rmt   {_pixeldsnap rmoveto} bdef\r
-\r
-/bshow  {gsave psz 30 div 0 _rmt dup show grestore show} bdef\r
-\r
-/DUx    0 def\r
-/DUy    0 def\r
-/hscl   0 def\r
-\r
-/M      {_mt\r
-         2 mul -2 2\r
-         { -2 roll 0 _rmt _S } for\r
-        } bdef\r
-\r
-/makeoutl\r
-        { dup /OutlineFlag known not\r
-          { dup dup length 2 add dict begin\r
-            {1 index /FID ne { def }{ pop pop } ifelse } forall\r
-            /UniqueID known {/UniqueID UniqueID 10000 add def} if\r
-            /PaintType PaintType 0 eq { 2 }{ PaintType } ifelse def\r
-            /StrokeWidth 15 def\r
-            /OutlineFlag true def\r
-            /OutlineFont currentdict end definefont\r
-          } if\r
-        } bdef\r
-\r
-/nbuff  50 string def\r
-/orntsv 0 def\r
-/plen   0 def\r
-/pwid   0 def\r
-/picstr 1 string def\r
-\r
-/WPencoding StandardEncoding 256 array copy def 0\r
- [ 127/Aacute/Acircumflex/Adieresis/Agrave/Aring/Atilde/Ccedilla\r
-  /Delta/Eacute/Ecircumflex/Edieresis/Egrave/Eth/Gamma/Iacute\r
-  /Icircumflex/Idieresis/Igrave/Lambda/Ntilde/Oacute\r
-  /Ocircumflex/Odieresis/Ograve/Omega/Otilde/Phi/Pi/Psi\r
-  /Scaron/Sigma/TeXtext32/Theta/Thorn\r
-  209/Uacute/Ucircumflex/Udieresis/Ugrave/Upsilon/Xi/Yacute\r
-  /Ydieresis/Zcaron/aacute/acircumflex/adieresis/agrave\r
-  /aring/atilde/brokenbar\r
-  228/ccedilla/copyright/degree/divide\r
-  236/dotlessj/eacute/ecircumflex/edieresis/egrave\r
-  242/eth/ff/ffi\r
-  246/ffl/iacute\r
-  252/icircumflex/idieresis/igrave/logicalnot\r
-  1/minus/mu/multiply/ntilde/oacute/ocircumflex/odieresis\r
-  /ograve/onehalf/onequarter/onesuperior/otilde/plusminus\r
-  /registered/scaron/thorn/threequarters/threesuperior\r
-  /trademark/twosuperior/uacute/ucircumflex/udieresis\r
-  /ugrave/yacute/ydieresis/zcaron\r
-]\r
-{ dup type /nametype eq\r
-  { WPencoding 2 index 2 index put pop 1 add }\r
-  { exch pop } ifelse\r
-} forall pop\r
-\r
-/reencode\r
-{ dup FontDirectory exch known\r
-   { findfont }\r
-   {  dup nbuff cvs dup length 1 sub get 82 eq\r
-   {dup nbuff cvs dup length 1 sub 0 exch getinterval\r
-   findfont begin\r
-   currentdict dup length dict begin\r
-{ 1 index /FID ne {def} {pop pop} ifelse } forall\r
-/FontName exch def\r
-\r
-/Encoding WPencoding def\r
-currentdict dup end end\r
-/FontName get exch definefont\r
-     }\r
-     { findfont } ifelse\r
-  } ifelse\r
-} bdef\r
-\r
-/WPDLencoding StandardEncoding 256 array copy def 0\r
-[ 127     /SA420000/SD630000/SF010000/SF020000/SF030000\r
-/SF040000/SF050000/SF060000/SF070000/SF080000/SF090000\r
-/SF100000/SF110000/SF140000/SF150000/SF160000/SF190000\r
-/SF200000/SF210000/SF220000/SF230000/SF240000/SF250000/SF260000\r
-/SF270000/SF280000/SF360000/SF370000/SF380000/SF390000/SF400000\r
-/SF410000/SF420000/SF430000\r
-209 /SF440000/SF450000/SF460000/SF470000/SF480000\r
-/SF490000/SF500000/SF510000/SF520000/SF530000/SF540000\r
-/SF570000/SF580000/SF590000/SF600000/SF610000\r
-228 /SM570001/SM590000/SM600000/SM630000\r
-236 /SM680000/SM690000/SM700000/SM750000/SM750002\r
-242 /SM770000/SM790000/SP320000\r
-246 /SS000000/SS010000\r
-252 /SS260000/SS270000/SV040000/apostrophereverse\r
-1/arrowboth/arrowdown/arrowleft/arrowright/arrowup/club\r
-/deutschmark/diamond/diamondopen/exclamdbl/female\r
-/fiveeighths/franc/heart/male/musicalnote/musicalnotedbl\r
-/napostrophe/nsuperior/oneeighths/seveneighths/spade\r
-/threeeights/underscoredbl/SM760000\r
-]\r
-{ dup type /nametype eq\r
-  { WPDLencoding 2 index 2 index put pop 1 add }\r
-  { exch pop } ifelse\r
-} forall pop\r
-\r
-/reencodeL\r
-    { dup FontDirectory exch known\r
-      { findfont }\r
-      {  dup nbuff cvs dup length 1 sub get 76 eq\r
-         {    dup nbuff cvs dup length 1 sub 0 exch getinterval\r
-         findfont begin\r
-         currentdict dup length dict begin\r
-         { 1 index /FID ne {def} {pop pop} ifelse } forall\r
-         /FontName exch def\r
-         /Encoding WPDLencoding def\r
-         currentdict dup end end\r
-         /FontName get exch definefont\r
-         }\r
-         { findfont } ifelse\r
-      } ifelse\r
-    } bdef\r
-\r
-/ron    false def\r
-/sflg   false def\r
-/slan   0 def\r
-/sp     32 def\r
-\r
-/sshow\r
-        { save exch\r
-           gsave\r
-            psz 20 div dup neg _rmt dup show\r
-           grestore\r
-           dup\r
-           save exch\r
-            Bfont setfont\r
-            1 setgray show\r
-           restore\r
-           currentfont makeoutl setfont show\r
-           currentpoint 3 -1 roll\r
-          restore _mt\r
-        } bdef\r
-\r
-/Sx     0 def\r
-/Sy     0 def\r
-/Ux     0 def\r
-/Uy     0 def\r
-/W      /widthshow load def\r
-\r
-/_B     {/bflg true def\r
-         sflg not {/_S /bshow load def /bon true def} if\r
-        } bdef\r
-/_b     {/bflg false def\r
-         bon {/_S /show load def /bon false def} if\r
-        } bdef\r
-/_bd    {save} bdef\r
-/_bp    {save 2 setmiterlimit .06 .06 scale 0 0 _mt} bdef\r
-/_ccprocs\r
-        {/proc2 exch cvlit def\r
-         /proc1 exch cvlit def\r
-         /newproc proc1 length proc2 length add\r
-         array def\r
-         newproc 0 proc1 putinterval\r
-         newproc proc1 length proc2 putinterval\r
-         newproc cvx\r
-        } def\r
-/_clr   {3 {255 div 3 1 roll} repeat\r
-         ron {6 3 roll pop pop pop} {setrgbcolor} ifelse\r
-        } bdef\r
-/_cp    /closepath load def\r
-/_cw    {stroke initclip _mt 0 2 index\r
-         _rlt 0 _rlt 0 exch neg\r
-         _rlt clip newpath\r
-        } bdef\r
-/_d     /setdash load def\r
-/_DU    {currentpoint /DUy exch def /DUx exch def} bdef\r
-/_du    {gsave\r
-          save\r
-          8 setlinewidth\r
-      currentpoint -30 add _mt\r
-      DUx DUy -30 add _lt stroke\r
-          restore\r
-          8 setlinewidth\r
-          currentpoint -50 add _mt\r
-          DUx DUy -50 add _lt stroke\r
-         grestore\r
-        } bdef\r
-/_ed    {restore} bdef\r
-/_ep    {restore showpage 0 0 _mt} bdef\r
-/_f     /eofill load def\r
-/_ff    { exch reencode exch\r
-          3 div dup /psz exch def\r
-          scalefont dup /Bfont exch def setfont\r
-        } bdef\r
-/_ffs   { /slan exch 10 div def /hscl exch 1000 div def\r
-          /psz exch 3 div def\r
-          [ psz hscl mul 0 slan dup sin exch cos div psz mul psz 0 0 ]\r
-          exch reencode exch makefont dup /Bfont exch def setfont\r
-        } bdef\r
-/_g     /setgray load def\r
-/_gs    {neg 100 add 100 div setgray} bdef\r
-/_i     {gsave\r
-          dup /picstr exch 7 add 8 idiv string def\r
-          3 1 roll translate dup 1 scale\r
-          dup 1 1 [5 -1 roll 0 0 1 0 0]\r
-          {currentfile picstr readhexstring pop} image\r
-         grestore\r
-        } bdef\r
-/_is    {save 4 1 roll\r
-          dup /picstr exch 7 add 8 idiv string def\r
-          3 1 roll translate dup 1 scale\r
-          dup 1 1 [5 -1 roll 0 0 1 0 0]\r
-          {currentfile picstr readhexstring pop} image\r
-         restore\r
-        } bdef\r
-/_ie    {1 eq { {1 exch sub} currenttransfer _ccprocs settransfer} if\r
-         /_isx exch def /_isy exch def\r
-         _isx mul exch _isy mul translate\r
-         add 2 div /_txc exch def\r
-         add 2 div /_tyc exch def\r
-         _txc _isx mul _tyc _isy mul translate\r
-         360 exch sub rotate\r
-         1 eq { _isx neg _isy scale }\r
-         { _isx _isy scale }\r
-         ifelse _txc neg _tyc neg translate\r
-        } bdef\r
-/_irms  {save\r
-          12 1 roll\r
-          1 eq {{1 exch sub} currenttransfer _ccprocs settransfer} if\r
-          /picstr exch string def translate\r
-          2 index 6 index sub 2 div 2 index 6 index sub 2 div neg\r
-          translate\r
-          5 index 5 index 2 div neg exch 2 div exch\r
-          2 copy neg exch neg exch 5 2 roll translate\r
-          360 exch sub rotate\r
-          3 index 3 index 7 index div exch 8 index div exch scale\r
-          translate pop pop 2 index 2 index scale\r
-          3 index 0 eq\r
-          { [ 3 index 0 0 5 index neg 0 0 ] }\r
-          { 3 index 1 eq\r
-      { [ 3 index 0 0 5 index 0 7 index ] }\r
-      { 3 index 128 eq\r
-          { [ 3 index neg 0 0 5 index neg 7 index 0 ] }\r
-          { [ 3 index neg 0 0 5 index 7 index 7 index ] } ifelse\r
-            } ifelse\r
-          } ifelse\r
-          {currentfile picstr readhexstring pop} image\r
-          pop\r
-         restore\r
-        } bdef\r
-\r
-/_l     {_lt} bdef\r
-/_lr    {_rlt} bdef\r
-/_m     {_mt} bdef\r
-/_O     {currentfont makeoutl setfont} bdef\r
-/_o     {Bfont setfont} bdef\r
-/_ornt  {/pwid exch def /plen exch def\r
-         orntsv 1 eq {0 pwid translate -90 rotate} if\r
-         orntsv 2 eq {pwid plen translate 180 rotate} if\r
-         orntsv 3 eq {plen 0 translate 90 rotate} if\r
-         dup 1 eq {pwid 0 translate 90 rotate} if\r
-         dup 2 eq {pwid plen translate 180 rotate} if\r
-         dup 3 eq {0 plen translate -90 rotate} if\r
-         /orntsv exch def\r
-        } bdef\r
-/_lod1  {currentpoint orntsv plen pwid 6 -1 roll restore save} bdef\r
-/_lod2  {_bp 7 2 roll _ornt _mt} bdef\r
-/_unlod {currentpoint orntsv plen pwid 7 -2 roll restore restore\r
-         _bp 6 1 roll _ornt _mt\r
-        } bdef\r
-/_p     {2 copy _mt 1 0 _rlt _mt} bdef\r
-/_pl    {{_lt} repeat} bdef\r
-/_R      { /ron true def /_S /_rshow load def /_t /_red load def} bdef\r
-/_rshow  { save exch\r
-           currentpoint\r
-           /RSy exch def /RSx exch def\r
-           ron {\r
-                 sflg\r
-                 {      currentpoint\r
-                        /Ry exch def /Rx exch def\r
-                        dup stringwidth pop Rx Ry psz 4 div add _mt\r
-                        Rx psz 15 add setlinewidth .95 setgray 0 setlinecap\r
-                        add Ry psz 4 div add _lt stroke Rx Ry _mt 0 0 0 setrgbcolor\r
-                        dup show Rx Ry _mt\r
-                        sshow\r
-                 }\r
-                 { _redshow\r
-                 }ifelse\r
-           }\r
-           {     sflg {sshow} if\r
-           }ifelse\r
-           currentpoint 3 -1 roll\r
-           restore _mt\r
-         } bdef\r
-/_red   { gsave dup\r
-         currentpoint /Ry exch def /Rx exch def\r
-         Rx Ry psz 4 div add _mt\r
-         Rx psz 15 add setlinewidth .95 setgray 0 setlinecap\r
-         add Ry psz 4 div add _lt stroke\r
-         Rx Ry _mt\r
-         grestore\r
-         0 rmoveto\r
-    }bdef\r
-/_redshow {currentpoint\r
-         /Ry exch def /Rx exch def\r
-         dup stringwidth pop Rx Ry psz 4 div add _mt\r
-         Rx psz 15 add setlinewidth .95 setgray 0 setlinecap\r
-         add Ry psz 4 div add _lt stroke Rx Ry _mt 0 0 0 setrgbcolor\r
-         show currentpoint _mt\r
-    }bdef\r
-/_rmxy  {_rmt} bdef\r
-/_s     /stroke load def\r
-/_SH    bon {/bon false def} if\r
-        {/sflg true def /_S /_rshow load def\r
-        } bdef\r
-/_sh    { ron   {/sflg false def bflg {_B} if}\r
-                {/_S /show load def /sflg false def bflg {_B} if}ifelse\r
-        }bdef\r
-/_sp    { gsave stroke grestore } bdef\r
-/_ST    {currentpoint /Sy exch def /Sx exch def} bdef\r
-/_st    {gsave\r
-          currentpoint pop\r
-          Sx dup Sy _mt sub\r
-          (\320) stringwidth pop div\r
-          dup floor cvi dup\r
-      dup 0 gt {{(\320) show} repeat}{pop} ifelse sub\r
-          dup 0 gt {1 scale (\320) show}{pop} ifelse\r
-         grestore\r
-        } bdef\r
-/_U     {currentpoint /Uy exch def /Ux exch def} bdef\r
-/_u     {gsave\r
-          currentpoint\r
-          -30 add _mt\r
-          Ux Uy -30 add _lt\r
-          12 setlinewidth\r
-          stroke\r
-         grestore\r
-        } bdef\r
-/_w     /setlinewidth load def\r
-end\r
-/#copies 1 def /wpdict2 100 dict def\r
-wpdict begin wpdict2 begin\r
-\r
-_bd\r
-/_rhs{readhexstring}bdef/_tr{translate}bdef\r
-/_ix{index}bdef/_mx{matrix}bdef\r
-/ife{ifelse}bdef/_x{exch}bdef\r
-/_is{save 4 1 roll\r
-dup/picstr _x 7 add 8 idiv string def\r
-3 1 roll _tr dup 1 scale\r
-dup 1 1[5 -1 roll 0 0 1 0 0]\r
-{currentfile picstr _rhs pop}image restore}bdef\r
-/_epsi{1 eq{{1 _x sub}currenttransfer _ccprocs settransfer}if\r
-/yp _x def/xp _x def/dhgt _x def/dwid _x def\r
-4 copy sub/swid _x def\r
-sub/shgt _x def\r
-add 2 div/icx _x def add 2 div/icy _x def\r
-xp dwid 2 div add icx sub yp dhgt 2 div sub\r
-icy sub _tr icx icy _tr\r
-360 _x sub rotate\r
-dwid swid div/xsc _x def _x\r
-dhgt shgt div/ysc _x def _x\r
-dup 1 eq{xsc neg/xsc _x def pop}\r
-{dup 2 eq{ysc neg /ysc _x def pop}\r
-{3 eq{ysc neg/ysc _x def xsc neg/xsc _x def}\r
-{}ife}ife}ife\r
-xsc ysc scale\r
-100 div _x 100 div _x scale\r
-icx neg icy neg _tr}bdef\r
-/_c{3{255 div 3 1 roll}repeat setrgbcolor}bdef\r
-/eq3{3 copy 2 _ix eq{eq{true}{false}ife}{pop\r
-pop false}ife}bdef\r
-/g{255 div setgray}bdef\r
-/_clr{ron{6 3 roll pop pop pop}{eq3{pop\r
-pop g}{_c}ife}ife}bdef\r
-/_r{/ron false def eq3{1 sub neg g pop\r
-pop}{setrgbcolor}ife}bdef\r
-/_ircms{save 15 1 roll\r
-1 eq{{1 exch sub}currenttransfer _ccprocs settransfer}if\r
-/pstr _x string def _tr\r
-/Cli _x def/USy _x def/USx _x def/Rot _x def/HTd _x def\r
-/WDd _x def/Bdep _x def/HTs _x def/WDs _x def/MIR _x def\r
-USx 100 div USy 100 div scale\r
-WDd WDs sub 2 div HTd HTs sub 2 div neg _tr\r
-WDs HTs 2 div neg _x 2 div _x _tr\r
-Rot 360 _x sub rotate WDd HTd HTs div _x WDs div _x scale\r
-WDs 2 div neg HTs 2 div _tr\r
-WDs HTs scale WDs HTs Bdep MIR 0\r
-eq{[WDs 0 0 HTs neg 0 0]}{MIR 1 eq{[WDs 0 0 HTs 0 HTs]}\r
-{MIR 128 eq{[WDs neg 0 0 HTs neg WDs 0]}\r
-{[WDs neg 0 0 HTs WDs HTs]}ife}ife}ife\r
-{currentfile pstr _rhs pop}Cli\r
-0 eq{image}{false 3 colorimage}ife\r
-restore}bdef\r
-/_bp{save 2 setlinecap 2 setmiterlimit\r
-.06 .06 scale 0 0 moveto}bdef\r
-/tctm _mx def/trot _mx def/tscale _mx def/rmtx _mx def\r
-/fr{72 0 rmtx defaultmatrix dtransform\r
-/yres _x def/xres _x def\r
-xres dup mul yres dup mul add sqrt}bdef\r
-/sus{/spotf _x def/sang _x def/csz _x def\r
-/m tctm currentmatrix def/rm sang trot rotate def\r
-/sm csz dup tscale scale def\r
-sm rm m m concatmatrix m concatmatrix pop\r
-1 0 m dtransform /y1 _x def/x1 _x def\r
-/veclength x1 dup mul y1 dup mul add sqrt def\r
-/frcy fr veclength div def /nsang y1 x1 atan def\r
-frcy nsang/spotf load setscreen}bdef\r
-/bitis{/ybit _x def /xbit _x def\r
-/bval bstring ybit bwidth mul xbit 8 idiv add get def\r
-/mask 1 7 xbit 8 mod sub bitshift def\r
-bval mask and 0 ne}bdef\r
-/bps{/y _x def /x _x def\r
-/xndx x 1 add 2 div bpside mul cvi def\r
-/yndx y 1 add 2 div bpside mul cvi def\r
-xndx yndx bitis\r
-{/onb onb 1 add def 1}{/ofb ofb 1 add def 0}ife}bdef\r
-/stpatt{/csz _x def /angle _x def /bwidth _x def\r
-/bpside _x def /bstring _x def\r
-/onb 0 def /ofb 0 def\r
-csz angle /bps load\r
-sus{}settransfer\r
-ofb ofb onb add div _g}bdef\r
-/_fp{8 1 0 cpi stpatt}bdef\r
-/_pf{gsave eofill grestore}bdef\r
-/_np{newpath}bdef/_lc{setlinecap}bdef\r
-/_sr{/cpi _x def}bdef\r
-/nbuff 50 string def\r
-letter _bp 0 13200 10200 _ornt /NewCenturySchlbk-RomanR 500 _ff\r
-0 13200 10200 _ornt \r
-/_r      { sflg {/_t {0 rmoveto}bdef /ron false def}\r
-         { /_S /show load def /_t {0 rmoveto}bdef /ron false def}ifelse\r
-     }bdef\r
-8907 11870 _m\r
-(1)_S 3462 11439 _m\r
-/NewCenturySchlbk-RomanR 750 _ff\r
-(Standard)_S 83 _t\r
-(MIDI)_S 83 _t\r
-(File)_S 83 _t\r
-(Format)_S /NewCenturySchlbk-RomanR 500 _ff\r
-4469 11220 _m\r
-(Dustin)_S 56 _t\r
-(Caldwell)_S 1800 10820 _m\r
-(The)_S 56 _t\r
-(standard)_S 56 _t\r
-(MIDI)_S 56 _t\r
-(file)_S 56 _t\r
-(format)_S 56 _t\r
-(is)_S 56 _t\r
-(a)_S 56 _t\r
-(very)_S 56 _t\r
-(strange)_S 56 _t\r
-(beast.)_S 56 _t\r
-(When)_S 56 _t\r
-(viewed)_S 56 _t\r
-(as)_S 56 _t\r
-(a)_S 56 _t\r
-(whole,)_S 56 _t\r
-(it)_S 56 _t\r
-(can)_S 56 _t\r
-(be)_S 1200 10620 _m\r
-(quite)_S 56 _t\r
-(overwhelming.)_S 56 _t\r
-(Of)_S 56 _t\r
-(course,)_S 56 _t\r
-(no)_S 56 _t\r
-(matter)_S 56 _t\r
-(how)_S 56 _t\r
-(you)_S 56 _t\r
-(look)_S 56 _t\r
-(at)_S 56 _t\r
-(it,)_S 56 _t\r
-(describing)_S 56 _t\r
-(a)_S 56 _t\r
-(piece)_S 56 _t\r
-(of)_S 56 _t\r
-(music)_S 56 _t\r
-(in)_S 56 _t\r
-(enough)_S 1200 10420 _m\r
-(detail)_S 56 _t\r
-(to)_S 56 _t\r
-(be)_S 56 _t\r
-(able)_S 56 _t\r
-(to)_S 56 _t\r
-(reproduce)_S 56 _t\r
-(it)_S 56 _t\r
-(accurately)_S 56 _t\r
-(is)_S 56 _t\r
-(no)_S 56 _t\r
-(small)_S 56 _t\r
-(task.)_S 56 _t\r
-(So,)_S 56 _t\r
-(while)_S 56 _t\r
-(complicated,)_S 56 _t\r
-(the)_S 56 _t\r
-(structure)_S 56 _t\r
-(of)_S 1200 10220 _m\r
-(the)_S 56 _t\r
-(midi)_S 56 _t\r
-(file)_S 56 _t\r
-(format)_S 56 _t\r
-(is)_S 56 _t\r
-(fairly)_S 56 _t\r
-(intuitive)_S 56 _t\r
-(when)_S 56 _t\r
-(understood.)_S 56 _t\r
-1800 10020 _m\r
-(I)_S 56 _t\r
-(must)_S 56 _t\r
-(insert)_S 56 _t\r
-(a)_S 56 _t\r
-(disclaimer)_S 56 _t\r
-(here)_S 56 _t\r
-(that)_S 56 _t\r
-(I)_S 56 _t\r
-(am)_S 56 _t\r
-(by)_S 56 _t\r
-(no)_S 56 _t\r
-(means)_S 56 _t\r
-(an)_S 56 _t\r
-(expert)_S 56 _t\r
-(with)_S 56 _t\r
-(midi)_S 56 _t\r
-(nor)_S 56 _t\r
-(midi)_S 56 _t\r
-(files.)_S 56 _t\r
-(I)_S 1200 9820 _m\r
-(recently)_S 56 _t\r
-(obtained)_S 56 _t\r
-(a)_S 56 _t\r
-(Gravis)_S 56 _t\r
-(UltraSound)_S 56 _t\r
-(board)_S 56 _t\r
-(for)_S 56 _t\r
-(my)_S 56 _t\r
-(PC,)_S 56 _t\r
-(and)_S 56 _t\r
-(upon)_S 56 _t\r
-(hearing)_S 56 _t\r
-(a)_S 56 _t\r
-(few)_S 56 _t\r
-(midi)_S 56 _t\r
-(files)_S 56 _t\r
-(\(.MID\))_S 1200 9620 _m\r
-(thought,)_S 56 _t\r
-("Gee,)_S 56 _t\r
-(I'd)_S 56 _t\r
-(like)_S 56 _t\r
-(to)_S 56 _t\r
-(be)_S 56 _t\r
-(able)_S 56 _t\r
-(to)_S 56 _t\r
-(make)_S 56 _t\r
-(my)_S 56 _t\r
-(own)_S 56 _t\r
-(.MID)_S 56 _t\r
-(files.")_S 56 _t\r
-(Well,)_S 56 _t\r
-(many)_S 56 _t\r
-(aggravating)_S 56 _t\r
-(hours)_S 56 _t\r
-(later,)_S 1200 9420 _m\r
-(I)_S 56 _t\r
-(discovered)_S 56 _t\r
-(that)_S 56 _t\r
-(this)_S 56 _t\r
-(was)_S 56 _t\r
-(no)_S 56 _t\r
-(trivial)_S 56 _t\r
-(task.)_S 56 _t\r
-(But,)_S 56 _t\r
-(I)_S 56 _t\r
-(couldn't)_S 56 _t\r
-(let)_S 56 _t\r
-(a)_S 56 _t\r
-(stupid)_S 56 _t\r
-(file)_S 56 _t\r
-(format)_S 56 _t\r
-(stop)_S 56 _t\r
-(me.)_S 56 _t\r
-(\(besides,)_S 56 _t\r
-(I)_S 1200 9220 _m\r
-(once)_S 56 _t\r
-(told)_S 56 _t\r
-(my)_S 56 _t\r
-(wife)_S 56 _t\r
-(that)_S 56 _t\r
-(computers)_S 56 _t\r
-(aren't)_S 56 _t\r
-(really)_S 56 _t\r
-(that)_S 56 _t\r
-(hard)_S 56 _t\r
-(to)_S 56 _t\r
-(use,)_S 56 _t\r
-(and)_S 56 _t\r
-(I'd)_S 56 _t\r
-(hate)_S 56 _t\r
-(to)_S 56 _t\r
-(be)_S 56 _t\r
-(a)_S 56 _t\r
-(hypocrite\))_S 56 _t\r
-(So)_S 1200 9020 _m\r
-(if)_S 56 _t\r
-(any)_S 56 _t\r
-(errors)_S 56 _t\r
-(are)_S 56 _t\r
-(found)_S 56 _t\r
-(in)_S 56 _t\r
-(this)_S 56 _t\r
-(information,)_S 56 _t\r
-(please)_S 56 _t\r
-(let)_S 56 _t\r
-(me)_S 56 _t\r
-(know)_S 56 _t\r
-(and)_S 56 _t\r
-(I)_S 56 _t\r
-(will)_S 56 _t\r
-(fix)_S 56 _t\r
-(it.)_S 56 _t\r
-(Also,)_S 56 _t\r
-(this)_S 1200 8820 _m\r
-(document's)_S 56 _t\r
-(scope)_S 56 _t\r
-(does)_S 56 _t\r
-(not)_S 56 _t\r
-(extend)_S 56 _t\r
-(to)_S 56 _t\r
-(EVERY)_S 56 _t\r
-(type)_S 56 _t\r
-(of)_S 56 _t\r
-(midi)_S 56 _t\r
-(command)_S 56 _t\r
-(and)_S 56 _t\r
-(EVERY)_S 56 _t\r
-(possible)_S 56 _t\r
-(file)_S 1200 8620 _m\r
-(configuration.)_S 56 _t\r
-(It)_S 56 _t\r
-(is)_S 56 _t\r
-(a)_S 56 _t\r
-(basic)_S 56 _t\r
-(guide)_S 56 _t\r
-(that)_S 56 _t\r
-(should)_S 56 _t\r
-(enable)_S 56 _t\r
-(the)_S 56 _t\r
-(reader)_S 56 _t\r
-(\(with)_S 56 _t\r
-(a)_S 56 _t\r
-(moderate)_S 56 _t\r
-(investment)_S 56 _t\r
-(in)_S 1200 8420 _m\r
-(time\))_S 56 _t\r
-(to)_S 56 _t\r
-(generate)_S 56 _t\r
-(a)_S 56 _t\r
-(quality)_S 56 _t\r
-(midi)_S 56 _t\r
-(file.)_S 1200 8020 _m\r
-(1.)_S 56 _t\r
-(Overview)_S 1800 7620 _m\r
-(A)_S 56 _t\r
-(midi)_S 56 _t\r
-(\(.MID\))_S 56 _t\r
-(file)_S 56 _t\r
-(contains)_S 56 _t\r
-(basically)_S 56 _t\r
-(2)_S 56 _t\r
-(things,)_S 56 _t\r
-(Header)_S 56 _t\r
-(chunks)_S 56 _t\r
-(and)_S 56 _t\r
-(Track)_S 56 _t\r
-(chunks.)_S 56 _t\r
-(Section)_S 56 _t\r
-(2)_S 1200 7420 _m\r
-(explains)_S 56 _t\r
-(the)_S 56 _t\r
-(header)_S 56 _t\r
-(chunks,)_S 56 _t\r
-(and)_S 56 _t\r
-(Section)_S 56 _t\r
-(3)_S 56 _t\r
-(explains)_S 56 _t\r
-(the)_S 56 _t\r
-(track)_S 56 _t\r
-(chunks.)_S 56 _t\r
-(A)_S 56 _t\r
-(midi)_S 56 _t\r
-(file)_S 56 _t\r
-(contains)_S 56 _t\r
-(ONE)_S 1200 7220 _m\r
-(header)_S 56 _t\r
-(chunk)_S 56 _t\r
-(describing)_S 56 _t\r
-(the)_S 56 _t\r
-(file)_S 56 _t\r
-(format,)_S 56 _t\r
-(etc.,)_S 56 _t\r
-(and)_S 56 _t\r
-(any)_S 56 _t\r
-(number)_S 56 _t\r
-(of)_S 56 _t\r
-(track)_S 56 _t\r
-(chunks.)_S 56 _t\r
-(A)_S 56 _t\r
-(track)_S 56 _t\r
-(may)_S 56 _t\r
-(be)_S 1200 7020 _m\r
-(thought)_S 56 _t\r
-(of)_S 56 _t\r
-(in)_S 56 _t\r
-(the)_S 56 _t\r
-(same)_S 56 _t\r
-(way)_S 56 _t\r
-(as)_S 56 _t\r
-(a)_S 56 _t\r
-(track)_S 56 _t\r
-(on)_S 56 _t\r
-(a)_S 56 _t\r
-(multi-track)_S 56 _t\r
-(tape)_S 56 _t\r
-(deck.)_S 56 _t\r
-(You)_S 56 _t\r
-(may)_S 56 _t\r
-(assign)_S 56 _t\r
-(one)_S 56 _t\r
-(track)_S 56 _t\r
-(to)_S 1200 6820 _m\r
-(each)_S 56 _t\r
-(voice,)_S 56 _t\r
-(each)_S 56 _t\r
-(staff,)_S 56 _t\r
-(each)_S 56 _t\r
-(instrument)_S 56 _t\r
-(or)_S 56 _t\r
-(whatever)_S 56 _t\r
-(you)_S 56 _t\r
-(want.)_S 56 _t\r
-1200 6420 _m\r
-(2.)_S 56 _t\r
-(Header)_S 56 _t\r
-(Chunk)_S 1800 6020 _m\r
-(The)_S 56 _t\r
-(header)_S 56 _t\r
-(chunk)_S 56 _t\r
-(appears)_S 56 _t\r
-(at)_S 56 _t\r
-(the)_S 56 _t\r
-(beginning)_S 56 _t\r
-(of)_S 56 _t\r
-(the)_S 56 _t\r
-(file,)_S 56 _t\r
-(and)_S 56 _t\r
-(describes)_S 56 _t\r
-(the)_S 56 _t\r
-(file)_S 56 _t\r
-(in)_S 56 _t\r
-(three)_S 56 _t\r
-(ways.)_S 1200 5820 _m\r
-(The)_S 56 _t\r
-(header)_S 56 _t\r
-(chunk)_S 56 _t\r
-(always)_S 56 _t\r
-(looks)_S 56 _t\r
-(like:)_S 1200 5420 _m\r
-(4D)_S 56 _t\r
-(54)_S 56 _t\r
-(68)_S 56 _t\r
-(64)_S 56 _t\r
-(00)_S 56 _t\r
-(00)_S 56 _t\r
-(00)_S 56 _t\r
-(06)_S 56 _t\r
-(ff)_S 56 _t\r
-(ff)_S 56 _t\r
-(nn)_S 56 _t\r
-(nn)_S 56 _t\r
-(dd)_S 56 _t\r
-(dd)_S 1200 5020 _m\r
-(The)_S 56 _t\r
-(ascii)_S 56 _t\r
-(equivalent)_S 56 _t\r
-(of)_S 56 _t\r
-(the)_S 56 _t\r
-(first)_S 56 _t\r
-(4)_S 56 _t\r
-(bytes)_S 56 _t\r
-(is)_S 56 _t\r
-(MThd.)_S 56 _t\r
-(After)_S 56 _t\r
-(MThd)_S 56 _t\r
-(comes)_S 56 _t\r
-(the)_S 56 _t\r
-(4-byte)_S 56 _t\r
-(size)_S 56 _t\r
-(of)_S 56 _t\r
-(the)_S 56 _t\r
-(header.)_S 1200 4820 _m\r
-(This)_S 56 _t\r
-(will)_S 56 _t\r
-(always)_S 56 _t\r
-(be)_S 56 _t\r
-(00)_S 56 _t\r
-(00)_S 56 _t\r
-(00)_S 56 _t\r
-(06,)_S 56 _t\r
-(because)_S 56 _t\r
-(the)_S 56 _t\r
-(actual)_S 56 _t\r
-(header)_S 56 _t\r
-(information)_S 56 _t\r
-(will)_S 56 _t\r
-(always)_S 56 _t\r
-(be)_S 56 _t\r
-(6)_S 56 _t\r
-(bytes.)_S 56 _t\r
-1200 4420 _m\r
-(ff)_S 56 _t\r
-(ff)_S 56 _t\r
-(is)_S 56 _t\r
-(the)_S 56 _t\r
-(file)_S 56 _t\r
-(format.)_S 56 _t\r
-(There)_S 56 _t\r
-(are)_S 56 _t\r
-(3)_S 56 _t\r
-(formats:)_S 1200 4020 _m\r
-(0)_S 56 _t\r
-(-)_S 56 _t\r
-(single-track)_S 56 _t\r
-1200 3820 _m\r
-(1)_S 56 _t\r
-(-)_S 56 _t\r
-(multiple)_S 56 _t\r
-(tracks,)_S 56 _t\r
-(synchronous)_S 1200 3620 _m\r
-(2)_S 56 _t\r
-(-)_S 56 _t\r
-(multiple)_S 56 _t\r
-(tracks,)_S 56 _t\r
-(asynchronous)_S 1200 3220 _m\r
-(Single)_S 56 _t\r
-(track)_S 56 _t\r
-(is)_S 56 _t\r
-(fairly)_S 56 _t\r
-(self-explanatory)_S 56 _t\r
-(-)_S 56 _t\r
-(one)_S 56 _t\r
-(track)_S 56 _t\r
-(only.)_S 56 _t\r
-(Synchronous)_S 56 _t\r
-(multiple)_S 56 _t\r
-(tracks)_S 56 _t\r
-(means)_S 56 _t\r
-(that)_S 56 _t\r
-(the)_S 1200 3020 _m\r
-(tracks)_S 56 _t\r
-(will)_S 56 _t\r
-(all)_S 56 _t\r
-(be)_S 56 _t\r
-(vertically)_S 56 _t\r
-(synchronous,)_S 56 _t\r
-(or)_S 56 _t\r
-(in)_S 56 _t\r
-(other)_S 56 _t\r
-(words,)_S 56 _t\r
-(they)_S 56 _t\r
-(all)_S 56 _t\r
-(start)_S 56 _t\r
-(at)_S 56 _t\r
-(the)_S 56 _t\r
-(same)_S 56 _t\r
-(time,)_S 56 _t\r
-(and)_S 56 _t\r
-(so)_S 1200 2820 _m\r
-(can)_S 56 _t\r
-(represent)_S 56 _t\r
-(different)_S 56 _t\r
-(parts)_S 56 _t\r
-(in)_S 56 _t\r
-(one)_S 56 _t\r
-(song.)_S 56 _t\r
-(Asynchronous)_S 56 _t\r
-(multiple)_S 56 _t\r
-(tracks)_S 56 _t\r
-(do)_S 56 _t\r
-(not)_S 56 _t\r
-(necessarily)_S 56 _t\r
-(start)_S 56 _t\r
-(at)_S 1200 2620 _m\r
-(the)_S 56 _t\r
-(same)_S 56 _t\r
-(time,)_S 56 _t\r
-(and)_S 56 _t\r
-(can)_S 56 _t\r
-(be)_S 56 _t\r
-(completely)_S 56 _t\r
-(asynchronous.)_S 56 _t\r
-1200 2220 _m\r
-(nn)_S 56 _t\r
-(nn)_S 56 _t\r
-(is)_S 56 _t\r
-(the)_S 56 _t\r
-(number)_S 56 _t\r
-(of)_S 56 _t\r
-(tracks)_S 56 _t\r
-(in)_S 56 _t\r
-(the)_S 56 _t\r
-(midi)_S 56 _t\r
-(file.)_S 1200 1820 _m\r
-(dd)_S 56 _t\r
-(dd)_S 56 _t\r
-(is)_S 56 _t\r
-(the)_S 56 _t\r
-(number)_S 56 _t\r
-(of)_S 56 _t\r
-(delta-time)_S 56 _t\r
-(ticks)_S 56 _t\r
-(per)_S 56 _t\r
-(quarter)_S 56 _t\r
-(note.)_S 56 _t\r
-(\(More)_S 56 _t\r
-(about)_S 56 _t\r
-(this)_S 56 _t\r
-(later\))_S _ep\r
-_bp /NewCenturySchlbk-RomanR 500 _ff\r
-0 13200 10200 _ornt \r
-/_r      { sflg {/_t {0 rmoveto}bdef /ron false def}\r
-         { /_S /show load def /_t {0 rmoveto}bdef /ron false def}ifelse\r
-     }bdef\r
-8907 11870 _m\r
-(2)_S 1200 11503 _m\r
-(3.)_S 56 _t\r
-(Track)_S 56 _t\r
-(Chunks)_S 1200 11103 _m\r
-(The)_S 56 _t\r
-(remainder)_S 56 _t\r
-(of)_S 56 _t\r
-(the)_S 56 _t\r
-(file)_S 56 _t\r
-(after)_S 56 _t\r
-(the)_S 56 _t\r
-(header)_S 56 _t\r
-(chunk)_S 56 _t\r
-(consists)_S 56 _t\r
-(of)_S 56 _t\r
-(track)_S 56 _t\r
-(chunks.)_S 56 _t\r
-(Each)_S 56 _t\r
-(track)_S 56 _t\r
-(has)_S 56 _t\r
-(one)_S 1200 10903 _m\r
-(header)_S 56 _t\r
-(and)_S 56 _t\r
-(may)_S 56 _t\r
-(contain)_S 56 _t\r
-(as)_S 56 _t\r
-(many)_S 56 _t\r
-(midi)_S 56 _t\r
-(commands)_S 56 _t\r
-(as)_S 56 _t\r
-(you)_S 56 _t\r
-(like.)_S 56 _t\r
-(The)_S 56 _t\r
-(header)_S 56 _t\r
-(for)_S 56 _t\r
-(a)_S 56 _t\r
-(track)_S 56 _t\r
-(is)_S 56 _t\r
-(very)_S 1200 10703 _m\r
-(similar)_S 56 _t\r
-(to)_S 56 _t\r
-(the)_S 56 _t\r
-(one)_S 56 _t\r
-(for)_S 56 _t\r
-(the)_S 56 _t\r
-(file:)_S 1200 10303 _m\r
-(4D)_S 56 _t\r
-(54)_S 56 _t\r
-(72)_S 56 _t\r
-(6B)_S 56 _t\r
-(xx)_S 56 _t\r
-(xx)_S 56 _t\r
-(xx)_S 56 _t\r
-(xx)_S 1200 9903 _m\r
-(As)_S 56 _t\r
-(with)_S 56 _t\r
-(the)_S 56 _t\r
-(header,)_S 56 _t\r
-(the)_S 56 _t\r
-(first)_S 56 _t\r
-(4)_S 56 _t\r
-(bytes)_S 56 _t\r
-(has)_S 56 _t\r
-(an)_S 56 _t\r
-(ascii)_S 56 _t\r
-(equivalent.)_S 56 _t\r
-(This)_S 56 _t\r
-(one)_S 56 _t\r
-(is)_S 56 _t\r
-(MTrk.)_S 56 _t\r
-(The)_S 56 _t\r
-(4)_S 56 _t\r
-(bytes)_S 56 _t\r
-(after)_S 1200 9703 _m\r
-(MTrk)_S 56 _t\r
-(give)_S 56 _t\r
-(the)_S 56 _t\r
-(length)_S 56 _t\r
-(of)_S 56 _t\r
-(the)_S 56 _t\r
-(track)_S 56 _t\r
-(\(not)_S 56 _t\r
-(including)_S 56 _t\r
-(the)_S 56 _t\r
-(track)_S 56 _t\r
-(header\))_S 56 _t\r
-(in)_S 56 _t\r
-(bytes.)_S 56 _t\r
-1800 9503 _m\r
-(Following)_S 56 _t\r
-(the)_S 56 _t\r
-(header)_S 56 _t\r
-(are)_S 56 _t\r
-(midi)_S 56 _t\r
-(events.)_S 56 _t\r
-(These)_S 56 _t\r
-(events)_S 56 _t\r
-(are)_S 56 _t\r
-(identical)_S 56 _t\r
-(to)_S 56 _t\r
-(the)_S 56 _t\r
-(actual)_S 56 _t\r
-(data)_S 56 _t\r
-(sent)_S 1200 9303 _m\r
-(and)_S 56 _t\r
-(received)_S 56 _t\r
-(by)_S 56 _t\r
-(MIDI)_S 56 _t\r
-(ports)_S 56 _t\r
-(on)_S 56 _t\r
-(a)_S 56 _t\r
-(synth)_S 56 _t\r
-(with)_S 56 _t\r
-(one)_S 56 _t\r
-(addition.)_S 56 _t\r
-(A)_S 56 _t\r
-(midi)_S 56 _t\r
-(event)_S 56 _t\r
-(is)_S 56 _t\r
-(preceded)_S 56 _t\r
-(by)_S 56 _t\r
-(a)_S 56 _t\r
-(delta-time.)_S 1200 9103 _m\r
-(A)_S 56 _t\r
-(delta)_S 56 _t\r
-(time)_S 56 _t\r
-(is)_S 56 _t\r
-(the)_S 56 _t\r
-(number)_S 56 _t\r
-(of)_S 56 _t\r
-(ticks)_S 56 _t\r
-(after)_S 56 _t\r
-(which)_S 56 _t\r
-(the)_S 56 _t\r
-(midi)_S 56 _t\r
-(event)_S 56 _t\r
-(is)_S 56 _t\r
-(to)_S 56 _t\r
-(be)_S 56 _t\r
-(executed.)_S 56 _t\r
-(The)_S 56 _t\r
-(number)_S 56 _t\r
-(of)_S 1200 8903 _m\r
-(ticks)_S 56 _t\r
-(per)_S 56 _t\r
-(quarter)_S 56 _t\r
-(note)_S 56 _t\r
-(was)_S 56 _t\r
-(defined)_S 56 _t\r
-(previously)_S 56 _t\r
-(in)_S 56 _t\r
-(the)_S 56 _t\r
-(file)_S 56 _t\r
-(header)_S 56 _t\r
-(chunk.)_S 56 _t\r
-(This)_S 56 _t\r
-(delta-time)_S 56 _t\r
-(is)_S 56 _t\r
-(a)_S 1200 8703 _m\r
-(variable-length)_S 56 _t\r
-(encoded)_S 56 _t\r
-(value.)_S 56 _t\r
-(This)_S 56 _t\r
-(format,)_S 56 _t\r
-(while)_S 56 _t\r
-(confusing,)_S 56 _t\r
-(allows)_S 56 _t\r
-(large)_S 56 _t\r
-(numbers)_S 56 _t\r
-(to)_S 56 _t\r
-(use)_S 56 _t\r
-(as)_S 56 _t\r
-(many)_S 1200 8503 _m\r
-(bytes)_S 56 _t\r
-(as)_S 56 _t\r
-(they)_S 56 _t\r
-(need,)_S 56 _t\r
-(without)_S 56 _t\r
-(requiring)_S 56 _t\r
-(small)_S 56 _t\r
-(numbers)_S 56 _t\r
-(to)_S 56 _t\r
-(waste)_S 56 _t\r
-(bytes)_S 56 _t\r
-(by)_S 56 _t\r
-(filling)_S 56 _t\r
-(with)_S 56 _t\r
-(zeros.)_S 56 _t\r
-(The)_S 1200 8303 _m\r
-(number)_S 56 _t\r
-(is)_S 56 _t\r
-(converted)_S 56 _t\r
-(into)_S 56 _t\r
-(7-bit)_S 56 _t\r
-(bytes,)_S 56 _t\r
-(and)_S 56 _t\r
-(the)_S 56 _t\r
-(most-significant)_S 56 _t\r
-(bit)_S 56 _t\r
-(of)_S 56 _t\r
-(each)_S 56 _t\r
-(byte)_S 56 _t\r
-(is)_S 56 _t\r
-(1)_S 56 _t\r
-(except)_S 56 _t\r
-(for)_S 56 _t\r
-(the)_S 1200 8103 _m\r
-(last)_S 56 _t\r
-(byte)_S 56 _t\r
-(of)_S 56 _t\r
-(the)_S 56 _t\r
-(number,)_S 56 _t\r
-(which)_S 56 _t\r
-(has)_S 56 _t\r
-(a)_S 56 _t\r
-(msb)_S 56 _t\r
-(of)_S 56 _t\r
-(0.)_S 56 _t\r
-(This)_S 56 _t\r
-(allows)_S 56 _t\r
-(the)_S 56 _t\r
-(number)_S 56 _t\r
-(to)_S 56 _t\r
-(be)_S 56 _t\r
-(read)_S 56 _t\r
-(one)_S 56 _t\r
-(byte)_S 56 _t\r
-(at)_S 56 _t\r
-(a)_S 1200 7903 _m\r
-(time,)_S 56 _t\r
-(and)_S 56 _t\r
-(when)_S 56 _t\r
-(you)_S 56 _t\r
-(see)_S 56 _t\r
-(a)_S 56 _t\r
-(msb)_S 56 _t\r
-(of)_S 56 _t\r
-(0,)_S 56 _t\r
-(you)_S 56 _t\r
-(know)_S 56 _t\r
-(that)_S 56 _t\r
-(it)_S 56 _t\r
-(was)_S 56 _t\r
-(the)_S 56 _t\r
-(last)_S 56 _t\r
-(\(least)_S 56 _t\r
-(significant\))_S 56 _t\r
-(byte)_S 56 _t\r
-(of)_S 56 _t\r
-(the)_S 1200 7703 _m\r
-(number.)_S 56 _t\r
-(According)_S 56 _t\r
-(to)_S 56 _t\r
-(the)_S 56 _t\r
-(MIDI)_S 56 _t\r
-(spec,)_S 56 _t\r
-(the)_S 56 _t\r
-(entire)_S 56 _t\r
-(delta-time)_S 56 _t\r
-(should)_S 56 _t\r
-(be)_S 56 _t\r
-(at)_S 56 _t\r
-(most)_S 56 _t\r
-(4)_S 56 _t\r
-(bytes)_S 56 _t\r
-(long.)_S 56 _t\r
-1800 7503 _m\r
-(Following)_S 56 _t\r
-(the)_S 56 _t\r
-(delta-time)_S 56 _t\r
-(is)_S 56 _t\r
-(a)_S 56 _t\r
-(midi)_S 56 _t\r
-(event.)_S 56 _t\r
-(Each)_S 56 _t\r
-(midi)_S 56 _t\r
-(event)_S 56 _t\r
-(\(except)_S 56 _t\r
-(a)_S 56 _t\r
-(running)_S 56 _t\r
-(midi)_S 56 _t\r
-(event\))_S 1200 7303 _m\r
-(has)_S 56 _t\r
-(a)_S 56 _t\r
-(command)_S 56 _t\r
-(byte)_S 56 _t\r
-(which)_S 56 _t\r
-(will)_S 56 _t\r
-(always)_S 56 _t\r
-(have)_S 56 _t\r
-(a)_S 56 _t\r
-(msb)_S 56 _t\r
-(of)_S 56 _t\r
-(1)_S 56 _t\r
-(\(the)_S 56 _t\r
-(value)_S 56 _t\r
-(will)_S 56 _t\r
-(be)_S 56 _t\r
-(>=)_S 56 _t\r
-(128\).)_S 56 _t\r
-(A)_S 56 _t\r
-(list)_S 56 _t\r
-(of)_S 56 _t\r
-(most)_S 56 _t\r
-(of)_S 1200 7103 _m\r
-(these)_S 56 _t\r
-(commands)_S 56 _t\r
-(is)_S 56 _t\r
-(in)_S 56 _t\r
-(appendix)_S 56 _t\r
-(A.)_S 56 _t\r
-(Each)_S 56 _t\r
-(command)_S 56 _t\r
-(has)_S 56 _t\r
-(different)_S 56 _t\r
-(parameters)_S 56 _t\r
-(and)_S 56 _t\r
-(lengths,)_S 56 _t\r
-(but)_S 56 _t\r
-(the)_S 1200 6903 _m\r
-(data)_S 56 _t\r
-(that)_S 56 _t\r
-(follows)_S 56 _t\r
-(the)_S 56 _t\r
-(command)_S 56 _t\r
-(will)_S 56 _t\r
-(have)_S 56 _t\r
-(a)_S 56 _t\r
-(msb)_S 56 _t\r
-(of)_S 56 _t\r
-(0)_S 56 _t\r
-(\(less)_S 56 _t\r
-(than)_S 56 _t\r
-(128\).)_S 56 _t\r
-(The)_S 56 _t\r
-(exception)_S 56 _t\r
-(to)_S 56 _t\r
-(this)_S 56 _t\r
-(is)_S 56 _t\r
-(a)_S 1200 6703 _m\r
-(meta-event,)_S 56 _t\r
-(which)_S 56 _t\r
-(may)_S 56 _t\r
-(contain)_S 56 _t\r
-(data)_S 56 _t\r
-(with)_S 56 _t\r
-(a)_S 56 _t\r
-(msb)_S 56 _t\r
-(of)_S 56 _t\r
-(1.)_S 56 _t\r
-(However,)_S 56 _t\r
-(meta-events)_S 56 _t\r
-(require)_S 56 _t\r
-(a)_S 56 _t\r
-(length)_S 1200 6503 _m\r
-(parameter)_S 56 _t\r
-(which)_S 56 _t\r
-(alleviates)_S 56 _t\r
-(confusion.)_S 56 _t\r
-1800 6303 _m\r
-(One)_S 56 _t\r
-(subtlety)_S 56 _t\r
-(which)_S 56 _t\r
-(can)_S 56 _t\r
-(cause)_S 56 _t\r
-(confusion)_S 56 _t\r
-(is)_S 56 _t\r
-(running)_S 56 _t\r
-(mode.)_S 56 _t\r
-(This)_S 56 _t\r
-(is)_S 56 _t\r
-(where)_S 56 _t\r
-(the)_S 56 _t\r
-(actual)_S 56 _t\r
-(midi)_S 1200 6103 _m\r
-(command)_S 56 _t\r
-(is)_S 56 _t\r
-(omitted,)_S 56 _t\r
-(and)_S 56 _t\r
-(the)_S 56 _t\r
-(last)_S 56 _t\r
-(midi)_S 56 _t\r
-(command)_S 56 _t\r
-(issued)_S 56 _t\r
-(is)_S 56 _t\r
-(assumed.)_S 56 _t\r
-(This)_S 56 _t\r
-(means)_S 56 _t\r
-(that)_S 56 _t\r
-(the)_S 56 _t\r
-(midi)_S 1200 5903 _m\r
-(event)_S 56 _t\r
-(will)_S 56 _t\r
-(consist)_S 56 _t\r
-(of)_S 56 _t\r
-(a)_S 56 _t\r
-(delta-time)_S 56 _t\r
-(and)_S 56 _t\r
-(the)_S 56 _t\r
-(parameters)_S 56 _t\r
-(that)_S 56 _t\r
-(would)_S 56 _t\r
-(go)_S 56 _t\r
-(to)_S 56 _t\r
-(the)_S 56 _t\r
-(command)_S 56 _t\r
-(if)_S 56 _t\r
-(it)_S 56 _t\r
-(were)_S 1200 5703 _m\r
-(included.)_S 56 _t\r
-1200 5303 _m\r
-(4.)_S 56 _t\r
-(Conclusion)_S 1800 4903 _m\r
-(If)_S 56 _t\r
-(this)_S 56 _t\r
-(explanation)_S 56 _t\r
-(has)_S 56 _t\r
-(only)_S 56 _t\r
-(served)_S 56 _t\r
-(to)_S 56 _t\r
-(confuse)_S 56 _t\r
-(the)_S 56 _t\r
-(issue)_S 56 _t\r
-(more,)_S 56 _t\r
-(the)_S 56 _t\r
-(appendices)_S 56 _t\r
-(contain)_S 1200 4703 _m\r
-(examples)_S 56 _t\r
-(which)_S 56 _t\r
-(may)_S 56 _t\r
-(help)_S 56 _t\r
-(clarify)_S 56 _t\r
-(the)_S 56 _t\r
-(issue.)_S 56 _t\r
-(Also,)_S 56 _t\r
-(2)_S 56 _t\r
-(utilities)_S 56 _t\r
-(and)_S 56 _t\r
-(a)_S 56 _t\r
-(graphic)_S 56 _t\r
-(file)_S 56 _t\r
-(should)_S 56 _t\r
-(have)_S 56 _t\r
-(been)_S 1200 4503 _m\r
-(included)_S 56 _t\r
-(with)_S 56 _t\r
-(this)_S 56 _t\r
-(document:)_S 56 _t\r
-1200 4103 _m\r
-(DEC.EXE)_S 56 _t\r
-(-)_S 56 _t\r
-(This)_S 56 _t\r
-(utility)_S 56 _t\r
-(converts)_S 56 _t\r
-(a)_S 56 _t\r
-(binary)_S 56 _t\r
-(file)_S 56 _t\r
-(\(like)_S 56 _t\r
-(.MID\))_S 56 _t\r
-(to)_S 56 _t\r
-(a)_S 56 _t\r
-(tab-delimited)_S 56 _t\r
-(text)_S 56 _t\r
-(file)_S 56 _t\r
-(containing)_S 56 _t\r
-(the)_S 1200 3903 _m\r
-(decimal)_S 56 _t\r
-(equivalents)_S 56 _t\r
-(of)_S 56 _t\r
-(each)_S 56 _t\r
-(byte.)_S 1200 3503 _m\r
-(REC.EXE)_S 56 _t\r
-(-)_S 56 _t\r
-(This)_S 56 _t\r
-(utility)_S 56 _t\r
-(converts)_S 56 _t\r
-(a)_S 56 _t\r
-(tab-delimited)_S 56 _t\r
-(text)_S 56 _t\r
-(file)_S 56 _t\r
-(of)_S 56 _t\r
-(decimal)_S 56 _t\r
-(values)_S 56 _t\r
-(into)_S 56 _t\r
-(a)_S 56 _t\r
-(binary)_S 56 _t\r
-(file)_S 56 _t\r
-(in)_S 1200 3303 _m\r
-(which)_S 56 _t\r
-(each)_S 56 _t\r
-(byte)_S 56 _t\r
-(corresponds)_S 56 _t\r
-(to)_S 56 _t\r
-(one)_S 56 _t\r
-(of)_S 56 _t\r
-(the)_S 56 _t\r
-(decimal)_S 56 _t\r
-(values.)_S 1200 2903 _m\r
-(MIDINOTE.PS)_S 56 _t\r
-(-)_S 56 _t\r
-(This)_S 56 _t\r
-(is)_S 56 _t\r
-(the)_S 56 _t\r
-(postscript)_S 56 _t\r
-(form)_S 56 _t\r
-(of)_S 56 _t\r
-(a)_S 56 _t\r
-(page)_S 56 _t\r
-(showing)_S 56 _t\r
-(note)_S 56 _t\r
-(numbers)_S 56 _t\r
-(with)_S 56 _t\r
-(a)_S 56 _t\r
-(keyboard)_S 56 _t\r
-(and)_S 1200 2703 _m\r
-(with)_S 56 _t\r
-(the)_S 56 _t\r
-(standard)_S 56 _t\r
-(grand)_S 56 _t\r
-(staff.)_S _ep\r
-_bp /NewCenturySchlbk-RomanR 500 _ff\r
-0 13200 10200 _ornt \r
-/_r      { sflg {/_t {0 rmoveto}bdef /ron false def}\r
-         { /_S /show load def /_t {0 rmoveto}bdef /ron false def}ifelse\r
-     }bdef\r
-8907 11870 _m\r
-(3)_S 4645 11503 _m\r
-(Appendix)_S 56 _t\r
-(A)_S 1200 11103 _m\r
-(1.)_S 56 _t\r
-(MIDI)_S 56 _t\r
-(Event)_S 56 _t\r
-(Commands)_S 1200 10703 _m\r
-(Each)_S 56 _t\r
-(command)_S 56 _t\r
-(byte)_S 56 _t\r
-(has)_S 56 _t\r
-(2)_S 56 _t\r
-(parts.)_S 56 _t\r
-(The)_S 56 _t\r
-(left)_S 56 _t\r
-(nybble)_S 56 _t\r
-(\(4)_S 56 _t\r
-(bits\))_S 56 _t\r
-(contains)_S 56 _t\r
-(the)_S 56 _t\r
-(actual)_S 56 _t\r
-(command,)_S 56 _t\r
-(and)_S 56 _t\r
-(the)_S 1200 10503 _m\r
-(right)_S 56 _t\r
-(nybble)_S 56 _t\r
-(contains)_S 56 _t\r
-(the)_S 56 _t\r
-(midi)_S 56 _t\r
-(channel)_S 56 _t\r
-(number)_S 56 _t\r
-(on)_S 56 _t\r
-(which)_S 56 _t\r
-(the)_S 56 _t\r
-(command)_S 56 _t\r
-(will)_S 56 _t\r
-(be)_S 56 _t\r
-(executed.)_S 56 _t\r
-(There)_S 56 _t\r
-(are)_S 1200 10303 _m\r
-(16)_S 56 _t\r
-(midi)_S 56 _t\r
-(channels,)_S 56 _t\r
-(and)_S 56 _t\r
-(8)_S 56 _t\r
-(midi)_S 56 _t\r
-(commands)_S 56 _t\r
-(\(the)_S 56 _t\r
-(command)_S 56 _t\r
-(nybble)_S 56 _t\r
-(must)_S 56 _t\r
-(have)_S 56 _t\r
-(a)_S 56 _t\r
-(msb)_S 56 _t\r
-(of)_S 56 _t\r
-(1\).)_S 1200 10103 _m\r
-(In)_S 56 _t\r
-(the)_S 56 _t\r
-(following)_S 56 _t\r
-(table,)_S 56 _t\r
-(x)_S 56 _t\r
-(indicates)_S 56 _t\r
-(the)_S 56 _t\r
-(midi)_S 56 _t\r
-(channel)_S 56 _t\r
-(number.)_S 56 _t\r
-(Note)_S 56 _t\r
-(that)_S 56 _t\r
-(all)_S 56 _t\r
-(data)_S 56 _t\r
-(bytes)_S 56 _t\r
-(will)_S 56 _t\r
-(be)_S 56 _t\r
-(<128)_S 1200 9903 _m\r
-(\(msb)_S 56 _t\r
-(set)_S 56 _t\r
-(to)_S 56 _t\r
-(0\).)_S 1200 9503 _m\r
-_U (Hex)_S 2109 9503 _m\r
-(Binary)_S 3422 9503 _m\r
-(Data)_S 4836 9503 _m\r
-(Description)_S _u 1200 9303 _m\r
-(8x)_S 2109 9303 _m\r
-(1000xxxx)_S 3422 9303 _m\r
-(nn)_S 56 _t\r
-(vv)_S 4836 9303 _m\r
-(Note)_S 56 _t\r
-(off)_S 56 _t\r
-(\(key)_S 56 _t\r
-(is)_S 56 _t\r
-(released\))_S 4836 9103 _m\r
-(nn=note)_S 56 _t\r
-(number)_S 4836 8903 _m\r
-(vv=velocity)_S 1200 8503 _m\r
-(9x)_S 2109 8503 _m\r
-(1001xxxx)_S 3422 8503 _m\r
-(nn)_S 56 _t\r
-(vv)_S 4836 8503 _m\r
-(Note)_S 56 _t\r
-(on)_S 56 _t\r
-(\(key)_S 56 _t\r
-(is)_S 56 _t\r
-(pressed\))_S 4836 8303 _m\r
-(nn=note)_S 56 _t\r
-(number)_S 4836 8103 _m\r
-(vv=velocity)_S 1200 7703 _m\r
-(Ax)_S 2109 7703 _m\r
-(1010xxxx)_S 3422 7703 _m\r
-(nn)_S 56 _t\r
-(vv)_S 4836 7703 _m\r
-(Key)_S 56 _t\r
-(after-touch)_S 4836 7503 _m\r
-(nn=note)_S 56 _t\r
-(number)_S 4836 7303 _m\r
-(vv=velocity)_S 1200 6903 _m\r
-(Bx)_S 2109 6903 _m\r
-(1011xxxx)_S 3422 6903 _m\r
-(cc)_S 56 _t\r
-(vv)_S 4836 6903 _m\r
-(Control)_S 56 _t\r
-(Change)_S 4836 6703 _m\r
-(cc=controller)_S 56 _t\r
-(number)_S 4836 6503 _m\r
-(vv=new)_S 56 _t\r
-(value)_S 1200 6103 _m\r
-(Cx)_S 2109 6103 _m\r
-(1100xxxx)_S 3422 6103 _m\r
-(pp)_S 4836 6103 _m\r
-(Program)_S 56 _t\r
-(\(patch\))_S 56 _t\r
-(change)_S 4836 5903 _m\r
-(pp=new)_S 56 _t\r
-(program)_S 56 _t\r
-(number)_S 1200 5503 _m\r
-(Dx)_S 2109 5503 _m\r
-(1101xxxx)_S 3422 5503 _m\r
-(cc)_S 4836 5503 _m\r
-(Channel)_S 56 _t\r
-(after-touch)_S 4836 5303 _m\r
-(cc=channel)_S 56 _t\r
-(number)_S 1200 4903 _m\r
-(Ex)_S 2109 4903 _m\r
-(1110xxxx)_S 3422 4903 _m\r
-(bb)_S 56 _t\r
-(tt)_S 4836 4903 _m\r
-(Pitch)_S 56 _t\r
-(wheel)_S 56 _t\r
-(change)_S 56 _t\r
-(\(2000H)_S 56 _t\r
-(is)_S 56 _t\r
-(normal)_S 56 _t\r
-(or)_S 56 _t\r
-(no)_S 56 _t\r
-(change\))_S 4836 4703 _m\r
-(bb=bottom)_S 56 _t\r
-(\(least)_S 56 _t\r
-(sig\))_S 56 _t\r
-(7)_S 56 _t\r
-(bits)_S 56 _t\r
-(of)_S 56 _t\r
-(value)_S 4836 4503 _m\r
-(tt=top)_S 56 _t\r
-(\(most)_S 56 _t\r
-(sig\))_S 56 _t\r
-(7)_S 56 _t\r
-(bits)_S 56 _t\r
-(of)_S 56 _t\r
-(value)_S _ep\r
-_bp /NewCenturySchlbk-RomanR 500 _ff\r
-0 13200 10200 _ornt \r
-/_r      { sflg {/_t {0 rmoveto}bdef /ron false def}\r
-         { /_S /show load def /_t {0 rmoveto}bdef /ron false def}ifelse\r
-     }bdef\r
-8907 11870 _m\r
-(4)_S 1200 11503 _m\r
-(The)_S 56 _t\r
-(following)_S 56 _t\r
-(table)_S 56 _t\r
-(lists)_S 56 _t\r
-(meta-events)_S 56 _t\r
-(which)_S 56 _t\r
-(have)_S 56 _t\r
-(no)_S 56 _t\r
-(midi)_S 56 _t\r
-(channel)_S 56 _t\r
-(number.)_S 56 _t\r
-(They)_S 56 _t\r
-(are)_S 56 _t\r
-(of)_S 56 _t\r
-(the)_S 56 _t\r
-(format:)_S 1200 11103 _m\r
-(FF)_S 56 _t\r
-(xx)_S 56 _t\r
-(nn)_S 56 _t\r
-(dd)_S 1200 10703 _m\r
-(All)_S 56 _t\r
-(meta-events)_S 56 _t\r
-(start)_S 56 _t\r
-(with)_S 56 _t\r
-(FF)_S 56 _t\r
-(followed)_S 56 _t\r
-(by)_S 56 _t\r
-(the)_S 56 _t\r
-(command)_S 56 _t\r
-(\(xx\),)_S 56 _t\r
-(the)_S 56 _t\r
-(length,)_S 56 _t\r
-(or)_S 56 _t\r
-(number)_S 56 _t\r
-(of)_S 56 _t\r
-(bytes)_S 56 _t\r
-(that)_S 1200 10503 _m\r
-(will)_S 56 _t\r
-(contain)_S 56 _t\r
-(data)_S 56 _t\r
-(\(nn\),)_S 56 _t\r
-(and)_S 56 _t\r
-(the)_S 56 _t\r
-(actual)_S 56 _t\r
-(data)_S 56 _t\r
-(\(dd\).)_S 1200 10103 _m\r
-_U (Hex)_S 2109 10103 _m\r
-(Binary)_S 3422 10103 _m\r
-(Data)_S 4836 10103 _m\r
-(Description)_S _u 1200 9903 _m\r
-(00)_S 2109 9903 _m\r
-(00000000)_S 3422 9903 _m\r
-(nn)_S 56 _t\r
-(ssss)_S 4836 9903 _m\r
-(Sets)_S 56 _t\r
-(the)_S 56 _t\r
-(track's)_S 56 _t\r
-(sequence)_S 56 _t\r
-(number.)_S 4836 9703 _m\r
-(nn=02)_S 56 _t\r
-(\(length)_S 56 _t\r
-(of)_S 56 _t\r
-(2-byte)_S 56 _t\r
-(sequence)_S 56 _t\r
-(number\))_S 4836 9503 _m\r
-(ssss=sequence)_S 56 _t\r
-(number)_S 1200 9103 _m\r
-(01)_S 2109 9103 _m\r
-(00000001)_S 3422 9103 _m\r
-(nn)_S 56 _t\r
-(tt)_S 56 _t\r
-(..)_S 4836 9103 _m\r
-(Text)_S 56 _t\r
-(event-)_S 56 _t\r
-(any)_S 56 _t\r
-(text)_S 56 _t\r
-(you)_S 56 _t\r
-(want.)_S 4836 8903 _m\r
-(nn=length)_S 56 _t\r
-(in)_S 56 _t\r
-(bytes)_S 56 _t\r
-(of)_S 56 _t\r
-(text)_S 4836 8703 _m\r
-(tt=text)_S 56 _t\r
-(characters)_S 1200 8303 _m\r
-(02)_S 2109 8303 _m\r
-(00000010)_S 3422 8303 _m\r
-(nn)_S 56 _t\r
-(tt)_S 56 _t\r
-(..)_S 4836 8303 _m\r
-(Same)_S 56 _t\r
-(as)_S 56 _t\r
-(text)_S 56 _t\r
-(event,)_S 56 _t\r
-(but)_S 56 _t\r
-(used)_S 56 _t\r
-(for)_S 56 _t\r
-(copyright)_S 56 _t\r
-(info.)_S 4836 8103 _m\r
-(nn)_S 56 _t\r
-(tt=same)_S 56 _t\r
-(as)_S 56 _t\r
-(text)_S 56 _t\r
-(event)_S 1200 7703 _m\r
-(03)_S 2109 7703 _m\r
-(00000011)_S 3422 7703 _m\r
-(nn)_S 56 _t\r
-(tt)_S 56 _t\r
-(..)_S 4836 7703 _m\r
-(Sequence)_S 56 _t\r
-(or)_S 56 _t\r
-(Track)_S 56 _t\r
-(name)_S 4836 7503 _m\r
-(nn)_S 56 _t\r
-(tt=same)_S 56 _t\r
-(as)_S 56 _t\r
-(text)_S 56 _t\r
-(event)_S 1200 7103 _m\r
-(04)_S 2109 7103 _m\r
-(00000100)_S 3422 7103 _m\r
-(nn)_S 56 _t\r
-(tt)_S 56 _t\r
-(..)_S 4836 7103 _m\r
-(Track)_S 56 _t\r
-(instrument)_S 56 _t\r
-(name)_S 4836 6903 _m\r
-(nn)_S 56 _t\r
-(tt=same)_S 56 _t\r
-(as)_S 56 _t\r
-(text)_S 56 _t\r
-(event)_S 1200 6503 _m\r
-(05)_S 2109 6503 _m\r
-(00000101)_S 3422 6503 _m\r
-(nn)_S 56 _t\r
-(tt)_S 56 _t\r
-(..)_S 4836 6503 _m\r
-(Lyric)_S 4836 6303 _m\r
-(nn)_S 56 _t\r
-(tt=same)_S 56 _t\r
-(as)_S 56 _t\r
-(text)_S 56 _t\r
-(event)_S 1200 5903 _m\r
-(06)_S 2109 5903 _m\r
-(00000110)_S 3422 5903 _m\r
-(nn)_S 56 _t\r
-(tt)_S 56 _t\r
-(..)_S 4836 5903 _m\r
-(Marker)_S 4836 5703 _m\r
-(nn)_S 56 _t\r
-(tt=same)_S 56 _t\r
-(as)_S 56 _t\r
-(text)_S 56 _t\r
-(event)_S 1200 5303 _m\r
-(07)_S 2109 5303 _m\r
-(00000111)_S 3422 5303 _m\r
-(nn)_S 56 _t\r
-(tt)_S 56 _t\r
-(..)_S 4836 5303 _m\r
-(Cue)_S 56 _t\r
-(point)_S 4836 5103 _m\r
-(nn)_S 56 _t\r
-(tt=same)_S 56 _t\r
-(as)_S 56 _t\r
-(text)_S 56 _t\r
-(event)_S 1200 4703 _m\r
-(2F)_S 56 _t\r
-2109 4703 _m\r
-(00101111)_S 3422 4703 _m\r
-(00)_S 4836 4703 _m\r
-(This)_S 56 _t\r
-(event)_S 56 _t\r
-(must)_S 56 _t\r
-(come)_S 56 _t\r
-(at)_S 56 _t\r
-(the)_S 56 _t\r
-(end)_S 56 _t\r
-(of)_S 56 _t\r
-(each)_S 56 _t\r
-(track)_S 1200 4303 _m\r
-(51)_S 2109 4303 _m\r
-(01010001)_S 3422 4303 _m\r
-(03)_S 56 _t\r
-(tttttt)_S 4836 4303 _m\r
-(Set)_S 56 _t\r
-(tempo)_S 4836 4103 _m\r
-(tttttt=microseconds/quarter)_S 56 _t\r
-(note)_S 1200 3703 _m\r
-(58)_S 2109 3703 _m\r
-(01011000)_S 3422 3703 _m\r
-(04)_S 56 _t\r
-(nn)_S 56 _t\r
-(dd)_S 56 _t\r
-(cc)_S 56 _t\r
-(bb)_S 4836 3703 _m\r
-(Time)_S 56 _t\r
-(Signature)_S 4836 3503 _m\r
-(nn=numerator)_S 56 _t\r
-(of)_S 56 _t\r
-(time)_S 56 _t\r
-(sig.)_S 4836 3303 _m\r
-(dd=denominator)_S 56 _t\r
-(of)_S 56 _t\r
-(time)_S 56 _t\r
-(sig.)_S 56 _t\r
-(2=quarter)_S 56 _t\r
-(3=eighth,)_S 56 _t\r
-(etc.)_S 4836 3103 _m\r
-(cc=number)_S 56 _t\r
-(of)_S 56 _t\r
-(ticks)_S 56 _t\r
-(in)_S 56 _t\r
-(metronome)_S 56 _t\r
-(click)_S 4836 2903 _m\r
-(bb=number)_S 56 _t\r
-(of)_S 56 _t\r
-(32nd)_S 56 _t\r
-(notes)_S 56 _t\r
-(to)_S 56 _t\r
-(the)_S 56 _t\r
-(quarter)_S 56 _t\r
-(note)_S 1200 2503 _m\r
-(59)_S 2109 2503 _m\r
-(01011001)_S 3422 2503 _m\r
-(02)_S 56 _t\r
-(sf)_S 56 _t\r
-(mi)_S 4836 2503 _m\r
-(Key)_S 56 _t\r
-(signature)_S 4836 2303 _m\r
-(sf=sharps/flats)_S 56 _t\r
-(\(-7=7)_S 56 _t\r
-(flats,)_S 56 _t\r
-(0=key)_S 56 _t\r
-(of)_S 56 _t\r
-(C,)_S 56 _t\r
-(7=7)_S 56 _t\r
-(sharps\))_S 4836 2103 _m\r
-(mi=major/minor)_S 56 _t\r
-(\(0=major,)_S 56 _t\r
-(1=minor\))_S 1200 1703 _m\r
-(7F)_S 2109 1703 _m\r
-(01111111)_S 3422 1703 _m\r
-(xx)_S 56 _t\r
-(dd)_S 56 _t\r
-(..)_S 4836 1703 _m\r
-(Sequencer)_S 56 _t\r
-(specific)_S 56 _t\r
-(information)_S 4836 1503 _m\r
-(xx=number)_S 56 _t\r
-(of)_S 56 _t\r
-(bytes)_S 56 _t\r
-(to)_S 56 _t\r
-(be)_S 56 _t\r
-(sent)_S 4836 1303 _m\r
-(dd=data)_S _ep\r
-_bp /NewCenturySchlbk-RomanR 500 _ff\r
-0 13200 10200 _ornt \r
-/_r      { sflg {/_t {0 rmoveto}bdef /ron false def}\r
-         { /_S /show load def /_t {0 rmoveto}bdef /ron false def}ifelse\r
-     }bdef\r
-8907 11870 _m\r
-(5)_S 1200 11303 _m\r
-(The)_S 56 _t\r
-(following)_S 56 _t\r
-(table)_S 56 _t\r
-(lists)_S 56 _t\r
-(system)_S 56 _t\r
-(messages)_S 56 _t\r
-(which)_S 56 _t\r
-(control)_S 56 _t\r
-(the)_S 56 _t\r
-(entire)_S 56 _t\r
-(system.)_S 56 _t\r
-(These)_S 56 _t\r
-(have)_S 56 _t\r
-(no)_S 56 _t\r
-(midi)_S 1200 11103 _m\r
-(channel)_S 56 _t\r
-(number.)_S 56 _t\r
-(\(these)_S 56 _t\r
-(will)_S 56 _t\r
-(generally)_S 56 _t\r
-(only)_S 56 _t\r
-(apply)_S 56 _t\r
-(to)_S 56 _t\r
-(controlling)_S 56 _t\r
-(a)_S 56 _t\r
-(midi)_S 56 _t\r
-(keyboard,)_S 56 _t\r
-(etc.\))_S 1200 10703 _m\r
-_U (Hex)_S 2109 10703 _m\r
-(Binary)_S 3422 10703 _m\r
-(Data)_S 4836 10703 _m\r
-(Description)_S _u 1200 10503 _m\r
-(F8)_S 2109 10503 _m\r
-(11111000)_S 4836 10503 _m\r
-(Timing)_S 56 _t\r
-(clock)_S 56 _t\r
-(used)_S 56 _t\r
-(when)_S 56 _t\r
-(synchronization)_S 56 _t\r
-(is)_S 56 _t\r
-(required.)_S 1200 10103 _m\r
-(FA)_S 2109 10103 _m\r
-(11111010)_S 4836 10103 _m\r
-(Start)_S 56 _t\r
-(current)_S 56 _t\r
-(sequence)_S 1200 9703 _m\r
-(FB)_S 2109 9703 _m\r
-(11111011)_S 4836 9703 _m\r
-(Continue)_S 56 _t\r
-(a)_S 56 _t\r
-(stopped)_S 56 _t\r
-(sequence)_S 56 _t\r
-(where)_S 56 _t\r
-(left)_S 56 _t\r
-(off)_S 1200 9303 _m\r
-(FC)_S 2109 9303 _m\r
-(11111100)_S 4836 9303 _m\r
-(Stop)_S 56 _t\r
-(a)_S 56 _t\r
-(sequence)_S 1200 8703 _m\r
-(The)_S 56 _t\r
-(following)_S 56 _t\r
-(table)_S 56 _t\r
-(lists)_S 56 _t\r
-(the)_S 56 _t\r
-(numbers)_S 56 _t\r
-(corresponding)_S 56 _t\r
-(to)_S 56 _t\r
-(notes)_S 56 _t\r
-(for)_S 56 _t\r
-(use)_S 56 _t\r
-(in)_S 56 _t\r
-(note)_S 56 _t\r
-1200 8503 _m\r
-(on)_S 56 _t\r
-(and)_S 56 _t\r
-(note)_S 56 _t\r
-(off)_S 56 _t\r
-(commands.)_S /CourierR 500 _ff\r
-1200 7952 _m\r
-(Octave||)_S 2100 _t\r
-(Note)_S 100 _t\r
-(Numbers)_S 1200 7785 _m\r
-100 _t\r
-100 _t\r
-100 _t\r
-(#)_S 200 _t\r
-(||)_S 1200 7618 _m\r
-100 _t\r
-100 _t\r
-100 _t\r
-100 _t\r
-100 _t\r
-100 _t\r
-(||)_S 100 _t\r
-(C)_S 300 _t\r
-(|)_S 100 _t\r
-(C#)_S 200 _t\r
-(|)_S 100 _t\r
-(D)_S 300 _t\r
-(|)_S 100 _t\r
-(D#)_S 200 _t\r
-(|)_S 100 _t\r
-(E)_S 300 _t\r
-(|)_S 100 _t\r
-(F)_S 300 _t\r
-(|)_S 100 _t\r
-(F#)_S 200 _t\r
-(|)_S 100 _t\r
-(G)_S 300 _t\r
-(|)_S 100 _t\r
-(G#)_S 200 _t\r
-(|)_S 100 _t\r
-(A)_S 300 _t\r
-(|)_S 100 _t\r
-(A#)_S 200 _t\r
-(|)_S 100 _t\r
-(B)_S 1200 7451 _m\r
-(-----------------------------------------------------------------------------)_S 1200 7284 _m\r
-100 _t\r
-100 _t\r
-100 _t\r
-(0)_S 200 _t\r
-(||)_S 300 _t\r
-(0)_S 100 _t\r
-(|)_S 300 _t\r
-(1)_S 100 _t\r
-(|)_S 300 _t\r
-(2)_S 100 _t\r
-(|)_S 300 _t\r
-(3)_S 100 _t\r
-(|)_S 300 _t\r
-(4)_S 100 _t\r
-(|)_S 300 _t\r
-(5)_S 100 _t\r
-(|)_S 300 _t\r
-(6)_S 100 _t\r
-(|)_S 300 _t\r
-(7)_S 100 _t\r
-(|)_S 300 _t\r
-(8)_S 100 _t\r
-(|)_S 300 _t\r
-(9)_S 100 _t\r
-(|)_S 200 _t\r
-(10)_S 100 _t\r
-(|)_S 100 _t\r
-(11)_S 1200 7117 _m\r
-100 _t\r
-100 _t\r
-100 _t\r
-(1)_S 200 _t\r
-(||)_S 200 _t\r
-(12)_S 100 _t\r
-(|)_S 200 _t\r
-(13)_S 100 _t\r
-(|)_S 200 _t\r
-(14)_S 100 _t\r
-(|)_S 200 _t\r
-(15)_S 100 _t\r
-(|)_S 200 _t\r
-(16)_S 100 _t\r
-(|)_S 200 _t\r
-(17)_S 100 _t\r
-(|)_S 200 _t\r
-(18)_S 100 _t\r
-(|)_S 200 _t\r
-(19)_S 100 _t\r
-(|)_S 200 _t\r
-(20)_S 100 _t\r
-(|)_S 200 _t\r
-(21)_S 100 _t\r
-(|)_S 200 _t\r
-(22)_S 100 _t\r
-(|)_S 100 _t\r
-(23)_S 1200 6950 _m\r
-100 _t\r
-100 _t\r
-100 _t\r
-(2)_S 200 _t\r
-(||)_S 200 _t\r
-(24)_S 100 _t\r
-(|)_S 200 _t\r
-(25)_S 100 _t\r
-(|)_S 200 _t\r
-(26)_S 100 _t\r
-(|)_S 200 _t\r
-(27)_S 100 _t\r
-(|)_S 200 _t\r
-(28)_S 100 _t\r
-(|)_S 200 _t\r
-(29)_S 100 _t\r
-(|)_S 200 _t\r
-(30)_S 100 _t\r
-(|)_S 200 _t\r
-(31)_S 100 _t\r
-(|)_S 200 _t\r
-(32)_S 100 _t\r
-(|)_S 200 _t\r
-(33)_S 100 _t\r
-(|)_S 200 _t\r
-(34)_S 100 _t\r
-(|)_S 100 _t\r
-(35)_S 1200 6783 _m\r
-100 _t\r
-100 _t\r
-100 _t\r
-(3)_S 200 _t\r
-(||)_S 200 _t\r
-(36)_S 100 _t\r
-(|)_S 200 _t\r
-(37)_S 100 _t\r
-(|)_S 200 _t\r
-(38)_S 100 _t\r
-(|)_S 200 _t\r
-(39)_S 100 _t\r
-(|)_S 200 _t\r
-(40)_S 100 _t\r
-(|)_S 200 _t\r
-(41)_S 100 _t\r
-(|)_S 200 _t\r
-(42)_S 100 _t\r
-(|)_S 200 _t\r
-(43)_S 100 _t\r
-(|)_S 200 _t\r
-(44)_S 100 _t\r
-(|)_S 200 _t\r
-(45)_S 100 _t\r
-(|)_S 200 _t\r
-(46)_S 100 _t\r
-(|)_S 100 _t\r
-(47)_S 1200 6616 _m\r
-100 _t\r
-100 _t\r
-100 _t\r
-(4)_S 200 _t\r
-(||)_S 200 _t\r
-(48)_S 100 _t\r
-(|)_S 200 _t\r
-(49)_S 100 _t\r
-(|)_S 200 _t\r
-(50)_S 100 _t\r
-(|)_S 200 _t\r
-(51)_S 100 _t\r
-(|)_S 200 _t\r
-(52)_S 100 _t\r
-(|)_S 200 _t\r
-(53)_S 100 _t\r
-(|)_S 200 _t\r
-(54)_S 100 _t\r
-(|)_S 200 _t\r
-(55)_S 100 _t\r
-(|)_S 200 _t\r
-(56)_S 100 _t\r
-(|)_S 200 _t\r
-(57)_S 100 _t\r
-(|)_S 200 _t\r
-(58)_S 100 _t\r
-(|)_S 100 _t\r
-(59)_S 1200 6449 _m\r
-100 _t\r
-100 _t\r
-100 _t\r
-(5)_S 200 _t\r
-(||)_S 200 _t\r
-(60)_S 100 _t\r
-(|)_S 200 _t\r
-(61)_S 100 _t\r
-(|)_S 200 _t\r
-(62)_S 100 _t\r
-(|)_S 200 _t\r
-(63)_S 100 _t\r
-(|)_S 200 _t\r
-(64)_S 100 _t\r
-(|)_S 200 _t\r
-(65)_S 100 _t\r
-(|)_S 200 _t\r
-(66)_S 100 _t\r
-(|)_S 200 _t\r
-(67)_S 100 _t\r
-(|)_S 200 _t\r
-(68)_S 100 _t\r
-(|)_S 200 _t\r
-(69)_S 100 _t\r
-(|)_S 200 _t\r
-(70)_S 100 _t\r
-(|)_S 100 _t\r
-(71)_S 1200 6282 _m\r
-100 _t\r
-100 _t\r
-100 _t\r
-(6)_S 200 _t\r
-(||)_S 200 _t\r
-(72)_S 100 _t\r
-(|)_S 200 _t\r
-(73)_S 100 _t\r
-(|)_S 200 _t\r
-(74)_S 100 _t\r
-(|)_S 200 _t\r
-(75)_S 100 _t\r
-(|)_S 200 _t\r
-(76)_S 100 _t\r
-(|)_S 200 _t\r
-(77)_S 100 _t\r
-(|)_S 200 _t\r
-(78)_S 100 _t\r
-(|)_S 200 _t\r
-(79)_S 100 _t\r
-(|)_S 200 _t\r
-(80)_S 100 _t\r
-(|)_S 200 _t\r
-(81)_S 100 _t\r
-(|)_S 200 _t\r
-(82)_S 100 _t\r
-(|)_S 100 _t\r
-(83)_S 1200 6115 _m\r
-100 _t\r
-100 _t\r
-100 _t\r
-(7)_S 200 _t\r
-(||)_S 200 _t\r
-(84)_S 100 _t\r
-(|)_S 200 _t\r
-(85)_S 100 _t\r
-(|)_S 200 _t\r
-(86)_S 100 _t\r
-(|)_S 200 _t\r
-(87)_S 100 _t\r
-(|)_S 200 _t\r
-(88)_S 100 _t\r
-(|)_S 200 _t\r
-(89)_S 100 _t\r
-(|)_S 200 _t\r
-(90)_S 100 _t\r
-(|)_S 200 _t\r
-(91)_S 100 _t\r
-(|)_S 200 _t\r
-(92)_S 100 _t\r
-(|)_S 200 _t\r
-(93)_S 100 _t\r
-(|)_S 200 _t\r
-(94)_S 100 _t\r
-(|)_S 100 _t\r
-(95)_S 1200 5948 _m\r
-100 _t\r
-100 _t\r
-100 _t\r
-(8)_S 200 _t\r
-(||)_S 200 _t\r
-(96)_S 100 _t\r
-(|)_S 200 _t\r
-(97)_S 100 _t\r
-(|)_S 200 _t\r
-(98)_S 100 _t\r
-(|)_S 200 _t\r
-(99)_S 100 _t\r
-(|)_S 100 _t\r
-(100)_S 100 _t\r
-(|)_S 100 _t\r
-(101)_S 100 _t\r
-(|)_S 100 _t\r
-(102)_S 100 _t\r
-(|)_S 100 _t\r
-(103)_S 100 _t\r
-(|)_S 100 _t\r
-(104)_S 100 _t\r
-(|)_S 100 _t\r
-(105)_S 100 _t\r
-(|)_S 100 _t\r
-(106)_S 100 _t\r
-(|)_S 100 _t\r
-(107)_S 1200 5781 _m\r
-100 _t\r
-100 _t\r
-100 _t\r
-(9)_S 200 _t\r
-(||)_S 100 _t\r
-(108)_S 100 _t\r
-(|)_S 100 _t\r
-(109)_S 100 _t\r
-(|)_S 100 _t\r
-(110)_S 100 _t\r
-(|)_S 100 _t\r
-(111)_S 100 _t\r
-(|)_S 100 _t\r
-(112)_S 100 _t\r
-(|)_S 100 _t\r
-(113)_S 100 _t\r
-(|)_S 100 _t\r
-(114)_S 100 _t\r
-(|)_S 100 _t\r
-(115)_S 100 _t\r
-(|)_S 100 _t\r
-(116)_S 100 _t\r
-(|)_S 100 _t\r
-(117)_S 100 _t\r
-(|)_S 100 _t\r
-(118)_S 100 _t\r
-(|)_S 100 _t\r
-(119)_S 1200 5614 _m\r
-100 _t\r
-100 _t\r
-(10)_S 200 _t\r
-(||)_S 100 _t\r
-(120)_S 100 _t\r
-(|)_S 100 _t\r
-(121)_S 100 _t\r
-(|)_S 100 _t\r
-(122)_S 100 _t\r
-(|)_S 100 _t\r
-(123)_S 100 _t\r
-(|)_S 100 _t\r
-(124)_S 100 _t\r
-(|)_S 100 _t\r
-(125)_S 100 _t\r
-(|)_S 100 _t\r
-(126)_S 100 _t\r
-(|)_S 100 _t\r
-(127)_S 100 _t\r
-(|)_S 1200 5113 _m\r
-100 _t\r
-100 _t\r
-100 _t\r
-100 _t\r
-100 _t\r
-100 _t\r
-100 _t\r
-100 _t\r
-100 _t\r
-100 _t\r
-100 _t\r
-100 _t\r
-100 _t\r
-100 _t\r
-100 _t\r
-100 _t\r
-100 _t\r
-100 _t\r
-100 _t\r
-100 _t\r
-100 _t\r
-100 _t\r
-100 _t\r
-100 _t\r
-100 _t\r
-100 _t\r
-100 _t\r
-100 _t\r
-100 _t\r
-100 _t\r
-100 _t\r
-100 _t\r
-(BIBLIOGRAPHY)_S 1200 4779 _m\r
-100 _t\r
-100 _t\r
-("MIDI)_S 100 _t\r
-(Systems)_S 100 _t\r
-(and)_S 100 _t\r
-(Control")_S 100 _t\r
-(Francis)_S 100 _t\r
-(Rumsey)_S 200 _t\r
-(1990)_S 100 _t\r
-(Focal)_S 100 _t\r
-(Press)_S 1200 4445 _m\r
-100 _t\r
-100 _t\r
-("MIDI)_S 100 _t\r
-(and)_S 100 _t\r
-(Sound)_S 100 _t\r
-(Book)_S 100 _t\r
-(for)_S 100 _t\r
-(the)_S 100 _t\r
-(Atari)_S 100 _t\r
-(ST")_S 100 _t\r
-(Bernd)_S 100 _t\r
-(Enders)_S 100 _t\r
-(and)_S 100 _t\r
-(Wolfgang)_S 100 _t\r
-(Klemme)_S 2109 4278 _m\r
-100 _t\r
-(1989)_S 100 _t\r
-(M&T)_S 100 _t\r
-(Publishing,)_S 100 _t\r
-(Inc.)_S 1200 3944 _m\r
-100 _t\r
-100 _t\r
-(MIDI)_S 100 _t\r
-(file)_S 100 _t\r
-(specs)_S 100 _t\r
-(and)_S 100 _t\r
-(general)_S 100 _t\r
-(MIDI)_S 100 _t\r
-(specs)_S 100 _t\r
-(were)_S 100 _t\r
-(also)_S 100 _t\r
-(obtained)_S 100 _t\r
-(by)_S 100 _t\r
-(sending)_S 100 _t\r
-(e-mail)_S 1200 3777 _m\r
-(to)_S 2109 3777 _m\r
-100 _t\r
-(LISTSERV@AUVM.AMERICAN.EDU)_S 100 _t\r
-(with)_S 100 _t\r
-(the)_S 100 _t\r
-(phrase)_S 100 _t\r
-(GET)_S 100 _t\r
-(MIDISPEC)_S 100 _t\r
-(PACKAGE)_S 100 _t\r
-(in)_S 1200 3610 _m\r
-(the)_S 100 _t\r
-(message.)_S 1200 3276 _m\r
-100 _t\r
-100 _t\r
-_ep\r
-_ed end end\r
-\ 4\e%-12345X\r
-\r
----------------------------- MIDINOTE.PS ----------------------------------\r
-\r
-%!PS-Adobe-3.0 EPSF-2.0\r
-%%Creator: Windows PSCRIPT\r
-%%Title: KEYS.CDR from CorelDRAW!\r
-%%BoundingBox: 19 17 594 776\r
-%%DocumentNeededResources: (atend)\r
-%%DocumentSuppliedResources: (atend)\r
-%%Pages: 0\r
-%%BeginResource: procset Win35Dict 3 1\r
-/Win35Dict 60 dict def Win35Dict begin/bd{bind def}bind def/in{72\r
-mul}bd/ed{exch def}bd/ld{load def}bd/tr/translate ld/gs/gsave ld/gr\r
-/grestore ld/fPP false def/SS{fPP{/SV save def}{gs}ifelse}bd/RS{fPP{SV\r
-restore}{gr}ifelse}bd/EJ{gsave showpage grestore}bd/#C{userdict begin\r
-/#copies ed end}bd/FEbuf 2 string def/FEglyph(G  )def/FE{1 exch{dup\r
-16 FEbuf cvrs FEglyph exch 1 exch putinterval 1 index exch FEglyph\r
-cvn put}for}bd/SM{/iRes ed/cyP ed/cxPg ed/cyM ed/cxM ed 0 ne{0 cyP\r
-72 mul 100 div tr -90 rotate}if pop}bd/CB{moveto/dy ed/dx ed dx 0 rlineto\r
-0 dy rlineto dx neg 0 rlineto closepath clip newpath}bd end\r
-%%EndResource\r
-/SVDoc save def\r
-%%EndProlog\r
-%%BeginSetup\r
-Win35Dict begin\r
-%%EndSetup\r
-SS\r
-0 0 26 22 799 1100 300 SM\r
-2397 3162 0 0 CB\r
-%%BeginSetup\r
-/AutoFlatness false def\r
-% Options: Emulsion Up\r
-% Options: Print Positive Output\r
-/SepsColor false def\r
-/ATraps false def\r
-%%EndSetup\r
-%%BeginProlog\r
-%%BeginResource: procset wCorel4Dict\r
-%Copyright (c)1992, 1993 Corel Corporation.  All rights reserved. v4.00.00\r
-/wCorel4Dict 300 dict def wCorel4Dict begin\r
-/bd{bind def}bind def/ld{load def}bd/xd{exch def}bd\r
-/_ null def/rp{{pop}repeat}bd/@cp/closepath ld\r
-/@gs/gsave ld/@gr/grestore ld/@np/newpath ld\r
-/Tl/translate ld/$sv 0 def/@sv{/$sv save def}bd\r
-/@rs{$sv restore}bd/spg/showpage ld/showpage{}bd\r
-currentscreen/@dsp xd/$dsp/@dsp def/$dsa xd\r
-/$dsf xd/$sdf false def/$SDF false def/$Scra 0 def\r
-/SetScr/setscreen ld/setscreen{3 rp}bd/@ss{2 index 0 eq{$dsf 3 1 roll\r
-4 -1 roll pop}if exch $Scra add exch load SetScr}bd\r
-/$c 0 def/$m 0 def/$y 0 def/$k 0 def/$t 1 def\r
-/$n _ def/$o 0 def/$fil 0 def/$C 0 def/$M 0 def\r
-/$Y 0 def/$K 0 def/$T 1 def/$N _ def/$O 0 def\r
-/$PF false def/s1c 0 def/s1m 0 def/s1y 0 def\r
-/s1k 0 def/s1t 0 def/s1n _ def/$bkg false def\r
-/SK 0 def/SM 0 def/SY 0 def/SC 0 def/SepMode 0 def\r
-/CurrentInkName (Composite) def/$ink -1 def\r
-/$op false def matrix currentmatrix/$ctm xd\r
-/$ptm matrix def/$ttm matrix def/$stm matrix def\r
-/$fst 128 def/$pad 0 def/$rox 0 def/$roy 0 def\r
-/CorelDrawReencodeVect [ 16#0/grave 16#5/breve 16#6/dotaccent 16#8/ring 16#A/hungarumlaut 16#B/ogonek 16#C/caron 16#D/dotlessi\r
-16#82/quotesinglbase/florin/quotedblbase/ellipsis/dagger/daggerdbl\r
-16#88/circumflex/perthousand/Scaron/guilsinglleft/OE\r
-16#91/quoteleft/quoteright/quotedblleft/quotedblright/bullet/endash/emdash\r
-16#98/tilde/trademark/scaron/guilsinglright/oe\r
-16#9F/Ydieresis 16#A1/exclamdown/cent/sterling/currency/yen/brokenbar/section\r
-16#a8/dieresis/copyright/ordfeminine/guillemotleft/logicalnot/minus/registered/macron\r
-16#b0/degree/plusminus/twosuperior/threesuperior/acute/mu/paragraph/periodcentered\r
-16#b8/cedilla/onesuperior/ordmasculine/guillemotright/onequarter/onehalf/threequarters/questiondown\r
-16#c0/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE/Ccedilla\r
-16#c8/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex/Idieresis\r
-16#d0/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis/multiply\r
-16#d8/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn/germandbls\r
-16#e0/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla\r
-16#e8/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis\r
-16#f0/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide\r
-16#f8/oslash/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis\r
-] def AutoFlatness{/@ifl{dup currentflat exch sub 10 gt{\r
-([Error: PathTooComplex; OffendingCommand: AnyPaintingOperator]\n)\r
-print flush newpath exit}{currentflat 2 add setflat}ifelse}bd\r
-/@fill/fill ld/fill{currentflat{{@fill}stopped{@ifl}{exit}ifelse\r
-}bind loop setflat}bd/@eofill/eofill ld/eofill{currentflat{\r
-{@eofill}stopped{@ifl}{exit}ifelse}bind loop\r
-setflat}bd/@clip/clip ld/clip{currentflat{{@clip}stopped{@ifl}{exit}\r
-ifelse}bind loop setflat}bd/@eoclip/eoclip ld\r
-/eoclip{currentflat{{@eoclip}stopped{@ifl}{exit}ifelse}bind loop\r
-setflat}bd/@stroke/stroke ld/stroke{currentflat{{@stroke}stopped{@ifl}\r
-{exit}ifelse}bind loop setflat}bd}if/d/setdash ld\r
-/j/setlinejoin ld/J/setlinecap ld/M/setmiterlimit ld\r
-/w/setlinewidth ld/O{/$o xd}bd/R{/$O xd}bd\r
-/W/eoclip ld/c/curveto ld/C/c ld/l/lineto ld\r
-/L/l ld/rl/rlineto ld/m/moveto ld/n/newpath ld\r
-/N/newpath ld/P{11 rp}bd/u{}bd/U{}bd/A{pop}bd\r
-/q/@gs ld/Q/@gr ld/`{}bd/~{}bd/@{}bd/&{}bd\r
-/@j{@sv @np}bd/@J{@rs}bd/g{1 exch sub/$k xd\r
-/$c 0 def/$m 0 def/$y 0 def/$t 1 def/$n _ def/$fil 0 def}bd\r
-/G{1 sub neg/$K xd _ 1 0 0 0/$C xd/$M xd/$Y xd/$T xd\r
-/$N xd}bd/k{1 index type/stringtype eq{/$t xd\r
-/$n xd}{/$t 0 def/$n _ def}ifelse/$k xd/$y xd\r
-/$m xd/$c xd/$fil 0 def}bd/K{1 index type\r
-/stringtype eq{/$T xd/$N xd}{/$T 0 def/$N _ def}ifelse\r
-/$K xd/$Y xd/$M xd/$C xd}bd/sf{1 index type\r
-/stringtype eq{/s1t xd/s1n xd}{/s1t 0 def\r
-/s1n _ def}ifelse/s1k xd/s1y xd/s1m xd/s1c xd}bd\r
-/i{dup 0 ne{setflat}{pop}ifelse}bd/v{4 -2 roll\r
-2 copy 6 -2 roll c}bd/V/v ld/y{2 copy c}bd\r
-/Y/y ld/@w{matrix rotate/$ptm xd matrix scale\r
-$ptm dup concatmatrix/$ptm xd 1 eq{$ptm exch dup concatmatrix\r
-/$ptm xd}if 1 w}bd/@g{1 eq dup/$sdf xd{/$scp xd\r
-/$sca xd/$scf xd}if}bd/@G{1 eq dup/$SDF xd{/$SCP xd\r
-/$SCA xd/$SCF xd}if}bd/@D{2 index 0 eq{$dsf 3 1 roll\r
-4 -1 roll pop}if 3 copy exch $Scra add exch load\r
-SetScr/$dsp xd/$dsa xd/$dsf xd}bd/$ngx{$SDF{$SCF\r
-SepMode 0 eq{$SCA}{$dsa}ifelse $SCP @ss}if}bd\r
-/p{/$pm xd 7{pop}repeat/$pyf xd/$pxf xd/$pn xd\r
-/$fil 1 def}bd/@MN{2 copy le{pop}{exch pop}ifelse}bd\r
-/@MX{2 copy ge{pop}{exch pop}ifelse}bd/InRange{3 -1 roll\r
-@MN @MX}bd/wDstChck{2 1 roll dup 3 -1 roll\r
-eq{1 add}if}bd/@dot{dup mul exch dup mul add\r
-1 exch sub}bd/@lin{exch pop abs 1 exch sub}bd\r
-/SetRgb/setrgbcolor ld/SetHsb/sethsbcolor ld\r
-/GetRgb/currentrgbcolor ld/GetHsb/currenthsbcolor ld\r
-/SetGry/setgray ld/GetGry/currentgray ld/cmyk2rgb{3{dup 5 -1 roll\r
-add 1 exch sub dup 0 lt{pop 0}if exch}repeat\r
-pop}bd/rgb2cmyk{3{1 exch sub 3 1 roll}repeat\r
-3 copy @MN @MN 3{dup 5 -1 roll sub neg exch}repeat}bd\r
-/rgb2hsb{SetRgb GetHsb}bd/hsb2rgb{3 -1 roll\r
-dup floor sub 3 1 roll SetHsb GetRgb}bd/rgb2g{2 index .299 mul\r
-2 index .587 mul add 1 index .114 mul add 4 1 roll\r
-3 rp}bd/WaldoColor where{pop}{/setcmykcolor where{pop\r
-/SetCmyk/setcmykcolor ld}{/SetCmyk{cmyk2rgb\r
-SetRgb}bd}ifelse/currentcmykcolor where{pop\r
-/GetCmyk/currentcmykcolor ld}{/GetCmyk{GetRgb\r
-rgb2cmyk}bd}ifelse/setoverprint where{pop}{/setoverprint{/$op xd}bd\r
-}ifelse/currentoverprint where{pop}{/currentoverprint{$op}bd}ifelse\r
-/colorimage where{pop/ColorImage/colorimage ld}{/ColorImage{\r
-/ncolors exch def pop/dataaq exch def{dataaq\r
-ncolors dup 3 eq{/$dat exch def 0 1 $dat length\r
-3 div 1 sub{dup 3 mul $dat 1 index get 255 div\r
-$dat 2 index 1 add get 255 div $dat 3 index 2 add get\r
-255 div rgb2g 255 mul cvi exch pop $dat 3 1 roll put}for\r
-$dat 0 $dat length 3 idiv getinterval pop}{4 eq{/$dat exch def\r
-0 1 $dat length 4 div 1 sub{dup 4 mul $dat 1 index get\r
-255 div $dat 2 index 1 add get 255 div $dat 3 index 2 add get\r
-255 div $dat 4 index 3 add get 255 div cmyk2rgb rgb2g 255 mul\r
-cvi exch pop $dat 3 1 roll put}for $dat 0 $dat length\r
-ncolors idiv getinterval}if}ifelse}image}bd}ifelse\r
-/@tc{5 -1 roll dup 1 ge{pop}{4{dup 6 -1 roll\r
-mul exch}repeat pop}ifelse}bd/@scc{1 eq setoverprint\r
-dup _ eq{pop SepMode 0 eq{SetCmyk 0}{0 4 $ink sub index\r
-exch pop 5 1 roll 4 rp SepsColor true eq{$ink 3 gt{1 sub neg dup SetGry\r
-exch}{dup 0 0 0 4 $ink roll SetCmyk}ifelse}{1 sub neg dup SetGry}ifelse\r
-}ifelse exch pop}{SepMode 0 eq{pop @tc SetCmyk 0}{CurrentInkName eq{\r
-4 index}{0}ifelse 6 1 roll 5 rp 1 sub neg dup SetGry}ifelse}ifelse\r
-SepMode 0 eq{pop true}{1 eq currentoverprint and not}ifelse}bd\r
-/setcmykcolor{1 5 1 roll _ currentoverprint @scc\r
-pop}bd/currentcmykcolor{0 0 0 0}bd/setrgbcolor{rgb2cmyk\r
-setcmykcolor}bd/currentrgbcolor{currentcmykcolor\r
-cmyk2rgb}bd/sethsbcolor{hsb2rgb setrgbcolor}bd\r
-/currenthsbcolor{currentrgbcolor rgb2hsb}bd\r
-/setgray{dup dup setrgbcolor}bd/currentgray{currentrgbcolor\r
-rgb2g}bd}ifelse/WaldoColor true def/@sft{$tllx $pxf add dup $tllx gt\r
-{$pwid sub}if/$tx xd $tury $pyf sub dup $tury lt{$phei add}if\r
-/$ty xd}bd/@stb{pathbbox/$ury xd/$urx xd/$lly xd/$llx xd}bd\r
-/@ep{{cvx exec}forall}bd/@tp{@sv/$in true def\r
-2 copy dup $lly le{/$in false def}if $phei sub $ury ge{/$in false def}if\r
-dup $urx ge{/$in false def}if $pwid add $llx le{/$in false def}if\r
-$in{@np 2 copy m $pwid 0 rl 0 $phei neg rl $pwid neg 0 rl\r
-0 $phei rl clip @np $pn cvlit load aload pop\r
-7 -1 roll 5 index sub 7 -1 roll 3 index sub Tl\r
-matrix currentmatrix/$ctm xd @ep 4 rp}{2 rp}ifelse\r
-@rs}bd/@th{@sft 0 1 $tly 1 sub{dup $psx mul $tx add{dup $llx gt\r
-{$pwid sub}{exit}ifelse}loop exch $phei mul\r
-$ty exch sub 0 1 $tlx 1 sub{$pwid mul 3 copy\r
-3 -1 roll add exch @tp pop}for 2 rp}for}bd/@tv{@sft\r
-0 1 $tlx 1 sub{dup $pwid mul $tx add exch $psy mul $ty exch sub{\r
-dup $ury lt{$phei add}{exit}ifelse}loop 0 1 $tly 1 sub{$phei mul\r
-3 copy sub @tp pop}for 2 rp}for}bd/@pf{@gs $ctm setmatrix\r
-$pm concat @stb eoclip Bburx Bbury $pm itransform\r
-/$tury xd/$turx xd Bbllx Bblly $pm itransform\r
-/$tlly xd/$tllx xd/$wid $turx $tllx sub def\r
-/$hei $tury $tlly sub def @gs $vectpat{1 0 0 0 0 _ $o @scc{eofill}if}{\r
-$t $c $m $y $k $n $o @scc{SepMode 0 eq $pfrg or{$tllx $tlly Tl\r
-$wid $hei scale <00> 8 1 false [ 8 0 0 1 0 0 ]{}imagemask}{\r
-/$bkg true def}ifelse}if}ifelse @gr $wid 0 gt $hei 0 gt and{\r
-$pn cvlit load aload pop/$pd xd 3 -1 roll sub/$phei xd\r
-exch sub/$pwid xd $wid $pwid div ceiling 1 add/$tlx xd\r
-$hei $phei div ceiling 1 add/$tly xd $psx 0 eq{@tv}{@th}ifelse}if\r
-@gr @np/$bkg false def}bd/@dlt{$fse $fss sub/nff xd\r
-$frb dup 1 eq exch 2 eq or{$frt dup $frc $frm $fry $frk\r
-@tc 4 copy cmyk2rgb rgb2hsb 3 copy/myb xd/mys xd\r
-/myh xd $tot $toc $tom $toy $tok @tc cmyk2rgb\r
-rgb2hsb 3 1 roll 4 1 roll 5 1 roll sub neg nff div/kdb xd\r
-sub neg nff div/kds xd sub neg dup 0 eq{pop\r
-$frb 2 eq{.99}{-.99}ifelse}if dup $frb 2 eq\r
-exch 0 lt and{1 add}if dup $frb 1 eq exch 0 gt and{1 sub}if\r
-nff div/kdh xd}{$frt dup $frc $frm $fry $frk\r
-@tc 5 copy $tot dup $toc $tom $toy $tok @tc 5 1 roll\r
-6 1 roll 7 1 roll 8 1 roll 9 1 roll sub neg nff div/$dk xd\r
-sub neg nff div/$dy xd sub neg nff div/$dm xd\r
-sub neg nff div/$dc xd sub neg nff div/$dt xd}ifelse}bd\r
-/ffcol{5 copy $fsit 0 eq{setcmykcolor pop}{SepMode 0 ne{\r
-4 index 1 sub neg SetGry 5 rp}{setcmykcolor pop}ifelse}ifelse}bd\r
-/@ftl{1 index 4 index sub dup $pad mul dup/$pdw xd\r
-2 mul sub $fst div/$wid xd 2 index sub/$hei xd\r
-pop Tl @dlt $fss 0 eq{ffcol 0 0 m 0 $hei l $pdw $hei l\r
-$pdw 0 l @cp fill $pdw 0 Tl}if $fss $wid mul 0 Tl\r
-nff{ffcol 0 0 m 0 $hei l $wid $hei l $wid 0 l\r
-@cp fill $wid 0 Tl $frb dup 1 eq exch 2 eq or{4 rp\r
-myh mys myb kdb add 3 1 roll kds add 3 1 roll\r
-kdh add 3 1 roll 3 copy/myb xd/mys xd/myh xd\r
-hsb2rgb rgb2cmyk}{$dk add 5 1 roll $dy add 5 1 roll\r
-$dm add 5 1 roll $dc add 5 1 roll $dt add 5 1 roll}ifelse}repeat\r
-5 rp $tot dup $toc $tom $toy $tok @tc ffcol 0 0 m\r
-0 $hei l $pdw $hei l $pdw 0 l @cp fill 5 rp}bd\r
-/@ftr{1 index 4 index sub dup $rox mul/$row xd\r
-2 div 1 index 4 index sub dup $roy mul/$roh xd\r
-2 div 2 copy dup mul exch dup mul add sqrt $row dup mul\r
-$roh dup mul add sqrt add dup/$hei xd $fst div/$wid xd\r
-4 index add $roh add exch 5 index add $row add\r
-exch Tl 4 rp @dlt $fss 0 eq{ffcol fill 1.0 $pad 2 mul sub\r
-dup scale}if $hei $fss $wid mul sub/$hei xd\r
-nff{ffcol $wid 0 m 0 0 $hei 0 360 arc fill/$hei $hei $wid sub def\r
-$frb dup 1 eq exch 2 eq or{4 rp myh mys myb\r
-kdb add 3 1 roll kds add 3 1 roll kdh add 3 1 roll\r
-3 copy/myb xd/mys xd/myh xd hsb2rgb rgb2cmyk}{$dk add 5 1 roll\r
-$dy add 5 1 roll $dm add 5 1 roll $dc add 5 1 roll\r
-$dt add 5 1 roll}ifelse}repeat 5 rp}bd/@ftc{1 index 4 index sub\r
-dup $rox mul/$row xd 2 div 1 index 4 index sub\r
-dup $roy mul/$roh xd 2 div 2 copy dup mul exch dup mul add sqrt\r
-$row dup mul $roh dup mul add sqrt add dup/$hei xd\r
-$fst div/$wid xd 4 index add $roh add exch 5 index add $row add\r
-exch Tl 4 rp @dlt $fss 0 eq{ffcol fill}{n}ifelse\r
-/$dang 180 $fst 1 sub div def/$sang $dang -2 div 180 add def\r
-/$eang $dang 2 div 180 add def/$sang $sang $dang $fss mul add def\r
-/$eang $eang $dang $fss mul add def/$sang $eang $dang sub def\r
-nff{ffcol $wid 0 m 0 0 $hei $sang $fan add $eang $fan add arc fill\r
-$wid 0 m 0 0 $hei $eang neg $fan add $sang neg $fan add arc fill\r
-/$sang $eang def/$eang $eang $dang add def\r
-$frb dup 1 eq exch 2 eq or{4 rp myh mys myb\r
-kdb add 3 1 roll kds add 3 1 roll kdh add 3 1 roll\r
-3 copy/myb xd/mys xd/myh xd hsb2rgb rgb2cmyk}{$dk add 5 1 roll\r
-$dy add 5 1 roll $dm add 5 1 roll $dc add 5 1 roll\r
-$dt add 5 1 roll}ifelse}repeat 5 rp}bd/@ff{/$fss 0 def\r
-1 1 $fsc 1 sub{dup 1 sub $fsit 0 eq{$fsa exch 5 mul\r
-5 getinterval aload 2 rp/$frk xd/$fry xd/$frm xd/$frc xd\r
-/$frn _ def/$frt 1 def $fsa exch 5 mul 5 getinterval aload pop\r
-$fss add/$fse xd/$tok xd/$toy xd/$tom xd/$toc xd\r
-/$ton _ def/$tot 1 def}{$fsa exch 7 mul 7 getinterval aload 2 rp\r
-/$frt xd/$frn xd/$frk xd/$fry xd/$frm xd/$frc xd\r
-$fsa exch 7 mul 7 getinterval aload pop $fss add/$fse xd\r
-/$tot xd/$ton xd/$tok xd/$toy xd/$tom xd/$toc xd}ifelse\r
-$fsit 0 eq SepMode 0 eq or dup not CurrentInkName $frn eq\r
-and or{@sv eoclip currentflat dup 5 mul setflat\r
-Bbllx Bblly Bburx Bbury $fty 2 eq{@ftc}{$fty 1 eq{1 index 3 index m\r
-2 copy l 3 index 1 index l 3 index 3 index l\r
-@cp @ftr}{1 index 3 index m 2 copy l 3 index 1 index l\r
-3 index 3 index l @cp 4 rp $fan rotate pathbbox\r
-@ftl}ifelse}ifelse setflat @rs/$fss $fse def}if}for\r
-@np}bd/@Pf{@sv SepMode 0 eq $ink 3 eq or{0 J 0 j [] 0 d\r
-$t $c $m $y $k $n $o @scc pop $ctm setmatrix\r
-72 1000 div dup matrix scale dup concat dup Bburx exch Bbury exch\r
-itransform ceiling cvi/Bbury xd ceiling cvi/Bburx xd\r
-Bbllx exch Bblly exch itransform floor cvi/Bblly xd\r
-floor cvi/Bbllx xd $Prm aload pop $Psn load exec}{1 SetGry eofill}ifelse\r
-@rs @np}bd/F{matrix currentmatrix $sdf{$scf $sca $scp @ss}if\r
-$fil 1 eq{@pf}{$fil 2 eq{@ff}{$fil 3 eq{@Pf}{$t $c $m $y $k $n $o\r
-@scc{eofill}{@np}ifelse}ifelse}ifelse}ifelse\r
-$sdf{$dsf $dsa $dsp @ss}if setmatrix}bd/f{@cp F}bd\r
-/S{matrix currentmatrix $ctm setmatrix $SDF{$SCF $SCA $SCP @ss}if\r
-$T $C $M $Y $K $N $O @scc{matrix currentmatrix\r
-$ptm concat stroke setmatrix}{@np}ifelse $SDF{$dsf $dsa $dsp @ss}if\r
-setmatrix}bd/s{@cp S}bd/B{@gs F @gr S}bd/b{@cp B}bd\r
-/E{5 array astore exch cvlit exch def}bd/@cc{\r
-currentfile $dat readhexstring pop}bd/@sm{/$ctm $ctm currentmatrix def\r
-}bd/@E{/Bbury xd/Bburx xd/Bblly xd/Bbllx xd}bd\r
-/@c{@cp}bd/@p{/$fil 1 def 1 eq dup/$vectpat xd{/$pfrg true def}{@gs\r
-$t $c $m $y $k $n $o @scc/$pfrg xd @gr}ifelse\r
-/$pm xd/$psy xd/$psx xd/$pyf xd/$pxf xd/$pn xd}bd\r
-/@P{/$fil 3 def/$Psn xd array astore/$Prm xd}bd\r
-/@k{/$fil 2 def/$roy xd/$rox xd/$pad xd/$fty xd/$fan xd\r
-$fty 1 eq{/$fan 0 def}if/$frb xd/$fst xd/$fsc xd\r
-/$fsa xd/$fsit 0 def}bd/@x{/$fil 2 def/$roy xd/$rox xd/$pad xd\r
-/$fty xd/$fan xd $fty 1 eq{/$fan 0 def}if/$frb xd\r
-/$fst xd/$fsc xd/$fsa xd/$fsit 1 def}bd/@ii{concat\r
-3 index 3 index m 3 index 1 index l 2 copy l\r
-1 index 3 index l 3 index 3 index l clip 4 rp}bd\r
-/tcc{@cc}def/@i{@sm @gs @ii 6 index 1 ne{/$frg true def\r
-2 rp}{1 eq{s1t s1c s1m s1y s1k s1n $o @scc\r
-/$frg xd}{/$frg false def}ifelse 1 eq{@gs $ctm setmatrix\r
-F @gr}if}ifelse @np/$ury xd/$urx xd/$lly xd/$llx xd\r
-/$bts xd/$hei xd/$wid xd/$dat $wid $bts mul 8 div ceiling cvi string def\r
-$bkg $frg or{$SDF{$SCF $SCA $SCP @ss}if $llx $lly Tl\r
-$urx $llx sub $ury $lly sub scale $bkg{$t $c $m $y $k $n $o @scc pop}if\r
-$wid $hei abs $bts 1 eq{$bkg}{$bts}ifelse [ $wid 0 0\r
-$hei neg 0 $hei 0 gt{$hei}{0}ifelse]/tcc load\r
-$bts 1 eq{imagemask}{image}ifelse $SDF{$dsf $dsa $dsp @ss}if}{\r
-$hei abs{tcc pop}repeat}ifelse @gr $ctm setmatrix}bind def\r
-/@M{@sv}bd/@N{/@cc{}def 1 eq{12 -1 roll neg 12 1 roll\r
-@I}{13 -1 roll neg 13 1 roll @i}ifelse @rs}bd\r
-/@I{@sm @gs @ii @np/$ury xd/$urx xd/$lly xd/$llx xd\r
-/$ncl xd/$bts xd/$hei xd/$wid xd/$dat $wid $bts mul $ncl mul 8 div ceiling cvi string def\r
-$ngx $llx $lly Tl $urx $llx sub $ury $lly sub scale\r
-$wid $hei abs $bts [ $wid 0 0 $hei neg 0 $hei 0 gt{$hei}{0}ifelse]\r
-/@cc load false $ncl ColorImage $SDF{$dsf $dsa $dsp @ss}if\r
-@gr $ctm setmatrix}bd/z{exch findfont exch scalefont setfont}bd\r
-/ZB{9 dict dup begin 4 1 roll/FontType 3 def\r
-/FontMatrix xd/FontBBox xd/Encoding 256 array def\r
-0 1 255{Encoding exch/.notdef put}for/CharStrings 256 dict def\r
-CharStrings/.notdef{}put/Metrics 256 dict def\r
-Metrics/.notdef 3 -1 roll put/BuildChar{exch\r
-dup/$char exch/Encoding get 3 index get def\r
-dup/Metrics get $char get aload pop setcachedevice\r
-begin Encoding exch get CharStrings exch get\r
-end exec}def end definefont pop}bd/ZBAddChar{findfont begin\r
-dup 4 1 roll dup 6 1 roll Encoding 3 1 roll put\r
-CharStrings 3 1 roll put Metrics 3 1 roll put\r
-end}bd/Z{findfont dup maxlength 2 add dict exch\r
-dup{1 index/FID ne{3 index 3 1 roll put}{2 rp}ifelse}forall\r
-pop dup dup/Encoding get 256 array copy dup/$fe xd\r
-/Encoding exch put dup/Fontname 3 index put\r
-3 -1 roll dup length 0 ne{0 exch{dup type 0 type eq{exch pop}{\r
-$fe exch 2 index exch put 1 add}ifelse}forall\r
-pop}if dup 256 dict dup/$met xd/Metrics exch put\r
-dup/FontMatrix get 0 get 1000 mul 1 exch div\r
-3 index length 256 eq{0 1 255{dup $fe exch get\r
-dup/.notdef eq{2 rp}{5 index 3 -1 roll get\r
-2 index mul $met 3 1 roll put}ifelse}for}if\r
-pop definefont pop pop}bd/@ftx{{currentpoint 3 -1 roll\r
-(0) dup 3 -1 roll 0 exch put dup @gs true charpath\r
-$ctm setmatrix @@txt @gr @np stringwidth pop 3 -1 roll add exch moveto\r
-}forall}bd/@ft{matrix currentmatrix exch $sdf{$scf $sca $scp @ss}if\r
-$fil 1 eq{/@@txt/@pf ld @ftx}{$fil 2 eq{/@@txt/@ff ld @ftx}{$fil 3 eq\r
-{/@@txt/@Pf ld @ftx}{$t $c $m $y $k $n $o @scc{show}{pop}ifelse}ifelse\r
-}ifelse}ifelse $sdf{$dsf $dsa $dsp @ss}if setmatrix}bd\r
-/@st{matrix currentmatrix exch $SDF{$SCF $SCA $SCP @ss}if\r
-$T $C $M $Y $K $N $O @scc{{currentpoint 3 -1 roll\r
-(0) dup 3 -1 roll 0 exch put dup @gs true charpath\r
-$ctm setmatrix $ptm concat stroke @gr @np stringwidth pop 3 -1 roll add exch moveto\r
-}forall}{pop}ifelse $SDF{$dsf $dsa $dsp @ss}if\r
-setmatrix}bd/@te{@ft}bd/@tr{@st}bd/@ta{dup\r
-@gs @ft @gr @st}bd/@t@a{dup @gs @st @gr @ft}bd\r
-/@tm{@sm concat}bd/e{/t{@te}def}bd/r{/t{@tr}def}bd\r
-/o{/t{pop}def}bd/a{/t{@ta}def}bd/@a{/t{@t@a}def}bd\r
-/t{@te}def/T{@np $ctm setmatrix/$ttm matrix def}bd\r
-/ddt{t}def/@t{/$stm $stm currentmatrix def\r
-3 1 roll moveto $ttm concat ddt $stm setmatrix}bd\r
-/@n{/$ttm exch matrix rotate def}bd/@s{}bd\r
-/@l{}bd/@B{@gs S @gr F}bd/@b{@cp @B}bd/@sep{\r
-CurrentInkName (Composite) eq{/$ink -1 def}{CurrentInkName (Cyan) eq\r
-{/$ink 0 def}{CurrentInkName (Magenta) eq{/$ink 1 def}{\r
-CurrentInkName (Yellow) eq{/$ink 2 def}{CurrentInkName (Black) eq\r
-{/$ink 3 def}{/$ink 4 def}ifelse}ifelse}ifelse}ifelse}ifelse}bd\r
-/@whi{@gs -72000 dup moveto -72000 72000 lineto\r
-72000 dup lineto 72000 -72000 lineto closepath 1 SetGry fill\r
-@gr}bd/@neg{ [{1 exch sub}/exec cvx currenttransfer/exec cvx] cvx settransfer\r
-@whi}bd/currentscale{1 0 dtransform matrix defaultmatrix idtransform\r
-dup mul exch dup mul add sqrt 0 1 dtransform\r
-matrix defaultmatrix idtransform dup mul exch dup mul add sqrt}bd\r
-/@unscale{currentscale 1 exch div exch 1 exch div exch scale}bd\r
-/@square{dup 0 rlineto dup 0 exch rlineto neg 0 rlineto\r
-closepath}bd/corelsym{gsave newpath Tl -90 rotate\r
-7{45 rotate -.75 2 moveto 1.5 @square fill}repeat\r
-grestore}bd/@reg{gsave newpath Tl -6 -6 moveto 12 @square\r
-gsave 1 GetGry sub SetGry fill grestore 4{90 rotate\r
-0 4 m 0 4 rl}repeat stroke 0 0 corelsym grestore}bd\r
-/$corelmeter [1 .95 .75 .50 .25 .05 0] def\r
-/@colormeter{@gs newpath 0 SetGry 0.3 setlinewidth\r
-/Courier findfont 5 scalefont setfont/y exch def\r
-/x exch def 0 1 6{x 20 sub y m 20 @square @gs $corelmeter exch get dup SetGry fill @gr\r
-stroke x 2 add y 8 add moveto 100 mul 100 exch sub cvi 20 string cvs show\r
-/y y 20 add def}for @gr}bd/@crop{gsave .3 setlinewidth\r
-0 SetGry Tl rotate 0 0 m 0 -24 rl -4 -24 m 8 @square\r
--4 -20 m 8 0 rl stroke grestore}bd/@colorbox{gsave\r
-newpath Tl 100 exch sub 100 div SetGry -8 -8 moveto 16 @square fill\r
-0 SetGry 10 -2 moveto show grestore}bd/deflevel 0 def\r
-/@sax{/deflevel deflevel 1 add def}bd/@eax{\r
-/deflevel deflevel dup 0 gt{1 sub}if def deflevel 0 gt{/eax load}{eax}\r
-ifelse}bd/eax{{exec}forall}bd/@rax{deflevel 0 eq{@rs @sv}if}bd\r
-/@daq{dup type/arraytype eq{{}forall}if}bd\r
-/@BMP{/@cc xd 12 index 1 eq{12 -1 roll pop\r
-@i}{7 -2 roll 2 rp @I}ifelse}bd end\r
-%%EndResource\r
-\r
-%%EndProlog\r
-/#copies 1 def\r
-wCorel4Dict begin\r
-0.00 0.00 Tl\r
-1.0000 1.0000 scale\r
-%%BeginSetup\r
-11.4737 setmiterlimit\r
-0 45 /@dot @D\r
-1.00 setflat\r
-/$fst 128 def\r
-%%EndSetup\r
-[ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 \r
-0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 278 \r
-278 355 556 556 889 667 191 333 333 389 584 278 333 278 278 556 \r
-556 556 556 556 556 556 556 556 556 278 278 584 584 584 556 1015 \r
-667 667 722 722 667 611 778 722 278 500 667 556 833 722 778 667 \r
-778 722 667 611 722 667 944 667 667 611 278 278 278 469 556 333 \r
-556 556 500 556 556 278 556 556 222 222 500 222 833 556 556 556 \r
-556 333 500 278 556 500 722 500 500 500 334 260 334 584 750 750 \r
-750 222 556 333 1000 556 556 333 1000 667 333 1000 750 750 750 750 \r
-222 222 333 333 350 556 1000 333 1000 500 333 944 750 750 667 278 \r
-333 556 556 556 556 260 556 333 737 370 556 584 333 737 552 400 \r
-549 333 333 333 576 537 278 333 333 365 556 834 834 834 611 667 \r
-667 667 667 667 667 1000 722 667 667 667 667 278 278 278 278 722 \r
-722 778 778 778 778 778 584 778 722 722 722 722 667 667 611 556 \r
-556 556 556 556 556 889 500 556 556 556 556 278 278 278 278 556 \r
-556 556 556 556 556 556 549 611 556 556 556 556 500 556 500 ]\r
-CorelDrawReencodeVect /_R1-Helvetica /Helvetica Z\r
-\r
-%StartPage\r
-@sv\r
-/$ctm matrix currentmatrix def\r
-@sv\r
-%StartColorLayer (COMPOSITE)\r
-%StartTile\r
-/$ctm matrix currentmatrix def\r
-@sv @sv\r
-@rs 0 0 Tl 1.000000 1.000000 scale \r
-0.000000 0.000000 Tl /$ctm matrix currentmatrix def @sv\r
-@rax %%Note: Object\r
-132.34 700.99 187.20 709.20 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.34 700.99 m\r
-132.34 709.20 L\r
-187.20 709.20 L\r
-187.20 700.99 L\r
-132.34 700.99 L\r
-@c\r
-S\r
-\r
-@rax %%Note: Object\r
-132.41 270.43 168.05 275.90 @E\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 270.43 m\r
-132.41 275.90 L\r
-168.05 275.90 L\r
-168.05 270.43 L\r
-132.41 270.43 L\r
-@c\r
-B\r
-\r
-@rax %%Note: Object\r
-132.41 311.54 168.05 317.02 @E\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 311.54 m\r
-132.41 317.02 L\r
-168.05 317.02 L\r
-168.05 311.54 L\r
-132.41 311.54 L\r
-@c\r
-B\r
-\r
-@rax %%Note: Object\r
-132.41 303.34 168.05 308.81 @E\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 303.34 m\r
-132.41 308.81 L\r
-168.05 308.81 L\r
-168.05 303.34 L\r
-132.41 303.34 L\r
-@c\r
-B\r
-\r
-@rax %%Note: Object\r
-132.41 295.06 168.05 300.60 @E\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 295.06 m\r
-132.41 300.60 L\r
-168.05 300.60 L\r
-168.05 295.06 L\r
-132.41 295.06 L\r
-@c\r
-B\r
-\r
-@rax %%Note: Object\r
-132.41 264.89 187.27 273.17 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 264.89 m\r
-132.41 273.17 L\r
-187.27 273.17 L\r
-187.27 264.89 L\r
-132.41 264.89 L\r
-@c\r
-S\r
-\r
-@rax %%Note: Object\r
-132.41 314.28 187.27 322.49 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 314.28 m\r
-132.41 322.49 L\r
-187.27 322.49 L\r
-187.27 314.28 L\r
-132.41 314.28 L\r
-@c\r
-S\r
-\r
-@rax %%Note: Object\r
-132.41 306.07 187.27 314.28 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 306.07 m\r
-132.41 314.28 L\r
-187.27 314.28 L\r
-187.27 306.07 L\r
-132.41 306.07 L\r
-@c\r
-S\r
-\r
-@rax %%Note: Object\r
-132.41 297.86 187.27 306.07 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 297.86 m\r
-132.41 306.07 L\r
-187.27 306.07 L\r
-187.27 297.86 L\r
-132.41 297.86 L\r
-@c\r
-S\r
-\r
-@rax %%Note: Object\r
-132.41 273.17 187.27 281.38 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 273.17 m\r
-132.41 281.38 L\r
-187.27 281.38 L\r
-187.27 273.17 L\r
-132.41 273.17 L\r
-@c\r
-S\r
-\r
-@rax %%Note: Object\r
-132.41 289.58 187.27 297.86 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 289.58 m\r
-132.41 297.86 L\r
-187.27 297.86 L\r
-187.27 289.58 L\r
-132.41 289.58 L\r
-@c\r
-S\r
-\r
-@rax %%Note: Object\r
-132.41 281.38 187.27 289.58 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 281.38 m\r
-132.41 289.58 L\r
-187.27 289.58 L\r
-187.27 281.38 L\r
-132.41 281.38 L\r
-@c\r
-S\r
-\r
-@rax %%Note: Object\r
-132.41 278.64 168.05 284.11 @E\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 278.64 m\r
-132.41 284.11 L\r
-168.05 284.11 L\r
-168.05 278.64 L\r
-132.41 278.64 L\r
-@c\r
-B\r
-\r
-@rax %%Note: Object\r
-132.41 97.70 168.05 103.18 @E\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 97.70 m\r
-132.41 103.18 L\r
-168.05 103.18 L\r
-168.05 97.70 L\r
-132.41 97.70 L\r
-@c\r
-B\r
-\r
-@rax %%Note: Object\r
-132.41 138.82 168.05 144.29 @E\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 138.82 m\r
-132.41 144.29 L\r
-168.05 144.29 L\r
-168.05 138.82 L\r
-132.41 138.82 L\r
-@c\r
-B\r
-\r
-@rax %%Note: Object\r
-132.41 130.61 168.05 136.08 @E\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 130.61 m\r
-132.41 136.08 L\r
-168.05 136.08 L\r
-168.05 130.61 L\r
-132.41 130.61 L\r
-@c\r
-B\r
-\r
-@rax %%Note: Object\r
-132.41 122.33 168.05 127.87 @E\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 122.33 m\r
-132.41 127.87 L\r
-168.05 127.87 L\r
-168.05 122.33 L\r
-132.41 122.33 L\r
-@c\r
-B\r
-\r
-@rax %%Note: Object\r
-132.41 92.16 187.27 100.44 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 92.16 m\r
-132.41 100.44 L\r
-187.27 100.44 L\r
-187.27 92.16 L\r
-132.41 92.16 L\r
-@c\r
-S\r
-\r
-@rax %%Note: Object\r
-132.41 141.55 187.27 149.76 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 141.55 m\r
-132.41 149.76 L\r
-187.27 149.76 L\r
-187.27 141.55 L\r
-132.41 141.55 L\r
-@c\r
-S\r
-\r
-@rax %%Note: Object\r
-132.41 133.34 187.27 141.55 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 133.34 m\r
-132.41 141.55 L\r
-187.27 141.55 L\r
-187.27 133.34 L\r
-132.41 133.34 L\r
-@c\r
-S\r
-\r
-@rax %%Note: Object\r
-132.41 125.14 187.27 133.34 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 125.14 m\r
-132.41 133.34 L\r
-187.27 133.34 L\r
-187.27 125.14 L\r
-132.41 125.14 L\r
-@c\r
-S\r
-\r
-@rax %%Note: Object\r
-132.41 100.44 187.27 108.65 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 100.44 m\r
-132.41 108.65 L\r
-187.27 108.65 L\r
-187.27 100.44 L\r
-132.41 100.44 L\r
-@c\r
-S\r
-\r
-@rax %%Note: Object\r
-132.41 116.86 187.27 125.14 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 116.86 m\r
-132.41 125.14 L\r
-187.27 125.14 L\r
-187.27 116.86 L\r
-132.41 116.86 L\r
-@c\r
-S\r
-\r
-@rax %%Note: Object\r
-132.41 108.65 187.27 116.86 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 108.65 m\r
-132.41 116.86 L\r
-187.27 116.86 L\r
-187.27 108.65 L\r
-132.41 108.65 L\r
-@c\r
-S\r
-\r
-@rax %%Note: Object\r
-132.41 105.91 168.05 111.38 @E\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 105.91 m\r
-132.41 111.38 L\r
-168.05 111.38 L\r
-168.05 105.91 L\r
-132.41 105.91 L\r
-@c\r
-B\r
-\r
-@rax %%Note: Object\r
-132.41 155.23 168.05 160.70 @E\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 155.23 m\r
-132.41 160.70 L\r
-168.05 160.70 L\r
-168.05 155.23 L\r
-132.41 155.23 L\r
-@c\r
-B\r
-\r
-@rax %%Note: Object\r
-132.41 196.34 168.05 201.82 @E\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 196.34 m\r
-132.41 201.82 L\r
-168.05 201.82 L\r
-168.05 196.34 L\r
-132.41 196.34 L\r
-@c\r
-B\r
-\r
-@rax %%Note: Object\r
-132.41 188.14 168.05 193.61 @E\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 188.14 m\r
-132.41 193.61 L\r
-168.05 193.61 L\r
-168.05 188.14 L\r
-132.41 188.14 L\r
-@c\r
-B\r
-\r
-@rax %%Note: Object\r
-132.41 179.86 168.05 185.40 @E\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 179.86 m\r
-132.41 185.40 L\r
-168.05 185.40 L\r
-168.05 179.86 L\r
-132.41 179.86 L\r
-@c\r
-B\r
-\r
-@rax %%Note: Object\r
-132.41 149.69 187.27 157.97 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 149.69 m\r
-132.41 157.97 L\r
-187.27 157.97 L\r
-187.27 149.69 L\r
-132.41 149.69 L\r
-@c\r
-S\r
-\r
-@rax %%Note: Object\r
-132.41 199.08 187.27 207.29 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 199.08 m\r
-132.41 207.29 L\r
-187.27 207.29 L\r
-187.27 199.08 L\r
-132.41 199.08 L\r
-@c\r
-S\r
-\r
-@rax %%Note: Object\r
-132.41 190.87 187.27 199.08 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 190.87 m\r
-132.41 199.08 L\r
-187.27 199.08 L\r
-187.27 190.87 L\r
-132.41 190.87 L\r
-@c\r
-S\r
-\r
-@rax %%Note: Object\r
-132.41 182.66 187.27 190.87 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 182.66 m\r
-132.41 190.87 L\r
-187.27 190.87 L\r
-187.27 182.66 L\r
-132.41 182.66 L\r
-@c\r
-S\r
-\r
-@rax %%Note: Object\r
-132.41 157.97 187.27 166.18 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 157.97 m\r
-132.41 166.18 L\r
-187.27 166.18 L\r
-187.27 157.97 L\r
-132.41 157.97 L\r
-@c\r
-S\r
-\r
-@rax %%Note: Object\r
-132.41 174.38 187.27 182.66 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 174.38 m\r
-132.41 182.66 L\r
-187.27 182.66 L\r
-187.27 174.38 L\r
-132.41 174.38 L\r
-@c\r
-S\r
-\r
-@rax %%Note: Object\r
-132.41 166.18 187.27 174.38 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 166.18 m\r
-132.41 174.38 L\r
-187.27 174.38 L\r
-187.27 166.18 L\r
-132.41 166.18 L\r
-@c\r
-S\r
-\r
-@rax %%Note: Object\r
-132.41 163.44 168.05 168.91 @E\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 163.44 m\r
-132.41 168.91 L\r
-168.05 168.91 L\r
-168.05 163.44 L\r
-132.41 163.44 L\r
-@c\r
-B\r
-\r
-@rax %%Note: Object\r
-132.34 673.56 167.98 679.03 @E\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.34 673.56 m\r
-132.34 679.03 L\r
-167.98 679.03 L\r
-167.98 673.56 L\r
-132.34 673.56 L\r
-@c\r
-B\r
-\r
-@rax %%Note: Object\r
-132.34 698.26 167.98 703.73 @E\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.34 698.26 m\r
-132.34 703.73 L\r
-167.98 703.73 L\r
-167.98 698.26 L\r
-132.34 698.26 L\r
-@c\r
-B\r
-\r
-@rax %%Note: Object\r
-132.34 668.09 187.20 676.30 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.34 668.09 m\r
-132.34 676.30 L\r
-187.20 676.30 L\r
-187.20 668.09 L\r
-132.34 668.09 L\r
-@c\r
-S\r
-\r
-@rax %%Note: Object\r
-132.34 676.30 187.20 684.50 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.34 676.30 m\r
-132.34 684.50 L\r
-187.20 684.50 L\r
-187.20 676.30 L\r
-132.34 676.30 L\r
-@c\r
-S\r
-\r
-@rax %%Note: Object\r
-132.34 692.78 187.20 700.99 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.34 692.78 m\r
-132.34 700.99 L\r
-187.20 700.99 L\r
-187.20 692.78 L\r
-132.34 692.78 L\r
-@c\r
-S\r
-\r
-@rax %%Note: Object\r
-132.34 684.58 187.20 692.78 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.34 684.58 m\r
-132.34 692.78 L\r
-187.20 692.78 L\r
-187.20 684.58 L\r
-132.34 684.58 L\r
-@c\r
-S\r
-\r
-@rax %%Note: Object\r
-132.34 681.77 167.98 687.24 @E\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.34 681.77 m\r
-132.34 687.24 L\r
-167.98 687.24 L\r
-167.98 681.77 L\r
-132.34 681.77 L\r
-@c\r
-B\r
-\r
-@rax %%Note: Object\r
-132.41 500.90 168.05 506.38 @E\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 500.90 m\r
-132.41 506.38 L\r
-168.05 506.38 L\r
-168.05 500.90 L\r
-132.41 500.90 L\r
-@c\r
-B\r
-\r
-@rax %%Note: Object\r
-132.41 542.02 168.05 547.49 @E\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 542.02 m\r
-132.41 547.49 L\r
-168.05 547.49 L\r
-168.05 542.02 L\r
-132.41 542.02 L\r
-@c\r
-B\r
-\r
-@rax %%Note: Object\r
-132.41 533.81 168.05 539.28 @E\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 533.81 m\r
-132.41 539.28 L\r
-168.05 539.28 L\r
-168.05 533.81 L\r
-132.41 533.81 L\r
-@c\r
-B\r
-\r
-@rax %%Note: Object\r
-132.41 525.53 168.05 531.07 @E\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 525.53 m\r
-132.41 531.07 L\r
-168.05 531.07 L\r
-168.05 525.53 L\r
-132.41 525.53 L\r
-@c\r
-B\r
-\r
-@rax %%Note: Object\r
-132.41 495.36 187.27 503.64 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 495.36 m\r
-132.41 503.64 L\r
-187.27 503.64 L\r
-187.27 495.36 L\r
-132.41 495.36 L\r
-@c\r
-S\r
-\r
-@rax %%Note: Object\r
-132.41 544.75 187.27 552.96 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 544.75 m\r
-132.41 552.96 L\r
-187.27 552.96 L\r
-187.27 544.75 L\r
-132.41 544.75 L\r
-@c\r
-S\r
-\r
-@rax %%Note: Object\r
-132.41 536.54 187.27 544.75 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 536.54 m\r
-132.41 544.75 L\r
-187.27 544.75 L\r
-187.27 536.54 L\r
-132.41 536.54 L\r
-@c\r
-S\r
-\r
-@rax %%Note: Object\r
-132.41 528.34 187.27 536.54 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 528.34 m\r
-132.41 536.54 L\r
-187.27 536.54 L\r
-187.27 528.34 L\r
-132.41 528.34 L\r
-@c\r
-S\r
-\r
-@rax %%Note: Object\r
-132.41 503.64 187.27 511.85 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 503.64 m\r
-132.41 511.85 L\r
-187.27 511.85 L\r
-187.27 503.64 L\r
-132.41 503.64 L\r
-@c\r
-S\r
-\r
-@rax %%Note: Object\r
-132.41 520.06 187.27 528.34 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 520.06 m\r
-132.41 528.34 L\r
-187.27 528.34 L\r
-187.27 520.06 L\r
-132.41 520.06 L\r
-@c\r
-S\r
-\r
-@rax %%Note: Object\r
-132.41 511.85 187.27 520.06 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 511.85 m\r
-132.41 520.06 L\r
-187.27 520.06 L\r
-187.27 511.85 L\r
-132.41 511.85 L\r
-@c\r
-S\r
-\r
-@rax %%Note: Object\r
-132.41 509.11 168.05 514.58 @E\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 509.11 m\r
-132.41 514.58 L\r
-168.05 514.58 L\r
-168.05 509.11 L\r
-132.41 509.11 L\r
-@c\r
-B\r
-\r
-@rax %%Note: Object\r
-132.41 558.50 168.05 563.98 @E\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 558.50 m\r
-132.41 563.98 L\r
-168.05 563.98 L\r
-168.05 558.50 L\r
-132.41 558.50 L\r
-@c\r
-B\r
-\r
-@rax %%Note: Object\r
-132.41 599.62 168.05 605.09 @E\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 599.62 m\r
-132.41 605.09 L\r
-168.05 605.09 L\r
-168.05 599.62 L\r
-132.41 599.62 L\r
-@c\r
-B\r
-\r
-@rax %%Note: Object\r
-132.41 591.41 168.05 596.88 @E\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 591.41 m\r
-132.41 596.88 L\r
-168.05 596.88 L\r
-168.05 591.41 L\r
-132.41 591.41 L\r
-@c\r
-B\r
-\r
-@rax %%Note: Object\r
-132.41 583.13 168.05 588.67 @E\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 583.13 m\r
-132.41 588.67 L\r
-168.05 588.67 L\r
-168.05 583.13 L\r
-132.41 583.13 L\r
-@c\r
-B\r
-\r
-@rax %%Note: Object\r
-132.41 552.96 187.27 561.24 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 552.96 m\r
-132.41 561.24 L\r
-187.27 561.24 L\r
-187.27 552.96 L\r
-132.41 552.96 L\r
-@c\r
-S\r
-\r
-@rax %%Note: Object\r
-132.41 602.35 187.27 610.56 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 602.35 m\r
-132.41 610.56 L\r
-187.27 610.56 L\r
-187.27 602.35 L\r
-132.41 602.35 L\r
-@c\r
-S\r
-\r
-@rax %%Note: Object\r
-132.41 594.14 187.27 602.35 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 594.14 m\r
-132.41 602.35 L\r
-187.27 602.35 L\r
-187.27 594.14 L\r
-132.41 594.14 L\r
-@c\r
-S\r
-\r
-@rax %%Note: Object\r
-132.41 585.94 187.27 594.14 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 585.94 m\r
-132.41 594.14 L\r
-187.27 594.14 L\r
-187.27 585.94 L\r
-132.41 585.94 L\r
-@c\r
-S\r
-\r
-@rax %%Note: Object\r
-132.41 561.24 187.27 569.45 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 561.24 m\r
-132.41 569.45 L\r
-187.27 569.45 L\r
-187.27 561.24 L\r
-132.41 561.24 L\r
-@c\r
-S\r
-\r
-@rax %%Note: Object\r
-132.41 577.66 187.27 585.94 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 577.66 m\r
-132.41 585.94 L\r
-187.27 585.94 L\r
-187.27 577.66 L\r
-132.41 577.66 L\r
-@c\r
-S\r
-\r
-@rax %%Note: Object\r
-132.41 569.45 187.27 577.66 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 569.45 m\r
-132.41 577.66 L\r
-187.27 577.66 L\r
-187.27 569.45 L\r
-132.41 569.45 L\r
-@c\r
-S\r
-\r
-@rax %%Note: Object\r
-132.41 566.71 168.05 572.18 @E\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 566.71 m\r
-132.41 572.18 L\r
-168.05 572.18 L\r
-168.05 566.71 L\r
-132.41 566.71 L\r
-@c\r
-B\r
-\r
-@rax %%Note: Object\r
-132.41 616.03 168.05 621.50 @E\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 616.03 m\r
-132.41 621.50 L\r
-168.05 621.50 L\r
-168.05 616.03 L\r
-132.41 616.03 L\r
-@c\r
-B\r
-\r
-@rax %%Note: Object\r
-132.41 657.14 168.05 662.62 @E\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 657.14 m\r
-132.41 662.62 L\r
-168.05 662.62 L\r
-168.05 657.14 L\r
-132.41 657.14 L\r
-@c\r
-B\r
-\r
-@rax %%Note: Object\r
-132.41 648.94 168.05 654.41 @E\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 648.94 m\r
-132.41 654.41 L\r
-168.05 654.41 L\r
-168.05 648.94 L\r
-132.41 648.94 L\r
-@c\r
-B\r
-\r
-@rax %%Note: Object\r
-132.41 640.66 168.05 646.20 @E\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 640.66 m\r
-132.41 646.20 L\r
-168.05 646.20 L\r
-168.05 640.66 L\r
-132.41 640.66 L\r
-@c\r
-B\r
-\r
-@rax %%Note: Object\r
-132.41 610.49 187.27 618.77 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 610.49 m\r
-132.41 618.77 L\r
-187.27 618.77 L\r
-187.27 610.49 L\r
-132.41 610.49 L\r
-@c\r
-S\r
-\r
-@rax %%Note: Object\r
-132.41 659.88 187.27 668.09 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 659.88 m\r
-132.41 668.09 L\r
-187.27 668.09 L\r
-187.27 659.88 L\r
-132.41 659.88 L\r
-@c\r
-S\r
-\r
-@rax %%Note: Object\r
-132.41 651.67 187.27 659.88 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 651.67 m\r
-132.41 659.88 L\r
-187.27 659.88 L\r
-187.27 651.67 L\r
-132.41 651.67 L\r
-@c\r
-S\r
-\r
-@rax %%Note: Object\r
-132.41 643.46 187.27 651.67 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 643.46 m\r
-132.41 651.67 L\r
-187.27 651.67 L\r
-187.27 643.46 L\r
-132.41 643.46 L\r
-@c\r
-S\r
-\r
-@rax %%Note: Object\r
-132.41 618.77 187.27 626.98 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 618.77 m\r
-132.41 626.98 L\r
-187.27 626.98 L\r
-187.27 618.77 L\r
-132.41 618.77 L\r
-@c\r
-S\r
-\r
-@rax %%Note: Object\r
-132.41 635.18 187.27 643.46 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 635.18 m\r
-132.41 643.46 L\r
-187.27 643.46 L\r
-187.27 635.18 L\r
-132.41 635.18 L\r
-@c\r
-S\r
-\r
-@rax %%Note: Object\r
-132.41 626.98 187.27 635.18 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 626.98 m\r
-132.41 635.18 L\r
-187.27 635.18 L\r
-187.27 626.98 L\r
-132.41 626.98 L\r
-@c\r
-S\r
-\r
-@rax %%Note: Object\r
-132.41 624.24 168.05 629.71 @E\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 624.24 m\r
-132.41 629.71 L\r
-168.05 629.71 L\r
-168.05 624.24 L\r
-132.41 624.24 L\r
-@c\r
-B\r
-\r
-@rax %%Note: Object\r
-132.41 385.63 168.05 391.10 @E\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 385.63 m\r
-132.41 391.10 L\r
-168.05 391.10 L\r
-168.05 385.63 L\r
-132.41 385.63 L\r
-@c\r
-B\r
-\r
-@rax %%Note: Object\r
-132.41 426.74 168.05 432.22 @E\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 426.74 m\r
-132.41 432.22 L\r
-168.05 432.22 L\r
-168.05 426.74 L\r
-132.41 426.74 L\r
-@c\r
-B\r
-\r
-@rax %%Note: Object\r
-132.41 418.54 168.05 424.01 @E\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 418.54 m\r
-132.41 424.01 L\r
-168.05 424.01 L\r
-168.05 418.54 L\r
-132.41 418.54 L\r
-@c\r
-B\r
-\r
-@rax %%Note: Object\r
-132.41 410.26 168.05 415.80 @E\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 410.26 m\r
-132.41 415.80 L\r
-168.05 415.80 L\r
-168.05 410.26 L\r
-132.41 410.26 L\r
-@c\r
-B\r
-\r
-@rax %%Note: Object\r
-132.41 380.09 187.27 388.37 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 380.09 m\r
-132.41 388.37 L\r
-187.27 388.37 L\r
-187.27 380.09 L\r
-132.41 380.09 L\r
-@c\r
-S\r
-\r
-@rax %%Note: Object\r
-132.41 429.48 187.27 437.69 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 429.48 m\r
-132.41 437.69 L\r
-187.27 437.69 L\r
-187.27 429.48 L\r
-132.41 429.48 L\r
-@c\r
-S\r
-\r
-@rax %%Note: Object\r
-132.41 421.27 187.27 429.48 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 421.27 m\r
-132.41 429.48 L\r
-187.27 429.48 L\r
-187.27 421.27 L\r
-132.41 421.27 L\r
-@c\r
-S\r
-\r
-@rax %%Note: Object\r
-132.41 413.06 187.27 421.27 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 413.06 m\r
-132.41 421.27 L\r
-187.27 421.27 L\r
-187.27 413.06 L\r
-132.41 413.06 L\r
-@c\r
-S\r
-\r
-@rax %%Note: Object\r
-132.41 388.37 187.27 396.58 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 388.37 m\r
-132.41 396.58 L\r
-187.27 396.58 L\r
-187.27 388.37 L\r
-132.41 388.37 L\r
-@c\r
-S\r
-\r
-@rax %%Note: Object\r
-132.41 404.78 187.27 413.06 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 404.78 m\r
-132.41 413.06 L\r
-187.27 413.06 L\r
-187.27 404.78 L\r
-132.41 404.78 L\r
-@c\r
-S\r
-\r
-@rax %%Note: Object\r
-132.41 396.58 187.27 404.78 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 396.58 m\r
-132.41 404.78 L\r
-187.27 404.78 L\r
-187.27 396.58 L\r
-132.41 396.58 L\r
-@c\r
-S\r
-\r
-@rax %%Note: Object\r
-132.41 393.84 168.05 399.31 @E\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 393.84 m\r
-132.41 399.31 L\r
-168.05 399.31 L\r
-168.05 393.84 L\r
-132.41 393.84 L\r
-@c\r
-B\r
-\r
-@rax %%Note: Object\r
-132.41 212.90 168.05 218.38 @E\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 212.90 m\r
-132.41 218.38 L\r
-168.05 218.38 L\r
-168.05 212.90 L\r
-132.41 212.90 L\r
-@c\r
-B\r
-\r
-@rax %%Note: Object\r
-132.41 254.02 168.05 259.49 @E\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 254.02 m\r
-132.41 259.49 L\r
-168.05 259.49 L\r
-168.05 254.02 L\r
-132.41 254.02 L\r
-@c\r
-B\r
-\r
-@rax %%Note: Object\r
-132.41 245.81 168.05 251.28 @E\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 245.81 m\r
-132.41 251.28 L\r
-168.05 251.28 L\r
-168.05 245.81 L\r
-132.41 245.81 L\r
-@c\r
-B\r
-\r
-@rax %%Note: Object\r
-132.41 237.53 168.05 243.07 @E\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 237.53 m\r
-132.41 243.07 L\r
-168.05 243.07 L\r
-168.05 237.53 L\r
-132.41 237.53 L\r
-@c\r
-B\r
-\r
-@rax %%Note: Object\r
-132.41 207.36 187.27 215.64 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 207.36 m\r
-132.41 215.64 L\r
-187.27 215.64 L\r
-187.27 207.36 L\r
-132.41 207.36 L\r
-@c\r
-S\r
-\r
-@rax %%Note: Object\r
-132.41 256.75 187.27 264.96 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 256.75 m\r
-132.41 264.96 L\r
-187.27 264.96 L\r
-187.27 256.75 L\r
-132.41 256.75 L\r
-@c\r
-S\r
-\r
-@rax %%Note: Object\r
-132.41 248.54 187.27 256.75 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 248.54 m\r
-132.41 256.75 L\r
-187.27 256.75 L\r
-187.27 248.54 L\r
-132.41 248.54 L\r
-@c\r
-S\r
-\r
-@rax %%Note: Object\r
-132.41 240.34 187.27 248.54 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 240.34 m\r
-132.41 248.54 L\r
-187.27 248.54 L\r
-187.27 240.34 L\r
-132.41 240.34 L\r
-@c\r
-S\r
-\r
-@rax %%Note: Object\r
-132.41 215.64 187.27 223.85 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 215.64 m\r
-132.41 223.85 L\r
-187.27 223.85 L\r
-187.27 215.64 L\r
-132.41 215.64 L\r
-@c\r
-S\r
-\r
-@rax %%Note: Object\r
-132.41 232.06 187.27 240.34 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 232.06 m\r
-132.41 240.34 L\r
-187.27 240.34 L\r
-187.27 232.06 L\r
-132.41 232.06 L\r
-@c\r
-S\r
-\r
-@rax %%Note: Object\r
-132.41 223.85 187.27 232.06 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 223.85 m\r
-132.41 232.06 L\r
-187.27 232.06 L\r
-187.27 223.85 L\r
-132.41 223.85 L\r
-@c\r
-S\r
-\r
-@rax %%Note: Object\r
-132.41 221.11 168.05 226.58 @E\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 221.11 m\r
-132.41 226.58 L\r
-168.05 226.58 L\r
-168.05 221.11 L\r
-132.41 221.11 L\r
-@c\r
-B\r
-\r
-@rax %%Note: Object\r
-132.41 328.03 168.05 333.50 @E\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 328.03 m\r
-132.41 333.50 L\r
-168.05 333.50 L\r
-168.05 328.03 L\r
-132.41 328.03 L\r
-@c\r
-B\r
-\r
-@rax %%Note: Object\r
-132.41 369.14 168.05 374.62 @E\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 369.14 m\r
-132.41 374.62 L\r
-168.05 374.62 L\r
-168.05 369.14 L\r
-132.41 369.14 L\r
-@c\r
-B\r
-\r
-@rax %%Note: Object\r
-132.41 360.94 168.05 366.41 @E\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 360.94 m\r
-132.41 366.41 L\r
-168.05 366.41 L\r
-168.05 360.94 L\r
-132.41 360.94 L\r
-@c\r
-B\r
-\r
-@rax %%Note: Object\r
-132.41 352.66 168.05 358.20 @E\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 352.66 m\r
-132.41 358.20 L\r
-168.05 358.20 L\r
-168.05 352.66 L\r
-132.41 352.66 L\r
-@c\r
-B\r
-\r
-@rax %%Note: Object\r
-132.41 322.49 187.27 330.77 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 322.49 m\r
-132.41 330.77 L\r
-187.27 330.77 L\r
-187.27 322.49 L\r
-132.41 322.49 L\r
-@c\r
-S\r
-\r
-@rax %%Note: Object\r
-132.41 371.88 187.27 380.09 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 371.88 m\r
-132.41 380.09 L\r
-187.27 380.09 L\r
-187.27 371.88 L\r
-132.41 371.88 L\r
-@c\r
-S\r
-\r
-@rax %%Note: Object\r
-132.41 363.67 187.27 371.88 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 363.67 m\r
-132.41 371.88 L\r
-187.27 371.88 L\r
-187.27 363.67 L\r
-132.41 363.67 L\r
-@c\r
-S\r
-\r
-@rax %%Note: Object\r
-132.41 355.46 187.27 363.67 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 355.46 m\r
-132.41 363.67 L\r
-187.27 363.67 L\r
-187.27 355.46 L\r
-132.41 355.46 L\r
-@c\r
-S\r
-\r
-@rax %%Note: Object\r
-132.41 330.77 187.27 338.98 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 330.77 m\r
-132.41 338.98 L\r
-187.27 338.98 L\r
-187.27 330.77 L\r
-132.41 330.77 L\r
-@c\r
-S\r
-\r
-@rax %%Note: Object\r
-132.41 347.18 187.27 355.46 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 347.18 m\r
-132.41 355.46 L\r
-187.27 355.46 L\r
-187.27 347.18 L\r
-132.41 347.18 L\r
-@c\r
-S\r
-\r
-@rax %%Note: Object\r
-132.41 338.98 187.27 347.18 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 338.98 m\r
-132.41 347.18 L\r
-187.27 347.18 L\r
-187.27 338.98 L\r
-132.41 338.98 L\r
-@c\r
-S\r
-\r
-@rax %%Note: Object\r
-132.41 336.24 168.05 341.71 @E\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.41 336.24 m\r
-132.41 341.71 L\r
-168.05 341.71 L\r
-168.05 336.24 L\r
-132.41 336.24 L\r
-@c\r
-B\r
-\r
-@rax %%Note: Object\r
-132.34 443.23 167.98 448.70 @E\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.34 443.23 m\r
-132.34 448.70 L\r
-167.98 448.70 L\r
-167.98 443.23 L\r
-132.34 443.23 L\r
-@c\r
-B\r
-\r
-@rax %%Note: Object\r
-132.34 484.34 167.98 489.82 @E\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.34 484.34 m\r
-132.34 489.82 L\r
-167.98 489.82 L\r
-167.98 484.34 L\r
-132.34 484.34 L\r
-@c\r
-B\r
-\r
-@rax %%Note: Object\r
-132.34 476.14 167.98 481.61 @E\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.34 476.14 m\r
-132.34 481.61 L\r
-167.98 481.61 L\r
-167.98 476.14 L\r
-132.34 476.14 L\r
-@c\r
-B\r
-\r
-@rax %%Note: Object\r
-132.34 467.86 167.98 473.40 @E\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.34 467.86 m\r
-132.34 473.40 L\r
-167.98 473.40 L\r
-167.98 467.86 L\r
-132.34 467.86 L\r
-@c\r
-B\r
-\r
-@rax %%Note: Object\r
-132.34 437.69 187.20 445.97 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.34 437.69 m\r
-132.34 445.97 L\r
-187.20 445.97 L\r
-187.20 437.69 L\r
-132.34 437.69 L\r
-@c\r
-S\r
-\r
-@rax %%Note: Object\r
-132.34 487.08 187.20 495.29 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.34 487.08 m\r
-132.34 495.29 L\r
-187.20 495.29 L\r
-187.20 487.08 L\r
-132.34 487.08 L\r
-@c\r
-S\r
-\r
-@rax %%Note: Object\r
-132.34 478.87 187.20 487.08 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.34 478.87 m\r
-132.34 487.08 L\r
-187.20 487.08 L\r
-187.20 478.87 L\r
-132.34 478.87 L\r
-@c\r
-S\r
-\r
-@rax %%Note: Object\r
-132.34 470.66 187.20 478.87 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.34 470.66 m\r
-132.34 478.87 L\r
-187.20 478.87 L\r
-187.20 470.66 L\r
-132.34 470.66 L\r
-@c\r
-S\r
-\r
-@rax %%Note: Object\r
-132.34 445.97 187.20 454.18 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.34 445.97 m\r
-132.34 454.18 L\r
-187.20 454.18 L\r
-187.20 445.97 L\r
-132.34 445.97 L\r
-@c\r
-S\r
-\r
-@rax %%Note: Object\r
-132.34 462.38 187.20 470.66 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.34 462.38 m\r
-132.34 470.66 L\r
-187.20 470.66 L\r
-187.20 462.38 L\r
-132.34 462.38 L\r
-@c\r
-S\r
-\r
-@rax %%Note: Object\r
-132.34 454.18 187.20 462.38 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.34 454.18 m\r
-132.34 462.38 L\r
-187.20 462.38 L\r
-187.20 454.18 L\r
-132.34 454.18 L\r
-@c\r
-S\r
-\r
-@rax %%Note: Object\r
-132.34 451.44 167.98 456.91 @E\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-132.34 451.44 m\r
-132.34 456.91 L\r
-167.98 456.91 L\r
-167.98 451.44 L\r
-132.34 451.44 L\r
-@c\r
-B\r
-\r
-@rax 174.17 95.54 177.19 99.94 @E\r
-[0.07199 0.00000 0.00000 0.07199 174.16800 95.61600] @tm\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-e\r
-/_R1-Helvetica 83.00 z\r
-0 0 (0) @t\r
-T\r
-@rax 174.17 153.22 180.50 157.54 @E\r
-[0.07199 0.00000 0.00000 0.07199 174.16800 153.21599] @tm\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-e\r
-/_R1-Helvetica 83.00 z\r
-0 0 (12) @t\r
-T\r
-@rax 174.17 210.82 180.50 215.14 @E\r
-[0.07199 0.00000 0.00000 0.07199 174.16800 210.81599] @tm\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-e\r
-/_R1-Helvetica 83.00 z\r
-0 0 (24) @t\r
-T\r
-@rax 174.17 268.34 180.50 272.74 @E\r
-[0.07199 0.00000 0.00000 0.07199 174.16800 268.41599] @tm\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-e\r
-/_R1-Helvetica 83.00 z\r
-0 0 (36) @t\r
-T\r
-@rax 174.17 325.94 180.50 330.34 @E\r
-[0.07199 0.00000 0.00000 0.07199 174.16800 326.01599] @tm\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-e\r
-/_R1-Helvetica 83.00 z\r
-0 0 (48) @t\r
-T\r
-@rax 174.17 383.54 180.50 387.94 @E\r
-[0.07199 0.00000 0.00000 0.07199 174.16800 383.61600] @tm\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-e\r
-/_R1-Helvetica 83.00 z\r
-0 0 (60) @t\r
-T\r
-@rax 174.17 441.22 180.50 445.54 @E\r
-[0.07199 0.00000 0.00000 0.07199 174.16800 441.21597] @tm\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-e\r
-/_R1-Helvetica 83.00 z\r
-0 0 (72) @t\r
-T\r
-@rax 174.17 498.74 180.50 503.14 @E\r
-[0.07199 0.00000 0.00000 0.07199 174.16800 498.81598] @tm\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-e\r
-/_R1-Helvetica 83.00 z\r
-0 0 (84) @t\r
-T\r
-@rax 174.17 556.34 180.50 560.74 @E\r
-[0.07199 0.00000 0.00000 0.07199 174.16800 556.41595] @tm\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-e\r
-/_R1-Helvetica 83.00 z\r
-0 0 (96) @t\r
-T\r
-@rax 174.17 613.94 183.82 618.34 @E\r
-[0.07199 0.00000 0.00000 0.07199 174.16800 614.01599] @tm\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-e\r
-/_R1-Helvetica 83.00 z\r
-0 0 (108) @t\r
-T\r
-@rax 174.17 671.54 183.82 675.94 @E\r
-[0.07199 0.00000 0.00000 0.07199 174.16800 671.61597] @tm\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-e\r
-/_R1-Helvetica 83.00 z\r
-0 0 (120) @t\r
-T\r
-@rax 174.17 695.52 183.82 699.91 @E\r
-[0.07199 0.00000 0.00000 0.07199 174.16800 695.59198] @tm\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-e\r
-/_R1-Helvetica 83.00 z\r
-0 0 (125) @t\r
-T\r
-@rax 174.17 637.92 183.38 642.31 @E\r
-[0.07199 0.00000 0.00000 0.07199 174.16800 637.99194] @tm\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-e\r
-/_R1-Helvetica 83.00 z\r
-0 0 (113) @t\r
-T\r
-@rax 174.17 580.32 182.95 584.71 @E\r
-[0.07199 0.00000 0.00000 0.07199 174.16800 580.39197] @tm\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-e\r
-/_R1-Helvetica 83.00 z\r
-0 0 (101) @t\r
-T\r
-@rax 174.17 522.72 180.50 527.11 @E\r
-[0.07199 0.00000 0.00000 0.07199 174.16800 522.79199] @tm\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-e\r
-/_R1-Helvetica 83.00 z\r
-0 0 (89) @t\r
-T\r
-@rax 174.17 465.19 180.50 469.44 @E\r
-[0.07199 0.00000 0.00000 0.07199 174.16800 465.19199] @tm\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-e\r
-/_R1-Helvetica 83.00 z\r
-0 0 (77) @t\r
-T\r
-@rax 174.17 407.52 180.50 411.91 @E\r
-[0.07199 0.00000 0.00000 0.07199 174.16800 407.59198] @tm\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-e\r
-/_R1-Helvetica 83.00 z\r
-0 0 (65) @t\r
-T\r
-@rax 174.17 349.92 180.50 354.31 @E\r
-[0.07199 0.00000 0.00000 0.07199 174.16800 349.99197] @tm\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-e\r
-/_R1-Helvetica 83.00 z\r
-0 0 (53) @t\r
-T\r
-@rax 174.17 292.39 179.64 296.71 @E\r
-[0.07199 0.00000 0.00000 0.07199 174.16800 292.39200] @tm\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-e\r
-/_R1-Helvetica 83.00 z\r
-0 0 (41) @t\r
-T\r
-@rax 174.17 234.72 180.50 239.11 @E\r
-[0.07199 0.00000 0.00000 0.07199 174.16800 234.79199] @tm\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-e\r
-/_R1-Helvetica 83.00 z\r
-0 0 (29) @t\r
-T\r
-@rax 174.17 177.19 180.50 181.51 @E\r
-[0.07199 0.00000 0.00000 0.07199 174.16800 177.19199] @tm\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-e\r
-/_R1-Helvetica 83.00 z\r
-0 0 (17) @t\r
-T\r
-@rax 174.17 119.52 177.19 123.84 @E\r
-[0.07199 0.00000 0.00000 0.07199 174.16800 119.59200] @tm\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-e\r
-/_R1-Helvetica 83.00 z\r
-0 0 (5) @t\r
-T\r
-@rax 194.40 745.06 392.04 755.21 @E\r
-[0.07199 0.00000 0.00000 0.07199 194.39999 745.19995] @tm\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-e\r
-/_R1-Helvetica 194.00 z\r
-0 0 (MIDI File Format Note Numbers) @t\r
-T\r
-@rax %%Note: Object\r
-288.00 691.27 301.03 705.67 @E\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-295.78 691.27 m\r
-291.67 691.27 288.29 696.38 288.14 700.56 C\r
-288.00 704.30 289.66 705.67 293.40 705.67 C\r
-297.43 705.60 301.03 700.34 301.03 696.31 C\r
-301.03 692.78 299.74 691.27 295.78 691.27 C\r
-@c\r
-293.33 696.10 m\r
-294.34 694.58 296.57 692.64 298.01 692.71 C\r
-300.82 693.00 297.36 698.69 296.35 699.98 c\r
-294.55 702.36 292.54 704.30 290.95 704.09 C\r
-288.14 703.37 292.32 697.46 293.33 696.10 c\r
-@c\r
-B\r
-\r
-@rax %%Note: Object\r
-302.40 655.27 315.43 669.67 @E\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-310.18 655.27 m\r
-306.07 655.27 302.69 660.38 302.54 664.56 C\r
-302.40 668.30 304.06 669.67 307.80 669.67 C\r
-311.83 669.60 315.43 664.34 315.43 660.31 C\r
-315.43 656.78 314.14 655.27 310.18 655.27 C\r
-@c\r
-307.73 660.10 m\r
-308.74 658.58 310.97 656.64 312.41 656.71 C\r
-315.22 657.00 311.76 662.69 310.75 663.98 c\r
-308.95 666.36 306.94 668.30 305.35 668.09 C\r
-302.54 667.37 306.72 661.46 307.73 660.10 c\r
-@c\r
-B\r
-\r
-@rax %%Note: Object\r
-318.24 619.27 331.27 633.67 @E\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-326.02 619.27 m\r
-321.91 619.27 318.53 624.38 318.38 628.56 C\r
-318.24 632.30 319.90 633.67 323.64 633.67 C\r
-327.67 633.60 331.27 628.34 331.27 624.31 C\r
-331.27 620.78 329.98 619.27 326.02 619.27 C\r
-@c\r
-323.57 624.10 m\r
-324.58 622.58 326.81 620.64 328.25 620.71 C\r
-331.06 621.00 327.60 626.69 326.59 627.98 c\r
-324.79 630.36 322.78 632.30 321.19 632.09 C\r
-318.38 631.37 322.56 625.46 323.57 624.10 c\r
-@c\r
-B\r
-\r
-@rax %%Note: Object\r
-331.20 590.47 344.23 604.87 @E\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-338.98 590.47 m\r
-334.87 590.47 331.49 595.58 331.34 599.76 C\r
-331.20 603.50 332.86 604.87 336.60 604.87 C\r
-340.63 604.80 344.23 599.54 344.23 595.51 C\r
-344.23 591.98 342.94 590.47 338.98 590.47 C\r
-@c\r
-336.53 595.30 m\r
-337.54 593.78 339.77 591.84 341.21 591.91 C\r
-344.02 592.20 340.56 597.89 339.55 599.18 c\r
-337.75 601.56 335.74 603.50 334.15 603.29 C\r
-331.34 602.57 335.52 596.66 336.53 595.30 c\r
-@c\r
-B\r
-\r
-@rax %%Note: Object\r
-347.04 554.47 360.07 568.87 @E\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-354.82 554.47 m\r
-350.71 554.47 347.33 559.58 347.18 563.76 C\r
-347.04 567.50 348.70 568.87 352.44 568.87 C\r
-356.47 568.80 360.07 563.54 360.07 559.51 C\r
-360.07 555.98 358.78 554.47 354.82 554.47 C\r
-@c\r
-352.37 559.30 m\r
-353.38 557.78 355.61 555.84 357.05 555.91 C\r
-359.86 556.20 356.40 561.89 355.39 563.18 c\r
-353.59 565.56 351.58 567.50 349.99 567.29 C\r
-347.18 566.57 351.36 560.66 352.37 559.30 c\r
-@c\r
-B\r
-\r
-@rax %%Note: Object\r
-361.44 518.47 374.47 532.87 @E\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-369.22 518.47 m\r
-365.11 518.47 361.73 523.58 361.58 527.76 C\r
-361.44 531.50 363.10 532.87 366.84 532.87 C\r
-370.87 532.80 374.47 527.54 374.47 523.51 C\r
-374.47 519.98 373.18 518.47 369.22 518.47 C\r
-@c\r
-366.77 523.30 m\r
-367.78 521.78 370.01 519.84 371.45 519.91 C\r
-374.26 520.20 370.80 525.89 369.79 527.18 c\r
-367.99 529.56 365.98 531.50 364.39 531.29 C\r
-361.58 530.57 365.76 524.66 366.77 523.30 c\r
-@c\r
-B\r
-\r
-@rax %%Note: Object\r
-375.84 482.47 388.87 496.87 @E\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-383.62 482.47 m\r
-379.51 482.47 376.13 487.58 375.98 491.76 C\r
-375.84 495.50 377.50 496.87 381.24 496.87 C\r
-385.27 496.80 388.87 491.54 388.87 487.51 C\r
-388.87 483.98 387.58 482.47 383.62 482.47 C\r
-@c\r
-381.17 487.30 m\r
-382.18 485.78 384.41 483.84 385.85 483.91 C\r
-388.66 484.20 385.20 489.89 384.19 491.18 c\r
-382.39 493.56 380.38 495.50 378.79 495.29 C\r
-375.98 494.57 380.16 488.66 381.17 487.30 c\r
-@c\r
-B\r
-\r
-@rax %%Note: Object\r
-388.80 446.47 401.83 460.87 @E\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-396.58 446.47 m\r
-392.47 446.47 389.09 451.58 388.94 455.76 C\r
-388.80 459.50 390.46 460.87 394.20 460.87 C\r
-398.23 460.80 401.83 455.54 401.83 451.51 C\r
-401.83 447.98 400.54 446.47 396.58 446.47 C\r
-@c\r
-394.13 451.30 m\r
-395.14 449.78 397.37 447.84 398.81 447.91 C\r
-401.62 448.20 398.16 453.89 397.15 455.18 c\r
-395.35 457.56 393.34 459.50 391.75 459.29 C\r
-388.94 458.57 393.12 452.66 394.13 451.30 c\r
-@c\r
-B\r
-\r
-@rax %%Note: Object\r
-419.04 410.47 432.07 424.87 @E\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-426.82 410.47 m\r
-422.71 410.47 419.33 415.58 419.18 419.76 C\r
-419.04 423.50 420.70 424.87 424.44 424.87 C\r
-428.47 424.80 432.07 419.54 432.07 415.51 C\r
-432.07 411.98 430.78 410.47 426.82 410.47 C\r
-@c\r
-424.37 415.30 m\r
-425.38 413.78 427.61 411.84 429.05 411.91 C\r
-431.86 412.20 428.40 417.89 427.39 419.18 c\r
-425.59 421.56 423.58 423.50 421.99 423.29 C\r
-419.18 422.57 423.36 416.66 424.37 415.30 c\r
-@c\r
-B\r
-\r
-@rax %%Note: Object\r
-433.44 374.47 446.47 388.87 @E\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-441.22 374.47 m\r
-437.11 374.47 433.73 379.58 433.58 383.76 C\r
-433.44 387.50 435.10 388.87 438.84 388.87 C\r
-442.87 388.80 446.47 383.54 446.47 379.51 C\r
-446.47 375.98 445.18 374.47 441.22 374.47 C\r
-@c\r
-438.77 379.30 m\r
-439.78 377.78 442.01 375.84 443.45 375.91 C\r
-446.26 376.20 442.80 381.89 441.79 383.18 c\r
-439.99 385.56 437.98 387.50 436.39 387.29 C\r
-433.58 386.57 437.76 380.66 438.77 379.30 c\r
-@c\r
-B\r
-\r
-@rax %%Note: Object\r
-447.84 338.47 460.87 352.87 @E\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-455.62 338.47 m\r
-451.51 338.47 448.13 343.58 447.98 347.76 C\r
-447.84 351.50 449.50 352.87 453.24 352.87 C\r
-457.27 352.80 460.87 347.54 460.87 343.51 C\r
-460.87 339.98 459.58 338.47 455.62 338.47 C\r
-@c\r
-453.17 343.30 m\r
-454.18 341.78 456.41 339.84 457.85 339.91 C\r
-460.66 340.20 457.20 345.89 456.19 347.18 c\r
-454.39 349.56 452.38 351.50 450.79 351.29 C\r
-447.98 350.57 452.16 344.66 453.17 343.30 c\r
-@c\r
-B\r
-\r
-@rax %%Note: Object\r
-462.24 302.47 475.27 316.87 @E\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-470.02 302.47 m\r
-465.91 302.47 462.53 307.58 462.38 311.76 C\r
-462.24 315.50 463.90 316.87 467.64 316.87 C\r
-471.67 316.80 475.27 311.54 475.27 307.51 C\r
-475.27 303.98 473.98 302.47 470.02 302.47 C\r
-@c\r
-467.57 307.30 m\r
-468.58 305.78 470.81 303.84 472.25 303.91 C\r
-475.06 304.20 471.60 309.89 470.59 311.18 c\r
-468.79 313.56 466.78 315.50 465.19 315.29 C\r
-462.38 314.57 466.56 308.66 467.57 307.30 c\r
-@c\r
-B\r
-\r
-@rax %%Note: Object\r
-476.64 266.47 489.67 280.87 @E\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-484.42 266.47 m\r
-480.31 266.47 476.93 271.58 476.78 275.76 C\r
-476.64 279.50 478.30 280.87 482.04 280.87 C\r
-486.07 280.80 489.67 275.54 489.67 271.51 C\r
-489.67 267.98 488.38 266.47 484.42 266.47 C\r
-@c\r
-481.97 271.30 m\r
-482.98 269.78 485.21 267.84 486.65 267.91 C\r
-489.46 268.20 486.00 273.89 484.99 275.18 c\r
-483.19 277.56 481.18 279.50 479.59 279.29 C\r
-476.78 278.57 480.96 272.66 481.97 271.30 c\r
-@c\r
-B\r
-\r
-@rax %%Note: Object\r
-489.60 230.47 502.63 244.87 @E\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-497.38 230.47 m\r
-493.27 230.47 489.89 235.58 489.74 239.76 C\r
-489.60 243.50 491.26 244.87 495.00 244.87 C\r
-499.03 244.80 502.63 239.54 502.63 235.51 C\r
-502.63 231.98 501.34 230.47 497.38 230.47 C\r
-@c\r
-494.93 235.30 m\r
-495.94 233.78 498.17 231.84 499.61 231.91 C\r
-502.42 232.20 498.96 237.89 497.95 239.18 c\r
-496.15 241.56 494.14 243.50 492.55 243.29 C\r
-489.74 242.57 493.92 236.66 494.93 235.30 c\r
-@c\r
-B\r
-\r
-@rax %%Note: Object\r
-512.64 151.20 525.67 165.60 @E\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-520.42 151.20 m\r
-516.31 151.20 512.93 156.31 512.78 160.49 C\r
-512.64 164.23 514.30 165.60 518.04 165.60 C\r
-522.07 165.53 525.67 160.27 525.67 156.24 C\r
-525.67 152.71 524.38 151.20 520.42 151.20 C\r
-@c\r
-517.97 156.02 m\r
-518.98 154.51 521.21 152.57 522.65 152.64 C\r
-525.46 152.93 522.00 158.62 520.99 159.91 c\r
-519.19 162.29 517.18 164.23 515.59 164.02 C\r
-512.78 163.30 516.96 157.39 517.97 156.02 c\r
-@c\r
-B\r
-\r
-@rax %%Note: Object\r
-330.91 72.00 331.20 720.00 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-331.06 72.00 m\r
-331.06 720.00 L\r
-S\r
-\r
-@rax %%Note: Object\r
-345.31 72.00 345.60 720.00 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-345.46 72.00 m\r
-345.46 720.00 L\r
-S\r
-\r
-@rax %%Note: Object\r
-359.71 72.00 360.00 720.00 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-359.86 720.00 m\r
-359.86 72.00 L\r
-S\r
-\r
-@rax %%Note: Object\r
-374.11 72.00 374.40 720.00 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-374.26 72.00 m\r
-374.26 720.00 L\r
-S\r
-\r
-@rax %%Note: Object\r
-388.51 72.00 388.80 720.00 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-388.66 720.00 m\r
-388.66 72.00 L\r
-S\r
-\r
-@rax %%Note: Object\r
-431.71 72.00 432.00 720.00 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-431.86 72.00 m\r
-431.86 720.00 L\r
-S\r
-\r
-@rax %%Note: Object\r
-446.11 72.00 446.40 720.00 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-446.26 720.00 m\r
-446.26 72.00 L\r
-S\r
-\r
-@rax %%Note: Object\r
-460.51 72.00 460.80 720.00 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-460.66 72.00 m\r
-460.66 720.00 L\r
-S\r
-\r
-@rax %%Note: Object\r
-474.91 72.00 475.20 720.00 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-475.06 720.00 m\r
-475.06 72.00 L\r
-S\r
-\r
-@rax %%Note: Object\r
-489.31 72.00 489.60 720.00 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-489.46 72.00 m\r
-489.46 720.00 L\r
-S\r
-\r
-@rax %%Note: Object\r
-504.00 194.47 517.03 208.87 @E\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-511.78 194.47 m\r
-507.67 194.47 504.29 199.58 504.14 203.76 C\r
-504.00 207.50 505.66 208.87 509.40 208.87 C\r
-513.43 208.80 517.03 203.54 517.03 199.51 C\r
-517.03 195.98 515.74 194.47 511.78 194.47 C\r
-@c\r
-509.33 199.30 m\r
-510.34 197.78 512.57 195.84 514.01 195.91 C\r
-516.82 196.20 513.36 201.89 512.35 203.18 c\r
-510.55 205.56 508.54 207.50 506.95 207.29 C\r
-504.14 206.57 508.32 200.66 509.33 199.30 c\r
-@c\r
-B\r
-\r
-@rax %%Note: Object\r
-518.26 144.00 518.54 172.80 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-518.40 144.00 m\r
-518.40 172.80 L\r
-S\r
-\r
-@rax %%Note: Object\r
-503.86 144.00 504.14 172.80 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-504.00 144.00 m\r
-504.00 172.80 L\r
-S\r
-\r
-@rax %%Note: Object\r
-302.26 684.00 302.54 712.80 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-302.40 684.00 m\r
-302.40 712.80 L\r
-S\r
-\r
-@rax %%Note: Object\r
-316.66 648.00 316.94 676.80 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-316.80 648.00 m\r
-316.80 676.80 L\r
-S\r
-\r
-@rax %%Note: Object\r
-316.66 684.00 316.94 712.80 @E\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-316.80 684.00 m\r
-316.80 712.80 L\r
-S\r
-\r
-@rax %%Note: Object\r
-331.20 71.93 395.06 101.38 @E\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-366.12 87.55 m\r
-366.62 85.82 368.57 83.88 370.80 83.88 c\r
-371.95 83.88 374.11 84.53 374.98 86.54 c\r
-375.26 87.34 376.13 87.05 375.19 85.39 c\r
-373.54 82.01 369.22 80.42 365.26 83.09 c\r
-364.10 83.66 362.66 85.32 362.09 86.76 C\r
-356.62 85.68 L\r
-358.06 84.02 359.42 82.58 361.51 80.86 c\r
-365.47 77.47 371.66 75.89 375.98 80.14 c\r
-378.86 83.09 379.08 87.12 378.22 90.00 C\r
-366.12 87.55 L\r
-@c\r
-365.98 88.70 m\r
-377.86 91.08 L\r
-376.78 93.82 374.11 94.90 371.59 94.68 c\r
-368.42 94.32 365.98 92.09 365.98 88.70 C\r
-@c\r
-349.92 85.54 m\r
-348.55 87.77 342.36 91.80 338.69 90.94 c\r
-336.46 90.65 336.46 88.20 338.69 86.83 c\r
-341.57 85.10 346.54 84.10 349.92 85.54 C\r
-@c\r
-350.86 84.53 m\r
-342.58 82.22 334.80 83.88 332.28 87.19 c\r
-331.20 88.63 331.34 88.92 332.42 89.78 c\r
-339.34 94.68 349.99 92.95 355.68 86.69 C\r
-361.80 87.91 L\r
-360.07 97.34 375.19 101.38 378.94 91.37 C\r
-384.48 92.23 389.66 94.97 392.83 90.65 c\r
-395.06 87.55 394.42 83.52 392.40 81.43 c\r
-391.03 79.99 388.51 79.13 386.06 80.86 c\r
-382.75 83.45 385.49 87.70 389.16 86.98 c\r
-391.25 86.54 391.75 84.53 391.61 83.45 C\r
-394.42 85.39 392.62 90.43 389.81 91.30 c\r
-386.64 92.45 383.26 91.01 379.44 90.14 C\r
-381.89 79.92 370.73 71.93 361.08 76.32 c\r
-357.55 77.98 354.02 81.29 350.86 84.53 C\r
-@c\r
-B\r
-\r
-@rax %%Note: Object\r
-439.13 72.00 482.40 100.80 @E\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-0 J 0 j [] 0 d 0 R 0 @G\r
-1.00 1.00 1.00 0.21 K\r
-0 0.22 0.22 0.00 @w\r
-481.25 72.00 m\r
-478.51 75.24 476.28 77.98 473.62 80.42 c\r
-471.02 82.58 468.29 84.53 465.12 85.82 c\r
-461.81 87.34 457.13 88.70 452.81 88.78 c\r
-449.64 88.78 446.98 88.49 444.96 87.41 c\r
-443.09 86.33 441.58 84.67 441.58 82.44 c\r
-441.58 79.99 442.66 76.75 446.33 75.60 c\r
-447.62 75.24 448.13 76.10 448.13 76.61 c\r
-448.27 77.04 447.70 77.83 447.70 78.70 c\r
-447.70 79.70 448.27 80.57 448.92 81.29 c\r
-449.71 81.86 450.94 82.30 451.94 82.30 c\r
-454.54 82.30 456.77 80.42 456.77 77.98 c\r
-456.77 76.61 456.19 75.53 455.26 74.66 c\r
-454.32 73.73 452.74 73.01 450.79 73.01 c\r
-447.84 73.01 444.74 74.45 442.87 76.39 c\r
-441.86 77.40 441.29 78.70 440.71 79.85 c\r
-439.13 84.24 440.06 87.84 443.38 90.86 c\r
-445.61 93.02 448.78 94.54 453.46 94.54 c\r
-457.92 94.54 463.32 92.81 468.50 89.21 c\r
-470.74 87.62 472.82 85.46 474.84 82.87 c\r
-477.50 79.78 479.88 76.10 482.40 72.14 C\r
-481.25 72.00 L\r
-@c\r
-446.90 96.26 m\r
-446.04 96.26 445.25 96.48 444.74 96.98 c\r
-444.31 97.34 444.02 97.85 444.02 98.57 c\r
-444.02 99.14 444.31 99.72 444.89 100.01 c\r
-445.25 100.44 446.04 100.80 446.98 100.80 c\r
-447.91 100.80 448.56 100.44 449.14 99.94 c\r
-449.64 99.65 449.86 99.07 449.86 98.42 c\r
-449.86 97.92 449.50 97.34 449.14 96.98 c\r
-448.56 96.55 447.84 96.26 446.90 96.26 c\r
-@c\r
-458.57 96.26 m\r
-457.56 96.26 456.98 96.55 456.41 96.98 c\r
-455.90 97.34 455.69 97.85 455.69 98.57 c\r
-455.69 99.14 455.98 99.79 456.55 100.15 c\r
-457.06 100.44 457.70 100.80 458.57 100.80 c\r
-459.50 100.80 460.37 100.44 460.80 99.94 c\r
-461.30 99.65 461.52 99.07 461.52 98.57 c\r
-461.52 97.92 461.30 97.34 460.80 96.98 c\r
-460.22 96.55 459.50 96.26 458.57 96.26 c\r
-@c\r
-B\r
-\r
-@rax 513.36 129.60 522.07 142.42 @E\r
-[0.00001 0.07199 -0.07199 0.00001 522.00000 129.59999] @tm\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-e\r
-/_R1-Helvetica 167.00 z\r
-0 0 (36) @t\r
-T\r
-@rax 506.16 180.00 514.87 192.82 @E\r
-[0.00001 0.07199 -0.07199 0.00001 514.79999 179.99998] @tm\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-e\r
-/_R1-Helvetica 167.00 z\r
-0 0 (38) @t\r
-T\r
-@rax 491.76 216.00 500.40 227.09 @E\r
-[0.00001 0.07199 -0.07199 0.00001 500.39996 215.99998] @tm\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-e\r
-/_R1-Helvetica 167.00 z\r
-0 0 (41) @t\r
-T\r
-@rax 477.43 252.00 486.07 264.82 @E\r
-[0.00001 0.07199 -0.07199 0.00001 485.99997 251.99998] @tm\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-e\r
-/_R1-Helvetica 167.00 z\r
-0 0 (45) @t\r
-T\r
-@rax 462.96 288.00 471.67 300.82 @E\r
-[0.00001 0.07199 -0.07199 0.00001 471.59998 288.00000] @tm\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-e\r
-/_R1-Helvetica 167.00 z\r
-0 0 (48) @t\r
-T\r
-@rax 448.56 324.00 457.27 336.74 @E\r
-[0.00001 0.07199 -0.07199 0.00001 457.19998 324.00000] @tm\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-e\r
-/_R1-Helvetica 167.00 z\r
-0 0 (52) @t\r
-T\r
-@rax 434.23 360.00 442.87 372.82 @E\r
-[0.00001 0.07199 -0.07199 0.00001 442.79999 359.99997] @tm\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-e\r
-/_R1-Helvetica 167.00 z\r
-0 0 (55) @t\r
-T\r
-@rax 419.76 396.00 428.47 408.82 @E\r
-[0.00001 0.07199 -0.07199 0.00001 428.39999 395.99997] @tm\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-e\r
-/_R1-Helvetica 167.00 z\r
-0 0 (59) @t\r
-T\r
-@rax 390.96 432.00 399.67 444.74 @E\r
-[0.00001 0.07199 -0.07199 0.00001 399.59998 431.99997] @tm\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-e\r
-/_R1-Helvetica 167.00 z\r
-0 0 (62) @t\r
-T\r
-@rax 376.56 468.00 385.27 480.82 @E\r
-[0.00001 0.07199 -0.07199 0.00001 385.19998 467.99997] @tm\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-e\r
-/_R1-Helvetica 167.00 z\r
-0 0 (65) @t\r
-T\r
-@rax 362.16 504.00 370.87 516.82 @E\r
-[0.00001 0.07199 -0.07199 0.00001 370.79999 503.99997] @tm\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-e\r
-/_R1-Helvetica 167.00 z\r
-0 0 (69) @t\r
-T\r
-@rax 347.76 540.00 356.40 552.74 @E\r
-[0.00001 0.07199 -0.07199 0.00001 356.39999 540.00000] @tm\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-e\r
-/_R1-Helvetica 167.00 z\r
-0 0 (72) @t\r
-T\r
-@rax 333.36 576.00 342.07 588.82 @E\r
-[0.00001 0.07199 -0.07199 0.00001 342.00000 576.00000] @tm\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-e\r
-/_R1-Helvetica 167.00 z\r
-0 0 (76) @t\r
-T\r
-@rax 318.96 604.80 327.67 617.62 @E\r
-[0.00001 0.07199 -0.07199 0.00001 327.59998 604.79999] @tm\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-e\r
-/_R1-Helvetica 167.00 z\r
-0 0 (79) @t\r
-T\r
-@rax 304.56 640.80 313.27 653.62 @E\r
-[0.00001 0.07199 -0.07199 0.00001 313.19998 640.79999] @tm\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-e\r
-/_R1-Helvetica 167.00 z\r
-0 0 (83) @t\r
-T\r
-@rax 290.16 676.80 298.87 689.62 @E\r
-[0.00001 0.07199 -0.07199 0.00001 298.79999 676.79999] @tm\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-e\r
-/_R1-Helvetica 167.00 z\r
-0 0 (86) @t\r
-T\r
-@rax 187.20 381.53 226.15 388.87 @E\r
-[0.07199 0.00000 0.00000 0.07199 187.20000 381.59998] @tm\r
- 0 O 0 @g\r
-1.00 1.00 1.00 0.21 k\r
-e\r
-/_R1-Helvetica 139.00 z\r
-0 0 (Middle C) @t\r
-T\r
-@rs @rs\r
-/$ctm matrix currentmatrix def\r
-%EndTile\r
-%EndColorLayer\r
-@rs\r
-@rs\r
-%EndPage\r
-%%Trailer\r
-end\r
-%%DocumentProcessColors: Cyan Magenta Yellow Black \r
-%%DocumentFonts: Helvetica \r
-%%DocumentSuppliedResources: procset wCorel4Dict\r
-EJ RS\r
-%%PageTrailer\r
-2397 3162 0 0 CB\r
-%%Trailer\r
-SVDoc restore\r
-end\r
-%%DocumentSuppliedResources: procset Win35Dict 3 1\r
-\r
-%%DocumentNeededResources: \r
-%%EOF\r
-\r
diff --git a/16/PCGPE10/MODEX.TXT b/16/PCGPE10/MODEX.TXT
deleted file mode 100644 (file)
index 009aaf2..0000000
+++ /dev/null
@@ -1,720 +0,0 @@
-\r
-                      ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-                      ³ INTRODUCTION TO MODE X ³\r
-                      ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-                 By Robert Schmidt <robert@stud.unit.no>\r
-\r
-\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ XINTRO18.TXT ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-Title:          INTRODUCTION TO MODE X\r
-\r
-Version:        1.8\r
-\r
-Author:         Robert Schmidt <robert@stud.unit.no>\r
-\r
-Copyright:      (C) 1993 of Ztiff Zox Softwear - refer to Status below.\r
-\r
-Last revision:  25-Nov-93 (Modified for the PCGPE 17-Apr-94)\r
-\r
-Figures:        1. M13ORG - memory organization in mode 13h\r
-                2. MXORG - memory organization in unchained modes\r
-                (Both files are appended to the end of this document)\r
-\r
-                The figures are available as 7-bit ASCII text (ASC) files.\r
-\r
-Status:         This article, its associated figures and source listings\r
-                named above, are all donated to the public domain.\r
-                Do with it whatever you like, but give credit where\r
-                credit is due.\r
-\r
-                The standard disclaimer applies.\r
-\r
-Index:          0. ABSTRACT\r
-                1. INTRODUCTION TO THE VGA AND ITS 256-COLOR MODE\r
-                2. GETTING MORE PAGES AND PUTTING YOUR FIRST PIXEL\r
-                3. THE ROAD FROM HERE\r
-                4. BOOKS ON THE SUBJECT\r
-                5. BYE - FOR NOW\r
-\r
-\r
-0. ABSTRACT\r
-\r
-This text gives a fairly basic, yet technical, explanation to what, why\r
-and how Mode X is.  It first tries to explain the layout of the VGA\r
-memory and the shortcomings of the standard 320x200 256-color mode,\r
-then gives instructions on how one can progress from mode 13h to a\r
-multipage, planar 320x200 256-color mode, and from there to the\r
-quasi-standard 320x240 mode, known as Mode X.\r
-\r
-A little experience in programming the standard VGA mode 13h\r
-(320x200 in 256 colors) is assumed.  Likewise a good understanding of\r
-hexadecimal notation and the concepts of segments and I/O ports is\r
-assumed.  Keep a VGA reference handy, which at least should have\r
-definitions of the VGA registers at bit level.\r
-\r
-Throughout the article, a simple graphics library for unchained (planar)\r
-256-color modes is developed.  The library supports the 320x200 and\r
-320x240 modes, active and visible pages, and writing and reading\r
-individual pixels.\r
-\r
-\r
-1. INTRODUCTION TO THE VGA AND ITS 256-COLOR MODE\r
-\r
-Since its first appearance on the motherboards of the IBM PS/2 50, 60\r
-and 80 models in 1987, the Video Graphics Array has been the de facto\r
-standard piece of graphics hardware for IBM and compatible personal\r
-computers.  The abbreviation, VGA, was to most people synonymous with\r
-acceptable resolution (640x480 pixels), and a stunning rainbow of colors\r
-(256 from a palette of 262,144), at least compared to the rather gory\r
-CGA and EGA cards.\r
-\r
-Sadly, to use 256 colors, the VGA BIOS limited the users to 320x200\r
-pixels, i.e. the well-known mode 13h.  This mode has one good and one\r
-bad asset.  The good one is that each one of the 64,000 pixels is easily\r
-addressable in the 64 Kb video memory segment at 0A000h.  Simply calculate\r
-the offset using this formula:\r
-\r
-offset = (y * 320) + x;\r
-\r
-Set the byte at this address (0A000h:offset) to the color you want, and\r
-the pixel is there.  Reading a pixel is just as simple: just read the\r
-corresponding byte.  This was heaven, compared to the havoc of planes and\r
-masking registers needed in 16-color modes.  Suddenly, the distance from a\r
-graphics algorithm on paper to an implemented graphics routine in assembly\r
-was cut down to a fraction.  The results were impressively fast, too!\r
-\r
-The bad asset is that mode 13h is also limited to only one page, i.e.\r
-the VGA can hold only one screenful at any one time (plus 1536 pixels, or\r
-about four lines).  Most 16-color modes let the VGA hold more than one page,\r
-and this enables you to show one of the pages to the user, while drawing on\r
-another page in the meantime.  Page flipping is an important concept in making\r
-flicker free animations.  Nice looking and smooth scrolling is also almost\r
-impossible in mode 13h using plain VGA hardware.\r
-\r
-Now, the alert reader might say: "Hold on a minute!  If mode 13h enables\r
-only one page, this means that there is memory for only one page.  But I\r
-know for a fact that all VGAs have at least 256 Kb RAM, and one 320x200\r
-256-color page should consume only 320*200=64000 bytes, which is less\r
-than 64 Kb.  A standard VGA should room a little more than four 320x200\r
-pages!"  Quite correct, and to see how the BIOS puts this limitation on\r
-mode 13h, I'll elaborate a little on the memory organization of the VGA.\r
-\r
-The memory is separated into four bit planes.  The reason for this stems\r
-from the EGA, where graphics modes were 16-color.  Using bit planes, the\r
-designers chose to let each pixel on screen be addressable by a single\r
-bit in a single byte in the video segment.  Assuming the palette has\r
-not been modified from the default, each plane represent one of the EGA\r
-primary colors: red, green, blue and intensity.  When modifying the bit\r
-representing a pixel, the Write Plane Enable register is set to the\r
-wanted color.  Reading is more complex and slower, since you can\r
-only read from a single plane at a time, by setting the Read Plane\r
-Select register.  Now, since each address in the video segment can\r
-access 8 pixels, and there are 64 Kb addresses, 8 * 65,536 = 524,288\r
-16-color pixels can be accessed.  In a 320x200 16-color mode, this makes\r
-for about 8 (524,288/(320*200)) pages, in 640x480 you get nearly 2\r
-(524,288/(640*480)) pages.\r
-\r
-In a 256-color mode, the picture changes subtly.  The designers decided\r
-to fix the number of bit planes to 4, so extending the logic above to 8\r
-planes and 256 colors does not work.  Instead, one of their goals was to\r
-make the 256-color mode as easily accessible as possible.  Comparing the\r
-8 pixels/address in 16-color modes to the 1-to-1 correspondence of\r
-pixels and addresses of mode 13h, one can say that they have\r
-succeeded, but at a certain cost.  For reasons I am not aware of, the\r
-designers came up with the following effective, but memory-wasting\r
-scheme:\r
-\r
-The address space of mode 13h is divided evenly across the four bit\r
-planes.  When an 8-bit color value is written to a 16-bit address in the\r
-VGA segment, a bit plane is automatically selected by the 2 least\r
-significant bits of the address.  Then all 8 bits of the data is written\r
-to the byte at the 16-bit address in the selected bitplane (have a look at\r
-figure 1).  Reading works exactly the same way.  Since the bit planes are so\r
-closely tied to the address, only every fourth byte in the video memory is\r
-accessible, and 192 Kb of a 256 Kb VGA go to waste.  Eliminating the\r
-need to bother about planes sure is convenient and beneficial, but to\r
-most people the loss of 3/4 of the total VGA memory sounds just hilarious.\r
-\r
-To accomodate this new method of accessing video memory, the VGA\r
-designers introduced a new configuration bit called Chain-4, which\r
-resides as bit number 3 in index 4 of the Sequencer.  In 16-color modes,\r
-the default state for this bit is off (zero), and the VGA operates as\r
-described earlier.  In the VGA's standard 256-color mode, mode 13h, this\r
-bit is turned on (set to one), and this turns the tieing of bit\r
-planes and memory address on.\r
-\r
-In this state, the bit planes are said to be chained together, thus mode\r
-13h is often called a _chained mode_.\r
-\r
-Note that Chain-4 in itself is not enough to set a 256-color mode -\r
-there are other registers which deals with the other subtle changes in\r
-nature from 16 to 256 colors.  But, as we now will base our work with\r
-mode X on mode 13h, which already is 256-color, we won't bother about\r
-these for now.\r
-\r
-\r
-\r
-2. GETTING MORE PAGES AND PUTTING YOUR FIRST PIXEL\r
-\r
-The observant reader might at this time suggest that clearing the\r
-Chain-4 bit after setting mode 13h will give us access to all 256 Kb of\r
-video memory, as the two least significant bits of the byte address\r
-won't be `wasted' on selecting a bit plane.  This is correct.  You might\r
-also start feeling a little uneasy, because something tells you that\r
-you'll instantly loose the simple addressing scheme of mode 13h.  Sadly,\r
-that is also correct.\r
-\r
-At the moment Chain-4 is cleared, each byte offset addresses *four*\r
-sequential pixels, corresponding to the four planes addressed in 16-color\r
-modes.  Every fourth pixel belong in the same plane.  Before writing to a byte\r
-offset in the video segment, you should make sure that the 4-bit mask in the\r
-Write Plane Enable register is set correctly, according to which of the four\r
-addressable pixels you want to modify.  In essence, it works like a 16-color\r
-mode with a twist.  See figure 2.\r
-\r
-So, is this mode X?  Not quite.  We need to elaborate to the VGA how to\r
-fetch data for refreshing the monitor image.  Explaining the logic\r
-behind this is beyond the scope of this getting-you-started text, and it\r
-wouldn't be very interesting anyway.  Also, mode 13h has only 200 lines,\r
-while I promised 240 lines.  I'll fix that later below.  Here is the minimum\r
-snippet of code to initiate the 4 page variant of mode 13h (320x200), written\r
-in plain C, using some DOS specific features (see header for a note about the\r
-sources included):\r
-\r
-----8<-------cut begin------\r
-\r
-/* width and height should specify the mode dimensions.  widthBytes\r
-   specify the width of a line in addressable bytes. */\r
-\r
-int width, height, widthBytes;\r
-\r
-/* actStart specifies the start of the page being accessed by\r
-   drawing operations.  visStart specifies the contents of the Screen\r
-   Start register, i.e. the start of the visible page */\r
-\r
-unsigned actStart, visStart;\r
-\r
-/*\r
- * set320x200x256_X()\r
- *      sets mode 13h, then turns it into an unchained (planar), 4-page\r
- *      320x200x256 mode.\r
- */\r
-\r
-set320x200x256_X()\r
-        {\r
-\r
-        union REGS r;\r
-\r
-        /* Set VGA BIOS mode 13h: */\r
-\r
-        r.x.ax = 0x0013;\r
-        int86(0x10, &r, &r);\r
-\r
-        /* Turn off the Chain-4 bit (bit 3 at index 4, port 0x3c4): */\r
-\r
-        outport(SEQU_ADDR, 0x0604);\r
-\r
-        /* Turn off word mode, by setting the Mode Control register\r
-           of the CRT Controller (index 0x17, port 0x3d4): */\r
-\r
-        outport(CRTC_ADDR, 0xE317);\r
-\r
-        /* Turn off doubleword mode, by setting the Underline Location\r
-           register (index 0x14, port 0x3d4): */\r
-\r
-        outport(CRTC_ADDR, 0x0014);\r
-\r
-        /* Clear entire video memory, by selecting all four planes, then\r
-           writing 0 to the entire segment. */\r
-\r
-        outport(SEQU_ADDR, 0x0F02);\r
-        memset(vga+1, 0, 0xffff); /* stupid size_t exactly 1 too small */\r
-        vga[0] = 0;\r
-\r
-        /* Update the global variables to reflect the dimensions of this\r
-           mode.  This is needed by most future drawing operations. */\r
-\r
-        width   = 320;\r
-        height  = 200;\r
-\r
-        /* Each byte addresses four pixels, so the width of a scan line\r
-           in *bytes* is one fourth of the number of pixels on a line. */\r
-\r
-        widthBytes = width / 4;\r
-\r
-        /* By default we want screen refreshing and drawing operations\r
-           to be based at offset 0 in the video segment. */\r
-\r
-        actStart = visStart = 0;\r
-\r
-        }\r
-\r
-----8<-------cut end------\r
-\r
-As you can see, I've already provided some of the mechanics needed to\r
-support multiple pages, by providing the actStart and visStart variables.\r
-Selecting pages can be done in one of two contexts:\r
-\r
-        1) selecting the visible page, i.e. which page is visible on\r
-           screen, and\r
-\r
-        2) selecting the active page, i.e. which page is accessed by\r
-           drawing operations\r
-\r
-Selecting the active page is just a matter of offsetting our graphics\r
-operations by the address of the start of the page, as demonstrated in\r
-the put pixel routine below.  Selecting the visual page must be passed\r
-in to the VGA, by setting the Screen Start register.  Sadly enough, the\r
-resolution of this register is limited to one addressable byte, which\r
-means four pixels in unchained 256-color modes.  Some further trickery is \r
-needed for 1-pixel smooth, horizontal scrolling, but I'll make that a subject\r
-for later.  The setXXXStart() functions provided here accept byte\r
-offsets as parameters, so they'll work in any mode.  If widthBytes and\r
-height are set correctly, so will the setXXXPage() functions.\r
-\r
-----8<-------cut begin------\r
-\r
-/*\r
- * setActiveStart() tells our graphics operations which address in video\r
- * memory should be considered the top left corner.\r
- */\r
-\r
-setActiveStart(unsigned offset)\r
-        {\r
-        actStart = offset;\r
-        }\r
-\r
-/*\r
- * setVisibleStart() tells the VGA from which byte to fetch the first\r
- * pixel when starting refresh at the top of the screen.  This version\r
- * won't look very well in time critical situations (games for\r
- * instance) as the register outputs are not synchronized with the\r
- * screen refresh.  This refresh might start when the high byte is\r
- * set, but before the low byte is set, which produces a bad flicker.\r
- * I won't bother with this now.\r
- */\r
-\r
-setVisibleStart(unsigned offset)\r
-        {\r
-        visStart = offset;\r
-        outport(CRTC_ADDR, 0x0C);               /* set high byte */\r
-        outport(CRTC_ADDR+1, visStart >> 8);\r
-        outport(CRTC_ADDR, 0x0D);               /* set low byte */\r
-        outport(CRTC_ADDR+1, visStart & 0xff);\r
-        }\r
-\r
-/*\r
- * setXXXPage() sets the specified page by multiplying the page number\r
- * with the size of one page at the current resolution, then handing the\r
- * resulting offset value over to the corresponding setXXXStart()\r
- * function.  The first page number is 0.\r
- */\r
-\r
-setActivePage(int page)\r
-        {\r
-        setActiveStart(page * widthBytes * height);\r
-        }\r
-\r
-setVisiblePage(int page)\r
-        {\r
-        setVisibleStart(page * widthBytes * height);\r
-        }\r
-\r
-----8<-------cut end------\r
-\r
-Due to the use of bit planes, the graphics routines tend to get more\r
-complex than in mode 13h, and your first versions will generally tend to\r
-be a little slower than mode 13h algorithms.  Here's a put pixel routine\r
-for any unchained 256-color mode (it assumes that the 'width' variable\r
-from the above code is set correctly).  Optimizing is left as an exercise\r
-to you, the reader.  This will be the only drawing operation I'll cover\r
-in this article, but all general primitives like lines and circles can be \r
-based on this routine.  (You'll probably not want to do that though, due\r
-to the inefficiency.)\r
-\r
-----8<-------cut begin------\r
-\r
-putPixel_X(int x, int y, char color)\r
-        {\r
-\r
-        /* Each address accesses four neighboring pixels, so set\r
-           Write Plane Enable according to which pixel we want\r
-           to modify.  The plane is determined by the two least\r
-           significant bits of the x-coordinate: */\r
-\r
-        outportb(0x3c4, 0x02);\r
-        outportb(0x3c5, 0x01 << (x & 3));\r
-\r
-        /* The offset of the pixel into the video segment is\r
-           offset = (width * y + x) / 4, and write the given\r
-           color to the plane we selected above.  Heed the active\r
-           page start selection. */\r
-\r
-        vga[(unsigned)(widthBytes * y) + (x / 4) + actStart] = color;\r
-\r
-        }\r
-\r
-char getPixel_X(int x, int y)\r
-        {\r
-\r
-        /* Select the plane from which we must read the pixel color: */\r
-\r
-        outport(GRAC_ADDR, 0x04);\r
-        outport(GRAC_ADDR+1, x & 3);\r
-\r
-        return vga[(unsigned)(widthBytes * y) + (x / 4) + actStart];\r
-\r
-        }\r
-\r
-----8<-------cut end------\r
-\r
-\r
-However, by now you should be aware of that the Write Plane Enable\r
-register isn't limited to selecting just one bit plane, like the\r
-Read Plane Select register is.  You can enable any combination of all\r
-four to be written.  This ability to access 4 pixels with one\r
-instruction helps quadrupling the speed in certain respects, especially when \r
-drawing horizontal lines and filling polygons of a constant color.  Also, most \r
-block algorithms can be optimized in various ways so that they need only\r
-a constant number of OUTs (typically four) to the Write Plane Enable\r
-register.  OUT is a relatively slow instruction.\r
-\r
-The gained ability to access the full 256 Kb of memory on a standard\r
-VGA enables you to do paging and all the goodies following from that:\r
-smooth scrolling over large maps, page flipping for flicker free\r
-animation... and I'll leave something for your own imagination.\r
-\r
-In short, the stuff gained from unchaining mode 13h more than \r
-upweighs the additional complexity of using a planar mode.  \r
-\r
-Now, the resolution of the mode is of little interest in this\r
-context.  Nearly any 256-color resolution from (about) 80x8 to 400x300\r
-is available for most VGAs.  I'll dwell particularly by 320x240, as this\r
-is the mode that Michael Abrash introduced as 'Mode X' in his DDJ\r
-articles.  It is also the resolution that most people refer to when\r
-using that phrase.\r
-\r
-The good thing about the 320x240 mode is that the aspect ratio is\r
-1:1, which means that each pixel is 'perfectly' square, i.e. not\r
-rectangular like in 320x200.  An ellipse drawn with the same number of\r
-pixels along both main axes will look like a perfect circle in 320x240,\r
-but like a subtly tall ellipse in 320x200.\r
-\r
-Here's a function which sets the 320x240 mode.  You'll notice that\r
-it depends on the first piece of code above:\r
-\r
-----8<-------cut begin------\r
-\r
-set320x240x256_X()\r
-        {\r
-\r
-        /* Set the unchained version of mode 13h: */\r
-\r
-        set320x200x256_X();\r
-\r
-        /* Modify the vertical sync polarity bits in the Misc. Output\r
-           Register to achieve square aspect ratio: */\r
-\r
-        outportb(0x3C2, 0xE3);\r
-\r
-        /* Modify the vertical timing registers to reflect the increased\r
-           vertical resolution, and to center the image as good as\r
-           possible: */\r
-\r
-        outport(0x3D4, 0x2C11);         /* turn off write protect */\r
-        outport(0x3D4, 0x0D06);         /* vertical total */\r
-        outport(0x3D4, 0x3E07);         /* overflow register */\r
-        outport(0x3D4, 0xEA10);         /* vertical retrace start */\r
-        outport(0x3D4, 0xAC11);         /* vertical retrace end AND wr.prot */\r
-        outport(0x3D4, 0xDF12);         /* vertical display enable end */\r
-        outport(0x3D4, 0xE715);         /* start vertical blanking */\r
-        outport(0x3D4, 0x0616);         /* end vertical blanking */\r
-\r
-        /* Update mode info, so future operations are aware of the\r
-           resolution: */\r
-\r
-        height = 240;\r
-\r
-        }\r
-\r
-----8<-------cut end------\r
-\r
-\r
-As you've figured out, this mode will be completely compatible with the\r
-utility functions presented earlier, thanks to the global variable\r
-'height'.  Boy, am I foreseeing or what!\r
-\r
-Other resolutions are achieved through giving other values to the sync\r
-timing registers of the VGA, but this is quite a large and complex\r
-subject, so I'll postpone this to later, if ever.\r
-\r
-Anyway, I hope I've helped getting you started using mode X.  As far as\r
-I know, the two modes I've used above should work on *any* VGA and Super\r
-VGA available, so this is pretty stable stuff.  Let me know of any \r
-trouble, and -\r
-                        good luck!\r
-\r
-\r
-\r
-3. THE ROAD FROM HERE\r
-\r
-I'm providing information on various libraries and archives which relate\r
-to what this article deals with.  If you want me to add anything to this\r
-list (for future articles), let me know, although I can't promise anything.\r
-I am assuming you have ftp access.\r
-\r
-\r
-wuarchive.wustl.edu:/pub/MSDOS_UPLOADS/programming/xlib06.zip\r
-\r
-This is the current de facto C/assembler library for programming\r
-unchained modes (do not confuse with a X Windows library).  All sources\r
-are included, and the library is totally free.  It has functions for\r
-pixels, lines, circles, bezier curves, mouse handling, sprites (bitmaps),\r
-compiled bitmaps, and supports a number of resolutions.  The version number\r
-('06') is current as of November 1993.\r
-\r
-\r
-graphprg.zip\r
-\r
-Michael Abrash' articles in Doctor Dobbs Journal is always mentioned\r
-with awe.  In this 350 Kb archive, most of his interesting stuff has\r
-been gathered.  Read about Mode X development and techniques from month\r
-to month.  Included is also all the individual source code snippets from\r
-each article, and also the full XSHARP library providing linedrawing,\r
-polygons, bitmaps, solid 3D projection and speedy rendering, and even an\r
-implementation of 2D texture mapping (can be used for quasi-3D texture\r
-mapping), plus an article on assembly optimization on the i86 processor\r
-family.  Definitely recommended.\r
-\r
-\r
-oak.oakland.edu:/pub/msdos/vga/vgadoc2.zip\r
-\r
-This is a bare bones VGA register reference.  It also contains register\r
-references for the CGA, EGA and Hercules cards, in addition to dozens of\r
-SuperVGAs.  Check out the BOOKS section for some decent VGA references\r
-though - you don't want to start tweaking without a real one.\r
-\r
-\r
-wuarchive.wustl.edu:/pub/MSDOS_UPLOADS/programming/tweak15b.zip\r
-\r
-TWEAK might be of interest to the more adventurous reader.  TWEAK lets you\r
-play around with the registers of the VGA in an interactive manner.\r
-Various testing screens for viewing your newmade modes are applied at\r
-the press of a key.  Version 1.5 adds a test screen which autodetects your \r
-graphics mode and displays various information about resolutions etc.\r
-Keep a VGA reference handy.  Don't try it if this is the first time you've \r
-heard of 'registers' or 'mode X' or 'tweaking'.  I was planning a version\r
-based on the Turbo Vision interface, but time has been short.  Maybe later!\r
-\r
-\r
-\r
-\r
-4. BOOKS ON THE SUBJECT\r
-\r
-Extremely little has been published in written form about using\r
-'Mode X'-style modes.  Below are some books which cover VGA programming\r
-at varying degrees of technical level, but the only one to mention\r
-unchained modes and Mode X, is Michael Abrash'.  I'd get one of the VGA\r
-references first, though.\r
-\r
-  o  George Sutty & Steve Blair : "Advanced Pogrammer's Guide to the\r
-     EGA/VGA" from Brady.  A bit old perhaps, but covers all *standard*\r
-     EGA/VGA registers, and discusses most BIOS functions and other\r
-     operations.  Contains disk with C/Pascal/assembler source code.\r
-     There's a sequel out for SuperVGAs, which I haven't seen.\r
-\r
-  o  Michael Abrash : "Power Graphics Programming" from QUE/Programmer's\r
-     Journal.  Collections of (old) articles from Programmer's Journal on\r
-     EGA/VGA, read modes and write modes, animation, tweaking (320x400\r
-     and 360x480).  His newer ravings in DDJ covers fast 256-color\r
-     bitmaps, compiled bitmaps, polygons, 3D graphics, texture mapping\r
-     among other stuff.\r
-\r
-  o  Richard F. Ferraro : "Programmer's Guide to the EGA and VGA video\r
-     cards including Super VGA".  I don't have this one, but heard it's\r
-     nice.  Detailed coverage of all EGA/VGA registers.  The Super VGA\r
-     reference makes it attractive.\r
-\r
-  o  Richard Wilton : "Programmer's Guide to PC & PS/2 Video Systems"\r
-     Less technical, more application/algorithm oriented.  Nice enough,\r
-     even though it is a bit outdated, in that he discusses CGA and\r
-     Hercules cards just as much as EGA/VGA.\r
-\r
-\r
-\r
-\r
-5. BYE - FOR NOW\r
-\r
-I am considering writing a text describing in more detail the process of\r
-using TWEAK to achieve the VGA resolution you want or need.  However, I\r
-thought I'd let this document go first, and see if I get any reactions.\r
-If I don't, I'll stop.  Feel free to forward any suggestions,\r
-criticisms, bombs and beers.\r
-\r
-I can be reached via:\r
-\r
-  o  e-mail: robert@stud.unit.no\r
-\r
-  o  land mail:\r
-\r
-     Robert Schmidt\r
-     Stud.post 170\r
-     NTH\r
-     N-7034 Trondheim\r
-     NORWAY\r
-\r
-Nothing would encourage or please me more than a postcard from where you\r
-live!\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ M1ORG.ASC ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-Figure 1: Memory organization in mode 13h (ASCII version)\r
-          by Robert Schmidt\r
-          (C) 1993 Ztiff Zox Softwear\r
-\r
-a. Imagine that the top of the screen looks like this (pixel values are\r
-   represented by color digits 0-9 for simplicity - actual colors may\r
-   range from 0 to 255) - a screen width of 320 pixels is assumed:\r
-\r
-    address:  0         10                310      319\r
-             ----------------------------------------\r
-             |0123456789012345    .....   0123456789|\r
-             |                                      |\r
-             |                                      |\r
-             |\r
-\r
-b. In VGA memory, the screen is represented as follows (question marks\r
-   represent unused bytes):\r
-\r
-   Plane 0:\r
-\r
-    address:  0         10                310      319\r
-             ----------------------------------------\r
-             |0???4???8???2???    .....   ??2???6???|\r
-             |                                      |\r
-             |                                      |\r
-\r
-   Plane 1:\r
-\r
-    address:  0         10                310      319\r
-             ----------------------------------------\r
-             |?1???5???9???3??    .....   ???3???7??|\r
-             |                                      |\r
-             |                                      |\r
-\r
-   Plane 2:\r
-\r
-    address:  0         10                310      319\r
-             ----------------------------------------\r
-             |??2???6???0???4?    .....   0???4???8?|\r
-             |                                      |\r
-             |                                      |\r
-\r
-   Plane 3:\r
-\r
-    address:  0         10                310      319\r
-             ----------------------------------------\r
-             |???3???7???1???5    .....   ?1???5???9|\r
-             |                                      |\r
-             |                                      |\r
-\r
-   I.e. a plane is selected automatically by the two least significant\r
-   bits of the address of the byte being read from or written two.\r
-   This renders 3/4 of the video memory unavailable and useless, but\r
-   all visible pixels are easily accessed, as each address in the video\r
-   segment provides access to one and ONLY ONE pixel.\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ MXORG.ASC ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-Figure 2: Memory organization in unchained 256-color modes (like\r
-          Mode X) (ASCII version)\r
-          by Robert Schmidt\r
-          (C) 1993 Ztiff Zox Softwear\r
-\r
-\r
-Imagine that the screen looks the same as in figure 1a.  A screen width\r
-of 320 pixels is still assumed.\r
-\r
-In VGA memory, the screen will be represented as follows:\r
-\r
-   Plane 0:\r
-\r
-    address:  0         10                70       79 (NOT 319!)\r
-             ----------------------------------------\r
-             |0482604826048260    .....   0482604826|\r
-             |                                      |\r
-             |                                      |\r
-\r
-   Plane 1:\r
-\r
-    address:  0         10                70       79\r
-             ----------------------------------------\r
-             |1593715937159371    .....   1593715937|\r
-             |                                      |\r
-             |                                      |\r
-\r
-   Plane 2:\r
-\r
-    address:  0         10                70       79\r
-             ----------------------------------------\r
-             |2604826048260482    .....   2604826048|\r
-             |                                      |\r
-             |                                      |\r
-\r
-   Plane 3:\r
-\r
-    address:  0         10                70       79\r
-             ----------------------------------------\r
-             |3715937159371593    .....   3715937159|\r
-             |                                      |\r
-             |                                      |\r
-\r
-Note that if pixel i is in plane p, pixel i+1 is in plane (p+1)%4.\r
-When the planes are unchained, we need to set the Write Plane Enable\r
-register to select which planes should receive the data when writing,\r
-or the Read Plane Select register when reading.  As is evident, one \r
-address in the video segment provides access to no less than FOUR\r
-different pixels.\r
-\r
-ÚÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Zox3D ³\r
-ÀÄÄÄÄÄÄÄÙ\r
-\r
-Available via ftp :\r
-ftp.wustl.edu:/pub/MSDOS_UPLOADS/games/programming/zox3d15.zip\r
-wasp.eng.ufl.edu:/pub/msdos/demos/<somewhere>/zox3d15.zip\r
-\r
-zox3d15.zip contains a demo of my 3D graphics engine.\r
-It resembles Wolf3D, but has a number of additional\r
-features:\r
-\r
-- texture mapped floor and ceiling (sky, in this demo)\r
-- real, recursive MIRRORS!\r
-- partly TRANSPARENT walls\r
-- input from keyboard, joystick and mouse (at the same\r
-  time, too, if you wish)\r
-- controllable camera height - NOT fixed like Wolf3D\r
-- quick resizable window\r
-- online help and fps rating\r
-- advanced collision detection and handling\r
-- supports a variety of tweaked X modes, from 256x256 to 400x300.\r
-\r
-The sky and mirrors have to be seen to be beleived!\r
-\r
-Zox3D does NOT implement objects, like the guards in\r
-Wolf3D, but that should be a breeze to add.\r
-\r
-The complete sources are available.  Read ZOX3D.DOC in\r
-the demo archive for information.\r
-\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-Robert Schmidt - robert@stud.unit.no - Buuud@IRC\r
diff --git a/16/PCGPE10/MODFORM.TXT b/16/PCGPE10/MODFORM.TXT
deleted file mode 100644 (file)
index 69163f7..0000000
+++ /dev/null
@@ -1,523 +0,0 @@
-\r
-Protracker 1.1B Song/Module Format:\r
\r
-Offset  Bytes  Description\r
-   0     20    Songname. Remember to put trailing null bytes at the end...\r
\r
-Information for sample 1-31:\r
\r
-Offset  Bytes  Description\r
-  20     22    Samplename for sample 1. Pad with null bytes.\r
-  42      2    Samplelength for sample 1. Stored as number of words.\r
-               Multiply by two to get real sample length in bytes.\r
-  44      1    Lower four bits are the finetune value, stored as a signed\r
-               four bit number. The upper four bits are not used, and\r
-               should be set to zero.\r
-               Value:  Finetune:\r
-                 0        0\r
-                 1       +1\r
-                 2       +2\r
-                 3       +3\r
-                 4       +4\r
-                 5       +5\r
-                 6       +6\r
-                 7       +7\r
-                 8       -8\r
-                 9       -7\r
-                 A       -6\r
-                 B       -5\r
-                 C       -4\r
-                 D       -3\r
-                 E       -2\r
-                 F       -1\r
\r
-  45      1    Volume for sample 1. Range is $00-$40, or 0-64 decimal.\r
-  46      2    Repeat point for sample 1. Stored as number of words offset\r
-               from start of sample. Multiply by two to get offset in bytes.\r
-  48      2    Repeat Length for sample 1. Stored as number of words in\r
-               loop. Multiply by two to get replen in bytes.\r
\r
-Information for the next 30 samples starts here. It's just like the info for\r
-sample 1.\r
\r
-Offset  Bytes  Description\r
-  50     30    Sample 2...\r
-  80     30    Sample 3...\r
-   .\r
-   .\r
-   .\r
- 890     30    Sample 30...\r
- 920     30    Sample 31...\r
-\r
-Offset  Bytes  Description\r
- 950      1    Songlength. Range is 1-128.\r
- 951      1    Well... this little byte here is set to 127, so that old\r
-               trackers will search through all patterns when loading.\r
-               Noisetracker uses this byte for restart, but we don't.\r
- 952    128    Song positions 0-127. Each hold a number from 0-63 that\r
-               tells the tracker what pattern to play at that position.\r
-1080      4    The four letters "M.K." - This is something Mahoney & Kaktus\r
-               inserted when they increased the number of samples from\r
-               15 to 31. If it's not there, the module/song uses 15 samples\r
-               or the text has been removed to make the module harder to\r
-               rip. Startrekker puts "FLT4" or "FLT8" there instead.\r
-\r
-Offset  Bytes  Description\r
-1084    1024   Data for pattern 00.\r
-   .\r
-   .\r
-   .\r
-xxxx  Number of patterns stored is equal to the highest patternnumber\r
-      in the song position table (at offset 952-1079).\r
-\r
-Each note is stored as 4 bytes, and all four notes at each position in\r
-the pattern are stored after each other.\r
-\r
-00 -  chan1  chan2  chan3  chan4\r
-01 -  chan1  chan2  chan3  chan4\r
-02 -  chan1  chan2  chan3  chan4\r
-etc.\r
-\r
-Info for each note:\r
-\r
- _____byte 1_____   byte2_    _____byte 3_____   byte4_\r
-/                 /        /                 /\r
-0000          0000-00000000  0000          0000-00000000\r
-\r
-Upper four    12 bits for    Lower four    Effect command.\r
-bits of sam-  note period.   bits of sam-\r
-ple number.                  ple number.\r
-\r
-Periodtable for Tuning 0, Normal\r
-  C-1 to B-1 : 856,808,762,720,678,640,604,570,538,508,480,453\r
-  C-2 to B-2 : 428,404,381,360,339,320,302,285,269,254,240,226\r
-  C-3 to B-3 : 214,202,190,180,170,160,151,143,135,127,120,113\r
-\r
-To determine what note to show, scan through the table until you find\r
-the same period as the one stored in byte 1-2. Use the index to look\r
-up in a notenames table.\r
-\r
-This is the data stored in a normal song. A packed song starts with the\r
-four letters "PACK", but i don't know how the song is packed: You can\r
-get the source code for the cruncher/decruncher from us if you need it,\r
-but I don't understand it; I've just ripped it from another tracker...\r
\r
-In a module, all the samples are stored right after the patterndata.\r
-To determine where a sample starts and stops, you use the sampleinfo\r
-structures in the beginning of the file (from offset 20). Take a look\r
-at the mt_init routine in the playroutine, and you'll see just how it\r
-is done.\r
\r
-Lars "ZAP" Hamre/Amiga Freelancers\r
\r
---------------------------\r
\r
-Found that document...\r
\r
-Mark J Cox ------------------------------------------- m.j.h.cox@bradford.ac.uk\r
-University of Bradford ---------------------------- bc732@cleveland.freenet.edu\r
-Mark\r
\r
-             EFFECT COMMANDS\r
-             ---------------\r
- Effect commands on protracker should\r
- be compatible with all other trackers.\r
- 0 - None/Arpeggio     8 - * NOT USED *\r
- 1 - Portamento Up     9 - SampleOffset\r
- 2 - Portamento Down   A - VolumeSlide\r
- 3 - TonePortamento    B - PositionJump\r
- 4 - Vibrato           C - Set Volume\r
- 5 - ToneP + VolSlide  D - PatternBreak\r
- 6 - Vibra + VolSlide  E - Misc. Cmds\r
- 7 - Tremolo           F - Set Speed\r
\r
\r
-              E - COMMANDS\r
-              ------------\r
- The E command has been altered to\r
- contain more commands than one.\r
- E0- Filter On/Off     E8- * NOT USED *\r
- E1- Fineslide Up      E9- Retrig Note\r
- E2- Fineslide Down    EA- FineVol Up\r
- E3- Glissando Control EB- FineVol Down\r
- E4- Vibrato Control   EC- NoteCut\r
- E5- Set Finetune      ED- NoteDelay\r
- E6- Patternloop       EE- PatternDelay\r
- E7- Tremolo Control   EF- Invert Loop\r
\r
\r
-  Cmd 0. Arpeggio [Range:$0-$F/$0-$F]\r
-  -----------------------------------\r
- Usage: $0 + 1st halfnote add\r
-           + 2nd halfnote add\r
- Arpeggio is used to simulate chords.\r
- This is done by rapidly changing the\r
- pitch between 3(or 2) different notes.\r
- It sounds very noisy and grainy on\r
- most samples, but ok on monotone ones.\r
- Example: C-300047  C-major chord:\r
-          (C+E+G  or C+4+7 halfnotes)\r
-          C-300037  C-minor chord:\r
-          (C+D#+G or C+3+7 halfnotes)\r
\r
\r
-  Cmd 1. Portamento up [Speed:$00-$FF]\r
-  ------------------------------------\r
- Usage: $1 + portamento speed\r
- Portamento up will simply slide the\r
- sample pitch up. You can NOT slide\r
- higher than B-3! (Period 113)\r
- Example: C-300103  1 is the command,\r
-            3 is the portamentospeed.\r
- NOTE: The portamento will be called as\r
- many times as the speed of the song.\r
- This means that you'll sometimes have\r
- trouble sliding accuratly. If you\r
- change the speed without changing the\r
- sliderates, it will sound bad...\r
\r
\r
-  Cmd 2. Portamento down [Speed:$00-FF]\r
-  -------------------------------------\r
- Usage: $2 + portamento speed\r
- Just like command 1, except that this\r
- one slides the pitch down instead.\r
- (Adds to the period).\r
- You can NOT slide lower than C-1!\r
- (Period 856)\r
- Example: C-300203  2 is the command,\r
-            3 is the portamentospeed.\r
\r
\r
- Cmd 3. Tone-portamento [Speed:$00-$FF]\r
- --------------------------------------\r
- Usage: Dest-note + $3 + slidespeed\r
- This command will automatically slide\r
- from the old note to the new.\r
- You don't have to worry about which\r
- direction to slide, you need only set\r
- the slide speed. To keep on sliding,\r
- just select the command $3 + 00.\r
- Example: A-200000  First play a note.\r
-          C-300305  C-3 is the note to\r
-               slide to, 3 the command,\r
-               and 5 the speed.\r
\r
\r
- Cmd 4. Vibrato [Rate:$0-$F,Dpth:$0-$F]\r
- --------------------------------------\r
- Usage: $4 + vibratorate + vibratodepth\r
- Example: C-300481  4 is the command,\r
-       8 is the speed of the vibrato,\r
-   and 1 is the depth of the vibrato.\r
- To keep on vibrating, just select\r
- the command $4 + 00. To change the\r
- vibrato, you can alter the rate,\r
- depth or both. Use command E4- to\r
- change the vibrato-waveform.\r
\r
\r
- Cmd 5. ToneP + Volsl [Spd:$0-$F/$0-$F]\r
- --------------------------------------\r
- Usage: $5 + upspeed + downspeed\r
- This command will continue the current\r
- toneportamento and slide the volume\r
- at the same time. Stolen from NT2.0.\r
- Example: C-300503  3 is the speed to\r
-                turn the volume down.\r
-          C-300540  4 is the speed to\r
-                         slide it up.\r
\r
\r
- Cmd 6. Vibra + Volsl [Spd:$0-$F/$0-$F]\r
- --------------------------------------\r
- Usage: $6 + upspeed + downspeed\r
- This command will continue the current\r
- vibrato and slide the volume at the\r
- same time. Stolen from NT2.0.\r
- Example: C-300605  5 is the speed to\r
-                turn the volume down.\r
-          C-300640  4 is the speed to\r
-                         slide it up.\r
\r
\r
- Cmd 7. Tremolo [Rate:$0-$F,Dpth:$0-$F]\r
- --------------------------------------\r
- Usage: $7 + tremolorate + tremolodepth\r
- Tremolo vibrates the volume.\r
- Example: C-300794  7 is the command,\r
-       9 is the speed of the tremolo,\r
-   and 4 is the depth of the tremolo.\r
- To keep on tremoling, just select\r
- the command $7 + 00. To change the\r
- tremolo, you can alter the rate,\r
- depth or both. Use command E7- to\r
- change the tremolo-waveform.\r
\r
\r
- Cmd 9. Set SampleOffset [Offs:$00-$FF]\r
- --------------------------------------\r
- Usage: $9 + Sampleoffset\r
- This command will play from a chosen\r
- position in the sample, and not from\r
- the beginning. The two numbers equal\r
- the two first numbers in the length\r
- of the sample. Handy for speech-\r
- samples.\r
- Example: C-300923  Play sample from\r
-                    offset $2300.\r
\r
\r
- Cmd A. Volumeslide [Speed:$0-$F/$0-$F]\r
- --------------------------------------\r
- Usage: $A + upspeed + downspeed\r
- Example: C-300A05  5 is the speed to\r
-                turn the volume down.\r
-          C-300A40  4 is the speed to\r
-                         slide it up.\r
- NOTE: The slide will be called as\r
- many times as the speed of the song.\r
- The slower the song, the more the\r
- volume will be changed on each note.\r
\r
\r
-   Cmd B. Position-jump [Pos:$00-$7F]\r
-   ----------------------------------\r
- Usage: $B + position to continue at\r
- Example: C-300B01  B is the command,\r
-                 1 is the position to\r
-                 restart the song at.\r
- This command will also perform a\r
- pattern-break (see 2 pages below).\r
- You can use this command instead of\r
- restart as on noisetracker, but you \r
- must enter the position in hex!\r
\r
\r
-   Cmd C. Set volume [Volume:$00-$40]\r
-   ----------------------------------\r
- Usage: $C + new volume\r
- Well, this old familiar command will\r
- set the current volume to your own\r
- selected. The highest volume is $40.\r
- All volumes are represented in hex.\r
- (Programmers do it in hex, you know!)\r
- Example: C-300C10  C is the command,\r
-       10 is the volume (16 decimal).\r
\r
\r
-      Cmd D. Pattern-break\r
-      [Pattern-pos:00-63, decimal]\r
-      ----------------------------\r
- Usage: $D + pattern-position\r
- This command just jumps to the next\r
- song-position, and continues play\r
- from the patternposition you specify.\r
- Example: C-300D00  Jump to the next\r
-     song-position and continue play\r
-            from patternposition 00.\r
-      Or: C-300D32  Jump to the next\r
-     song-position and continue play\r
-    from patternposition 32 instead.\r
\r
\r
-    Cmd E0. Set filter [Range:$0-$1]\r
-    --------------------------------\r
- Usage: $E0 + filter-status\r
- This command jerks around with the\r
- sound-filter on some A500 + A2000.\r
- All other Amiga-users should keep out\r
- of playing around with it.\r
- Example: C-300E01  disconnects filter\r
-                 (turns power LED off)\r
-          C-300E00  connects filter\r
-                  (turns power LED on)\r
\r
\r
-   Cmd E1. Fineslide up [Range:$0-$F]\r
-   ----------------------------------\r
- Usage: $E1 + value\r
- This command works just like the\r
- normal portamento up, except that\r
- it only slides up once. It does not\r
- continue sliding during the length of\r
- the note.\r
- Example: C-300E11  Slide up 1 at the\r
-               beginning of the note.\r
- (Great for creating chorus effects)\r
\r
\r
-  Cmd E2. Fineslide down [Range:$0-$F]\r
-  ------------------------------------\r
- Usage: $E2 + value\r
- This command works just like the\r
- normal portamento down, except that\r
- it only slides down once. It does not\r
- continue sliding during the length of\r
- the note.\r
- Example: C-300E26  Slide up 6 at the\r
-               beginning of the note.\r
\r
\r
-  Cmd E3. Glissando Ctrl [Range:$0-$1]\r
-  ------------------------------------\r
- Usage: $E3 + Glissando-Status\r
- Glissando must be used with the tone-\r
- portamento command. When glissando is\r
- activated, toneportamento will slide\r
- a halfnote at a time, instead of a\r
- straight slide.\r
- Example: C-300E31  Turn Glissando on.\r
-          C-300E30  Turn Glissando off.\r
\r
\r
-      Cmd E4. Set vibrato waveform\r
-      [Range:$0-$3]\r
-      ----------------------------\r
- Usage: $E4 + vibrato-waveform\r
- Example: C-300E40  Set sine(default)\r
-               E44  Don't retrig WF\r
-          C-300E41  Set Ramp Down\r
-               E45  Don't retrig WF\r
-          C-300E42  Set Squarewave\r
-               E46  Don't retrig WF\r
-          C-300E43  Set Random\r
-               E47  Don't retrig WF\r
\r
\r
-   Cmd E5. Set finetune [Range:$0-$F]\r
-   ----------------------------------\r
- Usage: $E5 + finetune-value\r
- Example: C-300E51  Set finetune to 1.\r
- Use these tables to figure out the\r
- finetune-value.\r
- Finetune: +7 +6 +5 +4 +3 +2 +1  0\r
-    Value:  7  6  5  4  3  2  1  0\r
- Finetune: -1 -2 -3 -4 -5 -6 -7 -8\r
-    Value:  F  E  D  C  B  A  9  8\r
\r
\r
-   Cmd E6. PatternLoop [Loops:$0-$F]\r
-   ----------------------------------\r
- Usage: $E6 + number of loops\r
- This command will loop a part of a\r
- pattern.\r
- Example: C-300E60  Set loopstart.\r
-          C-300E63  Jump to loop 3\r
-           times before playing on.\r
\r
\r
-      Cmd E7. Set tremolo waveform\r
-      [Range:$0-$3]\r
-      ----------------------------\r
- Usage: $E7 + tremolo-waveform\r
- Example: C-300E70  Set sine(default)\r
-               E74  Don't retrig WF\r
-          C-300E71  Set Ramp Down\r
-               E75  Don't retrig WF\r
-          C-300E72  Set Squarewave\r
-               E76  Don't retrig WF\r
-          C-300E73  Set Random\r
-               E77  Don't retrig WF\r
\r
\r
-    Cmd E9. Retrig note [Value:$0-$F]\r
-    ---------------------------------\r
- Usage: $E9 + Tick to Retrig note at.\r
- This command will retrig the same note\r
- before playing the next. Where to\r
- retrig depends on the speed of the\r
- song. If you retrig with 1 in speed 6\r
- that note will be trigged 6 times in\r
- one note slot. Retrig on hi-hats!\r
- Example: C-300F06  Set speed to 6.\r
-          C-300E93  Retrig at tick 3\r
-                    out of 6.\r
\r
\r
-   Cmd EA. FineVolsl up [Range:$0-$F]\r
-   ----------------------------------\r
- Usage: $EA + value\r
- This command works just like the\r
- normal volumeslide up, except that\r
- it only slides up once. It does not\r
- continue sliding during the length of\r
- the note.\r
- Example: C-300EA3  Slide volume up 1\r
-        at the beginning of the note.\r
\r
\r
-  Cmd EB. FineVolsl down [Range:$0-$F]\r
-  ------------------------------------\r
- Usage: $EB + value\r
- This command works just like the\r
- normal volumeslide down, except that\r
- it only slides down once. It does not\r
- continue sliding during the length of\r
- the note.\r
- Example: C-300EB6  Slide volume down\r
-       6 at the beginning of the note.\r
\r
\r
-     Cmd EC. Cut note [Value:$0-$F]\r
-     ------------------------------\r
- Usage: $EC + Tick to Cut note at.\r
- This command will cut the note\r
- at the selected tick, creating\r
- extremely short notes.\r
- Example: C-300F06  Set speed to 6.\r
-          C-300EC3  Cut at tick 3 out\r
-                    of 6.\r
- Note that the note is not really cut,\r
- the volume is just turned down.\r
\r
\r
-     Cmd ED. NoteDelay [Value:$0-$F]\r
-     -------------------------------\r
- Usage: $ED + ticks to delay note.\r
- This command will delay the note\r
- to the selected tick.\r
- Example: C-300F06  Set speed to 6.\r
-          C-300ED3  Play note at tick\r
-                    3 out of 6.\r
\r
\r
-   Cmd EE. PatternDelay [Notes:$0-$F]\r
-   ----------------------------------\r
- Usage: $EE + notes to delay pattern.\r
- This command will delay the pattern\r
- the selected numbers of notes.\r
- Example: C-300EE8  Delay pattern 8\r
-           notes before playing on.\r
- All other effects are still active\r
- when the pattern is being delayed.\r
\r
\r
-    Cmd EF. Invert Loop [Speed:$0-$F]\r
-    ---------------------------------\r
- Usage: $EF + Invertspeed\r
- This command will need a short loop\r
- ($10,20,40,80 etc. bytes) to work.\r
- It will invert the loop byte by byte.\r
- Sounds better than funkrepeat...\r
- Example: C-300EF8 Set invspeed to 8.\r
- To turn off the inverting, set \r
- invspeed to 0, or press ctrl + Z.\r
\r
\r
-    Cmd F. Set speed [Speed:$00-$FF]\r
-    --------------------------------\r
- Usage: $F + speed\r
- This command will set the speed of the\r
- song.  \r
-\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Annotation by Mark Feldman (u914097@student.canberra.edu.au ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-The 6 and 8 channel mod files differ from the normal mods in two ways:\r
-\r
-1) The signature string "M.K." at offset 1080 is either "6CHN" or "8CHN".\r
-2) The pattern data table starting at offset 1084 stores 6 or 8 notes for\r
-   each pattern position position.\r
diff --git a/16/PCGPE10/MOUSE.TXT b/16/PCGPE10/MOUSE.TXT
deleted file mode 100644 (file)
index 7f59c0b..0000000
+++ /dev/null
@@ -1,295 +0,0 @@
-                    ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-                    ³ Programming the Microsoft Mouse ³\r
-                    ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-                 Written for the PC-GPE by Mark Feldman\r
-              e-mail address : u914097@student.canberra.edu.au\r
-                               myndale@cairo.anu.edu.au\r
-\r
-              ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-              ³      THIS FILE MAY NOT BE DISTRIBUTED     ³\r
-              ³ SEPARATE TO THE ENTIRE PC-GPE COLLECTION. ³\r
-              ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Disclaimer ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-I assume no responsibility whatsoever for any effect that this file, the\r
-information contained therein or the use thereof has on you, your sanity,\r
-computer, spouse, children, pets or anything else related to you or your\r
-existance. No warranty is provided nor implied with this information.\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Introduction ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-A complete list of mouse function calls can be found in the file GMOUSE.TXT,\r
-the file contains calls for both Microsoft (2 button) and Genius (3 button)\r
-modes.\r
-\r
-Calling these functions from within a Pascal program is a fairly simple\r
-matter. This procedure would get the mouse position and button states:\r
-\r
-const MOUSEINTR = $33;\r
-\r
-procedure GetMousePos(var x, y : word; var button1, button2 : boolean);\r
-var regs : registers;\r
-begin\r
-  regs.ax := 3;\r
-  Intr(MOUSEINTR, regs);\r
-  x := regs.cx;\r
-  y := regs.dx;\r
-  button1 := (regs.bx and 1) <> 0;\r
-  button2 := (regs.bx and 2) <> 0;\r
-end;\r
-\r
-\r
-The mouse position is returned in variables x and y, the button states are\r
-returned in variable button1 and button2 (true = button is pressed).\r
-\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Writing Custom Handlers ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-Most mouse drivers do not support SVGA modes, so you must write custom\r
-handlers if you want mouse support for these modes.\r
-\r
-Rather than writing an entire mouse driver, you can write a simple handler\r
-routine to take care of the graphics and tell the mouse driver to call it\r
-whenever the mouse does anything. This function is descibed in the GMOUSE.DOC\r
-file, but this demo Pascal program shows the general idea. It sets mode 13h,\r
-resets the mouse and waits for a key to be pressed. Whenever you do anything\r
-to the mouse (moving it or pressing a button) the handler will get called\r
-and it will draw a pixel on the screen. The color of the pixel depends on\r
-which buttons are being pressed.\r
-\r
-Uses Crt, Dos;\r
-\r
-{$F+}\r
-{ called with bl = buttons, cx = x * 2, dx = y }\r
-procedure Handler; far; assembler;\r
-asm\r
-\r
-  { This mouse "handler" just draws a pixel at the current mouse pos }\r
-  pusha\r
-  mov ax, $A000\r
-  mov es, ax\r
-  shr cx, 1\r
-  xchg dh, dl\r
-  mov di, dx\r
-  shr dx, 2\r
-  add di, dx\r
-  add di, cx\r
-  mov al, bl\r
-  inc al\r
-  stosb\r
-  popa\r
-end;\r
-{$F-}\r
-\r
-begin\r
-  asm\r
-\r
-    { Set graphics mode 13h }\r
-    mov ax, $13\r
-    int $10\r
-\r
-    { Initialize mouse driver }\r
-    xor ax, ax\r
-    int $33\r
-\r
-    { Install custom handler }\r
-    mov ax, SEG Handler\r
-    mov es, ax\r
-    mov dx, OFS Handler\r
-    mov ax, 12\r
-    mov cx, $1F\r
-    int $33\r
-\r
-    { Wait for a key press }\r
-    xor ah, ah\r
-    int $16\r
-\r
-    { Back to text mode }\r
-    mov ax, 3\r
-    int $10\r
-  end;\r
-end.\r
-\r
-\r
-\r
-\r
-Alternatively you may wish to write your own interrupt handler to process\r
-mouse events as they happen. When a mouse event occurs, 3 interrupts are\r
-generated and the bytes are availble via the COM port.\r
-\r
-                  ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-                  ³        Interrupt    Port ³\r
-                  ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´\r
-                  ³ COM1      $0C       $3F8 ³\r
-                  ³ COM2      $0B       $3F8 ³\r
-                  ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-The three bytes sent are formatted as follows:\r
-\r
-\r
-               1st byte        2nd byte         3rd byte\r
-          ÚÄÂÄÂÄÂÄÂÄÂÄÂÄÂÄ¿ÚÄÂÄÂÄÂÄÂÄÂÄÂÄÂÄ¿ÚÄÂÄÂÄÂÄÂÄÂÄÂÄÂÄ¿\r
-          ³-³1³?³?³Y³Y³X³X³³-³0³X³X³X³X³X³X³³-³0³Y³Y³Y³Y³Y³Y³\r
-          ÀÄÁÄÁÄÁÄÁÄÁÄÁÄÁÄÙÀÄÁÄÁÄÁÄÁÄÁÄÁÄÁÄÙÀÄÁÄÁÄÁÄÁÄÁÄÁÄÁÄÙ\r
-               ³ ³ ÀÂÙ ÀÂÙ      ÀÄÄÄÄÂÄÄÄÄÙ      ÀÄÄÄÄÂÄÄÄÄÙ\r
-               ³ ³  ³   ³            ³                ³\r
-               ³ ³  ³   ÀÄÄÄÄ¿       ³                ³\r
-               ³ ³  ÀÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄ¿       ³\r
-               ³ ³          ÚÁ¿ ÚÄÄÄÄÁÄÄÄÄ¿  ÚÁ¿ ÚÄÄÄÄÁÄÄÄÄ¿\r
-               ³ ³         ÚÄÂÄÂÄÂÄÂÄÂÄÂÄÂÄ¿ÚÄÂÄÂÄÂÄÂÄÂÄÂÄÂÄ¿\r
-               ³ ³         ³ ³ ³ ³ ³ ³ ³ ³ ³³ ³ ³ ³ ³ ³ ³ ³ ³\r
- Left Button ÄÄÙ ³         ÀÄÁÄÁÄÁÄÁÄÁÄÁÄÁÄÙÀÄÁÄÁÄÁÄÁÄÁÄÁÄÁÄÙ\r
-Right Button ÄÄÄÄÙ            X increment      Y increment\r
-\r
-\r
-The X and Y increment values are in 2's compliment signed char format. (BTW\r
-thanks go to Adam Seychell for posting this info to comp.os.msdos.programmer).\r
-\r
-\r
-A simple Borland Pascal 7.0 mouse handler follows. First we declare a few\r
-things we'll need:\r
-\r
-\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-Uses Crt, Dos;\r
-\r
-{$F+}\r
-\r
-const COM1INTR = $0C;\r
-      COM1PORT = $3F8;\r
-\r
-var bytenum : word;\r
-    combytes : array[0..2] of byte;\r
-    x, y : longint;\r
-    button1, button2 : boolean;\r
-    MouseHandler : procedure;\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-The bytenum variable is used to keep track of which byte is expected next\r
-(ie 0, 1 or 2). The combytes variable is simply an array to keep track of\r
-bytes received so far. The mouse position will be stored in the x and y\r
-varaibles (note that this example will not perfrom any range checking).\r
-Button1 and button2 will be used to store the states of each of the buttons.\r
-MouseHandler will be used to store the normal mouse driver event handler.\r
-We'll need it to reset everything once we are finished.\r
-\r
-Here's the actual handler:\r
-\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-procedure MyMouseHandler; Interrupt;\r
-var dx, dy : integer;\r
-var inbyte : byte;\r
-begin\r
-\r
-  { Get the port byte }\r
-  inbyte := Port[COM1PORT];\r
-\r
-  { Make sure we are properly "synched" }\r
-  if (inbyte and 64) = 64 then bytenum := 0;\r
-\r
-  { Store the byte and adjust bytenum }\r
-  combytes[bytenum] := inbyte;\r
-  inc(bytenum);\r
-\r
-  { Have we received all 3 bytes? }\r
-  if bytenum = 3 then\r
-    begin\r
-      { Yes, so process them }\r
-      dx := (combytes[0] and 3) shl 6 + combytes[1];\r
-      dy := (combytes[0] and 12) shl 4 + combytes[2];\r
-      if dx >= 128 then dx := dx - 256;\r
-      if dy >= 128 then dy := dy - 256;\r
-      x := x + dx;\r
-      y := y + dy;\r
-      button1 := (combytes[0] And 32) <> 0;\r
-      button2 := (combytes[0] And 16) <> 0;\r
-\r
-      { And start on first byte again }\r
-      bytenum := 0;\r
-    end;\r
-\r
-  { Acknowledge the interrupt }\r
-  Port[$20] := $20;\r
-end;\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-Once again pretty simple stuff. We just read the byte from the com1 port and\r
-figure out if it's time to do anything yet. If bit 6 is set to 1 then we\r
-know that it's meant to be the first byte of the 3, so we reset our\r
-bytenum variable to zero (in a perfect world bytes would always come in 3's\r
-and we would never need to check, but it never hurts to be careful).\r
-\r
-When 3 bytes have been received we simple decode them according to the\r
-diagram above and update the appropriate variables accordingly.\r
-\r
-The 'Port[$20] := $20;' command just lets the interrupt controller know we\r
-have processed the interrupt so it can send us the next one when it wants to.\r
-\r
-Note that the above "handler" does nothing more than keep track of the\r
-current mouse position and button states. If we were writing a proper mouse\r
-driver for an SVGA game we would also have to write custom cursor routines.\r
-I'll leave that bit to you!\r
-\r
-To actually install our mouse driver we'll have to set up all the variables,\r
-save the address of the current mouse handler and install our own. We'll\r
-also need call the existing mouse driver to set up the COM1 port to make\r
-sure it sends us the mouse bytes as it receives them. We could do this\r
-ourselves, but why make life harder than it already is?\r
-\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-procedure InitMyDriver;\r
-begin\r
-\r
-  { Initialize the normal mouse handler }\r
-  asm\r
-    mov ax, 0\r
-    int $33\r
-  end;\r
-\r
-  { Initialize some of the variables we'll be using }\r
-  bytenum := 0;\r
-  x := 0;\r
-  y := 0;\r
-  button1 := false;\r
-  button2 := false;\r
-\r
-  { Save the current mouse handler and set up our own }\r
-  GetIntVec(COM1INTR, @MouseHandler);\r
-  SetIntVec(COM1INTR, Addr(MyMouseHandler));\r
-end;\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-\r
-And finally when our program is finished it'll need to clean up after\r
-itself and return control back to the normal mouse driver:\r
-\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-procedure CleanUpMyDriver;\r
-begin\r
-  SetIntVec(COM1INTR, @MouseHandler);\r
-end;\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-\r
-This little bit of source will test the above code. It does nothing more\r
-than repeatedly write the mouse position and button states to the screen\r
-until a keyboard key is pressed:\r
-\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-begin\r
-  ClrScr;\r
-  InitMyDriver;\r
-  while not keypressed do\r
-    WriteLn(x : 5, y : 5, button1 : 7, button2 : 7);\r
-  CleanUpMyDriver;\r
-end.\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
diff --git a/16/PCGPE10/PALLETTE.COL b/16/PCGPE10/PALLETTE.COL
deleted file mode 100644 (file)
index a945ccc..0000000
Binary files a/16/PCGPE10/PALLETTE.COL and /dev/null differ
diff --git a/16/PCGPE10/PARADISE.TXT b/16/PCGPE10/PARADISE.TXT
deleted file mode 100644 (file)
index be114a8..0000000
+++ /dev/null
@@ -1,237 +0,0 @@
-\r
-                ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-                ³ Programming the Paradise SVGA Chip ³\r
-                ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-                 Written for the PC-GPE by Mark Feldman\r
-            e-mail address : u914097@student.canberra.edu.au\r
-                             myndale@cairo.anu.edu.au\r
-\r
-                  Please read the file SVGINTRO.TXT\r
-              (Graphics/SVGA/Intro PC-GPE menu option)\r
-\r
-            ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-            ³      THIS FILE MAY NOT BE DISTRIBUTED     ³\r
-            ³ SEPARATE TO THE ENTIRE PC-GPE COLLECTION. ³\r
-            ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Disclaimer ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-I assume no responsibility whatsoever for any effect that this file, the\r
-information contained therein or the use thereof has on you, your sanity,\r
-computer, spouse, children, pets or anything else related to you or your\r
-existance. No warranty is provided nor implied with this information.\r
-\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Introduction ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-Western Digital have made a series of Paradise chips, the PVGA1A, WD90C00\r
-and WD90C11. Each chip is fully compatible with it's predecessors. There\r
-is also a WD90C10 which is a stripped down version of the WD90C00 used for\r
-motherboard VGA implementations and does not support 256 color modes higher\r
-that 320x200; this chip will not be discussed here.\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Paradise Extensions ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-To modify any of the Paradise extended registers you must enable the\r
-extensions. Disable them once you are done.\r
-\r
-To enable extensions:\r
-\r
-PortW[$3CE] := $050F; { Extensions on             }\r
-PortW[$3D4] := $8529; { Unlock PR10-PR17          }\r
-PortW[$3C4] := $4806; { Unlock extended sequencer }\r
-\r
-To disable extensions :\r
-\r
-PortW[$3CE] := $000F; { Extensions off          }\r
-PortW[$3D4] := $0029; { Lock PR10-PR17          }\r
-PortW[$3C4] := $0006; { Lock extended sequencer }\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Identifying the Paradise SVGA Chip ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-To identify if a Paradise SVGA chip is present read the 4 bytes at memory\r
-address C000:007D. These bytes should be the string "VGA=".\r
-\r
-                ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-                ³  Memory Address   Value      ³\r
-                ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´\r
-                ³  C000:007Dh        86d ('V') ³\r
-                ³  C000:007Eh        71d ('G') ³\r
-                ³  C000:007Fh        65d ('A') ³\r
-                ³  C000:0080h        61d ('=') ³\r
-                ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Identifying which Paradise Chip is Present ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-The Paradise chip present can be determined by trying to access selected\r
-registers. The following pseudo-code will determine the chip id:\r
-\r
-var old_value : byte;\r
-\r
-Enable Extensions\r
-\r
-{ Test for a PVGA1A }\r
-Port[$3D4] := $2B\r
-old_value := Port[$3D5]\r
-Port[$3D5] := $AA\r
-if Port[$3D5] <> $AA then\r
-  begin\r
-    chip is a PVGA1A\r
-    Port[$3D5] := old_value\r
-    return\r
-  end\r
-Port[$3D5] := old_value\r
-\r
-{ Distinguish between WD90C00 and WD90C10 }\r
-Port[$3C4] := $12\r
-old_value := Port[$3C5]\r
-Port[$3C5] := old_value and $BF\r
-if (Port[$3C5] and $40) <> 0 then\r
-  begin\r
-    chip is a WD90C00\r
-    return\r
-  end\r
-Port[$3C5] := old_value or $40\r
-if (Port[$3C5] and $40) = 0 then\r
-  begin\r
-    chip is a WD90C00\r
-    Port[$3C5] := old_value\r
-    return\r
-  end\r
-Port[$3C5] := old_value\r
-\r
-{ Distinguish between WD90C10 and WD90C11 }\r
-Port[$3C4] := $10\r
-old_value := Port[$3C5]\r
-Port[$3C5] := old_value and $FB\r
-if (Port[$3C5] and $04) <> 0 then\r
-  begin\r
-    chip is a WD90C10\r
-    Port[$3C5] := old_value\r
-    return\r
-  end\r
-Port[$3C5] := old_value or $04\r
-if (Port[$3C5] and $04) = 0 then\r
-  begin\r
-    chip is a WD90C10\r
-    Port[$3C5] := old_value\r
-    return\r
-  end\r
-\r
-{ We made it this far so it's a WD90C11 }\r
-chip is a WD90C11\r
-Port[$3C5] := old_value\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Paradise Graphics Display Modes ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-        ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-        ³ Mode     Resolution       Colors    Chips               ³\r
-        ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´\r
-        ³ 58h      800x600          16        pVGA1, WDC90cxx     ³\r
-        ³ 59h      800x600          2         pVGA1, WDC90cxx     ³\r
-        ³ 5Eh      640x400          256       pVGA1, WDC90cxx     ³\r
-        ³ 5Fh      640x480          256       pVGA1, WD90cxx      ³\r
-        ³ 5Ah      1024x768         2         WD90cxx             ³\r
-        ³ 5Bh      1024x768         4         WD90cxx             ³\r
-        ³ 5Dh      1024x768         16        WD90cxx, c11 (512K) ³\r
-        ³ 5Ch      800x600          256       WD90c11 (512K)      ³\r
-        ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Paradise Display Memory ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-Remember, extensions must be enabled before any of the following procedures\r
-are called.\r
-\r
-The Paradise can work in either single-paging mode, duel-paging mode or\r
-read/write mode. There are two registers used to select banks in each of\r
-the Paradise bank selection modes:\r
-\r
-          PR0A Address Offset A\r
-          Index : 09h at port 3CEh\r
-          Read/Write at port 3CFh\r
-          ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿\r
-          ³ 7 ³ 6 ³ 5 ³ 4 ³ 3 ³ 2 ³ 1 ³ 0 ³\r
-          ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÙ\r
-                ÀÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÙ\r
-                           Bank\r
-\r
-          PR0B Address Offset A\r
-          Index : 0Ah at port 3CEh\r
-          Read/Write at port 3CFh\r
-          ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿\r
-          ³ 7 ³ 6 ³ 5 ³ 4 ³ 3 ³ 2 ³ 1 ³ 0 ³\r
-          ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÙ\r
-                ÀÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÙ\r
-                           Bank\r
-\r
-There are 128 banks and the bank granularity is 4k, so if you want a bank\r
-granularity of 64k you must multiply the bank number by 16.\r
-\r
-\r
-Single Paging Mode\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-\r
-In single paging mode PR0A is set to map a bank to host memory at\r
-A000:0000-FFFFh. The bank is used for both reading and writing operations.\r
-To set up for single paging mode use the following procedure:\r
-\r
-Port[$3C4] := $11;                 { Disable read/write mode }\r
-Port[$3C5] := Port[$3C5] and $7F;\r
-Port[$3CE] := $0B;                 { Disable PR0B            }\r
-Port[$3CF] := Port[$3CF] and $F7;\r
-\r
-To set a 64k bank number in single paging mode use the following procedure:\r
-\r
-PortW[$3CE] := bank_number Shl 12 + $09;\r
-\r
-\r
-Duel Paging Mode\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-\r
-In duel paging mode PR0A is set to map a bank to host memory at\r
-A000:0000-7FFFh and PR0B is set to map a bank to host memory at\r
-A000:8000-FFFFh. Each bank is used for both reading and writing operations.\r
-\r
-To set up for duel paging mode use the following procedure:\r
-\r
-Port[$3C4] := $11;                 { Disable read/write mode }\r
-Port[$3C5] := Port[$3C5] and $7F;\r
-Port[$3CE] := $0B;                 { Enable PR0B             }\r
-Port[$3CF] := Port[$3CF] or $80;\r
-\r
-To set the lower bank use the same procedure as given for single-paging\r
-mode. The upper bank can be set with the following procedure:\r
-\r
-PortW[$3CE] := bank_number Shl 12 + $0A;\r
-\r
-\r
-Read/Write Paging Mode\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-\r
-In read/write paging mode PR0A is used to map a bank at A000:0000-FFFFh for\r
-read operations and PR0B is used to map a bank at A000:0000-FFFFh for write\r
-operations. To set up for read/write paging mode use the following procedure:\r
-\r
-Port[$3C4] := $11;                 { Enable read/write mode }\r
-Port[$3C5] := Port[$3C5] or $80;\r
-Port[$3CE] := $0B;                 { Enable PR0B             }\r
-Port[$3CF] := Port[$3CF] or $80;\r
-\r
-Setting PR0A and PR0B is the same as for duel paging mode.\r
-\r
diff --git a/16/PCGPE10/PCGPE.EXE b/16/PCGPE10/PCGPE.EXE
deleted file mode 100644 (file)
index 4b71580..0000000
Binary files a/16/PCGPE10/PCGPE.EXE and /dev/null differ
diff --git a/16/PCGPE10/PCX.TXT b/16/PCGPE10/PCX.TXT
deleted file mode 100644 (file)
index f354b1e..0000000
+++ /dev/null
@@ -1,586 +0,0 @@
-\r
-ZSoft PCX File Format Technical Reference Manual        \r
-        \r
-        \r
-        \r
-Introduction                            2 \r
-Image  File (.PCX) Format               3 \r
-ZSoft .PCX FILE HEADER FORMAT           4 \r
-Decoding .PCX Files                     6 \r
-Palette Information Description         7 \r
-EGA/VGA 16 Color Palette Information    7 \r
-VGA 256 Color Palette Information       7 \r
-24-Bit .PCX Files                       8 \r
-CGA Color Palette Information           8 \r
-CGA Color Map                           8 \r
-PC Paintbrush Bitmap Character Format   9 \r
-Sample "C" Routines                    10 \r
-FRIEZE Technical Information           14 \r
-General FRIEZE Information             14 \r
-7.00 and Later FRIEZE                  14 \r
-FRIEZE Function Calls                  15 \r
-FRIEZE Error Codes                     18 \r
-\f\r
-\r
-\r
-\r
-\r
-Introduction\r
-\r
-This booklet was designed to aid developers and users in understanding\r
-the technical aspects of the .PCX file format and the use of FRIEZE.\r
-Any comments, questions or suggestions about this booklet should be\r
-sent to:\r
-\r
-        ZSoft Corporation\r
-        Technical Services\r
-        ATTN: Code Librarian\r
-        450 Franklin Rd. Suite 100\r
-        Marietta, GA  30067\r
-\r
-\r
-\r
-Technical Reference Manual information compiled by:\r
-Dean Ansley\r
-\r
-\r
-Revision 5\r
-\r
-To down load additional information and the source for a complete\r
-Turbo Pascal program to show .PCX files on a CGA/EGA/VGA graphics\r
-display, call our BBS at (404)427-1045.  You may use a 9600 baud \r
-modem or a 2400 baud standard modem.  Your modem should be set for\r
-8 data bits, 1 stop bit, and NO parity.\r
-\r
-Image  File (.PCX) Format\r
-\r
-If you have technical questions on the format, please do not call\r
-technical support.  ZSoft provides this document as a courtesy to\r
-its users and developers.  It is not the function of Technical Support\r
-to provide programming assistance.  If something is not clear, leave a\r
-message on our BBS, Compuserve, or write us a letter at the above address.\r
-\r
-The information in this section will be useful if you want to write a\r
-program to read or write PCX files (images).  If you want to write a\r
-special case program for one particular image format you should be able\r
-to produce something that runs twice as fast as "Load from..." in\r
-PC Paintbrush.  \r
-\r
-Image files used by PC Paintbrush product family and FRIEZE (those with a\r
-.PCX extension) begin with a 128 byte header.  Usually you can ignore this\r
-header, since your images will probably all have the same resolution.  If\r
-you want to process different resolutions or colors, you will need to\r
-interpret the header correctly.  The remainder of the image file consists\r
-of encoded graphic data.  The encoding method is a simple byte oriented\r
-run-length technique.  We reserve the right to change this method to\r
-improve space efficiency.  When more than one color plane is stored in\r
-the file, each line of the image is stored by color plane (generally ordered\r
-red, green, blue, intensity), As shown below.\r
-\r
-Scan line 0:         RRR...        (Plane 0)\r
-                     GGG...        (Plane 1)\r
-                     BBB...        (Plane 2)\r
-                     III...        (Plane 3)\r
-Scan line 1:         RRR...\r
-                     GGG...\r
-                     BBB...\r
-                     III...        (etc.)\r
-\r
-The encoding method is:\r
-    FOR  each  byte,  X,  read from the file\r
-        IF the top two bits of X are  1's then\r
-            count = 6 lowest bits of X\r
-            data = next byte following X\r
-        ELSE\r
-            count = 1\r
-            data = X\r
-\r
-Since the overhead this technique requires is, on average,  25% of\r
-the non-repeating data and is at least offset whenever bytes are repeated,\r
-the file storage savings are usually considerable.\r
-\r
-ZSoft .PCX FILE HEADER FORMAT\r
-\r
-Byte      Item          Size   Description/Comments \r
- 0         Manufacturer 1      Constant Flag, 10 = ZSoft .pcx \r
- 1         Version      1      Version information \r
-                               0 = Version 2.5 of PC Paintbrush \r
-                               2 = Version 2.8 w/palette information \r
-                               3 = Version 2.8 w/o palette information \r
-                               4 = PC Paintbrush for Windows(Plus for\r
-                                  Windows uses Ver 5) \r
-                               5 = Version 3.0 and > of PC Paintbrush\r
-                                  and PC Paintbrush +, includes\r
-                                  Publisher's Paintbrush . Includes\r
-                                  24-bit .PCX files \r
- 2         Encoding      1     1 = .PCX run length encoding \r
- 3         BitsPerPixel  1     Number of bits to represent a pixel\r
-                                  (per Plane) - 1, 2, 4, or 8 \r
- 4         Window        8     Image Dimensions: Xmin,Ymin,Xmax,Ymax \r
-12         HDpi          2     Horizontal Resolution of image in DPI* \r
-14         VDpi          2     Vertical Resolution of image in DPI* \r
-16         Colormap     48     Color palette setting, see text \r
-64         Reserved      1     Should be set to 0. \r
-65         NPlanes       1     Number of color planes \r
-66         BytesPerLine  2     Number of bytes to allocate for a scanline\r
-                                  plane.  MUST be an EVEN number.  Do NOT\r
-                                  calculate from Xmax-Xmin. \r
-68         PaletteInfo   2     How to interpret palette- 1 = Color/BW,\r
-                                  2 = Grayscale (ignored in PB IV/ IV +) \r
-70         HscreenSize   2     Horizontal screen size in pixels. New field\r
-                                  found only in PB IV/IV Plus \r
-72         VscreenSize   2     Vertical screen size in pixels. New field\r
-                                  found only in PB IV/IV Plus \r
-74         Filler       54     Blank to fill out 128 byte header.  Set all\r
-                                  bytes to 0 \r
-\r
-\fNOTES:\r
-\r
-All sizes are measured in BYTES. \r
-\r
-All variables of SIZE 2 are integers.  \r
-\r
-*HDpi and VDpi represent the Horizontal and Vertical resolutions which the\r
-image was created (either printer or scanner); i.e. an image which was\r
-scanned might have 300 and 300 in each of these fields.\r
-\r
-Decoding .PCX Files\r
-\r
-First, find the pixel dimensions of the image by calculating\r
-[XSIZE = Xmax - Xmin + 1] and [YSIZE = Ymax - Ymin + 1].  Then calculate\r
-how many bytes are required to hold one complete uncompressed scan line:\r
-\r
-TotalBytes = NPlanes * BytesPerLine\r
-\r
-Note that since there are always an even number of bytes per scan line,\r
-there will probably be unused data at the end of each scan line.  TotalBytes\r
-shows how much storage must be available to decode each scan line, including\r
-any blank area on the right side of the image.  You can now begin decoding\r
-the first scan line - read the first byte of data from the file.  If the\r
-top two bits are set, the remaining six bits in the byte show how many times\r
-to duplicate the next byte in the file.  If the top two bits are not set,\r
-the first byte is the data itself, with a count of one.\r
-\r
-Continue decoding the rest of the line.  Keep a running subtotal of how\r
-many bytes are moved and duplicated into the output buffer.  When the\r
-subtotal equals TotalBytes, the scan line is complete.  There should always\r
-be a decoding break at the end of each scan line.  But there will not be a\r
-decoding break at the end of each plane within each scan line.  When the\r
-scan line is completed, there may be extra blank data at the end of each\r
-plane within the scan line.  Use the XSIZE and YSIZE values to find where\r
-the valid image data is.  If the data is multi-plane, BytesPerLine shows\r
-where each plane ends within the scan line.\r
-\r
-Continue decoding the remainder of the scan lines (do not just read to\r
-end-of-file).  There may be additional data after the end of the image\r
-(palette, etc.)\r
-\r
-\fPalette Information Description\r
-\r
-EGA/VGA 16 Color Palette Information\r
-\r
-In standard RGB format (IBM EGA, IBM VGA) the data is stored as 16 triples.\r
-Each triple is a 3 byte quantity of Red, Green, Blue values.  The values can\r
-range from 0-255, so some interpretation may be necessary.  On an IBM EGA,\r
-for example, there are 4 possible levels of RGB for each color.  Since\r
-256/4 = 64, the following is a list of the settings and levels:\r
-\r
-Setting                Level\r
-   0-63                0\r
- 64-127                1\r
-128-192                2\r
-193-254                3\r
-\r
-VGA 256 Color Palette Information\r
-\r
-ZSoft has recently added the capability to store palettes containing more\r
-than 16 colors in the .PCX image file.  The 256 color palette is formatted\r
-and treated the same as the 16 color palette, except that it is substantially\r
-longer.  The palette (number of colors x 3 bytes in length) is appended to\r
-the end of the .PCX file, and is preceded by a 12 decimal.  Since the VGA\r
-device expects a palette value to be 0-63 instead of 0-255, you need to\r
-divide the values read in the palette by 4.\r
-\r
-To access a 256 color palette:\r
-\r
-First, check the version number in the header; if it contains a 5 there is\r
-a palette.\r
-\r
-Second, read to the end of the file and count back 769 bytes.  The value\r
-you find should be a 12 decimal, showing the presence of a 256 color palette.\r
-\r
-\f24-Bit .PCX Files\r
-\r
-24 bit images are stored as version 5 or above as 8 bit, 3 plane images.\r
-\r
-24 bit images do not contain a palette.\r
-\r
-Bit planes are ordered as lines of red, green, blue in that order.\r
-\r
-CGA Color Palette Information\r
-\r
-NOTE: This is no longer supported for PC Paintbrush IV/IV Plus.\r
-\r
-For a standard IBM CGA board, the palette settings are a bit more complex.\r
-Only the first byte of the triple is used.  The first triple has a valid\r
-first byte which represents the background color.  To find the background,\r
-take the (unsigned) byte value and divide by 16.  This will give a result\r
-between 0-15, hence the background color.  The second triple has a valid\r
-first byte, which represents the foreground palette.  PC Paintbrush supports\r
-8 possible CGA palettes, so when the foreground setting is encoded between\r
-0 and 255, there are 8 ranges of numbers and the divisor is 32.\r
-\r
-CGA Color Map\r
-\r
-Header Byte #16 \r
-\r
-Background color is determined in the upper four bits.\r
-\r
-Header Byte #19\r
-\r
-Only upper 3 bits are used, lower 5 bits are ignored.  The first three bits\r
-that are used are ordered C, P, I.  These bits are interpreted as follows:\r
-\r
-c: color burst enable - 0 = color; 1 = monochrome\r
-\r
-p: palette - 0 = yellow; 1 = white\r
-\r
-i: intensity - 0 = dim; 1 = bright\r
-\r
-\fPC Paintbrush Bitmap Character Format\r
-\r
-NOTE: This format is for PC Paintbrush (up to Vers 3.7) and PC Paintbrush\r
-Plus (up to Vers 1.65)\r
-\r
-The bitmap character fonts are stored in a particularly simple format.  The\r
-format of these characters is as follows:\r
-\r
-\r
-Header\r
-\r
-font width         byte                0xA0 + character width  (in pixels)\r
-font height        byte                character height  (in pixels)\r
-\r
-Character Width Table\r
-\r
-char widths        (256 bytes)         each char's width + 1 pixel of kerning\r
-\r
-Character Images\r
-\r
-(remainder of the file)                starts at char 0  (Null)\r
-\r
-The characters are stored in ASCII order and as many as 256 may be provided.\r
-Each character is left justified in the character block, all characters take\r
-up the same number of bytes.\r
-\r
-Bytes are organized as N strings, where each string is one scan line of the\r
-character.\r
-\r
-For example, each character in a 5x7 font requires 7 bytes.  A 9x14 font\r
-uses 28 bytes per character (stored two bytes per scan line in 14 sets of\r
-2 byte packets).  Custom fonts may be any size up to the current maximum of\r
-10K bytes allowed for a font file.  There is a maximum of 4 bytes per scan\r
-line.\r
-\r
-\fSample "C" Routines\r
-\r
-The following is a simple set of C subroutines to read data from a .PCX file.\r
-\r
-/* This procedure reads one encoded block from the image file and stores a\r
-count and data byte.\r
-\r
-Return result:  0 = valid data stored, EOF = out of data in file */\r
-\r
-encget(pbyt, pcnt, fid)\r
-int *pbyt;        /* where to place data */\r
-int *pcnt;        /* where to place count */\r
-FILE *fid;        /* image file handle */\r
-{\r
-int i;\r
-        *pcnt = 1;        /* assume a "run" length of one */\r
-        if (EOF == (i = getc(fid)))\r
-                return (EOF);\r
-        if (0xC0 == (0xC0 & i))\r
-                {\r
-                *pcnt = 0x3F & i;\r
-                if (EOF == (i = getc(fid)))\r
-                        return (EOF);\r
-                }\r
-        *pbyt = i;\r
-        return (0);\r
-}\r
-/* Here's a program fragment using encget.  This reads an entire file and\r
-stores it in a (large) buffer, pointed to by the variable "bufr". "fp" is\r
-the file pointer for the image */\r
-\r
-int i;\r
-long l, lsize;\r
-     lsize = (long )hdr.BytesPerLine * hdr.Nplanes * (1 + hdr.Ymax - hdr.Ymin);\r
-     for (l = 0; l < lsize; )             /* increment by cnt below */\r
-                {\r
-                if (EOF == encget(&chr, &cnt, fp))\r
-                        break;\r
-                for (i = 0; i < cnt; i++)\r
-                        *bufr++ = chr;\r
-                l += cnt;\r
-                }\r
-\r
-The following is a set of C subroutines to write data to a .PCX file.\r
-\r
-/* Subroutine for writing an encoded byte pair (or single byte if it\r
-doesn't encode) to a file. It returns the count of bytes written, 0 if error */\r
-\r
-encput(byt, cnt, fid)\r
-unsigned char byt, cnt;\r
-FILE *fid;\r
-{\r
-  if (cnt) {\r
-        if ((cnt == 1) && (0xC0 != (0xC0 & byt)))\r
-                {\r
-                if (EOF == putc((int )byt, fid))\r
-                        return(0);     /* disk write error (probably full) */\r
-                return(1);\r
-                }\r
-        else\r
-                {\r
-                if (EOF == putc((int )0xC0 | cnt, fid))\r
-                        return (0);      /* disk write error */\r
-                if (EOF == putc((int )byt, fid))\r
-                        return (0);      /* disk write error */\r
-                return (2);\r
-                }\r
-        }\r
-   return (0);\r
-}\r
-\r
-\f/* This subroutine encodes one scanline and writes it to a file.\r
-It returns number of bytes written into outBuff, 0 if failed. */\r
-\r
-encLine(inBuff, inLen, fp)\r
-unsigned char *inBuff;    /* pointer to scanline data */\r
-int inLen;                        /* length of raw scanline in bytes */\r
-FILE *fp;                        /* file to be written to */\r
-{\r
-unsigned char this, last;\r
-int srcIndex, i;\r
-register int total;\r
-register unsigned char runCount;     /* max single runlength is 63 */\r
-  total = 0;\r
-  runCount = 1;\r
-  last = *(inBuff);\r
-\r
-/* Find the pixel dimensions of the image by calculating \r
-[XSIZE = Xmax - Xmin + 1] and [YSIZE = Ymax - Ymin + 1].  \r
-Then calculate how many bytes are in a "run" */\r
-\r
-  for (srcIndex = 1; srcIndex < inLen; srcIndex++)\r
-        {\r
-        this = *(++inBuff);\r
-        if (this == last)     /* There is a "run" in the data, encode it */\r
-                {\r
-                runCount++;\r
-                if (runCount == 63)\r
-                        {\r
-                        if (! (i = encput(last, runCount, fp)))\r
-                                return (0);\r
-                        total += i;\r
-                        runCount = 0;\r
-                        }\r
-                }\r
-        else                /* No "run"  -  this != last */\r
-                {\r
-                if (runCount)\r
-                        {\r
-                        if (! (i = encput(last, runCount, fp)))\r
-                                return(0);\r
-                        total += i;\r
-                        }\r
-                last = this;\r
-                runCount = 1;\r
-                }\r
-        }        /* endloop */\r
-  if (runCount)        /* finish up */\r
-        {\r
-        if (! (i = encput(last, runCount, fp)))\r
-                return (0);\r
-        return (total + i);\r
-        }\r
-  return (total);\r
-}\r
-\r
-\fFRIEZE Technical Information\r
-\r
-General FRIEZE Information\r
-\r
-FRIEZE is a memory-resident utility that allows you to capture and save\r
-graphic images from other programs.  You can then bring these images into\r
-PC Paintbrush for editing and enhancement.\r
-\r
-FRIEZE 7.10 and later can be removed from memory (this can return you up\r
-to 90K of DOS RAM, depending on your configuration). To remove FRIEZE from\r
-memory, change directories to your paintbrush directory and type the word\r
-"FRIEZE".\r
-\r
-7.00 and Later FRIEZE\r
-\r
-The FRIEZE command line format is:\r
-\r
-FRIEZE {PD} {Xn[aarr]} {flags} {video} {hres} {vres} {vnum}\r
-Where:\r
-{PD}        Printer driver filename (without the .PDV extension)\r
-{Xn[aarr]}\r
-                X=S for Serial Printer, P for Parallel Printer, D for disk file.\r
-                        (file is always named FRIEZE.PRN)\r
-                n = port number\r
-                aa = Two digit hex code for which return bits cause\r
-                         an abort (optional)\r
-                rr = Two digit hex code for which return bits cause\r
-                        a retry (optional)\r
-                NOTE:  These codes represent return values from serial or\r
-                       parallel port  BIOS calls.  For values see and IBM\r
-                       BIOS reference (such as Ray Duncan's Advanced MS-DOS\r
-                       Programming).\r
-{flags}Four digit hex code\r
-        First Digit controls Length Flag\r
-        Second Digit controls Width Flag\r
-                Third Digit controls Mode Flag\r
-                Fourth Digit controls BIOS Flag\r
-                        0 - None\r
-                        1 - Dual Monitor Present\r
-                        2 - Use internal (true) B/W palette for dithering\r
-                                2 color images\r
-                        4 - Capture palette along with screen IN VGA ONLY\r
-                                Frieze 8.08 & up ONLY)\r
-\r
-NOTE: The length, width and mode flags are printer driver specific.\r
-See PRINTERS.DAT on disk 1 (or Setup Disk) for correct use.  In general\r
-width flag of 1 means wide carriage, and 0 means standard width.  Length\r
-flag of 0 and mode flag of 0 means use default printer driver settings.\r
-\r
-If you need to use more than one BIOS flag option, add the needed flag values\r
-and use the sum as the flag value.\r
-\r
-{video}       Video driver combination, where the leading digit signifies the\r
-                high level video driver and the rest signifies the low\r
-                level video driver\r
-                Example = 1EGA - uses DRIVE1 and EGA.DEV\r
-{hres}        Horizontal resolution of the desired graphics mode\r
-{vres}        Vertical resolution of the desired graphics mode\r
-{vnum}        Hardware specific parameter (usually number of color planes)\r
-\r
-Note: The last four parameters can be obtained from the CARDS.DAT file,\r
-in your PC Paintbrush product directory.\r
-\r
-\r
-FRIEZE Function Calls\r
-\r
-FRIEZE is operated using software interrupt number 10h (the video interrupt\r
-call).\r
-\r
-To make a FRIEZE function call, load 75 (decimal) into the  AH register and\r
-the function number into the CL register, then either load AL with the\r
-function argument or load ES and BX with a segment and offset which point\r
-to the function argument. Do an int 10h. FRIEZE will return a result code\r
-number in AX.  All other registers are preserved.  In general, a result\r
-code of 0 means success and other values indicate errors.  However, function\r
-20 (get Frieze Version) behaves differently; see below.\r
-No.      Definition         Arguments\r
-0        Reserved\r
-1        Load Window\r
-                            ES:BX - string  (filename to read from)\r
-2        Save Window\r
-                            ES:BX - string  (filename to write to)\r
-3        Reserved\r
-4        Reserved        \r
-6        Reserved        \r
-7        Set Window Size\r
-                            ES:BX - 4 element word vector of window settings:\r
-                            Xmin, Ymin, Xmax, Ymax\r
-8        Reserved\r
-9        Set Patterns        \r
-                            ES:BX - 16 element vector of byte values\r
-                            containing the screen-to-printer color                                          correspondence\r
-10        Get Patterns\r
-                            ES:BX - room for 16 bytes as above\r
-11        Set Mode\r
-12,13,14  Reserved\r
-15        Get Window\r
-                            ES:BX - room for 4 words of the current window\r
-                            settings\r
-16         Set Print Options\r
-                            ES:BX - character string of printer options.\r
-                            Same format as for the FRIEZE command.\r
-17, 18, 19        Reserved\r
-20        Get FRIEZE Version.\r
-                            AH gets the whole number portion and AL gets the\r
-                            decimal portion of the version number.  (eg. for\r
-                            Freize vesion 7.41, AH will contain 7 and AL will\r
-                            contain 41.  If AH =0, you are calling a pre-7.0\r
-                            version of FRIEZE).\r
-21        Set Parameters\r
-                            ES:BX points to an 8 word table  (16 bytes) of\r
-                            parameter settings: TopMargin, LeftMargin,\r
-                            HSize,VSize, Quality/Draft Mode, PrintHres,\r
-                            PrintVres, Reserved.\r
-                            Margins and sizes are specified in hundredths\r
-                            of inches.\r
-                                    Q/D mode parameter values:\r
-                                    0 - draft print mode\r
-                                    1 - quality print mode\r
-                                    Print resolutions are specified in DPI.\r
-                            Any parameter which should be left unchanged may\r
-                            be filled with a (-1) (0FFFF hex).  The reserved\r
-                            settings should be filled with a (-1).\r
-22        Get Parameters\r
-                            ES:BX points to an 8 word table (16 bytes) where\r
-                            parameter settings are held.\r
-23        Get Printer Res\r
-                            ES:BX points to a 12 word table (24 bytes) that\r
-                            holds six printer resolution pairs.\r
-24        Reserved (versions 8.00 & up)\r
-\r
-FRIEZE Error Codes\r
-\r
-When FRIEZE is called using interrupt 10 hex, it will return an error code\r
-in the AX register.  A value of zero shows that there was no error.  A\r
-nonzero result means there was an error.  These error codes are explained\r
-below.\r
-\r
- 0        No Error\r
- 1        Printout was stopped by user with the ESC key\r
- 2        Reserved\r
- 3        File read error\r
- 4        File write error\r
- 5        File not found\r
- 6        Invalid Header - not an image, wrong screen mode\r
- 7        File close error\r
- 8        Disk error - usually drive door open\r
- 9        Printer error - printer is off or out of paper\r
-10        Invalid command - CL was set to call a nonexistent  FRIEZE function\r
-11        Can't create file - write protect tab or disk is full\r
-12        Wrong video mode - FRIEZE cannot capture text screens.\f\r
-\r
-Technical Reference Manual\r
-\r
-Including information for:\r
-Publisher's Paintbrushr\r
-PC Paintbrush IVTM\r
-PC Paintbrush IV PlusTM\r
-PC Paintbrush PlusTM\r
-PC Paintbrushr\r
-FRIEZETM Graphics\r
-PaintbrushTM\r
-Revision 5\r
-\r
-ZSoft Corporation\r
-450 Franklin Rd. Suite 100\r
-Marietta, GA  30067\r
-(404) 428-0008\r
-(404) 427-1150 Fax\r
-(404) 427-1045 BBS\r
-\r
-Copyright c 1985, 1987, 1988, 1990, 1991, ZSoft Corporation \r
-All Rights Reserved\r
-\r
-\r
-\r
diff --git a/16/PCGPE10/PERSPECT.TXT b/16/PCGPE10/PERSPECT.TXT
deleted file mode 100644 (file)
index cc58ad9..0000000
+++ /dev/null
@@ -1,149 +0,0 @@
-\r
-                   ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-                   ³ Perspective Transforms ³\r
-                   ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-        By Andre Yew (andrey@gluttony.ugcs.caltech.edu)\r
-\r
-\r
-\r
-    This is how I learned perspective transforms --- it was\r
-intuitive and understandable to me, so perhaps it'll be to\r
-others as well.  It does require knowledge of matrix math\r
-and homogeneous coordinates.  IMO, if you want to write a\r
-serious renderer, you need to know both.\r
-\r
-   First, let's look at what we're trying to do:\r
-               S (screen)\r
-               |    * P (y, z)\r
-               |   /|\r
-               |  / |\r
-               | /  |\r
-               |/   |\r
-               * R  |\r
-             / |    |\r
-            /  |    |\r
-           /   |    |\r
-   E (eye)/    |    | W\r
----------*-----|----*-------------\r
-         <- d -><-z->\r
-\r
-   E is the eye, P is the point we're trying to project, and\r
-R is its projected position on the screen S (this is the point\r
-you want to draw on your monitor).  Z goes into the monitor (left-\r
-handed coordinates), with X and Y being the width and height of the\r
-screen.  So let's find where R is:\r
-\r
-    R = (xs, ys)\r
-\r
-    Using similar triangles (ERS and EPW)\r
-\r
-    xs/d = x/(z + d)\r
-    ys/d = y/(z + d)\r
-    (Use similar triangles to determine this)\r
-\r
-    So,\r
-\r
-    xs = x*d/(z + d)\r
-    ys = y*d/(z + d)\r
-\r
-    Express this homogeneously:\r
-\r
-    R = (xs, ys, zs, ws).\r
-\r
-    Make xs = x*d\r
-         ys = y*d\r
-         zs = 0 (the screen is a flat plane)\r
-         ws = z + d\r
-\r
-    and express this as a vector transformed by a matrix:\r
-\r
-    [x y z 1][ d 0 0 0 ]\r
-             [ 0 d 0 0 ]    =  R\r
-             [ 0 0 0 1 ]\r
-             [ 0 0 0 d ]\r
-\r
-    The matrix on the right side can be called a perspective transform.\r
-But we aren't done yet.  See the zero in the 3rd column, 3rd row of\r
-the matrix?  Make it a 1 so we retain the z value (perhaps for some\r
-kind of Z-buffer).  Also, this isn't exactly what we want since we'd\r
-also like to have the eye at the origin and we'd like to specify some\r
-kind of field-of-view.  So, let's translate the matrix (we'll call\r
-it M) by -d to move the eye to the origin:\r
-\r
-    [ 1 0 0  0 ][ d 0 0 0 ]\r
-    [ 0 1 0  0 ][ 0 d 0 0 ]\r
-    [ 0 0 1  0 ][ 0 0 1 1 ]  <--- Remember, we put a 1 in (3,3) to\r
-    [ 0 0 -d 1 ][ 0 0 0 d ]       retain the z part of the vector.\r
-\r
-    And we get:\r
-\r
-    [ d 0 0  0 ]\r
-    [ 0 d 0  0 ]\r
-    [ 0 0 1  1 ]\r
-    [ 0 0 -d 0 ]\r
-\r
-    Now parametrize d by the angle PEW, which is half the field-of-view\r
-(FOV/2).  So we now want to pick a d such that ys = 1 always and we get\r
-a nice relationship:\r
-\r
-    d = cot( FOV/2 )\r
-\r
-    Or, to put it another way, using this formula, ys = 1 always.\r
-\r
-    Replace all the d's in the last perspective matrix and multiply\r
-through by sin's:\r
-\r
-    [ cos 0   0    0   ]\r
-    [ 0   cos 0    0   ]\r
-    [ 0   0   sin  sin ]\r
-    [ 0   0   -cos 0   ]\r
-\r
-    With all the trig functions taking FOV/2 as their arguments.\r
-Let's refine this a little further and add near and far Z-clipping\r
-planes.  Look at the lower right 2x2 matrix:\r
-\r
-   [ sin sin ]\r
-   [-cos 0   ]\r
-\r
-   and replace the first column by a and b:\r
-\r
-   [ a sin ]\r
-   [ b 0   ]\r
-   [ b 0   ]\r
-\r
-   Transform out near and far boundaries represented homogeneously\r
-as (zn, 1), (zf, 1), respectively and we get:\r
-\r
-   (zn*a + b, zn*sin) and (zf*a + b, zf*sin).\r
-\r
-   We want the transformed boundaries to map to 0 and 1, respectively,\r
-so divide out the homogeneous parts to get normal coordinates and equate:\r
-\r
-    (zn*a + b)/(zn*sin) = 0 (near plane)\r
-    (zf*a + b)/(zf*sin) = 1 (far plane)\r
-\r
-   Now solve for a and b and we get:\r
-\r
-   a = (zf*sin)/(zf - zn)\r
-     = sin/(1 - zn/zf)\r
-   b = -a*zn\r
-   b = -a*zn\r
-\r
-   At last we have the familiar looking perspective transform matrix:\r
-\r
-   [ cos( FOV/2 ) 0                        0            0 ]\r
-   [ 0            cos( FOV/2 )             0            0 ]\r
-   [ 0            0 sin( FOV/2 )/(1 - zn/zf) sin( FOV/2 ) ]\r
-   [ 0            0                    -a*zn            0 ]\r
-\r
-   There are some pretty neat properties of the matrix.  Perhaps\r
-the most interesting is how it transforms objects that go through\r
-the camera plane, and how coupled with a clipper set up the right\r
-way, it does everything correctly.  What's interesting about this\r
-is how it warps space into something called Moebius space, which\r
-is kind of like a fortune-cookie except the folds pass through\r
-each other to connect the lower folds --- you really have to see\r
-it to understand it.  Try feeding it some vectors that go off to\r
-infinity in various directions (ws = 0) and see where they come\r
-out.\r
diff --git a/16/PCGPE10/PIT.TXT b/16/PCGPE10/PIT.TXT
deleted file mode 100644 (file)
index a3127a1..0000000
+++ /dev/null
@@ -1,297 +0,0 @@
-         ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-         ³ Programming the Intel 8253 Programmable Interval Timer ³\r
-         ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-              Written for the PC-GPE by Mark Feldman\r
-              e-mail address : u914097@student.canberra.edu.au\r
-                               myndale@cairo.anu.edu.au\r
-\r
-                ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-                ³      THIS FILE MAY NOT BE DISTRIBUTED     ³\r
-                ³ SEPARATE TO THE ENTIRE PC-GPE COLLECTION. ³\r
-                ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Disclaimer ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-I assume no responsibility whatsoever for any effect that this file, the\r
-information contained therein or the use thereof has on you, your sanity,\r
-computer, spouse, children, pets or anything else related to you or your\r
-existance. No warranty is provided nor implied with this information.\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Introduction ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-The PIT chip has 3 channels, each of which are responsible for a different\r
-task on the PC:\r
-\r
-Channel 0 is responsible for updating the system clock. It is usually\r
-programmed to generate around 18.2 clock ticks a second. An interrupt 8 is\r
-generated for every clock tick.\r
-\r
-Channel 1 controls DMA memory refreshing. DRAM is cheap, but it's memory\r
-cells must be periodically refreshed or they quickly lose their charge. The\r
-PIT chip is responsible for sending signals to the DMA chip to refresh\r
-memory. Most machines are refreshed at a higher rate than neccesary, and\r
-reprogramming channel 1 to refresh memory at a slower rate can sometime speed\r
-up system performance. I got a 2.5 MHz speed-up when I did it to my 286, but\r
-it didn't seem to work on my 486SUX33.\r
-\r
-Channel 2 is connected to the speaker. It's normally programmed to generate\r
-a square wave so a continuous tone is heard. Reprogramming it for "Interrupt\r
-on Terminal Count" mode is a nifty trick which can be used to play 8-bit\r
-samples from the PC speaker.\r
-\r
-Each channel has a counter which counts down. The PIT input frequency is\r
-1193181 ($1234DD) Hz. Each counter decrements once for every input clock\r
-cycle. "Terminal Count", mentioned several times below, is when the counter\r
-reaches 0.\r
-\r
-Loading the counters with 0 has the same effect as loading them with 10000h,\r
-and is the highest count possible (approx 18.2 Hz).\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ The PIT Ports ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-The PIT chip is hooked up to the Intel CPU through the following ports:\r
-\r
-                ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-                ³ Port   Description                    ³\r
-                ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´\r
-                ³ 40h    Channel 0 counter (read/write) ³\r
-                ³ 41h    Channel 1 counter (read/write) ³\r
-                ³ 42h    Channel 2 counter (read/write) ³\r
-                ³ 43h    Control Word (write only)      ³\r
-                ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ The Control Word ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-              ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿\r
-              ³ 7 ³ 6 ³ 5 ³ 4 ³ 3 ³ 2 ³ 1 ³ 0 ³\r
-              ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÙ\r
-                ÀÄÂÄÙ   ÀÄÂÄÙ   ÀÄÄÄÂÄÄÄÙ   ÀÄÄ BCD 0 - Binary 16 bit\r
-                  ³       ³         ³               1 - BCD 4 decades\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄ¿  ³         ³\r
-³ Select Counter       ³  ³         ÀÄÄÄÄÄÄÄÄÄÄ Mode Number 0 - 5\r
-³ 0 - Select Counter 0 ³  ³\r
-³ 1 - Select Counter 1 ³  ³         ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-³ 2 - Select Counter 2 ³  ³         ³ Read/Load                  ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ  ³         ³ 0 - Counter Latching       ³\r
-                          ÀÄÄÄÄÄÄÄÄÄ´ 1 - Read/Load LSB only     ³\r
-                                    ³ 2 - Read/Load MSB only     ³\r
-                                    ³ 3 - Read/Load LSB then MSB ³\r
-                                    ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ The PIT Modes ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-The PIT is capable of operating in 6 different modes:\r
-\r
-MODE 0 - Interrupt on Terminal Count\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-When this mode is set the output will be low. Loading the count register\r
-with a value will cause the output to remain low and the counter will start\r
-counting down. When the counter reaches 0 the output will go high and remain\r
-high until the counter is reprogrammed. The counter will continue to count\r
-down after terminal count is reached. Writing a value to the count register\r
-during counting will stop the counter, writing a second byte starts the\r
-new count.\r
-\r
-MODE 1 - Programmable One-Shot\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-The output will go low once the counter has been loaded, and will go high\r
-once terminal count has been reached. Once terminal count has been reached\r
-it can be triggered again.\r
-\r
-MODE 2 - Rate Generator\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-A standard divide-by-N counter. The output will be low for one period of the\r
-input clock then it will remain high for the time in the counter. This cycle\r
-will keep repeating.\r
-\r
-MODE 3 - Square Wave Rate Generator\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-Similar to mode 2, except the ouput will remain high until one half of the\r
-count has been completed and then low for the other half.\r
-\r
-MODE 4 - Software Triggered Strobe\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-After the mode is set the output will be high. Once the count is loaded it\r
-will start counting, and will go low once terminal count is reached.\r
-\r
-MODE 5 - Hardware Triggered Strobe\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-Hardware triggered strobe. Similar to mode 5, but it waits for a hardware\r
-trigger signal before starting to count.\r
-\r
-Modes 1 and 5 require the PIT gate pin to go high in order to start\r
-counting. I'm not sure if this has been implemented in the PC.\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Counter Latching ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-Setting the Read/Load field in the Control Word to 0 (Counter Latch) causes\r
-the appropriate channel to go into a sort of "lap" mode, the counter keeps\r
-counting down internally but it appears to have stopped if you read it's\r
-values through the channel's counter port. In this way you get a stable count\r
-value when you read the counter. Once you send a counter latch command you\r
-*must* then read the counter.\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Doing Something Useful ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-Ok, so let's say we are writing a game and we need to have a certain\r
-routine called 100 times a second and we want to use channel 0 to do all\r
-this timing in the background while the main program is busy doing other\r
-stuff.\r
-\r
-The first thing we have to realise is that BIOS usually uses channel 0 to\r
-keep track of the time, so we have 3 options:\r
-\r
-1) Have our own routine handle all timer interrupts. This will effectively\r
-   stop the PC clock and the system time will be wrong from that point on.\r
-   The clock will be reset to the proper time the next time the computer\r
-   is turned off and on again, but it's not a nice thing to do to someone\r
-   unless you really have to.\r
-\r
-2) Have our routine do whatever it has to do and then call the BIOS handler.\r
-   This would be fine if our program was receiving the usual 18.2 ticks\r
-   a second, but we need 100 a second and calling the BIOS handler for every\r
-   tick will speed up the system time. Same net result as case 1.\r
-\r
-3) Have our routine do the interrupt handling and call the BIOS handler only\r
-   when it needs to be updated! BINGO!\r
-\r
-The PIT chip runs at a freqency of 1234DDh Hz, and normally the BIOS timer \r
-interrupt handler is called for every 10000h cycles of this clock. First we \r
-need to reprogram channel 0 to generate an interrupt 100 times a second, ie \r
-every 1234DDh / 100 = 11931 cycles. The best thing to do is keep a running \r
-total of the number of clock ticks which have occurred. For every interrupt \r
-generated we will add 11931 to this total. When it reaches 10000h our handler \r
-will know it's time to tell BIOS about it and do so.\r
-\r
-So let's get into some good old Pascal code. First we'll define a few\r
-constants and variables our program will need:\r
-\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-Uses Crt, Dos;\r
-\r
-{$F+} { Force far mode, a good idea when mucking around with interrupts }\r
-\r
-const TIMERINTR = 8;\r
-       PIT_FREQ = $1234DD;\r
-\r
-var BIOSTimerHandler : procedure;\r
-    clock_ticks, counter : longint;\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-The clock_ticks variable will keep track of how many cycles the PIT has\r
-had, it'll be intialised to 0. The counter variable will hold the new\r
-channel 0 counter value. We'll also be adding this number to clock_ticks\r
-every time our handler is called.\r
-\r
-Next we need to do some initialization:\r
-\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-procedure SetTimer(TimerHandler : pointer; frequency : word);\r
-begin\r
-\r
-  { Do some initialization }\r
-  clock_ticks := 0;\r
-  counter := $1234DD div frequency;\r
-\r
-  { Store the current BIOS handler and set up our own }\r
-  GetIntVec(TIMERINTR, @BIOSTimerHandler);\r
-  SetIntVec(TIMERINTR, TimerHandler);\r
-\r
-  { Set the PIT channel 0 frequency }\r
-  Port[$43] := $34;\r
-  Port[$40] := counter mod 256;\r
-  Port[$40] := counter div 256;\r
-end;\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-Pretty straightforward stuff. We save the address of the BIOS handler,\r
-install our own, set up the variables we'll use and program PIT channel 0\r
-for the divide-by-N mode at the frequency we need.\r
-\r
-This next bit is what we need to do once our program is finished. It just\r
-resets everything back to normal.\r
-\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-procedure CleanUpTimer;\r
-begin\r
-  { Restore the normal clock frequency }\r
-  Port[$43] := $34;\r
-  Port[$40] := 0;\r
-  Port[$40] := 0;\r
-\r
-  { Restore the normal ticker handler }\r
-  SetIntVec(TIMERINTR, @BIOSTimerHandler);\r
-end;\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-\r
-Ok, here's our actual handler. This particular handler just writes an\r
-asterix (*) to the screen. Then it does the checks to see if the BIOS\r
-handler should be called. If so it calls it, if not it acknowledges the\r
-interrupt itself.\r
-\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-\r
-procedure Handler; Interrupt;\r
-begin\r
-\r
-  { DO WHATEVER WE WANT TO DO IN HERE }\r
-  Write('*');\r
-\r
-  { Adjust the count of clock ticks }\r
-  clock_ticks := clock_ticks + counter;\r
-\r
-  { Is it time for the BIOS handler to do it's thang? }\r
-  if clock_ticks >= $10000 then\r
-    begin\r
-\r
-      { Yep! So adjust the count and call the BIOS handler }\r
-      clock_ticks := clock_ticks - $10000;\r
-\r
-      asm pushf end;\r
-      BIOSTimerHandler;\r
-    end\r
-\r
-  { If not then just acknowledge the interrupt }\r
-  else\r
-    Port[$20] := $20;\r
-end;\r
-\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-And finally our calling program. What follows is just an example program\r
-which sets everything up, waits for us to press a key and then cleans up\r
-after itself.\r
-\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-begin\r
-  SetTimer(Addr(Handler), 100);\r
-  ReadKey;\r
-  CleanUpTimer;\r
-end.\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ References ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-Title : "Peripheral Components"\r
-Publisher : Intel Corporation\r
-ISBN : 1-55512-127-6\r
diff --git a/16/PCGPE10/README.TXT b/16/PCGPE10/README.TXT
deleted file mode 100644 (file)
index 8eddc50..0000000
+++ /dev/null
@@ -1,293 +0,0 @@
-\r
-                 ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-                 ³ The PC GAMES PROGRAMMERS ENCYCLOPEDIA 1.0 ³\r
-                 ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Introduction ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-Well, here it is! This is the first edition of the PC Games Programmers\r
-Encyclopedia. The PC-GPE as it currently stands is a collection of text\r
-files, each covering a different aspect of programming games for the PC.\r
-Some files were obtained from the net, others were grabbed off Usenet, quite\r
-a few were written for the PC-GPE.\r
-\r
-Every effort has been made to contact the original authors of all public\r
-domain articles obtained via ftp. In some cases the original authors were\r
-not able to be contacted. Seeing as these files were already available to the\r
-public the liberty was taken to include them anyway. The files were not\r
-modified in any way. There is a list at the end of this document showing\r
-which files we couldn't contact the authors about. Please note that files\r
-were *not* written exclusively for the PC-GPE unless stated otherwise.\r
-\r
-The information in the PC-GPE is provided to you free of charge. The authors\r
-of each article have included their own conditions of use, eg some ask that\r
-you give them credit if you use their source code. As a general rule of\r
-thumb, an e-mail or postcard to an author telling them you found their file\r
-helpful probably wouldn't go astray.....\r
-\r
-This first version of the PC-GPE is very hardware oriented. We hope to\r
-include more actual game algorithms in future releases. If you would like to\r
-see a particular topic included in the next PC-GPE release or if you think\r
-you could contribute an article then by all means let us know (btw plugs for\r
-personal projects in articles are accepted). The editor's e-mail address is\r
-at the end of this file.\r
-\r
-Some of the text files are pretty long, so the PCGPE uses a protected mode\r
-file viewer (PCGPE.EXE) which may play up when run on 286 machines. If this\r
-happens read the DPMIUSER.DOC file for help on fixing the problem.\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ PC-GPE Home Site ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-The Games Programmers Encyclopedia official home site is:\r
-\r
-teeri.oulu.fi\r
-/pub/msdos/programming/gpe\r
-\r
-There are plans to develop GPE's for the mac and other architectures for\r
-cross-platform game development. The teeri site will also hold PC-GPE\r
-updates/bug fixes/etc.\r
-\r
-Many thanks to Jouni Miettunen for all his help and for allowing us to use\r
-teeri as the PC-GPE's home site. He's put a lot of work into it and it's a\r
-great programming resource, particularly for people wanting to develop game\r
-software.\r
-\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ History ³\r
-ÀÄÄÄÄÄÄÄÄÄÙ\r
-\r
-The PC-GPE was conceived, designed and largely built by the same people who\r
-keep the Usenet groups rec.games.programmer and comp.graphics.algorithms\r
-alive. It was noticed that information required for even the most basic game\r
-development was strewn out across the vast wastelands of the Internet and was\r
-time consuming and annoying (if not down-right impossible) to obtain.\r
-\r
-Most of us can't afford to go out and buy a book every time we want to look\r
-up a particlar topic, so a bunch of us decided to grab the most commonly\r
-sought-after free info and put it in one place.\r
-\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ The People Who Did All the Work ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-First a big thanks goes to everyone who wrote articles or allowed us to use\r
-their existing articles.\r
-\r
-Also thanks to the Demo groups Asphixia and VLA (more specifically Lithium\r
-and Denthor) for letting us use the asm and vga trainers they wrote.\r
-\r
-A number of people who didn't actually write articles contributed heaps\r
-to the project right from the start with tips/comments/suggestions etc as\r
-well as lots of info on where we could get stuff. Thanks go to Bri, Dizzy,\r
-Claus Anderson, Nathan Clegg, Alex Curylo, Cameron Grant, Chris Matrakidis\r
-and the many others who sent info. If it wasn't for them you probably\r
-wouldn't be reading this now!\r
-\r
-And finally thanks to Jouni Miettunen for setting up the PC-GPE directory on\r
-the teeri site, letting us use it as the official home site and supplying\r
-a heap of information.\r
-\r
-The editor would also like to thank the scores of other people who e-mailed\r
-him with suggestions, comments, requests etc...and continually hassled him to\r
-hurry up and get the damn thing finished.\r
-\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Disclaimer ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-It's a pity we live in a world where the following kind of crap is\r
-neccessary. Oh well, here goes....\r
-\r
-Each article appearing in the PC-GPE is bound by any disclaimer that appears\r
-within it. The editor assumes absolutely no responsibility whatsoever for\r
-any effect that this file viewer or any of the PC-GPE articles have on you,\r
-your sanity, computer, spouse, children, pets or anything else related to\r
-you or your existance. No warranty is provided nor implied with this\r
-information. The accuracy of the information contained is subject to\r
-conjecture. Use all information at your own risk. The file PC-GPE.EXE may\r
-not be distributed without all the original unmodified PC-GPE articles. The\r
-distribution rights of individual articles is at the discretion of the\r
-authors.\r
-\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ File List ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-The following is a list of all the PCGPE 1.0 files:\r
-\r
-File               Description\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-\r
-PCGPE    EXE   *   PC-GPE main exe file\r
-DPMIUSER DOC   *   PC-GPE.EXE DPMI info file\r
-RTM      EXE   *   PC-GPE.EXE DPMI support file\r
-RTMRES   EXE   *   PC-GPE.EXE DPMI support file\r
-DPMIINST EXE   *   PC-GPE.EXE DPMI support file\r
-DPMILOAD EXE   *   PC-GPE.EXE DPMI support file\r
-DPMI16BI OVL   *   PC-GPE.EXE DPMI support file\r
-\r
-README   TXT   *   PC-GPE main info doc\r
-FTPSITES TXT       List of FTP sites for game development programs/utils\r
-\r
-ASMINTRO TXT   *   VLA's assembly tutorial intro file\r
-ASM0     TXT   *   VLA's assembly tutorial\r
-ASM1     TXT   *   VLA's assembly tutorial\r
-ASM2     TXT   *   VLA's assembly tutorial\r
-ASM3     TXT   *   VLA's assembly tutorial\r
-ANSI     TXT   *   VLA's assembly tutorial support file\r
-\r
-INTEL    DOC       List of op codes plus timing info up to 486\r
-CPUTYPE  TXT   *   Testing CPU type\r
-TIMER    ASM   *   Testing CPU speed\r
-\r
-TUT1     TXT   *   Asphixia's VGA Primer - Mode 13h\r
-TUT2     TXT   *   Asphixia's VGA Primer - Palette/Fading\r
-TUT3     TXT   *   Asphixia's VGA Primer - Lines/Circles\r
-TUT4     TXT   *   Asphixia's VGA Primer - Virtual Screens\r
-TUT5     TXT   *   Asphixia's VGA Primer - Scrolling\r
-TUT6     TXT   *   Asphixia's VGA Primer - Look-up Tables\r
-TUT7     TXT   *   Asphixia's VGA Primer - Animation\r
-TUT8     TXT   *   Asphixia's VGA Primer - 3D/Optimisation\r
-TUT9     TXT   *   Asphixia's VGA Primer - 3D Solids\r
-TUT10    TXT   *   Asphixia's VGA Primer - Chain 4 mode\r
-COPPER   PAS   *   Asphixia's VGA Primer - Copper Effect\r
-WORMIE   PAS   *   Asphixia's VGA Primer - Worm Effect\r
-PALLETTE COL   *   Asphixia's VGA Primer support file\r
-SOFTROCK FNT   *   Asphixia's VGA Primer support file\r
-\r
-MODEX    TXT   *   Introduction to mode x\r
-SCROLL   TXT   *   VGA scrolling\r
-VGAREGS  TXT   *   VGA palette and register set\r
-VGABIOS  TXT       VGA BIOS function call list\r
-\r
-SVGINTRO TXT   *   SVGA - Intro to programming SVGA cards\r
-VESASP12 TXT       SVGA - The VESA standard\r
-ATI      TXT   *   SVGA - Programming the ATI chip set\r
-CAT      TXT   *   SVGA - Programming the Chips & Technologies chip set\r
-GENOA    TXT   *   SVGA - Programming the Genoa chip set\r
-PARADISE TXT   *   SVGA - Programming the Paradise chip set\r
-TRIDENT  TXT   *   SVGA - Programming the Trident chip set\r
-TSENG    TXT   *   SVGA - Programming the Tseng chip set\r
-VIDEO7   TXT   *   SVGA - Programming the Video7 chip set\r
-XTENDED  TXT   *   SVGA - 640x400x256 with no bank switching\r
-\r
-3DROTATE DOC   *   VLA's three dimensional rotations for computer graphics\r
-3DSHADE  DOC   *   VLA's three dimensional shading in computer graphics\r
-PERSPECT TXT   *   Perspective transforms\r
-BRES     TXT   *   Bresenham's line and circle algorithms\r
-CONIC    CC    *   A bresenham-like general conic sections algorithm\r
-BSP      TXT   *   A Simple Explanation of BSP Trees\r
-TEXTURE  TXT   *   Texture mapping\r
-FDTM     TXT   *   Real-time free direction texture mapping\r
-\r
-STARS    TXT   *   VLA's programming star fields\r
-FIRE     TXT   *   Programming fire effects\r
-\r
-PCX      TXT       PCX graphics file format\r
-BMP      TXT       BMP graphics file format\r
-GIF      TXT       GIF graphics file format\r
-IFF      DOC       IFF/LBM graphics file format\r
-FLI      FOR       FLI/FLC graphics file format\r
-\r
-SPEAKER  TXT   *   Programming the PC speaker (inc 8-bit sample playback)\r
-GAMEBLST TXT   *   Programming the GameBlaster sound card\r
-ADLIB    TXT       Programming the Adlib sound card\r
-SBDSP    TXT   *   Programming the SoundBlaster sound card (DSP)\r
-SBPRO    TXT   *   Programming the SoundBlaster Pro sound card\r
-GUSFAQ   TXT   *   The GUS sound card's Frequently Asked Questions\r
-GUS      TXT   *   Programming the GUS sound card\r
-\r
-MODFORM  TXT   *   The MOD sound file format\r
-VOC      TXT       The VOC sound file format\r
-WAV      TXT   *   The WAV sound file format\r
-CMF      TXT   *   The CMF sound file format\r
-MIDI     TXT   *   The MID sound file format\r
-UT       TXT       The UltraTracker sound file format\r
-\r
-SURROUND TXT       Generating surround sound\r
-\r
-MOUSE    TXT   *   Programming the mouse, general info\r
-GMOUSE   DOC       Mouse driver function call list\r
-KEYBOARD TXT   *   Programming for the PC keyboard\r
-JOYSTICK TXT   *   Programming for the PC joystick\r
-GAMEPAD  TXT   *   Programming for the Gravis GamePad and Analog Pro\r
-\r
-LIMEMS41 DOC       EMS (Expanded Memory Specification)\r
-XMS30    TXT       XMS (Extended Memory Specification)\r
-DMA_VLA  TXT   *   Intro to DMA\r
-\r
-PIT      TXT   *   Programming the Intel 8253 Programmable Interval Timer\r
-DOOM     TXT   *   DOOM techniques\r
-\r
-\r
-An asterix (*) indicates files which were either written for the PC-GPE or\r
-included with permission from the author.\r
-\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Final Words from the Editor ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-Greetz\r
-ÄÄÄÄÄÄ\r
-\r
-   Zob: Whaddaya mean you can't come out drinking with us for 6 months? What\r
-        the hell is "glandular fever" anyway?\r
-\r
-Wookie: Whaddaya mean I can't play ModemDOOM on a 2400?\r
-\r
-  Fink: Live fast, die young, have a good lookin' corpse!\r
-\r
-MainFrame, bri_acid, wReam, Nocturnus, MArtist, RetroSpec, Matrix, Syntax,\r
-Andrez, Gideon and the rest of the #coders gang : try and get some sleep\r
-                                                  some time guys!\r
-\r
-  Eyre: You/me babe, how 'bout it?\r
-\r
-  Aggi: Remember, reality is mass hallucination resulting from alcohol\r
-        deficiency!\r
-\r
-Fetish: You know the routine hon, pick a number and join the queue like\r
-        the rest of 'em!\r
-\r
-\r
-Why all my code is in Pascal\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-\r
-Ok, ok, I'm expecting to get lots of crap over this one. To put it simply\r
-Pascal is close to psuedo code and I wanted the routines to be understood\r
-by everyone, Pascal programmers, C programmers and *REAL* (to wit, asm)\r
-programmers alike. Apart from that I'm running a 40Mg doublespaced hard\r
-drive and I have to use the fastest compiler possible. That's a good enough\r
-reason isn't it?....people?.....\r
-\r
-\r
-Shameless Plug\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-\r
-There are two things in life I really can't stand,\r
-\r
-1) My ex-girlfriend\r
-2) Being unemployed, which I am now!\r
-\r
-So if your company has any openings I'd really like to hear from you,\r
-particularly if you develop game software.\r
-\r
-I'm a 3rd year computer engineering student and my specialties lie in\r
-computer graphics and low-level PC hardware programming. I program in C++\r
-(Dos and Windows), Pascal, 80x86 assembly, QBasic (heh heh) and Prolog.\r
-\r
-\r
-Mark Feldman\r
-Internet: u914097@student.canberra.edu.au\r
-          myndale@cairo.anu.edu.au\r
-\r
diff --git a/16/PCGPE10/RTM.EXE b/16/PCGPE10/RTM.EXE
deleted file mode 100644 (file)
index 2d11def..0000000
Binary files a/16/PCGPE10/RTM.EXE and /dev/null differ
diff --git a/16/PCGPE10/RTMRES.EXE b/16/PCGPE10/RTMRES.EXE
deleted file mode 100644 (file)
index 12e8ffe..0000000
Binary files a/16/PCGPE10/RTMRES.EXE and /dev/null differ
diff --git a/16/PCGPE10/SBDSP.TXT b/16/PCGPE10/SBDSP.TXT
deleted file mode 100644 (file)
index eab187f..0000000
+++ /dev/null
@@ -1,442 +0,0 @@
-\r
-                  ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-                  ³ Programming the SoundBlaster DSP ³\r
-                  ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-                  Written for the PC-GPE by Mark Feldman\r
-              e-mail address : u914097@student.canberra.edu.au\r
-                               myndale@cairo.anu.edu.au\r
-\r
-             ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-             ³      THIS FILE MAY NOT BE DISTRIBUTED     ³\r
-             ³ SEPARATE TO THE ENTIRE PC-GPE COLLECTION. ³\r
-             ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Disclaimer ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-I assume no responsibility whatsoever for any effect that this file, the\r
-information contained therein or the use thereof has on you, your sanity,\r
-computer, spouse, children, pets or anything else related to you or your\r
-existance. No warranty is provided nor implied with this information.\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Introduction ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-The SoundBlaster is capable of both FM and digitised sounds. The FM wave\r
-is fully Adlib compatible, so check the ADLIB.TXT file for info\r
-on how to program it. This file will concentrate on recording and playback\r
-of digital samples through the SoundBlaster CT-DSP 1321 chip.\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ The SoundBlaster DSP I/O Ports ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-The DSP (Digital Sound Processor) chip is programmed through 4 ports which\r
-are determined by the SoundBlaster base address jumper setting:\r
-\r
-                    RESET    2x6h\r
-\r
-                READ DATA    2xAh\r
-\r
-WRITE COMMAND/DATA output\r
-WRITE BUFFER STATUS input    2xCh\r
-\r
-\r
-           DATA AVAILABLE    2xEh\r
-\r
-where x = 1 for base address jumper setting 210h\r
-      x = 2 for base address jumper setting 220h\r
-      .\r
-      .\r
-      x = 6 for base address jumper setting 260h\r
-\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Resetting the DSP ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-You have to reset the DSP before you program it. This is done with the\r
-following procedure :\r
-\r
-1) Write a 1 to the SoundBlaster RESET port (2x6h)\r
-2) Wait for 3 micro-seconds\r
-3) Write a 0 to the SoundBlaster RESET port (2x6h)\r
-4) Read the byte from the DATA AVAILABLE (2xEh) port until bit 7 = 1\r
-5) Poll for a ready byte (AAh) from the READ DATA port (2xAh). Before\r
-   reading the READ DATA port it is avdvisable.\r
-\r
-The DSP usually takes somewhere around 100 micro-seconds to reset itself.\r
-If it fails to do within a reasonable time (say 200 micro-seconds) then\r
-an error has occurred, possibly an incorrect I/O address is being used.\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Writing to the DSP ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-A value can be written to the DSP with the following procedure :\r
-\r
-1) Read the DSP's WRITE BUFFER STATUS port (2xCh) until bit 7 = 0\r
-2) Write the value to the WRITE COMMAND/DATA port (2xCh)\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Reading the DSP ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-A value can be read from the DSP with the following procedure :\r
-\r
-1) Read the DSP's DATA AVAILABLE port (2xEh) until bit 7 = 1\r
-2) Read the data from the READ DATA port (2xAh)\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Turning the speaker on and controlling DMA ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-Speaker and DMA control are handled by writing one of the following bytes\r
-to the DSP:\r
-\r
-                     ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-                     ³ Value   Description     ³\r
-                     ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´\r
-                     ³ D0h    DMA Stop         ³\r
-                     ³ D1h    Turn speaker on  ³\r
-                     ³ D3h    Turn speaker off ³\r
-                     ³ D4h    DMA Continue     ³\r
-                     ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-DMA is discussed below. The DMA commands shown here can be used to pause\r
-the sample during DMA playback playback.\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Writing to the DAC ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-The DAC (Digital to Analog Converter) is the part of the card which converts\r
-a sample number (ie 0 -> 255) to a sound level. To generate a square sound\r
-wave at maximum volume (for example) you could alternate writing 0's and\r
-255's to the DAC.\r
-\r
-Programming the DAC in direct mode involves the main program setting the\r
-DAC to a desired value. Only 8 bit DAC is available in direct mode. To set\r
-the DAC level you write the value 10h to the DSP followed by the sample\r
-number (0 -> 255). Note that no sound will be heard unless the speaker has\r
-been turned on. In direct mode the main program is responsible for the\r
-timing between samples, the DAC can output sound samples as fast as the\r
-calling program can change it. Typically the timer interrupt is reprogrammed\r
-and used to generate the timing required for a sample playback. Info on\r
-programming the PIT chip can be found in the PIT.TXT file.\r
-\r
-The DAC can also be programmed to accept values sent to it via the DMA\r
-chip. Draeden has written an excellent article on programming the DMA chip\r
-(see DMA_VLA.TXT) so only a brief example of it's use will be given here.\r
-The important thing to remember is that the DMA chip cannot transfer data\r
-which crosses between page breaks. If the data does cross page breaks then\r
-it will have to be split up into several transfers, with one page per\r
-transfer.\r
-\r
-Setting the playback frequency for the DMA transfer is done by writing\r
-the value 40h to the DSP followed by TIME_CONSTANT, where\r
-TIME_CONSTANT = 256 - 1000000 / frequency\r
-\r
-There are several types of DMA transfers available. The following table\r
-lists them:\r
-\r
-      ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-      ³DMA_TYPE_VALUE   Description             Frequency Range    ³\r
-      ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´\r
-      ³    14h          8 bit                   4KHz -> 23 KHz     ³\r
-      ³    74h          4 bit ADPCM             4KHz -> 12 KHz     ³\r
-      ³    75h          4 bit ADPCM with        4KHz -> 12 KHz     ³\r
-      ³                 reference byte                             ³\r
-      ³    76h          2.6 bit ADPCM           4KHz -> 13 KHz     ³\r
-      ³    77h          2.6 bit ADPCM with      4KHz -> 13 KHz     ³\r
-      ³                 reference byte                             ³\r
-      ³    16h          2 bit ADPCM             4KHz -> 11 KHz     ³\r
-      ³    17h          2 bit ADPCM with        4KHz -> 11 KHz     ³\r
-      ³                 reference byte                             ³\r
-      ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-ADPCM stands for Adaptive Pulse Code Modulation, a sound compression\r
-technique where the difference between successive samples is stored rather\r
-than their actual values. In the modes with reference bytes, the first\r
-byte is the actual starting value. Having modes with and without reference\r
-bytes means you can output successive blocks without the need for a\r
-reference byte at the start of each one.\r
-\r
-The procedure for doing a DMA transfer is as follows:\r
-\r
-1) Load the sound data into memory\r
-2) Set up the DMA chip for the tranfer\r
-3) Set the DSP TIME_CONSTANT to the sampling rate\r
-4) Write DMA_TYPE_VALUE value to the DSP\r
-5) Write DATA_LENGTH to the DSP (2 bytes, LSB first) where\r
-   DATA_LENGTH = number of bytes to send - 1\r
-\r
-Note that the DMA chip must be programmed before the BSP.\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Reading from the ADC ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-Reading samples from the ADC (Analog to Digital Converter) can also be\r
-done in either direct or DMA mode.\r
-\r
-To read a sample in direct mode write the value 20h to the DSP and then\r
-read the value from the DSP. Simple as that!\r
-\r
-To set up the DSP for a DMA transfer, follow this procedure :\r
-\r
-1) Get a memory buffer ready to hold the sample\r
-2) Set up the DMA chip for the transfer\r
-3) Set the DSP TIME_CONSTANT to the sampling rate\r
-4) Write the value 24h to the DSP\r
-5) Write DATA_LENGTH to the DSP (2 bytes, LSB first) where\r
-   DATA_LENGTH = number of bytes to read - 1\r
-\r
-Note that the DMA chip must be programmed before the BSP.\r
-\r
-DMA reads only support 8 bit mode, compressed modes are done by software and\r
-stored in the voc file. I haven't tried to figure out how the compression is\r
-done. If someone does figure it out I'd like to know about it!\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Programming the DMA Chip ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-As mentioned before, Draeden has written a very good article on the dma\r
-chip, but here is a brief run down on what you would need to do to program\r
-the DMA channel 1 for the DSP in real mode:\r
-\r
-1) Calculate the 20 bit address of the memory buffer you are using\r
-   where Base Address = Segment * 16 + Offset\r
-   eg 1234h:5678h = 179B8h\r
-2) Send the value 05h to port 0Ah (mask off channel 1)\r
-3) Send the value 00h to port 0Ch (clear the internal DMA flip/flop)\r
-4) Send the value 49h to port 0Bh (for playback) or\r
-                  45h to port 0Bh (for recording)\r
-5) Write the LSB (bits 0 -> 7) of the 20 bit memory address to port 02h\r
-6) Write the MSB (bits 8 -> 15) of the 20 bit memory address to ort 02h\r
-7) Write the Page (bits 16 -> 19) of the 20 bit memory address to port 83h\r
-8) Send the LSB of DATA_LENGTH to port 03h\r
-9) Send the MSB of DATA_LENGTH to port 03h\r
-10) Send the value 01h to port 0Ah (enable channel 1)\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ End of DMA Interrupt ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-When a DMA transfer is complete an interrupt is generated. The actual\r
-interrupt number depends on the SoundBlaster card's IRQ jumper setting:\r
-\r
-                         ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-                         ³ IRQ Jumper             ³\r
-                         ³  Setting     Interrupt ³\r
-                         ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´\r
-                         ³    2            0Ah    ³\r
-                         ³    3            0Bh    ³\r
-                         ³    5            0Dh    ³\r
-                         ³    7            0Fh    ³\r
-                         ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-To service one of these interrupts you must perform these 3 tasks:\r
-\r
-1) Acknowledge the DSP interrupt by reading the DATA AVAILABLE port (2xEh)\r
-   once.\r
-2) If there are more blocks to transfer then set them up\r
-3) Output value 20h (EOI) to the interrupt controller port 20h\r
-\r
-Of course, as with any hardware interrupt you must also leave the\r
-state of the system (registers etc..) the way it was when the interrupt\r
-was called.\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ A Simple DSP Pascal Unit ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-{\r
-\r
-  DSP.PAS - A demo SoundBlaster DSP unit for real mode\r
-\r
-  By Mark Feldman\r
-}\r
-\r
-Unit DSP;\r
-\r
-Interface\r
-\r
-{ ResetDSP returns true if reset was successful\r
-  base should be 1 for base address 210h, 2 for 220h etc... }\r
-function ResetDSP(base : word) : boolean;\r
-\r
-{ Write DAC sets the speaker output level }\r
-procedure WriteDAC(level : byte);\r
-\r
-{ ReadDAC reads the microphone input level }\r
-function ReadDAC : byte;\r
-\r
-{ SpeakerOn connects the DAC to the speaker }\r
-function SpeakerOn: byte;\r
-\r
-{ SpeakerOff disconnects the DAC from the speaker,\r
-  but does not affect the DAC operation }\r
-function SpeakerOff: byte;\r
-\r
-{ Functions to pause DMA playback }\r
-procedure DMAStop;\r
-procedure DMAContinue;\r
-\r
-{ Playback plays a sample of a given size back at a given frequency using\r
-  DMA channel 1. The sample must not cross a page boundry }\r
-procedure Playback(sound : Pointer; size : word; frequency : word);\r
-\r
-Implementation\r
-\r
-Uses Crt;\r
-\r
-var      DSP_RESET : word;\r
-     DSP_READ_DATA : word;\r
-    DSP_WRITE_DATA : word;\r
-  DSP_WRITE_STATUS : word;\r
-    DSP_DATA_AVAIL : word;\r
-\r
-function ResetDSP(base : word) : boolean;\r
-begin\r
-\r
-  base := base * $10;\r
-\r
-  { Calculate the port addresses }\r
-  DSP_RESET := base + $206;\r
-  DSP_READ_DATA := base + $20A;\r
-  DSP_WRITE_DATA := base + $20C;\r
-  DSP_WRITE_STATUS := base + $20C;\r
-  DSP_DATA_AVAIL := base + $20E;\r
-\r
-  { Reset the DSP, and give some nice long delays just to be safe }\r
-  Port[DSP_RESET] := 1;\r
-  Delay(10);\r
-  Port[DSP_RESET] := 0;\r
-  Delay(10);\r
-  if (Port[DSP_DATA_AVAIL] And $80 = $80) And\r
-     (Port[DSP_READ_DATA] = $AA) then\r
-    ResetDSP := true\r
-  else\r
-    ResetDSP := false;\r
-end;\r
-\r
-procedure WriteDSP(value : byte);\r
-begin\r
-  while Port[DSP_WRITE_STATUS] And $80 <> 0 do;\r
-  Port[DSP_WRITE_DATA] := value;\r
-end;\r
-\r
-function ReadDSP : byte;\r
-begin\r
-  while Port[DSP_DATA_AVAIL] and $80 = 0 do;\r
-  ReadDSP := Port[DSP_READ_DATA];\r
-end;\r
-\r
-procedure WriteDAC(level : byte);\r
-begin\r
-  WriteDSP($10);\r
-  WriteDSP(level);\r
-end;\r
-\r
-function ReadDAC : byte;\r
-begin\r
-  WriteDSP($20);\r
-  ReadDAC := ReadDSP;\r
-end;\r
-\r
-function SpeakerOn: byte;\r
-begin\r
-  WriteDSP($D1);\r
-end;\r
-\r
-function SpeakerOff: byte;\r
-begin\r
-  WriteDSP($D3);\r
-end;\r
-\r
-procedure DMAContinue;\r
-begin\r
-  WriteDSP($D4);\r
-end;\r
-\r
-procedure DMAStop;\r
-begin\r
-  WriteDSP($D0);\r
-end;\r
-\r
-procedure Playback(sound : Pointer; size : word; frequency : word);\r
-var time_constant : word;\r
-     page, offset : word;\r
-begin\r
-\r
-  SpeakerOn;\r
-\r
-  size := size - 1;\r
-\r
-  { Set up the DMA chip }\r
-  offset := Seg(sound^) Shl 4 + Ofs(sound^);\r
-  page := (Seg(sound^) + Ofs(sound^) shr 4) shr 12;\r
-  Port[$0A] := 5;\r
-  Port[$0C] := 0;\r
-  Port[$0B] := $49;\r
-  Port[$02] := Lo(offset);\r
-  Port[$02] := Hi(offset);\r
-  Port[$83] := page;\r
-  Port[$03] := Lo(size);\r
-  Port[$03] := Hi(size);\r
-  Port[$0A] := 1;\r
-\r
-  { Set the playback frequency }\r
-  time_constant := 256 - 1000000 div frequency;\r
-  WriteDSP($40);\r
-  WriteDSP(time_constant);\r
-\r
-  { Set the playback type (8-bit) }\r
-  WriteDSP($14);\r
-  WriteDSP(Lo(size));\r
-  WriteDSP(Hi(size));\r
-end;\r
-\r
-end.\r
-\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ References ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-Title : The SoundBlaster Developpers Kit\r
-Publishers : Creative Labs Inc\r
-             Creative Technology PTE LTD\r
-\r
-Title : Sound Blaster - The Official Book\r
-Authors : Richard Heimlich, David M. Golden, Ivan Luk, Peter M. Ridge\r
-Publishers : Osborne/McGraw Hill\r
-ISBN : 0-07-881907-5\r
-\r
-Some of the information in this file was either obtained from or verified\r
-by the source code in a public domain library called SOUNDX by Peter\r
-Sprenger. I haven't tried using his library yet (I don't have a C compiler\r
-at the moment) but it looks very well done and contains numerous sound card\r
-detection routines. Says Peter : "It would be nice, that when you make\r
-something commercial with my routines, that you send me a copy of your\r
-project or send me some bucks, just enough for pizza and coke to support my\r
-night programming sessions. If you send me nothing, ok. But USE the stuff,\r
-if you can need it!". Heh...a REAL programmer!\r
-\r
-ftpsite: ftp.uwp.edu\r
-directory: /pub/msdos/demos/programming/game-dev/source\r
-filename: soundx.zip\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Sound Familiar? ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-What the...why is there a faint glimmer of sunlight outside? HOLY $#!^!! It's\r
-5:30am! I'm goin' to bed!\r
-\r
diff --git a/16/PCGPE10/SBPRO.TXT b/16/PCGPE10/SBPRO.TXT
deleted file mode 100644 (file)
index cc1915f..0000000
+++ /dev/null
@@ -1,267 +0,0 @@
-\r
-                  ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-                  ³ Programming the SoundBlaster Pro ³\r
-                  ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-                  Written for the PC-GPE by Mark Feldman\r
-              e-mail address : u914097@student.canberra.edu.au\r
-                               myndale@cairo.anu.edu.au\r
-\r
-             ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-             ³      THIS FILE MAY NOT BE DISTRIBUTED     ³\r
-             ³ SEPARATE TO THE ENTIRE PC-GPE COLLECTION. ³\r
-             ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Disclaimer ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-I assume no responsibility whatsoever for any effect that this file, the\r
-information contained therein or the use thereof has on you, your sanity,\r
-computer, spouse, children, pets or anything else related to you or your\r
-existance. No warranty is provided nor implied with this information.\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Introduction ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-I still own a SoundBlaster 1.0 (don't laugh) so I haven't been able to\r
-test any of the information in this file, ie don't take any of this as\r
-fact.\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Stereo Sound ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-Generating stereo FM sound on the SB Pro is similar to the way it's done\r
-on the SB 1.x, you just use different ports for the left and right channels.\r
-The file ADLIB.TXT has more information on this.\r
-\r
-Generating stereo sounds with the DSP is similar to the mono method, but you\r
-send *two* bytes for every sample. The first one goes to the left channel\r
-and the second one goes to the right. You also need to reset the mixer chip\r
-and tell the soundblaster you want to play a stereo sound (see below). This\r
-has the advantage in that you can store the info for both channels in a\r
-single data block and transfer it by still using only one DMA channel. The\r
-WAV file format actually stores it's audio waveform data like this (see the\r
-PC-GPE file WAV.TXT).\r
-\r
-\r
-  Left channel bytes\r
-\r
-  0       1       2       3       4       5       6\r
-ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ\r
-³   ³   ³   ³   ³   ³   ³   ³   ³   ³   ³   ³   ³   ³   ³   ........\r
-ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄ\r
-      0       1       2       3       4       5       6\r
-\r
-  Right channel bytes\r
-\r
-To play the sound the SoundBlaster Pro is set for stereo output and the DMA\r
-chip is programmed to send this chunk as is.\r
-\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ The CT 1345 Mixer Chip ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-\r
-You access the mixer registers the same way you access the regular SB\r
-registers, but Port 2x4h is the index port and 2x5h is the data read/write\r
-port, where x = 2 for base address jumper setting 220h\r
-            x = 3 for base address jumper setting 230h\r
-            x = 4 for base address jumper setting 240h\r
-\r
-So setting a mixer register to a given value can be accomplished with the\r
-following procedure:\r
-\r
-{ base = 220h, 230 or 240h }\r
-procedure SetMixerReg(base : word; index, value : byte);\r
-begin\r
-  Port[base + 4] := index;\r
-  Port[base + 5] := value;\r
-end;\r
-\r
-\r
-You can also read a register's current value:\r
-\r
-function GetMixerReg(base : word; index : byte) : byte;\r
-begin\r
-  Port[base + 4] := index;\r
-  GetMixerReg := Port[base + 5];\r
-end;\r
-\r
-\r
-\r
-\r
-\r
-The Data Reset register is used to reset the mixer chip. Set this register to\r
-0 before changing any of the other mixer registers.\r
-\r
-              Index = 00h\r
-              ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿\r
-              ³ 7 ³ 6 ³ 5 ³ 4 ³ 3 ³ 2 ³ 1 ³ 0 ³\r
-              ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÙ\r
-                ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-                              ³\r
-                          Data Reset\r
-\r
-\r
-\r
-\r
-The Input register selects the SB Pro sound input source and filter type.\r
-\r
-              Index = 0Ch\r
-              ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿\r
-              ³ 7 ³ 6 ³ 5 ³ 4 ³ 3 ³ 2 ³ 1 ³ 0 ³\r
-              ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÙ\r
-                        ÀÄÄÄÂÄÄÄÙ   ÀÄÂÄÙ\r
-                            ³         ³\r
-                ÚÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄ¿ ÚÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-                ³ In Filter       ³ ³ ADC Source        ³\r
-                ³ 000 - Low       ³ ³ 00 - Microphone 1 ³\r
-                ³ 001 - High      ³ ³ 01 - CD           ³\r
-                ³ 010 - No Filter ³ ³ 10 - Microphone 2 ³\r
-                ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ ³ 11 - Line In      ³\r
-                                    ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-\r
-\r
-The Output register determines whether to output sound in stereo or mono, in\r
-stereo two bytes must be sent for each sample, the first one goes to the left\r
-channel and the next one goes to the right. This register allows you to\r
-bypass the output filter.\r
-\r
-              Index = 0Eh\r
-              ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿\r
-              ³ 7 ³ 6 ³ 5 ³ 4 ³ 3 ³ 2 ³ 1 ³ 0 ³\r
-              ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÙ\r
-                        ³               ³\r
-           ÚÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄ¿ ÚÄÄÁÄÄÄÄÄÄÄÄÄ¿\r
-           ³ DNFI                  ³ ³ VSTC       ³\r
-           ³ 0 - Use O/P Filter    ³ ³ 0 - Mono   ³\r
-           ³ 1 - Bypass O/P Filter ³ ³ 1 - Stereo ³\r
-           ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ ÀÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-\r
-The Master Volume register allows you to set the master volume of each\r
-channel:\r
-\r
-              Index = 22h\r
-              ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿\r
-              ³ 7 ³ 6 ³ 5 ³ 4 ³ 3 ³ 2 ³ 1 ³ 0 ³\r
-              ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÙ\r
-                ÀÄÄÄÄÄÂÄÄÄÄÄÙ   ÀÄÄÄÄÄÂÄÄÄÄÄÙ\r
-                      ³               ³\r
-             ÚÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄ¿ÚÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄ¿\r
-             ³ Master Volume ³³ Master Volume ³\r
-             ³     Left      ³³     Right     ³\r
-             ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-\r
-The Voice Volume register allows you to set the volume of each channel for\r
-DSP output:\r
-\r
-              Index = 04h\r
-              ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿\r
-              ³ 7 ³ 6 ³ 5 ³ 4 ³ 3 ³ 2 ³ 1 ³ 0 ³\r
-              ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÙ\r
-                ÀÄÄÄÄÄÂÄÄÄÄÄÙ   ÀÄÄÄÄÄÂÄÄÄÄÄÙ\r
-                      ³               ³\r
-              ÚÄÄÄÄÄÄÄÁÄÄÄÄÄÄ¿ÚÄÄÄÄÄÄÄÁÄÄÄÄÄÄ¿\r
-              ³ Voice Volume ³³ Voice Volume ³\r
-              ³     Left     ³³     Right    ³\r
-              ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-                 Voice Volume    Voice Volume\r
-                    Left            Right\r
-\r
-\r
-The FM Volume register allows you to set the volume of each channel for\r
-FM wave synthesis:\r
-\r
-\r
-\r
-              Index = 26h\r
-              ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿\r
-              ³ 7 ³ 6 ³ 5 ³ 4 ³ 3 ³ 2 ³ 1 ³ 0 ³\r
-              ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÙ\r
-                ÀÄÄÄÄÄÂÄÄÄÄÄÙ   ÀÄÄÄÄÄÂÄÄÄÄÄÙ\r
-                      ³               ³\r
-                ÚÄÄÄÄÄÁÄÄÄÄÄ¿   ÚÄÄÄÄÄÁÄÄÄÄÄ¿\r
-                ³ FM Volume ³   ³ FM Volume ³\r
-                ³   Left    ³   ³   Right   ³\r
-                ÀÄÄÄÄÄÄÄÄÄÄÄÙ   ÀÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-\r
-The CD Volume register allows you to set the volume of each channel for\r
-CD output:\r
-\r
-              Index = 28h\r
-              ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿\r
-              ³ 7 ³ 6 ³ 5 ³ 4 ³ 3 ³ 2 ³ 1 ³ 0 ³\r
-              ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÙ\r
-                ÀÄÄÄÄÄÂÄÄÄÄÄÙ   ÀÄÄÄÄÄÂÄÄÄÄÄÙ\r
-                      ³               ³\r
-                ÚÄÄÄÄÄÁÄÄÄÄÄ¿   ÚÄÄÄÄÄÁÄÄÄÄÄ¿\r
-                ³ CD Volume ³   ³ CD Volume ³\r
-                ³   Left    ³   ³   Right   ³\r
-                ÀÄÄÄÄÄÄÄÄÄÄÄÙ   ÀÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-\r
-The Line Volume register allows you to set the volume of each channel for\r
-line in channel:\r
-\r
-\r
-              Index = 2Eh\r
-              ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿\r
-              ³ 7 ³ 6 ³ 5 ³ 4 ³ 3 ³ 2 ³ 1 ³ 0 ³\r
-              ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÙ\r
-                ÀÄÄÄÄÄÂÄÄÄÄÄÙ   ÀÄÄÄÄÄÂÄÄÄÄÄÙ\r
-                      ³               ³\r
-               ÚÄÄÄÄÄÄÁÄÄÄÄÄÄ¿ ÚÄÄÄÄÄÄÁÄÄÄÄÄÄ¿\r
-               ³ Line Volume ³ ³ Line Volume ³\r
-               ³    Left     ³ ³    Right    ³\r
-               ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÙ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-The Mic Mixing register allows you to set the input volume for the\r
-microphone:\r
-\r
-              Index = 0Ah\r
-              ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿\r
-              ³ 7 ³ 6 ³ 5 ³ 4 ³ 3 ³ 2 ³ 1 ³ 0 ³\r
-              ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÙ\r
-                                    ÀÄÄÄÂÄÄÄÙ\r
-                                        ³\r
-                                 ÚÄÄÄÄÄÄÁÄÄÄÄÄ¿\r
-                                 ³ Mic Mixing ³\r
-                                 ÀÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ References ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-Title : The SoundBlaster Developpers Kit\r
-Publishers : Creative Labs Inc\r
-             Creative Technology PTE LTD\r
-\r
-Title : Sound Blaster - The Official Book\r
-Authors : Richard Heimlich, David M. Golden, Ivan Luk, Peter M. Ridge\r
-Publishers : Osborne/McGraw Hill\r
-ISBN : 0-07-881907-5\r
-\r
-Some of the information in this file was either obtained from or verified\r
-by the source code in a public domain library called SOUNDX by Peter\r
-Sprenger. I haven't tried using his library yet (I don't have a C compiler\r
-at the moment) but it looks very well done and contains numerous sound card\r
-detection routines. Says Peter : "It would be nice, that when you make\r
-something commercial with my routines, that you send me a copy of your\r
-project or send me some bucks, just enough for pizza and coke to support my\r
-night programming sessions. If you send me nothing, ok. But USE the stuff,\r
-if you can need it!". Heh...a REAL programmer!\r
-\r
-ftp site: ftp.uwp.edu\r
-directory: /pub/msdos/demos/programming/game-dev/source\r
-filename: soundx.zip\r
-\r
diff --git a/16/PCGPE10/SCROLL.TXT b/16/PCGPE10/SCROLL.TXT
deleted file mode 100644 (file)
index b131853..0000000
+++ /dev/null
@@ -1,302 +0,0 @@
-\r
-\r
-\r
-      SSSSS   CCCCC  RRRRR    OOOOO  LL    LL    IIIIII NN    NN  GGGGG\r
-     SS   SS CC   CC RR  RR  OO   OO LL    LL      II   NNN   NN GG   GG\r
-     SS      CC      RR   RR OO   OO LL    LL      II   NNNN  NN GG\r
-      SSSSS  CC      RR  RR  OO   OO LL    LL      II   NN NN NN GG\r
-          SS CC      RRRRR   OO   OO LL    LL      II   NN  NNNN GG  GGG\r
-     SS   SS CC   CC RR  RR  OO   OO LL    LL      II   NN   NNN GG   GG\r
-      SSSSS   CCCCC  RR   RR  OOOOO  LLLLL LLLLL IIIIII NN    NN  GGGGG\r
-\r
-                    by Alec Thomas (Kestrel) of FORGE Software Australia\r
-                                          (c9223826@cs.newcastle.edu.au)\r
-\r
-\r
-------------\r
-INTRODUCTION\r
-------------\r
-Okay, here it is fans (and air conditioners, open windows...geez I hate that\r
-joke!), how to do scrolling using either X-mode (and associated variants) and\r
-standard mode 13h (not hard but I thought I'd put it in anyway :) as well as\r
-the basics of parallax scrolling...\r
-\r
-First things first - X-mode. Throughout this little dissertation, I'm going\r
-to assume that you know the basics of X-mode (or mode-X or mode-Y or\r
-whatever you want to call it) such as how to get into it, how to set the\r
-offset register, etc. and just get on with the scrolling :) I'm not trying\r
-to teach you X-mode, but SCROLLING!!\r
-\r
-One further thing. I'm not saying that the methods I'll explain below are\r
-the best method of scrolling, I'm just showing how I got it to work myself\r
-in the hope that someone out there can use it. Anyway, enough of this crap,\r
-on with the STUFF!!!\r
-\r
-(just a little note, when I'm talking about rows, they number from 0-199 and\r
-the same with columns (except 0-319), etc. unless otherwise stated)\r
-\r
-********************************************************************************\r
-*                               X-MODE SCROLLING                               *\r
-********************************************************************************\r
-------------------\r
-VERTICAL SCROLLING\r
-------------------\r
-Ok, this is the easiest form of scrolling using the VGA hardware...fast and\r
-clean. The following example assumes you are using 320x200 X-mode with the\r
-visible page starting at the top of the first page (offset 0).\r
-\r
-To scroll what is on the screen up off the top, you simply add 80 (decimal)\r
-to the screen offset register. This causes the screen to jump up by one\r
-row. However, it also causes whatever is off the bottom of the screen\r
-(the next page!) to become visible...not a desireable effect.\r
-\r
-Easily fixed however. Draw the image you want to scroll, on the row that\r
-will scroll on. So, when the screen offset is changed to scroll the screen\r
-up, the new data is already there for all to see. Beautiful!!!\r
-\r
------------ Scrolling A (up) --------------\r
-OFFSET = 0\r
-WHILE NOT FINISHED DO\r
-  OFFSET = OFFSET + 80\r
-  DRAW TO ROW 200\r
-  SET VGA OFFSET = OFFSET\r
-END WHILE\r
--------------------------------------------\r
-\r
-Bzzzzz! Wrong! This works fine, until you have scrolled down to the\r
-bottom of page 4. Because you're effectively off the bottom of the VGA\r
-window (starting at segment A000h), you can't write to the rest of the\r
-VGA memory (if there is any - only SVGA's have more than 256K on board\r
-memory) and so, you'll be viewing garbage.\r
-\r
-No problem. The way around it is to only use two pages!!! "What?" I hear\r
-you say. In fact, by using only two pages for scrolling, you gain two\r
-major advantages: page flipping (because you're only using two pages for\r
-the actual scrolling, you can use the spare two to perform page flipping)\r
-and infinite scroll regions.\r
-\r
-You perform the infinite scrolling in exactly the same way as before, with\r
-two minor additions: after changing the offset register, you copy the row\r
-just scrolled on to the row just scrolled off. Also, after you have scrolled\r
-a full page, you reset the offset to the top of the original page.\r
-\r
------------ Scrolling B (up) --------------\r
-OFFSET = 0\r
-WHILE NOT FINISHED DO\r
-  OFFSET = OFFSET + 80\r
-  IF OFFSET >= (200 * 80) THEN OFFSET = 0\r
-  DRAW TO ROW 200\r
-  SET VGA OFFSET = OFFSET\r
-  DRAW TO ROW -1 (was row 0 before scroll)\r
-END WHILE\r
--------------------------------------------\r
-\r
-Ok, so that's how to do vertical scrolling, now on with horizontal scrolling.\r
-\r
-\r
-\r
---------------------\r
-HORIZONTAL SCROLLING\r
---------------------\r
-Horizontal scrolling is essentially the same as vertical scrolling, all\r
-you do is increment or decrement the VGA offset register by 1 instead of\r
-80 as with vertical scrolling.\r
-\r
-However, horizontal scrolling is complicated by two things\r
-\r
-  1. Incrementing the offset register by one actually scrolls by FOUR\r
-     pixels (and there are FOUR planes on the VGA, what a coincidence)\r
-\r
-  2. You can't draw the image off the screen and then scroll it on\r
-     because of the way the VGA wraps to the next row every 80 bytes\r
-     (80 bytes * 4 planes = 320 pixels), if you tried it, you would\r
-     actually be drawing to the other side of the screen (which is\r
-     entirely visible)\r
-\r
-I'll solve these problems one at a time.\r
-\r
-Firstly, to get the VGA to scroll by only one pixel you use the horizontal\r
-pixel panning (HPP) register. This register resides at\r
-\r
-  PORT:     3C0H\r
-  INDEX:    13h\r
-\r
-and in real life, you use it like this\r
-\r
------------------ Pixel Panning ---------------\r
-IN PORT 3DAH (this clears an internal\r
-  flip-flop of the VGA)\r
-OUT 13H TO PORT 3C0H\r
-OUT value TO PORT 3C0H (where "value" is the\r
-  number of pixels to offset)\r
------------------------------------------------\r
-\r
-To implement smooth horizontal scrolling, you would do the following:\r
-\r
--------------- Horizontal Scrolling ------------\r
-FOR X = 0 TO 319 DO\r
-  SET HPP TO ( X MOD 4 )\r
-  SET VGA OFFSET TO ( X/4 )\r
-END FOR\r
-------------------------------------------------\r
-\r
-Okay, no problem at all (although I think you might have to fiddle\r
-around with the HPP a bit to get it right...try different values and\r
-see what works :).\r
-\r
-So, the next problem is with drawing the images off the screen where\r
-they aren't visible and then scrolling them on!!! As it turns out,\r
-there's yet ANOTHER register to accomplish this. This one's called the\r
-offset register (no, not the one I was talking about before, that one\r
-was actually the "start address" register) and it's at\r
-\r
-  PORT:     3D4H/3D5H\r
-  OFFSET:   13H\r
-\r
-and here's how to use it\r
-\r
--------------- Offset Register ---------------\r
-OUT 13H TO PORT 3D4H\r
-OUT value TO PORT 3D5H\r
-----------------------------------------------\r
-\r
-Now, what my VGA reference says is that this register holds the number\r
-of bytes (not pixels) difference between the start address of each row.\r
-So, in X-mode it normally contains the value 80 (as we remember,\r
-80 bytes * 4 planes = 320 pixels). This register does not affect the\r
-VISIBLE width of the display, only the difference between addresses on\r
-each row.\r
-\r
-When we scroll horizontally, we need a little bit of extra working space\r
-so we can draw off the edge of the screen.\r
-\r
-Perhaps a little diagram will clarify it. The following picture is of a\r
-standard X-mode addressing scheme with the OFFSET register set to 80.\r
-\r
-      ROW    OFFSET\r
-      0         0 ========================\r
-      1        80 [                      ]\r
-      2       160 [                      ]\r
-      ..       .. [       VISIBLE        ]\r
-                  [        SCREEN        ]\r
-                  [                      ]\r
-                  [                      ]\r
-      ..       .. [                      ]\r
-      199   15920 ========================\r
-\r
-and the next diagram is of a modified addressing scheme with the OFFSET\r
-register set to 82 (to give us 4 extra pixels on each side of the screen)\r
-\r
-ROW    OFFSET\r
-0         0 ------========================------\r
-1        82 |   V [                      ]   V |\r
-2       164 |   I [                      ]   I |\r
-..       .. | N S [      VISIBLE         ] N S |\r
-            | O I [       SCREEN         ] O I |\r
-            | T B [                      ] T B |\r
-            |   L [                      ]   L |\r
-..       .. |   E [                      ]   E |\r
-199   16318 ------========================------\r
-\r
-Beautiful!!!\r
-\r
-As with vertical scrolling, however, you still have the problem of when\r
-you reach the bottom of page 4...and it's fixed in the same manner.\r
-\r
-I haven't actually managed to get infinite horizontal scrolling working,\r
-but the method I have just stated will give you a horizontal scrolling\r
-range of over 200 screens!!!! So if you need more (which is extremely\r
-unlikely), figure it out yourself.\r
-\r
-\r
-------------------\r
-COMBINED SCROLLING\r
-------------------\r
-To do both horizontal and vertical scrolling, all you have to do is combine\r
-the two methods with a few little extras (it's always the way isn't it).\r
-\r
-You have to start off with the original screen on the current page and the\r
-next page as well. When you scroll horizontally, you have to draw the edge\r
-that's coming in to the screen to BOTH pages (that means you'll be drawing\r
-the incoming edge twice, once for each page). You do this so that when you\r
-have scrolled vertically down through a complete page, you can jump back\r
-to the first page and it will (hopefully) have an identical copy, and you\r
-can then continue scrolling again.\r
-\r
-I'm sorry about this being so confusing but it's a bit difficult to explain.\r
-\r
-\r
-\r
-\r
-\r
-********************************************************************************\r
-*                            STANDARD VGA SCROLLING                            *\r
-********************************************************************************\r
-Without X-mode, there is no easy way to do scrolling using the VGA hardware.\r
-So basically, you have to resort to redrawing the entire screen for every\r
-frame. Several popular games (Raptor and Mortal Kombat spring to mind)\r
-utilise this method with excellent effect, so it is quite effective.\r
-\r
-Basically all you do to implement this is redraw the screen every frame\r
-with a slightly different offset into the "map".\r
-\r
-The following bit of pseudo-code will scroll down and to the right\r
-through the map.\r
-\r
-------------- Standard Scrolling ---------------\r
-X = 0\r
-Y = 0\r
-WHILE NOT FINISHED DO\r
-  DRAW TO SCREEN( 0, 0 ) FROM MAP( X, Y )\r
-  X = X + 1\r
-  Y = Y + 1\r
-END WHILE\r
-------------------------------------------------\r
-\r
-\r
-\r
-\r
-\r
-********************************************************************************\r
-*                              PARALLAX SCROLLING                              *\r
-********************************************************************************\r
-Parallax scrolling is when the "world" appears to have different levels\r
-of perspective. That is, images further away from the viewer move\r
-proportionately slower than images closer to the screen.\r
-\r
-To implement parallax scrolling, you need two or more "maps". You start\r
-from the most distant map and end with the closest map. When you scroll,\r
-you offset the map furthest away by the smallest value and the map\r
-closest to you by the largest value.\r
-\r
-The following pseudo-code implements a 3 level parallax scrolling world,\r
-scrolling (as above) down to the right.\r
-\r
---------------- Parallax Scrolling ------------------\r
-X = 0\r
-Y = 0\r
-WHILE NOT FINISHED DO\r
-  DRAW TO SCREEN( 0, 0 ) USING MAP_FAR AT ( X/4, Y/4 )\r
-  DRAW TO SCREEN( 0, 0 ) USING MAP_MEDIUM AT ( X/2, Y/2 )\r
-  DRAW TO SCREEN( 0, 0 ) USING MAP_NEAR AT ( X, Y )\r
-  X = X + 4\r
-  Y = Y + 4\r
-END WHILE\r
------------------------------------------------------\r
-\r
-Obviously, with parallax scrolling, each successive map shouldn't delete\r
-the previous map entirely. So you'll have to draw the maps using some\r
-sort of masking (masking being where you can see through the background\r
-colour to what was there previously).\r
-\r
-\r
-********************************************************************************\r
-*                                  DISCLAIMER                                  *\r
-********************************************************************************\r
-I'm sorry if any of this is confusing, but hey that's half the fun of it -\r
-figuring out what the hell I'm raving on about :)\r
-\r
-So, if you can figure it out, have fun and make games (preferably good ones!)\r
-\r
-Later,\r
-      Kestrel => FORGE Software Australia\r
diff --git a/16/PCGPE10/SOFTROCK.FNT b/16/PCGPE10/SOFTROCK.FNT
deleted file mode 100644 (file)
index fa37613..0000000
Binary files a/16/PCGPE10/SOFTROCK.FNT and /dev/null differ
diff --git a/16/PCGPE10/SPEAKER.TXT b/16/PCGPE10/SPEAKER.TXT
deleted file mode 100644 (file)
index 09621af..0000000
+++ /dev/null
@@ -1,302 +0,0 @@
-                     ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-                     ³ Programming the PC Speaker ³\r
-                     ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-            Written for the PC-GPE by Mark Feldman\r
-            e-mail address : u914097@student.canberra.edu.au\r
-                             myndale@cairo.anu.edu.au\r
-\r
-              ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-              ³      THIS FILE MAY NOT BE DISTRIBUTED     ³\r
-              ³ SEPARATE TO THE ENTIRE PC-GPE COLLECTION. ³\r
-              ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Disclaimer ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-I assume no responsibility whatsoever for any effect that this file, the\r
-information contained therein or the use thereof has on you, your sanity,\r
-computer, spouse, children, pets or anything else related to you or your\r
-existance. No warranty is provided nor implied with this information.\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Basic Programming Info ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-The PC speaker has two states, in and out (0 and 1, on and off, Adam and\r
-Eve etc). You can directly set the state of the PC speaker or you can hook\r
-the speaker up to the output of PIT timer 2 to get various effects.\r
-\r
-Port 61h controls how the speaker will operate as follows:\r
-\r
-Bit 0    Effect\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-  0      The state of the speaker will follow bit 1 of port 61h\r
-  1      The speaker will be connected to PIT channel 2, bit 1 is\r
-         used as switch ie 0 = not connected, 1 = connected.\r
-\r
-Playing around with the bits in port 61h can prevent the Borland BC++ and\r
-Pascal sound() procedures from working properly. When you are done using the\r
-speaker make sure you set bit's 0 and 1 of port 61h to 0.\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Your First Tone ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-Ok, so lets generate a simple tone. We'll send a string of 0's and 1's to the\r
-PC speaker to generate a square wave. Here's the Pascal routine:\r
-\r
-\r
-Uses Crt;\r
-\r
-const SPEAKER_PORT = $61;\r
-\r
-var portval : byte;\r
-\r
-begin\r
-\r
-  portval := Port[SPEAKER_PORT] and $FC;\r
-\r
-  while not KeyPressed do\r
-    begin\r
-      Port[SPEAKER_PORT] := portval or 2;\r
-      Delay(5);\r
-      Port[SPEAKER_PORT] := portval;\r
-      Delay(5);\r
-    end;\r
-  ReadKey;\r
-end.\r
-\r
-On my 486SX33 this generates a tone of around about 100Hz.\r
-\r
-First this routine grabs the value from the speaker port, sets the lower two\r
-bits to 0 and stores it. The loop first sets the speaker to "on", waits a\r
-short while, sets it to "off" and waits another short while. I write the loop\r
-to do it in this order so that when a key is pressed and the program exits\r
-the loop the lower two bits in the speaker port will both be 0 so it won't\r
-prevent other programs which then use the speaker from working properly.\r
-\r
-This is a really bad way of generating a tone. While the program is running\r
-interrupts are continually occurring in the PC and this prevents the timing\r
-from being accurate. Try running the program and moving the mouse around.\r
-You can get a nicer tone by disabling interrupts first, but this would\r
-prevent the KeyPressed function from working. In any case we want to\r
-generate a nice tone of a given frequency, and using the Delay procedure\r
-doesn't really allow us to do this. To top it all off, this procedure uses\r
-all of the CPU's time so we can't do anything in the background while the\r
-tone is playing.\r
-\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Using PIT Channel 2 ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-Connecting the PC speaker to PIT channel 2 is simply a matter of programming\r
-the channel to generate a square wave of a given frequency and then setting\r
-the lower two bits in the speaker port to a 1. Detailed information on\r
-programming the PIT chip can be found in the file PIT.TXT, but here is\r
-the pascal source you'll need to do the job:\r
-\r
-const SPEAKER_PORT = $61;\r
-       PIT_CONTROL = $43;\r
-     PIT_CHANNEL_2 = $42;\r
-          PIT_FREQ = $1234DD;\r
-\r
-procedure Sound(frequency : word);\r
-var counter : word;\r
-begin\r
-\r
-  { Program the PIT chip }\r
-  counter := PIT_FREQ div frequency;\r
-  Port[PIT_CONTROL] := $B6;\r
-  Port[PIT_CHANNEL_2] := Lo(counter);\r
-  Port[PIT_CHANNEL_2] := Hi(counter);\r
-\r
-  { Connect the speaker to the PIT }\r
-  Port[SPEAKER_PORT] := Port[SPEAKER_PORT] or 3;\r
-end;\r
-\r
-procedure NoSound;\r
-begin\r
-  Port[SPEAKER_PORT] := Port[SPEAKER_PORT] and $FC;\r
-end;\r
-\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Playing 8-bit Sound Through the PC Speaker ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-Terminolgy\r
-ÄÄÄÄÄÄÄÄÄÄ\r
-\r
-To clear up any confusion, here's my own definition of some words I'll be\r
-using in this section:\r
-\r
-sample : A single value in the range 0-255 representing the input level of\r
-         the microphone at any given moment.\r
-\r
-volume : A sort of generic version of sample, not limited to the 0-255 range.\r
-\r
-  song : A bunch of samples in a row representing a continuous sound.\r
-\r
-string : A bunch of binary values (0-1) in a row.\r
-\r
-\r
-\r
-Programs like the legendary "Magic Mushroom" demo do a handly little trick\r
-to play 8-bit sound from the PC speaker by sending binary strings to the\r
-PC speaker for every sample they play. If the bits are all 0's, then the\r
-speaker will be "off". If they are all 1's the speaker will be "on". If they\r
-alternate 0's and 1's then the speaker will behave as if it's "half" on, and\r
-so forth.\r
-\r
-                ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-                ³ Bit string     Time speaker is on ³\r
-                ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´\r
-                ³ 11111111              100%        ³\r
-                ³ 11101110               75%        ³\r
-                ³ 10101010               50%        ³\r
-                ³ 10001000               25%        ³\r
-                ³ 00000000                0%        ³\r
-                ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-Note that in this table I've used strings which are 8 bits long meaning that\r
-there can only be 9 discrete volume levels (since anywhere from 0 to 8 of\r
-them can be set to 1). In reality the strings would be longer.\r
-\r
-The problem with using bit strings such as this is getting accurate timing\r
-between each bit you send. One way around this is to put all the 1's at the\r
-front of the string and all the 0's at the end, like so:\r
-\r
-                ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-                ³ Bit string     Time speaker is on ³\r
-                ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´\r
-                ³ 11111111              100%        ³\r
-                ³ 11111100               75%        ³\r
-                ³ 11110000               50%        ³\r
-                ³ 11000000               25%        ³\r
-                ³ 00000000                0%        ³\r
-                ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-This way you can send all the 1's as a single pulse and your timing doesn't\r
-have to be quite as accurate. The sound isn't quite as good, but I've found\r
-it to be pretty reasonable. A real advantage in using this method is that\r
-you can program the PIT chip for "interrupt on terminal count" mode, this\r
-mode is similar to the one-shot mode, but counting starts as soon as you\r
-load the PIT counter. So if you are playing an 11kHz song you simply load the\r
-PIT counter 11000 times a second with a value that's proportional to the\r
-sample value and trigger it. The speaker output will go low for the set time\r
-and then remain high until the next time you trigger it (in practise it\r
-doesn't matter whether the string of 1's make the speaker go "low" or\r
-"high", just so long as it's consistent). I've managed to get good results\r
-using PIT channel 2 to handle the one-shot for each sample and PIT channel 0\r
-to handle when to trigger channel 2 (ie 11000 times a second). *PLUS* I was\r
-able to have a program drawing stuff on the screen while all this was going\r
-on in the background!\r
-\r
-Incidently I should mention here that the "interrupt on terminal count" mode\r
-does not generate an actual interrupt on the Intel CPU. The mode was given\r
-this name since the PIT can can be hooked up to a CPU to generate an\r
-interrupt. As far as I can tell IBM didn't do it like this.\r
-\r
-This technique does have one nasty side-effect though. If you are playing an\r
-11kHz tone for example then the PC speaker will be being turned on and off\r
-exactly 11000 times a second, in other words you'll hear a nice 11kHz sine\r
-wave superimposed over the song (do any of you math weirdo's want to do\r
-a FFT to prove this for me?). A way around this is to play the song back\r
-at 22kHz and play each sample twice. This will result in a 22kHz sine wave\r
-which will pretty much be filtered out by the tiny PC speaker and the simple\r
-low-pass filter circuit that it's usually connected to on the motherboard.\r
-\r
-The PIT chip runs at a frequency of 1193181 Hz (1234DDh). If you are playing\r
-an 11kHz song at 22kHz then 1193181 / 22000 = 54 clocks per second, so\r
-you'll have to program the PIT to count a maximum of 54 clocks for each\r
-sample. What I'm getting at is that you'll only be able to play 54 discreet\r
-sample levels using this method, so you'll have to scale the 256 different\r
-levels in an 8-bit song to fit into this range which will also result in\r
-futher loss of sound quality. I sped things up considerably by pre-\r
-calculating a lookup table like so:\r
-\r
-var count_values : array[0..255] of byte;\r
-\r
-for level := 0 to 255 do\r
-  count_values[level] := level * 54 div 255;\r
-\r
-Then for each sample I just look up what it's counter value is and send\r
-that to the PIT chip. Since each value is of byte size you can program the\r
-PIT chip to accept the LSB only (see PIT.TXT for more info). The following\r
-pascal code will set the PIT chip up for "interrupt on terminal count" mode\r
-where only the LSB of the count needs to be loaded:\r
-\r
-Port[PIT_CONTROL] := $90;\r
-Port[SPEAKER_PORT] := Port[SPEAKER_PORT] or 3;\r
-\r
-And the following line will trigger the one-shot for a given sample value\r
-from 0-255:\r
-\r
-Port[PIT_CHANNEL_2] := count_values[sample_value];\r
-\r
-Do that 22000 times a second and whaddaya know, you'll hear "8-bit" sound\r
-from your PC speaker! Here's a bit of code which works ok on my machine:\r
-\r
-\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-\r
-const SPEAKER_PORT = $61;\r
-       PIT_CONTROL = $43;\r
-     PIT_CHANNEL_2 = $42;\r
-          PIT_FREQ = $1234DD;\r
-\r
-     DELAY_LENGTH = 100;\r
-\r
-procedure PlaySound(sound : PChar; length : word);\r
-var count_values : array[0..255] of byte;\r
-    i, loop : word;\r
-begin\r
-\r
-  { Set up the count table }\r
-  for i := 0 to 255 do\r
-    count_values[i] := i * 54 div 255;\r
-\r
-  { Set up the PIT and connect the speaker to it }\r
-  Port[PIT_CONTROL] := $90;\r
-  Port[SPEAKER_PORT] := Port[SPEAKER_PORT] or 3;\r
-\r
-  { Play the sound }\r
-\r
-  asm cli end;\r
-  for i := 0 to length - 1 do\r
-    begin\r
-      Port[PIT_CHANNEL_2] := count_values[byte(sound^)];\r
-      for loop := 0 to DELAY_LENGTH do;\r
-      Port[PIT_CHANNEL_2] := count_values[byte(sound^)];\r
-      for loop := 0 to DELAY_LENGTH do;\r
-      sound := sound + 1;\r
-    end;\r
-  asm sti end;\r
-\r
-  { Reprogram the speaker for normal operation }\r
-  Port[SPEAKER_PORT] := Port[SPEAKER_PORT] and $FC;\r
-  Port[PIT_CONTROL] := $B6;\r
-end;\r
-\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-\r
-\r
-Note that in this simple example I used a loop of DELAY_LENGTH to get the\r
-timing between samples. I had to fiddle around to get the right value for my\r
-machine and it varies from machine to machine. I also disable interrupts\r
-while the inner loop is playing, otherwise you hear the 18.2Hz timer tick\r
-while the sound was playing.\r
-\r
-\r
-Both of these techniques suffer from two drawbacks. The first is that\r
-samples played from the speaker do not sound very loud. You can make them\r
-louder by making the song you are playing louder, but this eventually means\r
-the sample values will start falling outside the 0-255 range and you'll have\r
-to clip them which starts distorting the sound. The second problem is that\r
-this technique doesn't work on the psezio-electric "speakers" inside lap-top\r
-computers.\r
-\r
diff --git a/16/PCGPE10/STARS.TXT b/16/PCGPE10/STARS.TXT
deleted file mode 100644 (file)
index ddb6527..0000000
+++ /dev/null
@@ -1,710 +0,0 @@
------------------------------ VLA.NFO -----------------------------------\r
-        ÖÄÄÄÄÄÄÄÄÄÄ (% VLA Presents Intro To Starfields %) ÄÄÄÄÄÄÄÄÄÄ·\r
-        º                                                            º\r
-        ÓÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Written áy : Draeden ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĽ\r
-\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ \ 4 VLA Members Are \ 4 ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-\r
-\r
-                        (© Draeden - Main Coder ª)\r
-                  (© Lithium - Coder/Ideas/Ray Tracing ª)\r
-                   (© The Kabal - Coder/Ideas/Artwork ª)\r
-                      (© Desolation - Artwork/Ideas ª)\r
-\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ The Finn - Mods/Sounds ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-\r
-\r
-   ÖÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Contact Us On These Boards: ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ·\r
-   º                                                                      º\r
-   ³   % Phantasm BBS .................................. (206) 232-5912   ³\r
-   ³   * The Deep ...................................... (305) 888-7724   ³\r
-   ³   * Dark Tanget Systems ........................... (206) 722-7357   ³\r
-   ³   * Metro Holografix .............................. (619) 277-9016   ³\r
-   ³                                                                      ³\r
-   º       % - World Head Quarters      * - Distribution Site             º\r
-   ÓÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĽ\r
-\r
-     Or Via Internet Mail For The Group : tkabal@carson.u.washington.edu\r
-\r
-                      Or to reach the other members :\r
-\r
-                       - draeden@u.washington.edu -\r
-\r
-                       - lithium@u.washington.edu -\r
-\r
-                     - desolation@u.washington.edu -\r
-\r
-\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ STARS.TXT ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-;\r
-;     TITLE: Star field\r
-;WRITTEN BY: DRAEDEN\r
-;      DATE: 03/15/93\r
-;\r
-;     NOTES:\r
-;\r
-;ASSOCIATED FILES:\r
-;\r
-;       STARGEN.BAS =>  Basic program that generates a set of 'randomized'\r
-;                       numbers.  Creates STARRND.DW\r
-;\r
-;       STARS.ASM   =>  The asm file.\r
-;\r
-;       STARRND.DW  =>  File that contains a set of shuffled numbers order.\r
-;                       Used to create 'random' star field.\r
-;\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-\r
-    A star field is just a series of 3d point plotted onto a 2d plane (your\r
-screen).  The movement effect is achieved by simply decreasing the Z\r
-cordinate and redisplaying the results.  The formula for the 3d to 2d\r
-conversion is:\r
-\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-    ScreenX = ScreenDist * Xpos / Zpos\r
-    ScreenY = ScreenDist * Ypos / Zpos\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ \r
-\r
-    This should make perfect sense.  As the object gets futher away, (X,Y)\r
-cordinates converge to (0,0).  The screen dist is how far away the 'eye' is\r
-from the screen, or, as I like to think of it, the window.  Naturally, as you\r
-get closer to the window, your field of view is greatly enhanced (you can see\r
-more).  But, because we can't make the monitor bigger, we have to shrink the\r
-data that is being displayed.  And when we have a large screen distance, we\r
-should see less of the virtual world, and the objects should appear bigger.\r
-When this formula is translated into assembler, you would immediatly decide\r
-that 256 is the best screen distance.  Why?  Multiplying by 256 on the 386 is\r
-as simple as this:\r
-\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ \r
-;we want to multiply ax by 256 and put it into dx:ax to set up for division\r
-\r
-    movsx   dx,ah   ;3 cycles\r
-    shl     ax,8    ;3 cycles -- total 6\r
-\r
-;or we could do it the 'normal way'...\r
-\r
-    mov     dx,256  ;2 cycles, but we can have any screen distance\r
-    imul    dx      ;9-22 cycles on a 386, 13-26 on a 486\r
-                    ;a total of 11-28 cycles!\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ \r
-\r
-    If you'll take note, the 6 cycle trick is AT LEAST 5 cycles faster than\r
-the imul.  Anyway... I bet you really don't care about a few cycles at this\r
-point, so I won't spend much more time on it... \r
-    So, as you can see, the math part of it is easy..  the hard part is the\r
-what's left.  You need a routine that creates a star, presumably random, and\r
-another routine that displays all the stars and advances them.  Well, that's\r
-how I broke it into subroutines...\r
-\r
-    For the routine that creates the star you need it to:\r
-\r
-    1)  See if we already have enough stars going (is NUMSTARS > MAXSTARS ?)\r
-    2)  If there's room, scan for the first open slot... \r
-    3)  Now that we've found where to put it, create a star by getting a set\r
-        of random numbers for the (X,Y) and setting the Z to the maximum.\r
-        Also select a color for the star.\r
-\r
-    The display routine would need to:\r
-\r
-    1)  Erase the old star.\r
-    2)  Calculate the screen X & Y positions for the new position.  Are they \r
-        inside the screen boundries?  If not, 'kill' the star, otherwise \r
-        display it.  The shade of the color to use must be calculated by \r
-        using the Z cordinate. Color = BaseColor + Zpos / 256\r
-    3)  Decrease the Zpos.\r
-\r
-    And the main routine would:\r
-\r
-    1)  Call MakeStars\r
-    2)  Wait for verticle retrace\r
-    3)  Call DisplayStars\r
-    4)  Check for keypress, if there is one, handle it, if its not one we're\r
-        looking for then exit program.\r
-    5)  Loop to step 1\r
-\r
-    To impliment this, we need to create an array of records which has enough\r
-room for MAXSTARS.  The record would contain the (X,Y,Z) cordinates, the\r
-OldDi and the base color for the star.  To create a star, it first checks to\r
-see if there is room.  If there is, then we scan through the array\r
-looking%wor an open slot.  If we don't find an empty space, then we don't\r
-create a star.  We create the star by grabbing a pair of (X,Y) cordinates\r
-from the list of 'random' numbers and set the Z to MAXZPOS.  Then, increase\r
-NUMSTARS and return.\r
-\r
-    In displaying the star, we would like to only have to calculate DI once.\r
-So we save off a copy of DI in an array after we calculate it for the drawing\r
-so that erasing the dot is really quick.  Next we calculate the new DI for\r
-the dot.  This is done by using the formula mentioned above and this one: \r
-\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ \r
-\r
-    DI = ScreenY * ScreenWidth + ScreenX\r
-\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ \r
-\r
-    When doing the math, care must be taken to make sure that:\r
-\r
-        a) the Zpos is not zero and X*256/ZPOS is not greater than 32767.\r
-            will cause a DIVIDE BY ZERO or a DIVIDE OVERFLOW\r
-\r
-        b) SY and SX do not go outside the border of the screen.\r
-\r
-    If either of these conditions are broken, the star must be terminated and\r
-calculations for that star must be aborted.  Actually, Zpos = 0 is used to\r
-signify a nonactive star.  To terminate the star, you'd simply change its\r
-zpos to 0 and decrease NUMSTARS.\r
-\r
-    To create the different shades, I used:\r
-\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-\r
-  Color = BaseColor + Zpos/256\r
-\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-\r
-    I used 256 as the number to divide by because that enables me to do no\r
-dividing at all- I just use AH, because AH = AX / 256 (AH is the upper 8 bits\r
-of AX). This relation suggests that the MAXZPOS shoul be 16*256 for 16\r
-shades.  So, the MAXZPOS = 4096.  The palette will have to be set up so that\r
-the shades go from light to black (lower # is lighter).  Simple enough. (I\r
-hope.)\r
-\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ \r
-        RANDOM NUMBERS\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ \r
-\r
-    Well, not truly random numbers, but random enough for a starfield.\r
-\r
-    The problem:\r
-        There is no way on a PC to create truly random numbers with \r
-        great speed.\r
-\r
-    Solution:\r
-        Don't use truly random numbers.  Use a chart of non-repeating,\r
-        shuffled numbers that fall within your desired range.  That way\r
-        the stars will be evenly spread out and the creation of a new star\r
-        is incredably fast. ( A few MOV instructions) All you have to is grab\r
-        the number and increase the NEXTRANDOM pointer.  I chose to fill in\r
-        the array half with positive numbers, half with negative with a\r
-        minimum distance of 10 from 0.  I did this so that no stars will\r
-        'hit' the screen and just vanish.  That doesn't look too good.\r
-\r
-    Here's the BASIC file that made my numbers for me...\r
-\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ \r
-\r
-\r
-    NumStars = 400\r
-    dim     RndArray(NumStars)\r
-    randomize (timer)\r
-\r
-    'fill the array with numbers from -Numstars/2 to -10\r
-    'and from 10 to Numstars/2\r
-\r
-    i=10\r
-    for r = 0 to NumStars/2\r
-        RndArray(r)=i\r
-        i=i+1\r
-    next\r
-\r
-    i=-10\r
-    for r = NumStars/2 to NumStars\r
-        RndArray(r)=i\r
-        i=i-1\r
-    next\r
-\r
-    'randomly shuffle them..\r
-\r
-    print "Total numbers: ";NumStars\r
-    print "Shuffling - Please wait... "\r
-\r
-    for q = 1 to numstars/5\r
-        for r = 0 to NumStars\r
-            swnum1 = int(rnd*NumStars+.5)\r
-            swap RndArray(swnum1),RndArray(r)\r
-        next\r
-    next\r
-\r
-    'write the numbers neatly to a file\r
-\r
-    open "starrnd.dw" for output as 1\r
-    cc= 0          ' CC is my "Column Control"\r
-    print#1, "StarRnd dw ";:print#1, using"####";RndArray(0)\r
-    for r = 1 to NumStars\r
-\r
-        IF cc=0 THEN   ' is this the first one on the line?\r
-            print#1, "dw ";:print#1, using"####" ;RndArray(r);\r
-        ELSE \r
-            print#1, ",";:print#1, using"####"; RndArray(r);\r
-        END IF\r
-\r
-        cc=cc+1:if cc= 10 then cc=0:print#1," "   'goto the next line\r
-    next\r
-    close #1\r
-\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ \r
-\r
-    This brings up another point.  Whenever you can write a program in a\r
-higher level language to create data for you, do it.  It sure beats typing\r
-then in by hand.  For instance, the palette was made using the REPT macro,\r
-the actual data is created by the compiler at compile time.  Doing it that \r
-way happens to be a whole lot easier than typing in every byte.\r
-\r
-    Last minute note: I rigged the plus and minus keys up so that they\r
-control the 'Warpspeed' can be from 0 - MaxWarp, which I set to 90 or \r
-something like that.\r
-\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-\r
-   Well, that's it for now.  See INFO.VLA for information on contacting us.\r
-\r
-   I would like some suggestions on what to write code for.  What would you\r
-   like to see done?  What code would you like to get your hands on?\r
-\r
-   Send question, comments, suggestions to draeden@u.washington.edu or post\r
-    on Phantasm BBS.\r
-\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ STARS.ASM ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-;\r
-;     TITLE: Star field\r
-;WRITTEN BY: DRAEDEN\r
-;      DATE: 03/15/93\r
-;\r
-;     NOTES: Need 386 to execute.\r
-;\r
-;ASSOCIATED FILES:\r
-;\r
-;       STARGEN.BAS =>  Basic program that generates a set of 'randomized'\r
-;                       numbers.  Creates STARRND.DW\r
-;\r
-;       STARS.TXT   =>  The text file that explains starfields...\r
-;\r
-;       STARRND.DW  =>  File that contains a set of shuffled numbers.\r
-;                       Used to create 'random' star field.\r
-;\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-\r
-    DOSSEG\r
-    .MODEL SMALL\r
-    .STACK 200h\r
-    .CODE\r
-    .386\r
-    ASSUME CS:@CODE, DS:@CODE\r
-    LOCALS\r
-\r
-;=== GLOBALS\r
-;=== Data Includes\r
-\r
-INCLUDE starrnd.dw      ;file that has label StarRnd numbers\r
-\r
-;=== DATA Structures\r
-\r
-    Star_Struc      STRUC\r
-        X       dw  0\r
-        Y       dw  0\r
-        Z       dw  0\r
-        OldDi   dw  0       ;where to erase last dot\r
-        Color   db  0       ;BASE color. a number 0-16 is added to it\r
-    Star_Struc      ENDS\r
-\r
-    StarStrucSize = 9       ;number of bytes per entry\r
-\r
-;=== DATA\r
-\r
-ScreenWidth EQU 320\r
-ScreenHeight EQU 200\r
-\r
-NumRnds     EQU 400     ;number of random numbers defined\r
-\r
-MaxZpos     EQU 4096\r
-MinZpos     EQU 2\r
-MaxStars    EQU 190\r
-NumColors   EQU 5       ;number of Base colors in the Color Chart\r
-\r
-WarpSpeed   dw  15      ;how quickly the stars move toward ya\r
-MaxWarp     EQU 90\r
-\r
-Xindex      dw  30      ;index into the StarRnd chart for X & Y\r
-Yindex      dw  230     ; -note they must be different; set em the same to\r
-                        ;see why\r
-Cindex      dw  0       ;index into ColorChart\r
-\r
-ColorChart  db  0,16,32,48,64,80    ;a list of base colors (-1)\r
-\r
-Stars       Star_Struc MaxStars DUP (<>) ;where all the data is held\r
-NumActive   dw  0       ;number of stars active\r
-\r
-Palette     db  3 dup (0)   ;the palette.. first entrie is BG color (black)\r
-    i = 15\r
-    REPT    16\r
-            db  2*i,3*i,4*i\r
-        i=i-1\r
-    ENDM\r
-    i = 15\r
-    REPT    16\r
-            db  2*i,2*i,4*i\r
-        i=i-1\r
-    ENDM\r
-    i = 15\r
-    REPT    16\r
-            db  3*i,3*i,4*i\r
-        i=i-1\r
-    ENDM\r
-    i = 15\r
-    REPT    16\r
-            db  3*i,2*i,4*i\r
-        i=i-1\r
-    ENDM\r
-    i = 15\r
-    REPT    16\r
-            db  3*i,3*i,3*i\r
-        i=i-1\r
-    ENDM\r
-    i = 15\r
-    REPT    16\r
-            db  2*i,4*i,3*i\r
-        i=i-1\r
-    ENDM\r
-\r
-;=== Code Includes\r
-;=== SUBROUTINES\r
-\r
-    ;finds 1st available slot for a star and puts it there\r
-MakeStar PROC NEAR\r
-    pusha\r
-    mov     ax,cs\r
-    mov     es,ax\r
-    mov     ds,ax\r
-\r
-    cmp     [NumActive],MaxStars    ;is there room for another star?\r
-    jae     NoEmptySpace            \r
-\r
-    ;search for 1st available slot\r
-\r
-    mov     si,0\r
-TryAgain:\r
-    cmp     word ptr [Stars.Z+si],0     ;is this slot empty?\r
-    je      GotOne                      ;yes, go fill it\r
-\r
-    add     si,StarStrucSize\r
-    cmp     si,MaxStars*StarStrucSize\r
-    jb      TryAgain\r
-    jmp     NoEmptySpace\r
-\r
-GotOne:         ;si points to the record for the star to fill\r
-    mov     di,[Yindex]         ;grab index for Ypos\r
-    add     di,di               ;multiply by 2 to make it a WORD index\r
-    mov     ax,[StarRnd+di]     ;get the number\r
-    shl     ax,3                ;multiply by 8- could been done in BAS file\r
-    mov     [Stars.Y+si],ax     ;and save off the number\r
-    \r
-    mov     di,[Xindex]         ;grab index for Xpos\r
-    add     di,di               ;... same as above, but for Xpos\r
-    mov     ax,[StarRnd+di]\r
-    shl     ax,3\r
-    mov     [Stars.X+si],ax\r
-\r
-    mov     [Stars.Z+si],MaxZpos    ;reset Zpos to the max\r
-    inc     [NumActive]             ;we added a star so increase the counter\r
-\r
-    mov     di,[Cindex]             ;grab the color index\r
-    mov     al,[ColorChart+di]      ;grab the BaseColor for the star\r
-    mov     [Stars.Color+si],al     ;save it in the record\r
-\r
-    ;increase all the index pointers\r
-\r
-    inc     [Cindex]                ;increases the color counter\r
-    cmp     [Cindex],NumColors\r
-    jb      OkColor\r
-    mov     [Cindex],0\r
-OkColor:\r
-    inc     [Yindex]                ;increases Yindex\r
-    cmp     [Yindex],NumRnds        ;note that for this one we\r
-    jb      YindNotZero             ; subtract NumRnds from Yindex if we\r
-    sub     [Yindex],NumRnds        ; go off the end of the chart\r
-YindNotZero:\r
-    inc     [Xindex]                ;increase Xindex\r
-    cmp     [Xindex],NumRnds        ;have we gone through the entire chart?\r
-    jb      XindNotZero             ;nope...\r
-\r
-;This clever bit of code makes more use out of the chart by increasing Yindex\r
-; one additional unit each time Xindex goes through the entire chart... the\r
-; result is nearly NumRND^2 random non-repeating points\r
-        \r
-    inc     [Yindex]                ;yes, so change Yindex so that we get a\r
-    mov     ax,[Yindex]             ;new set of random (x,y)\r
-    cmp     ax,[Xindex]             ;does Xindex = Yindex?\r
-    jne     NotTheSame              ;if the index were the same, you'd see \r
-                                    ;a graph of the line Y = X, not good...\r
-    inc     [Yindex]                ;if they are the same, inc Yindex again\r
-NotTheSame:\r
-    mov     [Xindex],0              ;reset Xindex to 0\r
-XindNotZero:                        ;all done making the star...\r
-\r
-NoEmptySpace:\r
-    popa\r
-    ret\r
-MakeStar ENDP\r
-\r
-DisplayStars PROC NEAR\r
-    pusha\r
-    mov     ax,cs\r
-    mov     ds,ax\r
-    mov     ax,0a000h\r
-    mov     es,ax\r
-\r
-    mov     si,0\r
-DispLoop:\r
-    mov     cx,[Stars.Z+si]\r
-    or      cx,cx                   ;if Zpos = 0 then this star is dead...\r
-    je      Cont                    ;continue to the next one- skip this one\r
-\r
-    mov     di,[Stars.OldDi+si]     ;grab old Di\r
-    mov     byte ptr es:[di],0      ;erase the star\r
-    \r
-    cmp     cx,MinZpos\r
-    jl      TermStar                ;if Zpos < MinZpos then kill the star\r
-\r
-    mov     ax,[Stars.Y+si]\r
-    movsx   dx,ah                   ;'multiply' Ypos by 256\r
-    shl     ax,8\r
-    \r
-    idiv    cx                      ;and divide by Zpos\r
-    add     ax,ScreenHeight/2       ;center it on the screen\r
-    mov     di,ax\r
-    cmp     di,ScreenHeight         ;see if the star is in range. \r
-    jae     PreTermStar             ; If not, kill it\r
-    imul    di,ScreenWidth          ; DI = Y*ScreenWidth\r
-\r
-    mov     ax,[Stars.X+si]\r
-    movsx   dx,ah                   ;multiply Xpos by 256\r
-    shl     ax,8\r
-\r
-    idiv    cx                      ;and divide by Zpos\r
-    add     ax,ScreenWidth/2        ;center it on the screen\r
-    cmp     ax,ScreenWidth          ;are we inside the screen boundries?\r
-    jae     PreTermStar\r
-    add     di,ax                   ; DI = Y * ScreenWidth + X\r
-\r
-    mov     [Stars.OldDi+si],di     ;save old di\r
-\r
-    ;calculate the color below\r
-\r
-    add     ch,cs:[Stars.Color+si]  ;i'm dividing cx (the zpos) by 256 and\r
-                                    ; putting the result in ch and adding\r
-                                    ; the base color to it in one instruction\r
-    mov     es:[di],ch              ;put the dot on the screen\r
-\r
-    mov     ax,cs:[WarpSpeed]\r
-    sub     cs:[Stars.Z+si],ax      ;move the stars inward at WarpSpeed\r
-\r
-Cont:\r
-    add     si,StarStrucSize        ;point to next record\r
-    cmp     si,MaxStars*StarStrucSize   ;are we done yet?\r
-    jb      DispLoop\r
-    popa\r
-    ret\r
-\r
-PreTermStar:\r
-    mov     [Stars.Z+si],1  ;this is here so that the star will get erased\r
-    jmp     short Cont      ;next time through if I just went off and killed\r
-                            ;the star, it would leave a dot on the screen\r
-TermStar:\r
-    mov     [Stars.Z+si],0  ;this actually kills the star, after it has\r
-    dec     [NumActive]     ;been erased\r
-    jmp     short Cont\r
-\r
-DisplayStars ENDP\r
-\r
-;=== CODE\r
-\r
-START:\r
-    mov     ax,cs\r
-    mov     ds,ax\r
-    mov     es,ax\r
-\r
-    mov     ax,0013h                ;set vid mode 320x200x256 graph\r
-    int     10h\r
-    \r
-    mov     dx,offset Palette\r
-    mov     ax,1012h                ; WRITE palette \r
-    mov     bx,0                    \r
-    mov     cx,256                  ;write entire palette\r
-    int     10h                     ;doesn't matter if we didnt define it all\r
-\r
-StarLoop:\r
-    call    MakeStar        ;make stars 2x as thick\r
-    call    MakeStar\r
-\r
-    mov     dx,3dah\r
-VRT:\r
-    in      al,dx\r
-    test    al,8\r
-    jnz     VRT             ;wait until Verticle Retrace starts\r
-\r
-NoVRT:\r
-    in      al,dx\r
-    test    al,8\r
-    jz      NoVRT           ;wait until Verticle Retrace Ends\r
-\r
-    call    DisplayStars\r
-\r
-    mov     ah,1            ;check to see if a char is ready\r
-    int     16h\r
-    jz      StarLoop        ;nope, continue\r
-    \r
-    mov     ah,0\r
-    int     16h             ;get the character & put in AX\r
-\r
-    cmp     al,"+"          ;compare ASCII part (al) to see what was pressed\r
-    jne     NotPlus\r
-\r
-    inc     [WarpSpeed]\r
-    cmp     [WarpSpeed],MaxWarp\r
-    jbe     StarLoop\r
-\r
-    mov     [WarpSpeed],MaxWarp\r
-    jmp     StarLoop\r
-\r
-NotPlus:\r
-    cmp     al,"-"\r
-    jne     NotMinus\r
-\r
-    dec     [WarpSpeed]\r
-    cmp     [WarpSpeed],0\r
-    jge     StarLoop\r
-\r
-    mov     [WarpSpeed],0\r
-    Jmp     StarLoop\r
-\r
-NotMinus:\r
-\r
-    mov     ax,0003h        ;set 80x25x16 char mode\r
-    int     10h\r
-    mov     ax,4c00h        ;return control to DOS\r
-    int     21h\r
-END START\r
-\r
-\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ STARRND.DW ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-\r
-StarRnd dw  166\r
-dw   67, 102,  46,-173,-154,-210,-192, 173,-196, -81 \r
-dw  -50,  36,  50,-200, -95, 209, -16,-179, -30,  18 \r
-dw  174, 197, 127,  71,  29,-121,-160,-176,  19, -52 \r
-dw -185,  89, 172,  74,-156, 157,-125, 144, -34,  69 \r
-dw   17, -40,  64, -98,-153, 125, 160, 140,-204, 141 \r
-dw  137,-165, -14, 154,-146, 119, 123, 165,-130, 168 \r
-dw -180, 143,  52, 107,-107,-102,  57,  27, 117,  37 \r
-dw  126,  15, -89, 184, 116, 183, -99,-139, 150, 188 \r
-dw   38,  90,  93,-194, 207,-187,  62,  59, 196,  12 \r
-dw -174,  54, 146,-137, 198, 162, 155,-163, -77,-144 \r
-dw  191,-132, -43, 151,-103,  20, -46,  13,-140,  31 \r
-dw  130,-169,-188, 109, -33,-150,-170,  68, -75,-201 \r
-dw -100,-171, -19, -61,-206, 149,  99, -76,-186, -44 \r
-dw -178,  34,  61,  28, 114, 199, 201, -83, -27,  63 \r
-dw  -38, 204, 208,-112,-208, 122, -90,  23,-122, 161 \r
-dw   35,-168, 170,-164,-151,  75, -60,-109,  85, 193 \r
-dw   45,-175,-134, 205, -21,  49, 133, -85, -47, -37 \r
-dw  -29, -96, -66,  73,-118, 147, -53, 120, 153,-155 \r
-dw  -11,  11,  95, -26, 134,-145, -49, -74,  42,-124\r
-dw  189, -42,  92,-167,  88,-126,-129,-108,-193, 195 \r
-dw  190,-106,-117, 203,  84, 139,-123, -94, -88,-158 \r
-dw  181, -97, -20,  82, -57, 112, -35,  14, -56, -58 \r
-dw  200,  80,-183, 106,  87,  30,  51, -28,  98, -12 \r
-dw -191,-128, -13,-184, 136,  43,-166, -62, -73,-116 \r
-dw  -31,-135,-101,  25,  41, -82, 110,  10, -45, -41 \r
-dw   97, 175, 138, 171,  72,-133,-157,  58,-104, 187 \r
-dw  192, -68, -87, 169,-110,  91, 129, 104, -70,-114 \r
-dw -138,-115,-141, -67,-195, -79, -69,  40,-147, -80 \r
-dw -119, 128, 152,-209,  83,  53, 159,  66,-190,  81 \r
-dw  -92, -10,-181, 135,  60,  33, -25,  70,  22, -72 \r
-dw  103, -23, 131,  79, -64,  55, -86, -32,-182,-136 \r
-dw   26, -54,-172,-148, 148, -65,-152,-207, -39, -71 \r
-dw   65, 179,-177,  24, 118, -59, -63,  44, 105, 206 \r
-dw  178, -84,-202, 132, 186, -17,  76, 176, -22, 177 \r
-dw -198,-159,-162,  78,  77, -55,-120,-203,-113, 156 \r
-dw -189,-197, 124, 121,-142, -15,-205,  56, 158, -18 \r
-dw  -93,-161,  39,  48, 101, -91, 182,-127, 108, 111 \r
-dw  -36,-143,  21,-149, -78, -48, 164, 202, 185, 180 \r
-dw  -51,-199, 100, 194,  32, -24, 142,  86,-111,  47\r
-dw  115,-105,  16, 167,  94, 163,  96, 113,-131, 145\r
-\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ STARGEN.BAS ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-\r
-'\r
-'Written by: Draeden /VLA\r
-'      Date: 03/15/93\r
-'\r
-'     Notes: Used for generating 'random' data for Stars.asm\r
-'\r
-\r
-\r
-        NumStars = 400\r
-        dim     RndArray(NumStars)\r
-        randomize (timer)\r
-\r
-        'fill the array with numbers from -Numstars/2 to -10\r
-        'and from 10 to Numstars/2\r
-\r
-        i=10\r
-        for r = 0 to NumStars/2\r
-                RndArray(r)=i\r
-                i=i+1\r
-        next\r
-        i=-10\r
-        for r = NumStars/2 to NumStars\r
-                RndArray(r)=i\r
-                i=i-1\r
-        next\r
-\r
-        'randomly shuffle them..\r
-\r
-        print "Total numbers: ";NumStars\r
-        print "Shuffling - Please wait... "\r
-\r
-        for q = 1 to numstars/5\r
-                for r = 0 to NumStars\r
-                        swnum1 = int(rnd*NumStars+.5)\r
-                        swap RndArray(swnum1),RndArray(r)\r
-                next\r
-        next\r
-\r
-        'write the numbers neatly to a file\r
-\r
-        open "starrnd.dw" for output as 1\r
-        cc= 0\r
-        print#1, "StarRnd dw ";:print#1, using"####";RndArray(0)\r
-        for r = 1 to NumStars\r
-\r
-                IF cc=0 THEN\r
-                        print#1, "dw ";:print#1, using"####" ;RndArray(r);\r
-                ELSE \r
-                        print#1, ",";:print#1, using"####"; RndArray(r);\r
-                END IF\r
-\r
-                cc=cc+1:if cc= 10 then cc=0:print#1," "\r
-        next\r
-        close #1\r
-\r
diff --git a/16/PCGPE10/SVGINTRO.TXT b/16/PCGPE10/SVGINTRO.TXT
deleted file mode 100644 (file)
index d4e13f4..0000000
+++ /dev/null
@@ -1,473 +0,0 @@
-            ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-            ³ Introduction to Programming the SVGA Cards  ³\r
-            ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-            Written for the PC-GPE by Mark Feldman\r
-            e-mail address : u914097@student.canberra.edu.au\r
-                             myndale@cairo.anu.edu.au\r
-\r
-             ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-             ³      THIS FILE MAY NOT BE DISTRIBUTED     ³\r
-             ³ SEPARATE TO THE ENTIRE PC-GPE COLLECTION. ³\r
-             ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Disclaimer ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-I assume no responsibility whatsoever for any effect that this file, the\r
-information contained therein or the use thereof has on you, your sanity,\r
-computer, spouse, children, pets or anything else related to you or your\r
-existance. No warranty is provided nor implied with this information.\r
-\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ SVGA Section Overview ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-The vast majority of the information presented in the PC-GPE was obtained\r
-from the book "Programmer's Guide to the EGA and VGA Cards - Includes Super\r
-VGAs, Second Edition" by Richard Ferraro, ISBN 0-201-57025-4, published\r
-by Addison-Wesley. This book is by far the most comprehensive VGA/SVGA\r
-reference I have seen to date and is more than worth it's price tag. I\r
-heartily recommend it to anyone wishing to do any serious graphics\r
-programming for the PC.\r
-\r
-The PC-GPE SVGA section was originally not going to be included in version 1\r
-due to the fact that I have only been able to verify that the info on the\r
-Paradise SVGA is correct. I will include it however, in the hope that\r
-everyone (and I mean *EVERYONE*) who reads these files and tries out the\r
-routines will e-mail me with the results they get so I can make the\r
-modifications in time for version 2.\r
-\r
-I will need to know these things:\r
-\r
-1) Your SVGA board name\r
-\r
-2) The id and revision number of the chip inside (if possible)\r
-\r
-3) What you tried and the results you got. This applies to *all* routines,\r
-   bank switching, chip detection etc....  I need to know everything!\r
-\r
-If a routine doesn't work as expected then let me know if it's doing anything\r
-at all. "The routine is stuffed you idiot" won't exactly help me much, but\r
-"I can only read pixels in bank 0 you idiot" just might......\r
-\r
-And of course there's always the chance that I've misunderstood my references\r
-so I need to have my mistakes pointed out to me as well. I'm a big boy...I\r
-can take it!\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Writing to the VGA Ports ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-Many of the PC-GPE SVGA texts have the PortW Pascal command as follows:\r
-\r
-PortW[PORTNUM] := VALUE;\r
-\r
-This command writes a 16 bit word to the port, the same as the asm op code:\r
-\r
-out dx, ax\r
-\r
-The effect of this code is the same as the following two Pascal statements:\r
-\r
-Port[PORTNUM] := Lo(VALUE);\r
-Port[PORTNUM + 1] := Hi(VALUE);\r
-\r
-I'm not sure if this is common to all the PC ports or only works on the\r
-VGA. (Perhaps someone could enlighten me?)\r
-\r
-The PortW command is very handy when writing to the SVGA extended registers.\r
-The SVGA register sets are all extensions of the VGA register sets and\r
-use an indexed addressing scheme to cut down on the number of ports they\r
-use. The texts often have register maps which look similar to the following:\r
-\r
-          PR0A Address Offset A\r
-          Index : 09h at port 3CEh\r
-          Read/Write at port 3CFh\r
-          ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿\r
-          ³ 7 ³ 6 ³ 5 ³ 4 ³ 3 ³ 2 ³ 1 ³ 0 ³\r
-          ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÙ\r
-                ÀÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÙ\r
-                           Bank\r
-\r
-For this particular map, the register name is PR0A Offset A. To select the\r
-register and get it ready for reading and/or writing you write the value\r
-09h to port 3CEh (the index port). The register can then be read from or\r
-written to port 3CFh (the read/write port).\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Bank Switching ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-In real mode, the PC has addresses A000:0000-B000:FFFF allocated for video\r
-memory, although most graphics modes only use the A000 segment.\r
-\r
-If you set an SVGA card to 640x480x256 color mode (for example) then there\r
-will be a total of 307200 pixels on the screen. Since each pixel takes up\r
-one byte in 256 color modes around 300K of video memory will be used to\r
-store the screen data. In most cases all this memory is accessed through the\r
-A000 segment. When you initially set the mode, bank 0 on the card will be\r
-active and anything you read to or write from this segment will be in the\r
-first 64K bytes in video memory (i.e. lines 0-101 and the first 256 bytes in\r
-line number 102). If you want to access the next 64K you must switch the\r
-card to bank number 1 so that the A000 segment now maps to the second bank,\r
-and so forth.\r
-\r
-The problem here is that each card has a different method of doing the bank\r
-switching. The PC-GPE files contain info on how to do the bank switching for\r
-a number of the most commonly used SVGA cards. The VESA standard helped\r
-inject some sanity into the otherwise chaotic world of SVGA programming by\r
-introducing a "standard" method of bank switching for all cards.\r
-\r
-A note should be made here about bank granularity. In the section above I\r
-assumed that bank 0 corresponded to the first 64K, bank 1 to the next etc..\r
-ie each bank has a 64K granularity. This is true for most cards, but some\r
-do have smaller granularities (see the table below). The Paradise for\r
-instance has a 4K granularity. It's very similar in concept to the PC's\r
-segmented memory, segments are 64K long but they have a 16 byte granularity.\r
-The Paradise chip's banks are also 64K long, but they have a 4K granularity.\r
-All the bank switching code given in the PC-GPE SVGA files adjust for this\r
-so that your code can assume the card has a 64K granularity in all cases.\r
-\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ SVGA Libraries ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-There are a few SVGA libraries available via anonymouse ftp. I haven't had\r
-a chance to use any of them yet, but I've heard some of them are pretty good,\r
-so they might be worth checking out. Here's two C libraries that I know of:\r
-\r
-     site: ftp.fasttax.com\r
-directory: /pc/graphic/scitech/beta\r
- filename: svkt44bl.zip\r
-\r
-     site: garbo.uwasa.fi\r
-directory: /pc/programming\r
- filename: SVGACC20.ZIP\r
-\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Common SVGA Cards ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-The PC-GPE files contain information on programming the 7 VGA "standards"\r
-as covered by Ferraro. According to Ferraro the majority of SVGA cards on\r
-the market today conform to one of these standards. The standards are\r
-Ati, Chips and Technologies, Genoa, Paradise, Trident, Tseng and Video7.\r
-I've also included a file on the VESA specifications (VESASP12.TXT). VESA\r
-seems to be the way to go now since public domain drivers are available for\r
-most cards and you only need to write one set of graphics drivers if you use\r
-it. VESA BIOS calls can be slow however, so if your program needs to do LOTS\r
-of bank switching then you may need to work with the cards on a hardware\r
-level.\r
-\r
-The following is a list of common SVGA's along with the chip it is based on,\r
-the number of banks the card contains and the modes they support. The GR\r
-field is the bank granularity. This information was obtained by examining\r
-the configuration files in the shareware program VPIC. VPIC is a great\r
-little program which supports numerous graphics file formats as well\r
-as all the cards listed below (and a few more). VPIC can be obtained via\r
-anonymous ftp from oak.oakland.edu, directory /pub/msdos/gif, filename\r
-vpic. I tried to contact the author so I'd feel better about blatently\r
-ripping all the info out of his data files but he doesn't seem to have an\r
-e-mail address. Are you out there Bob Montgomery?\r
-\r
-Quite a number of the chip sets in the list are not mentioned in Ferraro. If\r
-anyone has information on programming any of them drop me a line.\r
-\r
-Each mode in the table below has a mode number. To set the mode, load the AX\r
-register with this value and do an interrupt 10h. Some modes below have two\r
-numbers. In these cases load AX with the first number and BX with the second\r
-before calling interrupt 10h.\r
-\r
-Only 16 and 256 color are presented in the table below. True-color modes\r
-are not included in this version.\r
-\r
-\r
-Board                   Chip           Banks     Modes    Resolution  Col GR\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-\r
-Acumos                  ACUMOS         8         5Eh      640x400     256 64k\r
-                                                 5Fh      640x480     256 64k\r
-                                                 5Ch      800x256     256 64k\r
-                                                 10h      640x350     16  64k\r
-                                                 12h      640x480     16  64k\r
-                                                 58h      800x600     16  64k\r
-                                                 5dh      1024x768    16  64k\r
-\r
-Ahead A Chip            AHEADA         4/8       60h      640x400     256 64k\r
-                                                 61h      640x480     256 64k\r
-                                                 62h      800x600     256 64k\r
-                                                 6Ah      800x600     16  64k\r
-                                                 74h      1024x768    16  64k\r
-\r
-Ahead B Chip            AHEADB         8/16      60h      640x400     256 64k\r
-                                                 61h      640x480     256 64k\r
-                                                 62h      800x600     256 64k\r
-                                                 63h      1024x768    256 64k\r
-                                                 6Ah      800x600     16  64k\r
-                                                 74h      1024x768    16  64k\r
-\r
-ATI VGA Wonder          ATI OLD        4/8       61h      640x400     256 32k\r
-                                                 62h      640x480     256 32k\r
-                                                 63h      800x600     256 32k\r
-                                                 54h      800x600     16  32k\r
-                                                 65h      1024x768    16  64k\r
-\r
-ATI VGA Wonder+         ATI NEW        4/8/16    61h      640x400     256 32k\r
-                                                 62h      640x480     256 32k\r
-                                                 63h      800x600     256 32k\r
-                                                 64h      1024x768    256 32k\r
-                                                 54h      800x600     16  32k\r
-                                                 55h      1024x768    16  32k\r
-\r
-ATI Ultra 8514A GA      ATI NEW        4/8/16    61h      640x400     256 32k\r
-                                                 62h      640x480     256 32k\r
-                                                 63h      800x600     256 32k\r
-                                                 54h      800x600     16  32k\r
-                                                 55h      1024x768    16  32k\r
-\r
-ATI XL                  ATI NEW        4/8/16    61h      640x400     256 32k\r
-                                                 62h      640x480     256 32k\r
-                                                 63h      800x600     256 32k\r
-                                                 64h      1024x768    256 32k\r
-                                                 54h      800x600     16  32k\r
-                                                 55h      1024x768    16  32k\r
-\r
-Chips & Technology      Chips and      4/8       78h      640x400     256 16k\r
-                        Technologies             79h      640x480     256 16k\r
-                                                 7Ah      720x540     256 16k\r
-                                                 7Bh      800x600     256 16k\r
-                                                 70h      800x600     16  16k\r
-                                                 71h      960x720     16  16k\r
-                                                 72h      1024x768    16  16k\r
-\r
-Cirrus Logic GD54       VESA           16/64  4F02h,100h  640x400     256  4k\r
-                                              4F02h,101h  640x480     256  4k\r
-                                              4F02h,103h  800x600     256  4k\r
-                                              4F02h,105h  1024x768    256  4k\r
-                                              4F02h,102h  800x600     16   4k\r
-                                              4F02h,104h  1024x768    16   4k\r
-\r
-Definicon, 16 Bit       TSENG 4000     8/16      2dh      640x350     256 64k\r
-                                                 2fh      640x400     256 64k\r
-                                                 2eh      640x480     256 64k\r
-                                                 30h      800x600     256 64k\r
-                                                 38h      1024x768    256 64k\r
-                                                 29h      800x600     16  64k\r
-                                                 37h      1024x768    16  64k\r
-                                                 3Dh      1280x1024   16  64k\r
-\r
-Diamond 24x             PARADISE       4/16      5eh      640x400     256  4k\r
-                                                 5fh      640x480     256  4k\r
-                                                 5ch      800x600     256  4k\r
-                                                 60h      1024x768    256  4k\r
-                                                 58h      800x600     16   4k\r
-                                                 5Dh      1024x768    16   4k\r
-                                                 6Ch      1280x960    16   4k\r
-                                                 64h      1280x1024   16   4k\r
-\r
-Diamond Speedstar 24    TSENG 4000     8/16      2dh      640x350     256 64k\r
-                                                 2fh      640x400     256 64k\r
-                                                 2eh      640x480     256 64k\r
-                                                 30h      800x600     256 64k\r
-                                                 38h      1024x768    256 64k\r
-                                                 29h      800x600     16  64k\r
-                                                 37h      1024x768    16  64k\r
-\r
-Everex EV-673           EVEREX         4/8       70h,13h  640x350     256 64k\r
-                                                 70h,14h  640x400     256 64k\r
-                                                 70h,15h  512x480     256 64k\r
-                                                 70h,30h  640x480     256 64k\r
-                                                 70h,31h  800x600     256 64k\r
-                                                 70h,02h  800x600     16  64k\r
-                                                 70h,20h  1024x768    16  64k\r
-\r
-Everev 678              TRIDENT        4/8       70h,14h  640x400     256 64k\r
-                        8800                     70h,15h  512x480     256 64k\r
-                                                 70h,30h  640x480     256 64k\r
-                                                 70h,31h  800x600     256 64k\r
-                                                 70h,02h  800x600     16  64k\r
-                                                 70h,20h  1024x768    16  64k\r
-\r
-Everex Vision VGA HC    TSENG 4000     8/16      2fh      640x400     256 64k\r
-                                                 2eh      640x480     256 64k\r
-\r
-Genoa 5400              TSENG 3000     4/8       2dh      640x350     256 64k\r
-                                                 2eh      640x480     256 64k\r
-                                                 30h      800x600     256 64k\r
-                                                 29h      800x600     16  64k\r
-                                                 37h      1024x768    16  64k\r
-\r
-Genoa 6400              GENOA          4/8       2bh      640x350     256 64k\r
-                                                 2eh      640x480     256 64k\r
-                                                 30h      800x600     256 64k\r
-                                                 29h      800x600     16  64k\r
-                                                 37h      1024x768    16  64k\r
-\r
-Genoa 7900 24 bit       TSENG 4000     8/16      2dh      640x350     256 64k\r
-                                                 2fh      640x400     256 64k\r
-                                                 2eh      640x480     256 64k\r
-                                                 30h      800x600     256 64k\r
-                                                 38h      1024x768    256 64k\r
-                                                 29h      800x600     16  64k\r
-                                                 37h      1024x768    16  64k\r
-\r
-Headland 1024i          HEADLAND       4/8    6F05h,66h   640x400     256 64k\r
-                                              6F05h,67h   640x480     256 64k\r
-                                              6F05h,68h   720x540     256 64k\r
-                                              6F05h,69h   800x600     256 64k\r
-                                              6F05h,61h   720x540     16  64k\r
-                                              6F05h,62h   800x600     16  64k\r
-                                              6F05h,65h   1024x768    16  64k\r
-\r
-Hi Res 512              ZYMOS          4/8       5ch      640x400     256 64k\r
-                                                 5dh      640x480     256 64k\r
-                                                 5eh      800x600     256 64k\r
-                                                 6ah      800x600     16  64k\r
-                                                 5fh      1024x768    16  64k\r
-\r
-Maxxon                  TRIDENT 8800   4/8       5ch      640x400     256 64k\r
-                                                 5dh      640x480     256 64k\r
-                                                 5eh      800x600     256 64k\r
-                                                 5bh      800x600     16  64k\r
-                                                 5fh      1024x768    16  64k\r
-\r
-C&T MK82452             CHIPS AND      8         78h      640x400     256 16k\r
-                        TECHNOLOGIES             79h      640x480     256 16k\r
-                                                 70h      800x600     16  16k\r
-                                                 72h      1024x768    16  16k\r
-\r
-NCR 77C22               NCR            8/16      5eh      640x400     256 64k\r
-                                                 5fh      640x480     256 64k\r
-                                                 5ch      800x600     256 64k\r
-                                                 62h      1024x768    256 64k\r
-                                                 58h      800x600     16  64k\r
-                                                 5dh      1024x768    16  64k\r
-\r
-OAK                     OAK            8/16      53h      640x480     256 64k\r
-                                                 54h      800x600     256 64k\r
-                                                 59h      1024x768    256 64k\r
-                                                 52h      800x600     16  64k\r
-                                                 56h      1024x768    16  64k\r
-\r
-Orchid\r
-Fahrenheight 1280       S3             8/16   4F02h,201h  640x480     256 64k\r
-                                              4F02h,203h  800x600     256 64k\r
-                                              4F02h,205h  1024x768    256 64k\r
-                                              4F02h,202h  800x600     16  64k\r
-                                              4F02h,204h  1024x768    16  64k\r
-                                              4F02h,206h  1280x960    16  64k\r
-                                              4F02h,206h  1280x1024   16  64k\r
-\r
-Orchid Pro\r
-Designer II             TSENG 4000     8/16      2dh      640x350     256 64k\r
-                                                 2fh      640x400     256 64k\r
-                                                 2eh      640x480     256 64k\r
-                                                 30h      800x600     256 64k\r
-                                                 38h      1024x768    256 64k\r
-                                                 29h      800x600     16  64k\r
-                                                 37h      1024x768    16  64k\r
-\r
-Paradise VGA Pro        PARADISE       4/16      5eh      640x400     256  4k\r
-                                                 5fh      640x480     256  4k\r
-                                                 5ch      800x600     256  4k\r
-                                                 60h      1024x768    256  4k\r
-                                                 58h      800x600     16   4k\r
-                                                 5Dh      1024x768    16   4k\r
-\r
-Primus P2000 GA         PRIMUS         8/16      2dh      640x480     256 64k\r
-                                                 2bh      800x600     256 64k\r
-                                                 31h      1024x768    256 64k\r
-                                                 37h      1280x1024   256 64k\r
-                                                 2ah      800x600     16  64k\r
-                                                 30h      1024x768    16  64k\r
-                                                 36h      1280x1024   16  64k\r
-\r
-Compaq QVision          QVISION        8/16      32h      640x480     256  4k\r
-                                                 38h      1024x768    256  4k\r
-                                                 10h      640x350     16   4k\r
-                                                 12h      640x480     16   4k\r
-                                                 29h      800x600     16   4k\r
-                                                 37h      1024x768    16   4k\r
-\r
-Realtek RTVGA           REALTEK        8/16      25h      640x400     256 64k\r
-                                                 26h      640x480     256 64k\r
-                                                 27h      800x600     256 64k\r
-                                                 28h      1024x768    256 64k\r
-                                                 1Fh      800x600     16  64k\r
-                                                 21h      1024x768    16  64k\r
-                                                 2Ah      1280x1024   16  64k\r
-\r
-Realtek RTVGA           REALTEK        8/16      25h      640x400     256 64k\r
-                                                 26h      640x480     256 64k\r
-                                                 27h      800x600     256 64k\r
-                                                 28h      1024x768    256 64k\r
-                                                 1Fh      800x600     16  64k\r
-                                                 21h      1024x768    16  64k\r
-                                                 2Ah      1280x1024   16  64k\r
-\r
-S3 Graphics Accelerator S3             8/16   4F02h,201h  640x480     256 64k\r
-                                              4F02h,203h  800x600     256 64k\r
-                                              4F02h,205h  1024x768    256 64k\r
-                                              4F02h,202h  800x600     16  64k\r
-                                              4F02h,204h  1024x768    16  64k\r
-                                              4F02h,206h  1280x960    16  64k\r
-\r
-STB EM 16               TSENG 4000     8/16      2dh      640x350     256 64k\r
-                                                 78h      640x400     256 64k\r
-                                                 2eh      640x480     256 64k\r
-                                                 30h      800x600     256 64k\r
-                                                 38h      1024x768    256 64k\r
-                                                 29h      800x600     16  64k\r
-                                                 37h      1024x768    16  64k\r
-\r
-Phoebes                 TRIDENT 8800CS 4/8       5ch      640x400     256 64k\r
-                                                 5dh      640x480     256 64k\r
-                                                 5bh      800x600     16  64k\r
-                                                 5fh      1024x768    16  64k\r
-\r
-Maxxon                  TRIDENT 8800CS 4/8       5ch      640x400     256 64k\r
-                                                 5dh      640x480     256 64k\r
-                                                 5eh      800x600     256 64k\r
-                                                 5bh      800x600     16  64k\r
-                                                 5fh      1024x768    16  64k\r
-\r
-Trident 8900            TRIDENT 8900   8/16      5Ch      640x400     256 64k\r
-                                                 5Dh      640x480     256 64k\r
-                                                 5Eh      800x600     256 64k\r
-                                                 62h      1024x768    256 64k\r
-                                                 5Bh      800x600     16  64k\r
-                                                 5Fh      1024x768    16  64k\r
-\r
-Tseng ET-3000           TSENG ET3000   4/8       2dh      640x350     256 64k\r
-                                                 2eh      640x480     256 64k\r
-                                                 30h      800x600     256 64k\r
-                                                 29h      800x600     16  64k\r
-                                                 36h      960x720     16  64k\r
-                                                 37h      1024x768    16  64k\r
-\r
-Tseng ET-4000           TSENG ET4000   8/16      2dh      640x350     256 64k\r
-                                                 2fh      640x400     256 64k\r
-                                                 2eh      640x480     256 64k\r
-                                                 30h      800x600     256 64k\r
-                                                 38h      1024x768    256 64k\r
-                                                 29h      800x600     16  64k\r
-                                                 37h      1024x768    16  64k\r
-\r
-Video 7 VRAM            VIDEO7         4/8    6f05h,66h   640x400     256 64k\r
-                                              6f05h,67h   640x480     256 64k\r
-                                              6f05h,68h   720x540     256 64k\r
-                                              6f05h,69h   800x600     256 64k\r
-                                              6f05h,61h   720x540     16  64k\r
-                                              6f05h,62h   800x600     16  64k\r
-                                              6f05h,65h   1024x768    16  64k\r
-\r
-Western Digital 90C     PARADISE      4/8        5eh      640x400     256  4k\r
-                                                 5fh      640x480     256  4k\r
-                                                 5ch      800x600     256  4k\r
-                                                 58h      800x600     16   4k\r
-                                                 5Dh      1024x768    16   4k\r
diff --git a/16/PCGPE10/TEXTURE.TXT b/16/PCGPE10/TEXTURE.TXT
deleted file mode 100644 (file)
index 6905956..0000000
+++ /dev/null
@@ -1,1566 +0,0 @@
-                            ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-                            ³ Texture Mapping ³\r
-                            ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-                 Written for the PC-GPE by Sean Barrett.\r
-\r
-               ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-               ³      THIS FILE MAY NOT BE DISTRIBUTED     ³\r
-               ³ SEPARATE TO THE ENTIRE PC-GPE COLLECTION. ³\r
-               ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-\r
--=-=-=-=- -=-=-=-=-=- -=-=-=-=-=- -=-=-=-=-=- -=-=-=-=-=- -=-=-=-=-=-\r
-TEXTURE\r
-TEXUE  almost everything you need to know to texture map with the PC\r
-TXR\r
-X\r
--=-=-=-=- -=-=-=-=-=- -=-=-=-=-=- -=-=-=-=-=- -=-=-=-=-=- -=-=-=-=-=-\r
-\r
-Copyright 1994 Sean Barrett.\r
-Not for reproduction (electronic\r
-or hardcopy) except for personal use.\r
-\r
-Contents:\r
-\r
-  0. warnings\r
-  1. terminology and equations\r
-  2. the basics\r
-      Perfect texture mapping\r
-      DOOM essentials\r
-      Wraparound textures\r
-      Non-rectangular polygons\r
-  3. the hazards\r
-      going off the texture map\r
-      divide by 0\r
-      it'll never be fast enough\r
-  4. the complexities\r
-      handling arbitrarily-angled polygons\r
-      lighting\r
-      slow 16-bit VGA cards\r
-      mipmapping\r
-\r
- -=-=-=-=-=-\r
-| Note:  I am not providing any references as I simply\r
-|        derived the math myself and worked out the various\r
-|        techniques for myself (the 32-bit ADC trick was\r
-|        pointed out to me in another context by TJC,\r
-|        author of the Mars demo) over the last two years\r
-|        (since Wolfenstein 3D and Underworld came out).\r
- -=-=-=-=-=-\r
-\r
-TEXTURE\r
-TEXUE\r
-TXR   0. Warnings\r
-X\r
-\r
-  I assume a RIGHT-handed 3D coordinate system, with X positive\r
-to the right, Y positive disappearing into the screen/distance,\r
-and Z positive up.  To adjust this to the typical left-handed\r
-3D space, simply swap all the 3D Ys & Zs.\r
-\r
-  I assume the screen space is positive-X to the right,\r
-positive-Y goes down.  Adjust the signs as appropriate for\r
-your system.\r
-\r
-  I will present code and pseudo-code in C.  I also include\r
-some relatively tight inner loops written in assembly, but I'm\r
-omitting the details of the loop setup.  The inner loops, while\r
-usually from real, working code, should generally be taken\r
-as examples showing how fast it ought to be possible to run\r
-a given task, not as necessarily perfect examples.  I often\r
-use 32-bit instructions (sorry 286 programmers) because they\r
-can double the performance.  However, I write in real mode,\r
-because 16-bit addressing is often convenient for texture maps,\r
-and it's straightforward to use segment registers as pointers\r
-to texture maps.  The translation to protected mode should not\r
-prove problematic, but again, these should more be taken as\r
-examples rather than simply being used directly.  I optimize\r
-for the 486, but I skip some obvious optimizations.  For example,\r
-I write "loop", because it's simpler and more clear.\r
-Production code for the 486 should explicitly decrement and\r
-then branch.  Similarly, I write "stosb", etc. etc.\r
-\r
-\r
-TEXTURE\r
-TEXUE\r
-TXR   1. Terminology and Equations\r
-X\r
-\r
-\r
-  You really probably don't want to read this section first,\r
-but rather refer back to it whenever you feel the need.  So\r
-skip up to section 2 and refer back as appropriate.  I could've\r
-made this an appendix, but it seems too important to put last.\r
-\r
-TEX\r
-TE   Terms\r
-T\r
-    texture:  A texture is a pixelmap of colors which is mapped\r
-              onto a polygon using "texture mapping".  The size\r
-              of the polygon has nothing to do with the size (the\r
-              number of pixels) in the texture map.\r
-\r
-    run:  A run is a row or column of pixels.  Normal texture\r
-          mapping routines process one run in an "inner loop".\r
-\r
-    arbitrarily-angled polygon:  a polygon which isn't a floor,\r
-          wall, or ceiling; technically, a polygon which isn't\r
-          parallel to the X or Z axes (or X or Y axes in a\r
-          Z-is-depth coordinate system).\r
-\r
-    texture space:\r
-    polygon space:\r
-    polygon coordinate space:\r
-          Since a texture is flat, or two-dimensional, the relation\r
-          of the texture to the 3D world can be described with a\r
-          special coordinate space known by one of these names.\r
-          Because it is only 2D, the space can be characterized with\r
-          the location of the texture space in 2D, and two 3D vectors\r
-          which represent the axes of the coordinate space.  Sometimes\r
-          called "uv" space, because the name of the coordinates are\r
-          usually u & v.\r
-\r
-TEX\r
-TE   Notation\r
-T\r
-\r
-    Vectors appear in all caps.\r
-    Components of vectors are P = < Px, Py, Pz >.\r
-\r
-    Certain variables have consistent usage:\r
-\r
-      x,y,z are coordinates in three-space\r
-      i,j are screen coordinates\r
-      u,v are coordinates in texture space\r
-      a,b,c are "magic coordinates" such that\r
-         u = a/c, v = b/c\r
-\r
-TEX\r
-TE   Equations\r
-T\r
-\r
-    Don't let this scare you off!  Go read section 2, and\r
-    come back to this when you're ready.\r
-\r
-    Let P,M, and N be vectors defining the texture space: P is the\r
-    origin, and M and N are the vectors for the u&v axes.\r
-\r
-    Assume these vectors are in _view space_, where view space is\r
-    defined as being the space in which the transformation from\r
-    3D to 2D is:\r
-\r
-      (x,y,z) -> (i,j)\r
-        i = x / y\r
-        j = z / y\r
-\r
-    In other words, you have to adjust P, M, and N to be relative\r
-    to the view, and if you have multiplications in your perspective\r
-    computation, you have to multiply the appropriate components of\r
-    P, M, and N to compute them.  Note that since typically in 3D\r
-    up is positive, and in 2D down is positive, there may be a\r
-    multiplication by -1 that needs to go into Py, My, Ny.  Note that\r
-    this also assumes that (0,0) in screen space is at the center\r
-    of the screen.  Since it's generally not, simply translate\r
-    your screen coordinates (i,j) as if they were before applying\r
-    the texture mapping math (or if you're funky you can modify\r
-    your viewspace to pre-skew them).\r
-\r
-      For example, if your transforms are:\r
-         i = Hscale * x / y + Hcenter\r
-         j = -Vscale * z / y + Vcenter\r
-\r
-      Then you should simply multiply Px, Mx, and Nx by Hscale,\r
-      and multiply Py, My, and Mz by -Vscale.  Then just remember\r
-      to subtract Hcenter and Vcenter from the i,j values right\r
-      before plugging them into the texture mapping equations.\r
-\r
-    We begin by computing 9 numbers which are constant\r
-    for texture mapping the entire polygon (O stands for\r
-    Origin, H for Horizontal, and V for vertical; why I use\r
-    these names should become clear eventually):\r
-\r
-         Oa = Nx*Pz - Nz*Px\r
-         Ha = Nz*Py - Ny*Pz\r
-         Va = Ny*Px - Nx*Py\r
-\r
-         Ob = Mx*Pz - Mz*Px\r
-         Hb = Mz*Py - My*Pz\r
-         Vb = My*Px - Mx*Py\r
-\r
-         Oc = Mz*Nx - Mx*Nz\r
-         Hc = My*Nz - Mz*Ny\r
-         Vc = Mx*Ny - My*Nx\r
-\r
-    Ok.  Then, for a given screen location (i,j), the formula\r
-    for the texture space (u,v) coordinates corresponding to\r
-    it is:\r
-\r
-         a = Oa + i*Ha + j*Va\r
-         b = Ob + i*Hb + j*Vb\r
-         c = Oc + i*Hc + j*Hc\r
-\r
-         u = a/c\r
-         v = b/c\r
-\r
-\r
-TEXTURE\r
-TEXUE\r
-TXR   2.  The Basics\r
-X\r
-\r
-    So you've got your polygon 3D engine running, and\r
-you'd like to start adding a bit of texture to your\r
-flat- or Gouraud-shaded polygons.  Well, it will make\r
-it look a lot cooler.  But let's point out the\r
-disadvantages of texture mapping right away:\r
-\r
-      Slower\r
-      Sometimes hard to see polygon edges\r
-\r
-    Each of these has certain ramifications on the\r
-overall approach you want to take with your code,\r
-which we'll come back to later, in sections 3 and 4.\r
-\r
-    Practical advice: Don't try to get your riproaringly\r
-fast texture mapper running first.  Get a very simple,\r
-slow, "perfect" texture mapper working first, as described\r
-in the first subsection below.  This will allow you to make\r
-sure you've gotten the equations right.  Realize that I\r
-can't present the equations appropriate to every scenario,\r
-since there are simply too many spaces people can work\r
-in.  I've chosen to present the math from an extremely\r
-simple coordinate space which keeps the texture mapping\r
-relatively simple.  You'll have to work out the correct\r
-transformations to make it work right, and a slow but\r
-correct texture mapping routine may help you tweak the\r
-code as necessary to achieve this.  Use very simple\r
-polygons to start your testing; centered and facing the\r
-viewer should be your very first one (if done correctly,\r
-this will simply scale the texture).\r
-\r
-TEX\r
-TE   Perfect Texture Mapping\r
-T\r
-\r
-    To start with, we'll do slow but exact "perfect" texture\r
-mapping of a square tile with a simple texture map mapped onto\r
-it.  The polygon is defined in three-space using four points,\r
-and the texture map is 256x256 pixels.  Note that this is all\r
-talking about using floating point, so those of you working in\r
-C or Pascal are fine.  Those in assembly should realize that\r
-you have to do a bit of extra work to use fixed point, or you\r
-can beat out the floating point by hand if you want.\r
-\r
-    First we have to "map" the texture onto the polygon.\r
-We have to define how the square texture map corresponds\r
-to the square polygon.  This is relatively simple.  Let\r
-one corner of the polygon be the origin (location <0,0>)\r
-of the texture map.  Let each of the other corners\r
-correspond to corners just off the edge of the texture\r
-map (locations <256, 0>, <256, 256>, and <0, 256>).\r
-\r
-    We'd like to use the equations in section 1, which\r
-require vectors P, M, and N, where P is the origin,\r
-and M & N are the axes for u&v (which are _roughly_\r
-the coordinates in the texture map, but see below).\r
-In other words, P, M and N tells us where the texture\r
-lies relative to the polygon.  P is the coordinate in\r
-three-space where the origin of the texture is.  M\r
-tells us which way the "horizontal" dimension of the\r
-texture lies in three-space, and N the "vertical".\r
-\r
-    Suppose the polygon has four vertices V[0], V[1],\r
-V[2], and V[3] (all four of these are vectors).  Then,\r
-P is simply V[0].  M is a vector going from the origin\r
-to the corner <256, 0>, so M is a vector from V[0] to\r
-V[1], so M = V[1] - V[0].  N is a vector from the origin\r
-to the corner <0, 256>, so N is V[3] - v[0].\r
-\r
-    P = V[0]\r
-    M = V[1] - V[0]    { note these are vector subtractions }\r
-    N = V[3] - V[0]\r
-\r
-    Again, remember that we need P, M, and N in the viewspace\r
-discussed with the equation, so make sure you've transformed\r
-the Vs appropriately, or you can compute P, M, and N in world\r
-or object space and transform them into viewspace.\r
-\r
-    Compute the 9 magic numbers (vectors O, H, and V) as described\r
-in section 1.  Now, take your 3D polygon and process it as normal.\r
-Scan convert it so that you have a collection of rows of pixels\r
-to process.\r
-\r
-    Now, iterate across each row.  For each pixel in the polygon\r
-whose screen coordinates are <i,j>, apply the rest of the math\r
-described in section 1; that is, compute a, b, and c, and from\r
-them compute <u,v>.\r
-\r
-    I said before that <u,v> are basically the texture map\r
-coordinates.  What they are in truth are the coordinates in texture\r
-map space.  Because of the way we defined texture map space,\r
-we'll actually find that u and v both run from 0..1, not 0..256.\r
-This is an advantage for descriptive purposes because u and v\r
-are always 0 to 1, regardless of the size of the texture map.\r
-\r
-    So, to convert u&v to pixelmap coordinates, multiply them\r
-both by 256.  Now, use them as indices into the texture map,\r
-output the value found there, and voila, you've texture mapped!\r
-\r
-The loop should look something like this:\r
-\r
-[ loop #1 ]\r
-    for every j which is a row in the polygon\r
-      screen = 0xA0000000 + 320*j\r
-      for i = start_x to end_x for this row\r
-        a = Oa + (Ha * i) + (Va * j)\r
-        b = Ob + (Hb * i) + (Vb * j)\r
-        c = Oc + (Hc * i) + (Vc * j)\r
-        u = 256 * a / c\r
-        v = 256 * b / c\r
-        screen[i] = texture_map[v][u]\r
-      endfor\r
-    endfor\r
-\r
-    Once you've got that working, congratulations!  You're\r
-done dealing with the annoying messy part, which is getting\r
-those 9 magic numbers computed right.  The rest of this is\r
-just hard grunt work and trickery trying to make the code\r
-faster.\r
-\r
-    From here on in, I'm only going to look at the inner\r
-loop, that is, a single run (row or column), and let the\r
-rest of the runs be understood.\r
-\r
-TEX\r
-TE   Prepare to meet thy DOOM\r
-T\r
-\r
-    This subsection is concerned with vastly speeding\r
-up texture mapping by restricting the mapper to walls,\r
-floors and ceilings, or what is commonly called\r
-DOOM-style texture mapping, although it of course predates\r
-DOOM (e.g. Ultima Underworld [*], Legends of Valour).\r
-\r
-[*  Yes, Underworld allowed you to tilt the view,\r
-but it distorted badly.  Underworld essentially used\r
-DOOM-style tmapping, and tried to just use that on\r
-arbitrarily-angled polygons.  I can't even begin to\r
-guess what Underworld II was doing for the same thing.]\r
-\r
-    To begin with, let's take loop #1 and get as much\r
-stuff out of the inner loop as we can, so we can see\r
-what's going on.  Note that I'm not going to do low-level\r
-optimizations, just mathematical optimizations; I assume\r
-you understand that array walks can be turned into\r
-pointer walks, etc.\r
-\r
-[ loop #2 ]\r
-      a = Oa + Va*j\r
-      b = Ob + Vb*j\r
-      c = Oc + Vc*j\r
-\r
-      a += start_x * Ha\r
-      b += start_x * Hb\r
-      c += start_x * Hc\r
-\r
-      for i = start_x to end_x\r
-        u = 256 * a / c\r
-        v = 256 * b / c\r
-        screen[i] = texture_map[v][u]\r
-        a += Ha\r
-        b += Hb\r
-        c += Hc\r
-      endfor\r
-\r
-    With fixed point math, the multiplies by 256\r
-are really just shifts.  Furthermore, they can be\r
-"premultiplied" into a and b (and Ha and Hb) outside\r
-the loop.\r
-\r
-    Ok, so what do we have left?  Three integer adds,\r
-a texture map lookup, and two extremely expensive fixed-point\r
-divides.  How can we get rid of the divides?\r
-\r
-    This is the big question in texture mapping, and most\r
-answers to it are _approximate_.  They give results that\r
-are not quite the same as the above loop, but are difficult\r
-for the eye to tell the difference.\r
-\r
-    However, before we delve into these, there's a very\r
-special case in which we can get rid of the divides.\r
-\r
-    We can move the divide by c out of the loop without\r
-changing the results IFF c is constant for the duration\r
-of the loop.  This is true if Hc is 0.  It turns out that\r
-Hc is 0 if all the points on the run of pixels are the same\r
-depth from the viewer, that is, they lie on a line of\r
-so-called "constant Z" (I would call it "constant Y" in\r
-my coordinate system).\r
-\r
-    The requirement that a horizontal line of pixels be the\r
-same depth turns out to be met by ceilings and floors.\r
-For ceilings and floors, Hc is 0, and so the loop can be\r
-adjusted to:\r
-\r
-[ loop #3 ]\r
-      __setup from loop #2__\r
-      u = 256 * a / c\r
-      v = 256 * b / c\r
-      du = 256 * Ha / c\r
-      dv = 256 * Hb / c\r
-      for i = start_x to end_x\r
-        screen[i] = texture_map[v][u]\r
-        u += du\r
-        v += dv\r
-     endfor\r
-\r
-    Now _that_ can be a very fast loop, although adjusting\r
-the u&v values so they can be used as indices has been\r
-glossed over.  I'll give some sample assembly in the next\r
-section and make it all explicit.\r
-\r
-    First, though, let's look at walls.  Walls are almost\r
-identical to floors and ceilings.  However, with walls,\r
-Vc is 0, instead of Hc.  This means that to write a loop\r
-in which c is constant, we have to walk down columns instead\r
-of across rows.  This affects scan-conversion, of course.\r
-\r
-    The other thing about walls is that with floors, since\r
-you can rotate about the vertical axis (Z axis for me, Y axis\r
-for most of you), the horizontal runs on the floors cut\r
-across the texture at arbitrary angles.  Since you're\r
-bound to not tilt your head up or down, and since the\r
-polygons themselves aren't tilted, you generally find\r
-that for walls, Va is 0 as well.  In other words, as you\r
-walk down a column of a wall texture, both a & c are constant,\r
-so u is constant; you generally only change one coordinate,\r
-v, in the texture map.  This means the inner loop only needs\r
-to update one variable, and can be made to run _very_ fast.\r
-\r
-    The only thing missing from this discussion for creating\r
-a DOOM clone is how to do transparent walls, how to do\r
-lighting things, and how to make it fast enough.  These will\r
-be discussed in section 4, although the some of the speed\r
-issue is addressed by the inner loops in the next subsection,\r
-and the rest of the speed issue is discussed in general terms\r
-in section 3.\r
-\r
-TEX\r
-TE   ...wrapped around your finger...\r
-T\r
-\r
-    So far, we've only looked at texture mapping a single\r
-polygon.  Of course, it's obvious how to texture map\r
-a lot of polygons--just lather, rinse, repeat.  But it\r
-may seem sort of wasteful to go through all the 3D math\r
-and all over and over again if we just want to have one\r
-long wall with the same texture repeating over and over\r
-again--like linoleum tiles or wallpaper.\r
-\r
-    Well, we don't have to.  Let's think about this\r
-idea of a "texture map space" some more.  We defined\r
-it as being a coordinate system "superimposed" on\r
-the polygon that told us where the texture goes.\r
-However, when we implemented it, we simply used the\r
-polygon itself (in essence) as the coordinate space.\r
-\r
-    To see this, make a polygon which is a rectangle,\r
-perhaps four times as long as it is tall.  When it\r
-is drawn, you will see the texture is distorted,\r
-stretched out to four times its length in one dimension.\r
-Suppose we wanted it to repeat four times instead?\r
-\r
-    The first step is to look at what the definition\r
-of the texture map space means.  The texture map space\r
-shows how the physical pixelmap itself goes onto the\r
-polygon.  To get a repeating texture map, our first\r
-step is to just get one of the copies right.  If\r
-we set up our P,M, & N so that the M only goes one\r
-quarter of the way along the long edge of the\r
-rectangle, we'll map the texture onto just that\r
-quarter of the rectangle.\r
-\r
-     Here's a picture to explain it:\r
-\r
-              Polygon A-B-C-D                    Texture map\r
-\r
-   A          E                                  u=0     u=1\r
-    o--------o-___________          B        v=0  11112222\r
-    |111112222            ---------o              11112222\r
-    |111112222                     |              33334444\r
-    |111112222                     |              33334444\r
-    |333334444                     |         v=1\r
-    |333334444                     |\r
-    |333334444 ___________---------o\r
-    o--------o-                     C\r
-   D          F\r
-\r
-    So, we used to map (u,v)=(0,0) to A, (u,v)=(1,0) to B, and\r
-(u,v) = (0,1) to D.  This stretched the texture map out to\r
-fill the entire polygon map.\r
-\r
-    Now, instead, we map (u,v)=(1,0) to E.  In other words,\r
-let P = A, M = E-A, and N = D-A.  In this new coordinate\r
-space, we will map the texture onto the first quarter of\r
-the polygon.\r
-\r
-    What about the rest of the polygon?  Well, it simply\r
-turns out that for the first quarter 0 <= u <= 1.  For\r
-the rest, 1 <= u <= 4.\r
-\r
-    To make the texture wrap around, all we have to do is\r
-ignore the integer part of u, and look at the fractional part.\r
-Thus, as u goes from 1 to 2, we lookup in the texture map using\r
-the fractional part of u, or (u-1).\r
-\r
-    This is all very simple, and the upshot is that, once\r
-you define P, M, and N correctly, you simply have to mask\r
-your fixed-point u&v values; this is why we generally use\r
-texture maps whose sides are powers of two, so that we can\r
-mask to stay within the texture map.  (Also because they\r
-fit conveniently into segments this way, and also so that\r
-the multiply to convert u&v values from 0..1 to indices\r
-is just a shift.)\r
-\r
-    I'm assuming that's a sufficient explanation of the\r
-idea for you to get it all setup.  So here's the assembly\r
-inner loops I promised.  I'm not going to bother giving\r
-the ultra-fast vertical wall-drawing case, just the\r
-horizontal floor/ceiling-drawing case.\r
-\r
-    Note that a mask of 255 (i.e. for a 256x256 texture)\r
-can be gotten for free; however, no program that I'm\r
-aware of uses texture maps that large, since they\r
-simply require too much storage, and they can cache very\r
-poorly in the internal cache.\r
-\r
-    First, here's your basic floor/ceiling texture mapper,\r
-in C, with wraparound, and explicitly using fixed point\r
-math--but no setup.\r
-\r
-[ loop #4 ]\r
-    mask = 127, 63, 31, 15, whatever.\r
-    for (i=0; i < len; ++i) {\r
-      temp = table[(v >> 16) & mask][(u >> 16) & mask];\r
-      u += du;\r
-      v += dv;\r
-    }\r
-\r
-    Now, here's an assembly one.  This one avoids the\r
-shifts and does both masks at the same time, and uses\r
-16 bits of "fractional" precision and however many bits\r
-are needed for the coordinates.  Note that I assume\r
-that the texture, even if it is 64x64, still has each\r
-row starting 256 bytes apart.  This just requires some\r
-creative storage approaches, and is crucial for a fast\r
-inner loop, since no shifting&masking is required to\r
-assemble the index.\r
-\r
-       mov  al,mask\r
-       mov  ah,mask\r
-       mov  mask2,ax      ; setup mask to do both at the same time\r
-\r
-loop5  and  bx,mask2      ; mask both coordinates\r
-       mov  al,[bx]       ; fetch from the texture map\r
-       stosb\r
-       add  dx,ha_low     ; update fraction part of u\r
-       adc  bl,ha_hi      ; update index part of u\r
-       add  si,hb_low     ;   these are constant for the loop\r
-       adc  bh,hb_hi      ;   they should be on the stack\r
-       loop loop5         ;   so that ds is free for the texture map\r
-\r
-    This code is decent, but nowhere near as fast as it can be.\r
-The main trick to improving performance is to use 32 bit adds\r
-instead of two adds.  The problem with this is that extra operations\r
-are required to setup the indexing into the texture map.  Through\r
-the use of the ADC trick, these can be minimized.  In the following\r
-code, bl and bh are unchanged.  However, the top half of EBX now\r
-contains what used to be in si, and the other values have been\r
-moved into registers.  ESI contains hb_low in the top half, and\r
-ha_hi in the low 8 bits.  This means that ADC EBX,ESI achieves\r
-the result of two of the additions above.  Also, we start using\r
-BP, so we move our variables into the data segment and the texture\r
-map into FS.\r
-\r
-loop6  and  bx,mask2\r
-       mov  al,fs:[bx]\r
-       stosb\r
-       add  dx,bp          ; update fractional part of u\r
-       adc  ebx,esi        ; update u (BL) and frac. part of v (EBX)\r
-       adc  bh,ch          ; update index part of v\r
-       dec  cl\r
-       jnz  loop6\r
-\r
-    This is a bit faster, although it has one bug.  It's\r
-possible for the addition into BL to overflow into BH.  It might\r
-not seem to be, since BL is masked every iteration back down to\r
-stay in 0..127, 0..63, or whatever.  However, if the step is\r
-negative, then BL will be decremented each iteration, and may\r
-"underflow" and subtract one from BH.  To handle this, you need\r
-a seperate version of the loop for those cases.\r
-\r
-    If you're not doing wraparound textures, you can speed the\r
-loop up a bit more by removing the and.  You can run entirely\r
-from registers except for the texture map lookup.  Additionally,\r
-unrolling the loop once cuts down on loop overhead, and is crucial\r
-if you're writing straight to the VGA, since it doubles your\r
-throughput to a 16-bit VGA card.\r
-\r
-    Here's a very fast no-wraparound texture mapper.  It uses\r
-the ADC trick twice.  Note that the carry flag is maintained\r
-around the loop every iteration; unfortunately the 'and' required\r
-for wraparound textures clears the carry flag (uselessly).  EBX\r
-and EDX contain u & v in their bottom 8 bits, and contain the\r
-fractional parts of v & u in their top bits (note they keep the\r
-_other_ coordinate's fractional parts).  You have to have prepped\r
-the carry flag first; if you can't figure this technique out, don't\r
-sweat it, or look to see if someone else has a more clear discussion\r
-of how to do fast fixed-point walks using 32-bit registers.\r
-\r
-    This loop is longer because it does two pixels at a time.\r
-\r
-loop7   mov  al,[bx]       ; get first sample\r
-        adc  edx,esi       ; update v-high and u-low\r
-        adc  ebx,ebp       ; update u-high and v-low\r
-        mov  bh,dl         ; move v-high into tmap lookup register\r
-        mov  ah,[bx]       ; get second sample\r
-        adc  edx,esi\r
-        adc  ebx,ebp\r
-        mov  bh,dl\r
-        mov  es:[di],ax    ; output both pixels\r
-        inc  di            ; add 2 to di without disturbing carry\r
-        inc  di\r
-        dec  cx\r
-        jnz  loop7\r
-\r
-    I went ahead and 486-optimized the stosw/loop at the end to make\r
-cycle-counting easier.  All of these instructions are single cycle\r
-instructions, except the branch, and the segment-override.  So you're\r
-looking at roughly 15 cycles for every two pixels.  Your caching\r
-behavior on the reads and writes will determine the actual speed.\r
-It can be unrolled another time to further reduce the loop overhead;\r
-the core operations are 9 instructions (10 cycles) for every two\r
-pixels.  Note the "inc di/inc di", which protects the carry flag.\r
-If you unroll it again, four "inc di"s will be required.  Unroll it\r
-another time, and you're better off saving the carry flag, adding,\r
-and restoring, for example "adc ax,ax/add di,8/shr ax,1", rather\r
-than 8 "inc di"s.\r
-\r
-TEX\r
-TE   Lost My Shape (trying to act casual)\r
-T\r
-\r
-    Non-rectangular polygons are trivial under this system.\r
-Some approaches require you to specify the (u,v) coordinates\r
-for each of the vertices of the polygon.  With this technique,\r
-you instead specify the 3D coordinates for three of the\r
-"vertices" of the texture map.  So the easiest way of handling\r
-a texture of a complex polygon is simply to use a square\r
-texture which is larger than the polygon.  For example:\r
-\r
-   P1                       P2\r
-     x    B  _______  C    x\r
-           /         \\r
-         /             \\r
-     A /                 \\r
-       \                 / D\r
-         \             /\r
-           \ _______ /\r
-     x    F           E\r
-   P3\r
-\r
-    Now, we simply define the texture map such that P is P1,\r
-M is P2-P1, and N is P3-P1.  Then, if our texture looks like\r
-this:\r
-\r
-     u=0        u=1\r
-      ------------\r
- v=0 |..XXoooooo..\r
-     |.XXXXoooooo.\r
-     |XXXXXXoooooo\r
-     |.XXXXXXoooo.\r
- v=1 |..XXXXXXoo..\r
-\r
-    Then the regions marked by '.' in the texture map will\r
-simply never be displayed anywhere on the polygon.\r
-\r
-    Wraparound textures can still be used as per normal,\r
-and concave polygons require no special handling either.\r
-\r
-    Also, you can get special effects by having M and N not\r
-be perpendicular to each other.\r
-\r
-TEXTURE\r
-TEXUE\r
-TXR   3.  The Hazards\r
-X\r
-\r
-    This sections discusses some of the pitfalls and\r
-things-aren't-quite-as-simple-as-they-sounded issues\r
-that come up while texture mapping.  All of the\r
-information is, to some extent, important, whether\r
-you've encountered this problem or not.\r
-\r
-TEX\r
-TE   Cl-cl-cl-close to the Edge\r
-T\r
-\r
-    At some time when you're texture mapping, you'll\r
-discover (perhaps from the screen, perhaps from a\r
-debugger) that your U & V values aren't within the\r
-0..1 range; they'll be just outside it.\r
-\r
-    This is one of these "argh" problems.  It is\r
-possible through very very careful definition of\r
-scan-conversion operations to avoid it, but you're\r
-likely to encounter it.\r
-\r
-    If you use wraparound textures, you may not ever\r
-notice it, however, since when it happens, the\r
-texture will simply wraparound and display an\r
-appropriate pixel.\r
-\r
-    If not, you may get a black pixel, or just\r
-garbage.  It'll only happen at the edges of your\r
-polygon.\r
-\r
-    The reason this happens is because your scan-conversion\r
-algorithm may generate pixels "in the polygon" whose\r
-pixel-centers (or corners, depending on how you've\r
-defined it) are just outside the texture--that is,\r
-they're outside the polygon itself.\r
-\r
-    The right solution to this is to fix your scan-converter.\r
-If your texture mapper computes u&v coordinates based on\r
-the top-left corner of the pixel (as the one I've defined\r
-so far has), make sure your scan-converter only generates\r
-pixels whose top-left corner is really within the polygon.\r
-If you do this, you may need to make a minor change to my\r
-definition of M & N, but I'm not going to discuss this\r
-further, since you probably won't do this.\r
-\r
-    A second option is to define P, M, and N such that the\r
-texture map space is slightly bigger than the polygon; that\r
-is, so that if you go just off the edge of the polygon,\r
-you'll still be within the texture map.\r
-\r
-    This is a pain since you end up having to transform extra\r
-3D points to do it.\r
-\r
-    The third, and probably most common solution, is to always\r
-use wraparound textures, which hide the problem, but prevent\r
-you from using textures that have one edge that highly contrasts\r
-with another.\r
-\r
-    The fourth, and probably second most common solution,\r
-and the one that turns out to be a real pain, is to "clamp"\r
-the u&v values to be within the texture all the time.\r
-\r
-    Naively, you just put this in your inner loop:\r
-\r
-      if (u < 0) u = 0; else if (u > 1) u = 1;\r
-      if (v < 0) v = 0; else if (v > 1) v = 1;\r
-\r
-    Of course, you don't really do this, since it'd slow\r
-you down far too much.  You can do this outside the loop,\r
-clamping your starting location for each run.  However,\r
-you can't, under this system, clamp the ending value\r
-easily.\r
-\r
-    Remember that in the loop we update u and v with\r
-(essentially) Ha/c and Hb/c.  These are constant\r
-across the entire run, but not constant across the\r
-entire polygon, because c has different values for\r
-different runs.\r
-\r
-    We can compute du and dv in a different way to\r
-allow for clamping.  What we do is we explicitly compute\r
-(a,b,c) at (start_x, j) as we did before, but we also\r
-compute (a,b,c) at (end_x, j).  From these we compute\r
-(u,v) at start_x & at end_x.  Next we clamp both sets\r
-of u & v.  Then we compute du and dv with\r
-\r
-    du = (u2 - u1) / (end_x - start_x - 1)\r
-    dv = (v2 - v1) / (end_x - start_x - 1)\r
-\r
-    This is slightly more expensive than the old way,\r
-because we have to compute u2 and v2, which requires\r
-extra divides.  However, for methods that explicitly\r
-calculate u&v sets and then compute deltas (and we'll\r
-see some in section 4), this is the way to go.\r
-\r
-    One final thing you can do is interpolate the (a,b,c)\r
-triple from the vertices as you scan convert.  This will\r
-guarantee that all (a,b,c) triples computed will lie be\r
-within the polygon, and no clamping will be necessary\r
-(but deltas must still be computed as above).  However,\r
-you have to make sure the (a,b,c) values you compute at\r
-the vertices are clamped themselves, which is not too hard\r
-by a bit more complicated than clamping (u,v) values.\r
-\r
-TEX\r
-TE   Out of This Domain -- Zero's Paradox\r
-T\r
-\r
-    Divides by zero are ugly.  We programmers don't\r
-like them.  If this were an ideal world (a quick\r
-nod to mathematicians and some physicists), the\r
-texture mapping equations would be divide-by-zero-free.\r
-\r
-    Unfortunately, it's a repercussion of the exact\r
-same problem as above that you can bump into them.\r
-\r
-    Remember above, I noted that it's possible to\r
-get (u,v) pairs with a value just outside of the\r
-0..1 range, because a pixel we're texture mapping\r
-isn't even in the polygon?\r
-\r
-    Well, even worse, it's possible for this pixel,\r
-which isn't in the polygon, to be along the horizon\r
-line (vanishing point) for the polygon.  If this\r
-happens, your Y value (sorry, Z for most of you)\r
-would be infinite if you tried to compute the 3D\r
-coordinates from the screen coordinates; and in\r
-the (u,v) computation, you end up with a 0 value\r
-for c.  Since u = a/c, blammo, divide by 0.\r
-\r
-    Well, the solution is simple.  Test if c is 0,\r
-and if it is, don't divide.  But what _should_ you do?\r
-\r
-    Well, let's look at an "even worse" case.  Suppose\r
-the pixel is so far off the polygon it's across the\r
-horizon line.  In this case, we'll end up with c having\r
-the "wrong" sign, and while our divide won't fault on\r
-us, our u&v values will be bogus.\r
-\r
-    What do we do then?\r
-\r
-    We can't clamp our a&b&c values very easily.\r
-Fortunately, it turns out we don't have to.  If\r
-this happens, it means the edge of the polygon\r
-must be very close to the horizon, or the viewer\r
-must be very, very flat to the polygon (if you know\r
-what I mean).  If so, the viewer can't really tell\r
-what should be "right" for the polygon, so if we\r
-screw up the u&v values, it really doesn't matter.\r
-\r
-    So the answer is, don't worry if c gets the\r
-wrong sign, and if c comes out to be 0, use any\r
-value for u&v that you like--(0,0) makes an obvious\r
-choice.\r
-\r
-    I've never had a serious problem with this, but\r
-it is possible that this could actually give you some\r
-pretty ugly results, if, say, two corners of a polygon\r
-both "blew up", and you treated them both as being\r
-(0,0).  It can also cause problems with wraparound\r
-polygons not repeating the right amount.\r
-\r
-TEX\r
-TE   Do the Dog\r
-T\r
-\r
-    Most polygon 3D graphics engines probably use\r
-the painter's algorithm for hidden surface removal.\r
-You somehow figure out what order to paint the polygons\r
-in (depth sort, BSP trees, whatever), and then paint\r
-them back-to-front.  The nearer polygons obscure the\r
-farther ones, and voila!, you're done.\r
-\r
-    This works great, especially in a space combat\r
-simulator, where it's rare that you paint lots of pixels.\r
-\r
-    You can texture map this way, too.  For example,\r
-Wing Commander II doesn't texture map, but it does\r
-real time rotation, which involves essentially the\r
-same inner loop.  Wing Commander II is fast--until\r
-a lot of ships are on the screen close to you, at which\r
-point it bogs down a bit.\r
-\r
-    If you care about not slowing down too much in the above\r
-case, or you want to do an "indoor" renderer with lots of\r
-hidden surfaces, you'll find that with texture mapping,\r
-you can ill-afford to use the painter's algorithm.\r
-\r
-    You pay a noticeable cost for every pixel you texture\r
-map.  If you end up hiding 80% of your surfaces (i.e. there\r
-are five "layers" everywhere on the screen), you end up\r
-"wasting" 80% of the time you spend on texture mapping.\r
-\r
-    To prevent this, you have to use more complex methods\r
-of hidden surface removal.  These will probably slow you down\r
-somewhat, but you should make up for it with the gain in texture\r
-mapping.\r
-\r
-    The essential idea is to only texture map each screen pixel once.\r
-To do this, you do some sort of "front-to-back" painting, where\r
-you draw the nearest surface first.  Any pixel touched by this\r
-surface should never be considered for drawing again.\r
-\r
-    There are many ways to do this.  You can process a single\r
-scanline or column at a time and use ray-casting or just\r
-"scanline processing", then resolve the overlap between the\r
-runs with whatever method is appropriate.  You can stay\r
-polygonal and maintain "2D clipping" information (a data\r
-structure which tracks which pixels have been drawn so far).\r
-\r
-    Beyond getting a fast inner loop for texture mapping,\r
-getting a fast hidden-surface-removal technique (and a fast\r
-depth-sorting technique if appropriate) is probably the\r
-next most crucial thing for your frame rate.\r
-\r
-    But the details are beyond the scope of this article.\r
-\r
-    Note that if you attempt to use a Z-buffer, you will\r
-still end up paying all of the costs of texture mapping for\r
-every forward-facing polygon (or at least 50% of them if\r
-you get really tricky; if you get really, really tricky,\r
-the sky's the limit.)  I strongly doubt that any PC game\r
-now out, or that will come out in the next year, will\r
-render full-screen texture mapping through a Z-buffer.\r
-(Superimposing a rendered image on a Z-buffered background\r
-is a different issue and is no doubt done all the time.)\r
-\r
-\r
-TEXTURE\r
-TEXUE\r
-TXR   4.  The Complexities\r
-X\r
-\r
-    In this section we will discuss lots of miscellaneous\r
-topics.  We'll look at some more optimizations, such as\r
-considerations for dealing with slow VGA cards, and how to\r
-texture map arbitrarily-angled polygons without doing two\r
-divides per pixel.  We'll talk about a technique that lets\r
-you use textures with high-frequency components, and one way\r
-to integrate lighting into texture-mapping.\r
-\r
-TEX\r
-TE   Arbitrarily-Angled Polygons\r
-T\r
-\r
-    First suggestion: Don't.  Set up your world to\r
-have all (or mostly) walls and floors.  Supporting\r
-arbitrarily-angled polygons is going to slow you\r
-down, no matter what.\r
-\r
-    The original texture mapping loop, which supported\r
-arbitrarily-angled polygons, required two divides per\r
-pixel.  We don't have to go that slow, but we'll never\r
-go as fast as DOOM-style rendering can go.  (However,\r
-as you start to use more sophisticated lighting algorithms\r
-in your inner loop, the cost of handling arbitrarily-\r
-angled polygons may start to become less important.)\r
-\r
-    There is one way to texture map such polygons\r
-"perfectly" without two divides per pixel, and a\r
-host of ways to do it "imperfectly".  I'll discuss\r
-several of these ways in varying amounts of detail.\r
-Your best bet is to implement them all and see\r
-which ones you can get to run the fastest but still\r
-look good.  You might find that one is faster for\r
-some cases but not for others.  You could actually\r
-have an engine which uses all the methods, depending\r
-on the polygon it's considering and perhaps a "detail"\r
-setting which controls how accurate the approximations\r
-are.\r
-\r
-    The "perfect" texture mapping algorithm is\r
-described in another article, "Free-direction texture\r
-mapping".  I'll summarize the basic idea and the\r
-main flaw.  The basic idea is this.  For ceilings\r
-and walls, we were able to walk along a line on\r
-the screen for which the step in the "c" parameter\r
-was 0; this was a line of "constant Z" on the\r
-polygon.\r
-\r
-    It turns out that every polygon has lines of\r
-"constant Z"--however, they can be at any angle,\r
-not necessarily vertical or horizontal.\r
-\r
-    What this means, though, is that if you walk\r
-along those lines instead of walking along a horizontal\r
-or vertical, you do not need a divide to compute your\r
-texture map coordinates, just deltas.\r
-\r
-    The details can be found in the other article.\r
-The slope of the line to walk on the screen is something\r
-like Hc/Vc.\r
-\r
-    Note, however, that the "DOOM" approach was _just_\r
-an optimization for a special case.  The wall & ceiling\r
-renderers produce exactly the same results as a\r
-perfect texture mapper, for the polygons that they\r
-handle (ignoring rounding errors and fixed-point precision\r
-effects).  This is not true for the "free-direction"\r
-texture mapper.  While there is a line across the\r
-screen for which the polygon has constant Z,\r
-you cannot walk exactly along that line, since you\r
-must step by pixels.  The end result is that while\r
-in the texture map space, you move by even steps,\r
-in the screen space, you move with ragged jumps.\r
-With perfect texture mapping, you always sample\r
-from the texture map from the position corresponding\r
-to the top-left/center of each pixel.  With the\r
-free-direction mapper, you sample from a "random"\r
-location within the pixel, depending on how you're\r
-stepping across the screen.  This "random" displacement\r
-is extremely systematic, and leads to a systematic\r
-distortion of the texture.  I find it visually\r
-unacceptable with high-contrast textures, compared to\r
-perfect texture mapping, but you should try it and decide\r
-for yourself.  The technically inclined should note that\r
-this is simply the normal "floor" renderer with an extra\r
-2D skew, and that while 2D skews are trivial, they are\r
-non-exact and suffer from the flaw described above.\r
-\r
-    The only other alternative for arbitrarily-angled\r
-polygons is to use some kind of approximation.  We\r
-can characterize u and v as functions of i (the horizontal\r
-screen position; or use 'j' if you wish to draw columns);\r
-for instance, u = a / c, where a = q + i*Ha, c = p + i*Hc.\r
-So we can say  u(i) = (q + i*Ha) / (r + i*Hc).\r
-\r
-    Now, instead of computing u(i) exactly for each i,\r
-as we've done until now, we can instead compute some\r
-function u'(i) which is approximately equal to u(i) and\r
-which can be computed much faster.\r
-\r
-    There are two straightforward functions which we\r
-can compute very fast.  One is the simple linear\r
-function we used for DOOM-style mapping, u'(x) = r + x*s.\r
-Since the function we're approximating is curved (a\r
-hyperbola), a curved function is another possibility,\r
-such as u'(x) = r + x*s + x^2*t.  (SGI's Reality Engine\r
-apparently uses a cubic polynomial.)\r
-\r
-    If you try both of these approximations on a very\r
-large polygon at a sharp angle, you will find that\r
-they're not very good, and still cause visible\r
-curvature.  They are, of course, only approximations.\r
-The approximations can be improved with a simple\r
-speed/quality trade-off through subdivision.  The\r
-idea of subdivision is that the approximation is\r
-always of high quality for a small enough region,\r
-so you can simply subdivide each region until the\r
-subregions are small enough to have the desired\r
-quality.\r
-\r
-    There are two ways to subdivide.  One simple way\r
-is to subdivide the entire polygon into smaller\r
-polygons.  This should be done on the fly, not\r
-ahead of time, because only polygons that are at\r
-"bad" angles need a lot of subdivision.  After\r
-dividing a polygon into multiple smaller ones,\r
-render each one seperately.  Use the original\r
-P, M, and N values for all of the new polygons\r
-to make the texture remain where it should be\r
-after subdivision.\r
-\r
-    The (probably) better way to subdivide is to\r
-subdivide runs instead of polygons, and so I'll\r
-discuss this in more detail.  The essential thing\r
-is that to do an approximation, you evaluate the\r
-original function at two or more locations and\r
-then fit your approximate function to the computed\r
-values.  One advantage of run subdivision is that\r
-you can share points that you evaluated for one\r
-subrun with those of the next.\r
-\r
-    First lets turn back to the two approximations\r
-under consideration.  The first is what is called\r
-"bilinear texture mapping", because the function\r
-is linear and we're tracking two ("bi") values.\r
-To use this method, we compute the function at\r
-both endpoints: u1 = u(start_x), u2 = u(end_x).\r
-Then we compute our start and step values.  To\r
-keep things simple, I'm going to assume the approximation\r
-function u'(x) is defined from 0..end_x-start_x, not\r
-from start_x..end_x.\r
-\r
-    So, the linear function u'(x) = r + s*x, where\r
-u'(0) = u1 and u'(end_x - start_x) = u2 is met by\r
-letting r = u1, s = (u2 - u1) / (end_x - startx).\r
-\r
-    Now, suppose our run goes from x = 10 to x = 70.\r
-If we evaluate u(10), u(20), u(30), u(40),... u(70),\r
-then we can have six seperate sections of bilinear\r
-texture mapping.\r
-\r
-    For a quadratic, there are several ways to compute\r
-it.  One way is to compute an additional sample in the\r
-middle; u3 = u((start_x + end_x)/2).  Then we can\r
-fit u1,u2, and u3 to u'(x) = r + s*x + t*x^2 with:\r
-\r
-   len = (end_x - start_x)\r
-   k   = u1 + u2 - u3*2\r
-   r   = u1\r
-   s   = (u2 - u1 - 2*k)/len\r
-   t   = 2*k / len^2\r
-\r
-    Note that to use this in code, you cannot simply\r
-use a loop like this:\r
-\r
-   r += s;\r
-   s += t;\r
-\r
-    because the r,s, and t values aren't correct\r
-for discrete advancement.  To make them correct,\r
-do this during the setup code:\r
-\r
-    R = r\r
-    S = s + t\r
-    T = 2*t\r
-\r
-    Then the loop of (...use R..., R += S, S += T) will work correctly.\r
-\r
-    The biquadratic loop will be slower than the linear\r
-loop, but will look better with fewer subdivisions.  You\r
-can share one of the endpoints from one biquadratic\r
-section to the next.  Note, though, that you require twice\r
-as many calculations of u&v values for the same number of\r
-subdivisions with a biquadratic vs. a bilinear.\r
-\r
-    Another thing to do is to choose how to subdivide the run\r
-more carefully.  If you simply divide it in half or into quarters,\r
-you'll discover that some of the subruns come out looking better\r
-than others.  So there are some things you can do to improve the\r
-subdivision system.  Another thing you can do is to try to make\r
-most of your subruns have lengths which are powers of two.  This\r
-will let you use shifts instead of divides when computing r,s, and\r
-t, which cuts down on your overhead, which lets you use more\r
-subdivisions and get the same speed.\r
-\r
-    Note something very important.  Subdivision increases the\r
-overhead per run; biquadratic and other things increase the\r
-cost of the inner loop.  Before you go crazy trying to optimize\r
-your arbitrarily-angled polygon renderer, make sure you're\r
-rendering some "typical" scenes.  The "right" answer is going\r
-to depend on whether you have lots of very shorts runs or\r
-fewer, longer runs.  If you optimize based on a simple test\r
-case, you may end up suboptimal on the final code.\r
-\r
-    You probably still want to have both a column-based and a\r
-row-based renderer, and use whichever one the polygon is\r
-"closer to" (e.g. if Hc is closer to 0 than Vc, use the row-based).\r
-Note that the free-direction renderer looks its worst (to me)\r
-for very small rotations, i.e. when Hc or Vc are very close to 0.\r
-Since in these cases not much subdivision is needed, even if you\r
-choose to use a free-direction mapper as your primary renderer,\r
-you might still want to have "almost wall" and "almost floor"\r
-renderers as well.\r
-\r
-    Finally, there is one more approximation method you can use,\r
-which is faster than any of the ones discussed so far, but is\r
-simply totally and utterly wrong.  This is the approach used\r
-by Michael Abrash in his graphics column in Dr. Dobbs.  While\r
-it's quite wrong, it works on polygons which are entirely\r
-constant Y (sorry, Z), and can be a noticeable speedup.\r
-\r
-    What you do is 2D (instead of 3D) interpolation.  You mark\r
-each vertex with its coordinates in the texture map.  Then when\r
-you scan convert, you interpolate these values between vertices\r
-on the edges of your runs.  Thus, scan conversion will generate\r
-runs with (u,v) values for the left and right end.  Now simply\r
-compute (du,dv) by subtracting and dividing by the length (no\r
-clamping will be necessary), and use your fast bilinear inner\r
-loop.  When combined with 3D polygon subdivision, this approach\r
-can actually be useful.\r
-\r
-  A cheat:\r
-\r
-    When the player is moving, set your internal quality\r
-settings a little lower.  When the player stops, switch\r
-back to the normal quality; if the player pauses the game,\r
-render one frame in normal quality.\r
-\r
-    If done right, you can get a small boost to your fps\r
-without anyone being able to tell that you did it.  You\r
-may have to use normal quality if the player is only\r
-moving very slowly, as well.\r
-\r
-    Note that while this may sound like an utterly cheap\r
-trick just to improve the on-paper fps number, it's actually\r
-quite related to the "progressive refinement" approach used\r
-by some real VR systems (which, when the viewer isn't moving,\r
-reuse information from the previous frame to allow them to\r
-draw successive frames with more detail).\r
-\r
-    There are a number of ways of improving this cheat\r
-intelligently.  If the player is moving parallel to a polygon,\r
-that polygon will tend to be "stably" texture mapped (similar\r
-mapping from frame to frame).  If there is any distortion from\r
-your approximation, this will be visible to the player.  So\r
-this means a rule of thumb is to only cheat (draw with\r
-above-average distortion) on polygons that are not facing\r
-parallel to the direction of motion of the player.\r
-\r
-TEX\r
-TE   Light My Fire\r
-T\r
-\r
-    If you're texture mapping, it's generally a good idea\r
-to light your polygons.  If you don't light them, then it\r
-may be difficult to see the edge between two walls which\r
-have the same texture (for instance, check out the "warehouse"\r
-section of registered DOOM, which is sometimes confusing\r
-when a near crate looks the same color as a far crate).\r
-\r
-    Lighting is actually pretty straightforward, although\r
-you take a speed hit in your inner loop.  I'm not going\r
-to worry about actual lighting models and such; see other\r
-articles for discussion on how to do light-sourced polygons.\r
-\r
-    Instead I'm going to assume you've computed the lighting\r
-already.  We'll start with "flat-run" shading, wherein an\r
-entire run has the same intensity of light falling on it.\r
-\r
-    DOOM uses flat-run shading.  A given polygon has a certain\r
-amount of light hitting it, which is the same for the entire\r
-polygon.  In addition, each run of the polygon is sort-of\r
-lit by the player.  Since runs are always at a constant\r
-depth, you can use constant lighting across the run and\r
-still change the brightness with distance from the player\r
-(DOOM uses something that resembles black fog, technically).\r
-\r
-    So the only real issue is _how_ you actually get the\r
-lighting to affect the texture.  Several approaches are\r
-possible, but the only one that I think anyone actually uses\r
-is with a lighting table.\r
-\r
-    The lighting table is a 2D array.  You use the light\r
-intensity as one index, and the pixelmap color as the\r
-other index.  You lookup in the table, and this gives\r
-you your final output color to display.  (With two\r
-tables, you can do simple dithering.)  So the only thing\r
-you have to do is precompute this table.\r
-\r
-    Basically, your inner loop would look something like this:\r
-\r
-  ...compute light...\r
-  for (i=start_x; i <= end_x; ++i) {\r
-    color = texture[v >> 16][u >> 16];\r
-    output = light_table[light][color];\r
-    screen[i] = output;\r
-    u += du;\r
-    v += dv;\r
-  }\r
-\r
-    The next thing to consider is to Gouraud shade your\r
-texture map.  To do this, you need to compute the light\r
-intensity at the left and right edge of the run; look\r
-elsewhere for more details on Gouraud shading.\r
-\r
-    Once you've got that, you just do something like this:\r
-\r
-  z = light1 << 16;\r
-  dz = ((light2 - light1) << 16) / (end_x - start_x);\r
-  for (i=start_x; i <= end_x; ++i) {\r
-    color = texture[v >> 16][u >> 16];\r
-    output = light_table[z >> 16][color];\r
-    screen[i] = color;\r
-    u += du;\r
-    v += dv;\r
-    z += dz;\r
-  }\r
-\r
-    Note that you shouldn't really do this as I've written the\r
-code.  light1 and light2 should be calculated with 16 bits of extra\r
-precision in the first place, rather than having to be shifted\r
-left when computing z.  I just did it that way so the code\r
-would be self-contained.\r
-\r
-    I'm going to attempt to give a reasonably fast assembly\r
-version of this.  However, there's a big problem with doing\r
-it fast.  The 80x86 only has one register that you can\r
-address the individual bytes in, and also use for indexing--BX.\r
-This means that it's a real pain to make our inner loop alternate\r
-texture map lookup and lighting fetch--whereas it's almost\r
-trivial on a 680x0.  I avoid this somewhat by processing two\r
-pixels at a time; first doing two texture map lookups, then\r
-doing two lighting lookups.\r
-\r
-     Here's a flat-shading inner loop.  I'm doing this code off the\r
-top of my head, so it may have bugs, but it's trying to show\r
-at least one way you might try to do this.  Since I use BP,\r
-I put variables in the FS segment, which means DS points\r
-to the texture, GS to the lighting table.\r
-\r
-        mov  ch,fs:light\r
-        adc  ax,ax\r
-loop8   shr  ax,1          ; restore carry\r
-        mov  cl,[bx]       ; get first sample, setting up cx for color lookup\r
-        adc  edx,esi       ; update v-high and u-low\r
-        adc  ebx,ebp       ; update u-high and v-low\r
-        mov  bh,dl         ; move v-high into tmap lookup register\r
-        mov  ah,[bx]       ; get second sample, save it in ah\r
-        adc  edx,esi\r
-        adc  ebx,ebp\r
-        mov  dh,bl         ; save value of bl\r
-        mov  bx,cx         ; use bx to address color map\r
-        mov  al,gs:[bx]    ; lookup color for pixel 1\r
-        mov  bl,ah         ; switch to pixel 2\r
-        mov  ah,gs:[bx]    ; lookup color for pixel 2\r
-        mov  es:[di],ax    ; output both pixels\r
-        mov  bl,dh         ; restore bl from dh\r
-        mov  bh,dl\r
-        adc  ax,ax         ; save carry so we can do CMP\r
-        add  di,2\r
-        cmp  di,fs:last_di ; rather than having to decrement cx\r
-        jne  loop8\r
-\r
-    For a Gouraud shading inner loop, we can now have three\r
-different numbers u, v, and z, which we're all adding at every\r
-step.  To do this, we use THREE adc, and we have to shuffle\r
-around which high-bits correspond to which low-bits in a\r
-complex way.  I'll leave you to figure this out for yourself,\r
-but here's an attempt at the inner loop.\r
-\r
-loop9   shr  ax,1          ; restore carry\r
-        mov  al,fs:[bx]    ; get first sample\r
-        mov  ah,cl         ; save away current z-high into AH\r
-                           ; this makes AX a value we want to lookup\r
-        adc  edx,esi       ; update v-high and u-low\r
-        adc  ebx,ebp       ; update u-high and z-low\r
-        adc  ecx,z_v_inc   ; update z-high and v-low\r
-        mov  bh,dl         ; move v-high into tmap lookup register\r
-        mov  ch,fs:[bx]    ; get second sample, save it in ch\r
-        mov  dh,bl         ; save value of bl\r
-        mov  bx,ax\r
-        mov  al,gs:[bx]    ; lookup first color value\r
-        mov  bl,ch\r
-        mov  bh,cl\r
-        mov  ah,gs:[bx]    ; lookup second color value\r
-        mov  es:[di],ax    ; output both pixels\r
-        mov  bl,dh         ; restore bl from dh\r
-        adc  edx,esi\r
-        adc  ebx,ebp\r
-        adc  ecx,z_v_inc\r
-        mov  bh,dl\r
-        adc  ax,ax         ; save carry\r
-        add  di,2\r
-        cmp  di,last_di    ; rather than having to decrement cx\r
-        jne  loop9\r
-\r
-    Notice that both of these loops are significantly slower\r
-than the original loop.  I'm not personally aware of any\r
-generally faster way to do this sort of thing (but the code\r
-can be tweaked to be faster).  The one exception is\r
-that for flat-run shading, you could precompute the entire\r
-texture with the right lighting.  This would require a lot\r
-of storage, of course, but if you view it as a cache, it\r
-would let you get some reuse of information from frame to\r
-frame, since polygons tend to be lit the same from frame to\r
-frame.\r
-\r
-    Finally, here's a brief discussion of transparency.\r
-There are two ways to get transparency effects.  The first\r
-one is slower, but more flexible.  You use _another_ lookup\r
-table.  You have to paint the texture that is transparent\r
-after you've drawn things behind it.  Then, in the inner\r
-loop, you fetch the texture value (and light it) to draw.\r
-Then you fetch the pixel that's currently in that location.\r
-Lookup in a "transparency" table with those two values as\r
-indices, and write out the result.  The idea is that you\r
-do this: table[new][old].  If new is a normal, opaque,\r
-color, then table[new][old] == new, for every value of old.\r
-If new is a special "color" which is supposed to be transparent,\r
-then table[new][old] == old, for every value of old.  This causes\r
-old to show through.  In addition, you can have translucency\r
-effects, where table[new][old] gives a mixture of the colors\r
-of old and new.  This will let you do effects like the\r
-translucent ghosts in the Ultima Underworlds.\r
-\r
-    However, the above approach is extremely slow, since you\r
-have to load the value from the pixel map and do the extra\r
-table lookup.  But it works for arbitrary polygons.   DOOM\r
-only allows transparency on walls, not on ceilings and floors.\r
-Remember we noticed that the special thing about walls is\r
-that u is constant as you draw a column from a wall; you\r
-are walking down a column in the texture map at the same\r
-time you are drawing a column on screen.  What this means\r
-is that you can use a data structure which encodes where\r
-the transparency in each column of the texture map is, and\r
-use that _outside_ the inner loop to handle transparency.\r
-For example, your data structure tells you that you have\r
-a run of 8 opaque pixels, then 3 transparent pixels, then\r
-5 more opaque ones.  You scale 8, 3, and 5 by the rate at\r
-which you're walking over the textures, and simply treat\r
-this as two seperate opaque runs.\r
-\r
-    The details of this method depend on exactly how you're\r
-doing your hidden surface removal, and since it doesn't\r
-generalize to floors&ceilings, much less to arbitrarily\r
-angled polygons, I don't think going into further detail\r
-will be very useful (I've never bothered writing such a\r
-thing, but I'm pretty sure that's all there is to it).\r
-\r
-\r
-TEX\r
-TE   The Postman Always Rings Twice\r
-T\r
-\r
-    If you're going to write to a slow 16-bit VGA card, you\r
-should try your darndest to always write 2 pixels at a time.\r
-\r
-    For texture mapping, your best bet is to build your screen\r
-in a buffer in RAM, and then copy it to the VGA all at once.\r
-You can do this in Mode 13h or in Mode X or Y, as your heart\r
-desires.  You should definitely do this if you're painting\r
-pixels more than once while drawing.\r
-\r
-    If, however, you wish to get a speedup by not paying\r
-for the extra copy, you might like to write directly to the\r
-VGA card from your inner loop.\r
-\r
-    You might not think this is very interesting.  If the\r
-write to the screen buffer in regular RAM is fast, how much\r
-can you gain by doing both steps at once, instead of splitting\r
-them in two?\r
-\r
-    The reason it is interesting is because the VGA, while\r
-slow to accept multiple writes, will let you continue doing\r
-processing after a single write.  What this means is that\r
-if you overlap your texture mapping computation with your\r
-write to the VGA, you can as much as double your speed on\r
-a slow VGA card.  For example, the fastest I can blast my\r
-slow VGA card is 45 fps.  I can texture map floor-style directly\r
-to it at 30 fps.  If I texture map to a memory buffer,\r
-this is still somewhat slow, more than just the difference\r
-between the 30 and 45 fps figures.  Thus, my total rate if\r
-I write to an offscreen buffer drops as low as 20 fps, depending\r
-on exactly what I do in the texture map inner loop.\r
-\r
-    Ok, so, now suppose you've decided it might be a speedup\r
-to write directly to the VGA.  There are two problems.  First\r
-of all, if you're in mode X or Y, it's very difficult to\r
-write two bytes at a time, which is necessary for this\r
-approach to be a win.  Second of all, even in mode 13h, it's\r
-difficult to write two bytes at a time when you're drawing\r
-a column of pixels.\r
-\r
-    I have no answer here.  I expect people to stick to\r
-offscreen buffers, or to simply process columns at a time\r
-and write (at excruciatingly slow rates on some cards) to\r
-the VGA only one byte at a time.\r
-\r
-    One option is to set up a page flipping mode 13h (which\r
-is possible on some VGA cards), and to paint two independent\r
-but adjacent columns at the same time, so that you can write\r
-a word at a time.  I have a very simple demo that does the\r
-latter, but it's not for the faint of heart, and I don't\r
-think it's a win once you have a lot of small polygons.\r
-\r
-    Another answer is to have a DOOM-style "low-detail"\r
-mode which computes one pixel, duplicates it, and always\r
-writes both pixels at the same time.\r
-\r
-    A final answer is just to ignore the market of people\r
-with slow VGA cards.  I wouldn't be surprised if this\r
-approach was commonplace in a year or two.  But if you do\r
-so with commercial software, please put a notice of this\r
-requirement on the box.\r
-\r
-TEX\r
-TE   Mipmapping (or is it Mip-Mapping?)\r
-T\r
-\r
-    Mipmapping is a very straightforward technique that\r
-can be used to significantly improve the quality of your\r
-textures, so much so that textures that you could not\r
-otherwise use because they look ugly become usable.\r
-\r
-    The problem that mipmapping addresses is as follows.\r
-When a texture is far in the distance, such that its\r
-on-screen size in pixels is significantly smaller than\r
-its actual size as a texture, only a small number of\r
-pixels will actually be visible.  If the texture contains\r
-areas with lots of rapidly varying high contrast data,\r
-the texture may look ugly, and, most importantly,\r
-moire artifacts will occur.  (To see this in DOOM, try\r
-shrinking the screen to the smallest setting and going\r
-outside in shareware DOOM.  Many of the buildings will\r
-show moire patterns.  In registered DOOM, there is\r
-a black-and-blue ceiling pattern which has very bad\r
-artifacts if it is brightly lit.  Go to the mission\r
-with the gigantic round acid pool near the beginning.\r
-Cheat to get light amplification goggles (or maybe\r
-invulnerability), and you'll see it.)\r
-\r
-    Mipmapping reduces these artifacts by precomputing\r
-some "anti-aliased" textures and using them when the\r
-textures are in the distance.\r
-\r
-    The basic idea is to substitute a texture map half as\r
-big when the polygon is so small that only every other\r
-pixel is being drawn anyway.  This texture map contains\r
-one pixel for every 2x2 square in the original, and is\r
-the color average of those pixels.\r
-\r
-    For a 64x64 texture map, you'd have the original\r
-map, a 32x32 map, a 16x16 map, an 8x8 map, etc.\r
-\r
-    The mipmaps will smear out colors and lose details.\r
-You can best test them by forcing them to be displayed\r
-while they're still close to you; once they appear to\r
-be working, set them up as described above.\r
-\r
-    Mipmapping causes a somewhat ugly effect when you\r
-see the textures switch from one mipmap to the next.\r
-However, especially for some textures, it is far less\r
-ugly than the effect you would get without them.\r
-\r
-    For example, a fine white-and-black checkerboard\r
-pattern (perhaps with some overlaid text) would look\r
-very ugly without mipmapping, as you would see random\r
-collections of white and black pixels (which isn't too\r
-bad), and you would see curving moire patterns (which\r
-is).  With mipmapping, at a certain distance the whole\r
-polygon would turn grey.\r
-\r
-    I do not believe any existing games for the PC\r
-use mipmapping.  However, examining the data file\r
-for the Amiga demo version of Legends of Valour showed\r
-smaller copies of textures, which made it look like\r
-mipmapping was being used.\r
-\r
-    Mipmapping requires 33% extra storage for the\r
-extra texture maps (25% for the first, 25% of 25%\r
-for the second, etc.).\r
-\r
-    This may also be a good idea for 2D bitmaps which\r
-are scaled (e.g. critters in Underworld & DOOM, or\r
-ships in Wing Commander II--although none of those\r
-appeared to use it.)\r
-\r
-    SGI's Reality Engine does mipmapping.  Actually,\r
-it does a texturemap lookup on two of the mipmaps,\r
-the "closer" one and the "farther" one, and uses\r
-a weighted average between them depending on which\r
-size is closer to correct.  (The RE also does\r
-anti-aliasing, which helps even more.)\r
-\r
-\r
-TEXTURE\r
-TEXUE\r
-TXR    Where Do We Go From Here?\r
-X\r
-\r
-    The above discussion mostly covers what is basically\r
-the state of the art of texture mapping on the PC.  Hopefully\r
-in the future every game will be at least as fast as the\r
-inner loops in this article allow.\r
-\r
-    As long as people want full-screen images, it'll\r
-be a while before we have enough computational power\r
-to do more than that.  But if we did have more power,\r
-what else could we do with it?\r
-\r
-    o  Better lighting\r
-      o  Colored lighting (requires complex lookup tables)\r
-      o  Phong shading (interpolation of normals--one sqrt() per pixel!)\r
-    o  Higher resolution (640x400, or 640x400 and anti-alias to 320x200)\r
-    o  A lot more polygons\r
-    o  Bump mapping (can be done today with huge amounts of precomputation)\r
-    o  Curved surfaces\r
diff --git a/16/PCGPE10/TIMER.ASM b/16/PCGPE10/TIMER.ASM
deleted file mode 100644 (file)
index edc5732..0000000
+++ /dev/null
@@ -1,129 +0,0 @@
-;--------------------------------------------------------------------------\r
-; Here is a source for measuring relative speed of computer. This source\r
-; will NOT function properly under multitaskers, as they use timer them-\r
-; selves. At least DesqView, OS/2 and Windows mess up with timer.\r
-;\r
-; This source is copyright 1994 of Teemu Peltonen aka Quark/Remedy Prods.\r
-; If you modify this source, please do not spread it! You may spread the\r
-; unmodified source as much as you like, but please check that length of\r
-; the actual source (not including this comment between vertical lines) is\r
-; 91 lines!\r
-;\r
-; The way of measuring computer's speed is not the best possible, but it\r
-; works. Here's a small kind of table of speeds:\r
-;\r
-; CPU           Output value\r
-; 486DX/33MHz   024Ch\r
-; 486SX/20MHz   03D4h\r
-; 386DX/40MHz   05EDh\r
-; 386DX/16MHz   0DBAh\r
-; 286  /10MHz   1500h\r
-; 086  /4.77MHz 6006h\r
-;\r
-; Notice! Values may differ from these about 2 up or down. You should\r
-; run the tester for about five times and use the value that seems to\r
-; appear most times. Disk caches and others can mess up test.\r
-;\r
-; Thanks to my BBS's users for testing this piece of software!\r
-;\r
-; If you wish to add your computer's speed here, please contact author.\r
-; Feel free to contact me, even if you wouldn't want to add your speed..\r
-; Contact addresses are:\r
-; teemu.peltonen@stream.nullnet.fi in Internet\r
-; Teemu Peltonen@2:222/100         in Fidonet\r
-; Teemu Peltonen@68:100/100        in DGi-net\r
-; Or call Bitstream BBS (+358-21-4383244) and leave a comment to operator\r
-; (command C).\r
-;--------------------------------------------------------------------------\r
-stacki  segment para stack use16 'stack'\r
-        dw      100h dup (?)\r
-stacki  ends\r
-\r
-data    segment para public use16 'data'\r
-hexval  db      '0123456789ABCDEF'\r
-stringi db      'Relative speed of computer is '\r
-d       db      0\r
-c       db      0\r
-b       db      0\r
-a       db      0\r
-endi    db      'h.$'\r
-data    ends\r
-\r
-code    segment para public use16 'code'\r
-        assume cs:code, ds:data, ss:stacki\r
-startup:\r
-        mov     ax, seg data\r
-        mov     ds, ax\r
-\r
-        cli\r
-\r
-        mov     al, 34h\r
-        out     43h, al         ;OUT can be used as immediate\r
-                                ;if register value under 100h\r
-\r
-        xor     al, al\r
-        out     40h, al\r
-        out     40h, al\r
-\r
-        sti\r
-\r
-        mov     cx, 1000h       ;action here,\r
-here:                           ;must not take\r
-        dec     cx              ;more than 1/18\r
-        jnz     here            ;(0.0555) seconds to run\r
-\r
-        cli\r
-\r
-        mov     al, 4h\r
-        out     43h, al\r
-\r
-\r
-        in      al, 40h\r
-        mov     dl, al\r
-        in      al, 40h\r
-        mov     dh, al\r
-\r
-        sti\r
-\r
-        neg     dx              ;Action took bx/1193180 seconds\r
-\r
-        mov     cl, dh\r
-        and     cl, 11110000b\r
-        shr     cl, 4\r
-        xor     bx, bx\r
-        mov     bl, cl\r
-        mov     ah, hexval[bx]\r
-        mov     d, ah\r
-\r
-        mov     cl, dh\r
-        and     cl, 00001111b\r
-        xor     bx, bx\r
-        mov     bl, cl\r
-        mov     ah, hexval[bx]\r
-        mov     c, ah\r
-\r
-        mov     cl, dl\r
-        and     cl, 11110000b\r
-        shr     cl, 4\r
-        xor     bx, bx\r
-        mov     bl, cl\r
-        mov     ah, hexval[bx]\r
-        mov     b, ah\r
-\r
-        mov     cl, dl\r
-        and     cl, 00001111b\r
-        xor     bx, bx\r
-        mov     bl, cl\r
-        mov     ah, hexval[bx]\r
-        mov     a, ah\r
-\r
-\r
-        mov     ax, 0900h\r
-        mov     dx, offset stringi\r
-        int     21h\r
-\r
-        mov     ax, 4c00h\r
-        int     21h\r
-\r
-code    ends\r
-        end     startup\r
diff --git a/16/PCGPE10/TRIDENT.TXT b/16/PCGPE10/TRIDENT.TXT
deleted file mode 100644 (file)
index 67d8f07..0000000
+++ /dev/null
@@ -1,129 +0,0 @@
-\r
-                 ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-                 ³ Programming the Trident SVGA Chip ³\r
-                 ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-                 Written for the PC-GPE by Mark Feldman\r
-            e-mail address : u914097@student.canberra.edu.au\r
-                             myndale@cairo.anu.edu.au\r
-\r
-                  Please read the file SVGINTRO.TXT\r
-              (Graphics/SVGA/Intro PC-GPE menu option)\r
-\r
-             ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-             ³      THIS FILE MAY NOT BE DISTRIBUTED     ³\r
-             ³ SEPARATE TO THE ENTIRE PC-GPE COLLECTION. ³\r
-             ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Disclaimer ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-I assume no responsibility whatsoever for any effect that this file, the\r
-information contained therein or the use thereof has on you, your sanity,\r
-computer, spouse, children, pets or anything else related to you or your\r
-existance. No warranty is provided nor implied with this information.\r
-\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Identifying the Trident SVGA Card ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-There are two Trident SVGA chips, the TVGA 8800 and 8900.\r
-\r
-The Trident SVGA chips can be identified by attempting to change the\r
-Mode Control #1 register as follows:\r
-\r
-          Index : 0Eh at port 3C4h\r
-          Read/write data from port 3C5h\r
-          ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿\r
-          ³ 7 ³ 6 ³ 5 ³ 4 ³ 3 ³ 2 ³ 1 ³ 0 ³\r
-          ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÙ\r
-                                    ³\r
-                                   PAGE\r
-\r
-First write the value 0Eh to port 3C4h. Then read the value in from port\r
-3C5h and save it. for rest Next write the value 00h to port 3C5h and\r
-read the value back in from the port. If bit 1 in the value read is set\r
-(ie = 1) then a trident chip is present. Finally write the original value\r
-back to port 3C5h to leave the SVGA adapter in it's original state.\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Identifying which Trident Chip is Present ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-The Trident chip can be identified with the following psuedo code :\r
-\r
-Port[$3C4] := $0B\r
-Port[$3C5] := $00\r
-hardware_version_number := Port[$3C5]\r
-if hardware_version_number >= 3 then\r
-  chip is an 8900\r
-else\r
-  chip is an 8800\r
-\r
-This procedure leaves the chip in "New Mode". New Mode and Old mode are\r
-discussed below.\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Trident Graphics Display Modes ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-           ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-           ³ Mode     Resolution       Colors    Chip      ³\r
-           ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´\r
-           ³ 5Bh      800x600          16        8800/8900 ³\r
-           ³ 5Ch      640x400          256       8800/8900 ³\r
-           ³ 5Dh      640x480          256       8800/8900 ³\r
-           ³ 5Eh      800x600          256       8900      ³\r
-           ³ 5Fh      1024x768         16        8800/8900 ³\r
-           ³ 61h      768x1024         16        8800/8900 ³\r
-           ³ 62h      1024x768         256       8900      ³\r
-           ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Trident Display Memory ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-Both Trident chips can map video memory in either 64K or 128K paging\r
-schemes. The 8800 defaults to the 128K paging scheme at power up. This\r
-scheme is known as the "Old Mode". The 8900 defaults to the 64K paging\r
-scheme, the "New Mode". This file will concentrate solely on the 64K new\r
-mode operation.\r
-\r
-The new mode can be set with the following procedure:\r
-\r
-Port[$3C4] := $0B               { Set the old mode 128K scheme }\r
-Port[$3C5] := $00\r
-dummy_variable := Port[$3C5]    { Toggle over to the new mode }\r
-\r
-Trident bank switching is weird, REALLY weird! In new mode, the New Mode\r
-Control Register # 1 is used to select the active bank:\r
-\r
-          Index : 0Eh at port 3C4h\r
-          Read/write data from port 3C5h\r
-          ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿\r
-          ³ 7 ³ 6 ³ 5 ³ 4 ³ 3 ³ 2 ³ 1 ³ 0 ³\r
-          ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÙ\r
-                            ÀÄÂÄÙ   ³   ³\r
-                            Bank  Page Seg\r
-\r
-Bits 3-0 can be considered as a single 4 bit bank number. However, when\r
-you write to video memory the Trident inverts the Page bit to determine\r
-which bank should actually be written to. So if you set these bits to the\r
-value 0 (0000) then bank 0 will be used for all read operations and bank 2\r
-(0010) will be used for all write operations.\r
-\r
-The following code will set the bank number for all read operations:\r
-\r
-PortW[$3C4] := bank_number shl 8 + $0E;\r
-\r
-The following code will set the bank number for all write operations:\r
-\r
-PortW[$3C4] := (bank_number xor 2) shl 8 + $0E;\r
-\r
-It is important to realise that setting the write bank number changes the\r
-read bank number, and visa-versa. How you are supposed to rapidly transfer\r
-blocks of data around on the Trident screen is beyond me.\r
-\r
diff --git a/16/PCGPE10/TSENG.TXT b/16/PCGPE10/TSENG.TXT
deleted file mode 100644 (file)
index 41c10ca..0000000
+++ /dev/null
@@ -1,139 +0,0 @@
-\r
-                  ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-                  ³ Programming the Tseng SVGA Chip ³\r
-                  ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-                 Written for the PC-GPE by Mark Feldman\r
-            e-mail address : u914097@student.canberra.edu.au\r
-                             myndale@cairo.anu.edu.au\r
-\r
-                  Please read the file SVGINTRO.TXT\r
-              (Graphics/SVGA/Intro PC-GPE menu option)\r
-\r
-             ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-             ³      THIS FILE MAY NOT BE DISTRIBUTED     ³\r
-             ³ SEPARATE TO THE ENTIRE PC-GPE COLLECTION. ³\r
-             ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Disclaimer ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-I assume no responsibility whatsoever for any effect that this file, the\r
-information contained therein or the use thereof has on you, your sanity,\r
-computer, spouse, children, pets or anything else related to you or your\r
-existance. No warranty is provided nor implied with this information.\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Identifying the Tseng SVGA Card ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-Tseng Labs have produced two SVGA Chips, the ET3000 and the ET4000.\r
-\r
-The Tseng SVGA chips can be identified by attempting to change the\r
-Miscellaneous register as follows:\r
-\r
-          Index : 06h at port 3C0h\r
-          Read/write data from port 3C1h\r
-          ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿\r
-          ³ 7 ³ 6 ³ 5 ³ 4 ³ 3 ³ 2 ³ 1 ³ 0 ³\r
-          ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÙ\r
-                    ÀÄÂÄÙ\r
-                     High\r
-\r
-Output the value 6 to port 3C0h and read a byte from port 3C1h. Modify\r
-the high field in this byte (eg new byte = byte XOR 30h) and write this\r
-new byte to port 3C1h. Read the byte from port 3C1h and see if the byte\r
-was successfully modified, if it was then a Tseng chip is present. Having\r
-done this, write the original byte back to port 3C1h to leave the graphics\r
-adapter in it's original state.\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Identifying which Tseng Card is Present ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-The ET4000 can be distinguished from the ET3000 by attempting to change the\r
-ET4000 Extended Start Address register as follows:\r
-\r
-          Index : 33h at port 3D4h\r
-          Read/write data from port 3D5h\r
-          ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿\r
-          ³ 7 ³ 6 ³ 5 ³ 4 ³ 3 ³ 2 ³ 1 ³ 0 ³\r
-          ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÙ\r
-                            ÀÄÂÄÙ   ÀÄÂÄÙ\r
-                             CAD     DAD\r
-\r
-The same technique is used as was used to identify the presence of a\r
-Tseng chip, both fields should be modified, written, tested for a successful\r
-write and then restored to their original values. If the change was\r
-successful an ET4000 chip is present, otherwise an ET3000 chip is.\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Tseng Graphics Display Modes ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-            ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-            ³ Mode     Resolution       Colors    ³\r
-            ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´\r
-            ³ 25h      640x480          16        ³\r
-            ³ 29h      800x600          16        ³\r
-            ³ 2Dh      640x350          256       ³\r
-            ³ 2Eh      640x480          256       ³\r
-            ³ 2Fh      640x400          256       ³\r
-            ³ 30h      800x600          256       ³\r
-            ³ 37h      1024x768         16        ³\r
-            ³ 38h      1024x768         256       ³\r
-            ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-All graphics modes in the above table are supported by the ET4000. I am not\r
-sure which modes are supported by the ET3000.\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Tseng Display Memory ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-In my opinion the Tseng memory mapping was designed to prevent graphics\r
-programmers from suffering nervous breakdowns!\r
-\r
-Two banks can be mapped to the segment A000:0000-FFFFh, one for\r
-reading and one for writing. The banks can be selected by writing to\r
-the Segment Select Registers at port 3Cdh:\r
-\r
-ET3000 Segment Select Register:\r
-          Port 3CDh\r
-          ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿\r
-          ³ 7 ³ 6 ³ 5 ³ 4 ³ 3 ³ 2 ³ 1 ³ 0 ³\r
-          ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÙ\r
-                    ÀÄÄÄÂÄÄÄÙ   ÀÄÄÄÂÄÄÄÙ\r
-                      Read         Write\r
-                      Bank         Bank\r
-\r
-ET4000 Segment Select Register:\r
-          Port 3CDh\r
-          ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿\r
-          ³ 7 ³ 6 ³ 5 ³ 4 ³ 3 ³ 2 ³ 1 ³ 0 ³\r
-          ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÙ\r
-            ÀÄÄÄÄÄÂÄÄÄÄÄÙ   ÀÄÄÄÄÄÂÄÄÄÄÄÙ\r
-                 Read           Write\r
-                 Bank           Bank\r
-\r
-Both of these registers can be read from as well as written to.\r
-\r
-Each bank is 64K long, has a 64K granularity and is mapped to host\r
-memory A000:0000-FFFFh.\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ DPMI and the ET4000 ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-Apparently the ET4000 chip is capable of linear addressing in dos protect-\r
-mode programs. To enable this feature write the value 36h to port 3D4h,\r
-read the value from port 3D5h, set the lower nibble (bits 0 -> 3) to the\r
-value 1 and rewrite the value to port 3D5h. Resetting these bits to the\r
-value 0 puts the chip back in regular segmented addressing mode.\r
-\r
-I have no information where or how the entire ET4000 memory would then be\r
-mapped to linear memory. If anyone has more information on this or has a\r
-Tseng card they are willing to try it on let me know.\r
-\r
diff --git a/16/PCGPE10/TUT1.TXT b/16/PCGPE10/TUT1.TXT
deleted file mode 100644 (file)
index e220d00..0000000
+++ /dev/null
@@ -1,369 +0,0 @@
-                   ÕÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͸\r
-                   ³         W E L C O M E         ³\r
-                   ³  To the VGA Trainer Program   ³ ³\r
-                   ³              By               ³ ³\r
-                   ³      DENTHOR of ASPHYXIA      ³ ³ ³\r
-                   ÔÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ; ³ ³\r
-                     ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ ³\r
-                       ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-                           --==[ PART 1 ]==--\r
-\r
-\r
-\r
-þ Introduction\r
-\r
-\r
-\r
-Hi there! This is Denthor of ASPHYXIA, AKA Grant Smith. This training\r
-program is aimed at all those budding young demo coders out there. I am\r
-assuming that the reader is fairly young, has a bit of basic Std. 6 math\r
-under his belt, has done a bit of programming before, probably in BASIC,\r
-and wants to learn how to write a demo all of his/her own.\r
-\r
-This I what I am going to do. I am going to describe how certain routines\r
-work, and even give you working source code on how you do it. The source\r
-code will assume that you have a VGA card that can handle the\r
-320x200x256 mode. I will also assume that you have Turbo Pascal 6.0 or\r
-above (this is because some of the code will be in Assembly language,\r
-and Turbo Pascal 6.0 makes this incredibly easy to use). By the end of\r
-the first "run" of sections, you will be able to code some cool demo\r
-stuff all by yourself. The info you need, I will provide to you, but it\r
-will be you who decides on the most spectacular way to use it.\r
-\r
-Why not download some of our demos and see what I'm trying to head you\r
-towards.\r
-\r
-I will be posting one part a week on the Mailbox BBS. I have the first\r
-"run" of sections worked out, but if you want me to also do sections on\r
-other areas of coding, leave a message to Grant Smith in private E-Mail,\r
-or start a conversation here in this conference. I will do a bit of\r
-moderating of a sort, and point out things that have been done wrong.\r
-\r
-In this, the first part, I will show you how you are supposed to set up\r
-your Pascal program, how to get into 320x200x256 graphics mode without a\r
-BGI file, and various methods of putpixels and a clearscreen utility.\r
-\r
-NOTE : I drop source code all through my explanations. You needn't try\r
-       to grab all of it from all over the place, at the end of each part I\r
-       add a little program that uses all the new routines that we have\r
-       learned. If you do not fully understand a section, leave me\r
-       private mail telling me what you don't understand or asking how I\r
-       got something etc, and I will try to make myself clearer. One\r
-       last thing : When you spot a mistake I have made in one of my\r
-       parts, leave me mail and I will correct it post-haste.\r
-\r
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
-þ Disclaimer\r
-\r
-\r
-\r
-Hi again, sorry that I have to add this, but here goes. All source code\r
-obtained from this series of instruction programs is used at your own\r
-risk. Denthor and the ASPHYXIA demo team hold no responsibility for any\r
-loss or damage suffered by anyone through the use of this code. Look\r
-guys, the code I'm going to give you has been used by us before in\r
-Demos, Applications etc, and we have never had any compliants of machine\r
-damage, but if something does go wrong with your computer, don't blame\r
-us. Sorry, but that's the way it is.\r
-\r
-\r
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
-þ The MCGA mode and how you get into it in Pascal without a BGI\r
-\r
-\r
-Lets face it. BGI's are next to worthless for demo coding. It is\r
-difficult to find something that is slower then the BGI units for doing\r
-graphics. Another thing is, they wern't really meant for 256 color\r
-screens anyhow. You have to obtain a specific external 256VGA BGI to get\r
-into it in Pascal, and it just doesn't make the grade.\r
-\r
-So the question remains, how do we get into MCGA 320x200x256 mode in\r
-Pascal without a BGI? The answer is simple : Assembly language.\r
-Obviously assembly language has loads of functions to handle the VGA\r
-card, and this is just one of them. If you look in Norton Gides to\r
-Assembly Language, it says this ...\r
-\r
-____________________________________________________________________\r
-INT 10h,  00h (0)        Set Video Mode\r
-\r
-    Sets the video mode.\r
-\r
-       On entry:      AH         00h\r
-                      AL         Video mode\r
-\r
-       Returns:       None\r
-\r
-       Registers destroyed:      AX, SP, BP, SI, DI\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-\r
-This is all well and good, but what does it mean? It means that if you\r
-plug in the video mode into AL and call interrupt 10h, SHAZAM! you are\r
-in the mode of your choice. Now, the MCGA video mode is mode 13h, and\r
-here is how we do it in Pascal.\r
-\r
-Procedure SetMCGA;\r
-BEGIN\r
-  asm\r
-        mov     ax,0013h\r
-        int     10h\r
-  end;\r
-END;\r
-\r
-There you have it! One call to that procedure, and BANG you are in\r
-320x200x256 mode. We can't actually do anything in it yet, so to go back\r
-to text mode, you make the video mode equal to 03h, as seen below :\r
-\r
-Procedure SetText;\r
-BEGIN\r
-  asm\r
-        mov     ax,0003h\r
-        int     10h\r
-  end;\r
-END;\r
-\r
-\r
-BANG! We are back in text mode! Now, cry all your enquiring minds, what\r
-use is this? We can get into the mode, but how do we actually SHOW\r
-something on the screen? For that, you must move onto the next section\r
-....\r
-\r
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
-þ  Clearing the screen to a specific color\r
-\r
-Now that we are in MCGA mode, how do we clear the screen. The answer is\r
-simple : you must just remember that the base adress of the screen is\r
-$a000. From $a000, the next 64000 bytes are what is actually displayed on\r
-the screen (Note : 320 * 200 = 64000). So to clear the screen, you just use\r
-the fillchar command (a basic Pascal command) like so :\r
-\r
-      FillChar (Mem [$a000:0],64000,Col);\r
-\r
-What the mem command passes the Segment base and the Offset of a part of\r
-memory : in this case the screen base is the Segment, and we are starting\r
-at the top of the screen; Offset 0. The 64000 is the size of the screen\r
-(see above), and Col is a value between 0 and 255, which represents the\r
-color you want to clear the screen to.\r
-\r
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
-þ  Putting a pixel on the screen (two different methoods)\r
-\r
-If you look in Norton Guides about putting a pixel onto the screen, you\r
-will see this  :\r
-\r
-\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-    Writes a pixel dot of a specified color at a specified screen\r
-    coordinate.\r
-\r
-    On entry:      AH         0Ch\r
-                   AL         Pixel color\r
-                   CX         Horizontal position of pixel\r
-                   DX         Vertical position of pixel\r
-                   BH         Display page number (graphics modes with more\r
-                              than 1 page)\r
-\r
-    Returns:       None\r
-\r
-    Registers destroyed:      AX, SP, BP, SI, DI\r
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-\r
-As seen from our SetMCGA example, you would write this by doing the following:\r
-\r
-Procedure INTPutpixel (X,Y : Integer; Col : Byte);\r
-BEGIN\r
-  asm\r
-     mov        ah,0Ch\r
-     mov        al,[col]\r
-     mov        cx,[x]\r
-     mov        dx,[y]\r
-     mov        bx,[1]\r
-     int        10h\r
-  end;\r
-END;\r
-\r
-The X would be the X-Coordinate, the Y would be the Y-Coordinate, and the Col\r
-would be the color of the pixel to place. Note that MCGA has 256 colors,\r
-numbered 0 to 255. The startoff pallette is pretty grotty, and I will show\r
-you how to alter it in my next lesson, but for now you will have to hunt for\r
-colors that fit in for what you want to do. Luckily, a byte is 0 to 255, so\r
-that is what we pass to the col variable. Have a look at the following.\r
-\r
-    CGA = 4 colours.\r
-    4x4 = 16\r
-    EGA = 16 colors.\r
-    16x16 = 256\r
-    VGA = 256 colors.\r
-    Therefore an EGA is a CGA squared, and a VGA is an EGA squared ;-)\r
-\r
-Anyway, back to reality. Even though the abouve procedure is written in\r
-assembly language, it is slooow. Why? I hear your enquiring minds cry. The\r
-reason is simple : It uses interrupts (It calls INT 10h). Interrupts are\r
-sloooow ... which is okay for getting into MCGA mode, but not for trying\r
-to put down a pixel lickety-split. So, why not try the following ...\r
-\r
-Procedure MEMPutpixel (X,Y : Integer; Col : Byte);\r
-BEGIN\r
-  Mem [VGA:X+(Y*320)]:=Col;\r
-END;\r
-\r
-\r
-The Mem command, as we have seen above, allows you to point at a certain\r
-point in memory ... the starting point is $a000, the base of the VGA's\r
-memory, and then we specify how far into this base memory we start.\r
-Think of the monitor this way. It starts in the top left hand corner at\r
-0. As you increase the number, you start to move across the screen to your\r
-right, until you reach 320. At 320, you have gone all the way across the\r
-screen and come back out the left side, one pixel down. This carries on\r
-until you reach 63999, at the bottom right hand side of the screen. This\r
-is how we get the equation X+(Y*320). For every increased Y, we must\r
-increment the number by 320. Once we are at the beginning of the Y line\r
-we want, we add our X by how far out we want to be. This gives us the\r
-exact point in memory that we want to be at, and then we set it equal to\r
-the pixel value we want.\r
-\r
-The MEM methood of putpixel is much faster, and it is shown in the sample\r
-program at the end of this lesson. The ASPHYXIA team uses neither putpixel;\r
-we use a DMA-Straight-To-Screen-Kill-Yer-Momma-With-An-Axe type putipixel\r
-which is FAST. We will give it out, but only to those of you who show us\r
-you are serious about coding. If you do do anything, upload it to me,\r
-I will be very interested to see it. Remember : If you do glean anything\r
-from these training sessions, give us a mention in your demos and UPLOAD\r
-YOUR DEMO TO US!\r
-\r
-Well, after this is the sample program; have fun with it, UNDERSTAND it,\r
-and next week I will start on fun with the pallette.\r
-\r
-See you all later,\r
-    - Denthor\r
-\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ TUTPROG1.PAS ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-\r
-{$X+}   (* This is a handy little trick to know. If you put this at the top\r
-           of your program, you do not have to set a variable when calling\r
-           a function, i.e. you may just say 'READKEY' instead of\r
-           'CH:=READKEY'                                                *)\r
-\r
-USES Crt;           (* This has a few nice functions in it, such as the\r
-                       READKEY command.                                 *)\r
-\r
-CONST VGA = $a000;  (* This sets the constant VGA to the segment of the\r
-                       VGA screen.                                      *)\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure SetMCGA;  { This procedure gets you into 320x200x256 mode. }\r
-BEGIN\r
-  asm\r
-     mov        ax,0013h\r
-     int        10h\r
-  end;\r
-END;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure SetText;  { This procedure returns you to text mode.  }\r
-BEGIN\r
-  asm\r
-     mov        ax,0003h\r
-     int        10h\r
-  end;\r
-END;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure Cls (Col : Byte);\r
-   { This clears the screen to the specified color }\r
-BEGIN\r
-  Fillchar (Mem [$a000:0],64000,col);\r
-END;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure INTPutpixel (X,Y : Integer; Col : Byte);\r
-   { This puts a pixel on the screen using interrupts. }\r
-BEGIN\r
-  asm\r
-     mov        ah,0Ch\r
-     mov        al,[col]\r
-     mov        cx,[x]\r
-     mov        dx,[y]\r
-     mov        bx,[1]\r
-     int        10h\r
-  end;\r
-END;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure TestINTPutpixel;\r
-   { This tests out the speed of the INTPutpixel procedure. }\r
-VAR loop1,loop2 : Integer;\r
-BEGIN\r
-  For loop1:=0 to 319 do\r
-    For loop2:=0 to 199 do\r
-      INTPutpixel (loop1,loop2,Random (256));\r
-  Readkey;\r
-  Cls (0);\r
-END;\r
-\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure MEMPutpixel (X,Y : Integer; Col : Byte);\r
-  { This puts a pixel on the screen by writing directly to memory. }\r
-BEGIN\r
-  Mem [VGA:X+(Y*320)]:=Col;\r
-END;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure TestMEMPutpixel;\r
-   { This tests out the speed of the MEMPutpixel procedure. }\r
-VAR loop1,loop2 : Integer;\r
-BEGIN\r
-  For loop1:=0 to 319 do\r
-    For loop2:=0 to 199 do\r
-      MEMPutpixel (loop1,loop2,Random (256));\r
-  Readkey;\r
-  Cls (0);\r
-END;\r
-\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-BEGIN    (* Of the main program *)\r
-  ClrScr;               { This clears the text Screen (CRT unit) }\r
-  Writeln ('What will happen is that I will clear the screen twice. After');\r
-  Writeln ('each clear screen you will have to hit a key. I will then fill');\r
-  Writeln ('the screen twice with randomlly colored pixels using two different');\r
-  Writeln ('methoods, after each of which you will have to hit a key. I will');\r
-  Writeln ('then return you to text mode.');\r
-  Writeln; Writeln;\r
-  Write ('Hit any kay to continue ...');\r
-  Readkey;\r
-\r
-  SetMCGA;\r
-  CLS (32);\r
-  Readkey;\r
-  CLS (90);\r
-  Readkey;\r
-  TestINTPutpixel;\r
-  TestMEMPutpixel;\r
-  SetText;\r
-\r
-  Writeln ('All done. This concludes the first sample program in the ASPHYXIA');\r
-  Writeln ('Training series. You may reach DENTHOR under the name of GRANT');\r
-  Writeln ('SMITH on the MailBox BBS, or leave a message to ASPHYXIA on the');\r
-  Writeln ('ASPHYXIA BBS. Get the numbers from Roblist, or write to :');\r
-  Writeln ('             Grant Smith');\r
-  Writeln ('             P.O. Box 270');\r
-  Writeln ('             Kloof');\r
-  Writeln ('             3640');\r
-  Writeln ('I hope to hear from you soon!');\r
-  Writeln; Writeln;\r
-  Write   ('Hit any key to exit ...');\r
-  Readkey;\r
-END.     (* Of the main program *)
\ No newline at end of file
diff --git a/16/PCGPE10/TUT10.TXT b/16/PCGPE10/TUT10.TXT
deleted file mode 100644 (file)
index c634443..0000000
+++ /dev/null
@@ -1,514 +0,0 @@
-                   ÕÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͸\r
-                   ³         W E L C O M E         ³\r
-                   ³  To the VGA Trainer Program   ³ ³\r
-                   ³              By               ³ ³\r
-                   ³      DENTHOR of ASPHYXIA      ³ ³ ³\r
-                   ÔÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ; ³ ³\r
-                     ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ ³\r
-                       ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-                           --==[ PART 10 ]==--\r
-\r
-\r
-\r
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
-þ Introduction\r
-\r
-Wow! The trainer has finally reached part 10! This will also be the\r
-first part introduced simultaneously to local BBS's and the INTERNET at\r
-the same time! Yes folks, I put up a copy of previous tutorials onto\r
-various ftp sites, and awaited the flames saying that the net.gurus\r
-already knew this stuff, and why was I wasting disk space! The flames\r
-did not appear (well, except for one), and I got some messages saying\r
-keep it up, so from now on I will upload all future trainers to ftp\r
-sites too (wasp.eng.ufl.edu , cs.uwp.edu etc.). I will also leave a\r
-notice in the USENET groups comp.lang.pascal and comp.sys.ibm.pc.demos\r
-when a new part is finished (Until enough people say stop ;-))\r
-\r
-I can also be reached at my new E-Mail address,\r
-                 smith9@batis.bis.und.ac.za\r
-\r
-Well, this tutorial is on Chain-4. When asked to do a trainer on\r
-Chain-4, I felt that I would be walking on much travelled ground (I have\r
-seen numerous trainers on the subject), but the people who asked me said\r
-that they hadn't seen any, so could I do one anyway? Who am I to say no?\r
-\r
-The sample program attached isn't that great, but I am sure that all you\r
-people out there can immediately see the potential that Chain-4 holds.\r
-\r
-\r
-If you would like to contact me, or the team, there are many ways you\r
-can do it : 1) Write a message to Grant Smith/Denthor/Asphyxia in private mail\r
-                  on the ASPHYXIA BBS.\r
-            2) Write to Denthor, EzE or Goth on Connectix.\r
-            3) Write to :  Grant Smith\r
-                           P.O.Box 270 Kloof\r
-                           3640\r
-                           Natal\r
-                           South Africa\r
-            4) Call me (Grant Smith) at (031) 73 2129 (leave a message if you\r
-                  call during varsity). Call +27-31-73-2129 if you call\r
-                  from outside South Africa. (It's YOUR phone bill ;-))\r
-            5) Write to smith9@batis.bis.und.ac.za in E-Mail.\r
-\r
-NB : If you are a representative of a company or BBS, and want ASPHYXIA\r
-       to do you a demo, leave mail to me; we can discuss it.\r
-NNB : If you have done/attempted a demo, SEND IT TO ME! We are feeling\r
-        quite lonely and want to meet/help out/exchange code with other demo\r
-        groups. What do you have to lose? Leave a message here and we can work\r
-        out how to transfer it. We really want to hear from you!\r
-\r
-\r
-\r
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
-þ What is Chain-4?\r
-\r
-You people out there all have at least 256k vga cards. Most of you have\r
-512k vga cards, and some have 1MB vga cards. But what you see on your\r
-screen, as discussed in previous trainers, is 64k of data! What happened\r
-to the other 192k??? Chain-4 is a method of using all 256k at one time.\r
-\r
-The way this is done is simple. 1 screen = 64k. 64k * 4 = 256k.\r
-Therefore, chain-4 allows you to write to four screens, while displaying\r
-one of them. You can then move around these four screens to see the data\r
-on them. Think of the Chain-4 screen as a big canvas. The viewport,\r
-the bit you see out of, is a smaller rectangle which can be anywhere\r
-over the bigger canvas.\r
-\r
-     +----------------------------+ Chain-4 screen\r
-     |          +--+              |\r
-     |          |  | <- Viewport  |\r
-     |          +--+              |\r
-     |                            |\r
-     +----------------------------+\r
-\r
-\r
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
-þ The size of the chain-4 screen\r
-\r
-The Chain-4 screen, can be any size that adds up to 4 screens.\r
-\r
-For example, it can be 4 screens across and one screen down, or one\r
-screen across and 4 screens down, or two screens across and two screens\r
-down, and any size in between.\r
-\r
-In the sample program, the size is a constant. The size * 8 is how many\r
-pixels across there are on the chain-4 screen, ie\r
-   Size = 40   = 320 pixels across = 1 screen across, 4 screens down\r
-   Size = 80   = 640 pixels across = 2 screens across, 2 screens down\r
-etc.\r
-\r
-We need to know the size of the screen for almost all dealings with the\r
-Chain-4 screen, for obvious reasons.\r
-\r
-\r
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
-þ Layout of the chain-4 screen, and accessing it\r
-\r
-If you will remember all the way back to Part 1 of this series, I\r
-explained that the memory layout of the MCGA screen is linear. Ie, the\r
-top left hand pixel was pixel zero, the one to the right of it was\r
-number one, the next one was number two etc. With Chain-4, things are\r
-very different.\r
-\r
-Chain-4 gets the 4 screens and chains them together (hence the name :)).\r
-Each screen has a different plane value, and must be accessed\r
-differently. The reason for this is that a segment of memory is only 64k\r
-big, so that we could not fit the entire Chain-4 screen into one\r
-segment.\r
-\r
-All Chain-4 screens are accessed from $a000, just like in MCGA mode.\r
-What we do is, before we write to the screen, find out what plane we are\r
-writing to, set that plane, then plot the pixel. Here is how we find out\r
-how far in to plot the pixel and what plane it is on :\r
-\r
- Instead of the linear model of MCGA mode, ie :\r
-        ÚÄÄÂÄÄÂÄÄÂÄÄÂÄÄÂÄÄÂÄÄÂÄÄÂÄÄÂÄÄÂÄÄÂÄÄ¿\r
-        ³00³01³02³03³04³05³06³07³08³09³10³11³ ...\r
-\r
- Each plane of the Chain-4 screen accesses the memory in this way :\r
-\r
-       Plane 0 :\r
-        ÚÄÄÂÄÄÂÄÄÂÄÄÂÄÄÂÄÄÂÄÄÂÄÄÂÄÄÂÄÄÂÄÄÂÄÄ¿\r
-        ³00³  ³  ³  ³01³  ³  ³  ³02³  ³  ³  ³ ...\r
-\r
-       Plane 1 :\r
-        ÚÄÄÂÄÄÂÄÄÂÄÄÂÄÄÂÄÄÂÄÄÂÄÄÂÄÄÂÄÄÂÄÄÂÄÄ¿\r
-        ³  ³00³  ³  ³  ³01³  ³  ³  ³02³  ³  ³ ...\r
-\r
-       Plane 2 :\r
-        ÚÄÄÂÄÄÂÄÄÂÄÄÂÄÄÂÄÄÂÄÄÂÄÄÂÄÄÂÄÄÂÄÄÂÄÄ¿\r
-        ³  ³  ³00³  ³  ³  ³01³  ³  ³  ³02³  ³ ...\r
-\r
-       Plane 3 :\r
-        ÚÄÄÂÄÄÂÄÄÂÄÄÂÄÄÂÄÄÂÄÄÂÄÄÂÄÄÂÄÄÂÄÄÂÄÄ¿\r
-        ³  ³  ³  ³00³  ³  ³  ³01³  ³  ³  ³02³ ...\r
-\r
-In this way, by choosing the right plane to write to, we can access all\r
-of the 256k of memory available to us. The plane that we write to can\r
-easily be found by the simple calculation of  x mod 4, and the x\r
-coordinate is also found by  x div 4. We work out our y by multiplying\r
-it by the size of our chain-4 screen.\r
-\r
-NOTE : It is possible to write to all four planes at once by setting the\r
-       correct port values.\r
-\r
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
-þ Uses of Chain-4\r
-\r
-The uses of Chain-4 are many. One could write data to one screen, then\r
-flip to it (the move_to command is almost instantaneous). This means\r
-that 64k of memory does not need to be set aside for a virtual screen,\r
-you are using the vga cards memory instead!\r
-\r
-Scrolling is much easier to code for in Chain-4 mode.\r
-\r
-It is possible to "tweak" the mode into other resolutions. In our demo,\r
-our vectors were in 320x240 mode, and our dot vectors were in 320x400\r
-mode.\r
-\r
-The main disadvantage of chain-4 as I see it is the plane swapping,\r
-which can be slow. With a bit of clever coding however, these can be\r
-kept down to a minimum.\r
-\r
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
-þ The sample programs\r
-\r
-The first sample program is GFX.PAS. This is a until in which I have\r
-placed most of our routines from previous tuts. All the procedures and\r
-variables you can see under the INTERFACE section can be used in any\r
-program with GFX in the USES clause. In other words, I could do this :\r
-\r
-USES GFX,crt;\r
-\r
-BEGIN\r
-  Setupvirtual;\r
-  cls (vaddr,0);\r
-  Shutdown;\r
-END.\r
-\r
-This program would compile perfectly. What I suggest you do is this :\r
-Rename the file to a name that suites you (eg your group name), change\r
-the first line of the unit to that name, then add all useful procedures\r
-etc. to the unit. Make it grow :-).\r
-\r
-The second file is the sample program (note the USES GFX,crt; up near\r
-the top!). The program is easy to understand and is documented. The bit\r
-that I want to draw your attention to is the constant, BIT. Because I\r
-am distributing this file to many places in text form, not binary form,\r
-I could not just add a .CEL file with the program. So what I did was\r
-write some text in one color then saved it as a .CEL . I then wrote a\r
-ten line program that did the following : Moving from left to right, it\r
-counted how many pixels were of color zero, then saved the byte value to\r
-an array. When it came across color one, is counted for how long that\r
-went on then saved the byte value and saved it to an array and so on.\r
-When it was finished, I converted the array into a text file in the\r
-CONST format. Not too cunning, but I thought I had better explain it ;-)\r
-\r
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
-þ In closing\r
-\r
-There are other documents and sample programs available on Chain-4 and\r
-it's like : Try XLIB for one...\r
-\r
-Finally! Some BBS's have joined my BBS list! (Okay, only two new ones,\r
-but it's a start ;-)) All you international BBS's! If you will regularly\r
-download the tuts from an FTP site, give me your names!\r
-\r
-I own a car. The car's name is Bob. A few days ago, Bob was in an\r
-accident, and now has major damage to his front. Knowing insurance, I\r
-probably won't get much, probably nothing (the other guy wasn't insured,\r
-and I am only 18 :( ). I will probably have to find work in order to pay\r
-for my repairs. The point to this meandering is this : I am upset, so if\r
-you think you are getting a quote, you can just forget it.\r
-\r
-Oh, well. Life goes on!\r
-\r
-See you next time,\r
-  - Denthor\r
-\r
-These fine BBS's carry the ASPHYXIA DEMO TRAINER SERIES : (alphabetical)\r
-\r
-ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍËÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍËÍÍÍÍÍËÍÍÍËÍÍÍÍËÍÍÍÍ»\r
-ºBBS Name                  ºTelephone No.   ºOpen ºMsgºFileºPastº\r
-ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÎÍÍÍÍÍÎÍÍÍÎÍÍÍÍÎÍÍÍ͹\r
-ºASPHYXIA BBS #1           º(031) 765-5312  ºALL  º * º *  º *  º\r
-ºASPHYXIA BBS #2           º(031) 765-6293  ºALL  º * º *  º *  º\r
-ºConnectix BBS             º(031) 266-9992  ºALL  º   º *  º *  º\r
-ºPOP!                      º(012) 661-1257  ºALL  º   º *  º *  º\r
-ºPure Surf BBS             º(031) 561-5943  ºA/H  º   º *  º *  º\r
-ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÊÍÍÍÊÍÍÍÍÊÍÍÍͼ\r
-\r
-For international users : If you live outside the Republic of South\r
-Africa, do the following : Dial +27, dont dial the first 0, but dial\r
-the rest of the number. Eg, for the ASPHYXIA BBS : +27-31-765-5312\r
-\r
-Open = Open at all times or only A/H\r
-Msg  = Available in message base\r
-File = Available in file base\r
-Past = Previous Parts available\r
-\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ C4TUT.PAS ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-(*\r
-Well folks, here it is - the long awaited for Chain-4 trainer. The\r
-routines are commented so I'm not going to say too much more here,\r
-except a few things.\r
-\r
-1: If ya don't understand this (not suprising its bloody cryptic!)\r
-   then if ur serious go out and buy - Programming the EGA & VGA Cards\r
-   I don't know who the book is by, so don't ask. Perhaps you know Greg?\r
-\r
-2: The code is unoptimised. I wrote it specifically for this conf. and\r
-   I'm buggered if I'm gonna give out my wholely (sp? ahh stuff it :-))\r
-   optimised code. If you want it faster, OPTIMISE IT!!\r
-   HINT: Its faster to load ax, with a low byte/high byte combination\r
-         and out a word instead of a byte at a time. If u don't know\r
-         what I'm talking about, too bad :-)\r
-\r
-3: If you use/like/whatever this code, please give Asphyxia a mention.\r
-   It wos bloody hard work figuring out how all this cr*p works, we\r
-   couldn't have done it with out a little guidence (thanx Gregie Poo).\r
-\r
-4: LiveWire got interested in the whole tut/trainer idea and MAY be\r
-   putting together a doc on how the whole thing works, including\r
-   Pel-Panning which I haven't included here.\r
-\r
-\r
-5: Good luck with the code, and if you write anything with it, I'd\r
-   appreciate having a look at it :-). Feel free to direct any comments\r
-   about the code to me in this conf. Or at one of the contact addresses\r
-   given in the code.\r
-\r
-\r
-l8rs\r
-EzE / Asphyxia\r
-\r
-\r
-\r
---------------------------------=[ Cut Here ]=-------------------------\r
-*)\r
-{$X+,G+}\r
-Program Chain4_Tut;\r
-Uses\r
-   Crt;\r
-\r
-\r
-Const\r
-   Size : Byte = 80;\r
-\r
-\r
-Var Loop : Integer;\r
-\r
-\r
-\r
-Procedure Init_C4; Assembler;\r
-Asm\r
-   mov   ax, 0013h\r
-   int   10h               { set up bios initially for 13h            }\r
-\r
-   mov   dx, 03c4h         { Sequencer Address Register               }\r
-   mov   al, 4             { Index 4 - Memory mode                    }\r
-   out   dx, al            { select it.                               }\r
-   inc   dx                { 03c5h - here we set the mem mode.        }\r
-   in    al, dx            { get whats already inside the reg         }\r
-   and   al, 11110111b     { un-set 4th bit - chain4                  }\r
-   out   dx, al\r
-\r
-   mov   dx, 3d4h\r
-   mov   al, 13h           { Offset Register - allocates amt. mem for }\r
-   out   dx, al            { 1 displayable line as - length div 8, so }\r
-   inc   dx                { we use 80 (80*8) = 640 = 2 pages across  }\r
-   mov   al, [Size]        { and cause of chain-4 i.e. 256k display   }\r
-   out   dx, al            { mem, 2 pages down for four pages         }\r
-\r
-                           { NOTE: setting AL above to 40 selects 1   }\r
-                           { page across and four down (nice for      }\r
-                           { 1942 type scrolling games) and setting   }\r
-                           { AL to 160 selects 4 pages across and 1   }\r
-                           { down, nice for horizontal scrolling      }\r
-\r
-End;\r
-\r
-\r
-\r
-Procedure Cls_C4; Assembler;\r
-Asm\r
-   mov   dx, 03c4h         { 03c4h                                    }\r
-   mov   al, 2             { Map Mask Register                        }\r
-   out   dx, al\r
-   inc   dx\r
-   mov   al, 00001111b     { Select all planes to write to            }\r
-   out   dx, al            { Doing this to clear all planes at once   }\r
-\r
-   mov   ax, 0a000h\r
-   mov   es, ax\r
-   xor   di, di            { set es:di = Screen Mem                   }\r
-   mov   ax, 0000h         { colour to put = black                    }\r
-   mov   cx, 32768         { 32768 (words) *2 = 65536 bytes - vga mem }\r
-   cld\r
-   rep   stosw             { clear it                                 }\r
-End;\r
-\r
-\r
-\r
-Procedure PutPixel_C4(X, Y : Integer; Col : Byte); Assembler;\r
-Asm\r
-   mov   ax, [Y]           { Y val multiplied by...                   }\r
-   xor   bx, bx\r
-   mov   bl, [Size]        { Size....                                 }\r
-   shl   bx, 1             { *2 - just 'cause! (I can't remember why!)}\r
-   mul   bx\r
-   mov   bx, ax\r
-\r
-   mov   ax, [X]\r
-   mov   cx, ax\r
-   shr   ax, 2\r
-   add   bx, ax            { add X val div 4 (four planes)            }\r
-\r
-   and   cx, 00000011b     { clever way of finding x mod 4, i.e.      }\r
-   mov   dx, 03c4h         { which plane we're in.                    }\r
-   mov   al, 2             { then use 03c4h index 2 - write plane sel.}\r
-   out   dx, al            { to set plane to write to.                }\r
-   mov   al, 1             { plane to write to = 1 shl (X mod 4)      }\r
-   shl   al, cl\r
-   inc   dx\r
-   out   dx, al\r
-\r
-   mov   ax, 0a000h\r
-   mov   es, ax\r
-   mov   al, [Col]\r
-   mov   es: [bx], al      { then write pixel.                        }\r
-End;\r
-\r
-\r
-Function GetPixel_C4(X, Y : Integer): Byte; Assembler;\r
-Asm\r
-   mov   ax, [Y]           { Y val multiplied by...                   }\r
-   xor   bx, bx\r
-   mov   bl, [Size]        { Size....                                 }\r
-   shl   bx, 1             { *2 - just 'cause! (I can't remember why!)}\r
-   mul   bx\r
-   mov   bx, ax\r
-\r
-   mov   ax, [X]\r
-   mov   cx, ax\r
-   shr   ax, 2\r
-   add   bx, ax            { add X val div 4 (four planes)            }\r
-\r
-   and   cx, 00000011b     { clever way of finding x mod 4, i.e.      }\r
-   mov   dx, 03c4h         { which plane we're in.                    }\r
-   mov   al, 4h            { then use 03c4h index 4 - read plane sel. }\r
-   out   dx, al            { to set plane to read from.               }\r
-   mov   al, cl            { Plane to read from = X mod 4             }\r
-   inc   dx\r
-   out   dx, al\r
-\r
-   mov   ax, 0a000h\r
-   mov   es, ax\r
-   mov   al, es: [bx]      { then return pixel read                   }\r
-End;\r
-\r
-\r
-\r
-Procedure MoveScr_C4(X,Y : Integer); Assembler;\r
-Asm\r
-   mov   ax, [Y]           { Y val multiplied by...                   }\r
-   xor   bx, bx\r
-   mov   bl, [Size]        { Size....                                 }\r
-   shl   bx, 1             { *2 - just 'cause! (I can't remember why!)}\r
-   mul   bx\r
-   mov   bx, ax\r
-\r
-   add   bx, [X]           { Add X val                                }\r
-\r
-   mov   dx, 03d4h\r
-   mov   al, 0ch           { CRTC address reg.                        }\r
-   out   dx, al            { Start Address High Reg.                  }\r
-   inc   dx\r
-   mov   al, bh            { send high byte of start address.         }\r
-   out   dx, al\r
-\r
-   dec   dx\r
-   mov   al, 0dh           { Start Address Low Reg.                   }\r
-   out   dx, al\r
-   inc   dx\r
-   mov   al, bl            { send low byte of start address.          }\r
-   out   dx, al\r
-\r
-End;\r
-\r
-\r
-Procedure SetText; Assembler;\r
-Asm\r
-   mov   ax, 0003h\r
-   int   10h\r
-End;\r
-\r
-Procedure Creds;\r
-Begin\r
-   SetText;\r
-   While KeyPressed do ReadKey;\r
-\r
-   Asm\r
-      mov   ah, 1\r
-      mov   ch, 1\r
-      mov   cl, 0\r
-      int   10h\r
-   End;\r
-\r
-   WriteLn('Chain-4 Trainer...');\r
-   WriteLn('By EzE of Asphyxia.');\r
-   WriteLn;\r
-   WriteLn('Contact Us on ...');\r
-   WriteLn;\r
-   WriteLn;\r
-   WriteLn('the Asphyxia BBS (031) - 7655312');\r
-   WriteLn;\r
-   WriteLn('Email :       eze@');\r
-   WriteLn('         asphyxia@');\r
-   WriteLn('          edwards@');\r
-   WriteLn('           bailey@');\r
-   WriteLn('          mcphail@');\r
-   WriteLn('                  beastie.cs.und.ac.za');\r
-   WriteLn;\r
-   WriteLn('or  peter.edwards@datavert.co.za');\r
-   WriteLn;\r
-   WriteLn('Write me snail-mail at...');\r
-   WriteLn('P.O. Box 2313');\r
-   WriteLn('Hillcrest');\r
-   WriteLn('Natal');\r
-   WriteLn('3650');\r
-   Asm\r
-      mov   ah, 1\r
-      mov   ch, 1\r
-      mov   cl, 0\r
-      int   10h\r
-   End;\r
-\r
-End;\r
-\r
-\r
-\r
-\r
-Begin\r
-   Init_C4;\r
-   Cls_C4;\r
-   Repeat\r
-      Putpixel_C4(Random(320),Random(200),Random(256)+1);\r
-   Until KeyPressed;\r
-   For Loop := 0 to 80 do\r
-   begin\r
-      MoveScr_C4(0,Loop);\r
-      Delay(10);\r
-   End;\r
-   ReadKey;\r
-   Loop := GetPixel_C4(100,100);\r
-   Creds;\r
-   WriteLn('Colour at location X:100, Y:100 was: ',Loop);\r
-End.\r
-\r
---------------------------------=[ Cut Here ]=-------------------------\r
diff --git a/16/PCGPE10/TUT2.TXT b/16/PCGPE10/TUT2.TXT
deleted file mode 100644 (file)
index a97738b..0000000
+++ /dev/null
@@ -1,616 +0,0 @@
-                   ÕÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͸\r
-                   ³         W E L C O M E         ³\r
-                   ³  To the VGA Trainer Program   ³ ³\r
-                   ³              By               ³ ³\r
-                   ³      DENTHOR of ASPHYXIA      ³ ³ ³\r
-                   ÔÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ; ³ ³\r
-                     ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ ³\r
-                       ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-                           --==[ PART 2 ]==--\r
-\r
-\r
-\r
-þ Introduction\r
-\r
-\r
-\r
-Hi there again! This is Grant Smith, AKA Denthor of ASPHYXIA. This is the\r
-second part of my Training Program for new programmers. I have only had a\r
-lukewarm response to my first part of the trainer series ... remember, if\r
-I don't hear from you, I will assume that you are all dead and will stop\r
-writing the series ;-). Also, if you do get in contact with me I will give\r
-you some of our fast assembly routines which will speed up your demos no\r
-end. So go on, leave mail to GRANT SMITH in the main section of the\r
-MailBox BBS, start up a discussion or ask a few questions in this Conference,\r
-leave mail to ASPHYXIA on the ASPHYXIA BBS, leave mail to Denthor on\r
-Connectix, or write to Grant Smith,\r
-                       P.O.Box 270\r
-                       Kloof\r
-                       3640\r
-See, there are many ways you can get in contact with me! Use one of them!\r
-\r
-In this part, I will put the Pallette through it's paces. What the hell is\r
-a pallette? How do I find out what it is? How do I set it? How do I stop\r
-the "fuzz" that appears on the screen when I change the pallette? How do\r
-I black out the screen using the pallette? How do I fade in a screen?\r
-How do I fade out a screen? Why are telephone calls so expensive?\r
-Most of these quesions will be answered in this, the second part of my\r
-Trainer Series for Pascal.\r
-\r
-\r
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
-þ  What is the Pallette?\r
-\r
-A few weeks ago a friend of mine was playing a computer game. In the game\r
-there was a machine with stripes of blue running across it. When the\r
-machine was activated, while half of the the blue stripes stayed the same,\r
-the other half started to change color and glow. He asked me how two stripes\r
-of the same color suddenly become different like that. The answer is simple:\r
-the program was changing the pallette. As you know from Part 1, there are\r
-256 colors in MCGA mode, numbered 0 to 255. What you don't know is that each\r
-if those colors is made up of different intensities of Red, Green and Blue,\r
-the primary colors (you should have learned about the primary colors at\r
-school). These intensities are numbers between 0 and 63. The color of\r
-bright red would for example be obtained by setting red intensity to 63,\r
-green intensity to 0, and blue intensity to 0. This means that two colors\r
-can look exactly the same, eg you can set color 10 to bright red and color\r
-78 to color bright red. If you draw a picture using both of those colors,\r
-no-one will be able to tell the difference between the two.. It is only\r
-when you again change the pallette of either of them will they be able to\r
-tell the difference. Also, by changing the whole pallette, you can obtain\r
-the "Fade in" and "Fade out" effects found in many demos and games.\r
-Pallette manipulation can become quite confusing to some people, because\r
-colors that look the same are in fact totally seperate.\r
-\r
-\r
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
-þ  How do I read in the pallette value of a color?\r
-\r
-This is very easy to do. To read in the pallette value, you enter in the\r
-number of the color you want into port $3c7, then read in the values of\r
-red, green and blue respectively from port $3c9. Simple, huh? Here is a\r
-procedure that does it for you :\r
-\r
-Procedure GetPal(ColorNo : Byte; Var R,G,B : Byte);\r
-  { This reads the values of the Red, Green and Blue values of a certain\r
-    color and returns them to you. }\r
-Begin\r
-   Port[$3c7] := ColorNo;\r
-   R := Port[$3c9];\r
-   G := Port[$3c9];\r
-   B := Port[$3c9];\r
-End;\r
-\r
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
-þ  How do I set the pallette value of a color?\r
-\r
-This is also as easy as 3.1415926535897932385. What you do is you enter in\r
-the number of the color you want to change into port $3c8, then enter the\r
-values of red, green and blue respectively into port $3c9. Because you are\r
-all so lazy I have written the procedure for you ;-)\r
-\r
-\r
-Procedure Pal(ColorNo : Byte; R,G,B : Byte);\r
-  { This sets the Red, Green and Blue values of a certain color }\r
-Begin\r
-   Port[$3c8] := ColorNo;\r
-   Port[$3c9] := R;\r
-   Port[$3c9] := G;\r
-   Port[$3c9] := B;\r
-End;\r
-\r
-\r
-Asphyxia doesn't use the above pallete procedures, we use assembler versions,\r
-which will be given to PEOPLE WHO RESPOND TO THIS TRAINER SERIES (HINT,\r
-HINT)\r
-\r
-\r
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
-þ  How do I stop the "fuzz" that appears on my screen when I change the\r
-        pallette?\r
-\r
-If you have used the pallette before, you will have noticed that there is\r
-quite a bit of "fuzz" on the screen when you change it. The way we counter\r
-this is as follows : There is an elctron beam on your monitor that is\r
-constantly updating your screen from top to bottom. As it gets to the\r
-bottom of the screen, it takes a while for it to get back up to the top of\r
-the screen to start updating the screen again. The period where it moves\r
-from the bottom to the top is called the Verticle Retrace. During the\r
-verticle retrace you may change the pallette without affecting what is\r
-on the screen. What we do is that we wait until a verticle retrace has\r
-started by calling a certain procedure; this means that everything we do\r
-now will only be shown after the verticle retrace, so we can do all sorts\r
-of strange and unusual things to the screen during this retrace and only\r
-the results will be shown when the retrace is finished. This is way cool,\r
-as it means that when we change the pallette, the fuzz doesn't appear on\r
-the screen, only the result (the changed pallette), is seen after the\r
-retrace! Neat, huh? ;-) I have put the purely assembler WaitRetrace routine\r
-in the sample code that follows this message. Use it wisely, my son.\r
-\r
-NOTE : WaitRetrace can be a great help to your coding ... code that fits\r
-       into one retrace will mean that the demo will run at the same\r
-       speed no matter what your computer speed (unless you are doing a lot\r
-       during the WaitRetrace and the computer is slooooow). Note that in\r
-       the following sample program and in our SilkyDemo, the thing will run\r
-       at the same speed whether turbo is on or off.\r
-\r
-\r
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
-þ  How do I black out the screen using the pallette?\r
-\r
-This is basic : just set the Red, Green and Blue values of all colors to\r
-zero intensity, like so :\r
-\r
-Procedure Blackout;\r
-  { This procedure blackens the screen by setting the pallette values of\r
-    all the colors to zero. }\r
-VAR loop1:integer;\r
-BEGIN\r
-  WaitRetrace;\r
-  For loop1:=0 to 255 do\r
-    Pal (loop1,0,0,0);\r
-END;\r
-\r
-\r
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
-þ  How do I fade in a screen?\r
-\r
-Okay, this can be VERY effective. What you must first do is grab the\r
-pallette into a variable, like so :\r
-\r
-   VAR Pall := Array [0.255,1..3] of BYTE;\r
-\r
-0 to 255 is for the 256 colors in MCGA mode, 1 to 3 is red, green and blue\r
-intensity values;\r
-\r
-Procedure GrabPallette;\r
-VAR loop1:integer;\r
-BEGIN\r
-  For loop1:=0 to 255 do\r
-    Getpal (loop1,pall[loop1,1],pall[loop1,2],pall[loop1,3]);\r
-END;\r
-\r
-This loads the entire pallette into variable pall. Then you must blackout\r
-the screen (see above), and draw what you want to screen without the\r
-construction being shown. Then what you do is go throgh the pallette. For\r
-each color, you see if the individual intensities are what they should be.\r
-If not, you increase them by one unit until they are. Beacuse intensites\r
-are in a range from 0 to 63, you only need do this a maximum of 64 times.\r
-\r
-Procedure Fadeup;\r
-VAR loop1,loop2:integer;\r
-    Tmp : Array [1..3] of byte;\r
-      { This is temporary storage for the values of a color }\r
-BEGIN\r
-  For loop1:=1 to 64 do BEGIN\r
-      { A color value for Red, green or blue is 0 to 63, so this loop only\r
-        need be executed a maximum of 64 times }\r
-    WaitRetrace;\r
-    For loop2:=0 to 255 do BEGIN\r
-      Getpal (loop2,Tmp[1],Tmp[2],Tmp[3]);\r
-      If Tmp[1]<Pall[loop2,1] then inc (Tmp[1]);\r
-      If Tmp[2]<Pall[loop2,2] then inc (Tmp[2]);\r
-      If Tmp[3]<Pall[loop2,3] then inc (Tmp[3]);\r
-        { If the Red, Green or Blue values of color loop2 are less then they\r
-          should be, increase them by one. }\r
-      Pal (loop2,Tmp[1],Tmp[2],Tmp[3]);\r
-        { Set the new, altered pallette color. }\r
-    END;\r
-  END;\r
-END;\r
-\r
-Hey-presto! The screen fades up. You can just add in a delay before the\r
-waitretrace if you feel it is too fast. Cool, no?\r
-\r
-\r
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
-þ  How do I fade out a screen?\r
-\r
-This is just like the fade in of a screen, just in the opposite direction.\r
-What you do is you check each color intensity. If it is not yet zero, you\r
-decrease it by one until it is. BAAASIIIC!\r
-\r
-Procedure FadeDown;\r
-VAR loop1,loop2:integer;\r
-    Tmp : Array [1..3] of byte;\r
-      { This is temporary storage for the values of a color }\r
-BEGIN\r
-  For loop1:=1 to 64 do BEGIN\r
-    WaitRetrace;\r
-    For loop2:=0 to 255 do BEGIN\r
-      Getpal (loop2,Tmp[1],Tmp[2],Tmp[3]);\r
-      If Tmp[1]>0 then dec (Tmp[1]);\r
-      If Tmp[2]>0 then dec (Tmp[2]);\r
-      If Tmp[3]>0 then dec (Tmp[3]);\r
-        { If the Red, Green or Blue values of color loop2 are not yet zero,\r
-          then, decrease them by one. }\r
-      Pal (loop2,Tmp[1],Tmp[2],Tmp[3]);\r
-        { Set the new, altered pallette color. }\r
-    END;\r
-  END;\r
-END;\r
-\r
-Again, to slow the above down, put in a delay above the WaitRetrace. Fading\r
-out the screen looks SO much more impressive then just clearing the screen;\r
-it can make a world of difference in the impression your demo etc will\r
-leave on the people viewing it. To restore the pallette, just do this :\r
-\r
-Procedure RestorePallette;\r
-VAR loop1:integer;\r
-BEGIN\r
-  WaitRetrace;\r
-  For loop1:=0 to 255 do\r
-    pal (loop1,Pall[loop1,1],Pall[loop1,2],Pall[loop1,3]);\r
-END;\r
-\r
-\r
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
-þ  In closing\r
-\r
-Well, there are most of those origional questions answered ;-) The following\r
-sample program is quite big, so it might take you a while to get around it.\r
-Persevere and thou shalt overcome. Pallette manipulation has been a thorn\r
-in many coders sides for quite some time, yet hopefully I have shown you\r
-all how amazingly simple it is once you have grasped the basics.\r
-\r
-I need more feedback! In which direction would you like me to head? Is there\r
-any particular section you would like more info on? Also, upload me your\r
-demo's, however trivial they might seem. We really want to get in contact\r
-with/help out new and old coders alike, but you have to leave us that message\r
-telling us about yourself and what you have done or want to do.\r
-\r
-IS THERE ANYBODY OUT THERE!?!\r
-\r
-P.S. Our new demo should be out soon ... it is going to be GOOOD ... keep\r
-     an eye out for it.\r
-\r
-          [ And so she came across him, slumped over his keyboard\r
-            yet again . 'It's three in the morning' she whispered.\r
-            'Let's get you to bed'. He stirred, his face bathed in\r
-            the dull light of his monitor. He mutters something.\r
-            As she leans across him to disconnect the power, she\r
-            asks him; 'Was it worth it?'. His answer surprises her.\r
-            'No.' he says. In his caffiene-enduced haze, he smiles.\r
-            'But it sure is a great way to relax.'                  ]\r
-                                           - Grant Smith\r
-                                              Tue 13 July, 1993\r
-                                               2:23 am.\r
-\r
-See you next week!\r
-   - Denthor\r
-\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ TUTPROG2.PAS ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-{$X+}\r
-\r
-Uses Crt;\r
-\r
-CONST VGA=$a000;\r
-\r
-Var Pall,Pall2 : Array[0..255,1..3] of Byte;\r
-     { This declares the PALL variable. 0 to 255 signify the colors of the\r
-       pallette, 1 to 3 signifies the Red, Green and Blue values. I am\r
-       going to use this as a sort of "virtual pallette", and alter it\r
-       as much as I want, then suddenly bang it to screen. Pall2 is used\r
-       to "remember" the origional pallette so that we can restore it at\r
-       the end of the program. }\r
-\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure SetMCGA;  { This procedure gets you into 320x200x256 mode. }\r
-BEGIN\r
-  asm\r
-     mov        ax,0013h\r
-     int        10h\r
-  end;\r
-END;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure SetText;  { This procedure returns you to text mode.  }\r
-BEGIN\r
-  asm\r
-     mov        ax,0003h\r
-     int        10h\r
-  end;\r
-END;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-procedure WaitRetrace; assembler;\r
-  { This waits until you are in a Verticle Retrace ... this means that all\r
-    screen manipulation you do only appears on screen in the next verticle\r
-    retrace ... this removes most of the "fuzz" that you see on the screen\r
-    when changing the pallette. It unfortunately slows down your program\r
-    by "synching" your program with your monitor card ... it does mean\r
-    that the program will run at almost the same speed on different\r
-    speeds of computers which have similar monitors. In our SilkyDemo,\r
-    we used a WaitRetrace, and it therefore runs at the same (fairly\r
-    fast) speed when Turbo is on or off. }\r
-\r
-label\r
-  l1, l2;\r
-asm\r
-    mov dx,3DAh\r
-l1:\r
-    in al,dx\r
-    and al,08h\r
-    jnz l1\r
-l2:\r
-    in al,dx\r
-    and al,08h\r
-    jz  l2\r
-end;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure GetPal(ColorNo : Byte; Var R,G,B : Byte);\r
-  { This reads the values of the Red, Green and Blue values of a certain\r
-    color and returns them to you. }\r
-Begin\r
-   Port[$3c7] := ColorNo;\r
-   R := Port[$3c9];\r
-   G := Port[$3c9];\r
-   B := Port[$3c9];\r
-End;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure Pal(ColorNo : Byte; R,G,B : Byte);\r
-  { This sets the Red, Green and Blue values of a certain color }\r
-Begin\r
-   Port[$3c8] := ColorNo;\r
-   Port[$3c9] := R;\r
-   Port[$3c9] := G;\r
-   Port[$3c9] := B;\r
-End;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure Putpixel (X,Y : Integer; Col : Byte);\r
-  { This puts a pixel on the screen by writing directly to memory. }\r
-BEGIN\r
-  Mem [VGA:X+(Y*320)]:=Col;\r
-END;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure line(a,b,c,d,col:integer);\r
-  { This draws a line from a,b to c,d of color col. }\r
-   Function sgn(a:real):integer;\r
-   BEGIN\r
-        if a>0 then sgn:=+1;\r
-        if a<0 then sgn:=-1;\r
-        if a=0 then sgn:=0;\r
-   END;\r
-var u,s,v,d1x,d1y,d2x,d2y,m,n:real;\r
-    i:integer;\r
-BEGIN\r
-     u:= c - a;\r
-     v:= d - b;\r
-     d1x:= SGN(u);\r
-     d1y:= SGN(v);\r
-     d2x:= SGN(u);\r
-     d2y:= 0;\r
-     m:= ABS(u);\r
-     n := ABS(v);\r
-     IF NOT (M>N) then\r
-     BEGIN\r
-          d2x := 0 ;\r
-          d2y := SGN(v);\r
-          m := ABS(v);\r
-          n := ABS(u);\r
-     END;\r
-     s := INT(m / 2);\r
-     FOR i := 0 TO round(m) DO\r
-     BEGIN\r
-          putpixel(a,b,col);\r
-          s := s + n;\r
-          IF not (s<m) THEN\r
-          BEGIN\r
-               s := s - m;\r
-               a:= a +round(d1x);\r
-               b := b + round(d1y);\r
-          END\r
-          ELSE\r
-          BEGIN\r
-               a := a + round(d2x);\r
-               b := b + round(d2y);\r
-          END;\r
-     END;\r
-END;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure PalPlay;\r
-  { This procedure mucks about with our "virtual pallette", then shoves it\r
-    to screen. }\r
-Var Tmp : Array[1..3] of Byte;\r
-  { This is used as a "temporary color" in our pallette }\r
-    loop1 : Integer;\r
-BEGIN\r
-   Move(Pall[200],Tmp,3);\r
-     { This copies color 200 from our virtual pallette to the Tmp variable }\r
-   Move(Pall[0],Pall[1],200*3);\r
-     { This moves the entire virtual pallette up one color }\r
-   Move(Tmp,Pall[0],3);\r
-     { This copies the Tmp variable to the bottom of the virtual pallette }\r
-   WaitRetrace;\r
-   For loop1:=1 to 255 do\r
-     pal (loop1,pall[loop1,1],pall[loop1,2],pall[loop1,3]);\r
-END;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure SetUpScreen;\r
-  { This gets our screen ready but setting up the pallette and drawing\r
-    the lines. }\r
-Var Loop : Integer;\r
-BEGIN\r
-   FillChar(Pall,SizeOf(Pall),0);\r
-       { Clear the entire PALL variable to zero. }\r
-   For Loop := 0 to 200 do BEGIN\r
-      Pall[Loop,1] := Loop mod 64;\r
-   END;\r
-       { This sets colors 0 to 200 in the PALL variable to values between\r
-         0 to 63. the MOD function gives you the remainder of a division,\r
-         ie. 105 mod 10 = 5 }\r
-\r
-   For Loop := 1 to 320 do BEGIN\r
-      Line(319,199,320-Loop,0,(Loop Mod 199)+1);\r
-      Line(0,0,Loop,199,(Loop Mod 199)+1);\r
-       { These two lines start drawing lines from the left and the right\r
-         hand sides of the screen, using colors 1 to 199. Look at these\r
-         two lines and understand them. }\r
-      PalPlay;\r
-        { This calls the PalPlay procedure }\r
-   END;\r
-END;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure GrabPallette;\r
-VAR loop1:integer;\r
-BEGIN\r
-  For loop1:=0 to 255 do\r
-    Getpal (loop1,pall2[loop1,1],pall2[loop1,2],pall2[loop1,3]);\r
-END;\r
-\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure Blackout;\r
-  { This procedure blackens the screen by setting the pallette values of\r
-    all the colors to zero. }\r
-VAR loop1:integer;\r
-BEGIN\r
-  WaitRetrace;\r
-  For loop1:=0 to 255 do\r
-    Pal (loop1,0,0,0);\r
-END;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure HiddenScreenSetup;\r
-  { This procedure sets up the screen while it is blacked out, so that the\r
-    user can't see what is happening. }\r
-VAR loop1,loop2:integer;\r
-BEGIN\r
-  For loop1:=0 to 319 do\r
-    For loop2:=0 to 199 do\r
-      PutPixel (loop1,loop2,Random (256));\r
-END;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure Fadeup;\r
-  { This procedure slowly fades up the new screen }\r
-VAR loop1,loop2:integer;\r
-    Tmp : Array [1..3] of byte;\r
-      { This is temporary storage for the values of a color }\r
-BEGIN\r
-  For loop1:=1 to 64 do BEGIN\r
-      { A color value for Red, green or blue is 0 to 63, so this loop only\r
-        need be executed a maximum of 64 times }\r
-    WaitRetrace;\r
-    For loop2:=0 to 255 do BEGIN\r
-      Getpal (loop2,Tmp[1],Tmp[2],Tmp[3]);\r
-      If Tmp[1]<Pall2[loop2,1] then inc (Tmp[1]);\r
-      If Tmp[2]<Pall2[loop2,2] then inc (Tmp[2]);\r
-      If Tmp[3]<Pall2[loop2,3] then inc (Tmp[3]);\r
-        { If the Red, Green or Blue values of color loop2 are less then they\r
-          should be, increase them by one. }\r
-      Pal (loop2,Tmp[1],Tmp[2],Tmp[3]);\r
-        { Set the new, altered pallette color. }\r
-    END;\r
-  END;\r
-END;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure FadeDown;\r
-  { This procedure fades the screen out to black. }\r
-VAR loop1,loop2:integer;\r
-    Tmp : Array [1..3] of byte;\r
-      { This is temporary storage for the values of a color }\r
-BEGIN\r
-  For loop1:=1 to 64 do BEGIN\r
-    WaitRetrace;\r
-    For loop2:=0 to 255 do BEGIN\r
-      Getpal (loop2,Tmp[1],Tmp[2],Tmp[3]);\r
-      If Tmp[1]>0 then dec (Tmp[1]);\r
-      If Tmp[2]>0 then dec (Tmp[2]);\r
-      If Tmp[3]>0 then dec (Tmp[3]);\r
-        { If the Red, Green or Blue values of color loop2 are not yet zero,\r
-          then, decrease them by one. }\r
-      Pal (loop2,Tmp[1],Tmp[2],Tmp[3]);\r
-        { Set the new, altered pallette color. }\r
-    END;\r
-  END;\r
-END;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure RestorePallette;\r
-  { This procedure restores the origional pallette }\r
-VAR loop1:integer;\r
-BEGIN\r
-  WaitRetrace;\r
-  For loop1:=0 to 255 do\r
-    pal (loop1,Pall2[loop1,1],Pall2[loop1,2],Pall2[loop1,3]);\r
-END;\r
-\r
-\r
-BEGIN\r
-  ClrScr;\r
-  Writeln ('This program will draw lines of different colors across the');\r
-  Writeln ('screen and change them only by changing their pallette values.');\r
-  Writeln ('The nice thing about using the pallette is that one pallette');\r
-  Writeln ('change changes the same color over the whole screen, without');\r
-  Writeln ('you having to redraw it. Because I am using a WaitRetrace');\r
-  Writeln ('command, turning on and off your turbo during the demonstration');\r
-  Writeln ('should have no effect.');\r
-  Writeln;\r
-  Writeln ('The second part of the demo blacks out the screen using the');\r
-  Writeln ('pallette, fades in the screen, waits for a keypress, then fades');\r
-  Writeln ('it out again. I haven''t put in any delays for the fadein/out,');\r
-  Writeln ('so you will have to put ''em in yourself to get it to the speed you');\r
-  Writeln ('like. Have fun and enjoy! ;-)');\r
-  Writeln; Writeln;\r
-  Writeln ('Hit any key to continue ...');\r
-  Readkey;\r
-  SetMCGA;\r
-  GrabPallette;\r
-  SetUpScreen;\r
-  repeat\r
-     PalPlay;\r
-       { Call the PalPlay procedure repeatedly until a key is pressed. }\r
-  Until Keypressed;\r
-  Readkey;\r
-    { Read in the key pressed otherwise it is left in the keyboard buffer }\r
-  Blackout;\r
-  HiddenScreenSetup;\r
-  FadeUp;\r
-  Readkey;\r
-  FadeDown;\r
-  Readkey;\r
-  RestorePallette;\r
-  SetText;\r
-  Writeln ('All done. This concludes the second sample program in the ASPHYXIA');\r
-  Writeln ('Training series. You may reach DENTHOR under the name of GRANT');\r
-  Writeln ('SMITH on the MailBox BBS, or leave a message to ASPHYXIA on the');\r
-  Writeln ('ASPHYXIA BBS. Get the numbers from Roblist, or write to :');\r
-  Writeln ('             Grant Smith');\r
-  Writeln ('             P.O. Box 270');\r
-  Writeln ('             Kloof');\r
-  Writeln ('             3640');\r
-  Writeln ('I hope to hear from you soon!');\r
-  Writeln; Writeln;\r
-  Write   ('Hit any key to exit ...');\r
-  Readkey;\r
-END.\r
diff --git a/16/PCGPE10/TUT3.TXT b/16/PCGPE10/TUT3.TXT
deleted file mode 100644 (file)
index a70a801..0000000
+++ /dev/null
@@ -1,624 +0,0 @@
-                   ÕÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͸\r
-                   ³         W E L C O M E         ³\r
-                   ³  To the VGA Trainer Program   ³ ³\r
-                   ³              By               ³ ³\r
-                   ³      DENTHOR of ASPHYXIA      ³ ³ ³\r
-                   ÔÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ; ³ ³\r
-                     ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ ³\r
-                       ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-                           --==[ PART 3 ]==--\r
-\r
-\r
-\r
-þ Introduction\r
-\r
-\r
-\r
-Greetings! This is the third part of the VGA Trainer series! Sorry it \r
-took so long to get out, but I had a running battle with the traffic\r
-department for three days to get my car registered, and then the MailBox\r
-went down. Ahh, well, life stinks. Anyway, today will do some things\r
-vital to most programs : Lines and circles.\r
-\r
-Watch out for next week's part : Virtual screens. The easy way to\r
-eliminate flicker, "doubled sprites", and subjecting the user to watch\r
-you building your screen. Almost every ASPHYXIA demo has used a virtual\r
-screen (with the exception of the SilkyDemo), so this is one to watch out\r
-for. I will also show you how to put all of these loose procedures into\r
-units.\r
-\r
-If you would like to contact me, or the team, there are many ways you \r
-can do it : 1) Write a message to Grant Smith in private mail here on\r
-                  the Mailbox BBS.\r
-            2) Write a message here in the Programming conference here\r
-                  on the Mailbox (Preferred if you have a general\r
-                  programming query or problem others would benefit from)\r
-            3) Write to ASPHYXIA on the ASPHYXIA BBS.\r
-            4) Write to Denthor, Eze or Livewire on Connectix.\r
-            5) Write to :  Grant Smith\r
-                           P.O.Box 270 Kloof\r
-                           3640\r
-            6) Call me (Grant Smith) at 73 2129 (leave a message if you \r
-                  call during varsity)\r
-                  \r
-NB : If you are a representative of a company or BBS, and want ASPHYXIA \r
-       to do you a demo, leave mail to me; we can discuss it.\r
-NNB : If you have done/attempted a demo, SEND IT TO ME! We are feeling\r
-        quite lonely and want to meet/help out/exchange code with other demo\r
-        groups. What do you have to lose? Leave a message here and we can work\r
-        out how to transfer it. We really want to hear from you!\r
-\r
-\r
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
-þ  Circle Algorithim\r
-\r
-You all know what a circle looks like. But how do you draw one on the\r
-computer?\r
-\r
-You probably know circles drawn with the degrees at these points :\r
-\r
-                                0\r
-                              ÜÛ|ÛÜ\r
-                             ÛÛÛ|ÛÛÛ\r
-                        270 ----+---- 90\r
-                             ÛÛÛ|ÛÛÛ\r
-                              ßÛ|Ûß\r
-                               180\r
-\r
-Sorry about my ASCI ;-) ... anyway, Pascal doesn't work that way ... it\r
-works with radians instead of degrees. (You can convert radians to degrees,\r
-but I'm not going to go into that now. Note though that in pascal, the\r
-circle goes like this :\r
-\r
-                               270\r
-                              ÜÛ|ÛÜ\r
-                             ÛÛÛ|ÛÛÛ\r
-                        180 ----+---- 0\r
-                             ÛÛÛ|ÛÛÛ\r
-                              ßÛ|Ûß\r
-                                90\r
-\r
-\r
-Even so, we can still use the famous equations to draw our circle ...\r
-(You derive the following by using the theorem of our good friend\r
-Pythagoras)\r
-                     Sin (deg) = Y/R\r
-                     Cos (deg) = X/R\r
-(This is standard 8(?) maths ... if you haven't reached that level yet,\r
-take this to your dad, or if you get stuck leave me a message and I'll\r
-do a bit of basic Trig with you. I aim to please ;-))\r
-\r
-Where Y = your Y-coord\r
-      X = your X-coord\r
-      R = your radius (the size of your circle)\r
-      deg = the degree\r
-\r
-To simplify matters, we rewrite the equation to get our X and Y values :\r
-\r
-                     Y = R*Sin(deg)\r
-                     X = R*Cos(deg)\r
-\r
-This obviousy is perfect for us, because it gives us our X and Y co-ords\r
-to put into our putpixel routine (see Part 1). Because the Sin and Cos\r
-functions return a Real value, we use a round function to transform it\r
-into an Integer.\r
-\r
-     Procedure Circle (oX,oY,rad:integer;Col:Byte);\r
-     VAR deg:real;\r
-         X,Y:integer;\r
-     BEGIN\r
-       deg:=0;\r
-       repeat\r
-         X:=round(rad*COS (deg));\r
-         Y:=round(rad*sin (deg));\r
-         putpixel (x+ox,y+oy,Col);\r
-         deg:=deg+0.005;\r
-       until (deg>6.4);\r
-     END;\r
-\r
-In the above example, the smaller the amount that deg is increased by,\r
-the closer the pixels in the circle will be, but the slower the procedure.\r
-0.005 seem to be best for the 320x200 screen. NOTE : ASPHYXIA does not use\r
-this particular circle algorithm, ours is in assembly language, but this\r
-one should be fast enough for most. If it isn't, give us the stuff you are\r
-using it for and we'll give you ours.\r
-\r
-\r
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
-þ  Line algorithms\r
-\r
-There are many ways to draw a line on the computer. I will describe one\r
-and give you two. (The second one you can figure out for yourselves; it\r
-is based on the first one but is faster)\r
-\r
-The first thing you need to do is pass what you want the line to look\r
-like to your line procedure. What I have done is said that x1,y1 is the\r
-first point on the screen, and x2,y2 is the second point. We also pass the\r
-color to the procedure. (Remember the screens top left hand corner is (0,0);\r
-see Part 1)\r
-\r
-Ie.            o  (X1,Y1)\r
-                ooooooooo\r
-                         ooooooooo\r
-                                  oooooooo  (X2,Y2)\r
-\r
-Again, sorry about my drawings ;-)\r
-\r
-To find the length of the line, we say the following :\r
-\r
-           XLength = ABS (x1-x2)\r
-           YLength = ABS (y1-y2)\r
-\r
-The ABS function means that whatever the result, it will give you an\r
-absolute, or posotive, answer. At this stage I set a variable stating\r
-wheter the difference between the two x's are negative, zero or posotive.\r
-(I do the same for the y's) If the difference is zero, I just use a loop\r
-keeping the two with the zero difference posotive, then exit.\r
-\r
-If neither the x's or y's have a zero difference, I calculate the X and Y\r
-slopes, using the following two equations :\r
-\r
-           Xslope = Xlength / Ylength\r
-           Yslope = Ylength / Xlength\r
-\r
-As you can see, the slopes are real numbers.\r
-NOTE : XSlope = 1 / YSlope\r
-\r
-Now, there are two ways of drawing the lines :\r
-\r
-           X = XSlope * Y\r
-           Y = YSlope * X\r
-\r
-The question is, which one to use? if you use the wrong one, your line\r
-will look like this :\r
-\r
-        o\r
-           o\r
-              o\r
-\r
-Instead of this :\r
-\r
-        ooo\r
-           ooo\r
-              ooo\r
-\r
-Well, the solution is as follows :\r
-\r
-                           *\``|``/*\r
-                           ***\|/***\r
-                           ----+----\r
-                           ***/|\***\r
-                           */``|``\*\r
-\r
-If the slope angle is in the area of the stars (*) then use the first\r
-equation, if it is in the other section (`) then use the second one.\r
-What you do is you calculate the variable on the left hand side by\r
-putting the variable on the right hand side in a loop and solving. Below\r
-is our finished line routine :\r
-\r
-Procedure Line (x1,y1,x2,y2:integer;col:byte);\r
-VAR x,y,xlength,ylength,dx,dy:integer;\r
-    xslope,yslope:real;\r
-BEGIN\r
-  xlength:=abs (x1-x2);\r
-  if (x1-x2)<0 then dx:=-1;\r
-  if (x1-x2)=0 then dx:=0;\r
-  if (x1-x2)>0 then dx:=+1;\r
-  ylength:=abs (y1-y2);\r
-  if (y1-y2)<0 then dy:=-1;\r
-  if (y1-y2)=0 then dy:=0;\r
-  if (y1-y2)>0 then dy:=+1;\r
-  if (dy=0) then BEGIN\r
-    if dx<0 then for x:=x1 to x2 do\r
-      putpixel (x,y1,col);\r
-    if dx>0 then for x:=x2 to x1 do\r
-      putpixel (x,y1,col);\r
-    exit;\r
-  END;\r
-  if (dx=0) then BEGIN\r
-    if dy<0 then for y:=y1 to y2 do\r
-      putpixel (x1,y,col);\r
-    if dy>0 then for y:=y2 to y1 do\r
-      putpixel (x1,y,col);\r
-    exit;\r
-  END;\r
-  xslope:=xlength/ylength;\r
-  yslope:=ylength/xlength;\r
-  if (yslope/xslope<1) and (yslope/xslope>-1) then BEGIN\r
-    if dx<0 then for x:=x1 to x2 do BEGIN\r
-                   y:= round (yslope*x);\r
-                   putpixel (x,y,col);\r
-                 END;\r
-    if dx>0 then for x:=x2 to x1 do BEGIN\r
-                   y:= round (yslope*x);\r
-                   putpixel (x,y,col);\r
-                 END;\r
-  END\r
-  ELSE\r
-  BEGIN\r
-    if dy<0 then for y:=y1 to y2 do BEGIN\r
-                   x:= round (xslope*y);\r
-                   putpixel (x,y,col);\r
-                 END;\r
-    if dy>0 then for y:=y2 to y1 do BEGIN\r
-                   x:= round (xslope*y);\r
-                   putpixel (x,y,col);\r
-                 END;\r
-  END;\r
-END;\r
-\r
-Quite big, isn't it? Here is a much shorter way of doing much the same\r
-thing :\r
-\r
-function sgn(a:real):integer;\r
-begin\r
-     if a>0 then sgn:=+1;\r
-     if a<0 then sgn:=-1;\r
-     if a=0 then sgn:=0;\r
-end;\r
-\r
-procedure line(a,b,c,d,col:integer);\r
-var u,s,v,d1x,d1y,d2x,d2y,m,n:real;\r
-    i:integer;\r
-begin\r
-     u:= c - a;\r
-     v:= d - b;\r
-     d1x:= SGN(u);\r
-     d1y:= SGN(v);\r
-     d2x:= SGN(u);\r
-     d2y:= 0;\r
-     m:= ABS(u);\r
-     n := ABS(v);\r
-     IF NOT (M>N) then\r
-     BEGIN\r
-          d2x := 0 ;\r
-          d2y := SGN(v);\r
-          m := ABS(v);\r
-          n := ABS(u);\r
-     END;\r
-     s := INT(m / 2);\r
-     FOR i := 0 TO round(m) DO\r
-     BEGIN\r
-          putpixel(a,b,col);\r
-          s := s + n;\r
-          IF not (s<m) THEN\r
-          BEGIN\r
-               s := s - m;\r
-               a:= a +round(d1x);\r
-               b := b + round(d1y);\r
-          END\r
-          ELSE\r
-          BEGIN\r
-               a := a + round(d2x);\r
-               b := b + round(d2y);\r
-          END;\r
-     end;\r
-END;\r
-\r
-This routine is very fast, and should meet almost all of your requirements\r
-(ASPHYXIA used it for quite a while before we made our new one.)\r
-In the end program, both the new line routine and the circle routine are\r
-tested. A few of the procedures of the first parts are also used.\r
-\r
-Line and circle routines may seem like fairly trivial things, but they are\r
-a vital component of many programs, and you may like to look up other\r
-methods of drawing them in books in the library (I know that here at the\r
-varsity they have books for doing this kind of stuff all over the place)\r
-A good line routine to look out for is the Bressenhams line routine ...\r
-there is a Bressenhams circle routine too ... I have documentaiton for them\r
-if anybody is interested, they are by far some of the fastest routines\r
-you will use.\r
-\r
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
-þ  In closing\r
-\r
-Varsity has started again, so I am (shock) going to bed before three in\r
-the morning, so my quote this week wasn't written in the same wasted way\r
-my last weeks one was (For last week's one, I had gotten 8 hours sleep in\r
-3 days, and thought up and wrote the quote at 2:23 am before I fell asleep.)\r
-\r
-        [  "What does it do?" she asks.\r
-           "It's a computer," he replies.\r
-           "Yes, dear, but what does it do?"\r
-           "It ..er.. computes! It's a computer."\r
-           "What does it compute?"\r
-           "What? Er? Um. Numbers! Yes, numbers!" He smiles\r
-              worriedly.\r
-           "Why?"\r
-           "Why? Well ..um.. why?" He starts to sweat.\r
-           "I mean, is it just something to dust around, or does\r
-              it actually do something useful?"\r
-           "Um...you can call other computers with it!" Hope lights\r
-              up his eyes. "So you can get programs from other computers!"\r
-           "I see. Tell me, what do these programs do?"\r
-           "Do? I don't think I fol..."\r
-           "I see. They compute. Numbers. For no particular reason." He\r
-              withers under her gaze.\r
-           "Yes, but..."\r
-           She smiles, and he trails off, defeated. She takes another look\r
-               at the thing. "Although," she says, with a strange look in\r
-               her eyes. He looks up, an insane look of hope on his\r
-               face. "Does it come in pink?" she asks.\r
-                                                                           ]\r
-                                                     - Grant Smith\r
-                                                        Tue 27 July, 1993\r
-                                                         9:35 pm.\r
-\r
-See you next time,\r
-    - Denthor\r
-\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ TUTPROG3.PAS ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-{$X+}\r
-USES crt;\r
-\r
-CONST VGA = $a000;\r
-\r
-VAR loop1:integer;\r
-    Pall : Array [1..199,1..3] of byte;\r
-      { This is our temporary pallette. We ony use colors 1 to 199, so we\r
-        only have variables for those ones. }\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure SetMCGA;  { This procedure gets you into 320x200x256 mode. }\r
-BEGIN\r
-  asm\r
-     mov        ax,0013h\r
-     int        10h\r
-  end;\r
-END;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure SetText;  { This procedure returns you to text mode.  }\r
-BEGIN\r
-  asm\r
-     mov        ax,0003h\r
-     int        10h\r
-  end;\r
-END;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure Putpixel (X,Y : Integer; Col : Byte);\r
-  { This puts a pixel on the screen by writing directly to memory. }\r
-BEGIN\r
-  Mem [VGA:X+(Y*320)]:=Col;\r
-END;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-procedure WaitRetrace; assembler;\r
-label\r
-  l1, l2;\r
-asm\r
-    mov dx,3DAh\r
-l1:\r
-    in al,dx\r
-    and al,08h\r
-    jnz l1\r
-l2:\r
-    in al,dx\r
-    and al,08h\r
-    jz  l2\r
-end;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure Pal(ColorNo : Byte; R,G,B : Byte);\r
-  { This sets the Red, Green and Blue values of a certain color }\r
-Begin\r
-   Port[$3c8] := ColorNo;\r
-   Port[$3c9] := R;\r
-   Port[$3c9] := G;\r
-   Port[$3c9] := B;\r
-End;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure Circle (X,Y,rad:integer;Col:Byte);\r
-  { This draws a circle with centre X,Y, with Rad as it's radius }\r
-VAR deg:real;\r
-BEGIN\r
-  deg:=0;\r
-  repeat\r
-    X:=round(rad*COS (deg));\r
-    Y:=round(rad*sin (deg));\r
-    putpixel (x+160,y+100,col);\r
-    deg:=deg+0.005;\r
-  until (deg>6.4);\r
-END;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure Line2 (x1,y1,x2,y2:integer;col:byte);\r
-  { This draws a line from x1,y1 to x2,y2 using the first method }\r
-VAR x,y,xlength,ylength,dx,dy:integer;\r
-    xslope,yslope:real;\r
-BEGIN\r
-  xlength:=abs (x1-x2);\r
-  if (x1-x2)<0 then dx:=-1;\r
-  if (x1-x2)=0 then dx:=0;\r
-  if (x1-x2)>0 then dx:=+1;\r
-  ylength:=abs (y1-y2);\r
-  if (y1-y2)<0 then dy:=-1;\r
-  if (y1-y2)=0 then dy:=0;\r
-  if (y1-y2)>0 then dy:=+1;\r
-  if (dy=0) then BEGIN\r
-    if dx<0 then for x:=x1 to x2 do\r
-      putpixel (x,y1,col);\r
-    if dx>0 then for x:=x2 to x1 do\r
-      putpixel (x,y1,col);\r
-    exit;\r
-  END;\r
-  if (dx=0) then BEGIN\r
-    if dy<0 then for y:=y1 to y2 do\r
-      putpixel (x1,y,col);\r
-    if dy>0 then for y:=y2 to y1 do\r
-      putpixel (x1,y,col);\r
-    exit;\r
-  END;\r
-  xslope:=xlength/ylength;\r
-  yslope:=ylength/xlength;\r
-  if (yslope/xslope<1) and (yslope/xslope>-1) then BEGIN\r
-    if dx<0 then for x:=x1 to x2 do BEGIN\r
-                   y:= round (yslope*x);\r
-                   putpixel (x,y,col);\r
-                 END;\r
-    if dx>0 then for x:=x2 to x1 do BEGIN\r
-                   y:= round (yslope*x);\r
-                   putpixel (x,y,col);\r
-                 END;\r
-  END\r
-  ELSE\r
-  BEGIN\r
-    if dy<0 then for y:=y1 to y2 do BEGIN\r
-                   x:= round (xslope*y);\r
-                   putpixel (x,y,col);\r
-                 END;\r
-    if dy>0 then for y:=y2 to y1 do BEGIN\r
-                   x:= round (xslope*y);\r
-                   putpixel (x,y,col);\r
-                 END;\r
-  END;\r
-END;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-procedure line(a,b,c,d,col:integer);\r
-  { This draws a line from x1,y1 to x2,y2 using the first method }\r
-\r
-    function sgn(a:real):integer;\r
-    begin\r
-         if a>0 then sgn:=+1;\r
-         if a<0 then sgn:=-1;\r
-         if a=0 then sgn:=0;\r
-    end;\r
-\r
-var u,s,v,d1x,d1y,d2x,d2y,m,n:real;\r
-    i:integer;\r
-begin\r
-     u:= c - a;\r
-     v:= d - b;\r
-     d1x:= SGN(u);\r
-     d1y:= SGN(v);\r
-     d2x:= SGN(u);\r
-     d2y:= 0;\r
-     m:= ABS(u);\r
-     n := ABS(v);\r
-     IF NOT (M>N) then\r
-     BEGIN\r
-          d2x := 0 ;\r
-          d2y := SGN(v);\r
-          m := ABS(v);\r
-          n := ABS(u);\r
-     END;\r
-     s := INT(m / 2);\r
-     FOR i := 0 TO round(m) DO\r
-     BEGIN\r
-          putpixel(a,b,col);\r
-          s := s + n;\r
-          IF not (s<m) THEN\r
-          BEGIN\r
-               s := s - m;\r
-               a:= a +round(d1x);\r
-               b := b + round(d1y);\r
-          END\r
-          ELSE\r
-          BEGIN\r
-               a := a + round(d2x);\r
-               b := b + round(d2y);\r
-          END;\r
-     end;\r
-END;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure PalPlay;\r
-  { This procedure mucks about with our "virtual pallette", then shoves it\r
-    to screen. }\r
-Var Tmp : Array[1..3] of Byte;\r
-  { This is used as a "temporary color" in our pallette }\r
-    loop1 : Integer;\r
-BEGIN\r
-   Move(Pall[199],Tmp,3);\r
-     { This copies color 199 from our virtual pallette to the Tmp variable }\r
-   Move(Pall[1],Pall[2],198*3);\r
-     { This moves the entire virtual pallette up one color }\r
-   Move(Tmp,Pall[1],3);\r
-     { This copies the Tmp variable to the bottom of the virtual pallette }\r
-   WaitRetrace;\r
-   For loop1:=1 to 199 do\r
-     pal (loop1,pall[loop1,1],pall[loop1,2],pall[loop1,3]);\r
-END;\r
-\r
-\r
-BEGIN\r
-  ClrScr;\r
-  Writeln ('This sample program will test out our line and circle algorithms.');\r
-  Writeln ('In the first part, many circles will be draw creating (hopefully)');\r
-  Writeln ('a "tunnel" effect. I will the rotate the pallete to make it look');\r
-  Writeln ('nice. I will then draw some lines and rotate the pallette on them');\r
-  Writeln ('too. Note : I am using the slower (first) line algorithm (in');\r
-  Writeln ('procedure line2). Change it to Procedure Line and it will be using');\r
-  Writeln ('the second line routine. NB : For descriptions on how pallette works');\r
-  Writeln ('have a look at part two of this series; I won''t re-explain it here.');\r
-  Writeln;\r
-  Writeln ('Remember to send me any work you have done, I am most eager to help.');\r
-  Writeln; Writeln;\r
-  Writeln ('Hit any key to continue ...');\r
-  Readkey;\r
-  setmcga;\r
-\r
-  For Loop1 := 1 to 199 do BEGIN\r
-    Pall[Loop1,1] := Loop1 mod 30+33;\r
-    Pall[Loop1,2] := 0;\r
-    Pall[Loop1,3] := 0;\r
-  END;\r
-       { This sets colors 1 to 199 to values between 33 to 63. The MOD\r
-         function gives you the remainder of a division, ie. 105 mod 10 = 5 }\r
-\r
-   WaitRetrace;\r
-   For loop1:=1 to 199 do\r
-     pal (loop1,pall[loop1,1],pall[loop1,2],pall[loop1,3]);\r
-        { This sets the true pallette to variable Pall }\r
-\r
-  for loop1:=1 to 90 do\r
-    circle (160,100,loop1,loop1);\r
-       { This draws 90 circles all with centres at 160,100; with increasing\r
-         radii and colors. }\r
-\r
-  Repeat\r
-    PalPlay;\r
-  Until keypressed;\r
-  Readkey;\r
-\r
-  for loop1:=1 to 199 do\r
-    line2 (0,1,319,loop1,loop1);   { *** Replace Line2 with Line to use the\r
-                                         second line algorithm *** }\r
-       { This draws 199 lines, all starting at 0,1 }\r
-\r
-  Repeat\r
-    PalPlay;\r
-  Until keypressed;\r
-\r
-  readkey;\r
-  SetText;\r
-  Writeln ('All done. Okay, so maybe it wasn''t a tunnel effect, but you get the');\r
-  Writeln ('general idea ;-) This concludes the third sample program in the ASPHYXIA');\r
-  Writeln ('Training series. You may reach DENTHOR under the name of GRANT SMITH');\r
-  Writeln ('on the MailBox BBS, or leave a message to ASPHYXIA on the ASPHYXIA BBS.');\r
-  Writeln ('Get the numbers from Roblist, or write to :');\r
-  Writeln ('             Grant Smith');\r
-  Writeln ('             P.O. Box 270');\r
-  Writeln ('             Kloof');\r
-  Writeln ('             3640');\r
-  Writeln ('I hope to hear from you soon!');\r
-  Writeln; Writeln;\r
-  Write   ('Hit any key to exit ...');\r
-  Readkey;\r
-END.\r
diff --git a/16/PCGPE10/TUT4.TXT b/16/PCGPE10/TUT4.TXT
deleted file mode 100644 (file)
index f284905..0000000
+++ /dev/null
@@ -1,408 +0,0 @@
-\r
-                   ÕÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͸\r
-                   ³         W E L C O M E         ³\r
-                   ³  To the VGA Trainer Program   ³ ³\r
-                   ³              By               ³ ³\r
-                   ³      DENTHOR of ASPHYXIA      ³ ³ ³\r
-                   ÔÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ; ³ ³\r
-                     ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ ³\r
-                       ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-                           --==[ PART 4 ]==--\r
-\r
-\r
-\r
-þ Introduction\r
-\r
-\r
-Howdy all! Welcome to the fourth part of this trainer series! It's a\r
-little late, but I am sure you will find that the wait was worth it,\r
-becase today I am going to show you how to use a very powerful tool :\r
-Virtual Screens.\r
-\r
-If you would like to contact me, or the team, there are many ways you\r
-can do it : 1) Write a message to Grant Smith in private mail here on\r
-                  the Mailbox BBS.\r
-            2) Write a message here in the Programming conference here\r
-                  on the Mailbox (Preferred if you have a general\r
-                  programming query or problem others would benefit from)\r
-            3) Write to ASPHYXIA on the ASPHYXIA BBS.\r
-            4) Write to Denthor, Eze or Livewire on Connectix.\r
-            5) Write to :  Grant Smith\r
-                           P.O.Box 270 Kloof\r
-                           3640\r
-            6) Call me (Grant Smith) at 73 2129 (leave a message if you\r
-                  call during varsity)\r
-\r
-NB : If you are a representative of a company or BBS, and want ASPHYXIA\r
-       to do you a demo, leave mail to me; we can discuss it.\r
-NNB : If you have done/attempted a demo, SEND IT TO ME! We are feeling\r
-        quite lonely and want to meet/help out/exchange code with other demo\r
-        groups. What do you have to lose? Leave a message here and we can work\r
-        out how to transfer it. We really want to hear from you!\r
-\r
-\r
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
-þ  What is a Virtual Screen and why do we need it?\r
-\r
-Let us say you are generating a complex screen numerous times on the fly\r
-(for example scrolling up the screen then redrawing all the sprites for\r
-each frame of a game you are writing.) Do you have any idea how awful it\r
-would look if the user could actually see you erasing and redrawing each\r
-sprite for each frame? Can you visualise the flicker effect this would\r
-give off? Do you realise that there would be a "sprite doubling" effect\r
-(where you see two copies of the same sprite next to each other)? In the\r
-sample program I have included a part where I do not use virtual screens\r
-to demonstrate these problems. Virtual screens are not the only way to\r
-solve these problems, but they are definately the easiest to code in.\r
-\r
-A virtual screen is this : a section of memory set aside that is exactly\r
-like the VGA screen on which you do all your working, then "flip" it\r
-on to your true screen. In EGA 640x350x16 you automatically have a\r
-virtual page, and it is possible to have up to four on the MCGA using a\r
-particular tweaked mode, but for our puposes we will set one up using base\r
-memory.\r
-\r
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
-þ  Setting up a virtual screen\r
-\r
-As you will have seen in the first part of this trainer series, the MCGA\r
-screen is 64000 bytes big (320x200=64000). You may also have noticed that\r
-in TP 6.0 you arn't allowed too much space for normal variables. For\r
-example, saying :\r
-\r
-VAR Virtual : Array [1..64000] of byte;\r
-\r
-would be a no-no, as you wouldn't have any space for your other variables.\r
-What is the solution? I hear you enquiring minds cry. The answer : pointers!\r
-Pointers to not use up the base 64k allocated to you by TP 6.0, it gets\r
-space from somewhere else in the base 640k memory of your computer. Here is\r
-how you set them up :\r
-\r
-Type Virtual = Array [1..64000] of byte;  { The size of our Virtual Screen }\r
-     VirtPtr = ^Virtual;                  { Pointer to the virtual screen }\r
-\r
-VAR Virscr : VirtPtr;                      { Our first Virtual screen }\r
-    Vaddr  : word;                        { The segment of our virtual screen}\r
-\r
-If you put this in a program as it stands, and try to acess VirScr, your\r
-machine will probably crash. Why? Because you have to get the memory for\r
-your pointers before you can acess them! You do that as follows :\r
-\r
-Procedure SetUpVirtual;\r
-BEGIN\r
-  GetMem (VirScr,64000);\r
-  vaddr := seg (virscr^);\r
-END;\r
-\r
-This procedure has got the memory for the screen, then set vaddr to the\r
-screens segment. DON'T EVER LEAVE THIS PROCEDURE OUT OF YOUR PROGRAM!\r
-If you leave it out, when you write to your virtual screen you will probably\r
-be writing over DOS or some such thing. Not a good plan ;-).\r
-\r
-When you have finished your program, you will want to free the memory\r
-taken up by the virtual screen by doing the following :\r
-\r
-Procedure ShutDown;\r
-BEGIN\r
-  FreeMem (VirScr,64000);\r
-END;\r
-\r
-If you don't do this your other programs will have less memory to use for\r
-themselves.\r
-\r
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
-þ  Putting a pixel to your virtual screen\r
-\r
-This is very similar to putting a pixel to your normal MCGA screen, as\r
-discussed in part one... here is our origonal putpixel :\r
-\r
-Procedure PutPixel (X,Y : Integer; Col : Byte);\r
-BEGIN\r
-  Mem [VGA:X+(Y*320)]:=col;\r
-END;\r
-\r
-For our virtual screen, we do the following :\r
-\r
-Procedure VirtPutPixel (X,Y : Integer; Col : Byte);\r
-BEGIN\r
-  Mem [Vaddr:X+(Y*320)]:=col;\r
-END;\r
-\r
-It seems quite wasteful to have two procedures doing exactly the same thing,\r
-just to different screens, doesn't it? So why don't we combine the two like\r
-this :\r
-\r
-Procedure PutPixel (X,Y : Integer; Col : Byte; Where : Word);\r
-BEGIN\r
-  Mem [Where:X+(Y*320)]:=col;\r
-END;\r
-\r
-To use this, you will say something like :\r
-\r
-Putpixel (20,20,32,VGA);\r
-PutPixel (30,30,64,Vaddr);\r
-\r
-These two statements draw two pixels ... one to the VGA screen and one to\r
-the virtual screen! Doesn't that make you jump  with joy! ;-) You will\r
-have noticed that we still can't actually SEE the virtual screen, so on to\r
-the next part ...\r
-\r
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
-þ  How to "Flip" your virtual screen on to the true screen\r
-\r
-You in fact already have to tools to do this yourselves from information\r
-in the previous parts of this trainer series. We will of course use the\r
-Move command, like so :\r
-\r
-Move (Virscr^,mem [VGA:0],64000);\r
-\r
-simple, eh? Yuo may want to wait for a verticle retrace (Part 2) before you\r
-do that, as it may make the flip much smoother (and, alas, slower).\r
-\r
-Note that most of our other procedures may be altered to support the\r
-virtual screen, such as Cls etc. (see Part 1 of this series), using the\r
-methoods described above (I have altered the CLS procedure in the sample\r
-program given at the end of this Part.)\r
-\r
-We of ASPHYXIA have used virtual screens in almost all of our demos.\r
-Can you imagine how awful the SoftelDemo would have looked if you had to\r
-watch us redrawing the moving background, text and vectorballs for EACH\r
-FRAME? The flicker, doubling effects etc would have made it awful! So\r
-we used a virtual screen, and are very pleased with the result.\r
-Note, though, that to get the speed we needed to get the demo fast enough,\r
-we wrote our sprites routines, flip routines, pallette routines etc. all\r
-in assembly. The move command is very fast, but not as fast as ASM ;-)\r
-\r
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
-þ  In closing\r
-\r
-I am writing this on the varsity computers in between lectures. I prefer\r
-writing & coding between 6pm and 4am, but it isn't a good plan when\r
-varsity is on ;-), so this is the first part of the trainer series ever\r
-written before 9pm.\r
-\r
-I have been asked to do a part on scrolling the screen, so that is\r
-probably what I will do for next week. Also, ASPHYXIA will soon be putting\r
-up a small demo with source on the local boards. It will use routines\r
-that we have discussed in this series, and demonstrate how powerful these\r
-routines can be if used in the correct manner.\r
-\r
-Some projects for you to do :\r
-  1) Rewrite the flip statement so that you can say :\r
-        flip (Vaddr,VGA);\r
-        flip (VGA,Vaddr);\r
-      ( This is how ASPHYXIAS one works )\r
-\r
-  2) Put most of the routines (putpixel, cls, pal etc.) into a unit,\r
-     so that you do not need to duplicate the procedures in each program\r
-     you write. If you need help, leave me mail.\r
-\r
-\r
-See you next week\r
-   - Denthor\r
-\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ TUTPROG4.PAS ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-{$X+}   (* This is a handy little trick to know. If you put this at the top\r
-           of your program, you do not have to set a variable when calling\r
-           a function, i.e. you may just say 'READKEY' instead of\r
-           'CH:=READKEY'                                                *)\r
-\r
-USES Crt;           (* This has a few nice functions in it, such as the\r
-                       READKEY command.                                 *)\r
-\r
-CONST VGA = $a000;  (* This sets the constant VGA to the segment of the\r
-                       VGA screen.                                      *)\r
-\r
-Type Virtual = Array [1..64000] of byte;  { The size of our Virtual Screen }\r
-     VirtPtr = ^Virtual;                  { Pointer to the virtual screen }\r
-\r
-VAR Virscr : VirtPtr;                      { Our first Virtual screen }\r
-    Vaddr  : word;                        { The segment of our virtual screen}\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure SetMCGA;  { This procedure gets you into 320x200x256 mode. }\r
-BEGIN\r
-  asm\r
-     mov        ax,0013h\r
-     int        10h\r
-  end;\r
-END;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure SetText;  { This procedure returns you to text mode.  }\r
-BEGIN\r
-  asm\r
-     mov        ax,0003h\r
-     int        10h\r
-  end;\r
-END;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure Cls (Col : Byte; Where:Word);\r
-   { This clears the screen to the specified color, on the VGA or on the\r
-        virtual screen }\r
-BEGIN\r
-  Fillchar (Mem [where:0],64000,col);\r
-END;\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-procedure WaitRetrace; assembler;\r
-  { This waits until you are in a Verticle Retrace ... this means that all\r
-    screen manipulation you do only appears on screen in the next verticle\r
-    retrace ... this removes most of the "fuzz" that you see on the screen\r
-    when changing the pallette. It unfortunately slows down your program\r
-    by "synching" your program with your monitor card ... it does mean\r
-    that the program will run at almost the same speed on different\r
-    speeds of computers which have similar monitors. In our SilkyDemo,\r
-    we used a WaitRetrace, and it therefore runs at the same (fairly\r
-    fast) speed when Turbo is on or off. }\r
-\r
-label\r
-  l1, l2;\r
-asm\r
-    mov dx,3DAh\r
-l1:\r
-    in al,dx\r
-    and al,08h\r
-    jnz l1\r
-l2:\r
-    in al,dx\r
-    and al,08h\r
-    jz  l2\r
-end;\r
-\r
-\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure SetUpVirtual;\r
-   { This sets up the memory needed for the virtual screen }\r
-BEGIN\r
-  GetMem (VirScr,64000);\r
-  vaddr := seg (virscr^);\r
-END;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure ShutDown;\r
-   { This frees the memory used by the virtual screen }\r
-BEGIN\r
-  FreeMem (VirScr,64000);\r
-END;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure PutPixel (X,Y : Integer; Col : Byte; Where : Word);\r
-   { This puts a pixel at X,Y using color col, on VGA or the Virtual Screen}\r
-BEGIN\r
-  Mem [Where:X+(Y*320)]:=col;\r
-END;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure Flip;\r
-   { This flips the virtual screen to the VGA screen. }\r
-BEGIN\r
-  Move (Virscr^,mem [VGA:0],64000);\r
-END;\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure BlockMove;\r
-   { This tests various ways of moving a block around the screen }\r
-VAR loop1,loop2,loop3:Integer;\r
-BEGIN\r
-  For loop1:=1 to 50 do BEGIN                     { This draw a block    }\r
-    for loop2:=1 to 50 do                         {  directly to VGA, no }\r
-      for loop3:=1 to 50 do                       {  flipping            }\r
-        putpixel (loop1+loop2,loop3,32,VGA);\r
-    cls (0,VGA);\r
-  END;\r
-\r
-  For loop1:=1 to 50 do BEGIN                     { This draws a block     }\r
-    for loop2:=1 to 50 do                         { to the virtual screen, }\r
-      for loop3:=1 to 50 do                       { then flips it to VGA   }\r
-        putpixel (loop1+loop2,loop3,32,Vaddr);\r
-    flip;\r
-    cls (0,Vaddr);\r
-  END;\r
-\r
-  For loop1:=1 to 50 do BEGIN                     { This draws a block     }\r
-    for loop2:=1 to 50 do                         { to the virtual screen, }\r
-      for loop3:=1 to 50 do                       { waits for a retrace,   }\r
-        putpixel (loop1+loop2,loop3,32,Vaddr);    { then flips it to VGA   }\r
-    waitretrace;\r
-    flip;\r
-    cls (0,Vaddr);\r
-  END;\r
-END;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure PatternDraw;\r
-   { This test the speed of flipping by drawing two patterns and flipping\r
-     them }\r
-VAR loop1,loop2:integer;\r
-BEGIN\r
-  for loop1:=1 to 100 do                        { This draws pattern one }\r
-    for loop2:=1 to 100 do                      { to the virtual screen  }\r
-      putpixel (loop1,loop2,loop1,Vaddr);       { then flips it to VGA   }\r
-  flip;\r
-\r
-  for loop1:=1 to 100 do                        { This draws pattern two }\r
-    for loop2:=1 to 100 do                      { to the virtual screen  }\r
-      putpixel (loop1,loop2,loop2,Vaddr);       { then flips it to VGA   }\r
-  flip;\r
-END;\r
-\r
-\r
-BEGIN\r
-  ClrScr;\r
-  Writeln ('This program will demonstrate the power of virtual screens.');\r
-  Writeln ('A block will firstly move across the screen, being drawn and');\r
-  Writeln ('erased totally on the VGA. Then the same block will move');\r
-  Writeln ('across, but will be drawn on the virtual screen and flipped');\r
-  Writeln ('to the VGA screen without a retrace (see part 2). The the');\r
-  Writeln ('block will go again, with flipping and a retrace.');\r
-  Writeln;\r
-  Writeln ('I will then draw a pattern, flip it to VGA, draw another');\r
-  Writeln ('pattern, flip it to VGA, and repeat that until a key is pressed.');\r
-  Writeln ('This will demonstrate that even when I put down 10000 pixels,');\r
-  Writeln ('then flip them to the VGA, it is still relatively fast.      ');\r
-  Writeln; Writeln;\r
-  Writeln ('Hit any key to continue ...');\r
-  readkey;\r
-  setmcga;\r
-  setupvirtual;\r
-  cls (0,vaddr);    { After you have got the memory for the virtual screen,\r
-                      it is usually filled with random garbage. It is always\r
-                      wise to clear the virtual screen directly afterwards }\r
-  BlockMove;\r
-\r
-  Repeat\r
-    PatternDraw;\r
-  Until keypressed;\r
-\r
-  Readkey;\r
-  settext;\r
-  shutdown;\r
-  Writeln ('All done. This concludes the fourth sample program in the ASPHYXIA');\r
-  Writeln ('Training series. You may reach DENTHOR under the name of GRANT');\r
-  Writeln ('SMITH on the MailBox BBS, or leave a message to ASPHYXIA on the');\r
-  Writeln ('ASPHYXIA BBS. Get the numbers from Roblist, or write to :');\r
-  Writeln ('             Grant Smith');\r
-  Writeln ('             P.O. Box 270');\r
-  Writeln ('             Kloof');\r
-  Writeln ('             3640');\r
-  Writeln ('I hope to hear from you soon!');\r
-  Writeln; Writeln;\r
-  Write   ('Hit any key to exit ...');\r
-  Readkey;\r
-END.\r
diff --git a/16/PCGPE10/TUT5.TXT b/16/PCGPE10/TUT5.TXT
deleted file mode 100644 (file)
index 43a7249..0000000
+++ /dev/null
@@ -1,410 +0,0 @@
-\r
-                   ÕÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͸\r
-                   ³         W E L C O M E         ³\r
-                   ³  To the VGA Trainer Program   ³ ³\r
-                   ³              By               ³ ³\r
-                   ³      DENTHOR of ASPHYXIA      ³ ³ ³\r
-                   ÔÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ; ³ ³\r
-                     ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ ³\r
-                       ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-                           --==[ PART 5 ]==--\r
-\r
-\r
-\r
-þ Introduction\r
-\r
-Hello! This is Denthor here with the 5 part of the ASPHYXIA VGA Trainer\r
-Series : The Scrolling Saga. I have had many requests for information on\r
-scrolling, so I decided to make it this weeks topic. Note that I do make\r
-reference to my recently released program TEXTER5, which should be available\r
-from wherever you get this message. (Note to Sysops : If you put the trainer\r
-series up on your boards, please add WORMIE.ZIP and TEXTER5.ZIP as they\r
-both suppliment this series)\r
-\r
-By the way, sorry for the delay in the appearance of this part. Tests,\r
-projects and a few wild days of sin at the Wild Coast all conspired\r
-against the prompt appearance of this part. Also note I need more input as\r
-to what I should do future parts on, so leave me mail.\r
-\r
-If you would like to contact me, or the team, there are many ways you\r
-can do it : 1) Write a message to Grant Smith in private mail here on\r
-                  the Mailbox BBS.\r
-            2) Write a message here in the Programming conference here\r
-                  on the Mailbox (Preferred if you have a general\r
-                  programming query or problem others would benefit from)\r
-            3) Write to ASPHYXIA on the ASPHYXIA BBS.\r
-            4) Write to Denthor, Eze or Livewire on Connectix.\r
-            5) Write to :  Grant Smith\r
-                           P.O.Box 270 Kloof\r
-                           3640\r
-                           Natal\r
-            6) Call me (Grant Smith) at 73 2129 (leave a message if you\r
-                  call during varsity)\r
-\r
-NB : If you are a representative of a company or BBS, and want ASPHYXIA\r
-       to do you a demo, leave mail to me; we can discuss it.\r
-NNB : If you have done/attempted a demo, SEND IT TO ME! We are feeling\r
-        quite lonely and want to meet/help out/exchange code with other demo\r
-        groups. What do you have to lose? Leave a message here and we can work\r
-        out how to transfer it. We really want to hear from you!\r
-\r
-\r
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
-þ  What is scrolling?\r
-\r
-If you have ever seen a demo, you have probably seen some form of scrolling.\r
-Our SILKYDEMO has quite a nice example of scrolling. What it is is a long\r
-row of text moving across your screen, usually from right to left, eg :\r
-\r
-                                       H     : Step 1\r
-                                      He     : Step 2\r
-                                     Hel     : Step 3\r
-                                    Hell     : Step 4\r
-                                   Hello     : Step 5\r
-                                  Hello      : Step 6\r
-\r
-etc. etc. See the program attatched for an example of scrolling.\r
-\r
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
-þ  What do we scroll?\r
-\r
-Usually, letters. Most groups put greetings and information in their\r
-'scrollies', as they are termed. You can also scroll and entire screen\r
-using the scrolling technique. Scrolling your text is a hell of a lot\r
-less boring then just having it appear on your screen. Unfortunately,\r
-'scrollies' have been used so many times in demos they are wearing a\r
-bit thin, so usually they are accompanied by a cool picture or some nice\r
-routine happening at the same time (In our SILKYDEMO we had a moving\r
-checkerboard and colour bars going at the same time).\r
-\r
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
-þ  How do we scroll from side to side?\r
-\r
-The theory behind scrolling is quite easy. Let us imagine that we are\r
-scrolling a 16x16 font grabbed by TEXTER (;-)) across the top of the\r
-screen (ie. 320 pixels) As we know, the VGA screen starts at zero at the\r
-top left hand part of the screen, then counts up to the right to 319, then\r
-goes back to the left hand side one pixel down at 320. (See Tut 1) This means\r
-that a 16*320 scroller takes up the space 0 to 5119 on the screen. In ascii\r
-this looks like this :\r
-\r
-            (0)   .                                    .  (319)\r
-            (320) .                                    .  (639)\r
-                            "             "           "\r
-           (4800) .                                    .   (5119)\r
-\r
-Simple enough. Now what we do is we put down the first Y-line of the first\r
-character onto the very right hand side of the screen , like so :\r
-\r
-              For loop1:=1 to 16 do\r
-                Putpixel (319,loop1-1,font['A',1,loop1],vga);\r
-\r
-This will draw some stuff on the very right hand side. Your screen should now\r
-look like this :\r
-\r
-            (0)   .                                   X.  (319)\r
-            (320) .                                   X.  (639)\r
-                            "             "           "\r
-           (4800) .                                   X.   (5119)\r
-\r
-Next, we move each line one to the left, ie :\r
-\r
-              For loop1:=0 to 15 do\r
-                Move (mem[VGA:loop1*320+1],mem[VGA:loop1*320],320);\r
-\r
-This scrolls the screen from right to left, which is the easiest to read.\r
-To scroll the screen from left to right, swap the +1 onto the other side\r
-of the command. Also, to increase the size of the portion scrolled, increase\r
-the 15 to however many lines from the top you wish to scroll-1.\r
-\r
-After this move, your screen will look like this :\r
-\r
-            (0)   .                                  X .  (319)\r
-            (320) .                                  X .  (639)\r
-                            "             "           "\r
-           (4800) .                                  X .   (5119)\r
-                                                      ^\r
-                                                Note this space\r
-\r
-\r
-What you then do is draw in the next line on the right hand side, move it,\r
-draw the next line, move it etc. etc. Tah-Dah! You have a scrolly! Fairly\r
-simple, isn't it?\r
-\r
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
-þ  How do we scroll up or down?\r
-\r
-To scroll up or down is also fairly simple. This can be used for 'movie\r
-credit' endings (I once wrote a little game with a desert scrolling down\r
-with you being a little robot on the bottom of the screen). The theory is\r
-this : Draw the top line (or bottom line) then move the entire screen :\r
-\r
-             Move (mem[vga:0],mem[vga:320],63680);\r
-                       { 64000 - 320 = 63680 }\r
-\r
-For scrolling down, or :\r
-\r
-             Move (mem[vga:320],mem[vga:0],63680);\r
-\r
-For scrolling up. You then draw the next line and repeat.\r
-\r
-Because of the simplicity of coding in a scrolly, most demos have one. It\r
-is usually best to have something extra happening on the screen so that\r
-the viewer doesn't get too bored, even, as I say, if it is only a really nice\r
-picture.\r
-\r
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
-þ  In closing\r
-\r
-The University of Natal, Durban, Science Dept., now has 10 new 486's!\r
-This is a great boon, as now I can program nice routines during frees\r
-(even though I am a Commerce Student (Shhhhh) ;-) ). I can now use those\r
-previously wasted hours that I spent socialising and making friends\r
-coding instead ;-)\r
-\r
-I suggest you get a copy of TEXTER, for coding demos with fonts, or in fact\r
-almost any graphics application, it is an amazing help, and we have used it\r
-for *ALL* our demos. (P.S. We have written many demos, but many have been\r
-written for companies and have not been released for the general public)\r
-NOTE : For TEXTER's test program TEST.PAS, add {$X+} {$R-} if you have range\r
-checking on (I code with it off.)\r
-\r
-            [  "I'm from the Computer Inspection Agency, sir,\r
-                   I'm here to check your computer. Here is\r
-                   my identification."\r
-               "Certainly. Have a look, I'm clean. I don't have\r
-                   any pirated software."\r
-               The C-man pushes past him and sits in front of the\r
-                   computer. He notes the fact that the computer\r
-                   is currently off with a look of disdain. He\r
-                   makes a note on his clipboard. He boots up.\r
-               "What is this?" he asks, pointing at the screen.\r
-               "It's MasterMenu" stutters the man. "I wrote it\r
-                   myself!"\r
-               "Do you know what the penalty is for using junk\r
-                   like this on a private machine?" The C-man smiles.\r
-                   "This is a two-month sentance in itself!"\r
-               "I'm sorry sir! It won't happen again!"\r
-               "I know. I'll make sure of that." He smiles again.\r
-               The C-man runs through the hard drive, checking for\r
-                   illeagal software, bad programs and anti-government\r
-                   propaganda. He notes with satisfaction that he has\r
-                   enough to put this weenie away for ten years, not that\r
-                   it mattered. He usually could just make something up.\r
-               He comes to the last entry on the aphebetised menu tree.\r
-                   His hands jerk away from the keyboard. Then, tentatively,\r
-                   he types in the three letters of doom. He looks at the\r
-                   man, who is backing away with wide eyes and his hands\r
-                   outstretched in front of him, as if to ward off a blow.\r
-               The C-man smiles, his lips a thin, hard line.\r
-               "Windows!"\r
-                                                                     ]\r
-                                                           - Grant Smith\r
-                                                               1:55pm\r
-                                                                 16/9/93\r
-\r
-Cheers,\r
-  - Denthor\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ TUTPROG5.PAS ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-{$X+} {$R-}\r
-Uses Crt;\r
-\r
-CONST VGA = $a000;\r
-      XSize = 16;\r
-      YSize = 16;\r
-\r
-TYPE\r
-        Letter = Array[1..xsize,1..ysize] of Byte;\r
-        Letters = Array[' '..']'] of Letter;\r
-\r
-VAR Font : ^Letters;\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure SetMCGA;  { This procedure gets you into 320x200x256 mode. }\r
-BEGIN\r
-  asm\r
-     mov        ax,0013h\r
-     int        10h\r
-  end;\r
-END;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure SetText;  { This procedure returns you to text mode.  }\r
-BEGIN\r
-  asm\r
-     mov        ax,0003h\r
-     int        10h\r
-  end;\r
-END;\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-procedure WaitRetrace; assembler;\r
-  { This waits until you are in a Verticle Retrace }\r
-\r
-label\r
-  l1, l2;\r
-asm\r
-    mov dx,3DAh\r
-l1:\r
-    in al,dx\r
-    and al,08h\r
-    jnz l1\r
-l2:\r
-    in al,dx\r
-    and al,08h\r
-    jz  l2\r
-end;\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure Pal(ColorNo : Byte; R,G,B : Byte);\r
-  { This sets the Red, Green and Blue values of a certain color }\r
-Begin\r
-   Port[$3c8] := ColorNo;\r
-   Port[$3c9] := R;\r
-   Port[$3c9] := G;\r
-   Port[$3c9] := B;\r
-End;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure PutPixel (X,Y : Integer; Col : Byte; Where : Word);\r
-   { This puts a pixel at X,Y using color col, on VGA or the Virtual Screen}\r
-BEGIN\r
-  Mem [Where:X+(Y*320)]:=col;\r
-END;\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-procedure LoadPal (FileName : string);\r
-   { This loads the Pallette file and puts it on screen }\r
-type DACType = array [0..255] of record\r
-                                R, G, B : byte;\r
-                              end;\r
-var DAC : DACType;\r
-    Fil : file of DACType;\r
-    I : integer;\r
-BEGIN\r
-  assign (Fil, FileName);\r
-  reset (Fil);\r
-  read (Fil, DAC);\r
-  close (Fil);\r
-  for I := 0 to 255 do Pal(I,Dac[I].R,Dac[I].G,Dac[I].B);\r
-end;\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-function Exist(FileName: string): Boolean;\r
-    { Checks to see if filename exits or not }\r
-var f: file;\r
-begin\r
-  {$I-}\r
-  Assign(f, FileName);\r
-  Reset(f);\r
-  Close(f);\r
-  {$I+}\r
-  Exist := (IOResult = 0) and\r
-   (FileName <> '');\r
-end;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure Setup;\r
-  { This loads the font and the pallette }\r
-VAR f:file;\r
-    loop1:char;\r
-    loop2,loop3:integer;\r
-BEGIN\r
-  getmem (font,sizeof (font^));\r
-  If exist ('softrock.fnt') then BEGIN\r
-    Assign (f,'softrock.fnt');\r
-    reset (f,1);\r
-    blockread (f,font^,sizeof (font^));\r
-    close (f);\r
-    Writeln ('SoftRock.FNT from TEXTER5 found in current directory. Using.');\r
-  END\r
-  ELSE BEGIN\r
-    Writeln ('SoftRock.FNT from TEXTER5 not found in current directory.');\r
-    For loop1:=' ' to ']' do\r
-      For loop2:=1 to 16 do\r
-        for loop3:=1 to 16 do\r
-          font^[loop1,loop2,loop3]:=loop2;\r
-  END;\r
-  If exist ('pallette.col') then\r
-    Writeln ('Pallette.COL from TEXTER5 found in current directory. Using.')\r
-  ELSE\r
-    Writeln ('Pallette.COL from TEXTER5 not found in current directory.');\r
-  Writeln;\r
-  Writeln;\r
-  Write ('Hit any key to continue ...');\r
-  readkey;\r
-  setmcga;\r
-  If exist ('pallette.col') then loadpal ('pallette.col');\r
-END;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure ScrollMsg (Msg : String);\r
-  { This scrolls the string in MSG across the screen }\r
-Var Loop1,loop2,loop3 : Integer;\r
-Begin\r
-  For loop1:=1 to length (msg) do BEGIN\r
-    For loop2:=1 to xsize do BEGIN\r
-\r
-      { This bit scrolls the screen by one then puts in the new row of\r
-        letters }\r
-\r
-      waitretrace;\r
-      For Loop3 := 100 to 99+ysize do\r
-        move (mem[vga:1+(loop3*320)],mem[vga:(loop3*320)],319);\r
-      for loop3:=100 to 99+ysize do\r
-        putpixel (319,loop3,font^[msg[loop1],loop2,loop3-99],vga);\r
-           { Change the -99 above to the minimum of loop3-1, which you\r
-             will change in order to move the position of the scrolly }\r
-    END;\r
-\r
-    {This next bit scrolls by one pixel after each letter so that there\r
-      are gaps between the letters }\r
-\r
-    waitretrace;\r
-    For Loop3 := 100 to 99+ysize do\r
-      move (mem[vga:1+(loop3*320)],mem[vga:(loop3*320)],319);\r
-      for loop3:=100 to 99+ysize do\r
-        putpixel (319,loop3,0,vga);\r
-  END;\r
-End;\r
-\r
-\r
-BEGIN\r
-  ClrScr;\r
-  Writeln ('This program will give you an example of a scrolly. If the file');\r
-  Writeln ('SOFTROCK.FNT is in the current directory, this program will scroll');\r
-  Writeln ('letters, otherwise it will only scroll bars. It also searches for');\r
-  Writeln ('PALLETTE.COL, which it uses for it''s pallette. Both SOFTROCK.FNT');\r
-  Writeln ('and PALLETTE.COL come with TEXTER5.ZIP, at a BBS near you.');\r
-  Writeln;\r
-  Writeln ('You will note that you can change what the scrolly says merely by');\r
-  Writeln ('changing the string in the program.');\r
-  Writeln;\r
-  Setup;\r
-  repeat\r
-    ScrollMsg ('ASPHYXIA RULZ!!!   ');\r
-  until keypressed;\r
-  Settext;\r
-  freemem (font, sizeof (font^));\r
-  Writeln ('All done. This concludes the fifth sample program in the ASPHYXIA');\r
-  Writeln ('Training series. You may reach DENTHOR under the name of GRANT');\r
-  Writeln ('SMITH on the MailBox BBS, or leave a message to ASPHYXIA on the');\r
-  Writeln ('ASPHYXIA BBS. Get the numbers from Roblist, or write to :');\r
-  Writeln ('             Grant Smith');\r
-  Writeln ('             P.O. Box 270');\r
-  Writeln ('             Kloof');\r
-  Writeln ('             3640');\r
-  Writeln ('I hope to hear from you soon!');\r
-  Writeln; Writeln;\r
-  Write   ('Hit any key to exit ...');\r
-  Readkey;\r
-END.\r
diff --git a/16/PCGPE10/TUT6.TXT b/16/PCGPE10/TUT6.TXT
deleted file mode 100644 (file)
index 7311bb3..0000000
+++ /dev/null
@@ -1,434 +0,0 @@
-\r
-                   ÕÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͸\r
-                   ³         W E L C O M E         ³\r
-                   ³  To the VGA Trainer Program   ³ ³\r
-                   ³              By               ³ ³\r
-                   ³      DENTHOR of ASPHYXIA      ³ ³ ³\r
-                   ÔÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ; ³ ³\r
-                     ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ ³\r
-                       ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-                           --==[ PART 6 ]==--\r
-\r
-\r
-\r
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
-þ Introduction\r
-\r
-Hi there! I'm back, with the latest part in the series : Pregenerated\r
-arrays. This is a fairly simple concept that can treble the speed of\r
-your code, so have a look.\r
-\r
-I still suggest that if you haven't got a copy of TEXTER that you get it.\r
-This is shareware, written by me, that allows you to grab fonts and use\r
-them in your own programs.\r
-\r
-I downloaded the Friendly City BBS Demo, an intro for a PE BBS, written\r
-by a new group called DamnRite, with coder Brett Step. The music was\r
-excellent, written by Kon Wilms (If I'm not mistaken, he is an Amiga\r
-weenie ;-)). A very nice first production, and I can't wait to see more\r
-of their work. I will try con a local BBS to allow me to send Brett some\r
-fido-mail.\r
-\r
-If you would like to contact me, or the team, there are many ways you\r
-can do it : 1) Write a message to Grant Smith in private mail here on\r
-                  the Mailbox BBS.\r
-            2) Write a message here in the Programming conference here\r
-                  on the Mailbox (Preferred if you have a general\r
-                  programming query or problem others would benefit from)\r
-            3) Write to ASPHYXIA on the ASPHYXIA BBS.\r
-            4) Write to Denthor, Eze or Livewire on Connectix.\r
-            5) Write to :  Grant Smith\r
-                           P.O.Box 270 Kloof\r
-                           3640\r
-                           Natal\r
-            6) Call me (Grant Smith) at (031) 73 2129 (leave a message if you\r
-                  call during varsity)\r
-\r
-NB : If you are a representative of a company or BBS, and want ASPHYXIA\r
-       to do you a demo, leave mail to me; we can discuss it.\r
-NNB : If you have done/attempted a demo, SEND IT TO ME! We are feeling\r
-        quite lonely and want to meet/help out/exchange code with other demo\r
-        groups. What do you have to lose? Leave a message here and we can work\r
-        out how to transfer it. We really want to hear from you!\r
-\r
-\r
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
-þ  Why do I need a lookup table? What is it?\r
-\r
-A lookup table is an imaginary table in memory where you look up the\r
-answers to certain mathematical equations instead of recalculating them\r
-each time. This may speed things up considerably. Please note that a\r
-lookup table is sometimes referred to as a pregenerated array.\r
-\r
-One way of looking at a lookup table is as follows : Let us say that for\r
-some obscure reason you need to calculate a lot of multiplications (eg.\r
-5*5 , 7*4 , 9*2 etc.). Instead of actually doing a slow multiply each\r
-time, you can generate a kind of bonds table, as seen below :\r
-\r
-\r
-ÉÍÑÍËÍÍÍÍÍÍÍÑÍÍÍÍÍÍÑÍÍÍÍÍÍÑÍÍÍÍÍÍÑÍÍÍÍÍÍÑÍÍÍÍÍÍÑÍÍÍÍÍÍÑÍÍÍÍÍÍÑÍÍÍÍÍÍ»\r
-ÇÄÅĶ   1   ³  2   ³  3   ³  4   ³  5   ³  6   ³  7   ³  8   ³  9   º\r
-ÇÄÁÄ×ÍÍÍÍÍÍÍØÍÍÍÍÍÍØÍÍÍÍÍÍØÍÍÍÍÍÍØÍÍÍÍÍÍØÍÍÍÍÍÍØÍÍÍÍÍÍØÍÍÍÍÍÍØÍÍÍÍÍ͵\r
-º 1 º   1   ³  2   ³  3   ³  4   ³  5   ³  6   ³  7   ³  8   ³  9   ³\r
-ÇÄÄÄ×ÄÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄ´\r
-º 2 º   2   ³  4   ³  6   ³  8   ³  10  ³  12  ³  14  ³  16  ³  18  ³\r
-ÇÄÄÄ×ÄÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄ´\r
-º 3 º   3   ³  6   ³  9   ³  12  ³  15  ³  18  ³  21  ³  24  ³  27  ³\r
-ÇÄÄÄ×ÄÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄ´\r
-º 4 º   4   ³  8   ³  12  ³  16  ³  20  ³  24  ³  28  ³  32  ³  36  ³\r
-ÇÄÄÄ×ÄÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄ´\r
-º 5 º   5   ³  10  ³  15  ³  20  ³  25  ³  30  ³  35  ³  40  ³  45  ³\r
-ÇÄÄÄ×ÄÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄ´\r
-º 6 º   6   ³  12  ³  18  ³  24  ³  30  ³  36  ³  42  ³  48  ³  54  ³\r
-ÇÄÄÄ×ÄÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄ´\r
-º 7 º   7   ³  14  ³  21  ³  28  ³  35  ³  42  ³  49  ³  56  ³  63  ³\r
-ÇÄÄÄ×ÄÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄ´\r
-º 8 º   8   ³  16  ³  24  ³  32  ³  40  ³  48  ³  56  ³  64  ³  72  ³\r
-ÇÄÄÄ×ÄÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄ´\r
-º 9 º   9   ³  18  ³  27  ³  36  ³  45  ³  54  ³  63  ³  72  ³  81  ³\r
-ÈÍÍÍÊÄÄÄÄÄÄÄÁÄÄÄÄÄÄÁÄÄÄÄÄÄÁÄÄÄÄÄÄÁÄÄÄÄÄÄÁÄÄÄÄÄÄÁÄÄÄÄÄÄÁÄÄÄÄÄÄÁÄÄÄÄÄÄÙ\r
-\r
-This means that instead of calculating 9*4, you just find the 9 on the\r
-top and the 4 on the side, and the resulting number is the answer.  This\r
-type of table is very useful when the equations are very long to do.\r
-\r
-The example I am going to use for this part is that of circles. Cast\r
-your minds back to Part 3 on lines and circles. The circle section took\r
-quite a while to finish drawing, mainly because I had to calculate the\r
-SIN and COS for EVERY SINGLE POINT. Calculating SIN and COS is obviously\r
-very slow, and that was reflected in the speed of the section.\r
-\r
-\r
-\r
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
-þ  How do I generate a lookup table?\r
-\r
-This is very simple. In my example, I am drawing a circle. A circle has\r
-360 degrees, but for greater accuracy, to draw my circle I will start\r
-with zero and increase my degrees by 0.4. This means that in each circle\r
-there need to be 8000 SINs and COSes (360/0.4=8000). Putting these into\r
-the base 64k that Pascal allocates for normal variables is obviously not\r
-a happening thing, so we define them as pointers in the following\r
-manner: \r
-        TYPE   table = Array [1..8000] of real;\r
-\r
-        VAR    sintbl : ^table;\r
-               costbl : ^table;\r
-\r
-Then in the program we get the memory for these two pointers. Asphyxia \r
-was originally thinking of calling itself Creative Reboot Inc., mainly \r
-because we always forgot to get the necessary memory for our pointers.\r
-(Though a bit of creative assembly coding also contributed to this. We\r
-wound up rating our reboots on a scale of 1 to 10 ;-)). The next obvious\r
-step is to place our necessary answers into our lookup tables.  This can\r
-take a bit of time, so in a demo, you would do it in the very beginning\r
-(people just think it's slow disk access or something), or after you\r
-have shown a picture (while the viewer is admiring it, you are\r
-calculating pi to its 37th degree in the background ;-)) Another way of\r
-doing it is, after calculating it once, you save it to a file which you\r
-then load into the variable at the beginning of the program. Anyway,\r
-this is how we will calculate the table for our circle :\r
-\r
-    Procedure Setup;\r
-    VAR deg:real;\r
-    BEGIN\r
-      deg:=0;\r
-      for loop1:=1 to 8000 do BEGIN\r
-        deg:=deg+0.4;\r
-        costbl^[loop1]:=cos (rad(deg));\r
-        sintbl^[loop1]:=sin (rad(deg));\r
-      END;\r
-    END;\r
-\r
-This will calculate the needed 16000 reals and place them into our two\r
-variables. The amount of time this takes is dependant on your computer.\r
-\r
-\r
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
-þ  How do I use a lookup table?\r
-\r
-This is very easy. In your program, wherever you put\r
-               cos (rad(deg)),\r
-you just replace it with :\r
-               costbl^[deg]\r
-\r
-Easy, no? Note that the new "deg" variable is now an integer, always\r
-between 1 and 8000.\r
-\r
-\r
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
-þ Where else do I use lookup tables?\r
-\r
-Lookup tables may be used in many different ways. For example, when\r
-working out 3-dimensional objects, sin and cos are needed often, and are\r
-best put in a lookup table. In a game, you may pregen the course an\r
-enemy may take when attacking. Even saving a picture (for example, a\r
-plasma screen) after generating it, then loading it up later is a form\r
-of pregeneration.\r
-\r
-When you feel that your program is going much too slow, your problems\r
-may be totally sorted out by using a table. Or, maybe not. ;-)\r
-\r
-\r
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
-þ  In closing\r
-\r
-As you have seen above, lookup tables aren't all that exciting, but they\r
-are useful and you need to know how to use them. The attached sample\r
-program will demonstrate just how big a difference they can make.\r
-\r
-Keep on coding, and if you finish anything, let me know about it! I\r
-never get any mail, so all mail is greatly appreciated ;-)\r
-\r
-Sorry, no quote today, it's hot and I'm tired. Maybe next time ;-)\r
-\r
-  - Denthor\r
-\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ TUTPROG6.PAS ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-{$X+}\r
-USES crt;\r
-\r
-CONST VGA = $a000;\r
-\r
-TYPE tbl = Array [1..8000] of real;\r
-             { This will be the shape of the 'table' where we look up\r
-               values, which is faster then calculating them }\r
-\r
-VAR loop1:integer;\r
-    Pall : Array [1..20,1..3] of byte;\r
-      { This is our temporary pallette. We ony use colors 1 to 20, so we\r
-        only have variables for those ones. }\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure SetMCGA;  { This procedure gets you into 320x200x256 mode. }\r
-BEGIN\r
-  asm\r
-     mov        ax,0013h\r
-     int        10h\r
-  end;\r
-END;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure SetText;  { This procedure returns you to text mode.  }\r
-BEGIN\r
-  asm\r
-     mov        ax,0003h\r
-     int        10h\r
-  end;\r
-END;\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure Cls (Col : Byte);\r
-   { This clears the screen to the specified color }\r
-BEGIN\r
-  Fillchar (Mem [VGA:0],64000,col);\r
-END;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure Putpixel (X,Y : Integer; Col : Byte);\r
-  { This puts a pixel on the screen by writing directly to memory. }\r
-BEGIN\r
-  Mem [VGA:X+(Y*320)]:=Col;\r
-END;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-procedure WaitRetrace; assembler;\r
-  {  This waits for a vertical retrace to reduce snow on the screen }\r
-label\r
-  l1, l2;\r
-asm\r
-    mov dx,3DAh\r
-l1:\r
-    in al,dx\r
-    and al,08h\r
-    jnz l1\r
-l2:\r
-    in al,dx\r
-    and al,08h\r
-    jz  l2\r
-end;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure Pal(ColorNo : Byte; R,G,B : Byte);\r
-  { This sets the Red, Green and Blue values of a certain color }\r
-Begin\r
-   Port[$3c8] := ColorNo;\r
-   Port[$3c9] := R;\r
-   Port[$3c9] := G;\r
-   Port[$3c9] := B;\r
-End;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Function rad (theta : real) : real;\r
-  {  This calculates the degrees of an angle }\r
-BEGIN\r
-  rad := theta * pi / 180\r
-END;\r
-\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure NormCirc;\r
-  { This generates a spireal without using a lookup table }\r
-VAR deg,radius:real;\r
-    x,y:integer;\r
-\r
-BEGIN\r
-  gotoxy (1,1);\r
-  Writeln ('Without pregenerated arrays.');\r
-  for loop1:=60 downto 43 do BEGIN\r
-    deg:=0;\r
-    radius:=loop1;\r
-    repeat\r
-      X:=round(radius*COS (rad (deg)));\r
-      Y:=round(radius*sin (rad (deg)));\r
-      putpixel (x+160,y+100,61-loop1);\r
-      deg:=deg+0.4;           { Increase the degree so the circle is round }\r
-      radius:=radius-0.02;    { Decrease the radius for a spiral effect }\r
-    until radius<0; {  Continue till at the centre (the radius is zero) }\r
-  END;\r
-END;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure LookupCirc;\r
-  {  This draws a spiral using a lookup table }\r
-VAR radius:real;\r
-    x,y,pos:integer;\r
-    costbl : ^tbl;\r
-    sintbl : ^tbl;\r
-\r
-    Procedure Setupvars;\r
-      {  This is a nested procedure (a procedure in a procedure), and may\r
-         therefore only be used from within the main part of this procedure.\r
-         This section gets the memory for the table, then generates the\r
-         table. }\r
-    VAR deg:real;\r
-    BEGIN\r
-      getmem (costbl,sizeof(costbl^));\r
-      getmem (sintbl,sizeof(sintbl^));\r
-      deg:=0;\r
-      for loop1:=1 to 8000 do BEGIN         { There are 360 degrees in a    }\r
-        deg:=deg+0.4;                       { circle. If you increase the   }\r
-        costbl^[loop1]:=cos (rad(deg));     { degrees by 0.4, the number of }\r
-        sintbl^[loop1]:=sin (rad(deg));     { needed parts of the table is  }\r
-      END;                                  { 360/0.4=8000                  }\r
-    END;\r
-    { NB : For greater accuracy I increase the degrees by 0.4, because if I\r
-           increase them by one, holes are left in the final product as a\r
-           result of the rounding error margin. This means the pregen array\r
-           is bigger, takes up more memory and is slower to calculate, but\r
-           the finished product looks better.}\r
-\r
-BEGIN\r
-  cls (0);\r
-  gotoxy (1,1);\r
-  Writeln ('Generating variables....');\r
-  setupvars;\r
-  gotoxy (1,1);\r
-  Writeln ('With pregenerated arrays.');\r
-  for loop1:=60 downto 43 do BEGIN\r
-    pos:=1;\r
-    radius:=loop1;\r
-    repeat\r
-      X:=round (radius*costbl^[pos]);   { Note how I am not recalculating sin}\r
-      Y:=round (radius*sintbl^[pos]);   { and cos for each point.            }\r
-      putpixel (x+160,y+100,61-loop1);\r
-      radius:=radius-0.02;\r
-      inc (pos);\r
-      if pos>8000 then pos:=1;    { I only made a table from 1 to 8000, so it}\r
-                                  { must never exceed that, or the program   }\r
-                                  { will probably crash.                     }\r
-    until radius<0;\r
-  END;\r
-  freemem (costbl,sizeof(costbl^));   { Freeing the memory taken up by the   }\r
-  freemem (sintbl,sizeof(sintbl^));   { tables. This is very important.      }\r
-END;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure PalPlay;\r
-  { This procedure mucks about with our "virtual pallette", then shoves it\r
-    to screen. }\r
-Var Tmp : Array[1..3] of Byte;\r
-  { This is used as a "temporary color" in our pallette }\r
-    loop1 : Integer;\r
-BEGIN\r
-   Move(Pall[1],Tmp,3);\r
-     { This copies color 1 from our virtual pallette to the Tmp variable }\r
-   Move(Pall[2],Pall[1],18*3);\r
-     { This moves the entire virtual pallette down one color }\r
-   Move(Tmp,Pall[18],3);\r
-     { This copies the Tmp variable to no. 18 of the virtual pallette }\r
-   WaitRetrace;\r
-   For loop1:=1 to 18 do\r
-     pal (loop1,pall[loop1,1],pall[loop1,2],pall[loop1,3]);\r
-END;\r
-\r
-\r
-BEGIN\r
-  ClrScr;\r
-  writeln ('Hi there! This program will demonstrate the usefullness of ');\r
-  writeln ('pregenerated arrays, also known as lookup tables. The program');\r
-  writeln ('will first draw a spiral without using a lookup table, rotate');\r
-  writeln ('the pallette until a key is pressed, the calculate the lookup');\r
-  writeln ('table, then draw the same spiral using the lookup table.');\r
-  writeln;\r
-  writeln ('This is merely one example for the wide range of uses of a ');\r
-  writeln ('lookup table.');\r
-  writeln;\r
-  writeln;\r
-  Write ('  Hit any key to contine ...');\r
-  Readkey;\r
-  setmcga;\r
-  directvideo:=FALSE;  { This handy trick allows you to use GOTOXY and }\r
-                       { Writeln in GFX mode. Hit CTRL-F1 on it for more }\r
-                       { info/help }\r
-  For Loop1 := 1 to 18 do BEGIN\r
-    Pall[Loop1,1] := (Loop1*3)+9;\r
-    Pall[Loop1,2] := 0;\r
-    Pall[Loop1,3] := 0;\r
-  END;\r
-       { This sets colors 1 to 18 to values between 12 to 63. }\r
-\r
-   WaitRetrace;\r
-   For loop1:=1 to 18 do\r
-     pal (loop1,pall[loop1,1],pall[loop1,2],pall[loop1,3]);\r
-        { This sets the true pallette to variable Pall }\r
-\r
-  normcirc;         { This draws a spiral without lookups }\r
-  Repeat\r
-    PalPlay;\r
-  Until keypressed;\r
-  readkey;\r
-  lookupcirc;       { This draws a spiral with lookups }\r
-  Repeat\r
-    PalPlay;\r
-  Until keypressed;\r
-  Readkey;\r
-\r
-  SetText;\r
-  Writeln ('All done. This concludes the sixth sample program in the ASPHYXIA');\r
-  Writeln ('Training series. You may reach DENTHOR under the name of GRANT');\r
-  Writeln ('SMITH on the MailBox BBS, or leave a message to ASPHYXIA on the');\r
-  Writeln ('ASPHYXIA BBS. I am also an avid Connectix BBS user.');\r
-  Writeln ('Get the numbers from Roblist, or write to :');\r
-  Writeln ('             Grant Smith');\r
-  Writeln ('             P.O. Box 270');\r
-  Writeln ('             Kloof');\r
-  Writeln ('             3640');\r
-  Writeln ('I hope to hear from you soon!');\r
-  Writeln; Writeln;\r
-  Write   ('Hit any key to exit ...');\r
-  Readkey;\r
-END.\r
diff --git a/16/PCGPE10/TUT7.TXT b/16/PCGPE10/TUT7.TXT
deleted file mode 100644 (file)
index 3ebb859..0000000
+++ /dev/null
@@ -1,1195 +0,0 @@
-                   ÕÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͸\r
-                   ³         W E L C O M E         ³\r
-                   ³  To the VGA Trainer Program   ³ ³\r
-                   ³              By               ³ ³\r
-                   ³      DENTHOR of ASPHYXIA      ³ ³ ³\r
-                   ÔÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ; ³ ³\r
-                     ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ ³\r
-                       ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-                           --==[ PART 7 ]==--\r
-\r
-\r
-\r
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
-þ Introduction\r
-\r
-Hello! By popular request, this part is all about animation. I will be\r
-going over three methods of doing animation on a PC, and will\r
-concerntrate specifically on one, which will be demonstrated in the\r
-attached sample code.\r
-\r
-Although not often used in demo coding, animation is usually used in\r
-games coding, which can be almost as rewarding ;-)\r
-\r
-In this part I will also be a lot less stingy with assembler code :)\r
-Included will be a fairly fast pure assembler putpixel, an asm screen\r
-flip command, an asm icon placer, an asm partial-flip and one or two\r
-others. I will be explaining how these work in detail, so this may also\r
-be used as a bit of an asm-trainer too.\r
-\r
-By the way, I apologise for this part taking so long to be released, but\r
-I only finished my exams a few days ago, and they of course took\r
-preference ;-). I have also noticed that the MailBox BBS is no longer\r
-operational, so the trainer will be uploaded regularly to the BBS lists\r
-shown at the end of this tutorial.\r
-\r
-If you would like to contact me, or the team, there are many ways you\r
-can do it : 1) Write a message to Grant Smith/Denthor/Asphyxia in private mail\r
-                  on the ASPHYXIA BBS.\r
-            2) Write a message in the Programming conference on the\r
-                  For Your Eyes Only BBS (of which I am the Moderator )\r
-                  This is preferred if you have a general programming query\r
-                  or problem others would benefit from.\r
-            4) Write to Denthor, Eze or Livewire on Connectix.\r
-            5) Write to :  Grant Smith\r
-                           P.O.Box 270 Kloof\r
-                           3640\r
-                           Natal\r
-            6) Call me (Grant Smith) at (031) 73 2129 (leave a message if you\r
-                  call during varsity)\r
-            7) Write to mcphail@beastie.cs.und.ac.za on InterNet, and\r
-                  mention the word Denthor near the top of the letter.\r
-\r
-NB : If you are a representative of a company or BBS, and want ASPHYXIA\r
-       to do you a demo, leave mail to me; we can discuss it.\r
-NNB : If you have done/attempted a demo, SEND IT TO ME! We are feeling\r
-        quite lonely and want to meet/help out/exchange code with other demo\r
-        groups. What do you have to lose? Leave a message here and we can work\r
-        out how to transfer it. We really want to hear from you!\r
-\r
-\r
-\r
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
-þ  The Principals of Animation\r
-\r
-I am sure all of you have seen a computer game with animation at one or\r
-other time. There are a few things that an animation sequence must do in\r
-order to give an impression of realism. Firstly, it must move,\r
-preferably using different frames to add to the realism (for example,\r
-with a man walking you should have different frames with the arms an\r
-legs in different positions). Secondly, it must not destroy the\r
-background, but restore it after it has passed over it.\r
-\r
-This sounds obvious enough, but can be very difficult to code when you\r
-have no idea of how to go about achieving that.\r
-\r
-In this trainer I will discuss various methods of meeting these two\r
-objectives.\r
-\r
-\r
-\r
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
-þ  Frames and Object Control\r
-\r
-It is quite obvious that for most animation to succeed, you must have\r
-numerous frames of the object in various poses (such as a man with\r
-several frames of him walking). When shown one after the other, these\r
-give the impression of natural movement.\r
-\r
-So, how do we store these frames? I hear you cry. Well, the obvious\r
-method is to store them in arrays. After drawing a frame in Autodesk\r
-Animator and saving it as a .CEL, we usually use the following code to\r
-load it in :\r
-\r
-TYPE icon = Array [1..50,1..50] of byte;\r
-\r
-VAR tree : icon;\r
-\r
-Procedure LoadCEL (FileName :  string; ScrPtr : pointer);\r
-var\r
-  Fil : file;\r
-  Buf : array [1..1024] of byte;\r
-  BlocksRead, Count : word;\r
-begin\r
-  assign (Fil, FileName);\r
-  reset (Fil, 1);\r
-  BlockRead (Fil, Buf, 800);    { Read and ignore the 800 byte header }\r
-  Count := 0; BlocksRead := $FFFF;\r
-  while (not eof (Fil)) and (BlocksRead <> 0) do begin\r
-    BlockRead (Fil, mem [seg (ScrPtr^): ofs (ScrPtr^) + Count], 1024, BlocksRead);\r
-    Count := Count + 1024;\r
-  end;\r
-  close (Fil);\r
-end;\r
-\r
-BEGIN\r
-  Loadcel ('Tree.CEL',addr (tree));\r
-END.\r
-\r
-We now have the 50x50 picture of TREE.CEL in our array tree. We may access\r
-this array in the usual manner (eg. col:=tree [25,30]). If the frame is\r
-large, or if you have many frames, try using pointers (see previous\r
-parts)\r
-\r
-Now that we have the picture, how do we control the object? What if we\r
-want multiple trees wandering around doing their own thing? The solution\r
-is to have a record of information for each tree. A typical data\r
-structure may look like the following :\r
-\r
-TYPE Treeinfo = Record\r
-                  x,y:word;       { Where the tree is }\r
-                  speed:byte;     { How fast the tree is moving }\r
-                  Direction:byte; { Where the tree is facing }\r
-                  frame:byte      { Which animation frame the tree is\r
-                                    currently involved in }\r
-                  active:boolean; { Is the tree actually supposed to be\r
-                                    shown/used? }\r
-                END;\r
-\r
-VAR Forest : Array [1..20] of Treeinfo;\r
-\r
-You now have 20 trees, each with their own information, location etc.\r
-These are accessed using the following means :\r
-                  Forest [15].x:=100;\r
-This would set the 15th tree's x coordinate to 100.\r
-\r
-\r
-\r
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
-þ  Restoring the Overwritten Background\r
-\r
-I will discuss three methods of doing this. These are NOT NECESSARILY\r
-THE ONLY OR BEST WAYS TO DO THIS! You must experiment and decide which\r
-is the best for your particular type of program.\r
-\r
-METHOD 1 :\r
-\r
-Step 1 : Create two virtual pages, Vaddr and Vaddr2.\r
-Step 2 : Draw the background to Vaddr2.\r
-Step 3 : Flip Vaddr2 to Vaddr.\r
-Step 4 : Draw all the foreground objects onto Vaddr.\r
-Step 5 : Flip Vaddr to VGA.\r
-Step 6 : Repeat from 3 continuously.\r
-\r
-In ascii, it looks like follows ...\r
-\r
-    +---------+           +---------+           +---------+\r
-    |         |           |         |           |         |\r
-    |  VGA    | <=======  |  VADDR  |  <======  |  VADDR2 |\r
-    |         |           | (bckgnd)|           | (bckgnd)|\r
-    |         |           |+(icons) |           |         |\r
-    +---------+           +---------+           +---------+\r
-\r
-The advantages of this approach is that it is straightforward, continual\r
-reading of the background is not needed, there is no flicker and it is\r
-simple to implement.  The disadvantages are that two 64000 byte virtual\r
-screens are needed, and the procedure is not very fast because of the\r
-slow speed of flipping.\r
-\r
-\r
-METHOD 2 :\r
-\r
-Step 1 : Draw background to VGA.\r
-Step 2 : Grab portion of background that icon will be placed on.\r
-Step 3 : Place icon.\r
-Step 4 : Replace portion of background from Step 2 over icon.\r
-Step 5 : Repeat from step 2 continuously.\r
-\r
-In terms of ascii ...\r
-\r
-      +---------+\r
-      |      +--|------- + Background restored (3)\r
-      |      * -|------> * Background saved to memory (1)\r
-      |      ^  |\r
-      |      +--|------- # Icon placed (2)\r
-      +---------+\r
-\r
-The advantages of this method is that very little extra memory is\r
-needed. The disadvantages are that writing to VGA is slower then writing\r
-to memory, and there may be large amounts of flicker.\r
-\r
-\r
-METHOD 3 :\r
-\r
-Step 1 : Set up one virtual screen, VADDR.\r
-Step 2 : Draw background to VADDR.\r
-Step 3 : Flip VADDR to VGA.\r
-Step 4 : Draw icon to VGA.\r
-Step 5 : Transfer background portion from VADDR to VGA.\r
-Step 6 : Repeat from step 4 continuously.\r
-\r
-In ascii ...\r
-\r
-     +---------+           +---------+\r
-     |         |           |         |\r
-     |   VGA   |           |  VADDR  |\r
-     |         |           | (bckgnd)|\r
-     | Icon>* <|-----------|--+      |\r
-     +---------+           +---------+\r
-\r
-The advantages are that writing from the virtual screen is quicker then\r
-from VGA, and there is less flicker then in Method 2. Disadvantages are\r
-that you are using a 64000 byte virtual screen, and flickering occurs\r
-with large numbers of objects.\r
-\r
-In the attached sample program, a mixture of Method 3 and Method 1 is\r
-used. It is faster then Method 1, and has no flicker, unlike Method 3.\r
-What I do is I use VADDR2 for background, but only restore the\r
-background that has been changed to VADDR, before flipping to VGA.\r
-\r
-In the sample program, you will see that I restore the entire background\r
-of each of the icons, and then place all the icons. This is because if I\r
-replace the background then place the icon on each object individually,\r
-if two objects are overlapping, one is partially overwritten.\r
-\r
-The following sections are explanations of how the various assembler\r
-routines work. This will probably be fairly boring for you if you\r
-already know assembler, but should help beginners and dabblers alike.\r
-\r
-\r
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
-þ  The ASM Putpixel\r
-\r
-To begin with, I will explain a few of the ASM variables and functions :\r
-\r
-<NOTE THAT THIS IS AN EXTREMELY SIMPLISTIC VIEW OF ASSEMBLY LANGUAGE!\r
-There are numerous books to advance your knowledge, and the Norton\r
-Guides assembler guide  may be invaluable for people beginning to code\r
-in assembler. I haven't given you the pretty pictures you are supposed\r
-to have to help you understand it easier, I have merely laid it out like\r
-a programming language with it's own special procedures. >\r
-\r
-There are 4 register variables : AX,BX,CX,DX. These are words (double\r
-bytes) with a range from 0 to 65535. You may access the high and low\r
-bytes of these by replacing the X with a "H" for high or "L" for low.\r
-For example, AL has a range from 0-255.\r
-\r
-You also have two pointers : ES:DI and DS:SI. The part on the left is\r
-the segment to which you are pointing (eg $a000), and the right hand\r
-part is the offset, which is how far into the segment you are pointing.\r
-Turbo Pascal places a variable over 16k into the base of a segment, ie.\r
-DI or SI will be zero at the start of the variable.\r
-\r
-If you wish to be pointing to pixel number 3000 on the VGA screen (see\r
-previous parts for the layout of the VGA screen), ES would be equal to\r
-$a000 and DI would be equal to 3000.  You can quite as easily make ES or\r
-DS be equal to the offset of a virtual screen.\r
-\r
-Here are a few functions that you will need to know :\r
-\r
-      mov   destination,source       This moves the value in source to\r
-                                     destination. eg  mov ax,50\r
-      add   destination,source       This adds source to destination,\r
-                                     the result being stored in destination\r
-      mul   source                   This multiplies AX by source. If\r
-                                     source is a byte, the source is\r
-                                     multiplied by AL, the result being\r
-                                     stored in AX. If source is a word,\r
-                                     the source is multiplied by AX, the\r
-                                     result being stored in DX:AX\r
-      movsb                          This moves the byte that DS:SI is\r
-                                     pointing to into ES:DI, and\r
-                                     increments SI and DI.\r
-      movsw                          Same as movsb except it moves a\r
-                                     word instead of a byte.\r
-      stosw                          This moves AX into ES:DI. stosb\r
-                                     moves AL into ES:DI. DI is then\r
-                                     incremented.\r
-      push register                  This saves the value of register by\r
-                                     pushing it onto the stack. The\r
-                                     register may then be altered, but\r
-                                     will be restored to it's original\r
-                                     value when popped.\r
-      pop register                   This restores the value of a pushed\r
-                                     register. NOTE : Pushed values must\r
-                                     be popped in the SAME ORDER but\r
-                                     REVERSED.\r
-      rep  command                   This repeats Command by as many\r
-                                     times as the value in CX\r
-\r
-\r
-SHL Destination,count      ;\r
-and SHR Destination,count  ;\r
-need a bit more explaining. As you know, computers think in ones and\r
-zeroes. Each number may be represented in this base 2 operation. A byte\r
-consists of 8 ones and zeroes (bits), and have a range from 0 to 255. A \r
-word consists of 16 ones and zeroes (bits), and has a range from 0 to \r
-65535. A double word consists of 32 bits.\r
-\r
-The number 53 may be represented as follows :  00110101.  Ask someone who\r
-looks clever to explain to you how to convert from binary to decimal and\r
-vice-versa.\r
-\r
-What happens if you shift everything to the left? Drop the leftmost\r
-number and add a zero to the right? This is what happens :\r
-\r
-                00110101     =  53\r
-                 <-----\r
-                01101010     =  106\r
-\r
-As you can see, the value has doubled! In the same way, by shifting one\r
-to the right, you halve the value! This is a VERY quick way of\r
-multiplying or dividing by 2. (note that for dividing by shifting, we\r
-get the trunc of the result ... ie.  15 shr 1 = 7)\r
-\r
-In assembler the format is SHL destination,count    This shifts\r
-destination by as many bits in count (1=*2, 2=*4, 3=*8, 4=*16 etc)\r
-Note that a shift takes only 2 clock cycles, while a mul can take up to 133\r
-clock cycles. Quite a difference, no? Only 286es or above may have count\r
-being greater then one.\r
-\r
-This is why to do the following to calculate the screen coordinates for\r
-a putpixel is very slow :\r
-\r
-           mov    ax,[Y]\r
-           mov    bx,320\r
-           mul    bx\r
-           add    ax,[X]\r
-           mov    di,ax\r
-\r
-But alas! I hear you cry. 320 is not a value you may shift by, as you\r
-may only shift by 2,4,8,16,32,64,128,256,512 etc.etc. The solution is\r
-very cunning. Watch.\r
-\r
-    mov     bx,[X]\r
-    mov     dx,[Y]\r
-    push    bx\r
-    mov     bx, dx                  {; bx = dx = Y}\r
-    mov     dh, dl                  {; dh = dl = Y}\r
-    xor     dl, dl                  {; These 2 lines equal dx*256 }\r
-    shl     bx, 1\r
-    shl     bx, 1\r
-    shl     bx, 1\r
-    shl     bx, 1\r
-    shl     bx, 1\r
-    shl     bx, 1                   {; bx = bx * 64}\r
-    add     dx, bx                  {; dx = dx + bx (ie y*320)}\r
-    pop     bx                      {; get back our x}\r
-    add     bx, dx                  {; finalise location}\r
-    mov     di, bx\r
-\r
-Let us have a look at this a bit closer shall we?\r
-bx=dx=y        dx=dx*256  ;   bx=bx*64     ( Note, 256+64 = 320 )\r
-\r
-dx+bx=Correct y value, just add X!\r
-\r
-As you can see, in assembler, the shortest code is often not the\r
-fastest.\r
-\r
-The complete putpixel procedure is as follows :\r
-\r
-Procedure Putpixel (X,Y : Integer; Col : Byte; where:word);\r
-  { This puts a pixel on the screen by writing directly to memory. }\r
-BEGIN\r
-  Asm\r
-    push    ds                      {; Make sure these two go out the }\r
-    push    es                      {; same they went in }\r
-    mov     ax,[where]\r
-    mov     es,ax                   {; Point to segment of screen }\r
-    mov     bx,[X]\r
-    mov     dx,[Y]\r
-    push    bx                      {; and this again for later}\r
-    mov     bx, dx                  {; bx = dx}\r
-    mov     dh, dl                  {; dx = dx * 256}\r
-    xor     dl, dl\r
-    shl     bx, 1\r
-    shl     bx, 1\r
-    shl     bx, 1\r
-    shl     bx, 1\r
-    shl     bx, 1\r
-    shl     bx, 1                   {; bx = bx * 64}\r
-    add     dx, bx                  {; dx = dx + bx (ie y*320)}\r
-    pop     bx                      {; get back our x}\r
-    add     bx, dx                  {; finalise location}\r
-    mov     di, bx                  {; di = offset }\r
-    {; es:di = where to go}\r
-    xor     al,al\r
-    mov     ah, [Col]\r
-    mov     es:[di],ah              {; move the value in ah to screen\r
-                                       point es:[di] }\r
-    pop     es\r
-    pop     ds\r
-  End;\r
-END;\r
-\r
-Note that with DI and SI, when you use them :\r
-      mov   di,50      Moves di to position 50\r
-      mov   [di],50    Moves 50 into the place di is pointing to\r
-\r
-\r
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
-þ  The Flip Procedure\r
-\r
-This is fairly straightforward. We get ES:DI to point to the start of\r
-the destination screen, and DS:SI to point to the start of the source\r
-screen, then do 32000 movsw (64000 bytes).\r
-\r
-procedure flip(source,dest:Word);\r
-  { This copies the entire screen at "source" to destination }\r
-begin\r
-  asm\r
-    push    ds\r
-    mov     ax, [Dest]\r
-    mov     es, ax                  { ES = Segment of source }\r
-    mov     ax, [Source]\r
-    mov     ds, ax                  { DS = Segment of source }\r
-    xor     si, si                  { SI = 0   Faster then mov si,0 }\r
-    xor     di, di                  { DI = 0 }\r
-    mov     cx, 32000\r
-    rep     movsw                   { Repeat movsw 32000 times }\r
-    pop     ds\r
-  end;\r
-end;\r
-\r
-The cls procedure works in much the same way, only it moves the color\r
-into AX then uses a rep stosw (see program for details)\r
-\r
-The PAL command is almost exactly the same as it's Pascal equivalent\r
-(see previous tutorials). Look in the sample code to see how it uses the\r
-out and in commands.\r
-\r
-\r
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
-þ  In Closing\r
-\r
-The assembler procedures presented to you in here are not at their best.\r
-Most of these are procedures ASPHYXIA abandoned for better ones after\r
-months of use. But, as you will soon see, they are all MUCH faster then\r
-the original Pascal equivalents I originally gave you. In future, I\r
-hope to give you more and more assembler procedures for your ever\r
-growing collections. But, as you know, I am not always very prompt with\r
-this series (I don't know if even one has been released within one week\r
-of the previous one), so if you want to get any stuff done, try do it\r
-yourself. What do you have to lose, aside from your temper and a few\r
-rather inventive reboots ;-)\r
-\r
-What should I do for the next trainer? A simple 3-d tutorial? You may\r
-not like it, because I would go into minute detail of how it works :)\r
-Leave me suggestions for future trainers by any of the means discussed\r
-at the top of this trainer.\r
-\r
-After the customary quote, I will place a listing of the BBSes I\r
-currently know that regularly carry this Trainer Series. If your BBS\r
-receives it regularly, no matter where in the country you are, get a\r
-message to me and I'll add it to the list. Let's make it more convenient\r
-for locals to grab a copy without calling long distance ;-)\r
-\r
-            [  There they sit, the preschooler class encircling their\r
-                  mentor, the substitute teacher.\r
-               "Now class, today we will talk about what you want to be\r
-                  when you grow up. Isn't that fun?" The teacher looks\r
-                  around and spots the child, silent, apart from the others\r
-                  and deep in thought. "Jonny, why don't you start?" she\r
-                  encourages him.\r
-               Jonny looks around, confused, his train of thought\r
-                  disrupted. He collects himself, and stares at the teacher\r
-                  with a steady eye. "I want to code demos," he says,\r
-                  his words becoming stronger and more confidant as he\r
-                  speaks. "I want to write something that will change\r
-                  peoples perception of reality. I want them to walk\r
-                  away from the computer dazed, unsure of their footing\r
-                  and eyesight. I want to write something that will\r
-                  reach out of the screen and grab them, making\r
-                  heartbeats and breathing slow to almost a halt. I want\r
-                  to write something that, when it is finished, they\r
-                  are reluctant to leave, knowing that nothing they\r
-                  experience that day will be quite as real, as\r
-                  insightful, as good. I want to write demos."\r
-               Silence. The class and the teacher stare at Jonny, stunned. It\r
-                  is the teachers turn to be confused. Jonny blushes,\r
-                  feeling that something more is required.  "Either that\r
-                  or I want to be a fireman."\r
-                                                                     ]\r
-                                                       - Grant Smith\r
-                                                            14:32\r
-                                                               21/11/93\r
-\r
-See you next time,\r
-  - DENTHOR\r
-\r
-These fine BBS's carry the ASPHYXIA DEMO TRAINER SERIES : (alphabetical)\r
-\r
-ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍËÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍËÍÍÍÍÍËÍÍÍËÍÍÍÍËÍÍÍÍ»\r
-ºBBS Name                  ºTelephone No.   ºOpen ºMsgºFileºPastº\r
-ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÎÍÍÍÍÍÎÍÍÍÎÍÍÍÍÎÍÍÍ͹\r
-ºASPHYXIA BBS #1           º(031) 765-5312  ºALL  º * º *  º *  º\r
-ºASPHYXIA BBS #2           º(031) 765-6293  ºALL  º * º *  º *  º\r
-ºConnectix BBS             º(031) 266-9992  ºALL  º * º *  º *  º\r
-ºFor Your Eyes Only BBS    º(031) 285-318   ºA/H  º * º *  º *  º\r
-ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÊÍÍÍÊÍÍÍÍÊÍÍÍͼ\r
-\r
-Open = Open at all times or only A/H\r
-Msg  = Available in message base\r
-File = Available in file base\r
-Past = Previous Parts available\r
-\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ TUTPROG7.PAS ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-{$X+}\r
-USES crt;\r
-\r
-CONST VGA = $a000;\r
-\r
-Type Toastinfo = Record                 { This is format of of each of our }\r
-                 x,y:integer;              { records for the flying toasters }\r
-                 speed,frame:integer;\r
-                 active:boolean;\r
-               END;\r
-\r
-     icon = Array [1..30*48] of byte;  { This is the size of our pictures }\r
-\r
-     Virtual = Array [1..64000] of byte;  { The size of our Virtual Screen }\r
-     VirtPtr = ^Virtual;                  { Pointer to the virtual screen }\r
-\r
-CONST frame1 : icon = (\r
-0,0,0,0,5,5,5,5,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,5,5,5,5,5,5,\r
-7,7,7,7,0,0,0,0,0,0,0,5,5,5,5,5,5,5,5,5,5,5,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,\r
-5,7,7,7,7,7,7,7,8,8,7,7,7,7,7,7,0,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,0,0,0,0,0,0,0,0,\r
-0,0,0,0,0,5,5,7,7,7,7,7,8,8,7,8,8,7,8,7,8,7,7,7,5,8,8,8,8,5,5,5,5,5,5,5,5,5,5,5,\r
-5,0,0,0,0,0,0,0,0,0,0,0,5,7,7,7,7,7,7,8,7,7,7,8,7,7,7,7,7,7,0,0,0,0,0,0,8,5,5,5,\r
-5,5,5,5,5,5,5,5,5,0,0,0,0,0,0,0,0,0,0,5,7,7,8,8,7,7,8,7,7,8,7,7,7,7,7,0,0,0,0,0,\r
-0,0,0,0,0,0,5,5,5,5,5,5,5,5,5,5,5,5,0,0,0,0,0,0,0,0,5,7,8,8,8,7,7,8,7,7,8,7,7,7,\r
-7,7,0,0,0,0,0,0,0,0,0,0,0,0,0,5,5,5,5,5,5,5,5,5,5,5,5,0,0,0,0,0,0,5,7,8,8,8,7,7,\r
-8,8,8,8,8,8,7,7,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,9,9,9,9,\r
-9,5,7,8,8,8,8,8,7,7,8,8,7,7,7,7,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,\r
-1,1,1,1,9,9,9,9,5,7,7,8,8,8,8,7,7,8,8,7,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,\r
-1,1,0,0,0,1,1,1,1,1,1,1,9,9,9,5,7,8,8,7,7,8,8,7,8,8,8,7,0,0,0,0,0,0,0,0,0,0,0,0,\r
-0,0,0,0,0,0,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,5,7,8,8,7,7,7,7,8,8,7,7,7,0,0,0,0,\r
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,1,1,1,1,1,1,2,2,2,2,7,8,8,8,8,8,8,8,7,\r
-7,7,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,1,1,1,1,1,1,2,2,2,2,7,\r
-7,7,7,7,7,7,7,7,2,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,1,1,1,\r
-1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,\r
-1,1,0,0,0,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,\r
-0,0,0,0,0,0,1,1,1,1,0,0,0,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,0,0,0,0,\r
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,\r
-2,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,1,1,1,1,1,1,2,2,2,2,2,\r
-2,2,2,2,2,2,2,2,2,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,1,1,1,\r
-1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,4,\r
-4,6,6,6,6,6,6,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,\r
-0,0,0,0,0,0,1,1,1,1,1,1,1,1,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,\r
-0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,3,3,1,1,1,1,9,9,9,9,9,9,9,9,9,9,9,9,\r
-9,9,9,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,9,9,9,9,\r
-9,9,9,9,9,9,9,9,9,9,9,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,\r
-1,1,1,1,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\r
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\r
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\r
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\r
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\r
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\r
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\r
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\r
-);\r
-      frame2 : icon = (\r
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\r
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\r
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\r
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\r
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\r
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\r
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\r
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\r
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,9,9,9,9,\r
-9,9,9,9,9,9,9,9,9,9,9,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,\r
-1,1,1,1,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,\r
-1,1,0,0,0,1,1,1,1,1,1,1,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,0,0,0,0,0,0,0,0,0,0,0,0,\r
-0,0,0,0,0,0,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,\r
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,\r
-2,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,1,1,1,1,1,1,2,2,2,2,5,\r
-5,5,5,5,5,5,5,2,2,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,1,1,1,\r
-1,1,1,2,2,2,2,2,5,5,5,5,5,5,5,5,5,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,\r
-1,1,0,0,0,1,1,1,1,1,1,2,2,2,2,2,2,5,5,5,5,5,5,5,5,5,2,0,0,0,0,0,0,0,0,0,0,0,0,0,\r
-0,0,0,0,0,5,1,1,1,1,0,0,0,1,1,1,1,1,1,2,2,2,2,2,2,2,2,5,5,5,5,5,5,5,5,0,0,0,0,0,\r
-0,0,0,0,0,0,0,0,0,0,0,0,5,5,1,1,1,1,0,0,0,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,5,5,5,5,\r
-5,5,5,5,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,5,5,1,1,1,1,0,0,0,1,1,1,1,1,1,2,2,2,2,2,\r
-2,2,2,2,2,5,5,5,5,5,5,5,5,5,0,0,0,0,0,0,0,0,0,0,0,0,0,5,1,1,1,1,1,1,0,0,0,1,1,1,\r
-1,1,1,2,2,2,2,2,2,2,2,2,2,2,5,5,5,5,5,5,5,5,0,0,0,0,0,0,0,0,0,0,0,0,0,5,1,7,1,4,\r
-4,6,6,6,6,6,6,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,5,5,5,5,5,5,5,5,0,0,0,0,0,0,0,0,0,0,\r
-0,0,0,5,5,1,1,1,1,1,1,1,1,1,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,5,5,5,5,5,5,5,5,0,0,\r
-0,0,0,0,0,0,0,0,0,0,0,5,5,1,1,1,1,1,1,1,1,1,3,3,1,1,1,1,9,9,9,9,9,9,9,9,9,9,5,5,\r
-5,5,5,5,5,5,5,0,0,0,0,0,0,0,0,0,0,0,0,0,5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,9,9,9,9,\r
-9,9,9,9,9,9,5,5,5,5,5,5,5,5,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,\r
-1,1,1,1,9,9,9,9,9,9,9,9,9,9,5,5,5,5,5,5,5,5,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,5,\r
-1,7,7,1,7,1,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,5,5,5,5,5,5,5,5,5,0,0,0,0,0,0,0,0,0,\r
-0,0,0,0,0,0,0,5,5,1,7,7,7,1,1,5,0,0,0,0,0,0,0,0,0,0,0,0,5,5,5,5,5,5,5,5,5,5,5,0,\r
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,5,1,1,5,5,5,5,0,0,0,0,0,0,0,0,0,0,5,5,5,5,5,5,\r
-5,5,5,5,5,5,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,5,5,0,0,0,0,0,0,0,0,0,0,0,\r
-0,0,5,5,5,5,5,5,5,5,5,5,5,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\r
-0,0,0,0,0,0,0,0,0,0,5,5,5,5,5,5,5,5,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\r
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,5,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\r
-);\r
-      frame3 : icon = (\r
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\r
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\r
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\r
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\r
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\r
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\r
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\r
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\r
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,9,9,9,9,\r
-9,9,9,9,9,9,9,5,5,5,5,5,5,5,0,0,0,0,0,0,0,0,0,0,0,0,0,7,7,1,1,1,1,1,1,1,1,1,1,1,\r
-1,1,1,1,9,9,9,9,9,9,9,9,9,5,5,5,5,5,5,5,5,5,5,5,0,0,0,0,0,0,0,0,0,0,7,1,1,1,1,1,\r
-1,1,0,0,0,1,1,1,1,1,1,1,9,9,9,9,9,9,9,5,5,5,5,5,5,5,5,5,5,5,5,5,0,0,0,0,0,0,0,0,\r
-0,7,1,1,7,7,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,5,5,5,1,7,7,7,7,5,5,5,5,5,5,\r
-5,0,0,0,0,0,0,0,7,1,7,7,7,1,1,1,1,1,0,0,0,1,1,1,1,1,1,2,2,2,2,2,2,5,5,1,1,1,7,7,\r
-1,1,7,5,5,5,5,5,5,5,0,0,0,0,0,0,1,1,7,1,1,7,1,1,1,1,0,0,0,1,1,1,1,1,1,2,2,2,2,2,\r
-2,1,7,7,7,1,7,7,7,7,7,5,5,5,5,5,5,5,5,0,0,0,0,0,1,7,7,7,7,1,1,1,1,1,0,0,0,1,1,1,\r
-1,1,1,2,2,2,2,2,2,1,7,7,7,7,7,7,7,1,1,5,5,5,5,5,5,5,5,5,0,0,0,0,7,7,1,7,1,7,1,1,\r
-1,1,0,0,0,1,1,1,1,1,1,2,2,2,2,2,2,2,1,1,1,1,1,1,2,2,5,5,5,5,5,5,5,5,5,5,5,0,0,0,\r
-7,7,7,7,7,1,1,1,1,1,0,0,0,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,5,5,5,5,5,5,\r
-5,5,5,5,5,0,0,0,7,7,0,0,7,7,1,1,1,1,0,0,0,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,\r
-2,2,5,5,0,0,5,5,0,5,5,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,1,1,1,1,1,1,2,2,2,2,2,\r
-2,2,2,2,2,2,2,2,2,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,1,1,1,\r
-1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,4,\r
-4,6,6,6,6,6,6,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,\r
-0,0,0,0,0,0,1,1,1,1,1,1,1,1,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,\r
-0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,3,3,1,1,1,1,9,9,9,9,9,9,9,9,9,9,9,9,\r
-9,9,9,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,9,9,9,9,\r
-9,9,9,9,9,9,9,9,9,9,9,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,\r
-1,1,1,1,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\r
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\r
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\r
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\r
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\r
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\r
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\r
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\r
-);\r
-\r
-\r
-VAR Virscr : VirtPtr;                      { Our first Virtual screen }\r
-    VirScr2 : VirtPtr;                     { Our second Virtual screen }\r
-    Vaddr  : word;                      { The segment of our virtual screen}\r
-    Vaddr2 : Word;                      { The segment of our 2nd virt. screen}\r
-    ourpal : Array [0..255,1..3] of byte; { A virtual pallette }\r
-    toaster : Array [1..10] of toastinfo; { The toaster info }\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure SetMCGA;  { This procedure gets you into 320x200x256 mode. }\r
-BEGIN\r
-  asm\r
-     mov        ax,0013h\r
-     int        10h\r
-  end;\r
-END;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure SetText;  { This procedure returns you to text mode.  }\r
-BEGIN\r
-  asm\r
-     mov        ax,0003h\r
-     int        10h\r
-  end;\r
-END;\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure Cls (Col : Byte; Where:word);\r
-   { This clears the screen to the specified color }\r
-BEGIN\r
-     asm\r
-        push    es\r
-        mov     cx, 32000;\r
-        mov     es,[where]\r
-        xor     di,di\r
-        mov     al,[col]\r
-        mov     ah,al\r
-        rep     stosw\r
-        pop     es\r
-     End;\r
-END;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure Putpixel (X,Y : Integer; Col : Byte; where:word);\r
-  { This puts a pixel on the screen by writing directly to memory. }\r
-BEGIN\r
-  Asm\r
-    push    ds\r
-    push    es\r
-    mov     ax,[where]\r
-    mov     es,ax\r
-    mov     bx,[X]\r
-    mov     dx,[Y]\r
-    push    bx                      {; and this again for later}\r
-    mov     bx, dx                  {; bx = dx}\r
-    mov     dh, dl                  {; dx = dx * 256}\r
-    xor     dl, dl\r
-    shl     bx, 1\r
-    shl     bx, 1\r
-    shl     bx, 1\r
-    shl     bx, 1\r
-    shl     bx, 1\r
-    shl     bx, 1                   {; bx = bx * 64}\r
-    add     dx, bx                  {; dx = dx + bx (ie y*320)}\r
-    pop     bx                      {; get back our x}\r
-    add     bx, dx                  {; finalise location}\r
-    mov     di, bx\r
-    {; es:di = where to go}\r
-    xor     al,al\r
-    mov     ah, [Col]\r
-    mov     es:[di],ah\r
-    pop     es\r
-    pop     ds\r
-  End;\r
-END;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-procedure WaitRetrace; assembler;\r
-  {  This waits for a vertical retrace to reduce snow on the screen }\r
-label\r
-  l1, l2;\r
-asm\r
-    mov dx,3DAh\r
-l1:\r
-    in al,dx\r
-    and al,08h\r
-    jnz l1\r
-l2:\r
-    in al,dx\r
-    and al,08h\r
-    jz  l2\r
-end;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure Pal(Col,R,G,B : Byte);\r
-  { This sets the Red, Green and Blue values of a certain color }\r
-Begin\r
-   asm\r
-      mov    dx,3c8h\r
-      mov    al,[col]\r
-      out    dx,al\r
-      inc    dx\r
-      mov    al,[r]\r
-      out    dx,al\r
-      mov    al,[g]\r
-      out    dx,al\r
-      mov    al,[b]\r
-      out    dx,al\r
-   end;\r
-End;\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure GetPal(Col : Byte; Var R,G,B : Byte);\r
-  { This gets the Red, Green and Blue values of a certain color }\r
-Var\r
-   rr,gg,bb : Byte;\r
-Begin\r
-   asm\r
-      mov    dx,3c7h\r
-      mov    al,col\r
-      out    dx,al\r
-\r
-      add    dx,2\r
-\r
-      in     al,dx\r
-      mov    [rr],al\r
-      in     al,dx\r
-      mov    [gg],al\r
-      in     al,dx\r
-      mov    [bb],al\r
-   end;\r
-   r := rr;\r
-   g := gg;\r
-   b := bb;\r
-end;\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure SetUpVirtual;\r
-   { This sets up the memory needed for the virtual screen }\r
-BEGIN\r
-  GetMem (VirScr,64000);\r
-  vaddr := seg (virscr^);\r
-  GetMem (VirScr2,64000);\r
-  vaddr2 := seg (virscr2^);\r
-END;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure ShutDown;\r
-   { This frees the memory used by the virtual screen }\r
-BEGIN\r
-  FreeMem (VirScr,64000);\r
-  FreeMem (VirScr2,64000);\r
-END;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-procedure flip(source,dest:Word);\r
-  { This copies the entire screen at "source" to destination }\r
-begin\r
-  asm\r
-    push    ds\r
-    mov     ax, [Dest]\r
-    mov     es, ax\r
-    mov     ax, [Source]\r
-    mov     ds, ax\r
-    xor     si, si\r
-    xor     di, di\r
-    mov     cx, 32000\r
-    rep     movsw\r
-    pop     ds\r
-  end;\r
-end;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure putico(X,Y:Word;VAR sprt : icon;Where:Word); ASSEMBLER;\r
-  { This puts an icon, EXCEPT it's color 0 (black) pixels, onto the screen\r
-    "where", at position X,Y }\r
-label\r
-  _Redraw, _DrawLoop, _Exit, _LineLoop, _NextLine, _Store, _NoPaint;\r
-\r
-asm\r
-    push  ds\r
-    push  es\r
-    lds   si,Sprt\r
-    mov   ax,X     { ax = x }\r
-    mov   bx,Y     { bx = y }\r
-_Redraw:\r
-    push    ax\r
-    mov     ax,[where]\r
-    mov     es,ax\r
-\r
-    mov     ax, bx                  {; ax = bx  x = y}\r
-    mov     bh, bl                  {; y = y * 256  bx = bx * 256}\r
-    xor     bl, bl\r
-    shl     ax, 1\r
-    shl     ax, 1\r
-    shl     ax, 1\r
-    shl     ax, 1\r
-    shl     ax, 1\r
-    shl     ax, 1                   {; y = y * 64   ax = ax * 64}\r
-    add     bx, ax                  {; y = (y*256) + (Y*64)  bx = bx + ax (ie y*320)}\r
-\r
-    pop     ax                      {; get back our x}\r
-\r
-\r
-    add     ax, bx                  {; finalise location}\r
-    mov     di, ax\r
-\r
-    mov   dl,30    { dl = height of sprite }\r
-    xor   ch,ch\r
-    mov   cl,48     { cx = width of sprite }\r
-    cld\r
-    push  ax\r
-    mov   ax,cx\r
-_DrawLoop:\r
-    push  di            { store y adr. for later }\r
-    mov   cx,ax          { store width }\r
-_LineLoop:\r
-    mov   bl,byte ptr [si]\r
-    or    bl,bl\r
-    jnz   _Store\r
-_NoPaint:\r
-    inc    si\r
-    inc    di\r
-    loop   _LineLoop\r
-    jmp    _NextLine\r
-_Store:\r
-    movsb\r
-    loop  _LineLoop\r
-_NextLine:\r
-    pop   di\r
-    dec   dl\r
-    jz    _Exit\r
-    add   di,320        { di = next line of sprite }\r
-    jmp   _DrawLoop\r
-_Exit:\r
-    pop   ax\r
-    pop   es\r
-    pop   ds\r
-end;\r
-\r
-\r
-\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure Funny_line(a,b,c,d:integer;where:word);\r
-  { This procedure draws a line from a,b to c,d on screen "where". After\r
-    each pixel it plots, it increments a color counter for the next pixel.\r
-    you may easily alter this to be a normal line procedure, and it will\r
-    be quite a bit faster than the origional one I gave you. This is\r
-    because I replaced all the reals with integers. }\r
-\r
-  function sgn(a:real):integer;\r
-  begin\r
-       if a>0 then sgn:=+1;\r
-       if a<0 then sgn:=-1;\r
-       if a=0 then sgn:=0;\r
-  end;\r
-var i,s,d1x,d1y,d2x,d2y,u,v,m,n:integer;\r
-    count:integer;\r
-begin\r
-     count:=50;\r
-     u:= c - a;\r
-     v:= d - b;\r
-     d1x:= SGN(u);\r
-     d1y:= SGN(v);\r
-     d2x:= SGN(u);\r
-     d2y:= 0;\r
-     m:= ABS(u);\r
-     n := ABS(v);\r
-     IF NOT (M>N) then\r
-     BEGIN\r
-          d2x := 0 ;\r
-          d2y := SGN(v);\r
-          m := ABS(v);\r
-          n := ABS(u);\r
-     END;\r
-     s := m shr 1;\r
-     FOR i := 0 TO m DO\r
-     BEGIN\r
-          putpixel(a,b,count,where);\r
-          inc (count);\r
-          if count=101 then count:=50;\r
-          s := s + n;\r
-          IF not (s<m) THEN\r
-          BEGIN\r
-               s := s - m;\r
-               a:= a + d1x;\r
-               b := b + d1y;\r
-          END\r
-          ELSE\r
-          BEGIN\r
-               a := a + d2x;\r
-               b := b + d2y;\r
-          END;\r
-     end;\r
-END;\r
-\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure SetUpScreen;\r
-  { This procedure sets up the static background to be used in the program }\r
-\r
-CONST circ : Array [1..5,1..5] of byte =\r
-        ((0,10,10,10,0),\r
-         (10,13,12,11,10),\r
-         (10,12,12,11,10),\r
-         (10,11,11,11,10),\r
-         (0,10,10,10,0));\r
-\r
-VAR x,y:integer;\r
-    loop1,loop2,loop3:integer;\r
-\r
-BEGIN\r
-  pal (1,22,22,22);\r
-  pal (2,45,45,45);\r
-  pal (3,59,59,59);\r
-  pal (4,63,63,27);\r
-  pal (5,39,63,3);\r
-  pal (6,51,39,3);\r
-  pal (7,3,27,3);\r
-  pal (8,15,39,15);\r
-  pal (9,35,35,35);\r
-  pal (10, 0, 0,40);\r
-  pal (11,10,10,50);\r
-  pal (12,20,20,60);\r
-  pal (13,30,30,63);\r
-\r
-  For loop1:=50 to 100 do\r
-    pal (loop1,0,0,loop1-36);\r
-\r
-  For loop1:=0 to 255 do\r
-     getpal (loop1,OurPal[loop1,1],OurPal[loop1,2],OurPal[loop1,3]);\r
-\r
-  For loop1:=0 to 319 do\r
-    Funny_line (0,199,loop1,0,vaddr);\r
-  For loop1:=0 to 199 do\r
-    Funny_line (0,199,319,loop1,vaddr);\r
-\r
-  For loop1:=1 to 200 do BEGIN\r
-    x:=random (315);\r
-    y:=random (195);\r
-    For loop2:=1 to 5 do\r
-      For loop3:=1 to 5 do\r
-        if circ [loop2,loop3]<>0 then\r
-          putpixel (x+loop2,y+loop3,circ [loop2,loop3],vaddr);\r
-  END;\r
-  flip (vaddr,vga);  { Copy the entire screen at vaddr, our virtual screen }\r
-                     { on which we have done all our graphics, onto the    }\r
-                     { screen you see, VGA }\r
-  flip (vaddr,vaddr2);\r
-END;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure rotatepal;\r
-  { This procedure rotates the colors between 50 and 100 }\r
-VAR temp : Array [1..3] of byte;\r
-    loop1:integer;\r
-BEGIN\r
-  Move(OurPal[100],Temp,3);\r
-  Move(OurPal[50],OurPal[51],50*3);\r
-  Move(Temp,OurPal[50],3);\r
-  For loop1:=50 to 100 do\r
-    pal (loop1,OurPal[loop1,1],OurPal[loop1,2],OurPal[loop1,3]);\r
-END;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure ScreenTrans (x,y:word);\r
-  { This is a small procedure to copy a 30x30 pixel block from coordinates\r
-    x,y on the virtual screen to coordinates x,y on the true vga screen }\r
-BEGIN\r
-  asm\r
-    push    ds\r
-    push    es\r
-    mov     ax,vaddr\r
-    mov     es,ax\r
-    mov     ax,vaddr2\r
-    mov     ds,ax\r
-    mov     bx,[X]\r
-    mov     dx,[Y]\r
-    push    bx                      {; and this again for later}\r
-    mov     bx, dx                  {; bx = dx}\r
-    mov     dh, dl                  {; dx = dx * 256}\r
-    xor     dl, dl\r
-    shl     bx, 1\r
-    shl     bx, 1\r
-    shl     bx, 1\r
-    shl     bx, 1\r
-    shl     bx, 1\r
-    shl     bx, 1                   {; bx = bx * 64}\r
-    add     dx, bx                  {; dx = dx + bx (ie y*320)}\r
-    pop     bx                      {; get back our x}\r
-    add     bx, dx                  {; finalise location}\r
-    mov     di, bx                  {; es:di = where to go}\r
-    mov     si, di\r
-    mov     al,60\r
-    mov     bx, 30         { Hight of block to copy }\r
-@@1 :\r
-    mov     cx, 24         { Width of block to copy divided by 2 }\r
-    rep     movsw\r
-    add     di,110h        { 320 - 48 = 272 .. or 110 in hex }\r
-    add     si,110h\r
-    dec     bx\r
-    jnz     @@1\r
-\r
-    pop     es\r
-    pop     ds\r
-  end;\r
-  { I wrote this procedure late last night, so it may not be in it's\r
-    most optimised state. Sorry :-)}\r
-END;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure NewToaster;\r
-  { This adds a new toaster to the screen }\r
-VAR loop1:integer;\r
-BEGIN\r
-  loop1:=0;\r
-  repeat\r
-    inc (loop1);\r
-    if not (toaster[loop1].active) then BEGIN\r
-      toaster[loop1].x:=random (200)+70;\r
-      toaster[loop1].y:=0;\r
-      toaster[loop1].active:=true;\r
-      toaster[loop1].frame:=1;\r
-      toaster[loop1].speed:=Random (3)+1;\r
-      loop1:=10;\r
-    END;\r
-  until loop1=10;\r
-END;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure Fly;\r
-  { This is the procedure where we move and put the toasters }\r
-VAR loop1,loop2:integer;\r
-    ch:char;\r
-BEGIN\r
-  For loop1:=1 to 10 do\r
-    toaster[loop1].active:=FALSE;\r
-  ch:=#0;\r
-  NewToaster;\r
-  Repeat\r
-    if keypressed then BEGIN\r
-      ch:=readkey;\r
-      if ch='+' then NewToaster;      { If '+' is pressed, add a toaster }\r
-      if ch='-' then BEGIN            { if '-' is pressed, remove a toaster }\r
-        loop1:=0;\r
-        repeat\r
-          inc (loop1);\r
-          if toaster[loop1].active then BEGIN\r
-            screentrans (toaster[loop1].x,toaster[loop1].y);\r
-            toaster [loop1].active:=FALSE;\r
-            loop1:=10;\r
-          END;\r
-        until loop1=10;\r
-      END;\r
-    END;\r
-    for loop1:=1 to 10 do\r
-      if toaster[loop1].active then BEGIN\r
-        screentrans (toaster[loop1].x,toaster[loop1].y);\r
-          { Restore the backgrond the toaster was over }\r
-        dec (toaster[loop1].x,toaster[loop1].speed);\r
-        inc (toaster[loop1].y,toaster[loop1].speed);\r
-          { Move the toaster }\r
-        if (toaster[loop1].x<1) or (toaster[loop1].y>170) then BEGIN\r
-          toaster[loop1].active:=FALSE;\r
-          NewToaster;\r
-        END;\r
-          { When toaster reaches the edge of the screen, render it inactive\r
-            and bring a new one into existance. }\r
-      END;\r
-    for loop1:=1 to 10 do\r
-      if toaster[loop1].active then BEGIN\r
-        CASE toaster [loop1].frame of\r
-           1   : putico (toaster[loop1].x,toaster[loop1].y,frame1,vaddr);\r
-           3   : putico (toaster[loop1].x,toaster[loop1].y,frame2,vaddr);\r
-           2,4 : putico (toaster[loop1].x,toaster[loop1].y,frame3,vaddr);\r
-        END;\r
-        toaster[loop1].frame:=toaster[loop1].frame+1;\r
-        if toaster [loop1].frame=5 then toaster[loop1].frame:=1;\r
-          { Draw all the toasters on the VGA screen }\r
-      END;\r
-    waitretrace;\r
-    flip (vaddr,vga);\r
-    rotatepal;\r
-  Until ch=#27;\r
-END;\r
-\r
-\r
-BEGIN\r
-  Randomize;       { Make sure that the RANDOM funcion really is random }\r
-  SetupVirtual;    { Set up virtual page, VADDR }\r
-  ClrScr;\r
-  writeln ('Hello! This program will demonstrate the principals of animation.');\r
-  writeln ('The program will firstly generate an arb background screen to a');\r
-  writeln ('virtual page, then flip it to the VGA. A toaster will then start');\r
-  writeln ('to move across the screen. Note that the background will be restored');\r
-  writeln ('after the toaster has passed over it. You may add or remove toasters');\r
-  writeln ('by hitting "+" or "-" respectively. Note that the more frames you');\r
-  writeln ('use, usually the better the routine looks. Because of space');\r
-  writeln ('restrictions, we only had room for three frames.');\r
-  writeln;\r
-  writeln ('The toasters were drawn by Fubar (Pieter Buys) in Autodesk Animator.');\r
-  writeln ('I wrote a small little program to convert them into CONSTANTS. See');\r
-  writeln ('the main text to find out how to load up AA CEL files directly.');\r
-  writeln;\r
-  writeln;\r
-  Write ('  Hit any key to contine ...');\r
-  Readkey;\r
-  SetMCGA;\r
-  SetupScreen;     { Draw the background screen to VADDR, then flip it to\r
-                     the VGA screen }\r
-  Fly;             { Make the toasters fly around the screen }\r
-  SetText;\r
-  ShutDown;        { Free the memory taken up by virtual page }\r
-  Writeln ('All done. This concludes the seventh sample program in the ASPHYXIA');\r
-  Writeln ('Training series. You may reach DENTHOR under the names of GRANT');\r
-  Writeln ('SMITH/DENTHOR/ASPHYXIA on the ASPHYXIA BBS. I am also an avid');\r
-  Writeln ('Connectix BBS user, which is unfortunatly offline for the moment.');\r
-  Writeln ('For discussion purposes, I am also the moderator of the Programming');\r
-  Writeln ('newsgroup on the For Your Eyes Only BBS.');\r
-  Writeln ('The numbers are available in the main text. You may also write to me at:');\r
-  Writeln ('             Grant Smith');\r
-  Writeln ('             P.O. Box 270');\r
-  Writeln ('             Kloof');\r
-  Writeln ('             3640');\r
-  Writeln ('I hope to hear from you soon!');\r
-  Writeln; Writeln;\r
-  Write   ('Hit any key to exit ...');\r
-  Readkey;\r
-END.\r
diff --git a/16/PCGPE10/TUT8.TXT b/16/PCGPE10/TUT8.TXT
deleted file mode 100644 (file)
index abea384..0000000
+++ /dev/null
@@ -1,792 +0,0 @@
-                   ÕÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͸\r
-                   ³         W E L C O M E         ³\r
-                   ³  To the VGA Trainer Program   ³ ³\r
-                   ³              By               ³ ³\r
-                   ³      DENTHOR of ASPHYXIA      ³ ³ ³\r
-                   ÔÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ; ³ ³\r
-                     ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ ³\r
-                       ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-                           --==[ PART 8 ]==--\r
-\r
-\r
-\r
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
-þ Introduction\r
-\r
-Hello everybody! Christmas is over, the last of the chocolates have been\r
-eaten, so it's time to get on with this, the eighth part of the ASPHYXIA\r
-Demo Trainer Series. This particular part is primarily about 3-D, but\r
-also includes a bit on optimisation.\r
-\r
-If you are already a 3-D guru, you may as well skip this text file, have\r
-a quick look at the sample program then go back to sleep, because I am\r
-going to explain in minute detail exactly how the routines work ;)\r
-\r
-If you would like to contact me, or the team, there are many ways you\r
-can do it : 1) Write a message to Grant Smith/Denthor/Asphyxia in private mail\r
-                  on the ASPHYXIA BBS.\r
-            2) Write a message in the Programming conference on the\r
-                  For Your Eyes Only BBS (of which I am the Moderator )\r
-                  This is preferred if you have a general programming query\r
-                  or problem others would benefit from.\r
-            4) Write to Denthor, EzE or Goth on Connectix.\r
-            5) Write to :  Grant Smith\r
-                           P.O.Box 270 Kloof\r
-                           3640\r
-                           Natal\r
-            6) Call me (Grant Smith) at (031) 73 2129 (leave a message if you\r
-                  call during varsity)\r
-            7) Write to mcphail@beastie.cs.und.ac.za on InterNet, and\r
-                  mention the word Denthor near the top of the letter.\r
-\r
-NB : If you are a representative of a company or BBS, and want ASPHYXIA\r
-       to do you a demo, leave mail to me; we can discuss it.\r
-NNB : If you have done/attempted a demo, SEND IT TO ME! We are feeling\r
-        quite lonely and want to meet/help out/exchange code with other demo\r
-        groups. What do you have to lose? Leave a message here and we can work\r
-        out how to transfer it. We really want to hear from you!\r
-\r
-\r
-\r
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
-þ Optimisation\r
-\r
-Before I begin with the note on 3-D, I would like to stress that many of\r
-these routines, and probably most of your own, could be sped up quite a\r
-bit with a little optimisation. One must realise, however, that you must\r
-take a look at WHAT to optimise ... converting a routine that is only\r
-called once at startup into a tightly coded assembler routine may show\r
-off your merits as a coder, but does absolutely nothing to speed up your\r
-program. Something that is called often per frame is something that\r
-needs to be as fast as possible. For some, a much used procedure is the\r
-PutPixel procedure. Here is the putpixel procedure I gave you last week:\r
-\r
-Procedure Putpixel (X,Y : Integer; Col : Byte; where:word);\r
-BEGIN\r
-  Asm\r
-    push    ds                      { 14   clock ticks }\r
-    push    es                      { 14 }\r
-    mov     ax,[where]              { 8  }\r
-    mov     es,ax                   { 2 }\r
-    mov     bx,[X]                  { 8  }\r
-    mov     dx,[Y]                  { 8  }\r
-    push    bx                      { 15 }\r
-    mov     bx, dx                  { 2  }\r
-    mov     dh, dl                  { 2  }\r
-    xor     dl, dl                  { 3  }\r
-    shl     bx, 1                   { 2  }\r
-    shl     bx, 1                   { 2  }\r
-    shl     bx, 1                   { 2  }\r
-    shl     bx, 1                   { 2  }\r
-    shl     bx, 1                   { 2  }\r
-    shl     bx, 1                   { 2  }\r
-    add     dx, bx                  { 3  }\r
-    pop     bx                      { 12 }\r
-    add     bx, dx                  { 3  }\r
-    mov     di, bx                  { 2 }\r
-    xor     al,al                   { 3  }\r
-    mov     ah, [Col]               { 8  }\r
-    mov     es:[di],ah              { 10 }\r
-    pop     es                      { 12 }\r
-    pop     ds                      { 12 }\r
-  End;\r
-END;\r
-                            Total = 153 clock ticks\r
-NOTE : Don't take my clock ticks as gospel, I probably got one or two\r
-       wrong.\r
-\r
-Right, now for some optimising. Firstly, if you have 286 instructions\r
-turned on, you may replace the 6 shl,1 with shl,6. Secondly, the Pascal\r
-compiler automatically pushes and pops ES, so those two lines may be\r
-removed. DS:[SI] is not altered in this procedure, so we may remove\r
-those too. Also, instead of moving COL into ah, we move it into AL and\r
-call stosb (es:[di]:=al; inc di). Let's have a look at the routine now :\r
-\r
-Procedure Putpixel (X,Y : Integer; Col : Byte; where:word);\r
-BEGIN\r
-  Asm\r
-    mov     ax,[where]              { 8  }\r
-    mov     es,ax                   { 2 }\r
-    mov     bx,[X]                  { 8  }\r
-    mov     dx,[Y]                  { 8  }\r
-    push    bx                      { 15 }\r
-    mov     bx, dx                  { 2  }\r
-    mov     dh, dl                  { 2  }\r
-    xor     dl, dl                  { 3  }\r
-    shl     bx, 6                   { 8  }\r
-    add     dx, bx                  { 3  }\r
-    pop     bx                      { 12 }\r
-    add     bx, dx                  { 3  }\r
-    mov     di, bx                  { 2 }\r
-    mov     al, [Col]               { 8  }\r
-    stosb                           { 11 }\r
-  End;\r
-END;\r
-                            Total = 95 clock ticks\r
-\r
-Now, let us move the value of BX directly into DI, thereby removing a\r
-costly push and pop. The MOV and the XOR of DX can be replaced by it's\r
-equivalent, SHL DX,8\r
-\r
-Procedure Putpixel (X,Y : Integer; Col : Byte; where:word); assembler;\r
-asm\r
-    mov     ax,[where]              { 8  }\r
-    mov     es,ax                   { 2  }\r
-    mov     bx,[X]                  { 8  }\r
-    mov     dx,[Y]                  { 8  }\r
-    mov     di,bx                   { 2  }\r
-    mov     bx, dx                  { 2  }\r
-    shl     dx, 8                   { 8  }\r
-    shl     bx, 6                   { 8  }\r
-    add     dx, bx                  { 3  }\r
-    add     di, dx                  { 3  }\r
-    mov     al, [Col]               { 8  }\r
-    stosb                           { 11 }\r
-end;\r
-                            Total = 71 clock ticks\r
-\r
-As you can see, we have brought the clock ticks down from 153 ticks to\r
-71 ticks ... quite an improvement. (The current ASPHYXIA putpixel takes\r
-48 clock ticks) . As you can see, by going through your routines a few\r
-times, you can spot and remove unnecessary instructions, thereby greatly\r
-increasing the speed of your program.\r
-\r
-\r
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
-þ Defining a 3-D object\r
-\r
-Drawing an object in 3-D is not that easy. Sitting down and plotting a\r
-list of X,Y and Z points can be a time consuming business. So, let us\r
-first look at the three axes you are drawing them on :\r
-\r
-                    Y    Z\r
-                   /|\  /\r
-                    | /\r
-             X<-----|----->\r
-                    |\r
-                   \|/\r
-\r
-X is the horisontal axis, from left to right. Y is the vertical axis,\r
-from top to bottom. Z is the depth, going straight into the screen.\r
-\r
-In this trainer, we are using lines, so we define 2 X,Y and Z\r
-coordinates, one for each end of the line. A line from far away, in the\r
-upper left of the X and Y axes, to close up in the bottom right of the\r
-X and Y axes, would look like this :\r
-\r
-{       x1 y1  z1   x2  y2 z2    }\r
-    ( (-10,10,-10),(10,-10,10) )\r
-\r
-\r
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
-þ Rotating a point with matrixes\r
-\r
-NOTE : I thought that more then one matix are matrisese (sp), but my \r
-       spellchecker insists it is matrixes, so I let it have it's way \r
-       ;-)\r
-\r
-Having a 3-D object is useless unless you can rotate it some way. For\r
-demonstration purposes, I will begin by working in two dimensions, X and\r
-Y.\r
-\r
-Let us say you have a point, A,B, on a graph.\r
-                      Y\r
-                      |  /O1 (Cos (a)*A-Sin (a)*B , Sin (a)*A+Cos (a)*B)\r
-                      |/      (A,B)\r
-               X<-----|------O-->\r
-                      |\r
-                      |\r
-\r
-Now, let us say we rotate this point by 45 degrees anti-clockwise. The\r
-new A,B can be easily be calculated using sin and cos, by an adaption of\r
-our circle algorithm, ie.\r
-           A2:=Cos (45)*A - Sin (45)*B\r
-           B2:=Sin (45)*A + Cos (45)*B\r
-I recall that in standard 8 and 9, we went rather heavily into this in\r
-maths. If you have troubles, fine a 8/9/10 maths book and have a look;\r
-it will go through the proofs etc.\r
-\r
-Anyway, we have now rotated an object in two dimensions, AROUND THE Z\r
-AXIS. In matrix form, the equation looks like this :\r
-\r
-   [  Cos (a)   -Sin (a)      0        0     ]    [  x ]\r
-   [  Sin (a)    Cos (a)      0        0     ]  . [  y ]\r
-   [     0         0          1        0     ]    [  z ]\r
-   [     0         0          0        1     ]    [  1 ]\r
-\r
-I will not go to deeply into matrixes math at this stage, as there are\r
-many books on the subject (it is not part of matric maths, however). To\r
-multiply a matrix, to add the products of the row of the left matrix and\r
-the column of the right matrix, and repeat this for all the columns of the\r
-left matrix. I don't explain it as well as my first year maths lecturer,\r
-but have a look at how I derived A2 and B2 above. Here are the other\r
-matrixes :\r
-\r
-Matrix for rotation around the Y axis :\r
-   [  Cos (a)      0       -Sin (a)    0     ]    [  x ]\r
-   [     0         1          0        0     ]  . [  y ]\r
-   [  Sin (a)      0        Cos (a)    0     ]    [  z ]\r
-   [     0         0          0        1     ]    [  1 ]\r
-\r
-Matrix for rotation around the X axis :\r
-   [     1         0                   0     ]    [  x ]\r
-   [     0       Cos (a)   -Sin (a)    0     ]  . [  y ]\r
-   [     0       Sin (a)    Cos (a)    0     ]    [  z ]\r
-   [     0         0          0        1     ]    [  1 ]\r
-\r
-By putting all these matrixes together, we can translate out 3D points\r
-around the origin of 0,0,0. See the sample program for how we put them\r
-together.\r
-\r
-In the sample program, we have a constant, never changing base object.\r
-This is rotated into a second variable, which is then drawn. I am sure\r
-many of you can thing of cool ways to change the base object, the\r
-effects of which will appear while the object is rotating. One idea is\r
-to "pulsate" a certain point of the object according to the beat of the\r
-music being played in the background. Be creative. If you feel up to it,\r
-you could make your own version of transformers ;)\r
-\r
-\r
-\r
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
-þ Drawing a 3D point to screen\r
-\r
-Having a rotated 3D object is useless unless we can draw it to screen.\r
-But how do we show a 3D point on a 2D screen? The answer needs a bit of\r
-explaining. Examine the following diagram :\r
-\r
-              |         ________-------------\r
-          ____|___------      o Object at X,Y,Z     o1 Object at X,Y,Z2\r
- Eye -> O)____|___\r
-              |   ------________\r
-              |                 -------------- Field of vision\r
-            Screen\r
-\r
-Let us pretend that the centre of the screen is the horizon of our\r
-little 3D world. If we draw a three dimensional line from object "o" to\r
-the centre of the eye, and place a pixel on the X and Y coordinates\r
-where it passes through the screen, we will notice that when we do the\r
-same with object o1, the pixel is closer to the horizon, even though\r
-their 3D X and Y coords are identical, but "o1"'s Z is larger then\r
-"o"'s. This means that the further away a point is, the closer to the\r
-horizon it is, or the smaller the object will appear. That sounds\r
-right, doesent it? But, I hear you cry, how do we translate this into a\r
-formula? The answer is quite simple. Divide your X and your Y by your Z.\r
-Think about it. The larger the number you divide by, the closer to zero,\r
-or the horizon, is the result! This means, the bigger the Z, the\r
-further away is the object! Here it is in equation form :\r
-\r
-       nx := 256*x div (z-Zoff)+Xoff\r
-       ny := 256*y div (z-Zoff)+Yoff\r
-\r
-NOTE : Zoff is how far away the entire object is, Xoff is the objects X\r
-       value, and Yoff is the objects Y value. In the sample program,\r
-       Xoff start off at 160 and Yoff starts off at 100, so that the\r
-       object is in the middle of the screen.\r
-\r
-The 256 that you times by is the perspective with which you are viewing.\r
-Changing this value gives you a "fish eye" effect when viewing the\r
-object. Anyway, there you have it! Draw a pixel at nx,ny, and viola! you\r
-are now doing 3D! Easy, wasn't it?\r
-\r
-\r
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
-þ Possible improvements\r
-\r
-This program is not the most optimised routine you will ever encounter\r
-(;-)) ... it uses 12 muls and 2 divs per point. (Asphyxia currently has\r
-9 muls and 2 divs per point) Real math is used for all the calculations\r
-in the sample program, which is slow, so fixed point math should be\r
-implemented (I will cover fixed point math in a future trainer). The\r
-line routine currently being used is very slow. Chain-4 could be used to\r
-cut down on screen flipping times.\r
-\r
-Color values per line should be added, base object morphing could be put\r
-in, polygons could be used instead of lines, handling of more then one\r
-object should be implemented, clipping should be added instead of not\r
-drawing something if any part of it is out of bounds.\r
-\r
-In other words, you have a lot of work ahead of you ;)\r
-\r
-\r
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
-þ  In closing\r
-\r
-There are a lot of books out there on 3D, and quite a few sample\r
-programs too. Have a look at them, and use the best bits to create your\r
-own, unique 3D engine, with which you can do anything you want. I am\r
-very interested in 3D (though EzE and Goth wrote most of ASPHYXIA'S 3D\r
-routines), and would like to see what you can do with it. Leave me a\r
-message through one of the means described above.\r
-\r
-I am delving into the murky world of texture mapping. If anyone out \r
-there has some routines on the subject and are interested in swapping, \r
-give me a buzz!\r
-\r
-What to do in future trainers? Help me out on this one! Are there any\r
-effects/areas you would like a bit of info on? Leave me a message!\r
-\r
-I unfortunately did not get any messages regarding BBS's that carry this\r
-series, so the list that follows is the same one from last time. Give\r
-me your names, sysops!\r
-\r
-Aaaaargh!!! Try as I might, I can't think of a new quote. Next time, I\r
-promise! ;-)\r
-\r
-Bye for now,\r
-  - Denthor\r
-\r
-\r
-These fine BBS's carry the ASPHYXIA DEMO TRAINER SERIES : (alphabetical)\r
-\r
-ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍËÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍËÍÍÍÍÍËÍÍÍËÍÍÍÍËÍÍÍÍ»\r
-ºBBS Name                  ºTelephone No.   ºOpen ºMsgºFileºPastº\r
-ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÎÍÍÍÍÍÎÍÍÍÎÍÍÍÍÎÍÍÍ͹\r
-ºASPHYXIA BBS #1           º(031) 765-5312  ºALL  º * º *  º *  º\r
-ºASPHYXIA BBS #2           º(031) 765-6293  ºALL  º * º *  º *  º\r
-ºConnectix BBS             º(031) 266-9992  ºALL  º * º    º    º\r
-ºFor Your Eyes Only BBS    º(031) 285-318   ºA/H  º * º *  º *  º\r
-ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÊÍÍÍÊÍÍÍÍÊÍÍÍͼ\r
-\r
-Open = Open at all times or only A/H\r
-Msg  = Available in message base\r
-File = Available in file base\r
-Past = Previous Parts available\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ TUTPROG8.PAS ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-\r
-{$X+}\r
-USES Crt;\r
-\r
-CONST VGA = $A000;\r
-      MaxLines = 12;\r
-      Obj : Array [1..MaxLines,1..2,1..3] of integer =\r
-        (\r
-        ((-10,-10,-10),(10,-10,-10)),((-10,-10,-10),(-10,10,-10)),\r
-        ((-10,10,-10),(10,10,-10)),((10,-10,-10),(10,10,-10)),\r
-        ((-10,-10,10),(10,-10,10)),((-10,-10,10),(-10,10,10)),\r
-        ((-10,10,10),(10,10,10)),((10,-10,10),(10,10,10)),\r
-        ((-10,-10,10),(-10,-10,-10)),((-10,10,10),(-10,10,-10)),\r
-        ((10,10,10),(10,10,-10)),((10,-10,10),(10,-10,-10))\r
-        );  { The 3-D coordinates of our object ... stored as (X1,Y1,Z1), }\r
-            { (X2,Y2,Z2) ... for the two ends of a line }\r
-\r
-\r
-Type Point = Record\r
-               x,y,z:real;                { The data on every point we rotate}\r
-             END;\r
-     Virtual = Array [1..64000] of byte;  { The size of our Virtual Screen }\r
-     VirtPtr = ^Virtual;                  { Pointer to the virtual screen }\r
-\r
-\r
-VAR Lines : Array [1..MaxLines,1..2] of Point;  { The base object rotated }\r
-    Translated : Array [1..MaxLines,1..2] of Point; { The rotated object }\r
-    Xoff,Yoff,Zoff:Integer;               { Used for movement of the object }\r
-    lookup : Array [0..360,1..2] of real; { Our sin and cos lookup table }\r
-    Virscr : VirtPtr;                     { Our first Virtual screen }\r
-    Vaddr  : word;                        { The segment of our virtual screen}\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure SetMCGA;  { This procedure gets you into 320x200x256 mode. }\r
-BEGIN\r
-  asm\r
-     mov        ax,0013h\r
-     int        10h\r
-  end;\r
-END;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure SetText;  { This procedure returns you to text mode.  }\r
-BEGIN\r
-  asm\r
-     mov        ax,0003h\r
-     int        10h\r
-  end;\r
-END;\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure Cls (Where:word;Col : Byte);\r
-   { This clears the screen to the specified color }\r
-BEGIN\r
-     asm\r
-        push    es\r
-        mov     cx, 32000;\r
-        mov     es,[where]\r
-        xor     di,di\r
-        mov     al,[col]\r
-        mov     ah,al\r
-        rep     stosw\r
-        pop     es\r
-     End;\r
-END;\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure SetUpVirtual;\r
-   { This sets up the memory needed for the virtual screen }\r
-BEGIN\r
-  GetMem (VirScr,64000);\r
-  vaddr := seg (virscr^);\r
-END;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure ShutDown;\r
-   { This frees the memory used by the virtual screen }\r
-BEGIN\r
-  FreeMem (VirScr,64000);\r
-END;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-procedure flip(source,dest:Word);\r
-  { This copies the entire screen at "source" to destination }\r
-begin\r
-  asm\r
-    push    ds\r
-    mov     ax, [Dest]\r
-    mov     es, ax\r
-    mov     ax, [Source]\r
-    mov     ds, ax\r
-    xor     si, si\r
-    xor     di, di\r
-    mov     cx, 32000\r
-    rep     movsw\r
-    pop     ds\r
-  end;\r
-end;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure Pal(Col,R,G,B : Byte);\r
-  { This sets the Red, Green and Blue values of a certain color }\r
-Begin\r
-   asm\r
-      mov    dx,3c8h\r
-      mov    al,[col]\r
-      out    dx,al\r
-      inc    dx\r
-      mov    al,[r]\r
-      out    dx,al\r
-      mov    al,[g]\r
-      out    dx,al\r
-      mov    al,[b]\r
-      out    dx,al\r
-   end;\r
-End;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Function rad (theta : real) : real;\r
-  {  This calculates the degrees of an angle }\r
-BEGIN\r
-  rad := theta * pi / 180\r
-END;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure SetUpPoints;\r
-  { This sets the basic offsets of the object, creates the lookup table and\r
-    moves the object from a constant to a variable }\r
-VAR loop1:integer;\r
-BEGIN\r
-  Xoff:=160;\r
-  Yoff:=100;\r
-  Zoff:=-256;\r
-  For loop1:=0 to 360 do BEGIN\r
-    lookup [loop1,1]:=sin (rad (loop1));\r
-    lookup [loop1,2]:=cos (rad (loop1));\r
-  END;\r
-  For loop1:=1 to MaxLines do BEGIN\r
-    Lines [loop1,1].x:=Obj [loop1,1,1];\r
-    Lines [loop1,1].y:=Obj [loop1,1,2];\r
-    Lines [loop1,1].z:=Obj [loop1,1,3];\r
-    Lines [loop1,2].x:=Obj [loop1,2,1];\r
-    Lines [loop1,2].y:=Obj [loop1,2,2];\r
-    Lines [loop1,2].z:=Obj [loop1,2,3];\r
-  END;\r
-END;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure Putpixel (X,Y : Integer; Col : Byte; where:word);\r
-  { This puts a pixel on the screen by writing directly to memory. }\r
-BEGIN\r
-  Asm\r
-    mov     ax,[where]\r
-    mov     es,ax\r
-    mov     bx,[X]\r
-    mov     dx,[Y]\r
-    mov     di,bx\r
-    mov     bx, dx                  {; bx = dx}\r
-    shl     dx, 8\r
-    shl     bx, 6\r
-    add     dx, bx                  {; dx = dx + bx (ie y*320)}\r
-    add     di, dx                  {; finalise location}\r
-    mov     al, [Col]\r
-    stosb\r
-  End;\r
-END;\r
-\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure Line(a,b,c,d:integer;col:byte;where:word);\r
-  { This draws a solid line from a,b to c,d in colour col }\r
-  function sgn(a:real):integer;\r
-  begin\r
-       if a>0 then sgn:=+1;\r
-       if a<0 then sgn:=-1;\r
-       if a=0 then sgn:=0;\r
-  end;\r
-var i,s,d1x,d1y,d2x,d2y,u,v,m,n:integer;\r
-begin\r
-     u:= c - a;\r
-     v:= d - b;\r
-     d1x:= SGN(u);\r
-     d1y:= SGN(v);\r
-     d2x:= SGN(u);\r
-     d2y:= 0;\r
-     m:= ABS(u);\r
-     n := ABS(v);\r
-     IF NOT (M>N) then\r
-     BEGIN\r
-          d2x := 0 ;\r
-          d2y := SGN(v);\r
-          m := ABS(v);\r
-          n := ABS(u);\r
-     END;\r
-     s := m shr 1;\r
-     FOR i := 0 TO m DO\r
-     BEGIN\r
-          putpixel(a,b,col,where);\r
-          s := s + n;\r
-          IF not (s<m) THEN\r
-          BEGIN\r
-               s := s - m;\r
-               a:= a + d1x;\r
-               b := b + d1y;\r
-          END\r
-          ELSE\r
-          BEGIN\r
-               a := a + d2x;\r
-               b := b + d2y;\r
-          END;\r
-     end;\r
-END;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure DrawLogo;\r
-  { This draws 'ASPHYXIA' at the top of the screen in little balls }\r
-CONST ball : Array [1..5,1..5] of byte =\r
-         ((0,1,1,1,0),\r
-          (1,4,3,2,1),\r
-          (1,3,3,2,1),\r
-          (1,2,2,2,1),\r
-          (0,1,1,1,0));\r
-\r
-VAR Logo : Array [1..5] of String;\r
-    loop1,loop2,loop3,loop4:integer;\r
-BEGIN\r
-  pal (13,0,63,0);\r
-  pal (1,0,0,40);\r
-  pal (2,0,0,45);\r
-  pal (3,0,0,50);\r
-  pal (4,0,0,60);\r
-  Logo[1]:=' O  OOO OOO O O O O O O OOO  O ';\r
-  Logo[2]:='O O O   O O O O O O O O  O  O O';\r
-  Logo[3]:='OOO OOO OOO OOO  O   O   O  OOO';\r
-  Logo[4]:='O O   O O   O O  O  O O  O  O O';\r
-  Logo[5]:='O O OOO O   O O  O  O O OOO O O';\r
-  For loop1:=1 to 5 do\r
-    For loop2:=1 to 31 do\r
-      if logo[loop1][loop2]='O' then\r
-        For loop3:=1 to 5 do\r
-          For loop4:=1 to 5 do\r
-            putpixel (loop2*10+loop3,loop1*4+loop4,ball[loop3,loop4],vaddr);\r
-END;\r
-\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure RotatePoints (X,Y,Z:Integer);\r
-  { This rotates object lines by X,Y and Z; then places the result in\r
-    TRANSLATED }\r
-VAR loop1:integer;\r
-    temp:point;\r
-BEGIN\r
-  For loop1:=1 to maxlines do BEGIN\r
-    temp.x:=lines[loop1,1].x;\r
-    temp.y:=lookup[x,2]*lines[loop1,1].y - lookup[x,1]*lines[loop1,1].z;\r
-    temp.z:=lookup[x,1]*lines[loop1,1].y + lookup[x,2]*lines[loop1,1].z;\r
-\r
-    translated[loop1,1]:=temp;\r
-\r
-    If y>0 then BEGIN\r
-      temp.x:=lookup[y,2]*translated[loop1,1].x - lookup[y,1]*translated[loop1,1].y;\r
-      temp.y:=lookup[y,1]*translated[loop1,1].x + lookup[y,2]*translated[loop1,1].y;\r
-      temp.z:=translated[loop1,1].z;\r
-      translated[loop1,1]:=temp;\r
-    END;\r
-\r
-    If z>0 then BEGIN\r
-      temp.x:=lookup[z,2]*translated[loop1,1].x + lookup[z,1]*translated[loop1,1].z;\r
-      temp.y:=translated[loop1,1].y;\r
-      temp.z:=-lookup[z,1]*translated[loop1,1].x + lookup[z,2]*translated[loop1,1].z;\r
-      translated[loop1,1]:=temp;\r
-    END;\r
-\r
-    temp.x:=lines[loop1,2].x;\r
-    temp.y:=cos (rad(X))*lines[loop1,2].y - sin (rad(X))*lines[loop1,2].z;\r
-    temp.z:=sin (rad(X))*lines[loop1,2].y + cos (rad(X))*lines[loop1,2].z;\r
-\r
-    translated[loop1,2]:=temp;\r
-\r
-    If y>0 then BEGIN\r
-      temp.x:=cos (rad(Y))*translated[loop1,2].x - sin (rad(Y))*translated[loop1,2].y;\r
-      temp.y:=sin (rad(Y))*translated[loop1,2].x + cos (rad(Y))*translated[loop1,2].y;\r
-      temp.z:=translated[loop1,2].z;\r
-      translated[loop1,2]:=temp;\r
-    END;\r
-\r
-    If z>0 then BEGIN\r
-      temp.x:=cos (rad(Z))*translated[loop1,2].x + sin (rad(Z))*translated[loop1,2].z;\r
-      temp.y:=translated[loop1,2].y;\r
-      temp.z:=-sin (rad(Z))*translated[loop1,2].x + cos (rad(Z))*translated[loop1,2].z;\r
-      translated[loop1,2]:=temp;\r
-    END;\r
-  END;\r
-END;\r
-\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure DrawPoints;\r
-  { This draws the translated object to the virtual screen }\r
-VAR loop1:Integer;\r
-    nx,ny,nx2,ny2:integer;\r
-    temp:integer;\r
-BEGIN\r
-  For loop1:=1 to MaxLines do BEGIN\r
-    If (translated[loop1,1].z+zoff<0) and (translated[loop1,2].z+zoff<0) then BEGIN\r
-      temp:=round (translated[loop1,1].z+zoff);\r
-      nx :=round (256*translated[loop1,1].X) div temp+xoff;\r
-      ny :=round (256*translated[loop1,1].Y) div temp+yoff;\r
-      temp:=round (translated[loop1,2].z+zoff);\r
-      nx2:=round (256*translated[loop1,2].X) div temp+xoff;\r
-      ny2:=round (256*translated[loop1,2].Y) div temp+yoff;\r
-      If (NX > 0) and (NX < 320) and (NY > 25) and (NY < 200) and\r
-         (NX2> 0) and (NX2< 320) and (NY2> 25) and (NY2< 200) then\r
-           line (nx,ny,nx2,ny2,13,vaddr);\r
-    END;\r
-  END;\r
-END;\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure ClearPoints;\r
-  { This clears the translated object from the virtual screen ... believe it\r
-    or not, this is faster then a straight "cls (vaddr,0)" }\r
-VAR loop1:Integer;\r
-    nx,ny,nx2,ny2:Integer;\r
-    temp:integer;\r
-BEGIN\r
-  For loop1:=1 to MaxLines do BEGIN\r
-    If (translated[loop1,1].z+zoff<0) and (translated[loop1,2].z+zoff<0) then BEGIN\r
-      temp:=round (translated[loop1,1].z+zoff);\r
-      nx :=round (256*translated[loop1,1].X) div temp+xoff;\r
-      ny :=round (256*translated[loop1,1].Y) div temp+yoff;\r
-      temp:=round (translated[loop1,2].z+zoff);\r
-      nx2:=round (256*translated[loop1,2].X) div temp+xoff;\r
-      ny2:=round (256*translated[loop1,2].Y) div temp+yoff;\r
-      If (NX > 0) and (NX < 320) and (NY > 25) and (NY < 200) and\r
-         (NX2> 0) and (NX2< 320) and (NY2> 25) and (NY2< 200) then\r
-           line (nx,ny,nx2,ny2,0,vaddr);\r
-    END;\r
-  END;\r
-END;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure MoveAround;\r
-  { This is the main display procedure. Firstly it brings the object towards\r
-    the viewer by increasing the Zoff, then passes control to the user }\r
-VAR deg,loop1:integer;\r
-    ch:char;\r
-BEGIN\r
-  deg:=0;\r
-  ch:=#0;\r
-  Cls (vaddr,0);\r
-  DrawLogo;\r
-  For loop1:=-256 to -40 do BEGIN\r
-    zoff:=loop1*2;\r
-    RotatePoints (deg,deg,deg);\r
-    DrawPoints;\r
-    flip (vaddr,vga);\r
-    ClearPoints;\r
-    deg:=(deg+5) mod 360;\r
-  END;\r
-\r
-  Repeat\r
-    if keypressed then BEGIN\r
-      ch:=upcase (Readkey);\r
-      Case ch of 'A' : zoff:=zoff+5;\r
-                 'Z' : zoff:=zoff-5;\r
-                 ',' : xoff:=xoff-5;\r
-                 '.' : xoff:=xoff+5;\r
-                 'S' : yoff:=yoff-5;\r
-                 'X' : yoff:=yoff+5;\r
-      END;\r
-    END;\r
-    DrawPoints;\r
-    flip (vaddr,vga);\r
-    ClearPoints;\r
-    RotatePoints (deg,deg,deg);\r
-    deg:=(deg+5) mod 360;\r
-  Until ch=#27;\r
-END;\r
-\r
-\r
-BEGIN\r
-  SetUpVirtual;\r
-  Writeln ('Greetings and salutations! Hope you had a great Christmas and New');\r
-  Writeln ('year! ;-) ... Anyway, this tutorial is on 3-D, so this is what is');\r
-  Writeln ('going to happen ... a wireframe square will come towards you.');\r
-  Writeln ('When it gets close, you get control. "A" and "Z" control the Z');\r
-  Writeln ('movement, "," and "." control the X movement, and "S" and "X"');\r
-  Writeln ('control the Y movement. I have not included rotation control, but');\r
-  Writeln ('it should be easy enough to put in yourself ... if you have any');\r
-  Writeln ('hassles, leave me mail.');\r
-  Writeln;\r
-  Writeln ('Read the main text file for ideas on improving this code ... and');\r
-  Writeln ('welcome to the world of 3-D!');\r
-  writeln;\r
-  writeln;\r
-  Write ('  Hit any key to contine ...');\r
-  Readkey;\r
-  SetMCGA;\r
-  SetUpPoints;\r
-  MoveAround;\r
-  SetText;\r
-  ShutDown;\r
-  Writeln ('All done. This concludes the eigth sample program in the ASPHYXIA');\r
-  Writeln ('Training series. You may reach DENTHOR under the names of GRANT');\r
-  Writeln ('SMITH/DENTHOR/ASPHYXIA on the ASPHYXIA BBS. I am also an avid');\r
-  Writeln ('Connectix BBS user, and occasionally read RSAProg.');\r
-  Writeln ('For discussion purposes, I am also the moderator of the Programming');\r
-  Writeln ('newsgroup on the For Your Eyes Only BBS.');\r
-  Writeln ('The numbers are available in the main text. You may also write to me at:');\r
-  Writeln ('             Grant Smith');\r
-  Writeln ('             P.O. Box 270');\r
-  Writeln ('             Kloof');\r
-  Writeln ('             3640');\r
-  Writeln ('I hope to hear from you soon!');\r
-  Writeln; Writeln;\r
-  Write   ('Hit any key to exit ...');\r
-  Readkey;\r
-END.\r
diff --git a/16/PCGPE10/TUT9.TXT b/16/PCGPE10/TUT9.TXT
deleted file mode 100644 (file)
index 0e80d21..0000000
+++ /dev/null
@@ -1,823 +0,0 @@
-                   ÕÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͸\r
-                   ³         W E L C O M E         ³\r
-                   ³  To the VGA Trainer Program   ³ ³\r
-                   ³              By               ³ ³\r
-                   ³      DENTHOR of ASPHYXIA      ³ ³ ³\r
-                   ÔÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ; ³ ³\r
-                     ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ ³\r
-                       ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-                           --==[ PART 9 ]==--\r
-\r
-\r
-\r
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
-þ Introduction\r
-\r
-Hi there! ASPHYXIA is BACK with our first MegaDemo, Psycho Neurosis! A\r
-paltry 1.3MB download is all it takes to see the group from Durbs first\r
-major production! We are quite proud of it, and think you should see it\r
-;)\r
-\r
-Secondly, I released a small little trainer (a trainerette ;-)) on\r
-RsaPROG and Connexctix BBS mail, also on the ASPHYXIA BBS as COPPERS.ZIP\r
-It is a small Pascal program demonstrating how to display copper bars in\r
-text mode. Also includes a check for horizontal retrace (A lot of people\r
-wanted it, that is why I wrote the program) (ASPHYXIA ... first with the\r
-trainer goodies ;-)  aargh, sorry, had to be done ))\r
-\r
-Thirdly, sorry about the problems with Tut 8! If you had all the\r
-checking on, the tutorial would probably die on the first points. The\r
-reason is this : in the first loop, we have DrawPoints then\r
-RotatePoints. The variables used in DrawPoints are set in RotatePoints,\r
-so if you put RotatePoints before DrawPoints, the program should work\r
-fine. Alternatively, turn off error checking 8-)\r
-\r
-Fourthly, I have had a surprisingly large number of people saying that\r
-"I get this, like, strange '286 instructions not enabled' message!\r
-What's wrong with your code, dude?"  To all of you, get into Pascal, hit\r
-Alt-O (for options), hit enter and a 2 (for Enable 286 instructions). Hard\r
-hey? Doesn't anyone EVER set up their version of Pascal?\r
-\r
-Now, on to todays tutorial! 3D solids. That is what the people wanted,\r
-that is what the people get! This tutorial is mainly on how to draw the\r
-polygon on screen. For details on how the 3D stuff works, check out tut\r
-8.\r
-\r
-\r
-\r
-If you would like to contact me, or the team, there are many ways you\r
-can do it : 1) Write a message to Grant Smith/Denthor/Asphyxia in private mail\r
-                  on the ASPHYXIA BBS.\r
-            2) Write to Denthor, EzE or Goth on Connectix.\r
-            3) Write to :  Grant Smith\r
-                           P.O.Box 270 Kloof\r
-                           3640\r
-                           Natal\r
-            4) Call me (Grant Smith) at (031) 73 2129 (leave a message if you\r
-                  call during varsity)\r
-            5) Write to mcphail@beastie.cs.und.ac.za on InterNet, and\r
-                  mention the word Denthor near the top of the letter.\r
-\r
-NB : If you are a representative of a company or BBS, and want ASPHYXIA\r
-       to do you a demo, leave mail to me; we can discuss it.\r
-NNB : If you have done/attempted a demo, SEND IT TO ME! We are feeling\r
-        quite lonely and want to meet/help out/exchange code with other demo\r
-        groups. What do you have to lose? Leave a message here and we can work\r
-        out how to transfer it. We really want to hear from you!\r
-\r
-\r
-\r
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
-þ How to draw a polygon\r
-\r
-Sounds easy enough, right? WRONG! There are many, many different ways to\r
-go about this, and today I'll only be showing you one. Please don't take\r
-what is written here as anything approaching the best method, it is just\r
-here to get you on your way...\r
-\r
-The procedure I will be using here is based on something most of us\r
-learned in standard eight ... I think. I seem to recall doing something\r
-like this in Mrs. Reids maths class all those years ago ;)\r
-\r
-Take two points, x1,y1 and x2,y2. Draw them :\r
-\r
-                  + (x1,y1)\r
-                   \\r
-                     \  <-- Point a somewhere along the line\r
-                       \\r
-                         + (x2,y2)\r
-\r
-Right, so what we have to do is this : if we know the y-coord of a, what\r
-is it's x-coord? To prove the method we will give the points random\r
-values.\r
-\r
-                 + (2,10)\r
-                  \\r
-                    \  <-- a.y = 12\r
-                      \\r
-                        +  (15,30)\r
-\r
-Right. Simple enough problem. This is how we do it :\r
-   (a.y-y1) = (12 - 10)  {to get a.y as though y1 was zero}\r
-   *(x2-x1) = *(15 - 2)  {the total x-length of the line}\r
-   /(y2-y1) = /(30 - 10) {the total y-length of the line}\r
-        +x1 = +2         { to get the equation back to real coords}\r
-\r
-So our equation is :  (a.y-y1)*(x2-x1)/(y2-y1)+x4    or\r
-                      (12-10)*(15-2)/(30-10)+2\r
-      which gives you :\r
-                      2*13/20+2 = 26/20+2\r
-                                = 3.3\r
-\r
-That means that along the line with y=12, x is equal to 3.3. Since we\r
-are not concerned with the decimal place, we replace the  /  with a div,\r
-which in Pascal gives us an integer result, and is faster too. All well\r
-and good, I hear you cry, but what does this have to do with life and\r
-how it relates to polygons in general. The answer is simple. For each of\r
-the four sides of the polygon we do the above test for each y line. We\r
-store the smallest and the largest x values into separate variables for\r
-each line, and draw a horizontal line between them. Ta-Dah! We have a\r
-cool polygon!\r
-\r
-For example : Two lines going down :\r
-    \r
-                +             +\r
-               / <-x1     x2->|   <--For this y line\r
-             /                |\r
-           +                  +\r
-\r
-Find x1 and x2 for that y, then draw a line between them. Repeat for all\r
-y values.\r
-\r
-Of course, it's not as simple as that. We have to make sure we only\r
-check those y lines that contain the polygon (a simple min y, max y test\r
-for all the points). We also have to check that the line we are\r
-calculating actually extends as far as where our current y is (check\r
-that the point is between both y's). We have to compare each x to see\r
-weather it is smaller then the minimum x value so far, or bigger then\r
-the maximum (the original x min is set as a high number, and the x max\r
-is set as a small number). We must also check that we only draw to the\r
-place that we can see ( 0-319 on the x ; 0-199 on the y (the size of the\r
-MCGA screen))\r
-\r
-To see how this looks in practice, have a look at the sample code\r
-provided. (Mrs. Reid would probably kill me for the above explanation,\r
-so when you learn it in school, split it up into thousands of smaller\r
-equations to get the same answer ;))\r
-\r
-Okay, that's it! What's that? How do you draw a vertical line? Thats\r
-simple ...\r
-\r
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
-þ Drawing a vertical line\r
-\r
-Right, this is a lot easier than drawing a normal line (Tut 5 .. I\r
-think), because you stay on the same y value. So, what you do is you set\r
-ES to the screen you want to write to, and get DI to the start of the\r
-y-line (see earlier trainers for a description of how SEGMENT:OFFSET\r
-works.\r
-\r
-IN   : x1 , x2, y, color, where\r
-\r
-           asm\r
-             mov    ax,where\r
-             mov    es,ax\r
-             mov    di,y\r
-             mov    ax,y\r
-             shl    di,8   { di:=di*256 }\r
-             shl    ax,6   { ax:=ax*64 }\r
-             add    di,ax  { di := (y*256)+(y*64) := y*320 Faster then a\r
-                             straight multiplication }\r
-\r
-Right, now you add the first x value to get your startoff.\r
-             add    di,x1\r
-Move the color to store into ah and al\r
-             mov    al,color\r
-             mov    ah,al       { ah:=al:=color }\r
-then get CX equal to how many pixels across you want to go\r
-             mov    cx,x2\r
-             sub    cx,x1   { cx:=x2-x1 }\r
-Okay, as we all know, moving a word is a lot faster then moving a byte,\r
-so we halve CX\r
-             shr    cx,1    { cx:=cx/2 }\r
-but what happens if CX was an odd number. After a shift, the value of\r
-the last number is placed in the carry flag, so what we do is jump over\r
-a single byte move if the carry flag is zero, or execute it if it is\r
-one.\r
-            jnc     @Start  { If there is no carry, jump to label Start }\r
-            stosb           { ES:[DI]:=al ; increment DI }\r
-        @Start :            { Label Start }\r
-            rep     stosw   { ES:[DI]:=ax ; DI:=DI+2; repeat CX times }\r
-\r
-Right, the finished product looks like this :\r
-\r
-Procedure Hline (x1,x2,y:word;col:byte;where:word); assembler;\r
-  { This draws a horizontal line from x1 to x2 on line y in color col }\r
-asm\r
-  mov   ax,where\r
-  mov   es,ax\r
-  mov   ax,y\r
-  mov   di,ax\r
-  shl   ax,8\r
-  shl   di,6\r
-  add   di,ax\r
-  add   di,x1\r
-\r
-  mov   al,col\r
-  mov   ah,al\r
-  mov   cx,x2\r
-  sub   cx,x1\r
-  shr   cx,1\r
-  jnc   @start\r
-  stosb\r
-@Start :\r
-  rep   stosw\r
-end;\r
-\r
-Done!\r
-\r
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
-þ  In closing\r
-\r
-This 3D system is still not perfect. It needs to be faster, and now I\r
-have also dumped the problem of face-sorting on you! Nyahahahaha!\r
-\r
-           [ My sister and I were driving along the other day when she\r
-               asked me, what would I like for my computer.\r
-             I thought long and hard about it, and came up with the\r
-               following hypothesis. When a girl gets a Barbie doll, she\r
-               then wants the extra ballgown for the doll, then the\r
-               hairbrush, and the car, and the house, and the friends\r
-               etc.\r
-             When a guy gets a computer, he wants the extra memory, the\r
-               bigger hard drive, the maths co-pro, the better\r
-               motherboard, the latest software, and the bigger monitor\r
-               etc.\r
-             I told my sister all of this, and finished up with : "So as\r
-               you can see, computers are Barbie dolls for MEN!"\r
-             She called me a chauvinist. And hit me. Hard.\r
-                                                                   ]\r
-                                                       - Grant Smith\r
-                                                           19:24\r
-                                                             26/2/94\r
-\r
-See you next time!\r
-  - Denthor\r
-\r
-These fine BBS's carry the ASPHYXIA DEMO TRAINER SERIES : (alphabetical)\r
-\r
-ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍËÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍËÍÍÍÍÍËÍÍÍËÍÍÍÍËÍÍÍÍ»\r
-ºBBS Name                  ºTelephone No.   ºOpen ºMsgºFileºPastº\r
-ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÎÍÍÍÍÍÎÍÍÍÎÍÍÍÍÎÍÍÍ͹\r
-ºASPHYXIA BBS #1           º(031) 765-5312  ºALL  º * º *  º *  º\r
-ºASPHYXIA BBS #2           º(031) 765-6293  ºALL  º * º *  º *  º\r
-ºConnectix BBS             º(031) 266-9992  ºALL  º   º *  º *  º\r
-ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÊÍÍÍÊÍÍÍÍÊÍÍÍͼ\r
-\r
-Open = Open at all times or only A/H\r
-Msg  = Available in message base\r
-File = Available in file base\r
-Past = Previous Parts available\r
-\r
-Does no other BBS's ANYWHERE carry the trainer? Am I writing this for\r
-three people who get it from one of these BBS's each week? Should I go\r
-on? (Hehehehe ... I was pleased to note that Tut 8 was THE most\r
-downloaded file from ASPHYXIA BBS last month ... )       \r
-\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ TUTPROG9.PAS ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-{$X+}\r
-USES Crt;\r
-\r
-CONST VGA = $A000;\r
-      maxpolys = 5;\r
-      A : Array [1..maxpolys,1..4,1..3] of integer =\r
-        (\r
-         ((-10,10,0),(-2,-10,0),(0,-10,0),(-5,10,0)),\r
-         ((10,10,0),(2,-10,0),(0,-10,0),(5,10,0)),\r
-         ((-2,-10,0),(2,-10,0),(2,-5,0),(-2,-5,0)),\r
-         ((-6,0,0),(6,0,0),(7,5,0),(-7,5,0)),\r
-         ((0,0,0),(0,0,0),(0,0,0),(0,0,0))\r
-        );  { The 3-D coordinates of our object ... stored as (X1,Y1,Z1), }\r
-            { (X2,Y2,Z2) ... for the 4 points of a poly }\r
-     S : Array [1..maxpolys,1..4,1..3] of integer =\r
-        (\r
-         ((-10,-10,0),(10,-10,0),(10,-7,0),(-10,-7,0)),\r
-         ((-10,10,0),(10,10,0),(10,7,0),(-10,7,0)),\r
-         ((-10,1,0),(10,1,0),(10,-2,0),(-10,-2,0)),\r
-         ((-10,-8,0),(-7,-8,0),(-7,0,0),(-10,0,0)),\r
-         ((10,8,0),(7,8,0),(7,0,0),(10,0,0))\r
-        );  { The 3-D coordinates of our object ... stored as (X1,Y1,Z1), }\r
-            { (X2,Y2,Z2) ... for the 4 points of a poly }\r
-     P : Array [1..maxpolys,1..4,1..3] of integer =\r
-        (\r
-         ((-10,-10,0),(-7,-10,0),(-7,10,0),(-10,10,0)),\r
-         ((10,-10,0),(7,-10,0),(7,0,0),(10,0,0)),\r
-         ((-9,-10,0),(9,-10,0),(9,-7,0),(-9,-7,0)),\r
-         ((-9,-1,0),(9,-1,0),(9,2,0),(-9,2,0)),\r
-         ((0,0,0),(0,0,0),(0,0,0),(0,0,0))\r
-        );  { The 3-D coordinates of our object ... stored as (X1,Y1,Z1), }\r
-            { (X2,Y2,Z2) ... for the 4 points of a poly }\r
-     H : Array [1..maxpolys,1..4,1..3] of integer =\r
-        (\r
-         ((-10,-10,0),(-7,-10,0),(-7,10,0),(-10,10,0)),\r
-         ((10,-10,0),(7,-10,0),(7,10,0),(10,10,0)),\r
-         ((-9,-1,0),(9,-1,0),(9,2,0),(-9,2,0)),\r
-         ((0,0,0),(0,0,0),(0,0,0),(0,0,0)),\r
-         ((0,0,0),(0,0,0),(0,0,0),(0,0,0))\r
-        );  { The 3-D coordinates of our object ... stored as (X1,Y1,Z1), }\r
-            { (X2,Y2,Z2) ... for the 4 points of a poly }\r
-     Y : Array [1..maxpolys,1..4,1..3] of integer =\r
-        (\r
-         ((-7,-10,0),(0,-3,0),(0,0,0),(-10,-7,0)),\r
-         ((7,-10,0),(0,-3,0),(0,0,0),(10,-7,0)),\r
-         ((-2,-3,0),(2,-3,0),(2,10,0),(-2,10,0)),\r
-         ((0,0,0),(0,0,0),(0,0,0),(0,0,0)),\r
-         ((0,0,0),(0,0,0),(0,0,0),(0,0,0))\r
-        );  { The 3-D coordinates of our object ... stored as (X1,Y1,Z1), }\r
-            { (X2,Y2,Z2) ... for the 4 points of a poly }\r
-     X : Array [1..maxpolys,1..4,1..3] of integer =\r
-        (\r
-         ((-7,-10,0),(10,7,0),(7,10,0),(-10,-7,0)),\r
-         ((7,-10,0),(-10,7,0),(-7,10,0),(10,-7,0)),\r
-         ((0,0,0),(0,0,0),(0,0,0),(0,0,0)),\r
-         ((0,0,0),(0,0,0),(0,0,0),(0,0,0)),\r
-         ((0,0,0),(0,0,0),(0,0,0),(0,0,0))\r
-        );  { The 3-D coordinates of our object ... stored as (X1,Y1,Z1), }\r
-            { (X2,Y2,Z2) ... for the 4 points of a poly }\r
-     I : Array [1..maxpolys,1..4,1..3] of integer =\r
-        (\r
-         ((-10,-10,0),(10,-10,0),(10,-7,0),(-10,-7,0)),\r
-         ((-10,10,0),(10,10,0),(10,7,0),(-10,7,0)),\r
-         ((-2,-9,0),(2,-9,0),(2,9,0),(-2,9,0)),\r
-         ((0,0,0),(0,0,0),(0,0,0),(0,0,0)),\r
-         ((0,0,0),(0,0,0),(0,0,0),(0,0,0))\r
-        );  { The 3-D coordinates of our object ... stored as (X1,Y1,Z1), }\r
-            { (X2,Y2,Z2) ... for the 4 points of a poly }\r
-\r
-\r
-Type Point = Record\r
-               x,y,z:real;                { The data on every point we rotate}\r
-             END;\r
-     Virtual = Array [1..64000] of byte;  { The size of our Virtual Screen }\r
-     VirtPtr = ^Virtual;                  { Pointer to the virtual screen }\r
-\r
-\r
-VAR Lines : Array [1..maxpolys,1..4] of Point;  { The base object rotated }\r
-    Translated : Array [1..maxpolys,1..4] of Point; { The rotated object }\r
-    Xoff,Yoff,Zoff:Integer;               { Used for movement of the object }\r
-    lookup : Array [0..360,1..2] of real; { Our sin and cos lookup table }\r
-    Virscr : VirtPtr;                     { Our first Virtual screen }\r
-    Vaddr  : word;                        { The segment of our virtual screen}\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure SetMCGA;  { This procedure gets you into 320x200x256 mode. }\r
-BEGIN\r
-  asm\r
-     mov        ax,0013h\r
-     int        10h\r
-  end;\r
-END;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure SetText;  { This procedure returns you to text mode.  }\r
-BEGIN\r
-  asm\r
-     mov        ax,0003h\r
-     int        10h\r
-  end;\r
-END;\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure Cls (Where:word;Col : Byte);\r
-   { This clears the screen to the specified color }\r
-BEGIN\r
-     asm\r
-        push    es\r
-        mov     cx, 32000;\r
-        mov     es,[where]\r
-        xor     di,di\r
-        mov     al,[col]\r
-        mov     ah,al\r
-        rep     stosw\r
-        pop     es\r
-     End;\r
-END;\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure SetUpVirtual;\r
-   { This sets up the memory needed for the virtual screen }\r
-BEGIN\r
-  GetMem (VirScr,64000);\r
-  vaddr := seg (virscr^);\r
-END;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure ShutDown;\r
-   { This frees the memory used by the virtual screen }\r
-BEGIN\r
-  FreeMem (VirScr,64000);\r
-END;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-procedure flip(source,dest:Word);\r
-  { This copies the entire screen at "source" to destination }\r
-begin\r
-  asm\r
-    push    ds\r
-    mov     ax, [Dest]\r
-    mov     es, ax\r
-    mov     ax, [Source]\r
-    mov     ds, ax\r
-    xor     si, si\r
-    xor     di, di\r
-    mov     cx, 32000\r
-    rep     movsw\r
-    pop     ds\r
-  end;\r
-end;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure Pal(Col,R,G,B : Byte);\r
-  { This sets the Red, Green and Blue values of a certain color }\r
-Begin\r
-   asm\r
-      mov    dx,3c8h\r
-      mov    al,[col]\r
-      out    dx,al\r
-      inc    dx\r
-      mov    al,[r]\r
-      out    dx,al\r
-      mov    al,[g]\r
-      out    dx,al\r
-      mov    al,[b]\r
-      out    dx,al\r
-   end;\r
-End;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure Hline (x1,x2,y:word;col:byte;where:word); assembler;\r
-  { This draws a horizontal line from x1 to x2 on line y in color col }\r
-asm\r
-  mov   ax,where\r
-  mov   es,ax\r
-  mov   ax,y\r
-  mov   di,ax\r
-  shl   ax,8\r
-  shl   di,6\r
-  add   di,ax\r
-  add   di,x1\r
-\r
-  mov   al,col\r
-  mov   ah,al\r
-  mov   cx,x2\r
-  sub   cx,x1\r
-  shr   cx,1\r
-  jnc   @start\r
-  stosb\r
-@Start :\r
-  rep   stosw\r
-end;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure DrawPoly(x1,y1,x2,y2,x3,y3,x4,y4:integer;color:byte;where:word);\r
-  { This draw a polygon with 4 points at x1,y1 , x2,y2 , x3,y3 , x4,y4\r
-    in color col }\r
-var\r
-  x:integer;\r
-  mny,mxy:integer;\r
-  mnx,mxx,yc:integer;\r
-  mul1,div1,\r
-  mul2,div2,\r
-  mul3,div3,\r
-  mul4,div4:integer;\r
-\r
-begin\r
-  mny:=y1; mxy:=y1;\r
-  if y2<mny then mny:=y2;\r
-  if y2>mxy then mxy:=y2;\r
-  if y3<mny then mny:=y3;\r
-  if y3>mxy then mxy:=y3;    { Choose the min y mny and max y mxy }\r
-  if y4<mny then mny:=y4;\r
-  if y4>mxy then mxy:=y4;\r
-\r
-  if mny<0 then mny:=0;\r
-  if mxy>199 then mxy:=199;\r
-  if mny>199 then exit;\r
-  if mxy<0 then exit;        { Verticle range checking }\r
-\r
-  mul1:=x1-x4; div1:=y1-y4;\r
-  mul2:=x2-x1; div2:=y2-y1;\r
-  mul3:=x3-x2; div3:=y3-y2;\r
-  mul4:=x4-x3; div4:=y4-y3;  { Constansts needed for intersection calc }\r
-\r
-  for yc:=mny to mxy do\r
-    begin\r
-      mnx:=320;\r
-      mxx:=-1;\r
-      if (y4>=yc) or (y1>=yc) then\r
-        if (y4<=yc) or (y1<=yc) then   { Check that yc is between y1 and y4 }\r
-          if not(y4=y1) then\r
-            begin\r
-              x:=(yc-y4)*mul1 div div1+x4; { Point of intersection on x axis }\r
-              if x<mnx then\r
-                mnx:=x;\r
-              if x>mxx then\r
-                mxx:=x;       { Set point as start or end of horiz line }\r
-            end;\r
-      if (y1>=yc) or (y2>=yc) then\r
-        if (y1<=yc) or (y2<=yc) then   { Check that yc is between y1 and y2 }\r
-          if not(y1=y2) then\r
-            begin\r
-              x:=(yc-y1)*mul2 div div2+x1; { Point of intersection on x axis }\r
-              if x<mnx then\r
-                mnx:=x;\r
-              if x>mxx then\r
-                mxx:=x;       { Set point as start or end of horiz line }\r
-            end;\r
-      if (y2>=yc) or (y3>=yc) then\r
-        if (y2<=yc) or (y3<=yc) then   { Check that yc is between y2 and y3 }\r
-          if not(y2=y3) then\r
-            begin\r
-              x:=(yc-y2)*mul3 div div3+x2; { Point of intersection on x axis }\r
-              if x<mnx then\r
-                mnx:=x;\r
-              if x>mxx then\r
-                mxx:=x;       { Set point as start or end of horiz line }\r
-            end;\r
-      if (y3>=yc) or (y4>=yc) then\r
-        if (y3<=yc) or (y4<=yc) then   { Check that yc is between y3 and y4 }\r
-          if not(y3=y4) then\r
-            begin\r
-              x:=(yc-y3)*mul4 div div4+x3; { Point of intersection on x axis }\r
-              if x<mnx then\r
-                mnx:=x;\r
-              if x>mxx then\r
-                mxx:=x;       { Set point as start or end of horiz line }\r
-            end;\r
-      if mnx<0 then\r
-        mnx:=0;\r
-      if mxx>319 then\r
-        mxx:=319;          { Range checking on horizontal line }\r
-      if mnx<=mxx then\r
-        hline (mnx,mxx,yc,color,where);   { Draw the horizontal line }\r
-    end;\r
-  end;\r
-\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Function rad (theta : real) : real;\r
-  {  This calculates the degrees of an angle }\r
-BEGIN\r
-  rad := theta * pi / 180\r
-END;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure SetUpPoints;\r
-  { This creates the lookup table }\r
-VAR loop1,loop2:integer;\r
-BEGIN\r
-  For loop1:=0 to 360 do BEGIN\r
-    lookup [loop1,1]:=sin (rad (loop1));\r
-    lookup [loop1,2]:=cos (rad (loop1));\r
-  END;\r
-END;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure Putpixel (X,Y : Integer; Col : Byte; where:word);\r
-  { This puts a pixel on the screen by writing directly to memory. }\r
-BEGIN\r
-  Asm\r
-    mov     ax,[where]\r
-    mov     es,ax\r
-    mov     bx,[X]\r
-    mov     dx,[Y]\r
-    mov     di,bx\r
-    mov     bx, dx                  {; bx = dx}\r
-    shl     dx, 8\r
-    shl     bx, 6\r
-    add     dx, bx                  {; dx = dx + bx (ie y*320)}\r
-    add     di, dx                  {; finalise location}\r
-    mov     al, [Col]\r
-    stosb\r
-  End;\r
-END;\r
-\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure RotatePoints (X,Y,Z:Integer);\r
-  { This rotates object lines by X,Y and Z; then places the result in\r
-    TRANSLATED }\r
-VAR loop1,loop2:integer;\r
-    temp:point;\r
-BEGIN\r
-  For loop1:=1 to maxpolys do BEGIN\r
-    For loop2:=1 to 4 do BEGIN\r
-      temp.x:=lines[loop1,loop2].x;\r
-      temp.y:=lookup[x,2]*lines[loop1,loop2].y - lookup[x,1]*lines[loop1,loop2].z;\r
-      temp.z:=lookup[x,1]*lines[loop1,loop2].y + lookup[x,2]*lines[loop1,loop2].z;\r
-\r
-      translated[loop1,loop2]:=temp;\r
-\r
-      If y>0 then BEGIN\r
-        temp.x:=lookup[y,2]*translated[loop1,loop2].x - lookup[y,1]*translated[loop1,loop2].y;\r
-        temp.y:=lookup[y,1]*translated[loop1,loop2].x + lookup[y,2]*translated[loop1,loop2].y;\r
-        temp.z:=translated[loop1,loop2].z;\r
-        translated[loop1,loop2]:=temp;\r
-      END;\r
-\r
-      If z>0 then BEGIN\r
-        temp.x:=lookup[z,2]*translated[loop1,loop2].x + lookup[z,1]*translated[loop1,loop2].z;\r
-        temp.y:=translated[loop1,loop2].y;\r
-        temp.z:=-lookup[z,1]*translated[loop1,loop2].x + lookup[z,2]*translated[loop1,loop2].z;\r
-        translated[loop1,loop2]:=temp;\r
-      END;\r
-    END;\r
-  END;\r
-END;\r
-\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure DrawPoints;\r
-  { This draws the translated object to the virtual screen }\r
-VAR loop1:Integer;\r
-    nx,ny,nx2,ny2,nx3,ny3,nx4,ny4:integer;\r
-    temp:integer;\r
-BEGIN\r
-  For loop1:=1 to maxpolys do BEGIN\r
-    If (translated[loop1,1].z+zoff<0) and (translated[loop1,2].z+zoff<0) and\r
-       (translated[loop1,3].z+zoff<0) and (translated[loop1,4].z+zoff<0) then BEGIN\r
-      temp:=round (translated[loop1,1].z+zoff);\r
-      nx :=round (256*translated[loop1,1].X) div temp+xoff;\r
-      ny :=round (256*translated[loop1,1].Y) div temp+yoff;\r
-      temp:=round (translated[loop1,2].z+zoff);\r
-      nx2:=round (256*translated[loop1,2].X) div temp+xoff;\r
-      ny2:=round (256*translated[loop1,2].Y) div temp+yoff;\r
-      temp:=round (translated[loop1,3].z+zoff);\r
-      nx3:=round (256*translated[loop1,3].X) div temp+xoff;\r
-      ny3:=round (256*translated[loop1,3].Y) div temp+yoff;\r
-      temp:=round (translated[loop1,4].z+zoff);\r
-      nx4:=round (256*translated[loop1,4].X) div temp+xoff;\r
-      ny4:=round (256*translated[loop1,4].Y) div temp+yoff;\r
-      drawpoly (nx,ny,nx2,ny2,nx3,ny3,nx4,ny4,13,vaddr);\r
-    END;\r
-  END;\r
-END;\r
-\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure MoveAround;\r
-  { This is the main display procedure. Firstly it brings the object towards\r
-    the viewer by increasing the Zoff, then passes control to the user }\r
-VAR deg,loop1,loop2:integer;\r
-    ch:char;\r
-\r
-  Procedure Whizz (sub:boolean);\r
-  VAR loop1:integer;\r
-  BEGIN\r
-    For loop1:=-64 to -5 do BEGIN\r
-      zoff:=loop1*8;\r
-      if sub then xoff:=xoff-7 else xoff:=xoff+7;\r
-      RotatePoints (deg,deg,deg);\r
-      DrawPoints;\r
-      flip (vaddr,vga);\r
-      Cls (vaddr,0);\r
-      deg:=(deg+5) mod 360;\r
-    END;\r
-  END;\r
-\r
-BEGIN\r
-  deg:=0;\r
-  ch:=#0;\r
-  Yoff:=100;\r
-  Xoff:=350;\r
-  Cls (vaddr,0);\r
-  For loop1:=1 to maxpolys do\r
-    For loop2:=1 to 4 do BEGIN\r
-      Lines [loop1,loop2].x:=a [loop1,loop2,1];\r
-      Lines [loop1,loop2].y:=a [loop1,loop2,2];\r
-      Lines [loop1,loop2].z:=a [loop1,loop2,3];\r
-    END;\r
-  Whizz (TRUE);\r
-\r
-  For loop1:=1 to maxpolys do\r
-    For loop2:=1 to 4 do BEGIN\r
-      Lines [loop1,loop2].x:=s [loop1,loop2,1];\r
-      Lines [loop1,loop2].y:=s [loop1,loop2,2];\r
-      Lines [loop1,loop2].z:=s [loop1,loop2,3];\r
-    END;\r
-  Whizz (FALSE);\r
-\r
-  For loop1:=1 to maxpolys do\r
-    For loop2:=1 to 4 do BEGIN\r
-      Lines [loop1,loop2].x:=p [loop1,loop2,1];\r
-      Lines [loop1,loop2].y:=p [loop1,loop2,2];\r
-      Lines [loop1,loop2].z:=p [loop1,loop2,3];\r
-    END;\r
-  Whizz (TRUE);\r
-\r
-  For loop1:=1 to maxpolys do\r
-    For loop2:=1 to 4 do BEGIN\r
-      Lines [loop1,loop2].x:=h [loop1,loop2,1];\r
-      Lines [loop1,loop2].y:=h [loop1,loop2,2];\r
-      Lines [loop1,loop2].z:=h [loop1,loop2,3];\r
-    END;\r
-  Whizz (FALSE);\r
-\r
-  For loop1:=1 to maxpolys do\r
-    For loop2:=1 to 4 do BEGIN\r
-      Lines [loop1,loop2].x:=y [loop1,loop2,1];\r
-      Lines [loop1,loop2].y:=y [loop1,loop2,2];\r
-      Lines [loop1,loop2].z:=y [loop1,loop2,3];\r
-    END;\r
-  Whizz (TRUE);\r
-\r
-  For loop1:=1 to maxpolys do\r
-    For loop2:=1 to 4 do BEGIN\r
-      Lines [loop1,loop2].x:=x [loop1,loop2,1];\r
-      Lines [loop1,loop2].y:=x [loop1,loop2,2];\r
-      Lines [loop1,loop2].z:=x [loop1,loop2,3];\r
-    END;\r
-  Whizz (FALSE);\r
-\r
-  For loop1:=1 to maxpolys do\r
-    For loop2:=1 to 4 do BEGIN\r
-      Lines [loop1,loop2].x:=i [loop1,loop2,1];\r
-      Lines [loop1,loop2].y:=i [loop1,loop2,2];\r
-      Lines [loop1,loop2].z:=i [loop1,loop2,3];\r
-    END;\r
-  Whizz (TRUE);\r
-\r
-  For loop1:=1 to maxpolys do\r
-    For loop2:=1 to 4 do BEGIN\r
-      Lines [loop1,loop2].x:=a [loop1,loop2,1];\r
-      Lines [loop1,loop2].y:=a [loop1,loop2,2];\r
-      Lines [loop1,loop2].z:=a [loop1,loop2,3];\r
-    END;\r
-  Whizz (FALSE);\r
-\r
-  cls (vaddr,0);\r
-  cls (vga,0);\r
-  Xoff := 160;\r
-\r
-  Repeat\r
-    if keypressed then BEGIN\r
-      ch:=upcase (Readkey);\r
-      Case ch of 'A' : zoff:=zoff+5;\r
-                 'Z' : zoff:=zoff-5;\r
-                 ',' : xoff:=xoff-5;\r
-                 '.' : xoff:=xoff+5;\r
-                 'S' : yoff:=yoff-5;\r
-                 'X' : yoff:=yoff+5;\r
-      END;\r
-    END;\r
-    DrawPoints;\r
-    flip (vaddr,vga);\r
-    cls (vaddr,0);\r
-    RotatePoints (deg,deg,deg);\r
-    deg:=(deg+5) mod 360;\r
-  Until ch=#27;\r
-END;\r
-\r
-\r
-BEGIN\r
-  SetUpVirtual;\r
-  clrscr;\r
-  Writeln ('Hello there! Varsity has begun once again, so it is once again');\r
-  Writeln ('back to the grindstone ;-) ... anyway, this tutorial is, by');\r
-  Writeln ('popular demand, on poly-filling, in relation to 3-D solids.');\r
-  Writeln;\r
-  Writeln ('In this program, the letters of ASPHYXIA will fly past you. As you');\r
-  Writeln ('will see, they are solid, not wireframe. After the last letter has');\r
-  Writeln ('flown by, a large A will be left in the middle of the screen.');\r
-  Writeln;\r
-  Writeln ('You will be able to move it around the screen, and you will notice');\r
-  Writeln ('that it may have bits only half on the screen, i.e. clipping is');\r
-  Writeln ('perfomed. To control it use the following : "A" and "Z" control the Z');\r
-  Writeln ('movement, "," and "." control the X movement, and "S" and "X"');\r
-  Writeln ('control the Y movement. I have not included rotation control, but');\r
-  Writeln ('it should be easy enough to put in yourself ... if you have any');\r
-  Writeln ('hassles, leave me mail.');\r
-  Writeln;\r
-  Writeln ('I hope this is what you wanted...leave me mail for new ideas.');\r
-  writeln;\r
-  writeln;\r
-  Write ('  Hit any key to contine ...');\r
-  Readkey;\r
-  SetMCGA;\r
-  SetUpPoints;\r
-  MoveAround;\r
-  SetText;\r
-  ShutDown;\r
-  Writeln ('All done. This concludes the ninth sample program in the ASPHYXIA');\r
-  Writeln ('Training series. You may reach DENTHOR under the names of GRANT');\r
-  Writeln ('SMITH/DENTHOR/ASPHYXIA on the ASPHYXIA BBS. I am also an avid');\r
-  Writeln ('Connectix BBS user, and occasionally read RSAProg.');\r
-  Writeln ('The numbers are available in the main text. You may also write to me at:');\r
-  Writeln ('             Grant Smith');\r
-  Writeln ('             P.O. Box 270');\r
-  Writeln ('             Kloof');\r
-  Writeln ('             3640');\r
-  Writeln ('I hope to hear from you soon!');\r
-  Writeln; Writeln;\r
-  Write   ('Hit any key to exit ...');\r
-  Readkey;\r
-END.\r
-\r
diff --git a/16/PCGPE10/UT.TXT b/16/PCGPE10/UT.TXT
deleted file mode 100644 (file)
index 7d5e77c..0000000
+++ /dev/null
@@ -1,195 +0,0 @@
-\r
-UltraTracker 1.5\r
-----------------\r
-<From the IBM "ultra150.zip" archive by Marc Schallehn, text file by\r
-Muchael J. Sutter and update comments added by Marc Schallehn. -JH>\r
-\r
-               Mysterious's ULTRA TRACKER File Format\r
-                  by FreeJack of The Elven Nation\r
-   (some additional infos on the new format (V1.4/5) by MAS -> * marked)\r
-\r
-I've done my best to document the file format of Ultra Tracker (UT).\r
-If you find any errors please contact me.\r
-The file format has stayed consistent through the first four public releases.\r
-At the time of this writting, Ultra Tracker is up to version 1.3\r
-(* With version V1.4/5 there are some changes done in the format. *)\r
-\r
-Thanks go to :\r
-SoJa of YLYSY for help translating stuff.\r
-\r
-Marc Andr\82 Schallehn\r
-Thanks for putting out this GREAT program.\r
-Also thanks for the info on 16bit samples.\r
-\r
-With all this crap out of the way lets get to the format.\r
-\r
-\r
-Sample Structure :\r
-______________________________________________________________________________\r
-Samplename : 32 bytes (Sample name)\r
-DosName    : 12 bytes (when you load a sample into UT,\r
-                      it records the file name here)\r
-LoopStart  : dbl word (loop start point)\r
-LoopEnd    : dbl word (loop end point)\r
-SizeStart  : dbl word (see below)\r
-SizeEnd    : dbl word (see below)\r
-volume     : byte (UT uses a logarithmic volume setting, ranging from 0-255)\r
-             (* V1.4: uses linear Volume ranging from 0-255 *)\r
-Bidi Loop  : byte (see below)\r
-FineTune   : word (Fine tune setting, uses full word value)\r
-______________________________________________________________________________\r
-\r
-8 Bit Samples  :\r
-\r
-SizeStart  :\r
-The SizeStart is the starting offset of the sample. \r
-This seems to tell UT how to load the sample into the Gus's onboard memory. \r
-All the files I have worked with start with a value of 32 for the first sample, \r
-and the previous SizeEnd value for all sample after that. (See Example below)\r
-If the previous sample was 16bit, then SizeStart = (Last SizeEnd * 2)\r
-SizeEnd : \r
-Like the SizeStart, SizeEnd seems to tell UT where to load the sample into the \r
-Gus's onboard memory. SizeEnd equal SizeStart + the length of the sample.\r
-\r
-Example :\r
-If a UT file had 3 samples, 1st 12000 bytes, 2nd 5600  bytes, 3rd 8000 byte. \r
-The SizeStart and SizeEnd would look like this:\r
-\r
-Sample        SizeStart         SizeEnd\r
-1st            32                12032\r
-2nd            12032             17632\r
-3rd            17632             25632\r
-\r
-***Note***\r
-Samples may NOT cross 256k boundaries. If a sample is too large to fit into the\r
-remaining space, its Sizestart will equal the start of the next 256k boundary.\r
-UT does keep track of the free space at the top of the 256k boundaries, and\r
-will load a sample in there if it will fit.\r
-Example : EndSize = 252144\r
-If the next sample was 12000 bytes, its SizeStart would be 262144, not 252144.\r
-Note that this leaves 10000 bytes unused. If any of the following sample could\r
-fit between 252144 and 262144, its Sizestart would be 252144.\r
-Say that 2 samples after the 12000 byte sample we had a sample that was only\r
-5000 bytes long. Its SizeStart would be 252144 and its SizeEnd would be 257144.\r
-This also applies to 16 Bit Samples.\r
-\r
-16 Bit Samples :\r
-16 bit samples are handled a little different then 8 bit samples.\r
-The SizeStart variable is calculated by dividing offset (last SizeEnd)\r
-by 2. The SizeEnd variable equals SizeStart + (SampleLength / 2).\r
-If the first sample is 16bit, then SizeStart = 16.\r
-Example :\r
-          sample1 = 8bit, 1000 bytes\r
-          sample2 = 16bit, 5000 bytes\r
-\r
-          sample1 SizeStart = 32\r
-                  SizeEnd   = 1032 (32 + 1000)\r
-\r
-          sample2 SizeStart = 516 (offset (1032) / 2)\r
-                  SizeEnd   = 3016 (516 + (5000/2))\r
-\r
-***Note***\r
-If a 16bit sample is loaded into banks 2,3, or 4\r
-the SizeStart variable will be\r
-(offset / 2) + 262144 (bank 2)\r
-(offset / 2) + 524288 (bank 3)\r
-(offset / 2) + 786432 (bank 4)\r
-The SizeEnd variable will be\r
-SizeStart + (SampleLength / 2) + 262144 (bank 2)\r
-SizeStart + (SampleLength / 2) + 524288 (bank 3)\r
-SizeStart + (SampleLength / 2) + 786432 (bank 4)\r
-\r
-BiDi Loop : (Bidirectional Loop)\r
-UT takes advantage of the Gus's ability to loop a sample in several different\r
-ways. By setting the Bidi Loop, the sample can be played forward or backwards,\r
-looped or not looped. The Bidi variable also tracks the sample\r
-resolution (8 or 16 bit).\r
-\r
-The following table shows the possible values of the Bidi Loop.\r
-Bidi = 0  : No looping, forward playback,  8bit sample\r
-Bidi = 4  : No Looping, forward playback, 16bit sample\r
-Bidi = 8  : Loop Sample, forward playback, 8bit sample\r
-Bidi = 12 : Loop Sample, forward playback, 16bit sample\r
-Bidi = 24 : Loop Sample, reverse playback 8bit sample\r
-Bidi = 28 : Loop Sample, reverse playback, 16bit sample\r
-______________________________________________________________________________\r
-Event Structure:\r
-______________________________________________________________________________\r
-Note                : byte (See note table below)\r
-SampleNumber        : byte (Sample Number)\r
-Effect1             : nib (Effect1)\r
-Effect2             : nib (Effect2)\r
-EffectVar           : word (Effect variables)\r
-\r
-The High order byte of EffectVar is the Effect variable for Effect1.\r
-The Low order byte of EffectVar is the Effect variable for Effect2.\r
-***(Note)***\r
-UT uses a form of compression on repetitive events. Say we read in the first\r
-byte, if it = $FC then this signifies a repeat block. The next byte is the\r
-repeat count. followed by the event structure to repeat.\r
-If the first byte read does NOT = $FC then this is the note of the event.\r
-So repeat blocks will be 7 bytes long : RepFlag      : byte ($FC)\r
-                                        RepCount     : byte\r
-                                        note         : byte\r
-                                        samplenumber : byte\r
-                                        effect1      : nib\r
-                                        effect2      : nib\r
-                                        effectVar    : word\r
-\r
-Repeat blocks do NOT bridge patterns. \r
-______________________________________________________________________________\r
-Note Table:\r
-______________________________________________________________________________\r
-note value of 0 = pause\r
-C-0 to B-0    1 to 12\r
-C-1 to B-1    13 to 24\r
-C-2 to B-2    26 to 36\r
-C-3 to B-3    39 to 48\r
-C-4 to B-4    52 to 60\r
-______________________________________________________________________________\r
-Offset     Bytes            Type                   Description\r
-______________________________________________________________________________\r
-0             15           byte           ID block : should contain\r
-                                                     'MAS_UTrack_V001'\r
-                                          \r
-                                          (* V1.4: 'MAS_UTrack_V002')\r
-\r
-                                          (* V1.5: 'MAS_UTrack_V003')\r
-\r
-15            32           AsciiZ         Song Title\r
-47            1            reserved       This byte is reserved and\r
-                                          always contain 0;\r
-\r
-                                          (* V1.4: jump-value: reserved * 32; \r
-                                           space between is used for song\r
-                                           text;\r
-                                           [reserved * 32] = RES ! )\r
-\r
-48+RES        1            byte           Number of Samples (NOS)\r
-49+RES        NOS * 64     SampleStruct   Sample Struct (see Sample Structure)\r
-\r
-Patt_Seq = 48 + (NOS * 64) + RES\r
-                       \r
-Patt_Seq          256        byte            Pattern Sequence\r
-Patt_Seq+256      1          byte            Number Of Channels (NOC) Base 0\r
-Patt_Seq+257      1          byte            Number Of patterns (NOP) Base 0\r
-\r
-                                             (* V1.5: PAN-Position Table\r
-                                              Length: NOC * 1byte\r
-                                              [0 left] - [0F right] )\r
-\r
-NOC+Patt_Seq+258      varies     EventStruct     Pattern Data (See Event\r
-Structure)\r
-\r
-______________________________________________________________________________\r
-The remainder of the file is the raw sample data. (signed)\r
-______________________________________________________________________________\r
-\r
-That should about cover it. If you have any questions, feel free to e-mail\r
-me at freejack@shell.portal.com\r
-\r
-I can also be contacted on The UltraSound Connection   (813) 787-8644 \r
-The UltraSound Connection is a BBS dedicated to the Gravis Ultrasound Card.\r
-\r
-Also I'm the author of Ripper and Gvoc. If anyone has any questions or\r
-problems, please contact me.\r
diff --git a/16/PCGPE10/VESASP12.TXT b/16/PCGPE10/VESASP12.TXT
deleted file mode 100644 (file)
index 3949748..0000000
+++ /dev/null
@@ -1,1134 +0,0 @@
-VESA                                                         Super VGA Standard\r
-Video Electronics Standards Association\r
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r
-2150 North First Street, Suite 360                        Phone: (408) 435-0333\r
-San Jose, CA 95131-2020                                     Fax: (408) 435-8225\r
-\r
-                            Super VGA BIOS Extension\r
-                               Standard #VS911022\r
-                                October 22, 1991\r
-                              Document Version 1.0\r
-                                VBE Version 1.2\r
-\r
-PURPOSE\r
-~~~~~~~\r
-To standardize a common software interface to Super VGA video adapters in order\r
-to provide simplified software application access to advanced VGA products.\r
-\r
-SUMMARY\r
-~~~~~~~\r
-The standard provides a  set of functions which an application program can use\r
-to A) obtain information about the capabilities and characteristics of a\r
-specific Super VGA implementation and B) to control the operation of such\r
-hardware in terms of video mode initialization and video memory access.  The\r
-functions are provided as an extension to the VGA BIOS video services, accessed\r
-through interrupt 10h.\r
-\f\r
-                      VESA Super VGA Standard VS911022-2\r
-\r
-Contents\r
-~~~~~~~~\r
-1.      Introduction ................................................. Page 3\r
-\r
-2.      Goals and Objectives .........................................      4\r
-        2.1     Video environment information ........................      4\r
-        2.2     Programming support ..................................      4\r
-        2.3     Compatibility ........................................      5\r
-        2.4     Scope of standard ....................................      5\r
-\r
-3.      Standard VGA BIOS ............................................      6\r
-\r
-4.      Super VGA Mode Numbers .......................................      7\r
-\r
-5.      CPU Video Memory Control .....................................      9\r
-        5.1     Hardware design consideration ........................      9\r
-                5.1.1   Limited to 64k/128k of CPU address space .....      9\r
-                5.1.2   Crossing CPU video memory window boundaries ..     10\r
-                5.1.3   Operating on data frolm different areas ......     10\r
-                5.1.4   Combining data from two different windows ....     10\r
-        5.2     Different types of hardware windows ..................     11\r
-                5.2.1   Single window systems ........................     11\r
-                5.2.2   Dual window systems ..........................     11\r
-\r
-6.      Extended VGA BIOS ............................................     12\r
-        6.1     Status Information ...................................     12\r
-        6.2     00h - Return Super VGA Information ...................     12\r
-        6.3     01h - Return Super VGA mode information ..............     14\r
-        6.4     02h - Set Super VGA mode .............................     20\r
-        6.5     03h - Return Super VGA mode ..........................     20\r
-        6.6     04h - Save/restore Super VGA video state .............     21\r
-        6.7     05h - Super VGGA video memory window control .........     22\r
-        6.8     06h - Set/Get Logical Scan Line Length ...............     23\r
-        6.9     07h - Set/Get Display Start ..........................     24\r
-        6.10    08h - Set/Get DAC Palette Control ....................     25\r
-\r
-7.      Application Example ..........................................     26\r
-\f\r
-                      VESA Super VGA Standard VS911022-3\r
-\r
-1.      Introduction\r
-~~~~~~~~~~~~~~~~~~~~\r
-This document contains a specification for a standardized interface to extended\r
-VGA video modes and functions.  The specification consists of mechanisms for\r
-supporting standard extended video modes and functions that have been approved\r
-by the main VESA committee and non-standard video modes that an individual VGA\r
-supplier may choose to add, in a uniform manner that application software can\r
-utilize without having to understand the intricate details of the particular VGA\r
-hardware.\r
-\r
-The primary topics of this specification are definitions of extended VGA video\r
-modes and the functions necessary for application software to understand the\r
-characteristics of the video mode and manipulate the extended memory associated\r
-with the video mode.\r
-\r
-Readers of this document should already be familiar with programming VGAs at the\r
-hardware level and Intel iAPX real mode assembly language.  Readers who are\r
-unfamiliar with programming the VGA should first read one of the many VGA\r
-programming tutorials before attempting to understand these extensions to the\r
-standard VGA.\r
-\f\r
-                      VESA Super VGA Standard VS911022-4\r
-\r
-2.      Goals and Objectives\r
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r
-The IBM VGA has become a defacto standard in the PC graphics world.  A multitude\r
-of different VGA offerings exist in the marketplace, each one providing BIOS or\r
-register compatibility with the IBM VGA.  More and more of these VGA compatible\r
-products implements various supersets of the VGA standard.  These extensions\r
-range from higher resolutions and more colors to improved performance and even\r
-some graphics processing capabilities.  Intense competition has dramatically\r
-improved the price/performance ratio, to the benefit of the end user.\r
-\r
-However, several serious problems face a software developer who intends to take\r
-advantage of these "Super VGA" environments.  Because there is no standard\r
-hardware implementation, the developer is faced with widely disparate Super VGA\r
-hardware architectures.  Lacking a common software interface, designing\r
-applications for these environments is costly and technically difficult.  Except\r
-for applications supported by OEM-specific display drivers, very few software\r
-packages can take advantage of the power and capabilities of Super VGA products.\r
-\r
-The purpose of the VESA VGA BIOS Extension is to remedy this situation.  Being a\r
-common software interface to Super VGA graphics products, the primary objective\r
-is to enable application and system software to adapt to and exploit the wide\r
-range of features available in these VGA extensions.\r
-\r
-Specifically, the VESA BIOS Extension attempts to address the following issues:\r
-A) Return information about the video environment to the application, and B)\r
-Assist the application in initializing and programming the hardware.\r
-\r
-2.1             Video environment information\r
-\r
-Today, an application has no standard mechanism to determine what Super VGA\r
-hardware it is running on.  Only by knowing OEM-specific features can an\r
-application determine the presence of a particular video board.  This often\r
-involves reading and testing registers located at I/O addresses unique to each\r
-OEM.  By not knowing what hardware an application is running on, few, if any, of\r
-the extended features of the underlying hardware can be used.\r
-\r
-The VESA BIOS Extension provides several functions to return information about\r
-the video environment.  These functions return system level information as well\r
-as video mode specific details.  Function 00h returns general system level\r
-information, including an OEM identification string.  The function also returns\r
-a pointer to the supported video modes.  Function 01h may be used by the\r
-application to obtain information about each supported video mode.  Function 03h\r
-returns the current video mode.\r
-\f\r
-                      VESA Super VGA Standard VS911022-5\r
-\r
-2.2             Programming support\r
-\r
-Due to the fact that different Super VGA products have different hardware\r
-implementations, application software has great difficulty in adapting to each\r
-environment.  However, since each is based on the VGA hardware architecture,\r
-differences are most common in video mode initialization and memory mapping.\r
-The rest of the architecture is usually kept intact, including I/O mapped\r
-registers, video buffer location in the CPU address space, DAC location and\r
-function, etc.\r
-\r
-The VESA BIOS Extension provides several functions to interface to the different\r
-Super VGA hardware implementations.  The most important of these is Function\r
-02h, Set Super VGA video mode.  This function isolates the application from the\r
-tedious and complicated task of setting up a video mode.  Function 05h provides\r
-an interface to the underlying memory mapping hardware.  Function 04h enables an\r
-application to save and restore a Super VGA state without knowing anything of\r
-the specific implementation.\r
-\r
-2.3             Compatibility\r
-\r
-A primary design objective of the VESA BIOS Extension is to preserve maximum\r
-compatibility to the standard VGA environment.  In no way should the BIOS\r
-extensions compromise compatibility or performance.  Another but related concern\r
-is to minimiza the changes necessary to an existing VGA BIOS.  Ram, as well as\r
-ROM-based implementations of the BIOS extension should be possible.\r
-\r
-2.4             Scope of standard\r
-\r
-The purpose of the VESA BIOS Extension is to provide support for extended VGA\r
-environments.  Thus, the underlying hardware architecture is assumed to be a\r
-VGA.  Graphics software that drives a Super VGA board will perform its graphics\r
-output in generally the same way it drives a standard VGA, i.e. writing directly\r
-to a VGA style frame buffer, manipulating graphics controller registers,\r
-directly programming the palette, etc.  No significant graphics processing will\r
-be done in hardware.  For this reason, the VESA BIOS Extension does not provide\r
-any graphics output functions, such as BitBlt, line or circle drawing, etc.\r
-\r
-An important constraint of the functionalities that can be placed into the VESA\r
-BIOS Extension is that ROM space is severely limited in certain existing BIOS\r
-implementations.\r
-\r
-Outside the scope of this VESA BIOS Extension is the handling of different\r
-monitors and monitor timings.  Such items are dealt with in other VESA fora.\r
-The purpose of the VESA BIOS Extension is to provide a standardized software\r
-interface to Super VGA graphics modes, independent of monitor and monitor timing\r
-issues.\r
-\f\r
-                      VESA Super VGA Standard VS911022-6\r
-\r
-3.      Standard VGA BIOS\r
-~~~~~~~~~~~~~~~~~~~~~~~~~\r
-A primary design goal with the VESA BIOS Extension is to minimize the effects on\r
-the standard VGA BIOS.  Standard VGA BIOS functions should need to be modified\r
-as little as possible.  This is important since ROM, as well as RAM based\r
-versions of the extensions, may be implemented.\r
-\r
-However, two standard VGA BIOS functions are affected by the VESA extension.\r
-These are Function 00h (Set video mode) and Function 0Fh (Read current video\r
-state).  VESA-aware applications will not set the video mode using VGA BIOS\r
-function 00h.  Nor will such applications use VGA BIOS function 0Fh.  VESA BIOS\r
-functions 02h (Set Super VGA mode) and 03h (Get Super VGA mode) will be used\r
-instead.\r
-\r
-However, VESA-unaware applications (such as old Pop-Up programs and other TSRs,\r
-or the CLS command of MS-DOS), might use VGA BIOS function 0Fh to get the\r
-present video mode.  Later it may call VGA BIOS function 00h to\r
-restore/reinitialize the old video mode.\r
-\r
-To make such applications work, VESA recommends that whatever value returned by\r
-VGA BIOS function 0Fh (it is up to the OEM to define this number) should be used\r
-to reinitialize the video mode through VGA BIOS function 00h.  Thus, the BIOS\r
-should keep track of the last Super VGA mode in effect.\r
-\r
-It is recommended, but not mandatory, to support output functions (such as\r
-TTY-output, scroll, set pixel, etc.) in Super VGA modes.  If the BIOS extension\r
-doesn't support such output functions, bit D2 (Output functions supported) of\r
-the ModeAttributes field (returned by VESA BIOS function 01h) should be clear.\r
-\f\r
-                      VESA Super VGA Standard VS911022-7\r
-\r
-4.      Super VGA mode numbers\r
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r
-Standard VGA mode numbers are 7 bits wide and presently range from 00h to 13h.\r
-OEMs have defined extended video modes in the range 14h to 7Fh.  Values in the\r
-range 80h to FFh cannot be used, since VGA BIOS function 00h (Set video mode)\r
-interprets bit 7 as a flag to clear/not clear video memory.\r
-\r
-Due to the limitations of 7 bit mode numbers, VESA video mode numbers are 15\r
-bits wide.  To initialize a Super VGA mode, its number is passed in the BX\r
-register to VESA BIOS function 02h (Set Super VGA mode).\r
-\r
-The format of VESA mode numbers is as follows:\r
-\r
-D0-D8  = Mode number\r
-              If D8 == 0, this is not a VESA defined mode\r
-              If D8 == 1, this is a VESA defined mode\r
-D9-D14 = Reserved by VESA for future expansion (= 0)\r
-D15    = Reserved (= 0)\r
-\r
-Thus, VESA mode numbers begin at 100h.  This mode numbering scheme implements\r
-standard VGA mode numbers as well as OEM-defined mode numbers as subsets of the\r
-VESA mode number.  That means that regular VGA modes may be initialized through\r
-VESA BIOS function 02h (Set Super VGA mode), simply by placing the mode number\r
-in BL and clearing the upper byte (BH).  OEM-defined modes may be initialized in\r
-the same way.\r
-\r
-To date, VESA has defined a 7-bit video mode number, 6Ah, for the 800x600,\r
-16-color, 4-plane graphics mode.  The corresponding 15-bit mode number for this\r
-mode is 102h.\r
-\r
-The following VESA mode numbers have been defined:\r
-\r
-                GRAPHICS                                TEXT\r
-\r
-15-bit   7-bit    Resolution   Colors   15-bit   7-bit    Columns   Rows\r
-mode     mode                           mode     mode\r
-number   number                         number   number\r
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r
-100h     -        640x400      256      108h     -        80        60\r
-101h     -        640x480      256\r
-                                        109h     -        132       25\r
-102h     6Ah      800x600      16       10Ah     -        132       43\r
-103h     -        800x600      256      10Bh     -        132       50\r
-                                        10Ch     -        132       60\r
-104h     -        1024x768     16\r
-105h     -        1024x768     256\r
-\r
-106h     -        1280x1024    16\r
-107h     -        1280x1024    256\r
-\f\r
-                      VESA Super VGA Standard VS911022-8\r
-\r
-10Dh     -        320x200      32K   (1:5:5:5)\r
-10Eh     -        320x200      64K   (5:6:5)\r
-10Fh     -        320x200      16.8M (8:8:8)\r
-110h     -        640x480      32K   (1:5:5:5)\r
-111h     -        640x480      64K   (5:6:5)\r
-112h     -        640x480      16.8M (8:8:8)\r
-113h     -        800x600      32K   (1:5:5:5)\r
-114h     -        800x600      64K   (5:6:5)\r
-115h     -        800x600      16.8M (8:8:8)\r
-116h     -        1024x768     32K   (1:5:5:5)\r
-117h     -        1024x768     64K   (5:6:5)\r
-118h     -        1024x768     16.8M (8:8:8)\r
-119h     -        1280x1024    32K   (1:5:5:5)\r
-11Ah     -        1280x1024    64K   (5:6:5)\r
-11Bh     -        1280x1024    16.8M (8:8:8)\r
-\f\r
-                      VESA Super VGA Standard VS911022-9\r
-\r
-5.      CPU Video Memory Windows\r
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r
-A standard VGA sub-system provides 256k bytes of memory and a corresponding\r
-mechanism to address this memory.  Super VGAs and their modes require more than\r
-the standard 256k bytes of memory but also require that the address space for\r
-this memory be restricted to the standard address space for compatibility\r
-reasons.  CPU video memory windows provide a means of accessing this extended\r
-VGA memory within the standard CPU address space.\r
-\r
-This chapter describes how several hardware implementations of CPU video memory\r
-windows operate, their impact on application software design, and relates them\r
-to the software model presented by the VESA VGA BIOS extensions.\r
-\r
-The VESA CPU video memory windows functions have been designed to put the\r
-performance insensitive, non-standard hardware functions into the BIOS while\r
-putting the performance sensitive, standard hardware functions into the\r
-application.  This provides portability among VGA systems together with the\r
-performance that comes from accessing the hardware directly.  In particular, the\r
-VESA BIOS is responsible for mapping video memory into the CPU address space\r
-while the application is responsible for performing the actual memory read and\r
-write operations.\r
-\r
-This combination software and hardware interface is accomplished by informing\r
-the application of the parameters that control the hardware mechanism of mapping\r
-the video memory into the CPU address space and then letting the application\r
-control the mapping within those parameters.\r
-\r
-5.1             Hardware\r
-5.1.1           Limited to 64k/128k of CPU address space\r
-\r
-The first consideration in implementing extended video memory is to give access\r
-to the memory to application software.\r
-\r
-The standard VGA CPU address space for 16 color graphics modes is typically at\r
-segment A000h for 64k.  This gives access to the 256k bytes of a standard VGA,\r
-i.e. 64k per plane.  Access to the extended video memory is accomplished by\r
-mapping portions of the video memory into the standard VGA CPU address space.\r
-\r
-Every Super VGA hardware implementation provides a mechanism for software to\r
-specify the offset from the start of video memory which is to be mapped to the\r
-start of the CPU address space.  Providing both read and write access to the\r
-mapped memory provides a necessary level of hardware support for an application\r
-to manipulate the extended video memory.\r
-\f\r
-                      VESA Super VGA Standard VS911022-10\r
-\r
-5.1.2           Crossing CPU video memory window boundaries\r
-\r
-The organization of most software algorithms which perform video operations\r
-consists of a pair of nested loops: and outer loop over rows or scan lines and\r
-an inner loop across the row or scan line.  The latter is the proverbial inner\r
-loop, which is the bottle neck to high performance software.\r
-\r
-If a target rectangle is large enough, or poorly located, part of the required\r
-memory may be with within the video memory mapped into the CPU address space and\r
-part of it may not be addressable by the CPU without changing the mapping.  It\r
-is desirable that the test for remapping the video memory is located outside of\r
-the inner loop.\r
-\r
-This is typically accomplished by selecting the mapping offset of the start of\r
-video memory to the start of the CPU address space so that at least one entire\r
-row or scan line can be processed without changing the video memory mapping.\r
-There are currently no Super VGAs that allow this offset to be specified on a\r
-byte boundary and there is a wide range among Super VGAs in the ability to\r
-position a desired video memory location at the start of the CPU address space.\r
-\r
-The number of bytes between the closest two bytes in video memory that can be\r
-placed on any single CPU address is defined as the granularity of the window\r
-function.  Some Super VGA systems allow any 4k video memory boundary to be\r
-mapped to the start of the CPY address space, while other Super VGA systems\r
-allow any 64k video memory boundary to be mapped to the start of the CPU address\r
-space.  These two example systems would have granularities of 4k and 64k,\r
-respectively.  This concept is very similar to the bytes that can be accessed\r
-with a 16 bit pointer in an Intel CPU before a segment register must be changed\r
-(the granularity of the segment register or mapping here is 16 bytes).\r
-\r
-Notes\r
-~~~~~\r
-If the granularity is equal to the length of the CPU address space, i.e. the\r
-least significant address bit of the hardware mapping function is more\r
-significant than the most significant bit of the CPU address, then the inner\r
-loop will have to contain the test for crossing the end or beginning of the CPU\r
-address space.  This is because if the length of the CPU address space (which is\r
-the granularity in this case) is not evenly divisible by the length of a scan\r
-line, then the scan line at the end of the CPU address will be in two different\r
-video memory which cannot be mapped into the CPU address space simultaneously.\r
-\r
-5.1.3           Operating on data from different areas\r
-\r
-It is sometimes required or convenient to move or combine data from two\r
-different areas of video memory.  One example of this is storing menus in the\r
-video memory beyond the displayed memory because there is hardware support in\r
-all VGAs for transferring 32 bits of video data with an 8 bit CPU read and\r
-write.  Two separately mappable CPU video memory windows must be used if the\r
-distance between the source and destination is larger than the size of the CPU\r
-video memory window.\r
-\r
-5.1.4           Combining data from two different windows\r
-\r
-The above example of moving data from one CPU video memory window to another CPU\r
-video memory only required read access to one window and only required write\r
-access to the other window.  Sometimes it is convenient to have read access to\r
-both windows and write access to one window.  An example of this would be a\r
-raster operation where the resulting destination is the source data logically\r
-combined with the original destination data.\r
-\f\r
-                      VESA Super VGA Standard VS911022-11\r
-\r
-5.2             Different types of hardware windows\r
-\r
-Different hardware implementations of CPU video memory windows can be supported\r
-by the VESA BIOS extension.  The information necessary for an application to\r
-understand the type of hardware implementation is provided by the BIOS to the\r
-application.  There are three basic types of hardware windowing implementations\r
-and they are described below.\r
-\r
-The types of windowing schemes described below do not include differences in\r
-granularity.\r
-\r
-Also note that is possible for a VGA to use a CPU address space of 128k starting\r
-at segment A000h.\r
-\r
-5.2.1           Single window systems\r
-\r
-Some hardware implementations only provide a single window.  This single window\r
-will be readable as well as writeable.  However, this causes a significant\r
-performance degradation when moving data in video memory a distance that is\r
-larger than the CPU address space.\r
-\r
-5.2.2           Dual window systems\r
-\r
-Many Super VGAs provide two windows to facilitate moving data within video\r
-memory.  There are two separate methods of providing two windows.\r
-\r
-5.2.2.1         Overlapping windows\r
-\r
-Some hardware implementations distinguish window A and window B by determining\r
-if the CPU is attempting to do a memory read or a memory write operation.  When\r
-the two windows are distinguished by whether the CPU is trying to read or write\r
-they can, and usually do, share the same CPU address space.  However, one window\r
-will be read only and the other will be write only.\r
-\r
-5.2.2.2         Non-overlapping windows\r
-\r
-Another mechanism used by two window systems to distinguish window A and window\r
-B is by looking at the CPU address within the total VGA CPU address space.  When\r
-the two windows are distinguished by the CPU address within the VGA CPU address\r
-space the windows cannot share the same address space, but they can each be both\r
-read and written.\r
-\f\r
-                      VESA Super VGA Standard VS911022-12\r
-\r
-6.      Extended VGA BIOS\r
-~~~~~~~~~~~~~~~~~~~~~~~~~\r
-Several new BIOS calls have been defined to support Super VGA modes.  For\r
-maximum compatibility with the standard VGA BIOS, these calls are grouped under\r
-one function number.  This number is passed in the AH register to the INT 10h\r
-handler.\r
-\r
-The designated Super VGA extended function number is 4Fh.  This function number\r
-is presently unused in most, if not all, VGA BIOS implementations.  A standard\r
-VGA BIOS performs no action when function call 4Fh is made.  Super VGA Standard\r
-VS900602 defines subfunctions 00h through 07h.  Subfunction numbers 08h through\r
-0FFh are reserved for future use.\r
-\r
-6.1             Status Information\r
-\r
-Every function returns status information in the AX register.  The format of the\r
-status word is as follows:\r
-\r
-        AL == 4Fh:      Function is supported\r
-        Al != 4Fh:      Function is not supported\r
-        AH == 00h:      Function call successful\r
-        AH == 01h:      Function call failed\r
-\r
-Software should treat a non-zero value in the AH register as a general failure\r
-condition.  In later versions of the VESA BIOS Extension new error codes might\r
-be defined.\r
-\r
-6.2             Function 00h - Return Super VGA Information\r
-\r
-The purpose of this function is to provide information to the calling program\r
-about the general capabilities of the Super VGA environment.  The function fills\r
-an information block structure at the address specified by the caller.  The\r
-information block size is 256 bytes.\r
-\r
-        Input:  AH = 4Fh        Super VGA support\r
-                AL = 00h        Return Super VGA information\r
-                ES:DI = Pointer to buffer\r
-\r
-        Output: AX = Status\r
-                (All other registers are preserved)\r
-\f\r
-                      VESA Super VGA Standard VS911022-13\r
-\r
-The information block has the following structure:\r
-\r
-VgaInfoBlock    STRUC\r
-      VESASignature   db   'VESA'      ; 4 signature bytes\r
-      VESAVersion     dw   ?           ; VESA version number\r
-      OEMStringPtr    dd   ?           ; Pointer to OEM string\r
-      Capabilities    db   4 dup(?)    ; capabilities of the video environment\r
-      VideoModePtr    dd   ?           ; pointer to supported Super VGA modes\r
-      TotalMemory     dw   ?           ; Number of 64kb memory blocks on board\r
-      Reserved        db   236 dup(?)  ; Remainder of VgaInfoBlock\r
-VgaInfoBlock    ENDS\r
-\r
-The VESASignature field contains the characters 'VESA' if this is a valid block.\r
-\r
-The VESAVersion is a binary field which specifies what level of the VESA\r
-standard the Super VGA BIOS conforms to.  The higher byte specifies the major\r
-version number.  The lower byte specifies the minor version number.  The current\r
-VESA version number is 1.2.  Applications written to use the features of a\r
-specific version of the VESA BIOS Extension, are guaranteed to work in later\r
-versions.  The VESA BIOS Extension will be fully upwards compatible.\r
-\r
-The OEMStringPtr is a far pointer to a null terminated OEM-defined string.  The\r
-string may used to identify the video chip, video board, memory configuration,\r
-etc. to hardware specific display drivers.  There are no restrictions on the\r
-format of the string.\r
-\r
-The Capabilities field describes what general features are supported in the\r
-video environment.  The bits are defined as follows:\r
-\r
-        D0      = DAC is switchable\r
-                  0 = DAC is fixed width, with 6-bits per primary color\r
-                  1 = DAC width is switchable\r
-        D1-31   = Reserved\r
-\r
-The VideoModePtr points to a list of supported Super VGA (VESA-defined as well\r
-as OEM-specific) mode numbers.  Each mode number occupies one word (16 bits).\r
-The list of mode numbers is terminated by a -1 (0FFFFh).  Please refer to\r
-chapter 2 for a description of VESA mode numbers.  The pointer could point into\r
-either ROM or RAM, depending on the specific implementation.  Either the list\r
-would be a static string stored in ROM, or the list would be generated at\r
-run-time in the information block (see above) in RAM.  It is the application's\r
-responsibility to verify the current availability of any mode returned by this\r
-Function through the Return Super VGA mode information (Function 1) call.  Some\r
-of the returned modes may not be available due to the video board's current\r
-memory and monitor configuration.\r
-\r
-The TotalMemory field indicates the amount of memory installed on the VGA\r
-board.  Its value represents the number of 64kb blocks of memory currently\r
-installed.\r
-\f\r
-                      VESA Super VGA Standard VS911022-14\r
-\r
-6.3             Function 01h - Return Super VGA mode information\r
-\r
-This function returns information about a specific Super VGA video mode that was\r
-returned by Function 0.  The function fills a mode information block structure\r
-at the address specified by the caller.  The mode information block size is\r
-maximum 256 bytes.\r
-\r
-Some information provided by this function is implicitly defined by the VESA\r
-mode number.  However, some Super VGA implementations might support other video\r
-modes than those defined by VESA.  To provide access to these modes, this\r
-function also returns various other information about the mode.\r
-\r
-        Input:  AH = 4Fh        Super VGA support\r
-                AL = 01h        Return Super VGA mode information\r
-                CX = Super VGA video mode\r
-                     (mode number must be one of those returned by Function 0)\r
-                ES:DI = Pointer to 256 byte buffer\r
-\r
-        Output: AX = Status\r
-                (All other registers are preserved)\r
-\r
-The mode information block has the following structure:\r
-\r
-ModeInfoBlock   STRUC\r
-\r
-; mandatory information\r
-\r
-        ModeAttributes      dw  ?  ; mode attributes\r
-        WinAAttributes      db  ?  ; window A attributes\r
-        WinBAttributes      db  ?  ; window B attributes\r
-        WinGranularity      dw  ?  ; window granularity\r
-        WinSize             dw  ?  ; window size\r
-        WinASegment         dw  ?  ; window A start segment\r
-        WinBSegment         dw  ?  ; window B start segment\r
-        WinFuncPtr          dd  ?  ; pointer to windor function\r
-        BytesPerScanLine    dw  ?  ; bytes per scan line\r
-\r
-; formerly optional information (now mandatory)\r
-\r
-        XResolution         dw  ?  ; horizontal resolution\r
-        YResolution         dw  ?  ; vertical resolution\r
-        XCharSize           db  ?  ; character cell width\r
-        YCharSize           db  ?  ; character cell height\r
-        NumberOfPlanes      db  ?  ; number of memory planes\r
-        BitsPerPixel        db  ?  ; bits per pixel\r
-        NumberOfBanks       db  ?  ; number of banks\r
-        MemoryModel         db  ?  ; memory model type\r
-        BankSize            db  ?  ; bank size in kb\r
-        NumberOfImagePages  db  ?  ; number of images\r
-        Reserved            db  1  ; reserved for page function\r
-\f\r
-                      VESA Super VGA Standard VS911022-15\r
-\r
-; new Direct Color fields\r
-\r
-        RedMaskSize         db  ?  ; size of direct color red mask in bits\r
-        RedFieldPosition    db  ?  ; bit position of LSB of red mask\r
-        GreenMaskSize       db  ?  ; size of direct color green mask in bits\r
-        GreenFieldPosition  db  ?  ; bit position of LSB of green mask\r
-        BlueMaskSize        db  ?  ; size of direct color blue mask in bits\r
-        BlueFieldPosition   db  ?  ; bit position of LSB of blue mask\r
-        RsvdMaskSize        db  ?  ; size of direct color reserved mask in bits\r
-        DirectColorModeInfo db  ?  ; Direct Color mode attributes\r
-        Reserved            db  216 dup(?)      ; remainder of ModeInfoBlock\r
-ModeInfoBlock   ENDS\r
-\r
-The ModeAttributes field describes certain important characteristics of the\r
-video mode.  Bit D0 specifies whether this mode can be initialized in the\r
-present video configuration.  This bit can be used to block access to a video\r
-mode if it requires a certain monitor type, and that this monitor is presently\r
-not connected.  Prior to Version 1.2 of the VESA BIOS Extension, it was not\r
-required that the BIOS return valid information for the fields after\r
-BytesPerScanline.  Bit D1 was used to signify if the optional information was\r
-present.  Version 1.2 of the VBE requires that all fields of the ModeInfoBlock\r
-contain valid data, except for the Direct Color fields, which are valid only if\r
-MemoryModel field is set to a 6 (Direct Color) or 7 (YUV).  Bit D1 is now\r
-reserved, and must be set to a 1.  Bit D2 indicates whether the BIOS has support\r
-for output functions like TTY output, scroll, pixel output, etc. in this mode\r
-(it is recommended, but not mandatory, that the BIOS have support for all output\r
-functions).  If bit D2 is 1 then the BIOS must support all of the standard\r
-output functions.\r
-\r
-The field is defined as follows:\r
-\r
-        D0 = Mode supported in hardware\r
-                0 = Mode not supported in hardware\r
-                1 = Mode supported in hardware\r
-        D1 = 1 (Reserved)\r
-        D2 = Output functions supported by BIOS\r
-                0 = Output functions not supported by BIOS\r
-                1 = Output functions supported by BIOS\r
-        D3 = Monochrome/color mode (see note below)\r
-                0 = Monochrome mode\r
-                1 = Color mode\r
-        D4 = Mode type\r
-                0 = Text mode\r
-                1 = Graphics mode\r
-        D5-D15 = Reserved\r
-\f\r
-                      VESA Super VGA Standard VS911022-16\r
-\r
-Note: Monochrome modes have their CRTC address at 3B4h.  Color modes have their\r
-CRTC address at 3D4h.  Monochrome modes have attributes in which only bit 3\r
-(video) and bit 4 (intensity) of the attribute controller output are\r
-significant.  Therefore, monochrome text modes have attributes of off, video,\r
-high intensity, blink, etc.  Monochrome graphics modes are two plane graphics\r
-modes and have attributes of off, video, high intensity, and blink.  Extended\r
-two color modes that have their CRTC address at 3D4h are color modes with one\r
-bit per pixel and one plane.  The standard VGA modes 06h and 11h would be\r
-classified as color modes, while the standard VGA modes 07h and 0Fh would be\r
-classified as monochrome modes.\r
-\r
-The BytesPerScanline field specifies how many bytes each logical scanline\r
-consists of.  The logical scanline could be equal to or larger then the\r
-displayed scanline.\r
-\f\r
-                      VESA Super VGA Standard VS911022-17\r
-\r
-The WinAAttributes and WinBAttributes describe the characteristics of the CPU\r
-windowing scheme such as whether the windows exist and are read/writeable, as\r
-follows:\r
-\r
-        D0 = Window supported\r
-                0 = Window is not supported\r
-                1 = Window is supported\r
-        D1 = Window readable\r
-                0 = Window is not readable\r
-                1 = Window is readable\r
-        D2 = Window writeable\r
-                0 = Window is not writeable\r
-                1 = Window is writeable\r
-        D3-D7 = Reserved\r
-\r
-If windowing is not supported (bit D0 = 0 for both Window A and Window B), then\r
-an application can assume that the display memory buffer resides at the standard\r
-CPU address appropriate for the MemoryModel of the mode.\r
-\r
-WinGranularity specifies the smallest boundary, in KB, on which the window can\r
-be placed in the video memory.  The value of this field is undefined if Bit D0\r
-of the appropriate WinAttributes field is not set.\r
-\r
-WinSize specifies the size of the window in KB.\r
-\r
-WinASegment and WinBSegment address specify the segment addresses where the\r
-windows are located in CPU address space.\r
-\r
-WinFuncAddr specifies the address of the CPU video memory windowing function.\r
-The windowing function can be invoked either through VESA BIOS function 05h, or\r
-by calling the function directly.  A direct call will provide faster access to\r
-the hardware paging registers than using Int 10h, and is intended to be used by\r
-high performance applications.  If this field is Null, then Function 05h must be\r
-used to set the memory window, if paging is supported.\r
-\r
-The XResolution and YResolution specify the width and height of the video mode.\r
-In graphics modes, this resolution is in units of pixels.  In text modes, this\r
-resolution is in units of characters.  Note that text mode resolutions, in units\r
-of pixels, can be obtained by multiplying XResolution and YResolution by the\r
-cell width and height, if the extended information is present.\r
-\r
-The XCharCellSize and YCharSellSize specify the size of the character cell in\r
-pixels.\r
-\r
-The NumberOfPlanes field specifies the number of memory planes available to\r
-software in that mode.  For standard 16-color VGA graphics, this would be set to\r
-4.  For standard packed pixel modes, the field would be set to 1.\r
-\r
-The BitsPerPixel field specifies the total number of bits that define the color\r
-of one pixel.  For example, a standard VGA 4 Plane 16-color graphics mode would\r
-have a 4 in this field and a packed pixel 256-color graphics mode would specify\r
-8 in this field.  The number of bits per pixel per plane can normally be derived\r
-by dividing the BitsPerPixel field by the NumberOfPlanes field.\r
-\f\r
-                      VESA Super VGA Standard VS911022-18\r
-\r
-The MemoryModel field specifies the general type of memory organization used in\r
-this mode.  The following models have been defined:\r
-\r
-        00h =           Text mode\r
-        01h =           CGA graphics\r
-        02h =           Hercules graphics\r
-        03h =           4-plane planar\r
-        04h =           Packed pixel\r
-        05h =           Non-chain 4, 256 color\r
-        06h =           Direct Color\r
-        07h =           YUV\r
-        08h-0Fh =       Reserved, to be defined by VESA\r
-        10h-FFh =       To be defined by OEM\r
-\r
-In Version 1.1 and earlier of the VESA Super VGA BIOS Extension, OEM defined\r
-Direct Color video modes with pixel formats 1:5:5:5, 8:8:8, and 8:8:8:8 were\r
-described as a Packed Pixel model with 16, 24, and 32 bits per pixel,\r
-respectively.  In Version 1.2 and later of the VESA Super VGA BIOS Extension, it\r
-is recommended that Direct Color modes use the Direct Color MemoryModel and use\r
-the MaskSize and FieldPosition fields of the ModeInfoBlock to describe the pixel\r
-format.  BitsPerPixel is always defined to be the total memory size of the\r
-pixel, in bits.\r
-\r
-The NumberOfBanks field specifies the number of banks in which the scan lines\r
-are grouped.  The remainder from dividing the scan line number by the number of\r
-banks is the bank that contains the scan line and the quotient is the scan line\r
-number within the bank.  For example, CGA graphics modes have two banks and\r
-Hercules graphics mode has four banks.  For modes that don't have scanline banks\r
-(such as VGA modes 0Dh-13h), this field should be set to 1.\r
-\r
-The BankSize field specifies the size of a bank (group of scan lines) in units\r
-of 1KB.  For CGA and Hercules graphics modes this is 8, as each bank is 8192\r
-bytes in length.  For modes that don't have scanline banks (such as VGA modes\r
-0Dh-13h), this field should be set to 0.\r
-\r
-The NumberOfImagePages field specifies the number of additional complete display\r
-images that will fit into the VGA's memory, at one time, in this mode.  The\r
-application may load more than one image into the VGA's memory if this field is\r
-non-zero, and flip the display between them.\r
-\r
-The Reserved field has been defined to support a future VESA BIOS extension\r
-feature and will always be set to one in this version.\r
-\r
-The RedMaskSize, GreenMaskSize, BlueMaskSize, and RsvdMaskSize fields define the\r
-size, in bits, of the red, green, and blue components of a direct color pixel.\r
-A bit mask can be constructed from the MaskSize fields using simple shift\r
-arithmetic.  For example, the MaskSize values for a Direct Color 5:6:5 mode\r
-would be 5, 6, 5, and 0, for the red, green, blue, and reserved fields,\r
-respectively.  Note that in the YUV MemoryModel, the red field is used for V,\r
-the green field is used for Y, and the blue field is used for U.  The MaskSize\r
-fields should be set to 0 in modes using a MemoryModel that does not have pixels\r
-with component fields.\r
-\f\r
-                      VESA Super VGA Standard VS911022-19\r
-\r
-The RedFieldPosition, GreenFieldPosition, BlueFieldPosition, and\r
-RsvdFieldPosition fields define the bit position within the direct color pixel\r
-or YUV pixel of the least significant bit of the respective color component.  A\r
-color value can be aligned with its pixel field by shifting the value left by\r
-the FieldPosition.  For example, the FieldPosition values for a Direct Color\r
-5:6:5 mode would be 11, 5, 0, and 0, for the red, green, blue, and reserved\r
-fields, respectively.  Note that in the YUV MemoryModel, the red field is used\r
-for V, the green field is used for Y, and the blue field is used for U.  The\r
-FieldPosition fields should be set to 0 in modes using a MemoryModel that does\r
-not have pixels with component fields.\r
-\r
-The DirectColorModeInfo field describes important characteristics of direct\r
-color modes.  Bit D0 specifies whether the color ramp of the DAC is fixed or\r
-programmable.  If the color ramp is fixed, then it can not be changed.  If the\r
-color ramp is programmable, it is assumed that the red, green, and blue lookup\r
-tables can be loaded using a standard VGA DAC color registers BIOS call\r
-(AX=1012h).  Bit D1 specifies whether the bits in the Rsvd field of the direct\r
-color pixel can be used by the application or are reserved, and thus unusable.\r
-\r
-        D0 = Color ramp is fixed/programmable\r
-                0 = Color ramp is fixed\r
-                1 = Color ramp is programmable\r
-        D1 = Bits in Rsvd field are usable/reserved\r
-                0 = Bits in Rsvd field are reserved\r
-                1 = Bits in Rsvd field are usable by the application\r
-\r
-Notes\r
-~~~~~\r
-Version 1.1 and later VESA BIOS extensions will zero out all unused fields in\r
-the Mode Information Block, always returning exactly 256 bytes.  This\r
-facilitates upward compatibility with future versions of the standard, as any\r
-newly added fields will be designed such that values of zero will indicate\r
-nominal defaults or non-implementation of optional features (for example, a\r
-field containing a bit-mask of extended capabilities would reflect the absence\r
-of all such capabilities).  Applications that wish to be backwards compatible to\r
-Version 1.0 VESA BIOS extensions should pre-initialize the 256 byte buffer\r
-before calling Return Super VGA mode information.\r
-\f\r
-                      VESA Super VGA Standard VS911022-20\r
-\r
-6.4             Function 02h - Set Super VGA video mode\r
-\r
-This function initializes a video mode.  The BX register contains the mode to\r
-set.  The format of VESA mode numbers is described in chapter 2.  If the mode\r
-cannot be set, the BIOS should leave the video environment unchanged and return\r
-a failure error code.\r
-\r
-        Input:  AH = 4Fh        Super VGA support\r
-                AL = 02h        Set Super VGA video mode\r
-                BX = Video mode\r
-                     D0-D14 = Video mode\r
-                     D15 = Clear memory flag\r
-                           0 = Clear video memory\r
-                           1 = Don't clear video memory\r
-\r
-        Output: AX = Status\r
-                (All other registers are preserved)\r
-\r
-6.5             Function 03h - Return current video mode\r
-\r
-This function returns the current video mode in BX.  The format of VESA video\r
-mode numbers is described in chapter 2 of this document.\r
-\r
-        Input:  AH = 4Fh        Super VGA support\r
-                AL = 03h        Return current video mode\r
-\r
-        Output: AX = Status\r
-                BX = Current video mode\r
-                (All other registers are preserved)\r
-\r
-Notes\r
-~~~~~\r
-In a standard VGA BIOS, function 0Fh (Read current video state) returns the\r
-current video mode in the AL register.  In D7 of AL, it also returns the status\r
-of the memory clear bit (D7 of 40:87).  This bit is set if the mode was set\r
-without clearing memory.  In this Super VGA function, the memory clear bit will\r
-not be returned in BX since the purpose of the function is to return the video\r
-mode only.  If an application wants to obtain the memory clear bit, it should\r
-call VGA BIOS function 0Fh.\r
-\f\r
-                      VESA Super VGA Standard VS911022-21\r
-\r
-6.6             Function 04h - Save/Restore Super VGA video state\r
-\r
-These functions provide a mechanism to save and restore the Super VGA video\r
-state.  The functions are a superset of the three subfunctions under standard\r
-VGA BIOS function 1Ch (Save/restore video state).  The complete Super VGA video\r
-state (except video memory) should be saveable/restoreable by setting the\r
-requested states mask (in the CX register) to 000Fh.\r
-\r
-        Input:  AH = 4Fh        Super VGA support\r
-                AL = 04h        Save/restore Super VGA video state\r
-                DL = 00h        Return save/restore state buffer size\r
-                CX = Requested states\r
-                        D0 = Save/restore video hardware state\r
-                        D1 = Save/restore video BIOS data state\r
-                        D2 = Save/restore video DAC state\r
-                        D3 = Save/restore Super VGA state\r
-\r
-        Output: AX = Status\r
-                BX = Number of 64-byte blocks to hold the state buffer\r
-                (All other registers are preserved)\r
-\r
-\r
-        Input:  AH = 4Fh        Super VGA support\r
-                AL = 04h        Save/restore Super VGA video state\r
-                DL = 01h        Save Super VGA video state\r
-                CX = Requested states (see above)\r
-                ES:BX = Pointer to buffer\r
-\r
-        Output: AX = Status\r
-                (All other registers are preserved)\r
-\r
-\r
-        Input:  AH = 4Fh        Super VGA support\r
-                AL = 04h        Save/restore Super VGA video state\r
-                DL = 02h        Restore Super VGA video state\r
-                CX = Requested states (see above)\r
-                ES:BX = Pointer to buffer\r
-\r
-        Output: AX = Status\r
-                (All other registers are preserved)\r
-\r
-Notes\r
-~~~~~\r
-Due to the goal of complete compatibility with the VGA environment, the standard\r
-VGA BIOS function 1Ch (Save/restore VGA state) has not been extended to save the\r
-Super VGA video state.  VGA BIOS compatibility requires that function 1Ch\r
-returns a specific buffer size with specific contents, in which there is no room\r
-for the Super VGA state.\r
-\f\r
-                      VESA Super VGA Standard VS911022-22\r
-\r
-6.7             Function 05h - CPU Video Memory Window Control\r
-\r
-This function sets or gets the position of the specified window in the video\r
-memory.  The function allows direct access to the hardware paging registers.  To\r
-use this function properly, the software should use VESA BIOS Function 01h\r
-(Return Super VGA mode information) to determine the size, location, and\r
-granularity of the windows.\r
-\r
-        Input:  AH = 4Fh        Super VGA support\r
-                AL = 05h        Super VGA video memory window control\r
-                BH = 00h        Select Super VGA video memory window\r
-                BL = Window number\r
-                        0 = Window A\r
-                        1 = Window B\r
-                DX = Window position in video memory\r
-                     (in window granularity units)\r
-\r
-        Output: AX = Status\r
-                (See notes below)\r
-\r
-\r
-        Input:  AH = 4Fh        Super VGA support\r
-                AL = 05h        Super VGA video memory window control\r
-                BH = 01h        Return Super VGA video memory window\r
-                BL = Window number\r
-                        0 = Window A\r
-                        1 = Window B\r
-\r
-        Output: AX = Status\r
-                DX = Window position in video memory\r
-                     (in window granularity units)\r
-                (See notes below)\r
-\r
-Notes\r
-~~~~~\r
-This function is also directly accessible through a far call from the\r
-application.  The address of the BIOS function may be obtained by using VESA\r
-BIOS Function 01h, Return Super VGA mode information.  A field in the\r
-ModeInfoBlock contains the address of this function.  Note that this function\r
-may be different among video modes in a particular BIOS implementation, so the\r
-function pointer should be obtained after each set mode.\r
-\r
-In the far call version, no status information is returned to the application.\r
-Also, the AX and DX registers will be destroyed.  Therefore, if AX and/or DX\r
-must be preserved, the application must do so priot to making the far call.\r
-\r
-The application must load the input arguments in BH, BL, and DX (for set window)\r
-but does not need to load either AH or AL in order to use the far call version\r
-of this function.\r
-\f\r
-                      VESA Super VGA Standard VS911022-23\r
-\r
-6.8             Function 06h - Set/Get Logical Scan Line Length\r
-\r
-This function sets or gets the length of a logical scan line.  This function\r
-allows an application to set up a logical video memory buffer that is wider than\r
-the displayed area.  Function 07h then allows the application to set the\r
-starting position that is to be displayed.\r
-\r
-        Input:  AH = 4Fh        Super VGA support\r
-                AL = 06h        Logical Scan Line Length\r
-                BL = 00h        Select Scan Line Length\r
-                CX = Desired width in pixels\r
-\r
-        Output: AX = Status\r
-                BX = Bytes Per Scan Line\r
-                CX = Actual Pixels Per Scan Line\r
-                DX = Maximum Number of Scan Lines\r
-\r
-\r
-        Input:  AH = 4Fh        Super VGA support\r
-                AL = 06h        Logical Scan Line Length\r
-                BL = 01h        Return Scan Line Length\r
-\r
-        Output: AX = Status\r
-                BX = Bytes Per Scan Line\r
-                CX = Actual Pixels Per Scan Line\r
-                DX = Maximum Number of Scan Lines\r
-\r
-Notes\r
-~~~~~\r
-The desired width in pixels may not be achieveable because of VGA hardware\r
-considerations.  The next larger value will be selected thta will accommodate\r
-the desired number of pixels, and the actual number of pixels will be returned\r
-in CX.  BX returns a value that, when added to a pointer into video memory, will\r
-point to the next scan line.  For example, in a mode 13h this would be 320, but\r
-in mode 12h this would be 80.  DX returns the number of logical scan lines based\r
-upon the new scan line length and the total memory installed and useable in this\r
-display mode.  This function is also valid in text modes.  In text modes, the\r
-application should find out the current character cell width through normal BIOS\r
-functions, multiply that times the desired number of characters per line, and\r
-pass the value in the CX register.\r
-\f\r
-                      VESA Super VGA Standard VS911022-24\r
-\r
-6.9             Function 07h - Set/Get Display Start\r
-\r
-This function selects the pixel to be displayed in the upper left corner of the\r
-display from the logical page.  This function can be used to pan and scroll\r
-around logical screens that are larger than the displayed screen.  This function\r
-can also be used to rapidly switch between two different displayed screens for\r
-double buffered animation effects.\r
-\r
-        Input:  AH = 4Fh        Super VGA support\r
-                AL = 07h        Display Start Control\r
-                BH = 00h        Reserved and must be 0\r
-                BL = 00h        Select Display Start\r
-                CX = First Displayed Pixel in Scan Line\r
-                DX = First Displayed Scan Line\r
-\r
-        Output: AX = Status\r
-\r
-\r
-        Input:  AH = 4Fh        Super VGA support\r
-                AL = 07h        Display Start Control\r
-                BL = 01h        Return Display Start\r
-\r
-        Output: AX = Status\r
-                BH = 00h Reserved and will be 0\r
-                CX = First Displayed Pixel in Scan Line\r
-                DX = First Displayed Scan Line\r
-\r
-Notes\r
-~~~~~\r
-This function is also valid in text modes.  In text modes, the application\r
-should find out the current character cell width through normal BIOS functions,\r
-multiply that times the desired starting character column, and pass that value\r
-in the CX register.  It should also multiply the current character cell height\r
-times the desired starting character row, and pass that value in the DX\r
-register.\r
-\f\r
-                      VESA Super VGA Standard VS911022-25\r
-\r
-6.10            Function 08h - Set/Get DAC Palette Control\r
-\r
-This function queries and selects the operating mode of the DAC palette.  Some\r
-DACs are configurable to provide 6-bits, 8-bits, or more of color definition per\r
-red, green, and blue primary color.  The DAC palette width is assumed to be\r
-reset to standard VGA 6-bits per primary during a standard or VESA Set Super VGA\r
-Mode (AX = 4F02h) call.\r
-\r
-        Input:  AH = 4Fh        Super VGA support\r
-                AL = 08h        Set/Get DAC Palette Control\r
-                BL = 00h        Set DAC palette width\r
-                BH = Desired number of bits of color per primary\r
-                     (Standard VGA = 6)\r
-\r
-        Output: AX = Status\r
-                BH = Current number of bits of color per primary\r
-                (Standard VGA = 6)\r
-\r
-\r
-        Input:  AH = 4Fh        Super VGA support\r
-                AL = 08h        Set/Get DAC Palette Control\r
-                BL = 01h        Get DAC palette width\r
-\r
-        Output: AX = Status\r
-                BH = Current number of bits of color per primary\r
-                (Standard VGA = 6)\r
-\r
-Notes\r
-~~~~~\r
-An application can find out if DAC switching is available by querying Bit D0 of\r
-the Capabilities field of the VgaInfoBlock structure returned by VESA Return\r
-Super VGA Information (AX = 4F00h).  The application can then attempt to set the\r
-DAC palette width to the desired value.  If the Super VGA is not capable of\r
-selecting the requested palette width, then the next lower value that the Super\r
-VGA is capable of will be selected.  The resulting palette width is returned.\r
-\f\r
-                      VESA Super VGA Standard VS911022-26\r
-\r
-7.      Application Example\r
-~~~~~~~~~~~~~~~~~~~~~~~~~~~\r
-The following sequence illustrates how an application interface to the VESA BIOS\r
-Extension.  The hypothetical application is VESA-aware and calls the VESA BIOS\r
-functions.  However, the application is not limited to supporting just\r
-VESA-defined video modes.  This it will inquire what video modes are available\r
-before setting up the video mode.\r
-\r
-1)      The application would first allocate a 256 byte buffer.  This buffer\r
-        will be used by the VESA BIOS to return information about the video\r
-        environment.  Some applications will statically allocate this buffer,\r
-        others will use system calls to temporarily obtain buffer space.\r
-\r
-2)      The application would then call VESA BIOS function 00h (Return Super VGA\r
-        information).  If the AX register does not contain 004Fh on return from\r
-        the function call, the application can determine that the VESA BIOS\r
-        Extension is not present and handle such situation.\r
-\r
-        If no error code is passed in AX, the function call was successful.  The\r
-        buffer has been filled by the VESA BIOS Extension with various\r
-        information.  The application can verify that indeed this is a valid\r
-        VESA block by identifying the characters 'VESA' in the beginning of the\r
-        block.  The application can inspect the VESAVersion field to determine\r
-        whether the VESA BIOS Extension ha sufficient functionality.  The\r
-        application may use the OEMStringPtr to locate OEM-specific information.\r
-\r
-        Finally, the application can obtain a list of the supported Super VGA\r
-        modes by using the VideoModePtr.  This field points to a list of the\r
-        video modes supported by the video environment.\r
-\r
-3)      The application would then create a new buffer and call the VESA BIOS\r
-        function 01h (Return Super VGA mode information) to obtain information\r
-        about the supported video modes.  Using the VideoModePtr obtained in\r
-        step 2) above, the application would call this function with a new mode\r
-        number until a suitable video mode is found.  If no appropriate video\r
-        mode is found, it is up to the application to handle this situation.\r
-\r
-        The Return Super VGA mode information function fills a buffer specified\r
-        by the application with information describing the features of the video\r
-        mode.  The data block contains all the information an application needs\r
-        to take advantage of the video mode.\r
-\r
-        The application would examine the ModeAttributes field.  To verify that\r
-        the mode indeed is supported, the application would inspect bit D0.  If\r
-        D0 is clear, then the mode is not supported by the hardware.  This might\r
-        happen is a specific mode requires a certain type of monitor but that\r
-        monitor is not present.\r
-\r
-4)      After the application has selected a video mode, the next step is to\r
-        initialize the mode.  However, the application might first want to save\r
-        the present video mode.  When the application exits, this mode would be\r
-        restored.  To obtain the present video mode, the VESA BIOS function 03h\r
-        (Get Super VGA mode) would be used.  If a non-VESA (standard VGA or\r
-        OEM-specific) mode is in effect, only the lower byte in the mode number\r
-        is filled.  The upper byte is cleared.\r
-\r
-5)      To initialize the video mode, the application would use VESA BIOS\r
-        function 02h (Set Super VGA mode).  The application has from this point\r
-        on full access to the VGA hardware and video memory.\r
-\f\r
-                      VESA Super VGA Standard VS911022-27\r
-\r
-6)      When the application is about to terminate, it would restore the prior\r
-        video mode.  The prior video mode, obtained in step 4) above could be\r
-        either a standard VGA mode, OEM-specific mode, or VESA-supported mode.\r
-        It would reinitialize the video mode by calling VESA BIOS function 02h\r
-        (Set Super VGA mode).  The application would then exit.\r
diff --git a/16/PCGPE10/VGABIOS.TXT b/16/PCGPE10/VGABIOS.TXT
deleted file mode 100644 (file)
index 257f883..0000000
+++ /dev/null
@@ -1,707 +0,0 @@
-----------1000-------------------------------\r
-INT 10 - VIDEO - SET VIDEO MODE\r
-        AH = 00h\r
-        AL = mode (see below)\r
-Return: AL = video mode flag (Phoenix BIOS)\r
-             20h mode > 7\r
-             30h modes <= 7 except mode 6\r
-             3Fh mode 6\r
-        AL = CRT controller mode byte (Phoenix 386 BIOS v1.10)\r
-Notes:       IBM standard modes do not clear the screen if the high bit of AL is set\r
-      (EGA or higher only)\r
-SeeAlso: AX=0070h,AX=007Eh,AX=10F0h,AX=6F05h,AH=FFh"GO32",INT 5F/AH=00h\r
-\r
-Values for video mode:\r
-     text/ text   pixel pixel    colors  display  scrn system\r
-     grph  resol  box   resoltn          pages   addr\r
- 00h = T   40x25  8x14           16gray     8    B800 EGA\r
-     = T   40x25  8x16             16       8    B800 MCGA\r
-     = T   40x25  9x16             16       8    B800 VGA\r
- 01h = T   40x25  8x14             16       8    B800 EGA\r
-     = T   40x25  8x16             16       8    B800 MCGA\r
-     = T   40x25  9x16             16       8    B800 VGA\r
- 02h = T   80x25  8x14           16gray     4    B800 EGA\r
-     = T   80x25  8x16             16       4    B800 MCGA\r
-     = T   80x25  9x16             16       4    B800 VGA\r
- 03h = T   80x25  8x14             16       4    B800 EGA\r
-     = T   80x25  8x16             16       4    B800 MCGA\r
-     = T   80x25  9x16             16       4    B800 VGA\r
- 04h = G   40x25  8x8     320x200           4    B800 CGA,PCjr,EGA,MCGA,VGA\r
- 05h = G   40x25  8x8     320x200 4gray          B800 CGA,PCjr,EGA\r
-     = G   40x25  8x8     320x200   4            B800 MCGA,VGA\r
- 06h = G   80x25  8x8     640x200   2            B800 CGA,PCjr,EGA,MCGA,VGA\r
- 07h = T   80x25  9x14            mono     var   B000 MDA,Hercules,EGA\r
-     = T   80x25  9x16            mono           B000 VGA\r
- 0Bh =                 reserved (used internally by EGA BIOS)\r
- 0Ch =                 reserved (used internally by EGA BIOS)\r
- 0Dh = G   40x25  8x8     320x200  16       8    A000 EGA,VGA\r
- 0Eh = G   80x25  8x8     640x200  16       4    A000 EGA,VGA\r
- 0Fh = G   80x25  8x14    640x350 mono      2    A000 EGA,VGA\r
- 10h = G   80x25  8x14    640x350   4       2    A000 64k EGA\r
-     = G                  640x350  16            A000 256k EGA,VGA\r
- 11h = G   80x30  8x16    640x480 mono           A000 VGA,MCGA,ATI EGA,ATI VIP\r
- 12h = G   80x30  8x16    640x480 16/256k        A000 VGA,ATI VIP\r
-     = G   80x30  8x16    640x480 16/64          A000 ATI EGA Wonder\r
- 13h = G   40x25  8x8     320x200 256/256k       A000 VGA,MCGA,ATI VIP\r
-----------1001-------------------------------\r
-INT 10 - VIDEO - SET TEXT-MODE CURSOR SHAPE\r
-        AH = 01h\r
-        CH = bit 7    should be zero\r
-             bits 6,5 cursor blink\r
-                (00=normal, 01=invisible, 10=erratic, 11=slow)\r
-                (00=normal, other=invisible on EGA/VGA)\r
-             bits 4-0 top scan line containing cursor\r
-        CL = bottom scan line containing cursor (bits 0-4)\r
-Notes: buggy on EGA systems--BIOS remaps cursor shape in 43 line modes, but\r
-       returns unmapped cursor shape\r
-       applications which wish to change the cursor by programming the\r
-       hardware directly on EGA or above should call INT 10/AX=1130h or\r
-       read 0040h:0085h first to determine the current font height\r
-BUG:   AMI 386 BIOS and AST Premier 386 BIOS will lock up the system if AL\r
-       is not equal to the current video mode\r
-SeeAlso: AH=03h,AX=CD05h\r
-----------1002-------------------------------\r
-INT 10 - VIDEO - SET CURSOR POSITION\r
-        AH = 02h\r
-        BH = page number\r
-              0-3 in modes 2&3\r
-              0-7 in modes 0&1\r
-                0 in graphics modes\r
-        DH = row (00h is top)\r
-        DL = column (00h is left)\r
-SeeAlso: AH=03h,AH=05h\r
-----------1003-------------------------------\r
-INT 10 - VIDEO - GET CURSOR POSITION AND SIZE\r
-        AH = 03h\r
-        BH = page number\r
-              0-3 in modes 2&3\r
-              0-7 in modes 0&1\r
-                0 in graphics modes\r
-Return: AX = 0000h (Phoenix BIOS)\r
-        CH = start scan line\r
-        CL = end scan line\r
-        DH = row (00h is top)\r
-        DL = column (00h is left)\r
-Notes: a separate cursor is maintained for each of up to 8 display pages\r
-       many ROM BIOSes incorrectly return the default size for a color display\r
-       (start 06h, end 07h) when a monochrome display is attached\r
-SeeAlso: AH=01h,AH=02h\r
-----------1004-------------------------------\r
-INT 10 - VIDEO - READ LIGHT PEN POSITION (EGA Only)\r
-        AH = 04h\r
-Return: AH = light pen trigger flag\r
-             00h not down/triggered\r
-             01h down/triggered \r
-        DH,DL = row,column of character light pen is on \r
-        CH = pixel row (graphics modes 04h-06h)\r
-        CX = pixel row (graphics modes with >200 rows)\r
-        BX = pixel column\r
-Notes: on a CGA, returned column numbers are always multiples of 2 (320-\r
-       column modes) or 4 (640-column modes)\r
-       returned row numbers are only accurate to two lines\r
-----------1005-------------------------------\r
-INT 10 - VIDEO -  SELECT ACTIVE DISPLAY PAGE\r
-        AH = 05h\r
-        AL = new page number (00h to number of pages - 1) (see AH=00h)\r
-SeeAlso: AH=0Fh\r
-----------1006-------------------------------\r
-INT 10 - VIDEO - SCROLL UP WINDOW\r
-        AH = 06h\r
-        AL = number of lines by which to scroll up (00h = clear entire window)\r
-        BH = attribute used to write blank lines at bottom of window\r
-     CH,CL = row,column of window's upper left corner\r
-     DH,DL = row,column of window's lower right corner\r
-Note:  affects only the currently active page (see AH=05h)\r
-Warning: some implementations have a bug which destroys BP\r
-SeeAlso: AH=07h,AH=72h,AH=73h\r
-----------1007-------------------------------\r
-INT 10 - VIDEO - SCROLL DOWN WINDOW\r
-        AH = 07h\r
-        AL = number of lines by which to scroll down (00h=clear entire window)\r
-        BH = attribute used to write blank lines at top of window\r
-     CH,CL = row,column of window's upper left corner\r
-     DH,DL = row,column of window's lower right corner\r
-Note:  affects only the currently active page (see AH=05h)\r
-Warning: some implementations have a bug which destroys BP\r
-SeeAlso: AH=06h,AH=72h,AH=73h\r
-----------1008-------------------------------\r
-INT 10 - VIDEO - READ CHARACTER AND ATTRIBUTE AT CURSOR POSITION\r
-        AH = 08h\r
-        BH = page number (00h to number of pages - 1) (see AH=00h)\r
-Return: AH = attribute\r
-             bit    7: blink\r
-             bits 6-4: background color\r
-                       000 black\r
-                       001 blue\r
-                       010 green\r
-                       011 cyan\r
-                       100 red\r
-                       101 magenta\r
-                       110 brown\r
-                       111 white\r
-             bits 3-0: foreground color\r
-                       0000 black       1000 dark gray\r
-                       0001 blue        1001 light blue\r
-                       0010 green       1010 light green\r
-                       0011 cyan        1011 light cyan\r
-                       0100 red         1100 light red\r
-                       0101 magenta     1101 light magenta\r
-                       0110 brown       1110 yellow\r
-                       0111 light gray  1111 white\r
-        AL = character\r
-Notes: for monochrome displays, a foreground of 1 with background 0 is underlined\r
-       the blink bit may be reprogrammed to enable intense background colors\r
-       using AX=1003h or by programming the CRT controller\r
-SeeAlso: AH=09h,AX=1003h\r
-----------1009-------------------------------\r
-INT 10 - VIDEO - WRITE CHARACTER AND ATTRIBUTE AT CURSOR POSITION\r
-        AH = 09h\r
-        AL = character to display\r
-        BH = page number (00h to number of pages - 1) (see AH=00h)\r
-        BL = attribute (text mode) or color (graphics mode)\r
-             if bit 7 set in graphics mode, character is xor'ed onto screen\r
-        CX = number of times to write character\r
-Notes: all characters are displayed, including CR, LF, and BS\r
-       replication count in CX may produce an unpredictable result in graphics\r
-       modes if it is greater than the number of positions remaining in the\r
-       current row\r
-SeeAlso: AH=08h,AH=0Ah,AH=4Bh,INT 17/AH=60h,INT 1F,INT 43,INT 44\r
-----------100A-------------------------------\r
-INT 10 - VIDEO - WRITE CHARACTER ONLY AT CURSOR POSITION\r
-        AH = 0Ah\r
-        AL = character to display\r
-        BH = page number (00h to number of pages - 1) (see AH=00h)\r
-        BL = attribute (PCjr only) or color (graphics mode)\r
-             if bit 7 set in graphics mode, character is xor'ed onto screen\r
-        CX = number of times to write character\r
-Notes: all characters are displayed, including CR, LF, and BS\r
-       replication count in CX may produce an unpredictable result in graphics\r
-       modes if it is greater than the number of positions remaining in the\r
-       current row\r
-SeeAlso: AH=08h,AH=09h,AH=4Bh,INT 17/AH=60h,INT 1F,INT 43,INT 44\r
-----------100B--BH00-------------------------\r
-INT 10 - VIDEO - SET BACKGROUND/BORDER COLOR\r
-        AH = 0Bh\r
-        BH = 00h\r
-        BL = background/border color (border only in text modes)\r
-SeeAlso: AH=0Bh/BH=01h\r
-----------100B--BH01-------------------------\r
-INT 10 - VIDEO - SET PALETTE\r
-        AH = 0BH\r
-        BH = 01h\r
-        BL = palette ID\r
-             00h background, green, red, and brown/yellow\r
-             01h background, cyan, magenta, and white\r
-SeeAlso: AH=0Bh/BH=00h\r
-----------100C-------------------------------\r
-INT 10 - VIDEO - WRITE GRAPHICS PIXEL\r
-        AH = 0Ch\r
-        BH = page number\r
-        AL = pixel color (if bit 7 set, value is xor'ed onto screen)\r
-        CX = column\r
-        DX = row\r
-Notes: valid only in graphics modes\r
-       BH is ignored if the current video mode supports only one page\r
-SeeAlso: AH=0Dh,AH=46h\r
-----------100D-------------------------------\r
-INT 10 - VIDEO - READ GRAPHICS PIXEL\r
-        AH = 0Dh\r
-        BH = page number\r
-        CX = column\r
-        DX = row\r
-Return: AL = pixel color\r
-Notes: valid only in graphics modes\r
-       BH is ignored if the current video mode supports only one page\r
-SeeAlso: AH=0Ch,AH=47h\r
-----------100E-------------------------------\r
-INT 10 - VIDEO - TELETYPE OUTPUT\r
-        AH = 0Eh\r
-        AL = character to write\r
-        BH = page number\r
-        BL = foreground color (graphics modes only)\r
-Notes: characters 07h (BEL), 08h (BS), 0Ah (LF), and 0Dh (CR) are interpreted\r
-       and do the expected things\r
-       IBM PC ROMs dated 4/24/81 and 10/19/81 require that BH be the same as\r
-       the current active page\r
-SeeAlso: AH=02h,AH=0Ah\r
-----------100F-------------------------------\r
-INT 10 - VIDEO - GET CURRENT VIDEO MODE\r
-        AH = 0Fh\r
-Return: AH = number of character columns\r
-        AL = display mode (see AH=00h)\r
-        BH = active page (see AH=05h)\r
-Notes: if mode was set with bit 7 set ("no blanking"), the returned mode will\r
-       also have bit 7 set\r
-       EGA, VGA, and UltraVision return either AL=03h (color) or AL=07h\r
-       (monochrome) in all extended-row text modes\r
-SeeAlso: AH=00h,AH=05h,AX=1130h,AX=CD04h\r
-----------101000----------------------------\r
-INT 10 - VIDEO - SET SINGLE PALETTE REGISTER (PCjr,EGA,MCGA,VGA)\r
-        AX = 1000h\r
-        BL = palette register number (00h-0Fh)\r
-           = attribute register number (undocumented)\r
-             10h attribute mode control register (should let BIOS control this)\r
-             11h overscan color register (see also AX=1001h)\r
-             12h color plane enable register (bits 3-0 enable corresponding\r
-                 text attribute bit)\r
-             13h horizontal PEL panning register\r
-             14h color select register\r
-        BH = color or attribute register value\r
-Notes: on MCGA, only BX = 0712h is supported\r
-       under UltraVision, the palette locking status (see AX=CD01h)\r
-       determines the outcome\r
-SeeAlso: AX=1002h,AX=1007h,AX=CD01h\r
-----------101001-----------------------------\r
-INT 10 - VIDEO - SET BORDER (OVERSCAN) COLOR (PCjr,EGA,VGA)\r
-        AX = 1001h\r
-        BH = border color (00h-3Fh)\r
-BUG: the original IBM VGA BIOS incorrectly updates the parameter save area\r
-     and places the border color at offset 11h of the palette table\r
-     rather than offset 10h\r
-Note: under UltraVision, the palette locking status (see AX=CD01h)\r
-      determines the outcome\r
-SeeAlso: AX=1002h,AX=1008h,AX=CD01h\r
-----------101002-----------------------------\r
-INT 10 - VIDEO - SET ALL PALETTE REGISTERS (PCjr,EGA,VGA)\r
-        AX = 1002h\r
-        ES:DX -> palette register list\r
-Note: under UltraVision, the palette locking status (see AX=CD01h)\r
-      determines the outcome\r
-SeeAlso: AX=1000h,AX=1001h,AX=1009h,AX=CD01h\r
-\r
-Format of palette register list:\r
-Offset  Size     Description\r
- 00h   16 BYTEs  colors for palette registers 00h through 0Fh\r
- 10h      BYTE   border color\r
-----------101003-----------------------------\r
-INT 10 - VIDEO - TOGGLE INTENSITY/BLINKING BIT (Jr, PS, TANDY 1000, EGA, VGA)\r
-        AX = 1003h\r
-        BL = new state\r
-             00h background intensity enabled\r
-             01h blink enabled\r
-Note: although there is no function to get the current status, bit 5 of\r
-      0040h:0065h indicates the state\r
-SeeAlso: AH=08h\r
-----------101007-----------------------------\r
-INT 10 - VIDEO - GET INDIVIDUAL PALETTE REGISTER (VGA,UltraVision v2+)\r
-        AX = 1007h\r
-        BL = palette or attribute (undoc) register number (see AX=1000h)\r
-Return: BH = palette or attribute register value\r
-Notes: UltraVision v2+ supports this function even on color EGA systems in\r
-       video modes 00h-03h, 10h, and 12h; direct programming of the palette\r
-       registers will cause incorrect results because the EGA registers are\r
-       write-only.  To guard against older versions or unsupported video\r
-       modes, programs which expect to use this function on EGA systems\r
-       should set BH to FFh on entry.\r
-SeeAlso: AX=1000h,AX=1009h\r
-----------101008-----------------------------\r
-INT 10 - VIDEO - READ OVERSCAN (BORDER COLOR) REGISTER (VGA,UltraVision v2+)\r
-        AX = 1008h\r
-Return: BH = border color (00h-3Fh)\r
-Notes: UltraVision v2+ supports this function even on color EGA systems in\r
-       video modes 00h-03h, 10h, and 12h; direct programming of the palette\r
-       registers will cause incorrect results because the EGA registers are\r
-       write-only.  To guard against older versions or unsupported video\r
-       modes, programs which expect to use this function on EGA systems\r
-       should set BH to FFh on entry.\r
-SeeAlso: AX=1001h\r
-----------101009-----------------------------\r
-INT 10 - VIDEO - READ ALL PALETTE REGISTERS AND OVERSCAN REGISTER (VGA)\r
-        AX = 1009h\r
-        ES:DX -> 17-byte buffer (see AX=1002h)\r
-Notes: UltraVision v2+ supports this function even on color EGA systems in\r
-       video modes 00h-03h, 10h, and 12h; direct programming of the palette\r
-       registers will cause incorrect results because the EGA registers are\r
-       write-only.  To guard against older versions or unsupported video\r
-       modes, programs which expect to use this function on EGA systems\r
-       should set the ES:DX buffer to FFh before calling.\r
-SeeAlso: AX=1002h,AX=1007h,AX=CD02h\r
-----------101010-----------------------------\r
-INT 10 - VIDEO - SET INDIVIDUAL DAC REGISTER (VGA/MCGA)\r
-        AX = 1010h\r
-        BX = register number\r
-        CH = new value for green (0-63)\r
-        CL = new value for blue (0-63)\r
-        DH = new value for red (0-63)\r
-SeeAlso: AX=1012h,AX=1015h\r
-----------101012-----------------------------\r
-INT 10 - VIDEO - SET BLOCK OF DAC REGISTERS (VGA/MCGA)\r
-        AX = 1012h\r
-        BX = starting color register\r
-        CX = number of registers to set\r
-        ES:DX -> table of 3*CX bytes where each 3 byte group represents one\r
-                 byte each of red, green and blue (0-63)\r
-SeeAlso: AX=1010h,AX=1017h\r
-----------101013-----------------------------\r
-INT 10 - VIDEO - SELECT VIDEO DAC COLOR PAGE (VGA)\r
-        AX = 1013h\r
-        BL = subfunction\r
-             00h select paging mode\r
-                 BH = 00h select 4 blocks of 64\r
-                 BH = 01h select 16 blocks of 16\r
-             01h select page\r
-                 BH = page number (00h to 03h) or (00h to 0Fh)\r
-Note: not valid in mode 13h\r
-SeeAlso: AX=101Ah\r
-----------101015-----------------------------\r
-INT 10 - VIDEO - READ INDIVIDUAL DAC REGISTER (VGA/MCGA)\r
-        AX = 1015h\r
-        BL = palette register number\r
-Return: DH = red value\r
-        CH = green value\r
-        CL = blue value\r
-SeeAlso: AX=1010h,AX=1017h\r
-----------101017-----------------------------\r
-INT 10 - VIDEO - READ BLOCK OF DAC REGISTERS (VGA/MCGA)\r
-        AX = 1017h\r
-        BX = starting palette register\r
-        CX = number of palette registers to read\r
-        ES:DX -> buffer (3 * CX bytes in size) (see also AX=1012h)\r
-Return: buffer filled with CX red, green and blue triples\r
-SeeAlso: AX=1012h,AX=1015h\r
-----------101018-----------------------------\r
-INT 10 - VIDEO - undocumented - SET PEL MASK (VGA/MCGA)\r
-        AX = 1018h\r
-        BL = new PEL value\r
-SeeAlso: AX=1019h\r
-----------101019-----------------------------\r
-INT 10 - VIDEO - undocumented - READ PEL MASK (VGA/MCGA)\r
-        AX = 1019h\r
-Return: BL = value read\r
-SeeAlso: AX=1018h\r
-----------10101A-----------------------------\r
-INT 10 - VIDEO - GET VIDEO DAC COLOR-PAGE STATE (VGA)\r
-        AX = 101Ah\r
-Return: BL = paging mode\r
-             00h four pages of 64\r
-             01h sixteen pages of 16\r
-        BH = current page\r
-SeeAlso: AX=1013h\r
-----------10101B-----------------------------\r
-INT 10 - VIDEO - PERFORM GRAY-SCALE SUMMING (VGA/MCGA)\r
-        AX = 101Bh\r
-        BX = starting palette register\r
-        CX = number of registers to convert\r
-SeeAlso: AH=12h/BL=33h\r
-----------1011-------------------------------\r
-INT 10 - VIDEO - TEXT-MODE CHARACTER GENERATOR FUNCTIONS (PS, EGA, VGA)\r
-        AH = 11h\r
-The following functions will cause a mode set, completely resetting\r
-the video environment, but without clearing the video buffer\r
-        AL = 00h, 10h: load user-specified patterns\r
-             ES:BP -> user table\r
-             CX  = count of patterns to store\r
-             DX  = character offset into map 2 block\r
-             BL  = block to load in map 2\r
-             BH  = number of bytes per character pattern\r
-        AL = 01h, 11h: load ROM monochrome patterns (8 by 14)\r
-             BL  = block to load\r
-        AL = 02h, 12h: load ROM 8 by 8 double-dot patterns\r
-             BL  = block to load\r
-        AL = 03h: set block specifier\r
-             BL  = block specifier\r
-               (EGA/MCGA) bits 0,1 = block selected by chars with attribute bit 3=0\r
-                          bits 2,3 = block selected by chars with attribute bit 3=1\r
-                    (VGA) bits 0,1,4 = block selected by attribute bit 3 = 0\r
-                          bits 2,3,5 = block selected by attribute bit 3 = 1\r
-        AL = 04h, 14h: load ROM 8x16 character set (VGA)\r
-             BL  = block to load\r
-The routines called with AL=1xh are designed to be called only\r
-immediately after a mode set and are similar to the routines called\r
-with AL=0xh, except that:\r
-      Page 0 must be active.\r
-      Bytes/character is recalculated.\r
-      Max character rows is recalculated.\r
-      CRT buffer length is recalculated.\r
-      CRTC registers are reprogrammed as follows:\r
-           R09 = bytes/char-1 ; max scan line (mode 7 only)\r
-           R0A = bytes/char-2 ; cursor start\r
-           R0B = 0            ; cursor end\r
-           R12 = ((rows+1)*(bytes/char))-1 ; vertical display end\r
-           R14 = bytes/char     ; underline loc\r
-                  (*** BUG: should be 1 less ***)\r
-SeeAlso: AX=CD10h\r
-----------1011-------------------------------\r
-INT 10 - VIDEO - GRAPHICS-MODE CHARACTER GENERATOR FUNCTIONS (PS, EGA, VGA)\r
-        AH = 11h\r
-        AL = 20h: set user 8 by 8 graphics characters (INT 1F)\r
-                  ES:BP -> user table\r
-        AL = 21h: set user graphics characters\r
-                  ES:BP -> user table\r
-                  CX      = bytes per character\r
-                  BL      = row specifier\r
-                        00h user set\r
-                            DL = number of rows\r
-                        01h 14 rows\r
-                        02h 25 rows\r
-                        03h 43 rows\r
-        AL = 22h: ROM 8 by 14 set\r
-                  BL = row specifier (see above)\r
-        AL = 23h: ROM 8 by 8 double dot\r
-                  BL = row specifier (see above)\r
-        AL = 24h: load 8x16 graphics characters (VGA/MCGA)\r
-                  BL = row specifier (see above)\r
-        AL = 29h: load 8x16 graphics characters (Compaq Systempro)\r
-                  BL = row specifier (see above)\r
-Notes: these functions are meant to be called only after a mode set\r
-       UltraVision v2+ sets INT 43 to the appropriate font for AL=22h,23h,24h,\r
-       and 29h\r
-SeeAlso: INT 1F, INT 43\r
-----------101130-----------------------------\r
-INT 10 - VIDEO - GET FONT INFORMATION (EGA, MCGA, VGA)\r
-        AX = 1130h\r
-        BH = pointer specifier\r
-             00h INT 1Fh pointer\r
-             01h INT 43h pointer\r
-             02h ROM 8x14 character font pointer\r
-             03h ROM 8x8 double dot font pointer\r
-             04h ROM 8x8 double dot font (high 128 characters)\r
-             05h ROM alpha alternate (9 by 14) pointer (EGA,VGA)\r
-             06h ROM 8x16 font (MCGA, VGA)\r
-             07h ROM alternate 9x16 font (VGA only)\r
-             11h (UltraVision v2+) 8x20 font (VGA) or 8x19 font (autosync EGA)\r
-             12h (UltraVision v2+) 8x10 font (VGA) or 8x11 font (autosync EGA)\r
-Return: ES:BP = specified pointer\r
-        CX    = bytes/character\r
-        DL    = character rows on screen - 1\r
-Note: for UltraVision v2+, the 9xN alternate fonts follow the corresponding\r
-      8xN font at ES:BP+256N\r
-SeeAlso: AX=1100h,AX=1120h,INT 1F,INT 43\r
-----------1012--BL10-------------------------\r
-INT 10 - VIDEO - ALTERNATE FUNCTION SELECT (PS, EGA, VGA, MCGA) - GET EGA INFO\r
-        AH = 12h\r
-        BL = 10h\r
-Return: BH = 00h color mode in effect (I/O port 3Dxh)\r
-             01h mono mode in effect (I/O port 3Bxh)\r
-        BL = 00h  64k bytes memory installed\r
-             01h 128k bytes memory installed\r
-             02h 192k bytes memory installed\r
-             03h 256k bytes memory installed\r
-        CH = feature bits\r
-        CL = switch settings\r
-----------1012--BL20-------------------------\r
-INT 10 - VIDEO - ALTERNATE FUNCTION SELECT (PS,EGA,VGA,MCGA) - ALTERNATE PRTSC\r
-        AH = 12h\r
-        BL = 20h  select alternate print screen routine\r
-Notes: installs a PrtSc routine from the video card's BIOS to replace the\r
-       default PrtSc handler from the ROM BIOS, which usually does not\r
-       understand screen heights other than 25 lines\r
-       some adapters disable print-screen instead of enhancing it\r
-SeeAlso: INT 05\r
-----------1012--BL30-------------------------\r
-INT 10 - VIDEO - ALTERNATE FUNCTION SELECT (VGA) - SELECT VERTICAL RESOLUTION\r
-        AH = 12h\r
-        BL = 30h\r
-        AL = vertical resolution\r
-             00h 200 scan lines\r
-             01h 350 scan lines\r
-             02h 400 scan lines\r
-Return: AL = 12h if function supported\r
-----------1012--BL31-------------------------\r
-INT 10 - VIDEO - ALTERNATE FUNCTION SELECT (VGA, MCGA) - PALETTE LOADING\r
-        AH = 12h\r
-        BL = 31h\r
-        AL = 00h enable default palette loading\r
-             01h disable default palette loading\r
-Return: AL = 12h if function supported\r
-----------1012--BL32-------------------------\r
-INT 10 - VIDEO - ALTERNATE FUNCTION SELECT (VGA, MCGA) - VIDEO ADDRESSING\r
-        AH = 12h\r
-        BL = 32h\r
-        AL = 00h enable video addressing\r
-             01h disable video addressing\r
-Return: AL = 12h if function supported\r
-----------1012--BL33-------------------------\r
-INT 10 - VIDEO - ALTERNATE FUNCTION SELECT (VGA, MCGA) - GRAY-SCALE SUMMING\r
-        AH = 12h\r
-        BL = 33h\r
-        AL = 00h enable gray scale summing\r
-             01h disable gray scale summing\r
-Return: AL = 12h if function supported\r
-SeeAlso: AX=101Bh,AX=BF06h\r
-----------1012--BL34-------------------------\r
-INT 10 - VIDEO - ALTERNATE FUNCTION SELECT (VGA) - CURSOR EMULATION\r
-        AH = 12h\r
-        BL = 34h\r
-        AL = 00h enable alphanumeric cursor emulation\r
-             01h disable alphanumeric cursor emulation\r
-Return: AL = 12h if function supported\r
-----------1012--BL35-------------------------\r
-INT 10 - VIDEO - ALTERNATE FUNCTION SELECT (PS) - DISPLAY-SWITCH INTERFACE\r
-        AH = 12h\r
-        BL = 35h\r
-        AL = 00h initial adapter video off\r
-             01h initial planar video on\r
-             02h switch active video off\r
-             03h switch inactive video on\r
-             80h *UNDOCUMENTED* set system board video active flag\r
-        ES:DX -> buffer (128 byte save area if AL = 0, 2 or 3)\r
-Return: AL = 12h if function supported\r
-----------1012--BL36-------------------------\r
-INT 10 - VIDEO - ALTERNATE FUNCTION SELECT (PS, VGA) - VIDEO REFRESH CONTROL\r
-        AH = 12h\r
-        BL = 36h\r
-        AL = 00h enable refresh\r
-             01h disable refresh\r
-Return: AL = 12h if function supported\r
-----------1013-------------------------------\r
-INT 10 - VIDEO - WRITE STRING (AT and later,EGA)\r
-        AH = 13h\r
-        AL = write mode\r
-             bit 0: update cursor after writing\r
-                 1: string contains alternating characters and attributes\r
-        BH = page number\r
-        BL = attribute if string contains only characters\r
-        CX = number of characters in string\r
-        DH,DL = row,column at which to start writing\r
-        ES:BP -> string to write\r
-Notes: recognizes CR, LF, BS, and bell\r
-       also available PC or XT with EGA or higher\r
-       HP 95LX only supports write mode 00h\r
-BUG: on the IBM VGA Adapter, any scrolling which may occur is performed on\r
-     the active page rather than the requested page\r
-SeeAlso: AH=09h,AH=0Ah\r
-----------101A-------------------------------\r
-INT 10 - VIDEO - DISPLAY COMBINATION (PS,VGA/MCGA)\r
-        AH = 1Ah\r
-        AL = 00h read display combination code\r
-Return:          BL = active display code (see below)\r
-                 BH = alternate display code\r
-             01h set display combination code\r
-                 BL = active display code (see below)\r
-                 BH = alternate display code\r
-Return: AL = 1Ah if function was supported\r
-\r
-Values for display combination code:\r
-  00h no display\r
-  01h monochrome adapter w/ monochrome display\r
-  02h CGA w/ color display\r
-  03h reserved\r
-  04h EGA w/ color display\r
-  05h EGA w/ monochrome display\r
-  06h PGA w/ color display\r
-  07h VGA w/ monochrome analog display\r
-  08h VGA w/ color analog display\r
-  09h reserved\r
-  0Ah MCGA w/ digital color display\r
-  0Bh MCGA w/ monochrome analog display\r
-  0Ch MCGA w/ color analog display\r
-  FFh unknown display type\r
-----------101B-------------------------------\r
-INT 10 - VIDEO - FUNCTIONALITY/STATE INFORMATION (PS,VGA/MCGA)\r
-        AH = 1Bh\r
-        BX = implementation type\r
-             0000h return functionality/state information\r
-        ES:DI -> 64 byte buffer for state information (see below)\r
-Return: AL = 1Bh if function supported\r
-        ES:DI buffer filled with state information\r
-SeeAlso: AH=15h\r
-\r
-Format of state information:\r
-Offset Size   Description\r
- 00h   DWORD  address of static functionality table (see below)\r
- 04h   BYTE   video mode in effect\r
- 05h   WORD   number of columns\r
- 07h   WORD   length of regen buffer in bytes\r
- 09h   WORD   starting address of regen buffer\r
- 0Bh   WORD   cursor position for page 0\r
- 0Dh   WORD   cursor position for page 1\r
- 0Fh   WORD   cursor position for page 2\r
- 11h   WORD   cursor position for page 3\r
- 13h   WORD   cursor position for page 4\r
- 15h   WORD   cursor position for page 5\r
- 17h   WORD   cursor position for page 6\r
- 19h   WORD   cursor position for page 7\r
- 1Bh   WORD   cursor type\r
- 1Dh   BYTE   active display page\r
- 1Eh   WORD   CRTC port address\r
- 20h   BYTE   current setting of register (3?8)\r
- 21h   BYTE   current setting of register (3?9)\r
- 22h   BYTE   number of rows\r
- 23h   WORD   bytes/character\r
- 25h   BYTE   display combination code of active display\r
- 26h   BYTE   DCC of alternate display\r
- 27h   WORD   number of colors supported in current mode\r
- 29h   BYTE   number of pages supported in current mode\r
- 2Ah   BYTE   number of scan lines active\r
-              (0,1,2,3) = (200,350,400,480)\r
- 2Bh   BYTE   primary character block\r
- 2Ch   BYTE   secondary character block\r
- 2Dh   BYTE   miscellaneous flags\r
-              bit 0 all modes on all displays on\r
-                  1 gray summing on\r
-                  2 monochrome display attached\r
-                  3 default palette loading disabled\r
-                  4 cursor emulation enabled\r
-                  5 0 = intensity; 1 = blinking\r
-                  6 PS/2 P70 plasma display (without 9-dot wide font) active\r
-                  7 reserved\r
- 2Eh  3 BYTEs reserved (00h)\r
- 31h   BYTE   video memory available\r
-              00h = 64K, 01h = 128K, 02h = 192K, 03h = 256K\r
- 32h   BYTE   save pointer state flags\r
-              bit 0 512 character set active\r
-                  1 dynamic save area present\r
-                  2 alpha font override active\r
-                  3 graphics font override active\r
-                  4 palette override active\r
-                  5 DCC override active\r
-                  6 reserved\r
-                  7 reserved\r
- 33h 13 BYTEs reserved (00h)\r
-\r
-Format of Static Functionality Table:\r
-Offset Size    Description\r
- 00h   BYTE    modes supported #1\r
-               bit 0 to bit 7 = 1 modes 0,1,2,3,4,5,6 supported\r
- 01h   BYTE    modes supported #2\r
-               bit 0 to bit 7 = 1 modes 8,9,0Ah,0Bh,0Ch,0Dh,0Eh,0Fh supported\r
- 02h   BYTE    modes supported #3\r
-               bit 0 to bit 3 = 1 modes 10h,11h,12h,13h supported\r
-               bit 4 to bit 7 reserved\r
- 03h  4 BYTEs  reserved\r
- 07h   BYTE    scan lines supported\r
-               bit 0 to bit 2 = 1 if scan lines 200,350,400 supported\r
- 08h   BYTE    total number of character blocks available in text modes\r
- 09h   BYTE    maximum number of active character blocks in text modes\r
- 0Ah   BYTE    miscellaneous function flags #1\r
-               bit 0 all modes on all displays function supported\r
-                   1 gray summing function supported\r
-                   2 character font loading function supported\r
-                   3 default palette loading enable/disable supported\r
-                   4 cursor emulation function supported\r
-                   5 EGA palette present\r
-                   6 color palette present\r
-                   7 color paging function supported\r
- 0Bh   BYTE    miscellaneous function flags #2\r
-               bit 0 light pen supported\r
-                   1 save/restore state function 1Ch supported\r
-                   2 intensity blinking function supported\r
-                   3 Display Combination Code supported\r
-                 4-7 reserved\r
- 0Ch   WORD    reserved\r
- 0Eh   BYTE    save pointer function flags\r
-               bit 0 512 character set supported\r
-                   1 dynamic save area supported\r
-                   2 alpha font override supported\r
-                   3 graphics font override supported\r
-                   4 palette override supported\r
-                   5 DCC extension supported\r
-                   6 reserved\r
-                   7 reserved\r
- 0Fh   BYTE    reserved\r
-----------101C-------------------------------\r
-INT 10 - VIDEO - SAVE/RESTORE VIDEO STATE (PS50+,VGA)\r
-        AH = 1Ch\r
-        AL = 00h return state buffer size\r
-Return: BX = number of 64-byte blocks needed\r
-             01h save video state\r
-                 ES:BX -> buffer\r
-             02h restore video state\r
-                 ES:BX -> buffer containing previously saved state\r
-        CX = requested states\r
-             bit 0 video hardware\r
-                 1 BIOS data areas\r
-                 2 color registers and DAC state\r
-              3-15 reserved\r
-Return: AL = 1Ch if function supported\r
diff --git a/16/PCGPE10/VGAREGS.TXT b/16/PCGPE10/VGAREGS.TXT
deleted file mode 100644 (file)
index 07f141d..0000000
+++ /dev/null
@@ -1,806 +0,0 @@
-\r
-                         Programming the VGA Registers\r
-                      by Boone (boone@ucsd.edu), March '94\r
-\r
-   The IBM PC has long been slammed by owners of other computers which come \r
-with superior graphics capabilities built right into hardware.  The PC is a \r
-strange beast to program in general, and when it comes to graphics the \r
-programmer doesn't get much help from the video hardware.  However, there are \r
-quite a few neat tricks you can do using the VGA registers, as I'm sure you're \r
-aware.  The trick is knowing just which registers to use and how to use them to \r
-achieve the desired results.  In particular, precise timing is necessary to \r
-avoid screen flicker and/or "snow".  The registers on your video card are \r
-necessary for just about any communication with the VGA besides basic \r
-reading/writing of pixels.  Some of the registers are standard, which are the \r
-ones we will be discussing here.  Most SVGA chipsets have their own special \r
-functions associated with different registers for things such as bank \r
-switching, which is part of what makes trying to write SVGA programs so \r
-difficult.  The registers are also used to set the various attributes of each \r
-video mode: horizontal and vertical resolution, color depth, refresh rate, \r
-chain-4 mode, and so on.  Luckily, BIOS handles all this for us and since we \r
-only need to set the video mode once at program start-up and once at exit, you \r
-should need to mess with these particular functions too much, unless you are \r
-using a special mode, such as mode X.  (See the mode X section for more info on \r
-all this.)  If you want to experiment with the video mode registers, ftp \r
-yourself a file called TWEAK*.* (my version is TWEAK10.ZIP).  For now we'll \r
-just assume the video mode has already been set to whatever mode you wish.\r
-   One of the most common techniques used by game programmers is fade in/out.  \r
-A clean fade is simple but very effective.  Suprisingly, even big-budget games \r
-like Ultima VII often have a lot of screen noise during their fades.  With a \r
-little effort you can easily write your own noise-free fade routines.  There's \r
-nothing like giving a professional first impression on your intro screen, since \r
-the fade-in is likely to be the very first thing they see of your program.\r
-   BIOS is much to slow for this timing-critical opperation, so we'll have to \r
-get down and dirty with our VGA card.  Fading is a fairly simple process.  As \r
-you should know, the VGA palette consists of 256 colors with 3 attributes for \r
-each color: red, green and blue.  Every cycle of the fade, we have to go \r
-through all 768 attributes and if it is larger than 0 subtract one.  We'll use \r
-regsiters 3C8h and 3C9h for palette opperations.  The operation for sending a \r
-palette to the card is straight-forward: send a 0 to port 3C8h and then your \r
-768 byte buffer to port 3C9h.  This is good enough for setting the palette at \r
-the start of your program, but of course it has to go in a loop for the fade, \r
-since you'll have to do this 256 times, subtracting one from each non-zero \r
-member of the buffer.  The pseudo-code looks something like this:\r
-\r
-   constant PALSIZE = 256*3;\r
-   unsigned character buffer[PALSIZE];\r
-   boolean done;\r
-   counter i,j;\r
-\r
-      for j = 255 to 0\r
-       {\r
-         for i = 0 to PALSIZE-1\r
-            if buffer[i] > 0\r
-               buffer[i] = buffer[i] - 1;\r
-\r
-         output 0 to port 3C8h;\r
-         for i = 0 to PALSIZE-1\r
-            output buffer[i] to port 3C9h;\r
-       }\r
-\r
-   Easy enough, right?  If you convert this to the language of your choice it \r
-should run fine.  (Make sure you have the buffer pre-loaded with the correct \r
-palette, however, or you will get very strange results...)  But you'll notice \r
-the "snow" mentioned earlier.  Depending on your video card, this could mean \r
-that you see no noise at all to fuzz covering your entire screen.  Even if it \r
-look fine on your system, however, we want to make sure it will be smooth on \r
-*all* setups it could potentially be run on.  For that we're going to have to \r
-ask the video card when it's safe to send the palette buffer to the card, and \r
-for that we'll need the retrace register.\r
-   Putting aside palette concerns for a moment, I'll briefly cover the retrace \r
-on your video card.  (See the next section of this article for a more in-depth \r
-discussion of this.)  Bascially the vertical retrace is a short time in which \r
-the screen is not being updated (from video memory to your monitor) and you can \r
-safely do writes to your video memory or palette without worrying about getting \r
-snow, flicker, tearing, or other unwanted side-effects.  This is a pretty quick \r
-period (retrace occurs 60 to 70 times a second) so you can't do too much at \r
-once.\r
-   Returning to our fade: we want to update the palette during the vertical \r
-retrace.  The value we want is bit 3 of register 3DAh.  While that bit is zero \r
-we're safe to write.  The best practice in this case is to wait for the bit to \r
-change to one (screen is being traced) and then the instant it changes to 0, \r
-blast all our new video info to the card.  It won't be necessary in this case \r
-since all we are doing is fading the palette and then waiting for the next \r
-retrace, but if you're doing animation or playing music at the same time \r
-you'll want to include this extra bit of code as a safety net.  Otherwise you \r
-might detect the 0 in the refresh bit at the very last instant of the retrace \r
-and end up writing while the screen is being traced.  The pseudo-code now goes \r
-like this:\r
-\r
-      for j = 255 to 0\r
-       {\r
-         for i = 0 to PALSIZE-1\r
-            if buffer[i] > 0\r
-               buffer[i] = buffer[i] - 1;\r
-\r
-         while bit 3 of port 3DAh is 0\r
-            no opperation;\r
-         while bit 3 of port 3DAh is 1\r
-            no opperation;\r
-\r
-         output 0 to port 3C8h;\r
-         for i = 0 to PALSIZE-1\r
-            output buffer[i] to port 3C9h;\r
-       }\r
-\r
-   That's it!  All that's left is for you to implement it in your favorite \r
-language.  However, I can hear the cries right now: "Code!  Give us some real \r
-assembly code we can use!"  I'm reluctant to provided it as this is the exact \r
-sort of thing that is easy to cut and paste into your program without knowing \r
-how it works.  However, I'll give you the unoptimized main loop in 80x86 \r
-assembly as this may be clearer to you that my explanation or pseudo-code.  Two \r
-things to remember about this code: it is optimized enough to be smooth on any \r
-video card (or any that I've seen, anyway) assuming that the fade is the _only_ \r
-thing going on.  There's some other things you may want to change if you plan \r
-to say, play music during this process.  Secondly, you'll need to have the \r
-current palette loaded into the buffer beforehand.  You could read it from the \r
-VGA card using either registers or BIOS, but this is both slow and (in my \r
-oppinion) sloppy coding.  You should *never* ask the video card about anything \r
-(excluding retrace) that you could keep track of yourself.  In the case of the \r
-palette, you probably already loaded it from disk anyway, or if you are using \r
-the default palette <cough, gag, choke> just read the values once and store \r
-them in your executable or in a resource file.\r
-\r
-     palbuf   DB                  768 DUP (?)\r
-     fadecnt  DW                  040h\r
-\r
-; At this point, you should:\r
-;  1) have the video mode set\r
-;  2) have palbuf loaded with the current palette\r
-;  3) have something on the screen to fade!\r
-\r
-fadeloop:\r
-\r
-     xor      al,al               ; used for comparisons and port 3D8h\r
-     mov      cx,768              ; loop counter\r
-     mov      si,offset palbuf    ; save palette buffer in si\r
-\r
-decloop:\r
-     mov      dl,[si]              ; put next pal reg in dx\r
-     cmp      al,dl                ; is it 0?\r
-     je       next                 ; nope...\r
-     dec      dl                   ; yes, so subtract one\r
-     mov      [si],dl              ; put it back into palette buffer\r
-\r
-next:\r
-     dec      cx                   ; decrement counter\r
-     inc      si                   ; increment our buffer\r
-     cmp      cx,0\r
-     jne      decloop              ; not done yet, so loop around\r
-\r
-     mov      cx,768              ; reset for palette output\r
-     sub      si,768              ; reset palbuf pointer\r
-     mov      dx,03c8h\r
-     out      dx,al               ; inform VGA of palette change\r
-     inc      dx                  ; DX = 3C8h + 1 = 3C9h\r
-\r
-     mov      ch,02h              ; do outter loop 2 times\r
-     mov      dx,03dah            ; prepare refresh register\r
-     mov      bx,03c9h            ; prepare palette reg (for quick loading)\r
-\r
-     cli                          ; disable interrupts!\r
-\r
-outloop:\r
-     mov      cl,80h              ; do inner loop 128 times\r
-\r
-     in       al,dx               ; wait for current retrace to end\r
-     test     al,08h\r
-     jnz      $-5\r
-\r
-     in       al,dx               ; wait for current screen trace to end\r
-     test     al,08h\r
-     jz       $-5\r
-\r
-     mov      dx,bx               ; load up the palette change register\r
-\r
-innerloop:\r
-     mov      al,[si]             ; load next byte of palbuf\r
-     out      dx,al               ; send it to the VGA card\r
-     dec      cl                  ; decrement counter\r
-     inc      si                  ; increment palbuf pointer\r
-     cmp      cl,0\r
-     jne      innerloop           ; loop while not done\r
-\r
-     dec      ch                  ; decrement outer loop counter\r
-     cmp      ch,0\r
-     jne      outloop             ; loop while not done\r
-\r
-     sti                          ; restore interrupts\r
-\r
-     mov      ax,fadecnt          ; entire palette has been sent\r
-     dec      ax                  ; so check fade loop \r
-     mov      fadecnt,ax\r
-     cmp      ax,0                ; ready to quit?\r
-     jne      fadeloop            ; nope, keep fading!\r
-\r
-\r
-   I should add a few comments about this code segment.  First of all, it \r
-assumes you want to fade every color all the way down.  You may only want to \r
-fade certain sections of the palette (if your screen was only using a certain \r
-number of colors) or maybe your palette is low-intensity so you don't need to \r
-go the full 256 loops to get every color down to 0.  It also goes by ones, so \r
-if you want a faster fade you can have it subtract two from each attribute.  \r
-If you want to fade to a certain color other than black (for instance, fade to \r
-red such as the "getting hit" effect in Doom), you'll need to check if each \r
-attribute is above or below your target color and increment or decrement \r
-accordingly.  Also, you may have noticed something in the code absent from the \r
-pseudo-code: it only sends 128 colors to the card each retrace!  This is \r
-because if you use all 256 the next retrace may start before you get all colors \r
-sent to the video card, thanks to the unoptimized code.  Some recommend as \r
-little as 64 colors per retrace, however I've found 128 to be okay and \r
-certainly much faster.  The above code works for any VGA-equiped machine, \r
-regardless of processor, but you'll probably want to compress all the IN and \r
-OUT loops into REP INSB/OUTSB, REP INSW/OUTSW, or REP INSD/OUTSD instructions \r
-depending upon the minimum processor requirement for your game/demo.\r
-   I won't describe fading in since it's the same sort of thing, and I'm sure \r
-you can figure it out once you know how to use the registers themselves.  It's \r
-a little more complicated since you need a second buffer of target values for \r
-your attributes, but otherwise quite similar.\r
-\r
-   Next up is vertical retrace.  This is simply one of many read registers on \r
-your VGA, but it happens to be one of the most useful for animation and palette \r
-fades (as shown above).  Here's a quick rundown of what exactly the vertical \r
-retrace is, and why it's useful.\r
-   There's an electron gun in the back of your monitor that keeps the pixels \r
-"refreshed" with their correct values every 1/60th of a second or so.  It fires \r
-electrons at each pixel, row by row.  The horizontal retrace is the time it \r
-takes it to return from the right side of the screen after it has traced a row.  \r
-This is a very short time and I wouldn't worry about that too much right now, \r
-as it is only useful for very specialized (and quite tricky) hardware effects.\r
-More useful, however, is the vertical retrace which occurs when the electron \r
-gun reaches the bottom of the screen (one entire screen traced) and it returns \r
-diagonally to the upper-right hand corner of the screen.  During this time you \r
-are free to update anything you like having to do with video with no noise or \r
-interference (since nothing on the screen is being updated).  This is a fairly \r
-short amount of time, though, so whatever you want to do you better do it \r
-_quickly_.  For animation, you'll usually want to keep a second buffer in main \r
-memory (remember that video RAM is quite slow compared to main RAM) which you \r
-can use to write your animations to.  When the vertical retrace occurs, you'll \r
-want to blast the entire thing to the VGA as quickly as possible, using a \r
-memory copy instruction.  You can find more on this in articles which cover \r
-animation.\r
-\r
-   Lastly I'll briefly describe the VGA mode-set registers.  There are quite a \r
-number of them and for the most part they're pretty boring.  By sending \r
-different values to these registers you can achieve the various video modes \r
-that your card is capable of.  These registers set values such as horizontal \r
-and vertical resolution, retrace timing, addressing modes, color depth, timing, \r
-and other fun stuff.  The truth is that it's easier and just as effective to\r
-let the BIOS (gasp!) handle setting the screen mode for you, particularly since \r
-most games use standard modes such as 320x200 anyway.  At the very least you \r
-can let BIOS set the mode to begin with and then just modify the registers to \r
-"tweak" the mode the way you want it.  Any of these non-BIOS modes are \r
-generally refered to as mode X.  I don't want to go deep into detail on the \r
-setting and usage of mode X because there is already so much info availible on \r
-the topic.  Check out the Mode X Faq (regularly posted in comp.sys.ibm.pc.demos \r
-and rec.games.programmer), Micheal Abrash's collumn in Dr. Dobb's and his \r
-X-sharp library, or the section on mode X in the PC-GPE.\r
-   One mode register I'll cover quickly is the chain-4 enable/disable.  A lot \r
-of programmers seem to have trouble visualizing what this thing does exactly. \r
-Bit 3 of port 3C4h (index 4) controls chain-4 mode.  Normally it is on.  This \r
-allows fast linear addressing of the bytes in video memory, which is the way \r
-you are probably used to addressing them.  For example, to change the second \r
-pixel on the screen to a certain color, you simply write the value to address \r
-A000:0001.  With chain-4 disabled (the main feature of mode X besides better \r
-resolution) A000:0000 refers to the first pixel in the upper-left corner of \r
-your screen, A000:0001 refers to the fourth pixel, A000:0002 to the eight pixel \r
-and so on.  The odd pixels are accessed by changing the write plane.  Since \r
-there are four planes, you effectively get an extra two bits of addressing \r
-space, boosting the total bit width for your pixel addressing from 16 to 18.  \r
-Standard chain-4 four only allows access to 64K of memory (2^16) while \r
-disabling this feature gives you the full 256K (2^18) of memory to work with.  \r
-The disadvantage, of course, is that pixel writes are slower due to the port \r
-writes required to access odd pixels.  How can this be an advantage?  For one \r
-thing, you can write four pixels at a time as long as they are all the same \r
-color - handy for single-color polygons, as in flight simulators.  Secondly, \r
-you get four times as much memory.  This allows you to have higher resolutions \r
-without bank switching, or scroll the screen using hardware scrolling, or do \r
-page flipping for smooth animation.  And since you can change the resolution, \r
-you can give yourself a sqaure aspect ration (320x240) which is better for \r
-bitmap rotations and the like.  But remember that it can be slower for \r
-bitmapped graphics because you have to do at least four writes to the card (to \r
-change planes) in order to copy bitmaps from main RAM to video memory.  Don't \r
-use mode X just because you think it's "cool"; make sure you have a good reason \r
-for wanting to use it in your program, or otherwise you're wasting a lot of \r
-effort for no reason.\r
-\r
-   Now, I'm sure you want me to continue until I divulge all the secrets of the \r
-VGA register to you - but, I only have some much time and space.  Besides, I \r
-still haven't uncovered all of their mysteries and capabilities myself.  \r
-However, below is a list of the registers which you may want to play with for \r
-various effects.  The following list was posted on rec.games.programmer by \r
-Andrew Bromage (bromage@mundil.cs.mu.OZ.AU), so thanks to him for posting in to \r
-begin with.\r
-   That's it for this article and I hope it helped you understand your VGA card \r
-a little better.  If not, re-read it, and try writing your own programs which \r
-use the registers.  The only way to really understand it (as with most things) \r
-is to get some hands-on experience.\r
-   If you've got any questions, comments, flames, or corrections related to \r
-this document or game programming/design in general, feel free to post an \r
-article in rec.games.programmer (in case you haven't noticed by now, I hang out \r
-there regularly) or send mail to boone@ucsd.edu.\r
-\r
-Here's the list.  Have fun...\r
-\r
-          Documentation Over the I/O Registers for Standard VGA Cards\r
-\r
-                    Documentated by Shaggy of The Yellow One\r
-                           Email: D91-SJD@TEKN.HJ.SE\r
-\r
-Feel free to spread this to whoever wants it.....\r
-------------------------------------------------------------\r
-Port-Index:  -               Port: Write/03c2h Read/03cch\r
-usage:       d7   Vertical sync polarity\r
-             d6   Horizontal sunc polarity\r
-             d5   Odd /even page\r
-             d4   Disable video\r
-             d3   Clock select 1\r
-             d2   Clock select 0\r
-             d1   Enable/Disable display RAM\r
-             d0   I/O address select\r
-Description: Sync polarity: Bits are set as below for VGA displays\r
-             that use sync polarity to determine screen resolution.\r
-             Many newer multiple frequency displays are insensitive\r
-             to sync polarity\r
-\r
-             d7 d6      Resolution\r
-             0  0       Invalid\r
-             0  1       400 lines\r
-             1  0       350 lines\r
-             1  1       480 lines\r
-\r
-             I/O address select: When set to zero, selects the\r
-             monochrome I/O address space (3bx). When set to one,\r
-             it selects the color I/O address space (3dx)\r
-\r
-------------------------------------------------------------\r
-Port-Index: -                Port: 03c2h ; read only\r
-usage:      d7    Vertical Retrace Interrupt pendling\r
-            d6    Feature connector bit 1\r
-            d5    Feature connector bit 0\r
-            d4    Switch sense\r
-            d0-d3 Unused\r
-\r
-Description: d7 uses IRQ2\r
-\r
-------------------------------------------------------------\r
-Port-Index: -                Port: 03bah,03dah ; read only\r
-usage:      d3  Vertical retrace\r
-            d0  Horizontal retrace\r
-\r
-------------------------------------------------------------\r
-Port-Index: -                Port: 03c3h,46e8h\r
-usage:      d7-d1  Reserved\r
-            d0     VGA enable/disable (03c3h only)\r
-\r
-Description: Disables access to display memmory and the other\r
-             VGA's ports\r
-\r
-------------------------------------------------------------\r
-Port-Index: 00h              Port: 03d4h, 03b4h\r
-usage:      Horizontal total\r
-Description: Total number of characters in horizontal scan minus\r
-             five ( including blanked and border characters)\r
-\r
-------------------------------------------------------------\r
-Port-Index: 01h              Port: 03d4h, 03b4h\r
-usage:      Horizontal display enable\r
-Description: Total number of characters displayed in horizontal\r
-             scan minus one.\r
-------------------------------------------------------------\r
-Port-Index: 02h              Port: 03d4h, 03b4h\r
-usage:      Start horizontal blanking\r
-Description: Character at which blanking starts\r
-\r
-------------------------------------------------------------\r
-Port-Index: 03h              Port: 03d4h, 03b4h\r
-usage:      End horizontal blanking\r
-            d7    Test\r
-            d6    Skew control\r
-            d5    Skew control\r
-            d0-d4 End blanking\r
-Description: End blanking: is five LSB bits of six-bit value,\r
-             which define the character at which blanking stops.\r
-             The MSB bit of this value is in register index 5.\r
-\r
-------------------------------------------------------------\r
-Port-Index: 04h              Port: 03d4h, 03b4h\r
-usage:      Start horizontal retrace\r
-Description: Character at which horizontal retrace starts\r
-\r
-------------------------------------------------------------\r
-Port-Index: 05h              Port: 03d4h, 03b4h\r
-usage:      End horizontal retrace\r
-            d7    End horizontal blanking bit 5\r
-            d6    Horizontal retrace delay\r
-            d5    Horizontal retrace delay\r
-            d0-d4 End horizontal retrace\r
-Description: End horizontal retrace: defines the character at\r
-             which horizontal retrace ends\r
-\r
-------------------------------------------------------------\r
-Port-Index: 06h              Port: 03d4h, 03b4h\r
-usage:      Vertical total\r
-Description: Total number of horizontal scan lines minus two\r
-             (including blanked and border characters). MSB bits\r
-             of this value are in register index 7\r
-\r
-------------------------------------------------------------\r
-Port-Index: 07h              Port: 03d4h, 03b4h\r
-usage:      Overflow register\r
-            d7  Vertical retrace start (bit 9)\r
-            d6  Vertical display enable end (bit 9)\r
-            d5  Vertical total (bit 9)\r
-            d4  Line compare (bit 8)\r
-            d3  Start vertical blank (bit 8)\r
-            d2  Vertical retrace start (bit 8)\r
-            d1  Vertical display enable end (bit 8)\r
-            d0  Vertical total (bit 8)\r
-------------------------------------------------------------\r
-Port-Index: 08h              Port: 03d4h, 03b4h\r
-usage:      Preset row scan\r
-            d7    Unused\r
-            d6    Byte panning control\r
-            d5    Byte panning control\r
-            d0-d4 Preset row scan\r
-Description: Byte panning control: is used to control byte\r
-             panning. This register together with attribute\r
-             controller register 13h allows for up to 31 pixels of\r
-             panning in double word modes\r
-             Preset row scan: Which character scan line is the\r
-             first to be displayed\r
-------------------------------------------------------------\r
-Port-Index: 09h              Port: 03d4h, 03b4h\r
-usage:      Maximum scan line/Character height\r
-            d7    double scan\r
-            d6    bit d9 of line compare register\r
-            d5    bit d9 of start vertical blank register\r
-            d0-d4 Maximum scan line\r
-Description: d0-d5=Character height-1,  only in textmodes\r
-------------------------------------------------------------\r
-Port-Index: 0ah              Port: 03d4h, 03b4h\r
-usage:      Cursor start\r
-            d7,d6 Reserved (0)\r
-            d5    Cursor off\r
-            d4-d0 Cursor start\r
-Description:\r
-------------------------------------------------------------\r
-Port-Index: 0bh              Port: 03d4h, 03b4h\r
-usage:      Cursor end\r
-            d7    reserved\r
-            d6,d5 Cursor skew\r
-            d4-d0 Cursor end\r
-Description:\r
-------------------------------------------------------------\r
-Port-Index: 0ch              Port: 03d4h, 03b4h\r
-usage:      Start address high\r
-------------------------------------------------------------\r
-Port-Index: 0dh              Port: 03d4h, 03b4h\r
-usage:      Start address low\r
-Description: Determine the offset in display memory to be\r
-             displayed on the upper-left corner on the screen\r
-------------------------------------------------------------\r
-Port-Index: 0eh              Port: 03d4h, 03b4h\r
-usage:      Cursor location (high byte)\r
-------------------------------------------------------------\r
-Port-Index: 0fh              Port: 03d4h, 03b4h\r
-usage:      Cursor location (low byte)\r
-Description: Where the cursor is displayed on screen\r
-------------------------------------------------------------\r
-Port-Index: 10h              Port: 03d4h, 03b4h\r
-usage:      Vertical retrace start\r
-Description: 8 bits out of 10\r
-------------------------------------------------------------\r
-Port-Index: 11h              Port: 03d4h, 03b4h\r
-usage:      Vertical retrace end\r
-            d7    Write protect CRTC register 0 to 7\r
-            d6    refresh cycle select\r
-            d5    enable vertical interrupt (when 0)\r
-            d4    Clear vertical interrupt (when 0)\r
-            d0-d3 Vertical retrace end\r
-------------------------------------------------------------\r
-Port-Index: 12h              Port: 03d4h, 03b4h\r
-usage:      Vertical display enable end\r
-Description: eight LSB bits out of ten-bit value which define\r
-             scan line minus one at which the display ends.\r
-             The other two are in CRTC register index 7\r
-------------------------------------------------------------\r
-Port-Index: 13h              Port: 03d4h, 03b4h\r
-usage:      Offset / Logical screen width\r
-Description: Logical screen width between successive scan lines\r
-------------------------------------------------------------\r
-Port-Index: 14h              Port: 03d4h, 03b4h\r
-usage:      Underline location register\r
-            d7    Reserved\r
-            d6    Double word mode\r
-            d5    count by 4\r
-            d0-d4 Underline location\r
-Description: Underline location: Monochrome textmode only\r
-------------------------------------------------------------\r
-Port-Index: 15h              Port: 03d4h, 03b4h\r
-usage:      Start vertical blanking\r
-Description: eight LSB bits of ten-bit value minus one which\r
-             define at which scan line the vertical blanking\r
-             starts. The other two bits are in CRTC registers\r
-             index 7 and 9\r
-------------------------------------------------------------\r
-Port-Index: 16h              Port: 03d4h, 03b4h\r
-usage:      End vertical blanking\r
-Description: eight LSB bits of a value which determine the scan\r
-             line after which vertical blanking ends.\r
-------------------------------------------------------------\r
-Port-Index: 17h              Port: 03d4h, 03b4h\r
-usage:      Mode control register\r
-            d7  Enable vertical and hoizontal retrace\r
-            d6  Byte mode (1), word mode (0)\r
-            d5  Address wrap\r
-            d4  Reserved\r
-            d3  count by 2\r
-            d2  multiple vertical by 2 (use half in\r
-                CRTC (8,10,12,14,18)\r
-            d1  Select row scan counter (not used)\r
-            d0  compatibilty mode support (enable interleave)\r
-------------------------------------------------------------\r
-Port-Index: 18h              Port: 03d4h, 03b4h\r
-usage:      Line compare register\r
-Description: Split screen,  8 bit value out of a ten-bit value\r
-------------------------------------------------------------\r
-Port-Index: 00h              Port: 03c4h\r
-usage:      Reset register\r
-            d7-d2 Reserved\r
-            d1    Synchronous reset\r
-            d0    Asynchronous reset\r
-Description: Synchr. when set to zero, will halt and reset\r
-             the sequencer at the end of its current cycle\r
-             Asyncht. when set to zero, will immediatly halt\r
-             and reset the sequencer. Data can be loss.\r
-------------------------------------------------------------\r
-Port-Index: 01h              Port: 03c4h\r
-usage:      Clock mode register\r
-            d7,d6 Reserved\r
-            d5    display off\r
-            d4    Allow 32-bit Fetch (not used in standard modes)\r
-            d3    Divide dot clock by 2 (used in some 320*200 modes)\r
-            d2    Allow 16-bit fetch (used in mon graphics modes)\r
-            d1    Reserved\r
-            d0    Enable (0) 9 dot characters (mono text and 400-line)\r
-Description: Display off: Will blank screen and give the cpu\r
-             uninterrupted access the display memory.\r
-------------------------------------------------------------\r
-Port-Index: 02h              Port: 03c4h\r
-usage:      Color plane write enable register\r
-            d7,d6 Reserved\r
-            d3    Plane 3 Write enable\r
-            d2    Plane 2 Write enable\r
-            d1    Plane 1 Write enable\r
-            d0    Plane 0 Write enable\r
-Description:\r
-------------------------------------------------------------\r
-Port-Index: 03h              Port: 03c4h\r
-usage:      Character generator select register\r
-            d7,d6 Reserved\r
-            d5    Character generator table select A (MSB)\r
-            d4    Character generator table select B (MSB)\r
-            d3,d2 Character generator table select A\r
-            d1,d0 Character generator table select B\r
-Description: This register is only of interest if your software\r
-             will be using multiple character sets. Either one\r
-             or two character sets can be active. Table A selects\r
-             the charcater with attribute d3 set to zero and\r
-             Table B is the one with d3 set to one.\r
-------------------------------------------------------------\r
-Port-Index: 04h              Port: 03c4h\r
-usage:      Memory mode register\r
-            d4-d7 Reserved\r
-            d3    Chain 4 (address bits 0&1 to select plan, mode 13h)\r
-            d2    Odd/even (address bit 0 to select plane 0&2 or   \r
-                  1&3 text modes)\r
-            d1    Extended memory (disable 64k modes)\r
-            d0    Reserved\r
-Description:\r
-------------------------------------------------------------\r
-Port-Index: 00h              Port: 03ceh\r
-usage:      Set / Reset register\r
-            d7-d4 Reserved (0)\r
-            d3    Fill data for plane 3\r
-            d2    Fill data for plane 2\r
-            d1    Fill data for plane 1\r
-            d0    Fill data for plane 0\r
-------------------------------------------------------------\r
-Port-Index: 01h              Port: 03ceh\r
-usage:      Set / Reset enable register\r
-            d7-d4 Reserved (0)\r
-            d3    enable set/reset for plane 3 (1 = enable)\r
-            d2    enable set/reset for plane 2 (1 = enable)\r
-            d1    enable set/reset for plane 1 (1 = enable)\r
-            d0    enable set/reset for plane 0 (1 = enable)\r
-Description: Set/Reset enable defines which memory planes will\r
-             receive fill data from set/reset register. Any plane\r
-             that is disable for set/reset will be written with\r
-             normal processor output data\r
-------------------------------------------------------------\r
-Port-Index: 02h              Port: 03ceh\r
-usage:      Color compare register\r
-            d7-d4 Reserved\r
-            d3    Color compare value for plane 3\r
-            d2    Color compare value for plane 2\r
-            d1    Color compare value for plane 1\r
-            d0    Color compare value for plane 0\r
-Description: one indicate that color is the same\r
-------------------------------------------------------------\r
-Port-Index: 03h              Port: 03ceh\r
-usage:      Data rotate / Function select register\r
-            d7-d5 Resrved (0)\r
-            d4,d3 Function select\r
-            d2-d0 Rotate count\r
-\r
-            d4 d3  Function\r
-            0  0   Write data unmodified\r
-            0  1   Write data ANDed with processor latches\r
-            1  0   Write data ORed with processor latches\r
-            1  1   Write data XORed with processor latches\r
-Description: Rotation is made before writing data\r
-------------------------------------------------------------\r
-Port-Index: 04h              Port: 03ceh\r
-usage:      Read plane select register\r
-            d7-d2 Reserved (0)\r
-            d1,d0 Defines color plane for reading (0-3)\r
-Description: Doesnt matter in color compare mode\r
-------------------------------------------------------------\r
-Port-Index: 05h              Port: 03ceh\r
-usage:      Mode register\r
-            d7    Reserved (0)\r
-            d6    256-colour mode\r
-            d5    Shift register mode\r
-            d4    Odd / Even mode\r
-            d3    Color compare mode enable (1 = enable)\r
-            d2    Reserved (0)\r
-            d1,d0 Write mode\r
-\r
-            d1 d0 Write mode\r
-            0  0  Direct write (data rotate, set/reset may apply)\r
-            0  1  Use processor latches as write data\r
-            1  0  Color plane n (0-3) is filled with the value of\r
-                  bit n in the write data\r
-            1  1  Use (rotated) write data ANDed with Bit mask as\r
-                  bit mask. Use set/reset as if set/reset was\r
-                  enable for all planes\r
-Description:\r
-------------------------------------------------------------\r
-Port-Index: 06h              Port: 03ceh\r
-usage:      Miscellaneous register\r
-            d7-d4 Reserved\r
-            d3-d2 Memory map\r
-                  00 = A000h for 128k\r
-                  01 = A000h for 64k\r
-                  10 = B000h for 32k\r
-                  11 = B800h for 32k\r
-            d1    Odd/even enable (used in text modes)\r
-            d0    Graphics mode enable\r
-Description: Memory map defines the location and size of the\r
-             host window\r
-------------------------------------------------------------\r
-Port-Index: 07h              Port: 03ceh\r
-usage:      Color don't care register\r
-            d7-d4 Reserved (0)\r
-            d3    Plane 3 don't care\r
-            d2    Plane 2 don't care\r
-            d1    Plane 1 don't care\r
-            d0    Plane 0 don't care\r
-Description: Color don't care is used in conjunction with color\r
-             compare mode. This register masks particular planes\r
-             from being tested during color compare cycles.\r
-------------------------------------------------------------\r
-Port-Index: 08h              Port: 03ceh\r
-usage:      Bitmask register\r
-Description: The bitmask register is used to mask certain bit\r
-             positons from being modified.\r
-------------------------------------------------------------\r
-Port-Index: -                 Port: 03c0h both index and data\r
-usage:      d7,d6 Reserved\r
-            d5    Palette address source\r
-                  0 = palette can be modified, screen is blanked\r
-                  1 = screen is enable, palette cannot be modified\r
-            d4-d0 Palette register address\r
-Description: Palette register address selects which register of\r
-             the attributes controller will be addres,sed by the\r
-             next I/O write cycle\r
-------------------------------------------------------------\r
-Port-Index: 00h-0fh          Port: 03c0h\r
-usage:      Color palette register\r
-            d6,d7 Reserved\r
-            d5-d0 Color value\r
-Description: not used in 256 color modes\r
-------------------------------------------------------------\r
-Port-Index: 10h              Port: 03c0h\r
-usage:      Mode control register\r
-            d7  p4,p5 source select\r
-            d6  pixel width\r
-            d5  Horizontal panning compatibility\r
-            d4  Reserved\r
-            d3  Background intensify / enable blinking\r
-            d2  Line graphics enable (text modes only)\r
-            d1  display type\r
-            d0  graphics / text mode\r
-Description: p4,p5 source select: selects the source for video\r
-              outputs p4 and p5 to the DACs. If set to zero, p4\r
-              and p5 are driven from the palette registers (normal\r
-              operation). If set to one, p4 and p5 video outputs\r
-              come from bits 0 and 1 of the color select register.\r
-             pixel width: is set to one in mode 13h (256-color mode)\r
-             horizontal panning compatibility: enhances the\r
-              operation of the line compare register of the CRT\r
-              controller, which allows one section of the screen\r
-              to be scrolled while another section remains stationary.\r
-              When this bit is set to one, the stationary\r
-              section of the screen will also be immune to horizontal\r
-              panning.\r
-------------------------------------------------------------\r
-Port-Index: 11h              Port: 03c0h\r
-usage:      Screen border color\r
-Description: In text modes, the screen border color register\r
-             selects the color of the border that sorrounds the\r
-             text display area on the screen. This is also referred\r
-             to by IBM as overscan. Unfortunately, this feature\r
-             does not work properly on EGA displays in 350-line\r
-             modes.\r
-------------------------------------------------------------\r
-Port-Index: 12h              Port: 03c0h\r
-usage:      Color plane enable register\r
-            d7,d6 Reserved\r
-            d5,d4 Video status mux\r
-            d3    Enable color plane 3\r
-            d2    Enable color plane 2\r
-            d1    Enable color plane 1\r
-            d0    Enable color plane 0\r
-Description:  The video status mux bits can be used in conjunction\r
-             with the diagnostic bits of input status register 1\r
-             to read palette registers. For the EGA, this is the\r
-             only means available for reading the palette registers.\r
-              Enable color planes can be used to enable or disable\r
-             color planes at the input to the color lockup table.\r
-             A zero in any of these bit positions will mask the\r
-             data from that color plane. The effect on the display\r
-             will be the same as if that color plane were cleared\r
-             to all zeros.\r
-------------------------------------------------------------\r
-Port-Index: 13h              Port: 03c0h\r
-usage:      Horizontal panning register\r
-            d7-d4 reserved\r
-            d3-d0 Horizontal pan\r
-Description: Horizontal pan allows the display to be shifted\r
-             horizontally one pixel at a time.\r
-\r
-             d3-d0      Number of pixels shifted to the left\r
-                        0+,1+,2+     13h     Other modes\r
-                        3+,7,7+\r
-             0          1            0       0\r
-             1          2            1       -\r
-             2          3            2       1\r
-             3          4            3       -\r
-             4          5            4       2\r
-             5          6            5       -\r
-             6          7            6       3\r
-             7          8            7       -\r
-             8          9            -       -\r
-------------------------------------------------------------\r
-Port-Index: 14h              Port: 03c0h\r
-usage:      Color select register\r
-            d7-d4 Reserved\r
-            d3    color 7\r
-            d2    color 6\r
-            d1    color 5\r
-            d0    color 4\r
-Description:  Color 7 and color 6: are normally used as the high\r
-             order bits of the eight-bit video color data from the\r
-             attribute controller to the DACs. The only exceptions\r
-             are 256-color modes\r
-              Color 5 and color 4: can be used in place of the p5\r
-             and p6 outputs from the palette registers (see mode\r
-             control register - index 10h). In 16-color modes, the\r
-             color select register can be used to rapidly cycle\r
-             between sets of colors in the video DAC.\r
-------------------------------------------------------------\r
-Port-Index: -                Port: 03c6h\r
-usage:      Pixel mask register\r
-Description: ???\r
-------------------------------------------------------------\r
-Port-Index: -                Port: 03c7h\r
-usage:      DAC state register (read-only)\r
-Description: if d0 and d1 is set to zero it indicates that\r
-             the lookup table is in a write mode\r
-------------------------------------------------------------\r
-Port-Index: -                Port: 03c7h\r
-usage:      Lookup table read index register (Write only)\r
-Description: Used when you want to read the palette (set color\r
-             number)\r
-------------------------------------------------------------\r
-Port-Index: -                Port: 03c8h\r
-usage:      Lookup table write index register\r
-Description: Used when you want to change palette (set color\r
-             number)\r
-------------------------------------------------------------\r
-Port-Index: -                Port: 03c9h\r
-usage:      Lookup table data register\r
-Description: Read color value (Red-Green-Blue) or write same data.\r
-------------------------------------------------------------\r
diff --git a/16/PCGPE10/VIDEO7.TXT b/16/PCGPE10/VIDEO7.TXT
deleted file mode 100644 (file)
index bd1ee1b..0000000
+++ /dev/null
@@ -1,197 +0,0 @@
-\r
-                 ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-                 ³ Programming the Video7 SVGA Chip ³\r
-                 ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-                 Written for the PC-GPE by Mark Feldman\r
-            e-mail address : u914097@student.canberra.edu.au\r
-                             myndale@cairo.anu.edu.au\r
-\r
-                  Please read the file SVGINTRO.TXT\r
-              (Graphics/SVGA/Intro PC-GPE menu option)\r
-\r
-             ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-             ³      THIS FILE MAY NOT BE DISTRIBUTED     ³\r
-             ³ SEPARATE TO THE ENTIRE PC-GPE COLLECTION. ³\r
-             ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Disclaimer ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-I assume no responsibility whatsoever for any effect that this file, the\r
-information contained therein or the use thereof has on you, your sanity,\r
-computer, spouse, children, pets or anything else related to you or your\r
-existance. No warranty is provided nor implied with this information.\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Video7 Extensions ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-To modify any of the Video7 extended registers you must enable the\r
-extensions. Disable them once you are done.\r
-\r
-To enable extensions:\r
-\r
-PortW[$3C4] := $EA06;\r
-\r
-To disable extensions:\r
-\r
-PortW[$3C4] := $AE06;\r
-\r
-\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Identifying the Video7 SVGA Chip ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-The presence of a Video7 chip can be detected with the following procedure:\r
-\r
-var old_value, new_value, id : byte;\r
-\r
-EnableVideo7Extensions;\r
-Port[$3D4] := $0C;\r
-old_value := Port[$3D5];\r
-Port[$3D5] := $55;\r
-new_value := Port[$3D5];\r
-Port[$3D4] := $1F;\r
-id := Port[$3D5];\r
-Port[$3D4] := $0C;\r
-Port[$3D5] := old_value;\r
-DisableVideo7Extentions;\r
-\r
-{ Check that register value is $55 Xor $EA }\r
-if id = $BF then\r
-  card is a video7\r
-else\r
-  card isn't a video7\r
-\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Identifying which Video7 Chip is Present ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-Once you know that the video card has a video7 in it you can read the Chip\r
-Revision register to find out which chip it is:\r
-\r
-Port[$3C4] := $8E;\r
-chip := Port[$3C5];\r
-\r
-              ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-              ³ Value in                               ³\r
-              ³ chip variable     Video7 Chip          ³\r
-              ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´\r
-              ³ 40h-49h           1024i                ³\r
-              ³ 50h-59h           V7VGA Version 5      ³\r
-              ³ 70h-7Eh           V7VGA FASTWRITE/VRAM ³\r
-              ³ 80h-FFh           VEGA VGA             ³\r
-              ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Video7 Graphics Display Modes ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-                  ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-                  ³ Mode     Resolution      Colors  ³\r
-                  ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´\r
-                  ³ 60h      752x410          16     ³\r
-                  ³ 61h      720x540          16     ³\r
-                  ³ 62h      800x600          16     ³\r
-                  ³ 63h      1024x768         2      ³\r
-                  ³ 64h      1024x768         4      ³\r
-                  ³ 65h      1024x768         16     ³\r
-                  ³ 66h      640x400          256    ³\r
-                  ³ 67h      640x480          256    ³\r
-                  ³ 68h      720x540          256    ³\r
-                  ³ 69h      800x600          256    ³\r
-                  ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Video7 Display Memory ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-Remeber, the extensions must be enabled before calling any of the following\r
-procedures.\r
-\r
-The Video7 version 1-3 chips use a ridiculously complex method to switch\r
-banks (in my opinion at least), so for these chips I'll only include the code\r
-to bank switch and leave the technical info on what it does and why it does\r
-it till a future PC-GPE version (if ever).\r
-\r
-The version 1-3 chips map two banks to host memory A000:0000-FFFFh. One bank\r
-is used for read operations, the other is used for write operations. For 256\r
-color modes there are 16 64k banks (numbered 0 - 15 for the following\r
-procedures). One really "stuffed in the head" thing about these chips (from\r
-a programmers point of view anyway) is that both bank registers use a common\r
-SVGA register to store their 2 low order bits, so if you set the Read Bank\r
-number, the Write Bank number's 2 low order bits will be set the same as the\r
-Read Bank number's 2 low order bits.\r
-\r
-The Write Bank number for 256 color modes can be set with the following\r
-procedure:\r
-\r
-Port[$3C4] := $F9;\r
-Port[$3C5] := bank_number and 1;\r
-Port[$3C2] := (Port[$3CC] and $DF) or ((bank_number and 2) shl 4);\r
-Port[$3C4] := $F6;\r
-Port[$3C5] := (Port[$3C5] and $FC) or (bank_number shr 2);\r
-\r
-The Read Bank number for 256 color modes can be set with the following\r
-procedure:\r
-\r
-Port[$3C4] := $F9;\r
-Port[$3C5] := bank_number and 1;\r
-Port[$3C2] := (Port[$3CC] and $DF) or ((bank_number and 2) shl 4);\r
-Port[$3C4] := $F6;\r
-Port[$3C5] := (Port[$3C5] and $F3) or (bank_number and $0C);\r
-\r
-By version 4 Headlands Technologies had gotten their act together and\r
-adopted a more "sane" bank switching scheme. Version 4 supports both single\r
-and duel paging schemes. There are 16 64k long banks, and a 64k granularity\r
-with the techniques used here.\r
-\r
-The single paging scheme maps a bank to host memory A000:0000-FFFFh for\r
-both read and write operations. The single paging scheme is the\r
-default for version 4, but can also be set with the following procedure:\r
-\r
-Port[$3C4] := $E0;\r
-Port[$3C5] := Port[$3C5] and $7F\r
-\r
-The Single/Write Bank Register is used to select which bank to map to\r
-host memory:\r
-\r
-          Index : E8h at port 3C4h\r
-          Read/Write at port 3C5h\r
-          ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿\r
-          ³ 7 ³ 6 ³ 5 ³ 4 ³ 3 ³ 2 ³ 1 ³ 0 ³\r
-          ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÙ\r
-            ÀÄÄÄÄÄÂÄÄÄÄÄÙ\r
-                 Bank\r
-\r
-A bank can be selected with the following procedure:\r
-\r
-PortW[$3C4] := (bank_number shl 12) + $E8;\r
-\r
-In duel paging mode one bank is mapped to A000:0000-FFFF for write operations\r
-and another for read operations. Duel paging mode can be selected with the\r
-following procedure:\r
-\r
-Port[$3C4] := $E0;\r
-Port[$3C5] := Port[$3C5] or $80;\r
-\r
-The Single/Write Bank Register (see above) is used to select which bank to\r
-map to host memory for writing operations. The Read Bank Register selects\r
-which bank to use for read operations:\r
-\r
-          Index : E9h at port 3C4h\r
-          Read/Write at port 3C5h\r
-          ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿\r
-          ³ 7 ³ 6 ³ 5 ³ 4 ³ 3 ³ 2 ³ 1 ³ 0 ³\r
-          ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÙ\r
-            ÀÄÄÄÄÄÂÄÄÄÄÄÙ\r
-                 Bank\r
-\r
-A read bank can be selected with the following procedure:\r
-\r
-PortW[$3C4] := (bank_number shl 12) + $E9;\r
diff --git a/16/PCGPE10/VOC.TXT b/16/PCGPE10/VOC.TXT
deleted file mode 100644 (file)
index 71ef562..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-\r
-Creative Voice (VOC) file format\r
---------------------------------\r
-\r
-~From: galt@dsd.es.com\r
-\r
-(byte numbers are hex!)\r
-\r
-    HEADER (bytes 00-19)\r
-    Series of DATA BLOCKS (bytes 1A+) [Must end w/ Terminator Block]\r
-\r
-- ---------------------------------------------------------------\r
-\r
-HEADER:\r
-=======\r
-     byte #     Description\r
-     ------     ------------------------------------------\r
-     00-12      "Creative Voice File"\r
-     13         1A (eof to abort printing of file)\r
-     14-15      Offset of first datablock in .voc file (std 1A 00\r
-                in Intel Notation)\r
-     16-17      Version number (minor,major) (VOC-HDR puts 0A 01)\r
-     18-19      2's Comp of Ver. # + 1234h (VOC-HDR puts 29 11)\r
-\r
-- ---------------------------------------------------------------\r
-\r
-DATA BLOCK:\r
-===========\r
-\r
-   Data Block:  TYPE(1-byte), SIZE(3-bytes), INFO(0+ bytes)\r
-   NOTE: Terminator Block is an exception -- it has only the TYPE byte.\r
-\r
-      TYPE   Description     Size (3-byte int)   Info\r
-      ----   -----------     -----------------   -----------------------\r
-      00     Terminator      (NONE)              (NONE)\r
-      01     Sound data      2+length of data    *\r
-      02     Sound continue  length of data      Voice Data\r
-      03     Silence         3                   **\r
-      04     Marker          2                   Marker# (2 bytes)\r
-      05     ASCII           length of string    null terminated string\r
-      06     Repeat          2                   Count# (2 bytes)\r
-      07     End repeat      0                   (NONE)\r
-      08     Extended        4                   ***\r
-\r
-      *Sound Info Format:       **Silence Info Format:\r
-       ---------------------      ----------------------------\r
-       00   Sample Rate           00-01  Length of silence - 1\r
-       01   Compression Type      02     Sample Rate\r
-       02+  Voice Data\r
-\r
-    ***Extended Info Format:\r
-       ---------------------\r
-       00-01  Time Constant: Mono: 65536 - (256000000/sample_rate)\r
-                             Stereo: 65536 - (25600000/(2*sample_rate))\r
-       02     Pack\r
-       03     Mode: 0 = mono\r
-                    1 = stereo\r
-\r
-\r
-  Marker#           -- Driver keeps the most recent marker in a status byte\r
-  Count#            -- Number of repetitions + 1\r
-                         Count# may be 1 to FFFE for 0 - FFFD repetitions\r
-                         or FFFF for endless repetitions\r
-  Sample Rate       -- SR byte = 256-(1000000/sample_rate)\r
-  Length of silence -- in units of sampling cycle\r
-  Compression Type  -- of voice data\r
-                         8-bits    = 0\r
-                         4-bits    = 1\r
-                         2.6-bits  = 2\r
-                         2-bits    = 3\r
-                         Multi DAC = 3+(# of channels) [interesting--\r
-                                       this isn't in the developer's manual]\r
diff --git a/16/PCGPE10/WAV.TXT b/16/PCGPE10/WAV.TXT
deleted file mode 100644 (file)
index ce9ec12..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-\r
-          ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-          ³ The Microsoft Multimedia WAV Sound File Format ³\r
-          ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-                 Written for the PC-GPE by Mark Feldman\r
-            e-mail address : u914097@student.canberra.edu.au\r
-                             myndale@cairo.anu.edu.au\r
-\r
-             ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-             ³      THIS FILE MAY NOT BE DISTRIBUTED     ³\r
-             ³ SEPARATE TO THE ENTIRE PC-GPE COLLECTION. ³\r
-             ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Disclaimer ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-I assume no responsibility whatsoever for any effect that this file, the\r
-information contained therein or the use thereof has on you, your sanity,\r
-computer, spouse, children, pets or anything else related to you or your\r
-existance. No warranty is provided nor implied with this information.\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ The RIFF File Format ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-WAV files use the RIFF file structure. The RIFF format was designed\r
-for multi-media purposes. A RIFF files consists of a number of "chunks":\r
-\r
-  ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-  ³ Byte              Length                                               ³\r
-  ³ Offset   Name   (in bytes)    Description                              ³\r
-  ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´\r
-  ³ 00h      rID        4h        Contains the characters "RIFF"           ³\r
-  ³ 04h      rLen       4h        The length of the data in the next chunk ³\r
-  ³ 08h      rData     rLen       The data chunk                           ³\r
-  ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ The WAVE Form Definition ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-The rData chunk in a WAV file is split up into several further chunks:\r
-\r
- ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
- ³ rData                                                                   ³\r
- ³ Byte              Length                                                ³\r
- ³ Offset   Name   (in bytes)    Description                               ³\r
- ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´\r
- ³ 00h      wID        4h        Contains the characters "WAVE"            ³\r
- ³ 04h      Format    14h        Contains data which specifies the format  ³\r
- ³          Chunk                  of the Data in the Data Chunk           ³\r
- ³ 18h      WAVE Data  ?         Contains the WAV audio data               ³\r
- ³          Chunk                                                          ³\r
- ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ The Format Chunk ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-The Format Chunk is split up into these fields:\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-³ Format                                                                  ³\r
-³ Chunk                  Length                                           ³\r
-³ Offset  Name         (in bytes)   Description                           ³\r
-ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´\r
-³ 00h     fId               4       Contains the characters "fmt"         ³\r
-³ 04h     fLen              4       Length of data in the format chunk    ³\r
-³ 08h     wFormatTag        2       *                                     ³\r
-³ 0Ah     nChannels         2       Number of channels, 1=mono, 2=stereo  ³\r
-³ 0Ch     nSamplesPerSec    2       Playback frequency                    ³\r
-³ 0Eh     nAvgBytesPerSec   2       **                                    ³\r
-³ 10h     nBlockAlign       2       ***                                   ³\r
-³ 12h     FormatSpecific    2       Format specific data area             ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-* The wFormatTag specifies the wave format, eg 1 = Pulse Code Modulation\r
-  (or in plain english, regular 8 bit sampled uncompressed sound)\r
-\r
-** Indicates the average number of bytes a second the data should be\r
-   transferred at = nChannels * nSamplesPerSec * (nBitsPerSample / 8)\r
-\r
-*** Indicates the block alignment of the data in the data chunk. Software\r
-    needs to process a multiplt of nBlockAlign at a time.\r
-    nBlockAlign = nChannels * (nBitsPerSample / 8)\r
-\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ The Data Chunk ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-The Data Chunk is split up into these fields:\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-³  Data                                                                   ³\r
-³ Chunk                  Length                                           ³\r
-³ Offset  Name         (in bytes)   Description                           ³\r
-ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´\r
-³ 00h     dId              4        Contains the characters "data"        ³\r
-³ 02h     dLen             4        Length of data in the dData field     ³\r
-³ 00h     dData            dLen     The actual waveform data              ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-In mono 8-bit files each byte represents one sample. In stereo 8-bit files\r
-two bytes are stored for each sample, the first byte is the left channel\r
-value, the next is the right channel value.\r
diff --git a/16/PCGPE10/WORMIE.PAS b/16/PCGPE10/WORMIE.PAS
deleted file mode 100644 (file)
index db1528c..0000000
+++ /dev/null
@@ -1,307 +0,0 @@
-{$R-}\r
-{$X+}\r
-Program T_holic;\r
-\r
-USES\r
-   Crt;\r
-\r
-CONST\r
-   Vga : Word = $a000;\r
-\r
-   Block : Array[1..40,1..40] of Byte = (\r
-\r
-       (0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0),\r
-       (0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0),\r
-       (0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0),\r
-       (0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0),\r
-       (0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0),\r
-       (0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0),\r
-       (0,0,0,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,0,0,0,0),\r
-       (0,0,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,0,0,0),\r
-       (0,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,0,0),\r
-       (0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,0),\r
-       (1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1),\r
-       (1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1),\r
-       (1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1),\r
-       (1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1),\r
-       (1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1),\r
-       (1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1),\r
-       (1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1),\r
-       (1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1),\r
-       (1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1),\r
-       (1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1),\r
-       (1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1),\r
-       (1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1),\r
-       (1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1),\r
-       (1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1),\r
-       (1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1),\r
-       (1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1),\r
-       (1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1),\r
-       (1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1),\r
-       (1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1),\r
-       (1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1),\r
-       (0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,0),\r
-       (0,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,0,0),\r
-       (0,0,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,0,0,0),\r
-       (0,0,0,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,0,0,0,0),\r
-       (0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0),\r
-       (0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0),\r
-       (0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0),\r
-       (0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0),\r
-       (0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0),\r
-       (0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0)\r
-       );\r
-\r
-\r
-VAR\r
-   WholePal : Array[1..256,1..3] of Byte;\r
-   CurX,CurY,CurCol : Word;\r
-   right,down:Boolean;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure SetMCGA;  { This procedure gets you into 320x200x256 mode. }\r
-BEGIN\r
-  asm\r
-     mov        ax,0013h\r
-     int        10h\r
-  end;\r
-END;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure SetText;  { This procedure returns you to text mode.  }\r
-BEGIN\r
-  asm\r
-     mov        ax,0003h\r
-     int        10h\r
-  end;\r
-END;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-procedure WaitRetrace; assembler;\r
-label\r
-  l1, l2;\r
-asm\r
-    mov dx,3DAh\r
-l1:\r
-    in al,dx\r
-    and al,08h\r
-    jnz l1\r
-l2:\r
-    in al,dx\r
-    and al,08h\r
-    jz  l2\r
-end;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure GetPal(ColorNo : Byte; Var R,G,B : Byte);\r
-  { This reads the values of the Red, Green and Blue values of a certain\r
-    color and returns them to you. }\r
-Begin\r
-   Port[$3c7] := ColorNo;\r
-   R := Port[$3c9];\r
-   G := Port[$3c9];\r
-   B := Port[$3c9];\r
-End;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure Pal(ColorNo : Byte; R,G,B : Byte);\r
-  { This sets the Red, Green and Blue values of a certain color }\r
-Begin\r
-   Port[$3c8] := ColorNo;\r
-   Port[$3c9] := R;\r
-   Port[$3c9] := G;\r
-   Port[$3c9] := B;\r
-End;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure FadeDown;\r
-  { This procedure fades the screen out to black. }\r
-VAR loop1,loop2:integer;\r
-    Tmp : Array [1..3] of byte;\r
-      { This is temporary storage for the values of a color }\r
-BEGIN\r
-  For loop1:=1 to 64 do BEGIN\r
-    WaitRetrace;\r
-    For loop2:=1 to 255 do BEGIN\r
-      Getpal (loop2,Tmp[1],Tmp[2],Tmp[3]);\r
-      If Tmp[1]>0 then dec (Tmp[1]);\r
-      If Tmp[2]>0 then dec (Tmp[2]);\r
-      If Tmp[3]>0 then dec (Tmp[3]);\r
-        { If the Red, Green or Blue values of color loop2 are not yet zero,\r
-          then, decrease them by one. }\r
-      Pal (loop2,Tmp[1],Tmp[2],Tmp[3]);\r
-        { Set the new, altered pallette color. }\r
-    END;\r
-  END;\r
-END;\r
-\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure Putpixel (X,Y : Integer; Col : Byte);\r
-  { This puts a pixel on the screen by writing directly to memory. }\r
-BEGIN\r
-  Mem [VGA:X+(Y*320)]:=Col;\r
-END;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure CunninglyManipulatePalette;\r
-   { This moves up the pallette by one so that the color of the block\r
-     being put down is always the same }\r
-Var\r
-   Tmp : Array[1..3] of byte;\r
-  loop : Byte;\r
-Begin\r
-   Move(WholePal[210],Tmp[1],3);           { Save Last Colour             }\r
-   Move(WholePal[1],WholePal[2],209*3);    { Move Rest Up one             }\r
-   Move(Tmp,WholePal[1],3);                { Put Last Colour to First pos }\r
-   For Loop := 1 to 210 do\r
-      Pal(Loop,WholePal[Loop,1],WholePal[Loop,2],WholePal[Loop,3]);\r
-End;\r
-\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure PreparePalette;\r
-   { This sets up the palette to have pretty gradients in it for our use }\r
-Var\r
-   Loop : Byte;\r
-Begin\r
-   For loop := 1 to 30 do BEGIN\r
-      Wholepal [loop,1]:=loop*2;\r
-      Wholepal [loop,2]:=0;\r
-      Wholepal [loop,3]:=0;\r
-   END;\r
-\r
-   For loop := 31 to 60 do BEGIN\r
-      Wholepal [loop,1]:=0;\r
-      Wholepal [loop,2]:=loop*2-30;\r
-      Wholepal [loop,3]:=0;\r
-   END;\r
-\r
-\r
-   For loop := 61 to 90 do BEGIN\r
-      Wholepal [loop,1]:=0;\r
-      Wholepal [loop,2]:=0;\r
-      Wholepal [loop,3]:=loop*2-30;\r
-   END;\r
-\r
-   For loop := 91 to 120 do BEGIN\r
-      Wholepal [loop,1]:=loop*2-30;\r
-      Wholepal [loop,2]:=loop*2-30;\r
-      Wholepal [loop,3]:=loop*2-30;\r
-   END;\r
-\r
-   For loop := 121 to 150 do BEGIN\r
-      Wholepal [loop,1]:=loop*2-30;\r
-      Wholepal [loop,2]:=loop*2-30;\r
-      Wholepal [loop,3]:=0;\r
-   END;\r
-\r
-   For loop := 151 to 180 do BEGIN\r
-      Wholepal [loop,1]:=0;\r
-      Wholepal [loop,2]:=loop*2-30;\r
-      Wholepal [loop,3]:=loop*2-30;\r
-   END;\r
-\r
-   For loop := 181 to 210 do BEGIN\r
-      Wholepal [loop,1]:=loop*2-30;\r
-      Wholepal [loop,2]:=0;\r
-      Wholepal [loop,3]:=loop*2-30;\r
-   END;\r
-End;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure IngeniouslyMoveCurPos;\r
-   { This moves the position of the block to put down around the screen }\r
-Begin\r
-   CurCol := (CurCol) mod 210 + 1;        { This Does Work                }\r
-   if right then CurX := CurX + 4 else CurX := CurX - 3;\r
-   if down then CurY := CurY + 3 else CurY := CurY - 2;\r
-\r
-   If CurX > 250 then right:= FALSE;\r
-   If CurY > 150 then down := FALSE;\r
-\r
-   If CurX < 10 then right := TRUE;\r
-   If CurY < 10 then down  := TRUE;\r
-\r
-End;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure DrawBlock;\r
-   { This draws the block onto the VGA screen }\r
-Var\r
-   Xloop,Yloop : Integer;\r
-Begin\r
-   For XLoop := 1 to 40 do\r
-      For Yloop := 1 to 40 do\r
-         If block[Yloop,Xloop] = 1 then\r
-            PutPixel(CurX+Xloop,CurY+Yloop,CurCol);\r
-End;\r
-\r
-\r
-{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}\r
-Procedure StartSnakiepoo;\r
-   { This is the proc where we set things up & set em in motion! ;-) }\r
-Begin\r
-   CurX := 100;\r
-   CurY := 100;\r
-   CurCol := 1;\r
-   PreparePalette;\r
-   Repeat\r
-      DrawBlock;\r
-      CunninglyManipulatePalette;\r
-      IngeniouslyMoveCurPos;\r
-   Until Keypressed;\r
-   fadedown;\r
-   Readkey;\r
-End;\r
-\r
-Begin\r
-   ClrScr;\r
-   Writeln ('Hi there!  This is a small little routine that Livewire');\r
-   Writeln ('and Denthor of ASPHYXIA threw together during lunch break');\r
-   Writeln ('at varsity. We first saw this routine in the T-Holic demo');\r
-   Writeln ('by Extreme a few months back, and decided to write it as');\r
-   Writeln ('a supliment to the ASPHYXIA VGA Demo Trainer Series on the');\r
-   Writeln ('MailBox BBS here in Durban.                              ');\r
-   Writeln;\r
-   Writeln ('The routine consists of a wormy type thing bouncing around');\r
-   Writeln ('the screen, and looks quite effective. The code is');\r
-   Writeln ('documented, and the concept behind it is so easy everyone');\r
-   Writeln ('should be able to understand it.                         ');\r
-   Writeln;\r
-   Writeln ('The Pal routines, setmcga, waitretrace etc. are taken');\r
-   Writeln ('directly from the ASPHYXIA Trainer Series, and you should');\r
-   Writeln ('read those to understand how they work.');\r
-   Writeln;\r
-   Writeln ('See the Trainer Series for how to get into contact with us.');\r
-   Writeln; Writeln;\r
-   Writeln ('Hit any key to continue ....                             ');\r
-   Readkey;\r
-   SetMCGA;\r
-   StartSnakiepoo;\r
-   SetText;\r
-   Writeln ('All done. This was a sample routine written by ASPHYXIA.');\r
-   Writeln ('Please read the ASPHYXIA Demo Trainer Series on the MailBox BBS,');\r
-   Writeln ('written by Denthor. You may reach DENTHOR under the name of GRANT');\r
-   Writeln ('SMITH on the MailBox BBS, or leave a message to ASPHYXIA on the');\r
-   Writeln ('ASPHYXIA BBS. Get the numbers from Roblist, or write to :');\r
-   Writeln ('             Grant Smith');\r
-   Writeln ('             P.O. Box 270');\r
-   Writeln ('             Kloof');\r
-   Writeln ('             3640');\r
-   Writeln ('We hope to hear from you soon!');\r
-   Writeln; Writeln;\r
-   Write   ('Hit any key to exit ...');\r
-   Readkey;\r
-End.
\ No newline at end of file
diff --git a/16/PCGPE10/XMS30.TXT b/16/PCGPE10/XMS30.TXT
deleted file mode 100644 (file)
index 09698de..0000000
+++ /dev/null
@@ -1,1079 +0,0 @@
-eXtended Memory Specification (XMS), ver 3.0\r
-\r
-\r
-January 1991\r
-\r
-\r
-Copyright (c) 1988, Microsoft Corporation, Lotus Development\r
-Corporation, Intel Corporation, and AST Research, Inc.\r
-\r
-Microsoft Corporation                                            \r
-Box 97017\r
-\r
-One Microsoft Way                                       \r
-Redmond, WA 98073\r
-\r
-LOTUS (r)\r
-INTEL (r)\r
-MICROSOFT (r)\r
-AST (r) Research\r
-\r
-This specification was jointly developed by Microsoft Corporation,\r
-Lotus Development Corporation, Intel Corporation,and AST Research,\r
-Inc. Although it has been released into the public domain and is not\r
-confidential or proprietary, the specification is still the copyright\r
-and property of Microsoft Corporation, Lotus Development Corporation,\r
-Intel Corporation, and AST Research, Inc.\r
-\r
-Disclaimer of Warranty\r
-\r
-MICROSOFT CORPORATION, LOTUS DEVELOPMENT CORPORATION, INTEL\r
-CORPORATION, AND AST RESEARCH, INC., EXCLUDE ANY AND ALL IMPLIED\r
-WARRANTIES, INCLUDING WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A\r
-PARTICULAR PURPOSE. NEITHER MICROSOFT NOR LOTUS NOR INTEL NOR AST\r
-RESEARCH MAKE ANY WARRANTY OF REPRESENTATION, EITHER EXPRESS OR\r
-IMPLIED, WITH RESPECT TO THIS SPECIFICATION, ITS QUALITY,\r
-PERFORMANCE, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.\r
-NEITHER MICROSOFT NOR LOTUS NOR INTEL NOR AST RESEARCH SHALL HAVE ANY\r
-LIABILITY FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING\r
-OUT OF OR RESULTING FROM THE USE OR MODIFICATION OF THIS\r
-SPECIFICATION.\r
-\r
-This specification uses the following trademarks:\r
-\r
-Intel is a registered trademark of Intel Corporation, Microsoft is a\r
-registered trademark of Microsoft Corporation, Lotus is a registered\r
-trademark of Lotus Development Corporation, and AST is a registered\r
-trademark of AST Research, Inc.\r
-\r
-\r
-\r
-Extended Memory Specification\r
-\r
-    The purpose of this document is to define the Extended Memory Specification (XMS) version 3.00 for MS-DOS.  XMS allows DOS programs to utilize additional memory found in Intel's 80286 and 80386 based machines in a consistent, machine independent manner.  With some restrictions, XMS adds almost 64K to the 640K which DOS programs can access directly.  Depending on available hardware, XMS may provide even more memory to DOS programs.  XMS also provides DOS programs with a standard method of storing data in extended memory.\r
-\r
-        To be considered fully XMS 3.0 compliant, all calls except those associated with UMB support must be implemented. UMB functions 10h, 11h and 12h are optional for XMS 3.0 and may return the Function Not Implemented error code, 80h.\r
-\r
-DEFINITIONS:\r
-------------\r
-\r
-Extended Memory:\r
-Memory in 80286 and 80386 based machines which is located above the 1MB address boundary.\r
-\r
-High Memory Area (HMA):\r
-The first 64K of extended memory.  The High Memory Area is unique because code can be executed in it while in real mode.  The HMA officially starts at FFFF:10h and ends at FFFF:FFFFh making it 64K-16 bytes in length.\r
-                    \r
-Upper Memory Blocks (UMBs):\r
-Blocks of memory available on some 80x86 based machines which are located between DOS's 640K limit and the 1MB address boundary.  The number, size, and location of these blocks vary widely depending upon the types of hardware adapter cards installed in the machine.\r
-                    \r
-Extended Memory Blocks (EMBs):\r
-Blocks of extended memory located above the HMA which can only be used for data storage.\r
-                    \r
-A20 Line:\r
-The 21st address line of 80x86 CPUs.  Enabling the A20 line allows access to the HMA.\r
-\r
-XMM:\r
-An Extended Memory Manager.  A DOS device driver which implements XMS.  XMMs are machine specific but allow programs to use extended memory in a machine-independent manner.\r
-    \r
-HIMEM.SYS:\r
-The Extended Memory Manager currently being distributed by Microsoft.\r
-\r
-\r
-\r
-Helpful Diagram:\r
-\r
-|               |   Top of Memory\r
-|               |\r
-|               |\r
-|       /\      |\r
-|       /||\    |\r
-|       ||      |\r
-|       ||      |\r
-|               |\r
-|               |\r
-|               |\r
-|       Possible Extended Memory Block  |\r
-|               |\r
-|               |\r
-|               |\r
-|       ||      |\r
-|       ||      |\r
-|       \||/    |\r
-|       \/      |\r
-|               |\r
-|               |\r
-|       Other EMBs could exist above 1088K (1MB+64K)    |\r
-|               |\r
-|               |\r
-|               |   1088K\r
-|               |\r
-|               |\r
-|       The High Memory Area    |\r
-|               |\r
-|               |\r
-|               |   1024K or 1MB\r
-|               |\r
-|       /\      |\r
-|       /||\    |\r
-|       ||      |\r
-|       ||      |\r
-|               |\r
-|               |\r
-|       Possible Upper Memory Block     |\r
-|               |\r
-|       ||      |\r
-|       ||      |\r
-|       \||/    |\r
-|       \/      |\r
-|               |\r
-|       Other UMBs could exist between 640K and 1MB     |\r
-|               |\r
-|               |   640K\r
-\r
-|               |\r
-|               |\r
-|               |\r
-|       Conventional or DOS Memory      |\r
-|               |\r
-|               |\r
-|               |\r
-|               |\r
-|               |\r
-+               +   0K\r
-\r
-DRIVER INSTALLATION:\r
---------------------\r
-\r
-    An XMS driver is installed by including a DEVICE= statement in the\r
-machine's CONFIG.SYS file.  It must be installed prior to any other\r
-devices or TSRs which use it.  An optional parameter after the driver's \r
-name (suggested name "/HMAMIN=") indicates the minimum amount of space in\r
-the HMA a program can use.  Programs which use less than the minimum will\r
-not be placed in the HMA.  See "Prioritizing HMA Usage" below for more\r
-information.  A second optional parameter (suggested name "/NUMHANDLES=")\r
-allows users to specify the maximum number of extended memory blocks which\r
-may be allocated at any time.\r
-\r
-    NOTE: XMS requires DOS 3.00 or above.\r
-\r
-\r
-THE PROGRAMMING API:\r
---------------------\r
-\r
-    The XMS API Functions are accessed via the XMS driver's Control Function.\r
-The address of the Control Function is determined via INT 2Fh.  First, a\r
-program should determine if an XMS driver is installed.  Next, it should\r
-retrieve the address of the driver's Control Function.  It can then use any\r
-of the available XMS functions.  The functions are divided into several\r
-groups:\r
-\r
-        1. Driver Information Functions (0h)\r
-        2. HMA Management Functions (1h-2h)\r
-        3. A20 Management Functions (3h-7h)\r
-        4. Extended Memory Management Functions (8h-Fh)\r
-        5. Upper Memory Management Functions (10h-11h)\r
-\r
-\r
-DETERMINING IF AN XMS DRIVER IS INSTALLED:\r
-------------------------------------------\r
-\r
-    The recommended way of determining if an XMS driver is installed is to\r
-set AH=43h and AL=00h and then execute INT 2Fh.  If an XMS driver is available,\r
-80h will be returned in AL.\r
-\r
-    Example:\r
-            ; Is an XMS driver installed?\r
-            mov     ax,4300h\r
-            int     2Fh         \r
-            cmp     al,80h  \r
-            jne     NoXMSDriver\r
-            \r
-\r
-CALLING THE API FUNCTIONS:\r
---------------------------\r
-\r
-    Programs can execute INT 2Fh with AH=43h and AL=10h to obtain the address\r
-of the driver's control function.  The address is returned in ES:BX.  This\r
-function is called to access all of the XMS functions.  It should be called\r
-with AH set to the number of the API function requested.  The API function\r
-will put a success code of 0001h or 0000h in AX.  If the function succeeded\r
-(AX=0001h), additional information may be passed back in BX and DX.  If the\r
-function failed (AX=0000h), an error code may be returned in BL.  Valid\r
-error codes have their high bit set.  Developers should keep in mind that\r
-some of the XMS API functions may not be implemented by all drivers and will\r
-return failure in all cases.\r
-\r
-    Example:\r
-            ; Get the address of the driver's control function\r
-            mov     ax,4310h\r
-            int     2Fh\r
-            mov     word ptr [XMSControl],bx        ; XMSControl is a DWORD\r
-            mov     word ptr [XMSControl+2],es\r
-            \r
-            ; Get the XMS driver's version number\r
-            mov     ah,00h\r
-            call    [XMSControl]    ; Get XMS Version Number\r
-\r
-    NOTE: Programs should make sure that at least 256 bytes of stack space\r
-          is available before calling XMS API functions.\r
-\r
-\r
-API FUNCTION DESCRIPTIONS:\r
---------------------------\r
-\r
-    The following XMS API functions are available:\r
-\r
-       0h)  Get XMS Version Number\r
-       1h)  Request High Memory Area\r
-       2h)  Release High Memory Area\r
-       3h)  Global Enable A20\r
-       4h)  Global Disable A20\r
-       5h)  Local Enable A20\r
-       6h)  Local Disable A20\r
-       7h)  Query A20\r
-       8h)  Query Free Extended Memory\r
-       9h)  Allocate Extended Memory Block\r
-       Ah)  Free Extended Memory Block\r
-       Bh)  Move Extended Memory Block\r
-       Ch)  Lock Extended Memory Block\r
-       Dh)  Unlock Extended Memory Block\r
-       Eh)  Get Handle Information\r
-       Fh)  Reallocate Extended Memory Block\r
-      10h)  Request Upper Memory Block\r
-      11h)  Release Upper Memory Block\r
-      12h) Realloc Upper Memory Block\r
-      88h) Query any Free Extended Memory\r
-      89h) Allocate any Extended Memory Block\r
-      8Eh) Get Extended EMB Handle\r
-      8Fh) Realloc any Extended Memory\r
-\r
-Each is described below.\r
-\r
-\r
-Get XMS Version Number (Function 00h):\r
---------------------------------------\r
-\r
-    ARGS:   AH = 00h\r
-    RETS:   AX = XMS version number\r
-            BX = Driver internal revision number\r
-            DX = 0001h if the HMA exists, 0000h otherwise\r
-    ERRS:   None\r
-\r
-    This function returns with AX equal to a 16-bit BCD number representing\r
-the revision of the DOS Extended Memory Specification which the driver\r
-implements (e.g. AX=0235h would mean that the driver implemented XMS version\r
-2.35).  BX is set equal to the driver's internal revision number mainly for\r
-debugging purposes.  DX indicates the existence of the HMA (not its\r
-availability) and is intended mainly for installation programs.\r
-    \r
-    NOTE: This document defines version 3.00 of the specification.\r
-\r
-\r
-Request High Memory Area (Function 01h):\r
-----------------------------------------\r
-\r
-    ARGS:   AH = 01h\r
-            If the caller is a TSR or device driver,\r
-                DX = Space needed in the HMA by the caller in bytes\r
-            If the caller is an application program,\r
-                DX = FFFFh     \r
-    RETS:   AX = 0001h if the HMA is assigned to the caller, 0000h otherwise\r
-    ERRS:   BL = 80h if the function is not implemented\r
-            BL = 81h if a VDISK device is detected\r
-            BL = 90h if the HMA does not exist\r
-            BL = 91h if the HMA is already in use\r
-            BL = 92h if DX is less than the /HMAMIN= parameter\r
-\r
-    This function attempts to reserve the 64K-16 byte high memory area for\r
-the caller.  If the HMA is currently unused, the caller's size parameter is\r
-compared to the /HMAMIN= parameter on the driver's command line.  If the\r
-value passed by the caller is greater than or equal to the amount specified\r
-by the driver's parameter, the request succeeds.  This provides the ability\r
-to ensure that programs which use the HMA efficiently have priority over\r
-those which do not.\r
-\r
-    NOTE: See the sections "Prioritizing HMA Usage" and "High Memory Area\r
-          Restrictions" below for more information.\r
-\r
-\r
-Release High Memory Area (Function 02h):\r
-----------------------------------------\r
-\r
-    ARGS:   AH = 02h\r
-    RETS:   AX = 0001h if the HMA is successfully released, 0000h otherwise\r
-    ERRS:   BL = 80h if the function is not implemented\r
-            BL = 81h if a VDISK device is detected\r
-            BL = 90h if the HMA does not exist\r
-            BL = 93h if the HMA was not allocated\r
-\r
-    This function releases the high memory area and allows other programs to\r
-use it.  Programs which allocate the HMA must release it before exiting.  \r
-When the HMA has been released, any code or data stored in it becomes invalid\r
-and should not be accessed.\r
-\r
-\r
-Global Enable A20 (Function 03h):\r
----------------------------------\r
-\r
-    ARGS:   AH = 03h\r
-    RETS:   AX = 0001h if the A20 line is enabled, 0000h otherwise\r
-    ERRS:   BL = 80h if the function is not implemented\r
-            BL = 81h if a VDISK device is detected\r
-            BL = 82h if an A20 error occurs\r
-\r
-    This function attempts to enable the A20 line.  It should only be used\r
-by programs which have control of the HMA.  The A20 line should be turned\r
-off via Function 04h (Global Disable A20) before a program releases control\r
-of the system.\r
-\r
-    NOTE: On many machines, toggling the A20 line is a relatively slow\r
-          operation.\r
-\r
-\r
-Global Disable A20 (Function 04h):\r
-----------------------------------\r
-\r
-    ARGS:   AH = 04h\r
-    RETS:   AX = 0001h if the A20 line is disabled, 0000h otherwise\r
-    ERRS:   BL = 80h if the function is not implemented\r
-            BL = 81h if a VDISK device is detected\r
-            BL = 82h if an A20 error occurs\r
-            BL = 94h if the A20 line is still enabled\r
-    \r
-    This function attempts to disable the A20 line.  It should only be used\r
-by programs which have control of the HMA.  The A20 line should be disabled\r
-before a program releases control of the system.\r
-\r
-    NOTE: On many machines, toggling the A20 line is a relatively slow\r
-          operation.\r
-\r
-\r
-Local Enable A20 (Function 05h):\r
---------------------------------\r
-\r
-    ARGS:   AH = 05h\r
-    RETS:   AX = 0001h if the A20 line is enabled, 0000h otherwise\r
-    ERRS:   BL = 80h if the function is not implemented\r
-            BL = 81h if a VDISK device is detected\r
-            BL = 82h if an A20 error occurs\r
-\r
-    This function attempts to enable the A20 line.  It should only be used\r
-by programs which need direct access to extended memory.  Programs which use\r
-this function should call Function 06h (Local Disable A20) before releasing\r
-control of the system.\r
-\r
-    NOTE: On many machines, toggling the A20 line is a relatively slow\r
-          operation.\r
-\r
-\r
-Local Disable A20 (Function 06h):\r
----------------------------------\r
-\r
-    ARGS:   AH = 06h\r
-    RETS:   AX = 0001h if the function succeeds, 0000h otherwise\r
-    ERRS:   BL = 80h if the function is not implemented\r
-            BL = 81h if a VDISK device is detected\r
-            BL = 82h if an A20 error occurs\r
-            BL = 94h if the A20 line is still enabled\r
-\r
-    This function cancels a previous call to Function 05h (Local Enable\r
-A20).  It should only be used by programs which need direct access to\r
-extended memory.  Previous calls to Function 05h must be canceled before\r
-releasing control of the system.\r
-\r
-    NOTE: On many machines, toggling the A20 line is a relatively slow\r
-          operation.\r
-\r
-\r
-Query A20 (Function 07h):\r
--------------------------\r
-\r
-    ARGS:   AH = 07h\r
-    RETS:   AX = 0001h if the A20 line is physically enabled, 0000h otherwise\r
-    ERRS:   BL = 00h if the function succeeds\r
-            BL = 80h if the function is not implemented\r
-            BL = 81h if a VDISK device is detected\r
-\r
-    This function checks to see if the A20 line is physically enabled.  It\r
-does this in a hardware independent manner by seeing if "memory wrap" occurs.\r
-\r
-\r
-Query Free Extended Memory (Function 08h):\r
-------------------------------------------\r
-\r
-    ARGS:   AH = 08h\r
-    RETS:   AX = Size of the largest free extended memory block in K-bytes\r
-            DX = Total amount of free extended memory in K-bytes\r
-    ERRS:   BL = 80h if the function is not implemented\r
-            BL = 81h if a VDISK device is detected\r
-            BL = A0h if all extended memory is allocated\r
-\r
-    This function returns the size of the largest available extended memory\r
-block in the system.\r
-\r
-    NOTE: The 64K HMA is not included in the returned value even if it is\r
-          not in use.\r
-\r
-\r
-Allocate Extended Memory Block (Function 09h):\r
-----------------------------------------------\r
-\r
-    ARGS:   AH = 09h\r
-            DX = Amount of extended memory being requested in K-bytes\r
-    RETS:   AX = 0001h if the block is allocated, 0000h otherwise\r
-            DX = 16-bit handle to the allocated block\r
-    ERRS:   BL = 80h if the function is not implemented\r
-            BL = 81h if a VDISK device is detected\r
-            BL = A0h if all available extended memory is allocated\r
-            BL = A1h if all available extended memory handles are in use\r
-            \r
-    This function attempts to allocate a block of the given size out of the\r
-pool of free extended memory.  If a block is available, it is reserved\r
-for the caller and a 16-bit handle to that block is returned.  The handle\r
-should be used in all subsequent extended memory calls.  If no memory was\r
-allocated, the returned handle is null.\r
-\r
-    NOTE: Extended memory handles are scarce resources.  Programs should\r
-          try to allocate as few as possible at any one time.  When all\r
-          of a driver's handles are in use, any free extended memory is\r
-          unavailable.\r
-\r
-\r
-\r
-Free Extended Memory Block (Function 0Ah):\r
-------------------------------------------\r
-\r
-    ARGS:   AH = 0Ah\r
-            DX = Handle to the allocated block which should be freed\r
-    RETS:   AX = 0001h if the block is successfully freed, 0000h otherwise\r
-    ERRS:   BL = 80h if the function is not implemented\r
-            BL = 81h if a VDISK device is detected\r
-            BL = A2h if the handle is invalid\r
-            BL = ABh if the handle is locked\r
-\r
-    This function frees a block of extended memory which was previously\r
-allocated using Function 09h (Allocate Extended Memory Block).  Programs\r
-which allocate extended memory should free their memory blocks before\r
-exiting.  When an extended memory buffer is freed, its handle and all data\r
-stored in it become invalid and should not be accessed.\r
-\r
-\r
-Move Extended Memory Block (Function 0Bh):\r
-------------------------------------------\r
-\r
-    ARGS:   AH = 0Bh\r
-            DS:SI = Pointer to an Extended Memory Move Structure (see below)\r
-    RETS:   AX = 0001h if the move is successful, 0000h otherwise\r
-    ERRS:   BL = 80h if the function is not implemented\r
-            BL = 81h if a VDISK device is detected\r
-            BL = 82h if an A20 error occurs\r
-            BL = A3h if the SourceHandle is invalid\r
-            BL = A4h if the SourceOffset is invalid\r
-            BL = A5h if the DestHandle is invalid\r
-            BL = A6h if the DestOffset is invalid\r
-            BL = A7h if the Length is invalid\r
-            BL = A8h if the move has an invalid overlap\r
-            BL = A9h if a parity error occurs\r
-\r
-    Extended Memory Move Structure Definition:\r
-\r
-        ExtMemMoveStruct    struc\r
-            Length              dd  ?   ; 32-bit number of bytes to transfer\r
-            SourceHandle        dw  ?   ; Handle of source block\r
-            SourceOffset        dd  ?   ; 32-bit offset into source \r
-            DestHandle          dw  ?   ; Handle of destination block\r
-            DestOffset          dd  ?   ; 32-bit offset into destination block\r
-        ExtMemMoveStruct    ends\r
-            \r
-    This function attempts to transfer a block of data from one location to\r
-another.  It is primarily intended for moving blocks of data between\r
-conventional memory and extended memory, however it can be used for moving\r
-blocks within conventional memory and within extended memory.\r
-\r
-    NOTE: If SourceHandle is set to 0000h, the SourceOffset is interpreted\r
-          as a standard segment:offset pair which refers to memory that is\r
-          directly accessible by the processor.  The segment:offset pair\r
-          is stored in Intel DWORD notation.  The same is true for DestHandle\r
-          and DestOffset.\r
-          \r
-          SourceHandle and DestHandle do not have to refer to locked memory\r
-          blocks.\r
-          \r
-          Length must be even.  Although not required, WORD-aligned moves\r
-          can be significantly faster on most machines.  DWORD aligned move\r
-          can be even faster on 80386 machines.\r
-          \r
-          If the source and destination blocks overlap, only forward moves\r
-          (i.e. where the source base is less than the destination base) are\r
-          guaranteed to work properly.\r
-          \r
-          Programs should not enable the A20 line before calling this\r
-          function.  The state of the A20 line is preserved.\r
-\r
-          This function is guaranteed to provide a reasonable number of\r
-          interrupt windows during long transfers.\r
-          \r
-          \r
-Lock Extended Memory Block (Function 0Ch):\r
-------------------------------------------\r
-\r
-    ARGS:   AH = 0Ch\r
-            DX = Extended memory block handle to lock\r
-    RETS:   AX = 0001h if the block is locked, 0000h otherwise\r
-            DX:BX = 32-bit physical address of the locked block\r
-    ERRS:   BL = 80h if the function is not implemented\r
-            BL = 81h if a VDISK device is detected\r
-            BL = A2h if the handle is invalid\r
-            BL = ACh if the block's lock count overflows\r
-            BL = ADh if the lock fails\r
-            \r
-    This function locks an extended memory block and returns its base \r
-address as a 32-bit physical address.  Locked memory blocks are guaranteed not\r
-to move.  The 32-bit pointer is only valid while the block is locked.\r
-Locked blocks should be unlocked as soon as possible.\r
-\r
-    NOTE: A block does not have to be locked before using Function 0Bh (Move\r
-          Extended Memory Block).\r
-          \r
-          "Lock counts" are maintained for EMBs.\r
-\r
-\r
-\r
-Unlock Extended Memory Block (Function 0Dh):\r
---------------------------------------------\r
-\r
-    ARGS:   AH = 0Dh\r
-            DX = Extended memory block handle to unlock\r
-    RETS:   AX = 0001h if the block is unlocked, 0000h otherwise\r
-    ERRS:   BL = 80h if the function is not implemented\r
-            BL = 81h if a VDISK device is detected\r
-            BL = A2h if the handle is invalid\r
-            BL = AAh if the block is not locked\r
-    \r
-    This function unlocks a locked extended memory block.  Any 32-bit\r
-pointers into the block become invalid and should no longer be used.\r
-\r
-\r
-Get EMB Handle Information (Function 0Eh):\r
-------------------------------------------\r
-\r
-    ARGS:   AH = 0Eh\r
-            DX = Extended memory block handle\r
-    RETS:   AX = 0001h if the block's information is found, 0000h otherwise\r
-            BH = The block's lock count\r
-            BL = Number of free EMB handles in the system\r
-            DX = The block's length in K-bytes\r
-    ERRS:   BL = 80h if the function is not implemented\r
-            BL = 81h if a VDISK device is detected\r
-            BL = A2h if the handle is invalid\r
-\r
-    This function returns additional information about an extended memory\r
-block to the caller.\r
-\r
-    NOTE: To get the block's base address, use Function 0Ch (Lock Extended\r
-          Memory Block).\r
-          \r
-          \r
-Reallocate Extended Memory Block (Function 0Fh):\r
-------------------------------------------------\r
-\r
-    ARGS:   AH = 0Fh\r
-            BX = New size for the extended memory block in K-bytes\r
-            DX = Unlocked extended memory block handle to reallocate\r
-    RETS:   AX = 0001h if the block is reallocated, 0000h otherwise\r
-    ERRS:   BL = 80h if the function is not implemented\r
-            BL = 81h if a VDISK device is detected\r
-            BL = A0h if all available extended memory is allocated\r
-            BL = A1h if all available extended memory handles are in use\r
-            BL = A2h if the handle is invalid\r
-            BL = ABh if the block is locked\r
-\r
-    This function attempts to reallocate an unlocked extended memory block\r
-so that it becomes the newly specified size.  If the new size is smaller\r
-than the old block's size, all data at the upper end of the old block is\r
-lost.\r
-\r
-\r
-Request Upper Memory Block (Function 10h):\r
-------------------------------------------\r
-\r
-    ARGS:   AH = 10h\r
-            DX = Size of requested memory block in paragraphs\r
-    RETS:   AX = 0001h if the request is granted, 0000h otherwise\r
-            BX = Segment number of the upper memory block\r
-            If the request is granted,\r
-                DX = Actual size of the allocated block in paragraphs\r
-            otherwise,\r
-                DX = Size of the largest available UMB in paragraphs\r
-    ERRS:   BL = 80h if the function is not implemented\r
-            BL = B0h if a smaller UMB is available\r
-            BL = B1h if no UMBs are available\r
-\r
-    This function attempts to allocate an upper memory block to the caller.\r
-If the function fails, the size of the largest free UMB is returned in DX.\r
-\r
-    NOTE: By definition UMBs are located below the 1MB address boundary.\r
-          The A20 Line does not need to be enabled before accessing an\r
-          allocated UMB.\r
-\r
-          UMBs are paragraph aligned.\r
-\r
-          To determine the size of the largest available UMB, attempt to\r
-          allocate one with a size of FFFFh.\r
-\r
-          UMBs are unaffected by EMS calls.\r
-\r
-\r
-Release Upper Memory Block (Function 11h):\r
-------------------------------------------\r
-\r
-    ARGS:   AH = 11h\r
-            DX = Segment number of the upper memory block\r
-    RETS:   AX = 0001h if the block was released, 0000h otherwise\r
-    ERRS:   BL = 80h if the function is not implemented\r
-            BL = B2h if the UMB segment number is invalid\r
-\r
-    This function frees a previously allocated upper memory block.  When an\r
-UMB has been released, any code or data stored in it becomes invalid and\r
-should not be accessed.\r
-\r
-\r
-\r
-\r
-Reallocate Upper Memory Block (Function 12h)\r
-\r
-        ARGS:\r
-                AH = 12h\r
-                BX = New size for UMB in paragraphs\r
-                DX = Segment number of the UMB to reallocate\r
-        RETS:\r
-                AX = 1 if the block was reallocated, 0 otherwise\r
-        ERRS:\r
-                BL = 80h if the function is not implemented\r
-                BL = B0h if no UMB large enough to satisfy the request is available.\r
-                        In this event, DX is returned with the size of the largest UMB that is                  available.\r
-                BL = B2h if the UMB segment number is invalid\r
-\r
-This function attempts to reallocate an Upper Memory Block to a newly specified size.  If the new size is smaller than the old block's size, all data at the upper end of the block is lost.\r
-\r
-\r
-\r
-Super Extended Memory Support\r
-\r
-These changes are intended to provide support for extended memory pools up to 4 Gb in size.  The current XMS API, since it uses 16-bit values to specify block sizes in Kb, is limited to 64 Mb maximum block size.  Future machines are expected to support memory above 64 MB.\r
-\r
-This support is implemented in the form of extensions to existing functions, rather than entirely new entry points, to allow for more efficient implementations.\r
-\r
-Programs should generally use the existing functions, instead of these extended ones, unless they have an explicit need to deal with memory above 64 Mb.  \r
-\r
-\r
-Query Any Free Extended Memory (Function 88h)\r
-\r
-        Entry:\r
-                AH = 88h                        \r
-        Exit:\r
-                EAX = Size of largest free extended memory block in Kb.\r
-                BL = 0 if no error occurs, otherwise it takes an error code.\r
-                ECX = Highest ending address of any memory block.\r
-                EDX = Total amount of free memory in Kb.\r
-        Errors:\r
-                BL = 80h if the function is not implemented.\r
-                BL = 81h if a VDISK device is detected.\r
-                BL = A0h if all extended memory is allocated.\r
-\r
-This function uses 32-bit values to return the size of available memory, thus allowing returns up to 4GByte.  Additionally, it returns the highest known physical memory address, that is, the physical address of the last byte of memory.  There may be discontinuities in the memory map below this address.\r
-\r
-The memory pool reported on is the same as that reported on by the existing Query Free Extended Memory function.  If the highest memory address is not more than 64 Mb, then these two functions will return the same results.\r
-\r
-Because of its reliance on 32-bit registers, this function is only available on 80386 and higher processors.  XMS drivers on 80286 machines should return error code 80h if this function is called.\r
-\r
-If error code 81h is returned, the value in ECX will still be valid.  If error code A0h is returned, EAX and EDX will be 0, and ECX will still be valid.\r
-\r
-\r
-Allocate Any Extended Memory (Function 89h)\r
-\r
-        Entry:\r
-                AH = 89h\r
-                EDX = Amount of extended memory requested, in Kb.\r
-        Exit:\r
-                AX = 1 if the block is allocated, 0 if not\r
-                DX = Handle to allocated block.\r
-        Errors:\r
-                BL = 80h if the function is not implemented.\r
-                BL = 81h if a VDISK device is detected.\r
-                BL = A0h if all available extended memory is allocated.\r
-                BL = A1h if all available extended memory handles are in use.\r
-\r
-This function is similar to the existing Allocate Extended Memory, except that it uses a 32-bit instead of a 16-bit value to specify the amount of memory requested.  It allocates from the same memory and handle pool as the current function.  Since it requires a 32-bit register, this function can be supported only on 80386 and higher processors, and XMS drivers on 80286 machines should return error code 80h.\r
-\r
-\r
-Get Extended EMB Handle Information (Function 8Eh)\r
-\r
-        Entry:\r
-                AH = 8Eh\r
-                DX = Extended memory block handle.\r
-        Exit:\r
-                AX = 1 if the block's information is found, 0 if not\r
-                BH = Block lock count\r
-                CX = Number of free EMB handles in the system\r
-                EDX = Block's length in Kb.\r
-        Errors:\r
-                BL = 80h if the function is not implemented.\r
-                BL = 81h if a VDISK device is detected.\r
-                BL = A2h if the handle is invalid.\r
-\r
-This function is similar to the Get EMB Handle Information function.  Since it uses a 32-bit register to report the block size, it can be used to get information on blocks larger than 64 Mb.  It also uses a 16-bit instead of 8-bit register to report the number of free handles, allowing the handle pool to be extended beyond 256 entries.\r
-\r
-Because of its reliance on a 32-bit register, this function is available on 80386 and higher processors.  XMS drivers on 80286 machines should return error code 80h if this function is called.\r
-\r
-\r
-Reallocate Any Extended Memory (Function 8Fh)\r
-\r
-        Entry:\r
-                AH = 8Fh\r
-                EBX = New size for extended memory block, in Kb.\r
-                DX = Unlocked handle for memory block to be resized.\r
-        Exit:\r
-                AX = 1 if the block is reallocated, 0 if not\r
-        Errors:\r
-                BL = 80h if the function is not implemented.\r
-                BL = 81h if a VDISK device is detected.\r
-                BL = A0h if all available extended memory is allocated.\r
-                BL = A1h if all available extended memory handles are in use.\r
-                BL = A2h if the handle is invalid.\r
-                BL = ABh if the block is locked.\r
-\r
-This function is similar to the existing Reallocate Extended Memory, except that it uses a 32-bit instead of a 16-bit value to specify the amount of memory requested.  It allocates from the same memory and handle pool as the current function.  Since it requires a 32-bit register, this function can be supported only on 80386 and higher processors, and XMS drivers on 80286 machines should return error code 80h.\r
-\r
-\r
-\r
-\r
-PRIORITIZING HMA USAGE:\r
------------------------\r
-\r
-    For DOS users to receive the maximum benefit from the High Memory Area,\r
-programs which use the HMA must store as much of their resident code in it as\r
-is possible.  It is very important that developers realize that the HMA is\r
-allocated as a single unit. \r
-\r
-    For example, a TSR program which grabs the HMA and puts 10K of code into\r
-it may prevent a later TSR from putting 62K into the HMA.  Obviously, regular\r
-DOS programs would have more memory available to them below the 640K line if\r
-the 62K TSR was moved into the HMA instead of the 10K one.\r
-\r
-    The first method for dealing with conflicts such as this is to require \r
-programs which use the HMA to provide a command line option for disabling\r
-this feature.  It is crucial that TSRs which do not make full use of the HMA\r
-provide such a switch on their own command line (suggested name "/NOHMA").\r
-\r
-    The second method for optimizing HMA usage is through the /HMAMIN=\r
-parameter on the XMS device driver line.  The number after the parameter\r
-is defined to be the minimum amount of HMA space (in K-bytes) used by any\r
-driver or TSR.  For example, if "DEVICE=HIMEM.SYS /HMAMIN=48" is in a\r
-user's CONFIG.SYS file, only programs which request at least 48K would be\r
-allowed to allocate the HMA.  This number can be adjusted either by\r
-installation programs or by the user himself.  If this parameter is not\r
-specified, the default value of 0 is used causing the HMA to be allocated\r
-on a first come, first served basis.\r
-\r
-    Note that this problem does not impact application programs.  If the HMA\r
-is available when an application program starts, the application is free to\r
-use as much or as little of the HMA as it wants.  For this reason,\r
-applications should pass FFFFh in DX when calling Function 01h.\r
-\r
-\r
-\r
-HIGH MEMORY AREA RESTRICTIONS:\r
-------------------------------\r
-\r
--   Far pointers to data located in the HMA cannot be passed to DOS.  DOS\r
-    normalizes any pointer which is passed into it.  This will cause data\r
-    addresses in the HMA to be invalidated.\r
-\r
--   Disk I/O directly into the HMA (via DOS, INT 13h, or otherwise) is not\r
-    recommended.\r
-       \r
--   Programs, especially drivers and TSRs, which use the HMA *MUST* use\r
-    as much of it as possible.  If a driver or TSR is unable to use at\r
-    least 90% of the available HMA (typically ~58K), they must provide\r
-    a command line switch for overriding HMA usage.  This will allow\r
-    the user to configure his machine for optimum use of the HMA.\r
-       \r
--   Device drivers and TSRs cannot leave the A20 line permanently turned\r
-    on.  Several applications rely on 1MB memory wrap and will overwrite the\r
-    HMA if the A20 line is left enabled potentially causing a system crash.\r
-        \r
--   Interrupt vectors must not point into the HMA.  This is a result of\r
-    the previous restriction.  Note that interrupt vectors can point into\r
-    any allocated upper memory blocks however.\r
-\r
-ERROR CODE INDEX:\r
------------------\r
-\r
-If AX=0000h when a function returns and the high bit of BL is set,\r
-\r
-    BL=80h if the function is not implemented\r
-       81h if a VDISK device is detected\r
-       82h if an A20 error occurs\r
-       8Eh if a general driver error occurs\r
-       8Fh if an unrecoverable driver error occurs\r
-       90h if the HMA does not exist\r
-       91h if the HMA is already in use\r
-       92h if DX is less than the /HMAMIN= parameter\r
-       93h if the HMA is not allocated\r
-       94h if the A20 line is still enabled\r
-       A0h if all extended memory is allocated\r
-       A1h if all available extended memory handles are in use\r
-       A2h if the handle is invalid\r
-       A3h if the SourceHandle is invalid\r
-       A4h if the SourceOffset is invalid\r
-       A5h if the DestHandle is invalid\r
-       A6h if the DestOffset is invalid\r
-       A7h if the Length is invalid\r
-       A8h if the move has an invalid overlap\r
-       A9h if a parity error occurs\r
-       AAh if the block is not locked\r
-       ABh if the block is locked\r
-       ACh if the block's lock count overflows\r
-       ADh if the lock fails\r
-       B0h if a smaller UMB is available\r
-       B1h if no UMBs are available\r
-       B2h if the UMB segment number is invalid\r
-\r
-\r
-IMPLEMENTATION NOTES FOR DOS XMS DRIVERS:\r
------------------------------------------\r
-\r
--   A DOS XMS driver's control function must begin with code similar to the\r
-    following:\r
-\r
-XMMControl  proc    far\r
-\r
-            jmp     short XCControlEntry    ; For "hookability"\r
-            nop                     ; NOTE: The jump must be a short\r
-            nop                     ;  jump to indicate the end of\r
-            nop                     ;  any hook chainThe nop's\r
-                                            ;  allow a far jump to be\r
-                                            ;  patched in.\r
-XCControlEntry:\r
-\r
-\r
--   XMS drivers must preserve all registers except those containing\r
-    returned values across any function call.\r
-\r
--   XMS drivers are required to hook INT 15h and watch for calls to\r
-    functions 87h (Block Move) and 88h (Extended Memory Available).  The\r
-    INT 15h Block Move function must be hooked so that the state of the A20\r
-    line is preserved across the call.  The INT 15h Extended Memory\r
-    Available function must be hooked to return 0h to protect the HMA.\r
-\r
--   In order to maintain compatibility with existing device drivers, DOS XMS\r
-    drivers must not hook INT 15h until the first non-Version Number call\r
-    to the control function is made.\r
-\r
--   XMS drivers are required to check for the presence of drivers which\r
-    use the IBM VDISK allocation scheme.  Note that it is not sufficient to\r
-    check for VDISK users at installation time but at the time when the HMA\r
-    is first allocated.  If a VDISK user is detected, the HMA must not be\r
-    allocated.  Microsoft will publish a standard method for detecting\r
-    drivers which use the VDISK allocation scheme.\r
-\r
--   XMS drivers which have a fixed number of extended memory handles (most\r
-    do) should implement a command line parameter for adjusting that number\r
-    (suggested name "/NUMHANDLES=")\r
-\r
--   XMS drivers should make sure that the major DOS version number is\r
-    greater than or equal to 3 before installing themselves.\r
-\r
--   UMBs cannot occupy memory addresses that can be banked by EMS 4.0.\r
-    EMS 4.0 takes precedence over UMBs for physically addressable memory.\r
-\r
--   All driver functions must be re-entrant.  Care should be taken to not\r
-    leave interrupts disabled for long periods of time.\r
-\r
--   Allocation of a zero length extended memory buffer is allowed.  Programs\r
-    which hook XMS drivers may need to reserve a handle for private use via\r
-    this method.  Programs which hook an XMS driver should pass all requests\r
-    for zero length EMBs to the next driver in the chain.\r
-\r
--   Drivers should control the A20 line via an "enable count."  Local En-\r
-    able only enables the A20 line if the count is zero.  It then increments\r
-    the count.  Local Disable only disables A20 if the count is one.  It\r
-    then decrements the count.  Global Enable/Disable keeps a flag which\r
-    indicates the state of A20.  They use Local Enable/Disable to actually\r
-    change the state.\r
-\r
--  Drivers should always check the physical A20 state in the local Enable-Disable calls, to see\r
-    that the physical state matches the internal count.  If the physical state does not match, it should\r
-    be modified so that it matches the internal count.  This avoids problems with applications that \r
-    modify A20 directly.\r
-\r
-\r
-IMPLEMENTATION OF CODE FOR HOOKING THE XMS DRIVER:\r
-\r
-  In order to support the hooking of the XMS driver by multiple\r
-  pieces of code, the following code sample should be followed.\r
-  Use of other methods for hooking the XMS driver will not work\r
-  in many cases. This method is the official supported one.\r
-\r
-  The basic strategy is:\r
-\r
-    Find the XMS driver header which has the "near jump" dispatch.\r
-\r
-    Patch the near jump to a FAR jump which jumps to my HOOK XMS\r
-        driver header.\r
-\r
-  NOTES:\r
-\r
-    o This architecture allows the most recent HOOKer to undo his\r
-        XMS driver hook at any time without having to worry about\r
-        damaging a "hook chain".\r
-\r
-    o This architecture allows the complete XMS hook chain to be\r
-        enumerated at any time. There are no "hidden hooks".\r
-\r
-    o This architecture allows the HOOKer to not have to worry\r
-        about installing an "INT 2F hook" to hook the AH=43h\r
-        INT 2Fs handled by the XMS driver. The base XMS driver\r
-        continues to be the only one installed on INT 2Fh AH=43h.\r
-\r
-        This avoids all of the problems of undoing a software\r
-        interrupt hook.\r
-\r
-  ;\r
-  ; When I wish to CHAIN to the previous XMS driver, I execute a FAR JMP\r
-  ;     to the address stored in this DWORD.\r
-  ;\r
-  PrevXMSControlAddr    dd      ?\r
-\r
-  ;\r
-  ; The next two data items are needed ONLY if I desire to be able to undo\r
-  ;     my XMS hook.\r
-  ; PrevXMSControlJmpVal stores the previos XMS dispatch near jump offset\r
-  ;     value that is used to unhook my XMS hook\r
-  ; PrevXMSControlBase stores the address of the XMS header that I hooked\r
-  ;\r
-  PrevXMSControlBase    dd      ?\r
-  PrevXMSControlJmpVal  db      ?\r
-\r
-  ;\r
-  ; This is MY XMS control header.\r
-  ;\r
-  MyXMSControlFunc proc FAR\r
-        jmp     short XMSControlEntry\r
-        nop\r
-        nop\r
-        nop\r
-  XMSControlEntry:\r
-\r
-  ......\r
-\r
-  Chain:\r
-        jmp     cs:[PrevXMSControlAddr]\r
-\r
-  MyXMSControlFunc endp\r
-\r
-\r
-  .......\r
-  ;\r
-  ; This is the code which installs my hook into the XMS driver.\r
-  ;\r
-    ;\r
-    ; See if there is an XMS driver to hook\r
-    ;\r
-        mov     ax,4300h\r
-        int     2Fh\r
-        cmp     al,80h\r
-        jne     NoXMSDrvrToHookError\r
-    ;\r
-    ; Get the current XMS driver Control address\r
-    ;\r
-        mov     ax,4310h\r
-        int     2Fh\r
-  NextXMSHeader:\r
-        mov     word ptr [PrevXMSControlAddr+2],es\r
-        mov     word ptr [PrevXMSControlBase+2],es\r
-        mov     word ptr [PrevXMSControlBase],bx\r
-        mov     cx,word ptr es:[bx]\r
-        cmp     cl,0EBh                         ; Near JUMP\r
-        je      ComputeNearJmp\r
-        cmp     cl,0EAh                         ; Far JUMP\r
-        jne     XMSDrvrChainMessedUpError\r
-  ComputeFarJmp:\r
-        mov     si,word ptr es:[bx+1]           ; Offset of jump\r
-        mov     es,word ptr es:[bx+1+2]         ; Seg of jump\r
-        mov     bx,si\r
-        jmp     short NextXMSHeader\r
-\r
-  ComputeNearJmp:\r
-        cmp     word ptr es:[bx+2],9090h        ; Two NOPs?\r
-        jne     XMSDrvrChainMessedUpError       ; No\r
-        cmp     byte ptr es:[bx+4],90h          ; Total of 3 NOPs?\r
-        jne     XMSDrvrChainMessedUpError       ; No\r
-        mov     di,bx                           ; Save pointer to header\r
-        xor     ax,ax\r
-        mov     al,ch                           ; jmp addr of near jump\r
-        mov     [PrevXMSControlJmpVal],al\r
-        add     ax,2                            ; NEAR JMP is 2 byte instruction\r
-        add     bx,ax                           ; Target of jump\r
-        mov     word ptr [PrevXMSControlAddr],bx\r
-    ;\r
-    ; Now INSTALL my XMS HOOK\r
-    ;\r
-        cli                             ; Disable INTs in case someone calls\r
-                                        ;       XMS at interrupt time\r
-        mov     byte ptr es:[di],0EAh   ; Far Immed. JUMP instruction\r
-        mov     word ptr es:[di+1],offset MyXMSControlFunc\r
-        mov     word ptr es:[di+3],cs\r
-        sti\r
-    .....\r
-\r
-    ;\r
-    ; Deinstall my XMS hook. This can be done IF AND ONLY IF my XMS header\r
-    ;   still contains the near jump dispatch\r
-    ;\r
-        cmp     byte ptr [MyXMSControlFunc],0EBh\r
-        jne     CantDeinstallError\r
-        mov     al,0EBh\r
-        mov     ah,[PrevXMSControlJmpVal]\r
-        les     bx,[PrevXMSControlBase]\r
-        cli                             ; Disable INTs in case someone calls\r
-                                        ;       XMS at interrupt time\r
-        mov     word ptr es:[bx],ax\r
-        mov     word ptr es:[bx+2],9090h\r
-        mov     byte ptr es:[bx+4],90h\r
-        sti\r
-    ....\r
-\r
-IMPLEMENTATION NOTES FOR HIMEM.SYS:\r
------------------------------------\r
-\r
--   HIMEM.SYS currently supports true AT-compatibles, 386 AT machines, IBM\r
-    PS/2s, AT&T 6300 Plus systems and Hewlett Packard Vectras.\r
-\r
--   If HIMEM finds that it cannot properly control the A20 line or if there\r
-    is no extended memory available when HIMEM.SYS is invoked, the driver\r
-    does not install itself.  HIMEM.SYS displays the message "High Memory\r
-    Area Unavailable" when this situation occurs.\r
-\r
--   If HIMEM finds that the A20 line is already enabled when it is invoked,\r
-    it will NOT change the A20 line's state.  The assumption is that whoever\r
-    enabled it knew what they were doing.  HIMEM.SYS displays the message "A20\r
-    Line Permanently Enabled" when this situation occurs.\r
-\r
--   HIMEM.SYS is incompatible with IBM's VDISK.SYS driver and other drivers\r
-    which use the VDISK scheme for allocating extended memory.  However, \r
-    HIMEM does attempt to detect these drivers and will not allocate the\r
-    HMA if one is found.\r
-\r
--   HIMEM.SYS supports the optional "/HMAMIN=" parameter.  The valid values\r
-    are decimal numbers between 0 and 63.\r
-\r
--   By default, HIMEM.SYS has 32 extended memory handles available for use.\r
-    This number may be adjusted with the "/NUMHANDLES=" parameter.  The\r
-    maximum value for this parameter is 128 and the minimum is 0.  Each\r
-    handle currently requires 6 bytes of resident space.\r
-\r
-\r
-Copyright (c) 1988, Microsoft Corporation\r
-\r
diff --git a/16/PCGPE10/XTENDED.TXT b/16/PCGPE10/XTENDED.TXT
deleted file mode 100644 (file)
index c02ecc0..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-\r
-                 ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-                 ³ Xtended Mode - Unchained 640x400x256 ³\r
-                 ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-                 Written for the PC-GPE by Mark Feldman\r
-            e-mail address : u914097@student.canberra.edu.au\r
-                             myndale@cairo.anu.edu.au\r
-\r
-                    Please read the file SVGINTRO.TXT\r
-                (Graphics/SVGA/Intro PC-GPE menu option)\r
-\r
-               ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-               ³      THIS FILE MAY NOT BE DISTRIBUTED     ³\r
-               ³ SEPARATE TO THE ENTIRE PC-GPE COLLECTION. ³\r
-               ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Disclaimer ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-I assume no responsibility whatsoever for any effect that this file, the\r
-information contained therein or the use thereof has on you, your sanity,\r
-computer, spouse, children, pets or anything else related to you or your\r
-existance. No warranty is provided nor implied with this information.\r
-\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Introduction ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-I am calling this mode Xtended mode simply because I don't know if it \r
-already has a name. It is a variation of mode x and it has worked on every \r
-SVGA I have tried it on. It seems very very unlikely that I was the first \r
-person to try this, so if this mode has already been documented elsewhere I \r
-would very much like to hear about it.\r
-\r
-Xtended mode is 640x400x256 and will only work on SVGA's supporting the\r
-"regular" 640x400x256 mode. It's advantage is that it requires no\r
-bank switching to access the entire display memory and, like mode x, polygon\r
-fill graphics can be up to 4 times faster.\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Setting Xtended Mode ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-Xtended mode is set similar to the way unchained mode 13h is set, the only\r
-difference is that you you call BIOS to set the 640x400x256 graphics mode\r
-instead of mode 13h. The 640x400x256 mode number varies from card to card.\r
-The following table lists the mode number for each of the 7 "standard"\r
-SVGAs:\r
-\r
-           640x400x256 mode numbers for various SVGA cards\r
-               ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
-               ³      SVGA Chip          Mode Number ³\r
-               ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´\r
-               ³ ATI                        61h      ³\r
-               ³ Chips & Technologies       78h      ³\r
-               ³ Genoa                      7Eh      ³\r
-               ³ Paradise                   5Eh      ³\r
-               ³ Trident                    5Ch      ³\r
-               ³ Tseng                      2Fh      ³\r
-               ³ Video 7                    66h      ³\r
-               ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-Alternatively the mode can be set with the VESA Set Super VGA Mode BIOS\r
-call, the VESA SVGA mode number is 100h. Refer to the file "VESASP12.TXT"\r
-for more information on VESA BIOS calls.\r
-\r
-The following Pascal procedure will set Xtended mode for a card with a VESA\r
-driver:\r
-\r
-const VIDEO     = $10;  { Video interrupt number                    }\r
-      CRTC_ADDR        = $3d4; { Base port of the CRT Controller (color)   }\r
-      SEQU_ADDR        = $3c4; { Base port of the Sequencer                }\r
-\r
-procedure InitXtended;\r
-begin\r
-\r
-  { Set VESA 640x400x256 mode }\r
-  asm\r
-    mov ax, $4F02\r
-    mov bx, $100\r
-    int VIDEO\r
-  end;\r
-\r
-  { Turn the VGA screen off }\r
-  Port[SEQU_ADDR] := 1;\r
-  Port[SEQU_ADDR + 1] := Port[SEQU_ADDR + 1] or $20;\r
-\r
-  { Turn off the Chain-4 bit (bit 3 at index 4, port 0x3c4) }\r
-  PortW[SEQU_ADDR] := $0604;\r
-\r
-  { Turn off word mode, by setting the Mode Control register\r
-    of the CRT Controller (index 0x17, port 0x3d4) }\r
-  PortW[CRTC_ADDR] := $E317;\r
-\r
-  { Turn off doubleword mode, by setting the Underline Location\r
-    register (index 0x14, port 0x3d4) }\r
-  PortW[CRTC_ADDR] := $0014;\r
-\r
-  { Clear entire video memory, by selecting all four planes, then writing\r
-  color 0 to the entire segment. Stoopid FillChar fills 1 byte too short! }\r
-  PortW[SEQU_ADDR] := $0F02;\r
-  FillChar(Mem[$A000 : 0], $8000, 0);\r
-  FillChar(Mem[$A000 : $8000], $8000, 0);\r
-\r
-  { Give a small delay to let the screen sort itself out }\r
-  Delay(100);\r
-\r
-  { Turn the screen back on }\r
-  Port[SEQU_ADDR] := 1;\r
-  Port[SEQU_ADDR + 1] := Port[SEQU_ADDR + 1] and $DF;\r
-end;\r
-\r
-ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
-³ Drawing a Pixel ³\r
-ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
-\r
-Drawing a pixel in Xtended mode is similar to drawing one in unchained mode\r
-13h or mode x, we just have to keep in mind that the display is now twice\r
-as wide. Also keep in mind that 640x400 has 4 times as many pixels as\r
-320x200, so there is only one page in Xtended mode.\r
-\r
-This example Pascal routine will draw a pixel at any screen position. I'll\r
-let you do the job of converting it to assembly:\r
-\r
-procedure XtendedPutPixel(x, y : word; color : byte);\r
-begin\r
-  { Set map mask to select proper plane }\r
-  PortW[SEQU_ADDR] := $100 shl (x and 3) + 2;\r
-\r
-  { Calculate address (y * 160 + x div 4) and write pixel }\r
-  Mem[$A000 : y shl 7 + y shl 5 + x shr 2] := color;\r
-end;\r
diff --git a/16/PCGPE10/suround.txt b/16/PCGPE10/suround.txt
deleted file mode 100644 (file)
index 7a33f97..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-\r
-Midi And 4 Channel Surround Sound\r
----------------------------------\r
-\r
-I got some email today asking how to do Dolby surround midi files. I tought\r
-it could be of interest to other people. Note: Only a ram wavetable midi\r
-device can reproduce the surround channel, with this method, but the center\r
-channel can be done on any midi playback device.\r
-\r
-If you want something that comes out from the center channel, just put the\r
-pan on the midi channel at 64. Coming from left? just put the panning to\r
-the left (under 64). Coming from right? just put the panning to the right\r
-(over 64).\r
-\r
-For elements that have to be present on both sides i'd recommend dupli\r
-cating the track and giving two opposite panning. This gives much better\r
-results than panning to center and shouldn't come out the front channel.\r
-Also, if you sampled something in stereo, then you can use the left signal\r
-to create a patch for the left track and a separate patch for the right\r
-track. This works very well.\r
-\r
-Finally, for the surround channel, it's the same as stereo snce you use\r
-two tracks. One for left, one for right. On the left you use the regular\r
-instrument, and on the right, you use the *inverted* signal (a flip around\r
-the X axis of the signal, as done by the invert function of most wave\r
-editors). When i was asked the question, i hadn't tried this, but i just\r
-did and it works. I use my own circuit to decode the surround channel (a\r
-very simple design, found on archive.epas.utoronto.ca under the filename\r
-surround.txt) and have not tried it on a real dolby surround or pro logic\r
-unit, but it should work equally well.\r
-\r
-Of course by using two voices per sounds, you use the GUS voices much more\r
-rapidly, but the sound is much better, even when it's the same signal on\r
-both channels because of the slight phasing between the left and right\r
-channels. Plus, you get much more balance control.\r
-\r
-So when you want something on the left, center or right channel, just use\r
-mono panning. For the surround channel, on top of that, just add two voices\r
-panned left and right, one playing the inverse of the other. Note, in mono,\r
-this will disapear totally...\r
-\r
-This should be very simple to understand by looking at this diagram:\r
-\r
-P=panning, V=volume\r
-                             CENTRE CHANNEL\r
-                             P=64, V=presence\r
-                              V        /|\\r
-                              variation |\r
-                                       \|/\r
- LEFT CHANNEL                                                   RIGHT CHANNEL\r
-P=1, V=presence               P variation <-->                P=127, V=presence\r
-\r
-                              Vleft=Vright /|\\r
-                              variation     |\r
-                                           \|/\r
-\r
-                            P=1,normal patch;P=127,inverted patch,\r
-                            Vleft=Vright=presence\r
-                            SURROUND CHANNEL (either 1 or two speakers,\r
-                                             this channel is mono)\r
-\r
-For stereo instead of panned mono:\r
-P=1, left signal patch;P=127, right signal patch, Vleft=left presence,\r
-Vright=right presence. So for <--> variation, you use the two volumes instead\r
-of P.\r
-\r
-Hope this helps.\r
-\r
-Ciao,\r
---\r
-Francois Dion\r
-    '  _   _   _\r
- CISM (_) (_)  _) FM       Montreal , Canada       Email: CISM@ERE.UMontreal.CA\r
-      (_)  / . _)             10000 Watts          Telephone no: (514) 343-7511\r
-_______________________________________________________________________________\r
-Audio-C-DJ-Fractals-Future-Label-Multimedia-Music-Radio-Rave-Video-VR-Volvo-...\r