-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCUTSPR.CPP
59 lines (47 loc) · 1.01 KB
/
CUTSPR.CPP
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#include <conio.h>
#include <io.h>
#include <stdlib.h>
#include <fcntl.h>
#include <ctype.h>
#include <bios.h>
#include <assert.h>
#include <dos.h>
#include <mem.h>
#include "famegraf.h"
#include "mouse.h"
Mouse m;
block sprbuf;
void ReadData(char *data_name,block dest,unsigned long n) {
int fdz;
if ( (fdz=open (data_name,O_BINARY | O_RDONLY)) < 0) exit (1);
if ((int)read (fdz, dest, n) == -1 ) exit (1);
close (fdz);
}
void main(void) {
int x,y;
SetLib("tmp");
InitSpr(); //¨¨æ¨ «¨§¨à㥬 á¯à ©âë
InitGraph();
Vga256();
ReadData("aatemp.pic",(block)SpritesScreen,(unsigned long)320*200);
CopyToScreen(SpritesScreen);
NormalScreen();
sprbuf=(block)SpritesScreen;
for ( y=0; y<12; ++y ) {
for ( x=0; x<16; ++x ) {
GetImg(x*16,y*16,16,16,sprbuf);
sprbuf+=256;
Bar(x*16,y*16,16,16);
}
}
PutLib("__fon.bin",(block)SpritesScreen,(unsigned long)16*16*16*12);
textmode(C80);
SetLib("");
return;
}
void fatalerror(char *t) {
//¢ë室 ¯® ä ⠫쮩 ®è¨¡ª¥
SetLib("");
puts(t);
exit(1);
}