home *** CD-ROM | disk | FTP | other *** search
/ MORE WinGames / WINGAMES.iso / chess / winport < prev   
Text File  |  1991-01-21  |  6KB  |  145 lines

  1. Notes on the Windows port of GNUchess.
  2. Daryl Baker
  3. 12/30/90
  4.  
  5. The core algrothms of the program has been preserved intact, however
  6. due to the memory management requirements of Windows significant changes
  7. to the data structure references were made.
  8.  
  9. The program is ported using Microsoft C 6.0a, Windows 3.0 and the Windows
  10. 3.0 Software Developers Kit.  To compile enter "nmake -f chess.mak"
  11.  
  12.  
  13. Source file overview;
  14.  
  15. Windows device independent bitmaps for each piece.
  16.  
  17. Each bitmap consists of an outline (xxxO.bmp), a mask which is
  18. used to clear the space to draw the piece (xxxM.bmp), and the bitmap
  19. for the piece (xxx.bmp).  These are based on the outlines contained
  20. in XCHESS.
  21.  
  22. BISHOP.BMP      KING.BMP        KNIGHT.BMP      QUEEN.BMP
  23. BISHOPM.BMP     KINGM.BMP       KNIGHTM.BMP     QUEENM.BMP
  24. BISHOPO.BMP     KINGO.BMP       KNIGHTO.BMP     QUEENO.BMP
  25.  
  26. PAWN.BMP        ROOK.BMP
  27. PAWNM.BMP       ROOKM.BMP
  28. PAWNO.BMP       ROOKO.BMP
  29.  
  30.  
  31. Chess.def is the liker definition file required for linking windows files
  32.  
  33. Resource File:  The resouce file contains the definitions for the menus
  34. icons, bitmaps, and dialog boxes.
  35.  
  36. CHESS.RC                ;The resource file
  37. CHESS.ICO               ;The program ICON
  38.  
  39. ABOUT.DLG               ;Templates for all dialog boxes
  40. COLOR.DLG     
  41. MANUAL.DLG
  42. GETNUM.DLG      
  43. PROMOTE.DLG      
  44. REVIEW.DLG      
  45. SAVEOPEN.DLG     
  46. STATS.DLG     
  47. TEST.DLG      
  48. TIMECNT.DLG     
  49.  
  50. COLOR.H                 ;Header files to support dialog functions
  51. SAVEOPEN.H        
  52. STATS.H       
  53. TIMECNT.H       
  54.  
  55. ABOUT.C                 ;C source to perform dialog functions
  56. COLOR.C                 ;Adjust the colors
  57. MANUAL.C                ;Prompt the user for a manual entered move
  58. NUMDLG.C                ;Prompt the user to enter a number                                     
  59. PROMOTE.C               ;Give the user a choice of what to promote a pawn to
  60. REVIEW.C                ;Review game moves
  61. SAVEOPEN.C              ;File open/save prompts
  62. STATS.C                 ;Display search/look ahead lines
  63. TEST.C                  ;Test compute speed
  64. TIMECNT.C               ;Select duration of game
  65.  
  66. Header files
  67.  
  68. GNUCHESS.H       
  69. CHESS.H       
  70. DEFS.H                  ;Function prototypes       
  71.  
  72. The source routines gnuchess.c and uxdsp.c have been broken up into
  73. small units (this is mainly to reduce them to smaller sizes to cut
  74. compile time and enable me to get a handle on each module's function)
  75.  
  76. BOOK.C                  ;Opening book routines
  77. DSP.C                   ;Routines from uxdsp.c that do not involve io
  78. EVAL.C                  ;Gnuchess move evaluation routines
  79. GLOBALS.C               ;Definition for all global varibles
  80. INITIALI.C              ;Gnuchess initialization routines
  81. SEARCH.C                ;Gnuchess search engine
  82.  
  83. Windows specifc routines
  84.  
  85. BOARD.C                 ;Routine to draw board
  86. CHESS.C                 ;Main program
  87. CREATE.C                ;Creates all sub-windows used in program
  88. HITTEST.C               ;Handle hit testing the mouse
  89. INIT.C                  ;Windows initializaiton
  90. INITMENU.C              ;Routine to handle state of memu items
  91. MSWDSP.C                ;Windows based IO routines for screen
  92. PIECE.C                 ;Routines to draw pieces
  93.  
  94. MAKEVER.C               ;Utility routine for updating version.h
  95. VERSION.C               ;Contains version number
  96.  
  97. Overview of modifications:
  98.  
  99. The routine main has been renamed to init_main in file initiali.c.  The
  100. first order of business was to move all "large" static data structures to 
  101. be dynamicly allocated. 
  102.  
  103. The following varibles were moved:
  104.         history, nextdir, nextpos, distdata, taxidata, hashcode, Tree,
  105.         GameList, ttable
  106.  
  107. In all routines that access these varibles the array references were changed
  108. to be consistant with a pointer representation.  In violation of good
  109. Windows programming these structures are "LOCKED".  This is only a penalty
  110. in real mode, in standard and 386 enhanced windows can move locked segments 
  111. without affecting references.
  112.  
  113. Also many of the static read-only data structures were moved to be "based"
  114. in the code segment.  (as opposed to user definded resources).  This saves
  115. space in the local heap and since the code segments can be moved this creates
  116. a relocatable data structure. A sample:
  117.  
  118.         static short _based(_segname("_CODE")) KingOpening[64] = {....};
  119.  
  120.  
  121. Openning book.
  122.  
  123. All opening book routines are contained in the file book.c.  The opening
  124. book would not fit into the local heap.  A 32 Kbyte array is allocated
  125. from the dynamic heap.  This array is used to construct a mini-heap to
  126. load the openning book into.  If the openning book grows much more this
  127. routine will need to be adjusted.  Routines were added to "free" the
  128. book when it is no longer needed.  Also all routines that used the book
  129. were fixed to eliminate book=NULL.  These routines now call Free_book first.
  130.  
  131. Help File
  132.  
  133. The source files for the help file is stored in several files.  The DOC
  134. files were created with Word for Windows.  The RTF files are created from
  135. the DOC files with a Save As.
  136.  
  137. CHESS.DOC       ---> CHESS.RTF          ;Main help file
  138. ARTICLE.DOC     ---> ARTICLE.RTF        ;An article by Stuart Cracraft on GNU chess
  139. ARTICLE2.DOC    ---> ARTICLE2.RTF       ;Another article
  140. COPYRIGHT.DOC   ---> COPYRIGHT.RTF      ;GNU Chess Copyright notice
  141. MOVE-GEN.DOC    ---> MOVE-GEN.RTF       ;An article about GNU Chess move generator
  142. HEURISTI.DOC    ---> HEURISTI.RTF       ;Article about GNU Chess heuristics
  143. MATCH.DOC       ---> MATCH.RTF          ;Games against MACH.
  144.  
  145.