KIT_PAL.CPP 691 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #include <iostream.h>
  2. #include <stdlib.h>
  3. #include <stdio.h>
  4. #include <graph.h>
  5. #include <i86.h>
  6. #include <dos.h>
  7. #include <conio.h>
  8. #include <float.h>
  9. #include <time.h>
  10. #include <math.h>
  11. #include <string.h>
  12. char *palette_buffer[768];
  13. void main(int argc, char **argv)
  14. {
  15. read_palette()
  16. write_palette()
  17. }
  18. void write_palette()
  19. {
  20. char *filename = "STRIP.BIN";
  21. FILE *fp5=fopen(filename,"wb");
  22. if(fp5!=NULL)
  23. {
  24. fwrite(&palette_buffer+48, sizeof(char), 48, fp5);
  25. fclose(fp5);
  26. }
  27. }
  28. void read_palette()
  29. {
  30. char *filename = "TEMP.BIN";
  31. FILE *fp5=fopen(filename,"rb");
  32. if(fp5!=NULL)
  33. {
  34. fread( &palette_buffer, sizeof(char), 768, fp5);
  35. fclose(fp5);
  36. }
  37. }