home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / pc / ABUSESRC.ZIP / AbuseSrc / macabuse / src / remap.c < prev    next >
Encoding:
C/C++ Source or Header  |  1997-05-20  |  699 b   |  61 lines

  1. #include <stdio.h>
  2.  
  3. #include <stdlib.h>
  4.  
  5.  
  6.  
  7. extern "C" {
  8.  
  9. void remap_line_asm(void *scr, void *remap, void *seq, int seqlen);
  10.  
  11. }
  12.  
  13.  
  14.  
  15. main()
  16.  
  17. {
  18.  
  19.  
  20.  
  21.     unsigned char *s = (unsigned char *) malloc(320*200);
  22.  
  23.     unsigned char *r, *seq;
  24.  
  25.     int i,j;
  26.  
  27.  
  28.  
  29.     r = (unsigned char *) malloc(256*256*2);
  30.  
  31.     r = (unsigned char *) (((unsigned) r + (256*256-1)) & ~(256*256-1));
  32.  
  33.     seq = (unsigned char *) malloc(40);
  34.  
  35.  
  36.  
  37.     for (j=0 ; j<64 ; j++)
  38.  
  39.         for (i=0 ; i<256; i++)
  40.  
  41.             r[j*256+i] = i+j;
  42.  
  43.     for (i=0 ; i<320*200 ; i++) s[i] = i&0xff;
  44.  
  45.     for (i=0 ; i<40 ; i++) seq[i] = i;
  46.  
  47.  
  48.  
  49.     for (j=0 ; j<200 ; j++)
  50.  
  51.                 remap_line_asm(s+j*320, r, seq, 40);
  52.  
  53.  
  54.  
  55.  
  56.  
  57. }
  58.  
  59.  
  60.  
  61.