home *** CD-ROM | disk | FTP | other *** search
- /*
- Filename : ixe.doc
- Author : Ray E. Bornert II
- Date : 1993-MAY-06
-
- Copyright (C) 1993 HixoxiH Software. All rights reserved.
- */
-
- IXE supported video modes
-
- IXE will precompile icons for video modes where one byte of data represents
- one pixel on the screen. We call these the 256 color modes. The most common
- of these modes is 320x200. The BIOS hex number for this mode is 13h.
- Mode 13h has many derivatives. Most of these derivatives use multiple planes
- where 1 byte in A0000-AFFFF system ram (SRAM) address space touches 4 bytes
- (4 different planes) in the video ram (VRAM) address space. These are
- generally referred to as the planar modes. IXE precompiles for either flat
- non-planar modes like standard vga mode 13h or non-flat planar modes like
- modeX 320x240. IXE's can in theory be used for blitting directly to the
- video card for SVGA modes like 1024x768 as long as a (VRAM) bank boundary
- is not crossed. The IXE compiler currently makes no provision for bank
- switching or clipping of any kind. If you attempted to blit an .IXE near
- the edge of a bank boundary you would see a split image on the screen of some
- kind. You will not hurt anything, it just won't look correct.
-
- IXE provides for the generation of 8,16 or 32 (default) bit machine code.
-
- Using the IXE compiler:
-
- 1. The IXE compiler accepts as input, flat bitmap data with no header or
- trailer. For lack of a better extension we will refer to these files
- as .PAN files, meaning a panel of artwork of some kind. The data in a
- .PAN file is an ordered array of bytes. The data is ordered left to
- right top to bottom. Each byte represents one color VGA palette index
- for 256 color VGA modes where one byte equals one pixel.
- The byte values in a 4x4 icon
-
- FF 23 8B 9C
- 22 64 64 93
- 10 01 95 82
- 33 69 37 02
-
- would appear in a .PAN file in the following order:
- FF 23 8B 9C 22 64 64 93 10 01 95 82 33 69 37 02
- That is contiguous order left to right top to bottom.
-
- 2. The IXE compiler produces as output, a file with an .IXE extension meaning
- Icon Executable. An .IXE contains straight binary machine code for the
- specific blitting of the compiled icon. The palette indexes for the icon
- are combined inside the actual instructions as immediate data values.
- The resulting code is the absolute FASTEST possible way to blit that icon.
- IXE's are very fast. Performance varies depending on the data and how it
- was compiled but at the very worst they are more than TWICE as fast as the
- fastest traditional blitting routines. In very typical cases they can
- be 300%-400% faster!
-
- 3. The IXE compiler generates .IXE files with lengths that are guaranteed
- to be an even multiple of 4. The last 4 bytes of an .IXE (the trailer)
- contain 2 word values for the width and the height of the compiled icon.
- The width is first and the height is last. This trailer is useful to
- programs like IXESHOW that present IXE's on the display for viewing.
-
- 4. Once an IXE has been compiled it can be read into memory and called.
- For optimization purposes we recommend that IXE's in memory be dword
- aligned (4byte boundary). The code inside an IXE is optimized to sit
- on word boundaries and since .IXE byte lengths are even multiples of
- 4 bytes they can be nicely concatenated together and will all be
- dword aligned if the very first one is dword aligned. If the IXE's
- are dword aligned they will run slightly faster.
-
- 5. An example command line for using IXE to compile the file MY.PAN is:
-
- C:\> ixe my.pan
-
- This will produce a file called MY.IXE that can be loaded into memory
- and invoked with one of the ixeBlit routines defined in IXEBLIT.C.
-
- 6. After you compile an .IXE you can verify your result with IXESHOW.
- To verify MY.IXE using IXESHOW you would do the following:
-
- C:\> ixeshow my.ixe
-
- The IXESHOW screen will appear with your icon in the upper left of the
- display. You can then use the arrow keys to move your icon around.
- Press ESCAPE to exit. After exiting, IXESHOW will display performance
- results for the .IXE in blits per second (BPS) and pixels per second (PPS)
- If you use your own palette instead of the standard default 256 color
- VGA palette the you will want to include the name of the .PAL file on
- the IXESHOW command line as follows:
-
- C:\> ixeshow my.ixe my.pal
-
- IXESHOW will use your palette instead of the default palette and your
- icon will appear the way it is supposed to.
-
- 7. Palettes files (.PAL) are 768 bytes long and contain the 3 byte
- red,green,blue (RGB) definitions for each palette index 0-255.
- There are 256 definitions each 3 bytes long (256*3==768). The first
- 3 byes define the RGB color for palette index 0. The last 3 bytes
- define the RGB color for palette index 255. Every definition in between
- is in consecutive ascending order (e.g. 0,1,2,3,4...253,254,255). The
- 3 byte definitions are ordered RGB that is red byte first green byte
- second and blue byte last. On the VGA only the low order first 6 bits,
- bits 5-0 of each byte are used to define the corresponding intensity for
- the 3 color guns red green and blue. So the 3 byte color definitions
- should only contain values 0-63. It is okay to have values greater than
- 63 that is to say bits 7-6 turned on but bits 7-6 are ignored and are
- therefore meaningless.
-
- Instructions for calling an IXE
- Before you can call an IXE you must first setup some registers.
- If you are blitting to the video card then you must have previously set
- the correct video mode.
-
- 1. (e)bx must contain the width in pixels of the destination buffer
- If your video mode is 320x240 and you are blitting directly
- to video memory then (e)bx should be set to 320. If you are blitting
- to an offscreen buffer 256 bytes wide then (e)bx should be set to 256.
-
- 2. ds:(e)di should contain the segment:offset address of the destination
- where the ixe will be blitted to. If your video mode is 320x240 and
- you are blitting directly to the card and you want the upper left corner
- of your IXE sprite to be at y=12,x=34 then DS should contain A000h and
- (e)di should contain 0F22h (320*12+34==3874==0F22h). Remember that for
- non-planar modes you can blit to a buffer in conventional ram and then
- copy that buffer to the video card later.
-
- 3. You jump to the IXE via the CALL instruction
-
- 4. The routines in IXEBLIT.C will show you the way.
- Unless you really need to do something out of the ordinary
- they should do just fine.
-