-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.c
70 lines (56 loc) · 999 Bytes
/
main.c
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
#include "graphics.h"
#include "bmpdata.h"
#include "music.h"
/* Return last key in input buffer, return 0 if buffer empty */
extern int get_key(void);
#pragma aux get_key = \
"xor bx,bx" \
"mov ah,0x01" \
"int 0x16" \
"je donzo" \
"more_key:" \
"xor ah,ah" \
"int 0x16" \
"mov bx,ax" \
"mov ah,0x01" \
"int 0x16" \
"jne more_key" \
"donzo:" \
"mov ax,bx" \
value [ ax ] \
modify [ bx ];
/* Put one character on screen */
extern void eputc(char c);
#pragma aux eputc = \
"mov ah, 06h" \
"int 21h" \
parm [ dl ] \
modify [ ax ];
void eputs(const char* str)
{
while(*str) {
eputc(*str);
str++;
};
}
int main() {
int key, frame;
set_cga();
draw_bmp();
music_select(0);
frame=0;
get_key(); /* Make sure buffer is empty */
while(1) {
wait_vsync();
if (frame>80)
music_process();
key = get_key();
if (key == 0x011B)
break;
frame++;
}
music_pause();
reset_display();
eputs ("Snigelson March 2020");
return 0;
}