home *** CD-ROM | disk | FTP | other *** search
/ Freelog 8 / Freelog008.iso / Prog / VGA.H < prev   
C/C++ Source or Header  |  2000-02-06  |  2KB  |  80 lines

  1. //En-tete realise par WALTER & PATRICE / wiSdom
  2.  
  3. /* ----------------INCLUSION DES BIBLIOTHEQUES ------------- */
  4.  
  5. #ifndef vga_head
  6. #define vga_head
  7.  
  8. #include <stdio.h>
  9. #include <stdlib.h>
  10. #include <dos.h>
  11. #include <io.h>
  12. #include <fcntl.h>
  13. #include <sys\stat.h>
  14.  
  15. /* ---------------- DECLARATION DES CONSTANTES ------------- */
  16.  
  17. #define MAXX 320   //Largeur de l'ecran
  18. #define MAXY 200   //Hauteur de l'ecran
  19. #define OX 160     //Abscisse du centre de l'ecran
  20. #define OY 100     //Ordonnee du centre de l'ecran
  21.  
  22. /* ------------------ DECLARATION DES MACROS --------------- */
  23.  
  24. #define VBL asm         \
  25.                 {               \
  26.                     mov dx,0x3da; \
  27.                     in al,dx;     \
  28.                     test al,8;    \
  29.                     jz $-3        \
  30.                 }
  31. //Role : Attend un retour vertical du balayage ecran (Vertical BLank)
  32.  
  33. #define HBL asm         \
  34.                 {               \
  35.                     mov dx,0x3da; \
  36.                     in al,dx;     \
  37.                     test al,1;    \
  38.                     jz $-3        \
  39.                 }
  40. //Role : Attend un retour horizontal du balayage ecran (Horizontal BLank)
  41.  
  42. /* ------------------REDEFINITION DES TYPES ---------------- */
  43.  
  44. typedef unsigned char byte;
  45. typedef unsigned short word;
  46. typedef unsigned long dword;
  47. typedef unsigned char far bytef;
  48. typedef unsigned short far wordf;
  49. typedef unsigned long far dwordf;
  50.  
  51. /* ----------------DECLARATION DES PROTOTYPES -------------- */
  52.  
  53. void InitVGA(void);
  54. //Role : initialise le mode VGA standard 320x200x256
  55.  
  56. void InitTexte(void);
  57. //Role : initialise le mode texte 80x25
  58.  
  59. byte LoadPCX(char *path,bytef *scr,byte *pal);
  60. //Role   : charge une image PCX (compression RLE) , 320x200x256
  61. //Entree : chemin, page, palette
  62. //Sortie : 0 (echec) ou 1 (succes)
  63.  
  64. void SetAllPal(byte *pal);
  65. //Role   : initialise toute la palette de couleurs internes
  66. //Entree : palette
  67.  
  68.  
  69. void CpyBlk2(short xs,short ys,word l,word h,short xd,short yd,bytef *src,bytef *dst);
  70. //Role   : copie un bloc (mot par mot)
  71. //Entree : x source, y source, largeur multiple de 2, hauteur, x destination,
  72. //         y destination, page source, page destination
  73.  
  74. void CpyBnd(short ys,word h,short yd,bytef *src,bytef *dst);
  75. //Role   : copie une bande de 320 pixels
  76. //Entree : y source, hauteur, y destination, page source, page destination
  77.  
  78. void read_buf_pcx(int handle,byte *tampon,word *comp);
  79. #endif //vga_head
  80.