-
Notifications
You must be signed in to change notification settings - Fork 1
/
menu_winner_loser_functions.asm
162 lines (131 loc) · 2.75 KB
/
menu_winner_loser_functions.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
%include "data.asm"
%include "imageandvideo.asm"
%macro score 1
pusha
mov ax, %1
mov di, score_n
call tostring
mov si, score_n
popa
%endmacro
end:
call limpaTela
jmp $
menu:
call limpaTela
score 0
mov ah, 0xb
mov bh, 0
mov bl, [preto]
int 10h
print titulo, [verde], 10,0
print play, [cinza], 15, 15
print quit, [cinza], 16, 15
print sobre, [cinza], 28, 0
call getchar
cmp al, 0x08 ;leitura de backspace. Al é registrador padrão de leitura
je end
cmp al, 0x20 ;leitura do valor do espaço
je logo1
jmp menu
reset:
;reseta as string do jogo para tracejado novamente
xor cx, cx
.loopreset1:
cmp byte[di], 8
je .donereset
mov al, '_'
stosb
jmp .loopreset1
.donereset:
ret
loserscreen:
call delay
call limpaTela
mov ah, 0xb
mov bh, 0
mov bl, [preto]
int 10h
print loser, [branco], 10,0
print backtomenu, [verde], 15, 3
print exitgame, [vermelho], 16, 3
print sobre, [cinza], 28, 0
print score, [branco], 19, 3
print score_n, [verde], 19, 9
mov di,mctracejado
call reset
mov di,pepsitracejado
call reset
mov di, linkedintracejado
call reset
mov di, robocintracejado
call reset
mov di, volkstracejado
call reset
mov di, giorgioarmani
call reset
call getchar
cmp al, 0x08 ;leitura de backspace. Al é registrador padrão de leitura
je end
cmp al, 0x20 ;leitura do valor do espaço
je menu
jmp loserscreen
winnerscreen:
call delay
call limpaTela
mov ah, 0xb
mov bh, 0
mov bl, [preto]
int 10h
print winner, [branco], 10,0
print backtomenu, [verde], 15, 3
print exitgame, [vermelho], 16, 3
print sobre, [cinza], 28, 0
print score, [branco], 19, 3
print score_n, [verde], 19, 9
mov di,mctracejado
call reset
mov di,pepsitracejado
call reset
mov di, linkedintracejado
call reset
mov di, robocintracejado
call reset
mov di, volkstracejado
call reset
mov di, giorgioarmani
call reset
call getchar
cmp al, 0x08 ;leitura de backspace. Al é registrador padrão de leitura
je end
cmp al, 0x20 ;leitura do valor do espaço
je menu
jmp winnerscreen
delay:
mov bx, 2000 ;pegado o registrador inteiro
mov cx, 2000
.delayloop:
dec bx
nop
jnz .delayloop
dec cx
jnz .delayloop
ret
limpaTela:
;coloca o cursor na posicao (0,0)
mov dx, 0
mov bh, 0
mov ah, 0x2
int 0x10
;printa 2500 caracteres em branco para limpar os caracteres da tela
mov cx, 2500
mov bh, 0
mov al, 0x20
mov ah, 0x9
int 0x10
;retorna o cursor para a posicao (0,0)
mov dx, 0
mov bh, 0
mov ah, 0x2
int 0x10
ret