-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path2ascii.h
130 lines (123 loc) · 2.81 KB
/
2ascii.h
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
/*
KtrAscii from Ktr.h
Ktr.h Copyright (c) 2003 Ktr & Dada66
www.ktr.fr.fm
*/
void DrawSprite(short x,short y,char* sprite,unsigned char mask,unsigned char height, short SEG1)
{
asm{
mov cx, x;
and cl, 0x7;
mov si, 0x3FF;
sub si, y;
and x, 0xFFF8;
shl x, 0x3;
sub si, x;
mov es, SEG1;
mov dh, mask;
xor dl, dl;
shr dx, cl;
xor dx, 0xFFFF;
mov di, sprite;
mov al, height;}
boucle:
asm{ mov bl, ds:[di];
shl bx, 0x8;
inc di;
dec al;
shr bx, cl;
and es:[si], dh;
or es:[si], bh;
}
if(_SI > 63)
{
asm push si;
asm sub si, 0x40;
asm and es:[si], dl;
asm or es:[si], bl;
asm pop si;
}
asm dec si;
asm cmp al, 0;
asm jne boucle;
}
unsigned char ktrascii[][5] =
{ 0, 0, 0, 0, 0,
64, 64, 64, 0, 64,
160,160, 0, 0, 0,
160,224,160,224,160,
224,192,224, 96,224,
128, 32, 64,128, 32,
64,160, 96,160, 96,
192,192, 0, 0, 0,
32, 64, 64, 64, 32,
128, 64, 64, 64,128,
224,224,224,224,224,
0, 64,224, 64, 0,
0, 0, 0, 64,128,
0, 0,224, 0, 0,
0, 0, 0, 0,128,
32, 64, 64, 64,128,
224,160,160,160,224,
64,192, 64, 64,224,
224, 32,224,128,224,
224, 32,224, 32,224,
160,160,224, 32, 32,
224,128,224, 32,224,
224,128,224,160,224,
224,160, 32, 32, 32,
224,160,224,160,224,
224,160,224, 32,224,
0, 64, 0, 64, 0,
0, 64, 0, 64,128,
32, 96,224, 96, 32,
0,224, 0,224, 0,
128,192,224,192,128,
64,160, 32, 64, 64,
224, 32,224,160,224,
64,160,160,224,160,
192,160,192,160,192,
96,128,128,128, 96,
192,160,160,160, 192,
224,128,192,128,224,
224,128,192,128,128,
96,128,160,160, 96,
160,160,224,160,160,
224, 64, 64, 64,224,
224, 32, 32,160,224,
160,192,128,192,160,
128,128,128,128,224,
160,224,160,160,160,
160,224,224,160,160,
64,160,160,160, 64,
192,160,192,128,128,
64,160,160, 64, 32,
192,160,192,192,160,
224,128,224, 32,224,
224, 64, 64, 64, 64,
160,160,160,160,224,
160,160,160,160, 64,
160,160,160,224,160,
160,160, 64,160,160,
160,160, 64, 64,128,
224, 32, 64,128,224,
192,128,128,128,192,
128, 64, 64, 64, 32,
96, 32, 32, 32, 96,
64,160, 0, 0, 0,
0, 0, 0, 0,224,
128, 64, 0, 0, 0,
0, 64,160, 0, 0,
0, 0,160, 64, 0};
/*affiche une police (KTR)*/
void putchar3(unsigned char x, unsigned char y, unsigned char lettre)
{
lettre -= 32;
DrawSprite(x, y, ktrascii[lettre], 224, 5,0x1a60);
}
void print3(unsigned char x, unsigned char y, unsigned char string[])
{int i;
for(i = 0 ; string[i] != 0 ; i++) putchar3(x + 4*i+10, y, string[i]);
}
void printline(int line,char * string){
print3(0,line*6+8,string);}