source: abuse/trunk/src/remap.cpp @ 97

Last change on this file since 97 was 56, checked in by Sam Hocevar, 11 years ago
  • Add licensing terms to most C / C++ files (Ref #5).
File size: 936 bytes
Line 
1/*
2 *  Abuse - dark 2D side-scrolling platform game
3 *  Copyright (c) 1995 Crack dot Com
4 *
5 *  This software was released into the Public Domain. As with most public
6 *  domain software, no warranty is made or implied by Crack dot Com or
7 *  Jonathan Clark.
8 */
9
10#include "config.h"
11
12#include <stdio.h>
13#include <stdlib.h>
14
15extern "C" {
16void remap_line_asm(void *scr, void *remap, void *seq, int seqlen);
17}
18
19main()
20{
21    unsigned char *s = (unsigned char *) malloc(320*200);
22    unsigned char *r, *seq;
23    int i,j;
24
25    r = (unsigned char *) malloc(256*256*2);
26    r = (unsigned char *) (((unsigned) r + (256*256-1)) & ~(256*256-1));
27    seq = (unsigned char *) malloc(40);
28
29    for (j=0 ; j<64 ; j++)
30        for (i=0 ; i<256; i++)
31            r[j*256+i] = i+j;
32    for (i=0 ; i<320*200 ; i++) s[i] = i&0xff;
33    for (i=0 ; i<40 ; i++) seq[i] = i;
34
35    for (j=0 ; j<200 ; j++)
36                remap_line_asm(s+j*320, r, seq, 40);
37}
38
Note: See TracBrowser for help on using the repository browser.