home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-386-Vol-2of3.iso / b / bgi256-3.zip / INITDATA.INC < prev    next >
Text File  |  1992-12-27  |  6KB  |  137 lines

  1. ;INITDATA.INC - Copyright 1991,1992 Knight Software
  2. ;
  3. ; History: 
  4. ;   22 Nov 1992 - 1st Created during conversion to protected mode 
  5. ;
  6. ;----------------------------------------------------------------------
  7. ;
  8. ; Initialization Data tables for BGI driver 
  9. ;  For Version 3.00 driver, this stuff *MUST* appear first in 
  10. ;    the data segment (ie offset zero).
  11. ;  For Version 2.00 driver it can appear anyplace.
  12. ;
  13. ; NOTE: For version 3.00 driver operation -
  14. ;       The data in this file resides in the data selector
  15. ;       when operating in protected mode. The data segment is 
  16. ;       shared with the code segment in real mode.
  17. ;
  18.  
  19.  
  20. ;=====================================================================
  21. ;This table is mainly for protected mode operation in ver 3+
  22. ;however, some routines do peek at the table to determine
  23. ;if we are running in protected mode even when compiled for ver 2.
  24.  
  25. InitTable:
  26.  
  27. NRealSegs    DB 3          ;number of items in segment table
  28. RealSegOfs   DW SegTable   ;offset (in DS) to segment lookup table
  29. NIntVects    DB 1          ;number of real mode interrupt vectors
  30. IntVecOfs    DW VectTable  ;offset (in DS) to interrupt vect table
  31. NRealBlocks  DB 0          ;number of real mode block descriptors
  32. RealBlockOfs DW 0 ;BlockTable ;offset (in DS) to block table
  33. DSinRealMem  DB 1       ;* indicates where to put the data segment 
  34. RealModeDS   DW 0       ;** Actual real mode segment value of DS
  35. CurOpMode    DB 0          ;Z=real mode, NZ=protected mode
  36.  
  37. ;*  if DSinRealMem is zero, the data segment will reside in protected
  38. ;    memory someplace. If DSinRealMem is 1 (NZ), the data segment
  39. ;    will be allocated in the real mode memory area (below 1M).
  40. ;     (For my purposes, I need to have the data seg in real mem area.)
  41. ;
  42. ;** RealModeDS is patched by loader at load time this is the real mode
  43. ;    "segment" address of the DS, not the protected mode selector. 
  44.  
  45.  
  46. ;----------------------------------------------------------------------
  47. ;The segment/selector table is used to access real mode memory
  48. ;directly. In real mode, the values will be left as is. In protected
  49. ;mode, the loader will read the values in the table and convert them
  50. ;to selectors. ie SEGA000 will contain 0A000h in real mode or the
  51. ;allocated selector in protected mode.
  52.  
  53. SegTable:
  54. SEG0040         DW 00040h       ;segment/selector for seg 40    (bios)
  55. SEGA000      DW 0A000h       ;segment/selector for seg A000  (video)
  56. SEGF000      DW 0F000h     ;segment/selector for seg F000  (rom)
  57.  
  58. ;----------------------------------------------------------------------
  59. ;the indicated interrupt vector in this table is read from real memory
  60. ;and either stuffed in the indicate pointer in real mode, or the segment
  61. ;part is converted to a selector in protected mode. With the selector
  62. ;being given a size of 64K. The offset remains the real mode offset value.
  63.  
  64. VectTable:
  65. ChrGen:      DD 0000001Fh  ;this gets replaced with the sel:ofs
  66.                ;in protected mode, or seg:ofs in real mode
  67.                ;as obtained from int vect 1Fh
  68.  
  69. ;----------------------------------------------------------------------
  70. ;The loader allocates the memory block at load time and inits 
  71. ;RBlockSeg and RBlockSel to appropriate values. In real mode, RBlockSeg
  72. ;will point to the real segment of the allocated memory. In protected 
  73. ;mode RBlockSeg and RBlockSel will point to the real mode segment and 
  74. ;protected mode selector of the allocated memory. The memory block 
  75. ;will always be located in real mode memory (under 1M).
  76. ;Note in this case I am creating my own real mode memory block
  77. ;to maintain reverse compatiblity to the V2.0 drivers.
  78.  
  79. ;BlockTable:
  80. ;RBlockMode   DW 32       ;how much real mem to grab (512 bytes)
  81. ;RBlockSeg    DW 0FFFFh     ;segment of temp work real memory  (NZ=none)
  82. ;RBlockSel    DW 0       ;selector of temp work real memory
  83.  
  84.  
  85. ;======================================================================
  86. ;The following are constant variables. They are set at compile time.
  87. ;======================================================================
  88. ;Interface table - these pointers are used to access the routines
  89. DDOVEC    DW _install      ; Driver initialization and installation
  90.     DW _init         ; Initialize device for output
  91.     DW _clear      ; Clear graphics device 
  92.     DW _post      ; Make picture visible. Enable screen.
  93.     DW _move      ; Set Current Drawing Pointer to value.
  94.     DW _draw      ; Draw a line from CP to X,Y coordinates.
  95.     DW _vect      ; Draw a line between given coordinates.
  96.     DW EMULATE      ; _polygon (Draw a polygon.)
  97.     DW EMULATE      ;_bar (Draw a 3D filled bar.)
  98.     DW _patbar      ; Draw a patterned bar.
  99.     DW EMULATE      ;_arc (Draw an elliptical arc.)
  100.     DW EMULATE      ;_pieslice (Draw an elliptical sector.)
  101.     DW EMULATE      ;_filled_ellipse (Draw a filled ellipse.) 
  102.     DW _palette      ; Set a palette entry to a given color.
  103.     DW _allpalette      ; Load the palette with a table of colors.
  104.     DW _color      ; Set Drawing and Fill colors.
  105.     DW _fillstyle      ; Set current fill pattern. 
  106.     DW _linestyle      ; Set current line style. 
  107.     DW _textstyle      ; Set the text font attributes.
  108.     DW _drawtext      ; Draw a string in the current font.
  109.     DW _textsize      ; Calculate string size (in pixels).
  110.     DW RESERVED      ; RESERVED
  111.     DW _floodfill      ; Do a floodfill.
  112.     DW _getpixel      ; Read a pixel from the given coord.
  113.     DW _setpixel      ; Write a pixel to the given coord.
  114.     DW _bitmaputil      ; Return a pointer to misc utilities. 
  115.     DW _savebitmap      ; Save a block of screen to CPU memory.
  116.     DW _restorebitmap ; Restore block of screen from CPU memory.
  117.     DW _setclip      ; Set the clipping window.
  118.     DW _color_query      ; Return device color information
  119.     DW 35 DUP (NONE)  ; Reserved Entry Points
  120.  
  121.  
  122. ;----------------------------------------------------------------------
  123. ;this is the table that the _bitmaputil function points at
  124.  
  125. BitMapTable:    
  126.     DW    bmi_gotographic      ; enter pixel drawing mode
  127.     DW    bmi_exitgraphic   ; leave pixel drawing mode
  128.     DW    bmi_putpixel      ; put a pixel on screen
  129.     DW    bmi_getpixel      ; read a pixel from screen
  130.     DW    bmi_bitsperpixel  ; display memory bits used per pixel
  131.     DW    bmi_setpage      ; draw specified page
  132.     DW    bmi_setvisual      ; select visual display page
  133.     DW    bmi_setwritemode  ; set write mode 
  134.  
  135.  
  136. ;======================================================================
  137.