home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / CLIPPER / MISC / MSMOUSE2.ZIP / UTILS.ZIP / CEFUNC.H < prev    next >
Encoding:
Text File  |  1989-02-10  |  7.2 KB  |  271 lines

  1. /*
  2.  *  cefunc.h
  3.  * 
  4.  * Module for C EGA library model independent functions
  5.  * This predeclaration file should be included in any module which uses it.
  6.  *
  7.  * Copyright (c) 1988-1989, Microsoft Corporation.  All rights reserved.
  8.  *
  9.  *  Revision History:
  10.  *    Tom Hensel    12/14/88    Wrote it
  11.  *
  12.  *  Predeclaration file for C EGA library model independent functions
  13.  *  The libraries are named cefuncx.lib, where x is:
  14.  *
  15.  *    s for small model
  16.  *    c for compact model
  17.  *    m for medium model
  18.  *    l for large model
  19.  *
  20.  *  Note:  Some file names may be too long and may cause compiler warning
  21.  *        messages.  This is a tradeoff to allow the names to
  22.  *        correspond to the mouse function descriptions in
  23.  *        the Mouse Programmer's Reference Guide.
  24.  *
  25.  * Library function definitions
  26.  *
  27.  * void ReadOneRegister(pPointerData, portNumber)
  28.  *
  29.  * Inputs:
  30.  *
  31.  * int *pPointerData;        Pointer for pointer/data chips
  32.  *                (Ignored for single registers)
  33.  *
  34.  * int portNumber;        Port number
  35.  *
  36.  *                Pointer/data chips
  37.  *
  38.  *                 0h: CRT Controller (3?4h)
  39.  *                 8h: Sequencer (3C4h)
  40.  *                10h: Graphics Controller (3CEh)
  41.  *                18h: Attribute Controller (3C0h)
  42.  *
  43.  *                Single registers
  44.  *
  45.  *                20h: Miscellaneous Output register (3C2h)
  46.  *                28h: Feature Control register (3?Ah)
  47.  *                30h: Graphics 1 Position register (3CCh)
  48.  *                38h: Graphics 2 Position register (3CAh)
  49.  *
  50.  *                ? = B for monochrome modes or D for color modes
  51.  *
  52.  * Outputs:
  53.  *
  54.  * int *pPointerData;        Data read
  55.  *
  56.  * void WriteOneRegister(pointer, data, portNumber)
  57.  *
  58.  * Inputs:
  59.  *
  60.  * int pointer;            Pointer for pointer/data chips
  61.  *                (Ignored for single registers)
  62.  *
  63.  * int data            Data to write
  64.  *
  65.  * int portNumber;        Port number
  66.  *
  67.  *                Pointer/data chips
  68.  *
  69.  *                 0h: CRT Controller (3?4h)
  70.  *                 8h: Sequencer (3C4h)
  71.  *                10h: Graphics Controller (3CEh)
  72.  *                18h: Attribute Controller (3C0h)
  73.  *
  74.  *                Single registers
  75.  *
  76.  *                20h: Miscellaneous Output register (3C2h)
  77.  *                28h: Feature Control register (3?Ah)
  78.  *                30h: Graphics 1 Position register (3CCh)
  79.  *                38h: Graphics 2 Position register (3CAh)
  80.  *
  81.  *                ? = B for monochrome modes or D for color modes
  82.  *
  83.  * void ReadRegisterRange(pTable,
  84.  *              startingPointerValue,
  85.  *              numberOfRegisters,
  86.  *              portNumber
  87.  *             )
  88.  *
  89.  * Inputs:
  90.  *
  91.  * char *pTable;        Points to table of one-byte entries (length =
  92.  *                value in CL).
  93.  *
  94.  * int startingPointerValue;    Starting pointer value
  95.  *
  96.  * int numberOfRegisters;    Number of registers (must be > 1)
  97.  *
  98.  * int portNumber;        Port number
  99.  *
  100.  *                 0h: CRT Controller (3?4h)
  101.  *                 8h: Sequencer (3C4h)
  102.  *                10h: Graphics Controller (3CEh)
  103.  *                18h: Attribute Controller (3C0h)
  104.  *
  105.  *                ? = B for monochrome modes or D for color modes
  106.  *
  107.  * Outputs:
  108.  *
  109.  * char *pTable;        Each entry is set to the contents of the
  110.  *                corresponding register.
  111.  *
  112.  * void WriteRegisterRange(pTable,
  113.  *               startingPointerValue,
  114.  *               numberOfRegisters,
  115.  *               portNumber
  116.  *              )
  117.  *
  118.  * Inputs:
  119.  *
  120.  * char *pTable;        Points to table of one-byte entries (length =
  121.  *                value in CL).  Each entry contains the value
  122.  *                to be written to the corresponding register.
  123.  *
  124.  * int startingPointerValue;    Starting pointer value
  125.  *
  126.  * int numberOfRegisters;    Number of registers (must be > 1)
  127.  *
  128.  * int portNumber;        Port number
  129.  *
  130.  *                 0h: CRT Controller (3?4h)
  131.  *                 8h: Sequencer (3C4h)
  132.  *                10h: Graphics Controller (3CEh)
  133.  *                18h: Attribute Controller (3C0h)
  134.  *
  135.  *                ? = B for monochrome modes or D for color modes
  136.  *
  137.  * void ReadRegisterSet(pTable, numberOfRegisters)
  138.  *
  139.  * Inputs:
  140.  *
  141.  * char *pTable;        Points to table of records with each entry
  142.  *                in this format:
  143.  *
  144.  *                Bytes 1-2:  Port number
  145.  *
  146.  *                Pointer/data chips
  147.  *
  148.  *                 0h: CRT Controller (3?4h)
  149.  *                 8h: Sequencer (3C4h)
  150.  *                10h: Graphics Controller (3CEh)
  151.  *                18h: Attribute Controller (3C0h)
  152.  *
  153.  *                Single registers
  154.  *
  155.  *                20h: Miscellaneous Output register (3C2h)
  156.  *                28h: Feature Control register (3?Ah)
  157.  *                30h: Graphics 1 Position register (3CCh)
  158.  *                38h: Graphics 2 Position register (3CAh)
  159.  *
  160.  *                ? = B for monochrome modes or D for color modes
  161.  *
  162.  *                Byte 3:  Pointer value (0 for single registers)
  163.  *
  164.  * int numberOfRegisters;    Number of registers (must be > 1)
  165.  *
  166.  * Outputs:
  167.  *
  168.  * char *pTable;        Byte 4:  EGA Register Interface fills in data
  169.  *                read from register specified in bytes 1-3.
  170.  *
  171.  * void WriteRegisterSet(pTable, numberOfRegisters)
  172.  *
  173.  * Inputs:
  174.  *
  175.  * char *pTable;        Points to table of records with each entry
  176.  *                in this format:
  177.  *
  178.  *                Bytes 1-2:  Port number
  179.  *
  180.  *                Pointer/data chips
  181.  *
  182.  *                 0h: CRT Controller (3?4h)
  183.  *                 8h: Sequencer (3C4h)
  184.  *                10h: Graphics Controller (3CEh)
  185.  *                18h: Attribute Controller (3C0h)
  186.  *
  187.  *                Single registers
  188.  *
  189.  *                20h: Miscellaneous Output register (3C2h)
  190.  *                28h: Feature Control register (3?Ah)
  191.  *                30h: Graphics 1 Position register (3CCh)
  192.  *                38h: Graphics 2 Position register (3CAh)
  193.  *
  194.  *                ? = B for monochrome modes or D for color modes
  195.  *
  196.  *                Byte 3:  Pointer value (0 for single registers)
  197.  *
  198.  *                Byte 4:  Data to be written to register
  199.  *                specified in bytes 1-3.
  200.  *
  201.  * int numberOfRegisters;    Number of registers (must be > 1)
  202.  *
  203.  * void RevertToDefaultRegisters()
  204.  *
  205.  * void DefineDefaultRegisterTable(pTable, VGAColorSelect, portNumber)
  206.  *
  207.  * Inputs:
  208.  *
  209.  * char *pTable;        Points to table of one-byte entries.
  210.  *                Each entry contains the default value
  211.  *                for the corresponding register.  The table
  212.  *                must contain entries for all registers.
  213.  *
  214.  * int VGAColorSelect;        This should be 'TH' (5448h) if the VGA color
  215.  *                select register is defined, otherwise
  216.  *                this value should be any value other than
  217.  *                5448h.
  218.  *
  219.  * int portNumber;        Port number
  220.  *
  221.  *                Pointer/data chips
  222.  *
  223.  *                 0h: CRT Controller (3?4h)
  224.  *                 8h: Sequencer (3C4h)
  225.  *                10h: Graphics Controller (3CEh)
  226.  *                18h: Attribute Controller (3C0h)
  227.  *
  228.  *                Single registers
  229.  *
  230.  *                20h: Miscellaneous Output register (3C2h)
  231.  *                28h: Feature Control register (3?Ah)
  232.  *                30h: Graphics 1 Position register (3CCh)
  233.  *                38h: Graphics 2 Position register (3CAh)
  234.  *
  235.  *                ? = B for monochrome modes or D for color modes
  236.  *
  237.  * void InterrogateDriver(pfDriverExist,
  238.  *              pMajorVersion,
  239.  *              pMinorVersion,
  240.  *              pVersionNumberSegment,
  241.  *              pVersionNumberOffset
  242.  *             )
  243.  *
  244.  * Outputs:
  245.  *
  246.  * int *pfDriverExist;        FALSE (0) if EGA interface loaded,
  247.  *                else TRUE (!0)
  248.  *
  249.  * int *pMajorVersion;        Major release number if EGA interface loaded
  250.  *
  251.  * int *pMinorVersion;        Minor release number (in 1/100ths) if EGA
  252.  *                interface loaded
  253.  *
  254.  * int *pVersionNumberSegment;    Segment of pointer to EGA Register Interface
  255.  *                version number
  256.  *
  257.  * int *pVersionNumberOffset;    Offset of pointer to EGA Register Interface
  258.  *                version number
  259.  *
  260.  */
  261.  
  262. void ReadOneRegister(int *, int);
  263. void WriteOneRegister(int, int, int);
  264. void ReadRegisterRange(char *, int, int, int);
  265. void WriteRegisterRange(char *, int, int, int);
  266. void ReadRegisterSet(char *, int);
  267. void WriteRegisterSet(char *, int);
  268. void RevertToDefaultRegisters(void);
  269. void DefineDefaultRegisterTable(char *, int, int);
  270. void InterrogateDriver(int *, int *, int *, int *, int *);
  271.