-
Notifications
You must be signed in to change notification settings - Fork 0
/
mapping.asm
172 lines (147 loc) · 1.46 KB
/
mapping.asm
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
.code
pixalize proc
xor ax,ax
mov al,8
mul si
mov cx,ax
xor ax,ax
mov al,4
mul di
mov dx,ax
ret
pixalize endp
shwMap proc
mov di,0
LP1:
mov si,0
LP2:
mov bx,di
mov ax,40
mul bx
mov bx,ax
mov al,map[si][bx]
mov ah,0
cmp al,0
je BLANK
cmp al,1
je TILE
cmp al,2
je BAR
cmp al,3
je BALL
FIN:
inc si
cmp si,40
jne LP2
inc di
cmp di,50
jne LP1
jmp EXIT
TILE:
mov [WIN_FLAG],0
call pixalize
call drwTile
jmp FIN
BAR:
call pixalize
call drwBar
jmp FIN
BALL:
call pixalize
call drwBall
jmp FIN
BLANK:
call pixalize
call drwBlank
jmp FIN
EXIT:
ret
shwMap endp
drwTile proc
mov ah,0ch
mov bl,3
mov al,2
inc cx
inc dx
LP1:
mov bh,7
LP2:
int 10h
inc cx
dec bh
jnz LP2
inc dx
sub cx,7
dec bl
jnz LP1
ret
drwTile endp
drwBlank proc
mov ah,0ch
mov bl,4
mov al,0
LP1:
mov bh,8
LP2:
int 10h
inc cx
dec bh
jnz LP2
inc dx
sub cx,8
dec bl
jnz LP1
ret
drwBlank endp
drwBall proc
mov ah,0ch
mov al,3
add cx,2
mov bl,4
LP1:
int 10h
inc cx
dec bl
jnz LP1
inc dx
int 10h
mov bl,5
LP2:
dec cx
int 10h
dec bl
jnz LP2
inc dx
mov bl,6
LP3:
int 10h
inc cx
dec bl
jnz LP3
sub cx,5
inc dx
mov bl,4
LP4:
int 10h
inc cx
dec bl
jnz LP4
ret
drwBall endp
drwBar proc
mov ah,0ch
mov al,1
mov bl,2
LP1:
mov bh,8
LP2:
int 10h
inc cx
dec bh
jnz LP2
inc dx
sub cx,8
dec bl
jnz LP1
ret
drwBar endp