source: abuse/tags/pd/abuse/src/remap.c @ 49

Last change on this file since 49 was 49, checked in by Sam Hocevar, 11 years ago
  • Imported original public domain release, for future reference.
  • Property svn:keywords set to Id
File size: 639 bytes
Line 
1#include <stdio.h>
2
3#include <stdlib.h>
4
5
6
7extern "C" {
8
9void remap_line_asm(void *scr, void *remap, void *seq, int seqlen);
10
11}
12
13
14
15main()
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
Note: See TracBrowser for help on using the repository browser.